A Rust implementation of the AQUILA cross-layer communication architecture for resilient video streaming and C2 telemetry, based on the quiche library.
- AQUILA Architecture:
- Cross-Layer Optimization: Unified congestion control context for mixed traffic types.
- Priority Scheduling: Prioritizes Reliable C2 telemetry over Unreliable Video Datagrams.
- Resilience: Supports 0-RTT Session Resumption and Connection Migration to minimize handover blackouts.
- RFC 9221 Compliance: Implements QUIC Unreliable Datagram Extension for low-latency video streaming.
- Dual Congestion Control: Supports both BBR and SCReAM congestion control algorithms.
- Real-time Pacing: Implements proper pacing to simulate real-time video streaming.
- Self-signed TLS: Automatic generation of ephemeral certificates.
The project consists of two binaries:
- quic-server: Streams video file using QUIC datagrams with configurable congestion control
- quic-client: Receives datagrams and writes directly to output file (no reordering/buffering)
cargo build --releaseBinaries will be available at:
target/release/quic-servertarget/release/quic-client
With BBR congestion control (default):
RUST_LOG=info ./target/release/quic-serverWith SCReAM congestion control:
RUST_LOG=info ./target/release/quic-server --cc screamWith Optimized SCReAM-FPV congestion control:
RUST_LOG=info ./target/release/quic-server --cc scream-fpvAQUILA Mode (Video + C2):
RUST_LOG=info ./target/release/quic-server \
--cc scream-fpv \
--c2-file c2/c2_data.txtCustom options:
RUST_LOG=info ./target/release/quic-server \
--listen 0.0.0.0:4433 \
--video test_video_h265_no_b_frames.ts \
--cc bbrIn another terminal:
RUST_LOG=info ./target/release/quic-clientCustom options:
RUST_LOG=info ./target/release/quic-client \
--server 127.0.0.1:4433 \
--output received_output.ts \
--c2-output received_c2.txtWhen running in C2 + Video mode (--c2-file), the server implements a priority scheduler:
-
Priority 1: C2 Telemetry (Reliable)
- Transmitted at 1 Hz (1 line per second) via QUIC Stream ID 1.
- Bypasses SCReAM congestion window checks (high priority).
- Updates the SCReAM controller with sent bytes to maintain a unified congestion context.
-
Priority 2: Video Data (Unreliable)
- Transmitted via QUIC Datagrams.
- Only transmitted if there is bandwidth headroom (
R_safe) remaining after C2 usage. - Strictly gated by
scream.can_transmit().
Both client and server explicitly enable datagram support:
config.enable_dgram(true, 1000, 1000);This is critical - without this configuration, the datagram extension is not negotiated and dgram_send()/dgram_recv() calls will fail.
- Loads video and optional C2 data into memory.
- Waits for client connection (supports 0-RTT and Connection Migration).
- Transmission Loop:
- Checks if C2 data needs to be sent (1 Hz interval).
- Checks if Video data can be sent (SCReAM window + Headroom check).
- Paces transmission to match video bitrate / available bandwidth.
- With SCReAM: Adjusts pacing dynamically based on network feedback.
- Connects to server (saves/loads
session.binfor 0-RTT). - Multiplexing:
- Receives C2 data on Stream 1 and writes to C2 output file immediately.
- Receives Video data via Datagrams and writes to video output file.
- Does not request retransmissions for video - simulates live streaming.
BBR Mode:
- Uses quiche's built-in BBR implementation
- Configured via
config.set_cc_algorithm_name("bbr")
SCReAM Mode:
- Uses custom SCReAM controller from
scream-cccrate (Rust implementation) - Dynamically adjusts pacing interval based on network conditions
- Start server:
RUST_LOG=info ./target/release/quic-server - Start client:
RUST_LOG=info ./target/release/quic-client - Wait for completion (~60 seconds for 4Mbps stream)
- Compare files:
ls -lh test_video_h265_no_b_frames.ts received_output.ts
Server logs:
INFO quic_server - Server listening on 127.0.0.1:4433
INFO quic_server - Loaded video file: 30000000 bytes
INFO quic_server - New connection from 127.0.0.1:xxxxx
INFO quic_server - Connection established. Ready to stream.
INFO quic_server - Sent 1 MB (3.3%) in 2.4s
...
INFO quic_server - Streaming complete! Sent 30000000 bytes in 60.00s (4.00 Mbps)
Client logs:
INFO quic_client - Client bound to 127.0.0.1:xxxxx
INFO quic_client - Connecting to 127.0.0.1:4433
INFO quic_client - Connection established! Ready to receive.
INFO quic_client - Received 1 MB in 2.4s (4.12 Mbps recent)
...
INFO quic_client - Total received: 30000000 bytes (28.61 MB)
INFO quic_client - Average bitrate: 4.00 Mbps
.
├── Cargo.toml # Workspace configuration
├── quic-server/
│ ├── Cargo.toml
│ └── src/
│ ├── main.rs # Server implementation
│ └── certs.rs # Certificate generation
├── quic-client/
│ ├── Cargo.toml
│ └── src/
│ ├── main.rs # Client implementation
│ └── certs.rs # Certificate utilities
├── scream-cc/
│ ├── Cargo.toml
│ └── src/
│ └── lib.rs # Pure Rust SCReAM implementation
├── c2/ # C2 data generation tools
│ ├── c2_data.txt
│ └── gen_c2.py
└── traces/ # Network traces for evaluation
└── ...
- quiche: Cloudflare's QUIC implementation
- tokio: Async runtime
- rcgen: Certificate generation
- ring: Cryptographic operations
- clap: CLI argument parsing
- anyhow: Error handling
- env_logger: Logging
- Certificates are auto-generated on first run (
cert.pem,key.pem) - Max datagram size: 1350 bytes
- Default video bitrate: 4 Mbps
- The client does not implement jitter buffering or packet reordering
- Packet loss will result in missing data in the output file (simulating live streaming behavior)
This project is licensed under the GNU General Public License v3.0 (GPLv3). See the LICENSE file for details.