OSPF SR-MPLS

This page shows the configuration and confirmation of OSPF SR-MPLS in IOS-XR.

It’s worth noting that SR (Segment Routing) is still MPLS (Multiprotocol Label Switching), we are still label switching however, SR removes the additional MPLS requirement of LDP (Label Distribution Protocol). LDP is replaced with new “Opaque” LSAs within the IGP (Interior Gateway Protocol) which enable SR-MPLS to advertise Labels. We could delve into the theory however I’m keen to share configuration and confirmation, I may try and delve into the theory of SR-MPLS in another post.

To start with, here is an overview of the topology I have used. I am using EVE-NG with XRv images (IOS-XR)

I started the lab by configuring the IOS-XR routers with Loopbacks, Interface IPs and OSPF. This is basic configuration and leaves OSPF as broadcast with default costs.

router ospf 1
 log adjacency changes
 address-family ipv4 unicast
 area 0
  interface Loopback0
   passive enable
  !
  interface GigabitEthernet0/0/0/0
  !
  interface GigabitEthernet0/0/0/1
  !
  interface GigabitEthernet0/0/0/2
  !
 !
!

Once configured we can confirm our OSPF neighbourships and confirm a ping between PE1 and PE2.

RP/0/0/CPU0:PE1#sh route ospf 

O    10.2.2.2/32 [110/4] via 172.20.0.1, 00:03:06, GigabitEthernet0/0/0/1

RP/0/0/CPU0:PE1#ping 10.2.2.2  
Thu Jan 30 16:10:33.016 UTC
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.2.2.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 9/43/159 ms

Next step is to enable Segment Routing (SR) at the OSPF process level and SR-MPLS forwarding within the area, we also add a prefix-sid index to the loopback, this will aid us in fault finding the LFIB (Label Forwarding Information Based) which will become clear. To add we enable MPLS OAM for troubleshooting.

router ospf 1
 log adjacency changes
 segment-routing mpls
 address-family ipv4 unicast
 area 0
  segment-routing forwarding mpls
  interface Loopback0
   passive enable
   prefix-sid index 10
mpls oam
!

Now we can confirm Segment Routing is working as expected by running Ping MPLS and Traceroute MPLS. For this to work MPLS OAM must be configured on each node in the LSP (Label-switched Path).

RP/0/0/CPU0:PE1#ping mpls ipv4 10.2.2.2/32

Sending 5, 100-byte MPLS Echos to 10.2.2.2/32,
      timeout is 2 seconds, send interval is 0 msec:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 10/22/50 ms

RP/0/0/CPU0:PE1#traceroute mpls ipv4 10.2.2.2/32 
Thu Jan 30 16:22:02.729 UTC

Tracing MPLS Label Switched Path to 10.2.2.2/32, timeout is 2 seconds
  0 172.20.0.0 MRU 1500 [Labels: 16020 Exp: 0]
L 1 172.20.0.1 MRU 1500 [Labels: 16020 Exp: 0] 30 ms
L 2 172.20.0.3 MRU 1500 [Labels: implicit-null Exp: 0] 20 ms
! 3 172.20.0.5 40 ms

Next we can show the MPLS forwarding database. This shows the prefix and adjacency SIDs. Here we can see 24000 and 24001 are the adjacency SIDs for PE1 connected to P1 and P2.

Here we can also see the prefix-sid index we configured on each of the loopback addresses. 16001 (idx 1), this is P1 loopback0 10.255.255.1. We can also see 16001 and 16002 Label as Pop because P1 and P2 are the next-hops so PHP (Penultimate Hop Popping) does it’s thing, as it would do with traditional LDP MPLS.

RP/0/0/CPU0:PE1#show mpls forwarding
Local  Outgoing    Prefix             Outgoing     Next Hop        Bytes       
Label  Label       or ID              Interface                    Switched    
------ ----------- ------------------ ------------ --------------- ------------
16001  Pop         SR Pfx (idx 1)     Gi0/0/0/2    172.10.0.1      0           
16002  Pop         SR Pfx (idx 2)     Gi0/0/0/1    172.20.0.1      0           
16003  16003       SR Pfx (idx 3)     Gi0/0/0/2    172.10.0.1      0           
16004  16004       SR Pfx (idx 4)     Gi0/0/0/1    172.20.0.1      0           
16020  16020       SR Pfx (idx 20)    Gi0/0/0/1    172.20.0.1      0           
24000  Pop         SR Adj (idx 0)     Gi0/0/0/1    172.20.0.1      0           
24001  Pop         SR Adj (idx 0)     Gi0/0/0/2    172.10.0.1      0     

Now we can look at the OSPF neighbor details and see unprotected Adjacency SID Lable 24000, this again confirms that segment-routing is enabled and Adjacency SIDs have been locally assigned for each OSPF neighbor. It is key to remember that in an OSPF network Adjacency SIDs will be assigned to any neighbor in the 2WAY or FULL state.

RP/0/0/CPU0:PE1#sh ospf neighbor detail 

* Indicates MADJ interface
# Indicates Neighbor awaiting BFD session up

Neighbors for OSPF 1

 Neighbor 10.255.255.2, interface address 172.20.0.1
    In the area 0 via interface GigabitEthernet0/0/0/1 
    Neighbor priority is 1, State is FULL, 6 state changes
    DR is 172.20.0.1 BDR is 172.20.0.0
    Options is 0x52  
    LLS Options is 0x1 (LR)
    Dead timer due in 00:00:30
    Neighbor is up for 00:26:44
    Number of DBD retrans during last exchange 0
    Index 1/1, retransmission queue length 0, number of retransmission 1
    First 0(0)/0(0) Next 0(0)/0(0)
    Last retransmission scan length is 2, maximum is 2
    Last retransmission scan time is 0 msec, maximum is 0 msec
    LS Ack list: NSR-sync pending 0, high water mark 0
    Unprotected Adjacency SID Label: 24000
    Neighbor Interface ID: 5

 Neighbor 10.255.255.1, interface address 172.10.0.1
    In the area 0 via interface GigabitEthernet0/0/0/2 
    Neighbor priority is 1, State is FULL, 6 state changes
    DR is 172.10.0.1 BDR is 172.10.0.0
    Options is 0x52  
    LLS Options is 0x1 (LR)
    Dead timer due in 00:00:37
    Neighbor is up for 00:26:40
    Number of DBD retrans during last exchange 0
    Index 2/2, retransmission queue length 0, number of retransmission 1
    First 0(0)/0(0) Next 0(0)/0(0)
    Last retransmission scan length is 1, maximum is 1
    Last retransmission scan time is 0 msec, maximum is 0 msec
    LS Ack list: NSR-sync pending 0, high water mark 0
    Unprotected Adjacency SID Label: 24001
    Neighbor Interface ID: 5

Now we can confirm the self originated LSAs as Type-10.

RP/0/0/CPU0:PE1#sh ospf database self-originate 


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

                Router Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum Link count
10.1.1.1        10.1.1.1        1931        0x80000003 0x007d7a 3

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

Link ID         ADV Router      Age         Seq#       Checksum Opaque ID
4.0.0.0         10.1.1.1        1190        0x80000002 0x009fa5        0
7.0.0.1         10.1.1.1        1195        0x80000001 0x00e298        1
8.0.0.4         10.1.1.1        1190        0x80000003 0x00fec2        4
8.0.0.5         10.1.1.1        1190        0x80000003 0x00f8da        5

Next we verify the OSPF router capability advertisements by looking deeper at the Type-10 LSAs. Here we can see OPAQUE TYPE: 4 (Router Information). This shows the SR algorithm TLV which indicates any used Algorithms (This relates to SPF flexible and strict). We can also see TLV Length 12 which shows the SRGB (Segment Routing Global Block) range, here we have the default SRGB because we haven’t changed it in the configuration.

Below that we can then see the sub-TLV which has a default starting label of 16000, again this is default. With a starting label of 16000 and a range of 8000 the range is 16,000 – 23,999 (Default SRGB).

RP/0/0/CPU0:PE1#show ospf database opaque-area 4.0.0.0 self-originate 


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

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

  LS age: 1361
  Options: (No TOS-capability, DC)
  LS Type: Opaque Area Link
  Link State ID: 4.0.0.0
  Opaque Type: 4
  Opaque ID: 0
  Advertising Router: 10.1.1.1
  LS Seq Number: 80000002
  Checksum: 0x9fa5
  Length: 60

    Router Information TLV: Length: 4
    Capabilities:
      Graceful Restart Helper Capable
      Stub Router Capable
      All capability bits: 0x60000000

    Segment Routing Algorithm TLV: Length: 2
      Algorithm: 0
      Algorithm: 1

    Segment Routing Range TLV: Length: 12
      Range Size: 8000

        SID sub-TLV: Length 3
         Label: 16000

    Node MSD TLV: Length: 2
        Type: 1, Value 10

Now we can confirm the Prefix-SID advertisements. You can see below Opaque Type 7 (Extended Prefix). The Extended Prefix TLV shows the Intra-area prefix 10.1.1.1/32.

Under the SID sub-TLV we can see the SID index, we have configured this index as 10 under loopback 0.

RP/0/0/CPU0:PE1#sh ospf database opaque-area 7.0.0.1 self-originate 


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

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

  LS age: 1766
  Options: (No TOS-capability, DC)
  LS Type: Opaque Area Link
  Link State ID: 7.0.0.1
  Opaque Type: 7
  Opaque ID: 1
  Advertising Router: 10.1.1.1
  LS Seq Number: 80000001
  Checksum: 0xe298
  Length: 44

    Extended Prefix TLV: Length: 20
      Route-type: 1
      AF        : 0
      Flags     : 0x40
      Prefix    : 10.1.1.1/32

      SID sub-TLV: Length: 8
        Flags     : 0x0
        MTID      : 0
        Algo      : 0
        SID Index : 10

Now can move onto verifying the Adj-SID advertisements. Here from the perspective of P1 we can see Opaque Type 8 (Extended Link), Under the LAN Adj sub-TLV we can see the Neighbor ID of 10.1.1.1 and the Adj-SID label in use 24002 (This matches what we see in the LFIB when we show mpls forwarding on P1).

As you can see when we look at each entry in the OSPF database under Type-10 Opaque LSA we use the link ID to get more details. The Link ID in the database is made up of the Opaque Type and the Opaque ID for example we can see 8.0.0.5. The eight is the opaque type and the five is the opaque ID.

RP/0/0/CPU0:P1#sh ospf database opaque-area 8.0.0.5 self-originate 


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

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

  LS age: 506
  Options: (No TOS-capability, DC)
  LS Type: Opaque Area Link
  Link State ID: 8.0.0.5
  Opaque Type: 8
  Opaque ID: 5
  Advertising Router: 10.255.255.1
  LS Seq Number: 80000004
  Checksum: 0xf0c7
  Length: 60

    Extended Link TLV: Length: 36
      Link-type : 2
      Link ID   : 172.10.0.1
      Link Data : 172.10.0.1

     LAN Adj sub-TLV: Length: 11
       Flags      : 0x60
       MTID       : 0
       Weight     : 0
       Neighbor ID: 10.1.1.1
       Label     : 24002

     Link MSD sub-TLV: Length: 2
        Type: 1, Value 10

That’s all for the OSPF SR configuration and confirmation. Next i’ll be looking at TI-LFA and FRR, some of the major perks of Segment Routing.