to start LDP and SR Interworking, remember, in the previous video we have seen that in MPLS network, there are many control plane options including LDP, RSVP-TE and segment routing.

LDP to Segment Routing Migration

Where it happens that we use multiple control plane protocols on an MPLS network? One of its uses is the LDP to SR migration process that I discussed in the previous section. During the migration process from LDP to SR, it happens that both LDP and SR are active in all routers in the network within a certain period of time.

In this video we will discuss the interworking between LDP and SR. By interworking, I mean that some routers support both LDP and SR, but others may only support LDP or SR. Interworking is how LDP and SR work together to route traffic from source to destination.

In order to understand LDP and SR interworking, I have already prepared a topology to show you in a few steps how interworking works.

LDP and SR Interworking Topology

In this topology, routers xv1 and xrv6 are our edge routers. The addresses of the loopback interfaces range from 1.1.1.1 to 6.6.6.6 according to the router numbers. The subnet of the links between routers also depends on the router number. For example, 10.1.2.x is selected for the subnet between routers xrv1 and xrv2. The last digit of the IP address is also the router number.

Step0: LDP and SR in all routers

In step0 it is supposed that LDP and segment routing are enabled in all routers.

LDP is enabled with two commands “mpls ldp” in global mode and “mpls ldp auto-config” in OSPF or ISIS context mode.

The segment routing is activated with two commands in the OSPF context mode, “segment-routing mpls” and “segment-routing forwarding mpls” and also the configuration of a prefix-SID for the loopback interface.

In xrv1, segment routing is preferred with command “segment-routing sr-prefer” in OSPF context mode. That means , we prefer our traffic be forwarded with segment routing labels.

mpls ldp
!
router ospf 1
 router-id 1.1.1.1
 segment-routing mpls
 segment-routing forwarding mpls
 mpls ldp auto-config
 segment-routing sr-prefer
 address-family ipv4 unicast
 area 0
  interface Loopback0
   network point-to-point
   passive enable
   prefix-sid index 1
  !
  interface GigabitEthernet0/0/0/0
   network point-to-point

If we trace from xrv1 to xrv6, it is expected that traffic will be forwarded with SR label over the entire path as it is preferred in edge router.

Let’s trace the traffic from xrv1 to xrv6.

RP/0/RP0/CPU0:xrv1#traceroute 6.6.6.6
Thu Jul  1 22:02:37.376 UTC

Type escape sequence to abort.
Tracing the route to 6.6.6.6

 1  10.1.2.2 [MPLS: Label 16006 Exp 0] 72 msec  50 msec  64 msec 
 2  10.2.4.4 [MPLS: Label 16006 Exp 0] 67 msec  69 msec  57 msec 
 3  10.4.5.5 [MPLS: Label 16006 Exp 0] 49 msec  76 msec  47 msec 
 4  10.5.6.6 69 msec  *  75 msec 

As you can see, the traffic is forwarded with label 16006 which is segment routing label.

Step1: disable SR in xrv4

In step 1 we disable the segment routing in xrv4.

If we trace from xrv1 to xrv6, we expect the traffic in xrv1 be forwarded still with segment routing label. But in xrv2, the router cannot forward the traffic with the outgoing SR label because xrv4 does not support segment routing, instead router xrv2 swap the incoming SR label with the outgoing LDP label. The LDP label that router xrv4 assigns for destination 6.6.6.6.

To swap the label from SR to LDP, we don’t have to configure anything and it is done automatically.

Incoming traffic in xrv4 with LDP label is forwarded still with LDP label. although xrv5 and xrv6 support SR, but traffic will stay with labels in the same control plane protocol as much as possible. Since xrv5 and xrv6 both support LDP as well, and incoming traffic in xrv4 is LDP, the traffic stays in LDP.

The traffic is forwarded from xrv1 with SR label. it is preferred to stay in SR label during the path, but in router xrv2, it has to change the label from SR to LDP, because router xrv4 does not support SR. Incoming traffic with LDP label in xrv4, remains in LDP until the end of the path, since all routers in the path support the LDP protocol.

Before going to Step2, let’s disable segment routing in xrv4 and trace the traffic from xrv1 to xrv6.

!!! xrv4
router ospf 1
 no segment-routing
 no segment-routing mpls
 no segment-routing forwarding mpls

 area 0
  interface Loopback0

   no prefix-sid
RP/0/RP0/CPU0:xrv1#traceroute 6.6.6.6
Thu Jul  1 22:03:34.166 UTC

Type escape sequence to abort.
Tracing the route to 6.6.6.6

 1  10.1.2.2 [MPLS: Label 16006 Exp 0] 57 msec  78 msec  65 msec 
 2  10.2.4.4 [MPLS: Label 24007 Exp 0] 55 msec  75 msec  48 msec 
 3  10.4.5.5 [MPLS: Label 24004 Exp 0] 61 msec  47 msec  61 msec 
 4  10.5.6.6 48 msec  *  61 msec 

As you can see, the label is swapped from SR to LDP in xrv2. To make sure, we check it with “show mpls ldp binding”

 

RP/0/RP0/CPU0:xrv2# show mpls ldp bindings 
Thu Jul  1 21:35:44.546 UTC

....
6.6.6.6/32, rev 26
        Local binding: label: 24012
        Remote bindings: (2 peers)
            Peer                Label    
            -----------------   ---------
            1.1.1.1:0           24008   
            4.4.4.4:0           24007   

....
RP/0/RP0/CPU0:xrv4#show mpls ldp bindings 
Thu Jul  1 22:04:05.415 UTC

...
6.6.6.6/32, rev 25
        Local binding: label: 24007
        Remote bindings: (2 peers)
            Peer                Label    
            -----------------   ---------
            2.2.2.2:0           24012   
            5.5.5.5:0           24004   
...

also with “show mpls forwading table”, you make sure that the swapping from SR to LDP label is done automatically and without any configuration.

RP/0/RP0/CPU0:xrv2#show mpls forwarding 
Thu Jul  1 21:35:35.135 UTC
Local  Outgoing    Prefix             Outgoing     Next Hop        Bytes       
Label  Label       or ID              Interface                    Switched    
------ ----------- ------------------ ------------ --------------- ------------
16001  Pop         SR Pfx (idx 1)     Gi0/0/0/0    10.1.2.1        0           
16005  24008       SR Pfx (idx 5)     Gi0/0/0/2    10.2.4.4        0           
16006  24007       SR Pfx (idx 6)     Gi0/0/0/2    10.2.4.4        882         
24000  Pop         SR Adj (idx 0)     Gi0/0/0/0    10.1.2.1        0           
24001  Pop         SR Adj (idx 0)     Gi0/0/0/2    10.2.4.4        0           
24008  Pop         1.1.1.1/32         Gi0/0/0/0    10.1.2.1        510386      
24010  Pop         4.4.4.4/32         Gi0/0/0/2    10.2.4.4        98          
24011  24008       5.5.5.5/32         Gi0/0/0/2    10.2.4.4        0           
24012  24007       6.6.6.6/32         Gi0/0/0/2    10.2.4.4        0           
24016  Pop         10.4.5.0/24        Gi0/0/0/2    10.2.4.4        0           
24018  24009       10.5.6.0/24        Gi0/0/0/2    10.2.4.4        0           

to summarize this section, in a segment routing network, if some routers between the path and not at the of the path, don’t support SR, traffic will be automatically switched from SR to LDP and you don’t need any extra configuration.

Step2: enable SR in xrv4. Disable SR in xrv5 and xrv6

In Step2, we will re-enable SR in xrv4 and disable SR in xrv5 and xrv6. In other words, this time we will disable SR at the end of the path.

If we trace the traffic from xrv1 to xrv6, although SR has higher priority in xrv1, but the traffic cannot be forwarded with SR label. Because the destination does not support SR and there is no SR label or prefix-SID for the destination. So the traffic  is forwarded with the LDP label over the entire path.

RP/0/RP0/CPU0:xrv1#traceroute 6.6.6.6
Thu Jul  1 22:07:24.550 UTC

Type escape sequence to abort.
Tracing the route to 6.6.6.6

 1  10.1.2.2 [MPLS: Label 24012 Exp 0] 82 msec  62 msec  65 msec 
 2  10.2.4.4 [MPLS: Label 24007 Exp 0] 47 msec  61 msec  53 msec 
 3  10.4.5.5 [MPLS: Label 24004 Exp 0] 67 msec  72 msec  66 msec 
 4  10.5.6.6 66 msec  *  48 msec 

So as you see, when the destination of the traffic does not support SR, the traffic cannot be forwarded with SR label. To resolve this problem, we can use Mapping Server which is the next step.

Step3: enable SR Mapping Server in xrv4

Mapping Server is a router at the control plane that assigns prefix-SID to the routers on behalf of the routers themself and then advertises them via OSPF or ISIS. Mapping Server does not have to be in the path of the data plane, but here we enable it in xrv4, which is in the path.

learn details of LDP and SR interworking

Segment Routing Mapping Server

When routers receive the labels announced by the mapping server, they replace these labels by default with the labels that were manually configured in the routers. However, this behavior can be overridden.

With these commands, we enable Mapping Server in xrv4 and advertise it through OSPF.

!!! xrv4
segment-routing
 mapping-server
  prefix-sid-map
   address-family ipv4
    1.1.1.1/32 1
    2.2.2.2/32 2
    3.3.3.3/32 3
    4.4.4.4/32 4
    5.5.5.5/32 5
    6.6.6.6/32 6
 
router ospf 1
 segment-routing prefix-sid-map advertise-local

With “segment-routing prefix-sid-map receive disable” you can disable default behaviour of routers which replace manually configured labels with mapping server labels.

RP/0/RP0/CPU0:xrv4(config-ospf)# segment-routing prefix-sid-map receive ?
  disable  Disable the usage of remote mapping server advertisements

With “show ospf database opaque-area 6.6.6.6/32”, you can ensure that labels assigned by the mapping server are advertised via OSPF.

RP/0/RP0/CPU0:xrv1#show ospf database opaque-area 6.6.6.6/32
Fri Jul  2 11:23:10.190 UTC


            OSPF Router with ID (1.1.1.1) (Process ID 1)

                Type-10 Opaque Link Area Link States (Area 0)

  LS age: 1386
  Options: (No TOS-capability, DC)
  LS Type: Opaque Area Link
  Link State ID: 7.0.0.8
  Opaque Type: 7
  Opaque ID: 8
  Advertising Router: 4.4.4.4
  LS Seq Number: 80000018
  Checksum: 0x62c7
  Length: 48

    Extended Prefix Range TLV: Length: 24
      AF        : 0
      Prefix    : 6.6.6.6/32
      Range Size: 1
      Flags     : 0x0

      SID sub-TLV: Length: 8
        Flags     : 0x60
        MTID      : 0
        Algo      : 0
        SID Index : 6

then you can trace the traffic from xrv1 to make sure the traffic is now routed with SR label in xrv1.

RP/0/RP0/CPU0:xrv1#traceroute 6.6.6.6
Thu Jul  1 22:08:46.612 UTC

Type escape sequence to abort.
Tracing the route to 6.6.6.6

 1  10.1.2.2 [MPLS: Label 16006 Exp 0] 75 msec  57 msec  68 msec 
 2  10.2.4.4 [MPLS: Label 16006 Exp 0] 65 msec  63 msec  53 msec 
 3  10.4.5.5 [MPLS: Label 24004 Exp 0] 56 msec  44 msec  47 msec 
 4  10.5.6.6 60 msec  *  60 msec 

Traffic with SR label is forwarded up to router xrv4. But xrv4 can not forward the traffic with SR label since xrv5 und xrv6 don’t support segment routing. So in xrv4, incoming SR label is swapped with outgoing LDP label. To this happen, we don’t need any configuration and it is done automatically.

To make sure that outgoing label in xrv4 is LDP label which xrv5 assign for 6.6.6.6, you can check “show mpls ldp binding” in router xrv4 or xrv5.

RP/0/RP0/CPU0:xrv4#show mpls forwarding           
Fri Jul  2 14:39:26.640 UTC
Local  Outgoing    Prefix             Outgoing     Next Hop        Bytes       
Label  Label       or ID              Interface                    Switched    
------ ----------- ------------------ ------------ --------------- ------------
16001  16001       SR Pfx (idx 1)     Gi0/0/0/0    10.2.4.2        0           
16002  Pop         SR Pfx (idx 2)     Gi0/0/0/0    10.2.4.2        0           
16005  Pop         SR Pfx (idx 5)     Gi0/0/0/1    10.4.5.5        0           
16006  24004       SR Pfx (idx 6)     Gi0/0/0/1    10.4.5.5        1260        
24000  Pop         SR Adj (idx 0)     Gi0/0/0/0    10.2.4.2        0           
24001  Pop         SR Adj (idx 0)     Gi0/0/0/1    10.4.5.5        0           
24004  24008       1.1.1.1/32         Gi0/0/0/0    10.2.4.2        0           
24005  Pop         2.2.2.2/32         Gi0/0/0/0    10.2.4.2        111934      
24006  Pop         10.1.2.0/24        Gi0/0/0/0    10.2.4.2        39192       
24007  24004       6.6.6.6/32         Gi0/0/0/1    10.4.5.5        0           
24008  Pop         5.5.5.5/32         Gi0/0/0/1    10.4.5.5        111644      
24009  Pop         10.5.6.0/24        Gi0/0/0/1    10.4.5.5        0           
RP/0/RP0/CPU0:xrv4#show mpls ldp bindings  6.6.6.6/32
Fri Jul  2 14:38:34.577 UTC
6.6.6.6/32, rev 25
        Local binding: label: 24007
        Remote bindings: (2 peers)
            Peer                Label    
            -----------------   ---------
            2.2.2.2:0           24012   
            5.5.5.5:0           24004   

 

Back to: Segment Routing > segment routing and ldp coexistence

Leave a Reply

Your email address will not be published. Required fields are marked *


Post comment