GithubHelp home page GithubHelp logo

fujiapple852 / trippy Goto Github PK

View Code? Open in Web Editor NEW
3.0K 3.0K 62.0 16.57 MB

A network diagnostic tool

Home Page: https://trippy.cli.rs

License: Apache License 2.0

Rust 98.87% Dockerfile 0.06% Roff 1.07%
cli command-line-interface command-line-tool dns freebsd icmp linux macos mtr netbsd network networking ping rust rustlang tool traceroute tui tui-rs windows

trippy's People

Contributors

0323pin avatar c-git avatar dependabot[bot] avatar fujiapple852 avatar kianmeng avatar marwanmhks avatar omaratefthabet avatar rtzoeller avatar trkelly23 avatar utkarshgupta137 avatar zarkdav avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

trippy's Issues

Multi-trace

Support tracing to multiple targets in a single Trippy instance (ICMP only, Tui only).

Status

  • Add tabs to the Tui
  • Run multiple backends (one per thread, each with own sockets)
  • Enforce only a single target for non-tui modes
  • Enforce ICMP protocol only
  • Support for ICMP

Follow up

system-wise unique identifier for each trace (see #123)
Multi-trace for UDP (see #121)
Multi-trace for TCP (see #122)

Round end reason indicator

When a round is complete and published it should include an indicator of why the round is complete (i.e. we found the target or we timed out)

Add support for `--unprivileged` mode (MacOS only)

See for background.

The full set of ICMP sockets to support:

Family Direction Tracer Socket Field
IPv4 Both ICMP socket(AF_INET, SOCK_DGRAM, IPPROTO_ICMP) ip4_txrx_icmp_socket
IPv4 Both UDP socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP) ip4_txrx_udp_socket
IPv6 Both ICMP socket(AF_INET6, SOCK_DGRAM, IPPROTO_ICMPV6) ip6_txrx_icmp_socket
IPv6 Both UDP socket(AF_INET6, SOCK_DGRAM, IPPROTO_UDP) ip6_txrx_udp_socket

Raw streaming mode

Add a raw streaming mode, similar to the existing stream mode but showing the raw output of each Probe, not waiting until a round is complete to publish. Unclear why this is useful however.

Multi-trace for UDP

For UDP tracing there is not trace_identifier and so we need a way to distinguish between separate traces.

Centre frequency% chart around the highest frequency

Currently, the frequency% barchart shows the first N round-trip-time (depending on screen width) and so can exclude the largest frequencies if they happen to be higher than can be displayed. It would be better to centre around the highest frequency

Allow configuring max sample count

Currently the sample count, which is used to display the sample history and frequency histogram, is hardcoded. This chane is to expose the max sample count as a configuration option.

ICMP Extensions

Tracking issue for ICMP Extensions.

Add support for generic Ipv4 & Ipv6 ICMP extensions, with specific parsing for:

  • #751
  • #753
  • Add support for Interface Information ICMP Extension Object
  • Add support for Interface Identification ICMP Extension Object
  • Add support for Extended Information ICMP Extension Object
  • Add additional tests for non-compliant ICMP Extension Object cases
  • #752
  • #807
  • #806
  • #804
  • Add support for IPv6 Extensions in splitter

Remove circular buffer

The Tracer uses a circular buffer to track the state of all Probe in-flight. To access a Probe in this buffer, the index is calculated as sequence number of the probe modulo the buffer size.

Whilst this works, it has the draw back that the probes for a given round may wrap around the buffer and therefore must be processed with an Iterator rather than a slice.

This changes the logic to index into the buffer using sequence - round_sequence (i.e. the sequence number - the initial sequence number of the round).

Therefore the buffer access will always start from 0 in every round and will never wrap around as the buffer size is the same as the maximum ttl allowed.

Calculate and display Jitter

Trippy current calculates the StDev column as:

pub fn stddev_ms(&self) -> f64 {
    if self.total_recv > 1 {
        (self.m2 / (self.total_recv - 1) as f64).sqrt()
    } else {
        0_f64
    }
}

Where, for each successful Probe (for a given hop ttl), the total_recv, mean and m2 values are updated as follows:

let dur = probe.duration();
let dur_ms = dur.as_secs_f64() * 1000_f64;
hop.total_recv += 1;
hop.mean += (dur_ms - hop.mean) / hop.total_recv as f64;
hop.m2 += (dur_ms - hop.mean) * (dur_ms - hop.mean);

We would like to add support for a Jitter columns similar to those provided by mtr (see https://networkengineering.stackexchange.com/questions/5288/what-is-interarrival-jitter-in-mtr)

`TCP` checksum not set

When sending TCP packets the checksum is not being set which results in the packets being dropped by routers.

Trippy currently uses pnet layer4 and to set the checksum we need to know both the destination and source IP address. We need to obtain the source IP address using the technique described in datalink::interfaces, but as the documentation notes:

is not guaranteed to work on each system

Later, Trippy will move to use layer3 or layer2 channels (#46) and the source interface can be chosen explicitly (#42).

Note that for UDP we deliberately do not set the checksum as, in some configurations, the checksum is used as to track the sequence number (MTR behaviour).

Better error handling for unknown hosts

Currently, when asked to trace to an unknown host, trippy produces an unhelpful error on startup.

System DNS resolver:

Error: failed to lookup address information: nodename nor servname provided, or not known

Other DNS resolvers:

Error: no record found for name: dffghfghf. type: AAAA class: IN

Show Hop Host Details

Currently Trippy can retrieve more information about the AS than it displays. In particular, the AS name is not shown.

Add a new Tui feature where we show a multiline display per hop showing the various data about the hop (ip, hostname, ASN, AS Name and other associated fields) for the currently selected hop.

Moreover, Trippy can limit the number of hosts shown per hop, as the display can become unwieldily when there are many hosts to display per hop. This provide an alternative display mode where only one host is shown per hop, but users can navigate between hosts for a hop using new key bindings.

Adjustable `UDP`/`TCP` source & target ports

Switch to use socket2 for TCP and UDP:

Then allow for fixing either the source OR the destination port for both TCP and UDP tracing,

We do not currently allow fixing both source and destination ports, which is possible if we use use IP header checksum to hold the sequence.

Set `TCP` options

TCP options being set by mtr, as sen by Wireshark:

    Options: (24 bytes), Maximum segment size, No-Operation (NOP), Window scale, No-Operation (NOP), No-Operation (NOP), Timestamps, SACK permitted, End of Option List (EOL)
        TCP Option - Maximum segment size: 1460 bytes
        TCP Option - No-Operation (NOP)
        TCP Option - Window scale: 6 (multiply by 64)
        TCP Option - No-Operation (NOP)
        TCP Option - No-Operation (NOP)
        TCP Option - Timestamps: TSval 2619510293, TSecr 0
        TCP Option - SACK permitted
        TCP Option - End of Option List (EOL)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.