LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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 06-15-2009, 05:49 PM   #1
tegelert
LQ Newbie
 
Registered: Jun 2009
Posts: 3

Rep: Reputation: 0
Unhappy Machine receives multicast but not the application.


I have a simple C++ application running on Redhat 5.3 which reads multicast packets on a configured group address and interface. On another machine I have a simple application which broadcast multicast to the same group as the listener. For some reason the receiver application never receives the packets. If I run the listener app on the sender machine and the sender app on the receiver machine, everything works fine, so I think this confirms the applications themselves are not the source of my problem.
On the receiver machine, if I listen with tcpdump, it detects the packets sent from the sender. So I believe this confirms the network itself is not the source of the problem.
So it seems there is something in the network configuration of the receiver machine which filters the packets and prevents them from reaching the application layer.
I noticed a few similar posts to this group which mentioned the rp_filter setting. I disabled this, but still no packets.
Any help is greatly appreciated.
 
Old 06-15-2009, 09:46 PM   #2
kumar_bst
Member
 
Registered: Jul 2007
Posts: 36
Blog Entries: 1

Rep: Reputation: 15
You may try the following,
set the local address of your multicast listener application as the multicast address instead of system ip. bind with port 5353. and finally set allmulti in ethernet, if you still done receive the packets.
 
Old 06-16-2009, 08:58 AM   #3
tegelert
LQ Newbie
 
Registered: Jun 2009
Posts: 3

Original Poster
Rep: Reputation: 0
Thumbs down Machine receives multicast but not the application

I'm not sure I understand everything you're saying and I'm not sure what you're trying to achieve here.
What I understand is that you want me to try and use the multicast group address as the machine interface IP. So, this means I should try to listen on the multicast group address (using port 5353, rather than my port) as well as use that multicast group address as the interface IP? I didn't expect this to work, but tried anyway. The experiment confirmed my expectation. The listener application fails. As shown in the code snippet below, the call to setsockopt fails with the error: "No such device". This makes complete sense as there is no interface device having the multicast group address.

struct ip_mreq group;
group.imr_multiaddr.s_addr = inet_addr(multicastGroup);
if (nic != NULL) {
group.imr_interface.s_addr = inet_addr(nic);
} else {
group.imr_interface.s_addr = htonl(INADDR_ANY);
}

if (setsockopt(sock, IPPROTO_IP, IP_ADD_MEMBERSHIP,


Any other suggestions?

Thanks for the reply.
 
Old 06-16-2009, 09:45 AM   #4
kumar_bst
Member
 
Registered: Jul 2007
Posts: 36
Blog Entries: 1

Rep: Reputation: 15
If you are using the port other than 5353, for receiving, better to use the port.
Please check the following from command line,
# ifconfig eth0

The output must contains MULTICAST word; you may try the following from comand line,

# ifconfig eth0 allmulti

The above one will enable your network device to receive all multicast packets. You can disable the above using -allmulti option.
[Hope, the interface is eth0]

After that, run your code. If setsockopt() fails, you cant receive multicast packet.

I wanted to mean, in the listen programme, use multicast address in the bind(). At least, I solved my problem in such a way.
 
Old 06-16-2009, 10:39 AM   #5
tegelert
LQ Newbie
 
Registered: Jun 2009
Posts: 3

Original Poster
Rep: Reputation: 0
Machine receives multicast but not the application

I solved this. Ran system-config-securitylevel and found that the RH firewall was running. system-config-securitylevel also allowed me to simply disabled it. Now everything works fine.
I previously thought that the firewall was not running, but was obviously mistaken.
Thanks for your help, much appreciated.
 
  


Reply



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
Run application on *monitor* of remote machine via SSH? DiBosco Linux - Networking 5 04-09-2007 08:57 AM
How to Display Running Application on Remote Machine with SHH anamericanjoe Linux - Software 3 09-14-2006 11:39 AM
Running X-application on a remote AND local machine LinuxFrosh Linux - Software 1 07-04-2006 10:24 AM
Join Multicast group from Linux machine. vineeth_thampi Linux - Networking 0 01-02-2006 06:53 AM
Creating a C application to be run on another machine guarriman Linux - General 2 01-20-2005 10:13 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 06:57 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration