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