Saturday, March 26, 2011

LACP/Etherchannel Algorithms & Linux Bonding Modes.

The LACP Mode in Enterasys or the Port-channel mode in Cisco, have their own algorithms for the priority selection for the slave interfaces involved in the bonding.
As I am a Linux Guy I am more familiar with the Bonding in Linux envoirnment.
we can create bonding in the /etc/sysconfig/network/ifcfg-bond0,here we can define the Master Interface with the IP address and then the slave interfaces involved in the bonding process along with the Mode of the Bonding.
The Switch connected for the bonding also has it's own aggregation algorithm present which must match the with the mode set in the server.
There are 7 modes present in the Linux kernel.

Refer to the Bonding Documentation in the Linux Kernel, it will be available at the path
cat /usr/src/linux-2.6.38/Documentation/networking/bonding.txt | less

More verbose information can be found at

Enterasys :
In Enterasys Switches such as N-series, the LACP Lag output Algorithm can be set for the 3 modes
DIP-SIP - Destination IP address/Source IP Address, slave interfaces are assigned on the basis of Source or Destination IP Addresses.
DA-SA - Destination MAC Addess/Source Mac Address, slave interfaces are assigned on the basis of Source or Destination MAC Addresses.
Round-Robin - Equal distribtution from the first slave to all slaves in round-robin fashion

To check for the LACP algorithm use following on the Enterasys Switch
Matrix N3 Platinum(su)->sh lacp ?
Specifies the lag port(s) to display
outportAlgorithm Shows lacp current ouport algorithm
flowRegeneration Shows lacp flow regeneration state
singleportlag Show single port lag setting
state Show global lag enable state
Matrix N3 Platinum(su)->sh lacp outportAlgorithm
Matrix N3 Platinum(su)->

To set the LACP outputalgorithm to different mode
Matrix N3 Platinum(su)->set lacp outportAlgorithm ?
dip-sip Use sip-dip algorithm for outport determination
da-sa Use da-sa algorithm for outport determination
round-robin Use round-robin algorithm for outport determination
Matrix N3 Platinum(su)->set lacp outportAlgorithm round-robin
Matrix N3 Platinum(su)->

Hence in accordance with the Mode set on the switch we can set the mode in the Linux
After doing this the LAG groups present will use the round-robin algorithm for flow distrbution.
Remember this is the global configuration which will cause change in algorithm of all LAG ports present.
By default the dip-sip algorithm is configured in the Enterasys switches.

Cisco :
On the Cisco Catalyst Switches, the port-channel can be used in LACP mode for the operation.
The default Load-balancing method used is src-mac (Source MAC Address).
Cisco allows us to perform the dry-run of the algoritm implemented using the test command.
I have all interfaces configured in the LACP Mode (Not in PAgP).

To check what is the current algorithm
Cisco#sh etherchannel load-balance
EtherChannel Load-Balancing Configuration:
EtherChannel Load-Balancing Addresses Used Per-Protocol:
Non-IP: Source MAC address
IPv4: Source MAC address
IPv6: Source MAC address

To test the Etherchannel Algorithm used
Cisco#test etherchannel load-balance interface port-channel 1 mac 00:18:17:F1:F9:C4 E4:9F:16:C5:11:56
Would select Gi1/0/1 of Po1

In IP based we can use the IP address to test the etherchannel.
To see the Ether-channel algorithm present
Cisco(config)#port-channel load-balance ?
dst-ip Dst IP Addr
dst-mac Dst Mac Addr
src-dst-ip Src XOR Dst IP Addr
src-dst-mac Src XOR Dst Mac Addr
src-ip Src IP Addr
src-mac Src Mac Addr
Cisco(config)#port-channel load-balance

Here we can see that there is the src-dst-ip & src-dst-mac which are used for inducing additional randomization using the XOR logical operation present.
Hence the load-balancing can be done using the Destination IP address or Source IP address, same goes for the MAC addresses.

To set the New Algorithm
Cisco(config)#port-channel load-balance dst-mac

Now the Load-balancing will happen through the Destination-Mac Address.I will do some more research on this and update the post.

No comments:

Post a Comment