cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
20123
Views
15
Helpful
5
Replies

L2 EtherChannel Load Balancing

jplenbrook
Level 1
Level 1

Hi All,

 

Today I had to set up an LCAP EtherChannel which consists of 3 ports on each side.

As far as I understand it, when you set up an EtherChannel it will not load balance on all 3 links. Instead it will use up the bandwidth on the first link and then forward the traffic onto the second link and so on.

I know that you can load balance layer 2 EtherChannel by source and destination MAC address. How does that work? How would I configure a L2 EtherChannel to load balance 50% on GigabitEthernet 1/0/46, 25% on GigabitEthernet 1/0/47 and 25% on GigabitEthernet 1/0/48?

Could anyone explain it a bit more? I have watched some tutorials and YouTube videos but I don't understand how an EtherChannel will load balance based on MAC addresses. Maybe you could give some configuration examples, anything would help!

This is not urgent, but it is something that would be nice to understand.

 

Best Regards,

2 Accepted Solutions

Accepted Solutions

Jose Solano
Level 4
Level 4

Hi,

 

EtherChannel balances the traffic load across the links in a channel through the reduction of part of the binary pattern that the addresses in the frame form to a numerical value that selects one of the links in the channel. EtherChannel load balancing can use MAC addresses or IP addresses, source or destination addresses, or both source and destination addresses. 


The hash algorithm cannot be configured or changed to load balance the traffic among the ports in an EtherChannel, in essence, you can only achieve perfect load balancing, even with random addresses, if you have two, four, or eight ports in the port channel.

 

 For example, if the traffic on a channel only goes to a single MAC address, use of the destination MAC address results in the choice of the same link in the channel each time. Use of source addresses or IP addresses can result in a better load balance. Issue the port-channel load-balance {src-mac | dst-mac | src-dst-mac | src-ip | dst-ip | src-dst-ip | src-port | dst-port | src-dst-port | mpls} global configuration command in order to configure the load balancing.

 

 Bottom line there is no way to force the load balance to use 50% one link and 25% etc. So if you use source and destination Mac if the frames come from the same source to the same destination it will always use the same link, same happens with if you use IP address. That said most of the time you will see some ports with higher load than other within the etherchannel.

Here is a link that provides more details about how this works across different catalyst switches and the way to test what link will be choose for a specific flow.

 

Understanding EtherChannel Load Balancing and Redundancy on Catalyst Switches

http://www.cisco.com/c/en/us/support/docs/lan-switching/etherchannel/12023-4.html

 

Hope this helps !

Leo

 

 

View solution in original post

Joseph W. Doherty
Hall of Fame
Hall of Fame

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

As far as I understand it, when you set up an EtherChannel it will not load balance on all 3 links. Instead it will use up the bandwidth on the first link and then forward the traffic onto the second link and so on.

No, that's incorrect.  Etherchannel can use 3 links, and Etherchannel doesn't fill a link and move to the next.

I know that you can load balance layer 2 EtherChannel by source and destination MAC address.

That's usually true for newer switches but some old switches don't support using both source and destination MACs.

How does that work?

Only Cisco can tell us, and I believe they consider it proprietary.  In general principle, when both source and destination MAC (or IP, if supported) are used in the hash generation.  What this buys us, if either differs, you have a chance of using a different link in the Etherchannel.  Understand, whatever values are being use to compute the link choice, the same input values always use the same link.

How would I configure a L2 EtherChannel to load balance 50% on GigabitEthernet 1/0/46, 25% on GigabitEthernet 1/0/47 and 25% on GigabitEthernet 1/0/48?

You cannot.

Could anyone explain it a bit more? . . .  I don't understand how an EtherChannel will load balance based on MAC addresses.

Again, what exactly Cisco does is only known to them, but a simple way to use a MAC would be to treat it as the 48 bit number it is, and divide it by the number of links in your Etherchannel.  The remainder would be the link offset value.

If using both source and destination MACs, you could treat the two as a 96 bit number, or XOR the two MACs, and again divide by the number of links being used and use the remainder as the link offset value.

There are many ways to generate the link number.  Ideally, you'll looking for a method that takes your input and equally (on average) distributes across your number of Etherchannel links.  Ideally, you're also looking for a method that requires little processing to accomplish.  Above, I mentioned using division, but full division can be involved, so . . .

For example, if you had just two links, you might take the right most bit of the MAC, if it's zero, use the first link, if it's one, use the second link.

View solution in original post

5 Replies 5

Jose Solano
Level 4
Level 4

Hi,

 

EtherChannel balances the traffic load across the links in a channel through the reduction of part of the binary pattern that the addresses in the frame form to a numerical value that selects one of the links in the channel. EtherChannel load balancing can use MAC addresses or IP addresses, source or destination addresses, or both source and destination addresses. 


The hash algorithm cannot be configured or changed to load balance the traffic among the ports in an EtherChannel, in essence, you can only achieve perfect load balancing, even with random addresses, if you have two, four, or eight ports in the port channel.

 

 For example, if the traffic on a channel only goes to a single MAC address, use of the destination MAC address results in the choice of the same link in the channel each time. Use of source addresses or IP addresses can result in a better load balance. Issue the port-channel load-balance {src-mac | dst-mac | src-dst-mac | src-ip | dst-ip | src-dst-ip | src-port | dst-port | src-dst-port | mpls} global configuration command in order to configure the load balancing.

 

 Bottom line there is no way to force the load balance to use 50% one link and 25% etc. So if you use source and destination Mac if the frames come from the same source to the same destination it will always use the same link, same happens with if you use IP address. That said most of the time you will see some ports with higher load than other within the etherchannel.

Here is a link that provides more details about how this works across different catalyst switches and the way to test what link will be choose for a specific flow.

 

Understanding EtherChannel Load Balancing and Redundancy on Catalyst Switches

http://www.cisco.com/c/en/us/support/docs/lan-switching/etherchannel/12023-4.html

 

Hope this helps !

Leo

 

 

chsarkar
Cisco Employee
Cisco Employee

Hey,

Its purely on HASH algorithm and you dont have control on it. Point to think here is, why would you need to configure L2 EC to load balance 50% ,25%, 25% on individual GigEthernets, when you get all three bundled to single Port.

 

Regards, Chandan

*********Please mark this as answered if this has answered your query so that other be benefited with the same*******

veerendrav2
Level 1
Level 1

Hi iplenbrook,

In addition to below comments, i want to mention one more point: it is better to bundle powers of 2 (2^0, 2^1, 2^2, 2^3.....)link in  ether channel, then only you will good performance. In same way you can bundle 3 or 5 links in ether channel, but you won't get that much performance(Utilization of links).

Regards

Veerendra

Joseph W. Doherty
Hall of Fame
Hall of Fame

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

As far as I understand it, when you set up an EtherChannel it will not load balance on all 3 links. Instead it will use up the bandwidth on the first link and then forward the traffic onto the second link and so on.

No, that's incorrect.  Etherchannel can use 3 links, and Etherchannel doesn't fill a link and move to the next.

I know that you can load balance layer 2 EtherChannel by source and destination MAC address.

That's usually true for newer switches but some old switches don't support using both source and destination MACs.

How does that work?

Only Cisco can tell us, and I believe they consider it proprietary.  In general principle, when both source and destination MAC (or IP, if supported) are used in the hash generation.  What this buys us, if either differs, you have a chance of using a different link in the Etherchannel.  Understand, whatever values are being use to compute the link choice, the same input values always use the same link.

How would I configure a L2 EtherChannel to load balance 50% on GigabitEthernet 1/0/46, 25% on GigabitEthernet 1/0/47 and 25% on GigabitEthernet 1/0/48?

You cannot.

Could anyone explain it a bit more? . . .  I don't understand how an EtherChannel will load balance based on MAC addresses.

Again, what exactly Cisco does is only known to them, but a simple way to use a MAC would be to treat it as the 48 bit number it is, and divide it by the number of links in your Etherchannel.  The remainder would be the link offset value.

If using both source and destination MACs, you could treat the two as a 96 bit number, or XOR the two MACs, and again divide by the number of links being used and use the remainder as the link offset value.

There are many ways to generate the link number.  Ideally, you'll looking for a method that takes your input and equally (on average) distributes across your number of Etherchannel links.  Ideally, you're also looking for a method that requires little processing to accomplish.  Above, I mentioned using division, but full division can be involved, so . . .

For example, if you had just two links, you might take the right most bit of the MAC, if it's zero, use the first link, if it's one, use the second link.

Thank you very much to all of you for such a valuable information.

I think this forum should have dedicated section for most common questions lrelating to EtherChannels and the most common configurations or technologies.

I think that all of your answers are valuable and should be easily accessible let's say in 'sticky' section like other forums do. Don't you think would make things easier for next people and also save time of other users trying to explain something that has already been explained 10 times probably.

Cheers guys, I appreciate your answers!
 

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Review Cisco Networking products for a $25 gift card