OPNsense Forum

Archive => 22.7 Legacy Series => Topic started by: joysense on August 11, 2022, 06:39:24 pm

Title: How to control the interface bandwidth usage evenly on egress and ingress
Post by: joysense on August 11, 2022, 06:39:24 pm
My question is similar to traffic shaping but differs slightly in terms of what I want to achieve. Let us assume 1Gbps is max bandwidth for the interface.
Requirements:
1. Allow maximum bandwidth on egress or ingress if there is not much utilization on either one.
2. When both egress and ingress wants max utilization, then allocate bandwidth evenly between them.

A simple solution is to setup traffic shaper pipe one for egress and one for ingress with 500Gbps each. But that will limit max utilization to 500Gbps and not close to 1Gbps when only one of ingress or egress is bandwidth hungry , hence not satisfying requirement 1. Requirement 2 will be satisfied by this shaper though.

Any suggestions? Or is my understanding of traffic shaper pipe bandwidth incorrect?
Title: Re: How to control the interface bandwidth usage evenly on egress and ingress
Post by: JasonJoel on August 11, 2022, 07:04:50 pm
I guess I don't understand the use case...

Is your interface half duplex? If not, the ingress and egress bandwidth are independent of each other, and what you are trying to do wouldn't make sense?
Title: Re: How to control the interface bandwidth usage evenly on egress and ingress
Post by: Demusman on August 11, 2022, 07:19:16 pm
I agree, a 1Gb link is 1G in and out simultaneously, not split between each direction.
Title: Re: How to control the interface bandwidth usage evenly on egress and ingress
Post by: joysense on August 11, 2022, 07:31:24 pm
Opnsense is hosted on xcp-ng. And there is a Nextcloud VM on the same. What happens is when I access Nextcloud on the lan,  when uploading or downloading large project files, I end up using a large chunk of the link bandwidth. Other users on the lan home network then have slow start and not able to achieve full download speed of the internet.

I see the links are detected are full duplex, but how to verify?

Because, when I ran iperf3 both sides the bandwidth totals to approx 1Gbps. Not 2 Gbps.
I tested by starting iperf in one direction and it peaks at 980Mbps. While that is running I ran iperf from another system in opposite direction simultaneously. It starts at 50Mbps, and slowly settles at 150 or 200 Mbps. It doesn’t even out at 500 and 500 as expected. Hence my question regarding evenly splitting.

Maybe you are right about this being a link duplex issue. How to check that?
Title: Re: How to control the interface bandwidth usage evenly on egress and ingress
Post by: joysense on August 12, 2022, 05:29:52 pm
I ran tcpdump and noticed a ton of incorrect chksum. Should I turn off tx offloading and gro on the XCP-NG pifs or vifs? Because tcpdump was run from xcp-bg management dom0 on the physical interface.