A host on a 10 Mbps network is regulated by a token bucket filled at 2 Mbps with a capacity of 16 megabits. It starts with a full bucket. For how long can it transmit at the full 10 Mbps, and how much data does it send in that burst?
Congestion happens when traffic offered to the network exceeds what routers and links can carry, causing queues, loss and collapse. Prevention (open loop), removal (closed loop), traffic shaping with leaky and token buckets, RED/ECN, TCP's AIMD window and QoS keep it in check.
Congestion occurs when the load on a network — packets offered per second — exceeds its capacity somewhere. Router queues fill, queuing delay climbs, buffers overflow and packets are dropped. Senders then retransmit, adding even more load. In October 1986 the early Internet suffered congestion collapse: throughput on one link fell about a thousand-fold while the link stayed busy carrying retransmissions. Van Jacobson's fixes to TCP (1988) are still the basis of TCP congestion control.
Open-loop techniques act before congestion appears, through good design and policy, without feedback from the network.
Closed-loop techniques detect congestion and feed that information back to the sources so they slow down.
Much congestion comes from bursty traffic. Traffic shaping regulates the rate and burstiness of the data a host sends; a network can agree a traffic profile with the host and police it (drop or mark packets that break it), while the host shapes its own output (buffers and delays packets so that they conform).
The leaky bucket (Turner, 1986) is a bucket with a small hole: water (packets) may pour in at any rate, but it leaks out at a constant rate r; if the bucket is full, the extra water spills — those packets are discarded. In practice it is a finite FIFO queue drained at a fixed rate (one packet per tick, or a fixed number of bytes per tick for variable-size packets). Output is perfectly smooth, but even an idle network cannot be used for a quick burst.
The token bucket relaxes this. Tokens drop into the bucket at rate ρ, up to a capacity of C tokens (bytes); sending a byte costs one token. A host that has been idle saves tokens, so it may later send a burst of up to C bytes at the full line rate M, while its long-term average still cannot exceed ρ. When the bucket is full, new tokens are thrown away — not packets.
A plain router queue is drop-tail: it accepts packets until the buffer is full and then drops every arrival. This keeps queues long (high delay) and drops packets from many TCP flows at once, so they all slow down together and then speed up together — global synchronisation, which wastes capacity.
RED (Random Early Detection), by Floyd and Jacobson (1993), drops packets before the buffer is full. It tracks an exponentially weighted average queue length and compares it with two thresholds.
Random early drops hit different flows at different times, so senders back off one by one and the average queue stays short. ECN (Explicit Congestion Notification, RFC 3168) goes further: instead of dropping, the router sets the two-bit ECN field of the IP header to CE (congestion experienced). The receiving TCP echoes this with the ECE flag in its ACKs; the sender halves its window as if a loss had occurred and confirms with the CWR flag. Nothing is lost and nothing has to be retransmitted.
TCP has no help from IP, so each sender estimates the network's capacity itself and keeps a congestion window (cwnd) alongside the receiver's window (rwnd); it may have min(cwnd, rwnd) bytes unacknowledged. A second variable, the slow-start threshold (ssthresh), separates two growth phases. Windows are usually counted in MSS (maximum segment size) units.
Why treat the two loss signals differently? A timeout means nothing has come back for a long time — the path may be badly congested — so TCP starts again cautiously. Duplicate ACKs mean the receiver is still getting later segments (each one triggers an ACK repeating the last in-order byte), so packets are flowing and only one was lost; halving the window is enough. Three duplicates, rather than one, are required because a single duplicate may just be caused by reordering.
Additive increase plus multiplicative decrease (AIMD) gives TCP its sawtooth: the window climbs linearly and halves at each loss. AIMD is also fair — competing flows converge towards equal shares of a bottleneck. Because the window swings between W/2 and W, average throughput is about 0.75 × W / RTT.
| Variant | Year | Key idea |
|---|---|---|
| Tahoe | 1988 | Slow start, congestion avoidance, fast retransmit; any loss → cwnd = 1 |
| Reno | 1990 | Adds fast recovery: after 3 duplicate ACKs halve cwnd instead of restarting |
| NewReno / SACK | 1990s | Recover from several losses in one window without repeated timeouts |
| Vegas | 1994 | Delay-based: slow down when RTT rises, before losses occur |
| CUBIC | 2006 (Linux default) | Window grows as a cubic function of time since the last loss — fast on high bandwidth-delay paths |
| BBR | 2016 (Google) | Model-based: estimates bottleneck bandwidth and minimum RTT instead of reacting to loss |
Applications differ in what they need from a flow: reliability (no loss — file transfer), delay (latency — interactive apps), jitter (variation in delay — voice and video), and bandwidth (throughput — streaming). QoS techniques include scheduling, traffic shaping, admission control and resource reservation.
DiffServ reuses the old IPv4 type-of-service byte (and IPv6 traffic class): the first six bits are the DSCP and the last two are the ECN bits. Expedited Forwarding gives a low-delay, low-jitter 'premium' class; Assured Forwarding defines four classes, each with three drop precedences; everything else is best effort (DSCP 0).
Try the problem first, then reveal the working one step at a time.
A host on a 10 Mbps network is regulated by a token bucket filled at 2 Mbps with a capacity of 16 megabits. It starts with a full bucket. For how long can it transmit at the full 10 Mbps, and how much data does it send in that burst?
A TCP connection starts with cwnd = 1 MSS and ssthresh = 16 MSS. A timeout occurs during RTT round 9 and three duplicate ACKs arrive during round 16. Tabulate cwnd per round for Reno, and say how Tahoe differs.
A host sends 20 Mbps for 1 s, stays silent for 3 s, then sends 4 Mbps for 1 s. A leaky bucket should output a constant rate over this 5 s period. What rate, and how big must the bucket (queue) be to lose nothing?
MSS = 1 KB, cwnd starts at 1 KB, ssthresh = 32 KB, and the receiver window is large. With no losses, after how many RTTs does cwnd first reach 32 KB? How many RTTs to reach 36 KB? If RTT = 50 ms, how long is that?
A token bucket has capacity C = 500 KB and token rate ρ = 1 MB/s; the line rate is M = 6 MB/s. Starting full, how long can the host send at 6 MB/s and how much data does it send?
A TCP sender has cwnd = 12 KB while the receiver advertises rwnd = 8 KB. How much may it have outstanding, and which mechanism is limiting it? What if rwnd later grows to 20 KB?
cwnd is 24 MSS when a loss is detected. Give the new ssthresh and cwnd (a) after a timeout, (b) after three duplicate ACKs in Tahoe, (c) after three duplicate ACKs in Reno.
A RED router uses min_th = 20 packets, max_th = 40 packets and max_p = 0.1. What is the drop probability when the average queue is 30 packets? When it is 15? When it is 45?
10 questions. 70 % passes the topic quiz (+30 XP, +20 more for 100 %). Exam scoring: +1 correct, −⅓ wrong.
Modelled on real KPSC questions (reworded) with the same concept and answer; each links to its original paper.