concept HTTP, TLS & web servers
HTTP/2 stream and connection flow-control stalls
A positive HTTP/2 stream window is not enough to send DATA. Follow two streams sharing one connection window to see which bytes can move, which must wait, and why the target of a window update matters.
What it means
An HTTP/2 stream needs credit in two places to send DATA bytes: its own window and the connection window shared by streams sending in the same direction. A window is an allowance measured in bytes. Sending 100 DATA bytes on stream A uses 100 bytes of A’s allowance and 100 bytes of the connection allowance. It uses none of B’s allowance, but it can still leave B unable to send.
Try it
Simulation. Start with 800 bytes waiting on each stream and WINDOW_UPDATE target set to none. With A-first, A sends 600 bytes and B sends 400. Change only Toy scheduler order to B-first: B now sends 700 bytes and A sends 300. The total stays at 1,000 bytes. What changes is which stream gets to spend the shared credit first.
HTTP/2 stream and connection flow-control stalls
Explain why both per-stream and connection windows matter to concurrent transfers
One or more streams still have pending DATA after available stream and connection credit is consumed.
Allocation
- OrderA-first
- Window updatednone
- Increment (bytes)Not evaluated / established
- Demand A (bytes)800
- Sent on A600
- Demand B (bytes)800
- Sent on B400
- Outcomestall
| Credit scope | Before DATAbytes | Remainingbytes |
|---|---|---|
| Connection | 1000 | 0 |
| Stream A | 600 | 0 |
| Stream B | 700 | 300 |
Both the connection and the individual stream must permit DATA. The displayed before values include the modeled update. This is flow control, not a congestion-control or wire throughput estimate.
Evaluated inputs
- Required scenario evidence
- provided
- Connection flow-control window
- 1000 bytes
- Stream A window
- 600 bytes
- Stream B window
- 700 bytes
- WINDOW_UPDATE target
- none
- Toy scheduler order
- A-first
- A pending DATA
- 800 bytes
- B pending DATA
- 800 bytes
Not evaluated: WINDOW_UPDATE increment
Two streams, initial nonnegative windows, one hypothetical WINDOW_UPDATE before DATA, fixed greedy order, count DATA payload bytes including no padding. A stream-scope protocol error stops this toy evaluation, not a claim that the whole HTTP/2 connection closes. SETTINGS may create negative windows in real HTTP/2, outside this model; no actual frames or congestion algorithm.
About this model
The controls set only a local, bounded scenario. The computed branch is not a verdict about a live system. Inputs listed as not evaluated did not participate in this branch after validation.
Reset restores the original inputs. It does not change the open or closed state of help or FAQ answers.
Use Reset to return to A-first and the original inputs. Here is that default example step by step; all three window columns show credit remaining, not bytes waiting to be sent.
| Step | Connection (bytes) | A (bytes) | B (bytes) |
|---|---|---|---|
| Before DATA, no update | 1,000 | 600 | 700 |
| After A sends 600 bytes | 400 | 0 | 700 |
| After B sends 400 bytes | 0 | 0 | 300 |
At each turn, the simulation takes the smallest of three amounts: the bytes waiting on that stream, its stream credit, and the remaining connection credit. When B’s turn starts, it has 800 bytes waiting and credit for 700, but the connection has only 400 bytes left. After sending those 400, B still has 400 bytes waiting. Its 300 bytes of unused stream credit are real within the example; B just cannot spend them while the connection window is zero.
Which window did the update change?
A WINDOW_UPDATE grants more credit at its target. It does not send DATA. Compare two changes to the same A-first starting point, each with a 600-byte increment applied before either stream sends:
- Target the connection. The shared window rises from 1,000 to 1,600 bytes, enough for all the waiting DATA in total. But A can still send only 600 bytes and B only 700. Both stream windows reach zero, leaving 300 bytes of connection credit unused.
- Target A instead. A’s window rises from 600 to 1,200 bytes. A has only 800 bytes waiting, so it sends 800, leaving 200 bytes of connection credit for B. B stalls after 200 bytes even though its own window started at 700.
A zero window is a valid balance; a zero WINDOW_UPDATE increment is an error. An update that would raise its target above 2,147,483,647 bytes is also an error. In either case the simulation stops before sending DATA. Stopping the example on a stream error does not mean that the whole HTTP/2 connection closes.
With default stream windows of 600 and 700 bytes, increasing the connection window by 600 yields 1,600 bytes of shared credit. The A-first allocation sends 600 and 700 bytes, leaving 300 connection bytes but zero on both streams. Both demands are still unmet. Increasing only the connection allowance cannot clear a stall whose remaining cause is an exhausted stream window.
In practice
First ask whether any DATA is waiting. If A started with 600 bytes waiting and B with 400, the default example would finish with exactly the same window balances shown in the table. This time there would be no stall: both streams sent everything they had.
For a stream with DATA waiting, compare its window with the connection window at the same point in the transfer. If you see an update, identify its target before adding its credit. If you know only the stream balance, you do not yet know whether HTTP/2 flow control permits the next byte.
Even two positive balances are not a delivery forecast. HTTP/2 credit reflects what the receiver permits; TCP congestion control responds separately to network conditions, including loss. This two-stream simulation sends no actual frames, and its fixed order is an example, not a prediction of a server’s schedule. Use the windows to answer how many pending DATA bytes flow control allows, not how soon those bytes will arrive.
Frequently asked questions
Editorial questions based on the listed sources and explicitly labeled local examples.
Does flow control apply to every frame type?
No. HTTP/2 flow control applies to DATA frames. The modeled sender is constrained by both the stream credit and shared connection credit; the lab does not treat other frame types as DATA.
Can a stream have room but connection be blocked?
Yes. Connection credit is shared and can be exhausted while an individual stream has room. The converse also occurs: the connection can have remaining credit while a stream has exhausted its own window.
What increases credit?
A valid WINDOW_UPDATE increases credit on the addressed stream or connection. SETTINGS_INITIAL_WINDOW_SIZE adjusts stream windows, not the connection window. The lab applies one supplied update and does not simulate SETTINGS-driven negative stream windows.
Is this TCP congestion control?
No. HTTP/2 flow control limits DATA according to receiver credit; TCP congestion control is a separate transport mechanism responding to network conditions. Available HTTP/2 credit does not imply immediate transport delivery.
Sources & model boundaries
Primary references used for this explanation. The interactive example is an educational model, not a live check.
- RFC 9113: HTTP/2
5.2,6.9. Sender is constrained by both flow-control windows. A zero increment is a protocol error scoped to stream or connection; overflow of 2^31−1 is a flow-control error at that scope. SETTINGS can change stream initial credit.
Checked .
- RFC 5681: TCP Congestion Control
§3; congestion control. TCP congestion control responds to network capacity and loss; the HTTP/2 flow-control credits in this lab are separate limits. Having HTTP/2 credit does not imply the transport can send immediately.
Checked .