/ THE IDEA
HTTP/2 splits messages into frames: labelled pieces carrying data or control information. Each conversation uses a stream identifier, a number telling the receiver which request or response a frame belongs to. The sender can alternate frames from several streams while keeping the order required within each stream. Contrast this with HTTP/1.1 pipelining on one connection, where responses have to remain in request order. If the first response is not ready, a later ready response cannot simply overtake it there. HTTP/2 removes that application-level ordering obstacle. However, its frames normally ride over TCP, which presents one ordered byte stream. A lost earlier TCP piece can therefore delay delivery of later bytes containing frames for several HTTP/2 streams.
THE FORMAL IDEA
independent HTTP/2 streams ≠ independent TCP byte delivery
| A stream is one labelled web conversation; TCP is the underlying reliable, ordered transport. | | The ≠ sign means not equal. Milliseconds, ms, are thousandths of a second; the times below omit transmission overhead. |
|
RUN THE TINY EXAMPLE
Change one thing. Predict what happens.
Requests A and B arrive together. A becomes ready at 100 ms; small B becomes ready at 10 ms. With HTTP/1.1 pipelining and A first, B’s response must wait behind A. With HTTP/2, B’s frames can be sent at 10 ms while A is still being prepared. Change one input: an earlier TCP piece is lost and recovered at 80 ms. Later-arriving B frames behind that byte gap may then wait until 80 ms.
|
The first improvement concerns response scheduling. The second delay concerns missing bytes beneath that scheduling layer. Both statements can be true for the same connection without contradiction.
/ SO WHAT?
When investigating a waterfall of webpage timings, distinguish “the server did not send it yet” from “the receiver cannot release the later bytes yet”. Increasing the number of web streams addresses neither server computation nor all transport loss. Knowing which order is compulsory, and at which layer, explains why multiplexing helps some stalls but leaves others visible.
ONE CAVEAT |
| The example isolates one connection and one loss event. Real scheduling, priorities, flow control and transmission times matter; HTTP/3 uses a different transport with different cross-stream loss behaviour. |
KEEP THIS
Interleaving labelled responses removes one ordering barrier, but a shared ordered transport can still make several conversations wait behind a missing byte range.
|
NEXT: Why a passing siren changes note without retuning
|