Configuring SQM to reduce Bufferbloat

This took a bit of research so I thought I’d share the steps.

What is Bufferbloat?

Bufferbloat is the undesirable latency that comes from a router or other network equipment buffering too much data. – www,bufferbloat.net

The most common effects are sluggish Internet, poor audio, SIP, and video calls, “Buffering” in Netflix / Hulu / etc.

First, let’s make sure you’re even having a problem with buffer bloat. Head over to DSL Reports. Their test will verify your speed and check if bufferbloat is causing issues. It will give you a rating indicating how well your connection is doing.
image

You will get 3 scores at the end of the test, Quality, Bloat, and Overall. If you have nothing below a B, then you’re in great shape and can skip the rest.

Here’s how to resolve Bloat in 15 minutes or less.
image
First, write down your download and upload speeds. We’ll use those later to make an educated guess on some settings.

Now let’s install SQM. Open your router’s Web management, log in and go all the way to the bottom. Open More Settings and select Advanced.
image
You’ll be asked to log on again. Use the same password you selected for your router.

Go to Network > Interfaces. You will see something like this.
image
Under the WAN tile there will be an Interface Name, usually eth0 or eth1. Write it down. This is your connection to the Internet and we’ll need it in a moment.

Go to System > Software. Click on UPDATE LISTS and wait while it gathers information from GL-iNet about available software.
image
When done you should see something like this.
image

Now we’ll install SQM (Smart Queue Management) which monitors and adjusts speed to make everything run smoother and enforces fair sharing across all your devices.

Go to System > Software.
In Download and Install package, enter luci-app-sqm and click OK.
image
When that completes, enter sqm-scripts and click OK.

Now we need to tell the router to start SQM. Go to System > Startup. Scroll down to find sqm.


The first button should read Enabled. If it doesn’t, click it once to enable. Next click Start.

Time to configure SQM. Go to Network > SQM QoS. Remember we wrote 3 things down? Download Speed, Upload Speed and our WAN Interface Name. Here’s where we use them. Multiple your Download Speed by 0.90 and Upload Speed by 0.90. See the following picture for where they belong.


Click on Queue Discipline. Set Queuing disciplines to codel and Queue setup script to nxt_routed_hfsc.qos.

Click on Link Layer Adaptation. If you have ADSL, choose ATM from the list.MOST of us will select NONE for Cable, WiFi, and Fiber Internet delivery.

Click Save and Apply.

Now you can return to DSL Reports and run that speed test again. You can play with the download and upload speeds the Network > SQM QoS > Basic Settings page to find tune speed vs bufferbloat.

Congratulations. You’ve just improved your Internet experience!

If you ever need to disable SQM go to Software > Startup, find sqm, and click the enabled button to disable it

Mike

3 Likes

on a typical home network with multiple devices don’t forget to enable per host isolation it will make a HUGE difference balancing bandwidth/latency between devices! this can be done with cake & piece of cake queuing disciplines.

To enable Per-Host Isolation Add the following to the “Advanced option strings” (in the Interfaces → SQM-QoS page; Queue Discipline tab, look for the Dangerous Configuration options):

Advanced option string to pass to the ingress queueing disciplines nat dual-dsthost ingress

Advanced option string to pass to the egress queueing disciplines nat dual-srchost

full and detailed info here.

2 Likes

thanks all for the guide and tips, but i wanted 'piece of cake ', the last time i tried manual installation of sqm qos, there was no ‘cake’ option in the glinet firmware

@bajave thanks for the tip. I usually don’t worry about device to device as my wireless network is much faster than our Internet connection. For Gig connections though I can see how this would be useful.

@bOcy I understand @alzhao is working on including Cake for the next release. I don’t know if he’ll get it in the GL-ui or not, but it is pretty simple to configure in LuCi. If someone reminds me, I might just write up instructions for Cake when it’s available. I just hope the Cake isn’t a lie. :laughing:

The cake is a lie and you will be… missed…

it is not about device to device, per host isolation will balance internet bandwidth/latency across all devices on the network, so if you have a torrent download on one pc you can still watch netflix on your tv while kids are gaming and wife is on a work meeting… with no lag… this is the point of fighting bufferbloat… and it’s done automagically :wink: have a look at the openwrt wiki on this subject is very descriptive. and yes @Johnex the cake is a lie no doubt about that :rofl:

@bajave I’ll have a look. With my current configuration I’ve had no issues with device contention. My test bed is multiple torrents (because one no longer take enough time), Netflix on the TV and the Wife happily downloading during her video conference calls. Lag is still sub 45ms. Her calls are stable, and “I’m still alive”. I wonder what the next level will look like? :laughing:

FYI, I just tried to install SQM as a “Plug-In” from the list of available plug-ins on my new Beryl. I updated the list of plug ins, browsed to SQM, and then chose “Install”.

I waited 5 or 10 minutes while my Beryl was non-responsive. I’ve tried power cycling and resetting several times – but it seemed to have bricked it.

Trying to recover now (but my work laptopm won’t let me alter the IP address – which is super annoying).

-Jonathan

1 Like

Thanks for the useful guide. A couple of questions please: 1) I have followed all the steps but I cannot find the nxt_routed_hfsc.qos on the list of options in the Queue setup script on my GL.iNet Brume but I am not sure why that is. Any idea? 2) My internet is via VDSL and so I chose ATM, but do I leave the per packet overhead at 0 or do I change it to 44?

Thanks again for any help.

I am having the same problem :frowning: just installing luci-app-sqm seems to have bricked my MT-1300. No response after reboots/resets.

@alzhao and @Johnex any ideas on what to try?

use 44

(post must have 20char)

1 Like

Replying to myself: I was able to recover using the procedure in Debrick via Uboot - GL.iNet Docs, just a note: the WAN port did not work and had to connect to one of the LAN ports, but the router is back in business :slight_smile:

The debrick procedure is a life saver! Now I am curious to know why it all happen

1 Like

@jxs457, did you get your router back? Have you tried booting into recovery mode to see if it is still responsive?

@Almahadeus, I’d recommend rebooting after installing luci-app-sqm and sqm-scripts. I’ve read that certain configurations may not load the scripts correctly without a reboot. Please let us know if that resolves the issue for you. If not what’s your firmware revision and router model?

1 Like

@arkangelglinet, debricking and a backup have saved me more times that I care to count. What version of firmware are you running on that MT-1300? luci-app-sqm makes changes to the web interface, however that shouldn’t cause it to fail.

Hi @mmonaghan, I am continuing the investigation in SQM package installation bricks GL-MT1300 (Beryl) firmware 3.200 since it seems a GL-MT1300 issue in particular.

My Beryl is back after Debrick and while we figure things out for SQM, which is a really desirable feature IMHO, I am experimenting with Hardware flow offloading since I will have to disable it once that works :grin:

@mmonaghan
I tried the guide again and it does work, I just needed to reboot after, which I didn’t do the first time. You should include rebooting in the guide :smiley:

I had 2ms buffering, basically no bloat on the downstream, but on the upstream I did have around 200ms. After SQM it is now around 5ms, so that worked perfect.

Thank you for your reply. Unfortunately, the nxt_routed_hfsc.qos on the list of options in the Queue setup script still does not exist even after a router reboot (please see attached screen). My current firmware is: openwrt-mv1000-emmc-3.105. I have just chosen the default option (simple.qos) and setup the upload and download speeds to 90% of my speedtest as recommended but the streaming is now terrible and glitchy with increased buffering. Followed the instruction to the letter other than not having the queue setup script recommended and I am not sure where I am going wrong with this.

Yes, I was just able to recover (by de-Bricking). Thank you.