Initial import from FreeBSD RELENG_4:
[dragonfly.git] / usr.sbin / mrouted / mtrace.8
1 .\" Copyright (c) 1995 by the University of Southern California
2 .\" All rights reserved.
3 .\"
4 .\" Permission to use, copy, modify, and distribute this software and its
5 .\" documentation in source and binary forms for non-commercial purposes
6 .\" and without fee is hereby granted, provided that the above copyright
7 .\" notice appear in all copies and that both the copyright notice and
8 .\" this permission notice appear in supporting documentation, and that
9 .\" any documentation, advertising materials, and other materials related
10 .\" to such distribution and use acknowledge that the software was
11 .\" developed by the University of Southern California, Information
12 .\" Sciences Institute.  The name of the University may not be used to
13 .\" endorse or promote products derived from this software without
14 .\" specific prior written permission.
15 .\"
16 .\" THE UNIVERSITY OF SOUTHERN CALIFORNIA makes no representations about
17 .\" the suitability of this software for any purpose.  THIS SOFTWARE IS
18 .\" PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES,
19 .\" INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
20 .\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
21 .\"
22 .\" Other copyrights might apply to parts of this software and are so
23 .\" noted when applicable.
24 .\"
25 .\" This manual page (but not the software) was derived from the
26 .\" manual page for the traceroute program which bears the following
27 .\" copyright notice:
28 .\"
29 .\" Copyright (c) 1988 The Regents of the University of California.
30 .\" All rights reserved.
31 .\"
32 .\" $FreeBSD: src/usr.sbin/mrouted/mtrace.8,v 1.12.2.6 2003/03/11 22:31:29 trhodes Exp $
33 .\"
34 .Dd May 8, 1995
35 .Dt MTRACE 8
36 .Os
37 .Sh NAME
38 .Nm mtrace
39 .Nd print multicast path from a source to a receiver
40 .Sh SYNOPSIS
41 .Nm
42 .Op Fl e Ar extrahops
43 .Op Fl g Ar gateway
44 .Op Fl i Ar if_addr
45 .Op Fl l
46 .Op Fl M
47 .Op Fl m Ar max_hops
48 .Op Fl n
49 .Op Fl O
50 .Op Fl p
51 .Op Fl P
52 .Op Fl q Ar nqueries
53 .Op Fl r Ar resp_dest
54 .Op Fl s
55 .Op Fl S Ar stat_int
56 .Op Fl t Ar ttl
57 .Op Fl T
58 .Op Fl U
59 .Op Fl v
60 .Op Fl w Ar waittime
61 .Ar source
62 .Op Ar receiver
63 .Op Ar group
64 .Sh DESCRIPTION
65 Assessing problems in the distribution of IP multicast traffic
66 can be difficult.
67 The
68 .Nm
69 utility utilizes a tracing feature implemented in multicast routers that is
70 accessed via an extension to the IGMP protocol.  A trace query is
71 passed hop-by-hop along the reverse path from the
72 .Ar receiver
73 to the
74 .Ar source ,
75 collecting hop addresses, packet counts, and routing error conditions
76 along the path, and then the response is returned to the requestor.
77 .Pp
78 The only required parameter is the
79 .Ar source
80 host name or address.  The default
81 .Ar receiver
82 is the host running mtrace, and the default
83 .Ar group
84 is 0.0.0.0, which is sufficient if packet loss
85 statistics for a particular multicast group are not needed.  These two
86 optional parameters may be specified to test the path to some other
87 receiver in a particular group, subject to some constraints as
88 detailed below.  The two parameters can be distinguished because the
89 .Ar receiver
90 is a unicast address and the
91 .Ar group
92 is a multicast address.
93 If the
94 .Fl g
95 flag is specified, the source address defaults to the host running
96 .Nm ,
97 and the receiver defaults to the router being addressed with
98 the
99 .Fl g
100 flag.  In this case, there are no required parameters.
101 .Pp
102 NOTE: For Solaris 2.4/2.5, if the multicast interface is not the default
103 interface, the
104 .Fl i
105 option must be used to set the local address.
106 .Pp
107 The following options are available:
108 .Bl -tag -width indent
109 .It Fl e Ar extrahops
110 Try tracing
111 .Ar extrahops
112 hops past a non-responding router.
113 .It Fl g Ar gwy
114 Send the trace query via unicast directly to the multicast router
115 .Ar gwy
116 rather than multicasting the query.
117 This must be the last-hop router on the path from the intended
118 .Ar source
119 to the
120 .Ar receiver .
121 .Pp
122 .Em CAUTION ! !
123 Versions 3.3 and 3.5 of
124 .Nm mrouted
125 will crash if a trace query is received via a
126 unicast packet and
127 .Nm mrouted
128 has no route for the
129 .Ar source
130 address.  Therefore, do not use the
131 .Fl g
132 option unless the target
133 .Nm mrouted
134 has been verified to be 3.4 or newer than 3.5.
135 .It Fl i Ar addr
136 Use
137 .Ar addr
138 as the local interface address (on a multi-homed host) for sending the
139 trace query and as the default for the
140 .Ar receiver
141 and the response destination.
142 .It Fl l
143 Loop indefinitely printing packet rate and loss statistics for the
144 multicast path every 10 seconds (see
145 .Fl S Ar stat_int ) .
146 .It Fl M
147 Always request the response using multicast rather than attempting
148 unicast for the last half of the tries.
149 .It Fl m Ar n
150 Set to
151 .Ar n
152 the maximum number of hops that will be traced from the
153 .Ar receiver
154 back toward the
155 .Ar source .
156 The default is 32 hops (infinity for the DVMRP routing protocol).
157 .It Fl n
158 Print hop addresses numerically rather than symbolically and numerically
159 (saves a nameserver address-to-name lookup for each router found on the
160 path).
161 .It Fl q Ar n
162 Set the maximum number of query attempts for any hop to
163 .Ar n .
164 The default is 3.
165 .It Fl O
166 Do not use the Router-Alert IP option on those requests which need it.
167 Some versions of Cisco's IOS cannot handle
168 multicast traceroutes with IP options, so it may be necessary to use the
169 .Fl O
170 flag if the last-hop router is a Cisco.
171 .It Fl p
172 Listen passively for multicast responses from traces initiated by
173 others.  This works best when run on a multicast router.
174 .It Fl P
175 Loop indefinitely collecting the path every 10 seconds (see
176 .Fl S Ar stat_int )
177 and printing it when it changes.  Do not print any statistics.
178 .It Fl r Ar host
179 Send the trace response to
180 .Ar host
181 rather than to the host on which
182 .Nm
183 is being run, or to a multicast address other than the one registered
184 for this purpose (224.0.1.32).
185 .It Fl s
186 Print a short form output including only the multicast path and not
187 the packet rate and loss statistics.
188 .It Fl S Ar n
189 Change the interval between statistics gathering traces to
190 .Ar n
191 seconds (default 10 seconds).
192 .It Fl t Ar ttl
193 Set the
194 .Ar ttl
195 (time-to-live, or number of hops) for multicast trace queries and
196 responses.  The default is 127, except for local queries to the "all
197 routers" multicast group which use ttl 1.
198 .It Fl T
199 "Tunnel statistics" mode; show loss rates for overall traffic.
200 These statistics can be extremely misleading.
201 .It Fl U
202 Always request the response using unicast rather than attempting
203 multicast first.
204 .It Fl v
205 Verbose mode; show hop times on the initial trace and statistics display.
206 Also show the route that was used to forward the initial trace.
207 .It Fl w Ar n
208 Set the time to wait for a trace response to
209 .Ar n
210 seconds (default 3 seconds).
211 .El
212 .Sh USAGE
213 .Ss "How It Works"
214 The technique used by the
215 .Nm traceroute
216 utility to trace unicast network paths will not work for IP multicast
217 because ICMP responses are specifically forbidden for multicast traffic.
218 Instead, a tracing feature has been built into the multicast routers.
219 This technique has the advantage that additional information about
220 packet rates and losses can be accumulated while the number of packets
221 sent is minimized.
222 .Pp
223 Since multicast uses
224 reverse path forwarding, the trace is run backwards from the
225 .Ar receiver
226 to the
227 .Ar source .
228 A trace query packet is sent to the last
229 hop multicast router (the leaf router for the desired
230 .Ar receiver
231 address).  The last hop router builds a trace response packet, fills in
232 a report for its hop, and forwards the trace packet using unicast to
233 the router it believes is the previous hop for packets originating
234 from the specified
235 .Ar source .
236 Each router along the path adds its report and forwards the packet.
237 When the trace response packet reaches the first hop router (the router
238 that is directly connected to the source's net), that router sends the
239 completed response to the response destination address specified in
240 the trace query.
241 .Pp
242 If some multicast router along the path does not implement the
243 multicast traceroute feature or if there is some outage, then no
244 response will be returned.  To solve this problem, the trace query
245 includes a maximum hop count field to limit the number of hops traced
246 before the response is returned.  That allows a partial path to be
247 traced.
248 .Pp
249 The reports inserted by each router contain not only the address of
250 the hop, but also the ttl required to forward and some flags to indicate
251 routing errors, plus counts of the total number of packets on the
252 incoming and outgoing interfaces and those forwarded for the specified
253 .Ar group .
254 Taking differences in these counts for two traces separated in time
255 and comparing the output packet counts from one hop with the input
256 packet counts of the next hop allows the calculation of packet rate
257 and packet loss statistics for each hop to isolate congestion
258 problems.
259 .Ss Finding the Last-Hop Router
260 The trace query must be sent to the multicast router which is the
261 last hop on the path from the
262 .Ar source
263 to the
264 .Ar receiver .
265 If the receiver is on the local subnet (as determined using the subnet
266 mask), then the default method is to multicast the trace query to
267 all-routers.mcast.net (224.0.0.2) with a ttl of 1.  Otherwise, the
268 trace query is multicast to the
269 .Ar group
270 address since the last hop router will be a member of that group if
271 the receiver is.  Therefore it is necessary to specify a group that
272 the intended receiver has joined.  This multicast is sent with a
273 default ttl of 127, which may not be sufficient for all cases (changed
274 with the
275 .Fl t
276 option).
277 If the last hop router is known, it may also be addressed directly
278 using the
279 .Fl g
280 option).  Alternatively, if it is desired to trace a group that the
281 receiver has not joined, but it is known that the last-hop router is a
282 member of another group, the
283 .Fl g
284 option may also be used to specify a different multicast address for the
285 trace query.
286 .Pp
287 When tracing from a multihomed host or router, the default receiver
288 address may not be the desired interface for the path from the source.
289 In that case, the desired interface should be specified explicitly as
290 the
291 .Ar receiver .
292 .Ss Directing the Response
293 By default,
294 .Nm
295 first attempts to trace the full reverse path, unless the number of
296 hops to trace is explicitly set with the
297 .Fl m
298 option.  If there is no response within a 3 second timeout interval
299 (changed with the
300 .Fl w
301 option), a "*" is printed and the probing switches to hop-by-hop mode.
302 Trace queries are issued starting with a maximum hop count of one and
303 increasing by one until the full path is traced or no response is
304 received.  At each hop, multiple probes are sent (default is three,
305 changed with
306 .Fl q
307 option).  The first half of the attempts (default is two) are made with
308 the reply address set to standard multicast address, mtrace.mcast.net
309 (224.0.1.32) with the ttl set to 32 more than what's needed to pass the
310 thresholds seen so far along the path to the receiver.  For each
311 additional attempt, the ttl is increased by another 32 each time up to
312 a maximum of 192.  Since the desired router may not be able to send a
313 multicast reply, the remainder of the attempts request that the
314 response be sent via unicast to the host running
315 .Nm .
316 Alternatively, the multicast ttl may be set explicitly with the
317 .Fl t
318 option, the initial multicast attempts can be forced to use unicast
319 instead with the
320 .Fl U
321 option, the final unicast attempts can be forced to use multicast
322 instead with the
323 .Fl M
324 option, or if you specify
325 .Fl UM ,
326 .Nm
327 will first attempt using unicast and then multicast.  For each attempt,
328 if no response is received within the timeout, a "*" is printed.  After
329 the specified number of attempts have failed,
330 .Nm
331 will try to query the next hop router with a DVMRP_ASK_NEIGHBORS2
332 request (as used by the
333 .Nm mrinfo
334 program) to see what kind of router it is.
335 The
336 .Nm
337 utility will try to query three (changed with the
338 .Fl e
339 option) hops past a non-responding router, in the hopes that even
340 though it isn't capable of sending a response, it might be capable of
341 forwarding the request on.
342 .Sh EXAMPLES
343 The output of
344 .Nm
345 is in two sections.  The first section is a short listing of the hops
346 in the order they are queried, that is, in the reverse of the order
347 from the
348 .Ar source
349 to the
350 .Ar receiver .
351 For each hop, a line is printed showing the hop number (counted
352 negatively to indicate that this is the reverse path); the multicast
353 routing protocol (DVMRP, MOSPF, PIM, etc.); the threshold required to
354 forward data (to the previous hop in the listing as indicated by the
355 up-arrow character); and the cumulative delay for the query to reach
356 that hop (valid only if the clocks are synchronized).  This first
357 section ends with a line showing the round-trip time which measures
358 the interval from when the query is issued until the response is
359 received, both derived from the local system clock, and the total
360 ttl required for a packet to travel along this path.  A sample use and
361 output might be:
362 .Pp
363 .Bd -literal
364 oak.isi.edu 80# mtrace -l caraway.lcs.mit.edu 224.2.0.3
365 Mtrace from 18.26.0.170 to 128.9.160.100 via group 224.2.0.3
366 Querying full reverse path...
367   0  oak.isi.edu (128.9.160.100)
368  -1  cub.isi.edu (128.9.160.153)  DVMRP  thresh^ 1  3 ms
369  -2  la.dart.net (140.173.128.1)  DVMRP  thresh^ 1  14 ms
370  -3  dc.dart.net (140.173.64.1)  DVMRP  thresh^ 1  50 ms
371  -4  bbn.dart.net (140.173.32.1)  DVMRP  thresh^ 1  63 ms
372  -5  mit.dart.net (140.173.48.2)  DVMRP  thresh^ 1  71 ms
373  -6  caraway.lcs.mit.edu (18.26.0.170)
374 Round trip time 124 ms; total ttl of 6 required.
375 .Ed
376 .Pp
377 If a hop reports that it is using the default route to forward packets,
378 the word
379 .Em [default]
380 is printed after that hop.  If the
381 .Fl v
382 flag is supplied, the route being used to forward packets is printed
383 in the form
384 .Em [18.26.0/24] .
385 .Pp
386 The second section provides a pictorial view of the path in the
387 forward direction with data flow indicated by arrows pointing downward
388 and the query path indicated by arrows pointing upward.  For each hop,
389 both the entry and exit addresses of the router are shown if
390 different, along with the initial ttl required on the packet in order
391 to be forwarded at this hop and the propagation delay across the hop
392 assuming that the routers at both ends have synchronized clocks.
393 The right half of this section is composed of two sets of statistics.
394 The first column contains the average packet rate for all traffic at
395 each hop.
396 The remaining columns are the
397 number of packets lost, the number of packets sent, the percentage
398 lost, and the average packet rate at each hop.  These statistics are
399 calculated from differences between traces and from hop to hop as
400 explained above.  The first group shows the statistics for all traffic
401 flowing out the interface at one hop and in the interface at the next
402 hop.  The second group shows the statistics only for traffic forwarded
403 from the specified
404 .Ar source
405 to the specified
406 .Ar group .
407 The first group of statistics may be expanded to include loss rates
408 using the
409 .Fl T
410 option.  However, these numbers can be extremely misleading and require
411 detailed knowledge of the routers involved to be interpreted properly.
412 .Pp
413 These statistics are shown on one or two lines for each hop.  Without
414 any options, this second section of the output is printed only once,
415 approximately 10 seconds after the initial trace.  One line is shown
416 for each hop showing the statistics over that 10-second period.  If
417 the
418 .Fl l
419 option is given, the second section is repeated every 10 seconds and
420 two lines are shown for each hop.  The first line shows the statistics
421 for the last 10 seconds, and the second line shows the cumulative
422 statistics over the period since the initial trace, which is 101
423 seconds in the example below.  The second section of the output is
424 omitted if the
425 .Fl s
426 option is set or if no multicast group is specified.
427 .Pp
428 .Bd -literal
429 Waiting to accumulate statistics... Results after 101 seconds:
430
431   Source       Response Dest    Overall   Packet Statistics For Traffic From
432 18.26.0.170    128.9.160.100    Packet    18.26.0.170 To 224.2.0.3
433      |       __/ rtt  125 ms     Rate     Lost/Sent = Pct  Rate
434      v      /    hop   65 ms    -------   ---------------------
435 18.26.0.144
436 140.173.48.2   mit.dart.net
437      |     ^     ttl    1         0 pps      0/2  = --%  0 pps
438      v     |     hop    8 ms      0 pps      0/18 =  0%  0 pps
439 140.173.48.1
440 140.173.32.1   bbn.dart.net
441      |     ^     ttl    2         0 pps      0/2  = --%  0 pps
442      v     |     hop   12 ms      0 pps      0/18 =  0%  0 pps
443 140.173.32.2
444 140.173.64.1   dc.dart.net
445      |     ^     ttl    3        27 pps      0/2  = --%  0 pps
446      v     |     hop   34 ms     26 pps      0/18 =  0%  0 pps
447 140.173.64.2
448 140.173.128.1  la.dart.net
449      |     ^     ttl    4        83 pps      0/2  = --%  0 pps
450      v     |     hop   11 ms     79 pps      0/18 =  0%  0 pps
451 140.173.128.2
452 128.9.160.153  cub.isi.edu
453      |      \\__  ttl    5        83 pps      ?/2         0 pps
454      v         \\ hop   -8 ms     79 pps      ?/18        0 pps
455 128.9.160.100  128.9.160.100
456   Receiver     Query Source
457 .Ed
458 .Pp
459 Because the packet counts may be changing as the trace query is
460 propagating, there may be small errors (off by 1 or 2) in these
461 statistics.  However, those errors should not accumulate, so the
462 cumulative statistics line should increase in accuracy as a new trace
463 is run every 10 seconds.  There are two sources of larger errors, both
464 of which show up as negative losses:
465 .Pp
466 If the input to a node is from a multi-access network with more than
467 one other node attached, then the input count will be (close to) the
468 sum of the output counts from all the attached nodes, but the output
469 count from the previous hop on the traced path will be only part of
470 that.  Hence the output count minus the input count will be negative.
471 .Pp
472 In release 3.3 of the DVMRP multicast forwarding software for SunOS
473 and other systems, a multicast packet generated on a router will be
474 counted as having come in an interface even though it did not.  This
475 creates the negative loss that can be seen in the example above.
476 .Pp
477 Note that these negative losses may mask positive losses.
478 .Pp
479 In the example, there is also one negative hop time.  This simply
480 indicates a lack of synchronization between the system clocks across
481 that hop.  This example also illustrates how the percentage loss is
482 shown as two dashes when the number of packets sent is less than 10
483 because the percentage would not be statistically valid.
484 .Pp
485 A second example shows a trace to a receiver that is not local; the
486 query is sent to the last-hop router with the
487 .Fl g
488 option.  In this example, the trace of the full reverse path resulted
489 in no response because there was a node running an old version of
490 .Nm mrouted
491 that did not implement the multicast traceroute function, so
492 .Nm
493 switched to hop-by-hop mode.  The
494 .Dq Output pruned
495 error code
496 indicates that traffic for group 224.2.143.24 would not be forwarded.
497 .Pp
498 .Bd -literal
499 oak.isi.edu 108# mtrace -g 140.173.48.2 204.62.246.73 \\
500                            butter.lcs.mit.edu 224.2.143.24
501 Mtrace from 204.62.246.73 to 18.26.0.151 via group 224.2.143.24
502 Querying full reverse path... * switching to hop-by-hop:
503   0  butter.lcs.mit.edu (18.26.0.151)
504  -1  jam.lcs.mit.edu (18.26.0.144)  DVMRP  thresh^ 1  33 ms  Output pruned
505  -2  bbn.dart.net (140.173.48.1)  DVMRP  thresh^ 1  36 ms
506  -3  dc.dart.net (140.173.32.2)  DVMRP  thresh^ 1  44 ms
507  -4  darpa.dart.net (140.173.240.2)  DVMRP  thresh^ 16  47 ms
508  -5  * * * noc.hpc.org (192.187.8.2) [mrouted 2.2] didn't respond
509 Round trip time 95 ms
510 .Ed
511 .Sh AUTHORS
512 .An -nosplit
513 Implemented by
514 .An Steve Casner
515 based on an initial prototype written by
516 .An Ajit Thyagarajan .
517 The multicast traceroute mechanism was designed by
518 .An Van Jacobson
519 with help from
520 .An Steve Casner ,
521 .An Steve Deering ,
522 .An Dino Farinacci ,
523 and
524 .An Deb Agrawal ;
525 it was implemented in
526 .Nm mrouted
527 by
528 .An Ajit Thyagarajan
529 and
530 .An Bill Fenner .
531 The option syntax and the output format of
532 .Nm
533 are modeled after the unicast
534 .Nm traceroute
535 program written by
536 .An Van Jacobson .
537 .Sh SEE ALSO
538 .Xr map-mbone 8 ,
539 .Xr mrinfo 8 ,
540 .Xr mrouted 8 ,
541 .Xr traceroute 8
542 .Sh BUGS
543 Statistics collection in passive mode doesn't always produce the same output
544 as when actively collecting data.