Congestion & Flow Control

active queue management

A naive router with a buffer just lets the queue grow until it is completely full, then drops whatever arrives next — a policy called tail drop. The trouble is that a chronically full buffer adds steady delay to every packet (the bufferbloat problem) and tends to drop a burst of packets from many flows all at once, throwing them into synchronised retreat. Active queue management, or AQM, is the router being smarter: it watches its own queue and acts early — dropping or marking a few packets before the buffer is full — to keep the queue short and signal congestion gently and in good time.

Two well-known AQM schemes show the idea. RED (Random Early Detection) watches the average queue length and, as it grows past a threshold, randomly drops (or ECN-marks) an increasing fraction of arriving packets. Because the drops are spread out and random, they nudge a few flows to slow down before the queue overflows, and they avoid the synchronised collapse that tail drop causes. CoDel (Controlled Delay) takes a more modern angle: rather than watching queue LENGTH, it watches how long packets are actually sitting in the queue, and starts dropping if that sojourn time stays too high for too long. CoDel needs almost no tuning, which was a notorious weakness of RED.

AQM matters because the alternative — big buffers with tail drop — is exactly the recipe for bufferbloat: high, variable latency that ruins video calls and games even when bandwidth is plentiful. By keeping queues short, AQM keeps latency low while still letting the link run full. It works beautifully alongside ECN (mark instead of drop) and is the router-side half of the congestion-control partnership: the endpoints do AIMD, and the routers, with AQM, give them clean, timely signals to react to.

A home router with tail drop holds a 256-packet buffer; under load it stays full, adding hundreds of milliseconds of delay to every packet — your video call stutters even though the download still runs fast. Swap in CoDel: it notices packets lingering longer than its target (a few milliseconds), drops just enough to make senders ease off, and the queue — and the latency — stays short while throughput barely changes.

AQM (RED, CoDel) drops or marks early to keep the queue short, trading a tiny throughput loss for much lower latency.

AQM does not increase a link's capacity — it cannot make a slow link fast. What it does is keep the queue short so latency stays low and senders get timely congestion signals, which is the cure for bufferbloat. Confusing 'more buffer' with 'better' is exactly the mistake AQM exists to correct.

Also called
AQMactive queue management主動佇列管理