All projects

Project case study

AeroUDP

Reliable delivery over an unreliable network

An experimental transport protocol in async Rust that adds ordering, retransmission, flow control, and congestion control to UDP.

  • Rust
  • Tokio
  • UDP
  • Networking
Project notes26 Rust tests passed across codec, handshake, reliability, and loopback transfer paths.

The problem

In AeroUDP, I built ordering, retransmission, and flow control on top of UDP. The sender tracks unacknowledged packets and adjusts its sending rate to both the receiver’s buffer space and network congestion. It is an experimental implementation.

How it fits together

  1. 01

    Application data

    Add sequence information and a checksum.

  2. 02

    Send window

    Respect receiver capacity and congestion limits.

  3. 03

    UDP transport

    Send packets and retain unacknowledged data.

  4. 04

    Receive & ACK

    Reorder packets and feed acknowledgements back.

Each datagram has a 28-byte header and a payload limit of 1,200 bytes. Acknowledgements drive retransmission, round-trip-time estimates, and the next send-window decision.

Decisions & tradeoffs

Use two independent limits

I limit sending by both the congestion window and the peer’s advertised receive window. One tracks network capacity; the other tracks receiver capacity. The engine currently clamps a zero receive window to one packet, so it cannot fully pause sending when the receiver is full.

Keep the feedback loop observable

I use NewReno-style slow start, additive growth, and loss recovery, with retransmission timers based on measured RTT. Packet counters and tracing make it possible to follow window changes and timeouts when a connection stalls.

Keep the protocol small enough to inspect

I use cumulative ACKs and leave out selective acknowledgements. This keeps the ACK state small, but the sender cannot identify every packet received beyond a gap. CRC32 catches accidental corruption; the protocol has no authentication or encryption.

Tests and limitations

The 11 November 2026 workspace run passed 26 Rust tests: 17 unit, three handshake, four reliability, and two stress cases. They cover codec properties, duplicate/reordered receive buffers, handshakes, and loopback transfers; this is not a WAN performance result.

The CLI proxy can inject loss, duplication, latency, and jitter using seeded random choices. The seed controls those choices, but execution still affects end-to-end timing.

The example configures 5% loss, 3% reordering, 20–60 ms latency, and 10 ms jitter. Those are fault settings, not measured outcomes. The proxy forwards serially, so the reordering flag alone does not demonstrate out-of-order delivery.

When trying the proxy, check that the received bytes match the sent bytes, then follow retransmissions, smoothed RTT, timeout backoff, and congestion-window recovery. The walkthrough explains how these measurements relate to the protocol.

Make the network misbehave

From a repository checkout with Rust installed, run the proxy below. Run the server on port 9000 and point the client at port 9500 to send traffic through it.

cargo run --release -p aeroudp-cli --bin aeroudp-analyzer -- proxy \
  --listen 127.0.0.1:9500 \
  --upstream 127.0.0.1:9000 \
  --loss 0.05 --reorder 0.03 \
  --min-latency-ms 20 --max-latency-ms 60 \
  --jitter-ms 10

Related writing