TRACEPATH(8)

๐Ÿ“ฆ
this version ยท 6 versions
, in alpine 3.24, arch rolling, fedora 43, fedora 44, nixpkgs unstable, ubuntu resolute, ubuntu stonking

๐Ÿ’– TRACEPATH ๐Ÿ’–

okay bestie, buckle up, this is tracepath, living in the iputils corner of your system, section 8 of the manual (that's the admin-ish section, iykyk).

โœจ NAME โœจ

tracepath โ€” traces path to a network host discovering MTU along this path ๐Ÿ›ฐ๏ธ


๐ŸŒธ SYNOPSIS ๐ŸŒธ

tracepath [-4] [-6] [-n] [-b] [-l pktlen] [-m max_hops] [-p port] [-V]
          {destination}

๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

So like, what does it do? It traces the network path to destination, discovering the MTU along this path. That's the whole vibe. ๐Ÿซถ

It uses UDP port port, or some random port if you don't say. It's similar to traceroute, except โ€” and this is the iconic part โ€” it does not require superuser privileges, and it has no fancy options. Low maintenance queen. ๐Ÿ’…

tracepath -6 is a good replacement for traceroute6 and is a classic example of application of Linux error queues. The situation with IPv4 is worse, because commercial IP routers do not return enough information in ICMP error messages. Probably, it will change, when they are updated. For now it uses Van Jacobson's trick, sweeping a range of UDP ports to maintain trace history. Not me explaining ancient router lore at 2am ๐Ÿ˜ญ but here we are.


๐ŸŽ€ OPTIONS ๐ŸŽ€

  • -4 โ€” Use IPv4 only.
  • -6 โ€” Use IPv6 only.
  • -n โ€” Print primarily IP addresses numerically. no names, just digits, we stay mysterious โœจ
  • -b โ€” Print both: Host names and IP addresses. best of both worlds, main character behaviour fr fr
  • -l โ€” Sets the initial packet length to pktlen instead of 65535 for IPv4 or 128000 for IPv6.
  • -m โ€” Set maximum hops (or maximum TTLs) to max_hops instead of 30.
  • -p โ€” Sets the initial destination port to use.
  • -V โ€” Print version and exit. short and sweet, we love a swift goodbye ๐Ÿ’œ

๐Ÿ”ฅ OUTPUT ๐Ÿ”ฅ

here's what it actually looks like, obsessed honestly:

root@mops:~ # tracepath -6 3ffe:2400:0:109::2
 1?: [LOCALHOST]                              pmtu 1500
 1:  dust.inr.ac.ru                   0.411ms
 2:  dust.inr.ac.ru        asymm  1   0.390ms pmtu 1480
 2:  3ffe:2400:0:109::2               463.514ms reached
     Resume: pmtu 1480 hops 2 back 2

Let's decode this masterpiece column by column:

  • The first column shows the TTL of the probe, followed by a colon. Usually the value of TTL is obtained from the reply from the network, but sometimes it does not contain the necessary information and we have to guess it. In this case the number is followed by ?. guessing era ๐Ÿ˜ญ
  • The second column shows the network hop which replied to the probe. It is either the address of the router or the word [LOCALHOST], if the probe was not sent to the network. hi localhost, love u ๐Ÿ 
  • The rest of the line shows miscellaneous information about the path to the corresponding network hop. It contains the value of RTT, and additionally it can show Path MTU when it changes. If the path is asymmetric or the probe finishes before it reaches the prescribed hop, the number of hops in return direction is shown next to the keyword asymm. This information is not reliable โ€” e.g. the third line shows asymmetry of 1. This is because the first probe with TTL of 2 was rejected at the first hop due to Path MTU Discovery.

The last line summarizes information about all the paths to the destination. It shows detected Path MTU, amount of hops to the destination and our guess about the number of hops from the destination to us, which can be different when the path is asymmetric. the grand finale ๐ŸŒˆ


๐Ÿ’€ HANDLING ERRORS ๐Ÿ’€

In case of errors tracepath prints short error code. here's the whole roster, no skips:

  • !A โ€” code EACCES โ€” Communication administratively prohibited
  • !H โ€” code EHOSTUNREACH โ€” Destination host unreachable
  • !N โ€” code ENETUNREACH โ€” Destination network unreachable
  • !P โ€” code EPROTO โ€” Destination protocol unreachable
  • pmtu N โ€” code EMSGSIZE โ€” Message too long
  • reached โ€” code ECONNREFUSED โ€” Connection refused
  • (no output) โ€” code ETIMEDOUT โ€” Connection timed out
  • NET ERROR N โ€” (no code) โ€” Any other error
not the error codes serving looks while your packets are literally lost ๐Ÿ’€ but at least they're short and readable, periodt.

๐Ÿงš SEE ALSO ๐Ÿงš

traceroute(8), traceroute6(8), ping(8).

๐Ÿ‘‘ AUTHOR ๐Ÿ‘‘

tracepath was written by Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>. thank you king ๐Ÿซก

๐Ÿ“ SECURITY ๐Ÿ“

No security issues.

This lapidary deserves to be elaborated. tracepath is not a privileged program, unlike traceroute, ping and other beasts of their kind. tracepath may be executed by everyone who has enough access to the network to send UDP datagrams to the desired destination using the given port. no root, no gatekeeping, we love accessibility ๐Ÿ’–

๐ŸŒŸ AVAILABILITY ๐ŸŒŸ

tracepath is part of iputils package.


okay that's the whole page bestie, and if you need the receipts: this is from iputils, version 20250605, and it's the TRACEPATH(8) page โ€” so go forth and trace some paths, you got this ๐Ÿฆ‹โœจ๐Ÿ’…

๐Ÿ“ฆ where this page comes from