I’m also using dscpclassify for a while now and based on my testings it will still work even if you set squash dscp
to “1” aka set the wash option for cake on ingress. For it to work Ignore DSCP on ingress
has to be on “Allow”.
The DSCPCLASSIFY README on github clearly states that:
It is important that Squash DSCP and Ignore DSCP on ingress are not enabled in SQM setup otherwise cake will ignore the service's DSCP classes.
.. but as I said when I’m testing it DSCP get’s restored even if Squash DSCP on inbound packets is enabled.
Please try it for yourself and report back if it solves your issue.
Maybe @moeller0, @amteza and @yelreve can chime in and shed some light on my findings.
Maybe there is something wrong with my testing:
- I’m using DSCPCLASSIFY with diffserv4 and I marked all ICMP packets to cs1 – It’s just for testing purposes because normally there is nothing in my bulk tin so it’s easier for me to see if I’m hitting the right tin
- Verify with tcpdump that packets are marked when not washing on ingress
root@OpenWrtHudra:~# tcpdump -i eth1 icmp and host 8.8.8.8 -vv
tcpdump: listening on eth1, link-type EN10MB (Ethernet), snapshot length 262144 bytes
10:00:39.109219 IP (tos 0x20, ttl 127, id 44282, offset 0, flags [none], proto ICMP (1), length 60)
185.217.1.12 > dns.google: ICMP echo request, id 1, seq 1614, length 40
root@OpenWrtHudra:~# tcpdump -i br-lan icmp and host 8.8.8.8 -vv
tcpdump: listening on br-lan, link-type EN10MB (Ethernet), snapshot length 262144 bytes
10:02:33.831923 IP (tos 0x20, ttl 111, id 0, offset 0, flags [none], proto ICMP (1), length 60)
dns.google > 192.168.1.190: ICMP echo reply, id 1, seq 1727, length 40
- Verify with tcpdump that packets are marked when not washing on ingress
root@OpenWrtHudra:~# tcpdump -i eth1 icmp and host 8.8.8.8 -vv
tcpdump: listening on eth1, link-type EN10MB (Ethernet), snapshot length 262144 bytes
10:06:02.130249 IP (tos 0x20, ttl 127, id 44572, offset 0, flags [none], proto ICMP (1), length 60)
185.217.1.12 > dns.google: ICMP echo request, id 1, seq 1904, length 40
root@OpenWrtHudra:~# tcpdump -i br-lan icmp and host 8.8.8.8 -vv
tcpdump: listening on br-lan, link-type EN10MB (Ethernet), snapshot length 262144 bytes
10:07:01.027866 IP (tos 0x20, ttl 111, id 0, offset 0, flags [none], proto ICMP (1), length 60)
dns.google > 192.168.1.190: ICMP echo reply, id 1, seq 1962, length 40
I removed the unnecessary stuff from my tcpdump…
Fresh tc -s qdisc with wash on ingress where you can see it's clearly hitting the bulk tin:
root@OpenWrtHudra:~# 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 mq 0: dev eth0 root
Sent 95555289116 bytes 103176397 pkt (dropped 0, overlimits 0 requeues 5330)
backlog 0b 0p requeues 5330
qdisc fq_codel 0: dev eth0 parent :4 limit 10240p flows 1024 quantum 1514 target 5ms interval 100ms memory_limit 32Mb ecn drop_batch 64
Sent 26515675408 bytes 32419442 pkt (dropped 0, overlimits 0 requeues 2550)
backlog 0b 0p requeues 2550
maxpacket 66616 drop_overlimit 0 new_flow_count 1371 ecn_mark 0
new_flows_len 0 old_flows_len 0
qdisc fq_codel 0: dev eth0 parent :3 limit 10240p flows 1024 quantum 1514 target 5ms interval 100ms memory_limit 32Mb ecn drop_batch 64
Sent 19465295422 bytes 22066614 pkt (dropped 0, overlimits 0 requeues 1204)
backlog 0b 0p requeues 1204
maxpacket 66616 drop_overlimit 0 new_flow_count 949 ecn_mark 0
new_flows_len 0 old_flows_len 0
qdisc fq_codel 0: dev eth0 parent :2 limit 10240p flows 1024 quantum 1514 target 5ms interval 100ms memory_limit 32Mb ecn drop_batch 64
Sent 29671817116 bytes 28368599 pkt (dropped 0, overlimits 0 requeues 936)
backlog 0b 0p requeues 936
maxpacket 1514 drop_overlimit 0 new_flow_count 741 ecn_mark 0
new_flows_len 0 old_flows_len 0
qdisc fq_codel 0: dev eth0 parent :1 limit 10240p flows 1024 quantum 1514 target 5ms interval 100ms memory_limit 32Mb ecn drop_batch 64
Sent 19902501170 bytes 20321742 pkt (dropped 0, overlimits 0 requeues 640)
backlog 0b 0p requeues 640
maxpacket 66616 drop_overlimit 0 new_flow_count 658 ecn_mark 0
new_flows_len 0 old_flows_len 0
qdisc cake 806c: dev eth1 root refcnt 5 bandwidth 45Mbit diffserv4 dual-srchost nat nowash no-ack-filter split-gso rtt 25ms noatm overhead 40 mpu 84
Sent 187338 bytes 620 pkt (dropped 1, overlimits 200 requeues 0)
backlog 0b 0p requeues 0
memory used: 29952b of 4Mb
capacity estimate: 45Mbit
min/max network layer size: 28 / 1500
min/max overhead-adjusted size: 84 / 1540
average network hdr offset: 13
Bulk Best Effort Video Voice
thresh 2812Kbit 45Mbit 22500Kbit 11250Kbit
target 6.46ms 1.25ms 1.25ms 1.61ms
interval 30.2ms 25ms 25ms 25.4ms
pk_delay 5us 400us 1.44ms 0us
av_delay 0us 29us 70us 0us
sp_delay 0us 1us 1us 0us
backlog 0b 0b 0b 0b
pkts 10 428 182 1
bytes 764 128514 59499 42
way_inds 0 0 0 0
way_miss 2 47 19 1
way_cols 0 0 0 0
drops 0 1 0 0
marks 0 0 0 0
ack_drop 0 0 0 0
sp_flows 0 2 0 0
bk_flows 0 1 0 0
un_flows 0 0 0 0
max_len 98 1481 13080 42
quantum 300 1373 686 343
qdisc ingress ffff: dev eth1 parent ffff:fff1 ----------------
Sent 343036 bytes 2369 pkt (dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
qdisc mq 0: dev eth2 root
Sent 7580172529 bytes 8995740 pkt (dropped 0, overlimits 0 requeues 712)
backlog 0b 0p requeues 712
qdisc fq_codel 0: dev eth2 parent :4 limit 10240p flows 1024 quantum 1514 target 5ms interval 100ms memory_limit 32Mb ecn drop_batch 64
Sent 1556126611 bytes 1703795 pkt (dropped 0, overlimits 0 requeues 181)
backlog 0b 0p requeues 181
maxpacket 6056 drop_overlimit 0 new_flow_count 182 ecn_mark 0
new_flows_len 0 old_flows_len 0
qdisc fq_codel 0: dev eth2 parent :3 limit 10240p flows 1024 quantum 1514 target 5ms interval 100ms memory_limit 32Mb ecn drop_batch 64
Sent 1637800422 bytes 1819200 pkt (dropped 0, overlimits 0 requeues 173)
backlog 0b 0p requeues 173
maxpacket 66616 drop_overlimit 0 new_flow_count 198 ecn_mark 0
new_flows_len 0 old_flows_len 0
qdisc fq_codel 0: dev eth2 parent :2 limit 10240p flows 1024 quantum 1514 target 5ms interval 100ms memory_limit 32Mb ecn drop_batch 64
Sent 1931951861 bytes 2023430 pkt (dropped 0, overlimits 0 requeues 179)
backlog 0b 0p requeues 179
maxpacket 66616 drop_overlimit 0 new_flow_count 154 ecn_mark 0
new_flows_len 0 old_flows_len 0
qdisc fq_codel 0: dev eth2 parent :1 limit 10240p flows 1024 quantum 1514 target 5ms interval 100ms memory_limit 32Mb ecn drop_batch 64
Sent 2454293635 bytes 3449315 pkt (dropped 0, overlimits 0 requeues 179)
backlog 0b 0p requeues 179
maxpacket 66616 drop_overlimit 0 new_flow_count 173 ecn_mark 0
new_flows_len 0 old_flows_len 0
qdisc mq 0: dev eth3 root
Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
qdisc fq_codel 0: dev eth3 parent :4 limit 10240p flows 1024 quantum 1514 target 5ms interval 100ms memory_limit 32Mb 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 eth3 parent :3 limit 10240p flows 1024 quantum 1514 target 5ms interval 100ms memory_limit 32Mb 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 eth3 parent :2 limit 10240p flows 1024 quantum 1514 target 5ms interval 100ms memory_limit 32Mb 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 eth3 parent :1 limit 10240p flows 1024 quantum 1514 target 5ms interval 100ms memory_limit 32Mb 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 mq 0: dev eth4 root
Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
qdisc fq_codel 0: dev eth4 parent :4 limit 10240p flows 1024 quantum 1514 target 5ms interval 100ms memory_limit 32Mb 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 eth4 parent :3 limit 10240p flows 1024 quantum 1514 target 5ms interval 100ms memory_limit 32Mb 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 eth4 parent :2 limit 10240p flows 1024 quantum 1514 target 5ms interval 100ms memory_limit 32Mb 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 eth4 parent :1 limit 10240p flows 1024 quantum 1514 target 5ms interval 100ms memory_limit 32Mb 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 mq 0: dev eth5 root
Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
qdisc fq_codel 0: dev eth5 parent :4 limit 10240p flows 1024 quantum 1514 target 5ms interval 100ms memory_limit 32Mb 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 eth5 parent :3 limit 10240p flows 1024 quantum 1514 target 5ms interval 100ms memory_limit 32Mb 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 eth5 parent :2 limit 10240p flows 1024 quantum 1514 target 5ms interval 100ms memory_limit 32Mb 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 eth5 parent :1 limit 10240p flows 1024 quantum 1514 target 5ms interval 100ms memory_limit 32Mb 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 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.10 root refcnt 2
Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
qdisc noqueue 0: dev eth0.15 root refcnt 2
Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
qdisc noqueue 0: dev eth0.25 root refcnt 2
Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
qdisc noqueue 0: dev eth0.33 root refcnt 2
Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
qdisc noqueue 0: dev eth0.50 root refcnt 2
Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
qdisc noqueue 0: dev lxcbr0 root refcnt 2
Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
qdisc noqueue 0: dev eth0.44 root refcnt 2
Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
qdisc noqueue 0: dev wg0 root refcnt 2
Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
qdisc noqueue 0: dev wg01 root refcnt 2
Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
qdisc noqueue 0: dev docker0 root refcnt 2
Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
qdisc noqueue 0: dev br-eff9b1a93cc8 root refcnt 2
Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
qdisc fq_codel 0: dev tun1 root refcnt 2 limit 10240p flows 1024 quantum 1500 target 5ms interval 100ms memory_limit 32Mb ecn drop_batch 64
Sent 11236476 bytes 126729 pkt (dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
maxpacket 684 drop_overlimit 0 new_flow_count 103 ecn_mark 0
new_flows_len 0 old_flows_len 0
qdisc fq_codel 0: dev tun2 root refcnt 2 limit 10240p flows 1024 quantum 1500 target 5ms interval 100ms memory_limit 32Mb ecn drop_batch 64
Sent 6558 bytes 24 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 tun0 root refcnt 2 limit 10240p flows 1024 quantum 1500 target 5ms interval 100ms memory_limit 32Mb ecn drop_batch 64
Sent 474162 bytes 1018 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 noqueue 0: dev vethd27dee9 root refcnt 2
Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
qdisc cake 806d: dev ifb4eth1 root refcnt 2 bandwidth 88Mbit diffserv4 dual-dsthost nat wash ingress no-ack-filter split-gso rtt 25ms noatm overhead 40 mpu 84
Sent 375762 bytes 2367 pkt (dropped 2, overlimits 733 requeues 0)
backlog 0b 0p requeues 0
memory used: 31032b of 4Mb
capacity estimate: 88Mbit
min/max network layer size: 46 / 1500
min/max overhead-adjusted size: 86 / 1540
average network hdr offset: 14
Bulk Best Effort Video Voice
thresh 5500Kbit 88Mbit 44Mbit 22Mbit
target 3.3ms 1.25ms 1.25ms 1.25ms
interval 27.1ms 25ms 25ms 25ms
pk_delay 5us 545us 1.34ms 22us
av_delay 0us 69us 52us 3us
sp_delay 0us 4us 3us 0us
backlog 0b 0b 0b 0b
pkts 9 449 173 1738
bytes 666 214487 59357 104280
way_inds 0 0 0 0
way_miss 1 40 19 1
way_cols 0 0 0 0
drops 0 1 1 0
marks 0 0 0 0
ack_drop 0 0 0 0
sp_flows 0 1 0 1
bk_flows 0 1 0 0
un_flows 0 0 0 0
max_len 74 10598 14810 60
quantum 300 1514 1342 671