Deleted Added
sdiff udiff text old ( 163388 ) new ( 176428 )
full compact
1.\" Copyright (c) 1989, 1995, 1996, 1997, 1999, 2000
2.\" The Regents of the University of California. All rights reserved.
3.\"
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.
15.\"
16.\" $Id: traceroute.8,v 1.19 2000/09/21 08:44:19 leres Exp $
17.\" $FreeBSD: head/contrib/traceroute/traceroute.8 176428 2008-02-20 23:29:53Z rpaulo $
18.\"
19.TH TRACEROUTE 8 "19 February 2008"
20.UC 6
21.SH NAME
22traceroute \- print the route packets take to network host
23.SH SYNOPSIS
24.na
25.B traceroute
26[
27.B \-adDeFISnrvx
28] [
29.B \-f
30.I first_ttl
31] [
32.B \-g
33.I gateway
34]
35.br
36.ti +8
37[
38.B \-i
39.I iface
40] [
41.B \-M
42.I first_ttl
43]
44.br
45.ti +8
46[
47.B \-m
48.I max_ttl
49] [
50.B \-P
51.I proto
52] [
53.B \-p
54.I port
55]
56.br
57.ti +8
58[
59.B \-q
60.I nqueries
61] [
62.B \-s
63.I src_addr
64] [
65.B \-t
66.I tos
67]
68.br
69.ti +8
70[
71.B \-w
72.I waittime
73] [
74.B \-A
75.I as_server
76] [
77.B \-z
78.I pausemsecs
79]
80.br
81.ti +8
82.I host
83[
84.I packetlen
85]
86.ad
87.SH DESCRIPTION
88The Internet is a large and complex aggregation of
89network hardware, connected together by gateways.
90Tracking the route one's packets follow (or finding the miscreant
91gateway that's discarding your packets) can be difficult.
92.I Traceroute
93utilizes the IP protocol `time to live' field and attempts to elicit an
94ICMP TIME_EXCEEDED response from each gateway along the path to some
95host.
96.PP
97The only mandatory parameter is the destination host name or IP number.
98The default probe datagram length is 40 bytes, but this may be increased
99by specifying a packet length (in bytes) after the destination host
100name.
101.PP
102Other options are:
103.TP
104.B \-a
105Turn on AS# lookups for each hop encountered.
106.TP
107.B -A
108Turn on AS# lookups and use the given server instead of the
109default.
110.TP
111.B \-e
112Firewall evasion mode.
113Use fixed destination ports for UDP and TCP probes.
114The destination port does NOT increment with each packet sent.
115.TP
116.B \-f
117Set the initial time-to-live used in the first outgoing probe packet.
118.TP
119.B \-F
120Set the "don't fragment" bit.
121.TP
122.B \-d
123Enable socket level debugging.
124.TP
125.B \-D
126When an ICMP response to our probe datagram is received,
127print the differences between the transmitted packet and
128the packet quoted by the ICMP response.
129A key showing the location of fields within the transmitted packet is printed,
130followed by the original packet in hex,
131followed by the quoted packet in hex.
132Bytes that are unchanged in the quoted packet are shown as underscores.
133Note,
134the IP checksum and the TTL of the quoted packet are not expected to match.
135By default, only one probe per hop is sent with this option.
136.TP
137.B \-g
138Specify a loose source route gateway (8 maximum).
139.TP
140.B \-i
141Specify a network interface to obtain the source IP address for
142outgoing probe packets. This is normally only useful on a multi-homed
143host. (See the
144.B \-s
145flag for another way to do this.)
146.TP
147.B \-I
148Use ICMP ECHO instead of UDP datagrams. (A synonym for "-P icmp").
149.TP
150.B \-M
151Set the initial time-to-live value used in outgoing probe packets.
152The default is 1, i.e., start with the first hop.
153.TP
154.B \-m
155Set the max time-to-live (max number of hops) used in outgoing probe
156packets. The default is
157.I net.inet.ip.ttl
158hops (the same default used for TCP
159connections).
160.TP
161.B \-n
162Print hop addresses numerically rather than symbolically and numerically
163(saves a nameserver address-to-name lookup for each gateway found on the
164path).
165.TP
166.B \-P
167Send packets of specified IP protocol. The currently supported protocols
168are: UDP, TCP, GRE and ICMP. Other protocols may also be specified (either by
169name or by number), though
170.I traceroute
171does not implement any special knowledge of their packet formats. This
172option is useful for determining which router along a path may be
173blocking packets based on IP protocol number. But see BUGS below.
174.TP
175.B \-p
176Protocol specific. For UDP and TCP, sets
177the base port number used in probes (default is 33434).
178Traceroute hopes that nothing is listening on UDP ports
179.I base
180to
181.I base + nhops * nprobes - 1
182at the destination host (so an ICMP PORT_UNREACHABLE message will
183be returned to terminate the route tracing). If something is
184listening on a port in the default range, this option can be used
185to pick an unused port range.
186.TP
187.B \-q
188Set the number of probes per hop (default is 3,
189unless
190.B -D
191is specified,
192when it is 1).
193.TP
194.B \-r
195Bypass the normal routing tables and send directly to a host on an attached
196network.
197If the host is not on a directly-attached network,
198an error is returned.
199This option can be used to ping a local host through an interface
200that has no route through it (e.g., after the interface was dropped by
201.IR routed (8C)).
202.TP
203.B \-s
204Use the following IP address (which usually is given as an IP number, not
205a hostname) as the source address in outgoing probe packets. On
206multi-homed hosts (those with more than one IP
207address), this option can be used to
208force the source address to be something other than the IP address
209of the interface the probe packet is sent on. If the IP address
210is not one of this machine's interface addresses, an error is
211returned and nothing is sent. (See the
212.B \-i
213flag for another way to do this.)
214.TP
215.B \-S
216Print a summary of how many probes were not answered for each hop.
217.TP
218.B \-t
219Set the
220.I type-of-service
221in probe packets to the following value (default zero). The value must be
222a decimal integer in the range 0 to 255. This option can be used to
223see if different types-of-service result in different paths. (If you
224are not running 4.4bsd, this may be academic since the normal network
225services like telnet and ftp don't let you control the TOS).
226Not all values of TOS are legal or
227meaningful \- see the IP spec for definitions. Useful values are
228probably
229.RB ` -t
230.IR 16 '
231(low delay) and
232.RB ` -t
233.IR 8 '
234(high throughput).
235.TP
236.B \-v
237Verbose output. Received ICMP packets other than TIME_EXCEEDED and
238UNREACHABLEs are listed.
239.TP
240.B \-w
241Set the time (in seconds) to wait for a response to a probe (default 5
242sec.).
243.TP
244.B \-x
245Toggle ip checksums. Normally, this prevents traceroute from calculating
246ip checksums. In some cases, the operating system can overwrite parts of
247the outgoing packet but not recalculate the checksum (so in some cases
248the default is to not calculate checksums and using
249.B \-x
250causes them to be calculated). Note that checksums are usually required
251for the last hop when using ICMP ECHO probes
252.RB ( \-I ).
253So they are always calculated when using ICMP.
254.TP
255.B \-z
256Set the time (in milliseconds) to pause between probes (default 0).
257Some systems such as Solaris and routers such as Ciscos rate limit
258icmp messages. A good value to use with this this is 500 (e.g. 1/2 second).
259.PP
260This program attempts to trace the route an IP packet would follow to some
261internet host by launching UDP probe
262packets with a small ttl (time to live) then listening for an
263ICMP "time exceeded" reply from a gateway. We start our probes
264with a ttl of one and increase by one until we get an ICMP "port
265unreachable" (which means we got to "host") or hit a max (which
266defaults to
267.I net.inet.ip.ttl
268hops & can be changed with the
269.B \-m
270flag). Three
271probes (change with
272.B \-q
273flag) are sent at each ttl setting and a
274line is printed showing the ttl, address of the gateway and
275round trip time of each probe. If the probe answers come from
276different gateways, the address of each responding system will
277be printed. If there is no response within a 5 sec. timeout
278interval (changed with the
279.B \-w
280flag), a "*" is printed for that
281probe.
282.PP
283We don't want the destination
284host to process the UDP probe packets so the destination port is set to an
285unlikely value (if some clod on the destination is using that
286value, it can be changed with the
287.B \-p
288flag).
289.PP
290A sample use and output might be:
291
292.RS
293.nf
294[yak 71]% traceroute nis.nsf.net.
295traceroute to nis.nsf.net (35.1.1.48), 64 hops max, 38 byte packet
296 1 helios.ee.lbl.gov (128.3.112.1) 19 ms 19 ms 0 ms
297 2 lilac-dmc.Berkeley.EDU (128.32.216.1) 39 ms 39 ms 19 ms
298 3 lilac-dmc.Berkeley.EDU (128.32.216.1) 39 ms 39 ms 19 ms
299 4 ccngw-ner-cc.Berkeley.EDU (128.32.136.23) 39 ms 40 ms 39 ms
300 5 ccn-nerif22.Berkeley.EDU (128.32.168.22) 39 ms 39 ms 39 ms
301 6 128.32.197.4 (128.32.197.4) 40 ms 59 ms 59 ms
302 7 131.119.2.5 (131.119.2.5) 59 ms 59 ms 59 ms
303 8 129.140.70.13 (129.140.70.13) 99 ms 99 ms 80 ms
304 9 129.140.71.6 (129.140.71.6) 139 ms 239 ms 319 ms
30510 129.140.81.7 (129.140.81.7) 220 ms 199 ms 199 ms
30611 nic.merit.edu (35.1.1.48) 239 ms 239 ms 239 ms
307.fi
308.RE
309
310Note that lines 2 & 3 are the same. This is due to a buggy
311kernel on the 2nd hop system \- lilac-dmc.Berkeley.EDU \- that forwards
312packets with a zero ttl (a bug in the distributed version
313of 4.3BSD). Note that you have to guess what path
314the packets are taking cross-country since the NSFNet (129.140)
315doesn't supply address-to-name translations for its NSSes.
316.PP
317A more interesting example is:
318
319.RS
320.nf
321[yak 72]% traceroute allspice.lcs.mit.edu.
322traceroute to allspice.lcs.mit.edu (18.26.0.115), 64 hops max
323 1 helios.ee.lbl.gov (128.3.112.1) 0 ms 0 ms 0 ms
324 2 lilac-dmc.Berkeley.EDU (128.32.216.1) 19 ms 19 ms 19 ms
325 3 lilac-dmc.Berkeley.EDU (128.32.216.1) 39 ms 19 ms 19 ms
326 4 ccngw-ner-cc.Berkeley.EDU (128.32.136.23) 19 ms 39 ms 39 ms
327 5 ccn-nerif22.Berkeley.EDU (128.32.168.22) 20 ms 39 ms 39 ms
328 6 128.32.197.4 (128.32.197.4) 59 ms 119 ms 39 ms
329 7 131.119.2.5 (131.119.2.5) 59 ms 59 ms 39 ms
330 8 129.140.70.13 (129.140.70.13) 80 ms 79 ms 99 ms
331 9 129.140.71.6 (129.140.71.6) 139 ms 139 ms 159 ms
33210 129.140.81.7 (129.140.81.7) 199 ms 180 ms 300 ms
33311 129.140.72.17 (129.140.72.17) 300 ms 239 ms 239 ms
33412 * * *
33513 128.121.54.72 (128.121.54.72) 259 ms 499 ms 279 ms
33614 * * *
33715 * * *
33816 * * *
33917 * * *
34018 ALLSPICE.LCS.MIT.EDU (18.26.0.115) 339 ms 279 ms 279 ms
341.fi
342.RE
343
344Note that the gateways 12, 14, 15, 16 & 17 hops away
345either don't send ICMP "time exceeded" messages or send them
346with a ttl too small to reach us. 14 \- 17 are running the
347MIT C Gateway code that doesn't send "time exceeded"s. God
348only knows what's going on with 12.
349.PP
350The silent gateway 12 in the above may be the result of a bug in
351the 4.[23]BSD network code (and its derivatives): 4.x (x <= 3)
352sends an unreachable message using whatever ttl remains in the
353original datagram. Since, for gateways, the remaining ttl is
354zero, the ICMP "time exceeded" is guaranteed to not make it back
355to us. The behavior of this bug is slightly more interesting
356when it appears on the destination system:
357
358.RS
359.nf
360 1 helios.ee.lbl.gov (128.3.112.1) 0 ms 0 ms 0 ms
361 2 lilac-dmc.Berkeley.EDU (128.32.216.1) 39 ms 19 ms 39 ms
362 3 lilac-dmc.Berkeley.EDU (128.32.216.1) 19 ms 39 ms 19 ms
363 4 ccngw-ner-cc.Berkeley.EDU (128.32.136.23) 39 ms 40 ms 19 ms
364 5 ccn-nerif35.Berkeley.EDU (128.32.168.35) 39 ms 39 ms 39 ms
365 6 csgw.Berkeley.EDU (128.32.133.254) 39 ms 59 ms 39 ms
366 7 * * *
367 8 * * *
368 9 * * *
36910 * * *
37011 * * *
37112 * * *
37213 rip.Berkeley.EDU (128.32.131.22) 59 ms ! 39 ms ! 39 ms !
373.fi
374.RE
375
376Notice that there are 12 "gateways" (13 is the final
377destination) and exactly the last half of them are "missing".
378What's really happening is that rip (a Sun-3 running Sun OS3.5)
379is using the ttl from our arriving datagram as the ttl in its
380ICMP reply. So, the reply will time out on the return path
381(with no notice sent to anyone since ICMP's aren't sent for
382ICMP's) until we probe with a ttl that's at least twice the path
383length. I.e., rip is really only 7 hops away. A reply that
384returns with a ttl of 1 is a clue this problem exists.
385Traceroute prints a "!" after the time if the ttl is <= 1.
386Since vendors ship a lot of obsolete (DEC's Ultrix, Sun 3.x) or
387non-standard (HPUX) software, expect to see this problem
388frequently and/or take care picking the target host of your
389probes.
390
391Other possible annotations after the time are
392.BR !H ,
393.BR !N ,
394or
395.B !P
396(host, network or protocol unreachable),
397.B !S
398(source route failed),
399.B !F\-<pmtu>
400(fragmentation needed \- the RFC1191 Path MTU Discovery value is displayed),
401.B !U
402or
403.B !W
404(destination network/host unknown),
405.B !I
406(source host is isolated),
407.B !A
408(communication with destination network administratively prohibited),
409.B !Z
410(communication with destination host administratively prohibited),
411.B !Q
412(for this ToS the destination network is unreachable),
413.B !T
414(for this ToS the destination host is unreachable),
415.B !X
416(communication administratively prohibited),
417.B !V
418(host precedence violation),
419.B !C
420(precedence cutoff in effect), or
421.B !<num>
422(ICMP unreachable code <num>).
423These are defined by RFC1812 (which supersedes RFC1716).
424If almost all the probes result in some kind of unreachable, traceroute
425will give up and exit.
426.PP
427This program is intended for use in network testing, measurement
428and management.
429It should be used primarily for manual fault isolation.
430Because of the load it could impose on the network, it is unwise to use
431.I traceroute
432during normal operations or from automated scripts.
433.SH SEE ALSO
434pathchar(8), netstat(1), ping(8)
435.SH AUTHOR
436Implemented by Van Jacobson from a suggestion by Steve Deering. Debugged
437by a cast of thousands with particularly cogent suggestions or fixes from
438C. Philip Wood, Tim Seaver and Ken Adelman.
439.LP
440The current version is available via anonymous ftp:
441.LP
442.RS
443.I ftp://ftp.ee.lbl.gov/traceroute.tar.gz
444.RE
445.SH BUGS
446When using protocols other than UDP, functionality is reduced.
447In particular, the last packet will often appear to be lost, because
448even though it reaches the destination host, there's no way to know
449that because no ICMP message is sent back.
450In the TCP case,
451.I traceroute
452should listen for a RST from the destination host (or an intermediate
453router that's filtering packets), but this is not implemented yet.
454.PP
455Please send bug reports to traceroute@ee.lbl.gov.
456.PP
457The AS number capability reports information that may sometimes be
458inaccurate due to discrepancies between the contents of the
459routing database server and the current state of the Internet.