Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

trippy 0.9.0 #156013

Merged
merged 2 commits into from
Nov 30, 2023
Merged

trippy 0.9.0 #156013

merged 2 commits into from
Nov 30, 2023

Conversation

chenrui333
Copy link
Member

Created by brew bump


Created with brew bump-formula-pr.

release notes
## Highlights

Trippy 0.9.0 introduces many new features, including tracing flows and ICMP extensions, the expansion of support for the Paris tracing strategy to encompass IPv6/UDP, an unprivileged execution mode for macOS, a hop privacy mode and many more. Additionally, this release includes several important bug fixes along with a range of new distribution packages.

Tracing Flows

Flow Id

A tracing flow represents the sequence of hosts traversed from the source to the target. Trippy is now able to identify individual flows within a trace and assign each a unique flow id. Trippy calculate a flow id for each round of tracing, based on the sequence of hosts which responded during that round, taking care to account for rounds in which only a subset of hosts responded. Tracing statistics, such as packet loss % and average RTT are recorded on a per-flow basis as well as being aggregated across all flow.

Tracing flows adds to the existing capabilities provided by Trippy to assist with ECMP (Equal-Cost Multi-Path Routing) when tracing with UDP and TCP protocols. Some of these capabilities, such as the paris and dublin tracing strategies, are designed to restrict tracing to a single flow, whilst others, such as the hop detail navigation mode (introduce in the last release) and tracing flows, are designed to help visualize tracing data in the presence of multiple flows. See the 0.8.0 release note for other such capabilities.

Tracing Flows in the TUI

The TUI has been enhanced with a new mode to help visualise flows. This can be toggled on and off with the toggle-flows command (bound to the f key by default).

When toggled on, this mode display flow information as a chart in a new panel above the hops table. Flows can be selected by using the left and right arrow keys (default key bindings). Flows are sorted by the number of rounds in which a given flow id was observed, with the most frequent flow ids shown on the left. When entering this mode flow id 1 is selected automatically. The selected flow acts as a filter for the other parts of the TUI, including the hops table, chart and maps views which only show data relevant to that specific flow.

flows

When toggled off, Trippy behaves as it did in previous versions where aggregated statistics (across all flows) are shown. Note that per-flow data is always recorded, the toggle only influences how the data is displayed.

The number of flows visible in the TUI is limited and can be controlled by the tui-max-flows configuration items which can be set via the command line or via the configuration file. By default up to 64 flows are shown.

The flows panel, as with all other parts of the TUI, can also be themed, see the theme reference for details.

Flow Reports

As well as visualising flows in the TUI, Trippy 0.9.0 introduces two new reports which make use of the tracing flow data.

The new flows report mode records and print all flows observed during tracing.

The following command will run a TCP trace for 10 round and report all of the flows observed:

trip example.com --tcp -m flows -C 10

Sample output (truncated) showing three unique flows:

flow 1: 192.168.1.1, 10.193.232.245, 218.102.40.38, 10.195.41.9, 172.217.27.14
flow 2: 192.168.1.1, 10.193.232.245, 218.102.40.22, 10.195.41.17, 172.217.27.14
flow 3: 192.168.1.1, 10.193.232.245, 218.102.40.38, 10.195.41.1, 172.217.27.14

Another new report, dot, outputs a GraphViz DOT format chart of all hosts observed during tracing.

The following command will run a TCP trace for 10 round and output a graph of flows in DOT format:

trip example.com --tcp -m dot -C 10

If you have a tool such as dot (Graphviz) installed you can use this to rendered the output in various formats, such as PNG:

trip example.com --tcp -m dot -C 10 | dot -Tpng > path.png

Sample output:

dot

ICMP Extensions

Parsing Extensions

Trippy 0.9.0 adds the ability to parse and display ICMP Multi-Part Messages (aka extensions). It supports both compliant and non-compliant ICMP extensions as defined in section 5 of rfc4884.

Trippy is able to parse and render any generic Extension Object but is also able to parse some well known Object Classes, notably the MPLS class.

Support for additional classes will be added to future versions of Trippy, see the ICMP Extensions tracking issue.

Parsing of ICMP extensions can be enabled by setting the --icmp-extensions (-e) command line flag or by adding the icmp-extensions entry in the strategy section of the configuration file:

[strategy]
icmp-extensions = true

ICMP Extensions in the TUI

The TUI has been enhanced to display ICMP extensions in both the normal and hop detail navigation modes.

In normal mode, ICMP extensions are not shown by default but can be enabled by setting the --tui-icmp-extension-mode command line flag or by adding the tui-icmp-extension-mode entry in the tui section of the configuration file:

[tui]
tui-icmp-extension-mode = "full"

This can be set to off (do not show ICMP extension data), mpls (shows a list of MPLS label(s) per hop), full (shows all details of all extensions, such as ttl, exp and bos for MPLS) or all (the same as full but also shows class, subtype and bytes for unknown extension objects).

The following screenshot shows ICMP extensions in normal mode with tui-icmp-extension-mode set to be mpls:

extensions

In hop detail mode, the full details of all ICMP extension objects are always shown if parsing of ICMP extensions is enabled.

The following screenshot shows ICMP extensions in hop detail mode:

extensions_detail

ICMP Extensions in Reports

ICMP extension information is also included the the json and stream report modes.

Sample output for a single hop from the json report:

{
  "ttl": 14,
  "hosts": [
    {
      "ip": "129.250.3.125",
      "hostname": "ae-4.r25.sttlwa01.us.bb.gin.ntt.net"
    }
  ],
  "extensions": [
    {
      "mpls": {
        "members": [
          {
            "label": 91106,
            "exp": 0,
            "bos": 1,
            "ttl": 1
          }
        ]
      }
    }
  ],
  "loss_pct": "0.00",
  "sent": 1,
  "last": "178.16",
  "recv": 1,
  "avg": "178.16",
  "best": "178.16",
  "worst": "178.16",
  "stddev": "0.00"
}

Paris Tracing Strategy for IPv6/UDP

The work to support the remaining paris and dublin tracing modes continues in this release with the addition of support for the Paris tracing strategy for IPv6/UDP.

As a reminder, unlike classic traceroute and MTR, these alternative tracing strategies do not encode the probe sequence number in either the src or dest port of the UDP or TCP packet, but instead use other protocol and address family specific techniques. Specifically, the Paris tracing strategy for IPv6/UDP utilizes the UDP checksum for this purposes and manipulates the UDP payload to ensure packets remind valid.

By doing so, these strategies are able to keep the src and dest ports fixed which makes it much more likely (though not guaranteed) that each round of tracing will follow the same path through the network (note that this is not true for the return path).

The following command runs a IPv6/UDP trace using the paris tracing strategy with fixed src and dest ports:

trip example.com --udp -6 -R paris -S 5000 -P 3500

Refer to the tracking issue for details of the work remaining to support all ECMP strategies for both UDP and TCP for IPv4 and IPv6.

Unprivileged Mode

Trippy normally requires elevated privileges due to the use of raw sockets. Enabling the required privileges for a given platform can be achieved in several ways as in described the privileges section of the documentation.

This release of Trippy adds the ability to run without elevated privileged on a subset of platforms, but with some limitations which are described below.

The unprivileged mode can be enabled by adding the --unprivileged (-u) command line flag or by adding the unprivileged entry in the trippy section of the configuration file:

[trippy]
unprivileged = true

The following command runs a trace in unprivileged mode:

trip example.com -u

Unprivileged mode is currently only supported on macOS. Linux support is possible and may be added in the future. Unprivileged mode is not supported on NetBSD, OpenBSD, FreeBSD or Windows as these platforms do not support the IPPROTO_ICMP socket type.

Unprivileged mode does not support the paris or dublin tracing strategies as these require raw sockets in order to manipulate the UDP and IP header respectively.

See #101 for further information.

Resolve All DNS

Trippy can be provided with either an IP address or a hostname as the target for tracing. Trippy will resolve hostnames to IP addresses via DNS lookup (using the configured DNS resolver, see the existing --dns-resolve-method flag) and pick an arbitrary IP address from those returned.

Trippy also has the ability to trace to several targets simultaneously (for the ICMP protocol only) and can be provided with a list of IP addresses and hostnames.

Trippy 0.9.0 combined these features and introduces a convenience flag --dns-resolve-all which resolves a given hostname to all IP addresses and will begin to trace to all of them simultaneously.

dns_resolve_all

Hop Privacy

At times it is desirable to share tracing information with others to help with diagnostics of a network problem. These traces can contain sensitive information, such as IP addresses, hostnames and GeoIp details of the internet facing hops. Users often wish to avoid exposing this data and are forced to redact the tracing output or screenshots.

Trippy 0.9.0 adds a new privacy feature, which hides all sensitive information for a configurable number of hops in the hops table, chart and GeoIP world map.

The following screenshot shows the world map view with the sensitive information of some hops hidden:

privacy

The following command will hide all sensitive information for the first 3 hops (ttl 1, 2 & 3) in the TUI:

trip example.com --tui-privacy-max-ttl 3

This can also be made the default behaviour by setting the value in the Trippy configuration file:

[tui]
tui-privacy-max-ttl = 3

From within the TUI the privacy mode can be toggled on and off using the toggle-privacy TUI command (bound to the pkey by default).

Note the toggle is only available if tui-privacy-max-ttl is configured to be non-zero. Privacy mode is entered automatically on startup to avoid any accidental exposure of sensitive data, such as when sharing a screen.

Print Config Template

The 0.8.0 release of Trippy introduced a configuration file and provided a sample configuration file you could download. This release adds a command which generates a configuration template appropriate for the specific version of Trippy.

The following command generates a trippy.toml configuration file with all possible configuration options specified and set to their default values:

trip --print-config-template > trippy.toml

Alternative Help Key Binding

Can't decide whether you want to use h or ? to display help information? Well fear not, Trippy now supports an toggle-help-alt TUI command (bound to the ? key by default) in additional to the existing toggle-help TUI command (bound to the h key by default).

Improvements to Report

This release fixes a bug that prevented reverse DNS lookup from working in all reporting modes.

The list of IPs associated with a given hop have also been added to the csv and all tabular reports. ICMP extension data has also been included in several reports.

Note that these are breaking change as the output of the reports has changed.

New Binary Asset Downloads

The list of operating systems, CPU architectures and environments which have pre-build binary assets available for download has been greatly expanded for the 0.9.0 release.

This includes assets for Linux, macOS, Windows, NetBSD and FreeBSD. Assets are available for x86_64, aarch64 and arm7 and includes builds for various environments such as gnu and musl where appropriate. There are also pre-build RPM and deb downloads available. See the Binary Asset Download section for a full list.

Note that Trippy 0.9.0 has only been tested on a small subset of these platforms.

New Distribution Packages

Since the last release Trippy has been added as an official WinGet package (kudos to @mdanish-kh and @BrandonWanHuanSheng!) and can be installed as follows:

winget install trippy

Trippy has also been added to the scoop Main bucket (thanks to @StarsbySea!) and can be installed as follows:

scoop install trippy

You can find the full list of distributions in the documentation.

Thanks

My thanks to all Trippy contributors, package maintainers and community members.

Feel free to drop by the Trippy Matrix room for a chat:

#trippy-dev:matrix.org

Happy Tracing!

New Contributors

Change Log

Added

  • Added support for tracing flows (#776)
  • Added support for icmp extensions (#33)
  • Added support for MPLS label stack class icmp extension objects (#753)
  • Added support for paris ECMP routing for IPv6/udp (#749)
  • Added --unprivileged (-u) flag to allow tracing without elevated privileges (macOS only) (#101)
  • Added --tui-privacy-max-ttl flag to hide host and IP details for low ttl hops (#766)
  • Added toggle-privacy (default: p) key binding to show or hide private hops (#823)
  • Added toggle-flows (default: f) key binding to show or hide tracing flows (#777)
  • Added --dns-resolve-all (-y) flag to allow tracing to all IPs resolved from DNS lookup entry (#743)
  • Added dot report mode (-m dot) to output hop graph in Graphviz DOT format (#582)
  • Added flows report mode (-m flows) to output a list of all unique tracing flows (#770)
  • Added --icmp-extensions (-e) flag for parsing IPv4/IPv6 icmp extensions (#751)
  • Added --tui-icmp-extension-mode flag to control how icmp extensions are rendered (#752)
  • Added --print-config-template flag to output a template config file (#792)
  • Added --icmp flag as a shortcut for --protocol icmp (#649)
  • Added toggle-help-alt (default: ?) key binding to show or hide help (#694)
  • Added panic handing to Tui (#784)
  • Added official Windows scoop package (#462)
  • Added official Windows winget package (#460)
  • Release musl Debian deb binary asset (#568)
  • Release armv7 Linux binary assets (#712)
  • Release aarch64-apple-darwin (aka macOS Apple Silicon) binary assets (#801)
  • Added additional Rust Tier 1 and Tier 2 binary assets (#811)

Changed

  • [BREAKING CHANGE] icmp extension object data added to json and stream reports (#806)
  • [BREAKING CHANGE] IPs field added to csv and all tabular reports (#597)
  • [BREAKING CHANGE] Command line flags --dns-lookup-as-info and --tui-preserve-screen no longer require a boolean argument (#708)
  • [BREAKING CHANGE] Default key binding for ToggleFreeze changed from f to ctrl+f (#785)
  • Always render AS lines in hop details mode (#825)
  • Expose DNS resolver module as part of trippy library (#754)
  • Replaced unmaintained tui-rs crate with ratatui crate (#569)

Fixed

  • Reverse DNS lookup not working in reports (#509)
  • Crash on NetBSD during window resizing (#276)
  • Protocol mismatch causes tracer panic (#745)
  • Incorrect row height in Tui hop detail navigation view for hops with no
    responses (#765)
  • Unnecessary socket creation in certain tracing modes (#647)
  • Incorrect byte order in IPv4 packet length calculation (#686)

See CHANGELOG.md for details.

Full Changelog: fujiapple852/trippy@0.8.0...0.9.0

@github-actions github-actions bot added rust Rust use is a significant feature of the PR or issue bump-formula-pr PR was created using `brew bump-formula-pr` labels Nov 30, 2023
@chenrui333
Copy link
Member Author

==> /opt/homebrew/Cellar/trippy/0.9.0/bin/trip brew.sh 2>&1
  Error: privileges are required (hint: try adding -u to run in unprivileged mode)
  
  see https://github.com/fujiapple8[52](https://github.com/Homebrew/homebrew-core/actions/runs/7049584820/job/19188564370?pr=156013#step:3:53)/trippy#privileges for details
  Error: trippy: failed
  An exception occurred within a child process:
    Minitest::Assertion: Expected: 2[55](https://github.com/Homebrew/homebrew-core/actions/runs/7049584820/job/19188564370?pr=156013#step:3:56)
    Actual: 1

@chenrui333 chenrui333 added the CI-no-fail-fast Continue CI tests despite failing GitHub Actions matrix builds. label Nov 30, 2023
trippy: update test

Signed-off-by: Rui Chen <[email protected]>
@chenrui333 chenrui333 added ready to merge PR can be merged once CI is green and removed CI-no-fail-fast Continue CI tests despite failing GitHub Actions matrix builds. labels Nov 30, 2023
Copy link
Contributor

🤖 An automated task has requested bottles to be published to this PR.

@github-actions github-actions bot added the CI-published-bottle-commits The commits for the built bottles have been pushed to the PR branch. label Nov 30, 2023
@BrewTestBot BrewTestBot added this pull request to the merge queue Nov 30, 2023
Merged via the queue into Homebrew:master with commit ccd70ca Nov 30, 2023
12 checks passed
@github-actions github-actions bot added the outdated PR was locked due to age label Dec 31, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 31, 2023
@chenrui333 chenrui333 deleted the bump-trippy-0.9.0 branch January 22, 2024 18:01
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bump-formula-pr PR was created using `brew bump-formula-pr` CI-published-bottle-commits The commits for the built bottles have been pushed to the PR branch. outdated PR was locked due to age ready to merge PR can be merged once CI is green rust Rust use is a significant feature of the PR or issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants