Help prioritizing games with alternative qdisc design

Just play your games, if the new script does not feel any better, just stick to the old one (probably your link then is fast enough that absolute real-time priority for gaming packets is not noticeable). As far as I can tell the trick here is to create a bounded unfairness (and its that bounding that makes it safe and dare I say in a certain way elegant), that helps with getting gaming working on links that do not really permit competitive gaming by default.

1 Like

That's right. You can also try playing your game while a different machine does a speed-test, and see if the speed test affects the game play.

This should produce detectable results when say 3 packets at 1500 bytes takes more than say 1ms to send... which means on links less than 36Mbps both directions.

ok if i can help the gamer , i'm post my different tc : )

root@OpenWrt:~# tc qdisc
qdisc noqueue 0: dev lo root refcnt 2
qdisc fq_codel 0: dev eth0 root refcnt 2 limit 10240p flows 1024 quantum 1514 ta                                                                    rget 5.0ms interval 100.0ms memory_limit 4Mb ecn
qdisc hfsc 1: dev eth0.2 root refcnt 2 default 3
qdisc pfifo 2: dev eth0.2 parent 1:2 limit 47p
qdisc fq_codel 3: dev eth0.2 parent 1:3 limit 233p flows 1024 quantum 3000 targe                                                                    t 5.0ms interval 100.0ms memory_limit 4Mb ecn
qdisc hfsc 1: dev eth0.1 root refcnt 2 default 3
qdisc pfifo 2: dev eth0.1 parent 1:2 limit 181p
qdisc fq_codel 3: dev eth0.1 parent 1:3 limit 900p flows 1024 quantum 3000 targe                                                                    t 5.0ms interval 100.0ms memory_limit 4Mb ecn
root@OpenWrt:~# tc qdisc show dev eth0.2
qdisc hfsc 1: root refcnt 2 default 3
qdisc pfifo 2: parent 1:2 limit 47p
qdisc fq_codel 3: parent 1:3 limit 233p flows 1024 quantum 3000 target 5.0ms interval 100.0ms memory_limit 4Mb                                      ecn
root@OpenWrt:~# tc qdisc show dev eth0.1
qdisc hfsc 1: root refcnt 2 default 3
qdisc pfifo 2: parent 1:2 limit 181p
qdisc fq_codel 3: parent 1:3 limit 900p flows 1024 quantum 3000 target 5.0ms interval 100.0ms memory_limit 4Mb ecn
root@OpenWrt:~#  tc -s -d 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 408316670 bytes 804013 pkt (dropped 0, overlimits 0 requeues 119)
 backlog 0b 0p requeues 119
  maxpacket 4542 drop_overlimit 0 new_flow_count 3732 ecn_mark 0
  new_flows_len 0 old_flows_len 0
qdisc hfsc 1: dev eth0.2 root refcnt 2 default 3
 linklayer atm overhead 26 mpu 68 mtu 2047 tsize 512
 Sent 139487573 bytes 384984 pkt (dropped 404, overlimits 56537 requeues 0)
 backlog 0b 0p requeues 0
qdisc pfifo 2: dev eth0.2 parent 1:2 limit 47p
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
qdisc fq_codel 3: dev eth0.2 parent 1:3 limit 233p flows 1024 quantum 3000 target 5.0ms interval 100.0ms memory_limit 4Mb ecn
 Sent 139487573 bytes 384984 pkt (dropped 404, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
  maxpacket 9805 drop_overlimit 0 new_flow_count 10245 ecn_mark 0
  new_flows_len 0 old_flows_len 1
qdisc hfsc 1: dev eth0.1 root refcnt 2 default 3
 linklayer atm overhead 26 mpu 68 mtu 2047 tsize 512
 Sent 341915349 bytes 401878 pkt (dropped 184, overlimits 97372 requeues 0)
 backlog 0b 0p requeues 0
qdisc pfifo 2: dev eth0.1 parent 1:2 limit 181p
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
qdisc fq_codel 3: dev eth0.1 parent 1:3 limit 900p flows 1024 quantum 3000 target 5.0ms interval 100.0ms memory_limit 4Mb ecn
 Sent 341915084 bytes 401877 pkt (dropped 184, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
  maxpacket 8162 drop_overlimit 0 new_flow_count 12393 ecn_mark 0
  new_flows_len 0 old_flows_len 1
root@OpenWrt:~#

Now play your game... you should see pfifo send some traffic. right now it hasn't.

@dlakelan after gaming nothing in pfifo

root@OpenWrt:~# tc qdisc
qdisc noqueue 0: dev lo root refcnt 2
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
qdisc hfsc 1: dev eth0.2 root refcnt 2 default 3
qdisc pfifo 2: dev eth0.2 parent 1:2 limit 47p
qdisc fq_codel 3: dev eth0.2 parent 1:3 limit 233p flows 1024 quantum 3000 target 5.0ms interval 100.0ms memory_limit 4Mb ecn
qdisc hfsc 1: dev eth0.1 root refcnt 2 default 3
qdisc pfifo 2: dev eth0.1 parent 1:2 limit 181p
qdisc fq_codel 3: dev eth0.1 parent 1:3 limit 900p flows 1024 quantum 3000 target 5.0ms interval 100.0ms memory_limit 4Mb ecn
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 482740268 bytes 1013661 pkt (dropped 0, overlimits 0 requeues 142)
 backlog 0b 0p requeues 142
  maxpacket 4542 drop_overlimit 0 new_flow_count 4135 ecn_mark 0
  new_flows_len 0 old_flows_len 0
qdisc hfsc 1: dev eth0.2 root refcnt 2 default 3
 Sent 169285816 bytes 486888 pkt (dropped 405, overlimits 60566 requeues 0)
 backlog 0b 0p requeues 0
qdisc pfifo 2: dev eth0.2 parent 1:2 limit 47p
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
qdisc fq_codel 3: dev eth0.2 parent 1:3 limit 233p flows 1024 quantum 3000 target 5.0ms interval 100.0ms memory_limit 4Mb ecn
 Sent 169285816 bytes 486888 pkt (dropped 405, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
  maxpacket 9805 drop_overlimit 0 new_flow_count 23509 ecn_mark 0
  new_flows_len 1 old_flows_len 2
qdisc hfsc 1: dev eth0.1 root refcnt 2 default 3
 Sent 405406169 bytes 509622 pkt (dropped 185, overlimits 103588 requeues 0)
 backlog 0b 0p requeues 0
qdisc pfifo 2: dev eth0.1 parent 1:2 limit 181p
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
qdisc fq_codel 3: dev eth0.1 parent 1:3 limit 900p flows 1024 quantum 3000 target 5.0ms interval 100.0ms memory_limit 4Mb ecn
 Sent 405405904 bytes 509621 pkt (dropped 185, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
  maxpacket 8162 drop_overlimit 0 new_flow_count 25605 ecn_mark 0
  new_flows_len 1 old_flows_len 1
root@OpenWrt:~#

You must have the latest script with bug-fixes, also you should run the script by hand so you can answer "y" to the question, or do

echo "y" | /root/my_script.sh

full script with all known bug fixes here:

#!/bin/sh

## "atm" for old-school DSL or change to "DOCSIS" for cable modem, or "other" for everything else

LINKTYPE="atm"

WAN=veth0 # change this to your WAN device name
UPRATE=6500 #change this to your kbps upload speed
LAN=veth1
DOWNRATE=30000 #change this to about 80% of your download speed (in kbps)

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

GAMEUP=450
GAMEDOWN=1200

## set this to "pfifo" or if you want to differentiate between game
## packets into 3 different classes you can use either "drr" or "qfq"
## be aware not all machines will have drr or qfq available

gameqdisc="pfifo"

GAMINGIP="192.168.1.111" ## change this



cat <<EOF

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 = $GAMEUP kbps
Game download guarantee = $GAMEDOWN 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 = $(((1500*8)*3/UPRATE)) ms

DOWN = $(((1500*8)*3/DOWNRATE)) 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:

$((1500*8*3/5)) 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.

EOF




setqdisc () {
DEV=$1
RATE=$2
OH=37
MTU=1500
highrate=$((RATE*90/100))
lowrate=$((RATE*10/100))
gamerate=$3
useqdisc=$4


tc qdisc del dev "$DEV" root

case $LINKTOP in
    "atm")
	tc qdisc replace dev "$DEV" handle 1: root stab mtu 2047 tsize 512 mpu 68 overhead ${OH} linklayer atm hfsc default 3
	;;
    "DOCSIS")
	tc qdisc replace dev $DEV stab overhead 25 linklayer ethernet handle 1: root hfsc default 3
	;;
    *)
	tc qdisc replace dev $DEV stab overhead 40 linklayer ethernet handle 1: root hfsc default 3
	;;
esac
     



#limit the link overall:
tc class add dev "$DEV" parent 1: classid 1:1 hfsc ls m2 "${RATE}kbit" ul m2 "${RATE}kbit"

# high prio class
tc class add dev "$DEV" parent 1:1 classid 1:2 hfsc rt m1 "${highrate}kbit" d 80ms m2 "${gamerate}kbit"

# other prio class
tc class add dev "$DEV" parent 1:1 classid 1:3 hfsc ls m1 "${lowrate}kbit" d 80ms m2 "${highrate}kbit"


## set this to "drr" or "qfq" to differentiate between different game
## packets, or use "pfifo" to treat all game packets equally

case $useqdisc in
    "drr")
	tc qdisc add dev "$DEV" parent 1:2 handle 2:0 drr
	tc class add dev "$DEV" parent 2:0 classid 2:1 drr quantum 8000
	tc class add dev "$DEV" parent 2:0 classid 2:2 drr quantum 4000
	tc class add dev "$DEV" parent 2:0 classid 2:3 drr quantum 1000
	## with this send high priority game packets to 2:1, medium to 2:2 and normal to 2:3
	## games will not starve but be given relative importance based on the quantum parameter
    ;;

    "qfq")
	tc qdisc add dev "$DEV" parent 1:2 handle 2:0 qfq
	tc class add dev "$DEV" parent 2:0 classid 2:1 qfq weight 8000
	tc class add dev "$DEV" parent 2:0 classid 2:2 qfq weight 4000
	tc class add dev "$DEV" parent 2:0 classid 2:3 qfq weight 1000
	## with this send high priority game packets to 2:1, medium to 2:2 and normal to 2:3
	## games will not starve but be given relative importance based on the weight parameter

    ;;

    *)
	PFIFOLEN=$((1 + 40*RATE/(MTU*8))) # at least 1 packet, plus 40ms worth of additional packets
	tc qdisc add dev "$DEV" parent 1:2 handle 2:1 pfifo limit $PFIFOLEN
	## send game packets to 2:1, they're all the same
	
    ;;
esac

if [ $((MTU * 8 * 10 / RATE > 50)) -eq 1 ]; then ## if one MTU packet takes more than 5ms
    echo "adding PIE qdisc for non-game traffic due to slow link"
    tc qdisc add dev "$DEV" parent 1:3 handle 3:1 pie limit  $((RATE * 200 / (MTU * 8))) target 80ms ecn tupdate 40ms bytemode
else ## we can have queues with multiple packets without major delays, fair queuing is more meaningful
    echo "adding fq_codel qdisc for non-game traffic due to fast link"
    tc qdisc add dev "$DEV" parent 1:3 handle 3:1 fq_codel limit $((RATE * 200 / (MTU * 8))) quantum $((MTU * 2))
fi

}




setqdisc $WAN $UPRATE $GAMEUP $gameqdisc

## uncomment this to do the download direction via output of LAN
setqdisc $LAN $DOWNRATE $GAMEDOWN $gameqdisc

## we want to classify packets, so use these rules

cat <<EOF

We are going to add classification rules via iptables to the
POSTROUTING 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)
EOF

read -r cont

if [ "$cont" = "y" ]; then


    ## change these if you use drr or prio instead of pfifo
    iptables -t mangle -A POSTROUTING -j CLASSIFY --set-class 3:1 # default everything to 3:1,  the "non-game" qdisc
    iptables -t mangle -A POSTROUTING -p udp -s ${GAMINGIP} -j CLASSIFY --set-class 2:1
    iptables -t mangle -A POSTROUTING -p udp -d ${GAMINGIP} -j CLASSIFY --set-class 2:1
    
else
    cat <<EOF
Check the rules and come back when you're ready.
EOF
fi

echo "DONE!"

tc -s qdisc

ok after reboot the router the classify adress is delete what is the command in local start up

i have try
sleep 8
sh /root/qosgaming.sh

but don't work

then my connection is (in french equivalent uk ) vdsl fttc or fiber to the promise

my router is only wired mikrotik rb750gr3

so i have replaced veth by eth0.2 wan and eth0.1 lan

then i don't know if gaming ip i add the two " in 192.168 " "" the sigle or not

thanks me help dlakelan

the script asks you interactively whether you want to change the firewall... so you should do:

echo "y" | /root/qosgaming.sh

right now it has only one spot for gaming IP but you can just make GAMINGIP2 and add a second set of rules just like the first.

ok i have understand the first message, i add echo.. in startup

then second message is just for know if the sign "" between is important or i delete to the script , i'm not sure

you want:

GAMINGIP="192.168.1.111" 
GAMINGIP2="192.168.1.112"

then add a second set of iptables just like the first, but using $GAMINGIP2

ok so my final script is like there

#!/bin/sh

## "atm" for old-school DSL or change to "DOCSIS" for cable modem, or "other" for everything else

LINKTYPE="other"

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

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

GAMEUP=450
GAMEDOWN=1200

## set this to "pfifo" or if you want to differentiate between game
## packets into 3 different classes you can use either "drr" or "qfq"
## be aware not all machines will have drr or qfq available

gameqdisc="pfifo"

GAMINGIP="192.168.2.167" ## change this



cat <<EOF

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 = $GAMEUP kbps
Game download guarantee = $GAMEDOWN 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 = $(((1500*8)*3/UPRATE)) ms

DOWN = $(((1500*8)*3/DOWNRATE)) 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:

$((1500*8*3/5)) 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.

EOF




setqdisc () {
DEV=$1
RATE=$2
OH=37
MTU=1500
highrate=$((RATE*90/100))
lowrate=$((RATE*10/100))
gamerate=$3
useqdisc=$4


tc qdisc del dev "$DEV" root

case $LINKTOP in
    "atm")
	tc qdisc replace dev "$DEV" handle 1: root stab mtu 2047 tsize 512 mpu 68 overhead ${OH} linklayer atm hfsc default 3
	;;
    "DOCSIS")
	tc qdisc replace dev $DEV stab overhead 25 linklayer ethernet handle 1: root hfsc default 3
	;;
    *)
	tc qdisc replace dev $DEV stab overhead 40 linklayer ethernet handle 1: root hfsc default 3
	;;
esac
     



#limit the link overall:
tc class add dev "$DEV" parent 1: classid 1:1 hfsc ls m2 "${RATE}kbit" ul m2 "${RATE}kbit"

# high prio class
tc class add dev "$DEV" parent 1:1 classid 1:2 hfsc rt m1 "${highrate}kbit" d 80ms m2 "${gamerate}kbit"

# other prio class
tc class add dev "$DEV" parent 1:1 classid 1:3 hfsc ls m1 "${lowrate}kbit" d 80ms m2 "${highrate}kbit"


## set this to "drr" or "qfq" to differentiate between different game
## packets, or use "pfifo" to treat all game packets equally

case $useqdisc in
    "drr")
	tc qdisc add dev "$DEV" parent 1:2 handle 2:0 drr
	tc class add dev "$DEV" parent 2:0 classid 2:1 drr quantum 8000
	tc class add dev "$DEV" parent 2:0 classid 2:2 drr quantum 4000
	tc class add dev "$DEV" parent 2:0 classid 2:3 drr quantum 1000
	## with this send high priority game packets to 2:1, medium to 2:2 and normal to 2:3
	## games will not starve but be given relative importance based on the quantum parameter
    ;;

    "qfq")
	tc qdisc add dev "$DEV" parent 1:2 handle 2:0 qfq
	tc class add dev "$DEV" parent 2:0 classid 2:1 qfq weight 8000
	tc class add dev "$DEV" parent 2:0 classid 2:2 qfq weight 4000
	tc class add dev "$DEV" parent 2:0 classid 2:3 qfq weight 1000
	## with this send high priority game packets to 2:1, medium to 2:2 and normal to 2:3
	## games will not starve but be given relative importance based on the weight parameter

    ;;

    *)
	PFIFOLEN=$((1 + 40*RATE/(MTU*8))) # at least 1 packet, plus 40ms worth of additional packets
	tc qdisc add dev "$DEV" parent 1:2 handle 2:1 pfifo limit $PFIFOLEN
	## send game packets to 2:1, they're all the same
	
    ;;
esac

if [ $((MTU * 8 * 10 / RATE > 50)) -eq 1 ]; then ## if one MTU packet takes more than 5ms
    echo "adding PIE qdisc for non-game traffic due to slow link"
    tc qdisc add dev "$DEV" parent 1:3 handle 3:1 pie limit  $((RATE * 200 / (MTU * 8))) target 80ms ecn tupdate 40ms bytemode
else ## we can have queues with multiple packets without major delays, fair queuing is more meaningful
    echo "adding fq_codel qdisc for non-game traffic due to fast link"
    tc qdisc add dev "$DEV" parent 1:3 handle 3:1 fq_codel limit $((RATE * 200 / (MTU * 8))) quantum $((MTU * 2))
fi

}




setqdisc $WAN $UPRATE $GAMEUP $gameqdisc

## uncomment this to do the download direction via output of LAN
setqdisc $LAN $DOWNRATE $GAMEDOWN $gameqdisc

## we want to classify packets, so use these rules

cat <<EOF

We are going to add classification rules via iptables to the
POSTROUTING 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)
EOF

read -r cont

if [ "$cont" = "y" ]; then


    ## change these if you use drr or prio instead of pfifo
    iptables -t mangle -A POSTROUTING -j CLASSIFY --set-class 3:1 # default everything to 3:1,  the "non-game" qdisc
    iptables -t mangle -A POSTROUTING -p udp -s ${GAMINGIP} -j CLASSIFY --set-class 2:1
    iptables -t mangle -A POSTROUTING -p udp -d ${GAMINGIP} -j CLASSIFY --set-class 2:1
    
else
    cat <<EOF
Check the rules and come back when you're ready.
EOF
fi

echo "DONE!"

tc -s qdisc


and startup
i'm add

echo "y" | /root/qosgaming.sh

i will test :wink: the barrier of the langue is difficult ^^

understood. thanks for your efforts in testing.

1 Like

ok i found the page of openwrt maybe a track

my pfifo doesn't work i don't know why

Can you screenshot the firewall page to show where the rules to classify traffic are?

ok how make that ? vi /Etc/config/firewall ?

Go to the web interface, click Status > Firewall and screen-shot the portion that shows the rules.

Uploading: Capture d’écran 2020-11-23 à 21.26.54.png...

like this ?

1 Like

Yes, so that shows 730 packets coming from 192.168.2.167 and 645 packets goes to. So it's working.

You should see the pfifos transferring those packets.

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 149073877 bytes 252533 pkt (dropped 0, overlimits 0 requeues 170)
 backlog 0b 0p requeues 170
  maxpacket 4942 drop_overlimit 0 new_flow_count 3585 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 3
 Sent 131439311 bytes 143376 pkt (dropped 48, overlimits 47418 requeues 0)
 backlog 0b 0p requeues 0
qdisc pfifo 2: dev eth0.1 parent 1:2 limit 187p
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
qdisc fq_codel 3: dev eth0.1 parent 1:3 limit 933p flows 1024 quantum 3000 target 5.0ms interval 100.0ms memory_limit 4Mb ecn
 Sent 131439046 bytes 143375 pkt (dropped 48, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
  maxpacket 8162 drop_overlimit 0 new_flow_count 679 ecn_mark 0
  new_flows_len 0 old_flows_len 1
qdisc hfsc 1: dev eth0.2 root refcnt 2 default 3
 Sent 15869154 bytes 64590 pkt (dropped 0, overlimits 15715 requeues 0)
 backlog 0b 0p requeues 0
qdisc pfifo 2: dev eth0.2 parent 1:2 limit 54p
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
qdisc fq_codel 3: dev eth0.2 parent 1:3 limit 266p flows 1024 quantum 3000 target 5.0ms interval 100.0ms memory_limit 4Mb ecn
 Sent 15869154 bytes 64590 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
  maxpacket 13091 drop_overlimit 0 new_flow_count 539 ecn_mark 0
  new_flows_len 0 old_flows_len 1
root@OpenWrt:~#

not appaear ?? what is wrong ?

maybe pfifo doesn't accept minor number 1, so 2:1 doesn't work for classify? I'm not sure. You can try changing the classify command to 2:0 and see if that works, change the two rules for gaming ip to use 2:0 (do it for both gaming rules, change the --set-class as follows)

    iptables -t mangle -A POSTROUTING -p udp -s ${GAMINGIP} -j CLASSIFY --set-class 2:0

1 Like