Understanding the basics of segment routing
This blog aims to take you on a journey through some fundamental concepts of Segment Routing, highlighting the most important features and looking behind the scenes at the technical implementation.
How segment routing works
You might ask, “What on earth is a segment?”
The answer is simple; a segment is a path in a network from one node to another. To distinguish between multiple segments, each segment is assigned a segment ID (SID).


If this sounds a bit abstract, remember that Segment Routing is a packet-switching concept whose fundamental principle is to route packets through the network via a sequence of segments. The packets thus include a list of SIDs in the correct order, and once a packet has completed a segment, the SID is removed from the list.


If you’re wondering what type of network we’re talking about and where such a segment runs, don’t worry! Industry standards provide precise definitions of segments that clarify this. Read on to learn more about the format of the segment ID and implementation of the SID list.


Comparing data planes: SR MPLS vs. SRv6
Historically, segment routing was implemented over MPLS networks, where label-based operation seemed ideal for meeting segment routing requirements. Now, these SR MPLS labels are used as SIDs. The SID list attaches to the packets as a label stack. It’s that easy with MPLS!
It was later clear that IPv6 networks could also implement Segment Routing. In this case, specially formatted IPv6 addresses serve as SIDs, and the SID list is included with packets in what was called the Routing Extension Header but was promptly renamed the Segment Routing Header. The packet’s current SID serves as the IPv6 destination address.


Why SRv6 is gaining traction
Eventually, the IPv6-based implementation was simply dubbed “SRv6,” since a comparison between the two showed that SRv6 requirements were less demanding.
You only need IPv6 routing, which even simple routers and switches can handle. SR MPLS, on the other hand, requires end-to-end label switching, supported only by carrier-grade routers, which are not cheap but offer high performance.
The bottom line—SRv6’s lower requirements enable larger network construction than SR MPLS networks allow. So it’s now easier to set up end-to-end services that use an SRv6 network as a data plane, resulting in a noticeable trend toward IPv6. Now we must face the unpopular topic of migration. But more on that later!
Advanced traffic engineering with segment routing
From my experience teaching many Segment Routing courses, I’ve found that participants often initially see it as mysterious—even a little magical—how the network decides, at the entry point, which segments a packet should follow and which SID list to attach.
Many people think some new kind of intelligence—maybe even artificial intelligence—has been added to the network.
What is actually being used here is a tried-and-true method that’s been available since the beginning of MPLS networking: traffic engineering, which is now used within the context of Segment Routing’s data-forwarding concept.
It works in two steps. First, the network calculates the best path to a destination based on limits and optimization goals. Second, it attaches a matching SID list to the packet to guide it precisely along this calculated path through the network.
You’ll rightly hear in many Cisco presentations, “The path is encoded in the packet!” That path gives traffic engineering a major advantage over the traditional approach using RSVP-TE, which leaves a lot of state in the network (data that routers must store). So they scale poorly.
Traffic engineering with Segment Routing requires no additional state in the network because the state is carried in the packet as a SID list. So are we witnessing a renaissance of traffic engineering with Segment Routing? Not necessarily; there’s still administrative overhead to manage.
When push comes to shove, such an SID list for traffic engineering can also be created manually. However, the administrator must really know their network (part of the administrative effort needed in traffic engineering)!


Implementing topology independent loop-free alternate (TI-LFA)
Amid all this enthusiasm for Segment Routing, we mustn’t overlook another key feature: Topology Independent Loop-Free Alternate (TI-LFA). This feature also benefits from Segment Routing’s stateless approach: it uses a list of SIDs to route packets along a loop-free alternate path that is calculated in advance.
What makes it special is that, with Segment Routing, it works in any topology—hence the term “topology independent.”
This capability existed even before Segment Routing, based on classic MPLS protocols or simply basic routing. However, those solutions were not topology-independent. In fact, TI-LFA has become best practice in production Segment Routing networks.


Both Traffic Engineering and TI-LFA attach a SID list to packets to route them through a specific sequence of segments.
Key components of the SR architecture
This brings us back to a question that needs an answer: How exactly is a segment defined, and who or what determines its path through the network?
You’ll notice that the mentioned use cases for Segment Routing—traffic engineering and TI-LFA—were defined independently of the specific implementation (i.e., SR MPLS or SRv6), which means they are possible with both.
The same applies to the two most important segment definitions:
- IGP Prefix Segment
- Adjacency Segment
Understanding IGP prefix segments
The IGP Prefix Segment refers to an Interior Gateway Protocol (IGP).
This is an umbrella term for protocols such as IS-IS or OSPF. What they have in common is that they operate on a topology-based basis; in technical circles, they are also referred to as Link State Protocols. This is essential for Segment Routing, as link-related information must be advertised throughout the network. And this applies equally to SR MPLS and SRv6.
What is the main task of the IGP? The answer is simple! It is designed to calculate the best path to all IPv4 and IPv6 addresses on the network.
This calculation is based on abstract costs assigned to each interface. The result is the so-called least-cost path, where the sum of the costs is minimal. This is precisely what the definition of the IGP prefix segment is based on: the least-cost path to a prefix routed by the IGP.
In SR MPLS, this is always an IPv4 prefix, whereas SRv6 uses IPv6 prefixes. For those familiar with the subject, the prefix used in this context is typically an IPv4 or IPv6 loopback address, such as 1.1.1.1/32 or fcaa:aa00::1/128. This makes it easy for the BGP control plane for Layer 3 or Layer 2 services to access the Segment Routing data plane.
The simplest possible Segment Routing network uses only IGP prefix segments and thus behaves similarly to a classic MPLS network that uses LDP to dynamically establish Label-Switched Paths.
It’s valid to ask whether Segment Routing is beneficial at all in this case. The packets travel along the same paths as before. Fortunately, that is indeed the case. Network operations are grateful that the label does not change along the segment, and TI-LFA can be used to protect the path.


For SRv6, these arguments also hold true with almost no changes. In any case, everything is simpler because packets are routed along the IGP prefix segment solely based on IPv6 routing decisions, and it is inherent to the nature of routing that the IPv6 destination address—in the case of SRv6, the SID of the IGP prefix segment—does not change.
Utilizing adjacency segments for granular control
Following these in-depth reflections on the IGP prefix segment, let’s look at the adjacency segment, which addresses the shortest possible segment in a network—a link between two routers. It doesn’t get any shorter than that.
The term “adjacency” alludes to the fact that its very definition is based on IGP adjacencies. In most backbones, however, these coincide with the physical links, so this simplified approach is entirely justified.


An adjacency segment has a SID, the adjacency SID. Packets arriving at a router with this SID are forced onto the link to which the adjacency SID has been assigned. In Segment Routing circles, this is known as a SID with local scope. But what is the adjacency segment good for? Where can it demonstrate its potential?
Two important use cases we’ve already covered demonstrate the need to force traffic over a link that would not otherwise do so.
The future of segment routing
Despite all the complexity that Segment Routing reveals behind the scenes, we must never lose sight of why we’re doing all this in the first place.
Segment Routing is designed to handle data transport for Layer 3 and Layer 2 VPN services. Experts refer to this as the data plane, while the control plane of these services (at least in most cases today) is based on BGP.


There is still much more to discover in the world of Segment Routing. We’ve explored Segment Routing primarily at an abstract level and from an MPLS perspective. In the second part of the blog, we’ll shift our focus toward SRv6 and take a closer look behind the scenes.


