Segment Routing MPLS Fundamentals
Basic Concepts
Segment routing domain: is a set of SR nodes.
Segment ID (SID): uniquely identifies a segment. A SID is mapped to an MPLS label on the forwarding plane.
SRGB: A segment routing global block (SRGB) is a set of local labels reserved for segment routing of users.
Segment Category
Label |
Generation Mode |
Function |
---|---|---|
Prefix Segment |
Manually configured. |
Identifies the prefix of a destination address. An IGP floods it to the other NEs. The prefix segment is visible globally and takes effect globally. Prefix segment identified by the prefix segment ID (SID). A prefix SID is an offset within the SRGB range and advertised by a source node. The receive end uses the local SRGB to compute label values and generate forwarding entries. |
Adjacency Segment |
Allocated by the ingress using a dynamic protocol. It can also be manually configured. |
Identifies an adjacency on a network. An IGP floods it to the other NEs. The adjacency segment is visible globally and takes effect locally. Adjacency segment identified by the adjacency segment ID (SID). The adjacency SID is a local SID out of the SRGB range. |
Node Segment |
Manually configured. |
The node segment, a special prefix segment, identifies a specific node. When an IP address is configured for a loopback interface, the IP address functions as the prefix SID that is a type of node SID. |
In simple words, a prefix segment indicates a destination address, and an adjacency segment indicates a link over which data packets travel. The prefix and adjacency segments are similar to the destination IP address and outbound interface, respectively, in conventional IP forwarding. In an IGP area, a network element (NE) sends extended IGP messages to flood its own node SID and adjacency SID. Upon receipt of the message, any NE can obtain information about the other NEs.
- If segment information at the stack top contains the identifier of another node, the receive end forwards a data packet to a next hop using ECMP.
- If segment information at the stack identifies the local node, the receive end removes the top segment and proceeds with the follow-up procedure.
In actual application, the prefix segment, adjacency segment, and node segment can be used independently or in combinations. The following three main cases are involved.
Prefix Segment
If there are several paths have the same cost, they perform ECMP. If they have different costs, they perform link backup. The prefix segment-based forwarding paths are not fixed, and the ingress cannot control the whole forwarding path.
Adjacency Segment
Adjacency Segment + Node Segment
SR Forwarding Mechanism
SR can be used directly in the MPLS architecture, where the forwarding mechanism remains. SIDs are encoded as MPLS labels. The segment list is encoded as a label stack. The segment to be processed is at the stack top. Once a segment is processed, its label is removed from a label stack.
Label Conflicts and Handling Rules
Prefix segments are manually configured. These settings on different devices may conflict with one another. Label conflicts are as follows:
Prefix conflict: The same prefix is associated with two different SIDs.
SID conflict: The same SID is associated with different prefixes.
If label conflicts occur, handle prefix conflicts before SID conflicts and use the following rules to preferentially select a SID or prefix:
A prefix with a larger mask is preferred.
The prefix of a smaller value is preferred.
A smaller SID is preferred.
For example, label conflicts occur in the following four routes (in the form of prefix/mask SID):
a. 1.1.1.1/32 1
b. 1.1.1.1/32 2
c. 2.2.2.2/32 3
d. 3.3.3.3/32 1
The process of handling the label conflicts is as follows:
Prefix conflicts are handled. Routers a and b lead to a prefix conflict. Route a has a smaller SID than route b. Route a is preferred. After the conflict is handled, the following three routes are selected:
a. 1.1.1.1/32 1
c. 2.2.2.2/32 3
d. 3.3.3.3/32 1
SID conflicts are handled. Routes a and d lead to a SID conflict. Route a has a smaller prefix than route d, route a is preferred. After the conflict is handled, the following two routes are selected:
a. 1.1.1.1/32 1
c. 2.2.2.2/32 3