Which router should I install luci-app-sqm on?

dslreports.com speed tests are giving me Cs and Ds for Bufferbloat so I was going to try following the directions here to see if it improves: https://lede-project.org/docs/howto/sqm

I have the following configuration: Cable-Modem --> Router-1 --> Router-2. Router-2 has streaming video connections and voip phone connections. Should I install luci-app-sqm on Router-1 and Router-2 or just Router-2?

On an aside, how come luci-app-sqm is not installed by default? Should I just install it on all my routers?

I would recommend to instantiate sqm scripts on Router-1's WAN interface, assuming that router-1 does NAT and DHCP for your network*. With VoIP I would recommend to use either the script layer_cake.qos and cake as qdisc, or simple.qos and fq_codel as qdisc. Set this up and test against the dslreports speedtest (get a free registration and configure your test to use 16 streams and 30 seconds in both directions and enable the high-res bufferbloat testing and enable "dodge compression"). Once you are happy with your WAN link, you can move to router-2. If you have a bit of luck, your routers both support BQL on their ethernet interfaces and both use fq_codel per default on the same interfaces. In that case, assuming router-1 and router-2 are connected via ethernet everything should be fine, for wired connections. For wifi use you will need to look at the progress of the make-wifi-fast project, sqm-scripts will not be able to help you too much with that (sqm-scripts does not handle variable bandwidth at all, so on wifi it would only work if you set the shaper to the minimum speed you are likely to encounter, and that way you will sacrifice loads of bandwidth).

Because not everybody wants/needs that and it does take up space, and many router's are very low on flash space to beginn with. Also sqm-scripts require user configuration before they are useful, so not installing them by default seems reasonable, no?

If you want to use it both routers or if your routers have lots of space available, by all means install it.

Hope that helps

*) I assume you are not having router-2 perform NAT as well, if router-2 also does NAT and DHCP, things are less than ideal....

I stayed up late testing. Before I read your reply, I installed SQM with the cake configuration on Router-2 and left Router-1 without SQM. NOTE: all traffic on Router-2 is wired. Here are a sample of my results:

Connection | Down  | Up    | Ping    | Bufferbloat | Quality | Score
Wired      | 106.8 | 10.26 | 17      | C           | A       | B
Wired-SQM  | 106.3 | 10.76 | 12      | A+          | A+      | A+

A third router handles wireless traffic. Let's call this Router-3. I installed SQM on Router-3 but NOT Router-1. Routers 2 and 3 cannot see each other's traffic. They each hold a LAN port on Router-1. Here are the wireless results from Router-3:

Connection     | Down  | Up    | Ping    | Bufferbloat | Quality | Score
Wireless       | 104.7 | 9.76  | 20      | C           | A       | B
Wireless-SQM   | 71    | 10.64 | 19      | C           | A+      | A

I will install SQM on Router-1 next and see how it affects results. What are your thoughts on my results? Maybe I should disable SQM on my wireless router (Router-3)? Although, Wireless-SQM got better score on 4/6 results.

Hi okji,

as long as all your traffic runs through router-N that is a decent place to position a shaper. So in your testing you made sure that Router-2 and Router-3 never interfered with each other, but in normal operation I would assume that you would operate wired and wifi components concurrently and will create traffic on both router3 and router2, in that case you either set each of the two shapers to 50% of WAN bandwidth (well any split that the sum of both does not exceed true WAN bandwidth), or you leave these routers alone and instantiate your WAN shaper on router1. Assuming that this router handles NAT and DHCP for your network, this also is the best place for the cake qdisc/shaper do its thing. Now if it turns out that there is internal bufferbloat between router1 and router 2, it makes good sense to also create a new sqm instance on Router2's interface connecting this to router 1 (I assume router2's wan interface, right?).

Regarding your results, the first pair of tests show a solid improvement of the bufferbloat score, showing that yes, sqm can help you in general.

The second tests I would not take too seriously, sqm in its current form simply is not well suited for wifi (well it does not really care about wif per se, but it has issues with variable bandwidth links like 802.11; in case your wifi network always has reliable bandwidth, sqm will also do a decent job there).

To summarize, I would instantiate sqm on router1's WAN interface, and would the test internally whether router2 in wired mode shows signs of bufferbloat (which assuming router1 and router2's interfaced support BQL and have the default fq_codel qdisc they most likely will not). If ad only if you see signs of bufferbloat internally would I go and install sqm on router2.*

Best Regards

*) Not actually true, I would install it anyways, but for testing purposes mainly, not because I expect much improvements...

P.S.: If you run dslreport speedtests it would be nice if you could add the link to the results and/or post the result overview image. The detailed results allow a deeper look into the bufferbloat measurements and are always nice in better understanding what is happening...