linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jean Tourrilhes <jt@bougret.hpl.hp.com>
To: "Clayton, Mark" <mark.clayton@netplane.com>,
	Linux kernel mailing list <linux-kernel@vger.kernel.org>
Subject: Re: Kernel Multicast
Date: Tue, 28 Aug 2001 11:13:21 -0700	[thread overview]
Message-ID: <20010828111321.A8147@bougret.hpl.hp.com> (raw)
In-Reply-To: <87009604743AD411B1F600508BA0F95994CA68@XOVER.dedham.mindspeed.com>
In-Reply-To: <87009604743AD411B1F600508BA0F95994CA68@XOVER.dedham.mindspeed.com>; from mark.clayton@netplane.com on Tue, Aug 28, 2001 at 01:45:35PM -0400

On Tue, Aug 28, 2001 at 01:45:35PM -0400, Clayton, Mark wrote:
> 
> Do you mind sharing your questions/thoughts?  This topic 
> interests me.  I'd be interested in hearing the dialog.
> 
> Thanks,
> Mark
> --
> [root@hjinc mclayton] /sbin/insmod stddisclaimer.o

	Ok, I'll try to be brief... I'm still not on the LKML...

	Linux 2.4.8, multiple network interfaces. I want to Rx/Tx
multicast junk on all interfaces or subset of them, on the same UDP
port.
	First, a bit of background : with multicast, packets are not
automatically sent on all interfaces. If you set a multicast route in
the routing table to an interface, they will be sent to this
interface, and only this one.
	The only way to bypass the routing table is to use the
IP_MULTICAST_IF option, but that select one specific outgoing
interface.
	Therefore, I'm trying to open a separate UDP multicast socket
on each interface active on the system (SIOCGIFCONF).


	I have a program that do (simplified) :
------------------------------------------
socket(AF_INET, SOCK_DGRAM, 0);
bind(sock, INADDR_ANY, MY_PORT);
setsockopt(IP_ADD_MEMBERSHIP, INADDR_ALLHOSTS_GROUP, ONE_INTERFACE);
setsockopt(IP_MULTICAST_IF, ONE_INTERFACE);
------------------------------------------
	First instance : work like a charm : multicast packet are
Tx/Rx on the selected interface without the need of explicit multicast
route.
        Second instance : "bind failed: Address already in use". In
other word, every time I try to bind a second socket on this port, it
fails...

	As "bind" is problematic, I tried as well :
------------------------------------------
bind(sock, INADDR_ALLHOSTS_GROUP, MY_PORT);
------------------------------------------
	This acts exactly as above, second bind fails.

	And finally, I tried :
------------------------------------------
bind(sock, ONE_INTERFACE, MY_PORT);
------------------------------------------
	First instance : Tx ok, doesn't Rx anything at all. I can
understand why, the Rx packet don't have a dest IP address matching
ONE_INTERFACE.


	That's it... As it's my first experiment with Multicast, I'm
probably missing something obvious...
	Thanks in advance...

	Jean

       reply	other threads:[~2001-08-28 18:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <87009604743AD411B1F600508BA0F95994CA68@XOVER.dedham.mindspeed.com>
2001-08-28 18:13 ` Jean Tourrilhes [this message]
2001-08-28 18:30   ` Kernel Multicast Ion Badulescu
2001-08-28 18:34     ` Jean Tourrilhes
     [not found] <87009604743AD411B1F600508BA0F95994CA6A@XOVER.dedham.mindspeed.com>
2001-08-28 21:28 ` Jean Tourrilhes
2001-08-28 17:19 Jean Tourrilhes

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20010828111321.A8147@bougret.hpl.hp.com \
    --to=jt@bougret.hpl.hp.com \
    --cc=jt@hpl.hp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.clayton@netplane.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).