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

Integers #877

Merged
merged 11 commits into from Oct 30, 2017
43 changes: 34 additions & 9 deletions draft-ietf-quic-transport.md
Expand Up @@ -2069,9 +2069,10 @@ The frame is as follows:
The fields in the MAX_STREAM_ID frame are as follows:

Maximum Stream ID:

: ID of the maximum peer-initiated stream ID for the connection encoded as a
variable-length integer.
: ID of the maximum unidirectional or bidirectional peer-initiated stream ID for
the connection encoded as a variable-length integer. The limit applies to
unidirectional steams if the second least signification bit of the stream ID
is 1, and applies to bidirectional streams if it is 0.

Loss or reordering can mean that a MAX_STREAM_ID frame can be received which
states a lower stream limit than the client has previously received.
Expand Down Expand Up @@ -2738,12 +2739,36 @@ for some applications.
## Stream Identifiers {#stream-id}

Streams are identified by an unsigned 62-bit integer, referred to as the Stream
ID. To avoid Stream ID collision, clients MUST initiate streams using
odd-numbered Stream IDs; servers MUST initiate streams using even-numbered
Stream IDs. If an endpoint receives a frame which corresponds to a stream which
is allocated to it (i.e., odd-numbered for the client or even-numbered for the
server) but which it has not yet created, it MUST close the connection with
error code STREAM_STATE_ERROR.
ID. The least significant two bits of the Stream ID are used to identify the
type of stream (unidirectional or bidirectional) and the initiator of the
stream.

The least significant bit (0x1) of the Stream ID identifies the initiator of the
stream. Clients initiate even-numbered streams (those with the least
significant bit set to 0); servers initiate even-numbered streams (with the bit
set to 1). Separation of the stream identifiers ensures that client and server
are able to open streams without the latency imposed by negotiating for an
identifier.

If an endpoint receives a frame for a stream that it expects to initiate (i.e.,
odd-numbered for the client or even-numbered for the server), but which it has
not yet opened, it MUST close the connection with error code STREAM_STATE_ERROR.

The second least significant bit (0x2) of the Stream ID differentiates between
unidirectional streams and bidirectional streams. Unidirectional streams always
have this bit set to 1 and bidirectional streams have this bit set to 0.

The two type bits from a Stream ID therefore identify streams as summarized in
{{stream-id-types}}.

| Low Bits | Stream Type |
|:---------|:---------------------------------|
| 0x0 | Client-Initiated, Bidirectional |
| 0x1 | Server-Initiated, Bidirectional |
| 0x2 | Client-Initiated, Unidirectional |
| 0x3 | Server-Initiated, Unidirectional |
{: #stream-id-types title="Stream ID Types"}
>>>>>>> origin/master

Stream ID 0 (0x0) is a client-initiated, bidirectional stream that is used for
the cryptographic handshake. Stream 0 MUST NOT be used for application data.
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.