What Is HTTP/2? How Streams, Multiplexing, and Their Limits Work
Learn how HTTP/2 frames messages, carries concurrent streams over a connection, compresses headers, and why TCP loss can still delay traffic.
HTTP/2 keeps HTTP semantics such as methods and status codes, while changing how messages are carried: it divides them into binary frames so multiple requests and responses can share a connection. This can reduce the need to open connections for a page's HTML, CSS, images, and scripts, and it compresses repeated headers. It does not remove every source of delay or eliminate the effects of TCP packet loss. This article follows RFC 9113 (2022); HTTP/3 and its QUIC transport are outside scope.
What changes from HTTP/1.1?
HTTP/1.1 represents a message as a start line, headers, a blank line, and an optional body. In HTTP/2, that readable text is not sent as-is. The meaning of methods, status codes, and headers remains, but the connection establishes the protocol version and message information travels in binary pieces called frames.
A frame carries control information such as its type, length, and stream identifier. HEADERS frames carry header fields; DATA frames carry message content; a large header block can continue in CONTINUATION frames. A packet capture is therefore not directly readable as ordinary HTTP/1.1 text. Browser developer tools or an HTTP/2-aware analyzer can reconstruct the request's meaning, even though the wire format is binary.
How do streams allow multiplexing?
A stream is an independent, bidirectional sequence of frames exchanged by the two endpoints over one HTTP/2 connection. A request and its response usually use one stream, identified by a stream number. Several streams can remain open, and their frames can be interleaved over the same TCP connection. This is called multiplexing.
Suppose a browser receives a page and then requests its stylesheet, logo, and an image:
One TCP connection; time moves left to right
Stream 1 (HTML) HEADERS — DATA — DATA — end
Stream 3 (CSS) HEADERS — DATA — end
Stream 5 (logo) HEADERS — DATA — end
Stream 7 (page image) HEADERS — DATA — DATA — endThis is a conceptual example; real frame order and resource sizes vary. The key is that stream 3 need not wait for all of stream 1's body to finish. Implementations schedule data across streams, while each receiver preserves the frame order within an individual stream to reconstruct its message. Frames may be interleaved across the connection without mixing up the messages.
Why compress headers?
Browser requests may repeat cookies, user-agent values, and accepted formats. Repeating long text fields adds overhead. HTTP/2 uses HPACK to encode header fields: common entries have compact representations, and a connection can maintain a dynamic table of values already seen. Repeated values can then be referenced instead of sent in full each time.
HPACK compresses headers, not the whole message body. Its encoder and decoder keep state for the connection, so a header block cannot be interpreted independently of that state. DATA and header fields use different frame types; HPACK itself does not shrink an ordinary response body.
How does flow control protect a receiver?
Several streams share a connection, so a sender could otherwise deliver data faster than a receiver can process it. HTTP/2 flow control lets a receiver advertise a credit: how many bytes it is ready to receive. Limits apply both to each stream and to the connection as a whole. A sender must stay within the advertised credit; when a receiver can accept more, it sends WINDOW_UPDATE.
RFC 9113 sets the initial flow-control window to 65,535 octets for a new stream and for the connection. This is initial credit, not a maximum download size; more credit can be advertised later. Flow control applies between endpoints on one hop, not across the entire Internet path. A proxy may be a receiver on one connection and a sender on another.
For example, if a client reads a large image slowly while CSS shares the connection, stream-level credit limits data for each stream and connection-level credit limits their combined data. This helps prevent unbounded receive buffers. A window kept too small or updates sent too late can limit throughput, however. An endpoint that does not promptly process frames can also delay the updates needed for sending to continue.
What does multiplexing not solve?
HTTP/2 commonly multiplexes streams over a single TCP connection. If a TCP packet is lost, TCP must recover the missing bytes before later bytes in that connection can be delivered. Consequently, several logically independent HTTP/2 streams can still be delayed by loss on the shared TCP connection. Application-level multiplexing and transport-level loss recovery solve different problems. HTTP/3 uses another transport design; a detailed comparison is a separate topic.
Multiplexing also does not add server CPU, bandwidth, or database capacity. Enabling HTTP/2 alone cannot guarantee faster responses if the server or connection is already the bottleneck. Streams still share bandwidth, and poor scheduling can delay important resources. RFC 9113 notes that prioritization and scheduling choices can affect performance.
How can you check whether HTTP/2 is in use?
Usually, an application developer need not change request code just to use HTTP/2; check the protocol negotiated by the browser and its current peer. In browser developer tools, show the Protocol column in the Network panel. A value such as h2 indicates HTTP/2 on that connection. Menu names and visibility vary by browser version. Operators should also inspect the TLS termination point: a CDN or proxy can use HTTP/2 with the browser and a different protocol on its separate connection to the origin.
| Observation | What it means and what to check |
|---|---|
The browser shows h2 | HTTP/2 was negotiated between the browser and this connection's peer. It does not prove every hop to the origin uses HTTP/2. |
The browser shows http/1.1 | This connection uses HTTP/1.1. Check client support, TLS/ALPN negotiation, and server or proxy configuration against that infrastructure's documentation before changing settings. |
Browser shows h2, origin logs show another version | A CDN, load balancer, or proxy may terminate one connection and open another. Check the topology and logs for each hop. |
HTTP/2 is best understood through the effects of frame multiplexing, header compression, and flow control on shared connections. A protocol label alone does not prove a speed improvement or describe the entire server path; performance diagnosis must also identify the actual route and bottleneck.
Sources
[RFC 9113: HTTP/2](https://www.rfc-editor.org/rfc/rfc9113.html)
[RFC 7541: HPACK Header Compression for HTTP/2](https://www.rfc-editor.org/rfc/rfc7541.html)
[MDN: HTTP messages](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Messages)
[MDN: Evolution of HTTP](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Evolution_of_HTTP)