How does S series switch implement load balancing among equal-cost routes


An S series switch supports enhanced equal-cost multipath (ECMP) load balancing mode. This function mitigates the problem of unequal traffic distribution among equal-cost routes. If this problem still occurs, configure a traffic policy to redirect the traffic with the highest rate to the link with the lightest traffic.

Perform the following operations to configure a traffic policy:
1. Configure redirection.
[HUAWEI] traffic behavior test
[HUAWEI-behavior-test] redirect ip-nexthop
2. Configure traffic classifier based on basic ACL.
[HUAWEI] acl 2000
[HUAWEI-acl-basic-2000] rule 10 permit source 0
[HUAWEI-acl-basic-2000] quit
[HUAWEI] traffic classifier test
[HUAWEI-classifier-test] if-match acl 2000
3. Create a traffic policy and associate it with the created traffic classifier and behavior.
[HUAWEI] traffic policy test
[HUAWEI-trafficpolicy-test] classifier test behavior test
4. Apply the traffic policy to the inbound direction of an interface.
[HUAWEI] interface GigabitEthernet 1/0/1
[HUAWEI-GigabitEthernet1/0/1] traffic-policy test inbound

Other related questions:
Load balancing cannot be implemented among member interfaces of an Eth-Trunk on S series switches
Cause 1: Traffic is unevenly balanced among active links of an Eth-Trunk due to the incorrect load balancing mode. 1. Run the display eth-trunk command to check whether the load balancing mode of the Eth-Trunk meets the actual networking requirements. For example, load balancing based on source and destination IP addresses is not recommended on an L2 network. 2. Run the load-balance command to set the load balancing mode that meets the traffic requirements. Cause 2: When an Eth-Trunk interface in static LACP mode goes Up and Down frequently due to unstable physical links, LACP flapping occurs accordingly. As a result, services transmitted on the Eth-Trunk link are affected. When the LACP preemption delay is configured, LACP negotiation is not performed during the delay period; therefore. As a result, LACP flapping will not occur and services will not be affected. You can run the lacp preempt enable command to enable the LACP preemption function and then run the lacp preempt delay delay-time command to specify the LACP preemption delay.

Maximum number of equal-cost OSPF routes supported by an S series switch
The maximum number of equal-cost OSPF routes on an S series modular switch that supports OSPF is 16 and that on an S series fixed switch that supports OSPF is 8. You can run the maximum load-balancing number command to set the maximum number of equal-cost OSPF routes.

Why cannot interfaces of different types generate equal-cost routes and establish OSPF load balancing
OSPF can automatically calculate the cost of an interface based on the interface bandwidth. The calculation formula is: Interface cost = Bandwidth reference value/Interface bandwidth. The bandwidth reference value is configurable. The default value is 100 Mbit/s. Routes generated by OSPF have the same priority (10 by default). The interface cost, however, depends on the interface type. Interfaces of different types have different costs; therefore, the interfaces cannot generate equal-cost routes, leading to failure in establishing load balancing.

Why the ASBR does not generate equal-cost route
Two areas are configured on two devices separately, for example: SwitchA: area 0: area 1: SwitchB: area 0: area 1: Adjacencies are formed on the devices separately. Thus, the next-hop of a route that SwitchB learns from SwitchA should be or However, the route on SwitchB goes through only in area 1 as the gateway and no load sharing can be performed. This is because when multiple equal-cost routes exist, an ASBR selects the route with the greatest area ID.

If you have more questions, you can seek help from following ways:
To iKnow To Live Chat
Scroll to top