TRACEPATH(8)

๐Ÿ“ฆ
this version ยท 3 versions
, in centos-stream 10, opensuse-leap 16.0

๐Ÿฆ‹ NAME ๐Ÿฆ‹

okay so tracepath is literally the tool that traces the path to a network host while figuring out the MTU along the way ๐Ÿ›ฃ๏ธโœจ fr it's giving "traceroute but make it cute" ๐Ÿ’…


๐ŸŽ€ SYNOPSIS ๐ŸŽ€

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

๐Ÿ’– DESCRIPTION ๐Ÿ’–

bestie, tracepath traces the network path to destination and discovers the MTU along that path ๐Ÿงš it sends UDP probes to port port, or to some random port if you don't pick one ๐ŸŽฒ

it's super similar to traceroute, but the big difference is that you don't need superuser privileges ๐Ÿ™Œ and it has no fancy options, so it's giving simple and iconic energy ๐Ÿ’…

tracepath -6 is a seriously good replacement for traceroute6, and it's a classic example of using Linux error queues ๐Ÿง ๐Ÿ”ฅ IPv4 is kinda messy tho ๐Ÿ˜ญ commercial IP routers don't send back enough info in their ICMP error messages. hopefully that changes once they get updated ๐Ÿ™ for now it uses Van Jacobson's trick, which means sweeping a range of UDP ports so it can keep track of the trace history ๐Ÿฆ‹


๐ŸŒธ OPTIONS ๐ŸŒธ

  • -4 โ€” use IPv4 only, no IPv6 drama ๐Ÿ™…โ€โ™€๏ธ
  • -6 โ€” use IPv6 only ๐Ÿ’œ
  • -n โ€” print IP addresses numerically, so no name lookups โœจ
  • -b โ€” print both host names and IP addresses ๐Ÿ‘‘
  • -l โ€” sets the initial packet length to pktlen instead of the default of 65535 for IPv4 or 128000 for IPv6 ๐Ÿ“ฆ
  • -m โ€” sets the maximum hops (aka max TTLs) to max_hops instead of the default of 30 ๐Ÿ›‘
  • -p โ€” sets the initial destination port to use ๐ŸŽฏ
  • -V โ€” prints the version and exits ๐Ÿท๏ธ

๐Ÿ“Š OUTPUT ๐Ÿ“Š

this is what it looks like when you run it, and it's kinda cute ngl ๐Ÿฅน

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

okay so breaking it down for you ๐Ÿง

the first column is the TTL of the probe, followed by a colon. usually the TTL comes from the reply from the network, but sometimes the reply doesn't have what we need, so we have to guess ๐Ÿ”ฎ when that happens the number gets a ? after it.

the second column is the network hop that replied to the probe. it's either the address of the router, or the word [LOCALHOST] if the probe never actually went out to the network ๐Ÿ 

the rest of the line is misc info about the path to that hop. it has the RTT, and it can also show the Path MTU whenever that changes ๐Ÿ“ if the path is asymmetric, or the probe finishes before reaching the hop you asked for, the number of return hops shows up next to the keyword asymm ๐Ÿ™ˆ this info isn't 100% reliable tho. like, the third line shows an asymmetry of 1, and that's because the first probe with a TTL of 2 got rejected at the first hop because of Path MTU Discovery ๐Ÿ’€

the last line is the summary of all the paths to the destination โœจ it shows the detected Path MTU, the number of hops to the destination, and our guess for the number of hops back from the destination to us. those can be different when the path is asymmetric ๐Ÿฆ‹


๐Ÿšจ HANDLING ERRORS ๐Ÿšจ

so when something goes wrong, tracepath prints a short error code ๐Ÿ˜ญ here's the tea:

  • !A โ€” EACCES โ€” communication administratively prohibited ๐Ÿšซ
  • !H โ€” EHOSTUNREACH โ€” destination host unreachable ๐Ÿฅฒ
  • !N โ€” ENETUNREACH โ€” destination network unreachable ๐ŸŒ
  • !P โ€” EPROTO โ€” destination protocol unreachable ๐Ÿซ 
  • pmtu N โ€” EMSGSIZE โ€” message too long ๐Ÿ“ฆ
  • reached โ€” ECONNREFUSED โ€” connection refused ๐Ÿ™…โ€โ™€๏ธ
  • (no output label) โ€” ETIMEDOUT โ€” connection timed out โฐ
  • NET ERROR N โ€” (no code) โ€” any other error ๐Ÿคทโ€โ™€๏ธ

๐Ÿ”— SEE ALSO ๐Ÿ”—

traceroute(8), traceroute6(8), ping(8) ๐Ÿ’œ


๐Ÿ‘ฉโ€๐Ÿ’ป AUTHOR ๐Ÿ‘ฉโ€๐Ÿ’ป

tracepath was written by Alexey Kuznetsov <kuznet@ms2.inr.ac.ru> ๐Ÿซถ


๐Ÿ”’ SECURITY ๐Ÿ”’

no security issues โœ…

okay but this deserves a little more detail, bestie ๐Ÿ™ˆ tracepath is not a privileged program, unlike traceroute, ping and other beasts of their kind ๐Ÿ’… anyone who has enough network access to send UDP datagrams to the desired destination on the given port can run it ๐ŸŒธ


๐Ÿ“ฆ AVAILABILITY ๐Ÿ“ฆ

tracepath is part of the iputils package ๐ŸŽ€


iputils 20240905 vibes, TRACEPATH(8) forever ๐ŸŒˆโœจ stay curious, stay gorgeous, and keep those MTUs in check bestie ๐Ÿซถ๐Ÿ’–

๐Ÿ“ฆ where this page comes from