Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make error codes smaller #851

Merged
merged 2 commits into from Oct 12, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions draft-ietf-quic-http.md
Expand Up @@ -1277,7 +1277,7 @@ The entries in the following table are registered by this document.
## Error Codes {#iana-error-codes}

This document establishes a registry for HTTP/QUIC error codes. The
"HTTP/QUIC Error Code" registry manages a 32-bit space. The "HTTP/QUIC
"HTTP/QUIC Error Code" registry manages a 16-bit space. The "HTTP/QUIC
Error Code" registry operates under the "Expert Review" policy
{{?RFC5226}}.

Expand All @@ -1292,7 +1292,7 @@ Name:
: A name for the error code. Specifying an error code name is optional.

Code:
: The 32-bit error code value.
: The 16-bit error code value.

Description:
: A brief description of the error code semantics, longer if no detailed
Expand Down
35 changes: 18 additions & 17 deletions draft-ietf-quic-transport.md
Expand Up @@ -1681,7 +1681,7 @@ The RST_STREAM frame is as follows:
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Stream ID (32) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Application Protocol Error Code (32) |
| Application Error Code (16) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
+ Final Offset (64) +
Expand All @@ -1697,7 +1697,7 @@ Stream ID:

Application Protocol Error Code:

: A 32-bit application protocol error code (see {{app-error-codes}}) which
: A 16-bit application protocol error code (see {{app-error-codes}}) which
indicates why the stream is being closed.

Final Offset:
Expand All @@ -1721,17 +1721,17 @@ The CONNECTION_CLOSE frame is as follows:
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Error Code (32) |
| Error Code (16) | Reason Phrase Length (16) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Reason Phrase Length (16) | [Reason Phrase (*)] ...
| Reason Phrase (*) ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
~~~

The fields of a CONNECTION_CLOSE frame are as follows:

Error Code:

: A 32-bit error code which indicates the reason for closing this connection.
: A 16-bit error code which indicates the reason for closing this connection.
CONNECTION_CLOSE uses codes from the space defined in {{error-codes}}
(APPLICATION_CLOSE uses codes from the application protocol error code space,
see {{app-error-codes}}).
Expand Down Expand Up @@ -2003,8 +2003,8 @@ The STOP_SENDING frame is as follows:
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Stream ID (32) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Application Error Code (32) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Application Error Code (16) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
~~~

The fields are:
Expand All @@ -2015,7 +2015,7 @@ Stream ID:

Application Error Code:

: A 32-bit, application-specified reason the sender is ignoring the stream (see
: A 16-bit, application-specified reason the sender is ignoring the stream (see
{{app-error-codes}}).


Expand Down Expand Up @@ -3025,7 +3025,7 @@ consistent state between endpoints.

## Transport Error Codes {#error-codes}

Transport error codes are 32 bits long.
QUIC error codes are 16-bit unsigned integers.

This section lists the defined QUIC transport error codes that may be used in a
CONNECTION_CLOSE frame. These errors apply to the entire connection.
Expand Down Expand Up @@ -3099,10 +3099,11 @@ See {{iana-error-codes}} for details of registering new error codes.

## Application Protocol Error Codes {#app-error-codes}

Application protocol error codes are 32-bits long, but the management of
application error codes are left to application protocols. Application protocol
error codes are used for the RST_STREAM ({{frame-rst-stream}}) and
APPLICATION_CLOSE ({{frame-application-close}}) frames.
Application protocol error codes are 16-bit unsigned integers, but the
management of application error codes are left to application protocols.
Application protocol error codes are used for the RST_STREAM
({{frame-rst-stream}}) and APPLICATION_CLOSE ({{frame-application-close}})
frames.

There is no restriction on the use of the 16-bit error code space for
application protocols. However, QUIC reserves the error code with a value of 0
Expand Down Expand Up @@ -3247,7 +3248,7 @@ The initial contents of this registry are shown in {{iana-tp-table}}.
IANA \[SHALL add/has added] a registry for "QUIC Transport Error Codes" under a
"QUIC Protocol" heading.

The "QUIC Transport Error Codes" registry governs a 32-bit space. This space is
The "QUIC Transport Error Codes" registry governs a 16-bit space. This space is
split into two spaces that are governed by different policies. Values with the
first byte in the range 0x00 to 0xfe (in hexadecimal) are assigned via the
Specification Required policy {{!RFC5226}}. Values with the first byte 0xff are
Expand All @@ -3257,8 +3258,8 @@ Registrations MUST include the following fields:

Value:

: The numeric value of the assignment (registrations will be between 0x00000000
and 0xfeffffff).
: The numeric value of the assignment (registrations will be between 0x0000 and
0xfeff).

Code:

Expand All @@ -3275,7 +3276,7 @@ Specification:

The initial contents of this registry are shown in {{iana-error-table}}. Note
that FRAME_ERROR takes the range from 0x100 to 0x1FF and private use occupies
the range from 0XFE000000 to 0XFFFFFFFF.
the range from 0xFE00 to 0xFFFF.

| Value | Error | Description | Specification |
|:------------|:--------------------------|:------------------------------|:----------------|
Expand Down