LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 01-08-2014, 06:47 AM   #1
anon_16
LQ Newbie
 
Registered: Jan 2014
Posts: 5

Rep: Reputation: Disabled
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?
 
Old 01-08-2014, 02:55 PM   #2
nini09
Member
 
Registered: Apr 2009
Posts: 969

Rep: Reputation: 67
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).
 
Old 01-10-2014, 06:02 AM   #3
anon_16
LQ Newbie
 
Registered: Jan 2014
Posts: 5

Original Poster
Rep: Reputation: Disabled
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 ?
 
Old 01-10-2014, 02:39 PM   #4
nini09
Member
 
Registered: Apr 2009
Posts: 969

Rep: Reputation: 67
The smcroute is good one. By the way, dynamic route is good even if the link is disturbed, isn't it?
 
Old 01-11-2014, 01:50 AM   #5
anon_16
LQ Newbie
 
Registered: Jan 2014
Posts: 5

Original Poster
Rep: Reputation: Disabled
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.
 
Old 01-13-2014, 06:51 AM   #6
anon_16
LQ Newbie
 
Registered: Jan 2014
Posts: 5

Original Poster
Rep: Reputation: Disabled
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?
 
Old 01-13-2014, 08:07 AM   #7
zhjim
Senior Member
 
Registered: Oct 2004
Distribution: Debian Squeeze x86_64
Posts: 1,436
Blog Entries: 11

Rep: Reputation: 181Reputation: 181
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.
 
Old 01-22-2014, 03:45 AM   #8
anon_16
LQ Newbie
 
Registered: Jan 2014
Posts: 5

Original Poster
Rep: Reputation: Disabled
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
IPv6 multicast listener on a Linux box acting as multicast router maxtux Linux - Networking 0 04-01-2012 09:52 AM
linux with kernel 2.6.x as MULTICAST ROUTER Paolo Prete Linux - Networking 0 05-23-2007 01:50 AM
Can traffic be forwarded to localhost? silence Linux - Networking 3 08-10-2004 02:42 PM
forwarded traffic is caught by input chain kc8tbe Linux - Security 5 04-14-2004 02:14 PM
Most efficient way to tunnel all traffic to remote linux box to then be forwarded? Rims Linux - Networking 0 03-14-2004 01:49 PM


All times are GMT -5. The time now is 02:42 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration