Ultimate SQM settings: Layer_cake + DSCP marks (New Script!)

put simply they make sqm less protocol agnostic... principally by identifying bulk/sparse/expeditable traffic...

depending on the network configuration ( and further mark tracking ), they may also offer greater inbound traffic handling which can be have a huge impact as they are typically difficult to manage... and are half of the total sqm experience...

with these scripts... media intensive interactive websites such as netflix with their 'hover over and pop up video' respond almost instantly... without them there is a noticeable few milliseconds of delay... as cdn is just another flow to 'equalise' amongst the others...

so in a nutshell... they expedite better flows and mark bulk better... which results in 30+% better experience on a typical modern home network...

Well, the OP had some exposition at the original post. IMHO the point is that SQM offers per-flow-fairness by default and allows an easy way to implement per-internal-IP fairness on top of that. IMHO that covers a lot of middle-of-the-road use-cases (especially on links with "enough" speed), BUT there are situations where the user actually requires targeted un-fairness, and that requires more involved configurations. This thread as well as the one that spawned it offer a specific refined script to allow loads of targeted unfairness, and can serve as great example of how to do that.
In a sense, the standard SQM scripts aims at "good enough" while these scripts go the extra mile to make things even better (but at the cost of requiring more involved configuration).

My router has Switch0 and based on your information not to use the veth method.
What should I change in your script.
Thanks

Solved, by deleting the vert script.
forgive me for not being thorough in reading all posts.
thanks

Hi I have a Router dual band with 4 connections.
i am using Mwan3 for load balancer, each connection has a different speed
wlan0 = 50/30
wlan1 = 70/60
wan (eth0.2) = 30/3
wan1 (eth0.3) = 10/3

That's why I set up SQM only on the LAN side and install this script without Vert
(ingress/egress FLIPS on LAN interfaces and without NAT)

My SQM Config is:

config queue
	option enabled '1'
	option interface 'eth0.1'
	option download '0'
	option upload '0'
	option debug_logging '0'
	option verbosity '5'
	option qdisc 'cake'
	option script 'layer_cake.qos'
	option qdisc_advanced '1'
	option squash_dscp '1'
	option squash_ingress '0'
	option ingress_ecn 'NOECN'
	option egress_ecn 'ECN'
	option qdisc_really_really_advanced '1'
	option iqdisc_opts 'diffserv4 dual-srchost'
	option eqdisc_opts 'diffserv4 dual-dsthost ingress'
	option linklayer 'ethernet'
	option overhead '18'
	option linklayer_advanced '1'
	option tcMTU '2047'
	option tcTSIZE '128'
	option tcMPU '64'
	option linklayer_adaptation_mechanism 'cake'

Is it true that the setup I made above, please correct it? Thanks

Hi All,

So I have implemented this using the LAN method as I don't use Wi-Fi on my router.

I think it's working apart from the fact YouTube loads very slowly when the WAN is under heavy load, the videos load fine, just the page loads slowly.

Any ideas?

hello can you help me to configurate idir ctinfo for PS4 prioritize games

thanks

https://gist.github.com/KiNgMaR/6298661 is it possible to incorporate this into hisham script? Most game servers lead to cloudflare if you dig far enoug...

Why have u made two config on eth0.1 and wan?

SQM by default uses an IFB for ingress, but that runs before iptables, so does not allow easy filtering and setting of DSCPs, so here I instruct SQN to not instantiate an IFB (option download '0' has that effect), but to still shap eingress traffic the scond shaper sits on the egress side of eth0.1 which points into the LAN (and hence affects traffic from the internet into the LAN). The sideeffects of such a setup are that traffic terminating at the router will not be shaped, nor will WAN to WiFi be shaped, but WiFi to LAN will be shaped. In other words that is a solution mainly if the primary router does not require WiFi... I hope that helps.

I see, ty for the information..

I wasnt having shaping on download side, i changed the interface to br-lan then it started working fine

just use CS4 for gaming i think

1 Like

hallo,help me this script please
My WAN is eth2 and prioritize ps4 (only) lan1
my sqm config

config queue 'eth1'
	option download '400000'
	option debug_logging '0'
	option verbosity '5'
	option enabled '1'
	option upload '0'
	option qdisc 'cake'
	option script 'layer_cake.qos'
	option linklayer 'ethernet'
	option linklayer_advanced '1'
	option tcMTU '2047'
	option tcTSIZE '128'
	option tcMPU '64'
	option qdisc_advanced '1'
	option squash_dscp '0'
	option squash_ingress '0'
	option ingress_ecn 'ECN'
	option qdisc_really_really_advanced '1'
	option egress_ecn 'ECN'
	option ilimit '18'
	option elimit '18'
	option iqdisc_opts 'overhead 28 diffserv4 nat dual-srchost rtt 200ms'
	option eqdisc_opts 'overhead 35 diffserv4 nat dual-dsthost rtt 200ms'
	option interface 'veth0'
	option overhead '0'
	option linklayer_adaptation_mechanism 'cake'

config queue
	option debug_logging '0'
	option verbosity '5'
	option squash_dscp '0'
	option squash_ingress '0'
	option ingress_ecn 'ECN'
	option download '1600'
	option upload '800'
	option qdisc 'cake'
	option script 'layer_cake.qos'
	option qdisc_advanced '1'
	option qdisc_really_really_advanced '1'
	option enabled '1'
	option linklayer 'ethernet'
	option linklayer_advanced '1'
	option tcMTU '2047'
	option tcTSIZE '128'
	option tcMPU '64'
	option egress_ecn 'ECN'
	option ilimit '18'
	option elimit '18'
	option linklayer_adaptation_mechanism 'cake'
	option interface 'eth0'
	option overhead '40'

what this realy do

#High priority ipset, i use for pubgM
iptmark ! -p tcp -m set --match-set latsens src,dst -j DSCP --set-dscp-class CS6 -m comment --comment "latency sensitive ipset" ## set dscp tag for Latency Sensitive (latsens) ipset,udp

iptmark -p tcp -m set --match-set latsens src,dst -j DSCP --set-dscp-class CS5 -m comment --comment "latency sensitive ipset" ## set dscp tag for Latency Sensitive (latsens) ipset

i play on ps4 and no traffic the if i change to udp proto

Those two lines set everything from or to the latency sensitive ipset that isn't TCP to CS6 and TCP to CS5

shaping was working fine till an hour back.... now it shows this... idk whats wrong...
now the veth0 is not limiting my download...
and sqm is not working on veth0 now...

qdisc noqueue 0: dev veth0 root refcnt 2
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0

sqm.@queue[1]=queue
sqm.@queue[1].debug_logging='0'
sqm.@queue[1].verbosity='5'
sqm.@queue[1].ingress_ecn='ECN'
sqm.@queue[1].tcMTU='2047'
sqm.@queue[1].tcTSIZE='128'
sqm.@queue[1].enabled='1'
sqm.@queue[1].download='0'
sqm.@queue[1].qdisc='cake'
sqm.@queue[1].script='piece_of_cake.qos'
sqm.@queue[1].qdisc_advanced='1'
sqm.@queue[1].egress_ecn='ECN'
sqm.@queue[1].qdisc_really_really_advanced='1'
sqm.@queue[1].ilimit='18'
sqm.@queue[1].elimit='18'
sqm.@queue[1].linklayer='ethernet'
sqm.@queue[1].linklayer_advanced='1'
sqm.@queue[1].tcMPU='64'
sqm.@queue[1].linklayer_adaptation_mechanism='cake'
sqm.@queue[1].interface='veth0'
sqm.@queue[1].squash_dscp='0'
sqm.@queue[1].squash_ingress='0'
sqm.@queue[1].upload='22000'
sqm.@queue[1].overhead='50'
sqm.@queue[1].eqdisc_opts='diffserv4 dual-dsthost ingress nat rtt 124ms'

anybody else has this problem?

restarted router and redid the setting on veth on sqm... now its working

I think maybe this is related to the question posted this morning about my other script not working after some time...

[SOLVED] SQM Script Hotplug

1 Like

Hello,

Concerning the DSCP.sh file.
Is there something to add in or in the dnsmasq.conf if we play csgo like the following :

#High priority ipset, i use for pubgM
iptmark ! -p tcp -m set --match-set latsens src,dst -j DSCP --set-dscp-class CS6 -m comment --comment "latency sensitive ipset" ## set dscp tag for Latency Sensitive (latsens) ipset,udp

iptmark -p tcp -m set --match-set latsens src,dst -j DSCP --set-dscp-class CS5 -m comment --comment "latency sensitive ipset" ## set dscp tag for Latency Sensitive (latsens) ipset

Regards

Hey guys,

I wanted to try those nice scripts to my router,
I placed the DSCP.sh to /root and then changed the dnsmasq.conf

All good until I restarted the rooter and now my devices cannot connect to wifi and my pc cannot get any ip, which makes the connection to the router impossible.

I actually did a hard reboot to the second partition for the internet to come up...
Any ideas how I can delete the script from the second partition? because now the DSCP.sh is hidden from the partition I'm currently in...

Thank you.

hi there..im a newbie here so..i wanna try your DSCP script without the "veth" on my Newifi with flashed Openwrt and already applied it , im not sure if it works or not.., and i hope if you can help me a bit to understand how to proceed if its not that much to ask but i'll ask anyway =) coz i been reading a lot of tutorials and wind up here..one thing i really get confused is the "veth" =( since im new on how to use "script" and i wanna show you whats inside of my router..by the way im on a low bandwwith ISP..3MbpsDown/1MbpsUp..and i love and play online games but lags at it..=(

The most well supported script currently is the one from the thread: Help prioritizing games with alternative qdisc design

but since you have such slow speeds, you should also read Why you need at least 3Mbps upload to get good game performance with ~1500byte packets: Doing the math

The script from the first link has some mitigation code that helps reduce the typical packet sizes for people with slow connections such as yourself. it can help a lot.

1 Like