Help me update my HFSC shaper scripts for fw4/nftables

i think use a script for a friend because cake qos script and adsl is a little bad so all seem slow

because he has only 20 and 3 up but i has thinked replace DSCP cs4 to AF41 or cs3 for traffic gaming has more space

Yes, given cake's hardcoded per tier shares, this is exactly the best way forward.
Personally, I would on that 20/3 link, really only up prioritise the specific game traffic and leave everything else at default.
As a rule of thumb, prioritisation works best if used sparingly, as for every packet treated to lower delay, other packet(s) will be treated to higher delay or even drops.

1 Like

Best way to set this for pppoe connection 900/80?

thanks zia

Does anyone know the MPU if my overhead is 44

Have a look at:
https://openwrt.org/docs/guide-user/network/traffic-shaping/sqm
and
https://openwrt.org/docs/guide-user/network/traffic-shaping/sqm-details

for information about mpu...

The relevant MPU likely is dependent more on the link technology and less on the configured per-packet overhead.

Hmmm I see. My reasoning to the answer is because I am using the experimental HFSC script by @Hudra that has the option to use cake instead of the usual pfifo. And in that script it asks for the common link such as raw, conservative, Ethernet, etcā€¦. Iā€™m on a docsis 3.1 connection with a speed of 2 gig down and 250mb up (currently 2 gig down and 75 up since my modem is incapable of pushing more upload due to firmware issue). So I was wondering what to put for that option. I see that on openwrt sqm details guide it says to use overhead 44 since my speed is greater than 760mb. So I donā€™t know if I should input docsis for the setting or what.

The named overhead keywords in cake are just there for convenience:
e.g.: the docsis keyword is equivalent to overhead 18 mpu 64 noatm
so you can use either for a true docsis link. DOCSIS ISPs almost never use anything special so overhead 18 is likely correct. However specifying a bit more overhead has only a little effect on achievable throughput, while specifying too little can result in clear increases of latency under load, that is why the wiki recommends to rather err on the side of too big, and 44 bytes is a value that will cover almost all commonly used links to the best of our knowledge.

1 Like

Ahhh I see. Iā€™ve been trying to experiment different numbers to see what works best for me. Is there a formula to calculate the exact overhead and mpu? Or is the formula listed in the link youā€™d have given prior to these messages. I believe attaining the exact numbers for my internet can give me a good balance between controlled latency and throughput. Iā€™ve seen that when I use overhead 44 with no atm and leave the mpu blank. My gameplay feelsā€¦how should I sayā€¦ more fluid or snappier. When I input mpu 84 or say 96 my gameplay feels sluggish. I think for my internet. Given that I have asymmetrical speeds but at the same time a very high download speed and somewhat high upload since Iā€™m in the newly mid split area, I would need to find the proper numbers to achieve a healthy balance for my network.

Typically not, as it depends on the mostly not well publicly documented details on the encapsulation, but in the case of docsis it is quite simple overhead 18 mpu 64 are in all likelihood the correct settings.

I thinbk this is listed there, so yes.

I doubt that.. as long as the configured overhead is >= the true overhead and the shaper rate is <= the true bottleneck rate and configured mpu is >= true mpu you are fine and the exact settings do not really matter all that much.

I would respectfully argue that your perception is playing tricks on you here... unless your link is actually saturated with other traffic at the same time you play your games these two sets of settings should not cause any noticeable difference...

Now, your network, your rules, if you find a set of numbers that you are happy with, I am not going to argue much, but conceptually the differences in expected behaviour between these sets is really to small to perceive differences without doing actual measurements.

Oh yes my house is a smart house with everything connected to wifi including lights, thermostats, cameras, alarm systems, iPhones, iPads, a few pcs, game consoles, smart tvs, and streaming boxes to achieve show channels for the tvs. But yes my connection is almost always being used up. Hence why I have the highest internet plan from comcrap Xfinity. Given my connection isnā€™t entirely used up but being on cable. The quality isnā€™t the greatest if we arenā€™t talking numbers but jitter and latency spikes. But I will try the given docsis input and see how that goes. Maybe even with my 2 gig speed I should stick with the docsis overhead of 18 or whatever it may be.

Hello, did you try putting the modem in bridge mode?
capable in this bridge mode, your router can have full control of the traffic.

In my case, something that helped me is setting a static IP to all connected devices. And add them to the list in the scripts

LOWPRIOLAN4="192.168.109.2" # example, add your low priority lan machines here

My modem is a modem only. No Wi-Fi on it.

Well my ips donā€™t really change at all tbh so I donā€™t think I necessarily need to do that. If it was ipv6 I would need to but I completely disabled ipv6 as itā€™s easier to use custom scripts and not have to edit them every time a ipv6 gets a new address for a device.

I am referring to the modem that your ISP internet provider installs. This would put it in bridge mode, and thus your router with OpenWRT where you place your scripts, would have control of the network traffic. I don't know if I'm explaining myself, I'm speaking to you through a translator and by the way, what is the model of your router?

Since it's using cake as a leaf-qdisc cake is probably not shaping, and so the overhead etc is irrelevant. When you use cake in this way it's essentially a fancy fair-queue

The version in my dev branch that he's referring to really does use cake as the root qdisc. I never released the version with cake as the leaf qdisc because I thought it could be confusing if there were a setting for cake as the root qdisc (replacing hfsc) and one for it as leaf qdisc (replacing fq_codel) and actually, there was no real benefit to using it as the leaf qdisc other than its sophisticated ACK filter and this also came with the tradeoff of higher resource usage.

2 Likes

Thanks hudra latest script is working great for me using Bfifo,in bf games i play hit reg is really good.
Was wondering how does bfifo determine byte size?
If different games use different byte size per packet how to set correct size?trial and error?

used this site to generally check for packet loss, but does give info on byte sizes per game

Zia

1 Like

Bfifo expands to byte first in first out, the kernel knows the size of packets and the amount of space left in a bfifo and will only move a packet from the higher level to a bfifo if that has enough room for that packet.
And the size of that bfifo is something you need to specify when you create that qdisc...
Conceptually a bfifo is marginally better than a pfifo, as at least the expected queueing delay can be estimated more easily... (in a pfifo of X packets the kernel does not care whether we are talkking 64 byte packets or 64K byte GSO/TSO meta packets, so worst case the amount of data in those X packet slots can differ by a factor of ~1000*).

*) Typically packets during load tended to be around 1500 bytes and hence even a pfifo allowed a decent enough estimate of buffer space, but bfifo is clearly the better of the two, but mostly neither is sufficient unless you can almost guarantee that your traffic will not create a standing queue (and then the difference does not differ because it does not matter in with unit you measure an almost empty queue :wink: )

2 Likes

Going from pfifo or cake i notice reduction in latency on my connection.


Red spike are when i restarted router at 10pm i enabled cake and at 10 am went back to bfifo

Zia

1 Like