QoSmate: (Yet Another) Quality of Service Tool for OpenWrt


| |.-----.-----.-----.| | | |.----.| |_
| - || _ | -| || | | || || |
|
_____|| |
||||___||| |____|
|
| W I R E L E S S F R E E D O M

OpenWrt 24.10.0, r28427-6df0e3d02a

root@OpenWrt:~# /etc/init.d/qosmate status
==== qosmate Status ====
qosmate autostart is enabled.
qosmate service is enabled.
Traffic shaping (HFSC) is active on the egress interface (lan0).
Traffic shaping is active on the ingress interface (ifb-lan0).
==== Overall Status ====
qosmate is currently active and managing traffic shaping.
==== Current Settings ====
Upload rate: 96732 kbps
Download rate: 163062 kbps
Game traffic upload: 14909 kbps
Game traffic download: 24859 kbps
Queue discipline: pfifo (for game traffic in HFSC)
==== Package Status ====
All required packages are installed.

==== Detailed Technical Information ====
Traffic Control (tc) Queues:
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 lan3 root refcnt 2 limit 10240p flows 1024 quantum 1514 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 hfsc 1: dev lan0 root refcnt 2 default 13
Sent 96103666 bytes 386028 pkt (dropped 2, overlimits 15284 requeues 0)
backlog 0b 0p requeues 0
qdisc fq_codel 8074: dev lan0 parent 1:13 limit 10240p flows 1024 quantum 3000 target 4ms interval 100ms memory_limit 2418300b ecn drop_batch 64
Sent 95828045 bytes 383390 pkt (dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
maxpacket 1554 drop_overlimit 0 new_flow_count 26015 ecn_mark 0
new_flows_len 1 old_flows_len 3
qdisc fq_codel 8076: dev lan0 parent 1:15 limit 10240p flows 1024 quantum 3000 target 4ms interval 100ms memory_limit 2418300b 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 pfifo 10: dev lan0 parent 1:11 limit 649p
Sent 198743 bytes 1898 pkt (dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
qdisc fq_codel 8075: dev lan0 parent 1:14 limit 10240p flows 1024 quantum 3000 target 4ms interval 100ms memory_limit 2418300b 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 8073: dev lan0 parent 1:12 limit 10240p flows 1024 quantum 3000 target 4ms interval 100ms memory_limit 2418300b ecn drop_batch 64
Sent 76878 bytes 740 pkt (dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
maxpacket 1490 drop_overlimit 0 new_flow_count 457 ecn_mark 0
new_flows_len 1 old_flows_len 0
qdisc ingress ffff: dev lan0 parent ffff:fff1 ----------------
Sent 546874591 bytes 497935 pkt (dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
qdisc fq_codel 0: dev lan1 root refcnt 2 limit 10240p flows 1024 quantum 1514 target 5ms interval 100ms memory_limit 4Mb ecn drop_batch 64
Sent 251145741 bytes 209336 pkt (dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
maxpacket 17054 drop_overlimit 0 new_flow_count 39 ecn_mark 0
new_flows_len 0 old_flows_len 0
qdisc fq_codel 0: dev lan2 root refcnt 2 limit 10240p flows 1024 quantum 1514 target 5ms interval 100ms memory_limit 4Mb ecn drop_batch 64
Sent 3354980407 bytes 3048412 pkt (dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
maxpacket 1446 drop_overlimit 0 new_flow_count 9 ecn_mark 0
new_flows_len 0 old_flows_len 0
qdisc noqueue 0: dev br-gamer 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 hfsc 1: dev ifb-lan0 root refcnt 2 default 13
Sent 573650733 bytes 497859 pkt (dropped 74, overlimits 543592 requeues 0)
backlog 0b 0p requeues 0
qdisc pfifo 10: dev ifb-lan0 parent 1:11 limit 1092p
Sent 374 bytes 1 pkt (dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
qdisc fq_codel 807a: dev ifb-lan0 parent 1:15 limit 10240p flows 1024 quantum 3000 target 4ms interval 100ms memory_limit 3981Kb ecn drop_batch 64
Sent 1985 bytes 17 pkt (dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
maxpacket 170 drop_overlimit 0 new_flow_count 17 ecn_mark 0
new_flows_len 1 old_flows_len 0
qdisc fq_codel 8078: dev ifb-lan0 parent 1:13 limit 10240p flows 1024 quantum 3000 target 4ms interval 100ms memory_limit 3981Kb ecn drop_batch 64
Sent 573646577 bytes 497833 pkt (dropped 74, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
maxpacket 1554 drop_overlimit 0 new_flow_count 22386 ecn_mark 0
new_flows_len 1 old_flows_len 3
qdisc fq_codel 8077: dev ifb-lan0 parent 1:12 limit 10240p flows 1024 quantum 3000 target 4ms interval 100ms memory_limit 3981Kb ecn drop_batch 64
Sent 528 bytes 4 pkt (dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
maxpacket 186 drop_overlimit 0 new_flow_count 3 ecn_mark 0
new_flows_len 1 old_flows_len 0
qdisc fq_codel 8079: dev ifb-lan0 parent 1:14 limit 10240p flows 1024 quantum 3000 target 4ms interval 100ms memory_limit 3981Kb ecn drop_batch 64
Sent 218 bytes 2 pkt (dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
maxpacket 114 drop_overlimit 0 new_flow_count 2 ecn_mark 0
new_flows_len 1 old_flows_len 0

==== Nftables Ruleset (dscptag) ====
chain dscptag {
type filter hook forward priority filter; policy accept;
meta l4proto udp ct original proto-src { 6881-6889, 51413 } counter packets 0 bytes 0 jump mark_cs1
meta l4proto udp ct original proto-dst { 6881-6889, 51413 } counter packets 1 bytes 88 jump mark_cs1
meta l4proto tcp ct original proto-dst { 6881-6889, 51413 } counter packets 0 bytes 0 jump mark_cs1
meta length < 100 tcp flags ack add @xfst4ack { ct id . ct direction limit rate over 483600/second burst 5 packets } counter packets 0 bytes 0 jump drop995
meta length < 100 tcp flags ack add @fast4ack { ct id . ct direction limit rate over 48360/second burst 5 packets } counter packets 0 bytes 0 jump drop95
meta length < 100 tcp flags ack add @med4ack { ct id . ct direction limit rate over 4836/second burst 5 packets } counter packets 104 bytes 4791 jump drop50
meta length < 100 tcp flags ack add @slow4ack { ct id . ct direction limit rate over 4836/second burst 5 packets } counter packets 53 bytes 2530 jump drop50
meta l4proto tcp ct bytes < 10191375 jump mark_500ms
meta l4proto tcp ct bytes > 203827500 jump mark_10s
meta l4proto tcp ip dscp != cs1 add @slowtcp { ct id . ct direction limit rate 150/second burst 150 packets } ip dscp set af42 counter packets 30525 bytes 25138131
meta l4proto tcp ip6 dscp != cs1 add @slowtcp { ct id . ct direction limit rate 150/second burst 150 packets } ip6 dscp set af42 counter packets 17644 bytes 13473270
ip saddr 192.168.10.2 udp dport != { 80, 443 } ip dscp set cs5 counter packets 294 bytes 18414 comment "Game_Console_Outbound"
udp sport != { 80, 443 } ip daddr 192.168.10.2 ip dscp set cs5 counter packets 299723 bytes 305850648 comment "Game_Console_Inbound"
ip saddr 192.168.10.2 udp sport 3074 udp dport 30000-65535 ip dscp set cs5 counter packets 0 bytes 0 comment "cod1"
ip daddr 192.168.10.2 udp dport 3074 ip dscp set cs5 counter packets 0 bytes 0 comment "cod2"
ip saddr 192.168.10.2 udp dport 56418 ip dscp set cs5 counter packets 0 bytes 0 comment "xbox"
udp sport 56418 ip daddr 192.168.10.2 ip dscp set cs5 counter packets 0 bytes 0 comment "xbox"
meta l4proto { tcp, udp } ip saddr 192.168.10.2 ip dscp set ef counter packets 1919 bytes 97091 comment "console"
meta l4proto { tcp, udp } ip daddr 192.168.10.2 ip dscp set ef counter packets 369807 bytes 395986158 comment "cosole"
ip saddr 192.168.10.2 udp sport 56418 udp dport 50000-65535 ip dscp set cs5 counter packets 0 bytes 0 comment "xbox"
ip saddr 192.168.10.2 udp sport 50000-65535 udp dport 56418 ip dscp set cs5 counter packets 0 bytes 0 comment "xbox"
udp sport 56418 ip daddr 192.168.10.2 udp dport 50000-65535 ip dscp set cs5 counter packets 0 bytes 0 comment "xbox"
udp sport 50000-65535 ip daddr 192.168.10.2 udp dport 56418 ip dscp set cs5 counter packets 0 bytes 0 comment "xbox"
meta priority set ip dscp map @priomap counter packets 378201 bytes 400194485
meta priority set ip6 dscp map @priomap counter packets 123227 bytes 146067485
ct mark set ip dscp | 0x80 counter packets 378202 bytes 400194521
ct mark set ip6 dscp | 0x80 counter packets 123227 bytes 146067485
}

thanks for the corrections, I was confuse

There is a reference about QoS bins above rule editor - everything in upper bin is treated identically.

Hello,

i still get random ping spikes if the TV is streaming videos / movies while i'm playing Counter Strike 2 or use the ping commandD.

There is no difference between streaming providers or if i stream in 4K or 1080p.

I tried lowering the bandwidth, no difference, i created custom rules to move the TV traffic in to lower queues, not difference.

Please fill issue template - what is your router, internet parameters, changes you made etc as follows:

You prioritiz# up a lot, likely all/most of traffic which neitralizes intent of priority usage actually pre-empting lesser priority usage.

This configures as if your game console was a game server in cloud. Please review your rules and mark outgoing connections to game server, as this will not match any realistic traffic.

BusyBox v1.36.1 (2025-02-03 23:09:37 UTC) built-in shell (ash)


| |.-----.-----.-----.| | | |.----.| |_
| - || _ | -| || | | || || |
|
_____|| |
||||___||| |____|
|
| W I R E L E S S F R E E D O M

OpenWrt 24.10.0, r28427-6df0e3d02a

root@OpenWrt:~# ubus call system board
/qosmate check_version
/etc/init.d/qosmate s{
"kernel": "6.6.73",
"hostname": "OpenWrt",
"system": "UBNT_E300 (CN7030p1.2-1000-AAP)",
"model": "Ubiquiti EdgeRouter 4",tatus
cat
"board_name": "ubnt,edgerouter-4",
"rootfs_type": "squashfs",
"release": {
"distribution": "OpenWrt",
"version": "24.10.0",
"revision": "r28427-6df0e3d02a",
"target": "octeon/generic",
"description": "OpenWrt 24.10.0 r28427-6df0e3d02a",
"builddate": "1738624177"
}
}
root@OpenWrt:~# /etc/init.d/qosmate check_version
/etc/config/qosmate
ifstatus wan | grep -e deviceBackend versions:
Current version: 0.5.52
Latest version: 0.5.52
Frontend versions:
Current version: 1.0.22
Latest version: 1.0.22

QoSmate is up to date.
root@OpenWrt:~# /etc/init.d/qosmate status
==== qosmate Status ====
qosmate autostart is enabled.
qosmate service is enabled.
Traffic shaping (HFSC) is active on the egress interface (lan0).
Traffic shaping is active on the ingress interface (ifb-lan0).
==== Overall Status ====
qosmate is currently active and managing traffic shaping.
==== Current Settings ====
Upload rate: 96732 kbps
Download rate: 163062 kbps
Game traffic upload: 14909 kbps
Game traffic download: 24859 kbps
Queue discipline: pfifo (for game traffic in HFSC)
==== Package Status ====
All required packages are installed.

==== Detailed Technical Information ====
Traffic Control (tc) Queues:
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 lan3 root refcnt 2 limit 10240p flows 1024 quantum 1514 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 hfsc 1: dev lan0 root refcnt 2 default 13
Sent 102874014 bytes 424968 pkt (dropped 2, overlimits 18123 requeues 0)
backlog 0b 0p requeues 0
qdisc fq_codel 8074: dev lan0 parent 1:13 limit 10240p flows 1024 quantum 3000 target 4ms interval 100ms memory_limit 2418300b ecn drop_batch 64
Sent 102540594 bytes 421769 pkt (dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
maxpacket 1554 drop_overlimit 0 new_flow_count 28713 ecn_mark 0
new_flows_len 1 old_flows_len 3
qdisc fq_codel 8076: dev lan0 parent 1:15 limit 10240p flows 1024 quantum 3000 target 4ms interval 100ms memory_limit 2418300b 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 pfifo 10: dev lan0 parent 1:11 limit 649p
Sent 210281 bytes 2002 pkt (dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
qdisc fq_codel 8075: dev lan0 parent 1:14 limit 10240p flows 1024 quantum 3000 target 4ms interval 100ms memory_limit 2418300b 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 8073: dev lan0 parent 1:12 limit 10240p flows 1024 quantum 3000 target 4ms interval 100ms memory_limit 2418300b ecn drop_batch 64
Sent 123139 bytes 1197 pkt (dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
maxpacket 1490 drop_overlimit 0 new_flow_count 778 ecn_mark 0
new_flows_len 1 old_flows_len 0
qdisc ingress ffff: dev lan0 parent ffff:fff1 ----------------
Sent 623778819 bytes 566017 pkt (dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
qdisc fq_codel 0: dev lan1 root refcnt 2 limit 10240p flows 1024 quantum 1514 target 5ms interval 100ms memory_limit 4Mb ecn drop_batch 64
Sent 330623998 bytes 276776 pkt (dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
maxpacket 17054 drop_overlimit 0 new_flow_count 47 ecn_mark 0
new_flows_len 0 old_flows_len 0
qdisc fq_codel 0: dev lan2 root refcnt 2 limit 10240p flows 1024 quantum 1514 target 5ms interval 100ms memory_limit 4Mb ecn drop_batch 64
Sent 3355619150 bytes 3050356 pkt (dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
maxpacket 1446 drop_overlimit 0 new_flow_count 10 ecn_mark 0
new_flows_len 0 old_flows_len 0
qdisc noqueue 0: dev br-gamer 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 hfsc 1: dev ifb-lan0 root refcnt 2 default 13
Sent 654191369 bytes 565911 pkt (dropped 104, overlimits 634947 requeues 0)
backlog 0b 0p requeues 0
qdisc pfifo 10: dev ifb-lan0 parent 1:11 limit 1092p
Sent 748 bytes 2 pkt (dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
qdisc fq_codel 807a: dev ifb-lan0 parent 1:15 limit 10240p flows 1024 quantum 3000 target 4ms interval 100ms memory_limit 3981Kb ecn drop_batch 64
Sent 2362 bytes 20 pkt (dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
maxpacket 170 drop_overlimit 0 new_flow_count 20 ecn_mark 0
new_flows_len 1 old_flows_len 0
qdisc fq_codel 8078: dev ifb-lan0 parent 1:13 limit 10240p flows 1024 quantum 3000 target 4ms interval 100ms memory_limit 3981Kb ecn drop_batch 64
Sent 654186462 bytes 565881 pkt (dropped 104, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
maxpacket 1554 drop_overlimit 0 new_flow_count 25497 ecn_mark 0
new_flows_len 0 old_flows_len 1
qdisc fq_codel 8077: dev ifb-lan0 parent 1:12 limit 10240p flows 1024 quantum 3000 target 4ms interval 100ms memory_limit 3981Kb ecn drop_batch 64
Sent 528 bytes 4 pkt (dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
maxpacket 186 drop_overlimit 0 new_flow_count 3 ecn_mark 0
new_flows_len 1 old_flows_len 0
qdisc fq_codel 8079: dev ifb-lan0 parent 1:14 limit 10240p flows 1024 quantum 3000 target 4ms interval 100ms memory_limit 3981Kb ecn drop_batch 64
Sent 218 bytes 2 pkt (dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
maxpacket 114 drop_overlimit 0 new_flow_count 2 ecn_mark 0
new_flows_len 1 old_flows_len 0

==== Nftables Ruleset (dscptag) ====
chain dscptag {
type filter hook forward priority filter; policy accept;
meta l4proto udp ct original proto-src { 6881-6889, 51413 } counter packets 0 bytes 0 jump mark_cs1
meta l4proto udp ct original proto-dst { 6881-6889, 51413 } counter packets 1 bytes 88 jump mark_cs1
meta l4proto tcp ct original proto-dst { 6881-6889, 51413 } counter packets 0 bytes 0 jump mark_cs1
meta length < 100 tcp flags ack add @xfst4ack { ct id . ct direction limit rate over 483600/second burst 5 packets } counter packets 0 bytes 0 jump drop995
meta length < 100 tcp flags ack add @fast4ack { ct id . ct direction limit rate over 48360/second burst 5 packets } counter packets 0 bytes 0 jump drop95
meta length < 100 tcp flags ack add @med4ack { ct id . ct direction limit rate over 4836/second burst 5 packets } counter packets 225 bytes 10672 jump drop50
meta length < 100 tcp flags ack add @slow4ack { ct id . ct direction limit rate over 4836/second burst 5 packets } counter packets 110 bytes 5485 jump drop50
meta l4proto tcp ct bytes < 10191375 jump mark_500ms
meta l4proto tcp ct bytes > 203827500 jump mark_10s
meta l4proto tcp ip dscp != cs1 add @slowtcp { ct id . ct direction limit rate 150/second burst 150 packets } ip dscp set af42 counter packets 34486 bytes 26288230
meta l4proto tcp ip6 dscp != cs1 add @slowtcp { ct id . ct direction limit rate 150/second burst 150 packets } ip6 dscp set af42 counter packets 23265 bytes 17600298
ip saddr 192.168.10.2 udp dport != { 80, 443 } ip dscp set cs5 counter packets 294 bytes 18414 comment "Game_Console_Outbound"
udp sport != { 80, 443 } ip daddr 192.168.10.2 ip dscp set cs5 counter packets 299872 bytes 305871401 comment "Game_Console_Inbound"
ip saddr 192.168.10.2 udp sport 3074 udp dport 30000-65535 ip dscp set cs5 counter packets 0 bytes 0 comment "cod1"
ip daddr 192.168.10.2 udp dport 3074 ip dscp set cs5 counter packets 0 bytes 0 comment "cod2"
ip saddr 192.168.10.2 udp dport 56418 ip dscp set cs5 counter packets 0 bytes 0 comment "xbox"
udp sport 56418 ip daddr 192.168.10.2 ip dscp set cs5 counter packets 0 bytes 0 comment "xbox"
meta l4proto { tcp, udp } ip saddr 192.168.10.2 ip dscp set ef counter packets 2023 bytes 103013 comment "console"
meta l4proto { tcp, udp } ip daddr 192.168.10.2 ip dscp set ef counter packets 371219 bytes 396330345 comment "cosole"
ip saddr 192.168.10.2 udp sport 56418 udp dport 50000-65535 ip dscp set cs5 counter packets 0 bytes 0 comment "xbox"
ip saddr 192.168.10.2 udp sport 50000-65535 udp dport 56418 ip dscp set cs5 counter packets 0 bytes 0 comment "xbox"
udp sport 56418 ip daddr 192.168.10.2 udp dport 50000-65535 ip dscp set cs5 counter packets 0 bytes 0 comment "xbox"
udp sport 50000-65535 ip daddr 192.168.10.2 udp dport 56418 ip dscp set cs5 counter packets 0 bytes 0 comment "xbox"
meta priority set ip dscp map @priomap counter packets 382501 bytes 401444155
meta priority set ip6 dscp map @priomap counter packets 187906 bytes 221871588
ct mark set ip dscp | 0x80 counter packets 382502 bytes 401444191
ct mark set ip6 dscp | 0x80 counter packets 187906 bytes 221871588
}
}

==== Custom Rules Table Status ====
Custom rules table (qosmate_custom) is not active or doesn't exist.
root@OpenWrt:~# cat /etc/config/qosmate

config global 'global'
option enabled '1'

config settings 'settings'
option WAN 'lan0'
option DOWNRATE '163062'
option UPRATE '96732'
option ROOT_QDISC 'hfsc'

config advanced 'advanced'
option PRESERVE_CONFIG_FILES '1'
option WASHDSCPUP '0'
option WASHDSCPDOWN '0'
option BWMAXRATIO '20'
option UDP_RATE_LIMIT_ENABLED '0'
option TCP_UPGRADE_ENABLED '1'
option UDPBULKPORT '51413,6881-6889'
option TCPBULKPORT '51413,6881-6889'
option NFT_HOOK 'forward'
option NFT_PRIORITY '0'

config hfsc 'hfsc'
option LINKTYPE 'ethernet'
option OH '44'
option gameqdisc 'pfifo'
option nongameqdisc 'fq_codel'
option nongameqdiscoptions 'besteffort ack-filter'
option MAXDEL '24'
option PFIFOMIN '5'
option PACKETSIZE '450'
option netemdelayms '30'
option netemjitterms '7'
option netemdist 'normal'
option pktlossp 'none'
option GAMEUP '14909'
option GAMEDOWN '24859'

config cake 'cake'
option COMMON_LINK_PRESETS 'ethernet'
option PRIORITY_QUEUE_INGRESS 'diffserv4'
option PRIORITY_QUEUE_EGRESS 'diffserv4'
option HOST_ISOLATION '1'
option NAT_INGRESS '1'
option NAT_EGRESS '1'
option ACK_FILTER_EGRESS 'auto'
option AUTORATE_INGRESS '0'

config custom_rules 'custom_rules'

config rule
option name 'Game_Console_Outbound'
option proto 'udp'
option src_ip '192.168.10.2'
list dest_port '!=80'
list dest_port '!=443'
option class 'cs5'
option counter '1'
option enabled '1'

config rule
option name 'Game_Console_Inbound'
option proto 'udp'
option dest_ip '192.168.10.2'
list src_port '!=80'
list src_port '!=443'
option class 'cs5'
option counter '1'
option enabled '1'

config rule
option name 'cod1'
option proto 'udp'
option src_ip '192.168.10.2'
option src_port '3074'
option dest_port '30000-65535'
option class 'cs5'
option counter '1'
option enabled '1'

config rule
option name 'cod2'
option proto 'udp'
option dest_ip '192.168.10.2'
option dest_port '3074'
option class 'cs5'
option counter '1'
option enabled '1'

config rule
option name 'xbox'
option proto 'udp'
option src_ip '192.168.10.2'
list dest_port '56418'
option class 'cs5'
option counter '1'
option enabled '1'

config rule
option name 'xbox'
option proto 'udp'
option dest_ip '192.168.10.2'
list src_port '56418'
option class 'cs5'
option counter '1'
option enabled '1'

config rule
option name 'console'
option proto 'tcp udp'
list src_ip '192.168.10.2'
option class 'ef'
option counter '1'
option enabled '1'

config rule
option name 'cosole'
option proto 'tcp udp'
list dest_ip '192.168.10.2'
option class 'ef'
option counter '1'
option enabled '1'

config rule
option name 'xbox'
option proto 'udp'
option src_ip '192.168.10.2'
option src_port '56418'
option dest_port '50000-65535'
option class 'cs5'
option counter '1'
option enabled '1'

config rule
option name 'xbox'
option proto 'udp'
option src_ip '192.168.10.2'
option src_port '50000-65535'
option dest_port '56418'
option class 'cs5'
option counter '1'
option enabled '1'

config rule
option name 'xbox'
option proto 'udp'
option dest_ip '192.168.10.2'
option src_port '56418'
option dest_port '50000-65535'
option class 'cs5'
option counter '1'
option enabled '1'

config rule
option name 'xbox'
option proto 'udp'
option dest_ip '192.168.10.2'
option src_port '50000-65535'
option dest_port '56418'
option class 'cs5'
option counter '1'
option enabled '1'

root@OpenWrt:~# ifstatus wan | grep -e device

`

*** 1. * List item**

Mr. brada this what im rocking right now, I have done this reflashing my router like 3 times to make this work

config custom_rules 'custom_rules'

config rule
option name 'Game_Console_Outbound'
option proto 'udp'
option src_ip '192.168.10.2'
list dest_port '!=80'
list dest_port '!=443'
option class 'cs5'
option counter '1'

config rule
option name 'Game_Console_Inbound'
option proto 'udp'
option dest_ip '192.168.10.2'
list src_port '!=80'
list src_port '!=443'
option class 'cs5'
option counter '1'

config rule
option name 'cod1'
option proto 'udp'
option src_ip '192.168.10.2'
option src_port '3074'
option dest_port '30000-65535'
option class 'cs5'
option counter '1'

config rule
option name 'cod2'
option proto 'udp'
option dest_ip '192.168.10.2'
option dest_port '3074'
option class 'cs5'
option counter '1'

Mr. brada, this is what I'm rocking right now. I have done this reflashing my router like 3 times to get this to work.

type or paste code here

config custom_rules 'custom_rules'

config rule
option name 'Game_Console_Outbound'
option proto 'udp'
option src_ip '192.168.10.2'
list dest_port '!=80'
list dest_port '!=443'
option class 'cs5'
option counter '1'

config rule
option name 'Game_Console_Inbound'
option proto 'udp'
option dest_ip '192.168.10.2'
list src_port '!=80'
list src_port '!=443'
option class 'cs5'
option counter '1'

config rule
option name 'cod1'
option proto 'udp'
option src_ip '192.168.10.2'
option src_port '3074'
option dest_port '30000-65535'
option class 'cs5'
option counter '1'

config rule
option name 'cod2'
option proto 'udp'
option dest_ip '192.168.10.2'
option dest_port '3074'
option class 'cs5'
option counter '1'

type or paste code here

more info if you wanna help my router going to the moon :rocket:

type or paste code here

BusyBox v1.36.1 (2025-02-03 23:09:37 UTC) built-in shell (ash)


| |.-----.-----.-----.| | | |.----.| |_
| - || _ | -| || | | || || |
|
_____|| |
||||___||| |____|
|
| W I R E L E S S F R E E D O M

OpenWrt 24.10.0, r28427-6df0e3d02a

root@OpenWrt:~# ubus call system board
qosmate check_version
/etc/init.d/qosmate status
cat{
"kernel": "6.6.73",
"hostname": "OpenWrt",
"system": "UBNT_E300 (CN7030p1.2-1000-AAP)",
"model": "Ubiquiti EdgeRouter 4",
"board_name": "ubnt,edgerouter-4",
"rootfs_type": "squashfs",
"release": {
"distribution": "OpenWrt",
"version": "24.10.0",
"revision": "r28427-6df0e3d02a",
"target": "octeon/generic",
"description": "OpenWrt 24.10.0 r28427-6df0e3d02a",
"builddate": "1738624177"
}
}
root@OpenWrt:~# /etc/init.d/qosmate check_version
mate
ifstatus wan | grep -e deviceBackend versions:
Current version: 0.5.52
Latest version: 0.5.52
Frontend versions:
Current version: 1.0.22
Latest version: 1.0.22

QoSmate is up to date.
root@OpenWrt:~# /etc/init.d/qosmate status
==== qosmate Status ====
qosmate autostart is enabled.
qosmate service is enabled.
Traffic shaping (HFSC) is active on the egress interface (lan0).
Traffic shaping is active on the ingress interface (ifb-lan0).
==== Overall Status ====
qosmate is currently active and managing traffic shaping.
==== Current Settings ====
Upload rate: 96732 kbps
Download rate: 163062 kbps
Game traffic upload: 14909 kbps
Game traffic download: 24859 kbps
Queue discipline: pfifo (for game traffic in HFSC)
==== Package Status ====
All required packages are installed.

==== Detailed Technical Information ====
Traffic Control (tc) Queues:
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 lan3 root refcnt 2 limit 10240p flows 1024 quantum 1514 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 hfsc 1: dev lan0 root refcnt 2 default 13
Sent 25990751 bytes 99516 pkt (dropped 2, overlimits 7479 requeues 0)
backlog 0b 0p requeues 0
qdisc fq_codel 8059: dev lan0 parent 1:12 limit 10240p flows 1024 quantum 3000 target 4ms interval 100ms memory_limit 2418300b ecn drop_batch 64
Sent 3227679 bytes 8290 pkt (dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
maxpacket 1554 drop_overlimit 0 new_flow_count 1869 ecn_mark 0
new_flows_len 1 old_flows_len 3
qdisc fq_codel 805b: dev lan0 parent 1:14 limit 10240p flows 1024 quantum 3000 target 4ms interval 100ms memory_limit 2418300b 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 pfifo 10: dev lan0 parent 1:11 limit 649p
Sent 12107022 bytes 58650 pkt (dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
qdisc fq_codel 805a: dev lan0 parent 1:13 limit 10240p flows 1024 quantum 3000 target 4ms interval 100ms memory_limit 2418300b ecn drop_batch 64
Sent 10655617 bytes 32574 pkt (dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
maxpacket 1554 drop_overlimit 0 new_flow_count 4275 ecn_mark 0
new_flows_len 1 old_flows_len 6
qdisc fq_codel 805c: dev lan0 parent 1:15 limit 10240p flows 1024 quantum 3000 target 4ms interval 100ms memory_limit 2418300b 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 ingress ffff: dev lan0 parent ffff:fff1 ----------------
Sent 60809708 bytes 82480 pkt (dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
qdisc fq_codel 0: dev lan1 root refcnt 2 limit 10240p flows 1024 quantum 1514 target 5ms interval 100ms memory_limit 4Mb ecn drop_batch 64
Sent 717894439 bytes 725631 pkt (dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
maxpacket 6056 drop_overlimit 0 new_flow_count 689 ecn_mark 0
new_flows_len 0 old_flows_len 0
qdisc fq_codel 0: dev lan2 root refcnt 2 limit 10240p flows 1024 quantum 1514 target 5ms interval 100ms memory_limit 4Mb ecn drop_batch 64
Sent 112235397 bytes 122083 pkt (dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
maxpacket 1514 drop_overlimit 0 new_flow_count 8 ecn_mark 0
new_flows_len 0 old_flows_len 0
qdisc noqueue 0: dev br-gamer 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 hfsc 1: dev ifb-lan0 root refcnt 2 default 13
Sent 65254089 bytes 82470 pkt (dropped 4, overlimits 51762 requeues 0)
backlog 0b 0p requeues 0
qdisc fq_codel 805d: dev ifb-lan0 parent 1:12 limit 10240p flows 1024 quantum 3000 target 4ms interval 100ms memory_limit 3981Kb 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 805f: dev ifb-lan0 parent 1:14 limit 10240p flows 1024 quantum 3000 target 4ms interval 100ms memory_limit 3981Kb ecn drop_batch 64
Sent 275 bytes 2 pkt (dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
maxpacket 171 drop_overlimit 0 new_flow_count 2 ecn_mark 0
new_flows_len 1 old_flows_len 0
qdisc pfifo 10: dev ifb-lan0 parent 1:11 limit 1092p
Sent 1528 bytes 8 pkt (dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
qdisc fq_codel 805e: dev ifb-lan0 parent 1:13 limit 10240p flows 1024 quantum 3000 target 4ms interval 100ms memory_limit 3981Kb ecn drop_batch 64
Sent 65246703 bytes 82433 pkt (dropped 3, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
maxpacket 1554 drop_overlimit 0 new_flow_count 9606 ecn_mark 0
new_flows_len 1 old_flows_len 4
qdisc fq_codel 8060: dev ifb-lan0 parent 1:15 limit 10240p flows 1024 quantum 3000 target 4ms interval 100ms memory_limit 3981Kb ecn drop_batch 64
Sent 2738 bytes 23 pkt (dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
maxpacket 130 drop_overlimit 0 new_flow_count 23 ecn_mark 0
new_flows_len 1 old_flows_len 0

==== Nftables Ruleset (dscptag) ====
chain dscptag {
type filter hook forward priority filter; policy accept;
counter packets 183175 bytes 81278133 jump mark_cs0
meta l4proto udp ct original proto-src { 6881-6889, 51413 } counter packets 0 bytes 0 jump mark_cs1
meta l4proto udp ct original proto-dst { 6881-6889, 51413 } counter packets 0 bytes 0 jump mark_cs1
meta l4proto tcp ct original proto-dst { 6881-6889, 51413 } counter packets 0 bytes 0 jump mark_cs1
meta length < 100 tcp flags ack add @xfst4ack { ct id . ct direction limit rate over 483600/second burst 5 packets } counter packets 0 bytes 0 jump drop995
meta length < 100 tcp flags ack add @fast4ack { ct id . ct direction limit rate over 48360/second burst 5 packets } counter packets 0 bytes 0 jump drop95
meta length < 100 tcp flags ack add @med4ack { ct id . ct direction limit rate over 4836/second burst 5 packets } counter packets 3037 bytes 191845 jump drop50
meta length < 100 tcp flags ack add @slow4ack { ct id . ct direction limit rate over 4836/second burst 5 packets } counter packets 1550 bytes 97736 jump drop50
meta l4proto tcp ct bytes < 10191375 jump mark_500ms
meta l4proto tcp ct bytes > 203827500 jump mark_10s
meta l4proto tcp ip dscp != cs1 add @slowtcp { ct id . ct direction limit rate 150/second burst 150 packets } ip dscp set af42 counter packets 16798 bytes 6018624
meta l4proto tcp ip6 dscp != cs1 add @slowtcp { ct id . ct direction limit rate 150/second burst 150 packets } ip6 dscp set af42 counter packets 29226 bytes 16096060
ip saddr 192.168.10.2 udp dport != { 80, 443 } ip dscp set cs5 counter packets 58650 bytes 8939922 comment "Game_Console_Outbound"
udp sport != { 80, 443 } ip daddr 192.168.10.2 ip dscp set cs5 counter packets 22699 bytes 15588581 comment "Game_Console_Inbound"
ip saddr 192.168.10.2 udp sport 3074 udp dport 30000-65535 ip dscp set cs5 counter packets 58514 bytes 8930154 comment "cod1"
ip daddr 192.168.10.2 udp dport 3074 ip dscp set cs5 counter packets 22662 bytes 15583810 comment "cod2"
meta priority set ip dscp map @priomap counter packets 99338 bytes 30931283
meta priority set ip6 dscp map @priomap counter packets 81616 bytes 50206488
ct mark set ip dscp | 0x80 counter packets 99338 bytes 30931283
ct mark set ip6 dscp | 0x80 counter packets 81616 bytes 50206488
oifname "lan0" jump mark_cs0
}
}

==== Custom Rules Table Status ====
Custom rules table (qosmate_custom) is not active or doesn't exist.
root@OpenWrt:~# cat /etc/config/qosmate

config global 'global'
option enabled '1'

config settings 'settings'
option WAN 'lan0'
option DOWNRATE '163062'
option UPRATE '96732'
option ROOT_QDISC 'hfsc'

config advanced 'advanced'
option PRESERVE_CONFIG_FILES '1'
option WASHDSCPUP '1'
option WASHDSCPDOWN '1'
option BWMAXRATIO '20'
option UDP_RATE_LIMIT_ENABLED '0'
option TCP_UPGRADE_ENABLED '1'
option UDPBULKPORT '51413,6881-6889'
option TCPBULKPORT '51413,6881-6889'
option NFT_HOOK 'forward'
option NFT_PRIORITY '0'

config hfsc 'hfsc'
option LINKTYPE 'ethernet'
option OH '44'
option gameqdisc 'pfifo'
option nongameqdisc 'fq_codel'
option nongameqdiscoptions 'besteffort ack-filter'
option MAXDEL '24'
option PFIFOMIN '5'
option PACKETSIZE '450'
option netemdelayms '30'
option netemjitterms '7'
option netemdist 'normal'
option pktlossp 'none'
option GAMEUP '14909'
option GAMEDOWN '24859'

config cake 'cake'
option COMMON_LINK_PRESETS 'ethernet'
option PRIORITY_QUEUE_INGRESS 'diffserv4'
option PRIORITY_QUEUE_EGRESS 'diffserv4'
option HOST_ISOLATION '1'
option NAT_INGRESS '1'
option NAT_EGRESS '1'
option ACK_FILTER_EGRESS 'auto'
option AUTORATE_INGRESS '0'

config custom_rules 'custom_rules'

config rule
option name 'Game_Console_Outbound'
option proto 'udp'
option src_ip '192.168.10.2'
list dest_port '!=80'
list dest_port '!=443'
option class 'cs5'
option counter '1'

config rule
option name 'Game_Console_Inbound'
option proto 'udp'
option dest_ip '192.168.10.2'
list src_port '!=80'
list src_port '!=443'
option class 'cs5'
option counter '1'

config rule
option name 'cod1'
option proto 'udp'
option src_ip '192.168.10.2'
option src_port '3074'
option dest_port '30000-65535'
option class 'cs5'
option counter '1'

config rule
option name 'cod2'
option proto 'udp'
option dest_ip '192.168.10.2'
option dest_port '3074'
option class 'cs5'
option counter '1'

root@OpenWrt:~# ifstatus wan | grep -e device

type or paste code here

There are exactly zero connections ever from the world to a closed port on your console. Just make 2 rules with CoD port lists as destination - one tcp one udp.

3074 is the main game interaction, start with that alone.

Try to paste your text output into ``` </> text boxes.

Good morning, I am going to try netem for a while, any suggestions? Has anyone tried this qdisc and liked it? What configuration do you use? As for rules, the ones shared by @hudra are more than enough for cod?

  1. @raynelv Please relax and make sure to format code, command-line output, and commands properly as follows:

Just make sure you "sandwich" your text between two rows of backtick characters ` (which themselves will be invisible in the preview) looking something like this in the editor:
```
Your Pasted Text as preformatted text with fixed width font
1
1111 (note with fixed-width fonts the numbers are right-aligned)
```
but looking like this in the rendered forum:

Your Pasted Text as preformatted text with fixed width font
   1
1111 (note with fixed-width fonts the numbers are right-aligned)
  1. Please don’t start cross-posting randomly, and don’t claim that we're laughing at router memory because that’s simply not true and doesn’t make any sense. WTF.

Now, regarding your issue:

  1. I'm not sure if lan0 is really your WAN interface. That could already be the cause of your problem. Please run the following command and post the output here:
ifstatus wan | grep -e device
  • Also, make sure that your gaming device consistently receives the IP address you are referring to in the rules.
  • Let us know which platform you are playing on—console or PC?
2 Likes

Also a serious question - @raynelv how did you get to such ruleset?

@brada4 How do you mean that? It looks like he just took the rules from the README examples.

@Hudra @brada4 With 1gb speeds is ack necessary? Netem is better on the output only? I woke up today wondering hehe

ACK dropping is totally unnecessary on symmetrical connection.
netem needs to be one way only, its main function is if you get punished for being too close to game server.

And permutated to make them not applicable to real life traffic ....

Netem is really just meant for testing and experimentation... it's probably not the best qdisc for gaming in general. With netem, you can, for example, add latency or jitter to outgoing or incoming packets (or both) that end up in the realtime class (1:11). As @brada4 correctly mentioned, it makes the most sense to apply it only to outgoing packets.

Regarding your connection and the ACK limit function... do you have a 1 Gbit symmetrical connection?

You're basically right... the reversed rules shouldn't be necessary. However, I do get normal hits on them when I use them (for example when playing cod). They don’t cause any harm, so I keep them in the README (and use them myself). One benefit, at least, is that in the connections tab, the DSCP value doesn’t randomly jump back and forth from CS5 to CS0 (or whatever DSCP is being used).