The opcode compress end-x command configures a compression opcode for static SRv6 End.X SIDs.
The undo opcode compress end-x command deletes the compression opcode configured for static SRv6 End.X SIDs.
By default, no compressed static SRv6 End.X SID opcode is configured.
opcode compress func-opcode end-x interface { intfname | interfaceType interfaceNum } nexthop nexthop-addr { no-flavor | psp | psp-usp-usd | psp-usp-usd-coc }
undo opcode compress func-opcode end-x interface { intfname | interfaceType interfaceNum } nexthop nexthop-addr [ no-flavor | psp | psp-usp-usd | psp-usp-usd-coc ]
Parameter | Description | Value |
---|---|---|
func-opcode |
Specifies the operation code of a static SRv6 End.X SID. |
The value is a 32-digit hexadecimal number, in the format of X:X:X:X:X:X:X:X. |
interface intfname |
Specifies an interface name. |
- |
interfaceType |
Specifies an interface type. |
- |
interfaceNum |
Specifies the number of an interface. |
- |
nexthop nexthop-addr |
Specifies the next-hop IP address. |
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. |
- |
psp-usp-usd-coc |
Specifies the PSP, USP, USD, and COC flags. The PSP flag indicates that the penultimate segment of an SRH is popped. The USP flag indicates that the last segment of an SRH is popped. The USD flag indicates that the last segment of an SRH is decapsulated, that is, the IPv6 header and all extension headers are popped. The COC flag indicates that the header is compressed. COC is a new behavior related to compressed SIDs. It is installed in the local SID table and is used to identify whether the current C-SID is the last C-SID of the current block (0 indicates the last C-SID and 1 indicates the non-last C-SID). |
- |
compress |
Specifies the compression function. |
- |
Usage Scenario
An SRv6 SID is a 128-bit IPv6 address. The SRv6 SID format is Locator:Function:Args. The Function field is also called Opcode. Configuring different Opcodes is equivalent to defining different functions. Opcodes can be dynamically allocated using an IGP or statically configured using the opcode command.
The compressed static Opcode must be configured in the range of the compressed static segment to prevent the conflict with the compressed Opcode dynamically allocated by the IGP protocol. The non-compressed static segment Opcode must be configured in the range of the non-compressed static segment to prevent conflicts with the non-compressed Opcode dynamically allocated by the IGP. The length range of the static opcode to be compressed is determined by the compress-static compress-length parameter in the locator command. The length range of an uncompressed static opcode is determined by the static static-length parameter in the locator command. After various types of opcodes are statically configured using the opcode command, the locator, compressed opcode, and Args form a unique SRv6 SID, and the locator, non-compressed opcode, and Args form a unique SRv6 SID. After an SRv6 SID is generated, it is added to the local SID table and can be advertised using a routing protocol. During actual forwarding, the locator part in an SRv6 SID is used to help other nodes on the network perform route addressing, find the node that generates the SRv6 SID, and forward the SRv6 packet to this node. The opcode part is used to instruct the node that generates the SRv6 SID to perform corresponding function operations. End.X is short for Layer-3 cross-connect. End.X supports the forwarding of packets from a specified link to a Layer 3 adjacency. It can be used in scenarios such as TI-LFA (Topology Independent Loop Free Alternate, topology-independent loop-free backup) and TE over strict explicit paths. End.X is essentially a change based on End. The instruction is disassembled into End + X, where X indicates a cross connection, that is, a packet is directly forwarded to a specified Layer 3 adjacency. Therefore, an End.X SID must be bound to a Layer 3 adjacency or a group of Layer 3 adjacencies. This instruction decreases the SL value by 1, obtains the next SID from the SRH based on the SL value, adds the SID to the destination address field in the IPv6 packet header, and forwards the IPv6 packet to the Layer 3 adjacency bound to End.X.Precautions
To ensure proper forwarding, the configured static SIDs cannot conflict with the IPv6 addresses configured on interfaces.
<HUAWEI> system-view [~HUAWEI] segment-routing ipv6 [*HUAWEI-segment-routing-ipv6] locator test1 ipv6-prefix 2001:DB8:3:: 64 compress block 48 compress-static 10 static 20 [*HUAWEI-segment-routing-ipv6-locator] opcode compress ::1 end-x interface Ethernet 0/1/16 nexthop 2001:DB8:10::2 no-flavor [*HUAWEI-segment-routing-ipv6-locator] opcode compress ::2 end-x interface Ethernet 0/1/16 nexthop 2001:DB8:10::2 psp [*HUAWEI-segment-routing-ipv6-locator] opcode compress ::3 end-x interface Ethernet 0/1/16 nexthop 2001:DB8:10::2 psp-usp-usd [*HUAWEI-segment-routing-ipv6-locator] opcode compress ::4 end-x interface Ethernet 0/1/16 nexthop 2001:DB8:10::2 psp-usp-usd-coc