How to Set DSCP tagging and Autorate

Hi looking to add DSCP tagging can I make devices cs7 I have heard that it won’t work due to mostly being used for networking protocols etc so will be dropped. Also looking to install cake autorate is this beneficial vs setting a fixed speed ?

Please examine the RFC https://www.rfc-editor.org/rfc/rfc8325

Anything in wifi voice bin sends one data packet in next txop killing airtime. ie dont go above CS5.

For fixed speed you can use sqm, qosify, qosmate , whichever you feel is best for you.

Sorry I’m running A wired connection but would it still be an issue ? Documentation doesn’t really say anything regarding cs7 that I can find

Hope you have an internet connection?

No I mean as I know the higher the bit the lower the latency so CS7 can’t find anyone trying to test this on a device and whether it works or not, no documentation saying it wouldn’t work on a device . It just shows it’s used for networking protocols

DSCP marks shouldn't carry much meaning once they cross your network boundary (inbound or outbound). They're only relevant if you trust the device doing the tagging. You might trust your LAN clients to mark their own packets for prioritization within your network, but once those outbound packets leave your router, the markings should be washed or reset.

Likewise, any DSCP marks on inbound traffic from the internet shouldn't be trusted and should be washed or rewritten by your own rules or policies.

Cake-Autorate was designed for variable bandwidth internet connections, like 5G/LTE internet service. If you have a more stable ISP connection, you might be better with sqm-scripts, QoSmate, DSCPClassify, qosify, or cake-qos-simple. The possibilities are endless for stable-speed connections.

4 Likes

Can you guys have a look at the firewall rules ?
What about using diffserv 8 I tried some settings to enable etc but my network stopped working despite me checking tcpdump showing the Devices sending packets over my network with CS5 tagged .I started off setting couple rules but no luck at the end so i restored to a backup. I dont remember what the name was when i done UCI add firewall therefore i just put down below what i done.

iptables -t mangle -A POSTROUTING -s 192.168.77.175 -j DSCP --set-dscp 0xA8

iptables -t mangle -A POSTROUTING -s 192.168.77.106 -j DSCP --set-dscp 0xA8



uci add firewall rule
uci set firewall.@rule[-1].name='PC'
uci set firewall.@rule[-1].src='lan'
uci set firewall.@rule[-1].src_ip='192.168.77.175'
uci set firewall.@rule[-1].target='ACCEPT'

uci add firewall rule
uci set firewall.@rule[-1].name='PS5'
uci set firewall.@rule[-1].src='lan'
uci set firewall.@rule[-1].src_ip='192.168.77.106'
uci set firewall.@rule[-1].target='ACCEPT'

uci commit firewall
/etc/init.d/firewall restart


uci set sqm.eth0.interface='eth0'     
uci set sqm.eth0.download='850000'       
uci set sqm.eth0.upload='850000'         
uci set sqm.eth0.script='piece_of_cake.qos'
uci set sqm.eth0.qdisc_advanced='true'
uci set sqm.eth0.ecn='no'
uci set sqm.eth0.overhead='22'
uci set sqm.eth0.diffserv='8'            
uci commit sqm
/etc/init.d/sqm restart

Which AI generated this sh&t ? Max dscp value is 63 /0x3f

2 Likes

Yeah, there’s a lot of junk in there. piece_of_cake.qos doesn’t use any diffserv3,4,8. It uses besteffort single tin only.

AI-generated sh#t won't get you anywhere and nobody here can guess what you actually want or need. Here is a better way to kick off this discussion.

I have:

(describe your network layout here, including but not limited to connection type and speed, relevant local network devices, specifics of the device running openwrt and openwrt version)

I want:

(describe what you ultimately want to achieve, including eg if it's gaming then which games etc)

Problems with my current setup:

(describe what you think is not working well enough or should be improved)

1 Like

To illustrate the problem add a link to test result via https://www.waveform.com/tools/bufferbloat

1 Like

What about it? If you either desire:
a) 8 different priority tiers
b) less than 8 tiers but like the way diffserv8 divides the capacity for those tiers you want to use.

Also the way cake works is, once a tin exceeds its guaranteed priority capacity it is still scheduled with the other tins and will get more capacity, albeit only at equal priority to the other tins. So I would very much advise against putting bulk transfers into higher priority tins, and keep them in either the besteffort tin or the bulk/background tin(s).

there is no reason to not use it (but note piece_of_cake does not use if by default, but it can be easily changed via the config file).

BUT, keep in mind how prioritisation actually works:
For every packet that gets treated to less queueing delay/more immediate transmission (that is what higher priority boils down to) other packet(s) will need to be treated to more queueing delay or even to being dropped completely. A consequence of this is that prioritisation only works well if there are enough "victim" packets available, and especially that prioritising all packets is identical to not prioritising at all.
To me the take home message is to be very selective what to prioritise: as few packets as possible and only keep those prioritisation rules that reliably deliver measurable improvement for your use-cases. That is: do not build elaborate priority hierarchies based on theoretical musings alone, but always re-evaluate whether specific rules are still work as intended and are still needed.

[quote="Ray3, post:7, topic:241267"]

uci set sqm.eth0.interface='eth0'     
uci set sqm.eth0.download='850000'       
uci set sqm.eth0.upload='850000'         
uci set sqm.eth0.script='piece_of_cake.qos'
uci set sqm.eth0.qdisc_advanced='true'
uci set sqm.eth0.ecn='no'
uci set sqm.eth0.overhead='22'
uci set sqm.eth0.diffserv='8'     

Pretty sure that is unlikely to result in a working configuration... I tend to agree with the fore-posters that this looks like an AI output, where the AI should have rather passed instead of making up a config out of thin air.

Try changing /etc/config/sqm like this:

config queue 'eth1'
        option ingress_ecn 'ECN'
        option egress_ecn 'ECN'
        option itarget 'auto'
        option etarget 'auto'
        option verbosity '5'
        option qdisc 'cake'
        option script 'layer_cake.qos'
        option qdisc_advanced '1'
        option squash_dscp '0'
        option squash_ingress '0'
        option qdisc_really_really_advanced '1'
        option eqdisc_opts 'nat dual-srchost memlimit 32mb diffserv8'
        option linklayer 'ethernet'
        option linklayer_advanced '1'
        option tcMTU '2047'
        option tcTSIZE '128'
        option linklayer_adaptation_mechanism 'default'
        option debug_logging '1'
        option iqdisc_opts 'nat dual-dsthost ingress memlimit 32mb diffserv8'
        option interface 'eth0'
        option tcMPU '88'
        option enabled '1'
        option overhead '22'
        option download '850000'
        option upload '850000'  

Please note that for ingress prioritisation you likely should run either qosmate or qosify (or one of the other two projects where I can't remember the name right now), as for default sqm-scripts setting DSCPs for ingress traffic is really hard (you need to build your own tc based assignments and will not see the internal IP addresses).

Tl;dr: try qosmate which will give you a starting position much closer to what you seem to desire

Sorry when I said I restored the backup , Instead of writing what exactly what done I just told AI summarise what I had added and I told it I had used CS5 DSCP tagging etc the rest now looking was exactly the same , realise that should have been 0x28 . Since I’m familiar with using UCI in CLI so I have always been using that to change all settings.

This is my current network I have

FTTP 900 symmetrical ,

ONT > Pi 5 running as a transparent bridge with SQM > Router with WiFi disabled > Managed switch > Pc , 2 Acess points, TV , PS5 and Firestick all hard wired. Connected to the AP around 15 devices.

So I’m looking to prioritise my gaming devices at highest possible level and then devices like TV and AP as medium .

Issue I was facing before was I had a low min ping around 4ms unloaded but when anything on the network would download it would spike to 260ms max and jitter was 23ms making gaming feel very laggy a lot of the time as I could never get a consistent ping . Most of this was heavily improved by me developing and implementing a transparent bridge running SQM using a IFB block and virtual interface to shape traffic on ingress and egress . Now I’m just looking to try and optimise SQM using prioritisation etc to further improve my results as I still get spikes to around 35ms max and jitter around 6-8ms

1 Like

Maybe start with the per internal IP fairness first (and reduce the shaper to say 800 Mbps)... as long as you do not run large data transfers from the gaming machines, that might already be good enough to isolate gaming from bulk data transfers on other machines in your network.

I don't actually know enough about QOS to give you a good advice, I just wanted to help make this discussion productive. Now that you explained the situation, I'm sure others will offer advice.

2 Likes

Show the measurement result? Without qos and with your qos setup?

Please connect to your OpenWrt device using ssh and copy the output of the following commands and post it here using the "Preformatted text </> " button:
grafik
Remember to redact passwords, VPN keys, MAC addresses and any public IP addresses you may have:

ubus call system board
cat /etc/config/network
cat /proc/net/softnet_stat
cat /proc/interrupts
cat /etc/config/firewall

AI is a dead end. iptables-legacy will race with nftables for no good. Rest is probably crippled too.

Sorry about that I’m New to IT and OpenWRT just landed my first IT job 6 months ago as a Cyber Security engineer apprentice . When I can’t figure out what’s wrong I try use AI to help pinpoint the issue or give me an idea.

This was results without my Transparent bridge running SQM vs with. Not currently able to show you the output of the commands but will send that over