LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 10-30-2008, 12:01 PM   #1
amolgupta
Member
 
Registered: Feb 2005
Location: agra,india
Distribution: FC2
Posts: 158

Rep: Reputation: 30
how to get a multicasting application to work


hey i wanted to do multicasting i.e. write multicasting application for educational purpose.i even tried to run few codes from different tutorial in c as well as java but thing didn't worked.then i discovered that there are different level of compliance of multicasting capability some say that linux is level 2 compliant and you need to execute some command of "route ***" which i don't understand but i guess has to do with making entries in routing table understand while others say that you will have to recompile your kernel and install mrouted which for me could be a great deal of work.so i just wanted to now what all is required for multicasing over lan and over internet
 
Old 10-30-2008, 01:15 PM   #2
jf.argentino
Member
 
Registered: Apr 2008
Location: Toulon (France)
Distribution: FEDORA CORE
Posts: 493

Rep: Reputation: 50
Nothing special required to do MULTICAST, note that mrouted is only used if you want that your linux box run as a MULTICAST router, nothing to deal with just sending and / or receiving MULTICAST datagrams.

Some tricks:
-you can add the multicast route into the kernel routing rules, but as far as i know it can be a problem only if you have more than interface, or if your default interface isn't configured. That said, you can add it with the following command as root:
Code:
route add -net 224.0.0.0 netmask 240.0.0.0 eth0
, you can replace "eth0" with any other interface you want.

-You can overwrite the system routing rule in your program by specifying the IP address of the interface to use to "listen" to the MULTICAST group when you "setsockopt (IP_ADD_MEMBERSHIP)", and for the emitting interface with a "setsockopt (IP_MULTICAST_IF)". The emitting and receiving interface are totally independant.

-Your MULTICAST emitter doesn't need to make a "setsockopt (IP_ADD_MEMBERSHIP)".

-If the emitter and the receiver run on the same system, you need to loop the MULTICAST socket with a "setsockopt (IP_MULTICAST_LOOP)"

If these don't help, post your code I'll take look.
 
  


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
Question about IP multicasting. lazareth1 Linux - Networking 1 05-30-2008 05:27 PM
multicasting info stoney55 Linux - Networking 3 03-08-2005 11:29 AM
Multicasting Problem Rajesh_Amma Linux - Networking 0 11-22-2004 02:41 AM
guide for multicasting bhupee Linux - General 1 07-01-2004 07:15 PM
Multicasting puzzle tachyon273 Linux - Networking 0 03-14-2003 04:38 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:31 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