Bufferbloat: How Network Queues Kill Latency


You’ve probably experienced it: your internet connection has plenty of bandwidth, but video calls stutter, games lag, and web pages load slowly whenever someone else is uploading a file. The problem isn’t insufficient bandwidth. It’s bufferbloat.

Bufferbloat occurs when network devices hold too much queued data for too long. Routers, switches, and modems buffer packets to smooth out traffic bursts, but excessive buffering trades throughput for latency. A packet sitting in a queue for hundreds of milliseconds creates the same delay whether your connection is 10 Mbps or 1 Gbps.

The Buffer Sizing Problem

Network engineers traditionally sized buffers using the bandwidth-delay product: buffer size should equal the link bandwidth multiplied by the round-trip time. This rule originated in an era when internet paths had few flows and long-distance links dominated latency.

Modern networks look different. Home routers handle dozens of simultaneous connections. Data centers run high-bandwidth, low-latency links. The bandwidth-delay product formula overestimates needed buffer space by orders of magnitude. A 1 Gbps link with 100ms RTT suggests 12.5 MB of buffering, but effective queue management works with far less.

Oversized buffers create a vicious cycle. When a queue fills during congestion, TCP’s congestion control backs off too slowly because packet loss—the traditional congestion signal—doesn’t occur until the buffer overflows. Packets sit in the queue accumulating delay while TCP continues sending at high rates.

Active Queue Management

The solution involves managing queues actively rather than letting them fill passively. Traditional tail-drop queuing accepts packets until the buffer is full, then drops new arrivals. This approach maximizes buffering delay before signaling congestion.

Active queue management (AQM) algorithms drop or mark packets before the buffer fills completely. Random Early Detection (RED) probabilistically drops packets as queue depth increases, signaling congestion earlier. However, RED requires careful parameter tuning and performs poorly with default settings.

CoDel (Controlled Delay) takes a different approach. Instead of monitoring queue depth, it tracks how long packets spend in the queue. When standing queue delay exceeds a target (typically 5ms), CoDel starts dropping packets. It distinguishes between a queue draining quickly during a short burst and a persistently full queue indicating sustained congestion.

The key insight is that queue delay, not queue depth, determines user experience. A deep queue that drains in microseconds is harmless. A shallow queue with milliseconds of delay hurts interactive applications.

FQ-CoDel and Flow Isolation

CoDel’s successor, FQ-CoDel (Fair Queue CoDel), adds flow isolation through hashing. It maintains separate queues for different flows, preventing one bulk transfer from monopolizing buffer space and delaying latency-sensitive traffic.

FQ-CoDel applies CoDel’s delay-based dropping to each flow independently and uses deficit round-robin scheduling to serve flows fairly. This design naturally prioritizes short flows and interactive traffic. A video conference or SSH session gets low latency even when competing with large downloads because it uses its own queue with minimal delay.

Linux adopted FQ-CoDel as the default queue discipline for many interface types, and it’s deployed in various home routers. The improvement is dramatic: latency under load drops from hundreds of milliseconds to single-digit milliseconds.

Beyond the Edge

Bufferbloat isn’t just a last-mile problem. Data center networks face similar issues when switch buffers fill during incast or many-to-one traffic patterns. Microsecond-scale latency requirements make even moderate buffering problematic.

Explicit Congestion Notification (ECN) complements AQM by allowing routers to mark packets instead of dropping them. The receiver signals congestion back to the sender without packet loss, enabling faster reaction. Data Center TCP (DCTCP) and similar protocols use ECN marks to maintain extremely shallow queues.

The bufferbloat problem reveals a fundamental tension in network design. Buffers exist to absorb bursts and maximize throughput, but excessive buffering destroys latency. Effective solutions require rethinking decades of assumptions about queue management, recognizing that modern applications and network conditions demand different tradeoffs than the internet’s early architecture anticipated.