1 .\" Copyright (c) 1989, 1995, 1996, 1997, 1999, 2000
2 .\" The Regents of the University of California. All rights reserved.
4 .\" Redistribution and use in source and binary forms are permitted
5 .\" provided that the above copyright notice and this paragraph are
6 .\" duplicated in all such forms and that any documentation,
7 .\" advertising materials, and other materials related to such
8 .\" distribution and use acknowledge that the software was developed
9 .\" by the University of California, Berkeley. The name of the
10 .\" University may not be used to endorse or promote products derived
11 .\" from this software without specific prior written permission.
12 .\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
13 .\" IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
14 .\" WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
21 .Nd print the route packets take to network host
37 .Op Fl z Ar pausemsecs
41 The Internet is a large and complex aggregation of
42 network hardware, connected together by gateways.
43 Tracking the route one's packets follow (or finding the miscreant
44 gateway that's discarding your packets) can be difficult.
46 utilizes the IP protocol `time to live' field and attempts to elicit an
49 response from each gateway along the path to some
52 The only mandatory parameter is the destination host name or IP number.
53 The default probe datagram length is 40 bytes, but this may be increased
54 by specifying a packet size (in bytes) after the destination host
60 Turn on AS# lookups for each hop encountered.
62 Turn on AS# lookups and use the given server instead of the
65 Enable socket level debugging.
67 When an ICMP response to our probe datagram is received,
68 print the differences between the transmitted packet and
69 the packet quoted by the ICMP response.
70 A key showing the location of fields within the transmitted packet is printed,
71 followed by the original packet in hex,
72 followed by the quoted packet in hex.
73 Bytes that are unchanged in the quoted packet are shown as underscores.
75 the IP checksum and the TTL of the quoted packet are not expected to match.
76 By default, only one probe per hop is sent with this option.
78 Firewall evasion mode.
79 Use fixed destination ports for UDP and TCP probes.
80 The destination port does NOT increment with each packet sent.
82 Set the initial time-to-live used in the first outgoing probe packet.
84 Set the "don't fragment" bit.
86 Specify a loose source route gateway (8 maximum).
88 Specify a network interface to obtain the source IP address for
89 outgoing probe packets. This is normally only useful on a multi-homed
92 flag for another way to do this.)
98 datagrams. (A synonym for "-P icmp").
100 Set the initial time-to-live value used in outgoing probe packets.
101 The default is 1, i.e., start with the first hop.
103 Set the max time-to-live (max number of hops) used in outgoing probe
104 packets. The default is
106 hops (the same default used for
110 Print hop addresses numerically rather than symbolically and numerically
111 (saves a nameserver address-to-name lookup for each gateway found on the
114 Send packets of specified IP protocol. The currently supported protocols
123 Other protocols may also be specified (either by name or by number), though
125 does not implement any special knowledge of their packet formats. This
126 option is useful for determining which router along a path may be
127 blocking packets based on IP protocol number. But see BUGS below.
129 Protocol specific. For
135 number used in probes (default is 33434).
137 hopes that nothing is listening on
143 at the destination host (so an
147 be returned to terminate the route tracing). If something is
148 listening on a port in the default range, this option can be used
149 to pick an unused port range.
151 Set the number of probes per ``ttl'' to
153 (default is three probes).
155 Bypass the normal routing tables and send directly to a host on an attached
157 If the host is not on a directly-attached network,
158 an error is returned.
159 This option can be used to ping a local host through an interface
160 that has no route through it (e.g., after the interface was dropped by
163 Use the following IP address
164 (which must be given as an IP number, not
165 a hostname) as the source address in outgoing probe packets. On
166 hosts with more than one IP address, this option can be used to
167 force the source address to be something other than the IP address
168 of the interface the probe packet is sent on. If the IP address
169 is not one of this machine's interface addresses, an error is
170 returned and nothing is sent.
173 flag for another way to do this.)
175 Print a summary of how many probes were not answered for each hop.
179 in probe packets to the following value (default zero). The value must be
180 a decimal integer in the range 0 to 255. This option can be used to
181 see if different types-of-service result in different paths. (If you
184 or later system, this may be academic since the normal network
185 services like telnet and ftp don't let you control the
190 meaningful \- see the IP spec for definitions. Useful values are
197 Verbose output. Received
205 Set the time (in seconds) to wait for a response to a probe (default 5 sec.).
207 Toggle IP checksums. Normally, this prevents
210 IP checksums. In some cases, the operating system can overwrite parts of
211 the outgoing packet but not recalculate the checksum (so in some cases
212 the default is to not calculate checksums and using
214 causes them to be calculated). Note that checksums are usually required
215 for the last hop when using
219 ). So they are always calculated when using ICMP.
220 .It Fl z Ar pausemsecs
221 Set the time (in milliseconds) to pause between probes (default 0).
222 Some systems such as Solaris and routers such as Ciscos rate limit
223 ICMP messages. A good value to use with this this is 500 (e.g. 1/2 second).
226 This program attempts to trace the route an IP packet would follow to some
227 internet host by launching
230 packets with a small ttl (time to live) then listening for an
232 "time exceeded" reply from a gateway. We start our probes
233 with a ttl of one and increase by one until we get an
236 (which means we got to "host") or hit a max (which
239 hops & can be changed with the
244 flag) are sent at each ttl setting and a
245 line is printed showing the ttl, address of the gateway and
246 round trip time of each probe. If the probe answers come from
247 different gateways, the address of each responding system will
248 be printed. If there is no response within a 5 sec. timeout
249 interval (changed with the
251 flag), a "*" is printed for that
254 We don't want the destination
257 probe packets so the destination port is set to an
258 unlikely value (if some clod on the destination is using that
259 value, it can be changed with the
263 A sample use and output might be:
265 [yak 71]% traceroute nis.nsf.net.
266 traceroute to nis.nsf.net (35.1.1.48), 64 hops max, 38 byte packet
267 1 helios.ee.lbl.gov (128.3.112.1) 19 ms 19 ms 0 ms
268 2 lilac-dmc.Berkeley.EDU (128.32.216.1) 39 ms 39 ms 19 ms
269 3 lilac-dmc.Berkeley.EDU (128.32.216.1) 39 ms 39 ms 19 ms
270 4 ccngw-ner-cc.Berkeley.EDU (128.32.136.23) 39 ms 40 ms 39 ms
271 5 ccn-nerif22.Berkeley.EDU (128.32.168.22) 39 ms 39 ms 39 ms
272 6 128.32.197.4 (128.32.197.4) 40 ms 59 ms 59 ms
273 7 131.119.2.5 (131.119.2.5) 59 ms 59 ms 59 ms
274 8 129.140.70.13 (129.140.70.13) 99 ms 99 ms 80 ms
275 9 129.140.71.6 (129.140.71.6) 139 ms 239 ms 319 ms
276 10 129.140.81.7 (129.140.81.7) 220 ms 199 ms 199 ms
277 11 nic.merit.edu (35.1.1.48) 239 ms 239 ms 239 ms
280 Note that lines 2 & 3 are the same. This is due to a buggy
281 kernel on the 2nd hop system \- lbl-csam.arpa \- that forwards
282 packets with a zero ttl (a bug in the distributed version
285 Note that you have to guess what path
286 the packets are taking cross-country since the
289 doesn't supply address-to-name translations for its
292 A more interesting example is:
294 [yak 72]% traceroute allspice.lcs.mit.edu.
295 traceroute to allspice.lcs.mit.edu (18.26.0.115), 64 hops max
296 1 helios.ee.lbl.gov (128.3.112.1) 0 ms 0 ms 0 ms
297 2 lilac-dmc.Berkeley.EDU (128.32.216.1) 19 ms 19 ms 19 ms
298 3 lilac-dmc.Berkeley.EDU (128.32.216.1) 39 ms 19 ms 19 ms
299 4 ccngw-ner-cc.Berkeley.EDU (128.32.136.23) 19 ms 39 ms 39 ms
300 5 ccn-nerif22.Berkeley.EDU (128.32.168.22) 20 ms 39 ms 39 ms
301 6 128.32.197.4 (128.32.197.4) 59 ms 119 ms 39 ms
302 7 131.119.2.5 (131.119.2.5) 59 ms 59 ms 39 ms
303 8 129.140.70.13 (129.140.70.13) 80 ms 79 ms 99 ms
304 9 129.140.71.6 (129.140.71.6) 139 ms 139 ms 159 ms
305 10 129.140.81.7 (129.140.81.7) 199 ms 180 ms 300 ms
306 11 129.140.72.17 (129.140.72.17) 300 ms 239 ms 239 ms
308 13 128.121.54.72 (128.121.54.72) 259 ms 499 ms 279 ms
313 18 ALLSPICE.LCS.MIT.EDU (18.26.0.115) 339 ms 279 ms 279 ms
316 Note that the gateways 12, 14, 15, 16 & 17 hops away
319 "time exceeded" messages or send them
320 with a ttl too small to reach us. 14 \- 17 are running the
322 C Gateway code that doesn't send "time exceeded"s. God
323 only knows what's going on with 12.
325 The silent gateway 12 in the above may be the result of a bug in
328 network code (and its derivatives): 4.x (x <= 3)
329 sends an unreachable message using whatever ttl remains in the
330 original datagram. Since, for gateways, the remaining ttl is
333 "time exceeded" is guaranteed to not make it back
334 to us. The behavior of this bug is slightly more interesting
335 when it appears on the destination system:
337 1 helios.ee.lbl.gov (128.3.112.1) 0 ms 0 ms 0 ms
338 2 lilac-dmc.Berkeley.EDU (128.32.216.1) 39 ms 19 ms 39 ms
339 3 lilac-dmc.Berkeley.EDU (128.32.216.1) 19 ms 39 ms 19 ms
340 4 ccngw-ner-cc.Berkeley.EDU (128.32.136.23) 39 ms 40 ms 19 ms
341 5 ccn-nerif35.Berkeley.EDU (128.32.168.35) 39 ms 39 ms 39 ms
342 6 csgw.Berkeley.EDU (128.32.133.254) 39 ms 59 ms 39 ms
349 13 rip.Berkeley.EDU (128.32.131.22) 59 ms ! 39 ms ! 39 ms !
352 Notice that there are 12 "gateways" (13 is the final
353 destination) and exactly the last half of them are "missing".
354 What's really happening is that rip (a Sun-3 running Sun OS3.5)
355 is using the ttl from our arriving datagram as the ttl in its
357 reply. So, the reply will time out on the return path
358 (with no notice sent to anyone since
362 until we probe with a ttl that's at least twice the path
363 length. I.e., rip is really only 7 hops away. A reply that
364 returns with a ttl of 1 is a clue this problem exists.
366 prints a "!" after the time if the ttl is <= 1.
367 Since vendors ship a lot of obsolete
372 software, expect to see this problem
373 frequently and/or take care picking the target host of your
376 Other possible annotations after the time are
381 (host, network or protocol unreachable),
383 (source route failed),
385 (fragmentation needed \- the RFC1191 Path MTU Discovery value is displayed),
389 (destination network/host unknown),
391 (source host is isolated),
393 (communication with destination network administratively prohibited),
395 (communication with destination host administratively prohibited),
397 (for this ToS the destination network is unreachable),
399 (for this ToS the destination host is unreachable),
401 (communication administratively prohibited),
403 (host precedence violation),
405 (precedence cutoff in effect), or
407 (ICMP unreachable code <num>).
408 These are defined by RFC1812 (which supersedes RFC1716).
409 If almost all the probes result in some kind of unreachable,
411 will give up and exit.
413 This program is intended for use in network testing, measurement
415 It should be used primarily for manual fault isolation.
416 Because of the load it could impose on the network, it is unwise to use
418 during normal operations or from automated scripts.
420 Implemented by Van Jacobson from a suggestion by Steve Deering. Debugged
421 by a cast of thousands with particularly cogent suggestions or fixes from
422 C. Philip Wood, Tim Seaver and Ken Adelman.
428 When using protocols other than UDP, functionality is reduced.
429 In particular, the last packet will often appear to be lost, because
430 even though it reaches the destination host, there's no way to know
431 that because no ICMP message is sent back.
434 should listen for a RST from the destination host (or an intermediate
435 router that's filtering packets), but this is not implemented yet.
437 The AS number capability reports information that may sometimes be
438 inaccurate due to discrepancies between the contents of the
439 routing database server and the current state of the Internet.