CAKE QoS Script (OpenWrt)

for information, the firewall indicates that for the class cs4 the packets are marked and displays the number of megabits to process in this class, however the capture shows that all the protocols are at CS0 .. I did not test to replace Forward as Dopam offers.

as i feel no difference with or without the script told myself that my ISP washes my class?

2 Likes

Ok thank you, how can I verify that my ISP is washing or not washing my class ?

what can I do to be sure to wash them?

Yes i confirm, than forward don't mark the packet to wireshark look

DOWN_NAT="no"  # Write: "yes" | "no"
UP_NAT="yes"   # Write: "yes" | "no"
               # Perform a NAT lookup before applying flow-isolation rules to improve fairness between hosts "inside" the NAT.
               # Don't use "nat" parameter in download when use 'Veth method' or flow-isolation stops working.
               # Only use "nat" parameter in download when use 'Normal method'.
               ## Recommendation: Don't use "nat" in download on the "Veth interfaces" and only use "nat" in download and upload on the "WAN interface".

DOWN_WASH="no"  # Write: "yes" | "no"
UP_WASH="yes"   # Write: "yes" | "no

my settings whashup

and my settings postrouting to the place forward

with forward i has all dscp with CS0

the screen next is with postrouting

look this

### DSCP marks ###

## Before changing the DSCP marks, first look at the images of the post and read this:
## Information: https://datatracker.ietf.org/doc/html/rfc8325


## Default Chain for iptables
CHAIN="POSTROUTING"  # Write: "FORWARD" | "POSTROUTING"


## Wash all DSCP marks and now this is the default DSCP for all unmarked traffic.
STANDARD_DEFAULT="CS0"

@elan



2 Likes

indeed with postrouting the DSCP appear in the capture! to my regret i can't take advantage of this, there is no improvement .. i constantly have latency which destroys any online gaming experience. I have tested at least 5 scripts from different developers (thank you very much) and none of them work for me.

1 Like

yes thanks just if i play in wireless i enabled the wireless and then i active the script or reverse

what is the command for restart the wireless for apply in putty thanks ? @elan

1 Like

What is your version of OpenWrt you can't install tje full packages required with old version install snapshot or 21.02.1.mayne ( i has snapshot ) et younwill can instalm packages normally

Keep me inform :slightly_smiling_face::wink:

WE are modifed the script with élan for dscp marked postrouting and not forward .. cheers

1 Like

@elan hello, can you lend me a hand?? I am using the script, I have my ps4 in the ip 192.168.1.3 that I add to games console and then I have an AP in the ip 192.168.1.9, is it okay if I put the AP in torrent box?? or do I leave the AP free? everything else I think I have it well configured and data passes through the sites I want but I have that doubt.

1 Like

I have also noticed that the speed and dslreport tests go through video "AF31" this causes me packet loss if I use differv4 but if I use differv8 no.. how can I do to not have that loss of packets in differv4??

after doing a speed test I still have packet losses even when putting in CS0,

Your router may not have the capacity for your speed, more than 500Mbit is recommended to build an x86 router or may also be that your ISP in peak hours gets saturated and causes you to have a bad connection, I don't know.

If you have a bad or unstable connection even using CAKE (because your ISP is bad), you will still have a bad connection even if you use DSCP marking.

As he said:

1 Like

I have 1gb of ftth fiber what values do you recommend? according to the table I see that noatm 84mpu and 38 oh?? would ethernet be right?

Yes, but you can also test the overhead values from here:

2 Likes

my whole family is connected to ArcherAX20 I do not care that they are all of the bulk class my doubt is if I should put all the IPs or only the router where they are connected ?

opnwrt

Given the low guaranteed rate of the bulk class that seems a rather contentious position, but then your network, your policy.

If you use NAT on the archer then using the archer's IP address will be the only solution, if the archer just acts as wifi access point and all devices get their IP addresses from your primary OpenWrt router, then you will need to add the individual devices' IP addresses.

Assuming you want to force a single priority tier on all machines hanging off the archer.

1 Like

the IP of the archer is 192.168.0.x

That by itself does not tell me too much (it hints at the archer performing NAT but is not conclusive).
How is that archer configured:

  1. stock firmware or OpenWrt
  2. which port is connected to the OpenWrt primary router, the WAN port or one on the LAN port
  3. how is that port in the archer configured (presumably it is the archers WAN port configured as DHCP)
  4. what IP addresses do the computers connected to the archer get (presumably from the 192.168.0.X (aka 192.168.0.0/24) rang)
1 Like
ISP ---> rpi4b---->my pc
           |_____>AX20

That still does not answer the question unambiguously, the question you need to answer is, what IP-address does your rpi4b see for computers connected to the archer. If the archer is configured as NAT route, that will be the archers 192.168.1.105, if the archer is not configured for NAT than each connected host will likely get its IP address also from the 192.168.1.0/24 range and you will need to add addresses individually. It seems slightly more likely that your are running double NAT here but hard to prrof from the outside.

Side-note if you are truly running in double NAT mode and use cake's sul-srchost/dual-dsthost method, then all machines attached to the archer will (under contention) only count as a single machine in IPv4 and further down-prioritising them will likely have very little effect. You could try to instantiate an additional hard traffic shaper on the archer to not only limit their share under contention, but unconditionally, but IMHO you should first test whether your gaming works sufficiently well with the archer disconnected. Because if your problems are not caused by the rest of your users traffic, throttling them down seems unnecessarily unfriendly.

ADDED: about your diagram, since the rpi4b only has one ethernet interface how dod you connect it with three other devices:
a) one built in ethernet and two USB ethernet dongles?
b) one built in ethernet, a managed switch and three VLANs?
c) one built in ethernet and one USB ethernet dongle, and a managed switch & VLANs to split "my PC" and "AX20"?
d) something else using the rpi4b's WiFi to connect one of the three shown branches?

1 Like

hi,

your drop rate, if i calculate correctly, is 0.02% ... would not worry unless you actually notice the 223 drops out of the 1052325 (e.g. all relates to a VoIP call).

but let's understand couple of things:

  • everybody should read this fantastic post who has 500+ Mbit internet access,
  • some basics about home vs public networking and false high hopes regarding what you can or cannot control (sorry to referring my own post),
  • there are more and more forum threads and posts are opened each day about QoS/SQM/CAKE and looks there are many misunderstanding what you can expect realistically

so you have pretty decent internet connection and low-mid end home multi purpose device (router, AP, switch, fw) in one box, which was working nicely so far and now wondering if it is working with 500mbit internet (you've just upgrade to maybe due to lockdown) but you are at home with your family in lockdown everybody try to do work, video conf, playing, streaming simultaneously ... and now you start feeling problems. real or imaginary problems.
why not to enable sqm/cake/qosify, what could go wrong, it must be better with qos on, right?

not necessarily.

with a low-mid end relatively cheap device without qos you saturate your internet line because device has hw offloading which even if you're picked the right router which is fully supported by owrt still means hw (or less effective but still valid software) offloading the same. i.e. offloading is taking off the burden from the CPU (which is kind of weak in these type of devices) to deal with legitimate traffic, so the flow is very straight and direct between the end points, there is no need to process it as it is legitimate -> hence it is very quick and even a low end device can work with crafty internet access. it is acting like a switch bluntly speaking.

But. offloading is neutral to traffic type, it does not know if any traffic is more important for you, it is handling each packets equally. the very moment you switch on qos because you want to prioritize traffic it will use CPU as it has to check, identify, analyze and re-queue packets in a way you configure, not in the way they flowing in. which means no offloading can be used, but all traffic is now processed by the weak CPU! you have to pay the price of prioritization: for example giving up some of the paid bandwidth so your CPU still can handle the traffic (hence the recommendation to set qos thresholds to approximately 80% of your internet speed), or if you up mark something you should down mark something else to be in balance (or there will be more delay or even drops)!
you have a bottleneck, your router's CPU, no matter what you hope from qos, no matter how you tweak your configuration.

so in short know your limits and try to find an acceptable compromise between speed, latency, bandwidth, priorities and price. you cannot have all, sadly that's reality. any offered solution (sqm,qosify etc) if improves your situation it is great, just be happy with it, but it will not solve all your issues for sure. or accept the fact you need to invest real money to have much better internet experience.

2 Likes

+1: ALSO drops is the way cake/fq_codel signal specific flows to slow down, so not only are drops (under saturating conditions) unavoidable, but for an AQM they are signs of the AQM actually working as intended. Sure, if the endpoints negotiated to use ECN and the link is not severely overloaded these drops could be replaced be CE-marking to instruct (well-behaving and responsive) flow to slow down, but there are quite a lot of IFs in that sentence...

QoS often is not needed I agree to that, but sqm, especially cake can offer attractive features even to fast links, like per IP-fairness and better micing/interleaving of different flows (resulting in less jitter for all flows).

Plus offloading often comes at the cost of generality, so by using offload engines to have a router punch above its true weight class one needs to trade in the potential to do a few things one might or might not desire; not a show-stopper for offloads but certainly something to keep in mind. (Making things simpler is one of the ways how offloads reduce the processing load, but some complexity exists to enable some features, removing that complexity hence removes the ability to use those features).

+1; excellent way of describing the challenge here!

2 Likes