Vinit's Tech Blog

Life has meaning as long as you keep learning.

LDP to Segment Routing Migration

Over the last couple of years, we have been hearing a lot about SDN and how networks will be smart enough to route the application traffic based on application requirements. Well, this is no more just a discussion in the network community. Segment Routing, which is a source based forwarding paradigm, allows the SDN controller to define the forwarding path for the application based on their requirements. Before jumping on to migration to Segment Routing, lets first understand what challenges do we currently face with MPLS? What is Segment Routing doing differently than MPLS and how?

Till recent years, Service Provider networks have been running MPLS in both core and provider edge devices and providing multiple services to their customers on dual stacks without having to make changes in the core network. But the current infrastructure isn't capable to provide traffic-engineering based on the application requirements. Today, companies are creating highly complex applications which have specific network requirements such as high bandwidth, low latency, throughput, etc. MPLS along with traffic-engineering isn't really capable to dynamically calculating paths based on these requirements. This is where Segment Routing comes into play. Segment Routing or SR as we call it, is the routing protocol for SDN which allows for dynamic paths which can be pushed down to the head-end node by the controller. The instructions on how the traffic will be steered across the network is pushed down at the head-end node itself and thus the name Source Routing. In this blog post, we shall see how to configure SR and migrate from LDP enabled network to SR enabled network without disrupting any services.

For understanding the LDP to SR migration, examine a simple topology as shown below. In this topology, all routers are configured with IS-IS and LDP. 

Before moving on to configuring SR, lets look at the routing table on XR-R1 and XE-R2.

XR-R1
RP/0/0/CPU0:XR-R1#show ip route isis
Thu Jul 18 23:06:35.445 UTC
i L2 2.2.2.2/32 [115/10] via 10.1.2.2, 00:19:16, GigabitEthernet0/0/0/0
i L2 3.3.3.3/32 [115/10] via 10.1.3.3, 00:13:58, GigabitEthernet0/0/0/1
i L2 4.4.4.4/32 [115/20] via 10.1.3.3, 00:10:20, GigabitEthernet0/0/0/1
[115/20] via 10.1.2.2, 00:10:20, GigabitEthernet0/0/0/0
i L2 10.2.4.0/24 [115/20] via 10.1.2.2, 00:18:30, GigabitEthernet0/0/0/0
i L2 10.3.4.0/24 [115/20] via 10.1.3.3, 00:13:58, GigabitEthernet0/0/0/1
RP/0/0/CPU0:XR-R1#show mpls forwarding
Thu Jul 18 23:07:04.083 UTC
Local Outgoing Prefix Outgoing Next Hop Bytes
Label Label or ID Interface Switched
------ ----------- ------------------ ------------ --------------- ------------
24000 Pop 2.2.2.2/32 Gi0/0/0/0 10.1.2.2 2165
24001 Pop 10.2.4.0/24 Gi0/0/0/0 10.1.2.2 0
24002 Pop 3.3.3.3/32 Gi0/0/0/1 10.1.3.3 1686
24003 Pop 10.3.4.0/24 Gi0/0/0/1 10.1.3.3 0
24004 20 4.4.4.4/32 Gi0/0/0/0 10.1.2.2 0
20 4.4.4.4/32 Gi0/0/0/1 10.1.3.3 50440
XE-R2
XE-R2#show ip route isis
1.0.0.0/32 is subnetted, 1 subnets
i L2 1.1.1.1 [115/10] via 10.1.2.1, 00:18:02, GigabitEthernet1
3.0.0.0/32 is subnetted, 1 subnets
i L2 3.3.3.3 [115/20] via 10.2.4.4, 00:11:07, GigabitEthernet2
[115/20] via 10.1.2.1, 00:11:07, GigabitEthernet1
4.0.0.0/32 is subnetted, 1 subnets
i L2 4.4.4.4 [115/10] via 10.2.4.4, 00:11:15, GigabitEthernet2
10.0.0.0/8 is variably subnetted, 6 subnets, 2 masks
i L2 10.1.3.0/24 [115/20] via 10.1.2.1, 00:18:02, GigabitEthernet1
i L2 10.3.4.0/24 [115/20] via 10.2.4.4, 00:11:15, GigabitEthernet2
XE-R2#show mpls forwarding-table
Local Outgoing Prefix Bytes Label Outgoing Next Hop
Label Label or Tunnel Id Switched interface
16 Pop Label 10.1.3.0/24 0 Gi1 10.1.2.1
17 Pop Label 1.1.1.1/32 570 Gi1 10.1.2.1
18 24002 3.3.3.3/32 0 Gi1 10.1.2.1
24000 3.3.3.3/32 0 Gi2 10.2.4.4
19 Pop Label 10.3.4.0/24 0 Gi2 10.2.4.4
20 Pop Label 4.4.4.4/32 0 Gi2 10.2.4.4

LDP to SR Migration

The LDP to SR migration can be performed in few simple steps:

  • All nodes are upgrade to SR capable code (if they are already not capable)
  • Configure all nodes with SR (In no particular order)
    • Keep default label imposition preference : LDP
  • All PE routers are configured to prefer SR label imposition (In no particular order)
  • All nodes are configured to prefer SR label imposition
  • LDP is removed from the nodes

 Enabling SR on all Nodes

IOS-XR
router isis SR
address-family ipv4 unicast
segment-routing mpls
!
 interface Loopback0
   address-family ipv4 unicast
    prefix-sid absolute 16001
   !
 !
!
segment-routing
XE
segment-routing mpls
!
  connected-prefix-sid-map
    address-family ipv4
     2.2.2.2/32 absolute 16002 range 1
    exit-address-family
!
router isis SR
  net 49.0000.0000.0000.0002.00
  is-type level-2-only
  metric-style wide
  segment-routing mpls
  passive-interface Loopback0

With the above configuration, we are just enabling SR but not forcing SR label imposition on the packets. The forwarding on all nodes will still take place using the LDP assigned labels.

XR-R1
RP/0/0/CPU0:XR-R1#show mpls forwarding
Fri Jul 19 13:06:29.193 UTC
Local Outgoing Prefix Outgoing Next Hop Bytes
Label Label or ID Interface Switched
------ ----------- ------------------ ------------ --------------- ------------
16002 Pop SR Pfx (idx 2) Gi0/0/0/0 10.1.2.2 0
16003 Pop SR Pfx (idx 3) Gi0/0/0/1 10.1.3.3 0
16004 16004 SR Pfx (idx 4) Gi0/0/0/0 10.1.2.2 0
16004 SR Pfx (idx 4) Gi0/0/0/1 10.1.3.3 0
24000 Pop 2.2.2.2/32 Gi0/0/0/0 10.1.2.2 96147
24001 Pop 10.2.4.0/24 Gi0/0/0/0 10.1.2.2 0
24002 Pop 3.3.3.3/32 Gi0/0/0/1 10.1.3.3 95544
24003 Pop 10.3.4.0/24 Gi0/0/0/1 10.1.3.3 0
24004 20 4.4.4.4/32 Gi0/0/0/0 10.1.2.2 0
20 4.4.4.4/32 Gi0/0/0/1 10.1.3.3 520
24005 Pop SR Adj (idx 1) Gi0/0/0/0 10.1.2.2 0
24006 Pop SR Adj (idx 3) Gi0/0/0/0 10.1.2.2 0
24007 Pop SR Adj (idx 1) Gi0/0/0/1 10.1.3.3 0
24008 Pop SR Adj (idx 3) Gi0/0/0/1 10.1.3.3 0
RP/0/0/CPU0:XR-R1#show cef 4.4.4.4/32
Fri Jul 19 13:50:30.462 UTC
4.4.4.4/32, version 24, internal 0x1000001 0x1 (ptr 0xa1419df4) [1], 0x0 (0xa13e565c), 0xa28 (0xa17840a8)
Updated Jul 19 12:49:16.544
local adjacency 10.1.2.2
Prefix Len 32, traffic index 0, precedence n/a, priority 3
via 10.1.2.2/32, GigabitEthernet0/0/0/0, 11 dependencies, weight 0, class 0 [flags 0x0]
path-idx 0 NHID 0x0 [0xa10f31fc 0x0]
next hop 10.1.2.2/32
local adjacency
local label 24004 labels imposed {20}
via 10.1.3.3/32, GigabitEthernet0/0/0/1, 11 dependencies, weight 0, class 0 [flags 0x0]
path-idx 1 NHID 0x0 [0xa10f32f8 0x0]
next hop 10.1.3.3/32
local adjacency
local label 24004 labels imposed {20}

XE-R2
XE-R2#show mpls forwarding-table 3.3.3.3
Local Outgoing Prefix Bytes Label Outgoing Next Hop
Label Label or Tunnel Id Switched interface
18 24002 3.3.3.3/32 0 Gi1 10.1.2.1
24000 3.3.3.3/32 0 Gi2 10.2.4.4
16003 16003 3.3.3.3/32 0 Gi1 10.1.2.1
16003 3.3.3.3/32 0 Gi2 10.2.4.4
XE-R2#show ip cef 3.3.3.3/32 detail
3.3.3.3/32, epoch 2, per-destination sharing
dflt local label info: global/18 [0x3]
sr local label info: global/16003 [0x1B]
nexthop 10.1.2.1 GigabitEthernet1 label 24002-(local:18)
nexthop 10.2.4.4 GigabitEthernet2 label 24000-(local:18)

Now, the next step is to prefer SR over LDP. This can be done using the command sr-prefer. The below example illustrates how to configure sr-prefer on both IOS-XR and IOS-XE.

XR-R1
RP/0/0/CPU0:XR-R1#conf t
Fri Jul 19 13:53:01.982 UTC
RP/0/0/CPU0:XR-R1(config)#router isis SR
RP/0/0/CPU0:XR-R1(config-isis)#address-family ipv4 unicast
RP/0/0/CPU0:XR-R1(config-isis-af)#segment-routing mpls sr-prefer
RP/0/0/CPU0:XR-R1(config-isis-af)#commit
XE-R2
XE-R2#conf t
XE-R2(config)#segment-routing mpls
XE-R2(config-srmpls)#set-attributes
XE-R2(config-srmpls-attr)#address-family ipv4
XE-R2(config-srmpls-attr-af)#sr-label-preferred

Once sr-prefer is configured, SR label imposition will be preferred and the CEF will be reprogrammed to use SR labels for performing forwarding decisions.

XR-R1
RP/0/0/CPU0:XR-R1#show cef 4.4.4.4/32
Fri Jul 19 13:56:23.758 UTC
4.4.4.4/32, version 34, internal 0x1000001 0x83 (ptr 0xa1419df4) [1], 0x0 (0xa13e580c), 0xa28 (0xa1784050)
Updated May 21 15:42:08.569
local adjacency 10.1.2.2
Prefix Len 32, traffic index 0, precedence n/a, priority 1
via 10.1.2.2/32, GigabitEthernet0/0/0/0, 11 dependencies, weight 0, class 0 [flags 0x0]
path-idx 0 NHID 0x0 [0xa10f31fc 0x0]
next hop 10.1.2.2/32
local adjacency
local label 16004 labels imposed {16004}
via 10.1.3.3/32, GigabitEthernet0/0/0/1, 11 dependencies, weight 0, class 0 [flags 0x0]
path-idx 1 NHID 0x0 [0xa10f32f8 0x0]
next hop 10.1.3.3/32
local adjacency
local label 16004 labels imposed {16004}
XE-R2
XE-R2#show ip cef 3.3.3.3/32 detail
3.3.3.3/32, epoch 2, per-destination sharing
dflt local label info: global/18 [0x3]
sr local label info: global/16003 [0x1B]
nexthop 10.1.2.1 GigabitEthernet1 label 16003-(local:16003)
nexthop 10.2.4.4 GigabitEthernet2 label 16003-(local:16003

Once SR labels are preferred, LDP can be removed from the device. This procedure will help perform easy migration from LDP to SR.

Hope this post was useful.

Comments are closed