From Wikipedia, the free encyclopedia
  (Redirected from Trace route)
Jump to: navigation, search

In computing, traceroute is a computer network diagnostic tool for displaying the route (path) 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 (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.

The command traceroute is available on many modern operating systems. On Apple macOS, it is available by opening the menu Network Utilities and selecting Traceroute, as well as from the command line interface in a terminal. On other Unix systems, such as FreeBSD or Linux, it is also available as a command line tool. On Microsoft Windows, it is named tracert. Windows NT-based operating systems also provide PathPing, with similar functionality. For Internet Protocol Version 6 (IPv6) the tool sometimes has the name traceroute6 or tracert6.


On Unix-like operating systems, traceroute sends, by default, a sequence of User Datagram Protocol (UDP) packets, with destination port numbers ranging from 33434 to 33534; the implementations of traceroute shipped with Linux,[1] FreeBSD,[2] NetBSD,[3] OpenBSD,[4] DragonFly BSD,[5] and macOS include an option to use ICMP Echo Request packets (-I), or any arbitrary protocol (-P) such as UDP, TCP using TCP SYN packets, or ICMP.[6] In Windows, traceroute sends ICMP echo requests instead of UDP packets.[7]

The time-to-live (TTL) value, also known as hop limit, is used in determining the intermediate routers being traversed towards the destination. Traceroute sends packets with TTL values that gradually increase from packet to packet, starting with TTL value of one. Routers decrement TTL values of packets by one when routing and discard packets whose TTL value has reached zero, returning the ICMP error message ICMP Time Exceeded.[6] For the first set of packets, the first router receives the packet, decrements the TTL value and drops the packet because it then has TTL value zero. The router sends an ICMP Time Exceeded message back to the source. The next set of packets are given a TTL value of two, so the first router forwards the packets, but the second router drops them and replies with ICMP Time Exceeded. Proceeding in this way, traceroute uses the returned ICMP Time Exceeded messages to build a list of routers that packets traverse, until the destination is reached and returns an ICMP Echo Reply message.[6]

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. 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.[8]

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.[9]


Router addresses can be superimposed upon maps of their physical locations. This example shows a request from New Zealand to an IP in Massachusetts which takes a route nearly twice as long by passing over Europe.

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. Simple example on Linux:

$ traceroute -w 3 -q 1 -m 16

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 as the final host.

This can help identify incorrect routing table definitions or firewalls that may be blocking ICMP traffic, or high port UDP in Unix ping, to a site. Note that 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 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, one can trace each mirror to get a good idea of which mirror would be the fastest to use.


The traceroute manual page states that the original traceroute program was written by Van Jacobson in 1987 from a suggestion by Steve Deering, with particularly cogent suggestions or fixes from C. Philip Wood, Tim Seaver and Ken Adelman. The author of the ping program, Mike Muuss, states on his website that traceroute was written using kernel ICMP support that he had earlier coded to enable raw ICMP sockets when he first wrote the ping program.[10]


Traceroute limitations 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.[11] 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[12], which maintains the flow identifier of the probes to avoid load balancing.

See also[edit]


  1. ^ traceroute(8) – Linux Programmer's Manual – Administration and Privileged Commands
  2. ^ traceroute(8) – FreeBSD System Manager's Manual
  3. ^ traceroute(8) – NetBSD System Manager's Manual
  4. ^ traceroute(8) – OpenBSD System Manager's Manual
  5. ^ traceroute(8) – DragonFly BSD System Maintenance and Operation Commands Manual
  6. ^ a b c Comer, Douglas (2004). Computer Network and Internets with Internet Applications. Pearson Education, Inc. pp. 360–362. ISBN 0131433512. 
  7. ^ "Tracert". Retrieved April 17, 2016. 
  8. ^ "tracepath(8) – Linux man page". Retrieved 2015-06-21. 
  9. ^ "Understanding the Ping and Traceroute Commands". Cisco IOS Software Releases 12.1 Mainline. 2006-11-29. Retrieved 2013-12-08. 
  10. ^ The Story of the PING Program
  11. ^ Marchetta, P.; Montieri, A.; Persico, V.; Pescapé, A.; Cunha, Í; Katz-Bassett, E. (June 2016). "How and how much traceroute confuses our understanding of network paths". 2016 IEEE International Symposium on Local and Metropolitan Area Networks (LANMAN): 1–7. doi:10.1109/lanman.2016.7548847. 
  12. ^ "Paris Traceroute". Retrieved 2017-06-10. 

This article is based on material taken from the Free On-line Dictionary of Computing prior to 1 November 2008 and incorporated under the "relicensing" terms of the GFDL, version 1.3 or later.

External links[edit]