traceroute
![]() The traceroute command | |
Original author(s) | Van Jacobson |
---|---|
Initial release | 1987 |
Platform | Unix-like systems |
Type | Command |
Developer(s) | Microsoft, ReactOS Contributors |
---|---|
Platform | Windows, ReactOS |
Type | Command |
License | Microsoft Windows: Proprietary commercial software ReactOS: GNU General Public License |
In computing, traceroute
and tracert
are computer network diagnostic commands for displaying possible routes (paths) and measuring transit delays of packets across an Internet Protocol (IP) network. The history of the route is recorded as the round-trip times of the packets received from each successive host (remote node) in the route (path); the sum of the mean times in each hop is a measure of the total time spent to establish the connection. Traceroute proceeds unless all (usually three) sent packets are lost more than twice; then the connection is lost and the route cannot be evaluated. Ping, on the other hand, only computes the final round-trip times from the destination point.
For Internet Protocol Version 6 (IPv6) the tool sometimes has the name traceroute6
[1] and tracert6
.[2]
Implementations
The command traceroute
is available on many modern operating systems. On Unix-like systems such as FreeBSD, macOS, and Linux it is available as a command line tool. Traceroute is also graphically accessible in macOS within the Network Utilities suite; these utilities have been deprecated since the release of macOS Big Sur.[3]
Microsoft Windows and ReactOS provide a program named tracert
that performs the same route-tracing function. Windows NT-based operating systems also provide PathPing, which combines the functionality of ping with that of tracert. The ReactOS version was developed by Ged Murphy and is licensed under the GPL.[4]
On
On Windows, tracert sends ICMP Echo Request packets, rather than the UDP packets traceroute sends by default.[11]
The
The timestamp values returned for each router along the path are the delay (latency) values, typically measured in milliseconds for each packet.
The sender expects a reply within a specified number of seconds. If a packet is not acknowledged within the expected interval, an asterisk is displayed. The Internet Protocol does not require packets to take the same route towards a particular destination, thus hosts listed might be hosts that other packets have traversed. If the host at hop #N does not reply, the hop is skipped in the output.
If a network has a firewall and operates both Windows and Unix-like systems, more than one protocol must be enabled inbound through the firewall for traceroute to work and receive replies.
Some traceroute implementations use TCP packets, such as tcptraceroute and layer four traceroute (lft). PathPing is a utility introduced with Windows NT that combines ping and traceroute functionality. MTR is an enhanced version of ICMP traceroute available for Unix-like and Windows systems. The various implementations of traceroute all rely on ICMP Time Exceeded (type 11) packets being sent to the source.
On Linux, tracepath is a utility similar to traceroute, with the primary difference of not requiring superuser privileges.[12]
Cisco's implementation of traceroute also uses a sequence of UDP datagrams, each with incrementing TTL values, to an invalid port number at the remote host; by default, UDP port 33434 is used. An extended version of this command (known as the extended traceroute command) can change the destination port number used by the UDP probe messages.[13]
Usage

Most implementations include at least options to specify the number of queries to send per hop, time to wait for a response, the hop limit and port to use. Invoking traceroute with no specified options displays the list of available options, while man traceroute presents more details, including the displayed error flags. An example on Linux:
$ traceroute -w 3 -q 1 -m 16 example.com
traceroute to example.com (93.184.216.34), 16 hops max, 52 byte packets
1 192.x.x.x (192.x.x.x) 5.152 ms
2 10.x.x.x (10.x.x.x) 12.767 ms
3 172.x.x.x (172.x.x.x) 11.638 ms
4 172.x.x.x (172.x.x.x) 13.193 ms
5 xxx.x.x.x.cox.net (68.x.x.x) 20.624 ms
6 xxx.xxx.xxx.edgecastcdn.net (192.x.x.x) 56.205 ms
7 xxx.xxx.xxx.edgecastcdn.net (192.x.x.x) 24.573 ms
8 *
9 *
10 93.x.x.x (93.x.x.x) 22.810 ms
11 93.x.x.x (93.x.x.x) 20.235 ms
In the example above, selected options are to wait for three seconds (instead of five), send out only one query to each hop (instead of three), limit the maximum number of hops to 16 before giving up (instead of 30), with example.com as the final host. On line 8 and 9 (TTLs 8 and 9) it shows asterisks where the router did not respond within the timeout.
Traceroute can be used to help identify incorrect routing table definitions or firewalls that may be blocking ICMP traffic, or high port UDP in Unix ping, to a site.[clarify] A correct traceroute response does not guarantee connectivity for applications as a firewall may permit ICMP packets but not permit packets of other protocols.
Traceroute is also used by penetration testers to gather information about network infrastructure and IP address ranges around a given host.
It can also be used when downloading data, and if there are multiple mirrors available for the same piece of data, each mirror can be traced to get an idea of which mirror would be the fastest to use.
Origins
The traceroute
Limitations
Traceroute limitations[15] are well known and should be taken into account when using the tool. For example, traceroute does not discover paths at the router level, but at the interface level. Another limitation appears when routers do not respond to probes or when routers have a limit for ICMP responses.[16] In the presence of traffic load balancing, traceroute may indicate a path that does not actually exist; to minimize this problem there is a traceroute modification called Paris-traceroute,[17] which maintains the flow identifier of the probes to avoid load balancing.
See also
- Looking Glass server
- autonomous systemtraceroute utility
References
- ^ "Traceroute6(8) - Linux man page".
- ^ "Tracert6(8): IPv6 traceroute tool - Linux man page".
- ^ Rossingol, Joe. "Network Utility Deprecated in macOS Big Sur". MacRumors.
- ^ tracert.cpp on GitHub
- ^ Linux Programmer's Manual – Administration and Privileged Commands –
- ^ FreeBSD System Manager's Manual –
- ^ NetBSD System Manager's Manual –
- ^ OpenBSD System Manager's Manual –
- ^ DragonFly BSD System Maintenance and Operation Commands Manual –
- ^ ISBN 978-0131433519.
- ^ "Tracert". Microsoft Docs. Retrieved December 11, 2020.
- ^ "tracepath(8) – Linux man page". linux.die.net. Retrieved 2015-06-21.
- ^ "Understanding the Ping and Traceroute Commands". Cisco IOS Software Releases 12.1 Mainline. cisco.com. 2006-11-29. Retrieved 2013-12-08.
- ^ The Story of the PING Program
- ^ Ray Belleville (March 3, 2017). "Limitations of Traceroute Explained".
- S2CID 4643833.
- ^ "Paris Traceroute". paris-traceroute.net. Retrieved 2017-06-10.
Further reading
- Frisch, Æleen (2001). Windows 2000 Commands Pocket Reference. ISBN 978-0-596-00148-3.
- Stanek, William R. (2008). Windows Command-Line Administrator's Pocket Consultant, 2nd Edition. ISBN 978-0735622623.
- Barrett, Daniel J. (2012). Macintosh Terminal Pocket Guide: Take Command of Your Mac. ISBN 978-1449328986.
External links

- RFC 1393: Traceroute using an IP Option Internet RFC
- How traceroute works – InetDaemon
- Tracert – Windows XP Command-line reference