Subject: [Tsvwg] SCTP socket API: No way to determine which connect() operation corresponds with which connect failure

From: Ivan Skytte Jørgensen <[email-masked]>
Date: Fri, 17 Nov 2006 20:31:12 +0100

I think I have found a problem with the SCTP Socket API Draft 
( draft-ietf-tsvwg-sctpsocket-13.txt)

Given:
1: A one-to-many socket,
2: Non-blocking mode,
3: Multiple outstanding connect() operations,
4: That fails.

I cannot find any way of determining which failure corresponds to which 
connection attempt.

When a connection fails (and the application has subscribed to association 
events), the application retrieves a sctp_assoc_change notification with 
sac_state = SCTP_CANT_STR_ASSOC, but that is not useful:
The connect() operation has no way of supplying the SCTP implementation with a 
cookie/context/... that can be given back to application in the 
sctp_assoc_change notification.

Similar (but solvable) for successful connections: The application has to do a 
sctp_getpaddrs() to obtain the peer address list and then look for a match in 
a list of outstanding connect operations. Not pretty.

I think a simple way of solving this is to extend the sctp_assoc_change 
structure with a "uint32_t sac_context", that will have the value of the 
default context value at the time the connect() call was made. Then the 
application can set the default context value before the connect() call, and 
later on easily match the failure with its own internal list of outstanding 
connect operations.

---

From: Randall Stewart <[email-masked]>
Date: Thu, 30 Nov 2006 14:30:14 -0500

> later on easily match the failure with its own internal list of outstanding 
Yes, a context could be added.. but also there may be another
way to skin this cat :-)

1) The can't str assoc has an assoc-id.
2) The assoc id is a uniq indicator of the association.

Why not make sctp_connectx() have an out param that is the associd that
can be filled in..

This would then allow you to do:

sctp_connectx(...., &myid);

and then when the notifications come in you can match the
association id to myid ?

I have often thought we were lacking this tie back...

R

-- 
Randall Stewart
803-345-0369 <or> 815-342-5222(cell)

---

From: Ivan Skytte Jørgensen <[email-masked]>
Date: Thu, 30 Nov 2006 22:34:49 +0100

On Thursday 30 November 2006 20:30, Randall Stewart wrote:
> > [snip: proposal for using 'context' to solve this]
>

That work work too, and be nicer than my proposal.

Applications using implicit association setup wouldn't be able to use it, but 
I don't think that will be a problem, because I believe that they probably 
are address-focused and rely on SCTP_SEND_FAILED instead.

So I think that your idea of an out parameter of type scpt_assoc_t to 
sctp_connectx() is the best solution.

Regards,
  Ivan