How Segment Routing Works?

How Segment Routing Works? - Concept

The below figure explains an MPLS network with 8 routers using Segment Routing, IGP IS-IS, a label range of 1000 to 1999 for node IDs, and 2000 and higher for adjacency IDs. ISIS will use sub-TLV extensions to distribute IP prefix reachability alongside segment ID (the MPLS label) across the network.

Kindly note that we are taking the simple label ranges just to understand the concept, however, in real config environment, the label ranges are allocated on the based of Segment Routing Global Block (SRGB) for Prefix or Node SIDs. SRGB is explicitly explained in an another article of this Blog.

Segment Routing

Router R8 advertises its loopback0 ipv4 prefix with attached prefix-SID (or Node SID) 1008 through IGP (OSPF or ISIS) sub-TLV extensions. A Node SID is bound to the SPF like algorithm.

All remote nodes install the Node Segment to  R8 in their forwarding plane.

One Segment is equal to one Label.
Segment List is equal to Label Stack.

As per picture below, for the traffic destined from Router R1 to Router R8 (via shortest path R1-R2-R3-R4-R8 - Segment shown with blue arrow), R1 pushes label 1008 over the packet and send it to R2. Routers R2 and R3 in the path will lookup their forwarding tables and perform Swap operation with same label 1008. PHP Router R4 will perform Pop operation and send packet to R8.

How Segment Routing Works? - Commands (IOS-XR)

To check label pushed on R1 for an IPv4 prefix - show cef
To check label pushed on R1 for an IPv6 Prefix - show cef ipv6 2001::0001:1008/128
To check forwarding plane on other routers (say R2) - show mpls forwarding labels 1008

Another way, Segment identifiers can also be combined as an ordered list (stack of labels) to perform traffic engineering. A segment list can contain several adjacency segments, several node segments, or a combination of both depending on the forwarding requirements. As shown in picture below, Router R1 could alternatively push label stack (1004, 2019) to reach Router R8 using the shortest path (say R1-R2-R3-R4-R7-R8) and all applicable ECMPs to Router D and then through an explicit interface onto the destination. Router R1 does not need to signal the new path, and the state information remains constant in the network. Router R1 ultimately enforces a forwarding policy that determines which flows destined to router R8 are switched through a particular path.  Label 2019 is R7 to R8 Adjacency SID.

Segment Routing

How Segment Routing Works? -  SR Terminology

SR-MPLS: the instantiation of SR on the MPLS dataplane

SRv6: the instantiation of SR on the IPv6 dataplane.

Segment: an instruction a node executes on the incoming packet (e.g.: forward packet according to shortest path to destination, or, forward packet through a specific interface, or, deliver the packet to a given application/service instance).

SID: a segment identifier. Note that the term SID is commonly used in place of the term Segment, though this is technically imprecise as it overlooks any necessary translation.

SR-MPLS SID: an MPLS label or an index value into an MPLS label space explicitly associated with the segment.

SRv6 SID: an IPv6 address explicitly associated with the segment.

Segment Routing Domain (SR Domain): the set of nodes participating in the source based routing model. These nodes may be connected to the same physical infrastructure (e.g.: a Service Provider's network). They may as well be remotely connected to each other (e.g.: an enterprise VPN or an overlay). If multiple protocol instances are deployed, the SR domain most commonly includes all of the protocol instances in a single SR domain. However, some deployments may wish to sub-divide the network into multiple SR domains, each of which includes one or more protocol instances. It is expected that all nodes in an SR Domain are managed by the same administrative entity.

Active Segment: the segment that MUST be used by the receiving router to process the packet. In the MPLS dataplane it is the top label. In the IPv6 dataplane it is the destination address. [I-D.ietf-6man-segment-routing-header].

PUSH: the instruction consisting of the insertion of a segment at the top of the segment list. In SR-MPLS the top of the segment list is the topmost (outer) label of the label stack. In SRv6, the top of the segment list is represented by the first segment in the Segment Routing Header as defined in [I-D.ietf-6man-segment-routing-header].

NEXT: when the active segment is completed, NEXT is the instruction consisting of the inspection of the next segment. The next segment becomes active. In SR-MPLS, NEXT is implemented as a POP of the top label. In SRv6, NEXT is implemented as the copy of the next segment from the SRH to the Destination Address of the IPv6 header.

CONTINUE: the active segment is not completed and hence remains active. In SR-MPLS, CONTINUE instruction is implemented as a SWAP of the top label. [RFC3031] In SRv6, this is the plain IPv6 forwarding action of a regular IPv6 packet according to its Destination Address.

SR Global Block (SRGB): the set of global segments in the SR Domain. If a node participates in multiple SR domains, there is one SRGB for each SR domain. In SR-MPLS, SRGB is a local property of a node and identifies the set of local labels reserved for global segments. In SR-MPLS, using the same SRGB on all nodes within the SR Domain is strongly recommended. Doing so eases operations and troubleshooting as the same label represents the same global segment at each node. In SRv6, the SRGB is the set of global SRv6 SIDs in the SR Domain.

SR Local Block (SRLB): local property of an SR node. If a node participates in multiple SR domains, there is one SRLB for each SR domain. In SR-MPLS, SRLB is a set of local labels reserved for local segments. In SRv6, SRLB is a set of local IPv6 addresses reserved for local SRv6 SID’s. In a controller-driven network, some controllers or applications MAY use the control plane to discover the available set of local segments.

Global Segment: a segment which is part of the SRGB of the domain. The instruction associated to the segment is defined at the SR Domain level. A topological shortest-path segment to a given destination within an SR domain is a typical example of a global segment.

Local Segment: In SR-MPLS, this is a local label outside the SRGB. It MAY be part of the explicitly advertised SRLB. In SRv6, this can be any IPv6 address i.e., the address MAY be part of the SRGB but used such that it has local significance. The instruction associated to the segment is defined at the node level.

IGP Segment: the generic name for a segment attached to a piece of information advertised by a link-state IGP, e.g. an IGP prefix or an IGP adjacency.

IGP-Prefix Segment: an IGP-Prefix Segment is an IGP Segment representing an IGP prefix. When an IGP-Prefix Segment is global within the SR IGP instance/topology it identifies an instruction to forward the packet along the path computed using the routing algorithm specified in the algorithm field, in the topology and the IGP instance where it is advertised. Also referred to as Prefix Segment.

Prefix SID: the SID of the IGP-Prefix Segment.

IGP-Anycast Segment: an IGP-Anycast Segment is an IGP-Prefix Segment which identify an anycast prefix advertised by a set of routers.

Anycast-SID: the SID of the IGP-Anycast Segment.

IGP-Adjacency Segment: an IGP-Adjacency Segment is an IGP Segment attached to a unidirectional adjacency or a set of unidirectional adjacencies. By default, an IGP-Adjacency Segment is local (unless explicitly advertised otherwise) to the node that advertises it. Also referred to as Adjacency Segment.

Adj-SID: the SID of the IGP-Adjacency Segment.

IGP-Node Segment: an IGP-Node Segment is an IGP-Prefix Segment which identifies a specific router (e.g., a loopback). Also referred to as Node Segment.

Node-SID: the SID of the IGP-Node Segment.

SR Policy: an ordered list of segments. The headend of an SR Policy steers packets onto the SR policy. The list of segments can be specified explicitly in SR-MPLS as a stack of labels and in SRv6 as an ordered list of SRv6 SID’s. Alternatively, the list of segments is computed based on a destination and a set of optimization objective and constraints (e.g., latency, affinity, SRLG, ...). The computation can be local or delegated to a PCE server. An SR policy can be configured by the operator, provisioned via NETCONF or provisioned via PCEP [RFC5440] . An SR policy can be used for traffic-engineering, OAM or FRR reasons.

Segment List Depth: the number of segments of an SR policy. The entity instantiating an SR Policy at a node N should be able to discover the depth insertion capability of the node N. For example, the PCEP SR capability advertisement described in [I-D.ietf-pce-segment-routing] is one means of discovering this capability.

Forwarding Information Base (FIB): the forwarding table of a node

Post a comment