opcode end

Function

The opcode end command configures a static SRv6 End SID opcode.

The undo opcode end command deletes a static SRv6 End SID opcode.

By default, no static SRv6 End SID opcode is configured.

Format

opcode func-opcode end { no-flavor | psp | psp-usp-usd }

undo opcode func-opcode end [ no-flavor | psp | psp-usp-usd ]

Parameters

Parameter Description Value
func-opcode

Specifies the operation code of an static SRv6 End SID.

The value is a 32-digit hexadecimal number, in the format of X:X:X:X:X:X:X:X.

no-flavor

Cancels the flavor attribute. After this parameter is configured, only the USP (last segment of SRH pops up) tag is available by default.

-

psp

Specifies the PSP flag.

-

psp-usp-usd

Specifies the PSP, USP, and USD flags. The PSP flag indicates that the penultimate segment of an SRH is popped up. The USP flag indicates that the last segment of an SRH is popped up. The USD flag indicates that the last segment of an SRH is decapsulated, that is, the IPv6 header and all extension headers are popped up.

The USD flag is often used in scenarios where an SRv6 TE Policy does not have a service SID (for example, an IPv4 public network does not carry an End.DT4 SID and is redirected to an SRv6 TE Policy). When packets are forwarded to the device where the last segment of the SID resides, the packets can be properly decapsulated.

-

no-psp

Disables penultimate segment pop of the SRH (PSP).

This field is deprecated and is used only for configuration restoration.

-

Views

Segment routing IPv6 locator 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 Function field is also called Opcode, and different operation codes define different functions. Operation codes can be dynamically assigned using an IGP or be configured using the opcode command.

Static operation codes must be configured within the static operation code segment to prevent conflicts with dynamically assigned operation codes. The length of a static operation code segment is configured through the static static-length parameter in the locator command to determine the number of static operation codes that can be configured in a specified locator range.

After you run the opcode command to configure various types of operation codes, the Locator, Opcode, and Args fields form a unique SRv6 SID. The SRv6 SID is then added to the local SID table on the device and also advertised externally through a routing protocol. In forwarding, the Locator field in the SRv6 SID instructs other nodes to find the SRv6 SID generation node through addressing and forward SRv6 packets to the node; the Opcode field instructs the SRv6 SID generation node to implement corresponding functions.

End is the most basic SRv6 instruction. A SID bound to the End instruction is called an End SID, which identifies a node. An End SID instructs a network node to forward a packet to the node that advertises the SID. After receiving the packet, the node performs the operations defined by the SID for packet processing.

The End SID instruction includes the following operations:

  1. Decrements the SL value by 1.
  2. Obtains the next SID from the SRH based on the SL value.
  3. Updates the DA field in the IPv6 header with the next SID.
  4. Searches the corresponding routing table for packet forwarding.

Precautions

To ensure proper forwarding, the configured static SIDs cannot conflict with the IPv6 addresses configured on interfaces.

Example

# Configure a static SRv6 End SID opcode.
<HUAWEI> system-view
[~HUAWEI] segment-routing ipv6
[*HUAWEI-segment-routing-ipv6] locator test1 ipv6-prefix 100:: 64 static 32
[*HUAWEI-segment-routing-ipv6-locator] opcode ::100 end no-flavor
[*HUAWEI-segment-routing-ipv6-locator] opcode ::101 end psp
[*HUAWEI-segment-routing-ipv6-locator] opcode ::102 end psp-usp-usd
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >