fujiapple852 / trippy Goto Github PK
View Code? Open in Web Editor NEWA network diagnostic tool
Home Page: https://trippy.cli.rs
License: Apache License 2.0
A network diagnostic tool
Home Page: https://trippy.cli.rs
License: Apache License 2.0
Support tracing by sending UDP
packets instead of ICMP
EchoRequest
packets.
See discussion in crossterm-rs/crossterm#660
Enable support for Trippy on Windows.
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)
The Tracer
is generic over the Network
trait to abstract it from the underlying pnet
implementation. We can use mockall to test the Tracer
with a dummy Network
implementation.
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 |
When the round ends due to timeout on max_round_duration
without finding the target, only the Probe
which responded are published and so the statistics for all other Probe
in the round are not updated. Notably, this includes the sent
count and so this leads to a "tearing" effect whereby the sent
count is not consistent for all hops in the trace.
For UDP
tracing there is not trace_identifier
and so we need a way to distinguish between separate traces.
Switch to use TransportChannelType::Layer3
to allow adjusting various IPv4 header parameters.
Assumption is that the Tui is registering and handling SIGINT
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.
The non-system DNS resolver includes a period (.
) suffix on resolved hostnames whereas the system DNS resolver does not.
Support tracing to multiple targets in a single Trippy instance (ICMP only, Tui only).
system-wise unique identifier for each trace (see #123)
Multi-trace for UDP (see #121)
Multi-trace for TCP (see #122)
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).
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.
Which shells? Can be automated with clap.
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.
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.
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
Currently, for TCP
probing, the source port is fixed and the target ports rotations (to track the sequence). The default for TCP
should be the reverse.
Depends on #43
Support for tracing with the IPv6
protocol.
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 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.
Generate deb
packages on release using cargo-deb
or similar
Tracking issue for ICMP Extensions.
Add support for generic Ipv4 & Ipv6 ICMP extensions, with specific parsing for:
When a hop has multiple associated ip address, show only the top N most frequent.
Support the ability to lookup AS
information.
dig 1.2.3.4.origin.asn.cymru.com TXT +short
Support for POSIX & Linux capacities to allow running without super-user privileges
A regression from #104
Trippy needs a logo, help needed!
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
aka ToS
Use https://docs.rs/nix/latest/nix/ifaddrs/fn.getifaddrs.html
See net_find_interface_address_from_name
in net.c
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)
Currently, AS lookup is only supported when using the trust_dns_resolver
.
See #34 for the current implementation.
Support tracing by sending TCP
packets instead of ICMP
EchoRequest
packets.
A caching DNS & reverse-DNS resolver which does not block the application during lookup.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.