SQM doesn't do its job

you will see I have sqm configured as shown here: https://openwrt.org/docs/guide-user/network/traffic-shaping/sqm
and doing the test in Dslreports I get good results A but the problem starts when someone in my family sends files by whatsapp I have a high ping and it is impossible to play

Hopefully an easy fix. Post which router you are using, what is the speed/ type of your connection and some of your settings:

uname -a

cat /etc/config/sqm

My router is a tl-wr841hp v5 running openwrt 19.07.3
my speed is 60mb download and 6mb upload, although sometimes the upload drops to 2mb

 option qdisc_advanced '0'
        option download '55000'
        option upload '4000'
        option debug_logging '0'
        option verbosity '5'
        option linklayer 'atm'
        option overhead '44'
        option linklayer_advanced '1'
        option tcMTU '2047'
        option tcTSIZE '128'
        option tcMPU '64'
        option linklayer_adaptation_mechanism 'default'
        option interface 'eth0.2'
        option enabled '1'
        option qdisc 'cake'
        option script 'piece_of_cake.qos'

Looks like it is one of two issues.

  1. real world speed is slower than your settings- If your download and/or upload are much lower on testing with speedtest.net than what you are paying for (without SQM) - I’d let your ISP know that you aren’t getting what you are paying for. I’d turn down your SQM download and upload settings to about 90% of what your real world speeds are. (Ex: if you are only getting 2 mbps upload real world, put your upload at 1800)

  2. you are using some advanced linklayer settings. I’d turn off the advanced settings until you have a solid base. I’d unclick the last box on this page & hit save if you are using Luci (make it look just like this screenshot).

This is what your basic SQM setup should look like for comparison (without the advanced options and not adjusting the speeds as per #1):


root@OpenWrt:~# cat /etc/config/sqm

config queue 'eth0'
        option enabled '1'
        option interface 'eth0.2'
        option qdisc_advanced '0'
        option download '55000'
        option upload '4000'
        option debug_logging '0'
        option verbosity '5'
        option qdisc 'cake'
        option script 'piece_of_cake.qos'
        option linklayer 'atm'
        option overhead '44'

Mmmh, what is the output of:
tc -s qdisc
and
ifstatus wan

looking at http://en.techinfodepot.shoutwiki.com/wiki/TP-LINK_TL-WR841HP_v5.x and https://www.mediatek.com/products/homeNetworking/mt7628k-n-a I would not be completely surprised if the CPU might simply not be fast enough for cake AND concurrent wifi traffic...

1 Like

I did what you mentioned, disabled advanced option and on load 1800, but these are my results.


config queue 'eth1'
        option qdisc_advanced '0'
        option download '55000'
        option debug_logging '0'
        option verbosity '5'
        option linklayer 'atm'
        option overhead '44'
        option interface 'eth0.2'
        option enabled '1'
        option qdisc 'cake'
        option script 'piece_of_cake.qos'
        option upload '1800'

sqm
sqm2

root@OpenWrt:~# tc -s qdisc
qdisc noqueue 0: dev lo root refcnt 2
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
qdisc fq_codel 0: dev eth0 root refcnt 2 limit 10240p flows 1024 quantum 1514 ta                                                                                                                     rget 5.0ms interval 100.0ms memory_limit 4Mb ecn
 Sent 7432661722 bytes 8305784 pkt (dropped 0, overlimits 0 requeues 80)
 backlog 0b 0p requeues 80
  maxpacket 1514 drop_overlimit 0 new_flow_count 82 ecn_mark 0
  new_flows_len 0 old_flows_len 0
qdisc noqueue 0: dev br-lan root refcnt 2
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
qdisc noqueue 0: dev eth0.1 root refcnt 2
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
qdisc cake 8027: dev eth0.2 root refcnt 2 bandwidth 1800Kbit besteffort triple-i                                                                                                                     solate nonat nowash no-ack-filter split-gso rtt 100.0ms atm overhead 44
 Sent 3909076 bytes 19225 pkt (dropped 57, overlimits 19931 requeues 0)
 backlog 0b 0p requeues 0
 memory used: 252Kb of 4Mb
 capacity estimate: 1800Kbit
 min/max network layer size:           28 /    1500
 min/max overhead-adjusted size:      106 /    1749
 average network hdr offset:           14

                  Tin 0
  thresh       1800Kbit
  target         10.1ms
  interval      105.1ms
  pk_delay        7.5ms
  av_delay        949us
  sp_delay         22us
  backlog            0b
  pkts            19282
  bytes         3957834
  way_inds          179
  way_miss          808
  way_cols            0
  drops              57
  marks               0
  ack_drop            0
  sp_flows            1
  bk_flows            1
  un_flows            0
  max_len          3105
  quantum           300

qdisc ingress ffff: dev eth0.2 parent ffff:fff1 ----------------
 Sent 62436097 bytes 65065 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
qdisc cake 8028: dev ifb4eth0.2 root refcnt 2 bandwidth 55Mbit besteffort triple                                                                                                                     -isolate nonat wash no-ack-filter split-gso rtt 100.0ms atm overhead 44
 Sent 63411299 bytes 65049 pkt (dropped 16, overlimits 69835 requeues 0)
 backlog 0b 0p requeues 0
 memory used: 358848b of 4Mb
 capacity estimate: 55Mbit
 min/max network layer size:           46 /    1500
 min/max overhead-adjusted size:      106 /    1749
 average network hdr offset:           14

                  Tin 0
  thresh         55Mbit
  target          5.0ms
  interval      100.0ms
  pk_delay        7.4ms
  av_delay        2.1ms
  sp_delay          7us
  backlog            0b
  pkts            65065
  bytes        63433735
  way_inds          280
  way_miss          733
  way_cols            0
  drops              16
  marks               0
  ack_drop            0
  sp_flows            0
  bk_flows            1
  un_flows            0
  max_len         15694
  quantum          1514

root@OpenWrt:~# ifstatus wan
{
        "up": true,
        "pending": false,
        "available": true,
        "autostart": true,
        "dynamic": false,
        "uptime": 20963,
        "l3_device": "eth0.2",
        "proto": "dhcp",
        "device": "eth0.2",
        "metric": 0,
        "dns_metric": 0,
        "delegation": true,
        "ipv4-address": [
                {
                        "address": "10.168.47.216",
                        "mask": 24
                }
        ],
        "ipv6-address": [

        ],
        "ipv6-prefix": [

        ],
        "ipv6-prefix-assignment": [

        ],
        "route": [
                {
                        "target": "0.0.0.0",
                        "mask": 0,
                        "nexthop": "10.168.47.1",
                        "source": "10.168.47.216/32"
                }
        ],
        "dns-server": [
                "190.113.220.18",
                "190.113.220.51",
                "190.113.220.54"
        ],
        "dns-search": [

        ],
        "neighbors": [

        ],
        "inactive": {
                "ipv4-address": [

                ],
                "ipv6-address": [

                ],
                "route": [

                ],
                "dns-server": [

                ],
                "dns-search": [

                ],
                "neighbors": [

                ]
        },
        "data": {
                "hostname": "CPE-50D4F75513EF",
                "leasetime": 32400
        }
}

1 Like

Mmmh,

and

(a private IP address) hints at that being a cable/DOCSIS link (as does the operator of the DNS servers, claro.com.pe), in that case
delete the following line
option linklayer 'atm'
and change option overhead '44' to option overhead '22'
as these are sub-optimal for a cable link.

This is also a problem, if the whatsap upload happen, while your upload drops below 4mbps your upload shaper will not help anymore.

might fix the issue, but at that setting you might want to try the following options:

	option iqdisc_opts 'nat dual-dsthost ingress'
	option eqdisc_opts 'nat dual-srchost ack-filter'
	option linklayer_advanced '1'
	option tcMTU '2047'
	option tcTSIZE '128'
	option tcMPU '64'

(you need the tcMPU '64' as docsis uses full ethernet frames including the FCS and hence inherits ethernet's minimum frame size of 64 bytes). The ack-filter keyword should help for uploads on strongly asymmetric and bursty links like cable/docsis, and the 'nat dual-dsthost' and 'nat dual-srchost' keywords should enforce per internal IP fairness, so that your gaming computer gets at least 1/(number of concurrently uploading devices in your network) of the available uplink speed.

Final question, all your devices only connect via your OpenWrt router? That is the whats-app sending is not bypassing your router, by say directly using a wifi network operated by your docsis modem-router? Because in that case sqm simply does not see the data and has no chance of properly accounting/shaping your traffic.

mmmm my ISP's router I have it in bridge mode connected to my second router with openwrt and this is connected to another router with stock firmware that it distributes to everyone, either by wifi or by cable
then I am connected to the one that runs openwrt

Mmmh, I am a bit slow today, so is your gaming machine directly connected to the OpenWrt router (2), or to the stock-router (3)? Also, since it is late here, I will probably be off-line soon (so I am not trying to ignore you, but I am in central Europe where it is getting late...)

I am connected to the router running openwrt 2

Just an FYI.

The HTTPS (default) DSL Reports Speed Test has been broken for a while, due to expired SSL certificates on many of the test servers.

Either select the HTTP test (upper right corner of the test window), or try the Desktop version of Ookla's Speed Test.

1 Like

I'm a bit of a fool, what do you mean?

a doubt ack-filter is something I have to activate? or edit

this is what i got right i put it in fq_codel because i get good results in dslreports but the buffer is unstable and varies


root@OpenWrt:~# cat /etc/config/sqm

config queue 'eth1'
        option download '55000'
        option debug_logging '0'
        option verbosity '5'
        option linklayer 'atm'
        option interface 'eth0.2'
        option enabled '1'
        option overhead '22'
        option linklayer_advanced '1'
        option tcMTU '2047'
        option tcTSIZE '128'
        option tcMPU '64'
        option linklayer_adaptation_mechanism 'default'
        option upload '4000'
        option qdisc_advanced '1'
        option squash_dscp '1'
        option squash_ingress '1'
        option ingress_ecn 'ECN'
        option egress_ecn 'NOECN'
        option qdisc_really_really_advanced '0'
        option qdisc 'fq_codel'
        option script 'simplest_tbf.qos'

If the openwrt router is not your main router you won’t get the full benefits of sqm. Most ideal is that the openwrt router controls all the traffic and controls that LAN to WAN bottleneck to optimize latency.

1 Like

I recommend you try it, it is supposed to help on bursty physical media like docsis/cable, some docsis ISPs actually try to do this in their modems (but their ACK-filter will not trigger if SQM is used to keep the modem's buffer empty as ack filtering requires a queue.

Well, TBF+fq_codel is the simplest shaper we have, but it lacks all the bells and whistles that cake offers. Now, cake requires more computations and does not harmonize well with frequency/power scaling in some routers (r7800 comes to mind), so if cake does not work with your link due to CPU overloading, simple_TBF.qos is a decent option, but other that that I would always start with piece_of_cake or layer_cake. BUT I would also test this and select the best performing qos script based on real data and not on theoretical observations :wink:

Yes, keep actually looking at how the different scripts perform with your real load and pick the best match.

Where do I find that option? ack-filter

The ack-filter can currently only be configured via the "dangerous" command line options as shown above in [SQM doesn't do its job]...(SQM doesn't do its job)

EDIT: fixed the link, sorry