Subject: Re: [Tsvwg] one-to-many/one-to-one socket API extension for SCTP

From: "Randall R. Stewart (home)" <[email-masked]>
Date: Sat, 01 Nov 2003 06:22:53 -0600

Hanping Long wrote:

>Hi,
>
>Regarding the one-to-many(UDP style) and one-to-one(tcp style) socket
>interface in socket API, one-to-many is more effiencient in terms of
>exploring the new features of SCTP, can anyone tell me which feature that
>one-to-one style interface CANNOT make use of?
>
>  
>
The big issue (at least I know in KAME-BSD) is that a one-to-one style
socket is not allowed to send data until the connect() or accept() as
completed. This translates into not being able to piggyback data on
the third or fourth leg of the 4-way handshake. The one-to-many uses
implicit connection setup so that when you do a send(data, new-addr); it
will start the connection setup and piggyback the data with the cookie-echo.

At one time there were other features that could not be used by the 
one-to-one style. But
I think for the most mart Kacheong as done a good job of finding ways to 
make them
all work ;->

>Though each association could have its dedicated buffer space for
>one-to-many style API, all the associations will fail if their related
>socket fails. But if one socket fails for one-to-one style API, only one
>association will fail. Is this the benefit of one-to-one style API? or it's
>not possible in reality?
>  
>
What in the world is a "socket fails" .. There is no such thing. You 
either allocate
a socket up front with a
sd = socket(...);
or it just does not work. Once the socket is open the resources are 
dedicated and
I don't see how it could "fail"... if you might give me an example of 
what you
have in mind I might understand what you are driving at.. but I know from
the BSD work in KAME that once I have a socket open.. the socket itself
has nothing in it that can fail.. maybe linux is different.. I don't know...

>But for one-to-one style, the maximum number of associations is limited by
>the number of socket the specific OS allows to open, as well as the select()
>call could handle(the value of FD_SETSIZE).
>
>  
>
Well this is true. In a typical BSD system the max sockets is somewhere 
around
8000. Of course there is almost always a "MAX ASSOC" variable as well.. we
have it in BSD.. (not sure what the default is but I have had it up to 
20,000 before
and brought up 20k assoc)... But back to your point... if  max_socket > 
max_assoc
you have no issue.. however if max_assoc > max_socket (likely) then yep 
..what
you say above is true.

Select would get in the way if you had a lot of assoc in the one-to-one 
catagory.. but
there is something to remember about select and a one-to-many style socket.

1) If you are doing a select for reading when it returns true one of the
    associations is ready to read from.... not a specific one but one of 
them.

2) If you are doing a slect for writing its even more strange :-0 since most
    likely one of the associations under the socket can be written so it 
will
    almost always return true.. however if you want to write a specific
    association it might block (if you don't have non-blocking io set) since
    it might not have been the assoc that the select call said was 
writeable :-0
   Basically select for write just does not work right for the 
one-to-many you
   almost have to do non-blocking io and get the error (EAGAIN) and then
   go forward from there... If you really need to do a select for write 
on a
   specific assoc you might have to peel it off with sctp_peeloff into a
   one-to-one type socket... if theres room :->

R

>Any suggestion or idea is highly appreciated!
>
>hanping
>
>
>
>_______________________________________________
>tsvwg mailing list
>[email-masked]
>https://www1.ietf.org/mailman/listinfo/tsvwg
>
>
>  
>

-- 
Randall R. Stewart
[email-masked] 815-342-5222 (cell phone)

_______________________________________________
tsvwg mailing list
[email-masked]
https://www1.ietf.org/mailman/listinfo/tsvwg

---

From: Sridhar Samudrala <[email-masked]>
Date: Sat, 1 Nov 2003 07:02:27 -0800 (PST)

> will start the connection setup and piggyback the data with the cookie-echo.

In LKSCTP it is possible to do auto connect using sendto()/sendmsg() which
allows bundling of data with cookie-echo. 

> I think for the most mart Kacheong as done a good job of finding ways to 

I can think of only one socket option that applies only to one-to-many
style sockets - SCTP_AUTOCLOSE.  

> has nothing in it that can fail.. maybe linux is different.. I don't know...

Hanping may have meant the failure of the process/thread owning the socket
as "socket fails".

> >call could handle(the value of FD_SETSIZE).

Yes, there are these limits, but it is possible to increase at least the open
file limit at runtime using 'ulimit -n'.
We don't have a limit on the no. of associations per socket(one-to-many) in
LKSCTP. I guess we should have it as a configurable parameter. 

Also 2.6 Linux is going to support a more scalable event polling mechanism 
than poll or select called epoll.
	http://lse.sourceforge.net/epoll

I haven't tried out this mechanism with SCTP sockets on linux, but hopefully
it should work.