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, 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"

Use --json on commands that support scripting output.

Command guide

Command Use when you need to… Example
host Trace the exact hostname/IP an app uses; 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

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

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.

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

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.27.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.27.0
File Size Uploaded
netpath-0.27.0.tar.gz 478.7 kB Details

Built distribution (wheel)

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

Total release size: 558.0 kB

Release files / netpath-0.27.0.tar.gz

Download URL netpath-0.27.0.tar.gz
Size 478.7 kB
Tags Source
SHA-256 checksum
How to use checksums
7a70e93cb5e4bb90a87b338a7c94a91579cdcdf59a3b384574ddabad5f2a11b3
BLAKE2b-256 checksum
How to use checksums
bb364b5707ba90e72569092a26c40c8a109d32cff3a58754c51603bef4041b66
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 5, 2026.

Transparency log

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

Download URL netpath-0.27.0-py3-none-any.whl
Size 79.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b797e2869d2e30d60671d43d2daf13eac07f78385a91b7af5318928ff543454f
BLAKE2b-256 checksum
How to use checksums
4b07a81d52b483af7a0e46d8e7a6a98f273d68cc824dd00ea317ab63e7a17d63
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 5, 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.27.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