What Is Source Routing in a Segment Routed Network?
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.
Prerequisites Knowledge
We assume that readers have read the sections titled What Is Segment Routing and Source Packet Routing in Networking? and What Features and Designs Does Segment Routing Enable?, along with the prerequisites for these topics.
Segment routing is also known as Source Packet Routing in Networking (SPRING).
Source routing does not mean forwarding packets based on the source IP address. This concept is called source-based routing. Source routing refers to the ability of the first node in any arbitrary path to calculate the path across the topology. The first node in the path is the source router. This source router performs the routing decisions for every single hop. The transit routers in the path then simply follow the instructions that they receive.
For example, in Figure 1, you can see an autonomous system (AS) that is part of a larger end-to-end path between the ultimate source and destination of a packet. AS 64523 is just one of three networks that a packet must traverse to arrive at its destination.
From the perspective of segment routing inside AS 64523, the source router is the ingress border router R1, and the destination router is the egress border router R5 at the other side of the AS.
In a network with segment routing, R1 will have a series of pre-calculated paths to various other routers in the network, such as R5. This may be as simple as an MPLS LSP or SRv6 tunnel that follows the metrically shortest path. Or, it can be a traffic-engineered path that follows a series of strict and loose hops. Either way, R1 is responsible for calculating the routing decisions for the entire path. After R1 calculates the path, it writes the required instructions onto the packet. This allows the packet to traverse your network precisely as you want.
In this situation, source of the path makes routing decisions. Transit routers then simply forward traffic based on the decisions that have already been made by the source router. This differs from a regular IP network where each transit router makes its own local routing decision at every hop. As such, in a segment-routed network, the source router performs source routing.