Repository navigation
feat: IPv6 header build/parse (roadmap task 1) - #49
Conversation
Add dpdk-udp/src/ipv6.rs implementing IPv6 roadmap task 1: Build functions: - build_udp6_frame() — allocating frame builder (Vec<u8>) - build_udp6_frame_into() — zero-alloc hot-path builder Parse functions: - parse_udp6_packet() — allocating parser (owns payload) - parse_udp6_packet_ref() — zero-copy parser (borrows payload) Checksum: - udp6_checksum() — mandatory IPv6 UDP checksum (RFC 8200 §8.1) - udp6_pseudo_header_checksum() — for TX hardware offload - verify_udp6_checksum() — RX validation (rejects zero checksum) Extension header walking: - walk_extension_headers() — chain walk for Hop-by-Hop, Routing, Fragment, and Destination Options headers to locate L4 payload 34 tests covering: roundtrip build+parse, extension header chains, checksum validation/corruption, wire format, VLAN-tagged frames, special addresses, edge cases, and a synthetic perf benchmark. All 422 tests pass (388 existing + 34 new).
Synthetic Performance Results — Graviton (run)Commit: ✅ synthetic UDP socket bound to 10.0.0.1:9000 (MAC: 02:00:00:00:00:01) Synthetic UDP Performance ResultsMeasures framework overhead: sync
Avg sync/async ratio: 0.9x, worst: 1.0x
|
Synthetic Performance Results (run)Commit: ✅ synthetic UDP socket bound to 10.0.0.1:9000 (MAC: 02:00:00:00:00:01) Synthetic UDP Performance ResultsMeasures framework overhead: sync
Avg sync/async ratio: 0.9x, worst: 1.1x
|
[CI] Stage: DeployInfrastructure ready.
|
[CI] Stage: DeployInfrastructure ready.
|
[CI] Stage: SummaryAll tests PASSED. ARP seeding: kernel /proc/net/arp (automatic)
|
✅ Integration Tests Passed — Graviton (run)Branch: Test Results
Application Logs (last 20 lines)receiver-echo-server.log sender-echo-server.log sender-test-client.log |
[CI] Stage: SummaryAll tests PASSED. ARP seeding: kernel /proc/net/arp (automatic)
|
✅ Integration Tests Passed (Run 24943086329)Branch: Test Results
Application Logs (last 20 lines)receiver-echo-server.log sender-echo-server.log sender-test-client.log receiver-test-client-iperf.log sender-test-client-iperf.log Full Application Logs (last 200 lines each)receiver-echo-server.logsender-echo-server.logsender-test-client.logreceiver-test-client-iperf.logsender-test-client-iperf.log
|
Synthetic Performance Results (run)Commit: ✅ synthetic UDP socket bound to 10.0.0.1:9000 (MAC: 02:00:00:00:00:01) Synthetic UDP Performance ResultsMeasures framework overhead: sync
Avg sync/async ratio: 0.9x, worst: 1.0x
|
Synthetic Performance Results — Graviton (run)Commit: ✅ synthetic UDP socket bound to 10.0.0.1:9000 (MAC: 02:00:00:00:00:01) Synthetic UDP Performance ResultsMeasures framework overhead: sync
Avg sync/async ratio: 0.9x, worst: 1.1x
|
[CI] Stage: DeployInfrastructure ready.
|
[CI] Stage: DeployInfrastructure ready.
|
[CI] Stage: SummaryAll tests PASSED. ARP seeding: kernel /proc/net/arp (automatic)
|
1 similar comment
[CI] Stage: SummaryAll tests PASSED. ARP seeding: kernel /proc/net/arp (automatic)
|
✅ Integration Tests Passed (Run 24943721363)Branch: Test Results
Application Logs (last 20 lines)receiver-echo-server.log sender-echo-server.log sender-test-client.log receiver-test-client-iperf.log sender-test-client-iperf.log Full Application Logs (last 200 lines each)receiver-echo-server.logsender-echo-server.logsender-test-client.logreceiver-test-client-iperf.logsender-test-client-iperf.log
|
✅ Integration Tests Passed — Graviton (run)Branch: Test Results
Application Logs (last 20 lines)receiver-echo-server.log sender-echo-server.log sender-test-client.log |
## Roadmap item **Encap: IPv6 outer** — Adds IPv6 outer support to all three encapsulation protocols (VXLAN, GENEVE, GUE), closing out dual-stack encap in a single PR. ## Changes For each protocol (GUE, VXLAN, GENEVE), adds: - `*Config6` struct with `Ipv6Addr` for remote tunnel endpoint - `build_*_frame_into_v6()` — frame builder using outer IPv6 header + mandatory UDP6 checksum (RFC 8200 §8.1) - `try_decap_*_v6()` — decapsulation for IPv6-outer frames - `*DecapResult6` with `Ipv6Addr` for outer source IP - `*_ENCAP_OVERHEAD_V6` constant Wire format: `[Outer Eth 14B][Outer IPv6 40B][Outer UDP 8B][Protocol Header][Inner frame]` ## Tests added 41 new unit tests (total: 654, up from 613): - GUE: 13 tests (config, roundtrip, wire format, checksum, edge cases, perf) - VXLAN: 13 tests (config, roundtrip, wire format, checksum, VNI filtering, perf) - GENEVE: 15 tests (config, roundtrip, TLV options, wire format, checksum, VNI filtering, perf) All synthetic PPS benchmarks assert < 10µs/op. ## Tradeoffs - Inner payload is IPv4-only for now (matching the existing IPv4-outer encap). Inner IPv6 will come with the full IPv6 socket support (roadmap task 3). - No extension header support in the outer IPv6 — uses Next Header = UDP directly. Extension headers are not needed for tunnel endpoints. - The IPv6 outer decap functions do not walk extension headers in the outer IPv6 header (assumes Next Header = UDP). This matches real-world tunnel deployments where the outer header is minimal. ## Dependencies satisfied - IPv6 header build/parse (PR #49) ✓ - UDP6 checksum (same PR) ✓ - IPv6 offload flags (PR #55) ✓ --------- Co-authored-by: Agent Router <agent@agent-router.dev>
Roadmap Item
IPv6 task 1: header build/parse — the first step toward full IPv6 support in dpdk-stdlib-rust.
What This Provides
build_ipv6_udp_frame()andbuild_ipv6_udp_frame_into()for constructing IPv6/UDP Ethernet frames with proper headersparse_ipv6_udp_frame()and zero-copyIpv6UdpFrameReffor parsing inbound IPv6/UDP frames, including VLAN-tagged frameswalk_extension_headers()traverses Hop-by-Hop, Routing, Fragment, Destination Options, and AH headers to locate the upper-layer protocolIPV6_HEADER_LEN,ETH_IPV6_UDP_HEADER_LEN,MAX_IPV6_UDP_PAYLOAD, EtherType, Next Header valuesTest Coverage
Notes
This resumes work from a prior agent-router session that was blocked on credentials (GITHUB_TOKEN was not in the daemon environment). The implementation and tests were complete and passing locally; this PR ships that work now that auth is fixed.