tools/testing/selftests/net/srv6_hl2encap_red_l2vpn_test.sh
Source file repositories/reference/linux-study-clean/tools/testing/selftests/net/srv6_hl2encap_red_l2vpn_test.sh
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/net/srv6_hl2encap_red_l2vpn_test.sh- Extension
.sh- Size
- 20209 bytes
- Lines
- 781
- 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.
- Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
Dependency Surface
- No C-style include directives detected by the generator.
Detected Declarations
- No top-level syscall, struct, function, initcall, or export declaration detected by the generator.
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.L2Encaps.Red behavior.
#
# Below is depicted the IPv6 network of an operator which offers L2 VPN
# services to hosts, enabling them to communicate with each other.
# In this example, hosts hs-1 and hs-2 are connected through an L2 VPN service.
# Currently, the SRv6 subsystem in Linux allows hosts hs-1 and hs-2 to exchange
# full L2 frames as long as they carry IPv4/IPv6.
#
# Routers rt-1,rt-2,rt-3 and rt-4 implement L2 VPN services
# leveraging the SRv6 architecture. The key components for such VPNs are:
#
# i) The SRv6 H.L2Encaps.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.L2Encap aiming to reduce the
# length of the SID List carried in the pushed SRH. Specifically, the
# H.L2Encaps.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.L2Encaps.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.DX2 behavior is used for removing the SRv6 Policy
# and, thus, it terminates the VPN tunnel. The decapsulated L2 frame is
# sent over the interface connected with the destination host.
#
# 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 | |
# +---+----+ +----+---+
#
#
# Every fcf0:0:x:y::/64 network interconnects the SRv6 routers rt-x with rt-y
# in the IPv6 operator network.
#
# Local SID table
# ===============
#
# Each SRv6 router is configured with a Local SID table in which SIDs are
# stored. Considering the given SRv6 router rt-x, at least two SIDs are
Annotation
- Atlas domain: Support Tooling And Documentation / tools.
- Implementation status: atlas-only.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.