Skip to content

Add Traceroute functionality for network path analysis #39

@servak

Description

@servak

Summary

Add traceroute functionality as an extended feature to enable network path analysis and hop-by-hop monitoring for network engineers.

Motivation

Traceroute functionality is valuable for network engineers to:

  • Analyze network paths and routing
  • Identify network bottlenecks and failures
  • Monitor hop-by-hop latency
  • Troubleshoot routing issues
  • Perform network topology discovery

Proposed Implementation

Target Format

mping traceroute://google.com         # IPv4 traceroute
mping traceroute://2001:4860:4860::8888  # IPv6 traceroute
mping trace://example.com             # Short alias

Features

  • Hop-by-hop network path discovery
  • RTT measurement for each hop
  • Support for both IPv4 and IPv6
  • Configurable maximum hop count
  • Timeout handling per hop
  • Integration with existing TUI display (extended view)

Technical Requirements

  • Implement TracerouteProber following existing Prober interface
  • Add TracerouteConfig for traceroute-specific configuration
  • Use ICMP/UDP packets with incrementing TTL
  • Handle ICMP Time Exceeded responses
  • Integrate with existing event system (may need extension for hop data)
  • Add configuration options in YAML config file

Configuration Example

prober:
  traceroute:
    probe: traceroute
    traceroute:
      max_hops: 30           # Maximum hop count
      timeout: 5000ms        # Timeout per hop
      queries_per_hop: 3     # Number of queries per hop
      use_udp: false         # Use UDP instead of ICMP
      start_port: 33434      # Starting UDP port (if UDP mode)

UI Considerations

  • Extended TUI view to show hop-by-hop information
  • Possibly separate view mode or expanded display
  • Show hop number, IP address, hostname (if resolvable), and RTT
  • Handle multiple RTT values per hop

Acceptance Criteria

  • Traceroute queries can discover network path
  • RTT is measured for each hop
  • Maximum hop limit is configurable
  • Timeout handling works for unresponsive hops
  • Both IPv4 and IPv6 are supported
  • Integration with TUI (possibly extended view)
  • Configuration is properly loaded from YAML
  • Unit tests are implemented
  • Documentation is updated

Implementation Notes

  • This is a more complex feature than other probes
  • May require UI modifications to display hop information
  • Consider whether this fits the current mping architecture
  • Might be better as a separate mode or view
  • Need to handle privileged operations (raw sockets)

Priority

Low - Advanced feature that extends beyond basic monitoring to network analysis.

Technical Considerations

  • Requires raw socket capabilities (similar to ICMP)
  • May need special handling in TUI for multi-hop display
  • Consider if this should be a separate command or mode
  • Performance impact of multiple concurrent traceroutes

Alternative Approach

Consider implementing this as a separate subcommand:

mping trace google.com    # Dedicated traceroute command

Rather than integrating into the main probe system.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions