Debian Codegraph @

upstream/debian-unstable/man1/traceroute.db.1

raw
1 .\" Copyright (c) 2006 Dmitry Butskoy ([email protected])
2 .\" License: GPL v2 or any later version
3 .\" See COPYING for the status of this software
4 .TH TRACEROUTE 1 "11 October 2006" "Traceroute" "Traceroute For Linux"
5 .\" .UC 6
6 .SH NAME
7 traceroute \- print the route packets trace to network host
8 .SH SYNOPSIS
9 .na
10 .BR traceroute " [" \-46dFITUnreAV "] [" "\-f first_ttl" "] [" "\-g gate,..." ]
11 .br
12 .ti +8
13 .BR "" [ "-i device" "] [" "-m max_ttl" "] [" "-p port" "] [" "-s src_addr" ]
14 .br
15 .ti +8
16 .BR "" [ "-q nqueries" "] [" "-N squeries" "] [" "-t tos" ]
17 .br
18 .ti +8
19 .BR "" [ "-l flow_label" "] [" "-w waittimes" "] [" "-z sendwait" "] [" "-UL" "] [" "-D" ]
20 .br
21 .ti +8
22 .BR "" [ "-P proto" "] [" "--sport=port" "] [" "-M method" "] [" "-O mod_options" ]
23 .br
24 .ti +8
25 .BR "" [ "--mtu" "] [" "--back" ]
26 .br
27 .ti +8
28 .BR host " [" "packet_len" "]"
29 .br
30 .B traceroute6
31 .RI " [" options ]
32 .br
33 .B tcptraceroute
34 .RI " [" options ]
35 .br
36 .B lft
37 .RI " [" options ]
38 .ad
39 .SH DESCRIPTION
40 .I traceroute
41 tracks the route packets taken from an IP network on their
42 way to a given host. It utilizes the IP protocol's time to live (TTL) field
43 and attempts to elicit an ICMP TIME_EXCEEDED response from each gateway
44 along the path to the host.
45 .P
46 .I traceroute6
47 is equivalent to
48 .I traceroute
49 .B \-6
50 .P
51 .I tcptraceroute
52 is equivalent to
53 .I traceroute
54 .B \-T
55 .P
56 .I lft
57 , the Layer Four Traceroute, performs a TCP traceroute, like
58 .I traceroute
59 .B \-T
60 , but attempts to provide compatibility with the original
61 such implementation, also called "lft".
62 .PP
63 The only required parameter is the name or IP address of the
64 destination
65 .BR host \ .
66 The optional
67 .B packet_len\fR`gth
68 is the total size of the probing packet (default 60 bytes
69 for IPv4 and 80 for IPv6). The specified size can be ignored
70 in some situations or increased up to a minimal value.
71 .PP
72 This program attempts to trace the route an IP packet would follow to some
73 internet host by launching probe
74 packets with a small ttl (time to live) then listening for an
75 ICMP "time exceeded" reply from a gateway. We start our probes
76 with a ttl of one and increase by one until we get an ICMP "port
77 unreachable" (or TCP reset), which means we got to the "host", or hit a max (which
78 defaults to 30 hops). Three probes (by default) are sent at each ttl setting
79 and a line is printed showing the ttl, address of the gateway and
80 round trip time of each probe. The address can be followed by additional
81 information when requested. If the probe answers come from
82 different gateways, the address of each responding system will
83 be printed. If there is no response within a certain timeout,
84 an "*" (asterisk) is printed for that probe.
85 .PP
86 After the trip time, some additional annotation can be printed:
87 .BR !H ,
88 .BR !N ,
89 or
90 .B !P
91 (host, network or protocol unreachable),
92 .B !S
93 (source route failed),
94 .B !F
95 (fragmentation needed),
96 .B !X
97 (communication administratively prohibited),
98 .B !V
99 (host precedence violation),
100 .B !C
101 (precedence cutoff in effect), or
102 .B !<num>
103 (ICMP unreachable code <num>).
104 If almost all the probes result in some kind of unreachable, traceroute
105 will give up and exit.
106 .PP
107 We don't want the destination host to process the UDP probe packets,
108 so the destination port is set to an unlikely value (you can change it with the
109 .B \-p
110 flag). There is no such a problem for ICMP or TCP tracerouting (for TCP we
111 use half-open technique, which prevents our probes to be seen by applications
112 on the destination host).
113 .PP
114 In the modern network environment the traditional traceroute methods
115 can not be always applicable, because of widespread use of firewalls.
116 Such firewalls filter the "unlikely" UDP ports, or even ICMP echoes.
117 To solve this, some additional tracerouting methods are implemented
118 (including tcp), see
119 .B LIST OF AVAILABLE METHODS
120 below. Such methods try to use particular protocol
121 and source/destination port, in order to bypass firewalls (to be seen
122 by firewalls just as a start of allowed type of a network session).
123 .SH OPTIONS
124 .TP
125 .B \-\-help
126 Print help info and exit.
127 .TP
128 .BR \-4 ", " \-6
129 Explicitly force IPv4 or IPv6 tracerouting. By default, the program
130 will try to resolve the name given, and choose the appropriate
131 protocol automatically. If resolving a host name returns both
132 IPv4 and IPv6 addresses,
133 .I traceroute
134 will use IPv4.
135 .TP
136 .B \-I, \-\-icmp
137 Use ICMP ECHO for probes
138 .TP
139 .B \-T, \-\-tcp
140 Use TCP SYN for probes
141 .TP
142 .B \-d, --debug
143 Enable socket level debugging (when the Linux kernel supports it)
144 .TP
145 .B \-F, --dont-fragment
146 Do not fragment probe packets. (For IPv4 it also sets DF bit, which tells
147 intermediate routers not to fragment remotely as well).
148 .br
149
150 .br
151 Varying the size of the probing packet by the
152 .B packet_len
153 command line parameter, you can manually obtain information
154 about the MTU of individual network hops. The
155 .B \--mtu
156 option (see below) tries to do this automatically.
157 .br
158
159 .br
160 Note, that non-fragmented features (like
161 .B \-F
162 or
163 .B \--mtu\fR)
164 work properly since the Linux kernel 2.6.22 only.
165 Before that version, IPv6 was always fragmented, IPv4 could use
166 the once the discovered final mtu only (from the route cache), which can be
167 less than the actual mtu of a device.
168 .TP
169 .BI \-f " first_ttl" ", --first=" first_ttl
170 Specifies with what TTL to start. Defaults to 1.
171 .TP
172 .BI \-g " gateway" ", --gateway=" gateway
173 Tells traceroute to add an IP source routing option to the outgoing
174 packet that tells the network to route the packet through the
175 specified
176 .I gateway
177 (most routers have disabled source routing for security reasons).
178 In general, several
179 .IR gateway 's
180 is allowed (comma separated). For IPv6, the form of
181 .IB num , addr , addr...
182 is allowed, where
183 .I num
184 is a route header type (default is type 2). Note the type 0 route header
185 is now deprecated (rfc5095).
186 .TP
187 .BI \-i " interface" ", --interface=" interface
188 Specifies the interface through which
189 .I traceroute
190 should send packets. By default, the interface is selected
191 according to the routing table.
192 .TP
193 .BI \-m " max_ttl" ", --max-hops=" max_ttl
194 Specifies the maximum number of hops (max time-to-live value)
195 .I traceroute
196 will probe. The default is 30.
197 .TP
198 .BI \-N " squeries" ", --sim-queries=" squeries
199 Specifies the number of probe packets sent out simultaneously.
200 Sending several probes concurrently can speed up
201 .I traceroute
202 considerably. The default value is 16.
203 .br
204 Note that some routers and hosts can use ICMP rate throttling. In such
205 a situation specifying too large number can lead to loss of some responses.
206 .TP
207 .B \-n
208 Do not try to map IP addresses to host names when displaying them.
209 .TP
210 .BI \-p " port" ", --port=" port
211 For UDP tracing, specifies the destination port base
212 .I traceroute
213 will use (the destination port number will be incremented by each probe).
214 .br
215 For ICMP tracing, specifies the initial ICMP sequence value (incremented
216 by each probe too).
217 .br
218 For TCP and others specifies just the (constant) destination
219 port to connect. When using the tcptraceroute wrapper,
220 \-p specifies the source port.
221 .TP
222 .BI \-t " tos" ", --tos=" tos
223 For IPv4, set the Type of Service (TOS) and Precedence value. Useful values
224 are 16 (low delay) and 8 (high throughput). Note that in order to use
225 some TOS precedence values, you have to be super user.
226 .br
227 For IPv6, set the Traffic Control value.
228 .TP
229 .BI \-l " flow_label" ", --flowlabel=" flow_label
230 Use specified flow_label for IPv6 packets.
231 .TP
232 .BI \-w " max\fR[\fB,\fIhere\fB,\fInear\fR]" ", --wait=" max\fR[\fB,\fIhere\fB,\fInear\fR]
233 Determines how long to wait for a response to a probe.
234 .br
235
236 .br
237 There are three (in general) float values separated by a comma
238 (or a slash).
239 .I Max
240 specifies the maximum time (in seconds, default 5.0) to wait, in any case.
241 .br
242
243 .br
244 Traditional traceroute implementation always waited whole
245 .I max
246 seconds for any probe. But if we already have some replies from the
247 .B same
248 hop, or even from some
249 .B next
250 hop, we can use the round trip time of such a reply as a hint
251 to determine the actual reasonable amount of time to wait.
252 .br
253
254 .br
255 The optional
256 .I here
257 (default 3.0) specifies a factor to multiply the round trip time of an already
258 received response from the
259 .B same
260 hop. The resulting value is used as a timeout for the probe, instead of
261 (but no more than)
262 .IR max .
263 The optional
264 .I near
265 (default 10.0) specifies a similar factor for a response from some
266 .B next
267 hop.
268 (The time of the first found result is used in both cases).
269 .br
270
271 .br
272 First, we look for the
273 .B same
274 hop (of the probe which will be printed first from now).
275 If nothing found, then look for some
276 .B next
277 hop. If nothing found, use
278 .IR max .
279 If
280 .I here
281 and/or
282 .I near
283 have zero values, the corresponding computation is skipped.
284 .br
285 .I Here
286 and
287 .I near
288 are always set to zero if only
289 .I max
290 is specified (for compatibility with previous versions).
291 .TP
292 .BI \-q " nqueries" ", --queries=" nqueries
293 Sets the number of probe packets per hop. The default is 3.
294 .TP
295 .B \-r
296 Bypass the normal routing tables and send directly to a host on
297 an attached network. If the host is not on a directly-attached
298 network, an error is returned. This option can be used to ping a
299 local host through an interface that has no route through it.
300 .TP
301 .BI \-s " source_addr" ", --source=" source_addr
302 Chooses an alternative source address. Note that you must select the
303 address of one of the interfaces.
304 By default, the address of the outgoing interface is used.
305 .TP
306 .BI \-z " sendwait" ", --sendwait=" sendwait
307 Minimal time interval between probes (default 0).
308 If the value is more than 10, then it specifies a number in milliseconds,
309 else it is a number of seconds (float point values allowed too).
310 Useful when some routers use rate-limit for ICMP messages.
311 .TP
312 .B \-e, \-\-extensions
313 Show ICMP extensions (rfc4884). The general form is
314 .I CLASS\fB/\fITYPE\fB:
315 followed by a hexadecimal dump.
316 The MPLS (rfc4950) is shown parsed, in a form:
317 .B MPLS:L=\fIlabel\fB,E=\fIexp_use\fB,S=\fIstack_bottom\fB,T=\fITTL
318 (more objects separated by
319 .B /
320 ). The Interface Information (rfc5837) is shown parsed as well, in a following form:
321 .B \fR{\fBINC\fR|\fBSUB\fR|\fBOUT\fR|\fBNXT\fR}\fB:\fIindex\fB,\fIIP_addr\fB,"\fIname\fB",mtu=\fIMTU\fB
322 (all four fields may be missing).
323 .TP
324 .B \-A, \-\-as\-path\-lookups
325 Perform AS path lookups in routing registries and print results
326 directly after the corresponding addresses.
327 .TP
328 .B \-V, \-\-version
329 Print the version and exit.
330 .br
331 .P
332 There are additional options intended for advanced usage
333 (such as alternate trace methods etc.):
334 .TP
335 .B \--sport\fR=\fIport
336 Chooses the source port to use. Implies
337 .B \-N\ 1\fR\ -w\ 5 .
338 Normally source ports (if applicable) are chosen by the system.
339 .TP
340 .B \--fwmark\fR=\fImark
341 Set the firewall mark for outgoing packets (since the Linux kernel 2.6.25).
342 .TP
343 .BI \-M " method" ", --module=" name
344 Use specified method for traceroute operations. Default traditional udp method
345 has name
346 .IR default ,
347 icmp
348 .BR "" ( "-I" ) "
349 and tcp
350 .BR "" ( "-T" ) "
351 have names
352 .I icmp
353 and
354 .I tcp
355 respectively.
356 .br
357 Method-specific options can be passed by
358 .BR \-O\ .
359 Most methods have their simple shortcuts,
360 .BR "" ( "-I " means " -M icmp" ,
361 etc).
362 .TP
363 .BI \-O " option" ", --options=" options
364 Specifies some method-specific option. Several options are separated by comma (or use several
365 .B \-O
366 on cmdline).
367 Each method may have its own specific options, or many not have them at all.
368 To print information about available options, use
369 .BR \-O\ help .
370 .TP
371 .B \-U, \-\-udp
372 Use UDP to particular destination port for tracerouting (instead of increasing
373 the port per each probe). Default port is 53 (dns).
374 .TP
375 .B \-UL
376 Use UDPLITE for tracerouting (default port is 53).
377 .TP
378 .B \-D, \-\-dccp
379 Use DCCP Requests for probes.
380 .TP
381 .BI \-P " protocol" ", --protocol=" protocol
382 Use raw packet of specified protocol for tracerouting. Default protocol is
383 253 (rfc3692).
384 .TP
385 .B \-\-mtu
386 Discover MTU along the path being traced. Implies
387 .BR \-F\ \-N\ 1 .
388 New
389 .I mtu
390 is printed once in a form of
391 .B F=\fINUM
392 at the first probe of a hop which requires such
393 .I mtu
394 to be reached. (Actually, the correspond "frag needed" icmp message
395 normally is sent by the previous hop).
396 .br
397
398 .br
399 Note, that some routers might cache once the seen information
400 on a fragmentation. Thus you can receive the final mtu from a closer hop.
401 Try to specify an unusual
402 .I tos
403 by
404 .B \-t
405 , this can help for one attempt (then it can be cached there as well).
406 .br
407 See
408 .B \-F
409 option for more info.
410 .TP
411 .B \-\-back
412 Print the number of backward hops when it seems different with the forward
413 direction. This number is guessed in assumption that remote hops send reply
414 packets with initial ttl set to either 64, or 128 or 255 (which seems
415 a common practice). It is printed as a negate value in a form of '-NUM' .
416 .SH LIST OF AVAILABLE METHODS
417 In general, a particular traceroute method may have to be chosen by
418 .BR \-M\ name ,
419 but most of the methods have their simple cmdline switches
420 (you can see them after the method name, if present).
421 .SS default
422 The traditional, ancient method of tracerouting. Used by default.
423 .P
424 Probe packets are udp datagrams with so-called "unlikely" destination ports.
425 The "unlikely" port of the first probe is 33434, then for each next probe
426 it is incremented by one. Since the ports are expected to be unused,
427 the destination host normally returns "icmp unreach port" as a final response.
428 (Nobody knows what happens when some application listens for such ports,
429 though).
430 .P
431 This method is allowed for unprivileged users.
432 .SS icmp \ \ \ \-I
433 Most usual method for now, which uses icmp echo packets for probes.
434 .br
435 If you can ping(8) the destination host, icmp tracerouting is applicable
436 as well.
437 .P
438 This method may be allowed for unprivileged users
439 since the kernel 3.0 (IPv4, for IPv6 since 3.11), which supports new
440 .I dgram icmp
441 (or
442 .RI """" ping """)"
443 sockets. To allow such sockets, sysadmin should provide
444 .I net/ipv4/ping_group_range
445 sysctl range to match any group of the user.
446 .br
447 Options:
448 .TP
449 .B raw
450 Use only raw sockets (the traditional way).
451 .br
452 This way is tried first by default (for compatibility reasons),
453 then new dgram icmp sockets as fallback.
454 .TP
455 .B dgram
456 Use only dgram icmp sockets.
457 .SS tcp \ \ \ \ \-T
458 Well-known modern method, intended to bypass firewalls.
459 .br
460 Uses the constant destination port (default is 80, http).
461 .P
462 If some filters are present in the network path, then most probably
463 any "unlikely" udp ports (as for
464 .I default
465 method) or even icmp echoes (as for
466 .IR icmp )
467 are filtered, and whole tracerouting will just stop at such a firewall.
468 To bypass a network filter, we have to use only allowed protocol/port
469 combinations. If we trace for some, say, mailserver, then more likely
470 .B \-T \-p 25
471 can reach it, even when
472 .B \-I
473 can not.
474 .P
475 This method uses well-known "half-open technique", which prevents
476 applications on the destination host from seeing our probes at all.
477 Normally, a tcp syn is sent. For non-listened ports we receive tcp reset,
478 and all is done. For active listening ports we receive tcp syn+ack, but
479 answer by tcp reset (instead of expected tcp ack), this way the remote tcp
480 session is dropped even without the application ever taking notice.
481 .P
482 There is a couple of options for
483 .I tcp
484 method:
485 .TP
486 .B syn,ack,fin,rst,psh,urg,ece,cwr
487 Sets specified tcp flags for probe packet, in any combination.
488 .TP
489 .B flags\fR=\fInum
490 Sets the flags field in the tcp header exactly to
491 .IR num .
492 .TP
493 .B ecn
494 Send syn packet with tcp flags ECE and CWR (for Explicit Congestion
495 Notification, rfc3168).
496 .TP
497 .B sack,timestamps,window_scaling
498 Use the corresponding tcp header option in the outgoing probe packet.
499 .TP
500 .B sysctl
501 Use current sysctl
502 .IR "" ( "/proc/sys/net/*" )
503 setting for the tcp header options above and
504 .BR ecn .
505 Always set by default, if nothing else specified.
506 .TP
507 .B fastopen
508 Use fastopen tcp option (when
509 .BR syn ),
510 for initial cookie negotiation only.
511 .TP
512 .B mss\fR=[\fInum\fR]
513 Use value of
514 .I num
515 (or unchanged) for maxseg tcp header option (when
516 .BR syn ),
517 and discover its clamping along the path being traced.
518 New changed
519 .I mss
520 is printed once in a form of
521 .B M=\fINUM
522 at the first probe on which it was detected.
523 Note, some routers may return too short original fragment
524 in the time exceeded message, making the check impossible.
525 Besides that the responses may come in a different order.
526 All this can lead to a later place of the report
527 (using
528 .BR \-N\ 1
529 can help for the order).
530 .TP
531 .B info
532 Print tcp flags and supported options
533 of final tcp replies when the target host is reached.
534 Allows to determine whether an application listens the port and
535 other useful things.
536 Supported tcp options are all that can be set by
537 .BR \-T\ \-O ,
538 ie.
539 .IR mss ,
540 .IR sack ,
541 .IR timestamps ,
542 .IR window_scaling
543 and
544 .IR fastopen ,
545 with the similar output format (a value for
546 .IR mss
547 and just presence for others).
548 .P
549 Default options is
550 .BR syn,sysctl .
551 .SS tcpconn
552 An initial implementation of tcp method, simple using connect(2) call,
553 which does full tcp session opening. Not recommended for normal use, because
554 a destination application is always affected (and can be confused).
555 .SS udp \ \ \ \ \-U
556 Use udp datagram with constant destination port (default 53, dns).
557 .br
558 Intended to bypass firewall as well.
559 .P
560 Note, that unlike in
561 .I tcp
562 method, the correspond application on the destination host
563 .B always
564 receive our probes (with random data), and most can easily be confused
565 by them. Most cases it will not respond to our packets though, so we will never
566 see the final hop in the trace. (Fortunately, it seems that at least
567 dns servers replies with something angry).
568 .P
569 This method is allowed for unprivileged users.
570 .SS udplite \ \ \-UL
571 Use udplite datagram for probes (with constant destination port,
572 default 53).
573 .P
574 This method is allowed for unprivileged users.
575 .br
576 Options:
577 .TP
578 .B coverage\fR=\fInum
579 Set udplite send coverage to
580 .IR num .
581 .SS dccp \ \ \-D
582 Use DCCP Request packets for probes (rfc4340).
583 .P
584 This method uses the same "half-open technique" as used for TCP.
585 The default destination port is 33434.
586 .P
587 Options:
588 .TP
589 .B service\fR=\fInum
590 Set DCCP service code to
591 .I num
592 (default is 1885957735).
593 .SS raw \ \ \ \ \-P proto
594 Send raw packet of protocol
595 .IR proto .
596 .br
597 No protocol-specific headers are used, just IP header only.
598 .br
599 Implies
600 .B \-N\ 1\fR\ -w\ 5 .
601 .br
602 Options:
603 .TP
604 .B protocol\fR=\fIproto
605 Use IP protocol
606 .I proto
607 (default 253).
608 .SH NOTES
609 .PP
610 To speed up work, normally several probes are sent simultaneously.
611 On the other hand, it creates a "storm of packages", especially
612 in the reply direction. Routers can throttle the rate of icmp responses,
613 and some of replies can be lost. To avoid this, decrease the number
614 of simultaneous probes, or even set it to 1 (like in initial traceroute
615 implementation), i.e.
616 .B \-N 1
617 .PP
618 The final (target) host can drop some of the simultaneous probes,
619 and might even answer only the latest ones. It can lead to extra
620 "looks like expired" hops near the final hop. We use a smart algorithm
621 to auto-detect such a situation, but if it cannot help in your case, just use
622 .B \-N 1
623 too.
624 .PP
625 For even greater stability you can slow down the program's work by
626 .B \-z
627 option, for example use
628 .B \-z 0.5
629 for half-second pause between probes.
630 .PP
631 To avoid an extra waiting, we use adaptive algorithm for timeouts (see
632 .B \-w
633 option for more info). It can lead to premature expiry
634 (especially when response times differ at times) and printing "*"
635 instead of a time. In such a case, switch this algorithm off, by specifying
636 .B \-w
637 with the desired timeout only (for example,
638 .B \-w 5\fR).
639 .PP
640 If some hops report nothing for every method, the last chance to obtain
641 something is to use
642 .B ping -R
643 command (IPv4, and for nearest 8 hops only).
644 .SH SEE ALSO
645 .BR ping (8),
646 .BR ping6 (8),
647 .BR tcpdump (8),
648 .BR netstat (8)