EtherChannel Load Distribution Explained

EtherChannel is a group of links that work together as a single link. You can use EtherChannels for load balancing. If you configure an EtherChannel, the EtherChannel distributes traffic among all ports configured in it. EtherChannel uses pre-defined rules for load balancing. These rules override the default frame-processing function. Before we learn these rules, let us briefly discuss how a switch processes frames.

A switch processes frames through three stages. These stages are learning, decision-making, and forwarding. In the learning stage, it learns the MAC addresses of connected devices and adds them to the CAM table. In the decision-making stage, it selects forwarding ports for incoming frames. In the forwarding stage, it forwards frames from ports selected in stage two.

It uses the source MAC address field of incoming frames to learn the MAC address of the connected devices and the destination MAC address field to make forwarding decisions. It uses the CAM table to save the MAC addresses of the connected devices. A CAM table entry contains a MAC address and an associate switch port. When the switch receives an incoming frame, it finds the destination MAC address of the frame in the CAM table. If it finds a matching entry in the CAM table, it forwards the frame from the port mentioned in the entry. The switch uses the source address of incoming frames to build CAM table entries and the destination address to make forwarding decisions.

Let us take a Packet Tracer example to understand these stages. The following image shows a Packet Tracer lab.

etherchannel lab

Download Packet Tracer LAB

PC1 sends a frame to PC2. The frame contains the source and destination MAC addresses. The frame reaches S1 on port F0/1.

The following table lists the frame processing stages on S1.

Learning S1 adds an entry to the CAM table. This entry associates port F0/1 with MAC1.
Decision making S1 finds MAC2 in the CAM table. Since the CAM table has no entry for MAC2, S1 decides to forward it from all ports, excluding port F0/1.
Forwarding S1 forwards the frame from all selected ports.

The frame reaches S2 on port G0/1. The following table lists the frame processing stages on S2.

Learning S2 adds an entry to the CAM table. This entry associates port G0/1 with MAC1.
Decision making S2 finds MAC2 in the CAM table. Since the CAM table has no entry for MAC2, S2 decides to forward it from all ports apart from port G0/1.
Forwarding S2 forwards the frame from all selected ports.

cam table entry

The frame reaches PC2. PC2 replies to the frame. The frame reaches S2 on port 1. S2 takes the following steps to process the frame.

Learning S2 adds an entry to the CAM table. This entry associates port F0/1 with MAC2.
Decision making S2 finds MAC1 in the CAM table. Since the CAM table has an entry for MAC1, S2 decides to forward it from port G0/1.
Forwarding S2 forwards the frame from port G0/1.

The frame reaches S1 on port G0/1.

Learning S1 adds an entry to the CAM table. This entry associates port G0/1 with MAC2.
Decision making S1 finds MAC1 in the CAM table. Since the CAM table has an entry for MAC1, S2 decides to forward it from port F0/1.
Forwarding S1 forwards the frame from port F0/1.

cam table entries

Currently, this network has only one link between switches. If we add another link between these switches, STP will block that link to remove the loop. We can use the show spanning-tree command to verify it.

Create an additional link between switches and run the show spanning-tree command.

show spanning-tree command

Download Packet Tracer LAB with loop

As the above output shows, STP blocked port G0/2 to remove the loop.

STP allows only one link between two switches. If we want to use more than one link, we must configure an EtherChannel and add all links.

EtherChannel Configuration

There are two ways to configure EtherChannel: static and dynamic. No matter which option you choose to configure the EtherChannel, after configuration, it uses the same rules for frame processing.

This tutorial is the last part of the tutorial "EhterChannel Concepts and Configurations Explained.". Other parts of this series are the following.

Chapter 01 EtherChannel Basic Concepts Explained

Chapter 02 EtherChannel Manual Configuration

Chapter 03 Port Aggregation Protocol (PAgP) Explained

Chapter 04 Link Aggregation Control Protocol (LACP) Explained

The following image shows static EtherChannel configuration on this network.

etherchannel configuration

Download Packet Tracer LAB With EtherChannel Configuration

The above configuration creates a new EtherChannel on both switches and adds ports G0/1 and G0/2. The EtherChannel works as a new port called po1 on the switch. After this configuration, all protocols and processes running on both switches see port po1 instead of G0/1 and G0/2. Since STP sees only one connection between switches, it does not block port po1. We can use the show spanning-tree command to verify this.

stp port before and after etherchannel

After the EtherChannel configuration, the switch associates the MAC addresses with the EtherChannel, not the underlying physical ports. We can use the show mac-address-table command to verify this.

show cam table entries

After the EtherChannel configuration, the switch uses EtherChannel load balancing rules to decide which specific physical port inside the EtherChannel will forward the incoming frame.

The following table lists EtherChannel load balancing rules and options.

Layer Keyword [option] Description
2 src-mac Source MAC address
2 dst-mac Destination MAC address
2 src-dst-mac Both source and destination MAC
3 src-ip Source IP address
3 dst-ip Destination IP address
3 src-dst-ip Both source and destination IP
4 src-port Source TCP or UDP port
4 dst-port Destination TCP or UDP port
4 src-dst-port Both source and destination TCP or UDP port

All switches support MAC-based rules. IP-based rules depend on the model and software version of the switch. The EtherChannel load balancing algorithm uses the low-order bits in the fields in the message headers. The low-order bits tend to differ more in real networks. Most of the networks use the same high-order bits. By picking the lower-order bits, the algorithm achieves better load balancing of traffic over the links.

EtherChannel load balancing configuration and verification

Load balancing is the default on EtherChannels. The default load balancing uses the source MAC addresses of incoming frames to select the forwarding port. The following command allows you to configure a custom option for load balancing.

Switch(config)#port-channel load-balance [option]

You can select any valid option from the above table. You can use the following command to view the configured option.

Switch#show etherchannel load-balance

load balance command

Regardless of the EtherChannel load balancing rule you choose, the rule identifies fields in the message headers. Since all messages in the same application have the same values in the header fields, the switch forwards them from the same link in the EtherChannel.

forwarding loop

For example, you connect to a website to get some information. The website may return thousands of data packets based on the requested information. Those packets flow over the same link in the EtherChannel. For example, with the load distribution rule of src-mac (meaning source MAC address), all frames with the same MAC address flow over one link.

EtherChannel load balancing advantages

EtherChannel load balancing provides the following advantages.

  • EtherChannel load balancing ensures that all messages in a single application use the same link of the EtherChannel. It prevents the switch from inadvertently reordering the messages sent in that application flow by sending one message over a busy link while immediately sending another message out an unused link.
  • EtherChannel load balancing integrates the load distribution algorithm work into the hardware forwarding ASIC so that it works just as fast as the work to forward any other frame.
  • EtherChannel load balancing utilizes all active links in the EtherChannel.

EtherChannel load balancing disadvantages

EtherChannel load balancing has the following disadvantages.

It adds complexity to the network. EtherChannel requires many port-level configurations to be identical on all ports of the EtherChannel. If a port in the EtherChannel has a different configuration, the EtherChannel does not work. A misconfiguration on a single port is enough to bring the entire EtherChannel down.

Conclusion

EtherChannel load balancing provides many load distribution options so that you can examine the flows in the network to figure out which fields have the most variety in their values: source and destination MAC, IP address, or transport layer port numbers. The more variety in the values in the fields, the better result you achieve from the load balancing.

ComputerNetworkingNotes CCNA Study Guide EtherChannel Load Distribution Explained