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