BGP Configuration Guide for Cisco 8000 Series Routers, Cisco IOS XR Releases

PDF

Hierarchical load balancing

Want to summarize with AI?

Log in

Overview

Explains hierarchical load balancing that expands ECMP and UCMP scalability beyond hardware limits by splitting routes into multiple hierarchical levels, requiring CEF enabled on all routers.

Hierarchical load balancing is a network load balancing model that

  • allows you to configure up to 1,024 ECMPs or 256 UCMPs to reach a destination

  • achieves this by splitting routes into multiple hierarchical ECMPs or UCMPs, and

  • enables ECMP to expand beyond hardware limitations, providing greater scalability.

Table 1. Feature History Table

Feature Name

Release Name

Description

Configure 1024 Equal Cost Multi-Path or 256 Unequal Cost Multi-Path using Hierarchical Load Balancing

Release 25.4.1

Introduced in this release on: Fixed Systems (8010 [ASIC: A100])(select variants only*)

*This feature is now supported on:

  • 8011-32Y8L2H2FH

  • 8011-12G12X4Y-A

  • 8011-12G12X4Y-D

Configure 1024 Equal Cost Multi-Path or 256 Unequal Cost Multi-Path using Hierarchical Load Balancing

Release 25.1.1

Introduced in this release on: Fixed Systems (8010 [ASIC: A100])(select variants only*)

*This feature is supported on Cisco 8011-4G24Y4H-I routers.

Configure 1024 Equal Cost Multi-Path or 256 Unequal Cost Multi-Path using Hierarchical Load Balancing

Release 24.4.1

Introduced in this release on: Fixed Systems (8200 [ASIC: P100], 8700 [ASIC: P100, K100])(select variants only); Modular Systems (8800 [LC ASIC: P100])(select variants only*)

*This feature is supported on:

  • 8212-48FH-M

  • 8711-32FH-M

  • 8712-MOD-M

  • 88-LC1-36EH

  • 88-LC1-12TH24FH-E

  • 88-LC1-52Y8H-EM

Configure 1024 Equal Cost Multi-Path or 256 Unequal Cost Multi-Path using Hierarchical Load Balancing

Release 7.3.3

In earlier releases, you could configure only up to 128 ECMPs. This feature now allows you to configure up to 1,024 ECMPs or 256 UCMPs to reach a destination. You can achieve this by splitting the routes into multiple hierarchical-based ECMPs or UCMPs. This enables ECMP to expand beyond the hardware limitation of only 512 ECMPs, providing greater scalability.

Routes are split into multiple hierarchical routes to expand the capabilities into two levels of hierarchical ECMPs or UCMPs. You can enable the router to support 1,024 ECMPs or 256 UCMPs by using hierarchical-load-balancing model. Forwarding Information Base (FIB) splits routes based on your configuration, such as Autonomous System (AS) number of each path, group size, and your specific scenario.

As a prerequisite, Cisco Express Forwarding (CEF) must be enabled on all participating routers, since load balancing requires CEF. In unequal cost multipath (UCMP) load-balancing, a weight is associated with each next hop and traffic is distributed across the next hops in proportion to their weight. In ECMP, the route to a destination has multiple next hops and traffic is equally distributed.

Support was previously limited to 128 ECMPs. Starting from Release 7.3.3, the support is extended to 1,024 ECMPs or 256 UCMPs. At any given time, you can configure either 1,024 ECMPs or 256 UCMPs.

Restrictions and guidelines for hierarchical load balancing

  • The hierarchical-load-balancing model works only for IP paths, which enhances eBGP interface peering scenario.

  • This model does not apply to any path that includes an MPLS label or SRv6 information, because such information prevents CEF from converting flat load-balancing to a hierarchical-load-balancing model.

  • CEF must be enabled on all participating routers.


How hierarchical load balancing works

Summary

The key components involved in the process are:

  • BGP: Downloads neighbor AS information for each path.

  • Routing Information Base (RIB): Receives path information from BGP and passes it to FIB.

  • FIB: Splits routes and groups paths into hierarchical levels based on configuration and received information.

Hierarchical load balancing is a network load balancing model that extends the capabilities of ECMP and UCMP by splitting and grouping routes into multiple hierarchical levels. This process involves the cooperation of BGP, RIB, and FIB to manage path information and distribute traffic efficiently.

Workflow

Figure 1. Sample topology of hierarchical load balancing

These stages describe hierarchical load balancing.

  1. BGP downloads neighbor AS information for each path.
  2. BGP forwards this path information to the RIB.
  3. The RIB then passes this information to the FIB for regrouping.
  4. The FIB splits routes based on the configured group size, AS number of each path, and the specific scenario.
  5. The router-specific FIB groups these paths into two hierarchical levels.

Result

The sample topology shows the regional hub connected with 32 data centers with eBGP interface peering. Each data center has 32 interface connections, which adds up to a total of 1,024 ECMPs.

By enabling a hierarchical load-balancing UCMP group size of 256 within a data center, you can scale 256 UCMP eBGP paths on top-of-rack switching using weights.


Configure hierarchical load balancing

Enable and configure hierarchical load balancing to support a higher number of ECMP or UCMP paths for efficient traffic distribution.

Hierarchical load balancing allows you to scale beyond traditional ECMP limits by splitting and grouping routes. To use this feature, enable it and define route policies for UCMP.

Before you begin

Ensure CEF is enabled on all participating routers.

Procedure

1.

Run the cef hierarchical-load-balancing command to enable hierarchical load balancing with 1024 paths in ECMP mode.

For ECMP mode, the FIB splits or groups paths according to the path attribute of the AS number. Paths to the same destination must be configured on the same AS. Because of hardware limitations, the maximum number of remote AS numbers should be fewer than 128.

  • If paths are less than the min-path, FIB uses native forwarding mode.

  • If paths are greater than or equal to the min-path, FIB converts the forwarding chain to hierarchical forwarding.

Example:

Router(config)#router bgp 100
Router(config-bgp)#bgp router-id 10.10.10.11 
Router(config-bgp)#address-family ipv4 unicast 
Router(config-bgp-af)#maximum-paths ebgp 1024
Router(config-bgp-af)#maximum-paths unique-nexthop-check-disable 
Router(config-bgp-af)#exit
Router(config-bgp)#address-family ipv6 unicast 
Router(config-bgp-af)#maximum-paths ebgp 1024
Router(config-bgp-af)#maximum-paths unique-nexthop-check-disable 
Router(config-bgp-af)#exit
Router(config-bgp)#exit
Router(config)#cef hierarchical-load-balancing ecmp min-paths 128
Note

Reload the router so that the cef hierarchical-load-balancing ecmp min-paths command takes effect.

2.

Configure group size and route policy for UCMP links.

Define an extended community bandwidth routing policy that uses weight values to control traffic on UCMP links.

For example, the system applies the ratio AS number to Weight number on the egress of BGP. The FIB uses group size to split or group paths into hierarchical forwarding mode.

  • The group size value must be within the hardware limitation of 64 in case of IGP level load balancing.

  • The recommended group size is 64 if all paths are ECMP.

  • If paths have weight attributes, the recommended group size is only 32.

Example:

Router(config)# cef hierarchical-load-balancing ucmp group-size 32

Router(config)#route-policy BW1
Router(config-rpl)#set extcommunity bandwidth (800:10000)
Router(config-rpl)#end-policy
Router(config)#route-policy BW2
Router(config-rpl)#set extcommunity bandwidth (800:20000)
Router(config-rpl)#end-policy
Router(config)#route-policy BW3
Router(config-rpl)#set extcommunity bandwidth (800:40000) 
Router(config-rpl)#end-policy
Router(config)#route-policy BW4
Router(config-rpl)#set extcommunity bandwidth (800:80000) 
Router(config-rpl)#end-policy
Router(config)#commit
Note

Reload the router so that the cef hierarchical-load-balancing ucmp group-size command takes effect.

3.

Verify CEF configuration for hierarchical load balancing.

  1. Verify the BGP IPv4 unicast prefix status.

    Example:

    Router#show bgp ipv4 unicast 1.4.0.0/16 
    BGP routing table entry for 1.4.0.0/16 
    Versions:
    Process	bRIB/RIB SendTblVer
    Speaker	3	3
    Last Modified: Jan 31 13:14:07.023 for 08:53:38
    Paths: (1 available, best #1)
    Advertised IPv4 Unicast paths to update-groups (with more than one peer): 0.5
    Path #1: Received by speaker 0
    Advertised IPv4 Unicast paths to update-groups (with more than one peer): 0.5
    Local
    100.100.100.200 (metric 30) from 100.100.100.101 (100.100.100.200)
    Origin incomplete, metric 0, localpref 100, valid, internal, best, group-best Received Path ID 1, Local Path ID 1, version 3
    Originator: 100.100.100.200, Cluster list: 100.100.100.101
    
  2. Verify the CEF configuration status for ECMP.

    Example:

    Router# show cef 200.1.0.0 detail
    200.1.0.0/24, version 92168105, internal 0x5000001 0x40 (ptr 0xaa001058) [1], 0x0 (0x0), 0x0 (0x0)
    Updated Sep 8 23:04:13.489
    Prefix Len 24, traffic index 0, precedence n/a, priority 4
    gateway array (0x9232e858) reference count 596, flags 0x2010, source rib (7), 0 backups
    [1 type 3 flags 0x48441 (0xa9df9098) ext 0x0 (0x0)] LW-LDI[type=0, refc=0, ptr=0x0, sh-ldi=0x0]
    gateway array update type-time 1 Sep 8 23:04:13.490
    LDI Update time Sep 8 23:04:13.490 Weight distribution:
    slot 0, weight 5120, normalized_weight 15
    slot 1, weight 5120, normalized_weight 15
    slot 2, weight 5120, normalized_weight 15
    slot 3, weight 5120, normalized_weight 15
    
    Level 1 - Load distribution: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
    2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
    
  3. Verify the CEF configuration status for UCMP.

    Example:

    Router# show cef 200.1.0.0 detail
    200.1.0.0/24, version 6044, internal 0x5000001 0x40 (ptr 0xa64e7738) [1], 0x0 (0x0), 0x0 (0x0)
    Prefix Len 24, traffic index 0, precedence n/a, priority 4
    gateway array (0x92f14758) reference count 5001, flags 0x2010, source rib (7), 0 backups [1 type 3 flags 0x40441 (0xa4d331d8) ext 0x0 (0x0)]
    LW-LDI[type=0, refc=0, ptr=0x0, sh-ldi=0x0]
    gateway array update type-time 3 Nov 26 16:32:49.195
    LDI Update time Nov 26 16:32:49.195 Weight distribution:
    slot 0, weight 2560, normalized_weight 2
    slot 1, weight 2560, normalized_weight 2
    slot 2, weight 2560, normalized_weight 2
    slot 3, weight 2560, normalized_weight 2
    slot 4, weight 1280, normalized_weight 1
    slot 5, weight 1280, normalized_weight 1
    slot 6, weight 1280, normalized_weight 1
    slot 7, weight 1280, normalized_weight 1
    Level 1 - Load distribution: 0 0 1 1 2 2 3 3 4 5 6 7
    [0] via 241.0.58.138/32, recursive
    [1]	via 241.0.58.138/32, recursive
    [2]	via 241.0.58.134/32, recursive
    [3]	via 241.0.58.134/32, recursive
    [4]	via 241.0.58.130/32, recursive
    [5]	via 241.0.58.130/32, recursive
    [6]	via 241.0.58.126/32, recursive
    [7]	via 241.0.58.126/32, recursive
    [8]	via 241.0.58.122/32, recursive
    [9]	via 241.0.58.118/32, recursive
    [10]	via 241.0.58.114/32, recursive
    [11]	via 241.0.58.110/32, recursive
    via 241.0.58.138/32, 4 dependencies, recursive [flags 0x0] path-idx 0 NHID 0x0 [0x930b65e0 0x0]
    next hop VRF - 'iid', table - 0xe0000203 next hop 241.0.58.138/32 via 241.0.58.138/32
    Load distribution: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
    27 28	29 30 31 (refcount 1)	
    Hash	OK Interface	Address
    0	Y	TenGigE0/0/0/21/3.1	18.1.0.1
    1	Y	TenGigE0/0/0/21/3.2	18.1.1.1
    2	Y	TenGigE0/0/0/21/3.3	18.1.2.1
    3	Y	TenGigE0/0/0/21/3.4	18.1.3.1
    4	Y	TenGigE0/0/0/21/3.5	18.1.4.1
    5	Y	TenGigE0/0/0/21/3.6	18.1.5.1
    6	Y	TenGigE0/0/0/21/3.7	18.1.6.1
    7	Y	TenGigE0/0/0/21/3.8	18.1.7.1
    8	Y	TenGigE0/0/0/21/3.9	18.1.8.1
    9	Y	TenGigE0/0/0/21/3.10	18.1.9.1
    10	Y	TenGigE0/0/0/21/3.11	18.1.10.1
    11	Y	TenGigE0/0/0/21/3.12	18.1.11.1
    12	Y	TenGigE0/0/0/21/3.13	18.1.12.1
    13	Y	TenGigE0/0/0/21/3.14	18.1.13.1
    14	Y	TenGigE0/0/0/21/3.15	18.1.14.1
    15	Y	TenGigE0/0/0/21/3.16	18.1.15.1
    16	Y	TenGigE0/0/0/21/3.17	18.1.16.1
    17	Y	TenGigE0/0/0/21/3.18	18.1.17.1
    18	Y	TenGigE0/0/0/21/3.19	18.1.18.1
    19	Y	TenGigE0/0/0/21/3.20	18.1.19.1
    20	Y	TenGigE0/0/0/21/3.21	18.1.20.1
    21	Y	TenGigE0/0/0/21/3.22	18.1.21.1
    22	Y	TenGigE0/0/0/21/3.23	18.1.22.1
    23	Y	TenGigE0/0/0/21/3.24	18.1.23.1
    24	Y	TenGigE0/0/0/21/3.25	18.1.24.1
    25	Y	TenGigE0/0/0/21/3.26	18.1.25.1
    26	Y	TenGigE0/0/0/21/3.27	18.1.26.1
    27	Y	TenGigE0/0/0/21/3.28	18.1.27.1
    28	Y	TenGigE0/0/0/21/3.29	18.1.28.1
    29	Y	TenGigE0/0/0/21/3.30	18.1.29.1
    30	Y	TenGigE0/0/0/21/3.31	18.1.30.1
    31	Y	TenGigE0/0/0/21/3.32	18.1.31.1
    

Hierarchical load balancing is enabled and configured, allowing for expanded ECMP or UCMP capabilities.