Skip to main content

NetLab-TopoGen

CI

NetLab-TopoGen creates backbone network scenarios for the contiguous United States. It chooses metropolitan areas from Census data and follows highways to connect them. It then adds network sites, routers, traffic demands and failure policies. The result is a YAML scenario for NetGraph.

There are two steps: generate chooses the locations and routes; build turns those routes into a network. NetGraph runs the analysis of that network.

Install

Use Python 3.11 or later. Run these commands in a terminal:

pip install netlab-topogen

This also installs NetGraph 0.25, which brings its computation engine, NetGraph-Core. pyproject.toml lists the supported NetGraph versions and the other dependencies.

Download the geographic data

Create a data/ directory in the repository and save these files there. Keep the ZIP files as downloaded; do not unpack them.

The example configurations use these filenames. To store the files elsewhere, change data_sources in your configuration. Relative paths start at the directory where you run the command.

Build a network

Run this five-metro example from the repository root:

cp examples/small_baseline.yml config.yml
netlab-topogen info config.yml
netlab-topogen generate config.yml -o output
netlab-topogen build config.yml -o output

info checks the configuration and shows whether its data files exist. generate selects the metros: the urban areas you name, then the largest remaining ones by land area. It then finds highway routes between nearby metros. A route between two metros is called a corridor.

build adds points of presence (PoPs), where backbone routers are located, and data-center sites. A blueprint describes the devices and links inside a site. The build also assigns hardware, creates traffic demands and checks the scenario with NetGraph. It writes files only after the check passes, so a scenario that fails the check leaves the existing files unchanged.

Files in output/ use the configuration filename as their prefix:

File Contents
config_integrated_graph.json Metro locations and corridors from generate; build reads it
config_scenario.yml The network, traffic, failure policies and analysis steps
config_network_graph.json Sites and the links between them, with their capacities
config_*.jpg Maps and site diagrams enabled in the configuration

Map backgrounds need an internet connection; without one, build stops with an error after writing the scenario and the site-network JSON. To run the analysis steps saved in the scenario:

ngraph run output/config_scenario.yml --output output

Change the design

Edit config.yml. Capacities and traffic volumes in the supplied examples use Gbps; geographic distances use kilometers.

Setting What it controls
clustering.metro_clusters Number of metro locations
clustering.override_metro_clusters Name patterns of urban areas to include; they count toward metro_clusters
corridors Nearby metros to connect, route count and distance limits
build.build_defaults PoPs, data-center sites, blueprints, link capacities and costs
build.build_overrides Different settings for selected metros
build.tm_sizing Link capacities calculated from traffic, with spare capacity
traffic Traffic volume and distribution model
components Router types and optics for link endpoints
failure_policies Failures to model in the scenario
workflows Analysis steps for NetGraph to run
visualization Maps and diagrams to export

The traffic models are uniform (equal traffic between data-center sites), gravity (traffic weighted by site size and distance), and hose (traffic fitted to each site's send and receive totals). traffic.flow_policy_config gives each priority class a NetGraph routing preset, spelled exactly as NetGraph names it, such as TE_MAXFLOW_UNLIM.

Start with the baseline, Clos and Dragonfly examples. The configuration schema lists every accepted field and its allowed values.

Your own sites, hardware, failures and analyses go in lib/blueprints.yml, lib/components.yml, lib/failure_policies.yml and lib/workflows.yml. The netlab-topogen command reads lib/ in the directory where you run it. Each file maps names to definitions; a name that matches a built-in definition replaces it. Only the workflow the configuration selects is checked, so an unused workflow cannot stop a build. The repository's lib/ already adds failure policies and workflows, such as hose_samples_3 for three sampled traffic matrices. See how the pipeline works for the build rules, Python entry points and validation steps.

After changing locations or highway routing, run generate and build again. After changing sites, hardware or traffic, run build again.

Build several configurations

./build.sh examples output

Each configuration gets a subdirectory, such as output/small_baseline/. The script reuses a saved corridor graph when one exists. Use --force to regenerate the graphs, or --build-only to build scenarios from saved graphs. A failed configuration makes the command return a failure status.

Development

git clone https://github.com/networmix/NetLab-TopoGen
cd NetLab-TopoGen
python3 -m venv venv
source venv/bin/activate
python -m pip install -e '.[dev]'
make check-ci

This checks formatting, lint, types, example configurations and tests. In a Superset workspace, bash .superset/workspace.sh setup installs the development environment; the Run button runs these checks.

Changelog · MIT license

Metadata

Release files for netlab-topogen 0.6.0

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

Source distribution (sdist)

Source distribution for netlab-topogen 0.6.0
File Size Uploaded Provenance Actions
netlab_topogen-0.6.0.tar.gz 130.2 kB With provenance Details for netlab_topogen-0.6.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for netlab-topogen 0.6.0
File Interpreter ABI Platform Actions
netlab_topogen-0.6.0-py3-none-any.whl Python 3 none any Details for netlab_topogen-0.6.0-py3-none-any.whl

Total release size: 209.8 kB

Release files / netlab_topogen-0.6.0.tar.gz

Download URL netlab_topogen-0.6.0.tar.gz
Size 130.2 kB
Tags Source
SHA-256 checksum
How to use checksums
bf45514893efe11c6bbf382f03258300df2764853c483ee5336ef2cfeca25ecc
BLAKE2b-256 checksum
How to use checksums
affa4e42ba4a65f8c371d3f0599e43115fe965e18ae13ed954eb6d456e131054
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 Oct 28, 2026.

Transparency log

Release files / netlab_topogen-0.6.0-py3-none-any.whl

Download URL netlab_topogen-0.6.0-py3-none-any.whl
Size 79.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1fc4b0436ab38288a728bb9538ea1f82d0f5936f143c521461e6566cd770ad74
BLAKE2b-256 checksum
How to use checksums
fd227ce5fbbbf6b56baba21951e37a4a5a861ddee12bb03a0dc523fa99369fe9
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 Oct 28, 2026.

Transparency log

Security for netlab-topogen 0.6.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 netlab_topogen-0.6.0.tar.gz

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 Oct 28, 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