LACP: A way to optimize network throughput and improve reliability
Deepak Kumar
Propelling AI To Reinvent The Future || Mentor|| Leader || Innovator || Machine learning Specialist || Distributed architecture | IoT | Cloud Computing
Introduction
Laymen explanation
If you are a network admin and you have to create high throughput and reliable communication between a firewall and an attached switch (it will be needed since all traffic will pass thro' firewall and then switch, switch will provide access to internal network), then you will connect two(or more) ethernet ports back-to-back between switch and firewall. Are you assuming that both connections will be carry traffic? It is not always true assumption. Why so? It is because your switch and firewall device might not know that these two connections are similar. You need to explicitly inform this to them. So, what should be done? This topic helps in this regard.
Technical explanation
Link aggregation is a way of bundling a bunch of individual (Ethernet) links together so they act like a single logical link.
If you have a switch with a whole lot of Gigabit Ethernet ports, you can connect all of them to another device that also has a bunch of ports and balance the traffic among these links to improve performance.
Another important reason for using link aggregation is to provide fast and transparent recovery in case one of the individual links fails.
Individual packets are kept intact and sent from one device to the other over one of the links. In fact, the protocol usually tries to keep whole sessions on a single link. A packet from the next conversation could go over a different link.
The idea is to achieve improved performance by transmitting several packets simultaneously down different links. But standard Ethernet link aggregation never chops up the packet and sends the bits over different links.
How link aggregation looks like
Link aggregation for fail-over handling
Important points
- An important concept of link aggregation is that all the packets belonging to any individual session should go down the same single link. Otherwise you risk out-of-order packets, which causes serious problems for a lot of applications. For example, assume that video packets are transmitted out of order, then video player needs to spend much time in ordering the packet otherwise video will not be useful for user.
- Most scheduling algorithms use some sort of simple hash function that looks at fields in the Layer 2 and/or Layer 3 headers. The most common hashes involve the source and destination MAC addresses, the source and destination IP addresses, or both sets of addresses.
- If you see that one link is consistently more heavily utilized, then it might be a good idea to change your algorithm.