Networking

QUIC

QUIC's existence looks like a contradiction at first: it's a reliable, ordered transport — exactly what TCP already provides — built on top of UDP, the protocol with no reliability at all. It isn't a contradiction; it's reliability rebuilt from scratch, in software, specifically to avoid a few structural costs that are baked into TCP itself and can't be fixed without replacing it.

Quick reference
What it is
A reliable, ordered, encrypted transport protocol built on top of UDP instead of using TCP.
Mental model
TCP's reliability guarantees, rebuilt in user-space software instead of the OS kernel, and per-stream instead of per-connection.
Key numbers
0-RTT or 1-RTT connection setup (vs. TCP+TLS's 2-3 RTT); runs over UDP port 443 for HTTP/3.
Reach for it when
You're serving many small, independent requests over a lossy or high-latency link (mobile networks) where TCP's head-of-line blocking and handshake cost actually show up as user-visible delay.

The problem QUIC exists to fix

A modern web page isn't one request — it's dozens, fetched over the same TCP connection to avoid paying for a new handshake every time. That reuse is good, but it creates a new problem: TCP delivers bytes to the application strictly in the order they were sent, across the entire connection, even when those bytes belong to completely unrelated requests.

Head-of-line blocking

If a packet carrying part of request #1 is lost, TCP holds up everything behind it — including already-arrived data for requests #2 through #10 — until the lost packet is retransmitted and its place in the sequence is filled. The application can't see request #2's data yet, even though it's sitting right there in the OS's receive buffer, purely because TCP won't hand over anything out of order.

A single lost TCP segment for one request blocks delivery of already-arrived data for unrelated requests behind it in the same byte stream req 1 req 2 lost! req 3 req 4 one TCP byte stream — req 3 and 4 already arrived, but can't be delivered yet blocked until req 2's retransmit arrives — even though req 3 and 4 are fine QUIC gives each request its own independent stream — req 2's loss only blocks req 2
TCP's ordering guarantee applies to the whole connection, not per-request — QUIC's does not.

Independent streams, one connection

QUIC solves this by multiplexing multiple independent streams inside one QUIC connection, each with its own ordering guarantee. A lost packet only blocks the one stream it belonged to — every other stream keeps delivering data to the application the instant it arrives. This is the single biggest practical difference from TCP, and the reason QUIC was built as a new protocol instead of a patch to TCP: stream-level ordering isn't something you can retrofit onto a byte-stream protocol without breaking compatibility with every existing TCP implementation.

Faster handshake — and built-in encryption

Plain TCP needs one round trip before TLS even starts its own handshake on top — two separate negotiations, stacked. QUIC folds transport and encryption setup into a single handshake, because QUIC is encrypted by design; there's no such thing as unencrypted QUIC in practice. A returning client that has talked to a server recently can often skip the round trip entirely (0-RTT), sending encrypted application data in its very first packet.

Why build this on UDP instead of just fixing TCP

TCP is implemented deep inside operating system kernels, and middleboxes across the internet (firewalls, NAT gateways, corporate proxies) have decades of hard-coded assumptions about what a TCP segment looks like. Changing TCP's core behavior would mean waiting for every OS and every piece of middlebox hardware on the internet to update — effectively never. UDP, by contrast, is deliberately minimal — the network mostly just forwards UDP datagrams as opaque payloads. Building the new reliability logic inside that payload, as ordinary application-layer software, means QUIC can evolve at the pace of a library update instead of an operating-system release cycle.

Real-world applications

Gotchas

Field notes