nxtquic-sim 0.1.3

Deterministic network simulator for NxtQuic testing
Documentation

nxtquic-sim

Crates.io Documentation License: MIT OR Apache-2.0 Rust: 1.85+

Deterministic network simulator for NxtQuic testing.

nxtquic-sim is a virtual network environment for the NxtQuic workspace. It allows you to run QUIC endpoints inside a fully controllable, deterministic simulation — without any real OS networking — making it ideal for unit tests, system tests, and reproducing network edge cases reliably.

Features

  • Deterministic execution — controllable virtual time; replay any scenario bit-for-bit
  • Configurable link impairment — inject latency, packet loss, duplication, and bit corruption
  • Multi-node topologies — model complex networks with multiple endpoints and routers
  • Mobile handoff simulation — reproduce path migration, failover, and multipath scenarios
  • I/O-free — runs on top of nxtquic-proto with no OS socket involvement
  • No async runtime required — synchronous simulation loop, zero flakiness

Usage

[dependencies]
nxtquic-sim = "0.1.2"
use nxtquic_sim::{Simulator, LinkConfig};

let mut sim = Simulator::new();
let link = sim.add_link(LinkConfig {
    latency_ms: 50,
    loss_percent: 2,
    ..Default::default()
});

// Feed packets and advance virtual time
sim.step();

Part of the NxtQuic workspace

Crate Purpose
nxtquic Top-level re-export, async API
nxtquic-proto Core state machine
nxtquic-crypto Pluggable crypto backends
nxtquic-udp Platform-optimized UDP I/O
nxtquic-api Tokio async/await API
nxtquic-h3 HTTP/3 + QPACK
nxtquic-sim Deterministic network simulator (this crate)
nxtquic-qlog qlog structured logging

License

Licensed under either of MIT or Apache-2.0 at your option.