target = "https://www.rfc-editor.org/rfc/rfc9000#section-2.1" # 2.1. Stream Types and Identifiers # # Streams can be unidirectional or bidirectional. Unidirectional # streams carry data in one direction: from the initiator of the stream # to its peer. Bidirectional streams allow for data to be sent in both # directions. # # Streams are identified within a connection by a numeric value, # referred to as the stream ID. A stream ID is a 62-bit integer (0 to # 2^62-1) that is unique for all streams on a connection. Stream IDs # are encoded as variable-length integers; see Section 16. A QUIC # endpoint MUST NOT reuse a stream ID within a connection. # # The least significant bit (0x01) of the stream ID identifies the # initiator of the stream. Client-initiated streams have even-numbered # stream IDs (with the bit set to 0), and server-initiated streams have # odd-numbered stream IDs (with the bit set to 1). # # The second least significant bit (0x02) of the stream ID # distinguishes between bidirectional streams (with the bit set to 0) # and unidirectional streams (with the bit set to 1). # # The two least significant bits from a stream ID therefore identify a # stream as one of four types, as summarized in Table 1. # # +======+==================================+ # | Bits | Stream Type | # +======+==================================+ # | 0x00 | Client-Initiated, Bidirectional | # +------+----------------------------------+ # | 0x01 | Server-Initiated, Bidirectional | # +------+----------------------------------+ # | 0x02 | Client-Initiated, Unidirectional | # +------+----------------------------------+ # | 0x03 | Server-Initiated, Unidirectional | # +------+----------------------------------+ # # Table 1: Stream ID Types # # The stream space for each type begins at the minimum value (0x00 # through 0x03, respectively); successive streams of each type are # created with numerically increasing stream IDs. A stream ID that is # used out of order results in all streams of that type with lower- # numbered stream IDs also being opened. [[spec]] level = "MUST" quote = ''' A QUIC endpoint MUST NOT reuse a stream ID within a connection. '''