Skip to main content

netscenario

Declarative network scenarios for tests: describe a network (nodes, links, delay, jitter, loss, rate, and how they change over time), send traffic through it or run your own program in it, measure per packet, and assert on the numbers, with confidence intervals over repeated runs.

pip install netscenario
netscenario doctor        # what this machine can do, and how to fix what it cannot
import netscenario as ns

scenario = ns.Scenario.from_yaml("""
version: 0
name: video-call
seed: 11
duration: 5s
topology:
  nodes: [caller, callee]
  links:
    - id: wifi
      between: [caller, callee]
      forward: { delay: 30ms, jitter: { amount: 5ms, distribution: normal }, loss: { model: random, p: 1% } }
      reverse: { delay: 30ms }
workloads:
  - { id: video, kind: udp-cbr, from: caller, to: callee, rate: 1500kbit, packet-size: 1200b }
""")

result = ns.run(scenario, out="video-call-result")
video = result["video"]
print(
    f"{video.sent} packets sent, {video.loss_ratio:.1%} lost, p99 delay {video.delay.p99 * 1000:.0f} ms"
)
assert video.delay.p99 < 0.100  # seconds

Repeat a scenario with seeds derived from one seed and assert on an interval, make reports and replay a run:

runs = ns.run(scenario, repetitions=10)
assert runs.metric("video.loss_ratio").ci95_high < 0.05
open("report.html", "w").write(runs.report("html"))  # or "md" for a CI summary, "junit"
assert ns.replay(result.out_dir).reproduced  # the recorded seed, the same lost packets

The wheel carries the extension module and the two programs that a run needs (netscenario and netscenario-agent), and puts the command netscenario on the PATH. It is for Linux (x86_64 and aarch64) with the tools ip, tc, unshare, nsenter and prlimit (packages iproute2 and util-linux). A run creates network namespaces, which Debian and Ubuntu 22.04 allow without root; Ubuntu 24.04 needs one setting, and a container needs more: permissions. If something does not work, start with netscenario doctor and the troubleshooting guide.

The pytest plugin is the package pytest-netscenario.

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

Metadata

Release files for netscenario 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for netscenario 0.2.0
File Interpreter ABI Platform Actions
netscenario-0.2.0-cp311-abi3-manylinux_2_28_x86_64.whl CPython 3.11 abi3 Linux glibc 2.28+ x86-64 Details for netscenario-0.2.0-cp311-abi3-manylinux_2_28_x86_64.whl
netscenario-0.2.0-cp311-abi3-manylinux_2_28_aarch64.whl CPython 3.11 abi3 Linux glibc 2.28+ ARM64 Details for netscenario-0.2.0-cp311-abi3-manylinux_2_28_aarch64.whl

Total release size: 10.1 MB

Release files / netscenario-0.2.0-cp311-abi3-manylinux_2_28_x86_64.whl

Download URL netscenario-0.2.0-cp311-abi3-manylinux_2_28_x86_64.whl
Size 5.1 MB
Tags CPython 3.11 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
cea5dfae497c72fe867c5d7e04f51c59bc6deb8b7474901359edf2b23e0a9675
BLAKE2b-256 checksum
How to use checksums
1c7745e7f0b2c6a7e2f008b05b471da549f5a8082b84bf1c5722aac02dc898df
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 3, 2026.

Transparency log

Release files / netscenario-0.2.0-cp311-abi3-manylinux_2_28_aarch64.whl

Download URL netscenario-0.2.0-cp311-abi3-manylinux_2_28_aarch64.whl
Size 4.9 MB
Tags CPython 3.11 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
97d0bb2f54eb1e587f5497680e8028ec82e01afd1240aa579f8c7fbe48f8c649
BLAKE2b-256 checksum
How to use checksums
0f16027a8d589e59ea096c803cc6325dc233215ca02d2f84549395c52ef8c662
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 3, 2026.

Transparency log

Security for netscenario 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for netscenario-0.2.0-cp311-abi3-manylinux_2_28_x86_64.whl

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 3, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page