Part I β The Pipes Β· Lesson 1.4
Communication Protocols
In one lineHTTP/1.1 queues, HTTP/2 multiplexes over one TCP stream, HTTP/3 removes TCP's shared queue entirely.
Where you've seen itAn Amazon product page pulling 90 assets β six parallel connections on HTTP/1.1, one on HTTP/2.
Diagram
HTTP/1.1 β one request at a time per connection (6 connections max)
conn 1 [ a.js ][ d.png ][ g.css ]
conn 2 [ b.js ][ e.png ]
conn 3 [ c.css ][ f.png ]
βββ each file waits for the one before it on its connection
HTTP/2 β one connection, interleaved frames
conn 1 [a][b][c][a][d][b][e][a][c] ...
βββ all streams share one pipe, no per-file queue
β but one lost TCP packet stalls EVERY stream (TCP head-of-line)
HTTP/3 (QUIC over UDP) β independent streams
conn 1 stream a [β β β β ββ β ] β packet lost, only 'a' waits
stream b [β β β β β β β ] β keeps flowing
stream c [β β β β β β β ]TRANSPORT LAYER
βββββββββββββββββββββββ¬ββββββββββββββββββββββ
β TCP β UDP β
βββββββββββββββββββββββΌββββββββββββββββββββββ€
β ordered, reliable β unordered, lossy β
β handshake required β fire and forget β
β retransmits β no retransmit β
β HTTP/1.1, HTTP/2 β QUIC β HTTP/3, WebRTCβ
βββββββββββββββββββββββ΄ββββββββββββββββββββββHow it works
- HTTP/1.1 β one in-flight request per connection; browsers open ~6 per origin and queue the rest. This is why we used to sprite images and concat bundles.
- HTTP/2 β binary framing multiplexes many streams over one connection, plus header compression and server push (now largely deprecated).
- TCP head-of-line blocking β HTTP/2 fixes the application queue but not the transport one; a single dropped packet stalls every stream.
- HTTP/3 / QUIC β runs on UDP with per-stream ordering, so loss is isolated. Connection setup collapses to 0β1 RTT.
Trade-offs
| Version | Use when | Watch out for |
|---|---|---|
| HTTP/1.1 | Legacy infra only | Concat/sprite hacks still needed |
| HTTP/2 | Default today; many small files | Lossy networks stall all streams |
| HTTP/3 | Mobile, high-loss, global users | Some corporate proxies block UDP |
Anti-pattern: bundling everything into one giant file on HTTP/2 β it destroys caching granularity for a problem the protocol already solved.
Interview angle
"You migrated to HTTP/2 and nothing got faster. Why?"
- Check the bundling strategy: 1.1-era concatenation cancels multiplexing's benefit.
- Check the network: on lossy mobile links, TCP head-of-line blocking eats the gain.
- Check the origin: if TTFB is server-bound, the protocol was never the bottleneck.
Recap
- 1.1 queues per connection, 2 multiplexes per connection, 3 multiplexes per stream.
- Head-of-line blocking moves down the stack with each version, then disappears.
- Your bundling strategy must match your protocol version.