Tackling BufferBloat and Equitably Sharing Bandwidth

Started by timtrace, March 26, 2024, 03:30:37 AM

Previous topic - Next topic
March 26, 2024, 03:30:37 AM Last Edit: March 26, 2024, 03:50:25 AM by timtrace
I've applied Maltech's BufferBloat How-To on my symmetrical 1GB ATT fiber service.

Now, I want to add something like shaped, equitable bandwidth sharing on top of it, and I want to apply the shaping to a subset of hosts.

192.168.200.0/24  <--- internal subnet
192.168.200.96/28 <--- equitably share up to 300MB among themselves, on demand
192.168.200.128/25 <--- equitably share up to 50MB among themselves, on demand

So .0/24 would get 1000MB when .96/28 and .128/25 are idle.

Then, a host in .96/28 would wake up and pull up to 300MB from the rest of the .0/24. If a second host woke up in .96/28 pulling 300MB, it would only get 150MB, and the first host would drop back to 150MB - equitable sharing! Ditto for the .128/25 but the numbers are smaller.  ;D

Finally, if a host outside of .96/28 or .128/25 started pulling hard, it wouldn't rob bandwidth from the smaller subnets as long as they ran below their limits.

This sounds like basic QOS to me, but I don't know how it dovetails with the bufferbloat fix and the OPNsense UI.

So I have two questions right off the bat: 1> Am I making sense here, and 2> Is it possible to do this? Thank you!

Sounds to me what are you looking for is more like to guarantee a certain BW to a "Certain HOST/Subnet". If yes 1. & 2.

1. Weight it self is a ratio, you use the Weight to say who gets what %, if a specific queue with a specific Weight is not consumed it will be allocated across other Queues within the same Pipe.


Traffic can also be prioritized by adding queues and defining weights.
Strictly speaking traffic is not really prioritized but applications with a higher weight
can consume more bandwidth than others when the total available bandwidth is limited.


2. Not possible with FQ_CODEL see >

https://forum.opnsense.org/index.php?topic=36602.msg178873#msg178873


Overall & Otherwise >
The evenly share is that all will get even BW during saturation, but more or less, first come first take.
Meaning
Host 1 downloads at 1G
Host 2 starts and wants 200M, thus Host 1 should drop to 800M
Host 3 will come and wants to DL at 200M so, Host 1 drops to 600M, Host 2 should retain 200M
Host 4 starts and wants 250M, Host 1 drops to 350M, Host 2 & 3 should retain 200M

Regards,
S.
Networking is love. You may hate it, but in the end, you always come back to it.

OPNSense HW
APU2D2 - deceased
N5105 - i226-V | Patriot 2x8G 3200 DDR4 | L 790 512G - VM HA(SOON)
N100   - i226-V | Crucial 16G  4800 DDR5 | S 980 500G - PROD

March 26, 2024, 07:14:49 PM #2 Last Edit: March 26, 2024, 07:22:54 PM by timtrace
Thank you, that was an excellent response.

If I do these things ...

1. Copy Maltech's download pipe and set BW 150 quantum 350
2. Copy their queue and connect it to the copied pipe
3. Copy their rule, put it first in the sequence, target the copied queue, and assign the destination .96/28

... assuming my Maltech download and upload pipes are bandwidth 860, and download is quantum 2560 ...

... do I have to back the Maltech download pipe to bandwidth 710 and quantum 2200?

This is based on the reasoning that the pipes are blissfully unaware of each other's existence and that I will be setting a hard QOS in favor of the .96/28.

Am I going wrong anywhere in here?

This would work but keep in mind if you will divide BW per pipe/queue, your hosts in that pipe/queue cant never go above that specific BW set.

If you want to just have all available BW for all at any time, you need to set the hosts/subnets  all within one pipe. 1 pipe 1 queue, as mentioned FQ_CODEL should divide it equally. But if you really need to gurantee a certain MAX at all time then you need to divide it as you mentioned.

In regards FQ_Codel and quantum:
Quantum should be set no more no less than is your WAN MTU. We had actually a discussion with one of the algorithm creators of FQ_CODEL here on the forum. And he explicitly advised how it shoudl be set is

A. Quantum no more no less than WAN MTU (If you are going to SHAPE internet traffic on WAN interface)
B. BW in the pipe should be targeted around 85% (this may vary depending on the consistency ISP can provide) of the capacity your ISP provides you in order to take control of the queue away from the ISP and absorb slow start bursts
NOTE: In a sub-40Mbit scenario we recommend 300

Meaning if you SHAPE 1G as whole, your BW in Pipe should be around 850-900M. If you will divide the BW into several Pipes, divide in such a way that if all pipes/queues will be used they will not aggregate all together at once 1G during peak saturation.

Meaning lets say you have 24x7 consistent 1G at disposal, we target 900M as due to the above. So you have 900M you can divide into Specific Pipes.

Regards,
S.
Networking is love. You may hate it, but in the end, you always come back to it.

OPNSense HW
APU2D2 - deceased
N5105 - i226-V | Patriot 2x8G 3200 DDR4 | L 790 512G - VM HA(SOON)
N100   - i226-V | Crucial 16G  4800 DDR5 | S 980 500G - PROD