Skip to content

Commit be62dc9

Browse files
doublegateclaude
andcommitted
feat(transport): implement v2 protocol Phase 3 transport layer
Add TCP, WebSocket, and QUIC transports. Implement TransportManager with runtime migration. Wrap AF_XDP and io_uring as Transport trait implementors. Extend Transport trait and TransportType enum. Includes 275 unit tests, 73 integration tests, and 37 doc tests. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent c2dc515 commit be62dc9

22 files changed

+3927
-119
lines changed

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,27 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2424
- **v2 Extended Frame Types**: FrameTypeV2 with 30 types across 7 categories (core, stream, path, security, file, diagnostic, reserved) and FlagsV2 with 8 flags (`types_v2.rs`)
2525
- 58 integration tests for v2 wire format (connection ID, header, polymorphic, compat, full pipeline)
2626
- 28 new v2 wire format benchmarks (header encode/decode, polymorphic, CID generation, format detection, frame type validation)
27+
- **v2 TCP Transport**: Length-prefixed framing with concurrent connection support (`tcp.rs`)
28+
- **v2 WebSocket Transport**: HTTP proxy traversal via tokio-tungstenite (`websocket.rs`)
29+
- **v2 QUIC Transport**: Full quinn-based transport with TLS 1.3, 0-RTT resumption, and connection migration (`quic.rs`)
30+
- **v2 TransportManager**: Multi-transport orchestration with runtime migration between transport types (`manager.rs`)
31+
- **v2 AF_XDP Transport wrapper**: AF_XDP implementing Transport trait for unified interface (Linux-only) (`af_xdp_transport.rs`)
32+
- **v2 io_uring Network Transport**: io_uring implementing Transport trait for unified interface (Linux-only) (`io_uring_net.rs`)
33+
- Enhanced Transport trait with `transport_type()`, `supports_migration()`, `mtu()`, `latency_estimate()`
34+
- Extended TransportType enum with 6 variants: UDP, TCP, WebSocket, QUIC, IoUring, AfXdp
35+
- TransportFactory updated to create all transport types
36+
- 73 Phase 3 integration tests for transport layer
2737

2838
### Changed
2939
- ml-dsa upgraded from 0.0.4 to 0.1.0-rc.5 (CI compatibility fix)
3040

41+
### Dependencies
42+
- Added quinn 0.11 (QUIC transport)
43+
- Added rustls 0.23 (TLS for QUIC)
44+
- Added rcgen 0.13 (certificate generation for QUIC)
45+
- Added tokio-tungstenite 0.24 (WebSocket transport)
46+
- Added futures-util 0.3 (async stream utilities)
47+
3148
### Performance (v2 Crypto Benchmarks)
3249
- Hybrid KEM keygen: 69.56 us
3350
- Hybrid encapsulate (X25519 + ML-KEM-768): 106.46 us

README.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ WRAITH Protocol is a privacy-focused, high-performance file transfer protocol de
3838

3939
| Metric | Value |
4040
| ----------------- | ------------------------------------------------------------------------- |
41-
| **Tests** | 2,839 passing (2,828 workspace + 11 spectre-implant), 16 ignored |
41+
| **Tests** | 2,957 passing (2,946 workspace + 11 spectre-implant), 16 ignored |
4242
| **Code** | ~141,000 lines Rust (protocol + clients) + ~36,600 lines TypeScript |
4343
| **Documentation** | 114 files, ~62,800 lines |
4444
| **Security** | Grade A+ (zero vulnerabilities, 295 audited dependencies) |
@@ -332,7 +332,7 @@ WRAITH Protocol uses a six-layer design optimized for security and performance:
332332
| ---------------------- | ------------------------------------------------------------ | ----- |
333333
| **wraith-core** | Frame parsing (SIMD), sessions, congestion control, Node API, v2 wire format (128-bit CID, 24B header, polymorphic encoding, v1 compat) | 606 |
334334
| **wraith-crypto** | Ed25519, X25519+Elligator2, AEAD, Noise_XX, Double Ratchet, v2 Hybrid KEM, PQ Signatures | 293 |
335-
| **wraith-transport** | AF_XDP, io_uring, UDP sockets, worker pools | 226 |
335+
| **wraith-transport** | UDP, TCP, WebSocket, QUIC (quinn), TransportManager, AF_XDP, io_uring, 6 transport types | 312 |
336336
| **wraith-obfuscation** | Padding, timing, cover traffic, protocol mimicry | 140 |
337337
| **wraith-discovery** | Kademlia DHT, STUN, ICE, relay infrastructure | 405 |
338338
| **wraith-files** | File chunking, BLAKE3 tree hashing, io_uring I/O | 34 |
@@ -484,7 +484,7 @@ Measured on production hardware (Intel i9-10850K, 64 GB RAM) with `cargo bench -
484484

485485
**Validation:**
486486

487-
- Comprehensive test coverage (2,839 tests across all components)
487+
- Comprehensive test coverage (2,957 tests across all components)
488488
- DPI evasion validation (Wireshark, Zeek, Suricata, nDPI)
489489
- 5 libFuzzer targets
490490
- Property-based tests
@@ -581,6 +581,9 @@ cargo bench --workspace # Benchmarks
581581
| `curve25519-elligator2` | Elligator2 key encoding for traffic analysis resistance |
582582
| `blake3` | BLAKE3 cryptographic hashing with SIMD acceleration |
583583
| `snow` | Noise Protocol Framework (Noise_XX handshake pattern) |
584+
| `quinn` | QUIC transport with TLS 1.3, 0-RTT resumption, connection migration |
585+
| `rustls` | TLS implementation for QUIC transport |
586+
| `tokio-tungstenite` | WebSocket transport for HTTP proxy traversal |
584587
| `io-uring` | Linux io_uring async I/O for zero-copy file operations |
585588
| `tokio` | Async runtime for concurrent I/O operations |
586589
| `clap` | Command-line argument parsing |
@@ -595,7 +598,7 @@ WRAITH-Protocol/
595598
|-- crates/ # Protocol crates (8 active + 1 excluded)
596599
| |-- wraith-core/ # Frame, session, congestion, Node API
597600
| |-- wraith-crypto/ # Noise, AEAD, Elligator2, ratcheting
598-
| |-- wraith-transport/ # AF_XDP, io_uring, UDP
601+
| |-- wraith-transport/ # UDP, TCP, WebSocket, QUIC, AF_XDP, io_uring
599602
| |-- wraith-obfuscation/# Padding, timing, mimicry
600603
| |-- wraith-discovery/ # DHT, relay, NAT traversal
601604
| |-- wraith-files/ # Chunking, integrity, transfer
@@ -716,12 +719,12 @@ WRAITH Protocol v2.3.7 represents 2,740+ story points across 24 development phas
716719
- Conductor project management system with code style guides for development workflow tracking
717720
- RedOps workspace integration: team-server and operator-client as workspace members (spectre-implant excluded for no_std compatibility)
718721
- v2.3.6 RedOps Advanced Tradecraft: Signal Double Ratchet C2 ratcheting, 4 new MITRE ATT&CK techniques (T1134, T1140, T1574.002, T1105), Runner source-build, operator UX polish, team server safety hardening
719-
- Comprehensive documentation (114 files, ~62,800 lines) and testing (2,839 tests across all components)
722+
- Comprehensive documentation (114 files, ~62,800 lines) and testing (2,957 tests across all components)
720723
- CI/CD infrastructure with multi-platform releases
721724

722725
### Future Development
723726

724-
- **v2 Protocol Migration** - Phase 1 (crypto foundation) and Phase 2 (wire format) complete; Phases 3-9 in progress
727+
- **v2 Protocol Migration** - Phase 1 (crypto foundation), Phase 2 (wire format), and Phase 3 (transport layer) complete; Phases 4-9 in progress
725728
- **Post-quantum cryptography** - Hybrid X25519 + ML-KEM-768 (Phase 1 complete), ML-DSA-65 signatures (optional)
726729
- **Formal verification** - Cryptographic protocol proofs
727730
- **XDP/eBPF implementation** - Full kernel bypass (wraith-xdp crate)
@@ -794,6 +797,6 @@ WRAITH Protocol builds on excellent projects and research:
794797

795798
**WRAITH Protocol** - _Secure. Fast. Invisible._
796799

797-
**Version:** 2.3.7 | **License:** MIT | **Language:** Rust 2024 (MSRV 1.88) | **Tests:** 2,839 passing (2,828 workspace + 11 spectre-implant) | **Clients:** 12 applications (9 desktop + 2 mobile + 1 server)
800+
**Version:** 2.3.7 | **License:** MIT | **Language:** Rust 2024 (MSRV 1.88) | **Tests:** 2,957 passing (2,946 workspace + 11 spectre-implant) | **Clients:** 12 applications (9 desktop + 2 mobile + 1 server)
798801

799802
**Last Updated:** 2026-02-02

crates/wraith-transport/Cargo.toml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "wraith-transport"
3-
description = "Network transport layer for WRAITH - AF_XDP, io_uring, UDP fallback"
3+
description = "Network transport layer for WRAITH - UDP, TCP, WebSocket, QUIC, AF_XDP, io_uring"
44
version.workspace = true
55
edition.workspace = true
66
rust-version.workspace = true
@@ -19,6 +19,15 @@ crossbeam-queue = { workspace = true }
1919
num_cpus = "1.16"
2020
libc = "0.2"
2121

22+
# QUIC transport
23+
quinn = "0.11"
24+
rustls = { version = "0.23", default-features = false, features = ["ring", "logging", "std", "tls12"] }
25+
rcgen = "0.13"
26+
27+
# WebSocket transport
28+
tokio-tungstenite = "0.24"
29+
futures-util = "0.3"
30+
2231
# Linux-only dependencies for kernel bypass (AF_XDP, io_uring)
2332
[target.'cfg(target_os = "linux")'.dependencies]
2433
io-uring = { workspace = true }

0 commit comments

Comments
 (0)