Merge branch 'vendor/OPENSSH'
[dragonfly.git] / usr.sbin / mrouted / mrouted.8
1 .\"COPYRIGHT 1989 by The Board of Trustees of Leland Stanford Junior University.
2 .\"
3 .\" $FreeBSD: src/usr.sbin/mrouted/mrouted.8,v 1.16.2.8 2003/03/11 22:31:29 trhodes Exp $
4 .\" $DragonFly: src/usr.sbin/mrouted/mrouted.8,v 1.6 2008/05/02 02:05:08 swildner Exp $
5 .\"
6 .Dd May 8, 1995
7 .Dt MROUTED 8
8 .Os
9 .Sh NAME
10 .Nm mrouted
11 .Nd IP multicast routing daemon
12 .Sh SYNOPSIS
13 .Nm
14 .Op Fl c Ar config_file
15 .Op Fl d Op Ar debug_level
16 .Op Fl p
17 .Sh DESCRIPTION
18 The
19 .Nm
20 utility is an implementation of the Distance-Vector Multicast Routing
21 Protocol (DVMRP), an earlier version of which is specified in RFC 1075.
22 It maintains topological knowledge via a distance-vector routing protocol
23 (like RIP, described in RFC 1058), upon which it implements a multicast
24 datagram forwarding algorithm called Reverse Path Multicasting.
25 .Pp
26 The
27 .Nm
28 utility forwards a multicast datagram along a shortest (reverse) path tree
29 rooted at the subnet on which the datagram originates.
30 The multicast
31 delivery tree may be thought of as a broadcast delivery tree that has
32 been pruned back so that it does not extend beyond those subnetworks
33 that have members of the destination group.
34 Hence, datagrams
35 are not forwarded along those branches which have no listeners of the
36 multicast group.
37 The IP time-to-live of a multicast datagram can be
38 used to limit the range of multicast datagrams.
39 .Pp
40 In order to support multicasting among subnets that are separated by (unicast)
41 routers that do not support IP multicasting,
42 .Nm
43 includes support for
44 "tunnels", which are virtual point-to-point links between pairs of
45 multicast routers
46 located anywhere in an internet.  IP multicast packets are encapsulated for
47 transmission through tunnels, so that they look like normal unicast datagrams
48 to intervening routers and subnets.  The encapsulation
49 is added on entry to a tunnel, and stripped off
50 on exit from a tunnel.
51 The packets are encapsulated using the IP-in-IP protocol
52 (IP protocol number 4).
53 Older versions of
54 .Nm
55 tunneled using IP source routing, which puts a heavy load on some
56 types of routers.
57 This version does not support IP source route tunnelling.
58 .Pp
59 The tunnelling mechanism allows
60 .Nm
61 to establish a virtual internet, for
62 the purpose of multicasting only, which is independent of the physical
63 internet, and which may span multiple Autonomous Systems.  This capability
64 is intended for experimental support of internet multicasting only, pending
65 widespread support for multicast routing by the regular (unicast) routers.
66 The
67 .Nm
68 utility suffers from the well-known scaling problems of any distance-vector
69 routing protocol, and does not (yet) support hierarchical multicast routing.
70 .Pp
71 The
72 .Nm
73 utility
74 handles multicast routing only; there may or may not be unicast routing
75 software running on the same machine as
76 .Nm .
77 With the use of tunnels, it
78 is not necessary for
79 .Nm
80 to have access to more than one physical subnet
81 in order to perform multicast forwarding.
82 .Pp
83 The following options are available:
84 .Bl -tag -width indent
85 .It Fl c Ar config_file
86 Specify an alternative file for configuration commands.
87 Default is
88 .Pa /etc/mrouted.conf .
89 .It Fl d Op Ar debug_level
90 If no
91 .Fl d
92 option is given, or if the debug level is specified as 0,
93 .Nm
94 detaches from the invoking terminal.  Otherwise, it remains attached to the
95 invoking terminal and responsive to signals from that terminal.
96 Regardless of the debug level,
97 .Nm
98 always writes warning and error messages to the system
99 log daemon.  The
100 .Fl debug-level
101 argument is a comma-separated list of any of the following:
102 .Bl -tag -width indent
103 .It "packet"
104 Display the type, source and destination of all packets sent or received.
105 .It "pruning"
106 Display more information about prunes sent or received.
107 .It "routing"
108 Display more information about routing update packets sent or received.
109 .It "route_detail"
110 Display routing updates in excruciating detail.  This is generally way too
111 much information.
112 .It "neighbors"
113 Display information about neighbor discovery.
114 .It "cache"
115 Display insertions, deletions and refreshes of entries in
116 the kernel forwarding cache.
117 .It "timeout"
118 Debug timeouts and periodic processes.
119 .It "interface"
120 Display information about interfaces and their configuration.
121 .It "membership"
122 Display information about group memberships on physical interfaces.
123 .It "traceroute"
124 Display information about multicast traceroute requests
125 passing through this router.
126 .It "igmp"
127 Display IGMP operation including group membership and querier election.
128 .It "icmp"
129 Monitor ICMP handling.
130 .It "rsrr"
131 Monitor RSRR operation.
132 .El
133 .Pp
134 Upon startup,
135 .Nm
136 writes its pid to the file
137 .Pa /var/run/mrouted.pid .
138 .El
139 .Sh CONFIGURATION
140 The
141 .Nm
142 utility automatically configures itself to forward on all multicast-capable
143 interfaces, i.e., interfaces that have the IFF_MULTICAST flag set (excluding
144 the loopback "interface"), and it finds other DVMRP routers directly reachable
145 via those interfaces.  To override the default configuration, or to add
146 tunnel links to other multicast routers,
147 configuration commands may be placed in
148 .Pa /etc/mrouted.conf
149 (or an alternative file, specified by the
150 .Fl c
151 option).
152 .Pp
153 The file format is free-form; whitespace (including newlines) is not
154 significant.
155 The file begins with commands that apply to
156 .Nm Ns 's
157 overall operation or set defaults.
158 .Bl -tag -width indent
159 .It cache_lifetime Ar secs
160 Specifies, in seconds, the lifetime of a multicast forwarding cache
161 entry in the kernel.  Multicast forwarding cache entries in the kernel
162 are checked every
163 .Ar secs
164 seconds, and are refreshed if the source is still
165 active or deleted if not.  Care should be taken when setting this value,
166 as a low value can keep the kernel cache small at the cost of "thrashing"
167 the cache for periodic senders, but high values can cause the kernel
168 cache to grow unacceptably large.  The default is 300 seconds (5 minutes).
169 .It prune_lifetime Ar secs
170 Specifies, in seconds, the average lifetime of prunes that are sent towards
171 parents.  The actual lifetimes will be randomized in the range
172 [.5\fIsecs\fP,1.5\fIsecs\fP].  The default is 7200 (2 hours).  Smaller values
173 cause less state to be kept both at this router and the parent, at the
174 cost of more frequent broadcasts.  However, some routers (e.g.\&
175 .Nm
176 <3.3
177 and all currently known versions of cisco's IOS) do not use the
178 DVMRP generation ID to determine that a neighbor has rebooted.  Prunes
179 sent towards these neighbors should be kept short, in order to shorten
180 the time to recover from a reboot.  For use in this situation, the
181 prune_lifetime keyword may be specified on an interface as described
182 below.
183 .It noflood
184 The
185 .Nm
186 utility
187 uses a DVMRP optimization to prevent having to keep individual routing tables
188 for each neighbor; part of this optimization is that
189 .Nm
190 assumes that it is the forwarder for each of its attached subnets on
191 startup.  This can cause duplicates for a short period (approximately
192 one full route report interval), since both the router that just
193 started up and the proper forwarder will be forwarding traffic.  This
194 behavior can be turned off with the noflood keyword;
195 .Nm
196 will not assume that it is the forwarder on startup.
197 Turning on noflood can cause black holes on restart, which will generally
198 last approximately one full route report interval.
199 The noflood keyword can also be specified on individual interfaces.
200 .It rexmit_prunes Ar [on|off]
201 Default is to retransmit prunes on all point-to-point interfaces
202 (including tunnels) but no multi-access interfaces.  This option
203 may be used to make the default on (or off) for all interfaces.
204 The rexmit_prunes keyword can also be specified on individual interfaces.
205 .It name Ar "boundary-name scoped-addr/mask-len"
206 Associates
207 .Ar boundary-name
208 with the boundary described by
209 .Ar scoped-addr/mask-len ,
210 to help make interface configurations
211 more readable and reduce repetition in the configuration file.
212 .El
213 .Pp
214 The second section of the configuration file, which may optionally
215 be empty, describes options that apply to physical interfaces.
216 .Bl -tag -width indent
217 .It phyint Ar "local-addr|ifname"
218 The phyint command does nothing by itself; it is simply a place holder
219 which interface-specific commands may follow.  An interface address or
220 name may be specified.
221 .It disable
222 Disables multicast forwarding on this interface.  By default,
223 .Nm
224 discovers all locally attached multicast capable interfaces and forwards
225 on all of them.
226 .It netmask Ar netmask
227 If the kernel's netmask does not accurately reflect
228 the subnet (e.g. you're using proxy-ARP in lieu of IP subnetting), use the
229 netmask command to describe the real netmask.
230 .It altnet Ar network/mask-len
231 If a phyint is attached to multiple IP subnets, describe each additional subnet
232 with the altnet keyword.  This command may be specified multiple times
233 to describe multiple subnets.
234 .It igmpv1
235 If there are any IGMPv1 routers on the phyint, use the \fBigmpv1\fP
236 keyword to force
237 .Nm
238 into IGMPv1 mode.  All routers on the phyint
239 must use the same version of IGMP.
240 .It force_leaf
241 Force
242 .Nm
243 to ignore other routers on this interface.
244 .Nm
245 will never send or accept neighbor probes or
246 route reports on this interface.
247 .El
248 .Pp
249 In addition, the common vif commands described later may all be used on
250 a phyint.
251 .Pp
252 The third section of the configuration file, also optional, describes
253 the configuration of any DVMRP tunnels this router might have.
254 .Bl -tag -width indent
255 .It tunnel Ar "local-addr|ifname" Ar "remote-addr|remote-hostname"
256 This command establishes a DVMRP tunnel between this host (on the interface
257 described by
258 .Ar local-addr
259 or
260 .Ar ifname )
261 and a remote host (identified by
262 .Ar remote-addr
263 or
264 .Ar remote-hostname ) .
265 A remote hostname may only be used if
266 it maps to a single IP address.
267 A tunnel must be configured on both routers before it can be used.
268 .Pp
269 Be careful that the unicast route to the remote address goes out the
270 interface specified by the
271 .Ar "local-addr|ifname"
272 argument.  Some
273 .Ux
274 kernels rewrite the source address of
275 .Nm Ns 's
276 packets on their way out to contain the address of the transmission
277 interface.  This is best assured via a static host route.
278 .El
279 .Pp
280 The common vif commands described below
281 may all be used on tunnels or phyints.
282 .Bl -tag -width indent
283 .It metric Ar m
284 The metric is the "cost" associated with receiving a datagram on the given
285 interface or tunnel; it may be used to influence the choice of routes.
286 The metric defaults to 1.  Metrics should be kept as small as possible,
287 because DVMRP cannot route along paths with a sum of metrics greater
288 than 31.
289 .It advert_metric Ar m
290 The advert_metric is the "cost" associated with sending a datagram
291 on the given interface or tunnel; it may be used to influence the choice
292 of routes.  The advert_metric defaults to 0.  Note that the effective
293 metric of a link is one end's metric plus the other end's advert_metric.
294 .It threshold Ar t
295 The threshold is the minimum IP time-to-live required for a multicast datagram
296 to be forwarded to the given interface or tunnel.  It is used to control the
297 scope of multicast datagrams.  (The TTL of forwarded packets is only compared
298 to the threshold, it is not decremented by the threshold.  Every multicast
299 router decrements the TTL by exactly 1.)  The default threshold is 1.
300 .Pp
301 In general, all multicast routers
302 connected to a particular subnet or tunnel should
303 use the same metric and threshold for that subnet or tunnel.
304 .It rate_limit Ar r
305 The rate_limit option allows the network administrator to specify a
306 certain bandwidth in Kbits/second which would be allocated to multicast
307 traffic.  It defaults 0 (unlimited).
308 .It boundary Ar "boundary-name|scoped-addr/mask-len"
309 The boundary option allows an interface
310 to be configured as an administrative boundary for the specified
311 scoped address.
312 Packets belonging to this address will not
313 be forwarded on a scoped interface.  The boundary option accepts either
314 a name or a boundary spec.  This command may be specified several times
315 on an interface in order to describe multiple boundaries.
316 .It passive
317 No packets will be sent on this link or tunnel until we hear from the other
318 end.  This is useful for the "server" end of a tunnel that goes over
319 a dial-on-demand link; configure the "server" end as passive and
320 it will not send its periodic probes until it hears one from the other
321 side, so will not keep the link up.  If this option is specified on both
322 ends of a tunnel, the tunnel will never come up.
323 .It noflood
324 As described above, but only applicable to this interface/tunnel.
325 .It prune_lifetime Ar secs
326 As described above, but only applicable to this interface/tunnel.
327 .It rexmit_prunes Ar "[on|off]"
328 As described above, but only applicable to this interface/tunnel.
329 Recall that prune retransmission
330 defaults to on on point-to-point links and tunnels, and off on
331 multi-access links.
332 .It allow_nonpruners
333 By default,
334 .Nm
335 refuses to peer with DVMRP neighbors that
336 do not claim to support pruning.  This option allows such peerings
337 on this interface.
338 .It notransit
339 A specialized case of route filtering; no route learned from an interface
340 marked "notransit" will be advertised on another interface marked
341 "notransit".  Marking only a single interface "notransit" has no meaning.
342 .It accept|deny Ar "(route/mask-len [exact])+" Op bidir
343 The
344 .Li accept
345 and
346 .Li deny
347 commands allow rudimentary route filtering.  The
348 .Li accept
349 command causes
350 .Nm
351 to accept only the listed routes on the configured interface; the
352 .Li deny
353 command causes
354 .Nm
355 to accept all but the listed routes.
356 Only one of
357 .Li accept
358 or
359 .Li deny
360 commands may be used on a given interface.
361 .Pp
362 The list of routes follows the
363 .Li accept
364 or
365 .Li deny
366 keyword.  If the keyword
367 .Ar exact
368 follows a route, then only that route is matched; otherwise, that route
369 and any more specific route is matched.  For example,
370 .Li deny 0/0
371 denys all routes, while
372 .Li deny 0/0 exact
373 denys only the default route.  The default route may also be specified
374 with the
375 .Li default
376 keyword.
377 .Pp
378 The
379 .Ar bidir
380 keyword enables bidirectional route filtering; the filter will be applied
381 to routes on both output and input.  Without the
382 .Ar bidir
383 keyword,
384 .Li accept
385 and
386 .Li deny
387 filters are only applied on input.  Poison reverse routes are never
388 filtered out.
389 .El
390 .Pp
391 The
392 .Nm
393 utility will not initiate execution if it has fewer than two enabled vifs,
394 where a vif (virtual interface) is either a physical multicast-capable
395 interface or a tunnel.  It will log a warning if all of its vifs are
396 tunnels; such an
397 .Nm
398 configuration would be better replaced by more
399 direct tunnels (i.e. eliminate the middle man).
400 .Sh "EXAMPLE CONFIGURATION"
401 This is an example configuration for a mythical multicast router at a big
402 school.
403 .Bd -literal
404 #
405 # mrouted.conf example
406 #
407 # Name our boundaries to make it easier
408 name LOCAL 239.255.0.0/16
409 name EE 239.254.0.0/16
410 #
411 # le1 is our gateway to compsci, don't forward our
412 #     local groups to them
413 phyint le1 boundary EE
414 #
415 # le2 is our interface on the classroom net, it has four
416 #     different length subnets on it.
417 # note that you can use either an ip address or an
418 # interface name
419 phyint 172.16.12.38 boundary EE altnet 172.16.15.0/26
420         altnet 172.16.15.128/26 altnet 172.16.48.0/24
421 #
422 # atm0 is our ATM interface, which doesn't properly
423 #      support multicasting.
424 phyint atm0 disable
425 #
426 # This is an internal tunnel to another EE subnet
427 # Remove the default tunnel rate limit, since this
428 #   tunnel is over ethernets
429 tunnel 192.168.5.4 192.168.55.101 metric 1 threshold 1
430         rate_limit 0
431 #
432 # This is our tunnel to the outside world.
433 # Careful with those boundaries, Eugene.
434 tunnel 192.168.5.4 10.11.12.13 metric 1 threshold 32
435         boundary LOCAL boundary EE
436 .Ed
437 .Sh SIGNALS
438 The
439 .Nm
440 utility responds to the following signals:
441 .Bl -tag -width indent
442 .It HUP
443 Restarts
444 .Nm .
445 The configuration file is reread every time this signal is evoked.
446 .It INT
447 Terminate execution gracefully (i.e., by sending
448 good-bye messages to all neighboring routers).
449 .It TERM
450 Same as INT.
451 .It USR1
452 Dump the internal routing tables to
453 .Pa /var/tmp/mrouted.dump .
454 .It USR2
455 Dump the internal cache tables to
456 .Pa /var/tmp/mrouted.cache .
457 .It QUIT
458 Dump the internal routing tables to stderr (only if
459 .Nm
460 was invoked with a non-zero debug level).
461 .El
462 .Pp
463 For convenience in sending signals,
464 .Nm
465 writes its pid to
466 .Pa /var/run/mrouted.pid
467 upon startup.
468 .Sh FILES
469 .Bl -tag -width /var/tmp/mrouted.cache -compact
470 .It Pa /etc/mrouted.conf
471 .It Pa /var/run/mrouted.pid
472 .It Pa /var/tmp/mrouted.dump
473 .It Pa /var/tmp/mrouted.cache
474 .El
475 .Sh EXAMPLES
476 The routing tables look like this:
477 .Bd -literal
478 Virtual Interface Table
479  Vif  Local-Address                    Metric  Thresh  Flags
480   0   36.2.0.8      subnet: 36.2/16       1       1    querier
481                     groups: 224.0.2.1
482                             224.0.0.4
483                    pkts in: 3456
484                   pkts out: 2322323
485
486   1   36.11.0.1     subnet: 36.11/16      1       1    querier
487                     groups: 224.0.2.1
488                             224.0.1.0
489                             224.0.0.4
490                    pkts in: 345
491                   pkts out: 3456
492
493   2   36.2.0.8      tunnel: 36.8.0.77     3       1
494                      peers: 36.8.0.77 (3.255)
495                 boundaries: 239.0.1/24
496                           : 239.1.2/24
497                    pkts in: 34545433
498                   pkts out: 234342
499
500   3   36.2.0.8      tunnel: 36.6.8.23     3       16
501
502 Multicast Routing Table (1136 entries)
503  Origin-Subnet   From-Gateway    Metric Tmr In-Vif  Out-Vifs
504  36.2                               1    45    0    1* 2  3*
505  36.8            36.8.0.77          4    15    2    0* 1* 3*
506  36.11                              1    20    1    0* 2  3*
507  .
508  .
509  .
510 .Ed
511 .Pp
512 In this example, there are four vifs connecting to two subnets and two
513 tunnels.  The vif 3 tunnel is not in use (no peer address). The vif 0 and
514 vif 1 subnets have some groups present; tunnels never have any groups.  This
515 instance of
516 .Nm
517 is the one responsible for sending periodic group
518 membership queries on the vif 0 and vif 1 subnets, as indicated by the
519 "querier" flags.
520 The list of boundaries indicate the scoped addresses on that
521 interface.
522 A count of the no. of incoming and outgoing packets is also
523 shown at each interface.
524 .Pp
525 Associated with each subnet from which a multicast datagram can originate
526 is the address of the previous hop router (unless the subnet is directly-
527 connected), the metric of the path back to the origin, the amount of time
528 since we last received an update for this subnet, the incoming vif for
529 multicasts from that origin, and a list of outgoing vifs.  "*" means that
530 the outgoing vif is connected to a leaf of the broadcast tree rooted at the
531 origin, and a multicast datagram from that origin will be forwarded on that
532 outgoing vif only if there are members of the destination group on that leaf.
533 .Pp
534 The
535 .Nm
536 utility also maintains a copy of the kernel forwarding cache table.
537 Entries
538 are created and deleted by
539 .Nm .
540 .Pp
541 The cache tables look like this:
542 .Bd -literal
543 Multicast Routing Cache Table (147 entries)
544  Origin             Mcast-group     CTmr  Age Ptmr IVif Forwvifs
545  13.2.116/22        224.2.127.255     3m   2m    -  0    1
546 >13.2.116.19
547 >13.2.116.196
548  138.96.48/21       224.2.127.255     5m   2m    -  0    1
549 >138.96.48.108
550  128.9.160/20       224.2.127.255     3m   2m    -  0    1
551 >128.9.160.45
552  198.106.194/24     224.2.135.190     9m  28s   9m  0P
553 >198.106.194.22
554 .Ed
555 .Pp
556 Each entry is characterized by the origin subnet number and mask and the
557 destination multicast group.
558 .Pp
559 The 'CTmr' field indicates the lifetime
560 of the entry.  The entry is deleted from the cache table
561 (or refreshed, if traffic is flowing)
562 when the timer decrements to zero.  The 'Age' field is the time since
563 this cache entry was originally created.  Since cache entries get refreshed
564 if traffic is flowing, routing entries can grow very old.
565 .Pp
566 The 'Ptmr' field is simply a dash if no prune was sent upstream, or the
567 amount of time until the upstream prune will time out.
568 .Pp
569 The 'Ivif' field indicates the
570 incoming vif for multicast packets from that origin.  Each router also
571 maintains a record of the number of prunes received from neighboring
572 routers for a particular source and group.
573 If there are no members of
574 a multicast group on any downward link of the multicast tree for a
575 subnet, a prune message is sent to the upstream router.
576 They are
577 indicated by a "P" after the vif number.
578 .Pp
579 The Forwvifs field shows the
580 interfaces along which datagrams belonging to the source-group are
581 forwarded.
582 A "p" indicates that no datagrams are being forwarded along
583 that interface.
584 An unlisted interface is a leaf subnet with no
585 members of the particular group on that subnet.
586 A "b" on an interface
587 indicates that it is a boundary interface, i.e. traffic will not be
588 forwarded on the scoped address on that interface.
589 .Pp
590 An additional line with a ">" as the first character is printed for
591 each source on the subnet.  Note that there can be many sources in
592 one subnet.
593 An additional line with a "<" as the first character is printed
594 describing any prunes received from downstream dependent neighbors
595 for this subnet and group.
596 .Sh SEE ALSO
597 .Xr map-mbone 8 ,
598 .Xr mrinfo 8 ,
599 .Xr mtrace 8
600 .Pp
601 DVMRP is described, along with other multicast routing algorithms, in the
602 paper "Multicast Routing in Internetworks and Extended LANs" by S. Deering,
603 in the Proceedings of the ACM SIGCOMM '88 Conference.
604 .Sh AUTHORS
605 .An Steve Deering ,
606 .An Ajit Thyagarajan ,
607 .An Bill Fenner .