Skip to main content

Network path analyzer: throughput, latency, and packet loss across AS paths

Project description

netpath

Network path analyzer: probe throughput, latency, and packet loss across Autonomous System (AS) paths. Runs mtr/traceroute to a target ASN, measures bidirectional iperf3 throughput to servers inside that ASN, and optionally overlays Cloudflare Radar RUM data for comparison.

Installation

pip install netpath
uvx netpath
uv tool install netpath

System Prerequisites

netpath relies on two external tools for path probing and throughput measurement. Install them before running:

  • mtr — primary path prober (falls back to traceroute if unavailable)
  • iperf3 — bidirectional throughput measurement (falls back to Cloudflare HTTP speedtest if unavailable)
# macOS
brew install mtr iperf3

# Debian / Ubuntu
sudo apt install mtr-tiny iperf3

# Fedora / RHEL
sudo dnf install mtr iperf3

Usage

Probe a specific ASN

netpath asn AS15169

Options:

-n, --count INTEGER       Max servers to test (default: 3)
-d, --duration INTEGER    iperf3 seconds per direction (default: 5)
-c, --cycles INTEGER      mtr probe cycles (default: 10)
--no-throughput           Skip throughput test, trace path only
--cf-token TEXT           Cloudflare API token (or set NETPATH_CF_TOKEN)
--json                    Output results as JSON

Probe top ASNs for a country

netpath country US

Options:

-t, --top INTEGER         Number of top ASNs to test (default: 10)
-n, --count INTEGER       Max servers per ASN (default: 3)
-d, --duration INTEGER    iperf3 seconds per direction (default: 5)
-c, --cycles INTEGER      mtr probe cycles (default: 10)
--no-throughput           Skip throughput test
--cf-token TEXT           Cloudflare API token (or set NETPATH_CF_TOKEN)
--atlas-key KEY           RIPE Atlas API key for in-network measurements (or set NETPATH_ATLAS_KEY)
--globe                   Open interactive 3D globe after probes complete

Atlas coverage profile

netpath atlas-profile --top 10

Fetches probe and anchor counts from RIPE Atlas and displays a ranked table showing which countries have the richest coverage:

   Atlas Coverage — Top 10 Countries
 ┌────┬──────┬──────────────────────┬────────┬─────────┬───────┐
 │  # │ Code │ Country              │ Probes │ Anchors │ Total │
 ├────┼──────┼──────────────────────┼────────┼─────────┼───────┤
 │  1 │ US   │ United States        │   1842 │     104 │  1946 │
 │  2 │ DE   │ Germany              │    898 │      59 │   957 │
 │  3 │ FR   │ France               │    601 │      48 │   649 │
 └────┴──────┴──────────────────────┴────────┴─────────┴───────┘

Options:

--atlas-key KEY           RIPE Atlas API key (or set NETPATH_ATLAS_KEY)
-t, --top INTEGER         Rows to show (default: 20)
--globe                   Open choropleth globe showing coverage density

Examples

# Probe Google's ASN
netpath asn AS15169

# Probe top 5 UK ISPs
netpath country GB --top 5

# Path-only probe (no throughput test)
netpath asn AS7018 --no-throughput

# JSON output for scripting
netpath asn AS15169 --json | jq .verdict

RIPE Atlas

RIPE Atlas is a global network of ~13,000 hardware probes hosted by volunteers. netpath can use Atlas probes to measure your network path from inside each target ISP — the probes ping your IP and run a traceroute back to you, giving you an inside-out view of each AS hop.

Getting an Atlas key

Create a free account at https://atlas.ripe.net/ and generate an API key with measurement creation permission. Each sweep costs approximately 11 Atlas credits per probe per ASN (1 ping + 10 traceroute).

export NETPATH_ATLAS_KEY=your_key_here
netpath country ZA --top 10

Or pass the key inline:

netpath country ZA --top 10 --atlas-key your_key_here

What the output looks like

When Atlas probes exist in a target ASN, a [Atlas] row appears below the regular measurement showing the inbound RTT and AS path as seen from inside that ISP:

  [Atlas]  ping avg 12.3 ms  AS37611 → AS3356 → AS7018 → ...

When no volunteer probes exist but anchor nodes do, the tool falls back automatically and labels the row [Atlas anchor]:

  [Atlas anchor]  ping avg 28.1 ms  AS37611 → AS3356 → ...

When neither probes nor anchors exist for a target ASN, the tool reports "no Atlas coverage" and continues to the next ASN.

Atlas coverage profile

Use netpath atlas-profile to discover which countries have the richest Atlas coverage before planning a sweep:

netpath atlas-profile --top 10
netpath atlas-profile --top 20 --globe

Cloudflare Radar RUM Overlay

netpath can overlay Cloudflare Radar Real User Monitoring (RUM) quality metrics for each ASN, showing real-world HTTP performance data alongside your own measurements.

To enable it, pass a Cloudflare API token with radar:read permission:

export NETPATH_CF_TOKEN=your_token_here
netpath asn AS15169

Or pass it inline:

netpath asn AS15169 --cf-token your_token_here

Tokens are free. Create one in the Cloudflare dashboard with the radar:read permission scope.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

netpath-0.10.0.tar.gz (319.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

netpath-0.10.0-py3-none-any.whl (47.4 kB view details)

Uploaded Python 3

File details

Details for the file netpath-0.10.0.tar.gz.

File metadata

  • Download URL: netpath-0.10.0.tar.gz
  • Upload date:
  • Size: 319.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for netpath-0.10.0.tar.gz
Algorithm Hash digest
SHA256 2334ed6104582dff0e235ad02913090976b7e0db649e4ba0ff92b60b17d01566
MD5 f4d1a445e55be0f1fb1a582d75bda1c0
BLAKE2b-256 fafd17bfc94141dd6a3adfdaa6eeac82db07124e079d6523ff210b0710a921b1

See more details on using hashes here.

Provenance

The following attestation bundles were made for netpath-0.10.0.tar.gz:

Publisher: publish.yml on holynakamoto/netpath

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file netpath-0.10.0-py3-none-any.whl.

File metadata

  • Download URL: netpath-0.10.0-py3-none-any.whl
  • Upload date:
  • Size: 47.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for netpath-0.10.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9d91d96bbeb86e36f177a513d2c617e857a1d68b9631120798ce3ae9f77d7812
MD5 3cdaef63007210b8d13b23f208b7cb24
BLAKE2b-256 6d99f81979c729c93cb726e28d8c20460446405e301188972a6fcd634a6133fd

See more details on using hashes here.

Provenance

The following attestation bundles were made for netpath-0.10.0-py3-none-any.whl:

Publisher: publish.yml on holynakamoto/netpath

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page