Migrating an MPLS Backbone from LDP to Segment Routing (SR-MPLS) on Cisco IOS-XR

Segment Routing (SR) is a source-routing architecture in which the ingress node encodes an explicit forwarding path into an ordered list of segments inside the packet header, allowing transit routers to forward strictly on those instructions without maintaining per-flow state. A segment can represent any topological or service instruction—forwarding along the shortest IGP path, steering over a specific adjacency link, or delivering traffic into a designated service instance.

Compared with legacy MPLS control planes, Segment Routing radically simplifies backbone operations and scales effortlessly. Unlike RSVP-TE, SR eliminates complex soft-state tunnel signaling on transit nodes, relies solely on existing IGPs (IS-IS or OSPF) for label distribution, and permanently solves the classic LDP-IGP synchronization problem.

Because SR reuses either the MPLS data plane (SR-MPLS) or IPv6 (SRv6), existing LDP networks can migrate smoothly without a forklift upgrade. This walkthrough documents the full end-to-end migration of a Cisco IOS-XR core from LDP to SR-MPLS—including Segment Routing Mapping Server (SRMS) interworking with legacy LDP edge domains.

Pre-Migration Topology & Interworking Scope

MPLS LDP to Segment Routing migration topology showing LDP Area A (R5, R6), SR-MPLS Core (R1-R4 with RR/SRMS R3), and LDP Area B (R7, R8)
Figure 1: Three-domain MPLS migration topology—legacy LDP Area A (R5/R6), IOS-XR core migrating LDP→SR (R1–R4), and legacy LDP Area B (R7/R8).

Before migration, the entire lab runs LDP + IS-IS + BGP. Router R3 serves as the BGP Route Reflector (RR) with iBGP sessions to R4, R5, and R8, and all client hosts have full reachability. Our goal is to migrate the core backbone (R1–R4) from LDP to SR-MPLS.

Because both edge domains (LDP Area A and LDP Area B) do not support Segment Routing, we must configure LDP ↔ SR interworking at the core borders so edge clients retain end-to-end connectivity after LDP is removed from the core.

Step 1: Enable IS-IS SR-MPLS Across the Core (R1–R4)

Configure Segment Routing on R1 through R4 with a shared SRGB (16000–23999) and SRLB (15000–15999). We also assign static Adjacency-SIDs using the convention 1500[x], where x is the GigabitEthernet port number (e.g., Gi0/0/0/1 → 15001).

Prerequisite: IS-IS must operate with metric-style wide; otherwise, routers cannot advertise Segment Routing sub-TLVs in their LSPs.

RP/0/RP0/CPU0:R1(config)#show configuration
Fri Jun 11 13:11:21.347 UTC
Building configuration...
!! IOS XR Configuration 7.3.1
router isis 1
 address-family ipv4 unicast
  segment-routing mpls // Enable SR-MPLS under IS-IS IPv4 unicast
 !
 interface Loopback0
  address-family ipv4 unicast
   prefix-sid index 1 // Global unique Prefix-SID index within SRGB
  !
 !
 interface GigabitEthernet0/0/0/0
  address-family ipv4 unicast
   adjacency-sid absolute 15000 // Static Adj-SID for SR-TE explicit paths (outside scope here)
  !
 !
 interface GigabitEthernet0/0/0/1
  address-family ipv4 unicast
   adjacency-sid absolute 15001
  !
 !
!
segment-routing
 global-block 16000 23999
 local-block 15000 15999
!
end
RP/0/RP0/CPU0:R2(config)#show confi
Fri Jun 11 13:13:26.059 UTC
Building configuration...
!! IOS XR Configuration 7.3.1
router isis 1
 address-family ipv4 unicast
  segment-routing mpls
 !
 interface Loopback0
  address-family ipv4 unicast
   prefix-sid index 2
  !
 !
 interface GigabitEthernet0/0/0/0
  address-family ipv4 unicast
   adjacency-sid absolute 15000
  !
 !
 interface GigabitEthernet0/0/0/1
  address-family ipv4 unicast
   adjacency-sid absolute 15001
  !
 !
!
segment-routing
 global-block 16000 23999
 local-block 15000 15999
!
end
RP/0/RP0/CPU0:R3(config)#show confi
Fri Jun 11 13:15:49.639 UTC
Building configuration...
!! IOS XR Configuration 7.3.1
router isis 1
 address-family ipv4 unicast
  segment-routing mpls
 !
 interface Loopback0
  address-family ipv4 unicast
   prefix-sid index 3
  !
 !
 interface GigabitEthernet0/0/0/0
  address-family ipv4 unicast
   adjacency-sid absolute 15000
  !
 !
 interface GigabitEthernet0/0/0/1
  address-family ipv4 unicast
   adjacency-sid absolute 15001
  !
 !
!
segment-routing
 global-block 16000 23999
 local-block 15000 15999
!
end
RP/0/RP0/CPU0:R4(config)#show confi
Fri Jun 11 13:18:05.689 UTC
Building configuration...
!! IOS XR Configuration 7.3.1
router isis 1
 address-family ipv4 unicast
  segment-routing mpls
 !
 interface Loopback0
  address-family ipv4 unicast
   prefix-sid index 4
  !
 !
 interface GigabitEthernet0/0/0/0
  address-family ipv4 unicast
   adjacency-sid absolute 15000
  !
 !
 interface GigabitEthernet0/0/0/1
  address-family ipv4 unicast
   adjacency-sid absolute 15001
  !
 !
!
segment-routing
 global-block 16000 23999
 local-block 15000 15999
!
end

SRGB vs. SRLB Planning Best Practices

  • SRGB (Segment Routing Global Block): Defines the global label range for Prefix-SID calculations (16000–23999). Keeping the SRGB identical across all nodes simplifies operations, while every router’s prefix-sid index must be globally unique.
  • SRLB (Segment Routing Local Block): Locally significant range (15000–15999) used for static manual Adjacency-SID bindings (critical for SR-TE explicit paths). Standardizing an interface-to-SID numbering rule prevents operational confusion.

Step 2: Verify IS-IS SR TLVs & Label Table

Commit the configuration and inspect R3‘s verbose IS-IS LSP and the local SR label table on R1 to verify Prefix-SIDs, Adj-SIDs, SRGB/SRLB blocks, and MSD:

RP/0/RP0/CPU0:R1#show isis database R3.00-00 verbose

IS-IS 1 (Level-2) Link State Database
LSPID                 LSP Seq Num  LSP Checksum  LSP Holdtime/Rcvd  ATT/P/OL
R3.00-00              0x00000019   0xe9b8        1019 /1200         0/0/0
 {..snip..}
  Metric: 0          IP-Extended 10.0.0.3/32
    Prefix-SID Index: 3, Algorithm:0, R:0 N:1 P:0 E:0 V:0 L:0  // SR advertises SID index rather than absolute label; N=1 indicates Node-SID
    Prefix Attribute Flags: X:0 R:0 N:1 E:0 A:0
    Source Router ID: 10.0.0.3
 {..snip..}
    Local Interface ID: 7, Remote Interface ID: 7
    Interface IP Address: 10.10.13.3
    Neighbor IP Address: 10.10.13.1
    ADJ-SID: F:0 B:0 V:1 L:1 S:0 P:0 weight:0 Adjacency-sid:24015 // Dynamically allocated Adj-SID
    ADJ-SID: F:0 B:0 V:1 L:1 S:0 P:1 weight:0 Adjacency-sid:15001 // Manually allocated static Adj-SID from SRLB
  Metric: 10         IS-Extended R4.00
    Local Interface ID: 6, Remote Interface ID: 6
    Interface IP Address: 10.10.34.3
    Neighbor IP Address: 10.10.34.4
    ADJ-SID: F:0 B:0 V:1 L:1 S:0 P:0 weight:0 Adjacency-sid:24017
    ADJ-SID: F:0 B:0 V:1 L:1 S:0 P:1 weight:0 Adjacency-sid:15000
  Router Cap:     10.0.0.3 D:0 S:0
    Segment Routing: I:1 V:0, SRGB Base: 16000 Range: 8000
    SR Local Block: Base: 15000 Range: 1000
    Node Maximum SID Depth:
      Label Imposition: 10 // Advertised Maximum SID Depth (label imposition capacity)
    SR Algorithm: // Flex-Algo capability (not covered in this lab)
      Algorithm: 0
      Algorithm: 1
RP/0/RP0/CPU0:R1#show isis segment-routing label table
Fri Jun 11 13:24:13.893 UTC

IS-IS 1 IS Label Table
Label         Prefix                   Interface
----------    ----------------         ---------
16001         10.0.0.1/32              Loopback0
16002         10.0.0.2/32
16003         10.0.0.3/32
16004         10.0.0.4/32

Step 3: Switch Forwarding Priority from LDP to SR (sr-prefer)

Even with SR operational, Cisco IOS-XR defaults to preferring LDP over SR when both label bindings exist for a prefix. A traceroute from R4 to 10.0.0.1 still pushes LDP label 24000:

RP/0/RP0/CPU0:R4#traceroute 10.0.0.1 source lo0
Fri Jun 11 13:47:57.344 UTC

Type escape sequence to abort.
Tracing the route to 10.0.0.1

 1  10.10.34.3 [MPLS: Label 24000 Exp 0] 5 msec  3 msec  3 msec
 2  10.10.13.1 6 msec  *
    10.10.12.1 7 msec

Enable segment-routing mpls sr-prefer under the IS-IS IPv4 unicast address-family (required on ingress/headend nodes). Re-running the traceroute confirms traffic immediately switches to SR Node-SID 16001:

RP/0/RP0/CPU0:R4(config-isis-af)#segment-routing mpls sr-prefer
RP/0/RP0/CPU0:R4(config-isis-af)#commit

RP/0/RP0/CPU0:R4#traceroute 10.0.0.1 source lo0
Fri Jun 11 13:45:36.906 UTC

Type escape sequence to abort.
Tracing the route to 10.0.0.1

 1  10.10.24.2 [MPLS: Label 16001 Exp 0] 24 msec
    10.10.34.3 7 msec
    10.10.24.2 3 msec
 2  10.10.13.1 10 msec  *  6 msec

Step 4: Troubleshooting Core LDP Removal & Deploying SRMS

In a pure-SR network, you could now decommission LDP everywhere. Here, however, edge areas still run LDP. Watch what happens when we disable LDP inside the core and trace from LDP Area A toward LDP Area B:

                             My traceroute  [v0.92]
localhost (100.64.0.2)                                 2021-06-11T14:03:04+0000
Keys:  Help   Display mode   Restart statistics   Order of fields   quit
                                       Packets               Pings
 Host                                Loss%   Snt   Last   Avg  Best  Wrst StDev
 1. 100.64.0.1                        0.0%     1    1.7   1.7   1.7   1.7   0.0
 2. ???

Packets drop immediately at hop 2! Checking the MPLS forwarding tables on edge router R6 and border router R1 reveals why:

R6#show mpls forwarding-table
Local      Outgoing   Prefix           Bytes Label   Outgoing   Next Hop
Label      Label      or Tunnel Id     Switched      interface
{..snip..}
29         24013      10.0.0.8/32      3608          Gi2        10.10.16.1
RP/0/RP0/CPU0:R1#show mpls forwarding
Fri Jun 11 14:06:56.465 UTC
Local  Outgoing    Prefix             Outgoing     Next Hop        Bytes
Label  Label       or ID              Interface                    Switched
------ ----------- ------------------ ------------ --------------- ------------
{..snip..}
24013  Unlabelled  10.0.0.8/32        Gi0/0/0/0    10.10.12.2      12154
{..snip..}

Root Cause: Traffic entering the SR domain from LDP works automatically because LDP border routers resolve onto SR labels. The failure occurs in the SR → LDP direction: since core LDP is off and legacy LDP router R8 (10.0.0.8/32) cannot originate a Prefix-SID, R1 has Unlabelled toward R2. R1 pops incoming LDP label 24013 and attempts an IP lookup on 100.64.2.0/24—which is absent from the BGP-free core—dropping the packet.

Bridging SR → LDP with Segment Routing Mapping Server (SRMS)

To fix SR → LDP interworking, deploy a Segment Routing Mapping Server (SRMS) inside the SR domain to advertise Prefix-SIDs on behalf of non-SR LDP routers. In production, always deploy redundant active/standby SRMS nodes; in this lab we configure SRMS on Route Reflector R3 mapping 10.0.0.5–10.0.0.8 to SID indices 5–8:

RP/0/RP0/CPU0:R3#show configuration commit changes last 1
Fri Jun 11 14:17:36.798 UTC
Building configuration...
!! IOS XR Configuration 7.3.1
router isis 1
 address-family ipv4 unicast
  segment-routing prefix-sid-map advertise-local // Advertise local SRMS bindings into IS-IS
 !
!
segment-routing
 mapping-server
  prefix-sid-map
   address-family ipv4
    10.0.0.5/32 5 range 4 // Map 10.0.0.5/32..10.0.0.8/32 starting at SID index 5 (range 4)
    // Non-contiguous loopbacks can be listed individually line by line.
   !
  !
 !
!
end

Verify the newly populated LFIB entries on R3 and confirm that R1 receives the IS-IS SID Binding sub-TLV and active SRMS policy:

RP/0/RP0/CPU0:R3#show mpls forwarding
Fri Jun 11 14:17:56.865 UTC
Local  Outgoing    Prefix             Outgoing     Next Hop        Bytes
Label  Label       or ID              Interface                    Switched
------ ----------- ------------------ ------------ --------------- ------------
{..snip..}
16001  Pop         SR Pfx (idx 1)     Gi0/0/0/1    10.10.13.1      0
16002  16002       SR Pfx (idx 2)     Gi0/0/0/0    10.10.34.4      0
       16002       SR Pfx (idx 2)     Gi0/0/0/1    10.10.13.1      0
16004  Pop         SR Pfx (idx 4)     Gi0/0/0/0    10.10.34.4      1243
16005  26          SR Pfx (idx 5)     Gi0/0/0/3    10.10.36.6      0
16006  Pop         SR Pfx (idx 6)     Gi0/0/0/3    10.10.36.6      0
16007  16007       SR Pfx (idx 7)     Gi0/0/0/0    10.10.34.4      0
16008  16008       SR Pfx (idx 8)     Gi0/0/0/0    10.10.34.4      0
{..snip..}
RP/0/RP0/CPU0:R1#show isis database R3.00-00 verbose
Fri Jun 11 14:23:02.372 UTC

IS-IS 1 (Level-2) Link State Database
LSPID                 LSP Seq Num  LSP Checksum  LSP Holdtime/Rcvd  ATT/P/OL
R3.00-00              0x0000001e   0xe2d2        844  /1200         0/0/0
{..snip..}
  Metric: 0          IP-Extended 10.0.0.3/32
    Prefix-SID Index: 3, Algorithm:0, R:0 N:1 P:0 E:0 V:0 L:0
    Prefix Attribute Flags: X:0 R:0 N:1 E:0 A:0
    Source Router ID: 10.0.0.3
{..snip..}
  Router Cap:     10.0.0.3 D:0 S:0
    Segment Routing: I:1 V:0, SRGB Base: 16000 Range: 8000
    SR Local Block: Base: 15000 Range: 1000
    Node Maximum SID Depth:
      Label Imposition: 10
    SR Algorithm:
      Algorithm: 0
      Algorithm: 1
  SID Binding:    10.0.0.5/32 F:0 M:0 S:0 D:0 A:0 Weight:0 Range:4 // SRMS sub-TLV
    SID: Start:5, Algorithm:0, R:0 N:0 P:0 E:0 V:0 L:0

RP/0/RP0/CPU0:R1#show isis segment-routing prefix-sid-map active-policy
Fri Jun 11 14:26:11.074 UTC

IS-IS 1 active policy
Prefix               SID Index    Range        Flags
10.0.0.5/32          5            4

Number of mapping entries: 1
LDP and SR-MPLS label stitching via SRMS from R5 to R8: LDP 29 to LDP 24013 stitched at R1 to SR 16008, then swapped at R2 to LDP 29
Figure 2: End-to-end LDP ↔ SR ↔ LDP label stitching enabled by R3’s SRMS mapping (LDP 29 → LDP 24013 → SR 16008 → LDP 29 → PHP).

Step 5: End-to-End Connectivity & Hop-by-Hop Label Trace

Re-running mtr from LDP Area A to LDP Area B (100.64.2.2) now succeeds with 0.0% packet loss:

root@localhost:~# mtr 100.64.2.2 --report -n
Start: 2021-06-11T14:27:47+0000
HOST: localhost                   Loss%   Snt   Last   Avg  Best  Wrst StDev
  1.|-- 100.64.0.1                 0.0%    10    0.9   1.9   0.5   3.9   1.2
  2.|-- 10.10.56.6                 0.0%    10   12.7   9.9   5.2  16.3   3.1
  3.|-- 10.10.16.1                 0.0%    10    7.1   8.3   5.1  12.3   2.0
  4.|-- 10.10.12.2                 0.0%    10   13.3   9.7   4.5  18.6   4.8
  5.|-- ???                       100.0    10    0.0   0.0   0.0   0.0   0.0
  6.|-- 10.10.78.8                 0.0%    10   11.1   7.3   3.2  11.1   2.2
  7.|-- 100.64.2.2                 0.0%    10    6.3   9.3   3.7  14.7   3.5

Finally, execute a traceroute from R5 to 10.0.0.8 to verify exact hop-by-hop LDP ↔ SR label stitching across the data plane:

R5#traceroute 10.0.0.8 source lo0
Type escape sequence to abort.
Tracing the route to 10.0.0.8
VRF info: (vrf in name/id, vrf out name/id)
  1 10.10.56.6 [MPLS: Label 29 Exp 0] 15 msec 14 msec 5 msec // LDP transport in Area A
  2 10.10.16.1 [MPLS: Label 24013 Exp 0] 6 msec 6 msec 9 msec // LDP entering SR border router R1
  3 10.10.12.2 [MPLS: Label 16008 Exp 0] 23 msec 13 msec 7 msec // Stitched to SRMS Prefix-SID 16008 across SR core
  4 10.10.27.7 [MPLS: Label 29 Exp 0] 9 msec 7 msec 7 msec // Exiting SR domain, stitched back to LDP label 29
  5 10.10.78.8 9 msec *  30 msec // Penultimate hop popping (PHP) at R7

The verified path R5 → R6 → R1 → R2 → R7 → R8 stitches LDP 29 → LDP 24013 → SR 16008 → LDP 29 → PHP cleanly. The backbone has completed a seamless, hitless migration from LDP to Segment Routing while preserving full backward compatibility with legacy LDP edge domains.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.