Label Space in Segment Routing MPLS
Overview
Segment Routing is a protocol designed to forward data packets on a network based on source routes. Segment Routing MPLS is implemented based on the MPLS forwarding plane. Segment Routing MPLS divides a network path into several segments and assigns a segment ID (SID) to each segment and forwarding node. The segments and nodes are sequentially arranged into a segment list to form a forwarding path.
Segment Routing MPLS uses multiple SIDs. These SIDs are MPLS labels on the forwarding plane. SID planning directly affects network expansion and O&M. Improper planning may lead to network adjustments. Therefore, before deploying Segment Routing MPLS, you need to know the types, configuration methods, and range of SIDs in Segment Routing MPLS, and also understand the relationship between the SID range and MPLS LDP/RSVP-TE label range.
MPLS Label Range
SIDs are also MPLS labels. Therefore, the SID range is restricted by the MPLS label range. An MPLS label has 4 bytes. Figure 1-1 shows the structure of an MPLS label.
An MPLS label contains the following fields:
Label: a 20-bit field that identifies a label value. The total number of labels is 2 raised to the power of 20, that is, 1048576. However, the actual label value ranges from 0 to 1048575, which is determined by the label space. Therefore, neither MPLS label values nor Segment Routing MPLS SIDs can exceed 1048575. The maximum label value varies according to the device type and may not reach 1048575 for many devices. In Segment Routing MPLS configuration for a device, you need to obtain the specific label range before planning a label space.
Exp: a 3-bit field used for extension. This field is used to implement the class of service (CoS) function that is similar to Ethernet 802.1p.
S: a 1-bit field that identifies the bottom of a label stack. MPLS supports multiple labels that may be stacked. If the S field of a label is set to 1, the label is at the bottom of the label stack.
TTL: an 8-bit field indicating a time to live (TTL) value. This field is the same as the TTL field in IP packets.
SIDs Used by Segment Routing MPLS
Segment Routing MPLS uses multiple types of SIDs, such as prefix SIDs, node SIDs, adjacency SIDs, Segment Routing mapping server (SRMS) SIDs, binding SIDs, and BGP egress peer engineering (EPE) SIDs. The functions of these SIDs are as follows:
- Prefix SID: identifies the prefix of a destination address. A prefix SID is an offset within the Segment Routing global block (SRGB) range, and it is advertised by a source node. The receive end uses the local SRGB to compute label values and then generates MPLS forwarding entries. An IGP propagates the prefix SID to the other NEs. The prefix SID is visible and takes effect globally.
- Node SID: identifies a specific network node. When an IP address is configured for a loopback interface of a node, the IP address functions as a node SID. An IGP propagates the node SID to the other NEs. The node SID is visible and takes effect globally.
- Adjacency SID: identifies an adjacency on a network. An adjacency SID is a local SID that is outside of the SRGB range. It can either be configured manually or be assigned by an IGP dynamically. An IGP propagates the adjacency SID to the other NEs. The adjacency SID is visible globally but takes effect locally.
- SRMS SID: used to map prefixes in the LDP domain to SIDs and advertises the SIDs with prefixes to the Segment Routing domain in a Segment Routing and LDP interworking scenario. An SRMS SID is calculated within the SRGB range based on the SRGB offset.
- Binding SID: used to bind traffic to a specified SR-TE tunnel or SR Policy. A binding SID can also be used to calculate an inter-AS E2E SR-TE tunnel.
- BGP EPE SID: indicates the peer-node SID, peer-Adj SID, or peer-set SID assigned by BGP EPE to a peer.
A peer-node SID identifies a peer node. The peers at both ends of each BGP session are assigned peer-node SIDs. An EBGP peer relationship established based on loopback interfaces may traverse multiple physical links. In this case, the peer-node SID of a peer is mapped to multiple outbound interfaces. Traffic can be forwarded through any outbound interface or be balanced by multiple outbound interfaces.
A peer-Adj SID identifies an adjacency to a peer. An EBGP peer relationship established based on loopback interfaces may traverse multiple physical links. In this case, each adjacency is assigned a peer-Adj SID. Only a specified link (mapped to a specified outbound interface) can be used for forwarding.
A peer-set SID identifies a group of peers that are planned as a set. BGP allocates a peer-set SID to the set. Each peer-set SID can map multiple outbound interfaces during forwarding. Because one peer set consists of multiple peer nodes and peer adjacencies, the SID allocated to a peer set is mapped to multiple peer-node SIDs and peer-Adj SIDs.
Prefix and node SIDs are within the local SRGB range, and binding SIDs are within the local Segment Routing local block (SRLB) range. However, adjacency and BGP EPE SIDs are configured within an unfixed static label range that is associated with the dynamic label range of the involved device.
Both the SRGB and SRLB contain locally reserved static labels. Except for the reserved MPLS label range (0 to 15) and the static label range, only a dynamic label range shared by Segment Routing MPLS and MPLS LSP/RSVP-TE is left in the label space.
The label space for each device is fixed. If MPLS LSP/RSVP-TE traffic on a device is heavy, a large number of labels are used, occupying some label space used for Segment Routing MPLS.
SID Configuration for Segment Routing MPLS
I. Prefix SID and node SID (IS-IS as an example)
a. Enable Segment Routing globally.
Run the system-view command to enter the system view.
Run the segment-routing command to enter the Segment Routing view.
Run the commit command to make the configuration take effect.
b. Configure an SRGB.
Run the system-view command to enter the system view.
Run the isis [ process-id ] command to start a specified IS-IS process and enter the IS-IS view.
Run the network-entity net command to set a network entity name.
Run the cost-style { wide | compatible | wide-compatible } command to configure the IS-IS wide metric attribute.
This configuration enables IS-IS processes to use TE.
Run the segment-routing mpls command to enable Segment Routing for IS-IS.
Run the segment-routing global-block begin-value end-value command to specify an SRGB range for the current IS-IS instance.
If the system displays a message indicating that the desired SRGB range has been occupied, run the display segment-routing global-block command to check the available SRGB range. Alternatively, delete the configuration that occupies the SRGB range to release label space.
# Display the available SRGB range.
<HUAWEI> display segment-routing global-block Segment Routing Global Block ---------------------------------- Lower SID Upper SID Total ------------------------------------------------------ 10000 29999 20000
Run the commit command to make the configuration take effect.
c. Configure a Segment Routing prefix SID.
Run the system-view command to enter the system view.
Run the interface loopback loopback-number command to create a loopback interface and enter the loopback interface view.
Run the isis enable [ process-id ] command to enable IS-IS on the loopback interface.
Run the ip address ip-address { mask | mask-length } command to configure an IP address for the loopback interface.
Run the isis prefix-sid { absolute sid-value | index index-value } [ node-disable ] command to configure a SID for the IP address of the loopback interface.
Run the commit command to make the configuration take effect.
II. Adjacency SID (IS-IS as an example)
After IS-IS Segment Routing is enabled, an adjacency SID is automatically generated. To disable the automatic generation of adjacency SIDs, run the segment-routing auto-adj-sid disable command. The adjacency SID may change after a device restart. If an explicit path uses an adjacency SID and the associated device is restarted, this adjacency SID must be reconfigured. You can also manually configure an adjacency SID for an explicit path. The configuration procedure is as follows:
- Run the system-view command to enter the system view.
- Run the segment-routing command to enter the Segment Routing view.
- Run the ipv4 adjacency local-ip-addr local-ip-address remote-ip-addr remote-ip-address sid sid-value command to configure an adjacency SID manually.
- Run the commit command to make the configuration take effect.
III. SRMS SID
- Run the system-view command to enter the system view.
- Run the segment-routing command to enter the Segment Routing view.
- Run the mapping-server prefix-sid-mapping ip-address mask-length begin-value [ range range-value ] [ attached ] command to map prefixes and SIDs.
- Run the commit command to make the configuration take effect.
IV. Binding SID
In an E2E SR-TE scenario, perform the following steps:
- Run the system-view command to enter the system view.
- Run the interface tunnel tunnel-number command to enter the intra-AS SR-TE tunnel interface view.
- Run the mpls te binding-sid label label-value command to configure a binding SID for the intra-AS SR-TE tunnel.
- Run the commit command to make the configuration take effect.
In an SR Policy scenario, perform the following steps:
- Run the system-view command to enter the system view.
- Run the segment-routing command to enable Segment Routing globally and enter the Segment Routing view.
- Run the local-block begin-value end-value command to specify an SRLB range.
If the system displays a message indicating that the desired SRLB range has been occupied, run the display segment-routing local-block command to check the available SRLB range. Alternatively, delete the configuration that occupies the SRLB range to release label space.
# Display the available SRLB range.
<HUAWEI> display segment-routing local-block 5000 Segment Routing Local Block Information ------------------------------------------------- Begin Value End Value Range ------------------------------------------------------------- 48120 152770 104651 156502 212657 56156 212979 321535 108557 524288 1048575 524288
- Run the sr-te policy policy-name command to create an SR Policy and enter the SR Policy view.
- Run the binding-sid label-value command to configure a binding SID for the SR Policy. The value of label-value must be within the range defined by local-block begin-value end-value.
V. BGP EPE SID
- Run the system-view command to enter the system view.
- Run the segment-routing command to enable Segment Routing.
- Run the quit command to return to the system view.
- Run the bgp { as-number-plain | as-number-dot } command to enable BGP and enter the BGP view.
- Run the peer ipv4-address as-number { as-number-plain | as-number-dot } command to create a BGP peer.
- Run the peer ipv4-address egress-engineering [ label static-label ] command to enable the BGP EPE function.
- Run the egress-engineering peer-set peer-set-name [ label static-label ] command to create a BGP peer set.
- Run the peer ipv4-address peer-set name peer-set-name command to add a specified peer to the BGP peer set.
- Run the commit command to make the configuration take effect.
PAF Options Related to Segment Routing MPLS SIDs
The NE40E is used as an example to describe the PAF options related to Segment Routing MPLS SIDs. The values of PAF options vary according to the device.
MPLS PAF options can be queried using the display paf command. For example:
<HUAWEI> display paf | include GRESM Info: It will take a long time if the content you search is too much or the string you input is too long, you can press CTRL_C to break. ---------------------------------------------------------------------------------------------------------------------- PafName PafValue Description ---------------------------------------------------------------------------------------------------------------------- SPEC_RES_GRESM_MIN_LABEL 32784 Min number for gresm label SPEC_RES_GRESM_MAX_LABEL 331775 Max number for gresm label, the default value defined by product SPEC_RES_GRESM_STATIC_LABEL_MIN 16 Min number for gresm static label, the default value defined by product SPEC_RES_GRESM_STATIC_LABEL_MAX 32783 Max number for gresm static label, the default value defined by product SPEC_FUNC_GRESM_GRACEFUL_RELEASE_ENABLED 1 Whether support gresm graceful release resource feature(0: disable, 1: enable) SPEC_RES_GRESM_BLOCK_LABEL_MIN 368640 Min number for gresm block label, the default value defined by product SPEC_RES_GRESM_BLOCK_LABEL_MAX 394239 Max number for gresm block label, the default value defined by product SPEC_RES_GRESM_LABEL_RESERVE_LEN 10240 The length of reserve label SPEC_RES_GRESM_MIN_LABEL2 524288 Min number for gresm label SPEC_RES_GRESM_MAX_LABEL2 1048575 Max number for gresm label, the default value defined by product ----------------------------------------------------------------------------------------------------------------------
The Segment Routing MPLS-related PAF options displayed in the display paf | include GRESM command output are as follows:
- SPEC_RES_GRESM_MIN_LABEL: minimum value of a dynamic label
- SPEC_RES_GRESM_MAX_LABEL: maximum value of a dynamic label
- SPEC_RES_GRESM_STATIC_LABEL_MIN: minimum value of a static label
- SPEC_RES_GRESM_STATIC_LABEL_MAX: maximum value of a static label
- SPEC_RES_GRESM_LABEL_RESERVE_LEN: length of a static SR-TE label range
- SPEC_RES_GRESM_MIN_LABEL2: start value of the second dynamic label range
- SPEC_RES_GRESM_MAX_LABEL2: end value of the second dynamic label range
Segment Routing PAF options, including the SEGR module, SRGB, and SRLB PAF options, can also be queried using the display paf command. For example:
<HUAWEI> display paf | include SEGR Info: It will take a long time if the content you search is too much or the string you input is too long, you can press CTRL_C to break. ---------------------------------------------------------------------------------------------------------------------- PafName PafValue Description ---------------------------------------------------------------------------------------------------------------------- SPEC_RES_SEGR_LABEL_STACK_NUM 10 The layer number of the label stack SPEC_RES_SEGR_ADJ_NUM 4000 The max number of the label SPEC_RES_SEGR_MAX_LABEL 331775 The max label value of segment-routing, the default value defined by product ----------------------------------------------------------------------------------------------------------------------
The PAF options displayed in the display paf | include SEGR command output are as follows:
- SPEC_RES_SEGR_LABEL_STACK_NUM: maximum SID depth (MSD) of Segment Routing MPLS packets
- SPEC_RES_SEGR_ADJ_NUM: number of adjacency SIDs
- SPEC_RES_SEGR_MAX_LABEL: maximum value of a Segment Routing label, which is equal to the value of SPEC_RES_GRESM_MAX_LABEL
<HUAWEI> display paf | include SRGB Info: It will take a long time if the content you search is too much or the string you input is too long, you can press CTRL_C to break. ---------------------------------------------------------------------------------------------------------------------- PafName PafValue Description ---------------------------------------------------------------------------------------------------------------------- SPEC_RES_SRGB_LABEL_MIN 16000 The begin value of the SRGB label range range SPEC_RES_SRGB_LABEL_MAX 47999 The end value of the SRGB label range SPEC_RES_OSPF_SRGB_CONFIG_SIZE 65535 The config size of SRGB for OSPF instance SPEC_FUN_ISIS_SRGB_CONFIG_SIZE 65535 The config size of SRGB for ISIS instance SPEC_FUN_SRGB_RESERVE_SIZE 131072 The reserve size of SRGB SPEC_RES_SRGB_CONFIG_BEGIN 16000 The begin value of the SRGB label configuration range ----------------------------------------------------------------------------------------------------------------------
The PAF options displayed in the display paf | include SRGB command output are as follows:
- SPEC_RES_SRGB_LABEL_MIN: start value of the reserved SRGB range
- SPEC_RES_SRGB_LABEL_MAX: end value of the reserved SRGB range
- SPEC_RES_OSPF_SRGB_CONFIG_SIZE: maximum SRGB length supported by a single OSPF process
- SPEC_FUN_ISIS_SRGB_CONFIG_SIZE: maximum SRGB length supported by a single IS-IS process
- SPEC_FUN_SRGB_RESERVE_SIZE: length of a reserved SRGB range (This PAF option has been deleted since V800R011C00, and the SRGB range can be specified using [SPEC_RES_SRGB_CONFIG_BEGIN, SPEC_RES_GRESM_MAX_LABEL].)
- SPEC_RES_SRGB_CONFIG_BEGIN: start value in an SRGB range
<HUAWEI> display paf | include SRLB Info: It will take a long time if the content you search is too much or the string you input is too long, you can press CTRL_C to break. ---------------------------------------------------------------------------------------------------------------------- PafName PafValue Description ---------------------------------------------------------------------------------------------------------------------- SPEC_FUN_SRLB_CONFIG_SIZE 65535 The config size of SRLB for each VR ----------------------------------------------------------------------------------------------------------------------
The PAF option displayed in the display paf | include SRLB command output is as follows:
SPEC_FUN_SRLB_CONFIG_SIZE: maximum SRLB length supported by a system
Figure 1-2 shows the relationships between the PAF options.
As shown in the preceding figure:
- 0–15: a special label range reserved for MPLS. For example, the common implicit null label (label 3) is within this range.
- 16–32783: a static label range. Certain static CR-LSPs and static LSPs use labels in this range. BGP EPE labels also fall into this range. For example, you can run the peer ipv4-address egress-engineering [ label static-label ] or egress-engineering peer-set peer-set-name [ label static-label ] command to configure a BGP EPE label.
- Dynamic label ranges: are used for dynamic signaling protocols, such as LDP, RSVP-TE, MP-BGP, and IGP.
- The remaining label range is used for other features.
A static label range and a dynamic label range of MPLS make up the first dynamic label range of Segment Routing MPLS. The static label range of Segment Routing MPLS is equal to the remaining part of the dynamic label range of MPLS. This range is used for static adjacency SIDs. You can configure a static adjacency SID using the ipv4 adjacency local-ip-addr local-ip-address remote-ip-addr remote-ip-address sid sid-value command.
The two dynamic label ranges of Segment Routing MPLS are both configurable SRGB ranges. The first dynamic Segment Routing label range contains a reserved SRGB range. No conflict occurs if you configure an SRGB in this range.
The ranges of different Segment Routing MPLS SIDs are as follows:
- Prefix SID: The value of a prefix SID is calculated based on the offset in the SRGB range. The SRGB range is determined by [SPEC_RES_SRGB_CONFIG_BEGIN, SPEC_RES_SEGR_MAX_LABEL - SPEC_RES_GRESM_LABEL_RESERVE_LEN].
- Node SID: The calculation method and the SRGB range of node SIDs are similar to those of prefix SIDs.
- Adjacency SID: The value of a static adjacency SID is determined by [SPEC_RES_SEGR_MAX_LABEL - SPEC_RES_GRESM_LABEL_RESERVE_LEN + 1, SPEC_RES_SEGR_MAX_LABEL]. The value of an adjacency SID dynamically assigned by an IGP is determined by [SPEC_RES_SRGB_LABEL_MAX + 1, SPEC_RES_GRESM_MAX_LABEL]. You can run the display isis peer verbose command to check the adjacency SID assigned by IS-IS and the display ospf peer neighbor-id command to check the adjacency SID assigned by OSPF.
- SRMS SID: The calculation method and the SRGB range of SRMS SIDs are similar to those of prefix SIDs.
- Binding SID: needs to be configured in the SRLB range. The start value of an SRLB is SPEC_RES_SRGB_LABEL_MAX + 1. The maximum SRLB length is 65535.
- BGP EPE SID: needs to be configured in the static label range, and is determined by [SPEC_RES_GRESM_STATIC_LABEL_MIN, SPEC_RES_GRESM_STATIC_LABEL_MAX], that is, the range from 16 to 32783.
SRGB Range
In an IGP scenario, you can run the segment-routing global-block command to configure an SRGB range. If this command is not run, no SR-BE tunnel can be generated.
Use a router as an example. The SRGB range is as follows:
- The SRGB range is determined by PAF options [SPEC_RES_SRGB_CONFIG_BEGIN, SPEC_RES_SEGR_MAX_LABEL – SPEC_RES_GRESM_LABEL_RESERVE_LEN]. Here:
SPEC_RES_SRGB_CONFIG_BEGIN specifies the start value of an SRGB. The value is 16000 for most devices.
SPEC_RES_SEGR_MAX_LABEL specifies the maximum value of a Segment Routing MPLS label.
SPEC_RES_GRESM_LABEL_RESERVE_LEN specifies the length of a static label range reserved for SR-TE.
- For certain devices, such as the NE40E, the SRGB range is determined by [SPEC_RES_GRESM_MIN_LABEL2, SPEC_RES_GRESM_MAX_LABEL2]. Here:
SPEC_RES_GRESM_MIN_LABEL2 specifies the start value of the second dynamic label range.
SPEC_RES_GRESM_MAX_LABEL2 specifies the end value of the second dynamic label range.
- It is recommended that the SRGB range be [16000, 23999]. This range facilitates interworking with third-party devices. To simplify network O&M, you are advised to configure the same SRGB for all devices.
- [SPEC_RES_SRGB_LABEL_MIN, SPEC_RES_SRGB_LABEL_MAX] is preferentially used as the SRGB range of most Huawei devices and cannot be used by other dynamic protocols. Therefore, to minimize configuration conflicts, you are advised to use labels in this range and set the same SRGB for all devices.
SPEC_RES_SRGB_LABEL_MIN specifies the start value of a reserved SRGB range. The value is 16000 for most devices.
SPEC_RES_SRGB_LABEL_MAX specifies the end value of a reserved SRGB range. The value is 47999 for most devices.
- If the system displays a message indicating that the desired SRGB range has been occupied, run the display segment-routing dynamic global-block command to check the available SRGB range. Alternatively, delete the configuration that occupies the SRGB range to release label space. Note that deleting the configuration affects existing services.
# Display SRGB ranges locally reserved for Segment Routing.
<HUAWEI> display segment-routing dynamic global-block 2000 Segment Routing Dynamic Global Block Information -------------------------------------------------- Begin Value End Value Range -------------------------------------------------------------- 153616 156245 2630 156502 284687 128186
- The maximum SRGB length supported by a single IS-IS process and that supported by a single OSPF process are determined by PAF options SPEC_FUN_ISIS_SRGB_CONFIG_SIZE and SPEC_RES_OSPF_SRGB_CONFIG_SIZE, respectively. Generally, the maximum length is 65535.
SRLB Range
Use a router as an example. The SRLB range is as follows:
- Generally, the start value of an SRLB is calculated using the formula shown below. If an available start value is greater than the calculated value, the start value is used. The start value is 48000 for most devices.
Formula: SPEC_RES_SRGB_LABEL_MAX + 1
- An SRLB range is obtained by deducting the value of SPEC_RES_SRGB_LABEL_MAX from a configurable range.
- The maximum SRLB length supported by each system is determined by PAF option SPEC_FUN_SRLB_CONFIG_SIZE. Generally, the maximum length is 65535.
- SRGB and SRLB ranges are mutually exclusive. That is, the two ranges cannot overlap with each other. If they overlap, an error message is displayed, indicating that SRLB configuration fails.
- If the system displays a message indicating that the desired SRLB range has been occupied, run the display segment-routing local-block command to check the available SRLB range. Alternatively, delete the configuration that occupies the SRLB range to release label space. Note that deleting the configuration affects existing services.
Label Conflicts and Handling Rules
Label conflicts, such as prefix conflicts, may occur on the network. Proper network planning helps avoid such conflicts.
Because prefix SIDs are manually configured, they may conflict on different devices. Label conflicts consist of prefix conflicts and SID conflicts. A prefix conflict indicates that the same prefix is associated with different SIDs, whereas a SID conflict indicates that the same SID is associated with different prefixes.
If label conflicts occur, prefix conflicts are handled prior to SID conflicts. Then, the following rules are observed to preferentially select a SID or prefix:
- A prefix with a larger mask is preferred.
- A prefix with a smaller value is preferred.
- A smaller SID is preferred.
For example, label conflicts occur in the following four routes expressed in the prefix/mask length SID format:
- 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 first. Routes a and b encounter a prefix conflict. Route a has a smaller SID than route b. Therefore, route a is preferred. After route b is excluded, the following three routes are left:
- a. 1.1.1.1/32 1
- c. 2.2.2.2/32 3
- d. 3.3.3.3/32 1
SID conflicts are then handled. Routes a and d encounter a SID conflict. Route a has a smaller prefix than route d. Therefore, route a is preferred. After route d is excluded, the following two routes are left:
- a. 1.1.1.1/32 1
- c. 2.2.2.2/32 3
Summary
This document focuses on the following items:
- Functions, configuration methods, and value ranges of SIDs in Segment Routing MPLS.
- Functions of MPLS and Segment Routing PAF options, and the impacts of the PAF options on SRGB and SRLB configuration. The values of PAF options vary according to the device.
- The maximum SRGB length supported by a single IGP process and the maximum SRLB length supported by a single system are both 65535. The recommended SRGB range is [16000, 47999]. To facilitate interworking with third-party devices, you are advised to configure an SRGB within the range of [16000, 23999]. For an SRLB range, using 48000 as the start value is recommended.
In actual deployment, you need to properly configure SIDs for the local device and avoid prefix SID conflicts between different devices. During the configuration, check whether conflict alarms or logs, such as OSPF_1.3.6.1.4.1.2011.5.25.353.2.1 hwSrPrefixSidConflict, OSPF/3/hwSrPrefixSidConflict_active, and ISIS/4/IS_PREFIX_SID_CONFLICT, are generated. If yes, handle the conflict according to relevant handling suggestions.
Related Information
For more information and detailed configuration procedures about Segment Routing MPLS, see the following documents: