Repository navigation
feat(dataplane): Traffic-Analysis Defense (DAITA & AmneziaWG recipes) - #162
Merged
Merged
Conversation
vxfemboy
temporarily deployed
to
benchmark-approval
October 22, 2026 02:14 — with
GitHub Actions
Inactive
vxfemboy
temporarily deployed
to
benchmark-approval
October 22, 2026 02:14 — with
GitHub Actions
Inactive
vxfemboy
had a problem deploying
to
benchmark-approval
October 22, 2026 02:14 — with
GitHub Actions
Failure
vxfemboy
temporarily deployed
to
benchmark-approval
October 22, 2026 02:15 — with
GitHub Actions
Inactive
vxfemboy
temporarily deployed
to
benchmark-approval
October 22, 2026 02:15 — with
GitHub Actions
Inactive
vxfemboy
temporarily deployed
to
benchmark-approval
October 22, 2026 02:15 — with
GitHub Actions
Inactive
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
Closes Sub-project #4 / Roadmap Item 3 (Traffic-Analysis Defense, #11).
This PR introduces end-to-end traffic-analysis defense (DAITA — Defending Against Intrusion with Traffic Analysis) and AmneziaWG-inspired wire shaping recipes across
crates/yip-obf,bin/yipd, andcrates/yip-io. The implementation directly mitigates the three primary side channels used by modern deep packet inspection classifiers, website fingerprinting classifiers, and statistical traffic-analysis models:TrafficDefensePresetandround_to_bucket).JUNK_TYPE).All primitives maintain 100% wire-format compatibility with
yip-obf, execute with zero heap allocations on the packet fast path, and enforce strict#![forbid(unsafe_code)]across all core and daemon crates.Architectural Highlights
1. Discrete Bucket Quantization (
crates/yip-obf,bin/yipd/src/peer_manager/obf.rs)crates/yip-obf: AddedTrafficDefensePresetenum (Off,Balanced,Paranoid) andround_to_bucket(raw_wire_len, buckets, max_budget) -> usize.balanced:[256, 512, 1024, 1420]paranoid:[512, 1420](2-state burst bucketing)HandshakeInit1,025B,HandshakeResp945B) blend invisibly into standard data packet size buckets (1,420B and 1,024B/1,420B).2. Zero-Allocation Decoy Bursts (
bin/yipd/src/peer_manager/)PeerManager::tickemits bursts of 1–defense_cover_burst_maxdecoy datagrams.obf_key/obf_psk) withptype = JUNK_TYPE (6).obf_scratchby passing an empty body&[]and padding lengthpad_len = target_wire - 11directly intoyip_obf::obfuscate_into. Produces target wire size datagrams with zero heap allocations.3. Bounded Micro-Jitter Delay Queue with Overrun Protection (
bin/yipd/src/peer_manager/)0..=defense_jitter_max_ms) are held inVecDeque<ScheduledDatagram>.MAX_JITTER_QUEUE = 1024.iperf3saturating line rate), buffer overruns trigger strict flush-oldest semantics (pop_front()), ensuring zero tail drops and preventing latency spikes.on_tun,on_udp(finish_wrapped), andtick.4. Event-Loop Poll Timeout Clamping (
crates/yip-io/src/poll.rs,bin/yipd/src/sharding.rs)next_timeout_msvia theDispatchtrait inyip-io, backed byPeerManager::next_scheduled_egress_delay_ms(now_ms).run_poll(single-threaded runtime) andsharding.rs(multi-queue runtime),libc::epoll_wait's timeout is clamped tomin(default_timeout_ms, delay_ms).5. Multi-Engine Netns Integration & DPI Verification (
bin/yipd/tests/tunnel_netns.rs)netns_tunnel_with_traffic_defense_balancedandnetns_tunnel_with_traffic_defense_paranoidrunning real bidirectional pings and 3siperf3streams in isolated namespaces overvethpairs.{256, 512, 1024, 1420}and{512, 1420}).tshark: 0 packets matchwg || openvpn || isakmp || esp || ah || udpencap || dtls.nDPI(ndpiReader): classified strictly asUnknown/Unrated, 0 detections in VPN category.Verification
cargo fmt --check: Passed cleanly.cargo clippy --workspace --all-targets -- -D warnings: Passed with zero warnings.python3 crates/yip-bench/generate-graphs.py --check: Passed cleanly.cargo test --workspace: All 387+ workspace unit and integration tests passed.