tools/testing/selftests/net/srv6_end_dt4_l3vpn_test.sh
Source file repositories/reference/linux-study-clean/tools/testing/selftests/net/srv6_end_dt4_l3vpn_test.sh
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/net/srv6_end_dt4_l3vpn_test.sh- Extension
.sh- Size
- 17088 bytes
- Lines
- 492
- 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
function check_and_log_hs2gw_connectivity
Annotated Snippet
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0
#
# author: Andrea Mayer <andrea.mayer@uniroma2.it>
# This test is designed for evaluating the new SRv6 End.DT4 behavior used for
# implementing IPv4 L3 VPN use cases.
#
# Hereafter a network diagram is shown, where two different tenants (named 100
# and 200) offer IPv4 L3 VPN services allowing hosts to communicate with each
# other across an IPv6 network.
#
# Only hosts belonging to the same tenant (and to the same VPN) can communicate
# with each other. Instead, the communication among hosts of different tenants
# is forbidden.
# In other words, hosts hs-t100-1 and hs-t100-2 are connected through the IPv4
# L3 VPN of tenant 100 while hs-t200-3 and hs-t200-4 are connected using the
# IPv4 L3 VPN of tenant 200. Cross connection between tenant 100 and tenant 200
# is forbidden and thus, for example, hs-t100-1 cannot reach hs-t200-3 and vice
# versa.
#
# Routers rt-1 and rt-2 implement IPv4 L3 VPN services leveraging the SRv6
# architecture. The key components for such VPNs are: a) SRv6 Encap behavior,
# b) SRv6 End.DT4 behavior and c) VRF.
#
# To explain how an IPv4 L3 VPN based on SRv6 works, let us briefly consider an
# example where, within the same domain of tenant 100, the host hs-t100-1 pings
# the host hs-t100-2.
#
# First of all, L2 reachability of the host hs-t100-2 is taken into account by
# the router rt-1 which acts as an arp proxy.
#
# When the host hs-t100-1 sends an IPv4 packet destined to hs-t100-2, the
# router rt-1 receives the packet on the internal veth-t100 interface. Such
# interface is enslaved to the VRF vrf-100 whose associated table contains the
# SRv6 Encap route for encapsulating any IPv4 packet in a IPv6 plus the Segment
# Routing Header (SRH) packet. This packet is sent through the (IPv6) core
# network up to the router rt-2 that receives it on veth0 interface.
#
# The rt-2 router uses the 'localsid' routing table to process incoming
# IPv6+SRH packets which belong to the VPN of the tenant 100. For each of these
# packets, the SRv6 End.DT4 behavior removes the outer IPv6+SRH headers and
# performs the lookup on the vrf-100 table using the destination address of
# the decapsulated IPv4 packet. Afterwards, the packet is sent to the host
# hs-t100-2 through the veth-t100 interface.
#
# The ping response follows the same processing but this time the role of rt-1
# and rt-2 are swapped.
#
# Of course, the IPv4 L3 VPN for tenant 200 works exactly as the IPv4 L3 VPN
# for tenant 100. In this case, only hosts hs-t200-3 and hs-t200-4 are able to
# connect with each other.
#
#
# +-------------------+ +-------------------+
# | | | |
# | hs-t100-1 netns | | hs-t100-2 netns |
# | | | |
# | +-------------+ | | +-------------+ |
# | | veth0 | | | | veth0 | |
# | | 10.0.0.1/24 | | | | 10.0.0.2/24 | |
# | +-------------+ | | +-------------+ |
# | . | | . |
# +-------------------+ +-------------------+
# . .
# . .
# . .
# +-----------------------------------+ +-----------------------------------+
# | . | | . |
# | +---------------+ | | +---------------- |
Annotation
- Detected declarations: `function check_and_log_hs2gw_connectivity`.
- 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.