Overview
Source routing is a technique where the sender of a packet can partially or completely specify a route in a network through which a packet is sent. Segment routing is a form of source routing where nodes and links are represented as segments. The path that a particular packet needs to traverse is represented by one or more segments. The list of segments is inserted into the packet itself and each segment in the path represents a particular node or an adjacency through which the packet needs to pass. The OcNOS implementation of segment routing is based on draft-ietf-spring-segment-routing-09.
A segment can be any instruction, topological or service based.
A segment can be
• Local to an SR node or global within an SR domain.
• IGP-based forwarding construct
• BGP-based forwarding construct
A segment may be associated with topological instructions.
For example:
• A topological local segment may instruct the node to forward the packet via specific outgoing interface.
• A topological global segment may instruct the SR domain to forward the packet via specific path to destination.
A segment may be associated with a service instruction.
• Packet should be processed by a container or Virtual Machine (VM) associated with the segment
They are importantly two kinds of segments.
• Prefix Segment
It is used to forward the packet along the shortest path to reach the prefix. When the prefix is that of the loopback interface which identifies the node and it's called a Node Segment. Prefix Segments are global segments and all the nodes in SR domain has the forwarding entry available for the prefix segment advertised.
• Adjacency Segment
It is used to forward the packet via a specific link to a particular neighbor. It's generally a local segment and only the node which holds the adjacency has the forwarding entry available for that adjacency.
OcNOS uses prefix segments which forward a packet along the shortest path to reach the prefix. Prefix segments are global and all the nodes in the segment routing domain advertise the forwarding entry for the prefix segment. When a prefix is for a loopback interface that identifies a node, it is called a node segment.
Segment routing does not require any additional control plane protocol and is implemented by extending an existing interior gateway protocol (IGP) such as OSPF and ISIS. Segment routing replaces MPLS control plane protocols such as LDP or RSVP.
In OcNOS, MPLS clients such as LDP and RSVP create FEC-to-NHLFE and Incoming Label Map (FTN/ILM) entries by signaling within the MPLS domain. After this, the entries are installed into the MPLS RIB hosted by NSM.
The segment routing framework reuses the existing MPLS framework with OSPF and ISIS which acts as an MPLS client. OSPF and ISIS with segment routing extensions exchanges the segment information within the segment routing domain. These segments are converted to MPLS FTN/ILM entries using a library. After this, the entries are installed into the same MPLS RIB hosted by NSM.
OcNOS supports ISIS and OSPF extensions to achieve segment routing via the MPLS data plane. OcNOS supports prefix segments and adjacency segments.
In segment routing, the path states are maintained only at the ingress node and the path to follow is pushed into the packet itself. The transit and egress nodes do not maintain state for each path traversing through them. The configuration overhead is less than traditional MPLS.
The major benefits of segment routing are as follows.
1. Simplified
• When applied to the MPLS data plane, Segment Routing offers the ability to tunnel MPLS services (VPN, VPLS, and VPWS) from an ingress provider edge to an egress provider edge without any other protocol than an IGP (ISIS or OSPF).
• Simpler operation without separate protocols for label distribution (for example, no LDP or RSVP)
• No complex LDP or IGP synchronization to troubleshoot.
2. Ready for SDN
• Segment Routing is a compelling architecture that supports Software-Defined Network (SDN) and is the foundation for Application Engineered Routing (AER).
• It strikes a balance between network-based distributed intelligence, such as automatic link and node protection, and controller-based centralized intelligence, such as traffic optimization
3. Scalable
• Avoid thousands of labels in LDP database.
• Avoid thousands of MPLS Traffic Engineering LSPs in the network.
• Avoid thousands of tunnels to configure.
4. Supports Fast Reroute (FRR)
• The traditional LFA and RLFA technologies have topology constraints that mean they are unable to implement 100% fault protection
• Segment routing provides Topology Independent Loop Free Alternate (TI-LFA) as its main solution for FRR.
• In case of link or node failures in a network, MPLS uses the FRR mechanism for convergence
Segment Routing Global Block
The Segment Routing Global Block (SRGB) is a local property of a segment routing node. In the context of MPLS, it is a set of “local labels” for global segments.
By default, OcNOS uses the same local label range (16000-23999) for all the segment routing nodes for SRGB.
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 identical SRGBs 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.
When SRGB is not configured, the system reserves a default label range.
The SRGB default value is 16000 to 23999. The SRGB can be configured as follows:
Note: Make sure that the labels in the SRGB label range are not used by any other protocols (LDP, RSVP, BGP, static LSP, ISIS-SR policy, OSPF-SR policy). To check the label ranges configured for each of the protocols use show mpls label-space 0 and re-configure the SRGB label range with a label range that is available.
SRGB in global mode:
#conf t
(config)#segment-routing
(config-sr)#global block 30000 50000
SRGB declared in global mode can be used by either ISIS or OSPF if they do not have configured SRGB in their respective routing process level.
SRGB under ISIS:
(config)#router isis isis1
(config-router)#isis segment-routing global block <16-1048575>
SRGB under OSPF:
(config)#router ospf 1
(config-router)#ospf segment-routing global block <16-1048575>
Segment Identifiers
Segments are identified by a Segment Identifier (SID) which is an unsigned 32-bit integer. Because the MPLS data plane is used, the segments are identified by a 20-bit integer, leaving the 12 left-most bits of the SID unused. A SID has an absolute value and index (label) allocated for the segment. Because the SRGB is the same across the entire domain, all nodes identify the segment with the same absolute value.
Prefix SID Absolute Value
Specify an absolute SID-value for each node to create a specific prefix SID within the configured SRGB range.
When a Prefix-SID is configured as absolute, the same value is used for packet-switching.
(config-if)#prefix-sid absolute <16-1048575>
Prefix SID Index Value
Specify an index SID-index for each node to create a prefix SID based on the lower boundary of the SRGB and the index.
(config-if)#prefix-sid index <0-1048575>
This index value will be used for calculating absolute MPLS label by adding base value of SRGB. In case of default SRGB (16000-23999) if index value is 1000, the MPLS label value will (16000 + 1000) = 17000.
Forwarding Example with SIDs
Figure 1-1 shows an example of forwarding a packet using a prefix SID.
Forwarding example
1. If ingress node R1 receives packet destined for R7 with no SR label stack in packet header, the packet will get forwarded to R7 along the IGP shortest-path (R1-R2-R3-R7).
2. If the packet was received with SR label stack of [16005], R1 inspects the top label which is 16005. 16005 is the node SID associated with R5 and so this tells R1 to forward the packet along IGP shortest-path to R5 (R1-R2-R5 or R1-R4-R5). The next hop node (R2 or R4) does the same action as R1. On receiving the packet, R5 inspects the top label which is 16005 and since it matches its node SID, it pops the top label. There are no more labels in the stack and R5 forwards the packet to R7 along the IGP shortest-path (R5-R6-R7).
3. If the packet was received with SR label stack of [16006, 24067], R1 inspects the top label which is 16006 and because that is the node SID associated with R6, R1 forwards the packet along the IGP shortest-path to R6 (R1-R2-R3-R6, R1-R2-R5-R6 or R1-R4-R5-R6). R6 inspects the top label which is 16006 and because it matches its node SID, R6 pops the top label and inspects the next label which is 24067. 24067 is the adjacency SID associated with R6's adjacency with R7 so this tells R6 to pop the label and forward the packet over its link connected to R7.