The locator command configures an SRv6 locator.
The undo locator command deletes the configured SRv6 locator.
By default, no SRv6 locator is configured.
locator locator-name [ ipv6-prefix ipv6-address mask-length [ [ static static-length ] | [ args args-length ] | [ flex-algo flexAlgoId ] ] * ]
locator locator-name [ ipv6-prefix ipv6-address mask-length compress block block-length [ [ compress-static compress-length ] | [ static static-length ] | [ args args-length ] | [ flex-algo flexAlgoId ] ] * ]
undo locator locator-name [ ipv6-prefix ipv6-address mask-length [ [ static static-length ] | [ args args-length ] | [ flex-algo flexAlgoId ] ] * ]
undo locator locator-name [ ipv6-prefix ipv6-address mask-length compress block block-length [ [ compress-static compress-length ] | [ static static-length ] | [ args args-length ] | [ flex-algo flexAlgoId ] ] * ]
Parameter | Description | Value |
---|---|---|
locator-name |
Specifies the name of a SID node route locator. |
The value is a string of 1 to 31 case-sensitive characters. When double quotation marks are used around the string, spaces are allowed in the string. |
ipv6-prefix ipv6-address |
Specifies the prefix of an IPv6 address. |
The value is a 32-digit hexadecimal number, in the format of X:X:X:X:X:X:X:X. |
mask-length |
Specifies the IPv6 address mask. |
The value is an integer that ranges from 32 to 120. |
static static-length |
Specifies a static segment length. This parameter specifies the static segment length in the Function. The static segment length determines how many static Opcodes can be configured under this Locator. For details, refer to the Usage Guidelines field of this command. |
The value is an integer that ranges from 1 to 96. |
args args-length |
Specifies an arguments segment length. The arguments segment is at the end of the SID. If the args args-length parameter is configured, the arguments segment is reserved. The static or generated dynamic SID is not occupied by the configuration. |
The value is an integer that ranges from 1 to 64. The total length specified using <i>prefix-length</i>, <i>static-length</i>, and <i>args-length</i> cannot exceed 128. |
flex-algo flexAlgoId |
Specifies a flexible algorithm identifier. |
The value is an integer that ranges from 128 to 255. |
compress |
Specifies the compression function. |
- |
block block-length |
Specifies the length of a block. |
The value is an integer that ranges from 4 to 88. |
compress-static compress-length |
Specifies the length of the compressed static segment. |
The value is an integer that ranges from 1 to 32. |
Usage Scenario
An SRv6 SID is a 128-bit IPv6 address expressed in the Locator:Function:Args format.
The relationship between the preceding fields is as follows:
|------Locator-----|-------Dynamic Opcode-------|-------Static Opcode-------|-Args-|
In static configuration mode, SIDs occupy only the static segment with values starting from 1, and the dynamic segment is set to 0. In dynamic allocation mode, SIDs occupy both the dynamic segment and static segment. The values in the dynamic segment start from 1, and those in the static segment start from 0. The following describes how SIDs are generated based on different combinations of parameters.During SRv6 SID allocation, if a static opcode is configured, the static opcode is preferentially used to form a static SID. If no static opcode is configured, a SID is dynamically allocated. The process of SRv6 SID allocation using IS-IS is as follows:
After an SRv6 SID is generated, it is added to the local SID table and can be advertised using IS-IS.
To implement SRv6 SRH compression, an SRv6 SID needs to be divided using the Locator:Compression Function:Non-compression Function:Args format.
The relationship between the preceding fields is as follows:
|-Block-|-NodeID-|-Compression Dynamic-|-Compression Static-|-Dynamic-|-Static-|-Args-| A compressed SID is fixed at 32 bits. It consists of a node ID and a compression function. The length of the Compression Static part is configurable, and the length of the Compression Dynamic part is obtained by deducting the NodeID and Compression Static lengths from 32. For locators configured with the compress parameter, you can use the static static-length parameter to specify the length of the non-compression static segment. The length of the non-compression dynamic segment is obtained by deducting the Block length, 32, Static Length, and ArgLength from 128. During SRv6 SRH compression configuration, SIDs occupy only the range of the Compression Static segment. The value of the Compression Static segment starts from 1, and that of the Compression Dynamic segment is set to 0. In dynamic allocation mode, SIDs occupy both the Compression Dynamic segment and Compression Static segment. The values in the Compression Dynamic segment start from 1, and those in the Compression Static segment start from 0. In addition, the values after the compression Function field are all set to 0.The following describes how SIDs are generated based on different combinations of configuration parameters.
During SRv6 SRH compression, if a static compression opcode is configured, this opcode is preferentially used to form SIDs. If no static compression opcode is configured, SRv6 SIDs are dynamically allocated. The following uses IS-IS as an example to describe the SRv6 SID allocation process:
After an SRv6 SID is generated, it is added to the local SID table and can be advertised using IS-IS.
Precautions
To implement evolution from traditional SRv6 to G-SRv6, locators support modification.
If the locator referenced by a protocol (such as IS-IS) is changed, the SID dynamically allocated by the protocol changes, causing a service interruption. Locator modification rules are as follows:<HUAWEI> system-view [~HUAWEI] segment-routing ipv6 [*HUAWEI-segment-routing-ipv6] locator test1 ipv6-prefix 2001:DB8:111:: 64 compress block 48 compress-static 8 static 32 arg 4
<HUAWEI> system-view [~HUAWEI] segment-routing ipv6 [*HUAWEI-segment-routing-ipv6] locator test1 ipv6-prefix 2001:DB8:100:: 64 static 32 flex-algo 128
<HUAWEI> system-view [~HUAWEI] segment-routing ipv6 [*HUAWEI-segment-routing-ipv6] locator test1 ipv6-prefix 2001:DB8:100:: 64 static 32