WEBMACHA

WebMacha HTTP/2

The client starts uploading 60 000 bytes to a resource that takes at most 10 KB. Its HEADERS carries content-length, so the server knows the size when the HEADERS lands, before any DATA, and Webmachine answers 413 Content Too Large from the headers alone. A server can send a complete response before the request ends, when the response does not depend on the rest of it (RFC 9113 §8.1). The client cannot know that until the answer reaches it, about a round trip after its HEADERS left, so it keeps sending: three 16 KB DATA frames, 49 152 bytes, two of them before the server has even read the HEADERS. The server's END_STREAM lands while the client is still sending, so on the client's side the stream becomes half-closed (remote): it has received END_STREAM but not sent it (RFC 9113 §5.1). After a complete response, a server may ask the client to stop sending by resetting the stream without error (RFC 9113 §8.1), and here it does: RST_STREAM with the error code NO_ERROR (RFC 9113 §7). The client must not discard the 413 because of it. It had already stopped sending when the END_STREAM landed: a server answers early only when the response does not depend on the rest of the request, so this client sends no more of the body once the response is complete (RFC 9113 §8.1). All three DATA frames land after the server closed the stream, and it discards them, but they still count against the connection's window, so the server gives 32 KB of that credit back with a WINDOW_UPDATE on the connection (RFC 9113 §5.1, RFC 9113 §6.9).

The pipe

client windows
server windows

Step 0 of 23

Streams at this step
s0 connection SET 1 frames
s1 upload not open yet
Reset
Step 0 · SETTINGS · stream 0 · leaves client → server

The client sends its SETTINGS

Before any frame, the client sends the 24-octet connection preface, PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n. RFC 9113 §3.4 chose it so that a large proportion of HTTP/1.x servers and intermediaries do not process further frames. It is not a frame, so it is not drawn. Then SETTINGS states what the client will accept: frames of up to 16 384 bytes (MAX_FRAME_SIZE), 65 535 bytes per stream before the server must wait for more window (INITIAL_WINDOW_SIZE). It also turns server push off (ENABLE_PUSH 0); the hub does not model it anyway.

moment
leaves the client
sent at
0 ms
received at
21 ms
length
18 bytes
flags
none

Settings

SETTINGS_ENABLE_PUSH
0
SETTINGS_INITIAL_WINDOW_SIZE
65 535
SETTINGS_MAX_FRAME_SIZE
16 384

RFC 9113 §3.4 · RFC 9113 §6.5.2

Lifecycle

RFC 9113 §5.1
from the client's side send HEADERS send HEADERS + ES send ES recv ES RST_STREAM recv ES · RST send ES · RST idle open half-closed (local) half-closed (remote) closed

ES is END_STREAM. Select a state to read about it. RFC 9113 §5.1 also has two reserved states for server push; they are left out because push is not modelled.

Step 0 of 23: The client sends its SETTINGS