14 mins read

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:

Now we are ready for the SR-MPLS basic config:

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:

We should also remember a couple of OAM commands to monitor SR-MPLS traffic and detect connectivity issues:

And finally, we can also see some tcpdump captures. Notice how the Node SID labels are conveniently used for forwarding:


External Resources: