Subject: Re: [Tsvwg] Section 7.1.3 sctpsocket-02.txt

From: [email-masked]
Date: Mon, 14 Jan 2002 09:41:19 +0530

Randall :
     thanks for for answer. i have one more doubt ...
  lets consider this sequence of events

   open a udp socket .
   make association with peer endpoint A with streams setting X  and got
assoc_id 1
   set some diifernt no of in and out streams using setsockopt
  make another association with other peer endpoint B with streams setting Y and
got assoc_id 2
  and now if i use getsockopt with socket option SCTP_INITMSG
  what should i get stream info from assoc_id 1 or 2....
the stream setting X and Y  may be different ( after stream negotaition )
is this sequence valid or i am missing something
i hope you understand my doubt .

thanks
yogesh

Randall Stewart <[email-masked]> on 01/11/2002 08:42:32 PM

To:   Yogesh Gahlaut/HSS@HSS
cc:   [email-masked]

Subject:  Re: [Tsvwg] Section 7.1.3 sctpsocket-02.txt

Yogesh:

Two things:

First:

The sctp_initmsg is used in the UDP model to start
a new association with a peer (i.e. you are sending the
INIT message out) and over-ride the default INIT parameters
with the value found in the sctp_initmsg structure.

So we have an app sending a message with a
sendmsg() and putting the sctp_initmsg structure
in a CMSG header to go with the first message you
are sending. The sendmsg() call also includes the
destination address in the msg_name field ... i.e. the
sockaddr * of who you are sending (and INIT'ing) to.

Second:

If you are asking instead about notifications, i.e.
the association just came up and how do I tell what
parameters were negotiated in the streams counts
etc.. you get this in a MSG_NOTIFICATION in the
form of a

struct sctp_assoc_change x;

And it too is received via a recvmsg() call where
the msg_flags field gets set to MSG_NOTIFICATION and the
msg_name will have the peer that the association just came
up with .. the data read will be the  sctp_assoc_change..

Of course you must enable this event...

Hope that helps...

R

[email-masked] wrote:
>
> hi all,
>
>   in section 7.1.3   the following structure is being used for returning the
> SCTP_INITMSG option value
>
> struct sctp_initmsg {
>        uint16_t sinit_num_ostreams;
>        uint16_t sinit_max_instreams;
>        uint16_t sinit_max_attempts;
>        uint16_t sinit_max_init_timeo;
>     };
>
>  Since it does not have any input parameter to differentiate in case of more
> than
> one association in UDP style socket .
>
> can anybody explain how to handle this case ?
>
> thanks
> Yogesh
>
> _______________________________________________
> tsvwg mailing list
> [email-masked]
> http://www1.ietf.org/mailman/listinfo/tsvwg

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

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

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

---

From: Randall Stewart <[email-masked]>
Date: Mon, 14 Jan 2002 04:49:17 -0600

Yogesh:

To quote that section:

"
    Setting initialization parameters is effective only on an
    unconnected socket (for UDP-style sockets only future associations
    are effected by the change). With TCP-style sockets, this option is
    inherited by sockets derived from a listener socket.
"

You do not GET anything back from this request. If you do a
getsocketopt() with this parameter you will get back what the 
current default is. For your example 2... This has nothing
to do with current associations but what FUTURE associations
will be setup with.

Now if you want the specific details on an association you
turn on the flag to receive association change events..

Which will cause you to receive a SCTP_ASOC_CHANGE event telling you how
many 
streams you have in/out.

Now you do bring up a good point. If I don't have this on
and want to know how many streams there are there is no
way to tell..

Hmm.. maybe we should add two parameters to the SCTP_STATUS
structure to tell you the in/out streams..

R