Skip to main content

Flow Control

The sender maintains a window of packets it is allowed to have in flight simultaneously. The window size (WIN) limits how many unacknowledged packets can be outstanding.

Sliding Window

Sender's view (WIN = 4):
0
1
2
3
sent
4
sent
5
sent
6
sent
7
8
ACKed & freedWindow: 4 packets in flightCannot send yet (window full)
ACKed
In flight (awaiting ACK)
Blocked (window full)

All 4 window slots are occupied by packets 3–6, all transmitted and awaiting ACKs. Packets 7–8 cannot be sent until the window slides forward. When the receiver sends an ACK with cumulative=4, packets 3–4 are freed, the window slides to cover 5–8, and packets 7–8 can now be transmitted.

If packet 4 is lost but 5 and 6 arrive, the receiver sets bits in the selective ACK bitmap for 5 and 6. The sender knows not to retransmit those — it only retries packet 4 when its timer expires.

Send Buffer

In addition to the window, the sender has a send buffer (BUF) that limits total bytes queued. The sender blocks when either the window is full (too many packets in flight) or the buffer is exhausted (too much data queued).