Import the mtrace "5.1" release. The version number jump is because

mtrace is now distributed seperately from mrouted.
This commit is contained in:
Bill Fenner 1996-12-20 01:29:00 +00:00
parent 1d970643c7
commit 54e56efac0
3 changed files with 1347 additions and 233 deletions

View File

@ -29,7 +29,7 @@
.\" Copyright (c) 1988 The Regents of the University of California.
.\" All rights reserved.
.\"
.\" $Id: mtrace.8,v 3.8 1995/11/29 22:37:21 fenner Rel $
.\" mtrace.8,v 5.1 1996/12/19 21:31:26 fenner Exp
.\"
.TH MTRACE 8 "May 8, 1995"
.UC 6
@ -38,6 +38,9 @@ mtrace \- print multicast path from a source to a receiver
.SH SYNOPSIS
.B mtrace
[
.B \-e
.I extrahops
] [
.B \-g
.I gateway
] [
@ -53,8 +56,12 @@ mtrace \- print multicast path from a source to a receiver
] [
.B \-n
] [
.B \-O
] [
.B \-p
] [
.B \-P
] [
.B \-q
.I nqueries
] [
@ -69,6 +76,10 @@ mtrace \- print multicast path from a source to a receiver
.B \-t
.I ttl
] [
.B \-T
] [
.B \-U
] [
.B \-v
] [
.B \-w
@ -84,9 +95,7 @@ mtrace \- print multicast path from a source to a receiver
Assessing problems in the distribution of IP multicast traffic
can be difficult.
.B mtrace
utilizes a tracing feature implemented in multicast routers
.RB ( mrouted
version 3.3 and later) that is
utilizes a tracing feature implemented in multicast routers that is
accessed via an extension to the IGMP protocol. A trace query is
passed hop-by-hop along the reverse path from the
.I receiver
@ -110,11 +119,23 @@ detailed below. The two parameters can be distinguished because the
is a unicast address and the
.I group
is a multicast address.
If the
.B \-g
flag is specified, the source address defaults to the host running
mtrace, and the receiver defaults to the router being addressed with
the
.B \-g
flag. In this case, there are no required parameters.
.PP
NOTE: For Solaris 2.4/2.5, if the multicast interface is not the default
interface, the -i option must be used to set the local address.
.SH OPTIONS
.TP 8 8
.BI \-e\ extrahops
Try tracing
.I extrahops
hops past a non-responding router.
.TP 8 8
.BI \-g\ gwy
Send the trace query via unicast directly to the multicast router
.I gwy
@ -155,8 +176,8 @@ multicast path every 10 seconds (see
.IR stat_int ).
.TP 8 8
.B \-M
Always send the response using multicast rather than attempting
unicast first.
Always request the response using multicast rather than attempting
unicast for the last half of the tries.
.TP 8 8
.BI \-m\ n
Set to
@ -177,10 +198,22 @@ Set the maximum number of query attempts for any hop to
.IR n .
The default is 3.
.TP 8 8
.B \-O
Do not use the Router-Alert IP option on those requests which need it.
Some versions of Cisco's IOS cannot handle
multicast traceroutes with IP options, so it may be necessary to use the
-O flag if the last-hop router is a Cisco.
.TP 8 8
.B \-p
Listen passively for multicast responses from traces initiated by
others. This works best when run on a multicast router.
.TP 8 8
.B \-P
Loop indefinitely collecting the path every 10 seconds (see
.B \-S
.IR stat_int )
and printing it when it changes. Do not print any statistics.
.TP 8 8
.BI \-r\ host
Send the trace response to
.I host
@ -202,11 +235,20 @@ seconds (default 10 seconds).
Set the
.I ttl
(time-to-live, or number of hops) for multicast trace queries and
responses. The default is 64, except for local queries to the "all
responses. The default is 127, except for local queries to the "all
routers" multicast group which use ttl 1.
.TP 8 8
.B \-T
"Tunnel statistics" mode; show loss rates for overall traffic.
These statistics can be extremely misleading.
.TP 8 8
.B \-U
Always request the response using unicast rather than attempting
multicast first.
.TP 8 8
.B \-v
Verbose mode; show hop times on the initial trace and statistics display.
Also show the route that was used to forward the initial trace.
.TP 8 8
.BI \-w\ n
Set the time to wait for a trace response to
@ -273,7 +315,7 @@ trace query is multicast to the
address since the last hop router will be a member of that group if
the receiver is. Therefore it is necessary to specify a group that
the intended receiver has joined. This multicast is sent with a
default ttl of 64, which may not be sufficient for all cases (changed
default ttl of 127, which may not be sufficient for all cases (changed
with the
.B \-t
option).
@ -307,28 +349,40 @@ increasing by one until the full path is traced or no response is
received. At each hop, multiple probes are sent (default is three,
changed with
.B \-q
option). The first half of the attempts (default is one) are made with
the unicast address of the host running
.B mtrace
as the destination for the response. Since the unicast route may be
blocked, the remainder of attempts request that the response be
multicast to mtrace.mcast.net (224.0.1.32) with the ttl set to 32 more
than what's needed to pass the thresholds seen so far along the path
to the receiver. For the last quarter of the attempts (default is
one), the ttl is increased by another 32 each time up to a maximum of
192. Alternatively, the ttl may be set explicity with the
option). The first half of the attempts (default is two) are made with
the reply address set to standard multicast address, mtrace.mcast.net
(224.0.1.32) with the ttl set to 32 more than what's needed to pass the
thresholds seen so far along the path to the receiver. For each
additional attempt, the ttl is increased by another 32 each time up to
a maximum of 192. Since the desired router may not be able to send a
multicast reply, the remainder of the attempts request that the
response be sent via unicast to the host running
.B mtrace .
Alternatively, the multicast ttl may be set explicitly with the
.B \-t
option and/or the initial unicast attempts can be forced to use
multicast instead with the
option, the initial multicast attempts can be forced to use unicast
instead with the
.B \-U
option, the final unicast attempts can be forced to use multicast
isntead with the
.B \-M
option. For each attempt, if no response is received within the
timeout, a "*" is printed. After the specified number of attempts
have failed,
option, or if you specify
.B \-UM
.B mtrace
will first attempt using unicast and then multicast. For each attempt,
if no response is received within the timeout, a "*" is printed. After
the specified number of attempts have failed,
.B mtrace
will try to query the next hop router with a DVMRP_ASK_NEIGHBORS2
request (as used by the
.B mrinfo
program) to see what kind of router it is.
.B mtrace
will try to query three (changed with the
.B \-e
option) hops past a non-responding router, in the hopes that even
though it isn't capable of sending a response, it might be capable of
forwarding the request on.
.SH EXAMPLES
The output of
.B mtrace
@ -346,7 +400,8 @@ up-arrow character); and the cumulative delay for the query to reach
that hop (valid only if the clocks are synchronized). This first
section ends with a line showing the round-trip time which measures
the interval from when the query is issued until the response is
received, both derived from the local system clock. A sample use and
received, both derived from the local system clock, and the total
ttl required for a packet to travel along this path. A sample use and
output might be:
.PP
.nf
@ -361,18 +416,29 @@ Querying full reverse path...
-4 bbn.dart.net (140.173.32.1) DVMRP thresh^ 1 63 ms
-5 mit.dart.net (140.173.48.2) DVMRP thresh^ 1 71 ms
-6 caraway.lcs.mit.edu (18.26.0.170)
Round trip time 124 ms
Round trip time 124 ms; total ttl of 6 required.
.fi
.PP
If a hop reports that it is using the default route to forward packets,
the word
.B [default]
is printed after that hop. If the
.B \-v
flag is supplied, the route being used to forward packets is printed
in the form
.B [18.26.0/24] .
.PP
The second section provides a pictorial view of the path in the
forward direction with data flow indicated by arrows pointing downward
and the query path indicated by arrows pointing upward. For each hop,
both the entry and exit addresses of the router are shown if
different, along with the initial ttl required on the packet in order
to be forwarded at this hop and the propagation delay across the hop
assuming that the routers at both ends have synchronized clocks. The
right half of this section is composed of several columns of
statistics in two groups. Within each group, the columns are the
assuming that the routers at both ends have synchronized clocks.
The right half of this section is composed of two sets of statistics.
The first column contains the average packet rate for all traffic at
each hop.
The remaining columns are the
number of packets lost, the number of packets sent, the percentage
lost, and the average packet rate at each hop. These statistics are
calculated from differences between traces and from hop to hop as
@ -383,6 +449,11 @@ from the specified
.I source
to the specified
.IR group .
The first group of statistics may be expanded to include loss rates
using the
.B \-T
option. However, these numbers can be extremely misleading and require
detailed knowledge of the routers involved to be interpreted properly.
.PP
These statistics are shown on one or two lines for each hop. Without
any options, this second section of the output is printed only once,
@ -397,7 +468,7 @@ statistics over the period since the initial trace, which is 101
seconds in the example below. The second section of the output is
omitted if the
.B \-s
option is set.
option is set or if no multicast group is specified.
.ie t \{\
.ft C
. ie \w'i'<>\w'm' \{\" looks like this is not proper Courier font
@ -411,30 +482,30 @@ and try again.)
.nf
Waiting to accumulate statistics... Results after 101 seconds:
Source Response Dest Packet Statistics For Only For Traffic
18.26.0.170 128.9.160.100 All Multicast Traffic From 18.26.0.170
| __/ rtt 125 ms Lost/Sent = Pct Rate To 224.2.0.3
v / hop 65 ms --------------------- ------------------
Source Response Dest Overall Packet Statistics For Traffic From
18.26.0.170 128.9.160.100 Packet 18.26.0.170 To 224.2.0.3
| __/ rtt 125 ms Rate Lost/Sent = Pct Rate
v / hop 65 ms ------- ---------------------
18.26.0.144
140.173.48.2 mit.dart.net
| ^ ttl 1 0/6 = --% 0 pps 0/2 = --% 0 pps
v | hop 8 ms 1/52 = 2% 0 pps 0/18 = 0% 0 pps
| ^ ttl 1 0 pps 0/2 = --% 0 pps
v | hop 8 ms 0 pps 0/18 = 0% 0 pps
140.173.48.1
140.173.32.1 bbn.dart.net
| ^ ttl 2 0/6 = --% 0 pps 0/2 = --% 0 pps
v | hop 12 ms 1/52 = 2% 0 pps 0/18 = 0% 0 pps
| ^ ttl 2 0 pps 0/2 = --% 0 pps
v | hop 12 ms 0 pps 0/18 = 0% 0 pps
140.173.32.2
140.173.64.1 dc.dart.net
| ^ ttl 3 0/271 = 0% 27 pps 0/2 = --% 0 pps
v | hop 34 ms -1/2652 = 0% 26 pps 0/18 = 0% 0 pps
| ^ ttl 3 27 pps 0/2 = --% 0 pps
v | hop 34 ms 26 pps 0/18 = 0% 0 pps
140.173.64.2
140.173.128.1 la.dart.net
| ^ ttl 4 -2/831 = 0% 83 pps 0/2 = --% 0 pps
v | hop 11 ms -3/8072 = 0% 79 pps 0/18 = 0% 0 pps
| ^ ttl 4 83 pps 0/2 = --% 0 pps
v | hop 11 ms 79 pps 0/18 = 0% 0 pps
140.173.128.2
128.9.160.153 cub.isi.edu
| \\__ ttl 5 833 83 pps 2 0 pps
v \\ hop -8 ms 8075 79 pps 18 0 pps
| \\__ ttl 5 83 pps ?/2 0 pps
v \\ hop -8 ms 79 pps ?/18 0 pps
128.9.160.100 128.9.160.100
Receiver Query Source
.fi
@ -480,7 +551,7 @@ in no response because there was a node running an old version of
.B mrouted
that did not implement the multicast traceroute function, so
.B mtrace
switched to hop-by-hop mode. The \*(lqRoute pruned\*(rq error code
switched to hop-by-hop mode. The \*(lqOutput pruned\*(rq error code
indicates that traffic for group 224.2.143.24 would not be forwarded.
.PP
.nf
@ -490,7 +561,7 @@ oak.isi.edu 108# mtrace -g 140.173.48.2 204.62.246.73 \\
Mtrace from 204.62.246.73 to 18.26.0.151 via group 224.2.143.24
Querying full reverse path... * switching to hop-by-hop:
0 butter.lcs.mit.edu (18.26.0.151)
-1 jam.lcs.mit.edu (18.26.0.144) DVMRP thresh^ 1 33 ms Route pruned
-1 jam.lcs.mit.edu (18.26.0.144) DVMRP thresh^ 1 33 ms Output pruned
-2 bbn.dart.net (140.173.48.1) DVMRP thresh^ 1 36 ms
-3 dc.dart.net (140.173.32.2) DVMRP thresh^ 1 44 ms
-4 darpa.dart.net (140.173.240.2) DVMRP thresh^ 16 47 ms
@ -514,3 +585,7 @@ program written by Van Jacobson.
.BR mrinfo (8) ,
.BR map-mbone (8) ,
.BR traceroute (8)
.SH BUGS
.PP
Statistics collection in passive mode doesn't always produce the same output
as when actively collecting data.

File diff suppressed because it is too large Load Diff

87
usr.sbin/mrouted/mtrace.h Normal file
View File

@ -0,0 +1,87 @@
/*
* Multicast traceroute related definitions
*
* mtrace.h,v 5.1 1996/12/19 21:31:26 fenner Exp
*/
/*
* The packet format for a traceroute request.
*/
struct tr_query {
u_int32 tr_src; /* traceroute source */
u_int32 tr_dst; /* traceroute destination */
u_int32 tr_raddr; /* traceroute response address */
#if defined(BYTE_ORDER) && (BYTE_ORDER == LITTLE_ENDIAN)
struct {
u_int qid : 24; /* traceroute query id */
u_int ttl : 8; /* traceroute response ttl */
} q;
#else
struct {
u_int ttl : 8; /* traceroute response ttl */
u_int qid : 24; /* traceroute query id */
} q;
#endif /* BYTE_ORDER */
};
#define tr_rttl q.ttl
#define tr_qid q.qid
/*
* Traceroute response format. A traceroute response has a tr_query at the
* beginning, followed by one tr_resp for each hop taken.
*/
struct tr_resp {
u_int32 tr_qarr; /* query arrival time */
u_int32 tr_inaddr; /* incoming interface address */
u_int32 tr_outaddr; /* outgoing interface address */
u_int32 tr_rmtaddr; /* parent address in source tree */
u_int32 tr_vifin; /* input packet count on interface */
u_int32 tr_vifout; /* output packet count on interface */
u_int32 tr_pktcnt; /* total incoming packets for src-grp */
u_char tr_rproto; /* routing protocol deployed on router */
u_char tr_fttl; /* ttl required to forward on outvif */
u_char tr_smask; /* subnet mask for src addr */
u_char tr_rflags; /* forwarding error codes */
};
/* defs within mtrace */
#define QUERY 1
#define RESP 2
#define QLEN sizeof(struct tr_query)
#define RLEN sizeof(struct tr_resp)
/* fields for tr_rflags (forwarding error codes) */
#define TR_NO_ERR 0
#define TR_WRONG_IF 1
#define TR_PRUNED 2
#define TR_OPRUNED 3
#define TR_SCOPED 4
#define TR_NO_RTE 5
#define TR_NO_FWD 7
#define TR_HIT_RP 8
#define TR_RPF_IF 9
#define TR_NO_MULTI 10
#define TR_NO_SPACE 0x81
#define TR_OLD_ROUTER 0x82
#define TR_ADMIN_PROHIB 0x83
/* fields for tr_rproto (routing protocol) */
#define PROTO_DVMRP 1
#define PROTO_MOSPF 2
#define PROTO_PIM 3
#define PROTO_CBT 4
#define PROTO_PIM_SPECIAL 5
#define PROTO_PIM_STATIC 6
#define PROTO_DVMRP_STATIC 7
#define VAL_TO_MASK(x, i) { \
x = htonl(~((1 << (32 - (i))) - 1)); \
};
#if defined(__STDC__) || defined(__GNUC__)
#define JAN_1970 2208988800UL /* 1970 - 1900 in seconds */
#else
#define JAN_1970 2208988800L /* 1970 - 1900 in seconds */
#define const /**/
#endif