TransportIntermediate

Head-of-line blocking

“What is head-of-line blocking? Where does it occur in TCP, in HTTP/1.1 and in HTTP/2, and what does HTTP/3 actually change about it?”

What this tests

  • Whether the candidate sees HOL blocking as one pattern that recurs at several layers
  • The precise mechanism in TCP: in-order delivery holding later bytes hostage
  • Why HTTP/2 multiplexing moved the problem rather than removing it
  • An accurate account of what QUIC does and does not fix

Answers by level

Read the beginner answer first and notice what is missing.

It is a queueing pattern: a shared, ordered queue in which the first element cannot be delivered, so nothing behind it is either — even if those later elements are complete and unrelated. The question is always *what is the queue, what does "delivered" mean, and why must it be in order*. Networking has at least three instances stacked on top of each other, and each was introduced to fix the one above it.

TCP. TCP promises an ordered byte stream. If segment 5 is lost and 6–20 arrive, the kernel keeps 6–20 in the receive buffer and gives the application nothing until 5 is retransmitted — at best one RTT later (fast retransmit after duplicate ACKs), at worst a retransmission timeout, which on Linux is at least 200 ms. The application sees a stall, not a loss. That is the price of in-order delivery, and it is paid by every byte behind the hole regardless of what those bytes mean. See Head-of-Line Blocking and Packet Loss: Duplicate ACKs, Fast Retransmit and the RTO.

HTTP/1.1. One request is in flight per connection; pipelining was specified but browsers abandoned it because responses had to come back in order, so a slow first response blocked the rest — application-level HOL. Browsers work around it with ~6 parallel connections per host, which is why HTTP/1.1: Persistent Connections and Their Limits sites sharded domains. HTTP/2 multiplexes many streams over *one* TCP connection with framing, so a slow response no longer blocks the others at the HTTP layer — but now all streams share a single TCP byte stream, so one lost packet stalls every stream until it is retransmitted. Under a few percent of loss HTTP/2 over one connection can be *slower* than HTTP/1.1 over six, because the six connections lose independently. HTTP/2 moved HOL from the HTTP layer down to TCP and made the blast radius larger.

HTTP/3. QUIC makes streams the unit of loss recovery: each stream has its own ordered byte space, so a lost packet blocks only the streams whose data it carried; the others keep delivering. That removes cross-stream HOL. It does not remove HOL *within* a stream — a lost packet in the middle of one large response still stalls the rest of that response — and QPACK header compression can reintroduce a small cross-stream dependency if a header block references a dynamic-table entry that has not arrived yet. The trade-off is that QUIC does all of this in user space over UDP: more CPU per byte, less hardware offload, and a fallback to TCP whenever UDP is blocked. See HTTP/3 and QUIC.

Green flags · Red flags

Strong green flag · Knows that HTTP/2 can be slower than HTTP/1.1 under loss and explains why with the six-connection comparison.
Green flags
  • Defines it as a queueing pattern and names the queue at each layer
  • Explains the TCP mechanism: receive buffer holds later segments until the hole is filled
  • Says HTTP/2 removed HTTP-level HOL but concentrated TCP-level HOL on one connection
  • States that QUIC removes cross-stream HOL and keeps intra-stream HOL
  • Mentions the retransmission timers that determine how long a stall lasts
Red flags
  • Says QUIC "eliminates head-of-line blocking" without qualification
  • Thinks HTTP/2 multiplexing solved the problem entirely
  • Cannot explain why TCP must hold the later segments
  • Believes the application can see or skip the missing data

Follow-up questions

F1
You serve 40 small images over HTTP/2 on a 2% loss mobile link. What happens when one packet is lost?
F2
Does a lost packet on a QUIC connection ever stall a stream it carried no data for?
F3
Where does head-of-line blocking appear inside a server rather than on the wire?

Scenario

A team migrated an image-heavy site to HTTP/2 and p95 page load improved on office Wi-Fi but regressed for users on cellular. Explain the mechanism, what you would measure to confirm it, and the two ways to fix it.

Learn this topic