SQM (aka Smart Queue Management)

OpenWrt/LEDE has pre-built packages for controlling Bufferbloat - the undesirable latency that arises when the router buffers too much data. OpenWrt calls this SQM, although it's also called active queue management - AQM.

Bufferbloat is most evident when the link is heavily loaded. It causes bad performance for voice and video conversations, causes gamers to lag out, and generally makes people say, “The Internet is slow today.”

The “luci-app-sqm” package of OpenWrt/LEDE solves the problem of Bufferbloat. In a three-minute installation and configuration, you'll have a much more lively network connection. Here's how:

TL;DR Install OpenWrt 18.06 or newer (or back to LEDE 17.01), and follow the video at: https://www.youtube.com/watch?v=FvYhifdQ92Q

Before you can optimize your network, you need to know its current state. Run a speed test to find your down/upload link speeds. To do this:

The default values described below work quite well for most situations. They represent conservative estimates that may slightly overestimate the real overhead, which is generally desirable compared to under-estimating. You may be able to improve performance by experimenting with settings, see A little more SQM tuning below.

To configure SQM, choose Network → SQM QoS to see the Smart Queue Management (SQM) GUI.

  1. In the Basic Settings tab:
    • Check the Enable box
    • Set the Interface name: to your wide area link (usually eth0 for OpenWrt/LEDE, but check Network → Interfaces to find the name for the WAN port.)
    • Set the Download and Upload speeds to 80-95% of the speed you measured above in the Preparation.
  2. In the Queue Discipline tab, you can leave the settings at their default.
    • Choose cake as the Queueing Discipline
    • Choose piece_of_cake.qos as the Queue Setup Script
    • The Advanced Configuration defaults are designed to work well out of the box.
  3. In the Link Layer Adaptation tab, choose the kind of link you have:
    • For VDSL - Choose Ethernet, and set per packet overhead to 34 (or 26 if you know you are not using PPPoE)
    • For DSL of any other type - Choose ATM, and set per packet overhead to 44
    • For Cable - Choose Ethernet, and set per packet overhead to 22
    • For true ethernet or Fiber to the Premises - Choose Ethernet, and set per packet overhead to 44
    • When in Doubt, it's better to overestimate - Choose packet overhead 44
  4. Click Save & Apply. That's it!

Measure your latency again with the speed test. You should notice that the measured ping times should only be slightly larger during the downloads and uploads. Try using VoIP, Skype, Facetime, gaming, DNS, and general web browsing. They should be much more pleasant, even if someone's uploading or downloading a lot of data.

You've reduced your connection's bufferbloat!

The steps above will control latency well without additional effort. The 80-95% figures mentioned above are good first-cut estimates, but you can often gain more speed while still controlling latency by making a couple experiments to adjust the settings.

If you want to spend a few more minutes tuning, do these steps.

  • Increase the Download speed until the latency begins to increase, then go back to a slightly lower value.
  • Do the same for the Upload speed entry.
  • It may be worth your time to tweak the two a bit up and down to find a sweet spot for your connection and usage.
  • We recommend you use DSLReports Speed Test for the latency tests because it measures both speed and latency at the same time.

Note: If you have a DSL link, the experiments above may produce Download and Upload values that are actually higher than the original speed test results. This is OK: the ATM framing bytes of a DSL link add an average of 9% overhead, and these settings simply tell SQM how to make up for that overhead.

Note: If you use a cable modem, you should use a speed test that runs for a longer time. Cable modem makers have gamed speed tests thoroughly by using “Speedboost”, which usually gives you an extra 10 mbits or so for the first 10 seconds (so the speed test will look good(!)). Don't be surprised if the “right” setting for your queue rates is significantly lower than the no-SQM speed test results. You may need to tune the speeds down from your initial settings to get the latency to the point you need for your own usage of your connection.

Note: You can also experiment with the other settings (read SQM - The Details for more information), but they will not make nearly as large a difference as ensuring that the Download and Upload speeds are maximized.

Note: Also check the FAQ and Troubleshooting SQM guides.

This website uses cookies. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website.More information about cookies
  • Last modified: 2020/11/05 21:50
  • by per