locator

Function

The locator command configures an SRv6 locator.

The undo locator command deletes the configured SRv6 locator.

By default, no SRv6 locator is configured.

Format

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 ] ] * ]

Parameters

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.

Views

Segment routing IPv6 view

Default Level

2: Configuration level

Task Name and Operations

Task Name Operations
segr write

Usage Guidelines

Usage Scenario

An SRv6 SID is a 128-bit IPv6 address expressed in the Locator:Function:Args format.

  • The Locator field corresponds to the ipv6-prefix ipv6-address parameter and its length is determined by the prefix-length parameter. A locator identifies an IPv6 subnet on which all IPv6 addresses can be allocated as SRv6 SIDs. After a locator is configured for a node, the system generates a locator route through which other nodes can locate this node. In addition, all SIDs advertised by the node are reachable through the route.
  • The Function field is also called opcode, which can be dynamically allocated using an IGP or be configured using the opcode command. When configuring a locator, you can use the static static-length parameter to specify the static segment length, which determines the number of static opcodes that can be configured in the locator. In dynamic opcode allocation, the IGP allocates opcodes outside the range of the static segment, so that no SRv6 SID conflict occurs.
  • The Args field is determined by the args args-length parameter. It is optional in SRv6 SIDs and depends on command configurations.

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.

  1. locator srv6_locator1 ipv6-prefix 2001:DB8:ABCD:: 64 static 32. In this example, the locator 2001:DB8:ABCD:: is configured, and its length is 64 bits. The static segment occupies 32 bits, the dynamic segment 32 bits, and the Args field 0 bits.
  • Start value of the static segment: 2001:DB8:ABCD:0000:0000:0000:0000:0001
  • End value of the static segment: 2001:DB8:ABCD:0000:0000:0000:FFFF:FFFF
  • Start value of the dynamic segment: 2001:DB8:ABCD:0000:0000:0001:0000:0000
  • End value of the dynamic segment: 2001:DB8:ABCD:0000:FFFF:FFFF:FFFF:FFFF
  1. locator srv6_locator2 ipv6-prefix 2001:DB8:ABCD:: 64 static 24 args 32. In this example, the locator 2001:DB8:ABCD:: is configured, and its length is 64 bits. The static segment occupies 24 bits, the Args field 32 bits, and the dynamic segment 8 bits (128 – 64 – 24 – 32 = 8).
  • Start value of the static segment: 2001:DB8:ABCD:0000:0000:0001::
  • End value of the static segment: 2001:DB8:ABCD:0000:00FF:FFFF::
  • Start value of the dynamic segment: 2001:DB8:ABCD:0000:0100:0000::
  • End value of the dynamic segment: 2001:DB8:ABCD:0000:FFFF:FFFF::
  1. locator srv6_locator3 ipv6-prefix 2001:DB8:ABCD:: 64 static 32 args 32. In this example, the locator 2001:DB8:ABCD:: is configured, and its length is 64 bits. The static segment occupies 32 bits, the Args field 32 bits, and the dynamic segment 0 bits (128 – 64 – 32 – 32 = 0).
  • Start value of the static segment: 2001:DB8:ABCD:0000:0000:0001::
  • End value of the static segment: 2001:DB8:ABCD:0000:FFFF:FFFF::
  • Dynamic segment: does not exist.
  1. locator srv6_locator4 ipv6-prefix 2001:DB8:ABCD:: 64 args 32. In this example, the locator 2001:DB8:ABCD:: is configured, and its length is 64 bits. The static segment occupies 0 bits, the Args field 32 bits, and the dynamic segment 32 bits (128 – 64 – 0 – 32 = 32).
  • Static segment: does not exist.
  • Start value of the dynamic segment: 2001:DB8:ABCD:0000:0000:0001::
  • End value of the dynamic segment: 2001:DB8:ABCD:0000:FFFF:FFFF::

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:

  1. A locator is configured in the global SRv6 view, and the segment-routing ipv6 command is run in the IS-IS process view to enable SRv6 and reference the locator.
  2. IS-IS allocates an End SID to each locator in the dynamic segment based on locator configurations. No-flavor, PSP, and PSP&USP&USD SIDs are allocated.
  3. IPv6 addresses are configured for interfaces and IS-IS IPv6 is enabled. IS-IS allocates no-flavor, PSP, and PSP&USP&USD End.X SIDs to the interfaces in the range of the dynamic segment based on locator configurations.

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 Locator field is divided into the Block and NodeID parts. The Block part indicates the address space of an SRv6 domain, in which different nodes typically have the same block. The NodeID part uniquely identifies a node in an SRv6 domain.
  • The Function field is divided into the Compression Function and Non-compression Function parts. The Compression Function part is divided into the Compression Dynamic segment and Compression Static segment. When configuring SRv6 SRH compression, you can use the compress-static compress-length parameter to specify the length of the Compression Static segment to determine the range of compression static opcodes that can be configured in the corresponding locator. During SRv6 SRH compression, an IGP dynamically allocates opcodes outside the range of the Compression Function part's Compression Static segment to ensure that no SRv6 SID conflict occurs. The Non-compression Function part also consists of a dynamic opcode segment and a static opcode segment, with the ranges of the segments changed.
  • The configuration of the Args field remains unchanged.

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.

  1. locator loc1 ipv6-prefix 2001:DB8:8797:2312:: 64 compress block 48 compress-static 8 static 16. In this example, the locator 2001:DB8:8797:2312:: is configured and its length is 64 bits. The Block segment occupies 48 bits, the NodeID segment 16 bits (64 – 48 = 16), the Compression Static segment 8 bits, the Compression Dynamic segment 8 bits (32 – 16 – 8 = 8), the non-compression static segment 16 bits, and the non-compression dynamic segment 32 bits (128 – 48 – 32 – 16 = 32).
  • Start value of the Compression Static segment: 2001:DB8:8797:2312:0001::
  • End value of the Compression Static segment: 2001:DB8:8797:2312:00FF::
  • Start value of the Compression Dynamic segment: 2001:DB8:8797:2312:0100::
  • End value of the Compression Dynamic segment: 2001:DB8:8797:2312:FFFF::
  • Start value of the non-compression Static segment: 2001:DB8:8797:2312:0000:0000:0000:0001
  • End value of the non-compression Static segment: 2001:DB8:8797:2312:0000:0000:0000:FFFF
  • Start value of the non-compression Dynamic segment: 2001:DB8:8797:2312:0000:0000:0001:0000
  • End value of the non-compression Dynamic segment: 2001:DB8:8797:2312:0000:FFFF:FFFF:FFFF
  1. locator loc2 ipv6-prefix 2001:DB8:8797:2312:: 64 compress block 48 compress-static 16 static 32 args 16. In this example, the locator 2001:DB8:8797:2312:: is configured and its length is 64 bits. The Block segment occupies 48 bits, the NodeID segment 16 bits (64 – 48 = 16), the Compression Static segment 16 bits, the Compression Dynamic segment 0 bits (32 – 16 – 16 = 0), the non-compression static segment 32 bits, and the non-compression dynamic segment 0 bits (128 – 48 – 32 – 32 – 16 = 0).
  • Start value of the Compression Static segment: 2001:DB8:8797:2312:0001::
  • End value of the Compression Static segment: 2001:DB8:8797:2312:FFFF::
  • Compression Dynamic segment: does not exist.
  • Start value of the non-compression Static segment: 2001:DB8:8797:2312:0000:0000:0001::
  • End value of the non-compression Static segment: 2001:DB8:8797:2312:0000:FFFF:FFFF::
  • Non-compression Dynamic segment: does not exist.
  1. locator loc3 ipv6-prefix 2001:DB8:8797:2312:: 64 compress block 48 args 16. In this example, the locator 2001:DB8:8797:2312:: is configured and its length is 64 bits. The Block segment occupies 48 bits, the NodeID segment 16 bits (64 – 48 = 16), the Compression Static segment 0 bits, the Compression Dynamic segment 16 bits (32 – 16 – 0 = 16), the non-compression static segment 0 bits, and the non-compression dynamic segment 32 bits (128 – 48 – 32 – 16 = 32).
  • Compression Static segment: does not exist.
  • Start value of the Compression Dynamic segment: 2001:DB8:8797:2312:0001::
  • End value of the Compression Dynamic segment: 2001:DB8:8797:2312:FFFF::
  • Non-compression Static segment: does not exist.
  • Start value of the non-compression Dynamic segment. 2001:DB8:8797:2312:0000:0000:0001::
  • End value of the non-compression Dynamic segment. 2001:DB8:8797:2312:0000:FFFF:FFFF::

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:

  1. Configure a locator in the global SRv6 view, and run the segment-routing ipv6 command in the IS-IS process view to enable SRv6 and reference the locator.
  2. IS-IS allocates an End SID to each locator within the range of the Compression Dynamic segment based on locator configurations. No-flavor, PSP, PSP-USP-USD, or PSP-USP-USD-COC SIDs are also allocated.
  3. Configure IPv6 addresses for interfaces and enable IS-IS IPv6. IS-IS allocates an End.X SID to each interface within the range of the Compression Dynamic segment based on locator configurations. No-flavor, PSP, PSP-USP-USD, or PSP-USP-USD-COC SIDs are also allocated.

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:

  1. A non-compression locator can be changed to a compression locator. In this case, compression-related parameters (block-length and compress-static-length) can be added only to the original locator, and other parameters cannot be modified.

    For example, locator srv6_locator1 ipv6-prefix 2001:DB8:ABCD:: 64 static 8 can be changed to locator srv6_locator1 ipv6-prefix 2001:DB8:ABCD:: 64 compress block 48 compress-static 8 static 8.
  2. A compression locator can be changed to a non-compression locator. In this case, compression-related parameters (block-length and compress-static-length) can be deleted only from the original locator, and other parameters cannot be modified.

    For example, locator srv6_locator1 ipv6-prefix 2001:DB8:ABCD:: 64 compress block 48 compress-static 8 static 8 can be changed to locator srv6_locator1 ipv6-prefix 2001:DB8:ABCD:: 64 static 8.

    If a compression static opcode is configured, however, changing a compression locator to a non-compression locator is not supported.

Example

# Configure a compressed SRv6 locator.
<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
# Configure an SRv6 locator that uses the flexible algorithm with the identifier 128.
<HUAWEI> system-view
[~HUAWEI] segment-routing ipv6
[*HUAWEI-segment-routing-ipv6] locator test1 ipv6-prefix 2001:DB8:100:: 64 static 32 flex-algo 128
# Configure an SRv6 locator.
<HUAWEI> system-view
[~HUAWEI] segment-routing ipv6
[*HUAWEI-segment-routing-ipv6] locator test1 ipv6-prefix 2001:DB8:100:: 64 static 32
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >