Repository navigation
ARP, ICMP and more - #4
Merged
Merged
Conversation
Add protocol support modules for real network communication: - ARP module (arp.rs): - Request/response handling with automatic reply generation - Thread-safe ARP cache with TTL-based expiration - Opportunistic learning from all observed ARP packets - Support for multiple local IP addresses - ICMP module (icmp.rs): - Echo request/reply (ping) support - Automatic ping response when enabled - Proper checksum calculation - Connection tracking: - ConnectionState struct with packet/byte counters - Receive queue for buffering incoming packets - Statistics accessible via connection_stats() - UdpSocket enhancements: - Integrated ARP resolution for destination MACs - Auto-response to ARP requests (configurable) - Auto-response to ICMP echo (configurable) - Methods: set_auto_arp(), set_auto_icmp(), connection_stats() 47 tests passing (14 ARP + 11 ICMP + 10 UDP API + 12 packet tests) https://claude.ai/code/session_01UiHnsVmMyk1CJgck3cCYZQ
Plan for non-DPDK fallback using AF_PACKET raw sockets: - Same packet building/parsing code - Same ARP/ICMP handlers - Abstract PacketBackend trait for runtime selection https://claude.ai/code/session_01UiHnsVmMyk1CJgck3cCYZQ
…ffloads Add advanced networking features to the DPDK stack: Multicast Support: - join_multicast_v4() / leave_multicast_v4() for group management - set_multicast_all() for all-multicast mode - IPv4 to multicast MAC address conversion (01:00:5e:xx:xx:xx) Promiscuous Mode: - set_promiscuous() / is_promiscuous() on Port - Configurable via PortConfig at initialization Hardware Offload Support: - RxOffload / TxOffload configuration structs - Device capability checking (DeviceCapabilities) - Only enables offloads that hardware actually supports - Active offload query methods - Supported: IPv4/UDP/TCP checksum, VLAN strip/insert Key safety feature: Requested offloads are AND-ed with device capabilities, so unsupported offloads are silently disabled with a warning, rather than causing failures. All 47 existing tests still pass. https://claude.ai/code/session_01UiHnsVmMyk1CJgck3cCYZQ
gspivey
pushed a commit
that referenced
this pull request
Mar 25, 2026
…m defaults - README: replace "10-100x" claim with actual measured ~2x PPS improvement, remove multi-core pipeline section (experimental), fix stale --dpdk flag - echo app: rewrite to mirror plain-echo (65 lines vs 282), demonstrating the drop-in replacement story (only difference is the import line) - plain-echo: add signal handling and read timeout to match echo structure - perf-test-log: add Run #4 entry for topology simplification PR #26 - perf-tests: remove rust-dpdk-multicore from default configs (experimental) https://claude.ai/code/session_013kEK2d9wyTRWwmoAB4VBco
5 tasks done
gspivey
pushed a commit
that referenced
this pull request
Mar 25, 2026
Run #5 (23548559577) had anomalous kernel numbers (78% drop at 64B/700K) due to a bad EC2 instance. Run #6 (23567309410) shows normal kernel performance (51% drop) consistent with Run #4. Updated both perf-test-log.md and README performance tables with the correct data. DPDK advantage is consistently ~2x at saturation, not the 3-4x that the outlier suggested. https://claude.ai/code/session_013kEK2d9wyTRWwmoAB4VBco
gspivey
added a commit
that referenced
this pull request
Jun 6, 2026
## Roadmap Item Addresses **ROADMAP #4**: `dpdk-stdlib-quic`: Frame building with TOS/ECN support. Spec: `.kiro/specs/s2n-quic-provider/` tasks 4.1, 4.2, 4.3. ## Changes ### dpdk-udp (additive, non-breaking) - Added `build_udp_frame_into_with_tos(out, src_mac, dst_mac, src_ip, dst_ip, src_port, dst_port, payload, ttl, tos)` — identical to `build_udp_frame_into` but sets `frame[ip+1] = tos` and recomputes the IPv4 header checksum in software. ### dpdk-stdlib-quic - Replaced the placeholder `frame.rs` with a proper module that re-exports `build_udp_frame_into_with_tos` and provides a `build_quic_frame` convenience wrapper (hardcodes TTL=64 for the typical QUIC TX pattern). ## Tests Added **dpdk-udp (4 tests):** - `test_build_udp_frame_with_tos_byte_placement` — verifies TOS byte at correct IPv4 offset - `test_build_udp_frame_with_tos_checksum_valid` — verifies IPv4 checksum after TOS modification - `test_build_udp_frame_with_tos_ecn_round_trip` — verifies all 4 ECN codepoints survive - `test_build_udp_frame_with_tos_zero_matches_original` — verifies TOS=0 produces identical frame to original function **dpdk-stdlib-quic (3 tests):** - `frame::tests::tos_byte_at_correct_offset` - `frame::tests::checksum_valid_after_tos` - `frame::tests::ecn_round_trip_through_frame` ## Validation - `cargo build`: ✅ (warnings only from unrelated placeholder fields) - `cargo test`: ✅ All 613 existing tests pass + 7 new tests pass - Zero regression on existing crates' public APIs ## Tradeoffs None — this is a purely additive change. The new function shares the same structure as `build_udp_frame_into`, differing only in setting the TOS byte instead of hardcoding 0x00. --------- Co-authored-by: Agent Router <agent@agent-router.dev>
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.
Phase 3: Protocol Support ✅
Phase 4: Advanced Features ✅