Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

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.0rc1

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.0rc1
File Interpreter ABI Platform Actions
netscenario-0.2.0rc1-cp311-abi3-manylinux_2_28_x86_64.whl CPython 3.11 abi3 Linux glibc 2.28+ x86-64 Details for netscenario-0.2.0rc1-cp311-abi3-manylinux_2_28_x86_64.whl
netscenario-0.2.0rc1-cp311-abi3-manylinux_2_28_aarch64.whl CPython 3.11 abi3 Linux glibc 2.28+ ARM64 Details for netscenario-0.2.0rc1-cp311-abi3-manylinux_2_28_aarch64.whl

Total release size: 10.1 MB

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

Download URL netscenario-0.2.0rc1-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
adcd66ec0884088404883f29ee550215c1ca7f5103ce65faf2a2918f09c29dee
BLAKE2b-256 checksum
How to use checksums
2e05397a55198213058bdebb065054f1b775de6db3252dbf7814a922486a162e
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.0rc1-cp311-abi3-manylinux_2_28_aarch64.whl

Download URL netscenario-0.2.0rc1-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
ac6569325527ef031760aaf9468e2be564447e97fbef05c078a45176a5afef5a
BLAKE2b-256 checksum
How to use checksums
92e242c6ea71b8d6f992e539490c08243e2d5606759cd5e0431af81b2a89ff78
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.0rc1

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.0rc1-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