Network & PerformanceBaseline · Widely

HTTP/2 & HTTP/3 Multiplexing

Mental Model

HTTP/2 interleaves binary frames from dozens of requests over a single TCP connection, eliminating application-level head-of-line blocking. HTTP/3 replaces TCP with QUIC over UDP so a single dropped packet stalls only its own stream rather than freezing every asset in flight.

Interactive Simulator

Connection Strategy: HTTP/1.1 Sharding vs HTTP/3 QUIC

Compare legacy domain-sharded HTTP/1.1 pools against single-origin QUIC stream multiplexing.

Lines of Code
Before
4
After
4
Reflows / Browser Cost
Before
Serial head-of-line blocking
After
Isolated per-stream loss recovery
BeforeHTTP/1.1 Domain Sharding (6 TCP Sockets/Host)
// Legacy bundling & sharding workaround
<script src="https://static1.cdn.example/app.js"></script>
<link rel="stylesheet" href="https://static2.cdn.example/app.css" />
// Separate TLS handshakes + 6-socket cap per host
Lines: 4Reflows: Serial head-of-line blockingDependencies: Multiple TCP + TLS handshakes

Each stalled request blocks every queued asset behind it on that socket.

After (Native)HTTP/3 Single-Origin QUIC Streams
// Single origin with Alt-Svc: h3=":443"; ma=86400
<script type="module" src="/assets/app.js"></script>
<link rel="stylesheet" href="/assets/app.css" />
// Independent QUIC streams over 1-RTT UDP
Lines: 4Reflows: Isolated per-stream loss recoveryDependencies: Single QUIC connection + QPACK

A lost UDP packet only stalls its own stream; sibling CSS and JS continue arriving.

Under the Hood

HTTP/1.1 behaves like a single-lane tollbooth: six parallel TCP connections per origin, each waiting for one response to finish before starting the next. HTTP/2 turns that tollbooth into a multi-lane highway where the network stack interleaves numbered binary frames from CSS, JS, and images discovered by the Preload Scanner.

  1. On connection setup, the client and server negotiate h2 via ALPN over TLS or h3 via Alt-Svc over QUIC.
  2. Each HTTP request allocates a unique numeric stream ID and encodes headers through HPACK (HTTP/2) or QPACK (HTTP/3).
  3. Under HTTP/2, the OS kernel still delivers one ordered TCP byte stream, so a single lost packet blocks all streams until retransmission completes.
  4. Under HTTP/3, QUIC manages stream reassembly in user space per stream, keeping the Browser Rendering Pipeline fed with unblocked CSS and script chunks.
HTTP
HTTP/2 200
alt-svc: h3=":443"; ma=86400
priority: u=1, i
content-type: text/css; charset=utf-8
cache-control: public, max-age=31536000, immutable

Problem Genealogy

  • 1999 (HTTP/1.1 Pipelining): Allowed queued requests on one socket, but responses still arrived strictly in FIFO order; proxies routinely broke it.
  • 2015 (RFC 7540 HTTP/2): Introduced binary framing and HPACK compression, killing domain sharding, though TCP still stalled every stream on 1% packet loss.
  • 2022 (RFC 9114 HTTP/3): Moved transport to QUIC over UDP, finally burying the "just open six sockets to static4.example.com" era.

Production Pitfalls

Production Pitfall
  • Legacy domain sharding: Splitting bundles across cdn1 and cdn2 forces extra TLS handshakes and breaks stream prioritization across assets.
  • Corporate UDP blocks: Roughly 3–5% of enterprise firewalls drop UDP port 443; servers must keep HTTP/2 over TCP active as an automatic fallback.
When Not to Use
  • When not to use HTTP/3: On internal microservice meshes or low-loss fiber links where kernel TCP offload outperforms user-space QUIC CPU overhead.

Connections & Logical Next Steps