UDP transport: implement buffers, socket tasks, throttles, ACKs, and reliability #52

Closed
opened 2026-08-08 08:19:15 +00:00 by hugo · 1 comment
Owner

Objective

Implement native Tokio UDP transport from packet buffers through reliable send/receive behavior.

Deliverables

  • Cover socket ownership, sequence numbers, ACK aggregation/resend, duplicate/out-of-order handling, zero coding integration, MTU/fragment assumptions, throttles, timeouts, and cancellation.
  • Use bounded channels/backpressure and one clear write owner.
  • Record transport statistics without logging sensitive payloads by default.

Validation

  • Deterministic transport tests pass with local fake sockets/time.
  • No task leaks on cancellation or drop.
  • Malformed datagrams do not panic or grow memory without bounds.

Prerequisite

Wire codegen and the foundational implementation milestones are complete; the fixed API/test gates remain authoritative.

Project constraints

  • Native Rust networking only; no C# bridge, helper service, subprocess, or fallback.
  • Keep mapped APIs and translated assertions fixed, use bounded resources, and never log secrets.
  • Validate offline with deterministic fake servers before live-grid use and update docs/coverage evidence.
## Objective Implement native Tokio UDP transport from packet buffers through reliable send/receive behavior. ## Deliverables - Cover socket ownership, sequence numbers, ACK aggregation/resend, duplicate/out-of-order handling, zero coding integration, MTU/fragment assumptions, throttles, timeouts, and cancellation. - Use bounded channels/backpressure and one clear write owner. - Record transport statistics without logging sensitive payloads by default. ## Validation - Deterministic transport tests pass with local fake sockets/time. - No task leaks on cancellation or drop. - Malformed datagrams do not panic or grow memory without bounds. ## Prerequisite Wire codegen and the foundational implementation milestones are complete; the fixed API/test gates remain authoritative. ## Project constraints - Native Rust networking only; no C# bridge, helper service, subprocess, or fallback. - Keep mapped APIs and translated assertions fixed, use bounded resources, and never log secrets. - Validate offline with deterministic fake servers before live-grid use and update docs/coverage evidence.
hugo added this to the 08 - Networking and client lifecycle milestone 2026-08-08 08:19:15 +00:00
hugo added the enhancement label 2026-08-08 08:19:15 +00:00
Author
Owner

Implemented and pushed in c7777d4. Added a native Tokio UDP transport with runtime-neutral construction, bounded receive/command/write queues, a single socket writer, per-peer full-width sequence/reliable state, appended and standalone ACK handling, retries, duplicate/out-of-order tracking, zerocoding/MTU enforcement, C#-compatible packet buffers and AgentThrottle encoding, token-bucket throttles, redacted statistics, cancellation, async task joining, and final-drop cleanup. Added docs and regenerated the native API shim/coverage evidence.

Verification: 12/12 isolated UDP loopback tests pass; 2/2 UDP fake-time/unit tests pass; packet-wire 6/6; core runtime compatibility 2/2; API compile fixture, API mapping/coverage, deterministic codegen gate, Clippy, and serial workspace no-run compile all pass. The repository-wide parity checker still independently reports its pre-existing stale PacketTests.ToBytesMultiple metadata hash; this change does not touch that catalog or test body.

Implemented and pushed in c7777d4. Added a native Tokio UDP transport with runtime-neutral construction, bounded receive/command/write queues, a single socket writer, per-peer full-width sequence/reliable state, appended and standalone ACK handling, retries, duplicate/out-of-order tracking, zerocoding/MTU enforcement, C#-compatible packet buffers and AgentThrottle encoding, token-bucket throttles, redacted statistics, cancellation, async task joining, and final-drop cleanup. Added docs and regenerated the native API shim/coverage evidence. Verification: 12/12 isolated UDP loopback tests pass; 2/2 UDP fake-time/unit tests pass; packet-wire 6/6; core runtime compatibility 2/2; API compile fixture, API mapping/coverage, deterministic codegen gate, Clippy, and serial workspace no-run compile all pass. The repository-wide parity checker still independently reports its pre-existing stale PacketTests.ToBytesMultiple metadata hash; this change does not touch that catalog or test body.
hugo closed this issue 2026-08-09 11:41:19 +00:00
Sign in to join this conversation.