← Lessons

quiz vs the machine

Platinum1820

Networking

Head of Line Blocking

When one stuck item stalls everything queued behind it.

5 min read · advanced · beat Platinum to climb

The core problem

Head of line blocking happens when the first item in a queue cannot proceed and forces everything behind it to wait, even though those later items are ready. It appears at several layers of networking.

Where it bites

  • At the transport layer, TCP delivers bytes strictly in order, so a single lost packet stalls every stream sharing that connection until it is retransmitted.
  • At the application layer, an early HTTP version that allowed only one outstanding request per connection made a slow response block the rest.
  • In message queues, a slow consumer at the front can delay later messages.

How protocols fix it

HTTP2 multiplexes many requests over one TCP connection, removing application level blocking, yet it still suffers transport level blocking because TCP underneath is in order. QUIC solves this by giving each stream independent ordering over UDP, so a lost packet only delays its own stream. The lesson is that fixing blocking at one layer does not help if a lower layer still enforces strict ordering.

Key idea

Head of line blocking stalls ready work behind a stuck item, and only independent per stream delivery truly removes it.

Check yourself

Answer to earn rating on the learn ladder.

1. Why does TCP cause head of line blocking?

2. How does QUIC avoid transport head of line blocking?

3. Why did HTTP2 multiplexing not fully solve the problem?