Subject: Multiple receive buffers for a one-to-many style socket?

From: Rakesh Saha <[email-masked]>
Date: Fri, 22 Apr 2005 16:24:38 -0700

Hello All,
I would like to know what are people's opinions of having multiple 
receive buffers one for each association controlled by a one-to-many 
style socket.

Consider that:
  a) An implementation has one receive buffer each for all the 
associations controlled by the same one-to-many socket
  b) The association ID specified in sctp_sndrcvinfo structure in a 
recvmsg() call is meant to indicate the association from which the 
application wants to read

then an application has some control on which association it wants to 
read from. This can facilitate an application reading from specific 
associations when it wants to. It will also make peel off easier to do. 
There may be other valid uses of this feature.

It is highly likely that this topic has been discussed before, in that 
case I would appreciate if someone can point me to any available emails 
etc.

I also thought of reasons why one would not want to have separate 
receive buffers for associations of one-to-many style socket. The 
following points come to my mind:

1. May be by design the read is defined at the socket level and all 
incoming data on all association is treated as FIFO. In such a case 
having a single receive buffer would make sense. However it should be 
pointed out that the application knows that there are multiple 
associations so it is reasonable to expect that the application may want 
to specify a specific association ID to receive data from.

2. What should be the behaviour if the application did not specify an 
association ID? This would be a matter of convention for ex: 
implementation will start from the lowest ID and search upwards till it 
finds an association with data.

3. What should happen if the specified ID does not have any data? I 
think this is covered by blocking/non-blocking behaviour of the socket.

4. Is it expected that if a particular association in the list 
controlled by a one-to-many socket is "special", it is better off being 
peeled off and dealt with separately?
This is reasonable argument but does not cover the case when there are 
many association IDs that the application wants specifically data from 
(at separate time i.e. not simultaneously) but it does not want to peel 
them off.

--
Thanks,
Rakesh.
-=-