Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
01-08-2014, 06:47 AM
|
#1
|
LQ Newbie
Registered: Jan 2014
Posts: 14
Rep: 
|
Multicast traffic not forwarded when using a Linux system as a router
My simple setup: A Linux system with 2 NICs and one laptop connected to each of the NICs. The laptops are in different subnets. Let's say that one laptop is 10.0.0.200 and the other is 192.168.1.200. I have assigned an IP in the same subnet to the corresponding NICs - i.e 10.0.0.100 and 192.168.1.100. I am running a simple multicast sender on one laptop and its corresponding receiver on the other. I know that this is possible using a Bridge, but I need this to take place at Layer 3 - i.e as a router.
I have enabled IP_FORWARD, disabled RP_FILTER for both the interfaces and "all", enabled MC_FORWARDING for both the interfaces and "all". In the kernel- IP_MULTICAST,IP_MROUTE and IP_PIMSM are enabled.
My route entries are :
route add -net 10.0.0.0/8 gw 192.168.1.100 dev eth0
route add -net 192.168.1.0/24 gw 10.0.0.100 dev eth1
With this I am able to ping one laptop from the other.
Since the multicast code needs a device to act upon, I use [route add default dev <device>] at the laptops. I check the traffic at the router using Wireshark and Tcpdump.
The multicast senders' packets reach the interface the laptop is connected to but they are not forwarded on to the other interface. I only receive join and leave group messages on the other interface from the receiver side. I have tried different combinations of these steps and routes including the multicast route [route add -net 224.0.0.0/4 dev <device>] at the router interfaces. I have tried using smcroute, mrouted and pimd extensively. I have used different physical systems as the router and also Ubuntu and RHEL. I have used different multicast packet generators.
But it simply does not forward the packets. Any ideas?
|
|
|
01-08-2014, 02:55 PM
|
#2
|
Senior Member
Registered: Apr 2009
Posts: 1,897
Rep: 
|
Before you can do any multicast routing, you need to configure the Linux kernel to support the type of multicast routing you want to do. This, in turn, requires you to decide what type of multicast routing you expect to be using. There are essentially four "common" types - DVMRP (the Multicast version of the RIP unicast protocol), MOSPF (the same, but for OSPF), PIM-SM ("Protocol Independent Multicasting - Sparse Mode", which assumes that users of any multicast group are spread out, rather than clumped) and PIM-DM (the same, but "Dense Mode", which assumes that there will be significant clumps of users of the same multicast group).
|
|
|
01-10-2014, 06:02 AM
|
#3
|
LQ Newbie
Registered: Jan 2014
Posts: 14
Original Poster
Rep: 
|
It seems that it takes 2 - 3 minutes for Mrouted to finish the IGMP transactions. Then magically ,the multicast packets are forwarded and received. So, the answer to my question was simply Patience.
Now, my problem extends a little further. The interface links on my router will not be "up" permanently. I need to be able to arbitrarily disturb them i.e pull the cables out manually by hand, if you will - and then receive the packets again immediately when I plug it back in. I believe Mrouted requires both the interfaces to be up all the time and disturbing any of the links stops the forwarding from that point on. Is it due to the dynamic nature of Mrouted ? Is there any other way to set static routes, besides smcroute, so the routes are not removed when the links are disturbed ?
|
|
|
01-10-2014, 02:39 PM
|
#4
|
Senior Member
Registered: Apr 2009
Posts: 1,897
Rep: 
|
The smcroute is good one. By the way, dynamic route is good even if the link is disturbed, isn't it?
|
|
|
01-11-2014, 01:50 AM
|
#5
|
LQ Newbie
Registered: Jan 2014
Posts: 14
Original Poster
Rep: 
|
No, it isn't. Mrouted requires at least two interfaces to be up and running in order to function. When the cables are removed and plugged back in, it needs time to send the IGMP join messages all over again. In short, it will work - but after a short delay, which I cannot afford to have.
Anyway, I think I'm onto something with smcroute - I found a few steps somewhere in Russian that I used Google Translate on. If it works I'll let you know.
|
|
|
01-13-2014, 06:51 AM
|
#6
|
LQ Newbie
Registered: Jan 2014
Posts: 14
Original Poster
Rep: 
|
Chipped off a little more of the wall of my problems : I got smcroute to work. Turns out the source IP address I was using while adding the routes was the problem. When I set the address to 0.0.0.0 i.e any source address , it starts forwarding the multicast packets. And as I had predicted, the static routes remained in place even after I disturbed the links - so now, the transition is seamless.
This is about 25% of what I am trying to achieve. And the next part goes a little bit outside the scope of my title topic. Should I start a new thread or continue with this one?
|
|
|
01-13-2014, 08:07 AM
|
#7
|
Senior Member
Registered: Oct 2004
Distribution: Debian Squeeze x86_64
Posts: 1,748
|
I was following the thread silently so also the mods will kill me. But go in this one please. Or provide link to the new post.
|
|
|
01-22-2014, 03:45 AM
|
#8
|
LQ Newbie
Registered: Jan 2014
Posts: 14
Original Poster
Rep: 
|
Turns out that smcroute is pretty unstable as well. After 4 - 5 minutes of repeated link abuse, the packets do not get forwarded anymore even though the routes are shown to be in place. You can check them using ip mroute show. So I had to kill the smcroute daemon and run it again every time it went down.
By the way, I needed these static routes for testing purposes only and smcroute was reliable enough. I will be making use of a Cisco L3 switch in the place of my Linux router in the future. My "research"  will take some time and if you leave this thread open I will post the results of my findings.
|
|
|
All times are GMT -5. The time now is 09:37 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|