Etherechannel load balancing

I tried to find explanation on how Etherchannel load balances the traffic between switches , but no clear explanation found

There is talk about load balancing based on Mac Address  or Source Destination IP address, but cannot understand how this works.

if I have 2 switches(SW1 and SW2) linked with 2 cables and they are configured for Etherchanel.
how does the traffic of Computers behind SW1 and computers behind SW2 get load balanced between SW1 and SW2
knowing that each switch might have 4 or more vlans

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

VLANs are ignored for Load Balancing.
The VLAN ID has no influence on the link that a packet takes.
*link - Understanding EtherChannel Load Balancing ....
Usually it is one of following methods for load balancing
src-dst-ip - source and destination IP  (default)

src-dst-mac - source and destination MAC
src-dst-port - source and destination port

Although you can find in documentations and articles that
The way EtherChannel load balancing works is that the switch assigns a hash result from 0-7 based on the configured hash  method ( load balancing algorithm ) for the type of traffic. This hash result is commonly called as Result Bundle Hash (RBH).
Basically principle is:
binary operation XOR

0 XOR 0 -> 0
0 XOR 1 -> 1
1 XOR 0 -> 1
1 XOR 0 -> 0

In the case of 8 links in EtherChannel It takes into account last 3 binary digits.
If you have 8 links in EtherChannel (Fa 0/0 - 0/7)
source address             -------------- last 3 binaries are 001
destination address -------------- last 3 binaries are 100
 binary XOR ----------------------------------------- 101 = 5 - traffic between those addresses would be placed  in Fa0/5

If there are only  2 links effectively just last binary digit is taken into account (XOR results that end with 0 would go in the first link (even number), and that end with 1 would go in the second link (odd number))

so if you have 2 links in EtherChannel  (Fa 0/0 - 0/1)
source address             -------------- last binary 1
destination address -------------- last 3 binary 0
 binary XOR ----------------------------------------- 1  - traffic between those addresses would be in Fa0/1

There are many source about this Catalyst XOR operation for EtherChannel and much more technical details:
Cisco - Understanding EtherChannel Load Balancing and Redundancy on Catalyst Switches
Cisco support forum - Etherchannel Loadbalancing on Catalyst Switches
TimotiStDatacenter TechnicianCommented:
This fully depends on the hardware platform, so be sure to fully read the manual of your switch.

Older switches usually did MAC-address based, newer ones can be configured for MAC and/or IP and/or TCP/UDP ports.

The majority of the switches will not do round-robin for the same TCP/UDP flow, so you won't really get multi-gigabit transfer speeds for a single ftp/iscsi/other operation. Some Foundry/Brocade switches are an exception to this rule, though.

jskfanAuthor Commented:
Let s say  load balancing on MAC Address , you have 20 computers connected to the switch that has 2 links aggregated.
how does the load balancing by MAC address work in this case ?
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

TimotiStDatacenter TechnicianCommented:
In that case:
Let's assume that as most modern switches, it does the balancing based on source&destination MAC.
Your traffic from half of your clients will go on one link, traffic from the other half on the other (assuming they go to the same destination, like the gateway or the same server).
You'll get a reasonable balance if traffic is mostly the same from all clients. But any client can still max out a link (or both, to 2 destinations) and no client will get 2Gb to the same destination (no superfast ftp).
jskfanAuthor Commented:
2 GB on the aggregated links for 20 computers is 100MB for each PC if all 20 PCs are sending traffic at the same time.
Will Etherchannel divide the bandwidth evenly, for instance 10 PC will go through one link and 10 other PCs will go through the  other link ?
What if just 5 PCs only are sending traffic, the other 15 PCs are idle, will they still be sending 100MB each only ?
What if just 5 PCs only are sending traffic, the other 15 PCs are idle, will they still be sending 100MB each only ?
No, they will utilize bandwidth till max per link is reached.
If you have 2*1 Gb links in etherchannel, depending on distribution each host can have 200Mb per host for TCP traffic (if all hosts are tied up to the same link), and up to the 500 Mb for 2 host (if distribution on links is 2:3).

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jskfanAuthor Commented:
Thank you.
I will come back on this Question Later
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Switches / Hubs

From novice to tech pro — start learning today.