Random network requests failures on router clients

DSCP was broken in 3.x and earlier versions. But not a big problem since I can specify TCP congestion control algorithm.

I mean, is tc -s qdisc supposed to print such kind of output? Or something else, e.g. sqm?

Yes, Sherlock, it is written all across sqm documentation.

1 Like

You used Piece of Cake which is improved FQ Codel (which I missed because of name similarity to Layer Cake). Piece of Cake provides isolation between IPs. IP traffic from one IP will not throttle traffic from another IP (which is your case... I believe). But it makes no prioritization within traffic generated by one client. For that you need Layer Cake and proper DSCP marks... (which is hard sometimes because few client applications support it and many ISPs erase it).

thanks, changed to Layer Cake.

I've figured out why I hadn't seen 'tins' in tc -s qdisc: looks like sqm simply hadn't started after adjusting parameters, probably because I've disabled the service in System > Startup. After starting it manually seems to function ok:

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 mq 0: dev eth0 root 
 Sent 6089897083 bytes 5616343391 pkt (dropped 113916, overlimits 0 requeues 135141589) 
 backlog 0b 0p requeues 135141589
qdisc fq_codel 0: dev eth0 parent :10 limit 10240p flows 1024 quantum 1518 target 5ms interval 100ms memory_limit 4Mb ecn drop_batch 64 
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) 
 backlog 0b 0p requeues 0
  maxpacket 0 drop_overlimit 0 new_flow_count 0 ecn_mark 0
  new_flows_len 0 old_flows_len 0
qdisc fq_codel 0: dev eth0 parent :f limit 10240p flows 1024 quantum 1518 target 5ms interval 100ms memory_limit 4Mb ecn drop_batch 64 
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) 
 backlog 0b 0p requeues 0
  maxpacket 0 drop_overlimit 0 new_flow_count 0 ecn_mark 0
  new_flows_len 0 old_flows_len 0
qdisc fq_codel 0: dev eth0 parent :e limit 10240p flows 1024 quantum 1518 target 5ms interval 100ms memory_limit 4Mb ecn drop_batch 64 
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) 
 backlog 0b 0p requeues 0
  maxpacket 0 drop_overlimit 0 new_flow_count 0 ecn_mark 0
  new_flows_len 0 old_flows_len 0
qdisc fq_codel 0: dev eth0 parent :d limit 10240p flows 1024 quantum 1518 target 5ms interval 100ms memory_limit 4Mb ecn drop_batch 64 
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) 
 backlog 0b 0p requeues 0
  maxpacket 0 drop_overlimit 0 new_flow_count 0 ecn_mark 0
  new_flows_len 0 old_flows_len 0
qdisc fq_codel 0: dev eth0 parent :c limit 10240p flows 1024 quantum 1518 target 5ms interval 100ms memory_limit 4Mb ecn drop_batch 64 
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) 
 backlog 0b 0p requeues 0
  maxpacket 0 drop_overlimit 0 new_flow_count 0 ecn_mark 0
  new_flows_len 0 old_flows_len 0
qdisc fq_codel 0: dev eth0 parent :b limit 10240p flows 1024 quantum 1518 target 5ms interval 100ms memory_limit 4Mb ecn drop_batch 64 
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) 
 backlog 0b 0p requeues 0
  maxpacket 0 drop_overlimit 0 new_flow_count 0 ecn_mark 0
  new_flows_len 0 old_flows_len 0
qdisc fq_codel 0: dev eth0 parent :a limit 10240p flows 1024 quantum 1518 target 5ms interval 100ms memory_limit 4Mb ecn drop_batch 64 
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) 
 backlog 0b 0p requeues 0
  maxpacket 0 drop_overlimit 0 new_flow_count 0 ecn_mark 0
  new_flows_len 0 old_flows_len 0
qdisc fq_codel 0: dev eth0 parent :9 limit 10240p flows 1024 quantum 1518 target 5ms interval 100ms memory_limit 4Mb ecn drop_batch 64 
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) 
 backlog 0b 0p requeues 0
  maxpacket 0 drop_overlimit 0 new_flow_count 0 ecn_mark 0
  new_flows_len 0 old_flows_len 0
qdisc fq_codel 0: dev eth0 parent :8 limit 10240p flows 1024 quantum 1518 target 5ms interval 100ms memory_limit 4Mb ecn drop_batch 64 
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) 
 backlog 0b 0p requeues 0
  maxpacket 0 drop_overlimit 0 new_flow_count 0 ecn_mark 0
  new_flows_len 0 old_flows_len 0
qdisc fq_codel 0: dev eth0 parent :7 limit 10240p flows 1024 quantum 1518 target 5ms interval 100ms memory_limit 4Mb ecn drop_batch 64 
 Sent 62433084207 bytes 191701749 pkt (dropped 1, overlimits 0 requeues 111007) 
 backlog 0b 0p requeues 111007
  maxpacket 34378 drop_overlimit 0 new_flow_count 107168 ecn_mark 0
  new_flows_len 0 old_flows_len 0
qdisc fq_codel 0: dev eth0 parent :6 limit 10240p flows 1024 quantum 1518 target 5ms interval 100ms memory_limit 4Mb ecn drop_batch 64 
 Sent 302641916475 bytes 3496175356 pkt (dropped 1, overlimits 0 requeues 864484) 
 backlog 0b 0p requeues 864484
  maxpacket 1518 drop_overlimit 0 new_flow_count 2144931 ecn_mark 0
  new_flows_len 0 old_flows_len 0
qdisc fq_codel 0: dev eth0 parent :5 limit 10240p flows 1024 quantum 1518 target 5ms interval 100ms memory_limit 4Mb ecn drop_batch 64 
 Sent 6375523615449 bytes 10518400856 pkt (dropped 113914, overlimits 0 requeues 134166098) 
 backlog 0b 0p requeues 134166098
  maxpacket 4404 drop_overlimit 17984 new_flow_count 242963244 ecn_mark 2 drop_overmemory 17984
  new_flows_len 0 old_flows_len 0
qdisc fq_codel 0: dev eth0 parent :4 limit 10240p flows 1024 quantum 1518 target 5ms interval 100ms memory_limit 4Mb ecn drop_batch 64 
 Sent 2578 bytes 23 pkt (dropped 0, overlimits 0 requeues 0) 
 backlog 0b 0p requeues 0
  maxpacket 0 drop_overlimit 0 new_flow_count 0 ecn_mark 0
  new_flows_len 0 old_flows_len 0
qdisc fq_codel 0: dev eth0 parent :3 limit 10240p flows 1024 quantum 1518 target 5ms interval 100ms memory_limit 4Mb ecn drop_batch 64 
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) 
 backlog 0b 0p requeues 0
  maxpacket 0 drop_overlimit 0 new_flow_count 0 ecn_mark 0
  new_flows_len 0 old_flows_len 0
qdisc fq_codel 0: dev eth0 parent :2 limit 10240p flows 1024 quantum 1518 target 5ms interval 100ms memory_limit 4Mb ecn drop_batch 64 
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) 
 backlog 0b 0p requeues 0
  maxpacket 0 drop_overlimit 0 new_flow_count 0 ecn_mark 0
  new_flows_len 0 old_flows_len 0
qdisc fq_codel 0: dev eth0 parent :1 limit 10240p flows 1024 quantum 1518 target 5ms interval 100ms memory_limit 4Mb ecn drop_batch 64 
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) 
 backlog 0b 0p requeues 0
  maxpacket 0 drop_overlimit 0 new_flow_count 0 ecn_mark 0
  new_flows_len 0 old_flows_len 0
qdisc cake 8009: dev wan root refcnt 2 bandwidth 90Mbit diffserv4 dual-srchost nat nowash no-ack-filter split-gso rtt 100ms noatm overhead 44 mpu 84 
 Sent 1921548341 bytes 2033762 pkt (dropped 26, overlimits 1266614 requeues 0) 
 backlog 0b 0p requeues 0
 memory used: 810Kb of 4500000b
 capacity estimate: 90Mbit
 min/max network layer size:           28 /    1500
 min/max overhead-adjusted size:       84 /    1544
 average network hdr offset:           14

                   Bulk  Best Effort        Video        Voice
  thresh       5625Kbit       90Mbit       45Mbit    22500Kbit
  target            5ms          5ms          5ms          5ms
  interval        100ms        100ms        100ms        100ms
  pk_delay       3.57ms        283us         13us         32us
  av_delay        748us         75us          0us         14us
  sp_delay        114us         16us          0us         14us
  backlog            0b           0b           0b           0b
  pkts          1176865       856569            4          350
  bytes       654068200   1267440210          760        55435
  way_inds        23610          145            0            0
  way_miss        20040         6523            1          161
  way_cols            0            0            0            0
  drops              25            1            0            0
  marks               0            0            0            0
  ack_drop            0            0            0            0
  sp_flows           12            4            1            1
  bk_flows            0            1            0            0
  un_flows            0            0            0            0
  max_len         37760        30280          190          590
  quantum           300         1514         1373          686

qdisc ingress ffff: dev wan parent ffff:fff1 ---------------- 
 Sent 55711469 bytes 889713 pkt (dropped 0, overlimits 0 requeues 0) 
 backlog 0b 0p requeues 0
qdisc noqueue 0: dev lan2 root refcnt 2 
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) 
 backlog 0b 0p requeues 0
qdisc noqueue 0: dev lan1 root refcnt 2 
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) 
 backlog 0b 0p requeues 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 phy1-ap0 root refcnt 2 
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) 
 backlog 0b 0p requeues 0
qdisc noqueue 0: dev wg_moscow_kl root refcnt 2 
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) 
 backlog 0b 0p requeues 0
qdisc cake 800a: dev ifb4wan root refcnt 2 bandwidth 90Mbit diffserv4 dual-dsthost nat wash no-ack-filter split-gso rtt 100ms noatm overhead 44 mpu 84 
 Sent 69209030 bytes 889704 pkt (dropped 9, overlimits 6236 requeues 0) 
 backlog 0b 0p requeues 0
 memory used: 114048b of 4500000b
 capacity estimate: 90Mbit
 min/max network layer size:           46 /    1500
 min/max overhead-adjusted size:       90 /    1544
 average network hdr offset:           14

                   Bulk  Best Effort        Video        Voice
  thresh       5625Kbit       90Mbit       45Mbit    22500Kbit
  target            5ms          5ms          5ms          5ms
  interval        100ms        100ms        100ms        100ms
  pk_delay        575us         54us        101us        610us
  av_delay         76us         21us         22us         31us
  sp_delay         12us         14us         12us         12us
  backlog            0b           0b           0b           0b
  pkts            47356       831409         8105         2843
  bytes         4589123     63369511       940317       314676
  way_inds           65        41765           65            0
  way_miss         1610        13741          562          257
  way_cols            0            0            0            0
  drops               0            8            1            0
  marks               0            0            0            0
  ack_drop            0            0            0            0
  sp_flows            2           13            2            1
  bk_flows            0            0            0            0
  un_flows            0            0            0            0
  max_len         19422         3602         1747         1611
  quantum           300         1514         1373          686

Will be watching behavior and then decide if I want to keep it or switch back to UDP-only in qBt.

Btw I've changed my setup and can enable flow offload now, but not sure if that makes any sense with just 100 Mbit uplink.

Flow offloading (hardware) doesn't work with SQM. It is clearly stated in Firewall settings. Don't change several settings at once, use step-by-step approach. Software flow offloading - it depends. In your case it will work (most likely).

3 Likes

Dont do it, it totally bypasses traffic shaping aka qos (few packets, once a minute per connection crosses it, makes little sense to police them)
You must really measure before and after each change.

and if I disable QoS / SQM, would it make any sense?

Yep, just wrap it with measuring tape https://www.waveform.com/tools/bufferbloat

You WILL have problems with bittorrent traffic without QoS/SQM. Both with uTP and TCP. But problems of different nature. Hardware flow offloading will not help. It will provide better performance if you have slow CPU, but problems with fair bandwidth sharing will remain. Don't reinvent the wheel, just follow recommendations.

like I said, I have zero issues with uTP-only :slight_smile:

You just didn't test it enough :slight_smile: