diff --git a/deploy/containerlab/README.md b/deploy/containerlab/README.md index 24cca5eeb..db3ddf4d5 100644 --- a/deploy/containerlab/README.md +++ b/deploy/containerlab/README.md @@ -669,6 +669,29 @@ what lived in its network namespace: its gvpc.clab.yaml links (through sysctls and exec commands, its peers' bonds, the pass-through XDP programs and its addresses. The script works for any Kind node of the topology. +### Tagged transport variant + +The [VLAN transport contract](../../docs/designs/vlan-transport/contract.md) needs each side of an edge node to run tagged (802.1Q) or untagged. The topology above builds untagged bonds only. `scripts/vlan-transport.sh` re-plumbs sjc at run time, without changing a manifest. It changes the public side (sjc-worker2 `bond0` to tr2 `bond1`) and the fabric side (sjc-worker2 `bond1` to sjc-worker `bond0`). + +- `resources/vlan-transport/cells.env` defines cells C1 to C6 of the [acceptance matrix](../../docs/designs/vlan-transport/acceptance.md) except C5, which point-to-point links cannot build. `PUB_VID` and `FAB_VID` override a cell's IDs. +- `apply` creates the VLAN netdevices on both ends of each tagged side and moves the link's addresses onto them: with `ip` on the Kind nodes and in vtysh's running configuration on tr2. It then points `galactic-gateway`, `galactic-nat` and `galactic-cni` at the new interfaces with `kubectl set env`. `SELECT=logical` names the VLAN netdevice, as the contract requires. `SELECT=parent` names the parent instead. +- sjc's single `galactic-cni` DaemonSet needs a different interface on each node once a side is tagged. `apply` gives sjc-worker2 its own copy, `galactic-cni-vt-edge`, and excludes that node from the original. +- `apply` saves the deployed settings on sjc-worker2 in `/galactic/vlan-transport.state`. `revert` uses it to restore C1. `offload on|off` toggles VLAN offloads on every transport member. +- `VT_SITE=dfw-worker3` re-plumbs only dfw-worker3's public side. It exists for the same-node delivery row, which `verify:edge-listener` runs on dfw. Set `EDGE_CONFORMANCE_UPLINK_DEV=dfw-worker3=bond2.101` so the test pins its VIP through the VLAN. + +```bash +task variant:vlan-transport:plan CELL=C4 SELECT=logical # no lab needed +task variant:vlan-transport:apply CELL=C4 SELECT=parent PUB_VID=1234 FAB_VID=3456 +task baseline:vlan-transport CELL=C4 SELECT=parent OUT=/tmp/c4 ROWS="V06 V01 V03 V05" +task variant:vlan-transport:revert +``` + +`baseline:vlan-transport` (`scripts/vlan-transport-baseline.sh`) records the cell's rows. It captures on the receiving end of every transport link, on bond members, so the tag shows whether it travels in the frame or in skb metadata. It also records the gateway and NAT counters that moved and the components' interface log lines. Isolation (`vlan-transport-inject.sh`, with `vlan-inject.py` for raw frames) and interruption timing (`vlan-transport-interrupt.sh`) have their own scripts. + +`verify-gateway-ingress*.sh` take `UPLINK_DEV="sjc-worker2=bond1.101"` to pin through a tagged transit-side device. + +Hold a containerlab-manager reservation for everything except `plan`, and end with `revert` and the sjc checks: `verify-gateway-ingress*.sh --node sjc-worker2`, `verify:nat-datapath SENDER_SITE=sjc SHARD_NODE=sjc-worker2 SHARD_SITE=sjc`, `verify-ns20.sh` and `verify:bonds`. The [baseline report](../../docs/archive/benchmarks/vlan-transport-baseline-2026-11-30.md) lists which rows have run. + ## Notes - All three Kind clusters use `disableDefaultCNI: true`. Cilium and Multus are installed diff --git a/deploy/containerlab/Taskfile.yaml b/deploy/containerlab/Taskfile.yaml index 928660157..b182030ee 100644 --- a/deploy/containerlab/Taskfile.yaml +++ b/deploy/containerlab/Taskfile.yaml @@ -1377,6 +1377,52 @@ tasks: cmds: - ./scripts/verify-ns40.sh + # Run every vlan-transport target except plan inside a containerlab-manager + # reservation, and end with variant:vlan-transport:revert (README). + "variant:vlan-transport:plan": + desc: Print what applying a transport cell would change, without touching the lab (CELL=, SELECT=) + requires: + vars: [CELL] + cmds: + - >- + {{if .PUB_VID}}PUB_VID={{.PUB_VID}} {{end}}{{if .FAB_VID}}FAB_VID={{.FAB_VID}} {{end}} + ./scripts/vlan-transport.sh plan {{.CELL}} {{.SELECT | default "logical"}} + + "variant:vlan-transport:apply": + desc: Apply a transport cell to sjc (CELL=, SELECT=, PUB_VID=, FAB_VID=) + requires: + vars: [CELL] + cmds: + - >- + LAB={{.LAB}} {{if .PUB_VID}}PUB_VID={{.PUB_VID}} {{end}}{{if .FAB_VID}}FAB_VID={{.FAB_VID}} {{end}} + ./scripts/vlan-transport.sh apply {{.CELL}} {{.SELECT | default "logical"}} + + "variant:vlan-transport:revert": + desc: Return sjc to untagged transport (C1) with its deployed Galactic settings + cmds: + - LAB={{.LAB}} ./scripts/vlan-transport.sh revert + + "variant:vlan-transport:offload": + desc: Turn VLAN receive and transmit offload on or off on every sjc transport member (STATE=on|off) + requires: + vars: [STATE] + cmds: + - LAB={{.LAB}} ./scripts/vlan-transport.sh offload {{.STATE}} + + "variant:vlan-transport:status": + desc: Show the applied transport cell and sjc's transport interfaces + cmds: + - LAB={{.LAB}} ./scripts/vlan-transport.sh status + + "baseline:vlan-transport": + desc: Apply a transport cell and record its traffic rows with captures (CELL=, SELECT=, OUT=, ROWS=); does not revert + requires: + vars: [CELL, OUT] + cmds: + - >- + LAB={{.LAB}} {{if .PUB_VID}}PUB_VID={{.PUB_VID}} {{end}}{{if .FAB_VID}}FAB_VID={{.FAB_VID}} {{end}} + ./scripts/vlan-transport-baseline.sh {{.CELL}} {{.SELECT | default "logical"}} {{.OUT}} {{.ROWS | default "V06 V01 V03 V05 V07"}} + clean: desc: Destroy the lab and delete artifacts cmds: diff --git a/deploy/containerlab/resources/vlan-transport/cells.env b/deploy/containerlab/resources/vlan-transport/cells.env new file mode 100644 index 000000000..8eb56cf7f --- /dev/null +++ b/deploy/containerlab/resources/vlan-transport/cells.env @@ -0,0 +1,38 @@ +# Configuration cells for the tagged/untagged transport variant +# (scripts/vlan-transport.sh), from docs/designs/vlan-transport/acceptance.md. +# Each cell sets, per side, the VLAN ID (empty: untagged) and the kind of +# parent the side's logical interface sits on. VLAN IDs are synthetic and +# overridable at apply time (PUB_VID=, FAB_VID=), so a run can prove that the +# operator-selected ID, not a fixture constant, is what reaches the wire. +# +# The variant runs on the sjc site. Contract name to lab interface: +# bondpub sjc-worker2 bond0 (peer tr2 bond1) public side +# bondfab sjc-worker2 bond1 (peer sjc-worker bond0) fabric side +# PARENT=nic takes each side's first bond member out of its bond on both ends +# and uses that veth as a plain NIC. +# +# C5 (two VLANs on one parent) is not a lab cell: the lab's links are +# point-to-point, so one parent cannot reach both the external router and the +# compute node. Its kernel behaviour is measured by the vlanprobe root test +# (internal/plumbing/ebpf/vlanprobe). + +# cell public-VID fabric-VID parent +C1_PUB_VID= +C1_FAB_VID= +C1_PARENT=bond + +C2_PUB_VID=101 +C2_FAB_VID= +C2_PARENT=bond + +C3_PUB_VID= +C3_FAB_VID=202 +C3_PARENT=bond + +C4_PUB_VID=101 +C4_FAB_VID=202 +C4_PARENT=bond + +C6_PUB_VID=101 +C6_FAB_VID=202 +C6_PARENT=nic diff --git a/deploy/containerlab/scripts/verify-gateway-ingress-ipv4.sh b/deploy/containerlab/scripts/verify-gateway-ingress-ipv4.sh index e311fbc90..ac9c8a3ce 100755 --- a/deploy/containerlab/scripts/verify-gateway-ingress-ipv4.sh +++ b/deploy/containerlab/scripts/verify-gateway-ingress-ipv4.sh @@ -137,6 +137,18 @@ case "${1:-}" in esac transit() { docker exec "clab-${LAB}-$1" "${@:2}"; } + +uplink_dev() { + local pair + local list=${UPLINK_DEV:-} + for pair in ${list//,/ }; do + if [ "${pair%%=*}" = "$1" ]; then + echo "${pair#*=}" + return + fi + done + echo "$2" +} client() { docker exec "clab-${LAB}-remote-host" "$@"; } unpin_all() { @@ -361,6 +373,8 @@ for site in "${SITES[@]}"; do [ -z "${only}" ] || [ "${only}" = "${gw}" ] || continue want_pins=$((want_pins + 1)) read -r tr nexthop dev <<<"${UPLINK[${gw}]}" + # UPLINK_DEV: see the README's tagged transport variant section. + dev=$(uplink_dev "${gw}" "${dev}") echo "--- ${site}: ${vip} through ${gw} (pinned on ${tr}) ---" if ! transit "${tr}" ip -4 route replace "${vip}/32" via "${nexthop}" dev "${dev}"; then fail "could not pin ${vip} to ${gw} on ${tr}" diff --git a/deploy/containerlab/scripts/verify-gateway-ingress.sh b/deploy/containerlab/scripts/verify-gateway-ingress.sh index 9f83227da..84fef3165 100755 --- a/deploy/containerlab/scripts/verify-gateway-ingress.sh +++ b/deploy/containerlab/scripts/verify-gateway-ingress.sh @@ -73,6 +73,18 @@ esac transit() { docker exec "clab-${LAB}-$1" "${@:2}"; } +uplink_dev() { + local pair + local list=${UPLINK_DEV:-} + for pair in ${list//,/ }; do + if [ "${pair%%=*}" = "$1" ]; then + echo "${pair#*=}" + return + fi + done + echo "$2" +} + unpin_all() { local site tr for site in "${SITES[@]}"; do @@ -172,6 +184,8 @@ for site in "${SITES[@]}"; do [ -z "${only}" ] || [ "${only}" = "${gw}" ] || continue checked=$((checked + 1)) read -r tr nexthop dev <<<"${UPLINK[${gw}]}" + # UPLINK_DEV: see the README's tagged transport variant section. + dev=$(uplink_dev "${gw}" "${dev}") echo "--- ${site}: ${vip} through ${gw} (pinned on ${tr}) ---" transit "${tr}" ip -6 route replace "${vip}/128" via "${nexthop}" dev "${dev}" diff --git a/deploy/containerlab/scripts/vlan-inject.py b/deploy/containerlab/scripts/vlan-inject.py new file mode 100755 index 000000000..9fc9fd071 --- /dev/null +++ b/deploy/containerlab/scripts/vlan-inject.py @@ -0,0 +1,80 @@ +#!/usr/bin/env python3 +# vlan-inject.py -- send crafted IPv6/UDP frames with chosen 802.1Q/802.1ad +# headers out of one interface, for the isolation rows of the tagged +# transport baseline (docs/designs/vlan-transport/acceptance.md V11 to V13). +# Runs inside a lab node (tr2 or a Kind node), which has python3. Standard +# library only. +# +# vlan-inject.py IFACE DST_MAC SRC_IP6 DST_IP6 DPORT CASE COUNT +# +# CASE is one of: +# untagged no tag +# q:VID one 802.1Q tag +# prio 802.1Q with VLAN ID 0 (priority tag) +# qq:VID1:VID2 two 802.1Q tags +# ad:VID1:VID2 802.1ad outer tag, 802.1Q inner tag +# trunc:VID 802.1Q tag with the frame cut inside the tag header +import socket +import struct +import sys + + +def csum(data): + if len(data) % 2: + data += b"\0" + s = sum(struct.unpack("!%dH" % (len(data) // 2), data)) + while s >> 16: + s = (s & 0xFFFF) + (s >> 16) + return (~s) & 0xFFFF + + +def ipv6_udp(src, dst, sport, dport, payload): + s = socket.inet_pton(socket.AF_INET6, src) + d = socket.inet_pton(socket.AF_INET6, dst) + length = 8 + len(payload) + udp = struct.pack("!HHHH", sport, dport, length, 0) + payload + pseudo = s + d + struct.pack("!I3xB", length, 17) + c = csum(pseudo + udp) or 0xFFFF + udp = udp[:6] + struct.pack("!H", c) + udp[8:] + hdr = struct.pack("!IHBB", 6 << 28, length, 17, 64) + s + d + return hdr + udp + + +def tags(case): + kind, _, rest = case.partition(":") + ids = [int(x) for x in rest.split(":")] if rest else [] + if kind == "untagged": + return b"", False + if kind == "q": + return struct.pack("!HH", 0x8100, ids[0]), False + if kind == "prio": + return struct.pack("!HH", 0x8100, 0), False + if kind == "qq": + return struct.pack("!HHHH", 0x8100, ids[0], 0x8100, ids[1]), False + if kind == "ad": + return struct.pack("!HHHH", 0x88A8, ids[0], 0x8100, ids[1]), False + if kind == "trunc": + return struct.pack("!HH", 0x8100, ids[0]), True + raise SystemExit("unknown case " + case) + + +def main(): + iface, dst_mac, src, dst, dport, case, count = sys.argv[1:8] + sock = socket.socket(socket.AF_PACKET, socket.SOCK_RAW) + sock.bind((iface, 0)) + src_mac = sock.getsockname()[4] + dmac = bytes.fromhex(dst_mac.replace(":", "")) + tag, truncate = tags(case) + sent = 0 + for i in range(int(count)): + body = ipv6_udp(src, dst, 40000 + i, int(dport), b"vlan-inject %s %d" % (case.encode(), i)) + frame = dmac + src_mac + tag + struct.pack("!H", 0x86DD) + body + if truncate: + frame = dmac + src_mac + tag[:3] + sock.send(frame) + sent += 1 + print("sent %d %s frames on %s" % (sent, case, iface)) + + +if __name__ == "__main__": + main() diff --git a/deploy/containerlab/scripts/vlan-transport-baseline.sh b/deploy/containerlab/scripts/vlan-transport-baseline.sh new file mode 100755 index 000000000..136985c54 --- /dev/null +++ b/deploy/containerlab/scripts/vlan-transport-baseline.sh @@ -0,0 +1,158 @@ +#!/bin/bash +# vlan-transport-baseline.sh: record the tagged/untagged transport baseline +# for one configuration cell on the sjc site (issue #1401). Applies the cell +# with vlan-transport.sh, runs each traffic row with captures on every +# transport link, and writes everything under OUT. It does not revert: the +# caller runs `vlan-transport.sh revert` and the site baseline afterwards, +# inside the same containerlab-manager reservation. +# +# Usage: vlan-transport-baseline.sh CELL SELECT OUT [ROWS] +# ROWS: space-separated subset of "V06 V01 V03 V05 V07 V11" (default all but V11) +# +# A row's result is what happened, pass or fail; a failing row is baseline +# evidence, so this script exits 0 unless the harness itself breaks. +set -uo pipefail + +SCRIPT_DIR=$(cd "$(dirname "$0")" && pwd) +LAB=${LAB:-gvpc} +CELL=${1:?cell} +SELECT=${2:?logical or parent} +OUT=${3:?output directory} +ROWS=${4:-V06 V01 V03 V05 V07} +EDGE=sjc-worker2 +COMPUTE=sjc-worker +TR=clab-${LAB}-tr2 +VT="${SCRIPT_DIR}/vlan-transport.sh" +GW_METRICS=8081 +NAT_METRICS=9182 +mkdir -p "${OUT}" +exec > >(tee -a "${OUT}/run.log") 2>&1 + +q() { docker exec "$@"; } +result() { echo "RESULT ${CELL}/${SELECT} $1: $2" | tee -a "${OUT}/results.txt"; } + +metrics() { # NODE PORT FILE + q "$1" curl -s --max-time 4 "http://localhost:$2/metrics" | grep -E '^galactic_' >"$3" || true +} + +# metric_delta BEFORE AFTER PATTERN: per-series increases for matching series. +metric_delta() { + join -a2 -e 0 -o '0,1.2,2.2' <(grep -E "$3" "$1" | awk '{print $1, $2}' | sort) \ + <(grep -E "$3" "$2" | awk '{print $1, $2}' | sort) | awk '$3 != $2 {printf " %s %s -> %s\n", $1, $2, $3}' +} + +counters_before() { + metrics "${EDGE}" "${GW_METRICS}" "${OUT}/$1-gw.before" + metrics "${EDGE}" "${NAT_METRICS}" "${OUT}/$1-nat.before" +} + +counters_after() { + metrics "${EDGE}" "${GW_METRICS}" "${OUT}/$1-gw.after" + metrics "${EDGE}" "${NAT_METRICS}" "${OUT}/$1-nat.after" + { + echo "gateway counters that moved:" + metric_delta "${OUT}/$1-gw.before" "${OUT}/$1-gw.after" '^galactic_(edge|xdp|gateway)' + echo "nat counters that moved:" + metric_delta "${OUT}/$1-nat.before" "${OUT}/$1-nat.after" '^galactic_(nat|xdp)' + } | tee "${OUT}/$1-counters.txt" +} + +field() { q "${EDGE}" sh -c "grep '^$1=' /galactic/vlan-transport.state | cut -d= -f2-"; } + +echo "=== ${CELL} ${SELECT} $(date -u +%FT%TZ)" +"${VT}" apply "${CELL}" "${SELECT}" +"${VT}" snapshot "${OUT}" +IFS=/ read -r PUB_L PUB_P PUB_VID <<<"$(field public)" +IFS=/ read -r FAB_L FAB_P FAB_VID <<<"$(field fabric)" +TR_DEV=bond1 +[ -n "${PUB_VID}" ] && TR_DEV=$(q "${TR}" sh -c "ip -o link show type vlan | awk -F': ' '{print \$2}' | cut -d@ -f1 | grep '\.${PUB_VID}\$' | head -1") +[ "${PUB_P}" = eth1 ] && [ -z "${PUB_VID}" ] && TR_DEV=eth1 +export TAG_A=${PUB_VID:-101} TAG_B=${FAB_VID:-202} +echo "public ${PUB_L} (parent ${PUB_P}, VID ${PUB_VID:-none}); fabric ${FAB_L} (parent ${FAB_P}, VID ${FAB_VID:-none}); tr2 device ${TR_DEV}" + +# Component state after the change: readiness, restarts and the log lines +# that say which interfaces each component took (V17/V18, contract Q1). +sleep 20 +{ + docker exec sjc-control-plane kubectl -n galactic-system get pods -o wide | grep -E "(${EDGE}|${COMPUTE})" + for app in galactic-gateway galactic-nat galactic-cni; do + for pod in $(docker exec sjc-control-plane kubectl -n galactic-system get pods -o wide | awk -v a="${app}" -v e="${EDGE}" -v c="${COMPUTE}" '$1 ~ "^"a && ($7 == e || $7 == c) {print $1}'); do + echo "--- ${pod}" + docker exec sjc-control-plane kubectl -n galactic-system logs "${pod}" --all-containers --tail=400 2>&1 \ + | grep -iE 'interface|xdp|attach|uplink|vlan|refus|error|fail|ready' | tail -25 + docker exec sjc-control-plane kubectl -n galactic-system logs "${pod}" --all-containers --previous --tail=60 2>/dev/null \ + | grep -iE 'refus|error|fail' | tail -5 | sed 's/^/previous: /' + done + done +} >"${OUT}/components.txt" 2>&1 +grep -cE 'Running' "${OUT}/components.txt" >/dev/null +head -80 "${OUT}/components.txt" + +for row in ${ROWS}; do + case "${row}" in + V06) + { + echo "--- tr2 BGP toward the edge" + q "${TR}" vtysh -c 'show bgp ipv6 unicast summary' | grep -E '2001:db8:1:21::2|Neighbor' + q "${TR}" vtysh -c 'show bgp ipv4 unicast summary' | grep -E '10\.1\.21\.2|Neighbor' + echo "--- neighbours" + q "${TR}" ip neigh show dev "${TR_DEV}" + q "${EDGE}" ip neigh show dev "${PUB_L}" + q "${EDGE}" ip neigh show dev "${FAB_L}" + } | tee "${OUT}/V06.txt" + if grep -qE '2001:db8:1:21::2 .*[0-9]+ +[0-9]+ *$|2001:db8:1:21::2.* [0-9]+ +N/A' "${OUT}/V06.txt" \ + && ! grep -E '2001:db8:1:21::2' "${OUT}/V06.txt" | grep -qE 'Active|Connect|Idle'; then + result V06 "public BGP Established" + else + result V06 "public BGP not established (see V06.txt)" + fi + ;; + V01) + counters_before V01 + "${VT}" capture-start "${OUT}" V01 + UPLINK_DEV="${EDGE}=${TR_DEV}" LAB=${LAB} "${SCRIPT_DIR}/verify-gateway-ingress.sh" --node "${EDGE}" >"${OUT}/V01-ipv6.txt" 2>&1 && r6=pass || r6=fail + UPLINK_DEV="${EDGE}=${TR_DEV}" LAB=${LAB} "${SCRIPT_DIR}/verify-gateway-ingress-ipv4.sh" --node "${EDGE}" >"${OUT}/V01-ipv4.txt" 2>&1 && r4=pass || r4=fail + "${VT}" capture-stop "${OUT}" V01 + counters_after V01 + tail -4 "${OUT}/V01-ipv6.txt" "${OUT}/V01-ipv4.txt" + result "V01/V02" "IPv6 VIP ${r6}, IPv4 VIP ${r4}" + ;; + V03) + counters_before V03 + "${VT}" capture-start "${OUT}" V03 + (cd "${SCRIPT_DIR}/.." && task verify:nat-datapath SENDER_SITE=sjc SHARD_NODE="${EDGE}" SHARD_SITE=sjc) >"${OUT}/V03.txt" 2>&1 && r=pass || r=fail + "${VT}" capture-stop "${OUT}" V03 + counters_after V03 + cat "${OUT}/V03.txt" + result "V03/V04" "NAT66 and NAT64 round trip ${r} ($(grep -cE '^ ok' "${OUT}/V03.txt") ok lines, $(grep -cE 'FAIL' "${OUT}/V03.txt") FAIL lines)" + ;; + V05) + "${VT}" capture-start "${OUT}" V05 + # ns20 is dual-stack and spans every site, so sjc's pod reaches dfw's and + # iad's across sjc's fabric and public sides. + "${SCRIPT_DIR}/verify-ns20.sh" >"${OUT}/V05.txt" 2>&1 && r=pass || r=fail + "${VT}" capture-stop "${OUT}" V05 + cat "${OUT}/V05.txt" + result V05 "ns20 dual-stack tenant ping between every site pair ${r}" + ;; + V07) + counters_before V07 + echo "change: ${EDGE}: ip neigh flush dev ${PUB_L}; ip neigh flush dev ${FAB_L}" + q "${EDGE}" ip neigh flush dev "${PUB_L}" + q "${EDGE}" ip neigh flush dev "${FAB_L}" + UPLINK_DEV="${EDGE}=${TR_DEV}" LAB=${LAB} "${SCRIPT_DIR}/verify-gateway-ingress.sh" --node "${EDGE}" >"${OUT}/V07-gw.txt" 2>&1 && rg=pass || rg=fail + echo "change: ${EDGE}: ip neigh flush dev ${PUB_L}; ip neigh flush dev ${FAB_L}" + q "${EDGE}" ip neigh flush dev "${PUB_L}" + q "${EDGE}" ip neigh flush dev "${FAB_L}" + (cd "${SCRIPT_DIR}/.." && task verify:nat-datapath SENDER_SITE=sjc SHARD_NODE="${EDGE}" SHARD_SITE=sjc) >"${OUT}/V07-nat.txt" 2>&1 && rn=pass || rn=fail + counters_after V07 + result V07 "after neighbour flush: gateway ${rg}, NAT ${rn}; fallbacks: $(grep -E 'neigh|fallback' "${OUT}/V07-counters.txt" | tr -s ' ' | tr '\n' ';')" + ;; + V11) + "${SCRIPT_DIR}/vlan-transport-inject.sh" "${OUT}" "${PUB_L}" "${PUB_VID}" | tee "${OUT}/V11.txt" + result "V11-V13" "$(grep -c '^case' "${OUT}/V11.txt") injection cases recorded" + ;; + esac +done +echo "=== ${CELL} ${SELECT} done $(date -u +%FT%TZ)" +exit 0 diff --git a/deploy/containerlab/scripts/vlan-transport-inject.sh b/deploy/containerlab/scripts/vlan-transport-inject.sh new file mode 100755 index 000000000..5710497ff --- /dev/null +++ b/deploy/containerlab/scripts/vlan-transport-inject.sh @@ -0,0 +1,96 @@ +#!/bin/bash +# vlan-transport-inject.sh OUT PUB_LOGICAL PUB_VID: isolation baseline for +# the tagged transport variant (acceptance rows V11 to V13). Sends UDP to +# sjc's IPv6 VIP from tr2 toward sjc-worker2's public side in two +# representations, and reports for each case whether the edge's gateway +# claimed it (its per-VIP rule counter rose): +# +# in-frame raw frames from vlan-inject.py on tr2's bond member, so every +# tag is in packet data when sjc-worker2 receives it; +# kernel datagrams sent through a temporary VLAN netdevice on tr2's +# bond, so the tag crosses the veth as skb metadata, as receive +# VLAN offload presents it to XDP. +# +# Called by vlan-transport-baseline.sh inside the lab reservation; every +# change on tr2 is echoed with "change:" and removed before returning. +set -uo pipefail + +SCRIPT_DIR=$(cd "$(dirname "$0")" && pwd) +LAB=${LAB:-gvpc} +OUT=${1:?out} +PUB_L=${2:?public logical interface} +PUB_VID=${3:-} +EDGE=sjc-worker2 +TR=clab-${LAB}-tr2 +VIP=2001:db8:6060:2::1 +SRC=2001:db8:1:40::2 +COUNT=20 +q() { docker exec "$@"; } +mkdir -p "${OUT}" +exec > >(tee "${OUT}/inject.txt") 2>&1 + +rule_packets() { + q "${EDGE}" curl -s --max-time 4 http://localhost:8081/metrics \ + | awk -v vip="${VIP}" '/^galactic_edge_rule_packets_total/ && index($0, vip) {s += $2} END {print s + 0}' +} + +edge_mac=$(q "${EDGE}" cat "/sys/class/net/${PUB_L}/address") +docker cp "${SCRIPT_DIR}/vlan-inject.py" "${TR}:/tmp/vlan-inject.py" >/dev/null +other=$(( ${PUB_VID:-0} == 999 ? 998 : 999 )) +pub=${PUB_VID:-101} + +echo "edge public ${PUB_L} (VID ${PUB_VID:-none}); edge MAC ${edge_mac}" +for c in untagged "q:${pub}" "q:${other}" q:202 prio "qq:${pub}:5" "ad:300:${pub}" "trunc:${pub}"; do + before=$(rule_packets) + q "${TR}" python3 /tmp/vlan-inject.py eth1 "${edge_mac}" "${SRC}" "${VIP}" 80 "${c}" "${COUNT}" >/dev/null + sleep 2 + after=$(rule_packets) + echo "case in-frame ${c}: sent ${COUNT}, gateway rule packets +$((after - before))" +done + +# Kernel-tagged: the same VIP reached through a temporary VLAN on tr2's bond. +for vid in "${pub}" "${other}" 202; do + dev="bond1.${vid}" + created=0 + if ! q "${TR}" ip link show dev "${dev}" >/dev/null 2>&1; then + echo "change: ${TR}: ip link add link bond1 name ${dev} type vlan id ${vid}" + q "${TR}" ip link add link bond1 name "${dev}" type vlan id "${vid}" + q "${TR}" ip link set dev "${dev}" up + created=1 + fi + q "${TR}" ip -6 addr add 2001:db8:ffff::1/64 dev "${dev}" nodad 2>/dev/null + q "${TR}" ip -6 neigh replace 2001:db8:ffff::2 lladdr "${edge_mac}" dev "${dev}" + before=$(rule_packets) + q "${TR}" python3 - "${VIP}" "${dev}" "${COUNT}" <<'EOF' +import socket, sys +vip, dev, n = sys.argv[1], sys.argv[2], int(sys.argv[3]) +s = socket.socket(socket.AF_INET6, socket.SOCK_DGRAM) +s.setsockopt(socket.SOL_SOCKET, socket.SO_BINDTODEVICE, dev.encode()) +s.bind(("2001:db8:ffff::1", 0)) +for i in range(n): + # Through the static neighbour: the destination is reached on-link. + s.sendto(b"vlan-transport kernel %d" % i, ("2001:db8:ffff::2", 9)) +EOF + # The datagram above proves the netdevice transmits; the VIP probe below is + # what the gateway would claim. + q "${TR}" ip -6 route replace "${VIP}/128" via 2001:db8:ffff::2 dev "${dev}" table 4242 + q "${TR}" ip -6 rule add to "${VIP}/128" ipproto udp dport 80 lookup 4242 priority 4242 2>/dev/null + q "${TR}" python3 -c " +import socket +s = socket.socket(socket.AF_INET6, socket.SOCK_DGRAM) +s.bind(('2001:db8:ffff::1', 0)) +for i in range(${COUNT}): + s.sendto(b'vlan-transport vip %d' % i, ('${VIP}', 80)) +" + sleep 2 + after=$(rule_packets) + q "${TR}" ip -6 rule del to "${VIP}/128" ipproto udp dport 80 lookup 4242 priority 4242 2>/dev/null + q "${TR}" ip -6 route flush table 4242 2>/dev/null + q "${TR}" ip -6 neigh del 2001:db8:ffff::2 dev "${dev}" 2>/dev/null + q "${TR}" ip -6 addr del 2001:db8:ffff::1/64 dev "${dev}" 2>/dev/null + if [ "${created}" = 1 ]; then + echo "change: ${TR}: ip link del ${dev}" + q "${TR}" ip link del dev "${dev}" + fi + echo "case kernel q:${vid}: sent ${COUNT}, gateway rule packets +$((after - before))" +done diff --git a/deploy/containerlab/scripts/vlan-transport-interrupt.sh b/deploy/containerlab/scripts/vlan-transport-interrupt.sh new file mode 100755 index 000000000..2b8d0ad37 --- /dev/null +++ b/deploy/containerlab/scripts/vlan-transport-interrupt.sh @@ -0,0 +1,75 @@ +#!/bin/bash +# vlan-transport-interrupt.sh OUT: interruption baselines for the tagged +# transport variant (acceptance rows V23, V24, V27, V28). A tenant pod on +# sjc's compute node pings the off-fabric host every 20 ms through sjc's NAT +# shard, crossing both of sjc's transport sides, while one event happens. The +# interruption is the longest run of missing replies times 20 ms. +# +# Events, each with its own prober: +# restart-C1 galactic-nat restarted on untagged sides (V27 baseline) +# transition-C1-C2 C1 to C2 with parent selection (V23) +# restart-C2 galactic-nat restarted with the public side tagged (V27) +# recreate-C2 the edge's public VLAN netdevice deleted and recreated (V24) +# rollback-C2-C1 C2 back to C1 (V28) +# +# Runs inside the lab reservation; leaves sjc at C1. +set -uo pipefail + +SCRIPT_DIR=$(cd "$(dirname "$0")" && pwd) +source "${SCRIPT_DIR}/lib.sh" +OUT=${1:?out} +VT="${SCRIPT_DIR}/vlan-transport.sh" +CP=sjc-control-plane +EDGE=sjc-worker2 +TARGET=2001:db8:1:40::2 +INTERVAL=0.02 +COUNT=9000 # 180 s, enough for an apply or revert to finish +mkdir -p "${OUT}" + +POD=$(pod_name "${CP}" ns20) + +# probe NAME EVENT_DELAY COMMAND...: start the prober, run COMMAND after +# EVENT_DELAY seconds, wait for the prober, and report the longest gap. +probe() { + local name="$1" delay="$2" + shift 2 + docker exec "${CP}" kubectl -n ns20 exec "${POD}" -- \ + ping -6 -n -i "${INTERVAL}" -c "${COUNT}" -W 1 "${TARGET}" >"${OUT}/${name}.ping" 2>&1 & + local pinger=$! + sleep "${delay}" + echo "event ${name} at $(date -u +%T.%N | cut -c1-12): $*" + "$@" >"${OUT}/${name}.event" 2>&1 + wait "${pinger}" + python3 - "${OUT}/${name}.ping" "${COUNT}" <<'EOF' | tee -a "${OUT}/results.txt" +import re, sys +path, count = sys.argv[1], int(sys.argv[2]) +seen = set(int(m.group(1)) for m in re.finditer(r"icmp_seq=(\d+)", open(path).read())) +gap = run = 0 +for s in range(1, count + 1): + run = 0 if s in seen else run + 1 + gap = max(gap, run) +name = path.rsplit("/", 1)[1][:-5] +print("%s: %d/%d replies, longest gap %d probes = %d ms" % (name, len(seen), count, gap, gap * 20)) +EOF +} + +restart_nat() { + docker exec "${CP}" kubectl -n galactic-system rollout restart ds/galactic-nat + docker exec "${CP}" kubectl -n galactic-system rollout status ds/galactic-nat --timeout=120s +} + +recreate_vlan() { + local dev vid + dev=$(docker exec "${EDGE}" sh -c "grep '^public=' /galactic/vlan-transport.state | cut -d= -f2 | cut -d/ -f1") + vid=${dev##*.} + echo "change: ${EDGE}: ip link del ${dev}; recreate it with VID ${vid} and its addresses" + docker exec "${EDGE}" sh -c "ip link del ${dev} && ip link add link ${dev%.*} name ${dev} type vlan id ${vid} \ + && ip link set ${dev} up && ip -6 addr add 2001:db8:1:21::2/64 dev ${dev} && ip -4 addr add 10.1.21.2/24 dev ${dev}" +} + +probe restart-C1 10 restart_nat +probe transition-C1-C2 10 "${VT}" apply C2 parent +probe restart-C2 10 restart_nat +probe recreate-C2 10 recreate_vlan +probe rollback-C2-C1 10 "${VT}" revert +cat "${OUT}/results.txt" diff --git a/deploy/containerlab/scripts/vlan-transport.sh b/deploy/containerlab/scripts/vlan-transport.sh new file mode 100755 index 000000000..82175eabf --- /dev/null +++ b/deploy/containerlab/scripts/vlan-transport.sh @@ -0,0 +1,482 @@ +#!/bin/bash +# vlan-transport.sh: the tagged/untagged transport lab variant on the sjc +# site (docs/designs/vlan-transport/, issue #1401). +# +# Moves sjc's public side (sjc-worker2 bond0 <-> tr2 bond1) and fabric side +# (sjc-worker2 bond1 <-> sjc-worker bond0) between untagged and 802.1Q tagged +# transport at run time, and points galactic-gateway, galactic-nat and +# galactic-cni at the chosen interfaces. Nothing under config/ or resources/ +# changes: interfaces and addresses change on the live nodes, routing config +# on tr2 changes in vtysh's running config only, and the Galactic settings +# change with kubectl on the live DaemonSets. `revert` undoes all of it from +# the state the first `apply` saved on the edge node. +# +# Usage: +# vlan-transport.sh plan CELL [logical|parent] print what apply would change; needs no lab +# vlan-transport.sh apply CELL [logical|parent] cells in ../resources/vlan-transport/cells.env +# vlan-transport.sh revert back to C1 with the saved Galactic settings +# vlan-transport.sh status what is applied now +# vlan-transport.sh offload on|off VLAN offloads on every transport member +# vlan-transport.sh snapshot DIR interfaces, offloads, XDP, versions +# vlan-transport.sh capture-start DIR NAME tcpdump every transport link +# vlan-transport.sh capture-stop DIR NAME stop and summarize tags per link +# +# SELECT=logical (default) names each side's logical interface, as the +# contract requires: the VLAN netdevice on a tagged side. SELECT=parent names +# the parent instead, the misconfiguration the contract's section 4 accepts, +# which lets the unchanged XDP programs show how they treat tagged traffic. +# PUB_VID and FAB_VID override the cell's IDs. +# +# The caller holds the containerlab-manager reservation. Every change here is +# echoed with a "change:" prefix so the run's log records it exactly. +set -euo pipefail + +SCRIPT_DIR=$(cd "$(dirname "$0")" && pwd) +source "${SCRIPT_DIR}/lib.sh" + +LAB=${LAB:-gvpc} +NS=galactic-system +STATE=/galactic/vlan-transport.state +CELLS="${RESOURCES_DIR}/vlan-transport/cells.env" +CNI_COPY=galactic-cni-vt-edge + +# VT_SITE picks the edge node the variant re-plumbs. sjc (the default) is the +# full variant: sjc-worker2's public and fabric sides. dfw-worker3 changes +# only that node's public side, for the same-node delivery row (V10), which +# the edge conformance suite runs on dfw; dfw's NAT DaemonSet also serves +# dfw-worker2, so its settings stay as deployed there. +# +# Per side: " " for +# both ends. Keep in step with resources/node-addresses/ and node_files/tr*. +# The side arrays are read through namerefs (side_apply, side_revert). +# shellcheck disable=SC2034 +case "${VT_SITE:-sjc}" in + sjc) + EDGE=sjc-worker2 COMPUTE=sjc-worker CP=sjc-control-plane TR=clab-${LAB}-tr2 + PUB_EDGE=("${EDGE}" bond0 eth1 2001:db8:1:21::2/64 10.1.21.2/24) + PUB_PEER=("${TR}" bond1 eth1 2001:db8:1:21::1/64 10.1.21.1/24) + FAB_EDGE=("${EDGE}" bond1 eth2 2001:db8:1:20::1/64 10.1.20.1/24) + FAB_PEER=("${COMPUTE}" bond0 eth1 2001:db8:1:20::2/64 10.1.20.2/24) + MEMBERS=("${TR} eth1 eth5" "${EDGE} eth1 eth3 eth2 eth4" "${COMPUTE} eth1 eth2") + SET_NAT=1 + ;; + dfw-worker3) + EDGE=dfw-worker3 COMPUTE=dfw-worker CP=dfw-control-plane TR=clab-${LAB}-tr1 + PUB_EDGE=("${EDGE}" bond0 eth1 2001:db8:1:12::2/64 10.1.12.2/24) + PUB_PEER=("${TR}" bond2 eth5 2001:db8:1:12::1/64 10.1.12.1/24) + FAB_EDGE=("${EDGE}" bond1 eth2 2001:db8:1:13::1/64 10.1.13.1/24) + FAB_PEER=("${COMPUTE}" bond1 eth2 2001:db8:1:13::2/64 10.1.13.2/24) + MEMBERS=("${TR} eth5 eth7" "${EDGE} eth1 eth3") + SET_NAT=0 + ;; + *) echo "vlan-transport: unknown VT_SITE ${VT_SITE}" >&2; exit 2 ;; +esac +# Datapath images and kubectl live on the Kind nodes; the transit routers +# have vtysh. +kc() { docker exec "${CP}" kubectl -n "${NS}" "$@"; } +on() { local n="$1"; shift; echo "change: ${n}: $*"; docker exec "${n}" "$@"; } +q() { local n="$1"; shift; docker exec "${n}" "$@"; } + +die() { echo "vlan-transport: $*" >&2; exit 1; } + +# ethtool runs on the Kind nodes directly. tr2's image has none, so it runs +# from the Kind node image joined to tr2's network namespace. +eth() { + local n="$1" + shift + if [ "${n}" = "${TR}" ]; then + docker run --rm --privileged --network "container:${TR}" --entrypoint ethtool kindest/node:galactic "$@" + else + docker exec "${n}" ethtool "$@" + fi +} + +state_get() { q "${EDGE}" sh -c "test -f ${STATE} && grep '^$1=' ${STATE} | cut -d= -f2- || true"; } +state_put() { q "${EDGE}" sh -c "grep -v '^$1=' ${STATE} 2>/dev/null > ${STATE}.new || true; echo '$1=$2' >> ${STATE}.new; mv ${STATE}.new ${STATE}"; } + +ds_env() { # DS CONTAINER VAR + kc get ds "$1" -o jsonpath="{.spec.template.spec.containers[?(@.name=='$2')].env[?(@.name=='$3')].value}" +} + +gateway_ds() { kc get ds -o name | grep -E "galactic-gateway.*${EDGE}" | head -1 | cut -d/ -f2; } + +# save_original records the C1 Galactic settings once, before the first change. +save_original() { + [ -n "$(state_get gw_public)" ] && return + local gw + gw=$(gateway_ds) + [ -n "${gw}" ] || die "no galactic-gateway DaemonSet for ${EDGE}" + q "${EDGE}" sh -c ": > ${STATE}" + state_put gw_ds "${gw}" + state_put gw_public "$(ds_env "${gw}" galactic-gateway GALACTIC_GATEWAY_PUBLIC_INTERFACE)" + state_put gw_internal "$(ds_env "${gw}" galactic-gateway GALACTIC_GATEWAY_INTERNAL_INTERFACES)" + state_put nat_uplinks "$(ds_env galactic-nat galactic-nat GALACTIC_NAT_UPLINK_INTERFACES)" + state_put cni_ifaces "$(ds_env galactic-cni credential-refresh GALACTIC_CNI_EBPF_INTERFACES)" + q "${EDGE}" cat "${STATE}" | sed 's/^/saved: /' +} + +# --- interfaces ------------------------------------------------------------- + +# tr2 addresses belong to FRR (node_files/tr2/frr.conf), so they move with +# vtysh; the Kind nodes' addresses are host-managed (deploy:node-addresses), +# so they move with ip. +addr_move() { # NODE FROM TO V6 V4 + local n="$1" from="$2" to="$3" v6="$4" v4="$5" + if [ "${n}" = "${TR}" ]; then + on "${n}" vtysh -c "configure terminal" -c "interface ${from}" -c "no ipv6 address ${v6}" -c "no ip address ${v4}" \ + -c "interface ${to}" -c "ipv6 address ${v6}" -c "ip address ${v4}" + else + on "${n}" ip -6 addr del "${v6}" dev "${from}" 2>/dev/null || true + on "${n}" ip -4 addr del "${v4}" dev "${from}" 2>/dev/null || true + on "${n}" ip -6 addr replace "${v6}" dev "${to}" + on "${n}" ip -4 addr replace "${v4}" dev "${to}" + fi +} + +# side_apply END PARENT_KIND VID: build one end of one side and print its +# logical interface and parent as "logical parent". +side_apply() { + local -n e="$1" + local kind="$2" vid="$3" n="${e[0]}" bond="${e[1]}" member="${e[2]}" v6="${e[3]}" v4="${e[4]}" + local parent="${bond}" + if [ "${kind}" = nic ]; then + parent="${member}" + if q "${n}" ip -o link show dev "${member}" | grep -q " master ${bond} "; then + on "${n}" ip link set dev "${member}" nomaster + on "${n}" ip link set dev "${member}" mtu 1500 up + fi + fi + local logical="${parent}" + if [ -n "${vid}" ]; then + logical="${parent}.${vid}" + q "${n}" ip link show dev "${logical}" >/dev/null 2>&1 \ + || on "${n}" ip link add link "${parent}" name "${logical}" type vlan protocol 802.1Q id "${vid}" + on "${n}" ip link set dev "${logical}" up + fi + if [ "${logical}" != "${bond}" ]; then + addr_move "${n}" "${bond}" "${logical}" "${v6}" "${v4}" + fi + echo "${logical} ${parent}" >&3 +} + +# side_revert END: remove any VLAN and re-bond, moving the addresses home. +side_revert() { + local -n e="$1" + local n="${e[0]}" bond="${e[1]}" member="${e[2]}" v6="${e[3]}" v4="${e[4]}" dev + for dev in $(q "${n}" sh -c "ip -o link show type vlan | awk -F': ' '{print \$2}' | cut -d@ -f1"); do + case "${dev}" in + "${bond}".* | "${member}".*) + addr_move "${n}" "${dev}" "${bond}" "${v6}" "${v4}" + on "${n}" ip link del dev "${dev}" + ;; + esac + done + if ! q "${n}" ip -o link show dev "${member}" | grep -q " master ${bond} "; then + if [ "${n}" = "${TR}" ]; then + on "${n}" /opt/lab/mkbond.sh "${bond}" "${member}" + else + on "${n}" /galactic/scripts/mkbond.sh "${bond}" "${member}" + fi + fi + if [ "${n}" != "${TR}" ]; then + on "${n}" ip -6 addr replace "${v6}" dev "${bond}" + on "${n}" ip -4 addr replace "${v4}" dev "${bond}" + fi +} + +# --- Galactic settings ------------------------------------------------------ + +set_gateway() { # PUBLIC INTERNAL + local gw + gw=$(state_get gw_ds) + echo "change: ds/${gw}: GALACTIC_GATEWAY_PUBLIC_INTERFACE=$1 GALACTIC_GATEWAY_INTERNAL_INTERFACES=$2" + kc set env "ds/${gw}" -c galactic-gateway "GALACTIC_GATEWAY_PUBLIC_INTERFACE=$1" "GALACTIC_GATEWAY_INTERNAL_INTERFACES=$2" +} + +set_nat() { + echo "change: ds/galactic-nat: GALACTIC_NAT_UPLINK_INTERFACES=$1" + kc set env ds/galactic-nat -c galactic-nat "GALACTIC_NAT_UPLINK_INTERFACES=$1" +} + +# set_cni COMPUTE_VALUE EDGE_VALUE. One cluster-wide DaemonSet serves both +# sjc nodes, and bond0 is the public side on the edge but the fabric side on +# the compute node, so a tagged side needs different names per node. When the +# values differ, the edge gets its own copy of the DaemonSet and the original +# excludes it. +set_cni() { + local compute="$1" edge="$2" + if kc get ds "${CNI_COPY}" >/dev/null 2>&1; then + cni_unsplit + fi + if [ "${edge}" != "${compute}" ]; then + echo "change: ds/galactic-cni: exclude ${EDGE}; ds/${CNI_COPY} on ${EDGE} with GALACTIC_CNI_EBPF_INTERFACES=${edge}" + kc patch ds galactic-cni --type=json -p "[{\"op\":\"add\",\"path\":\"/spec/template/spec/affinity/nodeAffinity/requiredDuringSchedulingIgnoredDuringExecution/nodeSelectorTerms/0/matchExpressions/-\",\"value\":{\"key\":\"kubernetes.io/hostname\",\"operator\":\"NotIn\",\"values\":[\"${EDGE}\"]}}]" + kc rollout status ds/galactic-cni --timeout=300s + kc get ds galactic-cni -o json | jq --arg name "${CNI_COPY}" --arg node "${EDGE}" --arg v "${edge}" ' + {apiVersion, kind, metadata: {name: $name, namespace: .metadata.namespace, labels: .metadata.labels}, + spec: (.spec + | .selector.matchLabels["vlan-transport.lab/copy"] = "edge" + | .template.metadata.labels["vlan-transport.lab/copy"] = "edge" + | .template.spec.affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms[0].matchExpressions + |= map(if .key == "kubernetes.io/hostname" then .operator = "In" | .values = [$node] else . end) + | (.template.spec.containers[], (.template.spec.initContainers // [])[]).env + |= ((. // []) | map(if .name == "GALACTIC_CNI_EBPF_INTERFACES" then .value = $v else . end)))}' \ + | docker exec -i "${CP}" kubectl apply -f - + kc rollout status "ds/${CNI_COPY}" --timeout=300s || echo "set_cni: ${CNI_COPY} not ready (recorded, not fatal)" + fi + echo "change: ds/galactic-cni: GALACTIC_CNI_EBPF_INTERFACES=${compute} (all containers)" + kc set env ds/galactic-cni --containers='*' "GALACTIC_CNI_EBPF_INTERFACES=${compute}" + kc rollout status ds/galactic-cni --timeout=300s || echo "set_cni: galactic-cni not ready (recorded, not fatal)" +} + +cni_unsplit() { + echo "change: delete ds/${CNI_COPY}; ds/galactic-cni: drop the ${EDGE} exclusion" + kc delete ds "${CNI_COPY}" --wait=true + local idx + idx=$(kc get ds galactic-cni -o json | jq '.spec.template.spec.affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms[0].matchExpressions | map(.key) | index("kubernetes.io/hostname")') + if [ "${idx}" != null ]; then + kc patch ds galactic-cni --type=json -p "[{\"op\":\"remove\",\"path\":\"/spec/template/spec/affinity/nodeAffinity/requiredDuringSchedulingIgnoredDuringExecution/nodeSelectorTerms/0/matchExpressions/${idx}\"}]" + fi +} + +wait_galactic() { + local gw rc=0 + gw=$(state_get gw_ds) + kc rollout status "ds/${gw}" --timeout=180s || rc=1 + if [ "${SET_NAT}" = 1 ]; then + kc rollout status ds/galactic-nat --timeout=180s || rc=1 + fi + return "${rc}" +} + +# --- commands --------------------------------------------------------------- + +# cell_values CELL SELECT sets pv, fv and kind from cells.env, applying the +# PUB_VID and FAB_VID overrides, and rejects values no transport may use. +cell_values() { + local cell="$1" select="$2" v + case "${cell}" in C[0-9]) ;; *) die "unknown cell ${cell}" ;; esac + case "${select}" in logical | parent) ;; *) die "select must be logical or parent, not ${select}" ;; esac + # shellcheck disable=SC1090 + source "${CELLS}" + eval "pv=\${${cell}_PUB_VID-unset} fv=\${${cell}_FAB_VID-unset} kind=\${${cell}_PARENT-unset}" + [ "${kind}" != unset ] || die "unknown cell ${cell}" + pv=${PUB_VID-${pv}} + fv=${FAB_VID-${fv}} + for v in "${pv}" "${fv}"; do + [ -z "${v}" ] && continue + if ! [[ "${v}" =~ ^[0-9]+$ ]] || [ "${v}" -lt 1 ] || [ "${v}" -gt 4094 ]; then + die "VLAN ID ${v} is outside 1 to 4094" + fi + done +} + +# name_of END KIND VID prints an end's logical interface and parent, as +# side_apply builds them. +name_of() { + local -n e="$1" + local parent="${e[1]}" + [ "$2" = nic ] && parent="${e[2]}" + if [ -n "$3" ]; then echo "${parent}.$3 ${parent}"; else echo "${parent} ${parent}"; fi +} + +# cmd_plan CELL [SELECT] prints what apply would change, touching nothing. +cmd_plan() { + local cell="${1:?cell}" select="${2:-logical}" pv fv kind end l p + cell_values "${cell}" "${select}" + echo "plan ${cell} on ${VT_SITE:-sjc}: public VID '${pv:-none}', fabric VID '${fv:-none}', parent ${kind}, select ${select}" + declare -A pick + for end in PUB_PEER PUB_EDGE FAB_EDGE FAB_PEER; do + local vid=${pv} + [[ "${end}" == FAB_* ]] && vid=${fv} + read -r l p <<<"$(name_of "${end}" "${kind}" "${vid}")" + local -n arr="${end}" + echo " ${end}: ${arr[0]#clab-"${LAB}"-} logical ${l}, parent ${p}, addresses ${arr[3]} ${arr[4]}" + pick[${end}]=${l} + [ "${select}" = parent ] && pick[${end}]=${p} + unset -n arr + done + echo " galactic-gateway on ${EDGE}: PUBLIC=${pick[PUB_EDGE]} INTERNAL=${pick[FAB_EDGE]}" + if [ "${SET_NAT}" = 1 ]; then + echo " galactic-nat: UPLINK_INTERFACES=${pick[PUB_EDGE]},${pick[FAB_EDGE]}" + echo " galactic-cni: ${COMPUTE} EBPF_INTERFACES=${pick[FAB_PEER]}; ${EDGE} EBPF_INTERFACES=${pick[PUB_EDGE]}" + else + echo " galactic-cni: ${EDGE} EBPF_INTERFACES=${pick[PUB_EDGE]},${pick[FAB_EDGE]}; other nodes unchanged" + fi +} + +cmd_apply() { + local cell="${1:?cell}" select="${2:-logical}" pv fv kind + cell_values "${cell}" "${select}" + save_original + [ -z "$(state_get cell)" ] || [ "$(state_get cell)" = C1 ] || cmd_revert_interfaces + echo "apply ${cell}: public VID '${pv:-none}', fabric VID '${fv:-none}', parent ${kind}, select ${select}" + + local pub fab cpt + exec 3>/tmp/vlan-transport.$$ + side_apply PUB_PEER "${kind}" "${pv}" + side_apply PUB_EDGE "${kind}" "${pv}" + side_apply FAB_EDGE "${kind}" "${fv}" + side_apply FAB_PEER "${kind}" "${fv}" + exec 3>&- + mapfile -t lines /dev/null || echo 'no state: C1 as deployed'" + local n + for n in "${TR}" "${EDGE}" "${COMPUTE}"; do + echo "--- ${n}" + q "${n}" sh -c "ip -br addr show | grep -E '^(bond|eth[1-5])' || true" + done + kc get pods -o wide 2>/dev/null | grep -E "galactic-(gateway|nat|cni).*(${EDGE}|${COMPUTE})" || true +} + +cmd_snapshot() { + local dir="${1:?dir}" n i + mkdir -p "${dir}" + { + echo "date: $(date -u +%FT%TZ)" + echo "host kernel: $(uname -r)" + for n in "${TR}" "${EDGE}" "${COMPUTE}"; do + echo "=== ${n}" + q "${n}" uname -r + q "${n}" ip -d link show 2>/dev/null | grep -A3 -E '^[0-9]+: (bond|eth[1-5])' || true + for i in $(q "${n}" sh -c "ls /sys/class/net | grep -E '^(bond|eth[1-5])'"); do + echo "--- ${n} ${i} ethtool" + { eth "${n}" -i "${i}" 2>/dev/null | head -2; eth "${n}" -k "${i}" 2>/dev/null | grep -E 'vlan|generic-receive'; } || true + done + done + echo "=== galactic images" + kc get pods -o jsonpath='{range .items[*]}{.metadata.name}{"\t"}{.spec.nodeName}{"\t"}{range .status.containerStatuses[*]}{.imageID}{" "}{end}{"\n"}{end}' \ + | grep -E "(${EDGE}|${COMPUTE})" || true + } >"${dir}/snapshot.txt" 2>&1 + echo "snapshot: ${dir}/snapshot.txt" +} + +# Capture points: the receiving end of every transport link, so frames a +# sender transmits from XDP (invisible to its own tcpdump) are still seen. +# Captures run on bond members or plain NICs, never on VLAN netdevices, so +# libpcap reports the tag whether it is in the frame or in skb metadata. +if [ "${VT_SITE:-sjc}" = sjc ]; then + CAPS=( + "${TR} eth1 public-at-router" "${TR} eth5 public-at-router" + "${EDGE} eth1 public-at-edge" "${EDGE} eth3 public-at-edge" + "${EDGE} eth2 fabric-at-edge" "${EDGE} eth4 fabric-at-edge" + "${COMPUTE} eth1 fabric-at-compute" "${COMPUTE} eth2 fabric-at-compute" + ) +else + CAPS=( + "${TR} eth5 public-at-router" "${TR} eth7 public-at-router" + "${EDGE} eth1 public-at-edge" "${EDGE} eth3 public-at-edge" + ) +fi + +cmd_capture_start() { + local dir="${1:?dir}" name="${2:?name}" c n i role + for c in "${CAPS[@]}"; do + read -r n i role <<<"${c}" + q "${n}" sh -c "rm -f /tmp/vt-${name}-${i}.pcap; (timeout 300 tcpdump -i ${i} -nn -e -s 128 -w /tmp/vt-${name}-${i}.pcap >/dev/null 2>/tmp/vt-${name}-${i}.err &)" + done + sleep 2 +} + +cmd_capture_stop() { + local dir="${1:?dir}" name="${2:?name}" c n i role f + mkdir -p "${dir}" + sleep 1 + for c in "${CAPS[@]}"; do + read -r n i role <<<"${c}" + q "${n}" sh -c "pkill -INT -f 'tcpdump -i ${i} -nn -e -s 128 -w /tmp/vt-${name}-${i}.pcap' || true" + done + sleep 1 + for c in "${CAPS[@]}"; do + read -r n i role <<<"${c}" + f="${dir}/${name}-${n#clab-"${LAB}"-}-${i}.pcap" + docker cp "${n}:/tmp/vt-${name}-${i}.pcap" "${f}" >/dev/null 2>&1 || continue + local tot v1 v2 un + tot=$(tcpdump -r "${f}" -nn 2>/dev/null | wc -l) + v1=$(tcpdump -r "${f}" -nn "vlan ${TAG_A:-101}" 2>/dev/null | wc -l) + v2=$(tcpdump -r "${f}" -nn "vlan ${TAG_B:-202}" 2>/dev/null | wc -l) + un=$(tcpdump -r "${f}" -nn 'not vlan' 2>/dev/null | wc -l) + printf '%-18s %-12s %-5s total=%-6s vlan%s=%-6s vlan%s=%-6s untagged=%-6s other-tag=%s\n' "${role}" "${n#clab-"${LAB}"-}" "${i}" \ + "${tot}" "${TAG_A:-101}" "${v1}" "${TAG_B:-202}" "${v2}" "${un}" "$((tot - v1 - v2 - un))" + done | tee "${dir}/${name}-tags.txt" +} + +case "${1:-}" in + plan) shift; cmd_plan "$@" ;; + apply) shift; cmd_apply "$@" ;; + revert) cmd_revert ;; + status) cmd_status ;; + offload) shift; cmd_offload "$@" ;; + snapshot) shift; cmd_snapshot "$@" ;; + capture-start) shift; cmd_capture_start "$@" ;; + capture-stop) shift; cmd_capture_stop "$@" ;; + *) sed -n '2,30p' "$0"; exit 2 ;; +esac diff --git a/docs/archive/README.md b/docs/archive/README.md index a012f93e9..2bdd91a08 100644 --- a/docs/archive/README.md +++ b/docs/archive/README.md @@ -14,5 +14,6 @@ Use the [current egress rollout checklist](../nat/active-active-rollout.md). In - [fabric-api full-table measurements, October 7](benchmarks/fabric-api-2026-10-07.md). - [Looking Glass qualification on the lab, October 27](benchmarks/looking-glass-qualification-2026-10-27.md). +- [VLAN transport baseline, November 30](benchmarks/vlan-transport-baseline-2026-11-30.md): kernel probe results and the expected result of each path, before the transport work. Use the [maintained load-test procedure](../fabric-api/load-test.md) and the [Looking Glass qualification procedure](../fabric-api/qualification.md) to qualify a new release. Record its revision, environment and result instead of replacing the older evidence. diff --git a/docs/archive/benchmarks/vlan-transport-baseline-2026-11-30.md b/docs/archive/benchmarks/vlan-transport-baseline-2026-11-30.md new file mode 100644 index 000000000..7f6a50ada --- /dev/null +++ b/docs/archive/benchmarks/vlan-transport-baseline-2026-11-30.md @@ -0,0 +1,206 @@ +# VLAN transport baseline, 2026-11-30 + +This is the baseline for issue [#1401](https://github.com/datum-cloud/galactic/issues/1401) under epic [#1399](https://github.com/datum-cloud/galactic/issues/1399). It records what the code below does with tagged and untagged transport, checked against the [transport contract](../../designs/vlan-transport/contract.md) and its [acceptance matrix](../../designs/vlan-transport/acceptance.md). A failing or inferred row is discovery evidence, not acceptance. Nothing here qualifies a hardware environment, a staging cell or a release. + +| Item | Value | +| ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Code | `epic/1399-vlan-transport` at `352fe3a2`, which carries `main` at `c504549a` plus the contract documents. `main` has since moved; nothing here covers that. | +| Environment U | veth and 802.3ad bond parents in network namespaces. Run as root in a privileged container on kernel 7.3.3, and in CI's root unit-test job on kernel 7.0.0, on 2026-11-30. | +| Environment L | Not run. The epic moved every lab run to one pass at its end ([#1405](https://github.com/datum-cloud/galactic/issues/1405)). The variant tooling is in place. | +| Environment H | Not run; [#1406](https://github.com/datum-cloud/galactic/issues/1406). | + +Each answer and row is labelled: + +- **Probe-measured**: executed by the kernel probe below. +- **Source-inferred**: read from code at `352fe3a2`, combined with probe results where stated. It is not observed behaviour of a Galactic component. +- **Deferred to #1405 end-of-epic lab pass**: not run here. It is never counted as passed. + +No row is lab-measured. + +## Answers to the contract's questions + +| Question | Answer | Label | +| ----------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------- | +| Q1. Where XDP hooks attach for a tagged side | A VLAN netdevice accepts generic XDP only. Native attach fails with `EOPNOTSUPP`, and the kernel reports it as having no native XDP, so Galactic's gate refuses it first. On `main`, `edgeattach.ResolveTargets` and `natattach.ResolveTargets` keep a VLAN netdevice as the target. A gateway or NAT shard pointed at a tagged side's logical interface therefore fails to attach in native mode. Native hooks have to go on the parent or its members, with the tag handled in the program. | Probe-measured; source-inferred for Galactic | +| Q2. Where the tag is, and whether `XDP_PASS` keeps it | At XDP the tag is in packet data unless VLAN offload has moved it into metadata: on veth, the sender's transmit offload decides. When it is in metadata the frame looks untagged. At tc on the physical interface or bond it is always in `skb->vlan_tci`. At tc on the VLAN netdevice it is gone. `XDP_PASS` delivered every frame to the correct VLAN netdevice in all 16 mode and offload combinations. | Probe-measured | +| Q3. How XDP tells two VLANs on one parent apart | From packet data it cannot when the tag is in metadata: both VLANs' frames are identical. The device-bound kfunc `bpf_xdp_metadata_rx_vlan_tag` returned the right VID on a veth and a bond member in native mode. It does not load for a VLAN netdevice, does not attach in generic mode, and binds a program to one device, which the shared XDP dispatcher does not do today. | Probe-measured | +| Q4. XDP redirect to a VLAN netdevice; FIB result through it | `bpf_fib_lookup` returns the VLAN netdevice. A native XDP redirect to it drops every frame, since there is no `ndo_xdp_xmit`. A generic redirect transmits it tagged. A redirect to the parent sends it untagged. | Probe-measured | +| Q5. tc `bpf_redirect` to a VLAN netdevice | It inserts the tag, on veth and bond parents, with transmit VLAN offload on and off. | Probe-measured; hardware parents deferred to #1406 | +| Q6. Same-node delivery with a tagged public side | Not reachable on `main` in the contract's configuration, because `edge_lb` cannot attach natively to the public VLAN netdevice (Q1). With the parent named instead and the tag in metadata, `edge_lb` would claim the frame: it checks only the EtherType (`edgedsr.c:1306`), and the probe shows such frames look untagged. It would push the outer header and return `XDP_PASS`, and the tag stays in metadata through `XDP_PASS` (Q2). `usid_ingress` on the bond members then sees it in `skb->vlan_tci` and pops it after decapsulation (`usid.c:4479`). With the tag in packet data, `edge_lb` does not claim the frame at all. Which hook claims the packet first, and the end-to-end result, are deferred to #1405. | Source-inferred from probe results | + +## Kernel behaviour (environment U) + +**Measured.** `TestVLANTransportProbe` (`internal/plumbing/ebpf/vlanprobe`) ran as root in a privileged container on host kernel 7.3.3. Parents are veths, either a single veth (the "NIC" case) or an 802.3ad bond of two veths, with VLANs 101 and 202 on every parent. Every delivery row sends 10 UDP datagrams after a warm-up datagram. Probe programs at each hook record the EtherType in packet data and any tag in metadata: `skb->vlan_tci` at tc, the `bpf_xdp_metadata_rx_vlan_tag` kfunc at XDP. Reproduce with: + +```sh +task test:unit-root # or, without host root, in a privileged container: +CGO_ENABLED=0 go test -c -o vlanprobe.test ./internal/plumbing/ebpf/vlanprobe/ +clang -O2 -g -target bpf -c internal/plumbing/ebpf/vlanprobe/testdata/probe.c -o probe.o +docker run --rm --privileged -v "$PWD:/w" -w /w -e VLANPROBE_OBJ=/w/probe.o \ + -e VLANPROBE_REPORT=/w/vlanprobe-report.json fabric-router:latest /w/vlanprobe.test -test.v +``` + +`VLANPROBE_REPORT` writes every observation as JSON. Two local runs on kernel 7.3.3 produced identical outcomes. CI's root unit-test job on kernel 7.0.0 recorded the same tag representation at every hook and on every wire; the bond spread flows over its members differently. Two delivery counts differed in CI, and the Q4 table notes them. + +### Q1: where XDP can attach + +| Interface | Kernel reports native XDP | Native attach | Generic attach | Device-bound program (kfunc) | +| ------------------- | ------------------------- | ------------- | -------------- | ---------------------------- | +| veth (plain NIC) | yes | ok | ok | native ok, generic `EINVAL` | +| 802.3ad bond master | yes | ok | ok | native ok, generic `EINVAL` | +| bond member | yes | ok | ok | native ok, generic `EINVAL` | +| VLAN on a veth | no | `EOPNOTSUPP` | ok | load fails with `EOPNOTSUPP` | +| VLAN on a bond | no | `EOPNOTSUPP` | ok | load fails with `EOPNOTSUPP` | + +`edgepreflight.InterfaceSupportsNativeXDP`, the check `xdpattach` runs before a native attach, reports both VLAN netdevices as unsupported. **Source:** `checkNativeXDPSupport` (`internal/plumbing/ebpf/xdpattach/gate.go`) then refuses the whole attach. + +### Q2: where the tag is at each hook + +Every row below delivered 10 of 10 datagrams on VLAN 101, on VLAN 202 and untagged, with an observing program at XDP on the physical interfaces returning `XDP_PASS`. So `XDP_PASS` always kept enough context for the kernel to deliver to the right VLAN netdevice. + +| Sender `tx-vlan-offload` | XDP on the physical interface, native or generic | tc ingress on the physical interface or bond | tc ingress on the VLAN netdevice | +| ------------------------ | ------------------------------------------------ | -------------------------------------------- | -------------------------------- | +| on | Frame untagged, no tag in packet data | Tag in `skb->vlan_tci` | No tag | +| off | Tag in packet data (EtherType `0x8100`) | Tag in `skb->vlan_tci` | No tag | + +- On veth, the receiver's `rx-vlan-offload` setting changed nothing. The sender's transmit offload decided where the tag was: with it on, the tag crosses the veth as skb metadata. A hardware NIC with receive VLAN offload strips the tag into its descriptor instead. That is the analogous case, but it was not measured here (environment H). +- The tc rows did not depend on either setting. The kernel moves an in-frame tag into metadata before tc ingress runs on the physical interface or bond, and pops it before the VLAN netdevice's tc ingress. +- Generic and native XDP saw the same representation. + +### Q3: two VLANs on one parent + +With the tag in metadata (sender offload on), XDP on the shared parent sees frames for VLAN 101 and VLAN 202 with identical, untagged packet data. **Packet data alone cannot tell the two VLANs apart.** A device-bound program calling `bpf_xdp_metadata_rx_vlan_tag` read VID 101 and VID 202 correctly on a veth and on a bond member in native mode, and both VLANs still delivered 10 of 10. That kfunc is the only XDP-side discriminator measured. It requires native mode, a driver that implements it (veth does; hardware drivers were not measured) and a program bound to one device. A program shared through the XDP dispatcher across several interfaces is not bound to one device. With the tag in packet data (sender offload off), the VID is readable from the frame. + +### Q4: `bpf_fib_lookup` and XDP redirect to a VLAN + +A route in B points through B's fabric VLAN (`parent.202`) toward A. A probe on B's ingress interface `bs0` looks the destination up and redirects. The neighbour is warm. + +| Program | Redirect target | Delivered at A on 7.3.3, both B `tx-vlan-offload` settings | What reached A's wire, on 7.3.3 and 7.0.0 | +| ----------------- | ------------------------- | ---------------------------------------------------------- | ----------------------------------------- | +| XDP, native | FIB result (`parent.202`) | 0/10 | nothing | +| XDP, generic | FIB result (`parent.202`) | 10/10 | 802.1Q VID 202 | +| XDP, native | the parent | 10/10 | untagged | +| XDP, generic | the parent | 10/10 | untagged | +| tc `bpf_redirect` | FIB result (`parent.202`) | 10/10 | 802.1Q VID 202 | +| tc `bpf_redirect` | the parent | 10/10 | untagged | + +- `bpf_fib_lookup` returned success with the VLAN netdevice's ifindex, on veth and bond parents, from XDP and from tc. +- A native XDP redirect to that ifindex drops every frame: a VLAN netdevice has no `ndo_xdp_xmit`. +- A generic redirect transmits through the VLAN netdevice and is tagged. +- A redirect to the parent, in either mode, puts the frame on the wire untagged. Nothing inserts the tag on its behalf. + +The rows are the same on a single veth and on a bond. + +The answer rests on the last column, the frames A's tc probe saw on its physical interfaces. Both kernels agree on it. On the CI kernel, A's UDP listener received none of these redirected datagrams in any row, including the untagged redirects to the parent, and no drop or error counter rose in A's namespace. That points at the probe's receive side on that runner, not at tagging, and it is left unexplained. One run in CI also delivered 9 of 10 on VLAN 101 for the bond, native, offload-on row. + +### Q5: tc redirect to a VLAN + +`bpf_redirect` from tc to the VLAN netdevice put all 10 datagrams on the wire with VID 202, and A received all 10 on kernel 7.3.3. That held on veth and bond parents, with B's transmit VLAN offload on and off. + +### Invalid VLAN netdevices the kernel accepts + +**Measured**, for [contract section 5](../../designs/vlan-transport/contract.md#validation): the kernel creates a VLAN with ID 0, an 802.1ad VLAN, and an 802.1Q VLAN stacked on an 802.1ad VLAN. It refuses ID 4095 (`ERANGE`). So infrastructure can hand Galactic every invalid case except ID 4095, and Galactic's own validation ([#1404](https://github.com/datum-cloud/galactic/issues/1404)) has to reject them. + +### Probe-rig artifact + +A veth sender with transmit checksum offload hands the receiver a frame whose UDP checksum is still partial. A native XDP redirect forwards those bytes as they are, and the far end counts `Udp.InCsumErrors`. The rig turns the sender's checksum offload off. The lab has the same exposure wherever a veth peer's traffic is natively redirected, which the #1405 lab pass should account for. + +### Finding: a single 802.1Q tag never reaches tc ingress in the frame + +**Probe-measured.** Every frame carrying one 802.1Q tag reached tc ingress on the physical interface or bond with the tag in `skb->vlan_tci`. The sender's offload setting made no difference, because the kernel moves an in-frame tag into metadata before tc runs. The worksheet's [P6](../../designs/vlan-transport/packet-paths.md#p6-tenant-srv6-ingress-fabric-to-tenant) and the contract's section 10 say a tag left in packet data reaches `usid_ingress`'s EtherType check. That did not happen for a single 802.1Q tag on this kernel. It remains possible for frames the kernel does not untag, such as an 802.1ad outer tag or a second tag. Hardware receive paths were not measured. + +## Expected result of each path on `main` + +**Source-inferred**, from the code at `352fe3a2` combined with the probe results above. "Tag in metadata" is what receive VLAN offload produces, and what a veth produces with the sender's transmit offload on. "Logical selection" names the VLAN netdevice, as the contract requires. "Parent selection" names its parent, the misconfiguration the [contract's section 4](../../designs/vlan-transport/contract.md#failure-this-design-accepts) accepts. + +| Path | Rows | Expected on a tagged side | Owner | +| -------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | +| P1 gateway ingress | V01 | **Logical selection:** `edge_lb` does not attach (Q1), so no VIP traffic is claimed. **Parent selection, tag in metadata:** claimed, because the frame looks untagged. With a tagged fabric, `bpf_fib_lookup` then returns the fabric VLAN netdevice and the native redirect drops every packet (Q4). **Tag in data:** not claimed (`edgedsr.c:1306`); the kernel handles it. | [#1403](https://github.com/datum-cloud/galactic/issues/1403) | +| P2 same-node delivery | V10 | As Q6: unreachable with logical selection. With parent selection, the tag survives `XDP_PASS` in metadata and `usid_ingress` pops it. | [#1403](https://github.com/datum-cloud/galactic/issues/1403) | +| P3 DSR return | V02 | **Backend node:** `usid_egress` redirects to the `public_uplink_table` row, which `srv6.ResolvePublicUplink` fills from the first interface `attach.ResolveInterfaces` lists. With the fabric VLAN named, that is the VLAN netdevice, and a tc redirect to it is tagged (Q5). **Edge:** `edge_return` does not attach to a fabric VLAN (Q1). With parent selection it claims the reply, `bpf_fib_lookup` returns the public VLAN netdevice when the public side is tagged, and the native redirect drops it (Q4). | [#1403](https://github.com/datum-cloud/galactic/issues/1403) | +| P4, P5 NAT66 and NAT64 | V03, V04 | `nat_ingress` does not attach to a VLAN netdevice (Q1). With parent selection: claimed when the tag is in metadata. A FIB result naming the other side's VLAN is dropped by the native redirect (Q4). A neighbour miss returns `XDP_PASS`, and the tag survives that (Q2), so a cold neighbour may succeed through the kernel where a warm one fails. That inverts V07's expectation. | [#1403](https://github.com/datum-cloud/galactic/issues/1403) | +| P6 tenant SRv6 ingress | V05 | `usid_ingress` is tc on the VLAN netdevice and on the bond's members (`expandBondSlaves`). The members see the tag in metadata, and the tag is popped after decapsulation (`usid.c:4479`). Expected to deliver. | [#1402](https://github.com/datum-cloud/galactic/issues/1402) | +| P7 tenant SRv6 egress | V05 | `EgressRouteTable.Register` stores the route's interface, the VLAN netdevice, and a tc redirect to it is tagged (Q5). Expected to deliver. | [#1402](https://github.com/datum-cloud/galactic/issues/1402) | +| P8 control plane | V06 | Kernel only: BGP, ND and ARP run on the VLAN netdevice. Expected to work. | [#1405](https://github.com/datum-cloud/galactic/issues/1405) | +| P9 unrelated trunk traffic | V11–V15 | With the tag in metadata, an XDP program on a parent sees every VLAN's frames as untagged (Q3). With parent selection, `edge_lb` and `nat_ingress` would claim VIP- or shard-addressed traffic arriving on any VLAN of that parent. `usid_ingress` on the members likewise does not compare `skb->vlan_tci` with the side's ID before claiming a local SID. | [#1402](https://github.com/datum-cloud/galactic/issues/1402), [#1403](https://github.com/datum-cloud/galactic/issues/1403) | + +The untagged cell C1 is today's lab configuration, which `task verify` exercises. It is not re-measured here. + +## Lab rows + +Every L row of the [acceptance matrix](../../designs/vlan-transport/acceptance.md) is **deferred to #1405 end-of-epic lab pass**. None is reported as passed. That includes the untagged baselines that the [contract's section 8](../../designs/vlan-transport/contract.md#measurement-and-recovery-targets) assigned to #1401 for the throughput, latency and recovery targets: V09, and V21 to V28 in C1. The tooling below runs each row. + +| Rows | Cells | Command, from `deploy/containerlab` | +| -------------------- | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| V01–V07 | C1–C4, C6 | `task baseline:vlan-transport CELL= SELECT=logical\|parent OUT=` | +| V01–V05, offload off | C1–C4 | `task variant:vlan-transport:offload STATE=off`, then the row above | +| Other VLAN IDs | C4 | the same with `PUB_VID=1234 FAB_VID=3456` | +| V10 | C2 on dfw-worker3 | `VT_SITE=dfw-worker3 scripts/vlan-transport.sh apply C2