Etherchannel load balancing?

author

need to know briefly about Etherchannel load balancing concept  

  • Total 1 Answer
  • 4234
Can You answer this question?
author

Etherchannel is a technology , which is used to bundle redundant links connected between switches. Now, the question is that how the switch will forward the traffic , because traffic still be forwarded through the physical links. So, the switch uses a hashing algorithm to find the specific interface from the bundle to forward traffic. The algorithm can use  source mac-address ,  destination mac-address , or the combination of source and destination mac-address, source and destination IP addresses or combination of both, or TCP/UDP source and destination port numbers. The hash algorithm computes a binary pattern that selects a link number in the bundle to carry each frame.

By default, the hashing algorithm uses source mac address on a switch to decide the link number to forward data. you can verify this with the following command:-

switch# show port-channel load-balance

Now, how  the switch will decide interface number from the bundle ??

As we know that we can bundle 8 links in an etherchannel. So the hashing algorithm mind the three rightmost bits and find out the interface number.

2 link bundle uses 1 bit index

4 link bundle uses 2 bit index

8 link bundle uses 3 bit index

XOR operation is performed to calculate hash.

1 XOR 0 = 1

0 XOR 1 = 1

1 XOR 1 = 0

0 XOR 0 = 0

 

For example , consider a packet being sent from IP address 192.168.1.1 to 172.31.67.46. Because EtherChannels can be built from two to eight individual links, only the rightmost (least-significant) 3 bits are needed as a link index. From the source and destination ip addresses, these bits are 001(1) and 110(6). 

Let's assume , two links are bundled in Etherchannel , a 1-bit XOR is performed on the rightmost address  as following:-

       0   0   1

      1    1   0

1 XOR 0 =1  

It means Link 1 in the bundle will be used to forward packet.

 

If four links bundled, a 2-bit XOR is performed on the rightmost address as following:-

     0   0   1

     1   1   0

1 XOR 0=1

0 XOR 1=1 

It means Link number 3 (1  1 ) will be used to forward packet.

 

If eight links bundled, a 3-bit XOR is performed on the rightmost address as following:-

  0   0    1

  1   1    0

1 XOR 0 = 1

0 XOR 1 = 1

0 XOR 1= 1

8         4          2         1

0         1          1         1

 

4+2+1 =7

seven number link will be used to forward traffic.

 

you can change hashing algorithm paremeters with the following commands:-

switch(config)#port-channel load-balance  

method can be = src-mac , dst-mac , src and dst mac , src-ip , dst-ip , src and dst ip, src port , dst port , src and dst port 

 

Hope it helps.

Thanks