cancel
Showing results for
Did you mean:
Announcements
Bronze

## etherchannel load balancing and conflicting materials

Hi everybody

Sw1 f1/1------------------------f1/1Sw

f1/2-----------------------f1/2

My book says switch performs a hashing operation which is XOR operation on the right most bits of source and destination ip, which is default method.

How many bits of source and destination ip are considered is determined number of ports in etherchannel. For example a etherchannel consists of two ports means the xor operation will be performed on one bit i.e the right most bit of source and destination ip.

199.199.199.1 src ip

199.199.199.2 dst ip

the last octet of src ip can be written in binary as:  00000001

the last octet of destination ip can be written as :   00000010

Performing XOR operation on right most bit( i.e bolded one) will yeild  : 1 XOR 0= 1

So link 1 will be used.

It was very simple until I read the link which left me with terrible headache. I attached the pdf file of the link as it is no longer active.

I quoted below:

The Cisco−proprietary hash algorithm computes a value in the range 0 to 7. With this value as a basis, a

particular port in the EtherChannel is chosen. The port setup includes a mask which indicates which values the

port accepts for transmission. With the maximum number of ports in a single EtherChannel, which is eight

ports, each port accepts only one value. If you have four ports in the EtherChannel, each port accepts two

values, and so forth. This table lists the ratios of the values that each port accepts, which depends on the

number of ports in the EtherChannel:

Number of Ports in the EtherChannel         Load Balancing

8                                                              1:1:1:1:1:1:1:1

7                                                               2:1:1:1:1:1:1

6                                                               2:2:1:1:1:1

5                                                                2:2:2:1:1

4                                                                 2:2:2:2

3                                                                  3:3:2

2                                                                    4:4

Note: This table only lists the number of values, which the hash algorithm calculates, that a particular port

accepts. You cannot control the port that a particular flow uses. You can only influence the load balance with

a frame distribution method that results in the greatest variety.

Note: The hash algorithm cannot be configured or changed to load balance the traffic among the ports in an

EtherChannel.

Note: The same Cisco−proprietary hash algorithm is also implemented in Cisco Catalyst 6500/6000 Series

Switches that run Cisco IOS software

==========================================================================

So regardless of number of ports in etherchanel, hashing operation will produce 0-7 values.

This is in contrast with my book which says for  for two port etheerchannel,  Xor operation will produce two possible values  0 or 1

According to the book, the hasing operation is XOR operation while according to the above paragraph, the hashing operation is cisco Proprietary.

The question is what is that cisco properitary hashing operation ?

the last question i have is who is right cisco book or cisco link?

Sorry for the long winded post.

Thanks and have a great weekend

Everyone's tags (4)
2 ACCEPTED SOLUTIONS

Accepted Solutions
Super Bronze

## etherchannel load balancing and conflicting materials

Disclaimer

The   Author of this posting offers the information contained within this   posting without consideration and with the reader's understanding that   there's no implied or expressed suitability or fitness for any purpose.   Information provided is for informational purposes only and should not   be construed as rendering professional advice of any kind. Usage of  this  posting's information is solely at reader's own risk.

Liability Disclaimer

In   no event shall Author be liable for any damages whatsoever (including,   without limitation, damages for loss of use, data or profit) arising  out  of the use or inability to use the posting's information even if  Author  has been advised of the possibility of such damage.

Posting

A feature of XOR, you can use it (sequentially) across more than two operands.  I.e. for any one bit position, your end result will be zero or one.

When you're hashing for multiple numbers (beyond two), you normally hash multiple bit positions to result in a number that "covers" the range of values needed.  If we were hashing for 8 numbers (such as for 8 links across an 8 channel Etherchannel), we would use 3 bits, so final result would always be 0..7.

Where hashing becomes proprietary, is the actual algorithm.  Again for a range of 8 values, we may be using XOR on groups of 3 bits, but which 3 bits to use for each XOR can have a profound impact on how pseudo-random our final result is (the real purpose of the hash algorithm).

If Cisco considers the hashing algorithm proprietary, you're probably not going to be able to find out, publicly, how it operates.

I think general explanation is just showing how you might use XOR to determine a particular link to use in an Etherchannel, but what Cisco actually does for determining Etherchannel link selection is unknown to the public.  (NB: Cisco probably uses XOR as part of their algorithm, but there are other ways to hash too.)

Hall of Fame Super Silver

## etherchannel load balancing and conflicting materials

Hello Sarah,

the table represents the way XOR results are mapped to member links of the bundle.

For example if the number of links is 3 link index varies between 0,1,2 and the EXOR of 3 bits produce values between 0 and 7.

The table says that nlinks = 3  the distribution of  EXOR results to member links is 3:3:2 meaning that a possible distribution is

EXOR value ----- >   link index

0                             0

1                              1

2                              2

3                              0

4                              1

5                              2

6                             0

7                              1

this leads to 3 values associated to link index 0, 3 to link index 1, 2 to link index 2, shortly noted as 3:3:2 distribution

I've seen experimentally that a 3 link member bundle respects this kind of distribution with more traffic on first two member links (simple comparison of show interface counters)

I would say the book is less precise then the link and that the book focuses on the concept ( the use of EXOR of last significant bits of IP SA and IP DA) and the link is more on the real implementation of the hashing algorythm.

So for efficiency reasons the number of bits on which the EXOR is performed may be 3 regardless of the number of member links.  The mapping of EXOR results to member links is indeed dependent on the number of member links in the bundle as explained in the table.

The mapping function is required to handle the odd numbers of member links that require a discrete decision and the acceptance of an approximated distribution of flows over the member links.

Hope to help

Giuseppe

4 REPLIES
Super Bronze

## etherchannel load balancing and conflicting materials

Disclaimer

The   Author of this posting offers the information contained within this   posting without consideration and with the reader's understanding that   there's no implied or expressed suitability or fitness for any purpose.   Information provided is for informational purposes only and should not   be construed as rendering professional advice of any kind. Usage of  this  posting's information is solely at reader's own risk.

Liability Disclaimer

In   no event shall Author be liable for any damages whatsoever (including,   without limitation, damages for loss of use, data or profit) arising  out  of the use or inability to use the posting's information even if  Author  has been advised of the possibility of such damage.

Posting

A feature of XOR, you can use it (sequentially) across more than two operands.  I.e. for any one bit position, your end result will be zero or one.

When you're hashing for multiple numbers (beyond two), you normally hash multiple bit positions to result in a number that "covers" the range of values needed.  If we were hashing for 8 numbers (such as for 8 links across an 8 channel Etherchannel), we would use 3 bits, so final result would always be 0..7.

Where hashing becomes proprietary, is the actual algorithm.  Again for a range of 8 values, we may be using XOR on groups of 3 bits, but which 3 bits to use for each XOR can have a profound impact on how pseudo-random our final result is (the real purpose of the hash algorithm).

If Cisco considers the hashing algorithm proprietary, you're probably not going to be able to find out, publicly, how it operates.

I think general explanation is just showing how you might use XOR to determine a particular link to use in an Etherchannel, but what Cisco actually does for determining Etherchannel link selection is unknown to the public.  (NB: Cisco probably uses XOR as part of their algorithm, but there are other ways to hash too.)

Bronze

## etherchannel load balancing and conflicting materials

Thanks JosephDoherty

Hall of Fame Super Silver

## etherchannel load balancing and conflicting materials

Hello Sarah,

the table represents the way XOR results are mapped to member links of the bundle.

For example if the number of links is 3 link index varies between 0,1,2 and the EXOR of 3 bits produce values between 0 and 7.

The table says that nlinks = 3  the distribution of  EXOR results to member links is 3:3:2 meaning that a possible distribution is

EXOR value ----- >   link index

0                             0

1                              1

2                              2

3                              0

4                              1

5                              2

6                             0

7                              1

this leads to 3 values associated to link index 0, 3 to link index 1, 2 to link index 2, shortly noted as 3:3:2 distribution

I've seen experimentally that a 3 link member bundle respects this kind of distribution with more traffic on first two member links (simple comparison of show interface counters)

I would say the book is less precise then the link and that the book focuses on the concept ( the use of EXOR of last significant bits of IP SA and IP DA) and the link is more on the real implementation of the hashing algorythm.

So for efficiency reasons the number of bits on which the EXOR is performed may be 3 regardless of the number of member links.  The mapping of EXOR results to member links is indeed dependent on the number of member links in the bundle as explained in the table.

The mapping function is required to handle the odd numbers of member links that require a discrete decision and the acceptance of an approximated distribution of flows over the member links.

Hope to help

Giuseppe

Bronze

Thanks Giuseppe.

412
Views
0