Best settings for gaming QoS+DSCP

Report issues relating to bandwith monitoring, bandwidth quotas or QoS in this forum.

Moderator: Moderators

Post Reply
VanCleef
Posts: 51
Joined: Tue Jul 09, 2019 9:01 am

Best settings for gaming QoS+DSCP

Post by VanCleef »

Hello everyone.
I've been trying to improve the performance of my games on Ps4.
I'm not an advanced user, I just want my online games to have the best performance possible.
So I believe I have found the best setting for online games.

Some people have already posted their settings here in the forum, including me.
Helped me a lot.
Now I've found a way to increment these settings, marking ports the games use a higher priority, using DSCP.

more about DSCP : https://medium.com/mindorks/improve-net ... e766d3373a



Just use this simple script in: /etc/firewall.user
(use vi command to edit)

iptables -t mangle -A PREROUTING -p udp -d 192.168.1.142 --dport 1024:65535 -j DSCP --set-dscp 48
iptables -t mangle -A POSTROUTING -p udp -s 192.168.1.142 --sport 1024:65535 -j DSCP --set-dscp 48

iptables -t mangle -A PREROUTING -p icmp -j DSCP --set-dscp 48
iptables -t mangle -A POSTROUTING -p icmp -j DSCP --set-dscp 48

run the commands after:
service firewall restart
reboot

Change the ip to your game machine.
Most games use udp high ports, icmp is just for ACC ping to work better.
udp ports and icmp are marked 48(CS6), this marking worked best for me.
You can also try 56 (CS7), 46 (EF) or 40 (CS5).
For consoles works fine, but if you play on PC and run a lot of torrents, it is better to tag ports individually:

iptables -t mangle -A PREROUTING -p udp -m multiport --dport 3659,3074,9305:9308,3478,3479 -j DSCP --set-dscp 48
iptables -t mangle -A POSTROUTING -p udp -m multiport --sport 3659,3074,9305:9308,3478,3479 -j DSCP --set-dscp 48

Change to the udp ports your games use.
TP-Link Archer C7 v2
Gargoyle: 1.10.0
Down: 38MB
Up: 6.5MB

VanCleef
Posts: 51
Joined: Tue Jul 09, 2019 9:01 am

Re: Best settings for gaming QoS+DSCP

Post by VanCleef »

Just a update, i have better resuts using only POSTROUTING, like this:

iptables -t mangle -A POSTROUTING -p udp -d 192.168.1.142 --dport 1024:65535 -j DSCP --set-dscp-class CS6
iptables -t mangle -A POSTROUTING -p udp -s 192.168.1.142 --sport 1024:65535 -j DSCP --set-dscp-class CS6

iptables -t mangle -A POSTROUTING -p icmp -j DSCP --set-dscp-class CS6
TP-Link Archer C7 v2
Gargoyle: 1.10.0
Down: 38MB
Up: 6.5MB

Sgt-Greco
Posts: 21
Joined: Thu Sep 28, 2017 9:28 am

Re: Best settings for gaming QoS+DSCP

Post by Sgt-Greco »

Thanks for your input mate. I appreciate your time.
I used your settings and I'm about to give it a try.
Do you port forward to your console or just DMZ ?

VanCleef
Posts: 51
Joined: Tue Jul 09, 2019 9:01 am

Re: Best settings for gaming QoS+DSCP

Post by VanCleef »

Dmz breaks some QoS Gargoyle rules.
I use ip fixed in my Ps4 and let UPnP do the work.
Port forwarding is good too.
TP-Link Archer C7 v2
Gargoyle: 1.10.0
Down: 38MB
Up: 6.5MB

VanCleef
Posts: 51
Joined: Tue Jul 09, 2019 9:01 am

Re: Best settings for gaming QoS+DSCP

Post by VanCleef »

This is my current setting:

iptables -t mangle -A PREROUTING -j DSCP --set-dscp-class CS0

iptables -t mangle -A POSTROUTING -p udp -d 192.168.1.142 --dport 1024:65535 -j DSCP --set-dscp-class CS6

iptables -t mangle -A POSTROUTING -p udp -s 192.168.1.142 --sport 1024:65535 -j DSCP --set-dscp-class CS6

iptables -t mangle -A POSTROUTING -p icmp -j DSCP --set-dscp-class CS6

iptables -t mangle -A POSTROUTING -p udp -s 192.168.1.142 --sport 1024:65534 -j TTL --ttl-set 255


1.All incoming traffic from all connections is remapped to normal priority.

2. Packets destined for my ps4 on specific ports are marked as high priority.

3.Packets coming out of my ps4 from the specified ports are marked as a high priority.

4. icmp also as a high priority, especially for ACC ping time.

5. An attempt to avoid packet loss when playing with players and servers that are too far away.
TP-Link Archer C7 v2
Gargoyle: 1.10.0
Down: 38MB
Up: 6.5MB

encro
Posts: 76
Joined: Fri Mar 13, 2015 10:52 am
Location: au.victoria

Re: Best settings for gaming QoS+DSCP

Post by encro »

This is interesting since while Gargoyle is great for dispersing load evenly, just using QoS alone doesn't seem to be giving me the most effective result for QoS Prioritisation of Real Time Traffic.

Reading through the DiffServ spec now (It's a lot to get my head around since I'm also quite new to traffic management) but wouldn't CS4 be the appropriate choice to use in this case?

If you are using CS6 then the RFC also states to set a minimum bandwidth for the class to be effective.

RFC4594:https://tools.ietf.org/html/rfc4594
Netgear WNDR3700v4 (N600) - Gargoyle 1.14.x
D-Link DIR-835 - Gargoyle 1.7.1 (Deceased)
Manual set up for PIA's OpenVPN in (Private Internet Access): https://www.gargoyle-router.com/phpbb/viewtopic.php?f=11&t=9129&p=45410#p45410

VanCleef
Posts: 51
Joined: Tue Jul 09, 2019 9:01 am

Re: Best settings for gaming QoS+DSCP

Post by VanCleef »

Yes, qos gargoyle is great, but acts more when link is saturated, while DSCP gives priority to the package at all times. Both together is the best combo. In the openwrt forum has good discussions about DSCP, gave me some ideas, advise to see too.
From what I know, CS4 is better for streaming video. I believe the best markup for real time like games and voip is EF or CS5, but in Wireless, WMM recognizes EF and CS5 for video class, while CS6 goes for voice class, which is the highest. I play over wifi and i have used cs6 for the incoming traffic, and the output is marked EF, since in theory it will travel by cable to the destination. If you use ethernet cable for gaming, use EF or CS5 in both directions if CS6 is not good.

iptables -t mangle -A PREROUTING -j DSCP --set-dscp-class CS0
iptables -t mangle -A POSTROUTING -p udp -d 192.168.1.142 --dport 1024:65535 -j DSCP --set-dscp-class CS6
iptables -t mangle -A POSTROUTING -p udp -s 192.168.1.142 --sport 1024:65535 -j DSCP --set-dscp-class EF
TP-Link Archer C7 v2
Gargoyle: 1.10.0
Down: 38MB
Up: 6.5MB

VanCleef
Posts: 51
Joined: Tue Jul 09, 2019 9:01 am

Re: Best settings for gaming QoS+DSCP

Post by VanCleef »

So I believe I finally found the definitive settings that will work for everyone, Pc, xbox, playstation, nintendo...

1- access your router by SSH, on Pc use the Putty, on android, I use JuiceSSH.

ip: 192.168.1.1
Port: 22
login: root
password: use the one you set in gargoyle

2- use the vi command to access the firewall:
vi /etc/firewall.user

The commands to edit the text are:
i -to enter edit mode

Esc -to exit edit mode

:wq -to save and exit (first leave edit mode)

3- Delete the text that is there and paste this script:

##NORMAL
Iptables -t mangle -A PREROUTING -j DSCP --set-dscp-class CS0


##ICMP
iptables -t mangle -A FORWARD -p icmp -j DSCP --set-dscp-class CS6

iptables -t mangle -A POSTROUTING -p icmp -j DSCP --set-dscp-class CS6


##GAMING
iptables -t mangle -A FORWARD -p udp --match multiport --sport 3658:3659,9305:9308,3478:3479,6000,14000:14016 -j DSCP --set-dscp-class CS6

iptables -t mangle -A FORWARD -p udp --match multiport --dport 3658:3659,9305:9308,3478:3479,6000,14000:14016 -j DSCP --set-dscp-class CS6


iptables -t mangle -A POSTROUTING -p udp --match multiport --sport 3658:3659,9305:9308,3478:3479,6000,14000:14016 -j DSCP --set-dscp-class CS6

iptables -t mangle -A POSTROUTING -p udp --match multiport --dport 3658:3659,9305:9308,3478:3479,6000,14000:14016 -j DSCP --set-dscp-class CS6


Image


4- Replace the port number with the ports used in your games, only the UDP high ports (between 1024 and 65535)


5- After saving and exiting execute this command:

 /etc/init.d/firewall restart
or
service firewall restart

Note if there are any errors in the firewall script, attention to spaces.

All right?
run the command:
reboot


I believe this Qos Gargoyle configuration works well for any
internet speed

Total Download: 100% of the speed

Total Upload: 90% ~ 98%

Here also change to the ports your games use

Image
Image
Image
Image

Restart the router after configuring everything.
TP-Link Archer C7 v2
Gargoyle: 1.10.0
Down: 38MB
Up: 6.5MB

Sgt-Greco
Posts: 21
Joined: Thu Sep 28, 2017 9:28 am

Re: Best settings for gaming QoS+DSCP

Post by Sgt-Greco »

Great.

A few questions as I know very little about networking.

1. The only UDP ports I need to forward are 3074 and 3478-3479 (Playstation). Is the syntax below correct ?

##ICMP
iptables -t mangle -A FORWARD -p icmp -j DSCP --set-dscp-class CS6

iptables -t mangle -A POSTROUTING -p icmp -j DSCP --set-dscp-class CS6


##GAMING
iptables -t mangle -A FORWARD -p udp --match multiport --sport 3074,3479:3480 -j DSCP --set-dscp-class CS6

iptables -t mangle -A FORWARD -p udp --match multiport --dport 3074,3479:3480 -j DSCP --set-dscp-class CS6


iptables -t mangle -A POSTROUTING -p udp --match multiport --sport 3074,3479:3480 -j DSCP --set-dscp-class CS6

iptables -t mangle -A POSTROUTING -p udp --match multiport --dport 3074,3479:3480 -j DSCP --set-dscp-class CS6


2. There is no console IP nowhere in your UP/DOWN or FIREWALL rules. Is this correct ?

3. How come no Gaming Rules in upload ?

4. If no one in the house uses the Internet (no LAN congestion at all), are all these rules necessary for Gaming ?. Or to put it differently is there any need for QoS at all ?

Thanks

VanCleef
Posts: 51
Joined: Tue Jul 09, 2019 9:01 am

Re: Best settings for gaming QoS+DSCP

Post by VanCleef »

Hello

1. Yes, that is correct. On ps4, you can also use ports 9305-9308, I believe are the ports used for party audio. Whenever I play on my ps4, upnp shows that they are being used.

2. Yes, since the ports being tagged correctly are not necessary, and I also feel it works better without ip.

3. I noticed that when the upload is saturated, the ping does not go up, and that must be why ACC is not in the upload.
But you can create a rule like this:

Image
Image


4. I have better performance using qos and DSCP,
But you can only test with DSCP, it might work.


Give us feedback if it's working for you.
Any questions I will try to help.
TP-Link Archer C7 v2
Gargoyle: 1.10.0
Down: 38MB
Up: 6.5MB

Post Reply