Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ No release has been cut yet — everything below is tracked under `[Unreleased]`
until 0.1.0.

### Security
- **Traffic-analysis defense subsystem & side-channel mitigations (`crates/yip-obf`, `bin/yipd`, #11).**
Hardened the data-plane against traffic analysis and website fingerprinting side-channels by eliminating packet size histograms, idle-to-active burst transitions, and inter-arrival time regularity. Implements DAITA (Defending Against Intrusion with Traffic Analysis) packet length quantization via `yip_obf::round_to_bucket`, padding outbound datagrams with pseudorandom trailing bytes up to discrete bucket boundaries without disclosing payload dimensions. Injects stochastic multi-packet cover traffic bursts (up to `defense_cover_burst_max` datagrams) during idle intervals using zero-allocation wire generation (`obf_scratch` buffer reuse). Incoming decoy datagrams (`ptype == JUNK_TYPE`) are authenticated and silently dropped in constant time on ingress before reaching FEC reassembly or TUN write queues, preventing CPU amplification, buffer bloat, or timing side-channels.
- **Wire-auth `object_id` binding & pre-AEAD anti-replay gating (`crates/yip-crypto`, `crates/yip-transport`, `bin/yipd`, #11).**
Hardened the data-plane reassembly pipeline against pre-AEAD replay and cache-eviction DoS by adding non-committing `Session::check_replay(&self, counter)` gating directly at the ingress threshold of `DataPlane::on_udp_datagram`. Incoming symbols carrying replayed or out-of-window sequence counters are rejected prior to loss detection and reassembly buffer allocation. Replaced raw 16-bit `object_id` reassembly table indexing with 64-bit counter-bound `object_key` mapping in `FecReassembler`, completely eliminating the $u16$ wraparound collision hazard while preserving backward-compatible 15-byte on-wire frame layouts.
- **Post-quantum hybrid handshake (`Noise_IKpsk2_25519_ChaChaPoly_BLAKE2s` + ML-KEM-512, #9, Milestone 9b, PR #152).**
Expand All @@ -27,6 +29,8 @@ until 0.1.0.
Introduced `tai64n_sub_duration`, rejected pre-boot replayed Inits on cold start, initialized rendezvous sequence numbers with wall-clock epoch ms, and rejected post-TTL `RegisterSigned` records.

### Added
- **Traffic-analysis defense configuration schema, micro-jitter queue & DPI validation (`bin/yipd`, `crates/yip-obf`, #11).**
Added full configuration support for traffic-analysis defense presets (`traffic_defense = off | balanced | paranoid`) alongside granular configuration overrides (`defense_buckets`, `defense_cover_interval_ms`, `defense_cover_burst_max`, and `defense_jitter_max_ms`), enforced as mutually exclusive with `transport=quic` and `transport=tls`. Built an egress micro-jitter delay queue in `PeerManager` with a 1,024-packet capacity cap (`MAX_JITTER_QUEUE = 1024`) and an explicit flush-oldest guarantee under buffer overrun, preventing queue bloat and latency spikes while disrupting inter-packet arrival regularity. Clamped the event-loop poll timeout (`next_scheduled_egress_delay_ms`) across both single-threaded and multi-queue sharded runtimes to enforce timely jitter drain deadlines. Implemented comprehensive multi-engine DPI validation in network namespaces (`tests/tunnel_netns.rs`, `run-netns-tunnel.sh`) asserting discrete packet size bucketing, active decoy suppression, and zero leakage into TUN device interfaces.
- **Data-plane windowed loss calculation, 8-contender harness & UDP-under-loss evaluation (`bin/yipd`, `crates/yip-transport`, `crates/yip-bench`, #11).**
Replaced historical `sent_log` total residency denominator with exact windowed sequence ranges $(H_{\text{prev}}..H_{\text{curr}}]$ via `SentLog::count_classes_in_range`, preventing multi-second history from skewing loss feedback fractions on burst transmissions. Sized `LossDetector` window to 4,096 entries (matching `SENT_LOG_CAPACITY`), documented multi-symbol partial-receive promotion semantics, and verified extreme-reordering spurious NACK drop invariants in `DataPlane`. Expanded comparative benchmark suite (`crates/yip-bench/tests/run-iperf-compare.sh`, `crates/yip-bench/setup-contenders.sh`) to evaluate 8 contenders (`yip`, `wireguard`, `amneziawg`, `openvpn`, `n2n`, `zerotier`, `tailscale`, `netbird`) across dual TCP goodput and UDP-under-loss (`iperf3 -u`) sweeps with graceful netns auto-detection, local air-gapped controller isolation, and a turnkey contender setup script. Parameterized benchmark runners (`run-compare.sh`, `run-iperf-compare.sh`, `run-wan-bench.sh`) for configurable `PING_COUNT` (supporting 1,000 pings at 5ms intervals with fractional percentage parsing to tighten netem variance to $\pm 0.1\%$).
- **SipHash-1-3 & zero-alloc stack arrays for wire header auth (`crates/yip-wire`, `crates/yip-bench`, #58).**
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,13 @@ All benchmark charts are generated deterministically from verified testbed data.
<!-- BENCHMARK-TABLE-START -->

<!-- generated by crates/yip-bench/wan/collect.sh -->
*Two 1-vCPU Debian 13 VPSes, ~54.411 ms apart, 2026-10-22. yip trades raw clean-path throughput for loss resilience — see the FEC row.*
*Two 1-vCPU Debian 13 VPSes, ~54.790 ms apart, 2026-10-22. yip trades raw clean-path throughput for loss resilience — see the FEC row.*

| | TCP 1-stream | UDP loss (200M) | effective loss @10% injected |
|---|--:|--:|--:|
| **yip** | 258.5 Mbit/s | 0.00% | 0% |
| **WireGuard** | 394.2 Mbit/s | 2.55% | 8% |
| **OpenVPN** | 26.2 Mbit/s | 0.00% | 16% |
| **yip** | 220.8 Mbit/s | 0.00% | 0% |
| **WireGuard** | 421.9 Mbit/s | 0.00% | 14% |
| **OpenVPN** | 25.8 Mbit/s | 0.15% | 7% |

<!-- BENCHMARK-TABLE-END -->

Expand Down Expand Up @@ -167,7 +167,7 @@ Full reproduction instructions, test scripts, and historical logs are in [`crate
| `yip-transport` | Systematic Reed–Solomon FEC (GF(256)), FEC object demuxing, per-flow classifier, thin ARQ. |
| `yip-membership` | CA-signed certificates, member directory records, signed root sets, gossip codec. |
| `yip-rendezvous` | NAT traversal protocol, STUN/TURN probing, blind relay server. |
| `yip-obf` | Obfuscation envelope (SipHash-CTR keystream over a random nonce). |
| `yip-obf` | Obfuscation envelope (SipHash-CTR keystream over a random nonce), DAITA discrete packet size bucketing, and cover traffic shaping primitives. |
| `yip-utls` | Xray-REALITY TLS 1.3 mimicry primitives, Chrome JA3/JA4 fingerprint emulation. |
| `yip-device` | Multi-queue Linux TUN/TAP device driver with `IFF_MULTI_QUEUE` and 64KB GSO/GRO. |
| `yipd` | The daemon combining all subsystems into a unified mesh node. |
Expand Down Expand Up @@ -251,16 +251,16 @@ cp example.config my-node.config
sudo target/release/yipd my-node.config
```

For two-node tunnels, mesh setups, and NAT configuration, consult the [User Guide](docs/user-guide.md) and [Configuration Reference](docs/configuration.md).
For two-node tunnels, mesh setups, NAT configuration, and DAITA traffic analysis defense (`traffic_defense = balanced`), consult the [User Guide](docs/user-guide.md) and [Configuration Reference](docs/configuration.md).

---

## Security Model

- **Data Plane & Handshake**: Single-RTT post-quantum hybrid key exchange (`Noise_IKpsk2` + ML-KEM-512 / FIPS 203) with ChaCha20-Poly1305 AEAD data plane, per-direction keys, a WireGuard-style replay window, and ~120s ephemeral rekey with epoch overlap. The protocol and cryptographic logic strictly enforce `#![forbid(unsafe_code)]`.
- **Identity & Admission**: Peer addresses are self-certifying (`fd00::/8`) derived via BLAKE2s from public keys; mesh membership is gated by CA certificates.
- **Anti-DPI Verification**: Verified in CI against four independent DPI engines (**nDPI**, **Zeek**, **Suricata**, and **Wireshark**).
- **What is *not* defended yet**: Traffic-analysis (timing/padding shape) defense is in development. Statistical packet-burst size classifiers can observe flow patterns without deep packet content inspection.
- **Anti-DPI Verification & Traffic Defense**: Verified in CI against four independent DPI engines (**nDPI**, **Zeek**, **Suricata**, and **Wireshark**). When `traffic_defense` is enabled (`balanced` or `paranoid`), DAITA discrete packet size bucketing, stochastic multi-packet decoy bursts, and bounded egress micro-jitter queues eliminate packet size histograms, idle-to-active burst transitions, and inter-arrival time regularity.
- **What is *not* defended yet**: Multi-hop anonymity / onion routing. `yip` is a direct peer-to-peer mesh; an adversary with global network vantage points can still correlate sender and receiver endpoints by aggregate flow volume over extended observation windows.

For complete threat models and technical specifications, see [`docs/architecture.md`](docs/architecture.md).

Expand Down
9 changes: 5 additions & 4 deletions ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,19 +53,20 @@ maintainer.
and stack-allocated keystream generation (`header_mask`), slashing scalar MAC CPU by ~45% and eliminating
intermediate heap allocations on data-plane framing.
- **Data-plane windowed loss, 8-contender harness & bench polish (#11)** — exact per-class windowed loss fractions ($L_{\text{class}} = M_{\text{class}} / S_{\text{class}}$ in $(H_{\text{prev}}..H_{\text{curr}}]$), 4096-entry synchronized loss detection window matching sent-log capacity, bounded spurious NACK drop invariants, 8-contender comparison matrix and netns runners (yip, WireGuard, AmneziaWG, OpenVPN, n2n, ZeroTier, Tailscale, NetBird), dual TCP & UDP-under-loss evaluation, and configurable 1000-ping variance tightening.
- **Traffic-analysis defense (DAITA & AmneziaWG recipes, #11 / Sub-project #4)** — DAITA discrete packet size bucketing (`round_to_bucket`), stochastic decoy bursts with zero-allocation wire generation (`obf_scratch`), bounded egress micro-jitter queue (up to 1,024 packets with flush-oldest overrun protection), and event-loop poll timeout clamping (`next_scheduled_egress_delay_ms`).

## Now

- **Traffic-analysis defense (#11 / Sub-project #4)** — jittered cover traffic cadence, packet size shaping, and AmneziaWG junk/padding recipes.
- **Multi-platform native drivers** — macOS (NetworkExtension / utun) and Windows (Wintun).
- **Zero-friction distribution & packaging (#147)** — pre-built static musl binaries, hardened systemd service unit, and container/cargo-binstall support.

## Next

- **Multi-platform native drivers** — macOS (NetworkExtension / utun) and Windows (Wintun).
- **Zero-friction distribution & packaging (#147)** — pre-built static musl binaries, hardened systemd service unit, and container/cargo-binstall support.
- **REALITY P256/P384 server-side KEX + HTTP/2 decoy (#84)** — broadening cipher suites and HTTP/2 decoy multiplexing.

## Later

- **Multi-platform native drivers** — macOS (NetworkExtension / utun) and Windows (Wintun).
- **Onion routing / multi-hop mixnet extensions** — multi-hop anonymity overlays.

## Not goals (for now)

Expand Down
34 changes: 17 additions & 17 deletions assets/bench-fec-recovery.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading