SR-MPLS – Basic Config
1. Intro
Segment Routing is also known as Source Packet Routing in Networking (SPRING), and it comes in two flavors SR-MPLS and SRv6
In a segment-routed network, source routing enables the first router in a path to calculate the end-to-end path. The source router can then write a series of MPLS labels or IPv6 addresses to the packet that represent the segment instructions for the path. Transit routers do not need to perform any routing calculations on an incoming packet. Instead, they simply follow the instructions made by the source router.
The Segment is a critical concept in a segment-routed network. Devices generate a series of instructions that represent the ways a packet can be forwarded or processed. These instructions are called segments. By stacking segments together, operators can create precise paths between any two devices.
SR-MPLS is an MPLS forwarding technology, that can be used to create label-switched paths between two routers and can be an alternate solution to LDP or RSVP. SR-MPLS will be the focus for this post.
Segment Routing (SR) is not a new protocol, not in the same way LDP and RSVP are protocols. SR has no adjacencies and is not doing any exchange of instruction/segments. We should rather see SR as an extension of OSPF or ISIS protocols, because these protocols are the ones doing all the instruction/segments exchange.
Before configuring SR-MPLS, we need to understand a few concepts like SID, Node ID, SRGB.
2. Segment ID (SID), Node SID and SRGB
SR-MPLS and SRv6 both use a numerical construct called a segment identifier (SID). SID is used to communicate the MPLS label or IPv6 address that should be used in the data plane. The SID value is used in different ways depending on the type of segment being advertised.
For example, in SR-MPLS, the SID value is sometimes the exact MPLS label that a router expects to receive for that segment. However, other segment types use the SID value as an index that can be combined with a pre-allocated set of MPLS labels to calculate the correct MPLS label that a router expects to receive for a segment.
Many instructions can receive a SID, but common options are: link/adjacency or node. But other options also exists (eg. prefix, anycast, etc).
A Link SID identifies a link to a directly connected neighbor, but it is generally used as a locally significant instruction to take a particular outgoing link. The important point is that a Link SID is local to the node. The same SID value can potentially be used by another node for a different link.
An Adjacency SID (Adj-SID) identifies a particular adjacency to a directly connected neighbor, and it is explicitly associated with the forwarding adjacency between two nodes. In other words, it is a strict forwarded single-hop tunnel that carries packets over a specific link between two nodes, irrespective of the link cost. The Adj-SID is also local to the node.
A Node SID is for when we assign a segment ID to a node. A node segment is a special case of prefix segment, where every node computes shortest path to the node segment and programs in the forwarding plane. This will allow forwarding across multiple hops using only one single (same) label from source to destination.
SRGB (Segment Routing Global Block) is the range of MPLS labels reserved for globally significant Segment IDs (SIDs) in a Segment Routing MPLS (SR-MPLS) network. The labels in the SRGB are globally meaningful. Every router in the SR domain can interpret a Node SID or Prefix SID because it knows the SRGB advertised by the originating router.
2. Basic Config
We will use the following topology to configure SR-MPLS:

Before we configure SR, we need to be sure that a few prerequisites are met:
- IGP configuration (OSPF or ISIS)
- MPLS configuration
- Chassis mode enhanced IP
Configuring the prerequisites is simple, find next a sample from R1 router:
### The prerequisite config:
set protocols isis interface ge-0/0/1.0 point-to-point
set protocols isis interface ge-0/0/2.0 point-to-point
set protocols isis interface lo0.0 passive
set protocols isis level 1 disable
set protocols isis level 2 wide-metrics-only
set interfaces ge-0/0/1 unit 0 family mpls
set interfaces ge-0/0/2 unit 0 family mpls
set protocols mpls interface ge-0/0/2.0
set protocols mpls interface ge-0/0/1.0
set chassis network-services enhanced-ip
### Note: SR config will not pass commit check if enhanced-ip is not configured!
### Note2: Notice that 'maximum-labels' was not configured for this test, because it was not needed.
### Note2: But, generally speaking, it is a good idea to configure 'maximum-labels' from the beginning.
Now we are ready for the SR-MPLS basic config:
### Remember that SR is not a new protocol, but rather an extension of the IGP.
### Hence, in our test network the SR-MPLS config will be under ISIS.
### To activate SR we only need the 'source-packet-routing'.
### But for a full config we also need to configure SRGB and the Node ID:
set protocols isis source-packet-routing srgb start-label 800000
set protocols isis source-packet-routing srgb index-range 10000
set protocols isis source-packet-routing node-segment ipv4-index 1001
set protocols isis source-packet-routing node-segment ipv6-index 5001
set chassis network-services enhanced-ip
### Notice we have different Node IDs (node-segment) for IPv4 and IPv6.
### Not shown here, but all routers were configured the same (each router with its own node ID).
This was the config, really simple. There is no adjacency to check, no LSP, at this point it works in a way that is similar to LDP:
### All loopbacks are present in the inet.3 table.
### Notice how the labels are constructed by combining the SRGB 'start-label' and the 'node-segment'.
root@R1# run show route table inet.3
inet.3: 7 destinations, 7 routes (7 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
17.0.0.2/32 *[L-ISIS/14] 03:41:50, metric 10
> to 17.1.2.2 via ge-0/0/1.0
17.0.0.3/32 *[L-ISIS/14] 03:42:18, metric 10
> to 17.1.3.3 via ge-0/0/2.0
17.0.0.4/32 *[L-ISIS/14] 03:41:13, metric 20
> to 17.1.2.2 via ge-0/0/1.0, Push 801004
to 17.1.3.3 via ge-0/0/2.0, Push 801004
17.0.0.5/32 *[L-ISIS/14] 03:41:13, metric 30
> to 17.1.2.2 via ge-0/0/1.0, Push 801005
to 17.1.3.3 via ge-0/0/2.0, Push 801005
17.0.0.6/32 *[L-ISIS/14] 03:42:08, metric 20
> to 17.1.3.3 via ge-0/0/2.0, Push 801006
17.0.0.7/32 *[L-ISIS/14] 03:41:46, metric 30
> to 17.1.3.3 via ge-0/0/2.0, Push 801007
17.0.0.8/32 *[L-ISIS/14] 03:40:54, metric 30
> to 17.1.3.3 via ge-0/0/2.0, Push 801008
### Now the full network is operational, we can test with a VRF ping:
root@R1# run ping 192.168.8.1 routing-instance Cust-A
PING 192.168.8.1 (192.168.8.1): 56 data bytes
64 bytes from 192.168.8.1: icmp_seq=0 ttl=62 time=4.130 ms
64 bytes from 192.168.8.1: icmp_seq=1 ttl=62 time=4.428 ms
^C
--- 192.168.8.1 ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max/stddev = 4.130/4.279/4.428/0.149 ms
### We can check the MPLS label usage with:
root@R1# run show mpls label usage
Label space Total Available Applications
LSI 989984 989979 (100.00%) BGP/LDP VPLS with no-tunnel-services, BGP L3VPN with vrf-table-label
Block 989984 989979 (100.00%) BGP/LDP VPLS with tunnel-services, BGP L2VPN
Dynamic 989984 989979 (100.00%) RSVP, LDP, PW, L3VPN, RSVP-P2MP, LDP-P2MP, MVPN, EVPN, BGP
Static 48576 48576 (100.00%) Static LSP, Static PW
Effective Ranges
Range name Shared with Start End
Dynamic 16 799999
Dynamic 810000 999999
Static 1000000 1048575
SRGB 800000 809999 ISIS
Configured Ranges
Range name Shared with Start End
Dynamic 16 799999
Dynamic 810000 999999
Static 1000000 1048575
SRGB 800000 809999 ISIS
### As we mentioned already, there no SR adjacency or LSP to show.
### But we can check the ISIS protocols show commands:
root@R1# run show isis overview
Instance: master
Router ID: 17.0.0.1
IPv6 Router ID: abcd::128:49:227:48
Hostname: R1
Sysid: 0001.1100.0001
Areaid: 47.0005.80ff.f800.0000.0108.0001
Adjacency holddown: enabled
Maximum Areas: 3
LSP life time: 1200
Attached bit evaluation: enabled
SPF delay: 200 msec, SPF holddown: 5000 msec, SPF rapid runs: 3
IPv4 is enabled, IPv6 is enabled, SPRING based MPLS is enabled
Traffic engineering: enabled
Traffic engineering v6: disabled
Restart: Disabled
Helper mode: Enabled
Layer2-map: Disabled
Source Packet Routing (SPRING): Enabled
SRGB Config Range :
SRGB Start-Label : 800000, SRGB Index-Range : 10000
SRGB Block Allocation: Success
SRGB Start Index : 800000, SRGB Size : 10000, Label-Range: [ 800000, 809999 ]
Node Segments: Enabled
Ipv4 Index : 1001, Ipv6 Index : 5001
SRv6: Disabled
Post Convergence Backup: Disabled
Level 1
Internal route preference: 15
External route preference: 160
Prefix export count: 0
Wide metrics are enabled, Narrow metrics are enabled
Source Packet Routing is enabled
Level 2
Internal route preference: 18
External route preference: 165
Prefix export count: 0
Wide metrics are enabled
Source Packet Routing is enabled
### We can also check the SR segments in the ISIS database:
root@R1# run show isis database R1 extensive
IS-IS level 1 link-state database:
IS-IS level 2 link-state database:
R1.00-00 Sequence: 0x1a, Checksum: 0xdc06, Lifetime: 757 secs
IPV4 Index: 1001, IPV6 Index: 5001
Node Segment Blocks Advertised:
Start Index : 0, Size : 10000, Label-Range: [ 800000, 809999 ]
IS neighbor: R2.00 Metric: 10
Two-way fragment: R2.00-00, Two-way first fragment: R2.00-00
P2P IPv4 Adj-SID: 19, Weight: 0, Flags: --VL--
P2P IPv6 Adj-SID: 20, Weight: 0, Flags: F-VL--
IS neighbor: R3.00 Metric: 10
Two-way fragment: R3.00-00, Two-way first fragment: R3.00-00
P2P IPv4 Adj-SID: 17, Weight: 0, Flags: --VL--
P2P IPv6 Adj-SID: 18, Weight: 0, Flags: F-VL--
IP prefix: 17.0.0.1/32 Metric: 0 Internal Up
IP prefix: 17.1.2.0/24 Metric: 10 Internal Up
IP prefix: 17.1.3.0/24 Metric: 10 Internal Up
IP prefix: 128.49.227.48/32 Metric: 0 Internal Up
V6 prefix: 2001:db88::1/128 Metric: 0 Internal Up
V6 prefix: 2001:db88:8::/64 Metric: 10 Internal Up
V6 prefix: 2001:db88:8:1::/64 Metric: 10 Internal Up
V6 prefix: abcd::128:49:227:48/128 Metric: 0 Internal Up
Header: LSP ID: R1.00-00, Length: 431 bytes
Allocated length: 1492 bytes, Router ID: 17.0.0.1
Remaining lifetime: 757 secs, Level: 2, Interface: 0
Estimated free bytes: 1013, Actual free bytes: 1061
Aging timer expires in: 757 secs
Protocols: IP, IPv6
Packet: LSP ID: R1.00-00, Length: 431 bytes, Lifetime : 1198 secs
Checksum: 0xdc06, Sequence: 0x1a, Attributes: 0x3 <L1 L2>
NLPID: 0x83, Fixed length: 27 bytes, Version: 1, Sysid length: 0 bytes
Packet type: 20, Packet version: 1, Max area: 0
TLVs:
Area address: 49.0001 (3)
LSP Buffer Size: 1492
Speaks: IP
Speaks: IPV6
IP router id: 17.0.0.1
IP address: 17.0.0.1
IPv6 TE Router ID: abcd::128:49:227:48
Hostname: R1
Extended IS Reachability TLV, Type: 22, Length: 166
IS extended neighbor: R2.00, Metric: default 10 SubTLV len: 72
IP address: 17.1.2.1
IPv6 address: 2001:db88:8::1
Neighbor's IP address: 17.1.2.2
Neighbor's IPv6 address: 2001:db88:8::2
Local interface index: 337, Remote interface index: 337
P2P IPV6 Adj-SID - Flags:0xb0(F:1,B:0,V:1,L:1,S:0,P:0), Weight:0, Label: 20
P2P IPv6 Adj-SID: 20, Weight: 0, Flags: F-VL--
P2P IPV4 Adj-SID - Flags:0x30(F:0,B:0,V:1,L:1,S:0,P:0), Weight:0, Label: 19
P2P IPv4 Adj-SID: 19, Weight: 0, Flags: --VL--
IS extended neighbor: R3.00, Metric: default 10 SubTLV len: 72
IP address: 17.1.3.1
IPv6 address: 2001:db88:8:1::1
Neighbor's IP address: 17.1.3.3
Neighbor's IPv6 address: 2001:db88:8:1::2
Local interface index: 338, Remote interface index: 334
P2P IPV6 Adj-SID - Flags:0xb0(F:1,B:0,V:1,L:1,S:0,P:0), Weight:0, Label: 18
P2P IPv6 Adj-SID: 18, Weight: 0, Flags: F-VL--
P2P IPV4 Adj-SID - Flags:0x30(F:0,B:0,V:1,L:1,S:0,P:0), Weight:0, Label: 17
P2P IPv4 Adj-SID: 17, Weight: 0, Flags: --VL--
IP extended prefix: 17.0.0.1/32 metric 0 up
8 bytes of subtlvs
Node SID, Flags: 0x40(R:0,N:1,P:0,E:0,V:0,L:0), Algo: SPF(0), Value: 1001
IP extended prefix: 128.49.227.48/32 metric 0 up
IP extended prefix: 17.1.2.0/24 metric 10 up
IP extended prefix: 17.1.3.0/24 metric 10 up
IP address: 128.49.227.48
IPv6 prefix: 2001:db88::1/128 Metric 0 Up
IPv6 prefix: abcd::128:49:227:48/128 Metric 0 Up
8 bytes of subtlvs
Node SID, Flags: 0x40(R:0,N:1,P:0,E:0,V:0,L:0), Algo: SPF(0), Value: 5001
IPv6 prefix: 2001:db88:8::/64 Metric 10 Up
IPv6 prefix: 2001:db88:8:1::/64 Metric 10 Up
Router Capability: Router ID 17.0.0.1, Flags: 0x00
SPRING Capability - Flags: 0xc0(I:1,V:1), Range: 10000, SID-Label: 800000
SPRING Algorithm - Algo: 0
SPRING Algorithm - Algo: 1
IPv6 TE Router Id: abcd::128:49:227:48
No queued transmissions
### We can also see the SIDs on the ISIS adjacencies:
root@R1# run show isis adjacency extensive
R2
Interface: ge-0/0/1.0, Level: 2, State: Up, Expires in 19 secs
Priority: 0, Up/Down transitions: 1, Last transition: 03:55:02 ago
Circuit type: 2, Speaks: IP, IPv6
Topologies: Unicast
Restart capable: Yes, Adjacency advertisement: Advertise
IP addresses: 17.1.2.2
IPv6 addresses: fe80::5604:dff:fe00:441e
IPv6 Global Interface Address: 2001:db88:8::2
Level 2 IPv4 Adj-SID: 19
Level 2 IPv6 Adj-SID: 20
Transition log:
When State Event Down reason
Thu Aug 6 05:01:26 Up Seenself
R3
Interface: ge-0/0/2.0, Level: 2, State: Up, Expires in 19 secs
Priority: 0, Up/Down transitions: 1, Last transition: 03:55:30 ago
Circuit type: 2, Speaks: IP, IPv6
Topologies: Unicast
Restart capable: Yes, Adjacency advertisement: Advertise
IP addresses: 17.1.3.3
IPv6 addresses: fe80::5604:dff:fe00:5fbf
IPv6 Global Interface Address: 2001:db88:8:1::2
Level 2 IPv4 Adj-SID: 17
Level 2 IPv6 Adj-SID: 18
Transition log:
When State Event Down reason
Thu Aug 6 05:00:58 Up Seenself
We should also remember a couple of OAM commands to monitor SR-MPLS traffic and detect connectivity issues:
root@R1# run ping mpls segment-routing isis 17.0.0.8
!!!!!^C
--- lsping statistics ---
5 packets transmitted, 5 packets received, 0% packet loss
root@R1# run traceroute mpls segment-routing isis 17.0.0.8
Probe options: ttl 64, retries 3, wait 10, paths 16, exp 7, fanout 16
ttl Label Protocol Address Previous Hop Probe Status
1 801008 ISIS 17.1.3.3 (null) Success
FEC-Stack-Sent: ISIS
ttl Label Protocol Address Previous Hop Probe Status
2 801008 ISIS 17.3.6.6 17.1.3.3 Success
FEC-Stack-Sent: ISIS
ttl Label Protocol Address Previous Hop Probe Status
3 3 ISIS 17.6.8.8 17.3.6.6 Egress
FEC-Stack-Sent: ISIS
Path 1 via ge-0/0/2.0 destination 127.0.0.64
And finally, we can also see some tcpdump captures. Notice how the Node SID labels are conveniently used for forwarding:
### R1-R3 link:
15:59:45.508983 MPLS (label 801008, exp 0, ttl 64) (label 16, exp 0, [S], ttl 64) IP 192.168.1.1 > 192.168.8.1: ICMP echo request, id 31096, seq 24, length 64
15:59:45.511597 MPLS (label 16, exp 0, [S], ttl 62) IP 192.168.8.1 > 192.168.1.1: ICMP echo reply, id 31096, seq 24, length 64
### R3-R6 link:
16:00:39.449334 MPLS (label 801008, exp 0, ttl 63) (label 16, exp 0, [S], ttl 64) IP 192.168.1.1 > 192.168.8.1: ICMP echo request, id 31096, seq 77, length 64
16:00:39.451206 MPLS (label 801001, exp 0, ttl 63) (label 16, exp 0, [S], ttl 64) IP 192.168.8.1 > 192.168.1.1: ICMP echo reply, id 31096, seq 77, length 64
External Resources: