Giter Site home page Giter Site logo

troglobit / mrouted Goto Github PK

View Code? Open in Web Editor NEW
76.0 9.0 18.0 1.33 MB

The original DVMRP (dynamic multicast routing) implementation for UNIX

Home Page: https://troglobit.com/projects/mrouted/

License: Other

C 84.91% Makefile 0.67% Yacc 3.63% Shell 9.98% M4 0.69% Dockerfile 0.12%
unix linux bsd multicast-routing rsvp multicast igmpv3 gre mroute ipip

mrouted's Introduction

Simple Multicast Routing for UNIX

License Badge GitHub Status Coverity Status

Simple overview of what DVMRP is

Table of Contents

Introduction

mrouted is the original implementation of the DVMRP multicast routing protocol, RFC 1075. It only works with IPv4 networks. For more advanced setups, the pimd project or pimd-dense project, for IPv6 the pim6sd project may be of interest.

mrouted is simple to use. DVMRP is derived from RIP, which means it works stand-alone without any extra network setup required. You can get up and running in a matter of minutes. Use the built-in IP-in-IP tunneling support, or GRE, to traverse Internet or intranets.

mrouted is developed on Linux and works as-is out of the box. Other UNIX variants should also work, but are not as thoroughly tested.

Manual pages available online:

Running

mrouted does not require a .conf file. When it starts up it probes all available interfaces and starts peering with any DVMRP capable neighbor. Multicast is forwarded to end-devices that join a group using IGMPv1, IGMPv2, or IGMPv3. For LANs where there may be hosts that do not speak IGMP, or where certain groups should always be forwarded, a static-group setting is available in mrouted.conf.

Use mgen(1), mcjoin(1), or iperf to send IGMP join packets and multicast data on the LAN to test your multicast routing setup. Use the mroutectl tool to query a running mrouted for status.

NOTE: Beware of the TTL value in the IP header of your multicast data. It defaults to 1 on most operating systems, which means nothing will be routed by default!

For the native mrouted tunnel to work in Linux based systems, you need to have the "ipip" kernel module loaded or as built-in:

modprobe ipip

Alternatively, you may of course also set up GRE tunnels between your multicast capable routers.

If you have many interfaces on your system you may want to look into the no phyint setting in [mroute.conf(5)][]. Linux users may also need to adjust /proc/sys/net/ipv4/igmp_max_memberships to a value larger than the default 20. mrouted needs 3x the number of interfaces (vifs) for the relevant control protocol groups. The kernel (Linux & BSD) maximum number of interfaces to use for multicast routing is 32.

Note: mrouted must run with sufficient capabilities, or as root.

Configuration

mrouted reads its configuration file from /etc/mrouted.conf, if it exists. You can override the default by specifying an alternate file when invoking mrouted:

mrouted -f /path/file.conf

mrouted can be reconfigured at runtime like any regular UNIX daemon with SIGHUP, or mroutectl restart, to activate changes made to its configuration file. The PID is saved in the file /run/mrouted.pid for your scripting needs.

By default, mrouted configures itself to act as a multicast router on all multicast capable interfaces. Hence, you do not need to explicitly configure it, unless you need to setup tunnel links, change the default operating parameters, disable multicast routing over a specific physical interfaces, or have dynamic interfaces.

Note: you need to have IP Multicast Routing enabled in the kernel as well. How this is achieved is outside the scope of this README.

For more help, see the mrouted(8) and mrouted.conf(5) man pages.

Build & Install

Debian/Ubuntu

curl -sS https://deb.troglobit.com/pubkey.gpg | sudo apt-key add -
echo "deb [arch=amd64] https://deb.troglobit.com/debian stable main" | sudo tee /etc/apt/sources.list.d/troglobit.list
sudo apt-get update && sudo apt-get install mrouted

Building from Source

Download the latest official versioned mrouted release. Official releases contain all the necessary files, unlike building from GIT. mrouted has no external dependencies except for a standard C library.

The configure script and Makefile supports de facto standard settings and environment variables such as --prefix=PATH and DESTDIR= for the install process. For example, to install mrouted to /usr, instead of the default /usr/local, and redirect install to a package directory in /tmp:

./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var
make
make DESTDIR=/tmp/mrouted-4.0-1 install-strip

Note: On some systems --runstatedir may not be available in the configure script, try --localstatedir=/var instead.

Building from GIT

If you want to contribute, or simply just try out the latest but unreleased features, then you need to know a few things about the GNU build system:

  • configure.ac and a per-directory Makefile.am are key files
  • configure and Makefile.in are generated from autogen.sh
  • Makefile is generated by configure script

To build from GIT you first need to clone the repository and run the autogen.sh script. This requires automake and autoconf to be installed on your system.

git clone https://github.com/troglobit/mrouted.git
cd mrouted/
./autogen.sh
./configure && make

GIT sources are a moving target and are not recommended for production systems, unless you know what you are doing!

Contributing

The basic functionality has been tested thoroughly over the years, but that does not mean mrouted is bug free. Please report bugs, feature requests, patches and pull requests at GitHub.

Origin & References

The mrouted routing daemon was developed by David Waitzman, Craig Partridge, Steve Deering, Ajit Thyagarajan, Bill Fenner, David Thaler and Daniel Zappala. With contributions by many others.

The last release by Mr. Fenner was 3.9-beta3 on April 26 1999 and mrouted has been in "beta" status since then. Several prominent UNIX operating systems, such as AIX, Solaris, HP-UX, BSD/OS, NetBSD, FreeBSD, OpenBSD as well as most GNU/Linux based distributions have used that beta as a de facto stable release, with (mostly) minor patches for system adaptations. Over time however many dropped support, but Debian and OpenBSD kept it under their wings.

In March 2003 OpenBSD, led by the fearless Theo de Raadt, managed to convince Stanford to release mrouted under a fully free license, the 3-clause BSD license. Unfortunately, and despite the license issue being corrected by OpenBSD, in February 2005 Debian dropped mrouted as an "obsolete protocol".

For a long time the OpenBSD team remained the sole guardian of this project. In 2010 Joachim Wiberg revived mrouted on GitHub based on the last release by Bill Fenner, the mrouted-3.9beta3+IOS12.tar.gz tarball. This project has integrated all (?) known patches and continuously track the OpenBSD project, which is based on the 3.8 release, for any relevant fixes.

mrouted's People

Contributors

bischoff avatar dimitryandric avatar ericb-summit avatar goochjj avatar gustavoz avatar hmflash avatar ocochard avatar rc-matthew-l-weber avatar troglobit avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mrouted's Issues

unexpect group drop issue on linux bridge interface with multicast snooping

Release info

version : 4.1
mrouted install method : install from apt / build from source at git tag 4.1
host system: ubuntu server 20.04/ debain 10.7

Topology

topology drawio

mrouted config

no phyint
phyint br0 enable
phyint enp1s0 enable

Issue Description

  • step1: setup system shown in topology figure
  • step2: start 2 iperf receiver and 1 sender as shown in topology figure, both 2 receiver can get mc traffic on 239.255.1.1
  • step3: use ctrl-c to stop the receiver 2 , receiver 1 will stop getting mc traffic on 239.255.1.1 after 3 seconds

if we turnoff mulitcast_snooping on br0 by

echo 0 > /sys/devices/virtual/net/br0/bridge/multicast_snooping

this issue will not reappear

Clues we got

mulitcast_snooping on

*igmp traffic on host1 br0

03:56:22.466983 IP (tos 0xc0, ttl 1, id 0, offset 0, flags [DF], proto IGMP (2), length 40, options (RA))
    10.88.84.102 > 224.0.0.22: igmp v3 report, 1 group record(s) [gaddr 239.255.1.1 to_ex { }]
03:56:23.022989 IP (tos 0xc0, ttl 1, id 0, offset 0, flags [DF], proto IGMP (2), length 40, options (RA))
    10.88.84.102 > 224.0.0.22: igmp v3 report, 1 group record(s) [gaddr 239.255.1.1 to_ex { }]
03:56:25.434460 IP (tos 0xc0, ttl 1, id 0, offset 0, flags [DF], proto IGMP (2), length 40, options (RA))
    10.88.84.103 > 224.0.0.22: igmp v3 report, 1 group record(s) [gaddr 239.255.1.1 to_ex { }]
03:56:25.642460 IP (tos 0xc0, ttl 1, id 0, offset 0, flags [DF], proto IGMP (2), length 40, options (RA))
    10.88.84.103 > 224.0.0.22: igmp v3 report, 1 group record(s) [gaddr 239.255.1.1 to_ex { }]

03:56:28.466437 IP (tos 0xc0, ttl 1, id 0, offset 0, flags [DF], proto IGMP (2), length 40, options (RA))
    10.88.84.103 > 224.0.0.22: igmp v3 report, 1 group record(s) [gaddr 239.255.1.1 to_in { }]

03:56:28.466661 IP (tos 0xc0, ttl 1, id 38833, offset 0, flags [none], proto IGMP (2), length 36, options (RA))
    10.88.84.1 > 239.255.1.1: igmp query v3 [max resp time 1.0s]
03:56:28.466717 IP (tos 0xc0, ttl 1, id 38834, offset 0, flags [none], proto IGMP (2), length 36, options (RA))
    10.88.84.1 > 239.255.1.1: igmp query v3 [max resp time 1.0s]

03:56:28.866371 IP (tos 0xc0, ttl 1, id 0, offset 0, flags [DF], proto IGMP (2), length 40, options (RA))
    10.88.84.103 > 224.0.0.22: igmp v3 report, 1 group record(s) [gaddr 239.255.1.1 to_in { }]
03:56:28.866581 IP (tos 0xc0, ttl 1, id 38913, offset 0, flags [none], proto IGMP (2), length 36, options (RA))
    10.88.84.1 > 239.255.1.1: igmp query v3 [max resp time 1.0s]

*igmp traffic on host3 eth0

13:34:15.766655 IP (tos 0xc0, ttl 1, id 0, offset 0, flags [DF], proto IGMP (2), length 40, options (RA))
    10.88.84.102 > 224.0.0.22: igmp v3 report, 1 group record(s) [gaddr 239.255.1.1 to_ex { }]
13:34:16.186495 IP (tos 0xc0, ttl 1, id 0, offset 0, flags [DF], proto IGMP (2), length 40, options (RA))
    10.88.84.102 > 224.0.0.22: igmp v3 report, 1 group record(s) [gaddr 239.255.1.1 to_ex { }]

mulitcast_snooping off

*igmp traffic on host1 br0

03:57:22.529303 IP (tos 0xc0, ttl 1, id 0, offset 0, flags [DF], proto IGMP (2), length 40, options (RA))
    10.88.84.102 > 224.0.0.22: igmp v3 report, 1 group record(s) [gaddr 239.255.1.1 to_ex { }]
03:57:22.993526 IP (tos 0xc0, ttl 1, id 0, offset 0, flags [DF], proto IGMP (2), length 40, options (RA))
    10.88.84.102 > 224.0.0.22: igmp v3 report, 1 group record(s) [gaddr 239.255.1.1 to_ex { }]
03:57:25.609174 IP (tos 0xc0, ttl 1, id 0, offset 0, flags [DF], proto IGMP (2), length 40, options (RA))
    10.88.84.103 > 224.0.0.22: igmp v3 report, 1 group record(s) [gaddr 239.255.1.1 to_ex { }]
03:57:26.497250 IP (tos 0xc0, ttl 1, id 0, offset 0, flags [DF], proto IGMP (2), length 40, options (RA))
    10.88.84.103 > 224.0.0.22: igmp v3 report, 1 group record(s) [gaddr 239.255.1.1 to_ex { }]

03:57:28.661242 IP (tos 0xc0, ttl 1, id 0, offset 0, flags [DF], proto IGMP (2), length 40, options (RA))
    10.88.84.103 > 224.0.0.22: igmp v3 report, 1 group record(s) [gaddr 239.255.1.1 to_in { }]

03:57:28.661387 IP (tos 0xc0, ttl 1, id 42959, offset 0, flags [none], proto IGMP (2), length 36, options (RA))
    10.88.84.1 > 239.255.1.1: igmp query v3 [max resp time 1.0s]
03:57:28.661443 IP (tos 0xc0, ttl 1, id 42960, offset 0, flags [none], proto IGMP (2), length 36, options (RA))
    10.88.84.1 > 239.255.1.1: igmp query v3 [max resp time 1.0s]

03:57:28.993216 IP (tos 0xc0, ttl 1, id 0, offset 0, flags [DF], proto IGMP (2), length 40, options (RA))
    10.88.84.103 > 224.0.0.22: igmp v3 report, 1 group record(s) [gaddr 239.255.1.1 to_in { }]
03:57:28.993298 IP (tos 0xc0, ttl 1, id 43030, offset 0, flags [none], proto IGMP (2), length 36, options (RA))
    10.88.84.1 > 239.255.1.1: igmp query v3 [max resp time 1.0s]


03:57:29.169749 IP (tos 0xc0, ttl 1, id 0, offset 0, flags [DF], proto IGMP (2), length 48, options (RA))
    10.88.84.102 > 224.0.0.22: igmp v3 report, 2 group record(s) [gaddr 239.255.1.1 is_ex { }] [gaddr 224.0.0.251 is_ex { }]

*igmp traffic on host3 eth0

13:35:09.866553 IP (tos 0xc0, ttl 1, id 0, offset 0, flags [DF], proto IGMP (2), length 40, options (RA))
    10.88.84.102 > 224.0.0.22: igmp v3 report, 1 group record(s) [gaddr 239.255.1.1 to_ex { }]
13:35:10.362665 IP (tos 0xc0, ttl 1, id 0, offset 0, flags [DF], proto IGMP (2), length 40, options (RA))
    10.88.84.102 > 224.0.0.22: igmp v3 report, 1 group record(s) [gaddr 239.255.1.1 to_ex { }]
13:35:18.350639 IP (tos 0xc0, ttl 1, id 64815, offset 0, flags [none], proto IGMP (2), length 36, options (RA))
    10.88.84.1 > 239.255.1.1: igmp query v3 [max resp time 1.0s]
13:35:18.478725 IP (tos 0xc0, ttl 1, id 64840, offset 0, flags [none], proto IGMP (2), length 36, options (RA))
    10.88.84.1 > 239.255.1.1: igmp query v3 [max resp time 1.0s]
13:35:18.490674 IP (tos 0xc0, ttl 1, id 0, offset 0, flags [DF], proto IGMP (2), length 48, options (RA))
    10.88.84.102 > 224.0.0.22: igmp v3 report, 2 group record(s) [gaddr 239.255.1.1 is_ex { }] [gaddr 224.0.0.251 is_ex { }]

Conclusion by now

from dumped msg above along with info from mroutectl show igmp we can found, if any host behind br0 send igmp leave for a specified mcaddress for example:239.255.1.1, mrouted will set group 239.255.1.1's expire time to 3 second and send an igmp query to 239.255.1.1, if any participant want to keep the group, it have to send igmp report in less than 1 second.

by now i got a conclusion that the reason why group drop happen is that the linux bridge drop any igmp query msg outside 224.0.0.0/24, meanwhile mrouted use user group (such as 239.255.1.1 in test above) to send igmp query when participant leave. host behind linux bridge with multicast snooping on will never get these query msg.

Question & Discussion

  • the fast leave mechanism in mrouted seems little radical especially in scene multi-participant behind a single interface,any configuration to change this behavior?
  • mrouted send igmp query on user group like 239.255.1.1
    linux bridge drop any igmp query outside 224.0.0.x
    tried some physical management switch with igmp-snooping ,they all accept/forward igmp query outside 224.0.0.x and do not have this issue
    which one should we apply fix on mrouted or linux bridge?
  • what workaround can we apply right now?

mrouted-3.9.7_Multicast_Forward_Issue

Hi,

We integrating the DVMRP is our protocol and we found the muticast is not forwarding from one VLAN to another VLAN.

The host is connected with switch through VLAN1 and VLAN2 is connected with another switch with same configuration.

" Host1-VLAN1->VLAN2----VLAN2->VLAN3-Host2 "

The multicast(239.0.0.100) UDP packet is received in the dvmrp flow,but it is not appearing in VLAN2.

For your information PIM-DIM is working with our environment and we are using BCM SDK.

Same way we are integrating the DVMRP ,but the multicast message is not flooding.
Please hep us to identify the issue ,because it is very urgent requirement.

Segmentation fault when running with debug all in foureground and closing another mrouted instance

I'm running a setup identical to the one described in this blog post: https://troglobit.com/2016/07/05/multicast-routing-with-pim-sm-over-gre/ Instead of pimd I am running mrouted though.

mrouted is running in the foreground in each of the routers R1 and R2 with the following command line parameters:

> mrouted -n -l debug -d all

If I issue Ctrl+C to stop one of the two instances the other one will also terminate with a segmentation fault. This appears to happen reliably on my machines regardless of which side i terminate. If I select any other subystems, or even list all of them individually, there is no crash.

My version of mrouted is 4.2 and I'm running Debian 10.

Cheers from a fellow MDH alumnus (DTV96).

10 seconds to establish routes?

Hello,

I have played with mrouted and noticed that I needed to wait at least 10 seconds to see the multicast routes appear on the router in this very simple setup:

   host ---- router ---- host

Both hosts request to join same multicast group. If I replace mrouted with smcroute, multicasting works immediately. I tested mrouted 3.9.6 as packaged 5 years ago (yep).

In the RFC 1075, one can read:

  Probes provide a keep-alive function in order to quickly detect
  neighbor loss. Probes sent on each multicast capable interface
  configured for DVMRP SHOULD use an interval of 10 seconds.

However, 10 seconds between probes does not mean IMHO that it is needed to wait 10 seconds to register a route based on a first IGMP join message. Is it an implementation problem of mrouted?

Or did I miss some point? Do other people experience this 10 seconds delay as well?

Best,

Multicast routing to Wireguard

Hello,

Is there a straightforward way to have mrouted route multicast traffic from my local network (on eth0) to my Wireguard interface (on wg0)?

I tried bringing it up without any configuration and I got:

# mrouted -n -l debug
mrouted: 17:16:35.996 mrouted version 4.0-rc1 starting
mrouted: 17:16:35.996 Getting vifs from kernel interfaces
mrouted: 17:16:35.997 Installing eth0 (10.1.1.2 on subnet 10.1.1/24) as VIF #0, rate 0 pps
mrouted: 17:16:35.997 Getting vifs from /etc/mrouted.conf
mrouted: 17:16:35.997 Cannot forward: only one enabled vif

But then how would I go about setting the Wireguard interface on /etc/mrouted.conf? I tried via phyint wg0, but it doesn't work.

Thanks in advance!

mrouted receives igmp join but doesn't route

Hi, I'm testing multicast routing because I have a camera at home that is able to generate an rtp multicast flow.
I want to implement a secure system to route the rtp flow only on ssh-tap interfaces.

I set the camera to use 239.255.42.42:5004. The camera sends the rtp flow to the eth1 of my debian_home0 pc.

The debian_home0 pc has an ssh-tap0 interface to a public_server.
I use smcroute to route the rtp flow --> tap0 --> public_server.
The public_server receives the rtp flow correctly through tap0.

The public_server has mrouted installed, and another ssh-tap1 interface with debian_home1 (debian_home1 is, for testing, a virtual machine).

debian_home0 <-- tap0 --> public_server <-- tap1 --> debian_home1

/etc/mrouted.conf in public_server is:
name CAMERA 239.255.42.42/32
phyint vio0 disable # don't route multicast to the ethernet

public_server is an OpenBSD where I set:
net.inet.ip.mforwarding=1
multicast=YES in /etc/rc.conf

debian_home1 has smcroutectl installed.
On debian_home1, I run the command: smcroutectl join tap1 239.255.42.42

I see, in the public_server, the igmp-join coming through the tap1 interface. I expect to receive the rtp flow through tap1, but, I don't know why, debian_home1 doesn't receive it.

Am I missing anything? It seems that mrouted on the OpenBSD public_server is not working properly.

Regards, thanks a lot

Add support for static multicast routes

For some use-cases where mrouted replaces SMCRoute it would be useful to support setting static routes as well. E.g., a router with three interfaces, where mrouted runs on two of them, a user might want to set up static routes from/to either of these to/from the third one.

The MROUTING stack in both Linux and *BSD does not allow for this using different daemons, since only one can do MRT_INIT for that MRT_TABLE, and each MRT_TABLE can only hold unique interfaces, i.e. no overlap is allowed.

Setting query interval to 12 sec => crazy behavior

While testing at Westermo, using the WeOS default IGMP query interval, I noticed mrouted going completely crazy. Unless I set the interval to an even multiple of 5 sec, mrouted is stuck in a loop sending queries once every second on all interfaces.

The internal progression of time may have to be audited now with the refactored timer implementation.

Starting mrouted and pimd together

How can I start both pimd and mrouted daemons together on my linux pc.

Different daemons on different interfaces.
right now its giving error that address already in use.

Support reloading config file without flushing routing table

How can I reread the configuration file of Mrouted mrouted.conf without restarting the whole daemon and losing the routing tables. What should be the modifications in package for that.

I want it (daemon) should reread the config file and update according to new configurations but it should not flush the routing tables.

mrouted 4.0 reports "Too many files on filesystem"

I have mrouted running on a Linux router sitting between multiple networks, only two of which have IFF_MULTICAST.
mrouted is used so that that multicast can be properly forwarded between the two multicast-enabled networks.
mrouted 4.0 runs without a configuration file (or rather, the empty, all-commented out /etc/mrouted.conf).
Every once in a while, mrouted will log (public IP address redacted as a.b.c.d:

mrouted[276475]: warning - Failed MRT_ADD_MFC(a.b.c.d, 239.255.255.250) from vif 32 to vif(s) 0, 0: Too many open files in system
mrouted[276475]: warning - Failed MRT_DEL_MFC(a.b.c.d 239.255.255.250): No such file or directory
mrouted[276475]: warning - age_table_entry() trying to delete no-route (a.b.c.d 239.255.255.250): No such file or directory

Looking at mrouted and the Linux kernel's code it looks like I'm running out of multicast virtual interfaces (vifs).
MAXVIFS is defined as 32 in my stock kernel.
I have 18 interfaces configures on the router (2 of which have IFF_MULTICAST).

Generation ID stored in /var/lib should be in /var/lib/misc (FHS)

In #25 we added support for persistent genid, but got the path wrong.

On Linux based systems we should honor the FHS:

"An application (or a group of inter-related applications) must use a subdirectory of /var/lib for its data.
There is one > required subdirectory, /var/lib/misc, which is intended for state files that don't need a subdirectory; ..."

On UNIX systems we should use /var/db.

Hence, _PATH_VARDB in /usr/include/paths.h really is the one to rely on here. Except some C-libraries on Linux still use /var/db, and the system is not guaranteed to have that path, or even a symlink to /var/lib/misc. So, we can either guess/probe on the system or make this a configure option, because some users don't even want to follow the FHS or a traditional hier(7).

Add support for joining groups on source network

In setups like #52, where you don't have access to the router(s), and you want to forward multicast between networks that are separated by an intranet/Internet without support for multicast, you may need to join the multicast groups you want to forward on the sender side.

In the picture below, A2 wants to route 226.94.1.1 to B2.

multicastr-traversing-unicast-only-networks

If A2 can join 226.94.1.1 it could forward the traffic to B2, which in turn can use the phyint sub-option static-group 226.94.1.1 to fake it has heard the IGMP join message on LAN B. (Which it likely won't if you don't have access to the switch on LAN B (serving 10.0.216/27) and it has IGMP snooping enabled.

This feature would perfectly complement static-group, which only serves the receiver side.

Mrouted support for IGMPv3 reports

mrotued acts as either IGMPv1/v2 querier and handles the reports.
I don't see any config option to make it IGMPv3 querier and dont see code to handle v3 reports.

Linked list refactor breaks forwarding on Linux

I have a simple 4 machine setup (nodes A, B, C, D). The nodes are set up in a linear setup (A<->B<->C<->D). The interfaces and addresses on each node are:

Node A:

  • eth0: 10.0.1.1

Node B:

  • eth0: 10.0.0.1
  • eth1: 10.0.1.2

Node C:

  • eth0: 10.0.0.2
  • eth1: 10.0.2.2

Node D:

  • eth0: 10.0.2.1

Nodes B and C have two network interfaces, and run mrouted on them. Any commit prior to ef6ce3f works fine. That particular commit seems to break routing. I see multicast joins show up from node A to node B, but node B never tells node C, and vice versa.

I used git bisect to find commit ef6ce3f which seems to break this, but I don't know what in particular in that commit causes issues. I'd be happy to help debug this.

This is on Ubuntu 10.04.1 running kernel 2.6.32.

Problem with SIGHUP in mrouted.

When I am applying SIGHUP to running Mrouted its getting killed and stoped.
When I am running in debug mode Its showing Segmentation Fault at the time of Applying signal.
What could be the solution.
Thanks..

Generation ID should persist across reboots

Currently the DVMRP generation id is stored in /var/run/mrouted/mrouted.genid. If mrouted is restarted this file is read and the value increased by one is used as the new generation id (and stored again). However, this file does not survive reboot. We should move to use /var/lib/mrouted.genid instead.

mrouted segfault after several hours

Hello! Currently have a setup using mrouted 4.4 on 2 interfaces on a brand new installation of Debian 11 CLI.
Downloaded the 4.4 client from deb.troglobit.com.

No modifications to mrouted.conf, just launching the daemon and letting it do it's thing for the 2 interfaces.

Please spare my lack of knowledge as I am neither a Linux pro, or a developer. :(

My 2 interfaces are:

  1. 10.11.12.0/24
  2. 192.168.1.0/24

I can see that the daemon crashes and pulled the syslog at that moment:

May 24 18:16:44 mrtr01 mrouted[625]: warning - Failed MRT_DEL_MFC(169.254.153.104 239.255.255.250): No such file or directory
May 24 18:16:44 mrtr01 mrouted[625]: warning - age_table_entry() trying to delete no-route (169.254.153.104 239.255.255.250): No such file or directory
May 25 05:03:56 mrtr01 kernel: [39776.168675] mrouted[625]: segfault at 21 ip 000055cd86b1fc61 sp 00007fff879362a0 error 6 in mrouted[55cd86b0e000+17000]
May 25 05:03:56 mrtr01 kernel: [39776.168727] Code: 30 85 ff 7f 54 8b 7b 38 85 ff 7f 3d 8b 73 10 89 ef e8 23 8e ff ff 48 8b 03 48 8b 53 08 48 85 c0 74 4f 48 89 50 08 48 8b 53 08 <48> 89 02 48 89 df e8 d4 e3>
May 25 05:03:56 mrtr01 systemd[1]: mrouted.service: Main process exited, code=killed, status=11/SEGV
May 25 05:03:56 mrtr01 systemd[1]: mrouted.service: Failed with result 'signal'.
May 25 05:03:56 mrtr01 systemd[1]: mrouted.service: Consumed 4.906s CPU time.

Restarting the daemon will allow it to run for another few hours, but will crash again. I previously had mrouted running on an Ubuntu VM, and the same issue happened. I am definitely suspecting something strange on MY network affecting the daemon. Perhaps the strange APIPA route del requests are doing something to the daemon?

My linux knowledge is very minimal, but if I'm given the steps to do something I will try and get it done for you. I am willing to debug or do whatever is needed. My goal is simply to have a stable daemon that I do not need to restart every so often. Appreciate any help that can be given!

Missing Networks

Hi,
I have setup it on two gentoo.
On the first gentoo, I have 192.168.253.0/24 and 192.168.252/24
On the second gentoo, I have 192.168.254.0/24.
(I have disable other networks).

First gentoo:
mrouted version 3.9.5 up 1:22:39 Sun Jan 7 19:46:18 2018

vifs_with_neighbors = 1
[This host is a leaf]

Virtual Interface Table
Vif Name Local-Address M Thr Rate Flags
0 br0 192.168.253.1 subnet: 192.168.253/24 1 1 0 querier leaf
group host (time left): 239.255.255.246 192.168.253.127 ( 0:02:57)
233.89.188.1 192.168.253.10 ( 0:02:55)
239.255.255.250 192.168.253.200 ( 0:02:57)
224.0.0.4 192.168.253.1 ( 0:02:55)
224.0.0.2 192.168.253.1 ( 0:03:02)
IGMP querier: 192.168.253.1 (this system)
Nbr bitmaps: 0x0000000000000000
pkts/bytes in : 1883/619540
pkts/bytes out: 2050/799936

1 br0.252 192.168.252.1 subnet: 192.168.252/24 1 1 0 querier leaf
group host (time left): 233.89.188.1 192.168.252.11 ( 0:02:56)
239.255.255.250 192.168.252.2 ( 0:02:56)
224.0.0.4 192.168.252.1 ( 0:02:54)
224.0.0.2 192.168.252.1 ( 0:02:55)
IGMP querier: 192.168.252.1 (this system)
Nbr bitmaps: 0x0000000000000000
pkts/bytes in : 2625/862886
pkts/bytes out: 36/12339

2 br1 172.16.100.1 subnet: 172.16.100/24 1 1 0 disabled
Nbr bitmaps: 0x0000000000000000

3 tun1 10.0.0.5 subnet: 10.0.0.5/32 1 1 0 disabled rexmit_prunes
Nbr bitmaps: 0x0000000000000000

4 tun2 10.0.0.9 subnet: 10.0.0.9/32 1 1 0 disabled rexmit_prunes
Nbr bitmaps: 0x0000000000000000

5 tun0 10.0.0.1 subnet: 10.0.0.1/32 1 1 0 disabled rexmit_prunes
Nbr bitmaps: 0x0000000000000000

6 br0 192.168.253.1 tunnel: 192.168.254.1 1 1 0 rexmit_prunes old-tunnel
peers: 192.168.254.1 (3.255) [0] have-genid up 1:05:50
Nbr bitmaps: 0x0000000000000001
pkts/bytes in : 0/0
pkts/bytes out: 2018/787400

Multicast Routing Table (2 entries)
Origin-Subnet From-Gateway Metric Tmr Fl In-Vif Out-Vifs
192.168.253/24 1 165 .. 0 1*
192.168.252/24 1 165 .. 1 0* 6[0]

second gentoo:
mrouted version 3.9.5 up 1:00:52 Sun Jan 7 19:41:31 2018

vifs_with_neighbors = 1
[This host is a leaf]

Virtual Interface Table
Vif Name Local-Address M Thr Rate Flags
0 br0 192.168.254.1 subnet: 192.168.254/24 1 1 0 querier leaf
group host (time left): 239.255.3.22 192.168.254.103 ( 0:03:53)
239.255.255.250 192.168.254.110 ( 0:03:49)
224.0.0.4 192.168.254.1 ( 0:03:48)
224.0.0.2 192.168.254.1 ( 0:03:55)
IGMP querier: 192.168.254.1 (this system)
Nbr bitmaps: 0x0000000000000000
pkts/bytes in : 1557/290331
pkts/bytes out: 0/0

1 tun0 10.0.1.1 subnet: 10.0.1.1/32 1 1 0 disabled rexmit_prunes
Nbr bitmaps: 0x0000000000000000

2 tun1 10.0.1.5 subnet: 10.0.1.5/32 1 1 0 disabled rexmit_prunes
Nbr bitmaps: 0x0000000000000000

3 tun3 10.0.0.2 subnet: 10.0.0.2/32 1 1 0 disabled rexmit_prunes
Nbr bitmaps: 0x0000000000000000

4 br0 192.168.254.1 tunnel: 192.168.253.1 1 1 0 rexmit_prunes old-tunnel
peers: 192.168.253.1 (3.255) [0] have-genid up 1:01:03
Nbr bitmaps: 0x0000000000000001
pkts/bytes in : 0/0
pkts/bytes out: 0/0

Multicast Routing Table (2 entries)
Origin-Subnet From-Gateway Metric Tmr Fl In-Vif Out-Vifs
192.168.254/24 1 60 .. 0
192.168.252/24 192.168.253.1 2 0 .. 4 0*

On the first, I can't see the second gentoo's network.
On the second, I can see only 192.168.252.0.

Do you know why and what can I do ?

Thanks

Update license to 2002 version from Stanford

Young Hyun dropped me an email with great news about a license change in mrouted that I had completely missed. See below. I will update the license in the repo asap.

I stumbled upon your mrouted GitHub repository (mrouted may be an "old and stale project",
but it seems to be useful in weird places, like for us doing topology measurement). The license
you list for mrouted is the original odd Stanford license. I've been digging around and have
uncovered evidence for a relicensing of the code to the 3-clause BSD license sometime in
2003-2004. Do you have any further details about this, such as an official software release with
the new license? It might be worth updating the license in your git repository, since the new
license is so much better.

Here's what I found:

compilation issue

Hi,

I was trying to install mrouted in a CentOS 4.5 server. I have tried many other mrouted sources and patches, but I couldn't install it. Since you have worked on it, I have found someone to help with my installation issues. I downloaded all your files, but focusing only on one "Original mrouted-3.9beta3+IOS12 + Debian and misc. collected patches.". I tried to compile it (run make), and I got the following error.

make

CC mrouted-3.9.0/igmp.o
In file included from include/linux/netinet/ip_mroute.h:6,
from defs.h:48,
from igmp.c:14:
/usr/include/linux/mroute.h:116: error: syntax error before "__u32"
/usr/include/linux/mroute.h:122: error: syntax error before '}' token

I hope I provided enough information.
Thanks for your attention.

Regards,
Robson.

DVMRP reporting missing last subnet that should be listed in report

Based on some testing where we added a list of subnets to the DVMRP report coming from host A, it was determined that mrouted on host B (A and B are connected with a L2 switch) was always missing the last subnet reported in the DVMRP report. Some of the debug output from mrouted as well as its route dump was showing that it was processing this subnet, but wasn't transmitting it within the DVMRP report nor was it processing traffic originating from this subnet.

Reverting back to the 3.9-beta3 version of mrouted resolved this issue, while version 3.9.7 was the one exhibiting this behavior. Beyond that we haven't investigation as to where along the line the bug may have been introduced.

We are running a 3.12.19 Linux kernel.

no phyint config option does not work

Hello there,

I am facing an issue while using the new "no phyint" option in /etc/mrouted.conf file.

I installed the 4.0 mrouted package through with OpenBSD 6.6 using:

./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var
make
make install-strip

I am using 100+ virtual interfaces (vlan/carp) on my system, and when I try to start mrouted with the "no phyint" option enabled and 3-4 interfaces enabled manually, I am still getting the following error:

warning - too many vifs, ignoring <if>
warning - /etc/mrouted.conf:29 phyint <if> not available, continuing . . . 
Cannot forward: only one enabled vif

(only one interface is enabled, because it's the first in the kernel list I guess).

It seems the "no phyint" option has no effect.
Any idea ?

Thanks
Luthing

IGMP group-specifc query broken in v4.0

In mrouted v4.0 the group-specific query was unintentionally broken when introducing support for IGMPv3. Commit b9c65cb centralizes IGMP querys to vif.c:send_query(), but the new group argument is never used.

Debian 12: 20:06:55.221 Another multicast routing application is already running

I've just installed mrouted on Debian 12, and I have this:

./configure gives me these alerts:

./configure: line 4433: PKG_PROG_PKG_CONFIG: command not found
./configure: line 4699: --variable=systemdsystemunitdir: command not found

make didn't show any alert

But:

./mrouted -n

mrouted: 20:06:55.221 Another multicast routing application is already running.

I don't know which other application is running multicast.... any idea?

Please help, I need to use mrouted.

Thanks. regards

won't start as soon as I add a tunnel config?

I have 3 mcast enabled interfaces on my system; eth0, eth1, and for sake of accuracy, docker0 (I do not intend to use docker0 for anything).

docker0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 172.17.0.1  netmask 255.255.0.0  broadcast 172.17.255.255
...
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 9001
        inet 10.0.200.77  netmask 255.255.255.224  broadcast 10.0.200.95
...
eth1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 9001
        inet 10.0.204.68  netmask 255.255.255.224  broadcast 10.0.204.95

When I run with no config, it starts as expected

mrouted    | 06:25:17.595 mrouted version 4.3 starting
...
mrouted    | 06:22:00.864 Installing eth0 (10.0.200.77 on subnet 10.0.200.64/27) as VIF #0, rate 0 pps
mrouted    | 06:22:00.864 Installing eth1 (10.0.204.68 on subnet 10.0.204.64/27) as VIF #1, rate 0 pps
mrouted    | 06:22:00.864 Installing docker0 (172.17.0.1 on subnet 172.17/16) as VIF #2, rate 0 pps

As I am attempting to use mrouted to tunnel multicast between two networks where the routers can speak to each other unicast but not multicast, I add a tunnel statement. The config is completely empty except for this one line:

tunnel 10.0.204.68 10.0.204.119 metric 1 threshold 1 rate-limit 0

I run it, I see this:

mrouted    | 06:24:33.022 installing tunnel from 10.0.204.68 to 10.0.204.119 as vif #0 - rate=0
mrouted    | 06:24:33.022 Correlating interfaces and configuration ...
mrouted    | 06:24:33.022 Installing eth0 (10.0.200.77 on subnet 10.0.200.64/27) as VIF #0, rate 0 pps
mrouted    | 06:24:33.022 Installing eth1 (10.0.204.68 on subnet 10.0.204.64/27) as VIF #0, rate 0 pps
mrouted    | 06:24:33.022 Installing docker0 (172.17.0.1 on subnet 172.17/16) as VIF #0, rate 0 pps
mrouted    | 06:24:33.022 Installing eth1 (10.0.204.68 on subnet default) as VIF #0, rate 0 pps
mrouted    | 06:24:33.022 Cannot forward: no enabled vifs

And it exits.

To be sure it wasn't something wonky with my binary, I rebuilt 4.3 from scratch inside alpine latest per your instructions. Then I tried debian stretch, then I dropped docker and just built in a AMI linux 2 instance. Same exact behaviour. My next step is to mark up the code to try to undertstand what is going on.

In the meantime, could you kindly comment if am I doing something very obviously wrong? Why do I see VIF#0 repeatedly? Why would installing the interface fail silently? Thanks.

Switch from bcopy() to memmove()

bcopy() is deprecated, use memmove() instead.

From 2d33110ee18fb59a1d6917d598fc1f4eb3c4cf83 Mon Sep 17 00:00:00 2001
From: Gustavo Zacarias <[email protected]>
Date: Mon, 7 May 2012 16:32:10 -0300
Subject: [PATCH] Switch from bcopy to memmove

The bcopy() function is marked as legacy per POSIX.1-2001 and removed by
POSIX-1.2008 thus shouldn't be used.
So switch over to memmove()

Signed-off-by: Gustavo Zacarias <[email protected]>

---
 mtrace.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/mtrace.c b/mtrace.c
index c982a67..64630bf 100644
--- a/mtrace.c
+++ b/mtrace.c
@@ -556,7 +556,7 @@ int send_recv(u_int32_t dst, int type, int code, int tries, struct resp_buf *sav
        save->rtime = ((tr.tv_sec + JAN_1970) << 16) +
            (tr.tv_usec << 10) / 15625;
        save->len = len;
-       bcopy((char *)igmp, (char *)&save->igmp, ipdatalen);
+       memmove((char *)&save->igmp, (char *)igmp, ipdatalen);
        }
        return recvlen;
    }
@@ -646,7 +646,7 @@ void passive_mode(void)
    base.rtime = ((tr.tv_sec + JAN_1970) << 16) +
        (tr.tv_usec << 10) / 15625;
    base.len = len;
-   bcopy((char *)igmp, (char *)&base.igmp, ipdatalen);
+   memmove((char *)&base.igmp, (char *)igmp, ipdatalen);
    /*
     * If the user specified which traces to monitor,
     * only accept traces that correspond to the
-- 
1.7.3.4

mrouted sends malformed IGMPV3 general query request

I am trying to use mrouted in CORE network simulator. I have built it form latest sources. However I have noticed that it sends malformed IGMP packets as general IGMP queries which cannot be parsed by any version of Wireshark.

Example is 01005e000001000000aa0015080045c00020075a00000102bdbf0a000a02e00000011164f41300000000fa7d000a

Privilege separation for OpenBSD

Hello,

First off, thank you very much for your continued work on mrouted, it's a service that I rely on daily.

My firewall/router is running OpenBSD (7.2) and as you know, the version of mrouted included in the base install (3.8) is quite old. When I asked on the Misc mailing list about including an updated version, Theo advised that the current version did not contain the necessary security features (his reply linked below).

I am running the current version of mrouted to route multicast traffic between two routing domains (via a set of pair(4) interfaces). Version 3.8 of mrouted does not allow me to attach to both pair interfaces, whereas 4.4 does, hence the request.

Thank you for your time and consideration.

https://marc.info/?l=openbsd-misc&m=164582045627328&w=2

Replace deprecated gethostbyname()

I get the following warnings when building mrouted:

I: binary-or-shlib-calls-gethostbyname /usr/sbin/mtrace
I: binary-or-shlib-calls-gethostbyname /usr/sbin/map-mbone
I: binary-or-shlib-calls-gethostbyname /usr/sbin/mrouted
I: binary-or-shlib-calls-gethostbyname /usr/sbin/mrinfo
The binary calls gethostbyname(). Please port the code to use getaddrinfo().

It seems that gethostbyname() is not IPv6-compatible, and that it is the reason why it should be replaced.

(and I have not the time to do the corresponding pull request, sorry)

IGMPv3 group record states not handled properly

Group record states other than IS_EX({})/TO_EX({}) and IS_IN({})/TO_IN({}) are not handled properly in mrouted.

The IGMPv3 support in mrouted is cannot be fully supported, because DVMRP does not have any kind of source tracking, but record states for IS_EX({x})/TO_EX({x}) and IS_IN({x})/TO_IN({x}) should be handled gracefully according to RFC5790. I.e., translated to (*,G) join/leave where appropriate and ignored otherwise.

The pimd igmp_proto.c:accept_membership_report() function has a good example of how this can be handled. Note, it handles sources which mrouted does not. So cases where sources are handled do not apply and need to be translated.

Cannot join group 224.0.0.x: No buffer space available

Starting up on a system with many interfaces cause failure to join multicast groups.

09:46:01.972 SENT neighbor probe     from 10.0.5.2        to 224.0.0.4
09:46:01.972 vif #6, phyint 10.0.6.2
09:46:01.972 warning - Cannot join group 224.0.0.22 on interface 10.0.6.2: No buffer space available
09:46:01.972 0.0.0.0 advertises new route 10.0.6/24
09:46:01.972 0.0.0.0 advertises 10.0.6/24 with adj_metric 1 (ours was 32)
09:46:01.972 Assuming querier duties on vif 6
09:46:01.972 Sending v3 query on eth6
09:46:01.972 SENT membership query   from 10.0.6.2        to 224.0.0.1
09:46:01.972 SENT neighbor probe     from 10.0.6.2        to 224.0.0.4
09:46:01.972 vif #7, phyint 10.0.7.2
09:46:01.972 warning - Cannot join group 224.0.0.4 on interface 10.0.7.2: No buffer space available
09:46:01.972 warning - Cannot join group 224.0.0.2 on interface 10.0.7.2: No buffer space available
09:46:01.972 warning - Cannot join group 224.0.0.22 on interface 10.0.7.2: No buffer space available
09:46:01.972 0.0.0.0 advertises new route 10.0.7/24
09:46:01.972 0.0.0.0 advertises 10.0.7/24 with adj_metric 1 (ours was 32)
09:46:01.972 Assuming querier duties on vif 7

"Required key not available" on Arch Linux

I built mrouted 4.4 from release. I run it with sudo ./mrouted -n, and I periodically get warning - sendto to 224.0.0.4 on 10.200.200.1: Required key not available, 10.200.200.1 being the IP address of my Wireguard interface.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.