(Lag) Link Aggregation
Technology in Network Switch to increase more throughput. The idea is to achieve better performance by sending several packets simultaneously down different links.
By default in a Network Switch, only single connection at a time can be active.
For example
==⚠ Switch to EXCALIDRAW VIEW in the MORE OPTIONS menu of this document. ⚠== You can decompress Drawing data with the command palette: 'Decompress current Excalidraw file'. For more info check in plugin settings under 'Saving'
Excalidraw Data
Text Elements
Switch B ^9OuBXzvf
Switch A ^umhsECMO
active ^o8GiBIkb
inactive ^3R1nRSwD
inactive ^UKnEyRFI
%%
Drawing
N4KAkARALgngDgUwgLgAQQQDwMYEMA2AlgCYBOuA7hADTgQBuCpAzoQPYB2KqATLZMzYBXUtiRoIACyhQ4zZAHoFAc0JRJQgEYA6bGwC2CgF7N6hbEcK4OCtptbErHALRY8RMpWdx8Q1TdIEfARcZgRmBShcZQUebTiADho6IIR9BA4oZm4AbXAwUDAiiBJuCABVAGsAThkAdQAJABYmyQAFSQBJABEAFQA2KABZI1wm5KLIWEQywOwojmVgieLM
bmcAZgBGOIAGBIBWao2AdgP+Yph1rd29nhONptPz/MgKEnVuLePtauqeLYJM4XSCSBCEZTSL4HA7aF6TCDWJbiVC7EEQZhQUhsSoIADCbHwbFIZQAxFsEBSKStIJpcNhKspsUIOMQCUSSRIsdZmHBcIFMjSIAAzQj4fAAZVgywkgg8Qsx2NxdQ+km4fFeGKxOIQUpgMvQctK6OZkI44WyaC26LYfOwaiuVt2aM1TOEcE6xEtqByAF10cLyOlPdwO
EJxejCKysGVcLshczWebmN7CgjpiiNq8AL7osIIYjcfpbE4JBI8f4ahGMFjsLhofpV4o11icABynDE3EeLSau2OCUjzG6qSgBe4woIYXRmmErIAosF0plvXlJgVXsVShIhPpJMx53ihgB5GnFDNlMeYKAQTe5zdphHb9AAKwoAEEcFkGlsjHUtm2zC7AAQi+wo8JIABqZ5TPAKKIqQ2JUHeIIbuukDPhApCVJBCRDBQABSADiQi9AAWkYAD6ABil
FbAAGmR5R4r0MHQHBsaIWwyHrtmrz+pqQhwMQuBjoWV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+LkfwN5A8Q8HazoMtC10OeaTQv
wtajCMk0tTwxY1Q8Vgy3wPabkLaD+MtzoJZ3xuOU6vaY6/wIi3SZYOwOuM1/xh5gJNV7+WVIJn5civ+P5b598/52ywBs55VmJL5bOy56JdVFVdJt63octkAj6+JbVro4unV2BMuP6spO0/VuABwxBwK2FEGsxTJ5kZwWKDw3wfxpZc1vAqOi170y1SUFaFack/Q1dW4PB10I+/B5G0pAR8p2MmhskD5a8apARl1LZ4pJlRFlh6EllemNlqiOt8Qx
WZmht9+rh5t+MeG1B8kO2dtTQTl1lclbmBgPh3mylARmIQR0lEWtRCIERsW7l0RzsiWbsKWns6WZ4U2M2Zt909mYODCBwEKxwQ8z5xQIxVoTSpwgipwMVYM/QBdkAlRIR19qAUWd9UADR/WVqQ2tqo2DqPe0snR6wPaP9ADnSCGhafafSwx62Ek2gwMNud0MDT58Dalp2mxl2ARel7DFi+Zb24Ay0iIcAcAUoySYRUwYI6QZQIk2EKwDAhACAFAw
EntBV3tpIwo6jGjsj02iEkRY4+gUoh8wJ86i6y6FwmsIgT8nQejSj4JN8hVtOAFWjFjujaQ1E8Jgd4B5jOjsWejBjOoVVaJlezjPjaQfj/U4dQdXjljejUc2J25Zj2j0TaQx4wue5L0UTLj+g1E1p6eP1QT3j6Dej2TmQ71Ke+QGTIT+gAqf1wQwogFFThToTJ2+lWxyxRlCTwTjT+g84Gxj2rT2lr2ZjzA2A2I4o9E3A08ctGIIzhI+AAAmhM0I
s0jJIflDhAEYGwAYGI5APQAQInF8HsQ01Y2kLE/ScClhMdLI0yCQKUxJaA86mshVCg5qMBISBYqSHiNUJ8589RNREKDHMoOGPyGSPON0KC6C7829h0wU2EwgCk/rJwDKRrhAHAIEGYMIMwERA87cwddLB8jHNGM6jJaZBkLgJoMEOZB3ZDUQIUSmWmZqK6pI4GqTTaBHCnNwEGoc3YC+AgDYhKK6nAEMGwLtD02SxS2PeAMZCKGKOEJFnxNmEAA=
%%
The other ones will be blocked and acts as a fallover for the first one. This is to prevent Switching Loop
(LAG) Link aggregation allows multiple switch to simultaneously active all interface at the same time
The way that it works is it creates logical interface associated with physical ports
A port failure will not trigger STP convergence process
[!important]
In a portchannel there is only a maximum of 8 physical links. This is because theHASH
function will hash the value to the range of0-7
.
Note
Since the way that PortChannel works is by default using the HASH
value of the MAC Address to deliver packet (This is to ensure the MAC address to single port will never arrive out of order. We can also opt in other fields for hashing). If the traffic talk to the same destination address it will be limited to the same speed.
For example:
In this case, if Switch1-A
and Swtich1-B
Both talks to Switch2-A
via the PortChannel. And the PortChannel is made of 3 1Gbps
ethernet cable. We only have 1Gbps
of speed in total.
The idea is we can support multiple connection to Switch2
, just as long as we spread it out evenly to multiple ports
Balancing of PortChannel
For example, if we have 2 physical links (ethernet cable). Cable 1 will need to handle 4 different traffic and Cable 2 will also have to handle 4 different traffic (to make up for 8 traffic)
If we have 6 physical links, then the first 2 cables will handle twice as much the traffic.
Options for hashing are
- Source MAC address
- Destination MAC address
- Source and Destination MAC address
- Source IP address
- Destination IP address
- Source and Destination IP address
- Source Port
- Destination Port
- Source and destination port
Example when to switch the Hash option
For example given this where email is used heavily. If we're using MAC address as the hash option it will be heavily on one channel.
As a result, the best situation for this is:
Switch A
: hash using source MAC address (so it will use all the channels evenly)Switch B
: hash using destination MAC address (since everyone is using Email, when replying email the source MAC address is email. In this case, we want to split out by choosing destination mac address).
Caviet problem
Given this situation where the server and the NAS is connected via the same switch.
We cannot use the Source and Destination mac address because they're all the same. The same for IP as well we can't use. We can't use Port either because once they're negotiated, they don't change
In this case, we have to make the NAS server to support multiple MAC address if allowed or use a 10 Gbps ethernet cable instead of PortChannel
Configuring and Managing PortChannel
One condition for all the links in the PortChannel is they must have the same type, the same speed and belong to the same VLAN.
If one of them is trunk, they must all be trunk, with the same trunk parameters
Dynamic LAG
Rather than manually configure LAG, it's recommended to use dynamic configuration which use the negotiation over physical ports and disable the failure connection.
To configure dynamically, we can use
Multiple switch per Poprtchannel
We can merge multiple switches into 1 port channel, there are several technology for it: