SQM doesn't do its job

An example ? pls

option eqdisc_opts 'nat dual-srchost ack-filter'

or rather, add the string ack-filter to whatever you have in option eqdisc_opts already...

Do I do that in ssh?

The minimum quantity of latency jitter you can expect at 1800 kbps upload (which you had set at one point) is 1500*8 bits / 1800 kb/s = .0067 seconds, or about 7 ms. I think it's probably good if you get say 4 times that much. so that's 28ms. Most of the time in your results you were in the range of about that... So SQM is doing its job.

If you are capable of getting closer to the 4000 kbps upload, then you can expect something like 12ms latency jitter.

2 Likes

Three options:

  1. use ssh to edit /etc/config/sqm directly. Either use the busybox vi editor or install a less powerful, but easier to use editor opkg update; opkg install nano, then use nano /etc/config/sqm to make changes to the file directly

  2. use WinSCP which supposedly allows to directly edit files on the SCP server (I have no windows machine, so I have not tried it myself and hence am short on details, but I believe this to be quite simple)

  3. use the luci GUI for SQM (opkg updata; opkg install luci-app-sqm if you have not installed that already):
    a) Navigate to "Network -> SQM QoS
    b) Select the "Queue Discipline" tab
    c) Unless checked already check the checkbox labeled "Show and Use Advanced Configuration. Advanced options will only be used as long as this box is checked."
    d) Unless checked already check the checkbox labeled "Show and Use Dangerous Configuration. Dangerous options will only be used as long as this box is checked."
    e) Add the string ack-filter to the text-box labeled "Advanced option string to pass to the egress queueing disciplines; no error checking, use very carefully." (optionally also add the strings nat and dual-srchost for per-internal-IP-fairness)
    f) Add the string ingress to the text-box labeled "Advanced option string to pass to the ingress queueing disciplines; no error checking, use very carefully." (optionally also add the strings nat and dual-dsthost for per-internal-IP-fairness)

As the text implies, the two * Configuration checkboxes need to stay checked, otherwise the GUI will prune the hidden config options... but the labels should have made that clear.

1 Like

it's okay ?

No, the 192.168.1.166 value in iqdisc_opts probably will cause an error resulting in SQM not working at all, but if you clear that out things might work, after you click "Save & Apply"...

After you are done with your edits, please post the output of cat /etc/config/sqm again and of tc -s qdisc, as well as the output of
SQM_VERBOSITY_MAX=10 /etc/init.d/sqm stop ; SQM_VERBOSITY_MAX=10 /etc/init.d/sqm start

I don't understand what I should put in "Advanced option string to pass to the ingress queueing disciplines; no error checking, use very carefully."

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

config queue 'eth1'
        option ingress_ecn 'ECN'
        option egress_ecn 'ECN'
        option itarget 'auto'
        option etarget 'auto'
        option enabled '1'
        option interface 'eth0.2'
        option download '53000'
        option debug_logging '0'
        option verbosity '5'
        option qdisc_advanced '1'
        option squash_dscp '1'
        option squash_ingress '1'
        option qdisc_really_really_advanced '1'
        option linklayer 'atm'
        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 'cake'
        option script 'piece_of_cake.qos'
        option iqdisc_opts 'nat dual-dsthost ack-filter'
        option eqdisc_opts 'nat dual-srchost ack-filter'

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 96443749 bytes 117107 pkt (dropped 0, overlimits 0 requeues 2)
 backlog 0b 0p requeues 2
  maxpacket 0 drop_overlimit 0 new_flow_count 0 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 8009: dev eth0.2 root refcnt 2 bandwidth 4Mbit besteffort dual-srchos                                                                                                                     t nat nowash ack-filter split-gso rtt 100.0ms atm overhead 22 mpu 64
 Sent 10130741 bytes 40190 pkt (dropped 133, overlimits 24003 requeues 0)
 backlog 0b 0p requeues 0
 memory used: 78624b of 4Mb
 capacity estimate: 4Mbit
 min/max network layer size:           28 /    1500
 min/max overhead-adjusted size:      106 /    1696
 average network hdr offset:           14

                  Tin 0
  thresh          4Mbit
  target          5.0ms
  interval      100.0ms
  pk_delay        1.6ms
  av_delay         82us
  sp_delay         18us
  backlog            0b
  pkts            40323
  bytes        10274131
  way_inds         3443
  way_miss          483
  way_cols            0
  drops              94
  marks               0
  ack_drop           39
  sp_flows            0
  bk_flows            1
  un_flows            0
  max_len          4542
  quantum           300

qdisc ingress ffff: dev eth0.2 parent ffff:fff1 ----------------
 Sent 84537204 bytes 80456 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
qdisc cake 800a: dev ifb4eth0.2 root refcnt 2 bandwidth 53Mbit besteffort dual-d                                                                                                                     sthost nat wash ack-filter split-gso rtt 100.0ms atm overhead 22 mpu 64
 Sent 85995776 bytes 80359 pkt (dropped 97, overlimits 77089 requeues 0)
 backlog 0b 0p requeues 0
 memory used: 397084b of 4Mb
 capacity estimate: 53Mbit
 min/max network layer size:           46 /    1500
 min/max overhead-adjusted size:      106 /    1696
 average network hdr offset:           14

                  Tin 0
  thresh         53Mbit
  target          5.0ms
  interval      100.0ms
  pk_delay         73us
  av_delay         24us
  sp_delay          9us
  backlog            0b
  pkts            80456
  bytes        86141180
  way_inds         4539
  way_miss          467
  way_cols            0
  drops              96
  marks               0
  ack_drop            1
  sp_flows            1
  bk_flows            1
  un_flows            0
  max_len         10646
  quantum          1514

root@OpenWrt:~# SQM_VERBOSITY_MAX=10 /etc/init.d/sqm stop ; SQM_VERBOSITY_MAX=10 /etc/init.d/sqm start
SQM: Acquired run lock
SQM: Stopping SQM on eth0.2
SQM: Acquired run lock
SQM:
SQM: Tue Aug 18 21:27:14 UTC 2020: Starting.
SQM: Starting SQM script: piece_of_cake.qos on eth0.2, in: 53000 Kbps, out: 4000 Kbps
SQM: fn_exists: function candidate name: sqm_start
SQM: fn_exists: TYPE_OUTPUT: sqm_start: not found
SQM: fn_exists: return value: 1
SQM: Using generic sqm_start_default function.
SQM: fn_exists: function candidate name: sqm_prepare_script
SQM: fn_exists: TYPE_OUTPUT: sqm_prepare_script is a function
SQM: fn_exists: return value: 0
SQM: sqm_start_default: starting sqm_prepare_script
SQM: cmd_wrapper: COMMAND: /sbin/ip link add name TMP_IFB_4_SQM type ifb
SQM: cmd_wrapper: ip: SUCCESS: /sbin/ip link add name TMP_IFB_4_SQM type ifb
SQM: cmd_wrapper: COMMAND: /usr/sbin/tc qdisc replace dev TMP_IFB_4_SQM root cake
SQM: cmd_wrapper: tc: SUCCESS: /usr/sbin/tc qdisc replace dev TMP_IFB_4_SQM root cake
SQM: QDISC cake is useable.
SQM: cmd_wrapper: COMMAND: /sbin/ip link set dev TMP_IFB_4_SQM down
SQM: cmd_wrapper: ip: SUCCESS: /sbin/ip link set dev TMP_IFB_4_SQM down
SQM: cmd_wrapper: COMMAND: /sbin/ip link delete TMP_IFB_4_SQM type ifb
SQM: cmd_wrapper: ip: SUCCESS: /sbin/ip link delete TMP_IFB_4_SQM type ifb
SQM: cmd_wrapper: COMMAND: /sbin/ip link add name TMP_IFB_4_SQM type ifb
SQM: cmd_wrapper: ip: SUCCESS: /sbin/ip link add name TMP_IFB_4_SQM type ifb
SQM: cmd_wrapper: COMMAND: /usr/sbin/tc qdisc replace dev TMP_IFB_4_SQM root cake
SQM: cmd_wrapper: tc: SUCCESS: /usr/sbin/tc qdisc replace dev TMP_IFB_4_SQM root cake
SQM: QDISC cake is useable.
SQM: cmd_wrapper: COMMAND: /sbin/ip link set dev TMP_IFB_4_SQM down
SQM: cmd_wrapper: ip: SUCCESS: /sbin/ip link set dev TMP_IFB_4_SQM down
SQM: cmd_wrapper: COMMAND: /sbin/ip link delete TMP_IFB_4_SQM type ifb
SQM: cmd_wrapper: ip: SUCCESS: /sbin/ip link delete TMP_IFB_4_SQM type ifb
SQM: sqm_start_default: Starting piece_of_cake.qos
SQM: ifb associated with interface eth0.2:
SQM: Currently no ifb is associated with eth0.2, this is normal during starting of the sqm system.
SQM: cmd_wrapper: COMMAND: /sbin/ip link add name ifb4eth0.2 type ifb
SQM: cmd_wrapper: ip: SUCCESS: /sbin/ip link add name ifb4eth0.2 type ifb
SQM: fn_exists: function candidate name: egress
SQM: fn_exists: TYPE_OUTPUT: egress is a function
SQM: fn_exists: return value: 0
SQM: egress
SQM: cmd_wrapper: tc: invocation silenced by request, FAILURE either expected or acceptable.
SQM: cmd_wrapper: COMMAND: /usr/sbin/tc qdisc del dev eth0.2 root
SQM: cmd_wrapper: tc: FAILURE (2): /usr/sbin/tc qdisc del dev eth0.2 root
SQM: cmd_wrapper: tc: LAST ERROR: RTNETLINK answers: No such file or directory
SQM: LLA: default link layer adjustment method for cake is cake
SQM: cake link layer adjustments: atm overhead 22 mpu 64
SQM: cmd_wrapper: COMMAND: /usr/sbin/tc qdisc add dev eth0.2 root cake bandwidth 4000kbit atm overhead 22 mpu 64 besteffort nat dual-srchost ack-filter
SQM: cmd_wrapper: tc: SUCCESS: /usr/sbin/tc qdisc add dev eth0.2 root cake bandwidth 4000kbit atm overhead 22 mpu 64 besteffort nat dual-srchost ack-filter
SQM: sqm_start_default: egress shaping activated
SQM: cmd_wrapper: COMMAND: /sbin/ip link add name TMP_IFB_4_SQM type ifb
SQM: cmd_wrapper: ip: SUCCESS: /sbin/ip link add name TMP_IFB_4_SQM type ifb
SQM: cmd_wrapper: COMMAND: /usr/sbin/tc qdisc replace dev TMP_IFB_4_SQM ingress
SQM: cmd_wrapper: tc: SUCCESS: /usr/sbin/tc qdisc replace dev TMP_IFB_4_SQM ingress
SQM: QDISC ingress is useable.
SQM: cmd_wrapper: COMMAND: /sbin/ip link set dev TMP_IFB_4_SQM down
SQM: cmd_wrapper: ip: SUCCESS: /sbin/ip link set dev TMP_IFB_4_SQM down
SQM: cmd_wrapper: COMMAND: /sbin/ip link delete TMP_IFB_4_SQM type ifb
SQM: cmd_wrapper: ip: SUCCESS: /sbin/ip link delete TMP_IFB_4_SQM type ifb
SQM: fn_exists: function candidate name: ingress
SQM: fn_exists: TYPE_OUTPUT: ingress is a function
SQM: fn_exists: return value: 0
SQM: ingress
SQM: cmd_wrapper: tc: invocation silenced by request, FAILURE either expected or acceptable.
SQM: cmd_wrapper: COMMAND: /usr/sbin/tc qdisc del dev eth0.2 handle ffff: ingress
SQM: cmd_wrapper: tc: FAILURE (2): /usr/sbin/tc qdisc del dev eth0.2 handle ffff: ingress
SQM: cmd_wrapper: tc: LAST ERROR: RTNETLINK answers: Invalid argument
SQM: cmd_wrapper: COMMAND: /usr/sbin/tc qdisc add dev eth0.2 handle ffff: ingress
SQM: cmd_wrapper: tc: SUCCESS: /usr/sbin/tc qdisc add dev eth0.2 handle ffff: ingress
SQM: cmd_wrapper: tc: invocation silenced by request, FAILURE either expected or acceptable.
SQM: cmd_wrapper: COMMAND: /usr/sbin/tc qdisc del dev ifb4eth0.2 root
SQM: cmd_wrapper: tc: FAILURE (2): /usr/sbin/tc qdisc del dev ifb4eth0.2 root
SQM: cmd_wrapper: tc: LAST ERROR: RTNETLINK answers: No such file or directory
SQM: LLA: default link layer adjustment method for cake is cake
SQM: cake link layer adjustments: atm overhead 22 mpu 64
SQM: cmd_wrapper: COMMAND: /usr/sbin/tc qdisc add dev ifb4eth0.2 root cake bandwidth 53000kbit atm overhead 22 mpu 64 besteffort wash nat dual-dsthost ack-filter
SQM: cmd_wrapper: tc: SUCCESS: /usr/sbin/tc qdisc add dev ifb4eth0.2 root cake bandwidth 53000kbit atm overhead 22 mpu 64 besteffort wash nat dual-dsthost ack-filter
SQM: cmd_wrapper: COMMAND: /sbin/ip link set dev ifb4eth0.2 up
SQM: cmd_wrapper: ip: SUCCESS: /sbin/ip link set dev ifb4eth0.2 up
SQM: cmd_wrapper: COMMAND: /usr/sbin/tc filter add dev eth0.2 parent ffff: protocol all prio 10 u32 match u32 0 0 flowid 1:1 action mirred egress redirect dev ifb4eth0.2
SQM: cmd_wrapper: tc: SUCCESS: /usr/sbin/tc filter add dev eth0.2 parent ffff: protocol all prio 10 u32 match u32 0 0 flowid 1:1 action mirred egress redirect dev ifb4eth0.2
SQM: sqm_start_default: ingress shaping activated
SQM: piece_of_cake.qos was started on eth0.2 successfully

Well nothing or as above 'nat dual-dsthost ingress'. ACK-filtering only makes sense for egress, so don't add the ack-filter keyword for the ingress side.

mmmmh removed this line? "option iqdisc_opts 'nat dual-dsthost ack-filter"

Sorry, your options are to use no ingress advanced options string (that is either empty the field in the GUI, or use an editor to remove the line from /etc/config/sqm that starts with option iqdisc_opts) OR edit the field to contain 'nat dual-dsthost ingress' only, that is replace the ack-filter with ingress keyword. For the download direction, ACK-filtering does not help anymore and the ingress keyword helps the Shaper deal better with the fact that the true bottleneck is before and not after your router. I hope this is clearer.

config queue 'eth1'
        option ingress_ecn 'ECN'
        option itarget 'auto'
        option etarget 'auto'
        option enabled '1'
        option interface 'eth0.2'
        option download '53000'
        option debug_logging '0'
        option verbosity '5'
        option qdisc_advanced '1'
        option squash_dscp '1'
        option squash_ingress '1'
        option qdisc_really_really_advanced '1'
        option qdisc 'cake'
        option upload '4000'
        option egress_ecn 'NOECN'
        option linklayer 'ethernet'
        option overhead '18'
        option linklayer_advanced '1'
        option tcMTU '2047'
        option tcTSIZE '128'
        option tcMPU '64'
        option linklayer_adaptation_mechanism 'default'
        option iqdisc_opts 'mpu 64 nat dual-dsthost'
        option eqdisc_opts 'mpu 64 nat dual-srchost'
        option script 'piece_of_cake.qos'

The 'mpu 64' part is already covered by option tcMPU '64' but you are still missing the 'ingress' keyword in option iqdisc_opts...
Sure, your network, your rules, so if you want to avoid using the ingress keyword that is fine as well and your prerogative.

good what I want to achieve is that it does not have very high latencies as I mentioned here the problem is whatsap and the latency is very high impossible to play so I would like a configuration with sqm to avoid high latencies so I want to know if this configuration adheres to her or if it's okay what I did

Well, I recommend you add the ingress keyword to option iqdisc_opts then...
And then go and try whether it actually helps...

Maybe it's because of my little knowledge of English because I don't understand what the keyword "income" refers to.

I could use an example

config queue 'eth1'
        option download '55000'
        option debug_logging '0'
        option verbosity '5'
        option linklayer 'ethernet'
        option interface 'eth0.2'
        option enabled '1'
        option overhead '22'
        option linklayer_advanced '1'
        option tcMTU '2047'
        option tcTSIZE '128'
        option tcMPU '68'
        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 '1'
        option iqdisc_opts 'nat dual-dsthost ingress'
        option eqdisc_opts 'nat dual-srchost ack-filter'
        option qdisc 'cake'
        option script 'piece_of_cake.qos'

So this is what I recommend you try, first without out the competing whatsap traffic, and if this works well, with whatsap traffic. If you can, please post the result of a speedtest without (so with sqm disabled) and with this sqm configuration.
First let's see whether this works reasonably well before we look at the whatsap case.

I wonder about the upload, but let's start with 4000.

this is the situation

config queue 'eth1'
        option download '55000'
        option debug_logging '0'
        option verbosity '5'
        option linklayer 'ethernet'
        option interface 'eth0.2'
        option enabled '1'
        option overhead '22'
        option linklayer_advanced '1'
        option tcMTU '2047'
        option tcTSIZE '128'
        option tcMPU '68'
        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 '1'
        option iqdisc_opts 'nat dual-dsthost ingress'
        option eqdisc_opts 'nat dual-srchost ack-filter'
        option qdisc 'cake'
        option script 'piece_of_cake.qos'

this is the test with whatsapp offline:

this is the test with whatsapp online:

speed test without SQM activated
dsl