OpenWrt supports SQM for mitigating bufferbloat, the undesirable latency that arises when your router buffers too much data.
Bufferbloat is most evident when a connection is heavily loaded with downloads or uploads. It causes increased latency (ping), resulting in poor performance for realtime tasks like VoIP, video chat, lag in online gaming, and generally makes the internet less responsive. This latency can be mitigated with SQM.
SQM is an integrated system that performs per-packet/per-flow network scheduling, active queue management (AQM), traffic shaping, rate limiting, and QoS prioritization. In comparison, “classic” AQM only manages queue length, and “classic” QoS only does prioritization.
SQM is performed on the CPU, as such slower devices may be unable to keep up with your peak internet speed.
SQM is incompatible with hardware flow offloading which bypasses part of the kernel as discussed in this thread. Be sure that is disabled on the LuCI → Network → Firewall dropdown box. Note that SQM works with software flow offloading enabled.
Before you can optimize your network, you need to test its current state.
Install luci-app-sqm (or sqm-scripts if you don't want LuCI) and follow below.
In LuCI go to Network → SQM QoS:
Done! You can confirm results by re-running the speedtest. Any increased ping during download/uploads will now be minimal.
As an example, the user below is running OpenWrt on a WRT32X router. The internet connection is a DOCSIS cable modem with 500/35 Mbit service and this ISP includes over-provisioning. SQM cake was selected with 90% dl/ul limits on baseline speedtest values. Packet Steering (all CPUs) is also enabled. Latency increase under load dropped to zero, lower ping with no packet loss is observed during VoIP and online gaming during heavy internet usage. The user's speedtest results with SQM and summary of tests below:
| Speedtest Results | |||||||
|---|---|---|---|---|---|---|---|
| QoS | Download | Upload | Unloaded Ping | DL Latency | UL Latency | Quality grade | Bufferbloat grade |
| None | 532 Mbits | 37 Mbits | 12 ms | +18 ms | +38 ms | B | B |
| SQM | 495 Mbits | 28 Mbits | 12 ms | +0 ms | +0 ms | A+ | A + |
1. Set your mpu to ensure rate shaping is correct for small packets in LuCI under SQM QoS → Link Layer Adaptation → Advanced Linklayer Options. See SQM Details and SQM setting question for more details.
2. The steps above will handle latency well but you may improve it further with these steps:
3. While Cake is the preferred discipline as it is excellent at mitigating bufferbloat, fq_codel is a faster, albeit less comprehensive option. One user found fq_codel gave about 15% higher throughput when CPU limited and this email thread showed similar results. See discussion of these algorithms on this forum post.
4. See SQM configuration for advanced settings.