Route Load Balancing
Overview
Huawei NE20E can implement load balancing using static routes and a variety of routing protocols, including the Routing Information Protocol (RIP), RIP next generation (RIPng), Open Shortest Path First (OSPF), OSPFv3, Intermediate System-to-Intermediate System (IS-IS), and Border Gateway Protocol (BGP).
When multiple dynamic routes participate in load-balancing, these routes must have equal metric. As metric can be compared only among routes of the same protocol, only routes of the same protocol can load-balance traffic.
Load Balancing Among Static Routes
By default, a maximum of 64 static routes can be used to load-balance traffic on Huawei NE20E.
The maximum number of static routes that can be used to load-balance traffic is controlled by the PAF/license or global trotter license (GTL) file and cannot be modified using commands.
Conditions
When the maximum number of static routes that load-balance traffic and the maximum number of routes of all types that load-balance traffic are both greater than 1, the following rules apply:
- If N active static routes with the same prefix are available and N is less than or equal to the maximum number of static routes that can be used to load-balance traffic, traffic is load-balanced among the N static routes, regardless of whether they have the same cost.
- If a static route is active and has N iterative next hops, traffic is load-balanced among N routes, which is called iterative load balancing.
In Figure 8-14, R1 learns two OSPF routes to 172.1.1.2/32, both with the cost 2. The outbound interface and next hop of one route are GE 1/0/0 and 172.1.1.34, and the outbound interface and next hop of the other route are GE 2/0/0 and 172.1.1.38.
A static route is configured on R1 using the following command:
ip route-static 172.1.1.45 30 172.1.1.2 inherit-cost
Although only one static route is configured, two iterative next hops (172.1.1.34 and 172.1.1.38) are available. Therefore, the number of static routes displayed in the routing table is 1, but the number of FIB entries is 2.
- If another static route is configured on R1 using the following
command:
ip route-static 172.1.1.45 30 172.1.1.42
Traffic is load-balanced among three routes, although the cost of the new static route is different from that of the other two routes.
- If the following command is run to set the priority of the new
static route to 1,
ip route-static 172.1.1.45 30 172.1.1.42 preference 1
R1 will preferentially select the static route with next hop 172.1.1.42. As a result, the other static routes become invalid, and traffic is no longer load-balanced.
Load Balancing Among OSPF Routes
Conditions
If the maximum number of OSPF routes that can be used to load-balance traffic and the maximum number of routes of all types that can be used to load-balance traffic are both greater than 1 and multiple OSPF routes with the same prefix exist, these routes participate in load balancing only when the following conditions are met:
- These routes are of the same type (intra-area, inter-area, Type-1 external, or Type-2 external).
- These routes have different direct next hops.
- These routes have the same cost.
- If these routes are Type-2 external routes, the costs of the links to the ASBR or forwarding address are the same.
- If OSPF route selection specified in relevant standards is implemented, these routes have the same area ID.
Principles
If the number of OSPF routes available for load balancing is greater than the configured maximum number of OSPF routes that can be used to load-balance traffic, OSPF selects routes for load balancing in the following order:
Routes whose next hops have smaller weights
NOTE:
Weight indicates the route preference, and the weight of the next hop can be changed by the nexthop command (in OSPF view). Routing protocols and their default preferences:- DIRECT: 0
- STATIC: 60
- IS-IS: 15
- OSPF: 10
- OSPF ASE: 150
- OSPF NSSA: 150
- RIP: 100
- IBGP: 255
- EBGP: 255
Routes whose outbound interfaces have larger indexes
NOTE:
Each interface has an index, which can be seen in the display interface interface-name command in any view.- Routes whose next hop IP addresses are larger.
Load Balancing Among IS-IS Routes
Conditions
If the maximum number of IS-IS routes that can be used to load-balance traffic and the maximum number of routes of all types that can be used to load-balance traffic are both greater than 1 and multiple IS-IS routes with the same prefix exist, these routes can participate in load balancing only when the following conditions are met:
- These routes are of the same level (Level-1, Level-2, or Level-1-2).
- These routes are of the same type (internal or external).
- These routes have the same cost.
- These routes have different direct next hops.
Principles
If the number of IS-IS routes available for load balancing is greater than the configured maximum number of IS-IS routes that can be used to load-balance traffic, IS-IS selects routes for load balancing in the following order:
Routes whose next hops have smaller weights
NOTE:
Weight indicates the route preference, and the weight of the next hop can be changed by the nexthop command (in IS-IS view). Routing protocols and their default preferences:- DIRECT: 0
- STATIC: 60
- IS-IS: 15
- OSPF: 10
- OSPF ASE: 150
- OSPF NSSA: 150
- RIP: 100
- IBGP: 255
- EBGP: 255
- Routes with smaller neighbor IDs
- Routes with smaller circuit IDs
- Routes with smaller sub-network point addresses (SNPAs)
Routes whose outbound interfaces have smaller indexes
NOTE:
Each interface has an index, which can be seen in the display interface interface-name command in any view.- Routes carrying IPv4, IPv6, and OSI next hop addresses, in descending order
- Routes whose next hops have smaller IP addresses
- If all the preceding items are the same, IS-IS selects the routes that are first calculated for load balancing.
Load Balancing Among BGP Routes
Conditions
Unlike an Interior Gateway Protocol (IGP), BGP imports routes from other routing protocols, controls route advertisement, and selects optimal routes, rather than maintaining network topologies or calculating routes by itself.
- Static routes or equal-cost IGP routes are used for BGP route iteration, and then traffic is load-balanced among BGP routes.
BGP route attributes are modified to carry out load balancing.
In versions that support BGP independent route selection, BGP routes can be used to load-balance traffic only when the following conditions are met:
- The PrefVal attributes of the BGP routes are the same.
- The Local_Pref attributes of the BGP routes are the same.
- The BGP routes are all summarized routes or none of them is a summarized route.
- The AS_Path (excluding As_Confed_Sequence and As_Confed_Set) attributes of the BGP routes carry the same number of ASs. During route selection, a router considers that the AS_Set carries only one AS, regardless of the actual number of ASs.
- The origin types (IGP, EGP, or incomplete) of the BGP routes are the same.
- The MED values of the BGP routes are the same.
- The BGP routes are either all EBGP or all IBGP routes.
- The metric values of intra-AS IGP routes imported and converted to the BGP routes are the same.
- The AS_Path attributes of the BGP routes are the same.
In versions that do not support BGP independent route selection, BGP routes can be used to load-balance traffic only when both the preceding nine conditions and the following conditions are met:
- The BGP routes are either all locally originated or none of the them is locally originated. If they are all locally originated, they must have the same priority.
- The next hops of the BGP routes are reachable.
- The BGP routes are either all labeled or none of them is labeled.
Principles
If the number of BGP routes available for load balancing is greater than the configured maximum number of BGP routes that can be used to load-balance traffic, BGP selects routes for load balancing in the following order:
- Routes with the shortest Cluster_List
- Routes advertised by the routers with smaller router IDs. If the BGP routes carry Originator_ID attributes, BGP selects the routes with smaller Originator_ID attributes without comparing the router IDs.
- Routes that are learned from BGP peers with smaller addresses
EIBGP Load Balancing
EIBGP load balancing is used in a VPN where a CE is dual-homed to two PEs, as shown in Figure 8-15. If the CE belongs to the same AS as one of the PEs and belongs to a different AS from the other PE, VPN traffic is load-balanced among EBGP and IBGP routes.
Multicast Load Balancing
If equal-cost unicast routes to multicast sources or RPs exist on a multicast network, you can implement multicast load balancing by running the multicast load-splitting command to configure a load balancing policy ( as shown in Figure 8-16 and Figure 8-17 ).