Bufferbloat & Smart Queue Management (SQM): How CAKE and FQ-CoDel Eliminate Online Lag Spikes

Why does your ping skyrocket from 15 ms to 250 ms whenever someone uploads a file? Understand bufferbloat and discover how modern Active Queue Management algorithms like CAKE and FQ-CoDel keep latency ultra-low.

Bufferbloat & Smart Queue Management (SQM): How CAKE and FQ-CoDel Eliminate Online Lag Spikes

You pay for a 500 Mbps high-speed internet plan. When the house is quiet, your ping in online games is a pristine 18 ms. However, the moment someone starts uploading a 4K video to Google Drive or downloading a massive Steam update, your ping explodes to 300 ms, video calls freeze, and web pages fail to load. This phenomenon is known as Bufferbloat.

Bufferbloat is one of the most pervasive design flaws of modern telecommunications equipment. In this engineering guide, we break down what bufferbloat actually is, why traditional FIFO queues fail, and how modern algorithms like CAKE and FQ-CoDel can permanently eliminate lag spikes on your home network.


What Causes Bufferbloat? The Problem with Dumb FIFO Buffers

To prevent dropped packets during transient bursts of traffic, router manufacturers began adding oversized memory buffers to home routers, cable modems, and Wi-Fi access points. When an application initiates a saturated upload or download, it transmits packets as quickly as possible. The bottleneck link (typically your connection to your ISP) cannot transmit them immediately, so the router stores them in a First-In, First-Out (FIFO) queue buffer.

As the buffer fills up with thousands of bulk file transfer packets, any small, time-critical packet—such as an online gaming player movement command or a VoIP voice packet—is placed at the very back of the line. The packet must wait for hundreds of megabytes of bulk data to drain before it can cross the wire. This queue delay introduces hundreds of milliseconds of artificial latency.


The Solution: Smart Queue Management (SQM)

Instead of relying on a single dumb FIFO queue that rewards bandwidth hogs and penalizes interactive users, Smart Queue Management (SQM) introduces intelligent Active Queue Management (AQM) and Fair Queuing:

  • FQ-CoDel (Fair Queuing Controlled Delay): Splits incoming traffic into hundreds of distinct virtual flow buckets using a hash of IP addresses and ports. Interactive traffic (DNS queries, gaming packets, ACK responses) gets its own fast-lane bucket, completely isolated from heavy streaming flows. When a queue starts growing too long, CoDel gently drops or marks packets using ECN to tell TCP senders to slow down before delay accumulates.
  • CAKE (Common Applications Kept Enhanced): The modern successor to FQ-CoDel developed by the Linux bufferbloat team. CAKE incorporates automatic bandwidth shaping, diffserv priority tinning (background, best-effort, video, voice), and automatic framing compensation for Ethernet, DOCSIS, and VDSL overhead.

How to Test Your Line for Bufferbloat

A standard idle ping test will never reveal bufferbloat because the test is executed while the line is quiet. To measure true bufferbloat, you must measure latency under simultaneous bidirectional load:

  1. Open the WRLDU Internet Quality & Bufferbloat Test.
  2. Observe your Idle Latency, then watch how high the latency climbs during the Download Loaded and Upload Loaded phases.
  3. Grading: If your latency under load increases by less than 5 ms, your connection scores an A+. If it jumps by more than 60 ms, your router suffers from severe bufferbloat and scores a D or F.

How to Enable SQM on Your Home Router

Many modern routers now include SQM or CAKE support out of the box:

  • OpenWrt: Install the luci-app-sqm package. Set your queue discipline to cake and set your download/upload bandwidth limits to approximately 90%–95% of your measured speed test capacity.
  • Asus Routers (Asuswrt-Merlin): Navigate to Adaptive QoS > QoS Type > Traditional QoS or Cake QoS.
  • Ubiquiti UniFi: Navigate to Settings > Networks > Global Network Settings > Smart Queues and enter your provisioned ISP bandwidth.