Skip to content

About

Cross-platform Python CLI for network benchmarking & diagnostics — latency, jitter, throughput, bufferbloat and traceroute against Tier-1 European & global IXPs. Zero dependencies.

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NetBench 🚀

Production-grade, cross-platform Network Benchmarking and Diagnostics CLI suite in Python 3.

Works seamlessly on Linux (Ubuntu, Debian, Fedora, Arch) and Windows 10/11 without requiring elevated/root privileges.

Python Version License Platform PRs Welcome Dependencies

🇬🇧 English · 🇮🇹 Italiano


🇬🇧 English

🌟 Key Features

  • Tier-1 Global Endpoints: Benchmarks against major European & Transcontinental Internet Exchange Points (IXPs) and Tier-1 CDNs/Backbones (Milan MIX, Rome NAMEX, Telecom Italia, Frankfurt DE-CIX, Paris OVH, London LINX, Amsterdam AMS-IX, US-East Ashburn, Tokyo TY2, Singapore Hub).
  • Comprehensive Latency & Jitter:
    • Measures Minimum, Average, Maximum, Median, and Standard Deviation.
    • Computes RFC 3393 Inter-Arrival Jitter and Packet Loss percentage.
    • Automatically falls back to high-precision TCP handshake timing if ICMP ping is restricted or blocked.
  • Hop-by-Hop Route Analysis (Traceroute):
    • Cross-platform parser for Windows tracert and Linux traceroute/tracepath.
    • Analyzes national Italian routes (Milan MIX) and European transit hubs (Frankfurt DE-CIX).
  • Throughput & Bufferbloat Evaluation:
    • Multi-stream chunked HTTP download and upload speed test against high-capacity Tier-1 CDN endpoints.
    • Continuous concurrent loaded latency sampling to calculate RFC bufferbloat grades (A+, A, B, C, D, F).
  • Automated Logging & Structured Artifacts:
    • Automatically exports raw machine-readable JSON (benchmark_<timestamp>.json).
    • Automatically generates human-readable ASCII text reports (benchmark_<timestamp>.txt).
  • Differential Comparison Engine (--compare):
    • Compares two benchmark JSON runs and displays calculated deltas (e.g. +25.3 Mbps down, -2.4 ms latency, -0.4 ms jitter).
  • Zero Mandatory Dependencies:
    • Runs out of the box using only the Python 3 standard library.
    • Optional rich integration for enhanced terminal styling.

📦 Installation & Requirements

NetBench requires Python 3.8+ and no mandatory third-party libraries.

# Clone or navigate to the repository
cd full_internet_test

# (Optional) Install rich for enhanced terminal colors and formatting
pip install -r requirements.txt

⚡ Quick Start & Usage

1. Run Comprehensive Benchmark Suite

python benchmark.py

2. Run Quick Mode (5 pings, 4-second throughput)

python benchmark.py --quick

3. Targeted Diagnostics

# Run only latency & jitter tests
python benchmark.py --latency-only

# Run only download/upload throughput and bufferbloat
python benchmark.py --throughput-only

# Run only traceroutes
python benchmark.py --traceroute-only

4. Custom Endpoints & Concurrency

# Test custom endpoints
python benchmark.py --targets "1.1.1.1,8.8.8.8,google.com,fsn1-speed.hetzner.com"

# Specify custom stream count and test duration
python benchmark.py --throughput-only --streams 8 --duration 15

5. Compare Historical Runs

python benchmark.py --compare benchmark_20260826_120000.json benchmark_20260826_140000.json

📊 CLI Options & Flags

Flag Description
--quick Fast diagnostic run (5 packets, 4s throughput).
--full Full comprehensive benchmark (default).
--latency-only Run only latency, jitter, and packet loss diagnostics.
--throughput-only Run only download/upload bandwidth and bufferbloat tests.
--traceroute-only Run only hop-by-hop route diagnostics.
--compare FILE1 FILE2 Compare two JSON benchmark runs and print deltas.
--targets HOSTS Comma-separated list of target IPs or domains.
--streams N Parallel HTTP streams for throughput testing (default: 4).
--duration SEC Duration for throughput test phases (default: 10s).
--pings N Number of ICMP/TCP ping packets per target (default: 15).
--output-dir DIR Destination directory for output files (default: .).
--no-save Do not write .json and .txt files to disk.
--no-color Disable ANSI and Rich formatting.
--json-only Output raw JSON data directly to standard output.

🔬 Benchmark Endpoints

  • Italy / Local:
    • 1.1.1.1 (Milan MIX / Cloudflare Anycast)
    • 104.16.0.0 (Milan Cloudflare Edge Gateway)
    • 8.8.8.8 (Rome NAMEX / Google Primary DNS)
    • 85.37.17.51 (Telecom Italia Gateway / DNS)
  • Europe:
    • fsn1-speed.hetzner.com (Frankfurt DE-CIX / Hetzner Core Hub)
    • proof.ovh.net (Paris / OVH Core Backbone)
    • 1.0.0.1 (London LINX / Cloudflare UK)
    • 8.8.4.4 (Amsterdam AMS-IX / Google Edge)
  • Global / Transcontinental:
    • speedtest.newyork.linode.com (US-East Ashburn / AWS Linode)
    • speedtest.tokyo2.linode.com (Tokyo Asia-East / Equinix TY2)
    • speedtest.singapore.linode.com (Singapore SEA Transit Hub)

🧪 Running Tests

NetBench includes a complete unit test suite using the standard Python unittest framework:

python -m unittest discover tests -v

🇮🇹 Italiano

🌟 Caratteristiche principali

  • Endpoint globali Tier-1: benchmark verso i principali Internet Exchange Point (IXP) europei e transcontinentali e verso CDN/backbone Tier-1 (Milano MIX, Roma NAMEX, Telecom Italia, Francoforte DE-CIX, Parigi OVH, Londra LINX, Amsterdam AMS-IX, US-East Ashburn, Tokyo TY2, Singapore Hub).
  • Latenza e jitter completi:
    • Misura minimo, medio, massimo, mediana e deviazione standard.
    • Calcola il Jitter Inter-Arrival RFC 3393 e la percentuale di pacchetti persi.
    • Fallback automatico al timing ad alta precisione dell'handshake TCP se il ping ICMP è bloccato o limitato.
  • Analisi hop-by-hop del percorso (Traceroute):
    • Parser cross-platform per tracert (Windows) e traceroute/tracepath (Linux).
    • Analizza rotte nazionali italiane (Milano MIX) e hub di transito europei (Francoforte DE-CIX).
  • Valutazione throughput e bufferbloat:
    • Test di velocità download/upload HTTP multi-stream verso endpoint CDN Tier-1 ad alta capacità.
    • Campionamento continuo della latenza sotto carico per calcolare i voti di bufferbloat secondo RFC (A+, A, B, C, D, F).
  • Logging automatico e artefatti strutturati:
    • Esportazione automatica di JSON grezzo leggibile da macchina (benchmark_<timestamp>.json).
    • Generazione automatica di report ASCII leggibili da persone (benchmark_<timestamp>.txt).
  • Motore di confronto differenziale (--compare):
    • Confronta due run di benchmark in JSON e mostra i delta calcolati (es. +25.3 Mbps down, -2.4 ms latenza, -0.4 ms jitter).
  • Zero dipendenze obbligatorie:
    • Funziona out of the box usando solo la libreria standard di Python 3.
    • Integrazione opzionale con rich per una formattazione avanzata del terminale.

📦 Installazione e requisiti

NetBench richiede Python 3.8+ e nessuna libreria di terze parti obbligatoria.

# Clona o naviga nel repository
cd full_internet_test

# (Opzionale) Installa rich per colori e formattazione avanzata del terminale
pip install -r requirements.txt

⚡ Avvio rapido e utilizzo

1. Esegui la suite di benchmark completa

python benchmark.py

2. Modalità rapida (5 ping, 4 secondi di throughput)

python benchmark.py --quick

3. Diagnostica mirata

# Esegui solo i test di latenza e jitter
python benchmark.py --latency-only

# Esegui solo i test di throughput download/upload e bufferbloat
python benchmark.py --throughput-only

# Esegui solo i traceroute
python benchmark.py --traceroute-only

4. Endpoint personalizzati e concorrenza

# Testa endpoint personalizzati
python benchmark.py --targets "1.1.1.1,8.8.8.8,google.com,fsn1-speed.hetzner.com"

# Specifica un numero personalizzato di stream e durata del test
python benchmark.py --throughput-only --streams 8 --duration 15

5. Confronta run storici

python benchmark.py --compare benchmark_20260826_120000.json benchmark_20260826_140000.json

📊 Opzioni e flag CLI

Flag Descrizione
--quick Esecuzione diagnostica rapida (5 pacchetti, 4s di throughput).
--full Benchmark completo (predefinito).
--latency-only Esegue solo la diagnostica di latenza, jitter e packet loss.
--throughput-only Esegue solo i test di banda download/upload e bufferbloat.
--traceroute-only Esegue solo la diagnostica hop-by-hop del percorso.
--compare FILE1 FILE2 Confronta due run di benchmark JSON e stampa i delta.
--targets HOSTS Elenco separato da virgole di IP o domini target.
--streams N Stream HTTP paralleli per il test di throughput (predefinito: 4).
--duration SEC Durata delle fasi di test throughput (predefinito: 10s).
--pings N Numero di pacchetti ICMP/TCP ping per target (predefinito: 15).
--output-dir DIR Directory di destinazione per i file di output (predefinito: .).
--no-save Non scrive i file .json e .txt su disco.
--no-color Disabilita la formattazione ANSI e Rich.
--json-only Stampa i dati JSON grezzi direttamente su standard output.

🔬 Endpoint di benchmark

  • Italia / Locale:
    • 1.1.1.1 (Milano MIX / Cloudflare Anycast)
    • 104.16.0.0 (Milano Cloudflare Edge Gateway)
    • 8.8.8.8 (Roma NAMEX / Google DNS primario)
    • 85.37.17.51 (Telecom Italia Gateway / DNS)
  • Europa:
    • fsn1-speed.hetzner.com (Francoforte DE-CIX / Hetzner Core Hub)
    • proof.ovh.net (Parigi / OVH Core Backbone)
    • 1.0.0.1 (Londra LINX / Cloudflare UK)
    • 8.8.4.4 (Amsterdam AMS-IX / Google Edge)
  • Globale / Transcontinentale:
    • speedtest.newyork.linode.com (US-East Ashburn / AWS Linode)
    • speedtest.tokyo2.linode.com (Tokyo Asia-East / Equinix TY2)
    • speedtest.singapore.linode.com (Singapore SEA Transit Hub)

🧪 Esecuzione dei test

NetBench include una suite completa di unit test basata sul framework standard unittest di Python:

python -m unittest discover tests -v

About

Cross-platform Python CLI for network benchmarking & diagnostics — latency, jitter, throughput, bufferbloat and traceroute against Tier-1 European & global IXPs. Zero dependencies.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages