Load Balancing Modes of Link Aggregation
Background
A data flow is a group of data packets with one or more identical attributes. The attributes include the source MAC address, destination MAC address, source IP address, destination IP address, source TCP/UDP port number, and destination TCP/UDP port number.
Load balancing can be classified as packet- or flow-based load balancing.
Packet-based load balancing
This type of load balancing allows devices to fully use the multiple physical links between both devices of the Eth-Trunk, transmitting data frames of the same data flow over different physical links. A potential problem arises in that the second data frame may arrive at the remote device earlier than the first data frame, resulting in out-of-order packets.
Flow-based load balancing
This type of load balancing allows the system to use a hash algorithm to calculate the address in a data frame and generates a HASH-KEY value. Then the system searches for the outbound interface in the Eth-Trunk forwarding table based on the generated HASH-KEY value. Each MAC or IP address corresponds to a specific HASH-KEY value, so the system uses different outbound interfaces to forward data. This mode ensures that frames of the same data flow are forwarded on the same physical link and implements load balancing of data flows. Flow-based load balancing ensures the correct sequence of data transmission, but cannot ensure efficient bandwidth usage.
Switches support only flow-based load balancing.
Forwarding Principle
In Figure 3-9, an Eth-Trunk is deployed in the data link layer between the LLC and MAC sub-layers.
The Eth-Trunk module maintains a forwarding table that consists of the following entries:
HASH-KEY value
The HASH-KEY value is calculated through the hash algorithm based on the MAC address or IP address in a data packet.
Interface number
Eth-Trunk forwarding entries are related to the number of member interfaces in an Eth-Trunk. Different HASH-KEY values map to different outbound interfaces.
For example, an Eth-Trunk supports a maximum of eight member interfaces. If physical interfaces 1, 2, 3, and 4 are bundled into an Eth-Trunk, the Eth-Trunk forwarding table contains four entries, as shown in Figure 3-10. In the Eth-Trunk forwarding table, the HASH-KEY values are 0, 1, 2, 3, 4, 5, 6, and 7, and the corresponding interface numbers are 1, 2, 3, 4, 1, 2, 3, and 4.
The Eth-Trunk module forwards a packet according to the Eth-Trunk forwarding table:
The Eth-Trunk module receives a packet from the MAC sub-layer, and then extracts its source MAC address/IP address or destination MAC address/IP address.
The Eth-Trunk module calculates the HASH-KEY value using the hash algorithm.
Using the HASH-KEY value, the Eth-Trunk module searches the Eth-Trunk forwarding table for the interface number, and then sends the packet from the corresponding interface.
Load Balancing Modes
To prevent out-of-order data packets, an Eth-Trunk uses flow-based load balancing. Data forwarding varies depending on the load balancing mode.
You can use the following flow-based load balancing modes:
- Based on source MAC addresses of packets
- Based on destination MAC addresses of packets
- Based on source IP addresses of packets
- Based on destination IP addresses of packets
- Based on the Exclusive-Or result of source and destination MAC addresses of packets
- Based on the Exclusive-Or result of source and destination IP addresses of packets
- Enhanced load balancing: based on VLAN IDs and source physical interface numbers for Layer 2, IPv4, IPv6, and MPLS packets
When configuring a load balancing mode, pay attention to the following points:
- The load balancing mode is only effective for traffic on the outbound interface. If traffic on the inbound interface is not balanced, change the load balancing mode of the uplink outbound interface.
Data flows should be load balanced among all active links. If data flows are transmitted over one link, traffic congestion may occur and services will be affected.
For example, when data packets have only one destination MAC address and IP address, use load balancing based on the source MAC address and IP address of packets. If load balancing based on the destination MAC address and IP address is used, traffic is transmitted over one link, causing congestion.
For details about how to determine whether Eth-Trunk load balancing is uneven and how to adjust Eth-Trunk configurations in this scenario, visit Huawei technical support website to search for How Do I Adjust Eth-Trunk Configurations When Eth-Trunk Load Balancing Is Uneven.