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