Repository navigation
feat(golden): netns pairs for congestion, loss, socket options and states - #330
Merged
Merged
Conversation
# Conflicts: # CHANGELOG.md
Every congestion algorithm the kernel offers (@manifest.cong_available), their info structs, loss counters, TOS/tclass/class_id, shutdown, the non-ESTABLISHED states, three path MTUs, SO_BINDTODEVICE. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ates Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- dctcp clients dial a dctcp listener: an ECT SYN gets ECN back only from a listener whose algorithm needs ECN (tcp_ecn_create_request), else dctcp_init falls back to dctcp-reno - q strips whitespace, so the ROW strings use commas - coverage requires bbr_info_bw_lo: bw_hi is nonzero only above about 34 Gbit/s (bbr_get_info) - enrich_socket_interface_name waits for the locality enricher - README and CHANGELOG Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
netem drops and reorders at random, so two captures disagree on which of a bulk transfer's counters are nonzero (dsack_dups, reord_seen, rwnd_limited, probes) and on tcp_info_reordering. Diff skips Presence columns and the loss-history Strict columns in Options.LossyNetns (default golden-bulk-a/b); the rest of those rows, and every other row, compare as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
158 rows: 17 algorithms x 2 families, bulk over netem, socket options, TIME_WAIT/SYN_SENT/FIN_WAIT2/CLOSE_WAIT, three MTUs. Two captures diff clean; coverage.json passes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With TSO/GSO netem drops whole 64 KiB super-packets, so a 4 MiB transfer is about a hundred packets and a client could lose none of its own (loss_seen saw 3 of 4). Per-segment loss makes it near certain. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review: skipping every Presence column in the netem rows let a bulk transfer's receive bytes go to zero unnoticed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The netem rows skipped every Presence column, so a bulk transfer whose receive bytes went to zero diffed clean. lossyColumns lists the eight columns a strict diff of four captures showed varying; ca_state never did and is compared again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Before a bulk socket receives its first byte, ss prints no bytes_received; the grep matched nothing, exited 1, and pipefail aborted the workload. bulk_done counts with awk, which prints 0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A fifth capture had one RTO in two bulk rows (total_rto, its recoveries and time, and rehash), which four captures had not shown. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…sockets # Conflicts: # nix/default.nix
…sockets # Conflicts: # CHANGELOG.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The golden fixture had only idle ESTABLISHED loopback sockets with cubic, so a real host populates many columns the fixture never exercises: per-algorithm info structs, loss counters, TOS/class_id/sockopt, non-ESTABLISHED states, and real MTUs. This widens the capture workload so
coverage.jsoncan require them. Includes #327 (coverage gate) and #329 (tool knobs), merged in; merge those first. The new commits start at "test(golden): coverage for the wider workload (red)". Done test-first.Workload (
golden-workload.sh): four named netns pairs joined by vethgolden-cc(MTU 1500): one idle connection per algorithm intcp_available_congestion_control, IPv4 and IPv6, after loading everytcp_*module. 17 on 7.3.1. The list goes into the manifest ascong_available, so a new kernel's new algorithm is required without editing anythingtcp_ecn_create_request,net/ipv4/tcp_input.c); otherwisedctcp_initfalls back todctcp-reno(net/ipv4/tcp_dctcp.c)golden-bulk(MTU 1500, netem delay 5 ms, loss 2 %, reorder 1 %): a 4 MiB echo each for cubic, bbr, dctcp and vegas, done before xtcp2 starts, so the counters are settledgolden-opts(MTU 1450): TOS 0x08/0xb8 (traffic class on IPv6), priority 6, freebind/transparent/bind-no-port, receive buffers of 64 KiB, 1 MiB and 16 MiB, oneSO_BINDTODEVICEclientgolden-states(MTU 1300): a FIN_WAIT2/CLOSE_WAIT pair; after poll 1 the capture adds exactly 3 TIME_WAIT and 2 SYN_SENT sockets (to 192.0.2.1, blackholed; a blackhole rather than unreachable, since an ICMP error aborts SYN_SENT)tools/golden-ccGo helper was dropped: listing modules and reading one sysctl is a few lines of shellChecks
ROWlines (golden-capture.sh), all four categories:every_cc,cc_info,opts_seen(positive);loss_seen,no_loss_idle(negative);state_counts(boundary);mtu_paths(corner). Any FAIL fails the capturecoverage.jsonrequires the bbr/vegas/dctcp info,total_retrans,bytes_retrans,rcv_ooopack,class_id, states 2/5/6/8, shutdown 1/2, tos 8/184, tclass 184, pmtu 1300/1450/1500, snd_mss 1248/1398/1448, andinet_diag_cong⊇@manifest.cong_availablebbr_info_bw_hi→bbr_info_bw_lo: hi is the top 32 bits of the bandwidth in bytes/s (bbr_get_info,net/ipv4/tcp_bbr.c), nonzero only above about 34 Gbit/s, which a VM can't reach reliablyenrich_socket_interface_namemoves to the next PR: only the locality enricher fills it (pkg/xtcp/enrich.go)Determinism
xtcp2-golden difffirst showed differences only on the bulk rows (dsack_dups, reord_seen, rwnd_limited, probes, retrans, dctcp_alpha, tcp_info_reordering), because netem drops and reorders at randomDiffnow skips, in rows ofOptions.LossyNetns(defaultgolden-bulk-a/b), only the twelve columns strict diffs of five captures (two from this PR, three from feat(golden): uplink2, NIC speed, locality and ASN in the capture VM #331) showed varying:goldenrec.lossyColumns= dsack_dups, reord_seen, rwnd_limited, probes, delivery_rate_app_limited,inet_diag_msg_retrans,dctcp_info_alpha,tcp_info_reordering, and the RTO group (total_rto, total_rto_recoveries, total_rto_time, rehash: they move only when a tail loss ends in a retransmission timeout,net/ipv4/tcp_timer.c; one capture in five had one, in two bulk rows). Every other column of those rows (total_retrans, bytes_received, ca_state, ...) and every other row compare as before; a missing row is still reported. Rather than reclassing these columns everywhere, which would hide changes on the idle rowsTestDiffgainslossy_counters_ignored,lossy_presence_kept,lossy_retrans_kept,lossy_strict_kept,lossy_elsewhere,lossy_disabled,lossy_custom,lossy_row_missing;TestLossyColumnspins the list (and that each name is a column); the RTO rows went red first tooRed (coverage commit, against the old fixture)
LossyNetns(tests commit):Review fixes (each red first)
ssprints nobytes_received; thegrepmatched nothing, exited 1, andpipefail(writeShellApplication) aborted the workload.bulk_donecounts with awk, which prints 0. Red:bash -c 'set -euo pipefail; n=$(printf "cubic rtt:1/1\n" | grep -oE "bytes_received:[0-9]+" | awk … | wc -l); echo reached'exits 1 withoutreached. The awk was checked on positive, negative (no bytes yet, no sockets), boundary (4 MiB − 1, exactly 4 MiB) and corner (bytes_acked) inputs-closeandprocnetfixesGreen
All 17
ROWlines PASS in both captures;xtcp2-golden checkpasses coverage;go test ./...and the nix checks (gofmt, go-vet, nix-fmt, lint-baseline, golangci ×3, redteam-lint, golden-records, test-fuzz-all) pass.🤖 Generated with Claude Code