encapsulation-mode (SRv6 TE policy view)

Function

The encapsulation-mode command configures an encapsulation mode for an SRv6 TE Policy.

The undo encapsulation-mode command deletes the encapsulation mode of an SRv6 TE Policy.

By default, no encapsulation mode is configured for an SRv6 TE Policy.

Format

encapsulation-mode { insert | encaps | insert-encaps }

undo encapsulation-mode { insert | encaps | insert-encaps }

Parameters

Parameter Description Value
insert

Sets the encapsulation mode of an SRv6 TE Policy to insert.

-

encaps

Sets the encapsulation mode of an SRv6 TE Policy to encaps.

-

insert-encaps

Sets the encapsulation mode of an SRv6 TE Policy to insert-encaps.

-

Views

SRv6 TE policy view

Default Level

2: Configuration level

Task Name and Operations

Task Name Operations
srpolicy write

Usage Guidelines

Usage Scenario

When forwarded traffic enters an SRv6 TE Policy, a new SID stack needs to be encapsulated. If no service SID is available, the SRv6 TE Policy needs to use the encaps encapsulation mode. That is, the SRv6 TE Policy encapsulates the IPv6 header and SRH when the traffic enters the SRv6 TE Policy, and the egress removes the IPv6 header and SRH in USD mode.

Currently, only the encaps encapsulation mode can be used for the following services, and the insert encapsulation mode cannot be used:

  1. IGP shortcut directs traffic to an SRv6 TE Policy in route iteration mode.
  2. Public IPv4/IPv6 traffic without a public SID is redirected to an SRv6 TE Policy.
  3. Public network IPv4/IPv6 traffic without a public SID is diverted to an SRv6 TE Policy using BGP FlowSpec.
  4. L2VPN VPWS PW over SRv6 TE Policy.

An SRv6 TE Policy can dynamically calculate the encapsulation mode based on the configured encapsulation mode, hardware capability, and flavor information of the last two SIDs in a segment list. The calculation rules for the encapsulation mode are as follows:

  1. When the last two layers of SIDs in the segment list of the forwarding entries delivered by the primary and backup candidate paths have the flavor attribute:

    If the encapsulation mode is configured, the intersection of the flavor attribute and configuration is used as the encapsulation mode.

    If no encapsulation mode is configured, the intersection of the flavor attribute and hardware capability is used as the encapsulation mode.
  2. When the last two SIDs in the segment list of the forwarding entries delivered by the primary and backup candidate paths do not have the flavor attribute:

    If the encapsulation mode is configured, the configured encapsulation mode is used.

    If the encapsulation mode is not configured, when the hardware capability is Insert or Insert&Encaps, the final encapsulation mode is Insert; when the hardware capability is Encaps, the final encapsulation mode is Encaps.

Example

# Set the encapsulation mode of an SRv6 TE Policy to encaps.
<HUAWEI> system-view
[~HUAWEI] segment-routing ipv6
[*HUAWEI-segment-routing-ipv6] srv6-te policy policy1 endpoint 2001:DB8::2:2:1 color 100
[*HUAWEI-segment-routing-ipv6-policy-policy1] encapsulation-mode encaps
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >