Help prioritizing games with alternative qdisc design

@anon78773196 I'm not sure, is there a "full" version of tc you can install? Otherwise try "uniform" for the distribution.

1 Like

@dlakelan see above..no netem class.

are there any errors you can see? It's probably related to what @anon78773196 said about the tc command not having normal data, try "uniform" for distribution

no all version i had replaced distribution by uniform and error ( what is uniform) if i understand your message

I dont have any errors....i dont understand "uniform"??????

netemdist="uniform"

No distribution data for uniform (/usr/lib/tc//uniform.dist: No such file or directory)
adding fq_codel qdisc for non-game traffic due to fast link
No distribution data for uniform (/usr/lib/tc//uniform.dist: No such file or directory)
adding fq_codel qdisc for non-game traffic due to fast link

We are going to add classification rules via iptable

This is unfortunate, it's related to OpenWrt stripping down everything to fit on tiny routers. It seems like jitter is not possible without some recompile of tc

ah i don't know compiled i never make it's complicated ?

I really don't know either. It's not just compiling an image, you have to make modifications to the way that tc is compiled... This is beyond what I really am likely to get into at the moment. If someone wants to test this out on a RPi4 running raspbian which has a full version of tc, or something like that, it will probably work.

maybe it will work to just copy the distribution data off a real linux? I'll look

i have a raspberry pi 3 b i can test you think ?

the problem is the i don't have the wan and i don't know work the wan for has internet connexion

I can put the dist files on the github archive... you can grab them and install

1 Like

@anon78773196 ok, I pushed to devel a version that has tc-netem directory, you can copy those files to /usr/lib/tc/ on your router and try again!

1 Like

ok is good now

not error

This script prioritizes the UDP packets from / to a set of gaming
machines into a real-time HFSC queue with guaranteed total bandwidth

Based on your settings:

Game upload guarantee = 3400 kbps
Game download guarantee = 9700 kbps

Download direction only works if you install this on a *wired* router
and there is a separate AP wired into your network, because otherwise
there are multiple parallel queues for traffic to leave your router
heading to the LAN.

Based on your link total bandwidth, the **minimum** amount of jitter
you should expect in your network is about:

UP = 1 ms

DOWN = 0 ms

In order to get lower minimum jitter you must upgrade the speed of
your link, no queuing system can help.

Please note for your display rate that:

at 30Hz, one on screen frame lasts:   33.3 ms
at 60Hz, one on screen frame lasts:   16.6 ms
at 144Hz, one on screen frame lasts:   6.9 ms

This means the typical gamer is sensitive to as little as on the order
of 5ms of jitter. To get 5ms minimum jitter you should have bandwidth
in each direction of at least:

7200 kbps

The queue system can ONLY control bandwidth and jitter in the link
between your router and the VERY FIRST device in the ISP
network. Typically you will have 5 to 10 devices between your router
and your gaming server, any of those can have variable delay and ruin
your gaming, and there is NOTHING that your router can do about it.

adding fq_codel qdisc for non-game traffic due to fast link
adding fq_codel qdisc for non-game traffic due to fast link

We are going to add classification rules via iptables to the
FORWARD chain. You should actually read and ensure that these
rules make sense in your firewall before running this script.

Continue? (type y or n and then RETURN/ENTER)
y
YOU MUST PLACE CLASSIFIERS FOR YOUR GAME TRAFFIC HERE
SEND GAME TRAFFIC TO 2:1 (high) or 2:2 (medium) or 2:3 (normal)
Requires use of tc filters! -j CLASSIFY won't work!
DONE!
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 1047311 bytes 2854 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
  maxpacket 1514 drop_overlimit 0 new_flow_count 92 ecn_mark 0
  new_flows_len 0 old_flows_len 0
qdisc hfsc 1: dev eth0.1 root refcnt 2 default 13
 Sent 3537 bytes 14 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
qdisc fq_codel 800b: dev eth0.1 parent 1:13 limit 10240p flows 1024 quantum 3000 target 5.0ms interval 100.0ms memory_limit 1550000b ecn
 Sent 2819 bytes 11 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
  maxpacket 1186 drop_overlimit 0 new_flow_count 8 ecn_mark 0
  new_flows_len 1 old_flows_len 0
qdisc fq_codel 800d: dev eth0.1 parent 1:15 limit 10240p flows 1024 quantum 3000 target 5.0ms interval 100.0ms memory_limit 1550000b ecn
 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 netem 10: dev eth0.1 parent 1:11 limit 143 delay 10.0ms  5.0ms
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
qdisc fq_codel 800a: dev eth0.1 parent 1:12 limit 10240p flows 1024 quantum 3000 target 5.0ms interval 100.0ms memory_limit 1550000b ecn
 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 800c: dev eth0.1 parent 1:14 limit 10240p flows 1024 quantum 3000 target 5.0ms interval 100.0ms memory_limit 1550000b ecn
 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 eth0.2 root refcnt 2 default 13
 Sent 4332 bytes 13 pkt (dropped 0, overlimits 2 requeues 0)
 backlog 0b 0p requeues 0
qdisc fq_codel 8007: dev eth0.2 parent 1:13 limit 10240p flows 1024 quantum 3000 target 6.0ms interval 101.0ms memory_limit 500000b ecn
 Sent 2234 bytes 11 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
  maxpacket 983 drop_overlimit 0 new_flow_count 7 ecn_mark 0
  new_flows_len 1 old_flows_len 0
qdisc fq_codel 8009: dev eth0.2 parent 1:15 limit 10240p flows 1024 quantum 3000 target 6.0ms interval 101.0ms memory_limit 500000b ecn
 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 netem 10: dev eth0.2 parent 1:11 limit 49 delay 10.0ms  5.0ms
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
qdisc fq_codel 8006: dev eth0.2 parent 1:12 limit 10240p flows 1024 quantum 3000 target 6.0ms interval 101.0ms memory_limit 500000b ecn
 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 8008: dev eth0.2 parent 1:14 limit 10240p flows 1024 quantum 3000 target 6.0ms interval 101.0ms memory_limit 500000b ecn
 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
root@OpenWrt:~#

@knomax you have pie so me i have fq codel why ? @dlakelan

Because you have faster connection.

2 Likes

this is a graph with netem

what delay and jitter did you put? This looks like hardly anything compared to Help prioritizing games with alternative qdisc design - #1667 by johnnyt

If I were going to estimate the values off the @johnnyt graph I'd suggest maybe delay 15 jitter 15 uniform or delay 20 jitter 10 normal or something.

anyone who wants to try netem with a jitter distribution grab the latest files from devel, and also put files from the tc-netem directory on github in /usr/lib/tc on your router (@Knomax and others)

then I suggest to set

gameqdisc="netem"
netemdelayms="10"
netemjitterms="5"
netemdist="normal"

Now you can set either "normal" or "uniform" for netemdist and you can adjust the mean delay with netemdelayms and the amount of jitter with netemjitterms. you have to have a mean delay in order to have jitter, what it does is it chooses random delays around that mean value both above and below

euh my script is wrong ?

i have put

LINKTYPE="ethernet"

WAN=eth0.2 # change this to your WAN device name
UPRATE=20000 #change this to your kbps upload speed
LAN=eth0.1
DOWNRATE=62000 #change this to about 80% of your download speed (in kbps)

BWMAXRATIO=20 ## prevent ack floods by limiting download to at most
	      ## upload times this amount... ratio somewhere between
	      ## 10 and 20 probably optimal. we down-prioritize
	      ## certain ACKs to reduce the chance of a flood as well.

if [ $((DOWNRATE > UPRATE*BWMAXRATIO)) -eq 1 ]; then
    echo "We limit the downrate to at most $BWMAXRATIO times the upstream rate to ensure no upstream ACK floods occur which can cause game packet drops"
    DOWNRATE=$((BWMAXRATIO*UPRATE))
fi

## how many kbps of UDP upload and download do you need for your games
## across all gaming machines? 

## you can tune these yourself, but a good starting point is this
## formula.  this script will not work for UPRATE less than about
## 600kbps or downrate less than about 1000kbps

GAMEUP=$((UPRATE*15/100+400))
GAMEDOWN=$((DOWNRATE*15/100+400))

## you can try setting GAMEUP and GAMEDOWN manually, some report this
## works well for CoD
#GAMEUP=400
#GAMEDOWN=800


DSCPSCRIPT="/etc/dscptag.sh"

if [ ! -f $DSCPSCRIPT ]; then
    workdir=$(pwd)
    echo "You do not have the DSCP tagging script, downloading from github"
    cd /etc/
    wget https://raw.githubusercontent.com/dlakelan/routerperf/master/dscptag.sh
    cd $workdir
fi



## Right now there are three possible leaf qdiscs: pfifo, red, or
## netem. If you use netem it's so you can intentionally add delay to
## your packets, set netemdelayms to the number of ms you want to add
## each direction. Our default is pfifo it is reported to be the best
## for use in the realtime queue

#gameqdisc="pfifo"

gameqdisc="netem"

netemdelayms="10"
netemjitterms="5"
netemdist="normal"


pour le graph

no it's not wrong, just a small jitter value, try some largish values, like try

netemdelayms=30
netemjitterms=15
1 Like