Skip to main content

Module headers

Module headers 

Source
Expand description

QUIC packet header structures (RFC 9000 Section 17).

QUIC supports two header forms:

  • Long Header (bit 7 = 1): used for Initial, 0-RTT, Handshake, Retry, and Version Negotiation packets.
  • Short Header (bit 7 = 0): used for 1-RTT (data) packets after the handshake.

Long Header format (RFC 9000 Section 17.2):

 Byte 0:  | Header Form (1) | Fixed Bit (1) | Long Packet Type (2) | Type-Specific (4) |
 Bytes 1-4: Version (big-endian u32)
 Byte 5:  Destination Connection ID Length
 N bytes: Destination Connection ID
 Byte:    Source Connection ID Length
 M bytes: Source Connection ID
 (type-specific fields follow)

Version Negotiation packets have bit 6 = 0 (Fixed Bit cleared). All other long-header packets have bit 6 = 1.

Structs§

QuicLongHeader
Parsed QUIC Long Header.
QuicShortHeader
Parsed QUIC Short Header (1-RTT).

Enums§

QuicPacketType
QUIC packet type, derived from the first byte (and version field for Version Negotiation).

Functions§

packet_type
Determine the QUIC packet type from the first byte.