tto / docs / quic / quic a udp-based multiplexed secure transport protocol

TCP vs QUIC

TCP requires 3 way handshake that can’t transmit data.

TLS over TCP requires 3 way handshake and TLS handshake, leads to 2 round-trips.

TLS 1.3 improves that with 0-RTT if keys were previously negotiated, still requires TCP handshake though. This uses early_data extension. Lifetime is defined in the TLS session ticket. TCP fast open (TFO) would allow sending data with SYN packet in successive sessions however, browsers don’t implement it.

Think of QUIC as a transport protocol (for http/3, smb, others…). It uses UDP because there are only two options for new protocols: TCP and UDP. Anything else won’t be allowed by firewalls.

Decrypt TLS with Wireshark

Used to require SSLKEYLOGFILE env variable, but can be enabled from Wireshark, Tools, Key Log Launcher. Set log file path to some text file, caution, this will contain keys in plain-text. Keys can be injected with Edit, Inject TLS secrets.

HTTP alternate service

Webservers that support http/3 include an alternate service header, clients then try to start quick if .

Alt-Svc: h3=":443"; ma=60

Service Binding (SVCB) DNS records (rfc9460)

A new HTTPS resource record type is used to allow clients to start QUIC immediately and doesn’t require into the alt-svc.

Headers

Initial and handshake packets include long headers, once the session is established, subsequent packets use short headers. Identifiers always start at 1. Packet numbers and acknowledges are encrypted, which makes troubleshooting on network level almost impossible.

The IP protocol header always sets the don't fragment bit. If mtu is smaller than 1200, QUIC will not be able to start. Initial package is padded to min 1220 bytes.

QUIC packets are almost completely encrypted and can’t be read without keys. However, a few bits are used to recognize the type of package.

Connection Id (DCID)

Session is not only defined by Layer 3/4 connection information (IP, Port) instead a source connection id is used to identify a session. This allows clients to change IP and or port while keeping the session alive. The destination connection id in the initial packet is random.

Server can offer multiple connection ids that the client can use. The client may or may not include a source connection id, the client always has to include the destination connection id (DCID) of the server. Chrome appears to be using 0 source connection id.

Spin bit

Server mirrors the bit, client can flip it. This allows an observer to measure end-to-end RTT.

ACK

TCP typically acknowledges every third packet. QUIC uses a range of 25ms (max_ack_delay) and acknowledges largest seen packet number. Client can use gap ranges to notify server of missing packets.