← Lessons

quiz vs the machine

Silver1080

Networking

HTTP2 Multiplexing In Depth

How many requests share one connection through interleaved streams.

4 min read · intro · beat Silver to climb

The Problem It Solves

Older HTTP sent one request at a time per connection, so a slow response blocked everything behind it. Browsers opened many connections to work around this, wasting memory and slow start time.

Streams And Frames

HTTP2 splits a single connection into many streams. Each stream carries one request and its response. Data is chopped into small frames that are tagged with a stream identifier.

  • Frames from different streams are interleaved on the wire.
  • The receiver reassembles each stream by its identifier.
  • One connection now carries dozens of exchanges at once.

Why This Helps

Because requests no longer wait in line, a large download does not block a small one. The browser sends everything immediately and lets the server respond as data becomes ready.

  • Fewer connections means less setup cost and less memory.
  • Head of line blocking at the HTTP layer disappears.
  • Bandwidth is shared fairly across active streams.

The Remaining Limit

Multiplexing lives above TCP. If a TCP segment is lost, every stream stalls until it is retransmitted, because TCP delivers bytes in order. This transport level blocking is what HTTP3 later removes.

Key idea

HTTP2 turns one connection into many interleaved streams of frames, removing HTTP level head of line blocking while still sitting on top of ordered TCP.

Check yourself

Answer to earn rating on the learn ladder.

1. How does HTTP2 carry many requests on one connection?

2. Why can a lost TCP segment still stall HTTP2 streams?