Jump to content

Traffic prortization please read


kinel
 Share

Recommended Posts

1 hour ago, Fuzy said:

it doesn't make sense! prioritize the console or use Classified games returns to the same ...

I test all the ports given by portforward.com none works in UDP console and PC confused.

the only thing that works in UDP is to open as said before 1024-65535 in both directions ... which is like using classified games!

Yes mon amie you are correct. 

Link to comment
Share on other sites

2 hours ago, Fuzy said:

it doesn't make sense! prioritize the console or use Classified games returns to the same ...

I test all the ports given by portforward.com none works in UDP console and PC confused.

the only thing that works in UDP is to open as said before 1024-65535 in both directions ... which is like using classified games!

so if its like using classified games then what points make the 1024 port valid? 

Link to comment
Share on other sites

33 minutes ago, Baturi said:

so if its like using classified games then what points make the 1024 port valid? 

I thought ports 1-65535 was Classified and 1024-65535 it eliminates other ports that prioritize downloading for other apps or devices that could hinder the games packets. Something like that. @Netduma Fraser can explain it better. 
 

Plus Cold War is new. 

Link to comment
Share on other sites

I played for more then 5 hours straight testing Black Ops CW on PS4 got everytime Source port 3074 UDP, Destination port between 30000 and 59000 UDP, so I am pretty sure for this game applies the same as COD MW go for traffic prio:

Source 3074 3074 UDP - Destination 30000-65535 UDP

Link to comment
Share on other sites

2 hours ago, Mobel said:

I played for more then 5 hours straight testing Black Ops CW on PS4 got everytime Source port 3074 UDP, Destination port between 30000 and 59000 UDP, so I am pretty sure for this game applies the same as COD MW go for traffic prio:

Source 3074 3074 UDP - Destination 30000-65535 UDP

Thats what I was seeing in the alpha and beta too.

Link to comment
Share on other sites

Hello guys..for everyone using Openwrt ...a QOS script "hand made" tested with Cold War.

In this script it creates a realtime HFSC class to control the game traffic. It gives a maximum bandwidth that it absolutely guarantees for the real-time class. You can throttle your speeds that game can use changing values in GAMEUP (upload) or GAMEDOWN (download).

It uses HFSC ...for gaming priority we use pfifo qdisc to dont drop packets and make sure no packet loss will occur.And a pie qdisc for non prioritize traffic.

Doing that gives some reasonable amount of delay control to the "less sensitive" users but still prioritizes mainly the game traffic from console (ps4/xbox).

This results in bufferbloat in the 80-150 ms range for things like general web surfing, but essentially zero bufferbloat and zero packet drops for the gaming traffic.

For typical stuff, 80-150ms is actually not particularly a big deal, you blink your eye in about 100-150ms. It's a huge deal however for games, or VOIP. So for people who dedicate a particular console or gaming machine to their games, this script should produce very good results after tuning the appropriate values in the header.

Just create an empty file..name it etc.   qos.sh  put the code inside..save it...copy to openwrt /root/ folder.

#!/bin/sh
WAN=pppoe-wan # change this to your WAN device name
UPRATE=818 #change this to your 80% kbps upload speed (in kbps)
LAN=eth0.1 # change this to your LAN device name
DOWNRATE=16000 #change this to about 80% of your download speed (in kbps)
GAMEUP=400  # throttle your speeds for upload in PS4/Xbox
GAMEDOWN=2000  # throttle your speeds for download in PS4/Xbox

setqdisc () {
DEV=$1
RATE=$2
OH=44
highrate=$((RATE*90/100))
lowrate=$((RATE*10/100))
gamerate=$3

tc qdisc replace dev eth0 pfifo
tc qdisc delete dev $WAN
tc qdisc delete dev $LAN

## for ethernet / DOCSIS / VDSL etc use this
#tc qdisc replace dev $DEV stab overhead $OH linklayer ethernet handle 1: root hfsc default 3
# for old school DSL with ATM use this:
tc qdisc replace dev "$DEV" handle 1: root stab mtu 2047 tsize 512 mpu 68 overhead ${OH} linklayer atm hfsc default 3


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 40ms m2 "${gamerate}kbit"

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

tc qdisc add dev "$DEV" parent 1:2 pfifo limit 10
tc qdisc add dev "$DEV" parent 1:3 pie limit 100 target 80ms ecn tupdate 40ms bytemode

}

setqdisc $WAN $UPRATE $GAMEUP

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

Second script for iptables Classify....gaming traffic from Ps4/Xbox  falls in "high priority" class...1:2

Just change the value to your Ps4/Xbox IP...save the file etc. as     gaming.sh

#!/bin/sh

GAMINGIP="192.168.1.xxx" # change this to Ps4/xbox IP.

#reclassify all udp packets from your gaming machine as 1:2, high priority
iptables -t mangle -A POSTROUTING -p udp --sport 1024:65535 -s ${GAMINGIP}  -j CLASSIFY --set-class 1:2
iptables -t mangle -A POSTROUTING -p udp --dport 1024:65535 -d ${GAMINGIP} -j CLASSIFY --set-class 1:2

In Openwrt    "System-->startup--->local start up"  put this before  "exit 0"  so in every reboot the scripts auto loaded.

 

# Put your custom commands here that should be executed once
# the system init finished. By default this file does nothing.

sleep 8
/root/qos.sh
sleep 8
/root/gaming.sh

exit 0

 

 

That's it guys...have fun.😉

**Big thanks to Dlakelan and others "gurus" in Openwrt forum spending hours and hours with me..changing code,trying different q disc's..trying to "guess" how game mechanics works..lag comp and so on to find sweet spot.**

***Scripts approach is in logic..."all about gaming and nothing else".

Link to comment
Share on other sites

12 hours ago, Knomax said:

Hello guys..for everyone using Openwrt ...a QOS script "hand made" tested with Cold War.

That's it guys...have fun.😉

**Big thanks to Dlakelan and others "gurus" in Openwrt forum spending hours and hours with me..changing code,trying different q disc's..trying to "guess" how game mechanics works..lag comp and so on to find sweet spot.**

***Scripts approach is in logic..."all about gaming and nothing else".

What are the commands for sending it to the router? I've never had to send a setting file over. Also how do we edit the file?

/edit

I think i copied them over

D:\>scp D:\qos.sh [email protected]:/root
qos.sh                                                                                100% 1483   483.2KB/s   00:00

but must have done something wrong, when I tc qdisc i get the below. Looks like nothing changed? I did the bit in local startup and rebooted the router. I created the .sh file by creating a .txt file and renaming it .sh, was that correct? also chmod +x the files.

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 noqueue 0: dev br-lan root refcnt 2
qdisc noqueue 0: dev eth0.1 root refcnt 2
qdisc noqueue 0: dev eth0.3 root refcnt 2
qdisc noqueue 0: dev eth0.2 root refcnt 2
root@OpenWrt:~#
 

Did i do this bit correct? please match it with my screenshot. Maybe br-lan needs to be eth0.1? I'm using ER-X

#!/bin/sh
WAN=eth0.2 # change this to your WAN device name *********** eth0.2 is my WAN in SQM settings
UPRATE=17000 #change this to your 80% kbps upload speed (in kbps)
LAN=br-lan # change this to your LAN device name ************* not sure if this should be eth0.1?
DOWNRATE=102000 #change this to about 80% of your download speed (in kbps)
GAMEUP=400  # throttle your speeds for upload in PS4/Xbox
GAMEDOWN=2000  # throttle your speeds for download in PS4/Xbox

Ignore the VLAN interface, that's my eth0.3 port which I don't have my ps4 connected to for this.

Physical ports on the ER-X - eth0 is my WAN cable, eth1 is ps4 and eth2 is PC

interfaceas.JPG

sqm settings.JPG

system log is showing the below, but i can see the 2 files in /root/

Thu Nov 19 05:13:27 2020 daemon.notice procd: /etc/rc.d/S95done: /etc/rc.local: line 5: /root/qos.sh: not found
Thu Nov 19 05:13:35 2020 daemon.notice procd: /etc/rc.d/S95done: /etc/rc.local: line 7: /root/gaming.sh: not found

Are there any steps you needed to do to enable any of this to work? e.g. i had to figure out to chmod +x the .sh files to make the executable, is there any other services or something you needed to enable to have this all working?

Link to comment
Share on other sites

4 hours ago, iCreats said:

I've tried these ports, works pretty well on MW/Warzone (hit detection was fast), i'm still searching for Cold War

281165340_Capturedcran2020-11-1900_48_13.thumb.png.d085006c8c0a750c95bf929469be811d.png

I'll give these ports a try. Any other settings, how is your QoS settings, do you use Geofilter?

Link to comment
Share on other sites

ok so i have tried make 

#!/bin/sh
WAN=eth0.2 # change this to your WAN device name
UPRATE=16000 #change this to your 80% kbps upload speed (in kbps)
LAN=eth0.1 # change this to your LAN device name
DOWNRATE=56000 #change this to about 80% of your download speed (in kbps)
GAMEUP=400  # throttle your speeds for upload in PS4/Xbox
GAMEDOWN=2000  # throttle your speeds for download in PS4/Xbox

setqdisc () {
DEV=$1
RATE=$2
OH=26
highrate=$((RATE*90/100))
lowrate=$((RATE*10/100))
gamerate=$3

tc qdisc replace dev eth0 pfifo
tc qdisc delete dev $WAN
tc qdisc delete dev $LAN

## for ethernet / DOCSIS / VDSL etc use this

tc qdisc replace dev $DEV stab overhead $OH linklayer ethernet handle 1: root hfsc default 3

# for old school DSL with ATM use this:
#tc qdisc replace dev "$DEV" handle 1: root stab mtu 2047 tsize 512 mpu 68 overhead ${OH} #linklayer atm hfsc default 3


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 40ms m2 "${gamerate}kbit"

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

tc qdisc add dev "$DEV" parent 1:2 pfifo limit 10
tc qdisc add dev "$DEV" parent 1:3 pie limit 100 target 80ms ecn tupdate 40ms bytemode

}

setqdisc $WAN $UPRATE $GAMEUP

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

and i add

 

always in root of router rb750gr3

script gaming.sh in more 

then 

cd /root/
with chmod +x hfsc.sh (script)

 

i'm obtain a green validation 

 

then system - startup i put for start script 

 

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 noqueue 0: dev eth0.1 root refcnt 2
qdisc htb 1: dev eth0.2 root refcnt 2 r2q 10 default 0x12 direct_packets_stat 0                                                           direct_qlen 1000
qdisc fq_codel 120: dev eth0.2 parent 1:12 limit 1001p flows 1024 quantum 300 ta                                                          rget 5.0ms interval 100.0ms memory_limit 4Mb ecn
qdisc fq_codel 130: dev eth0.2 parent 1:13 limit 1001p flows 1024 quantum 300 ta                                                          rget 5.0ms interval 100.0ms memory_limit 4Mb ecn
qdisc fq_codel 110: dev eth0.2 parent 1:11 limit 1001p flows 1024 quantum 300 ta                                                          rget 5.0ms interval 100.0ms memory_limit 4Mb ecn
qdisc ingress ffff: dev eth0.2 parent ffff:fff1 ----------------
qdisc htb 1: dev ifb4eth0.2 root refcnt 2 r2q 10 default 0x10 direct_packets_sta                                                          t 0 direct_qlen 32
qdisc fq_codel 110: dev ifb4eth0.2 parent 1:10 limit 1001p flows 1024 quantum 15                                                          14 target 5.0ms interval 100.0ms memory_limit 4Mb ecn
 

 

what is wrong ? please 

 

Link to comment
Share on other sites

11 hours ago, johnnytran said:

but must have done something wrong, when I tc qdisc i get the below. Looks like nothing changed? I did the bit in local startup and rebooted the router. I created the .sh file by creating a .txt file and renaming it .sh, was that correct? also chmod +x the files.

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 noqueue 0: dev br-lan root refcnt 2
qdisc noqueue 0: dev eth0.1 root refcnt 2
qdisc noqueue 0: dev eth0.3 root refcnt 2
qdisc noqueue 0: dev eth0.2 root refcnt 2
root@OpenWrt:~#

You must run tc -s qdisc  and you will see the hfsc ...pie and pfifo qdiscs.

11 hours ago, johnnytran said:

Did i do this bit correct? please match it with my screenshot. Maybe br-lan needs to be eth0.1? I'm using ER-X

#!/bin/sh
WAN=eth0.2 # change this to your WAN device name *********** eth0.2 is my WAN in SQM settings
UPRATE=17000 #change this to your 80% kbps upload speed (in kbps)
LAN=br-lan # change this to your LAN device name ************* not sure if this should be eth0.1?
DOWNRATE=102000 #change this to about 80% of your download speed (in kbps)
GAMEUP=400  # throttle your speeds for upload in PS4/Xbox
GAMEDOWN=2000  # throttle your speeds for download in PS4/Xbox

Dont put bridge interface in LAN.....br-lan.........change it to eth0.1   i am using edgerouter x to.

 

12 hours ago, johnnytran said:

there any steps you needed to do to enable any of this to work? e.g. i had to figure out to chmod +x the .sh files to make the executable, is there any other services or something you needed to enable to have this all working?

Sorry i forgot to say that you must make them executable ....chmod +x qos.sh then chmod +x gaming.sh

Disable SQM..you will use these scripts for QOS.For gaming.sh yo will see the rules attached in gui-->firewall...for qos.sh when yo reboot router..run  tc -s qdisc to see.

Please tell me if you are ok or have any other problems.

Link to comment
Share on other sites

Quote
Quote


#!/bin/sh
WAN=eth0.2 # change this to your WAN device name
UPRATE=16000 #change this to your 80% kbps upload speed (in kbps)
LAN=eth0.1 # change this to your LAN device name
DOWNRATE=56000 #change this to about 80% of your download speed (in kbps)
GAMEUP=400  # throttle your speeds for upload in PS4/Xbox
GAMEDOWN=2000  # throttle your speeds for download in PS4/Xbox

setqdisc () {
DEV=$1
RATE=$2
OH=26
highrate=$((RATE*90/100))
lowrate=$((RATE*10/100))
gamerate=$3

tc qdisc replace dev eth0 pfifo
tc qdisc delete dev $WAN
tc qdisc delete dev $LAN

## for ethernet / DOCSIS / VDSL etc use this
tc qdisc replace dev $DEV stab overhead $OH linklayer ethernet handle 1: root hfsc default 3
# for old school DSL with ATM use this:
#tc qdisc replace dev "$DEV" handle 1: root stab mtu 2047 tsize 512 mpu 68 overhead ${OH} linklayer atm hfsc default 3


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 40ms m2 "${gamerate}kbit"

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

tc qdisc add dev "$DEV" parent 1:2 pfifo limit 10

tc qdisc add dev "$DEV" parent 1:3 pie limit 100 target 80ms ecn tupdate 40ms bytemode

}

setqdisc $WAN $UPRATE $GAMEUP

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

 

 

Il y a 10 minutes, Knomax a déclaré:

Vous devez voir un autre qdisc ... pie ... redémarrer le routeur et mettre une capture d'écran de tc -s qdsic.

pas la tarte 1330368722_Capturedecran2020-11-19a17_44_05.png.524ea0221b9da2ec68ad3b34f53cd470.png

Link to comment
Share on other sites

 ok i'm on vdsl2 if never 

#!/bin/sh
WAN=eth0.2 # change this to your WAN device name
UPRATE=16000 #change this to your 80% kbps upload speed (in kbps)
LAN=eth0.1 # change this to your LAN device name
DOWNRATE=56000 #change this to about 80% of your download speed (in kbps)
GAMEUP=400  # throttle your speeds for upload in PS4/Xbox
GAMEDOWN=2000  # throttle your speeds for download in PS4/Xbox

setqdisc () {
DEV=$1
RATE=$2
OH=26
highrate=$((RATE*90/100))
lowrate=$((RATE*10/100))
gamerate=$3

tc qdisc replace dev eth0 pfifo
tc qdisc delete dev $WAN
tc qdisc delete dev $LAN

## for ethernet / DOCSIS / VDSL etc use this
tc qdisc replace dev $DEV stab overhead $OH linklayer ethernet handle 1: root hfsc default 3
# for old school DSL with ATM use this:
#tc qdisc replace dev "$DEV" handle 1: root stab mtu 2047 tsize 512 mpu 68 overhead ${OH} linklayer atm hfsc default 3


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 40ms m2 "${gamerate}kbit"

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

tc qdisc add dev "$DEV" parent 1:2 pfifo limit 10

tc qdisc add dev "$DEV" parent 1:3 pie limit 100 target 80ms ecn tupdate 40ms bytemode

}

setqdisc $WAN $UPRATE $GAMEUP

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

maybe set qdisc $wan $uprate $gameup ? 

Link to comment
Share on other sites

7 minutes ago, juju1366 said:

no i have try on linux et osx same things

run this command and post here to see if you have pie...maybe missing...

ls -lha /lib/modules/$(uname -r)/ | grep sch

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...