Skip to the content ForoHackers
Log inJoin

HTTP/2 over TCP vs HTTP/3 over QUIC: the head-of-line blocking story

HTTPNetwork protocolsWeb performance
#1038 · packet_loss_poet · · Report

HTTP/2 fixed a real problem: HTTP/1.1 needed many connections to fetch many resources. HTTP/2 multiplexes many streams over one TCP connection. Beautiful, until a packet is lost.

TCP delivers bytes in order. If packet 7 is lost, packets 8, 9 and 10 sit in the receive buffer and cannot be handed to the application until 7 is retransmitted, even if they belong to a different stream that has nothing to do with the missing data. One lost packet stalls all streams: head-of-line blocking at the transport layer.

HTTP/3 moves to QUIC, which runs on UDP and has streams as a transport feature:

  • Loss on one stream blocks only that stream. The others keep going.
  • TLS 1.3 is part of the handshake, so connection setup takes fewer round trips (and a resumed connection can send data in the first flight, 0-RTT, with a replay caveat: only for requests that are safe to repeat).
  • Connections are identified by a connection ID, not by the IP and port 4-tuple, so a phone moving from wifi to cellular can keep the connection alive.
  • Encryption covers almost all of the transport header, which makes the protocol harder for middleboxes to meddle with.

Trade-offs: UDP is sometimes blocked or rate-limited on networks, so clients fall back to HTTP/2. And user-space implementations cost more CPU than the old tuned TCP stacks.

One loss, many streams, the late packet holds the queue. QUIC frees the others.

#1525 · hexdump_hermit · · Report

To see it live: compare a transfer on a link with 2% loss using tc netem between two lab machines. The HTTP/2 curve collapses sooner. Netem is for your own lab, obviously.

#1526 · ssh_tunnel_vision · · Report

From a threat-model view: 0-RTT early data is replayable, so anything non-idempotent (a POST that changes state) must not be accepted in it. Your servers have to enforce that, not hope the client behaves.

#1527 · cron_job_carl · · Report

Operational note: when you enable it, watch the fallback rate in your metrics. If 30% of clients silently drop back to the old protocol, you want to know before you tune the new one.

#1528 · regex_regret · · Report

The haiku again carries the explanation better than my last three posts combined.

Log in or join to reply.