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