MPLS – Segment Routing (MPLS-SR) Lab
What is MPLS Segment Routing (MPLS-SR)?
In short MPLS Segment Routing (MPLS-SR) is a modern approach to routing in MPLS (Multiprotocol Label Switching) networks. It allows for the efficient steering of traffic through predefined network segments. These segments are advertised by link-state routing protocols (IS-IS, OSPFv2, and OSPFv3) within IGP topologies. With MPLS-SR, path control and traffic engineering can be achieved without the need for protocols like LDP or RSVP-TE, which are typically used to set up traffic-engineered paths in traditional MPLS networks. These segments are stacked as labels in packet headers, allowing routers to follow predefined paths for traffic without this additional state tracking. This simplifies traffic engineering, enhances scalability, and enables efficient routing.
In this lab I will demonstrate the process of migrating from a traditional MPLS setup (using MPLS, OSPF, and LDP) to an MPLS-SR configuration on IOS-XR and IOS-XE. In this guide, you will see the configuration steps required and differences between both operating systems.
Following this, I will configure a Segment Routing Mapping Server (SRMS) to map the prefixes of IOSv routers since they don’t support MPLS-SR.
MPLS Lab Setup (Baseline)
Labs downloadTwo CML Labs are available for download here. |
Using Cisco’s Modeling Labs (CML) I build the following MPLS lab using OSPF and LDP neighbor relationships.
- 2 x PE router ( Left ) (PE5, PE6) running CSR1000v with IOS-XE.
- 4 x P router ( Center ) (P1, P2, P3, P4) running XRv with IOS-XR.
- 2 x PE router ( Right ) (PE7, PE8) running IOSv with IOS.
Logical View:
Interfaces:
IP Addressing:
The point-to-point links are configured with the following IP addressing scheme:
- “10.<Lowest Router Id>.<Highest Router Id>.<Router Id>./24.”
For example the link between P1 and P2 gives on P1: 10.1.2.1/24 and on P2: 10.1.2.2/24.
Device | Function | Loopback address | Subnets | Label Ranges | Image |
---|---|---|---|---|---|
P1 | P Router | 1.1.1.1/32 | Gi1 10.1.2.1/24 Gi2 10.1.3.1/24 Gi3 10.1.4.1/24 Gi4 10.1.5.1/24 Gi5 10.1.6.1/24 | 24100-24199 | IOS XRV |
P2 | P Router | 2.2.2.2/32 | Gi1 10.1.2.2/24 Gi2 10.2.4.2/24 Gi3 10.2.3.2/24 Gi4 10.2.6.2/24 Gi5 10.2.5.2/24 | 24200-24299 | IOS XRV |
P3 | P Router | 3.3.3.3/32 | Gi1 10.3.4.3/24 Gi2 10.1.3.3/24 Gi3 10.2.3.3/24 Gi4 10.3.7.3/24 Gi5 10.3.8.3/24 | 24300-24399 | IOS XRV |
P4 | PE Router | 4.4.4.4/32 | Gi1 10.3.4.4/24 Gi2 10.2.4.4/24 Gi3 10.1.4.4/24 Gi4 10.4.8.4/24 Gi5 10.4.7.4/24 | 24400-24499 | IOS XRV |
PE5 | PE Router | 5.5.5.5/32 | Gi1 10.1.5.5/24 Gi2 10.2.5.5/24 | 500-599 | CSR1000V |
PE6 | PE Router | 6.6.6.6/32 | Gi1 10.1.6.6/24 Gi2 10.2.6.6/24 | 600-699 | CSR1000V |
PE7 | PE Router | 7.7.7.7/32 | GE0/3 10.3.7.7/24 GE0/4 10.4.7.7/24 | 700-799 | IOSv |
PE8 | PE Router | 8.8.8.8/32 | GE0/3 10.4.8.8/24 GE0/4 10.3.8.8/24 | 800-899 | IOSv |
Verification on Router P1:
RP/0/0/CPU0:P-1#sh ospf database
Sun Nov 3 17:04:51.970 UTC
OSPF Router with ID (1.1.1.1) (Process ID 1)
Router Link States (Area 0)
Link ID ADV Router Age Seq# Checksum Link count
1.1.1.1 1.1.1.1 1436 0x80000005 0x00563f 11
2.2.2.2 2.2.2.2 1438 0x8000000f 0x00b9bc 11
3.3.3.3 3.3.3.3 1438 0x8000000c 0x00b695 11
4.4.4.4 4.4.4.4 1438 0x80000005 0x0040fd 11
5.5.5.5 5.5.5.5 1438 0x80000008 0x00d77e 5
6.6.6.6 6.6.6.6 1440 0x8000000c 0x002719 5
7.7.7.7 7.7.7.7 1525 0x8000000a 0x00ac6b 5
8.8.8.8 8.8.8.8 1525 0x8000000a 0x000402 5
RP/0/0/CPU0:P-1#show mpls interfaces
Sun Nov 3 19:07:29.491 UTC
Interface LDP Tunnel Static Enabled
-------------------------- -------- -------- -------- --------
GigabitEthernet0/0/0/1 Yes No No Yes
GigabitEthernet0/0/0/2 Yes No No Yes
GigabitEthernet0/0/0/3 Yes No No Yes
GigabitEthernet0/0/0/4 Yes No No Yes
GigabitEthernet0/0/0/5 Yes No No Yes
RP/0/0/CPU0:P-1#show mpls ldp neighbor brief
Sun Nov 3 19:07:44.450 UTC
Peer GR NSR Up Time Discovery Addresses Labels
ipv4 ipv6 ipv4 ipv6 ipv4 ipv6
----------------- -- --- ---------- ---------- ---------- ------------
5.5.5.5:0 N N 01:43:44 1 0 3 0 22 0
6.6.6.6:0 N N 01:43:43 1 0 3 0 22 0
2.2.2.2:0 N N 01:43:28 1 0 6 0 22 0
4.4.4.4:0 N N 01:41:52 1 0 6 0 22 0
3.3.3.3:0 N N 01:40:00 1 0 6 0 22 0
RP/0/0/CPU0:P-1#show mpls forwarding
Sun Nov 3 19:08:04.768 UTC
Local Outgoing Prefix Outgoing Next Hop Bytes
Label Label or ID Interface Switched
------ ----------- ------------------ ------------ --------------- ------------
24100 Pop 5.5.5.5/32 Gi0/0/0/4 10.1.5.5 12586
24101 Pop 6.6.6.6/32 Gi0/0/0/5 10.1.6.6 12550
24102 Pop 2.2.2.2/32 Gi0/0/0/1 10.1.2.2 13135
24103 Pop 10.2.3.0/24 Gi0/0/0/1 10.1.2.2 0
Pop 10.2.3.0/24 Gi0/0/0/2 10.1.3.3 0
24104 Pop 10.2.5.0/24 Gi0/0/0/1 10.1.2.2 0
Pop 10.2.5.0/24 Gi0/0/0/4 10.1.5.5 0
24105 Pop 10.2.6.0/24 Gi0/0/0/1 10.1.2.2 0
Pop 10.2.6.0/24 Gi0/0/0/5 10.1.6.6 0
24106 Pop 3.3.3.3/32 Gi0/0/0/2 10.1.3.3 11230
24107 24300 7.7.7.7/32 Gi0/0/0/2 10.1.3.3 0
24400 7.7.7.7/32 Gi0/0/0/3 10.1.4.4 0
24108 24301 8.8.8.8/32 Gi0/0/0/2 10.1.3.3 0
24401 8.8.8.8/32 Gi0/0/0/3 10.1.4.4 0
24109 Pop 10.3.4.0/24 Gi0/0/0/2 10.1.3.3 0
Pop 10.3.4.0/24 Gi0/0/0/3 10.1.4.4 0
24110 Pop 10.3.7.0/24 Gi0/0/0/2 10.1.3.3 0
24111 Pop 10.3.8.0/24 Gi0/0/0/2 10.1.3.3 0
24112 Pop 10.4.7.0/24 Gi0/0/0/3 10.1.4.4 0
24113 Pop 10.4.8.0/24 Gi0/0/0/3 10.1.4.4 0
24114 Pop 4.4.4.4/32 Gi0/0/0/3 10.1.4.4 250118
24115 Pop 10.2.4.0/24 Gi0/0/0/1 10.1.2.2 0
Pop 10.2.4.0/24 Gi0/0/0/3 10.1.4.4 0
Router Configurations
The baseline topology is configured with MPLS, LDP, and all routers in OSPF area 0.
P Routers: (P1, P2, P3, P4)
The P routers are configured with the standard subnetting scheme from the table above in combination with OSPF area 0 and LDP as the labelling protocol. The Label range is based on the Router number. I start the label ranges after the MPLS-SR SRGB Block (16000-23999) at 24000 and up.
For the P routers I use the the lightweight IOS-XR (XRv) image which supports MPLS-SR.
(P1, P2, P3, P4)
#change the values where needed.
# ============= Interfaces
interface Loopback0
ipv4 address 1.1.1.1 255.255.255.255
!
interface GigabitEthernet0/0/0/1
ipv4 address 10.1.2.1 255.255.255.0
!
interface GigabitEthernet0/0/0/2
ipv4 address 10.1.3.1 255.255.255.0
!
interface GigabitEthernet0/0/0/3
ipv4 address 10.1.4.1 255.255.255.0
!
interface GigabitEthernet0/0/0/4
ipv4 address 10.1.5.1 255.255.255.0
!
interface GigabitEthernet0/0/0/5
ipv4 address 10.1.6.1 255.255.255.0
!
# ============= MPLS
# ============= MPLS Label range = 24000 + Router ID
mpls label range table 0 24100 24199
!
mpls ldp
router-id 1.1.1.1
address-family ipv4
!
interface GigabitEthernet0/0/0/1
!
interface GigabitEthernet0/0/0/2
!
interface GigabitEthernet0/0/0/3
!
interface GigabitEthernet0/0/0/4
!
interface GigabitEthernet0/0/0/5
!
# ============= OSPF
router ospf 1
address-family ipv4
area 0
interface Loopback0
!
interface GigabitEthernet0/0/0/0
network point-to-point
!
interface GigabitEthernet0/0/0/1
network point-to-point
!
interface GigabitEthernet0/0/0/2
network point-to-point
!
interface GigabitEthernet0/0/0/3
network point-to-point
!
interface GigabitEthernet0/0/0/4
network point-to-point
!
interface GigabitEthernet0/0/0/5
network point-to-point
!
!
!
PE Routers – Left side – (PE5, PE6)
The PE routers are configured with the standard subnetting scheme from the table above in combination with OSPF area 0 and LDP as the labelling protocol. The Label range is based on the Router number.
For these PE Routers I use the CSR1000v routers so I can configure MPLS-SR on IOS-XE.
(PE5, PE6)
# ============= MPLS
mpls label range 500 599
mpls label protocol ldp
mpls ldp router-id Loopback0 force
# ============= OSPF
!
router ospf 1
router-id 5.5.5.5
!
# ============= Interfaces
interface Loopback0
ip address 5.5.5.5 255.255.255.255
ip ospf 1 area 0
!
interface GigabitEthernet1
ip address 10.1.5.5 255.255.255.0
ip ospf network point-to-point
ip ospf 1 area 0
mpls ip
!
interface GigabitEthernet2
ip address 10.2.5.5 255.255.255.0
ip ospf network point-to-point
ip ospf 1 area 0
mpls ip
!
PE Routers – Right side – (PE7, PE8)
The PE routers are configured with the standard subnetting scheme from the table above in combination with OSPF area 0 and LDP as the labelling protocol. The Label range is based on the Router number.
For these PE routers I use the IOSv which is more lightweight but doesn’t support MPLS-SR. The goal of these routers are to manually map them from the MPLS-SR domain.
(PE7, PE8)
# ============= MPLS
mpls label range 700 799
mpls label protocol ldp
mpls ldp router-id Loopback0 force
# ============= OSPF
!
router ospf 1
router-id 5.5.5.5
!
# ============= Interfaces
interface Loopback0
ip address 7.7.7.7 255.255.255.255
ip ospf 1 area 0
!
interface GigabitEthernet0/3
ip address 10.3.7.7 255.255.255.0
ip ospf network point-to-point
ip ospf 1 area 0
duplex auto
speed auto
media-type rj45
mpls ip
!
interface GigabitEthernet0/4
ip address 10.4.7.7 255.255.255.0
ip ospf network point-to-point
ip ospf 1 area 0
duplex auto
speed auto
media-type rj45
mpls ip
Traceroute between PE routers (PE-5 -> PE-7)
When performing a traceroute between routers PE-5 and PE-7 we see the path via P-1 and P-3 being used and reflected in the standard LDP labels (24107, 24300, implicit-null).
PE-5#traceroute mpls ipv4 7.7.7.7/32 verbose
Tracing MPLS Label Switched Path to 7.7.7.7/32, timeout is 2 seconds
Codes: '!' - success, 'Q' - request not sent, '.' - timeout,
'L' - labeled output interface, 'B' - unlabeled output interface,
'D' - DS Map mismatch, 'F' - no FEC mapping, 'f' - FEC mismatch,
'M' - malformed request, 'm' - unsupported tlvs, 'N' - no label entry,
'P' - no rx intf label prot, 'p' - premature termination of LSP,
'R' - transit router, 'I' - unknown upstream index,
'l' - Label switched with FEC change, 'd' - see DDMAP for return code,
'X' - unknown return code, 'x' - return code 0
Type escape sequence to abort.
0 10.1.5.5 10.1.5.1 MRU 1500 [Labels: 24107 Exp: 0]
L 1 10.1.5.1 10.1.3.3 MRU 1500 [Labels: 24300 Exp: 0] 4 ms, ret code 8
L 2 10.1.3.3 10.3.7.7 MRU 1500 [Labels: implicit-null Exp: 0] 7 ms, ret code 8
! 3 10.3.7.7 13 ms, ret code 3
MPLS Segment Routing (MPLS-SR) Configuration
P router configuration MPLS-SR (IOS-XR)
First we start by enabling Segment Routing on all P routers. Within this SR configuration we map the prefix-SID to the loopback address with an index number. This index must be globally unique because all routers will apply this index as a numeric offset to the global SRGB value.
Default SRGB value (16000) + [index] = Label
This will result in the following labels for the P Routers;
- P-1, 1.1.1.1, 16001
- P-2, 2.2.2.2, 16002
- P-3, 3.3.3.3, 16003
- P-4, 4.4.4.4, 16004
# (P1, P2, P3, P4)
# P Routers - IOS-XR
RP/0/0/CPU0:P-1(config)#segment-routing ?
global-block Prefix-SID Global label Block (SRGB)
local-block Local Block (SRLB) of labels
mapping-server Segment Routing Mapping Server (SRMS)
traffic-eng Segment Routing Traffic Engineering
<cr>
segment-routing
# P1
router ospf 1
segment-routing mpls
address-family ipv4
area 0
interface Loopback0
prefix-sid index 1
!
#P2
router ospf 1
segment-routing mpls
address-family ipv4
area 0
interface Loopback0
prefix-sid index 2
!
---- omitted for brevity ------
# Identical configuration for P3 and P4 with index 3 and 4.
P router verification MPLS-SR (IOS-XR)
After enabling MPLS-SR there are new labels in the MPLS forwarding table. The 1600X SR prefix-SID labels and the new SR Adjacency-SIDs labels. When verifying the loopback address 2.2.2.2/32 of P2 it is marked as “labeled SR”.
RP/0/0/CPU0:P-1#show mpls forwarding
Local Outgoing Prefix Outgoing Next Hop Bytes
Label Label or ID Interface Switched
------ ----------- ------------------ ------------ --------------- ------------
16002 Pop SR Pfx (idx 2) Gi0/0/0/1 10.1.2.2 0
16003 Pop SR Pfx (idx 3) Gi0/0/0/2 10.1.3.3 0
16004 16004 SR Pfx (idx 4) Gi0/0/0/1 10.1.2.2 0
16004 SR Pfx (idx 4) Gi0/0/0/2 10.1.3.3 0
24100 Pop 5.5.5.5/32 Gi0/0/0/4 10.1.5.5 27188
---- omitted for brevity ------
24114 24214 4.4.4.4/32 Gi0/0/0/1 10.1.2.2 0
24311 4.4.4.4/32 Gi0/0/0/2 10.1.3.3 0
24115 Pop 10.2.4.0/24 Gi0/0/0/1 10.1.2.2 0
24116 Pop SR Adj (idx 0) Gi0/0/0/1 10.1.2.2 0
24117 Pop SR Adj (idx 0) Gi0/0/0/2 10.1.3.3 0
24118 Pop SR Adj (idx 0) Gi0/0/0/4 10.1.5.5 0
24119 Pop SR Adj (idx 0) Gi0/0/0/5 10.1.6.6 0
==========
RP/0/0/CPU0:P-1#show cef 2.2.2.2/32
2.2.2.2/32, version 71, labeled SR, internal 0x1000001 0x81 (ptr 0xa12dc284) [1], 0x0 (0xa12c15f0), 0xa20 (0xa1495230)
Updated Nov 3 21:04:01.241
local adjacency 10.1.2.2
Prefix Len 32, traffic index 0, precedence n/a, priority 3
Extensions: context-label:16002
via 10.1.2.2/32, GigabitEthernet0/0/0/1, 17 dependencies, weight 0, class 0 [flags 0x0]
path-idx 0 NHID 0x0 [0xa166e2dc 0xa166e504]
next hop 10.1.2.2/32
local adjacency
local label 24102 labels imposed {ImplNull}
==========
RP/0/0/CPU0:P-1#show ospf sid-database
SID Database for ospf 1 with ID 1.1.1.1
SID Prefix/Mask
-------- ------------------
1 1.1.1.1/32 (L)
2 2.2.2.2/32
3 3.3.3.3/32
4 4.4.4.4/32
RP/0/0/CPU0:P-1#show mpls label table detail
Table Label Owner State Rewrite
----- ------- ------------------------------- ------ -------
0 0 LSD(A) InUse Yes
0 1 LSD(A) InUse Yes
0 2 LSD(A) InUse Yes
0 13 LSD(A) InUse Yes
0 15000 LSD(A) InUse No
(Lbl-blk SRLB, vers:0, (start_label=15000, size=1000, app_notify=0)
0 16000 OSPF(A):ospf-1 InUse No
(Lbl-blk SRGB, vers:0, (start_label=16000, size=8000)
0 24116 OSPF(A):ospf-1 InUse Yes
(SR Adj Segment IPv4, vers:0, index=0, type=2, intf=Gi0/0/0/1, nh=10.1.2.2)
0 24117 OSPF(A):ospf-1 InUse Yes
(SR Adj Segment IPv4, vers:0, index=0, type=2, intf=Gi0/0/0/2, nh=10.1.3.3)
0 24118 OSPF(A):ospf-1 InUse Yes
(SR Adj Segment IPv4, vers:0, index=0, type=2, intf=Gi0/0/0/4, nh=10.1.5.5)
0 24119 OSPF(A):ospf-1 InUse Yes
(SR Adj Segment IPv4, vers:0, index=0, type=2, intf=Gi0/0/0/5, nh=10.1.6.6)
PE router configuration MPLS-SR (IOS-XE)
In this we see the differences between IOS-XR and IOS-XE. First we start by globally enabling Segment Routing on PE routers PE-5 and PE-6. Within this global SR configuration we map the prefix-SID to the loopback address with an index number. This index must be globally unique because all routers will apply this index as a numeric offset to the global SRGB value.
SRGB (16000) + [index] = Label
This will result in the following labels for the P Routers;
- PE-5, 5.5.5.5, 16005
- PE-6, 6.6.6.6, 16006
# (PE-5, PE-6)
# P Routers - IOS-XE
# PE-5
#============= Segment Routing
segment-routing mpls
connected-prefix-sid-map
address-family ipv4
5.5.5.5/32 index 5 range 1
exit-address-family
!
#============= OSPF
router ospf 1
segment-routing mpls
segment-routing prefix-sid-map advertise-local
!
# PE-6
#============= Segment Routing
segment-routing mpls
connected-prefix-sid-map
address-family ipv4
6.6.6.6/32 index 6 range 1
exit-address-family
!
#============= OSPF
router ospf 1
segment-routing mpls
segment-routing prefix-sid-map advertise-local
!
PE router verification MPLS-SR (IOS-XE)
After enabling MPLS-SR there are new labels in the MPLS forwarding table. The 1600X prefix-SID labels and the new SR Adjacency SIDs. There are also the the prefix-SIDs from the P routers.
PE-5#show mpls forwarding-table
Local Outgoing Prefix Bytes Label Outgoing Next Hop
Label Label or Tunnel Id Switched interface
500 24213 10.4.8.0/24 0 Gi2 10.2.5.2
501 24212 10.4.7.0/24 0 Gi2 10.2.5.2
---- omitted for brevity ------
24207 7.7.7.7/32 0 Gi2 10.2.5.2
519 Pop Label 10.2.5.2-A 0 Gi2 10.2.5.2 # Adjencedy SID to P1
520 Pop Label 10.1.5.1-A 0 Gi1 10.1.5.1 # Adjencedy SID to P2
16001 Pop Label 1.1.1.1/32 0 Gi1 10.1.5.1
16002 Pop Label 2.2.2.2/32 0 Gi2 10.2.5.2
16003 16003 3.3.3.3/32 0 Gi1 10.1.5.1
16003 3.3.3.3/32 0 Gi2 10.2.5.2
16004 16004 4.4.4.4/32 0 Gi2 10.2.5.2
16006 16006 6.6.6.6/32 0 Gi1 10.1.5.1
16006 6.6.6.6/32 0 Gi2 10.2.5.2
A - Adjacency SID
PE-5#show segment-routing mpls connected-prefix-sid-map ipv4
PREFIX_SID_CONN_MAP ALGO_0
Prefix/masklen SID Type Range Flags SRGB
5.5.5.5/32 5 Indx 1 Y
PREFIX_SID_PROTOCOL_ADV_MAP ALGO_0
Prefix/masklen SID Type Range Flags SRGB Source
1.1.1.1/32 1 Indx 1 Y OSPF Area 0 1.1.1.1
2.2.2.2/32 2 Indx 1 Y OSPF Area 0 2.2.2.2
3.3.3.3/32 3 Indx 1 Y OSPF Area 0 3.3.3.3
4.4.4.4/32 4 Indx 1 Y OSPF Area 0 4.4.4.4
5.5.5.5/32 5 Indx 1 Y OSPF Area 0 5.5.5.5
6.6.6.6/32 6 Indx 1 Y OSPF Area 0 6.6.6.6
MPLS-SR is now enabled on the six Routers P-1, P-2, P-3, P-4, PE-5, PE-6. However, all the routers in the topology still use and prefer LDP.
The traceroute from PE5 towards PE7 shows the same LDP labels (24107, 24300).
PE-5#traceroute mpls ipv4 7.7.7.7/32
Tracing MPLS Label Switched Path to 7.7.7.7/32, timeout is 2 seconds
Codes: '!' - success, 'Q' - request not sent, '.' - timeout,
'L' - labeled output interface, 'B' - unlabeled output interface,
'D' - DS Map mismatch, 'F' - no FEC mapping, 'f' - FEC mismatch,
'M' - malformed request, 'm' - unsupported tlvs, 'N' - no label entry,
'P' - no rx intf label prot, 'p' - premature termination of LSP,
'R' - transit router, 'I' - unknown upstream index,
'l' - Label switched with FEC change, 'd' - see DDMAP for return code,
'X' - unknown return code, 'x' - return code 0
Type escape sequence to abort.
0 10.1.5.5 MRU 1500 [Labels: 24107 Exp: 0]
L 1 10.1.5.1 MRU 1500 [Labels: 24300 Exp: 0] 7 ms
L 2 10.1.3.3 MRU 1500 [Labels: implicit-null Exp: 0] 9 ms
! 3 10.3.7.7 18 ms
Static prefix-sid-map towards PE7 and PE8
PE Routers PE-7 and PE-8 are running IOSv which does not support MPLS-SR. In order to create SR labels for these prefixes we can configure a mapping server. This will create a manual prefix-to-sid mapping which we can advertise in our SR domain via our IGP. After we advertise the local map we will see the new SR Labels in the forwarding table.
In this example we will use Router P1 (IOS-XR) as the mapping server.
IOSv Prefixes and Index
- PE-7, 7.7.7.7, 16007
- PE-8, 8.8.8.8, 16008
# (P1)
segment-routing
mapping-server
prefix-sid-map
address-family ipv4
7.7.7.7/32 7 range 1
8.8.8.8/32 8 range 1
!
!
!
!
router ospf 1
segment-routing prefix-sid-map advertise-local
!
#
#====== BEFORE-MAPPING =============
#== Old LDP Labels are visible
#
RP/0/0/CPU0:P-4#show mpls forwarding prefix 7.7.7.7/32
Mon Nov 4 08:01:13.692 UTC
Local Outgoing Prefix Outgoing Next Hop Bytes
Label Label or ID Interface Switched
------ ----------- ------------------ ------------ --------------- ------------
24400 Pop 7.7.7.7/32 Gi0/0/0/5 10.4.7.7 0
PE-5#sh ip cef 7.7.7.7/32
7.7.7.7/32
nexthop 10.1.5.1 GigabitEthernet1 label 24107-(local:518)
nexthop 10.2.5.2 GigabitEthernet2 label 24207-(local:518)
#
#====== AFTER-MAPPING ==============
#== New SR Labels are visible
#
RP/0/0/CPU0:P-4#show mpls forwarding prefix 7.7.7.7/32
Mon Nov 4 08:04:19.629 UTC
Local Outgoing Prefix Outgoing Next Hop Bytes
Label Label or ID Interface Switched
------ ----------- ------------------ ------------ --------------- ------------
16007 Pop SR Pfx (idx 7) Gi0/0/0/5 10.4.7.7 0
PE-5#sh ip cef 7.7.7.7/32
7.7.7.7/32
nexthop 10.1.5.1 GigabitEthernet1 label 16007-(local:16007)
nexthop 10.2.5.2 GigabitEthernet2 label 16007-(local:16007)
Migrating from MPLS-LDP to MPLS-SR
Preferring MPLS-SR over MPLS-LDP
Now that there are both MPLS-LDP and MPLS-SR labels in the MPLS forwarding table, we can configure the routers to prefer the SR labels over the LDP labels. In IOS-XR this is done under the IGP process, in IOS-XE this is done under the global Segment-Routing configuration.
P Routers (P1, P2, P3, P4)
(IOS-XR)
router ospf 1
segment-routing sr-prefer
PE Routers (PE5, PE6)
(IOS-XE)
segment-routing mpls
set-attributes
address-family ipv4
sr-label-preferred
exit-address-family
!
Disabling MPLS-LDP on IOS-XE (PE5,PE6)
With MPLS-SR configured and preferred we can disable LDP on the Routers that don’t require it anymore. This can be done either on specific interfaces or in the global LDP configuration. We start with the IOS-XE routers PE-5 and PE-6.
# PE ROUTERS
# PE-5, PE6
PE-5#show mpls interfaces
Interface IP Tunnel BGP Static Operational
GigabitEthernet1 Yes (ldp) No No No Yes
GigabitEthernet2 Yes (ldp) No No No Yes
Enter configuration commands, one per line. End with CNTL/Z.
PE-5(config)#int range gi1-2
PE-5(config-if)#no mpls ip
PE-5#show mpls interfaces
Interface IP Tunnel BGP Static Operational
GigabitEthernet1 No No No No Yes
GigabitEthernet2 No No No No Yes
Disabling MPLS-LDP on IOS-XR (P1, P2)
Next, globally disabling LDP on the P Routers P1 and P2.
# P ROUTERS
# P1, P2
P1 (interface)
no mpls ldp interface GigabitEthernet0/0/0/1
P1 (global)
no mpls ldp
RP/0/0/CPU0:P-1#show mpls interfaces
Mon Nov 4 11:27:44.852 UTC
Interface LDP Tunnel Static Enabled
-------------------------- -------- -------- -------- --------
GigabitEthernet0/0/0/1 No No No Yes
GigabitEthernet0/0/0/2 No No No Yes
GigabitEthernet0/0/0/3 No No No Yes
GigabitEthernet0/0/0/4 No No No Yes
GigabitEthernet0/0/0/5 No No No Yes
Disabling MPLS-LDP on IOS-XR (P3, P4)
Routers P3 and P4 are the bridges between the MPLS-SR and MPLS-LDP domains. On these routers it is not possible to disable MPLS-LDP globally because they will not be able to translate the SR to LDP Labels. We only disable LDP on the interfaces in the SR domain, and keep LDP on the interfaces towards the IOSv routers.
# P ROUTERS
# P3, P4
P-3 (interface)
no mpls ldp interface GigabitEthernet0/0/0/1
no mpls ldp interface GigabitEthernet0/0/0/2
no mpls ldp interface GigabitEthernet0/0/0/3
RP/0/0/CPU0:P-3#show mpls interfaces
Mon Nov 4 11:40:15.252 UTC
Interface LDP Tunnel Static Enabled
-------------------------- -------- -------- -------- --------
GigabitEthernet0/0/0/1 No No No Yes
GigabitEthernet0/0/0/2 No No No Yes
GigabitEthernet0/0/0/3 No No No Yes
GigabitEthernet0/0/0/4 Yes No No Yes
GigabitEthernet0/0/0/5 Yes No No Yes
After removing LDP we only have the SR labels in our forwarding tables:
RP/0/0/CPU0:P-1#show mpls forwarding
Mon Nov 4 11:26:14.528 UTC
Local Outgoing Prefix Outgoing Next Hop Bytes
Label Label or ID Interface Switched
------ ----------- ------------------ ------------ --------------- ------------
16002 Pop SR Pfx (idx 2) Gi0/0/0/1 10.1.2.2 85901
16003 Pop SR Pfx (idx 3) Gi0/0/0/2 10.1.3.3 86039
16004 16004 SR Pfx (idx 4) Gi0/0/0/1 10.1.2.2 0
16004 SR Pfx (idx 4) Gi0/0/0/2 10.1.3.3 0
16005 Pop SR Pfx (idx 5) Gi0/0/0/4 10.1.5.5 72192
16006 Pop SR Pfx (idx 6) Gi0/0/0/5 10.1.6.6 87633
16007 16007 SR Pfx (idx 7) Gi0/0/0/2 10.1.3.3 528
16008 16008 SR Pfx (idx 8) Gi0/0/0/2 10.1.3.3 0
16009 16009 SR Pfx (idx 9) Gi0/0/0/2 10.1.3.3 183676
24116 Pop SR Adj (idx 0) Gi0/0/0/1 10.1.2.2 0
24117 Pop SR Adj (idx 0) Gi0/0/0/2 10.1.3.3 0
24118 Pop SR Adj (idx 0) Gi0/0/0/4 10.1.5.5 0
24119 Pop SR Adj (idx 0) Gi0/0/0/5 10.1.6.6 0
Traceroute (PE-5 -> PE-7) from MPLS-SR to MPLS-LDP
When performing a traceroute between routers PE-5 and PE-7 we see the path via P-1 and P-3 being used and reflected in the SR Label.
PE-5#traceroute mpls ipv4 7.7.7.7/32
Tracing MPLS Label Switched Path to 7.7.7.7/32, timeout is 2 seconds
Codes: '!' - success, 'Q' - request not sent, '.' - timeout,
'L' - labeled output interface, 'B' - unlabeled output interface,
'D' - DS Map mismatch, 'F' - no FEC mapping, 'f' - FEC mismatch,
'M' - malformed request, 'm' - unsupported tlvs, 'N' - no label entry,
'P' - no rx intf label prot, 'p' - premature termination of LSP,
'R' - transit router, 'I' - unknown upstream index,
'l' - Label switched with FEC change, 'd' - see DDMAP for return code,
'X' - unknown return code, 'x' - return code 0
Type escape sequence to abort.
0 10.1.5.5 MRU 1500 [Labels: 16007 Exp: 0]
L 1 10.1.5.1 MRU 1500 [Labels: 16007 Exp: 0] 4 ms
L 2 10.1.3.3 MRU 1500 [Labels: implicit-null Exp: 0] 8 ms
! 3 10.3.7.7 16 ms
Traceroute (PE-8 -> PE-6) from MPLS-LDP to MPLS-SR
When performing a traceroute between routers PE-8 and PE-6 we see the path via P-4 and P-2 being used and reflected in the SR Label.
The path starts with LDP Label 24409 then being translated to 16006, the Segment Routing Label.
PE-8#traceroute mpls ipv4 6.6.6.6/32
Tracing MPLS Label Switched Path to 6.6.6.6/32, timeout is 2 seconds
Codes: '!' - success, 'Q' - request not sent, '.' - timeout,
'L' - labeled output interface, 'B' - unlabeled output interface,
'D' - DS Map mismatch, 'F' - no FEC mapping, 'f' - FEC mismatch,
'M' - malformed request, 'm' - unsupported tlvs, 'N' - no label entry,
'P' - no rx intf label prot, 'p' - premature termination of LSP,
'R' - transit router, 'I' - unknown upstream index,
'X' - unknown return code, 'x' - return code 0
Type escape sequence to abort.
0 10.4.8.8 MRU 1500 [Labels: 24409 Exp: 0]
L 1 10.4.8.4 MRU 1500 [Labels: 16006 Exp: 0] 2 ms
L 2 10.2.4.2 MRU 1500 [Labels: implicit-null Exp: 0] 8 ms
! 3 10.2.6.6 11 ms