liveBook · Manning

HTTP/2 multiplexing

As explained in Secure APIs

HTTP/2 multiplexing is an HTTP/2 feature that carries multiple concurrent request and response streams over a single connection.

HTTP/2 multiplexing carries multiple concurrent request and response streams over one TCP connection. Each stream has an identifier, allowing clients to use one socket for many requests. section 9.3

The mechanism works as follows:

  • Clients serialize requests into separate streams over the same connection. section 9.3
  • Servers typically allow a maximum of about 100 concurrent streams. section 9.3
  • Clients can reset streams they no longer need, releasing capacity for other requests. section 9.3

Rapid reset abuse

A browser may cancel streams for images or text that fall outside the viewport. An attacker instead opens the maximum number of streams, resets them immediately, and repeatedly sends replacements. If the server does not cancel work triggered by those streams, its resources can be exhausted in a denial-of-service attack. section 9.3

Figure 9.15 HTTP/2 uses streams to allow clients to serialize multiple requests over a single TCP connection. Each stream has an identifier, and if the client deems a certain request no longer necessary, it can cancel it with a reset stream request.
figure

Shows stream identifiers, shared TCP transport, and cancellation through a reset-stream request. section 9.3

How Secure APIs covers it

How deep it goes
Explains streams, identifiers, shared TCP transport, concurrency limits, resets, and resource-exhaustion abuse.
Examples
Uses browser asset loading, viewport-based cancellations, and repeated stream resets as concrete examples.
What you can do after
Diagnose how rapid stream creation and cancellation can exhaust server resources.
How it connects
Connects HTTP/2 streams and TCP connections to denial-of-service attacks and HTTP/2 rapid reset.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Secure APIs. The section links point to the parts of the book it draws on.