Subject: Using stream in SCTP

From: [email-masked]
Date: Mon, 26 May 2003 02:29:45 -0700 (PDT)

Dear folks,
My question is about how to use SCTP stream. When reading RFC2960, I
noticed that SCTP can only sequence user messages in a stream by value of
stream sequence number of the data chunk. And stream sequence numbers are
independent of each other between different streams in an association.
Ok, let's say we want to transmit a file with several SCTP streams. How
will SCTP sequence the data in different streams? Is that true that assign
and sequence messages between different streams are not the responsibility
of SCTP, but upper layer? i.e. The upper layer of SCTP on sender end must
determine which stream to use for each data chunk, and further on receiver
end upper layer correspondingly takes care of the message sequencing in
different streams. Am I right? In Chapter 10.1, the Interface to Upper
Layer. The primitive Send() specifies stram id, this proves my guess:
application layer will take care of the data chunk assign and sequencing
among different treams by using SCTP primitives.
My next question is about SCTP API, the primitive vs. socket. In RFC2960,
we have SCTP primitives for convenient communication between SCTP layer
and upper layer. But draft-iftf-tsvwg-sctpsocket-06.txt also recommended
another socket API, which supposed to have minimal change to original TCP
or UDP API. (The socket API sounds awkward to me.) Why not push primitive
through? Thus we will have a clear picture of SCTP in the future!

    Zhou Yu
    Master of Applied Science
    Department of Electrical and Computer Engineering
    University of British Columbia

---

From: "Randall Stewart (cisco)" <[email-masked]>
Date: Mon, 26 May 2003 06:16:00 -0500

>among different treams by using SCTP primitives.

The stream sequence number is assigned by the sending SCTP not
the application.  I am unclear of your question on a file transfer
using streams. One would NOT send a file over multiple streams
unless one decided to have ones own sequenceing on top of what
SCTP does.. otherwise you would not get your file in the correct
order.

Now if you wanted to send two files at the same time.. then yes
you could do that...aka send file-1 down stream 1 and file-2 down
stream-2.. Every time you get a message from stream-1 you write
it to file-1 and  every time you get a message from stream-2 you
write it to file-2.. that would make sense...

>through? Thus we will have a clear picture of SCTP in the future!
The -06 api introduced the sctp_sendmsg() call. In the -07 we will
add a sctp_recvmsg()..

This  may be a library call (it is for the KAME stack) or it may be a
true system call.. the idea of it is to pass a pointer to a
sndrcvinfo structure that can be filled with the normal structure you
glom out of the ancillary data. You also send a int * that is the
msg_flags equivilant.. the prototype will be:

int    sctp_sendmsg    (int s, void *data, size_t datlen, struct 
sockaddr *to, socklen_t tolen,
                                    uint32_t ppid, uint32_t flags , 
uint16_t streamno, uint32_t timetolive, uint32_t context);

int     sctp_recvmsg    (int s, void *msg, size_t *len,
                                     struct sockaddr *from, socklen_t 
*fromlen,
                                     struct sctp_sndrcvinfo *sinfo,
                                     int *msg_flags);

That will make it much simpler for an application to use the API

R

-- 
Randall R. Stewart
ITD
Cisco Systems Inc.
[email-masked] 815-342-5222(cell) or 815-477-2127(office)

---

From: Caitlin Bestler <[email-masked]>
Date: Mon, 26 May 2003 09:27:21 -0500

On 5/26/03, [email-masked] wrote:

>Ok, let's say we want to transmit a file with several SCTP
>streams. How will SCTP sequence the data in different
>streams? 

Multiple streams are intended to allow the interleaved
sending of *different* objects. For example, a
multi-streamed SCTP web-session could deliver multiple
files that compose a single page each on a different
stream. This would be very useful if the server could
actually read them from different file systems, hence 
it was truly fetching them in parallel.

Caitlin Bestler
http://asomi.com/CaitlinBestler/