Skip to content

Releases: davidesantangelo/fastrace

v1.0.0

Choose a tag to compare

@davidesantangelo davidesantangelo released this 20 Jan 19:48

Fastrace v1.0.0 - Major Performance Release

This is the first stable major release of fastrace, featuring significant performance improvements and new capabilities.

Performance Improvements

  • 20x faster than standard traceroute in typical scenarios
  • Batch I/O with recvmmsg on Linux (up to 60% less syscall overhead)
  • Adaptive concurrency window based on network latency
  • Optimized timeouts (500ms hop, 1ms poll) for faster trace completion
  • Lock-free DNS queue with atomic operations
  • CLOCK_MONOTONIC_RAW for precise RTT measurements

New Features

Feature Flag Description
IPv6 -6 Full dual-stack support
ICMP Echo -I Ping-style traceroute
TCP SYN -T For firewalled networks
JSON output --json Machine-readable output
CSV output --csv Spreadsheet-compatible
Metrics --metrics RTT p50/p95/p99, jitter
Quiet mode --quiet Minimal output for benchmarking

Quick Start

# Build
make

# Standard trace
sudo ./fastrace google.com

# IPv6 with ICMP
sudo ./fastrace -6 -I ipv6.google.com

# JSON output with metrics
sudo ./fastrace --json --metrics cloudflare.com

Test Suite

make test        # Basic tests (no root)
sudo make test-full   # Full test suite
sudo make benchmark   # Performance benchmark

See CHANGELOG.md for full details.

v0.4.1

Choose a tag to compare

@davidesantangelo davidesantangelo released this 05 Dec 08:23

Performance

  • Nanosleep Precision: Replaced usleep() with nanosleep() for more accurate inter-probe delays and POSIX compliance.
  • DNS Pool Allocator: Added pre-allocated pool for DNS queue items, reducing malloc overhead in high-throughput scenarios.
  • Faster Early Exit: Optimized main loop to check finish condition more frequently, reducing latency when destination is reached.

Added

  • Trace Statistics: Displays hop count and response rate on completion for better observability.

Fixed

  • Hop Display with Concurrent Probing: Fixed a bug where intermediate hops were not displayed when the destination was reached by a concurrent probe. The trace now correctly shows all hops up to the destination.

Code Quality

  • Improved code organization with dedicated pool allocator functions.
  • Added statistics counters for probes sent and responses received.

v0.4.0

Choose a tag to compare

@davidesantangelo davidesantangelo released this 04 Dec 19:23

Performance

  • TTL Batching: Sets socket TTL once per hop and sends probes in bursts, reducing per-packet syscalls and improving send-side throughput under high concurrency.
  • Adaptive Waiting: Poll wait now aligns to the earliest hop deadline, cutting idle spins while still draining the ICMP socket aggressively.

Added

  • Probe Delay Flag: New -d <microseconds> option exposes inter-probe pacing (default 250µs) to tune burstiness versus jitter.

Changed

  • Clearer Hop Completion Logic: Hop readiness now factors both full receipt and TTL deadlines, yielding more deterministic timeout behavior in noisy networks.

v0.3.1

Choose a tag to compare

@davidesantangelo davidesantangelo released this 28 Nov 13:33

Fixed

  • Critical RTT Bug: Fixed incorrect RTT measurements showing values like 1764330397890.64 ms. The bug was caused by mixing SO_TIMESTAMP (wall-clock time from kernel) with CLOCK_MONOTONIC for sent timestamps. Now consistently uses monotonic clock for all RTT calculations.

v0.3.0

Choose a tag to compare

@davidesantangelo davidesantangelo released this 19 Nov 13:09

Performance

  • Asynchronous DNS Resolution: Moved reverse DNS lookups to a dedicated background thread. This eliminates the "stop-and-wait" behavior during printing, ensuring the packet probing loop never stalls while waiting for a hostname to resolve.
  • Kernel Timestamps: Implemented SO_TIMESTAMP support to retrieve packet arrival times directly from the kernel. This bypasses user-space scheduling jitter, providing significantly more accurate RTT measurements.

Changed

  • Thread-Safe Architecture: Refactored internal data structures (host cache, print queue) to be thread-safe using mutexes.
  • Build System: Added -pthread flag to compiler options and introduced a make test target.

Added

  • Test Suite: Added a basic regression test script (tests/test_basic.sh) to verify core functionality and argument parsing.

v0.2.1

Choose a tag to compare

@davidesantangelo davidesantangelo released this 31 Oct 10:46

Fixed

  • Removed artificial RTT clamping that was hiding legitimate network measurements
    • Previously clamped RTT between 0.05ms and 800ms
    • Now reports actual values including sub-50µs localhost responses and >800ms satellite/long-distance links
    • Added sanity check for negative RTT to detect clock issues without corrupting data

This fix restores full diagnostic capability for detecting network anomalies like bufferbloat and measuring true round-trip times across all network types.


Full Changelog: v0.2.0...v0.2.1

v0.2.0

Choose a tag to compare

@davidesantangelo davidesantangelo released this 31 Oct 08:55

A major performance and feature release delivering state-of-the-art traceroute capabilities with blazing speed and minimal resource usage.


Highlights

  • 65-75% faster trace completion with non-blocking event loop
  • 75-80% less memory usage through dynamic allocation
  • 70-80% lower CPU utilization with poll-driven I/O
  • Runtime tuning via comprehensive CLI options
  • DNS caching to eliminate redundant lookups
  • Monotonic timing for nanosecond-precision RTT tracking

Performance Improvements

  • Non-blocking event loop: Replaced select()-based architecture with poll() to minimize wakeups and efficiently drain ICMP response bursts
  • Monotonic timing: Switched from wall-clock to CLOCK_MONOTONIC for nanosecond-precision RTT tracking and tighter hop completion deadlines
  • Adaptive concurrency: Configurable probe counts, TTL windows, and wait intervals enable faster route convergence across diverse network conditions
  • Optimized packet emission: Pre-generated probe payloads and tuned UDP transmission cadence reduce per-packet overhead

New Features

Runtime Configuration

New command-line options for fine-grained control:

  • -n — Disable reverse DNS lookups for faster output
  • -m <hops> — Set maximum hop count (1-128, default 30)
  • -q <probes> — Configure probes per hop (1-10, default 3)
  • -c <count> — Adjust concurrent TTL window (default 6)
  • -W <ms> — Set poll wait timeout (default 2ms)
  • -t <ms> — Configure hop completion timeout (default 700ms)
  • -P <port> — Specify base UDP port (default 33434)
  • -V — Display version information

DNS Caching

Lightweight hostname cache prevents redundant reverse lookups when encountering load-balanced hops, significantly accelerating output generation.

Enhanced Output

Dynamic configuration summary displays active settings (protocol, hop limits, probe count) in the banner for better observability.


🛡️ Reliability Enhancements

  • Modern name resolution: Migrated to getaddrinfo()/getnameinfo() for thread-safe, standards-compliant DNS operations
  • Hardened ICMP parsing: Comprehensive bounds checking across all packet layers prevents buffer overruns
  • Resource management: Expanded socket buffers and safer cleanup routines improve stability under heavy traffic

📊 Benchmark Comparison

Metric Standard Traceroute fastrace v0.2.0 Improvement
Trace time (30 hops) 15-20s 4-7s 65-75% faster
Memory usage 400-600 KB 80-120 KB 75-80% less
CPU utilization 5-8% 1-2% 70-80% less
Concurrent TTLs 1 at a time 6+ simultaneously 6x+ throughput

v0.1.2

Choose a tag to compare

@davidesantangelo davidesantangelo released this 01 Apr 09:25

Security & Reliability

  • Added proper file descriptor flags with FD_CLOEXEC for socket security
  • Implemented comprehensive bounds checking to prevent buffer overflows
  • Enhanced memory safety with null pointer checks and proper initialization
  • Improved error handling throughout the codebase

Performance

  • Further optimized socket configuration with larger buffer sizes
  • Reduced probe delay to 1ms for faster tracing operations
  • Improved RTT measurement accuracy with better timing algorithm
  • Added constants for configurable response processing iterations

Code Quality

  • Refactored socket management with proper cleanup in error paths
  • Added additional debug information for troubleshooting
  • Improved source code organization with clearer separation of functions
  • Enhanced input validation for more robust operation
  • Fixed potential issues with type casting and numeric comparisons

v0.1.1

Choose a tag to compare

@davidesantangelo davidesantangelo released this 01 Apr 06:49

Fixed

  • Significantly improved RTT measurement accuracy to align with standard traceroute tools
  • Added proper timersub macro for correct time difference calculations with microsecond precision
  • Fixed timestamp handling to ensure accurate RTT measurements
  • Optimized timeout values for more responsive trace results

Changed

  • Reduced probe delay from 50ms to 5ms for faster tracing
  • Improved response processing with more frequent checks and shorter timeouts
  • Added sanity checks and reasonable caps for RTT values (maximum 1000ms)
  • Reduced socket receive timeout from 5s to 1s
  • Reduced TTL timeout from 5000ms to 1000ms for better responsiveness
  • Improved socket resource cleanup on program exit

v0.1.0

Choose a tag to compare

@davidesantangelo davidesantangelo released this 13 Mar 07:59

[0.1.0] - 2025-03-13

Added

  • Initial release of FastRace
  • High-performance traceroute implementation in pure C with zero dependencies
  • Dual socket architecture with UDP for probes and raw ICMP for responses
  • Concurrent TTL probing for faster route discovery (up to 5x faster than standard traceroute)
  • Visual tree-like representation of network paths showing load-balanced routes
  • Efficient memory management with minimal memory footprint
  • Optimized for speed with parallel probing and efficient packet handling
  • Smart timeout management with adaptive timeouts based on hop distance
  • Comprehensive route visualization with RTT measurements and hostname resolution

Technical Details

  • Implemented using standard C libraries and system calls
  • UDP probes with incremental TTL values to discover network path
  • Raw socket implementation for capturing ICMP responses
  • Port-based probe identification for accurate response matching
  • Non-blocking I/O with select() for efficient packet handling
  • Probe batching system with multiple probes per TTL
  • Flexible build system with optimization options

Code Improvements

  • Added proper random number generator seeding
  • Streamlined command line argument handling
  • Improved error messages and socket handling
  • Removed unnecessary privilege checking in favor of runtime capability detection
  • Eliminated redundant cleanup code for better performance
  • Improved code structure and variable declaration

Known Issues

  • IPv6 support not yet implemented
  • Limited support for non-POSIX systems
  • May require elevated privileges depending on system configuration