Skip to main content

netpath

Network path diagnostics for AS paths, exact service endpoints, and regional probe coverage. netpath combines traceroute/MTR, optional iperf3 throughput, latency/loss/jitter checks, DNS and HTTPS edge timing, PMTU/geo sanity checks, Globalping remote probes, and Cloudflare Radar RUM overlays.

Install

pip install netpath
# or
uvx netpath
# or
uv tool install netpath

System tools:

# macOS
brew install mtr iperf3

# Debian / Ubuntu
sudo apt install mtr-tiny iperf3

# Fedora / RHEL
sudo dnf install mtr iperf3

mtr is the preferred path prober; traceroute is used as a fallback when available. iperf3 enables cross-ASN throughput tests; without it, netpath falls back to a Cloudflare HTTP speedtest baseline where relevant.

Quickstart

# Diagnose a specific service endpoint
netpath host zoom.us

# Generate an escalation-ready root-cause report
netpath explain zoom.us --baseline ~/.netpath/monitor/AS15169.jsonl

# Probe one ASN
netpath asn AS15169

# Sweep top ASNs in a country
netpath country US --top 5

# Monitor path regressions over time
netpath monitor AS15169 --target zoom.us --every 10m

# Compare measured paths between ASNs or cities
netpath aspath AS7922 AS7018
netpath citypath "Los Angeles" "Tokyo"

# Check global DNS propagation in an interactive TUI
netpath dns example.com A

Use --json on commands that support scripting output. For DNS, use --once for the non-interactive terminal snapshot.

Command guide

Command Use when you need to… Example
host Trace the exact hostname/IP with approximate hop locations; best for SaaS/CDN/Anycast troubleshooting. netpath host zoom.us --json
explain Turn an endpoint trace into a likely-cause report with evidence and an escalation summary. netpath explain zoom.us --baseline ~/.netpath/monitor/AS15169.jsonl
asn Probe representative public iperf3 servers inside a target ASN. netpath asn AS15169 --no-throughput
country Compare top ASNs in a country, with optional Globalping inside-out measurements. netpath country GB --top 5
monitor Persist snapshots and report AS-path, RTT, loss, throughput, or verdict regressions. netpath monitor AS15169 --target zoom.us --every 10m
aspath Measure paths from probes inside one ASN toward a destination ASN or IP. netpath aspath AS7922 AS7018 --target 12.122.1.1
citypath Compare measured paths between two cities using Globalping and RIPE Atlas targets. netpath citypath "Los Angeles" "Tokyo"
target Discover or validate a usable probe target inside an ASN. netpath target AS7018 --json
coverage Show Globalping probe coverage by country. netpath coverage --top 20 --globe
dns Check DNS propagation across public resolvers in an interactive TUI. netpath dns example.com A
serve Run a self-hosted iperf3 server in your ASN and make it discoverable to netpath. netpath serve --announce https://registry.example/register

Common options

Option Applies to Meaning
-c, --cycles host, asn, country, monitor Probe cycles for MTR/traceroute.
-d, --duration Throughput-capable commands iperf3/speedtest duration.
--no-throughput asn, country, monitor Trace only; skip throughput.
--compare-v6 host, asn, country Show IPv4/IPv6 traces side by side.
--ecmp-passes host, asn, country Run multiple passes to expose route changes.
--trace-fusion host, explain, asn, country, monitor Merge mtr, Paris traceroute, UDP traceroute, and TCP traceroute observations by hop.
--gp-token Globalping commands Optional token for higher Globalping rate limits (NETPATH_GLOBALPING_TOKEN).
--cf-token RUM-capable commands Cloudflare Radar token (NETPATH_CF_TOKEN).
--baseline explain Compare against a monitor JSON/JSONL history file.
--globe Visual commands Open an interactive 3D globe after probing.

Run netpath <command> --help for the full option list.

Endpoint vs ASN mode

Use host when troubleshooting an application path. It bypasses representative ASN/city target selection and traces the resolved endpoint directly, which matters for DNS steering, CDNs, Anycast, and SaaS edges.

Use asn, country, aspath, and citypath when characterizing networks or comparing providers. Those modes intentionally select usable targets or remote probes to answer broader path questions.

Interactive TUI

Launch the full-screen network analyzer:

netpath

You can optionally start with a path prefilled:

netpath tui "Denver" "Tel Aviv"
netpath tui AS14593 AS12400 --asn

The TUI is the default interface and includes city and ASN path ranking, endpoint traces, ASN and country tests, DNS propagation, incident explanations, reusable baselines, target discovery, and Globalping coverage. Use Create baseline to save a measurement; Explain incident automatically lists the available JSON/JSONL baselines in a dropdown. Existing subcommands remain available for scripts and automation. Path views show each geolocated hop with RTT and network ownership, plot an approximate terminal route, and can open the result on the browser globe. Press Ctrl+R to run, m to cycle modes, g for the globe, and q to quit.

Check the installed version with netpath --version or netpath -V.

Monitoring

monitor stores JSONL history under ~/.netpath/monitor by default:

netpath monitor AS15169
netpath monitor AS15169 --every 10m --runs 6
netpath monitor AS15169 --target zoom.us --every 10m
netpath monitor AS15169 --forever --every 5m --webhook https://example.com/netpath-alert

Standard mode keeps one history file per ASN. --target mode keys history by ASN plus resolved endpoint, so application-specific baselines do not mix with representative ASN baselines. Add --fail-on-regression for cron or CI jobs.

Monitor snapshots include recent route-stability summaries: AS-path churn rate, median/p95 RTT baseline, and severity frequency.

Globalping and RUM

Globalping is used for remote, inside-out measurements without requiring an account. A token is optional and only raises rate limits:

export NETPATH_GLOBALPING_TOKEN=your_token_here
netpath country ZA --top 10

Cloudflare Radar RUM overlays need a free token with radar:read permission:

export NETPATH_CF_TOKEN=your_token_here
netpath asn AS15169

Target discovery

When netpath needs a target inside an ASN, it tries self-hosted/registered iperf3 servers (local registry and NETPATH_SERVERS_URL lists), public iperf3 servers, connected RIPE Atlas probe addresses, PeeringDB IXP interface addresses, then a small verified sample from RIPEstat announced prefixes. User-provided targets are preserved and annotated with Cymru ASN/prefix attribution.

Host an iperf3 server in your ASN

Real cross-ASN throughput numbers require an iperf3 server inside the target network, and public coverage is sparse. If you operate a network, one command fills the gap:

netpath serve

That runs iperf3 -s, detects your public IP and ASN via Cymru, registers the server in ~/.netpath/servers.json, and prints everything needed to make it discoverable to others. Open TCP+UDP 5201.

Prefer containers, systemd, or cloud-init? Deployment assets ship with the package:

netpath serve --emit install | sudo sh    # iperf3 + hardened systemd unit
netpath serve --emit compose              # docker-compose.yml (with --emit docker for the Dockerfile)
netpath serve --emit cloud-init           # user-data for a fresh VM

Discovery works at whatever radius you want:

  • Just you — the local registry written by netpath serve is merged ahead of the public list.
  • Your org or community — host the printed JSON entry anywhere and point users at it with NETPATH_SERVERS_URL=https://… (comma-separated URLs allowed), or run the reference community registry (netpath serve --emit registry) and announce servers to it with netpath serve --announce https://registry…/register.
  • Anyone probing your domain — publish the printed DNS SRV record (_netpath-iperf3._tcp.example.com); netpath host example.com --throughput finds and uses the record owned by that exact domain.
  • Everyone — submit the entry to the public iperf3 server list, which every netpath install checks.

See src/netpath/deploy/README.md for the full operator guide.

Development

make validate  # syncs dev extras, then runs tests and lint
make test      # uv run python -m pytest -q
make lint      # uv run python -m ruff check .

Maintainer release flow

Releases are tag-driven. Cut them from main with the local helper:

release-tag v0.27.0 "Describe the change"

The helper verifies main, runs tests, pushes the commit/tag, and the v*.*.* tag triggers PyPI publishing plus GitHub Release creation via GitHub Actions.

License

MIT

Release files for netpath 0.38.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 netpath 0.38.0
File Size Uploaded
netpath-0.38.0.tar.gz 525.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for netpath 0.38.0
File Interpreter ABI Platform
netpath-0.38.0-py3-none-any.whl Python 3 none any Details

Total release size: 647.8 kB

Release files / netpath-0.38.0.tar.gz

Download URL netpath-0.38.0.tar.gz
Size 525.8 kB
Tags Source
SHA-256 checksum
How to use checksums
a050f1f4d71047a9cf816281335771c08548efbf39dadc4f0f0f81ebf9196b7e
BLAKE2b-256 checksum
How to use checksums
04c463f5bed993ee4929b65010d7093b2f405034a8f93dd173614d82e7b0a6dc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Jul 8, 2026.

Transparency log

Release files / netpath-0.38.0-py3-none-any.whl

Download URL netpath-0.38.0-py3-none-any.whl
Size 122.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c32644a967904a2512e65d9d4a730741bf8e818c5087ade173326327b189a467
BLAKE2b-256 checksum
How to use checksums
60c08752033e44412a53649745b9cf103054f23ef7556b5e65a2273e5d91aa2b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Jul 8, 2026.

Transparency log

Release history Release notifications | RSS feed

0.48.0

2 release files

0.47.0

2 release files

0.46.0

2 release files

0.45.0

2 release files

0.44.0

2 release files

0.43.0

2 release files

0.42.1

2 release files

0.42.0

2 release files

0.41.0

2 release files

This release

0.38.0 This release

2 release files

0.9.0

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

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