What is head-of-line blocking in TCP, and why does it hurt HTTP/2?
Sketch your own answer first, then compare it with the one below.
A strong answer
TCP hands the application one ordered stream of bytes. If a packet is lost, later packets may arrive, but TCP cannot deliver them until the lost one is retransmitted.
HTTP/2 puts many streams on that one byte stream. A lost packet carrying data for one stream holds back every other stream on the connection, even though their data arrived. The more streams share the connection, the more requests a single loss delays.
On a clean network it rarely matters. On a lossy one, such as mobile, it can make HTTP/2 slower in the tail than several HTTP/1.1 connections.
Sources
- Martin Thomson, Cory Benfield (2022). RFC 9113: HTTP/2.
- Jana Iyengar, Martin Thomson (2021). RFC 9000: QUIC, A UDP-Based Multiplexed and Secure Transport.