HTTP/3 & QUIC

Moving the transport into userspace to fix TCP's oldest problem

L216 MINNETWORKING
PREDICT

A fresh visit with RTT 100 ms. How long until the first byte of the response arrives over TCP + TLS 1.3, and over QUIC, the UDP-based transport under HTTP/3?

TCP was designed when hosts did not move. A server finds a TCP connection by its 4-tuple: client IP, client port, server IP, server port. Change any of them and the server sees a stranger.

QUIC runs over UDP and does in userspace what TCP and TLS do in the kernel and library. It merges the transport and TLS 1.3 handshakes into one round trip. Every packet carries a connection ID the server issued, so the server can find the connection whatever address it comes from. A returning client can even send its request in the first flight (0-RTT), at the price that the flight can be replayed.

▶ SIMULATION
CLIENT
network Wi-Fi 192.0.2.10:51000
connection none
HTTP/2 over TCP + TLS 1.3
SERVER CONNECTION TABLE (key: 4-tuple)
empty
migrations survived 0 · dropped 0
SERVER APP
served —
POST /pay charges 0
no request lost
clockt = 0 ms = 0 RTT (RTT 100 ms)
time to first byte—
last event—
✓ first response byte on every new connection within 2 RTT✓ a network change does not drop the connection✓ POST /pay is charged at most once
SCHEDULE
01[CLIENT]HTTP/2 over TCP + TLS 1.3
02[CLIENT]TCP: SYN → SYN-ACK (1 RTT)
03[CLIENT]TLS 1.3: ClientHello → ServerHello … Finished (1 RTT)
04[CLIENT]GET /index
05[CLIENT]GET /feed
06[SERVER]report
Start of tcp + tls 1.3 scenario. 6 steps.
// TCP server: the kernel demultiplexes by 4-tuple.
const key = `${pkt.srcIp}:${pkt.srcPort}->${pkt.dstIp}:${pkt.dstPort}`;
const conn = table.get(key);
if (!conn) return sendRst(pkt);   // new client IP = unknown connection

Watch the server’s connection table. In the TCP, NETWORK CHANGE scenario the table is keyed by 4-tuple, the new address finds nothing, and GET /feed dies with a reset. In QUIC the key is a connection ID. The client switches to a spare ID the server issued, and the same entry serves the new path. The last two scenarios show the 0-RTT replay and the fix.

BREAK IT NOT YET

A phone talks HTTP/2 over TCP + TLS 1.3. Inject a network change (Wi-Fi to cellular) at a point where it costs the user a request.

GOAL: the server resets the connection and a request is lost

FIX IT NOT YET

Write the server's demultiplexer. conns is a list of { name, cids, peer: { ip, port } }; cids are the connection IDs the server issued to that connection. A packet is { src: { ip, port }, dcid }. Return the connection the packet belongs to, or null. Clients change address, rotate between their issued IDs, and NATs hand old ports to new clients.

Mental model:

QUIC names a connection by an ID, not by where it is, and it folds the crypto handshake into the transport handshake. That buys one round trip on every new connection and survival across network changes. 0-RTT buys one more, but early data is replayable: only send what is safe to run twice.

IN PRODUCTION

HTTP/3 in browsers and CDNs, mobile apps on flaky networks, and load balancers that must route QUIC by connection ID instead of by 4-tuple (or a migrated connection lands on a server that has never heard of it). 0-RTT shows up as the HTTP 425 Too Early status and in anti-replay settings on your TLS terminator.

IN INTERVIEWS

“What does HTTP/3 change compared with HTTP/2?” Cover the three wins: per-stream loss recovery (no TCP head-of-line blocking), a combined handshake (2 RTT to first byte instead of 3, 1 with 0-RTT), and connection migration by connection ID. Then name the costs: UDP is sometimes blocked or rate-limited, userspace crypto costs CPU, and 0-RTT data can be replayed.

RECALL CARDS Tap to flip. They join your review deck when you mark the lesson complete.
NEXT: LOAD BALANCING L4 & L7 →