Etherchannel load balancing?

author

need to know briefly about Etherchannel load balancing concept  

  • Total 1 Answer
  • 5156
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

 

Whoops, looks like something went wrong.

1/1 ErrorException in Filesystem.php line 111: file_put_contents(/var/www/html/storage/framework/sessions/iurbrdotoNW9UhzQg0b0NQcDXTZA3zxJCItFClvp): failed to open stream: No space left on device

  1. in Filesystem.php line 111
  2. at HandleExceptions->handleError(2, 'file_put_contents(/var/www/html/storage/framework/sessions/iurbrdotoNW9UhzQg0b0NQcDXTZA3zxJCItFClvp): failed to open stream: No space left on device', '/var/www/html/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php', 111, array('path' => '/var/www/html/storage/framework/sessions/iurbrdotoNW9UhzQg0b0NQcDXTZA3zxJCItFClvp', 'contents' => 'a:4:{s:6:"_token";s:40:"Pq8ycQbVYF4fFilVLqEBCRrEE6GeN7JVOaNy2pco";s:11:"viewed_urls";a:1:{i:0;s:27:"etherchannel-load-balancing";}s:9:"_previous";a:1:{s:3:"url";s:55:"http://www.networkbulls.com/etherchannel-load-balancing";}s:6:"_flash";a:2:{s:3:"old";a:0:{}s:3:"new";a:0:{}}}', 'lock' => true))
  3. at file_put_contents('/var/www/html/storage/framework/sessions/iurbrdotoNW9UhzQg0b0NQcDXTZA3zxJCItFClvp', 'a:4:{s:6:"_token";s:40:"Pq8ycQbVYF4fFilVLqEBCRrEE6GeN7JVOaNy2pco";s:11:"viewed_urls";a:1:{i:0;s:27:"etherchannel-load-balancing";}s:9:"_previous";a:1:{s:3:"url";s:55:"http://www.networkbulls.com/etherchannel-load-balancing";}s:6:"_flash";a:2:{s:3:"old";a:0:{}s:3:"new";a:0:{}}}', 2) in Filesystem.php line 111
  4. at Filesystem->put('/var/www/html/storage/framework/sessions/iurbrdotoNW9UhzQg0b0NQcDXTZA3zxJCItFClvp', 'a:4:{s:6:"_token";s:40:"Pq8ycQbVYF4fFilVLqEBCRrEE6GeN7JVOaNy2pco";s:11:"viewed_urls";a:1:{i:0;s:27:"etherchannel-load-balancing";}s:9:"_previous";a:1:{s:3:"url";s:55:"http://www.networkbulls.com/etherchannel-load-balancing";}s:6:"_flash";a:2:{s:3:"old";a:0:{}s:3:"new";a:0:{}}}', true) in FileSessionHandler.php line 83
  5. at FileSessionHandler->write('iurbrdotoNW9UhzQg0b0NQcDXTZA3zxJCItFClvp', 'a:4:{s:6:"_token";s:40:"Pq8ycQbVYF4fFilVLqEBCRrEE6GeN7JVOaNy2pco";s:11:"viewed_urls";a:1:{i:0;s:27:"etherchannel-load-balancing";}s:9:"_previous";a:1:{s:3:"url";s:55:"http://www.networkbulls.com/etherchannel-load-balancing";}s:6:"_flash";a:2:{s:3:"old";a:0:{}s:3:"new";a:0:{}}}') in Store.php line 128
  6. at Store->save() in StartSession.php line 88
  7. at StartSession->terminate(object(Request), object(Response)) in Kernel.php line 216
  8. at Kernel->terminateMiddleware(object(Request), object(Response)) in Kernel.php line 187
  9. at Kernel->terminate(object(Request), object(Response)) in index.php line 58
  10. at require_once('/var/www/html/public/index.php') in index.php line 20