Computer Networks · Computer Networks
TCP Flow and Congestion Control
Receiver window versus congestion window, sliding-window throughput, slow start and AIMD after loss.
Meera's TCP connection to the shop is already open. This lesson is how fast the tea page may move: the receiver window that protects her phone's buffer, and the congestion window that protects the shared path. The two caps are different jobs. The sender uses the smaller of them.
- Computer Networks
- Medium level
- 2 concepts
1Flow control and sliding window
Once the connection is open, the shop must not send the whole tea page faster than Meera's phone can store it. Flow control is receiver-driven: the phone advertises a window — how many more bytes of buffer it still has. The shop may have at most that many unacknowledged bytes in flight. As the phone reads bytes and frees buffer, the window slides forward.
This is not congestion control. Flow control protects the receiver's buffer. Congestion control protects the shared path. Throughput is bounded by roughly window size divided by RTT. RTT, round-trip time, is how long a byte takes to reach the shop and an acknowledgement to come back. A 10,000-byte window and a 0.1 s RTT suggest about 100,000 bytes per second until something else clips you.
Figure. Receiver advertises a byte window; sender may keep that many bytes in flight — throughput \approx W/\mathrm{RTT}.
How the window limits send rate
- AdvertiseReceiver puts its free buffer size in the TCP window field.
- Cap in flightSender may have at most that many unacknowledged bytes outstanding.
- SlideAs ACKs arrive and the receiver frees buffer, the window slides forward.
Throughput from window and RTT
A TCP sender has a 10,000-byte send window and RTT is 100 ms. Ignoring loss and headers, what throughput does window/RTT suggest?
- Window W10000 bytes
- RTT0.1 s
- Throughput \approx W / \mathrm{RTT}100000 bytes/s
- In kB/s100 kB/s
Pro tip. Double the window or halve the RTT and the bound doubles — until congestion control or the path capacity clips you first.
Flow control's sliding window is primarily there to
- Stop the sender overwhelming the receiver's buffer
- Halve cwnd on every ACK
- Replace IP routing when congestion appears
The advertised window is the receiver's remaining buffer. Congestion control (cwnd, AIMD) is a separate mechanism that reacts to network load.
2Slow start and AIMD
The path from Meera's home router to the shop is shared with other people's packets. Congestion control limits how much the sender puts on that path. The sender keeps a congestion window, cwnd — a second cap, counted in bytes or in MSS-sized chunks. MSS, maximum segment size, is the largest payload TCP will put in one segment. The effective send window is the smaller of cwnd and the receiver window.
Slow start grows cwnd exponentially — roughly doubling each RTT — until a threshold called ssthresh, or until a loss. Then congestion avoidance grows it linearly: about +1 MSS per RTT (additive increase). On loss, AIMD cuts cwnd sharply — classically to half (multiplicative decrease) — then adds again. Exponential probe, linear cruise, cut on trouble.

How cwnd evolves
- Slow startWhile cwnd is below ssthresh, grow exponentially with ACKs.
- Congestion avoidanceAbove ssthresh, add about one MSS to cwnd per RTT.
- On lossMultiplicative decrease: set cwnd near half, update ssthresh, then climb again.
AIMD after a loss
In congestion avoidance, cwnd is 16 MSS when a loss is detected. What is cwnd right after multiplicative decrease, and after one more RTT of additive increase?
- cwnd before loss16 MSS
- After MD: \mathrm{cwnd} \leftarrow 16/28 MSS
- After one RTT of AI: \mathrm{cwnd} \leftarrow 8+19 MSS
Pro tip. Halve on loss, add one MSS per RTT when stable — that AIMD pair is the congestion-avoidance rhythm the exam names.
During congestion avoidance, on ACK progress cwnd typically
- Doubles every RTT
- Increases by about 1 MSS per RTT
- Resets to 1 MSS on every ACK
Additive increase is ~+1 MSS per RTT. Doubling each RTT is slow start; resetting to 1 on every ACK would stall the transfer.
Notes
- Flow control is receiver-driven: the advertised window is remaining buffer, and the sender must not exceed it.
- Congestion control is network-driven: cwnd limits bytes in flight on the shared path.
- The sender's effective window is the minimum of the receiver window and cwnd.
Formulas
- Throughput (sliding window) \approx window size / RTT.
- Effective window = \min(\mathrm{cwnd},\mathrm{rwnd}).
- AIMD: on ACK increase cwnd by 1 MSS per RTT; on loss set cwnd to half (multiplicative decrease).
Exam traps & shortcuts
- Flow protects the receiver; congestion protects the path. Do not swap the names.
- Slow start doubles; avoidance adds one MSS per RTT; loss halves.
Recap
Two caps sit on the open tea-page connection. They are not the same job.
- Flow
- Receiver window: how many more bytes the phone can store. Throughput \approx W/\mathrm{RTT}.
- Congestion
- cwnd protects the shared path. Effective send window = \min(\mathrm{cwnd},\mathrm{rwnd}).
- AIMD
- Slow start doubles; avoidance adds about 1 MSS per RTT; loss halves, then adds.
Practise TCP Flow and Congestion Control
Reading is free and needs no account. Practice, mocks and progress live in the app.
- A 2-question practice set that ends the chapter
- 2 quick checks with worked explanations
- Timed mocks scored with the real marking scheme
- Readiness tracked per topic, kept on your device