Subject: Question for y'all on MSG_SENDALL

From: Randall Stewart <[email-masked]>
Date: Tue, 12 Oct 2004 08:33:26 -0400

Hi all:

I am busy implementing MSG_SENDALL.. very handy I might
add :-D

And I was wondering... do we want a notification when
a MSG_SENDALL completes?

Generally when doing something like this your not going
to block and wait for the copy's to be done to all
your association's (think of 1,000 or 10,000 associations
under one endpoint)... so it might be best to have
a notification that would come up telling you after
all the copy's had been distributed that:

1) the kernel sent a copy of the message to N associations
2) the kernel failed to send a copy of the message to Y associations.

Hopefully Y would be small or 0... but you never know if you
had 10,000 assoc's you might run out of mbufs.... or??

Anyway.. just a thought...

do we need such a critter?

R
-- 
Randall Stewart
ITD
803-345-0369 <or> 815-342-5222

---

From: Kacheong Poon <[email-masked]>
Date: Tue, 12 Oct 2004 06:25:25 -0700

> had 10,000 assoc's you might run out of mbufs.... or??

I guess it is not useful to know the number Y without knowing
which associations they are.  And there is already the
SCTP_SEND_FAILED notification so the app knows which send
fails.  I think the notification as you described is not needed.

-- 

						K. Poon.
						[email-masked]

---

From: Randall Stewart <[email-masked]>
Date: Tue, 12 Oct 2004 09:45:28 -0400

> fails.  I think the notification as you described is not needed.
Cool... I can live with that :-D

R

---

From: "La Monte H.P. Yarroll" <[email-masked]>
Date: Tue, 12 Oct 2004 15:35:50 -0400

I'm glad you brought it up--I meant to ask before you published the most 
recent draft...

Which associations recieve the message?  Just those which are already up 
or all those we've sent to since the socket was created?

It is perfectly legitimate for me to implement auto-close by opening an 
association for each user datagram and then closing it immediately.  An 
application using MSG_SENDALL would get a rather surprising behavior if 
it only sends to associations which happen to be open...

-- 
  Anyone who quotes me in their sig is an idiot. -- Rusty Russell's sig

---

From: Randall Stewart <[email-masked]>
Date: Tue, 12 Oct 2004 15:40:21 -0400

> it only sends to associations which happen to be open...

I don't think I follow the above ..

If an association is CLOSED you have NO record of it.. so you
have no way to send to it.

If an association is opening.. i.e. COOKIE-WAIT/COOKIE-ECHOED
You SHOULD send a copy to the association... even though it
may not be able to be sent right now.

If an assoociation is in SHUTDOWN-SENT or SHUTDOWN-RECEIVED you
would not queue the data there .. you are NOT allowed to per
the SCTP spec.

And of course ESTABLISHED would get a copy :-D

R

---

From: "La Monte H.P. Yarroll" <[email-masked]>
Date: Tue, 12 Oct 2004 15:50:28 -0400

Randall Stewart wrote:

>> I'm glad you brought it up--I meant to ask before you published the 
>> most recent draft...
>>
>> Which associations recieve the message?  Just those which are already 
>> up or all those we've sent to since the socket was created?
>>
>> It is perfectly legitimate for me to implement auto-close by opening 
>> an association for each user datagram and then closing it 
>> immediately.  An application using MSG_SENDALL would get a rather 
>> surprising behavior if it only sends to associations which happen to 
>> be open...
>>
>>
>
> I don't think I follow the above ...

sd = *socket*(PF_INET, *SOCK_SEQPACKET*, *IPPROTO_SCTP)
whatever_send(sd, dest1, p1)
whatever_send(sd, dest2, p2)
whatever_send(sd, dest3, p3)

whatever_send(sd, MSG_SENDALL, p4)

*I think the intent of MSG_SENDALL is that dest1, dest2,
and dest3 all get message p4.  HOWEVER, if my implementation
autocloses associations immediately (this is permissible),
then nobody gets p4.

---

From: Randall Stewart <[email-masked]>
Date: Tue, 12 Oct 2004 16:08:12 -0400

> autocloses associations immediately (this is permissible),

But by definition a sendall to an endpoint with
NO associations will not send anything..

This is no different then doing

send_a_abort( dest1)
send_a_abort( dest2)
send_a_abort( dest3)

(I use abort because its immediate.. but even a graceful close
  would have that property)..

Hey, if you are going to use auto-close AND you set the
timer that short.. this should not be surprising to you..

There are no associations..

R

---

From: "Peter Lei (peterlei)" <[email-masked]>
Date: Tue, 12 Oct 2004 15:01:43 -0500

> autocloses associations immediately (this is permissible),

Yes, that is the intent.  But if your implementation (or by
user/application specification) do an immediate autoclose
after the send, then no, you will NOT get p4 out to anyone.
As specified, SENDALL goes to only open associations.  For
your implementation, you must either disable auto-close,
change its timeout, or live with no SENDALL function :-D

regards,
--peter

---

From: "Peter Lei (peterlei)" <[email-masked]>
Date: Tue, 12 Oct 2004 15:04:23 -0500

regards,
--peter

---

From: "La Monte H.P. Yarroll" <[email-masked]>
Date: Wed, 13 Oct 2004 08:09:16 -0400

Peter Lei (peterlei) wrote:

>>>> Which associations recieve the message?  Just those which are 
>>>> already up or all those we've sent to since the socket was created?
>>>>
>>>> It is perfectly legitimate for me to implement auto-close by 
>>>> opening an association for each user datagram and then closing it 
>>>> surprising behavior if it only sends to associations which happen 
>>>> to be open...
>>>>
>>>>
>>>

Ah, good point.  So if I'm using MSG_SENDALL I really
ought to either explicitly set the auto-close timeout
or disable it.  Or are we explicit enough in the API
spec about the defaults that a coder can ignore
auto-close?

---

From: Randall Stewart <[email-masked]>
Date: Wed, 13 Oct 2004 08:25:35 -0400

> spec about the defaults that a coder can ignore
Auto-close (according to the socket draft) is OFF by default..

So you have to set it to get it enabled.. sooo if you
turn it on and set it for say 1ms.. and then do
a MSG_SENDALL.. you will get what you asked for :-0

Another cool thing one could do with MSG_SENDALL for example is

send with send...( MSG_SENDALL|MSG_ABORT);
or
send..(... MSG_SENDALL|MSG_EOF)

Which would gracefully close or abort all open associations.. kinda cool.

R