Help prioritizing games with alternative qdisc design

hello this is my result with new script

root@OpenWrt:~# tc -s class show dev eth0.2
class hfsc 1:11 parent 1:1 leaf 10: rt m1 16200Kbit d 25.0ms m2 800Kbit
 Sent 8858108 bytes 39851 pkt (dropped 802, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
 period 0 work 8858108 bytes rtwork 8858108 bytes level 0

class hfsc 1: root
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
 period 0 level 2

class hfsc 1:1 parent 1: ls m1 0bit d 0us m2 18Mbit ul m1 0bit d 0us m2 18Mbit
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
 period 880748 work 174324705 bytes level 1

class hfsc 1:13 parent 1:1 leaf 800f: ls m1 3600Kbit d 25.0ms m2 9Mbit
 Sent 165466597 bytes 1086707 pkt (dropped 1, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
 period 880748 work 165466597 bytes level 0

class hfsc 1:12 parent 1:1 leaf 800e: ls m1 13500Kbit d 25.0ms m2 5400Kbit
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
 period 0 level 0

class hfsc 1:15 parent 1:1 leaf 8011: ls m1 180Kbit d 25.0ms m2 900Kbit
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
 period 0 level 0

class hfsc 1:14 parent 1:1 leaf 8010: ls m1 720Kbit d 25.0ms m2 2700Kbit
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
 period 0 level 0

class fq_codel 800f:262 parent 800f:
 (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
  deficit 1918 count 0 lastcount 0 ldelay 420us
class red 10:1 parent 10:

root@OpenWrt:~#
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 target 5.0ms interval 100.0ms memory_limit 4Mb ecn
 Sent 2884665331 bytes 3311737 pkt (dropped 0, overlimits 0 requeues 294)
 backlog 0b 0p requeues 294
  maxpacket 7570 drop_overlimit 0 new_flow_count 37293 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 hfsc 1: dev eth0.1 root refcnt 2 default 13
 Sent 2523763254 bytes 1747070 pkt (dropped 9140, overlimits 843403 requeues 0)
 backlog 0b 0p requeues 0
Segmentation fault
root@OpenWrt:~#


Oy, DSCP is such a mess... The concept is fine but the standardization is just bonkers.

Practically speaking, what linux does by default to DSCP->WMM is https://wireless.wiki.kernel.org/en/developers/documentation/mac80211/queues?s[]=dscp it seems to take CS1 and CS2 to bulk. CS0 and CS3 are best effort and then CS4,5 are video and CS6,7 are voice. This follows a similar path, but offers two downgraded tiers that merge in the WMM bulk. You can use the CS2 tier for say filesystem traffic or downloads running for a few mins, and the CS1 tier for torrents or downloads running beyond a few mins or backups...

The IETF recommended 000001 tag maps to best effort in the WMM and that seems unfortunate.

fq_codel quantum I think is used like deficit in DRR, so it will move from queue to queue, but ultimately it's the higher level qdisc that determines the number of packets. HFSC will dequeue 1 at a time I believe unlike HTB which will dump multiple packets based on its quantum.

Well, the idea is that LE should be come an end2end DSCP and not just a PHB, so this was selected as it has low probability of being bleached to DCSP 0 during transit. Makes sense IMHO. The ball was dropped early on, when the decision was to keep the default besteffort PHB at 0, instead of moving that up to 1, but there are also good reasons why that was never a realistic option....

+1.

But regarding linux, 4 priority tiers are actually enough for quite a lot of situations, so WMM has most normal cases covered. WMM's fault is not introducing rate limits for AC_VO and AC_VI, but I digress...

Agreed, as long as the mappings work. Cake got this scrambled relative to linux standard behavior. Diffserv4 treats as

diffserv4
Provides a general-purpose Diffserv implementation with four
tins:
Bulk (CS1), 6.25% threshold, generally low priority.
Best Effort (general), 100% threshold.
Video (AF4x, AF3x, CS3, AF2x, CS2, TOS4, TOS1), 50%
threshold.
Voice (CS7, CS6, EF, VA, CS5, CS4), 25% threshold.

So the cake handling of CS3 and CS2 and related classes is different from the WMM handling .. CS2 is bulk WMM and CS3 is BE but both are "video" to cake

Yes, I believe this partially because cake's definitions are not tailored for perfect fit with the arguably wrong default AC mappings. https://tools.ietf.org/html/rfc8325 for example recommends to put CS2 into AC_BE...
Realistically though, that ship has sailed and WMM default definitions will constrain any non compatible marking scheme severely.

As you said DSCPs are a mess :wink:

Ok, I think this thread is pretty long as is... I'm going to post a link to the github version of the script which will always be the most up to date one... @knomax can you accept this post as the answer to the thread and we can do a couple rounds of debugging and then voila it's all here for posterity?

To download the script, go to the above page, click the "raw" button, and then save the page as your script... voila

If you want to put the file directly to your router... log into the router and do:

cd /tmp
wget https://github.com/dlakelan/routerperf/raw/master/SimpleHFSCgamerscript.sh
2 Likes

Yes of course..i start now and will post instructions and for this newer script.

Thanks! I really appreciate all the work that @knomax did in private messages to test versions of this script on a very constrained and non-ideal line, including many hours of router reboots and packet captures. His games look smooth as butter now even though he has only 830kbps upload! It's quite amazing how much better this is than when we started! Thanks for the late nights testing... I am in California and he is in somewhere far away (Greece?) so this international effort should be celebrated!

Thanks @dlakelan i just "throw" an idea and you take it to "another" level without you this will just stay as an "idea".

Great work! This week is too busy for any testing as I have late nights of scheduled maintenance operations. I look forward to testing it this weekend possibly.

2 Likes

For who is this?

wrong thread lol . multiple tabs open

so all we do is install this script into the /tmp folder?

we still need to modify it to work with our own interface such as eth0.1 ?

Correct, download it to the tmp folder, then move it to someplace like /etc/qos.sh and modify it with your interfaces and rates and things... There's a new thread designed to describe how to use it Instructions how to create/copy/configure/run dlakelan Gamer QoS script (or any script)

5 Likes

i got lost on gamingip setup. i dont see that option anymore and on the other thread looks like we are going based on the old script.

so how do we setup our gaming ip?

GAMINGIPSET4="192.168.1.197"
GAMINGIPSET6="realtimeset6"

## set up your ipsets here:

ipset del 192.168.1.197 > /dev/null 2>&1
ipset del realtimeset6 > /dev/null 2>&1
ipset create 192.168.1.197 hash:ip || echo "ERROR: could not create r192.168.1.197 do you have ipsets working?"
ipset create realtimeset6 hash:ip family inet6 || echo "ERROR: could not create realtimeset6 do you have ipsets working?"

leave the script the way it was... and change this section, by adding your ips in the list of the "for" loop


## some examples to add your gaming devices to the realtime sets,
## allows you to have more than one console etc. Just add your ips
## into the list of ips in the for loop

for ip4 in 192.168.1.111 192.168.1.222; do
    ipset add realtimeset4 "$ip4"
done

for ip6 in fd01:0101::1 fd01:0101::2 ; do
    ipset add realtimeset6 "$ip6"
done

image

i believe something like this? both ip are for the same XBox One, one is ip4 and one is ip6

Yes, that's right, but the fd32:... address is a local only address. If you have ipv6 from your ISP you should put the address it has that starts with 2... that will be the public one.

if you don't have IPv6 from your ISP don't worry about it. just leave it.

1 Like

@dlakelan

got this error man

did you type "y" to allow it to continue?