xref: /netbsd/usr.sbin/mrouted/mrouted.8 (revision 6550d01e)
1.\"	$NetBSD: mrouted.8,v 1.17 2009/03/15 10:16:28 joerg Exp $
2.\"	$OpenBSD: mrouted.8,v 1.11 2003/03/03 15:14:28 deraadt Exp $
3.\" The mrouted program is covered by the license in the accompanying file
4.\" named "LICENSE".  Use of the mrouted program represents acceptance of
5.\" the terms and conditions listed in that file.
6.\"
7.\" The mrouted program is COPYRIGHT 1989 by The Board of Trustees of
8.\" Leland Stanford Junior University.
9.Dd May 8, 1995
10.Dt MROUTED 8
11.Os
12.Sh NAME
13.Nm mrouted
14.Nd IP multicast routing daemon
15.Sh SYNOPSIS
16.Nm mrouted
17.Op Fl c Ar config_file
18.Op Fl d Ar debug_level
19.Op Fl p
20.Sh DESCRIPTION
21.Nm
22is an implementation of the Distance-Vector Multicast Routing
23Protocol (DVMRP), an earlier version of which is specified in RFC 1075.
24It maintains topological knowledge via a distance-vector routing protocol
25(like RIP, described in RFC 1058), upon which it implements a multicast
26datagram forwarding algorithm called Reverse Path Multicasting.
27.Pp
28.Nm
29forwards a multicast datagram along a shortest (reverse) path tree
30rooted at the subnet on which the datagram originates.
31The multicast
32delivery tree may be thought of as a broadcast delivery tree that has
33been pruned back so that it does not extend beyond those subnetworks
34that have members of the destination group.
35Hence, datagrams are not forwarded along those branches which have no
36listeners of the multicast group.
37The IP time-to-live of a multicast datagram can be
38used to limit the range of multicast datagrams.
39.Pp
40In order to support multicasting among subnets that are separated by (unicast)
41routers that do not support IP multicasting,
42.Nm
43includes support for
44"tunnels", which are virtual point-to-point links between pairs of
45.Nm
46daemons located anywhere in an internet.
47IP multicast packets are encapsulated
48for transmission through tunnels, so that they look like normal unicast
49datagrams to intervening routers and subnets.
50The encapsulation is added on
51entry to a tunnel, and stripped off on exit from a tunnel.
52By default, the packets are encapsulated using the IP-in-IP protocol
53(IP protocol number 4).
54Older versions of
55.Nm
56tunnel using IP source routing, which puts a heavy load on some
57types of routers.
58This version does not support IP source route tunneling.
59.Pp
60The tunneling mechanism allows
61.Nm
62to establish a virtual internet, for
63the purpose of multicasting only, which is independent of the physical
64internet, and which may span multiple Autonomous Systems.
65This capability
66is intended for experimental support of internet multicasting only, pending
67widespread support for multicast routing by the regular (unicast) routers.
68.Nm
69suffers from the well-known scaling problems of any distance-vector
70routing protocol, and does not (yet) support hierarchical multicast routing.
71.Pp
72.Nm
73handles multicast routing only; there may or may not be unicast routing
74software running on the same machine as
75.Nm mrouted .
76With the use of tunnels, it is not necessary for
77.Nm
78to have access to more than one physical subnet
79in order to perform multicast forwarding.
80.Sh INVOCATION
81If no
82.Fl d
83option is given, or if the debug level is specified as 0,
84.Nm
85detaches from the invoking terminal.
86Otherwise, it remains attached to the
87invoking terminal and responsive to signals from that terminal.
88If
89.Fl d
90is given with no argument, the debug level defaults to 2.
91Regardless of the debug level,
92.Nm
93always writes warning and error messages to the system
94log daemon.
95Non-zero debug levels have the following effects:
96.Bl -hang -compact -offset indent
97.It 1
98all syslog'ed messages are also printed to stderr.
99.It 2
100all level 1 messages plus notifications of "significant"
101events are printed to stderr.
102.It 3
103all level 2 messages plus notifications of all packet
104arrivals and departures are printed to stderr.
105.El
106.Pp
107Upon startup, mrouted writes its pid to the file
108.Pa /var/run/mrouted.pid .
109.Sh CONFIGURATION
110.Nm
111automatically configures itself to forward on all multicast-capable
112interfaces, i.e., interfaces that have the IFF_MULTICAST flag set (excluding
113the loopback "interface"), and it finds other
114.Nm
115directly reachable via those interfaces.
116To override the default configuration, or to add tunnel links to other
117.Nm
118configuration commands may be placed in
119.Pa /etc/mrouted.conf
120(or an alternative file, specified by the
121.Fl c
122option).
123There are four types of configuration commands:
124.Bl -item -offset indent
125.It
126.Tn phyint \*[Lt]local-addr\*[Gt] [disable] [metric \*[Lt]m\*[Gt]]
127.Bl -tag -width flag -compact -offset indent
128.It [threshold \*[Lt]t\*[Gt]] [rate_limit \*[Lt]b\*[Gt]]
129.It [boundary (\*[Lt]boundary-name\*[Gt]|\*[Lt]scoped-addr\*[Gt]/\*[Lt]mask-len\*[Gt])]
130.It [altnet \*[Lt]network\*[Gt]/\*[Lt]mask-len\*[Gt]]
131.El
132.It
133.Bl -tag -width flag -compact -offset indent
134.It Tn tunnel \*[Lt]local-addr\*[Gt] \*[Lt]remote-addr\*[Gt] [metric \*[Lt]m\*[Gt]]
135.It [threshold \*[Lt]t\*[Gt]] [rate_limit \*[Lt]b\*[Gt]]
136.It [boundary (\*[Lt]boundary-name\*[Gt]|\*[Lt]scoped-addr\*[Gt]/\*[Lt]mask-len\*[Gt])]
137.El
138.It
139.Tn cache_lifetime \*[Lt]ct\*[Gt]
140.It
141.Tn pruning \*[Lt]off/on\*[Gt]
142.It
143.Tn name \*[Lt]boundary-name\*[Gt] \*[Lt]scoped-addr\*[Gt]/\*[Lt]mask-len\*[Gt]
144.El
145.Pp
146The file format is free-form; whitespace (including newlines) is not
147significant.
148The
149.Ar boundary
150and
151.Ar altnet
152options may be specified as many times as necessary.
153.Pp
154The phyint command can be used to disable multicast routing on the physical
155interface identified by local IP address
156.Ar \*[Lt]local-addr\*[Gt] ,
157or to associate a non-default metric or threshold with the specified
158physical interface.
159The local IP address
160.Ar \*[Lt]local-addr\*[Gt]
161may be replaced by the interface name (e.g., le0).
162If a phyint is attached to multiple IP subnets, describe each additional subnet
163with the altnet keyword.
164Phyint commands must precede tunnel commands.
165.Pp
166The tunnel command can be used to establish a tunnel link between local
167IP address
168.Ar \*[Lt]local-addr\*[Gt]
169and remote IP address
170.Ar \*[Lt]remote-addr\*[Gt] ,
171and to associate a non-default metric or threshold with that tunnel.
172The local IP address
173.Ar \*[Lt]local-addr\*[Gt]
174may be replaced by the interface name (e.g., le0).
175The remote IP address
176.Ar \*[Lt]remote-addr\*[Gt]
177may be replaced by a host name, if and only if the host name has a single
178IP address associated with it.
179The tunnel must be set up in the mrouted.conf files of both routers before
180it can be used.
181.\"For backwards compatibility with older
182.\".IR mrouted s,
183.\"the srcrt keyword specifies
184.\"encapsulation using IP source routing.
185.Pp
186The cache_lifetime is a value that determines the amount of time that a
187cached multicast route stays in kernel before timing out.
188The value of this entry should lie between 300 (5 min) and 86400 (1 day).
189It defaults to 300.
190.Pp
191The
192.Ar pruning
193option is provided for
194.Nm
195to act as a non-pruning router.
196It is also possible to start
197.Nm
198in a non-pruning mode using the
199.Fl p
200option on the command line.
201It is expected that a router would be configured
202in this manner for test purposes only.
203The default mode is pruning enabled.
204.Pp
205You may assign names to boundaries to make configuration easier with
206the name keyword.
207The boundary option on phyint or tunnel commands
208can accept either a name or a boundary.
209.Pp
210The metric is the "cost" associated with sending a datagram on the given
211interface or tunnel; it may be used to influence the choice of routes.
212The metric defaults to 1.
213Metrics should be kept as small as possible, because
214.Nm
215cannot route along paths with a sum of metrics greater than 31.
216.Pp
217The threshold is the minimum IP time-to-live required for a multicast datagram
218to be forwarded to the given interface or tunnel.
219It is used to control the scope of multicast datagrams.
220(The TTL of forwarded packets is only compared
221to the threshold, it is not decremented by the threshold.
222Every multicast router decrements the TTL by 1.)
223The default threshold is 1.
224.Pp
225In general, all
226.Nm
227connected to a particular subnet or tunnel should
228use the same metric and threshold for that subnet or tunnel.
229.Pp
230The rate_limit option allows the network administrator to specify a
231certain bandwidth in Kbits/second which would be allocated to multicast
232traffic.
233It defaults to 500Kbps on tunnels, and 0 (unlimited) on physical
234interfaces.
235.Pp
236The boundary option allows an interface
237to be configured as an administrative boundary for the specified
238scoped address.
239Packets belonging to this address will not
240be forwarded on a scoped interface.
241The boundary option accepts either
242a name or a boundary spec.
243.Pp
244.Nm
245will not initiate execution if it has fewer than two enabled vifs,
246where a vif (virtual interface) is either a physical multicast-capable
247interface or a tunnel.
248It will log a warning if all of its vifs are tunnels; such an
249.Nm
250configuration would be better replaced by more
251direct tunnels (i.e., eliminate the middle man).
252.Sh EXAMPLE CONFIGURATION
253This is an example configuration for a mythical multicast router at a big
254school.
255.Bd -unfilled -compact -offset left
256#
257# mrouted.conf example
258#
259# Name our boundaries to make it easier.
260name LOCAL 239.255.0.0/16
261name EE 239.254.0.0/16
262#
263# le1 is our gateway to compsci, don't forward our
264# local groups to them.
265phyint le1 boundary EE
266#
267# le2 is our interface on the classroom net, it has four
268# different length subnets on it.
269# Note that you can use either an ip address or an
270# interface name
271phyint 172.16.12.38 boundary EE altnet 172.16.15.0/26
272	altnet 172.16.15.128/26 altnet 172.16.48.0/24
273#
274# atm0 is our ATM interface, which doesn't properly
275# support multicasting.
276phyint atm0 disable
277#
278# This is an internal tunnel to another EE subnet.
279# Remove the default tunnel rate limit, since this
280# tunnel is over ethernets.
281tunnel 192.168.5.4 192.168.55.101 metric 1 threshold 1
282	rate_limit 0
283#
284# This is our tunnel to the outside world.
285# Careful with those boundaries, Eugene.
286tunnel 192.168.5.4 10.11.12.13 metric 1 threshold 32
287	boundary LOCAL boundary EE
288.Ed
289.Sh SIGNALS
290.Nm
291responds to the following signals:
292.Bl -tag -width TERM -compact
293.It HUP
294restarts
295.Nm mrouted .
296The configuration file is reread every time this signal is evoked.
297.It INT
298terminates execution gracefully (i.e., by sending
299good-bye messages to all neighboring routers).
300.It TERM
301same as INT
302.It USR1
303dumps the internal routing tables to
304.Pa /var/tmp/mrouted.dump .
305.It USR2
306dumps the internal cache tables to
307.Pa /var/tmp/mrouted.cache .
308.It QUIT
309dumps the internal routing tables to stderr (only if
310.Nm
311was invoked with a non-zero debug level).
312.El
313.Pp
314For convenience in sending signals,
315.Nm
316writes its pid to
317.Pa /var/run/mrouted.pid
318upon startup.
319.Sh FILES
320.Bl -tag -width /var/tmp/mrouted.cache -compact
321.It Pa /etc/mrouted.conf
322.It Pa /var/run/mrouted.pid
323.It Pa /var/tmp/mrouted.dump
324.It Pa /var/tmp/mrouted.cache
325.El
326.Sh EXAMPLES
327The routing tables look like this:
328.Pp
329.Bd -literal -compact -offset left
330Virtual Interface Table
331 Vif  Local-Address                    Metric  Thresh  Flags
332  0   36.2.0.8      subnet: 36.2          1       1    querier
333                    groups: 224.0.2.1
334                            224.0.0.4
335                   pkts in: 3456
336                  pkts out: 2322323
337
338  1   36.11.0.1     subnet: 36.11         1       1    querier
339                    groups: 224.0.2.1
340                            224.0.1.0
341                            224.0.0.4
342                   pkts in: 345
343                  pkts out: 3456
344
345  2   36.2.0.8      tunnel: 36.8.0.77     3       1
346                     peers: 36.8.0.77 (2.2)
347                boundaries: 239.0.1
348                          : 239.1.2
349                   pkts in: 34545433
350                  pkts out: 234342
351
352  3   36.2.0.8	    tunnel: 36.6.8.23	  3       16
353
354Multicast Routing Table (1136 entries)
355 Origin-Subnet   From-Gateway    Metric Tmr In-Vif  Out-Vifs
356 36.2                               1    45    0    1* 2  3*
357 36.8            36.8.0.77          4    15    2    0* 1* 3*
358 36.11                              1    20    1    0* 2  3*
359 .
360 .
361 .
362.Ed
363.Pp
364In this example, there are four vifs connecting to two subnets and two
365tunnels.
366The vif 3 tunnel is not in use (no peer address).
367The vif 0 and
368vif 1 subnets have some groups present; tunnels never have any groups.
369This instance of
370.Nm
371is the one responsible for sending periodic group
372membership queries on the vif 0 and vif 1 subnets, as indicated by the
373"querier" flags.
374The list of boundaries indicate the scoped addresses on that interface.
375A count of the number of incoming and outgoing packets is also
376shown at each interface.
377.Pp
378Associated with each subnet from which a multicast datagram can originate
379is the address of the previous hop router (unless the subnet is directly-
380connected), the metric of the path back to the origin, the amount of time
381since we last received an update for this subnet, the incoming vif for
382multicasts from that origin, and a list of outgoing vifs.
383"*" means that
384the outgoing vif is connected to a leaf of the broadcast tree rooted at the
385origin, and a multicast datagram from that origin will be forwarded on that
386outgoing vif only if there are members of the destination group on that leaf.
387.Pp
388.Nm
389also maintains a copy of the kernel forwarding cache table.
390Entries are created and deleted by
391.Nm mrouted .
392.Pp
393The cache tables look like this:
394.Pp
395.Bd -unfilled -compact -offset left
396Multicast Routing Cache Table (147 entries)
397 Origin             Mcast-group     CTmr  Age Ptmr IVif Forwvifs
398 13.2.116/22        224.2.127.255     3m   2m    -  0    1
399\*[Gt]13.2.116.19
400\*[Gt]13.2.116.196
401 138.96.48/21       224.2.127.255     5m   2m    -  0    1
402\*[Gt]138.96.48.108
403 128.9.160/20       224.2.127.255     3m   2m    -  0    1
404\*[Gt]128.9.160.45
405 198.106.194/24     224.2.135.190     9m  28s   9m  0P
406\*[Gt]198.106.194.22
407.Ed
408.Pp
409Each entry is characterized by the origin subnet number and mask and the
410destination multicast group.
411The 'CTmr' field indicates the lifetime of the entry.
412The entry is deleted from the cache table
413when the timer decrements to zero.
414The 'Age' field is the time since
415this cache entry was originally created.
416Since cache entries get refreshed
417if traffic is flowing, routing entries can grow very old.
418The 'Ptmr' field is simply a dash if no prune was sent upstream, or the
419amount of time until the upstream prune will time out.
420The 'Ivif' field indicates the
421incoming vif for multicast packets from that origin.
422Each router also
423maintains a record of the number of prunes received from neighboring
424routers for a particular source and group.
425If there are no members of
426a multicast group on any downward link of the multicast tree for a
427subnet, a prune message is sent to the upstream router.
428They are indicated by a "P" after the vif number.
429The Forwvifs field shows the
430interfaces along which datagrams belonging to the source-group are
431forwarded.
432A "p" indicates that no datagrams are being forwarded along
433that interface.
434An unlisted interface is a leaf subnet with are no
435members of the particular group on that subnet.
436A "b" on an interface
437indicates that it is a boundary interface, i.e., traffic will not be
438forwarded on the scoped address on that interface.
439An additional line with a "\*[Gt]" as the first character is printed for
440each source on the subnet.
441Note that there can be many sources in one subnet.
442.Sh SEE ALSO
443.Xr map-mbone 8 ,
444.Xr mrinfo 8 ,
445.Xr mtrace 8
446.Pp
447DVMRP is described, along with other multicast routing algorithms, in the
448paper "Multicast Routing in Internetworks and Extended LANs" by S. Deering,
449in the Proceedings of the ACM SIGCOMM '88 Conference.
450.Sh AUTHORS
451Steve Deering, Ajit Thyagarajan, Bill Fenner
452