LDP Local Allocation Filtering

Load isis.cfg

#IOS-XE
config replace flash:isis.cfg

#IOS-XR
configure
load bootflash:isis.cfg
commit replace
y

  • Configure LDP using IGP autoconfig on routers R1-R6 and XR1-2

  • On R1-R3 and XR1, allocate labels only for host routes using a prefix-list/ACL

  • On R4-R6 and XR2, allocate labels only for host routes without using a prefix-list or ACL

Answer

#R1-R3
router isis
 mpls ldp autoconfig
!
ip prefix-list HOST_ROUTES permit 0.0.0.0/0 ge 32 le 32
!
mpls ldp label
 allocate global prefix-list HOST_ROUTES

#R4-R6
router isis
 mpls ldp autoconfig
!
mpls ldp label
 allocate global host-routes

#XR1
router isis 1
 add ipv4
  mpls ldp auto-config
!
mpls ldp
 address-family ipv4
  label
   local
    allocate for HOST_ROUTES
!
ipv4 access-list HOST_ROUTES
 permit ipv4 host 1.1.1.1 any
 permit ipv4 host 2.2.2.2 any
 permit ipv4 host 3.3.3.3 any
 permit ipv4 host 4.4.4.4 any
 permit ipv4 host 5.5.5.5 any
 permit ipv4 host 6.6.6.6 any
 permit ipv4 host 19.19.19.19 any
 permit ipv4 host 20.20.20.20 any

#XR2
router isis 1
 add ipv4
  mpls ldp auto-config
!
mpls ldp
 address-family ipv4
  label
   local
    allocate for host-routes

Explanation

By default, LDP will locally allocate labels for every non-BGP prefix in the RIB. However, generally LSPs are only formed on the loopbacks, so there is no reason to allocate labels for every transit prefix in the IGP. By allocating labels only for host routes, we can save some memory and better scale LDP.

To selectively allocate labels, we have two options. First, we can use a prefix-list/ACL to have granular control over what prefixes will be allocated a label.

#IOS-XE
mpls ldp label
 allocate global prefix-list PREFIX_LIST

#IOS-XR
mpls ldp
 address-family ipv4
  label
   local
    allocate for ACL

The IOS-XR method is quite burdensome, because we cannot use a mask filter like we can with a prefix-list. This is the reason that we had to manually specify every host route in the ACL on XR1:

mpls ldp
 address-family ipv4
  label
   local
    allocate for HOST_ROUTES
!
ipv4 access-list HOST_ROUTES
 permit ipv4 host 1.1.1.1 any
 permit ipv4 host 2.2.2.2 any
 permit ipv4 host 3.3.3.3 any
 permit ipv4 host 4.4.4.4 any
 permit ipv4 host 5.5.5.5 any
 permit ipv4 host 6.6.6.6 any
 permit ipv4 host 19.19.19.19 any
 permit ipv4 host 20.20.20.20 any

The second method is the built-in host-routes option. This instructs LDP to only allocate labels for /32 prefixes, and does not require any prefix-list or ACL.

#IOS-XE
mpls ldp label
 allocate global host-routes

#IOS-XR
mpls ldp
 address-family ipv4
  label
   local
    allocate for host-routes

Verification

On any router in the topology, we should only see /32 prefixes in the LFIB and LIB. It does not matter which router we look at, because both the ACL/prefix-list method, and the built-in for host-routes method, have the exact same effect.

Last updated