login
Header Space

 
 

Linux multicast forwarding

May 8, 2007 - 6:35am
Submitted by Anonymous on May 8, 2007 - 6:35am.
Linux

Hi,

I have some doubts related to Multicast forwarding in Linux.

I am sending Multicast data packets from source 172.31.128.112 to group 224.0.1.1. I want the linux to act as a simple multicast forwaring router. I do not want any dameon like mrouted and pimd to run. So i created an entry in virtual interface table and in Multicast forwarding cache using syssockopt. The linux has two interfaces eth0 and eth1. I named 0 as virtual interface indes for eth0 and 1 for eth1. The iif in the Multicast forwarding cache is set to 0 (eth0) and oif is 1 (eth1). The output of "ip mroute" command shows that a correct entry has been added in multicast forwarding cache. But the multicast data is not forwarding thru eth1. The data packets are receiving at eth0. But it simply doesnt forward packets. Am i missing something here ? Cant linux forward packets without any dameon running ?

Thanks in advance.

I forgot to say one more

May 8, 2007 - 6:38am
Anonymous (not verified)

I forgot to say one more thing. The entry in the Vif table in linux shows 0 for the pkts and bytes. rest are fine. can somebody help

You are not alone

May 9, 2007 - 1:06pm

Hello there,

I have been (not so) patiently trying to get this going off and on for years, and have given up for the time being. Check out this thread that has been going on for a while about it.

I really think at this time it is inaccurate to say that Linux works as a multicast router. My very careful and often repeated testing indicates that it just DOESN'T. Not only that, the responses I have gotten from people indicate that no one really seems interested in experimenting with multicasting. Otherwise they would have more useful suggestions, like they normally have with other problems...

(sadly)

Well

May 10, 2007 - 2:24am

Hi,

Thanks. I read your thread. I gather that you are running a multicast routing daemon and also the multicast data are arriving on the iif as showin in ip_mr_cache.

But i am not running any daemon. I have a seperate module which deals with the control packets. and also i am not implemeting IGMP. What i am doing is whenever i want some data comming from (S,G) to forward through some oif, i will modify ip_mr_cache and ip_mr_vif using setsockopt. Apart from adding entries to these tables, do i need to do anything else like specfying to kernel to consult MFC when multicast packets comes something like that.

Also is it necessary that kernel should receive IGMP messages to forward multicast data?

Thank you once more,

Maybe this can help...

May 12, 2007 - 6:17pm
TReZ42 (not verified)

Did you check rp_filter in /proc/sys/net/ipv4/conf/*/rp_filter ?

Distibs often enable this to prevent spoofing by checking reverse path of source adress. But multicast sources adresses can be weird, and don't pass reverse path check.

Try setting rp_filter to 0.

Regards,

TReZ42.

no luck here either

May 30, 2007 - 8:42pm
Anonymous (not verified)

I tried setting rp_filter to 0 as well but that didn't change my results ... I see the packets on the input interface of the router, but don't see them on the output interface of the router.

cat /proc/net/ip_mr_cache
Group Origin Iif Pkts Bytes Wrong Oifs
010000EF 1505C90A 6 362 30408 0 5:1
010000EF 1504C90A 5 0 0 0 6:1
000101E0 EDEDFE0A 65535 1 1 0
620101E0 EDEDFE0A 65535 1 1 0

cat /proc/net/ip_mr_vif
Interface BytesIn PktsIn BytesOut PktsOut Flags Local Remote
0 eth0 0 0 0 0 00000 18D3FE0A 00000000
1 eth0 0 0 0 0 00000 09D3FE0A 00000000
2 eth0 0 0 0 0 00000 29D3FE0A 00000000
3 eth1 0 0 0 0 00000 FD01C90A 00000000
4 eth2 0 0 0 0 00000 01ECFE0A 00000000
5 eth3 0 0 0 0 00000 0104C90A 00000000
6 eth4 31332 373 0 0 00000 0105C90A 00000000
7 eth1 0 0 0 0 00000 FD01C90A 00000000
8 eth1.238 0 0 0 0 00000 01EEFE0A 00000000
9 eth1.239 0 0 0 0 00000 01EFFE0A 00000000
10 tun0 0 0 0 0 00000 0102C90A 00000000
11 tun1 0 0 0 0 00000 1200C90A 00000000

Its now forwarding for me....

June 5, 2007 - 6:46am
sreejith menon (not verified)

Hi,

I am the guy who posted this thread. I am now able to forward multicast data in linux. I wrote my own program to add Multicast routing entry and vif entry. I am not using any multicast routing daemon. The problem i faced was thep program which calls MRT_INIT should be always running. I debuged the kernel code and found out the following

1) When MRT_INIT is done , a flag will be set inside this kernel. Only if this flag is set the ip_mr_route itself will be called inside kernel.
2) when we exit the program, the flag sets back to zero.

This was my problem and i am able to forwrard it now.

In the above mail thread, even if u r seeing the packets comming, from the ip_mr_vif file , it is obvious that no packets are reaching the Multicasting forwarding function in kernel. The Bytesin and PktsIn will be incread only inside the multicasting forwarding function. So i am sure here that, the packets have not yet reached the main function.

Are u sending the correct multicast packets? Are u using any daemon? Even if u r using it should be running. I hope the destination mac address you have set as correct.

it's not now forwarding for me ;)

June 20, 2007 - 4:08pm
Anonymous (not verified)

sreejith menon,
can you provide more detail on how you managed to fix the problem?

thanks.
t

Kernel requires that a socket called MRT_INIT and remains open

June 20, 2007 - 9:18pm

Yes, the kernel requires that:
either in your program or in a daemon, you must have a socket created and called MRT_INIT and this socket must keep running until you decide to stop forwarding multicast data.

ok, how to tell if that is the case or not?

July 19, 2007 - 6:17pm
Anonymous (not verified)

wheelz: ok, so how can i figure out if that's the case or not? i'm running smcrouted as my mrouting daemon.

this is all i see in my logs about it:
Jul 19 22:11:12 plutarch /usr/sbin/smcroute[25295]: Debu: 32 byte IGMP signaling dropped
Jul 19 22:11:14 plutarch /usr/sbin/smcroute[25295]: Debu: 28 byte IGMP signaling dropped

Can you share the source

November 15, 2007 - 2:23am
badfan (not verified)

Can you share the source code?

try to set rp_filter param

June 5, 2007 - 8:53am

try to set rp_filter param to "0"
net/ipv4/conf/eth*/rp_filter

Outdated already. Sorry :)

June 5, 2007 - 8:57am

Outdated already. Sorry :)

Any help needed?

July 5, 2007 - 7:02am
Anonymous (not verified)

If you can provide me with some details, i may be able to give some solution for multicast forwarding...

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
speck-geostationary