From: Terje Eggestad <terje.eggestad@scali.com>
To: Chris Friesen <cfriesen@nortelnetworks.com>
Cc: linux-kernel <linux-kernel@vger.kernel.org>,
netdev@oss.sgi.com, linux-net@vger.kernel.org
Subject: Re: anyone ever done multicast AF_UNIX sockets?
Date: 03 Mar 2003 13:51:17 +0100 [thread overview]
Message-ID: <1046695876.7731.78.camel@pc-16.office.scali.no> (raw)
In-Reply-To: <3E5E7081.6020704@nortelnetworks.com>
On a single box you would use a shared memory segment to do this. It has
the following advantages:
- no syscalls at all
- whenever the recipients need to use the info, they access the shm
directly (you may need to use a semaphore to enforce consistency, or if
you're really pressed on time, spin lock a shm location) There is no
need for the recipients to copy the info to private data structs.
- there is no need for the recipients to waste cycles on processing an
update
- you KNOW that all the recipients has "updated" at the same time.
That aside, you idea of being notified when the listener (peer) is not
there is pretty hopless when it comes to multicasts.
Why does it help you to know that there are no recipients contra the
wrong number recipients ???? OR asked differently, if you don't have a
notion of who the recipients are/should be, why would you care if there
are none??????
There are practically no real applications for this feature.
If you really want to get to know that a recipient disappeared, use
a stream socket to each recipients, and to keep the # of syscalls down,
get the aio patch, and do the send to all with a single lio_listio()
call.
Also: Keep in mind that either you do multicast, or explisit send to
all, the data you're sending are copied from you buffer to the dest
sockets recv buffers anyway. If you're sending 1k you need somewhere
between 250 to 1000 cycles to do the copy, depending on alignment. I've
measured the syscall overhead for a write(len=0) to be about 800 cycles
on a P3 or athlon, and about 2000 on P4. If you really have enough
possible recipients, you should use a shm segment instead. If you have
only a few (~10) the overhead is worst case 20000 cycles, or on a 2G P4,
10 microsecs to do a syscall for each. Who cares...
TJ
On Thu, 2003-02-27 at 21:09, Chris Friesen wrote:
> It is fairly common to want to distribute information between a single
> sender and multiple receivers on a single box.
>
> Multicast IP sockets are one possibility, but then you have additional
> overhead in the IP stack.
>
> Unix sockets are more efficient and give notification if the listener is
> not present, but the problem then becomes that you must do one syscall
> for each listener.
>
> So, here's my main point--has anyone ever considered the concept of
> multicast AF_UNIX sockets?
>
> The main features would be:
> --ability to associate/disassociate a socket with a multicast address
> --ability to associate/disassociate with all multicast addresses
> (possibly through some kind of raw socket thing, or maybe a simple
> wildcard multicast address)
> --on process death all sockets owned by that process are disassociated
> from any multicast addresses that they were associated with
> --on sending a packet to a multicast address and there are no sockets
> associated with it, return -1 with errno=ECONNREFUSED
>
> The association/disassociation could be done using the setsockopt()
> calls the same as with udp sockets, everything else would be the same
> from a userspace perspective.
>
> Any thoughts? How hard would this be to put in?
>
> Chris
--
_________________________________________________________________________
Terje Eggestad mailto:terje.eggestad@scali.no
Scali Scalable Linux Systems http://www.scali.com
Olaf Helsets Vei 6 tel: +47 22 62 89 61 (OFFICE)
P.O.Box 150, Oppsal +47 975 31 574 (MOBILE)
N-0619 Oslo fax: +47 22 62 89 51
NORWAY
_________________________________________________________________________
next prev parent reply other threads:[~2003-03-03 12:41 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-02-27 20:09 Chris Friesen
2003-02-27 22:21 ` Greg Daley
2003-02-28 13:33 ` jamal
2003-02-28 14:39 ` Chris Friesen
2003-03-01 3:18 ` jamal
2003-03-02 6:03 ` Chris Friesen
2003-03-02 14:11 ` jamal
2003-03-03 18:02 ` Chris Friesen
2003-03-03 0:05 ` Michael Richardson
2003-03-03 1:23 ` Alan Cox
2003-03-03 1:00 ` Jeff Dike
2003-03-03 18:11 ` Chris Friesen
2003-03-03 12:51 ` Terje Eggestad [this message]
2003-03-03 12:35 ` David S. Miller
2003-03-03 17:09 ` Chris Friesen
2003-03-03 16:55 ` David S. Miller
2003-03-03 18:07 ` Chris Friesen
2003-03-03 17:56 ` David S. Miller
2003-03-03 19:11 ` Chris Friesen
2003-03-03 18:56 ` David S. Miller
2003-03-03 19:42 ` Terje Eggestad
2003-03-03 21:32 ` Chris Friesen
2003-03-03 23:38 ` Terje Eggestad
2003-03-03 19:39 ` Terje Eggestad
2003-03-03 22:29 ` Chris Friesen
2003-03-03 23:29 ` Terje Eggestad
2003-03-04 2:38 ` jamal
[not found] <3E5E7081.6020704@nortelnetworks.com.suse.lists.linux.kernel>
[not found] ` <20030228083009.Y53276@shell.cyberus.ca.suse.lists.linux.kernel>
[not found] ` <3E5F748E.2080605@nortelnetworks.com.suse.lists.linux.kernel>
[not found] ` <20030228212309.C57212@shell.cyberus.ca.suse.lists.linux.kernel>
[not found] ` <3E619E97.8010508@nortelnetworks.com.suse.lists.linux.kernel>
[not found] ` <20030302081916.S61365@shell.cyberus.ca.suse.lists.linux.kernel>
[not found] ` <3E6398C4.2020605@nortelnetworks.com.suse.lists.linux.kernel>
2003-03-03 18:18 ` Andi Kleen
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=1046695876.7731.78.camel@pc-16.office.scali.no \
--to=terje.eggestad@scali.com \
--cc=cfriesen@nortelnetworks.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-net@vger.kernel.org \
--cc=netdev@oss.sgi.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
all inboxes | Powered by JetHome®