Senior LevelREST APIs & Web Services
Why does TCP Head-of-Line blocking degrade HTTP/2 under high packet loss networks?
❓ Interview Prompt: Explain TCP Head-of-Line (HoL) Blocking in HTTP/2, single TCP connection multiplexing, packet retransmission stalls, and HTTP/3 QUIC resolution.
HTTP/2 multiplexes dozens of concurrent HTTP streams over a single underlying TCP connection:
The TCP HoL Vulnerability:
TCP guarantees strict in-order delivery of bytes. If a single TCP packet is dropped on a lossy cellular network (1%-2% packet loss):
•
The OS kernel TCP stack MUST pause delivery of ALL multiplexed HTTP/2 streams on that connection until the missing packet is retransmitted and acknowledged!
•
Resolution: HTTP/3 replaces TCP with QUIC over UDP, making streams independent.
Code Implementation Example
http
// HTTP/2 Single TCP Connection:
Stream 1 [Packets 1, 2, 3] | Stream 2 [Packets 4, 5] | Stream 3 [Packets 6, 7]
// If Packet 2 drops -> TCP blocks Stream 1, Stream 2, AND Stream 3 until Packet 2 retransmits!💡TCP Head-of-Line blocking freezing multiplexed HTTP/2 streams.
🎯 Interview Key Takeaway
TCP head-of-line blocking stalls all HTTP/2 streams on packet loss; HTTP/3 QUIC resolves this using independent UDP streams.
#HTTP/2#Head-of-Line Blocking#TCP vs QUIC#Senior
Back to all REST APIs & Web Services Questions→