tools/testing/selftests/net/ioam6.sh

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

File Facts

System
Linux kernel
Corpus path
tools/testing/selftests/net/ioam6.sh
Extension
.sh
Size
51703 bytes
Lines
1684
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: Justin Iurman <justin.iurman@uliege.be>
#
# This script evaluates IOAM for IPv6 by checking local IOAM configurations and
# IOAM data inside packets. There are three categories of tests: LOCAL, OUTPUT,
# and INPUT. The former (LOCAL) checks all IOAM related configurations locally
# without sending packets. OUTPUT tests verify the processing of an IOAM
# encapsulating node, while INPUT tests verify the processing of an IOAM transit
# node. Both OUTPUT and INPUT tests send packets. Each test is documented inside
# its own handler.
#
# The topology used for OUTPUT and INPUT tests is made of three nodes:
# - Alpha (the IOAM encapsulating node)
# - Beta  (the IOAM transit node)
# - Gamma (the receiver) **
#
# An IOAM domain is configured from Alpha to Beta, but not on the reverse path.
# Alpha adds an IOAM option (Pre-allocated Trace) inside a Hop-by-hop.
#
# ** Gamma is required because ioam6_parser.c uses a packet socket and we need
#    to see IOAM data inserted by the very last node (Beta), which would happen
#    _after_ we get a copy of the packet on Beta. Note that using an
#    IPv6 raw socket with IPV6_RECVHOPOPTS on Beta would not be enough: we also
#    need to access the IPv6 header to check some fields (e.g., source and
#    destination addresses), which is not possible in that case. As a
#    consequence, we need Gamma as a receiver to run ioam6_parser.c which uses a
#    packet socket.
#
#
#         +-----------------------+          +-----------------------+
#         |                       |          |                       |
#         |      Alpha netns      |          |      Gamma netns      |
#         |                       |          |                       |
#         | +-------------------+ |          | +-------------------+ |
#         | |       veth0       | |          | |       veth0       | |
#         | | 2001:db8:1::2/64  | |          | | 2001:db8:2::2/64  | |
#         | +-------------------+ |          | +-------------------+ |
#         |           .           |          |           .           |
#         +-----------.-----------+          +-----------.-----------+
#                     .                                  .
#                     .                                  .
#                     .                                  .
#         +-----------.----------------------------------.-----------+
#         |           .                                  .           |
#         | +-------------------+              +-------------------+ |
#         | |       veth0       |              |       veth1       | |
#         | | 2001:db8:1::1/64  | ............ | 2001:db8:2::1/64  | |
#         | +-------------------+              +-------------------+ |
#         |                                                          |
#         |                        Beta netns                        |
#         |                                                          |
#         +----------------------------------------------------------+
#
#
#
#         +==========================================================+
#         |                Alpha - IOAM configuration                |
#         +=====================+====================================+
#         | Node ID             | 1                                  |
#         +---------------------+------------------------------------+
#         | Node Wide ID        | 11111111                           |
#         +---------------------+------------------------------------+
#         | Ingress ID          | 0xffff (default value)             |
#         +---------------------+------------------------------------+
#         | Ingress Wide ID     | 0xffffffff (default value)         |
#         +---------------------+------------------------------------+
#         | Egress ID           | 101                                |
#         +---------------------+------------------------------------+

Annotation

Implementation Notes