QUIC and HTTP/3
QUIC rebuilds TCP's job in user space on top of UDP, with TLS built in and streams in the transport. Learn what that changes, what it costs, and when not to use it.
QUIC is a transport protocol that runs over UDP. It provides what TCP provides, reliability, ordering and congestion control, plus what TLS provides, and it knows about streams. HTTP/3 is HTTP semantics mapped onto QUIC streams.
What QUIC changes
- 01One handshake, not two
Transport and TLS 1.3 handshakes combine. A new connection needs 1 round trip before the request, against 2 for TCP plus TLS.
- 02Streams in the transport
Loss is recovered per stream. A lost packet stalls only the streams whose data it carried.
- 03Connection IDs
Connections are identified by an ID, not the 4-tuple. A phone moving from Wi-Fi to cellular keeps its connection.
- 04Never-reused packet numbers
A retransmission gets a new packet number, so an ACK always says which transmission arrived. RTT measurement becomes unambiguous.
- 05Encrypted headers
Almost all of the header is encrypted. Middleboxes cannot inspect or depend on it, so the protocol can keep evolving.
Changing networks mid-download
TCP: the 4-tuple is the connection
- Streaming from
10.0.0.5:51000on Wi-Fi - Phone switches to cellular: new address
100.64.3.9 - Server has no connection for the new 4-tuple: reset
- Client reconnects: TCP + TLS handshakes, slow start
- Request is sent again; tokens 1–900 are generated again or lost
token 900 ✓ ── network change ── ECONNRESET reconnect … 3 RTT answer restarts
QUIC: the connection ID is the connection
- Packets carry destination connection ID
7f3a… - Phone switches to cellular: new address, same ID
- Server matches the ID to the existing connection
- Path validation: PATH_CHALLENGE and PATH_RESPONSE
- Stream continues from token 901
token 900 ✓ ── network change ── path validated (1 RTT) token 901 ✓ token 902 ✓
What it costs
- CPU. QUIC runs in user space with less hardware offload than TCP, so CPU cost per byte is usually higher. Kernel-bypass and UDP segmentation offload narrow the gap.
- Blocked UDP. Some enterprise and hotel networks block or throttle UDP. Clients must fall back to TCP, and race both to avoid waiting.
- Tooling. Encrypted headers that block middleboxes also block your packet captures. Use qlog, QUIC's structured event log, and qvis to visualise it.
- 0-RTT replay. As with TLS 1.3, early data can be replayed. Accept it only for idempotent requests.
QPACK
HPACK assumes headers arrive in order, which TCP guaranteed. QUIC streams arrive independently, so HTTP/3 uses QPACK: dynamic-table updates travel on a dedicated stream, and a request referencing an entry the decoder has not yet received must wait. That is the last place head-of-line blocking survives in HTTP/3, and encoders can trade compression for avoiding it.
How a client finds HTTP/3
A client cannot assume a server speaks QUIC. It learns from an Alt-Svc: h3=":443" response header on an HTTP/2 connection, or before connecting from an HTTPS DNS record. Browsers then race QUIC against TCP and use whichever connects first, remembering failures.
| Situation | Better default | Why |
|---|---|---|
| Mobile users, long or lossy paths | HTTP/3 | Independent stream recovery, 1-RTT setup, connection migration |
| Service to service inside one region | HTTP/2 | Loss is near zero, CPU and tooling are cheaper |
| Browser to CDN | Both, raced | Let the client pick what works on its network |
| Long-lived streaming to phones | HTTP/3 or resumable streams | Survive network changes (Module 6) |
Go deeperWhy build a transport on UDP at all?
TCP lives in operating system kernels, and changing it needs billions of devices to update. Worse, firewalls and NATs inspect TCP headers and drop anything unfamiliar, which is how TCP Fast Open stalled. UDP is a thin, universally forwarded wrapper. A transport built on it can live in an app or a library and change every release.
Encryption is the second half of the trick. Because QUIC encrypts nearly every header field, middleboxes cannot build features that depend on them, so they cannot freeze the protocol. Designers sometimes call this “greasing”: deliberately sending unused values so nobody can assume they never appear.
Where you will meet it
Large apps that ship their own networking stacks use QUIC to their own servers and see the biggest gains on poor mobile networks.
Most service meshes and gRPC deployments stay on HTTP/2 inside the data centre.
MASQUE tunnels UDP and IP traffic over HTTP/3, used by privacy relays such as iCloud Private Relay.
Words to know
- QUIC
- A UDP-based transport with built-in TLS 1.3 and streams.
- Connection ID
- QUIC's identifier for a connection, independent of IP address and port.
- QPACK
- HTTP/3 header compression adapted for out-of-order streams.
- Alt-Svc
- A response header advertising that a service is also available another way, such as HTTP/3.
Check yourself
Answer out loud before you open each one.
When would you not use HTTP/3 between internal services?
When loss is near zero, so its main benefit disappears, while CPU cost, offload and tooling are worse.
How does QUIC survive a network change?
Connections are identified by connection IDs, not addresses and ports, so packets from the new path still match.
Why do clients race QUIC against TCP?
UDP may be blocked or throttled. Racing avoids waiting on a QUIC attempt that will never succeed.
Try it
Run curl --http3 -sI https://cloudflare.com (with an HTTP/3-enabled curl) and look at the first line. Then check Alt-Svc in curl -sI --http2 output for the same site.