Traceroute
lastmod 2025-11-10created 2014-11-0420 edits
Prints the route that IP packets take to a network host.
traceroute or tracert is a computer network diagnostic utility for displaying the route taken across the Internet, recording information about each segment, and measuring the transit delays of packets across an Internet Protocol network.
About
The traceroute command attempts to trace the route an IP packet follows to an Internet host by launching UDP probe packets with a small maximum time-to-live (Max_ttl variable), then listening for ICMP TIME_EXCEEDED responses from gateways along the way. Probes start with a Max_ttl value of one hop and are increased one hop at a time until an ICMP PORT_UNREACHABLE message is returned. The ICMP PORT_UNREACHABLE message indicates either that the host has been located or that the command has reached the maximum number of hops allowed for the trace.
The traceroute command sends three probes at each Max_ttl setting and records the following:
- Max_ttl value
- Gateway address
- Round-trip time of each successful probe
The number of probes sent can be increased with the -q flag. If probe responses come from different gateways, the command prints the address of each responding system. If there is no response from a probe within a 3-second timeout interval, an * (asterisk) is printed for that probe.
The traceroute command prints an ! (exclamation mark) after the round-trip time if the Max_ttl value is one hop or less. A maximum time-to-live value of one hop or less usually indicates an incompatibility in the way ICMP replies are handled by different network software. The incompatibility can usually be resolved by doubling the last Max_ttl value used and trying again.
Other possible annotations after the round-trip annotation are:
-
!H: Host unreachable -
!N: Network unreachable -
!P: Protocol unreachable -
!S: Source route failed -
!F: Fragmentation needed
If most of the probes result in errors, the traceroute command exits.
The only mandatory parameter for the traceroute command is the destination host name or IP number. The traceroute command determines the length of the probe packet based on the maximum transmission unit (MTU) of the outgoing interface. UDP probe packets are set to an unlikely value so as to prevent processing by the destination host.
Installation
Example
$ traceroute naver.com
traceroute: Warning: naver.com has multiple addresses; using 125.209.222.141
traceroute to naver.com (125.209.222.141), 64 hops max, 52 byte packets
1 192.168.0.1 (192.168.0.1) 2.123 ms 0.927 ms 0.878 ms
2 118.222.146.190 (118.222.146.190) 3.657 ms 3.851 ms 4.411 ms
3 100.70.196.21 (100.70.196.21) 7.276 ms 6.317 ms 8.115 ms
4 100.69.168.29 (100.69.168.29) 2.742 ms 2.411 ms 1.444 ms
5 10.62.255.26 (10.62.255.26) 1.683 ms 1.704 ms 1.738 ms
6 10.222.7.170 (10.222.7.170) 9.962 ms
10.222.7.182 (10.222.7.182) 9.461 ms 4.392 ms
7 1.255.36.33 (1.255.36.33) 2.310 ms 1.739 ms
175.126.127.246 (175.126.127.246) 2.058 ms
8 211.176.57.26 (211.176.57.26) 3.549 ms
211.176.57.30 (211.176.57.30) 5.749 ms 2.838 ms
9 10.22.68.122 (10.22.68.122) 3.699 ms
10.22.69.98 (10.22.69.98) 4.154 ms
10.22.69.62 (10.22.69.62) 4.821 ms
10 10.118.2.142 (10.118.2.142) 3.986 ms
10.118.2.26 (10.118.2.26) 4.463 ms
10.118.2.134 (10.118.2.134) 4.012 ms
11 * * *
12 * * *
How to use Windows tracert
This diagnostic tool determines the path taken to a destination by sending Internet Control Message Protocol (ICMP) echo requests or ICMPv6 messages to the destination with incrementally increasing TTL (TTL) field values. Each router along the path is required to decrement the TTL in an IP packet by at least 1 before forwarding it. Effectively, the TTL is a maximum link counter. When the TTL on a packet reaches 0, the router is expected to return an ICMP Time Exceeded message to the source computer.
This command determines the path by sending the first echo request message with a TTL of 1 and incrementing the TTL by 1 on each subsequent transmission until the destination responds or the maximum number of hops is reached. The maximum number of hops is 30 by default and can be specified with the /h parameter.
The path is determined by examining the ICMP Time Exceeded messages returned by intermediate routers and the Echo Reply message returned by the destination. However, some routers do not return Time Exceeded messages for packets with expired TTL values and are invisible to the tracert command. In this case, a row of asterisks (*) is displayed for that hop. The path displayed is the list of near-side router interfaces of the routers in the path between the source host and the destination. The near-side interface is the router interface that is closest to the sending host in the path.
To trace a path using the Tracert command, open a command prompt and type the following.
To prevent the tracert command from resolving and displaying the names of all routers in the path, use the -d parameter. With this parameter, the path is displayed more quickly.
Note
To open a command prompt, click Start, point to All Programs, point to Accessories, and then click Command Prompt.
The tracert command traces a path by sending Internet Control Message Protocol (ICMP) Echo Request and Echo Reply messages, similar to the ping command, and outputs a command-line report of the RTT (round-trip time) of each hop and each router passed through. Packet filtering policies on routers, firewalls, or other security gateways may prevent this traffic from being forwarded.
If tracert fails, you can use the command output to identify the intermediate router that failed to forward or that slowed down forwarding.
For detailed information about packet forwarding and loss at each router and link in the path, use the pathping command.
Example
How to configure IPs in different subnets to communicate with each other
See Internet Protocol#How to configure IPs in different subnets to communicate with each other for details.
traceroute vs inetutils-traceroute
- There's no such thing!!: traceroute vs inetutils-traceroute
- networking - What is the difference between traceroute from traceroute and inetutils-traceroute - Ask Ubuntu
Long story short, I just ran sudo apt install traceroute.
Trouebleshooting
Only asterisks keep showing up
$ traceroute 192.168.0.250
traceroute to 192.168.0.250 (192.168.0.250), 30 hops max, 60 byte packets
1 * * *
2 * * *
3 * * *
...
29 * * *
30 * * *
A name reverse resolve problem?? <- Not sure of the exact cause.
But in the end, after waiting a bit and trying again, it worked fine.
See also
Favorite site
- [http://msdn.microsoft.com/ko-kr/library/cc782791(v=ws.10.aspx MSDN: Tracing a route with the Tracert command]
- IBM Knowledge Center - traceroute command
- root blog :: Checking routing paths and finding a fast DNS server with the tracert command
- How to use the traceroute command in Linux - Choesin
Online Tools
- How did I get here? | GeekNews
- How Did I Get Here?
- An interactive page that visualizes in real time the route the user's packets take across the Internet to reach the website's server
- Its custom-built traceroute program ‘ktr’ uses the TTL values of ICMP packets to collect information about each network hop
- The website works without JavaScript; the server streams the traceroute results into the HTML
- For route analysis, it uses WHOIS and PeeringDB data to show the autonomous system (AS) and company each IP belongs to
- Combines traceroute with the BGP-based structure of the Internet to show that the Internet is a collection of networks built from peering relationships between companies