What is AQM?
Active Queue Management
AQM (Active Queue Management) is a way of running a router's queue that drops or marks packets as soon as the queue starts to grow, instead of only when it's completely full, so that senders slow down before delay builds up.
A plain first-in-first-out buffer only drops packets when it overflows. TCP fills whatever buffer it finds, so a large plain buffer stays full during any bulk transfer, and every packet behind it waits: that's bufferbloat. AQM breaks the cycle by signalling congestion early. When packets have been waiting longer than a small target (5 milliseconds in CoDel), the queue drops one, or sets the ECN congestion mark if both ends support it, and TCP reduces its sending rate. The queue stays short, while the link stays busy.
The best-known algorithms are RED (Random Early Detection, older and hard to tune), CoDel (Controlled Delay, which watches how long packets wait rather than how many there are), and PIE. fq_codel and CAKE combine CoDel with fair queueing, giving each flow its own small queue, and are the defaults or common choices on modern Linux routers. AQM only helps where the queue actually builds up, though: on a router that's faster than the line in front of it, the queue is in the modem, and you need a shaper as well, which is what CAKE adds. See also QoS. The Traffic shaping with CAKE on Debian lesson measures the difference under load.
Lessons that use AQM
- Traffic shaping with CAKE on DebianTeaches this term · Intermediate · 40 min
Measure bufferbloat on an office line, then fix it on a Debian 13 router with CAKE: shaping uploads on the WAN and downloads through an IFB, fair shares between hosts, making it permanent with systemd-networkd, and tuning it for your line.