QUIC peers exchange transport parameters during the TLS handshake
(carried in the TLS extension quic_transport_parameters,
codepoint 0x39). Each parameter is encoded as
varint(id) || varint(length) || bytes[length]; the codec is
fully self-describing so unknown parameters are silently ignored
(RFC 9000 §7.4.2 -- forward compatibility).
Public surface:
- :class:
TransportParameters -- typed carrier for the v1
parameter set with sensible defaults from §18.2.
- :func:
encode_transport_parameters -- serialise a populated
:class:TransportParameters into a byte list. Unset parameters
whose default is the wire absence are not emitted; explicitly
set parameters always are.
- :func:
decode_transport_parameters -- parse a byte buffer into
a :class:TransportParameters; unknown ids are dropped on the
floor per RFC.
Parameter ids covered (RFC 9000 §18.2 + RFC 9221 §3 for datagram):
- 0x00 original_destination_connection_id (server only)
- 0x01 max_idle_timeout (ms; 0 means no timeout)
- 0x02 stateless_reset_token (server only; 16 bytes)
- 0x03 max_udp_payload_size (default 65527)
- 0x04 initial_max_data
- 0x05 initial_max_stream_data_bidi_local
- 0x06 initial_max_stream_data_bidi_remote
- 0x07 initial_max_stream_data_uni
- 0x08 initial_max_streams_bidi
- 0x09 initial_max_streams_uni
- 0x0a ack_delay_exponent (default 3)
- 0x0b max_ack_delay (default 25 ms)
- 0x0c disable_active_migration (flag, zero-length value)
- 0x0d preferred_address (layout validated, value not kept)
- 0x0e active_connection_id_limit (default 2; minimum 2)
- 0x0f initial_source_connection_id
- 0x10 retry_source_connection_id (server only)
- 0x20 max_datagram_frame_size (RFC 9221 §3; enables DATAGRAM)
The 0x0d preferred_address parameter carries a peer's preferred
IP/port for migration, which flare does not use: decode checks its
fixed layout (RFC 9000 §18.2: 4 + 2 + 16 + 2 bytes, a CID length of
1..20, the CID, a 16-byte reset token) and raises on a violation, but
does not store the value.
Sans-I/O contract: zero I/O imports; registered in
tests/tools/check_sans_io.sh so the contract is lint-enforced.
References:
- RFC 9000 §18 "Transport Parameter Encoding".
- RFC 9000 §7.4.2 "New Transport Parameters" (forward-compat).
- aioquic
packet.PullQuicTransportParameters (Python ref).
Aliases
comptime TP_ID_ORIGINAL_DCID = Int(0)
comptime TP_ID_MAX_IDLE_TIMEOUT = Int(1)
comptime TP_ID_STATELESS_RESET_TOKEN = Int(2)
comptime TP_ID_MAX_UDP_PAYLOAD_SIZE = Int(3)
comptime TP_ID_INITIAL_MAX_DATA = Int(4)
comptime TP_ID_INITIAL_MAX_STREAM_DATA_BIDI_LOCAL = Int(5)
comptime TP_ID_INITIAL_MAX_STREAM_DATA_BIDI_REMOTE = Int(6)
comptime TP_ID_INITIAL_MAX_STREAM_DATA_UNI = Int(7)
comptime TP_ID_INITIAL_MAX_STREAMS_BIDI = Int(8)
comptime TP_ID_INITIAL_MAX_STREAMS_UNI = Int(9)
comptime TP_ID_ACK_DELAY_EXPONENT = Int(10)
comptime TP_ID_MAX_ACK_DELAY = Int(11)
comptime TP_ID_DISABLE_ACTIVE_MIGRATION = Int(12)
comptime TP_ID_PREFERRED_ADDRESS = Int(13)
comptime TP_ID_ACTIVE_CONNECTION_ID_LIMIT = Int(14)
comptime TP_ID_INITIAL_SCID = Int(15)
comptime TP_ID_RETRY_SCID = Int(16)
comptime TP_ID_MAX_DATAGRAM_FRAME_SIZE = Int(32)
RFC 9221 §3: max DATAGRAM frame size the endpoint will accept. Absent or 0 means the peer MUST NOT send DATAGRAM frames.
comptime TP_ID_MIN_ACK_DELAY = Int(4278509083)
The draft-ietf-quic-ack-frequency minimum: the smallest ACK delay (microseconds) the endpoint can honour; present means it accepts ACK_FREQUENCY.
comptime DEFAULT_MAX_UDP_PAYLOAD_SIZE = UInt64(65527)
comptime DEFAULT_ACK_DELAY_EXPONENT = UInt64(3)
comptime DEFAULT_MAX_ACK_DELAY = UInt64(25)
comptime DEFAULT_ACTIVE_CONNECTION_ID_LIMIT = UInt64(2)