tools/testing/selftests/net/srv6_hencap_red_l3vpn_test.sh

Source file repositories/reference/linux-study-clean/tools/testing/selftests/net/srv6_hencap_red_l3vpn_test.sh

File Facts

System
Linux kernel
Corpus path
tools/testing/selftests/net/srv6_hencap_red_l3vpn_test.sh
Extension
.sh
Size
25488 bytes
Lines
921
Domain
Support Tooling And Documentation
Bucket
tools
Inferred role
Support Tooling And Documentation: tools
Status
atlas-only

Why This File Exists

Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.

Dependency Surface

Detected Declarations

Annotated Snippet

#!/bin/bash
# SPDX-License-Identifier: GPL-2.0
#
# author: Andrea Mayer <andrea.mayer@uniroma2.it>
#
# This script is designed for testing the SRv6 H.Encaps.Red behavior.
#
# Below is depicted the IPv6 network of an operator which offers advanced
# IPv4/IPv6 VPN services to hosts, enabling them to communicate with each
# other.
# In this example, hosts hs-1 and hs-2 are connected through an IPv4/IPv6 VPN
# service, while hs-3 and hs-4 are connected using an IPv6 only VPN.
#
# Routers rt-1,rt-2,rt-3 and rt-4 implement IPv4/IPv6 L3 VPN services
# leveraging the SRv6 architecture. The key components for such VPNs are:
#
#   i) The SRv6 H.Encaps.Red behavior applies SRv6 Policies on traffic received
#      by connected hosts, initiating the VPN tunnel. Such a behavior is an
#      optimization of the SRv6 H.Encap aiming to reduce the length of the SID
#      List carried in the pushed SRH. Specifically, the H.Encaps.Red removes
#      the first SID contained in the SID List (i.e. SRv6 Policy) by storing it
#      into the IPv6 Destination Address. When a SRv6 Policy is made of only one
#      SID, the SRv6 H.Encaps.Red behavior omits the SRH at all and pushes that
#      SID directly into the IPv6 DA;
#
#  ii) The SRv6 End behavior advances the active SID in the SID List carried by
#      the SRH;
#
# iii) The SRv6 End.DT46 behavior is used for removing the SRv6 Policy and,
#      thus, it terminates the VPN tunnel. Such a behavior is capable of
#      handling, at the same time, both tunneled IPv4 and IPv6 traffic.
#
#
#               cafe::1                      cafe::2
#              10.0.0.1                     10.0.0.2
#             +--------+                   +--------+
#             |        |                   |        |
#             |  hs-1  |                   |  hs-2  |
#             |        |                   |        |
#             +---+----+                   +--- +---+
#    cafe::/64    |                             |      cafe::/64
#  10.0.0.0/24    |                             |    10.0.0.0/24
#             +---+----+                   +----+---+
#             |        |  fcf0:0:1:2::/64  |        |
#             |  rt-1  +-------------------+  rt-2  |
#             |        |                   |        |
#             +---+----+                   +----+---+
#                 |      .               .      |
#                 |  fcf0:0:1:3::/64   .        |
#                 |          .       .          |
#                 |            .   .            |
# fcf0:0:1:4::/64 |              .              | fcf0:0:2:3::/64
#                 |            .   .            |
#                 |          .       .          |
#                 |  fcf0:0:2:4::/64   .        |
#                 |      .               .      |
#             +---+----+                   +----+---+
#             |        |                   |        |
#             |  rt-4  +-------------------+  rt-3  |
#             |        |  fcf0:0:3:4::/64  |        |
#             +---+----+                   +----+---+
#    cafe::/64    |                             |      cafe::/64
#  10.0.0.0/24    |                             |    10.0.0.0/24
#             +---+----+                   +--- +---+
#             |        |                   |        |
#             |  hs-4  |                   |  hs-3  |
#             |        |                   |        |
#             +--------+                   +--------+
#               cafe::4                      cafe::3
#              10.0.0.4                     10.0.0.3

Annotation

Implementation Notes