A network diagnostic tool, inspired by mtr.
Trippy combines the functionality of traceroute and ping and is designed to assist with the diagnosis of network issues.
ICMP
, UDP
& TCP
IPv4
& IPv6
TCP
& UDP
)classic
, paris
and dublin
)TOS
(aka DSCP + ECN
)8.8.8.8
or Cloudflare 1.1.1.1
) or custom resolverjson
, csv
& tabular (pretty-printed and markdown)shell
cargo install trippy
shell
brew install trippy
shell
pkgin install trippy
shell
pacman -S trippy
shell
snap install trippy
shell
docker run -it fujiapple/trippy
Trippy has been (lightly...) tested on the following platforms:
| Platform | ICMP | UDP | TCP | Notes | |----------|------|-----|-----|---------------------------------------------------------------| | Linux | ✅ | ✅ | ✅ | | | macOS | ✅ | ✅ | ✅ | | | NetBSD | ✅ | ✅ | ✅ | | | OpenBSD | ⏳ | ⏳ | ⏳ | See #213 | | FreeBSD | ⏳ | ⏳ | ⏳ | See #214 | | Windows | ✅ | ✅ | ✅ | See #98 |
| Platform | ICMP | UDP | TCP | Notes | |----------|------|-----|-----|---------------------------------------------------------------| | Linux | ✅ | ✅ | ✅ | | | macOS | ✅ | ✅ | ✅ | | | NetBSD | ✅ | ✅ | ✅ | | | OpenBSD | ⏳ | ⏳ | ⏳ | See #213 | | FreeBSD | ⏳ | ⏳ | ⏳ | See #214 | | Windows | ✅ | ✅ | ✅ | See #98 |
Support for Equal Cost Multi-path Routing strategies are shown in the following table (see the tracking issue):
| Strategy | Family | Protocol | Status | |----------|-------------|-----------|--------| | Classic | IPv4 / IPv6 | UDP / TCP | ✅ | | Paris | IPv4 / IPv6 | UDP / TCP | ❌ | | Dublin | IPv4 | UDP | ✅ | | Dublin | IPv4 | TCP | ❌ | | Dublin | IPv6 | UDP / TCP | ❌ |
Trippy uses a raw socket which require elevated privileges. Enabling the required privilege can be achieved in several ways, including:
1: Run as root
user via sudo
:
shell
sudo trip www.bitwizard.nl
2: chown
trip
as the root
user and set the setuid
bit:
shell
sudo chown root $(which trip) && sudo chmod +s $(which trip)
3: [Linux only] Set the CAP_NET_RAW
capability:
shell
sudo setcap CAP_NET_RAW+p $(which trip)
Trippy is a capability aware application and will add CAP_NET_RAW
to the effective set if it is present in the allowed
set. Note that trippy will drop all capabilities after creating the raw socket.
Basic usage with default parameters:
shell
trip www.bitwizard.nl
Trace using the udp
(or tcp
or icmp
) protocol (also aliases --udp
& --tcp
):
shell
trip www.bitwizard.nl -p udp
Trace to multiple targets simultaneously (icmp
protocol only,
see #72):
shell
trip www.bitwizard.nl google.com crates.io
Trace with a minimum round time of 250ms
and a grace period of 50ms
:
shell
trip www.bitwizard.nl -i 250ms -g 50ms
Trace with a custom first and maximum time-to-live
:
shell
trip www.bitwizard.nl --first-ttl 2 --max-ttl 10
Use custom destination port 443
for tcp
tracing:
shell
trip www.bitwizard.nl -p tcp -P 443
Use custom source port 5000
for udp
tracing:
shell
trip www.bitwizard.nl -p udp -S 5000
Use the dublin
Equal Cost Multi-path Routing strategy for udp
with fixed source and destination ports:
shell
trip www.bitwizard.nl -p udp -R dublin -S 5000 -P 3500
Trace with a custom source address:
shell
trip www.bitwizard.nl -p tcp -A 127.0.0.1
Trace with a source address determined by the IPv4 address for interface en0
:
shell
trip www.bitwizard.nl -p tcp -I en0
Trace using IPv6
:
shell
trip www.bitwizard.nl -6
Generate a json
(or csv
, pretty
, markdown
) tracing report with 5 rounds of data:
shell
trip www.bitwizard.nl -m json -c 5
Perform DNS queries using the google
DNS resolver (or cloudflare
, system
, resolv
):
shell
trip www.bitwizard.nl -r google
Lookup AS information for all discovered IP addresses (not yet available for the system
resolver,
see #66):
shell
trip www.bitwizard.nl -r google -z
Customize the color theme:
shell
trip www.bitwizard.nl --tui-theme-colors bg-color=blue,text-color=ffff00
List all Tui items that can have a custom color theme:
shell
trip www.bitwizard.nl --print-tui-theme-items
Customize the key bindings:
shell
trip www.bitwizard.nl --tui-key-bindings previous-hop=k,next-hop=j,quit=shift-q
List all Tui commands that can have a custo key binding:
shell
trip www.bitwizard.nl --print-tui-binding-commands
```shell
Usage: trip [OPTIONS]
Arguments:
Options:
-m, --mode
-p, --protocol
--udp
Trace using the UDP protocol
--tcp
Trace using the TCP protocol
-4, --ipv4 use IPv4 only
-6, --ipv6 Use IPv6 only
-P, --target-port
-S, --source-port
-A, --source-address
-I, --interface
-i, --min-round-duration
-T, --max-round-duration
--initial-sequence <INITIAL_SEQUENCE>
The initial sequence number [default: 33000]
-R, --multipath-strategy
-g, --grace-duration
-U, --max-inflight
-f, --first-ttl
-t, --max-ttl
--packet-size <PACKET_SIZE>
The size of IP packet to send (IP header + ICMP header + payload) [default:
84]
--payload-pattern <PAYLOAD_PATTERN>
The repeating pattern in the payload of the ICMP packet [default: 0]
-Q, --tos
--read-timeout <READ_TIMEOUT>
The socket read timeout [default: 10ms]
-r, --dns-resolve-method
--dns-timeout <DNS_TIMEOUT>
The maximum time to wait to perform DNS queries [default: 5s]
-z, --dns-lookup-as-info Lookup autonomous system (AS) information during DNS queries
-a, --tui-address-mode
-M, --tui-max-addrs
-s, --tui-max-samples
--tui-preserve-screen
Preserve the screen on exit
--tui-refresh-rate <TUI_REFRESH_RATE>
The TUI refresh rate [default: 100ms]
--tui-theme-colors <TUI_THEME_COLORS>
The TUI theme colors [item=color,item=color,..]
--print-tui-theme-items
Print all TUI theme items and exit
--tui-key-bindings <TUI_KEY_BINDINGS>
The TUI key bindings [command=key,command=key,..]
--print-tui-binding-commands
Print all TUI commands that can be bound and exit
-c, --report-cycles
-h, --help Print help (see more with '--help')
-V, --version Print version ```
The following table lists the default Tui color theme. These can be overridden with the --tui-theme-colors
command
line option.
| Item | Description | Default |
|--------------------------------------|------------------------------------------------------|------------|
| bg-color
| The default background color | Black
|
| border-color
| The default color of borders | Gray
|
| text-color
| The default color of text | Gray
|
| tab-text-color
| The color of the text in traces tabs | Green
|
| hops-table-header-bg-color
| The background color of the hops table header | White
|
| hops-table-header-text-color
| The color of text in the hops table header | Black
|
| hops-table-row-active-text-color
| The color of text of active rows in the hops table | Gray
|
| hops-table-row-inactive-text-color
| The color of text of inactive rows in the hops table | DarkGray
|
| hops-chart-selected-color
| The color of the selected series in the hops chart | Green
|
| hops-chart-unselected-color
| The color of the unselected series in the hops chart | Gray
|
| hops-chart-axis-color
| The color of the axis in the hops chart | DarkGray
|
| frequency-chart-bar-color
| The color of bars in the frequency chart | Green
|
| frequency-chart-text-color
| The color of text in the bars of the frequency chart | Gray
|
| samples-chart-color
| The color of the samples chart | Yellow
|
| help-dialog-bg-color
| The background color of the help dialog | Blue
|
| help-dialog-text-color
| The color of the text in the help dialog | Gray
|
The supported colors are:
Black
, Red
, Green
, Yellow
, Blue
, Magenta
, Cyan
, Gray
, DarkGray
, LightRed
, LightGreen
, LightYellow
, LightBlue
, LightMagenta
, LightCyan
, White
Color names are case insensitive and may contain dashes. Raw hex values, such as ffffff
for white, may also be used.
The following table lists the default Tui command key bindings. These can be overridden with the --tui-key-bindings
command line option.
| Command | Description | Default |
|----------------------|-------------------------------------------------|----------|
| toggle-help
| Toggle help | h
|
| next-hop
| Select next hop | down
|
| previous-hop
| Select previous hop | up
|
| next-trace
| Select next trace | right
|
| previous-trace
| Select previous trace | left
|
| address-mode-ip
| Show IP address only | i
|
| address-mode-host
| Show hostname only | n
|
| address-mode-both
| Show both IP address and hostname | b
|
| toggle-freeze
| Toggle freezing the display | f
|
| toggle-chart
| Toggle the chart | c
|
| expand-hosts
| Expand the hosts shown per hop | ]
|
| expand-hosts-max
| Expand the hosts shown per hop to the maximum | }
|
| contract-hosts
| Contract the hosts shown per hop | [
|
| contract-hosts-min
| Contract the hosts shown per hop to the minimum | {
|
| chart-zoom-in
| Zoom in the chart | =
|
| chart-zoom-out
| Zoom out the chart | -
|
| clear-trace-data
| Clear all trace data | ctrl-r
|
| clear-dns-cache
| Flash the DNS cache | ctrl-k
|
| clear-selection
| Clear the current selection | esc
|
| toggle-as-info
| Toggle AS info display | z
|
| quit
| Quit the application | q
|
The supported modifiers are: shift
, ctrl
, alt
, super
, hyper
& meta
. Multiple modifiers may be specified, for
example ctrl-shift-b
.
Trippy is made possible by tui-rs, crossterm as well as several foundational Rust libraries.
Trippy draws heavily from mtr and also incorporates ideas from both libparistraceroute & Dublin Traceroute.
The Trippy networking code is inspired by pnet and some elements of that codebase are incorporated in Trippy.
The AS data is retrieved from the IP to ASN Mapping Service provided by Team Cymru.
The trippy.cli.rs CNAME hosting is provided by cli.rs.
This project is distributed under the terms of the Apache License (Version 2.0).
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in time by you, as defined in the Apache-2.0 license, shall be licensed as above, without any additional terms or conditions.
See LICENSE for details.
Copyright 2022 Trippy Contributors