Skip to content

Vinylether/aquila

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AQUILA QUIC Video Proxy

A Rust implementation of the AQUILA cross-layer communication architecture for resilient video streaming and C2 telemetry, based on the quiche library.

Features

  • 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.

Architecture

The project consists of two binaries:

  1. quic-server: Streams video file using QUIC datagrams with configurable congestion control
  2. quic-client: Receives datagrams and writes directly to output file (no reordering/buffering)

Building

cargo build --release

Binaries will be available at:

  • target/release/quic-server
  • target/release/quic-client

Usage

Start the Server

With BBR congestion control (default):

RUST_LOG=info ./target/release/quic-server

With SCReAM congestion control:

RUST_LOG=info ./target/release/quic-server --cc scream

With Optimized SCReAM-FPV congestion control:

RUST_LOG=info ./target/release/quic-server --cc scream-fpv

AQUILA Mode (Video + C2):

RUST_LOG=info ./target/release/quic-server \
  --cc scream-fpv \
  --c2-file c2/c2_data.txt

Custom options:

RUST_LOG=info ./target/release/quic-server \
  --listen 0.0.0.0:4433 \
  --video test_video_h265_no_b_frames.ts \
  --cc bbr

Start the Client

In another terminal:

RUST_LOG=info ./target/release/quic-client

Custom options:

RUST_LOG=info ./target/release/quic-client \
  --server 127.0.0.1:4433 \
  --output received_output.ts \
  --c2-output received_c2.txt

Implementation Details

AQUILA Priority Scheduling

When running in C2 + Video mode (--c2-file), the server implements a priority scheduler:

  1. 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.
  2. 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().

RFC 9221 Datagram Support

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.

Server Behavior

  1. Loads video and optional C2 data into memory.
  2. Waits for client connection (supports 0-RTT and Connection Migration).
  3. 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.
  4. With SCReAM: Adjusts pacing dynamically based on network feedback.

Client Behavior

  1. Connects to server (saves/loads session.bin for 0-RTT).
  2. 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.
  3. Does not request retransmissions for video - simulates live streaming.

Congestion Control

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-cc crate (Rust implementation)
  • Dynamically adjusts pacing interval based on network conditions

Testing

Basic Test

  1. Start server: RUST_LOG=info ./target/release/quic-server
  2. Start client: RUST_LOG=info ./target/release/quic-client
  3. Wait for completion (~60 seconds for 4Mbps stream)
  4. Compare files: ls -lh test_video_h265_no_b_frames.ts received_output.ts

Expected Output

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

Project Structure

.
├── 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
    └── ...

Dependencies

  • quiche: Cloudflare's QUIC implementation
  • tokio: Async runtime
  • rcgen: Certificate generation
  • ring: Cryptographic operations
  • clap: CLI argument parsing
  • anyhow: Error handling
  • env_logger: Logging

Notes

  • 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)

License

This project is licensed under the GNU General Public License v3.0 (GPLv3). See the LICENSE file for details.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors