Sharing dscpclassify configuration on OpenWrt

Hello I create this topic in order to share our dscpclassify configuration

this new script created by jeverley if I'm not wrong

here is my configuration inspired by amteza thanks again to all for your help

config global 'global'
	option class_bulk 'le'
	option class_high_throughput 'af13'
	option client_hints '1'
	option threaded_client_min_bytes '10000'
	option threaded_service_min_bytes '1000000'
	option wmm '0'

config rule
        option name 'Consoles ps5'
        option proto 'udp'
        list src_ip '192.168.2.160'
	list dest_port '!80'
	list dest_port '!443'
	option class 'cs4'
        option family 'ipv4'
	option counter '1'

config rule
	option name 'twitch1'
	option proto 'tcp'
	list dest_port '1935'
	option class 'cs3'
	list src_ip '192.168.2.160'
	option family 'ipv4'
	option counter '1'


@di_Niko @segal_72

my config sqm

thanks hudra

config queue 'eth1'
	option debug_logging '0'
	option verbosity '5'
	option qdisc_advanced '1'
	option ingress_ecn 'ECN'
	option egress_ecn 'ECN'
	option linklayer 'ethernet'
	option overhead '38'
	option linklayer_advanced '1'
	option tcMTU '2047'
	option tcTSIZE '128'
	option tcMPU '84'
	option linklayer_adaptation_mechanism 'default'
	option qdisc_really_really_advanced '1'
	option interface 'wan'
	option enabled '1'
	option qdisc 'cake'
	option script 'layer_cake_ct.qos'
	option upload '450000'
	option eqdisc_opts 'nat dual-srchost diffserv4'
	option squash_ingress '0'
	option squash_dscp '0'
	option iqdisc_opts 'nat dual-dsthost ingress diffserv4'
	option download '600000'

3 Likes

If this was inspired on my advise, I wonder why this is configured as '0', I'll never do that as I live in WiFi all time in my network. :wink:

Hola Alberto,

Do you think the impact is big setting this option in 0?
You still play online gaming? on wifi?

BR

I would recommend to try this out in both settings. WiFi WMM is not free of side-effects so using AC_VI, and AC_VO is not a clear win in all cases (both classes can hog considerable amounts of air time, and AC_VO is limited in how much aggregation it can perform resulting in an overall throughput loss). So I would be weary to use WMM unless I had made sure that the amount of traffic in AC_VI and AC_VO (especially the latter) was sufficiently low. But that realy depends on the local use-case, so I would say, try out both options.

1 Like

I guess this was based on my recommendation as I saw static marks get overwritten because of option wmm.

2 Likes

yes exactly hudra

but I wonder so much about the importance of using ifb4wan and dscp restoration

i played with dscpclassify and elanscript

and I would say 60% elan 40% dscpclassify

I also tested cake qos simple which is a gem by lynx

the ideal for me would be to be able to if it would be beneficial to see to use the restoration dscp on the script of elan :stuck_out_tongue:

my gameplay with elan script is very good

but i noticed elan's script consumes more cpu bandwith

Hola:

I always play on WiFi. As you may know by now, I'm not fond of FPS, and all my gaming is done in GeForce NOW. Based on the nft ruleset it might or might not impact your gaming if you are on WiFi. However, in my network, there are two considerations:

  1. I have minimal prioritisation of traffic (@moeller0 TM), i.e., GeForce NOW, Zoom, Teams and VoIP.
  2. I overwrite my qos_map so any EF packets go over AC_VI. I only use AC_VO for a few things, and gaming is not one of them.

My results are good. My latency is always around 25 ms and jitter sub 2 ms, with a median of 1 ms. Of course, your mileage might be very different.

UPDATE

After the last year of back and forth with DSCP marking, scripts, and a whole set of different approaches by people in this forum, I'm dumping my brain here. And I will lean on what I said so many times to someone in this forum, stop with the "it feels slow" nonsense and provide data, please.

I see that many people are using these DSCP markings, scripts, etc., when they connect one computer via Ethernet to the router while any other traffic in the network is non existent. So, to be clear, these scripts and configurations in these cases will do nothing at all. If you want to prove me wrong, please, provide data, not feelings; I would like to see it.

At this stage, I firmly believe most gamers are just changing things for the sake of changing things, and on many more occasions than they would like to admit, it's their lack of better gaming skills that makes it "feel slow".

There you go, I said it.

4 Likes

Agreed, see my comments right above. :wink:

Hmm... in which case? Because most of what I see people doing for gaming won't be affected by the translation done in the code, see below:

    ## Conntrack mark to WMM class vmap (RFC-8325)
    map ct_wmm {
        type mark : verdict
        elements = {
            $cs0 : goto dscp_set_cs0,   # WMM BE
            $lephb : goto dscp_set_le,  # WMM BK
            $cs1 : goto dscp_set_cs1,   # WMM BK
            $af11 : goto dscp_set_cs0,  # WMM BE
            $af12 : goto dscp_set_cs0,  # WMM BE
            $af13 : goto dscp_set_cs0,  # WMM BE
            $cs2 : goto dscp_set_cs0,   # WMM BE
            $af21 : goto dscp_set_cs3,  # WMM BE
            $af22 : goto dscp_set_cs3,  # WMM BE
            $af23 : goto dscp_set_cs3,  # WMM BE
            $cs3 : goto dscp_set_cs4,   # WMM VI
            $af31 : goto dscp_set_cs4,  # WMM VI
            $af32 : goto dscp_set_cs4,  # WMM VI
            $af33 : goto dscp_set_cs4,  # WMM VI
            $cs4 : goto dscp_set_cs4,   # WMM VI
            $af41 : goto dscp_set_cs4,  # WMM VI
            $af42 : goto dscp_set_cs4,  # WMM VI
            $af43 : goto dscp_set_cs4,  # WMM VI
            $cs5 : goto dscp_set_cs5,   # WMM VI
            $va : goto dscp_set_cs6,    # WMM VO
            $ef : goto dscp_set_cs6,    # WMM VO
            $cs6 : goto dscp_set_cs7,   # WMM VO
            $cs7 : goto dscp_set_cs7,   # WMM VO
        }
    }
1 Like

you see with htop in game

you use what router ?!

the advantage of dscpclassify is that it is extremely flexible
:wink:

@Hudra

how to update this repo? you know I saw that @hudra said he could see the counter by having it built but I have no more linux in range thanks

When testing dscpclassify in the beginning i marked my packets with ef and then i was wondering why they appeared as cs6. First i thought there was an issue with my config but then I had a closer look at the code and found out that with option wmm ef gets remarked with cs6 so I disabled it. I mean in the end it doesn’t really make a difference with diffserv4 if its cs6 or ef as it ends in the same tin but for new users i think this could be a bit misleading so i also recommended it to other users who got confused. I think @anon78773196 wanted to mark packets with cs3 and it got remapped to cs4 (what actually would make a difference with cake) because of option wmm. I think wmm should by default be disabled to not confuse new users but this i just my personal opinion.

3 Likes

my rules today doesn't appair :confused:

chain static_classify {
            ip saddr 192.168.2.160 udp dport != { 80, 443 } counter packets 109 bytes 9284 goto ct_set_cs4 comment "Consoles ps5"

i don't know why

You can just download the the new files from github as instructed in the github readme. Probably the easiest way…

or

You can also build your own firmware image (that’s how i do it) which is well documented in the OpenWrt docs. Just clone the dscpclassify github repo into your packages folder in your build root. If then there is a change within dscpclassify you only have to „git pull“ to get the changes and build a new image. At least that’s how i do

2 Likes

Gotcha, but this is clearly to get packets in the right classification for a WiFi network. But, you are correct, of course.

2 Likes

good evening everybody

i has add this rules for all not that ps5

so hi have just 3 rules now

config rule
	option name 'DNS'
	list proto 'tcp'
	list proto 'udp'
	list dest_port '53'
	list dest_port '853'
	list dest_port '5353'
	option class 'cs2'

I would like to prioritize the tcp games also in cs4 

but not to include the tcp port 1935 I thought of doing like this 

config rule
        option name 'ps5 consoles'
        option proto 'tcp'
        list src_ip '192.168.2.160'
	list dest_port '!1935'
	option class 'cs4'
        option family 'ipv4'
	option counter '1'

I would like the 1935 port to remain in cs3 because I apply cake sqm in diffserv4

why I do this because some games on pc play in tcp like WoW or LoL I think

ok but i has just download to github i download where for update i has read the readme

maybe developp to jeverley i has try but not counter in firewall

more simply for me to make by github

This is arguable, also I would propose that on OpenWrt the way to align WiFI ACs with desired priority tiers is to adjust the qos_map instead of manipulating DSCPs, but I accept that this might be a matter of personal taste (and of layering, in a mostly nftable solution it seems attractive to solve this inside nftables as well, compared to dragging in changes to external config files....)

I see people here showing that the input and output ports are being marked by dscp, in my case my input ports are marked but the output ports are not?

06:55:49.187432 IP (tos 0x0, ttl 128, id 31429, offset 0, flags [DF], proto TCP (6), length 40)
    10.10.1.160.62297 > 31.13.85.53.443: Flags [.], cksum 0x74d8 (correct), ack 72, win 1025, length 0
06:55:49.407239 IP (tos 0x20, ttl 48, id 20201, offset 0, flags [DF], proto TCP (6), length 40)
    139.59.210.197.443 > 10.10.1.160.62359: Flags [.], cksum 0x13d5 (correct), ack 828, win 501, length 0

My DSCP CLASSIFY test settings

config global 'global'
	option class_bulk 'le'
	option class_high_throughput 'af13'
	option client_hints '1'
	option threaded_client_min_bytes '10000'
	option threaded_service_min_bytes '1000000'
	option wmm '0'


config rule
	option name 'test'
	list proto 'tcp'
	list dest_port '443'
	option class 'cs1'

SQM

config queue 'eth1'
	option enabled '1'
	option interface 'pppoe-wan'
	option download '75000'
	option upload '30000'
	option qdisc 'cake'
	option script 'layer_cake_ct.qos'
	option linklayer 'ethernet'
	option debug_logging '0'
	option verbosity '5'
	option qdisc_advanced '1'
	option squash_dscp '0'
	option squash_ingress '0'
	option ingress_ecn 'ECN'
	option egress_ecn 'NOECN'
	option qdisc_really_really_advanced '1'
	option iqdisc_opts 'nat dual-dsthost ingress diffserv4'
	option eqdisc_opts 'nat dual-srchost ack-filter diffserv4'
	option overhead '38'
	option linklayer_advanced '1'
	option tcMTU '2047'
	option tcTSIZE '128'
	option tcMPU '86'
	option linklayer_adaptation_mechanism 'cake'

Where did you capture this?

On the wan interface you should see egress DSCPs set by qosify but not ingress DSCPs (you will instead see whatever DSCPs come in from your ISP, these might or might not make sense for your own network, likely the latter).
On the lan interface(s) like br-lan you will see ingress DSCPÜs set by qosify but not egress DSCPs (instead you will see whatever DSCPs were set by the hosts in your internal network, these often can be made to make sense... but you need to use qosify's '+' notation so these are honored)...

1 Like