How to Configure Segment Routing MPLS with IS-IS?
Table of Contents
- Segment Routing configuration with IS-IS, IOS XE ‹
- Segment Routing configuration with IS-IS, IOS XR ‹
- Explicit-null label with Segment Routing ‹
- Download section ‹
Segment Routing configuration with IS-IS, IOS XE
In this example, Segment Routing (SR) is configured in a single IS-IS Level-2 area using IOS XE on each router. Each router has a /32 Loopback address configured as its Node SID. The Node SID is a special kind of SR Prefix SID that uniquely identifies a router in the SR domain.
The default Segment Routing Global Block (SRGB) range on Cisco devices is 16000 - 23999, and in this topology each router uses an index value to specify the offset from 16000. Accordingly, R1 has index 1, which equals to the MPLS label 16001. R2 has index 2, thus MPLS label 16002. Each router receives this information via the IS-IS Segment Routing extension and the advertised Link State PDUs (LSP) or Update packets. The IS-IS LSPs have a number of TLVs developed for SR.
Configuration:
R1
R1#show run int Gi1 | sec int interface GigabitEthernet1 description ** to R2 ** ip address 10.1.0.2 255.255.255.252 ip router isis EXAMPLE-ISIS negotiation auto no mop enabled no mop sysid R1#show run int Lo10 | sec int interface Loopback10 ip address 1.1.1.1 255.255.255.255 R1#show run | sec ^segment segment-routing mpls ! connected-prefix-sid-map address-family ipv4 1.1.1.1/32 index 1 range 1 exit-address-family ! R1#show run | sec ^router router isis EXAMPLE-ISIS net 49.0001.0000.0000.0001.00 is-type level-2-only advertise passive-only metric-style wide log-adjacency-changes segment-routing mpls passive-interface Loopback10
R2
R2#show run int Gi1 | sec int interface GigabitEthernet1 description ** to R1 ** ip address 10.1.0.1 255.255.255.252 ip router isis EXAMPLE-ISIS negotiation auto no mop enabled no mop sysid R2#show run int Gi2 | sec int interface GigabitEthernet2 description ** to R3 ** ip address 10.2.0.1 255.255.255.252 ip router isis EXAMPLE-ISIS negotiation auto no mop enabled no mop sysid R2#show run int Lo10 | sec int interface Loopback10 ip address 2.2.2.2 255.255.255.255 R2#show run | sec ^segment segment-routing mpls ! connected-prefix-sid-map address-family ipv4 2.2.2.2/32 index 2 range 1 exit-address-family ! R2#show run | sec ^router router isis EXAMPLE-ISIS net 49.0001.0000.0000.0002.00 is-type level-2-only advertise passive-only metric-style wide log-adjacency-changes segment-routing mpls passive-interface Loopback10
R3
R3#show run int Gi1 | sec int interface GigabitEthernet1 description ** to R2 ** ip address 10.2.0.2 255.255.255.252 ip router isis EXAMPLE-ISIS negotiation auto no mop enabled no mop sysid R3#show run int Gi2 | sec int interface GigabitEthernet2 description ** to R4 ** ip address 10.3.0.1 255.255.255.252 ip router isis EXAMPLE-ISIS negotiation auto no mop enabled no mop sysid R3#show run int Lo10 | sec int interface Loopback10 ip address 3.3.3.3 255.255.255.255 R3#show run | sec ^segment segment-routing mpls ! connected-prefix-sid-map address-family ipv4 3.3.3.3/32 index 3 range 1 exit-address-family ! R3#show run | sec ^router router isis EXAMPLE-ISIS net 49.0001.0000.0000.0003.00 is-type level-2-only advertise passive-only metric-style wide log-adjacency-changes segment-routing mpls passive-interface Loopback10
R1#show isis segment-routing connected-sid Tag EXAMPLE-ISIS: IS-IS Level-2 connected prefix-sids: Host Prefix SID Index Range Flags R1 * 1.1.1.1/32 1 1 R2 2.2.2.2/32 2 1 R5 5.5.5.5/32 5 1 R4 4.4.4.4/32 4 1 R3 3.3.3.3/32 3 1 R6 6.6.6.6/32 6 1 « ISIS resolves the hostname and displays it next to the Prefix and SID R1#show segment-routing mpls connected-prefix-sid-map ipv4 PREFIX_SID_CONN_MAP ALGO_0 Prefix/masklen SID Type Range Flags SRGB 1.1.1.1/32 1 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 IS-IS Level 2 0000.0000.0001 2.2.2.2/32 2 Indx 1 Y IS-IS Level 2 0000.0000.0002 3.3.3.3/32 3 Indx 1 Y IS-IS Level 2 0000.0000.0003 4.4.4.4/32 4 Indx 1 Y IS-IS Level 2 0000.0000.0004 5.5.5.5/32 5 Indx 1 Y IS-IS Level 2 0000.0000.0005 6.6.6.6/32 6 Indx 1 Y IS-IS Level 2 0000.0000.0006 « Prefix and SID Index value displayed together with ISIS system ID R1#show mpls forwarding-table Local Outgoing Prefix Bytes Label Outgoing Next Hop Label Label or Tunnel Id Switched interface 16 Pop Label 10.1.0.1-A 0 Gi1 10.1.0.1 16002 Pop Label 2.2.2.2/32 0 Gi1 10.1.0.1 16003 16003 3.3.3.3/32 0 Gi1 10.1.0.1 16004 16004 4.4.4.4/32 0 Gi1 10.1.0.1 16005 16005 5.5.5.5/32 0 Gi1 10.1.0.1 16006 16006 6.6.6.6/32 0 Gi1 10.1.0.1 « MPLS label assigned to Prefix A - Adjacency SID R1#show ip cef 6.6.6.6 detail 6.6.6.6/32, epoch 2 sr local label info: global/16006 [0x1B] nexthop 10.1.0.1 GigabitEthernet1 label 16006-(local:16006) « MPLS label loaded into the CEF FIB R1#show ip cef exact-route 1.1.1.1 6.6.6.6 1.1.1.1 -> 6.6.6.6 => label 16006-(local:16006)TAG adj out of GigabitEthernet1, addr 10.1.0.1 R1#trace 6.6.6.6 pr 1 Type escape sequence to abort. Tracing the route to 6.6.6.6 VRF info: (vrf in name/id, vrf out name/id) 1 10.1.0.1 [MPLS: Label 16006 Exp 0] 5 msec « Data is label switched between R1 and R6 2 10.2.0.2 [MPLS: Label 16006 Exp 0] 5 msec 3 10.3.0.2 [MPLS: Label 16006 Exp 0] 5 msec 4 10.4.0.2 [MPLS: Label 16006 Exp 0] 4 msec 5 10.5.0.2 5 msec
As visible in the above output, the same label is assigned on each hop. This is because R6 advertises its Node SID with the index value 6. And each router uses the same default SRGB base 16000. This means each router adds the value 6 to the 16000, and as a result the MPLS label 16006 is assigned to R6.
Segment Routing as an MPLS transport method supports a variety of L2VPN and L3VPN services (also IPv6 VPN). In such deployments, it may be enough for only the PE routers to advertise their SR Node SID, further reducing the MPLS control plane complexity and overhead.
Segment Routing configuration with IS-IS, IOS XR
In this example, Segment Routing is configured with IS-IS in a single Level-2 area using IOS XR. With IOS XR all of the SR configuration is applied under the IS-IS routing process for this scenario. The Loopback interfaces are assigned a unique index value on each router, and the base SRGB is 16000 throughout the topology. Thus, an end-to-end label switched path (LSP) is created between R1 and R6.
Configuration:
R1
RP/0/0/CPU0:R1#show run | beg hostname
Wed Jan 10 13:47:19.971 UTC
Building configuration...
hostname R1
domain lookup disable
line console
escape-character 0x51
!
interface Loopback10
ipv4 address 1.1.1.1 255.255.255.255
!
interface MgmtEth0/0/CPU0/0
shutdown
!
interface GigabitEthernet0/0/0/0
description ** to R2 **
ipv4 address 10.1.0.2 255.255.255.252
!
interface GigabitEthernet0/0/0/1
shutdown
!
interface GigabitEthernet0/0/0/2
shutdown
!
router isis EXAMPLE-ISIS
is-type level-2-only
net 49.0001.0000.0000.0001.00
log adjacency changes
address-family ipv4 unicast
metric-style wide
segment-routing mpls
!
interface Loopback10
address-family ipv4 unicast
prefix-sid index 1
!
!
interface GigabitEthernet0/0/0/0
point-to-point
address-family ipv4 unicast
!
!
!
end
R2
RP/0/0/CPU0:R2#show run | beg hostname
Wed Jan 10 13:47:44.637 UTC
Building configuration...
hostname R2
domain lookup disable
line console
escape-character 0x51
!
interface Loopback10
ipv4 address 2.2.2.2 255.255.255.255
!
interface MgmtEth0/0/CPU0/0
shutdown
!
interface GigabitEthernet0/0/0/0
description ** to R3 **
ipv4 address 10.2.0.1 255.255.255.252
!
interface GigabitEthernet0/0/0/1
description ** to R1 **
ipv4 address 10.1.0.1 255.255.255.252
!
interface GigabitEthernet0/0/0/2
shutdown
!
router isis EXAMPLE-ISIS
is-type level-2-only
net 49.0001.0000.0000.0002.00
log adjacency changes
address-family ipv4 unicast
metric-style wide
segment-routing mpls
!
interface Loopback10
address-family ipv4 unicast
prefix-sid index 2
!
!
interface GigabitEthernet0/0/0/0
point-to-point
address-family ipv4 unicast
!
!
interface GigabitEthernet0/0/0/1
point-to-point
address-family ipv4 unicast
!
!
!
end
R3
RP/0/0/CPU0:R3#show run | beg hostname
Wed Jan 10 13:48:26.443 UTC
Building configuration...
hostname R3
domain lookup disable
line console
escape-character 0x51
!
interface Loopback10
ipv4 address 3.3.3.3 255.255.255.255
!
interface MgmtEth0/0/CPU0/0
shutdown
!
interface GigabitEthernet0/0/0/0
description ** to R2 **
ipv4 address 10.2.0.2 255.255.255.252
!
interface GigabitEthernet0/0/0/1
description ** to R4 **
ipv4 address 10.3.0.1 255.255.255.252
!
interface GigabitEthernet0/0/0/2
shutdown
!
router isis EXAMPLE-ISIS
is-type level-2-only
net 49.0001.0000.0000.0003.00
log adjacency changes
address-family ipv4 unicast
metric-style wide
segment-routing mpls
!
interface Loopback10
address-family ipv4 unicast
prefix-sid index 3
!
!
interface GigabitEthernet0/0/0/0
point-to-point
address-family ipv4 unicast
!
!
interface GigabitEthernet0/0/0/1
point-to-point
address-family ipv4 unicast
!
!
!
end
RP/0/0/CPU0:R2#show isis neighbors Wed Jan 10 14:07:17.156 UTC IS-IS EXAMPLE-ISIS neighbors: System Id Interface SNPA State Holdtime Type IETF-NSF R1 Gi0/0/0/1 *PtoP* Up 24 L2 Capable « IS-IS point-to-point neighborships R3 Gi0/0/0/0 *PtoP* Up 21 L2 Capable Total neighbor count: 2 RP/0/0/CPU0:R2#show isis segment-routing label table Wed Jan 10 14:08:59.629 UTC IS-IS EXAMPLE-ISIS IS Label Table Label Prefix/Interface ---------- ---------------- 16001 1.1.1.1/32 16002 Loopback10 16003 3.3.3.3/32 16004 4.4.4.4/32 16005 5.5.5.5/32 16006 6.6.6.6/32 « IS-IS carries SR Prefix and Segment ID information to assign MPLS labels RP/0/0/CPU0:R1#show mpls forwarding Wed Jan 10 14:10:11.867 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.0.1 0 16003 16003 SR Pfx (idx 3) Gi0/0/0/0 10.1.0.1 0 16004 16004 SR Pfx (idx 4) Gi0/0/0/0 10.1.0.1 0 16005 16005 SR Pfx (idx 5) Gi0/0/0/0 10.1.0.1 0 16006 16006 SR Pfx (idx 6) Gi0/0/0/0 10.1.0.1 41001512 « MPLS LFIB has labels installed 24001 Pop SR Adj (idx 1) Gi0/0/0/0 10.1.0.1 0 24002 Pop SR Adj (idx 3) Gi0/0/0/0 10.1.0.1 0 RP/0/0/CPU0:R1#show isis route 6.6.6.6/32 detail Wed Jan 10 14:21:59.218 UTC L2 6.6.6.6/32 [60/115] medium priority via 10.1.0.1, GigabitEthernet0/0/0/0, R2, SRGB Base: 16000, Weight: 0 « SRGB base is indicated src R6.00-00, 6.6.6.6, prefix-SID index 6, R:0 N:1 P:0 E:0 V:0 L:0 « Index value 6 is received with the prefix RP/0/0/CPU0:R1#show ip route 6.6.6.6 Wed Jan 10 14:10:29.525 UTC Routing entry for 6.6.6.6/32 Known via "isis EXAMPLE-ISIS", distance 115, metric 60, labeled SR, type level-2 « Prefix is labeled SR, indicated in RIB Installed Jan 10 13:40:09.500 for 00:30:20 Routing Descriptor Blocks 10.1.0.1, from 6.6.6.6, via GigabitEthernet0/0/0/0 Route metric is 60 No advertising protos. RP/0/0/CPU0:R1#show cef 6.6.6.6 Wed Jan 10 14:11:08.233 UTC 6.6.6.6/32, version 65, labeled SR, internal 0x1000001 0x81 (ptr 0xa12db64c) [1], 0x0 (0xa12c1320), 0xa28 (0xa155b1e0) Updated Jan 10 13:40:09.521 local adjacency 10.1.0.1 Prefix Len 32, traffic index 0, precedence n/a, priority 1 Extensions: context-label:16006 via 10.1.0.1/32, GigabitEthernet0/0/0/0, 7 dependencies, weight 0, class 0 [flags 0x0] path-idx 0 NHID 0x0 [0xa163a16c 0x0] next hop 10.1.0.1/32 local adjacency local label 16006 labels imposed {16006} « CEF table also shows the assigned SR label RP/0/0/CPU0:R1#trace mpls ipv4 6.6.6.6/32 Wed Jan 10 15:29:42.850 UTC 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 rx label, '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.1.0.2 MRU 1500 [Labels: 16006 Exp: 0] « Traffic is switched using MPLS label L 1 10.1.0.1 MRU 1500 [Labels: 16006 Exp: 0] 0 ms L 2 10.2.0.2 MRU 1500 [Labels: 16006 Exp: 0] 10 ms L 3 10.3.0.2 MRU 1500 [Labels: 16006 Exp: 0] 10 ms L 4 10.4.0.2 MRU 1500 [Labels: implicit-null Exp: 0] 10 ms ! 5 10.5.0.2 10 ms
Notice in the above traceroute output from R1 that between hop number 4 and 5 there is an implicit-null MPLS label assigned. This is because of the Penultimate Hop Pop (PHP) default behavior, which is triggered by R6 advertising an implicit-null label to R5. This is also visible in the following outputs from R5.
RP/0/0/CPU0:R5#show cef 6.6.6.6 Wed Jan 10 14:32:58.581 UTC 6.6.6.6/32, version 61, labeled SR, internal 0x1000001 0x81 (ptr 0xa12dbcac) [1], 0x0 (0xa12c1440), 0xa20 (0xa155b230) Updated Jan 10 13:40:33.626 local adjacency 10.5.0.2 Prefix Len 32, traffic index 0, precedence n/a, priority 1 Extensions: context-label:16006 via 10.5.0.2/32, GigabitEthernet0/0/0/1, 7 dependencies, weight 0, class 0 [flags 0x0] path-idx 0 NHID 0x0 [0xa163a2dc 0xa163a338] next hop 10.5.0.2/32 local adjacency local label 16006 labels imposed {ImplNull} RP/0/0/CPU0:R5#show isis route 6.6.6.6/32 detail Wed Jan 10 14:49:40.382 UTC L2 6.6.6.6/32 [20/115] medium priority via 10.5.0.2, GigabitEthernet0/0/0/1, R6, SRGB Base: 16000, Weight: 0 src R6.00-00, 6.6.6.6, prefix-SID index 6, R:0 N:1 P:0 E:0 V:0 L:0 « The E-bit (Explicit-null) is not set
Explicit-null label with Segment Routing
In certain cases it is desirable to set the MPLS explicit-null label, for example when a Uniform MPLS QoS policy is required. With Segment Routing this can be achieved by issuing the following commands in IOS XE and IOS XR.
| IOS XE | IOS XR |
|---|---|
R6#show run | sec ^segment segment-routing mpls ! set-attributes address-family ipv4 explicit-null exit-address-family ! ! connected-prefix-sid-map address-family ipv4 6.6.6.6/32 index 6 range 1 exit-address-family ! |
RP/0/0/CPU0:R6#show run router isis Wed Jan 10 15:38:23.174 UTC router isis EXAMPLE-ISIS is-type level-2-only net 49.0001.0000.0000.0006.00 log adjacency changes address-family ipv4 unicast metric-style wide segment-routing mpls ! interface Loopback10 address-family ipv4 unicast prefix-sid index 6 explicit-null ! ! interface GigabitEthernet0/0/0/0 point-to-point address-family ipv4 unicast ! ! ! |
Now an MPLS label with the null value is inserted before R6, which could be a potential egress PE router. As a result, in case of a L3VPN MPLS label stack the MPLS EXP (QoS) marking can be preserved for the top (transport) label without exposing the EXP value of the bottom label.
RP/0/0/CPU0:R1#trace mpls ipv4 6.6.6.6/32 Wed Jan 10 15:40:50.204 UTC 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 rx label, '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.1.0.2 MRU 1500 [Labels: 16006 Exp: 0] L 1 10.1.0.1 MRU 1500 [Labels: 16006 Exp: 0] 0 ms L 2 10.2.0.2 MRU 1500 [Labels: 16006 Exp: 0] 0 ms L 3 10.3.0.2 MRU 1500 [Labels: 16006 Exp: 0] 10 ms L 4 10.4.0.2 MRU 1500 [Labels: explicit-null Exp: 0] 10 ms ! 5 10.5.0.2 10 ms RP/0/0/CPU0:R5#show cef 6.6.6.6 Wed Jan 10 15:43:21.192 UTC 6.6.6.6/32, version 81, labeled SR, internal 0x1000001 0x81 (ptr 0xa12dbcac) [1], 0x0 (0xa12c1680), 0xa28 (0xa155b258) Updated Jan 10 15:38:14.373 local adjacency 10.5.0.2 Prefix Len 32, traffic index 0, precedence n/a, priority 1 Extensions: context-label:16006 via 10.5.0.2/32, GigabitEthernet0/0/0/1, 5 dependencies, weight 0, class 0 [flags 0x0] path-idx 0 NHID 0x0 [0xa163a338 0x0] next hop 10.5.0.2/32 local adjacency local label 16006 labels imposed {ExpNullv4} RP/0/0/CPU0:R5#show isis route 6.6.6.6/32 detail Wed Jan 10 15:43:52.940 UTC L2 6.6.6.6/32 [20/115] medium priority via 10.5.0.2, GigabitEthernet0/0/0/1, R6, SRGB Base: 16000, Weight: 0 src R6.00-00, 6.6.6.6, prefix-SID index 6, R:0 N:1 P:1 E:1 V:0 L:0 « The E-bit (Explicit-null) is set