multicasting - need a help on multicasting

This is a discussion on multicasting - need a help on multicasting within the Networking/Device Communication forums, part of the General Programming Boards category; Hi All,
I im developing some p2p multicasting overlay layer using c.
basically what i want to implement is to ...

multicasting - need a help on multicasting

Hi All,

I im developing some p2p multicasting overlay layer using c.
basically what i want to implement is to multicast a string(or any query) from one node wait for a possible response. In the mean time other nodes which have been joined to the muticasting group are listening for multi-casting messages and respose once a message receive.

my question is how to avoid by receiving a multi-casting message sent by a node itself.
for eg if node A sent a message "Message from A", in my application node A receive the message "Message from A" itself. I want to avoid that from socket level.

Thanks for the reply.
If I do it at application level could you give me some tips how to filter its own ip of a peer node.
I mean a easy way rather I try with it. actualy im in a touch schedule with this project.

When you receive the datagram packet, just check the source IP of the sender. If it matches your current IP, then you can discard it. This will work depending on the layout of your network. If NAT occurs before your packet reaches the first multicast aware switch, then the source IP you get back will already be translated so it won't work.

The easiest way to filter out your own messages is to build it in to the protocol. For instance, your application generates a random GUID when it starts. The application then appends this GUID to every messages it sends out. The application can then drop all messages that have a GUID matching the one it generated on startup.