OPNsense Forum

Archive => 20.1 Legacy Series => Topic started by: moonman on March 08, 2020, 03:01:06 am

Title: Traffic shaper is not working properly for me
Post by: moonman on March 08, 2020, 03:01:06 am
There are 2 issues with it:
- It halves the total bandwidth for every user
- It limits the bandwidth per user, instead of per pipe. Given enough users, the cumulative bandwidth will exceed that of the maximum bandwidth of the pipe.

There are at least 2 topics on this on this forum. One from 2016 and one from 2018. Github issue was closed in 2019 with no resolution (and 1 more problem added while trying to fix the initial one).

Is anyone working on this at all?

https://forum.opnsense.org/index.php?topic=7235.0
https://forum.opnsense.org/index.php?topic=3966.0
https://github.com/opnsense/core/issues/2191


Title: Re: Traffic shaper is completely broken in opnsense
Post by: moonman on March 08, 2020, 05:20:08 am
So after reading the comments, one does not need to set the mask. Somebody needs to edit the wiki to get rid of that. Once mask is unset, it limits the bandwidth for the whole pipe.

The other problem is still there though.

Here's the list of corresponding values that I got from testing.

It is value set under Shaper -> Pipe (downpipe) vs actual value I get from speedtest.
Something is really off, and the results are consistent after many runs.

Pipe  - actual
150 -  80
300 -  150
320 -  200
330 -  250
340 -  ~310 My max connection speed is 300 with initial burst of up to 320

(https://i.imgur.com/f18O9fg.png)
Title: Re: Traffic shaper is completely broken in opnsense
Post by: mimugmail on March 08, 2020, 07:12:59 am
Where is the link in the Wiki with wrong explanation?
Did you read the Help Text of masks?
Title: Re: Traffic shaper is completely broken in opnsense
Post by: franco on March 08, 2020, 08:32:53 am
Whenever possible avoid generalisation of "it's broken" assessments. It can keep help away from your thread.

FreeBSD has a nice way of declaring the priority of an issue report: "affects only me", "affects some people", "affects everyone". If unsure, you should always assume "affects only me" unless you have confirmed that others are seeing the same thing on a local or global scale. :)


Cheers,
Franco
Title: Re: Traffic shaper is completely broken in opnsense
Post by: moonman on March 08, 2020, 09:55:36 pm
Where is the link in the Wiki with wrong explanation?
https://docs.opnsense.org/manual/how-tos/shaper.html
I suppose after reading those two topics on the forum + github and none of them were marked solved and I was seeing similar behavior I just assumed it wasn't fixed. After reading the help text for masks I realized mask behaves differently for "Pipe" and for "Queue".
Quote
Did you read the Help Text of masks?
I did, as I stated in the second post.

Whenever possible avoid generalisation of "it's broken" assessments. It can keep help away from your thread.
Apologies, duly noted. Topic subject edited.

I'm still having issue with only half of bandwidth available to me. I've now tested with 3 clients at the same time, and when the pipe bandwidth is set to 300, I only can get ~150 (+/- 10) Mbit/s cumulatively on all clients
Title: Re: Traffic shaper is not working properly for me
Post by: mimugmail on March 08, 2020, 10:11:25 pm
Screenshots of Pipes, Queues and Rules please
Title: Re: Traffic shaper is not working properly for me
Post by: moonman on March 11, 2020, 02:05:13 am
Here you go.

I have no problem with my upload shaping by the way, but it is only 15Mbit/s pipe.
Title: Re: Traffic shaper is not working properly for me
Post by: japtain.cack on April 01, 2021, 08:39:55 pm
I know this is a bit old, but I've been trying for a year to get traffic shaping to work as well as it did in pfsense. I migrated to opnsense about a year ago and have been less than satisfied with traffic shaping, wireguard, and the latest changes to the traffic graph aren't as informative as they were in the past.

So, I've followed the opnsense guides and am very familiar with the links to the issues posted. Specifically
https://forum.opnsense.org/index.php?topic=7235.0

I've nuked all my settings and started from scratch numerous times thinking I did something wrong.

First, I followed the guide from opnsense. This resulted in an upload/download pipe set to my ISPs bandwidth specifications, upload/download queues, and an upload/download rule

This seemed to help, I did get slightly better speeds when something was using all the bandwidth. To test, I had my desktop download a steam game at full blast and did speed tests on my laptop. I was getting about 3Mbps down on the laptop, sometimes less, but the desktop was still downloading at 75Mbps or so, and was more/less unaffected by the shaping.

However, today, I finally got traffic shaping working for shared internet across all vlans to wan in/out.

Here's what I've come up with. But first, let me describe my layout:

ISP UP/DL:
UP: 40Mbps
DL: 80Mbps

VLANs:
20_LAN, 30_guest, 50_isolated, 100_iot

WANs:
only one, pppoe0

output of ipfw -a list, we only care about the queues so I've only included that output.

Code: [Select]
root@opnsense01:~ # ipfw -a list

60001 11698461 17007930989 queue 10001 ip from any to any recv pppoe0 xmit lagg0_vlan20 // a6e70bb8-d78d-476e-a4b3-f05e6b3647ea wan -> opt1: Queue WAN Downd
60002  9321607   996798783 queue 10000 ip from any to any xmit pppoe0 recv lagg0_vlan20 // 5e0c6413-0a1f-47a5-9b32-24a34eb595b8 opt1 -> wan: Queue WAN Uplod
60003   263208   333891849 queue 10001 ip from any to any recv pppoe0 xmit lagg0_vlan50 // 4e016558-e251-4b47-a362-8561b1b8d0b5 wan -> opt2: Queue WAN Downd
60004   277856   104526307 queue 10000 ip from any to any xmit pppoe0 recv lagg0_vlan50 // 6625845a-e8c3-40cd-9546-317cafee4d12 opt2 -> wan: Queue WAN Uplod
60005   115963   116951966 queue 10001 ip from any to any recv pppoe0 xmit lagg0_vlan100 // 77dbdd28-393f-43b5-852b-4dd9d06e8e5b wan -> opt4: Queue WAN Dowd
60006   106041    38089982 queue 10000 ip from any to any xmit pppoe0 recv lagg0_vlan100 // 78f3ca35-32ab-428e-a58a-dce8ad097b15 opt4 -> wan: Queue WAN Upld
60007   103515   142606808 queue 10001 ip from any to any recv pppoe0 xmit lagg0_vlan30 // f2c84d39-63dc-46a1-8882-edab23edb93b wan -> opt3: Queue WAN Downd
60008    63038     4545797 queue 10000 ip from any to any xmit pppoe0 recv lagg0_vlan30 // c09e826e-fa31-4c92-88ce-6cf0b3325a1f opt3 -> wan: Queue WAN Uplod
60009 15393100 21516050871 queue 10001 ip from any to any in via pppoe0 // fcadaed6-e9ae-48b7-8f87-32342024d50f wan: Queue WAN Download
60010  1475091  1576433747 queue 10000 ip from any to any out via pppoe0 // 1b5397b6-e3ea-48f6-9843-20262b5a348e wan: Queue WAN Upload


I'm only providing the WAN rules and VLAN_20 rule screenshots. The WAN rules are from the opnsense shared bandwidth guide, except I'm using direction rather than IP ranges.

The VLAN rules I created myself and you can duplicate these for any other VLANs you need to include. I'm only providing screenshots for VLAN_20_LAN

Basically what it came down to is creating the WAN up/dl rules AND the specific VLAN up/dl rules. I placed the VLAN rules above the generic WAN rules.

So, once I had the up/dl rules for the WAN AND the VLANs, I'm getting a nice split in traffic when my desktop is downloading and I'm doing a speedtest I get a perfect split; as long as nothing else was downloading of course.

Do you need both set of rules? I asked myself that very question. So I disabled the WAN rules and the problem came back, laptop getting poor up/dl speeds again when the network was saturated.
I turned the WAN rules back on and disabled the VLAN rules, same problem.

Once I turned them all back on, everything is working as expected. I cannot explain this behavior but it appears to be working as expected. I also rebooted between enabling disabling the WAN/VLAN rules when testing this theory, so something getting hung up shouldn't be the case.

TL;DR
Follow the opnsense guide for sharing internet for all users, except for the rules. Then, create WAN up/dl rules similar to mine AND individual up/dl rules per VLAN. Use my screenshots as reference.


(https://minio.mimir-tech.org/public/screenshots/opnsense_shaper_wan-dl-vlan20.png)

(https://minio.mimir-tech.org/public/screenshots/opnsense_shaper_wan-up-vlan20.png)

(https://minio.mimir-tech.org/public/screenshots/opnsense_shaper_wan-dl.png)

(https://minio.mimir-tech.org/public/screenshots/opnsense_shaper_wan-up.png)
Title: Re: Traffic shaper is not working properly for me
Post by: GiantJack on April 25, 2021, 10:35:14 pm
Hi !
I do have VLANs but didn't wanted to do specific shaper on it....but still, I wasn't able to make the traffic shaper on my LAN (without V).

I apply same idea:  I made eachs rules twice, with and without the LAN in interface2, seems to works much better now!
if some are interested, my post is here: https://forum.opnsense.org/index.php?topic=22776.msg108503#msg108503
I will add information about my tests with the idea from japtain.cack