Subject: Re: Notes from the API discussion

From: Michael Tuexen <[email-masked]>
Date: Mon, 3 Sep 2007 18:06:19 +0200

Hi Vlad,

just two comments:

Regarding the AUTH stuff I also noted:
- new authentication event: peer supports no AUTH.

And the text we discussed regarding the SCTP level reuse option
is:

For TCP the SO_REUSEPORT or SO_REUSEADDR are an important
interface to the socket API. These allow binding of the same
port multiple times. In the case of TCP this is often necessary
since TCP will put into TIME-WAIT address and port combination thus
effectively blocking use of that port for 2 MSL. SCTP, on the other
hand, does not TIME-WAIT ports, instead it will TIME-WAIT V-Tags.
Thus such an option is less useful in the API with SCTP. There
are still, however, corner cases where an application may find
these options useful. The general rules for the use of these options
are as follows:

- SO_REUSEPORT and SO_REUSEADDR are the same, either options specifies
   the same behavior, described in this note. Furthermore, in the rest
   of this note we refer to either one (or both) of these options as
   SO_REUSE.

- SO_REUSE is explicitly disallowed on all one-to-many sockets.

- A socket that is NOT bound INADDR_ANY that attempts to
   use the SO_REUSE option will fail i.e. subset binding of
   SO_REUSE sockets is explicitly disallowed.

- If an application first binds a socket WITHOUT the SO_REUSE option,
   then all subsequent binds to that same port/address combination with
   the SO_REUSE option will fail.

- If an application first bind a socket WITH the SO_REUSE option, then
   subsequent binds of that same port/address combination with the
   SO_REUSE option will succeed only if those subsequent sockets also
   carry the SO_REUSE option.

- Only one socket of the same port/address combination may be allowed
   to listen by an implementation of SCTP. If an implementation does
   allow multiple sockets listening on the same port/address combination
   then it is an implementation dependent detail as to if connections to
   that socket go to the same socket, or are load shared amongst the
   multiply bound sockets.

- A connect call will always be allowed for sockets that share the
   same port/address combination. After the association completes and
   is subsequently shutdown, the socket will no longer be allowed to
   connect to further peers i.e. it is identical to an accepted
   one-to-one socket, it must be closed.

- A socket that does NOT use the SO_REUSE option may make a connection
   and after the association completes, be reused in a new connection.

Best regards
Michael

On Aug 27, 2007, at 7:09 PM, Vlad Yasevich wrote:

> Randall Stewart wrote:
>>
>> Michael has some of the other notes.. and can chime in here..
>> but I think we also agreed that...
>>
>> Vlad Yasevich wrote:
>>> [Trying again.  Looks like the mail list dropped my first  
>>> message....]
>>>
>>> Hi all
>>>
>>> This is the notes I have from the API discussion that happened at
>>> the SCTP interop.
>>> bindx()
>>> - this is an atomic operation that will succeed or fail for all
>>>   addresses.
>>> - add wording about usage with only 1 address so that applications
>>>   know which one failed.
>>>
>>> send calls()
>>>  - atomic in non-EOR mode (message mode).
>>>  - may or may not support implicit connect on 1-to-1 sockets.
>>
>>    - sending on a 1-2-M socket when an assoc is formed is a
>>      non-blocking thing. The data gets queued and the implicit
>>      setup happens in parrallel.
>>
>
> I believe it was mentioned :) As long as that's OK with others, I  
> can live with it.
>
> -vlad
>
>>
>> There may have been another one as well.. but I need to
>> think about it.. still a bit jet-lagged :-0
>>
>> R
>>>
>>> sinfo_flags:
>>>  - need to a list of flags that are only allowed in setsockopt().
>>>  - SCTP_INIT flag with NULL data established an association.
>>>  - sctp_sendmsg() with NULL data and NULL ancillary data establishes
>>>    an association with default init params.  This will be a non- 
>>> blocking
>>>    connect.
>>>  - sendmsg() with no user data, without existing association, and  
>>> with
>>>    SCTP_ABORT or SCTP_EOF results in an error (EDONOTBESTUPID? :-)
>>>
>>> PRSCTP
>>>  - replace timetolive with pr_value and add policy framework  
>>> support.
>>>  - add SCTP_PR*** sinfo flag  - pad the hole in sndrcvinfo with
>>> sinfo_pr_*** 16 bit field to support
>>>    policies.
>>>
>>> HAVE_SCTP_*** flags
>>>  - go away.
>>>
>>> SO_REUSE***
>>>  - Michael/Randy have text.
>>>  - setsockopt() must be before bind().  only 1 socket may listen.
>>>  - Define it as an SCTP level option (SO_ level option behavior is
>>>    unspecified)
>>>  - fail on 1-to-many.
>>>
>>> AUTH
>>>   - change sctp_hmacs structure to include a length or number of  
>>> hmacs
>>>   - change sctp_authkey structure to include the key length. This  
>>> pads
>>>     a hole in the structure and aligns the array access correctly.
>>>   - make consistent usage of changes affecting only future  
>>> associations.
>>>
>>> -vlad
>>>
>>
>>
>