PDA

View Full Version : Multicasting--Not able to Do it, suggestion pls



swamyonline
21st January 2009, 02:54
hi ppl,
I am trying to write a Multicast sender and receiver application. the setup is: 1 server, with 20 clients, connected with hub/switch. i wrote the multicasting sender application as normal (with UDP socket) sender with a multicast address group and a port. and the receiver with again UDP receiver but with multicast subscription by joining multicast group as explained in some of the posts earlier.

the problem is: when i execute the sender, its saying 'Network Error', Network not reachable.

whats the problem? initially, i tried with HUB as an interconnecting unit.
my question is: for multicasting in a network, do i need to have a router/ switch? do i have to make any changes in the router/switch? HUB will not support multicasting? What should i do to achieve multicasting in my small n/w?

i tried, with QUdpSocket as well as with plain unix sockets (with socket, bind, setsocketopt,recvfrom,sendto).
pls post ur suggestions, or if possible, post example code for multicast sender and receiver, in plain unix sockets or Qt Code.

my environment is: Qt-4.4.3, RHEL4/ Windows XP.

thanks in advance. bye
swamy.

muellerp
21st January 2009, 06:37
Is your firewall in the way?

swamyonline
22nd January 2009, 01:45
hi,
thanks for ur reply. actually, the problem is solved by configuring the NIC, its like this:

It is relatively simple to configure what interface multicast packets are to be sent out on. What is needed is a default route for multicast traffic specifying the interface.
To do this enter the following command in a terminal:


route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0


The above command will route all multicast traffic out through interface eth0. To confirm the route took effect and was added to your routing table run route -n.

for more information, pls goto:
http://www.tldp.org/HOWTO/Multicast-HOWTO.html

bye
swamy