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