OPNsense Forum

Archive => 21.7 Legacy Series => Topic started by: FarmServer on November 05, 2021, 07:32:50 PM

Title: Can using LAG improve a 1gbps connection? even slightly?
Post by: FarmServer on November 05, 2021, 07:32:50 PM
I just got a 1gbps connection and a new sb8200 modem to handle that speed upgrade. It has two NICs for link aggregation for use on connections over 1gbps.
But I was wondering if there was any benefit at all if I used both lines on my 1gbps connection. Maybe like a load balancer or to help decrease latency if a bunch of devices are communicating through my opnsense box at the same time.

Most of the stuff I could find online was for intranetwork speed improvements for a NAS or commercial access points. Its a new concept to me so I am just looking to get up to speed on any capabilities this could bring to the table.

It kind of seems like LAG would be helpful on my PCs that are using wired connections but that would require quite a few hardware upgrades and I only have one free ethernet port on my router and one on the sb8200 for now to play with.
Title: Re: Can using LAG improve a 1gbps connection? even slightly?
Post by: bimbar on November 05, 2021, 08:21:45 PM
LAGG does not load balance single connections over multiple links, it only balances multiple connections over multiple links. A single source / destination will always use only one link.

So no, I don't think there's much practical use for LAGG in home setups.
Title: Re: Can using LAG improve a 1gbps connection? even slightly?
Post by: fabian on November 06, 2021, 12:00:57 AM
Actually it will load balance but with no benefit. If I read the posting correctly, you want to load balance to the modem
However, the Modem still has one GBit to the internet, so the packets cannot be forwarded faster than one GBit from OPNsense, even if you have a two GBit link to the modem.

Link aggregation allows you to virtually bind multiple physical lines into one virtual. There you can fail over or load balance (get more speed).
Title: Re: Can using LAG improve a 1gbps connection? even slightly?
Post by: bimbar on November 06, 2021, 11:22:48 AM
Quote from: fabian on November 06, 2021, 12:00:57 AM
Actually it will load balance but with no benefit. If I read the posting correctly, you want to load balance to the modem
However, the Modem still has one GBit to the internet, so the packets cannot be forwarded faster than one GBit from OPNsense, even if you have a two GBit link to the modem.

Link aggregation allows you to virtually bind multiple physical lines into one virtual. There you can fail over or load balance (get more speed).

So how would I get LAGG to load balance one connection over multiple links? Usually you can configure some sort of load balancing criteria, like (source and destination ip) or (source and destination mac address). I don't believe I've seen a way to balance packets in a round robin fashion over multiple links.
Title: Re: Can using LAG improve a 1gbps connection? even slightly?
Post by: Patrick M. Hausen on November 06, 2021, 11:44:23 AM
bimbar, you can't. There is no standardized layer 2 technology like LACP that provides a 2 Gbit/s link made from two 1 Gbit/s links for a single connection.

If both ends are FreeBSD you can force round-robin instead of LACP but then you will end up with out of order packets and all sorts of problems coming from that so your TCP throughput will probably get worse. But for most applications one end is e.g. OPNsense and the other end is a switch ...

You can do equal cost multipath on layer 3 ...
Title: Re: Can using LAG improve a 1gbps connection? even slightly?
Post by: bimbar on November 06, 2021, 08:20:58 PM
Quote from: pmhausen on November 06, 2021, 11:44:23 AM
bimbar, you can't. There is no standardized layer 2 technology like LACP that provides a 2 Gbit/s link made from two 1 Gbit/s links for a single connection.

If both ends are FreeBSD you can force round-robin instead of LACP but then you will end up with out of order packets and all sorts of problems coming from that so your TCP throughput will probably get worse. But for most applications one end is e.g. OPNsense and the other end is a switch ...

You can do equal cost multipath on layer 3 ...

That's what I thought. And while you can do ECMP on L3, you can't do it statefully.