target = "https://www.rfc-editor.org/rfc/rfc9000#section-17.3.1" # 17.3.1. 1-RTT Packet # # A 1-RTT packet uses a short packet header. It is used after the # version and 1-RTT keys are negotiated. # # 1-RTT Packet { # Header Form (1) = 0, # Fixed Bit (1) = 1, # Spin Bit (1), # Reserved Bits (2), # Key Phase (1), # Packet Number Length (2), # Destination Connection ID (0..160), # Packet Number (8..32), # Packet Payload (8..), # } # # Figure 19: 1-RTT Packet # # 1-RTT packets contain the following fields: # # Header Form: The most significant bit (0x80) of byte 0 is set to 0 # for the short header. # # Fixed Bit: The next bit (0x40) of byte 0 is set to 1. Packets # containing a zero value for this bit are not valid packets in this # version and MUST be discarded. A value of 1 for this bit allows # QUIC to coexist with other protocols; see [RFC7983]. # # Spin Bit: The third most significant bit (0x20) of byte 0 is the # latency spin bit, set as described in Section 17.4. # # Reserved Bits: The next two bits (those with a mask of 0x18) of byte # 0 are reserved. These bits are protected using header protection; # see Section 5.4 of [QUIC-TLS]. The value included prior to # protection MUST be set to 0. An endpoint MUST treat receipt of a # packet that has a non-zero value for these bits, after removing # both packet and header protection, as a connection error of type # PROTOCOL_VIOLATION. Discarding such a packet after only removing # header protection can expose the endpoint to attacks; see # Section 9.5 of [QUIC-TLS]. # # Key Phase: The next bit (0x04) of byte 0 indicates the key phase, # which allows a recipient of a packet to identify the packet # protection keys that are used to protect the packet. See # [QUIC-TLS] for details. This bit is protected using header # protection; see Section 5.4 of [QUIC-TLS]. # # Packet Number Length: The least significant two bits (those with a # mask of 0x03) of byte 0 contain the length of the Packet Number # field, encoded as an unsigned two-bit integer that is one less # than the length of the Packet Number field in bytes. That is, the # length of the Packet Number field is the value of this field plus # one. These bits are protected using header protection; see # Section 5.4 of [QUIC-TLS]. # # Destination Connection ID: The Destination Connection ID is a # connection ID that is chosen by the intended recipient of the # packet. See Section 5.1 for more details. # # Packet Number: The Packet Number field is 1 to 4 bytes long. The # packet number is protected using header protection; see # Section 5.4 of [QUIC-TLS]. The length of the Packet Number field # is encoded in Packet Number Length field. See Section 17.1 for # details. # # Packet Payload: 1-RTT packets always include a 1-RTT protected # payload. # # The header form bit and the Destination Connection ID field of a # short header packet are version independent. The remaining fields # are specific to the selected QUIC version. See [QUIC-INVARIANTS] for # details on how packets from different versions of QUIC are # interpreted. [[spec]] level = "MUST" quote = ''' Packets containing a zero value for this bit are not valid packets in this version and MUST be discarded. ''' [[spec]] level = "MUST" quote = ''' The value included prior to protection MUST be set to 0. ''' [[spec]] level = "MUST" quote = ''' An endpoint MUST treat receipt of a packet that has a non-zero value for these bits, after removing both packet and header protection, as a connection error of type PROTOCOL_VIOLATION. '''