Repository navigation
feat: implement send_to() with packet building and API compatibility … - #3
Merged
Merged
Conversation
…tests Implement UDP packet transmission in dpdk-udp: dpdk-udp/src/lib.rs: - `send_to()` builds complete Ethernet/IPv4/UDP packets - `build_udp_packet()` constructs packet in mbuf with proper headers - `ipv4_checksum()` calculates IP header checksum - `udp_checksum()` calculates UDP checksum with pseudo-header - Shared DPDK resources (port, mempool) via Arc<Mutex> - Support for `send()`, `connect()`, `set_ttl()`, `ttl()` - Constants: ETH_HEADER_LEN, IPV4_HEADER_LEN, UDP_HEADER_LEN, MAX_UDP_PAYLOAD API Compatibility Tests (10 new tests): - test_api_bind_signature - test_api_send_to_signature - test_api_recv_from_signature - test_api_local_addr_signature - test_api_peer_addr_signature - test_api_connect_signature - test_api_send_signature - test_api_recv_signature - test_api_set_ttl_signature - test_api_ttl_signature dpdk/src/port.rs: - MacAddress::broadcast() - create ff:ff:ff:ff:ff:ff - MacAddress::zero() - create 00:00:00:00:00:00 - MacAddress::octets() - get bytes as array API_COMPATIBILITY.md: - Updated to reflect send_to() implementation - Added packet processing status - Added API compatibility test documentation Total: 74 tests passing across all crates https://claude.ai/code/session_01UiHnsVmMyk1CJgck3cCYZQ
rust build github action
Implement UDP packet receiving in dpdk-udp: recv_from(): - Calls rx_burst to receive packets from DPDK port - Filters packets by destination port - Parses Ethernet/IPv4/UDP headers - Copies payload to user buffer - Returns source address Packet Parsing: - ParsedUdpPacket struct with src/dst MAC, IP, port, payload - parse_udp_packet() - parse raw Ethernet frame - parse_udp_from_mbuf() - parse from mbuf - Validates ethertype (IPv4), protocol (UDP), header lengths New Tests (7): - test_parse_udp_packet_valid - test_parse_udp_packet_empty_payload - test_parse_udp_packet_too_short - test_parse_udp_packet_wrong_ethertype - test_parse_udp_packet_not_udp - test_parse_udp_packet_extracts_macs - test_parsed_udp_packet_debug Updated API_COMPATIBILITY.md: - recv_from() and recv() marked as implemented - Packet parsing marked as implemented - Phase 2 marked complete Total: 81 tests passing (22 in dpdk-udp) https://claude.ai/code/session_01UiHnsVmMyk1CJgck3cCYZQ
gspivey
pushed a commit
that referenced
this pull request
Mar 13, 2026
Mark P3.1-P3.4, P3.6, P3.8 complete. Add preliminary Run #3 entry to perf-test-log.md with pending benchmark results (perf-tests.yml running). https://claude.ai/code/session_01AX56ktjxp4ybrKFqAg7mMu
gspivey
added a commit
that referenced
this pull request
May 21, 2026
## Roadmap item IPv6 sub-task #2: **UDP over IPv6 checksum** — mandatory IPv6 pseudo-header checksum validation (RFC 8200 §8.1). ## Changes - Integrated `verify_udp6_checksum` into the RX path (`process_frame_zerocopy`) - IPv6 UDP packets are now parsed and checksum-validated before delivery to the application - Zero checksums are rejected (mandatory for IPv6, unlike IPv4 where 0 means disabled) - Valid IPv6 UDP packets are delivered with `SocketAddrV6` source addresses ## Tests added (21 new tests) **Checksum verification (ipv6.rs):** - VLAN-tagged IPv6 frame checksum verification - Extension header (Hop-by-Hop) checksum verification - Various payload sizes: empty, 1-byte, odd-length, max (1452B) - Corruption detection: src/dst IP, src/dst port, payload - Edge cases: truncated frames, non-IPv6 frames, too-short frames - Pseudo-header checksum properties (different lengths, addresses, large lengths) - Zero-becomes-0xFFFF contract verification (RFC 8200 §8.1) **RX path integration (lib.rs):** - `process_frame_zerocopy_accepts_valid_ipv6_udp` - `process_frame_zerocopy_rejects_corrupted_ipv6_checksum` - `process_frame_zerocopy_rejects_zero_ipv6_checksum` ## Tradeoffs - The RX path tries IPv4 parsing first, then falls back to IPv6. This adds one failed parse attempt for IPv6-only traffic. The cost is negligible (a few comparisons) and avoids changing the hot path for existing IPv4 workloads. - No topology worker integration yet — that will come with sub-task #3 (SocketAddrV6 through UdpSocket) which adds full dual-stack socket support. ## All 607 tests pass, no regressions. --------- Co-authored-by: Agent Router <agent@agent-router.dev>
gspivey
pushed a commit
that referenced
this pull request
Jun 6, 2026
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.
Summary
Test plan
cargo test)What's implemented
bind()- initializes DPDK EAL, port, mempoolsend_to()- builds Eth/IP/UDP packet, calls tx_burstsend(),connect(),local_addr(),peer_addr()set_ttl(),ttl()What's remaining
recv_from()- needs rx_burst + packet parsingImplement UDP packet transmission in dpdk-udp:
dpdk-udp/src/lib.rs:
send_to()builds complete Ethernet/IPv4/UDP packetsbuild_udp_packet()constructs packet in mbuf with proper headersipv4_checksum()calculates IP header checksumudp_checksum()calculates UDP checksum with pseudo-headersend(),connect(),set_ttl(),ttl()API Compatibility Tests (10 new tests):
dpdk/src/port.rs:
API_COMPATIBILITY.md:
Total: 74 tests passing across all crates
https://claude.ai/code/session_01UiHnsVmMyk1CJgck3cCYZQ