HTTP/3 & QUIC
Moving the transport into userspace to fix TCP's oldest problem
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.
// 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// QUIC server: find the connection by any ID it issued.
// A migrating client switches to a spare ID (NEW_CONNECTION_ID),
// so the table holds every ID issued to each connection.
const conn = table.get(pkt.destConnectionId);
if (!conn) return statelessReset(pkt);
if (pkt.srcAddr !== conn.peerAddr) {
conn.validatePath(pkt.srcAddr); // PATH_CHALLENGE / PATH_RESPONSE
}
conn.receive(pkt);
// 0-RTT: accept early data only for requests safe to replay
if (isEarlyData && !isIdempotent(req)) return tooEarly(425); 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.
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
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.
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.
“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.