From michal at traffixsystems.com Mon Aug 1 01:29:03 2011 From: michal at traffixsystems.com (Michal Lefler) Date: Mon, 1 Aug 2011 11:29:03 +0300 Subject: [sctp-dev] Setting "Traffic Class" to a SctpChannel In-Reply-To: <4E1C154F.7030800@oracle.com> References: <3D82F991-6495-4137-9CCB-ED5ADE3813A0@symsoft.com> <4E1C154F.7030800@oracle.com> Message-ID: Chris. Thanks for your response. We are indeed interested in configuring the different SCTP parameters since it makes a significant difference in how the associations function in different scenarios (channel failover etc.). SCTP is very sensitive to the network condition and we interconnect different associations with different network condition, so we should be able to configure profile per each remote association. We would like to configure each server accepted channel differently. Is this possible? We would like to be able to configure the traffic class. In addition, we are very interested to be able to configure the following parameters: * net.sctp.sack_timeout * net.sctp.prsctp_enable * net.sctp.addip_enable * net.sctp.rto_beta_exp_divisor * net.sctp.rto_alpha_exp_divisor * net.sctp.cookie_preserve_enable * net.sctp.hb_interval * net.sctp.max_init_retransmits * net.sctp.path_max_retrans * net.sctp.rcvbuf_policy * net.sctp.sndbuf_policy * net.sctp.association_max_retrans * net.sctp.max_burst * net.sctp.valid_cookie_life * net.sctp.rto_max * net.sctp.rto_min * net.sctp.rto_initial and in a lower priority: * net.sctp.sctp_wmem * net.sctp.sctp_rmem * net.sctp.sctp_mem Thanks, Michal. -----Original Message----- From: Chris Hegarty [mailto:chris.hegarty at oracle.com] Sent: Tuesday, July 12, 2011 12:35 PM To: Michal Lefler Cc: sctp-dev at openjdk.java.net Subject: Re: [sctp-dev] Setting "Traffic Class" to a SctpChannel On 07/ 7/11 03:09 PM, Michal Lefler wrote: > Hi. > Is there a way in which I can set the traffic class to a > com.sun.nio.sctp.SctpChannel instance? Currently there is no way of setting the traffic class on an SctpChannel. In our experience traffic class was not widely used and there were no requests for supping it in SCTP. Since socket options are supported through the SctpSocketOption interface and the channel can report its supported options, supportedOptions(), then it may be possible to support implementation specific options in the future. Is this something that is really important to you? -Chris. > I mean something similar to the TCP option: > java.net.Socket.setTrafficClass(int tc); > > Thanks, > Michal. > -- From michal at traffixsystems.com Mon Aug 1 02:56:32 2011 From: michal at traffixsystems.com (Michal Lefler) Date: Mon, 1 Aug 2011 12:56:32 +0300 Subject: [sctp-dev] Problem in receiving notifications on SCTP channel events In-Reply-To: <4E04B014.9070009@oracle.com> References: <4E04B014.9070009@oracle.com> Message-ID: Chris. You are right. We did manage to get the required notifications within a short while after playing with the different OS net.sctp. params (such as net.sctp.path_max_retrans etc.). Thanks, Michal. -----Original Message----- From: Chris Hegarty [mailto:chris.hegarty at oracle.com] Sent: Friday, June 24, 2011 6:41 PM To: Michal Lefler Cc: sctp-dev at openjdk.java.net Subject: Re: [sctp-dev] Problem in receiving notifications on SCTP channel events Hi Michal, Notification of these events is being passed by the native SCTP stack to the Java implementation. If they are not coming in a timely manner then it may be that there is a property in the OS controlling the heartbeat timeout that could help. What platform are you running on? Another question, are you saying that the notification is slow because of the fact that the selector doesn't fire? or is it just that you happen to be using this model rather then blocking. Do you know if the same delay is seen when using blocking SCTP channels? I'm sorry but I haven't done much testing of this type of scenario. -Chris. On 06/24/11 02:51 PM, Michal Lefler wrote: > Hi. > > We use SCTP channel, with asynchronous reads by a selector. > > We are using it as we saw in the SCTP example: > > private boolean read(SelectionKey k) { > > final SctpChannel ch = ... > > ... > > MessageInfo messageInfo = ch.receive(bb, ch, associationHandler); > > ... > > In our associationHandler implementation, we override all the methods in > "AbstractNotificationHandler", > > and for now, we simply write a log line for each. > > The problem is that we don't get any immediate notification when network > interfaces are disconnected. > > It becomes very problematic when we have no more connected network > interfaces left, and we don't get any notification for that. > > We do get few notifications after about a minute, which is far too late > for us. > > We also don't get any other indication that anything is wrong. > > It doesn't seem as if the SCTP implementation notices that anything is > wrong at all. > > When the network interfaces are back, the system is not recovering. > > Is there a way we can get any immediate notification (or any other > indication, such as an exception) when network interfaces are disconnected? > > Thanks, Michal. > > *Michal Lefler* > > *Chief Architect* / *Traffix Systems* > > *T* +972(0)9-788-9237, *M* +972(0)52-534-0905 > > *Skype *michal.lefler > > *We invite you to join the** LinkedIn Diameter discussion group > *** > > www.traffixsystems.com > > Description: Description: Description: sig 1 > > From chris.hegarty at oracle.com Tue Aug 2 04:23:45 2011 From: chris.hegarty at oracle.com (Chris Hegarty) Date: Tue, 02 Aug 2011 12:23:45 +0100 Subject: [sctp-dev] Setting "Traffic Class" to a SctpChannel In-Reply-To: References: <3D82F991-6495-4137-9CCB-ED5ADE3813A0@symsoft.com> <4E1C154F.7030800@oracle.com> Message-ID: <4E37DE41.7030909@oracle.com> On 8/1/2011 9:29 AM, Michal Lefler wrote: > Chris. > Thanks for your response. > We are indeed interested in configuring the different SCTP parameters > since it makes a significant difference in how the associations function > in different scenarios (channel failover etc.). > SCTP is very sensitive to the network condition and we interconnect > different associations with different network condition, so we should be > able to configure profile per each remote association. > We would like to configure each server accepted channel differently. Is > this possible? Socket-level options can be configured per accepted channel, but I'm not sure if this is what you are really looking for. > We would like to be able to configure the traffic class. Currently this is not supported, but I don't see any problem with supporting it. I'll file a bug in our bug database for this. > > In addition, we are very interested to be able to configure the > following parameters: > * net.sctp.sack_timeout > * net.sctp.prsctp_enable > * net.sctp.addip_enable > * net.sctp.rto_beta_exp_divisor > * net.sctp.rto_alpha_exp_divisor > * net.sctp.cookie_preserve_enable > * net.sctp.hb_interval > * net.sctp.max_init_retransmits > * net.sctp.path_max_retrans > * net.sctp.rcvbuf_policy > * net.sctp.sndbuf_policy > * net.sctp.association_max_retrans > * net.sctp.max_burst > * net.sctp.valid_cookie_life > * net.sctp.rto_max > * net.sctp.rto_min > * net.sctp.rto_initial > > and in a lower priority: > * net.sctp.sctp_wmem > * net.sctp.sctp_rmem > * net.sctp.sctp_mem These sysctl variables are not part of any RFC and I guess are implementation specific to LKSCTP. Most are not appropriate to a higher level API like Java, we could not provide consistent cross platform support. Also it is not clear to me the implication of setting some of these variables on a live process, e.g. can you enable/disable Dynamic Address Reconfiguration support per association? -Chris. > > Thanks, > Michal. > > > -----Original Message----- > From: Chris Hegarty [mailto:chris.hegarty at oracle.com] > Sent: Tuesday, July 12, 2011 12:35 PM > To: Michal Lefler > Cc: sctp-dev at openjdk.java.net > Subject: Re: [sctp-dev] Setting "Traffic Class" to a SctpChannel > > On 07/ 7/11 03:09 PM, Michal Lefler wrote: >> Hi. >> Is there a way in which I can set the traffic class to a >> com.sun.nio.sctp.SctpChannel instance? > Currently there is no way of setting the traffic class on an > SctpChannel. In our experience traffic class was not widely used and > there were no requests for supping it in SCTP. > > Since socket options are supported through the SctpSocketOption > interface and the channel can report its supported options, > supportedOptions(), then it may be possible to support implementation > specific options in the future. > > Is this something that is really important to you? > > -Chris. > >> I mean something similar to the TCP option: >> java.net.Socket.setTrafficClass(int tc); >> >> Thanks, >> Michal. >> From devnullaccount at yahoo.se Thu Aug 11 05:03:33 2011 From: devnullaccount at yahoo.se (Chris) Date: Thu, 11 Aug 2011 13:03:33 +0100 (BST) Subject: [sctp-dev] Using SctpMultiChannel Message-ID: <1313064213.34001.YahooMailClassic@web29008.mail.ird.yahoo.com> Hi, I'm trying to use SctpMultiChannel to get multiple associations on the same socket (same local port/IP but different remote endpoints), but I can't for the life of me figure out the API (http://openjdk.java.net/projects/sctp/javadoc/com/sun/nio/sctp/SctpMultiChannel.html) I get that I should do SctpMultiChannel.open() to create an instance and that I should bind it to my local address(es). But then I want to use something like connect() (like on a regular SctpChannel), but there's no such method, or anything similar as far as I can see. And the only way to get a regular SctpChannel out of this class seems to be branch(Accociation), but that's not either an option since I need to have an association to call that. What am I missing? TIA, Chris From johan.lubcke at symsoft.com Thu Aug 11 05:25:12 2011 From: johan.lubcke at symsoft.com (=?iso-8859-1?Q?Johan_L=FCbcke?=) Date: Thu, 11 Aug 2011 14:25:12 +0200 Subject: [sctp-dev] Using SctpMultiChannel In-Reply-To: <1313064213.34001.YahooMailClassic@web29008.mail.ird.yahoo.com> References: <1313064213.34001.YahooMailClassic@web29008.mail.ird.yahoo.com> Message-ID: <08E89A63-95B5-42B6-B236-6DF8D545F4DF@symsoft.com> I had the same problem and I ended up doing a "send" call to the remote address. That way I get a AssociationChangeNotification with an association id that can be passed to "branch". This seems a bit awkward but it works. (Especially since I need to have some actual data to send already when I want to connect to the remote side). Doing a "connect" would have been more natural. If there is a better way I am equally interested! / Johan 11 aug 2011 kl. 14.03 skrev Chris: > Hi, > > I'm trying to use SctpMultiChannel to get multiple associations on the same socket (same local port/IP but different remote endpoints), but I can't for the life of me figure out the API (http://openjdk.java.net/projects/sctp/javadoc/com/sun/nio/sctp/SctpMultiChannel.html) > > I get that I should do SctpMultiChannel.open() to create an instance and that I should bind it to my local address(es). > But then I want to use something like connect() (like on a regular SctpChannel), but there's no such method, or anything similar as far as I can see. And the only way to get a regular SctpChannel out of this class seems to be branch(Accociation), but that's not either an option since I need to have an association to call that. > > What am I missing? > > TIA, > Chris -------------- next part -------------- A non-text attachment was scrubbed... Name: PGP.sig Type: application/pgp-signature Size: 881 bytes Desc: =?iso-8859-1?Q?Detta_=E4r_en_digitalt_signerad_del_av_brevet?= Url : http://mail.openjdk.java.net/pipermail/sctp-dev/attachments/20110811/ad720f9c/attachment.bin From chris.hegarty at oracle.com Thu Aug 11 05:59:12 2011 From: chris.hegarty at oracle.com (Chris Hegarty) Date: Thu, 11 Aug 2011 13:59:12 +0100 Subject: [sctp-dev] Using SctpMultiChannel In-Reply-To: <08E89A63-95B5-42B6-B236-6DF8D545F4DF@symsoft.com> References: <1313064213.34001.YahooMailClassic@web29008.mail.ird.yahoo.com> <08E89A63-95B5-42B6-B236-6DF8D545F4DF@symsoft.com> Message-ID: <4E43D220.4030303@oracle.com> On 08/11/11 01:25 PM, Johan L?bcke wrote: > I had the same problem and I ended up doing a "send" call to the remote address. That way I get a AssociationChangeNotification with an association id that can be passed to "branch". Yes, this would be the best way to achieve what you are looking for. SctpMultiChannel is a little like a datagram socket, in that it can send and receive messages to/from remote peers without explicitly setting up an association, i.e. no connect is required. The class description and send method describe this: "The channel will implicitly setup a new association whenever it sends or receives a message from a remote peer if there is not already an association with that peer." It would appear that you want SctpChannel semantics but not the overhead of creating a new socket for each association. But once branched the returned SctpChannel will be assigned its own socket. -Chris. > This seems a bit awkward but it works. (Especially since I need to have some actual data to send already when I want to connect to the remote side). Doing a "connect" would have been more natural. > > If there is a better way I am equally interested! > > / Johan > > > 11 aug 2011 kl. 14.03 skrev Chris: > >> Hi, >> >> I'm trying to use SctpMultiChannel to get multiple associations on the same socket (same local port/IP but different remote endpoints), but I can't for the life of me figure out the API (http://openjdk.java.net/projects/sctp/javadoc/com/sun/nio/sctp/SctpMultiChannel.html) >> >> I get that I should do SctpMultiChannel.open() to create an instance and that I should bind it to my local address(es). >> But then I want to use something like connect() (like on a regular SctpChannel), but there's no such method, or anything similar as far as I can see. And the only way to get a regular SctpChannel out of this class seems to be branch(Accociation), but that's not either an option since I need to have an association to call that. >> >> What am I missing? >> >> TIA, >> Chris > From devnullaccount at yahoo.se Thu Aug 11 06:13:29 2011 From: devnullaccount at yahoo.se (Chris) Date: Thu, 11 Aug 2011 14:13:29 +0100 (BST) Subject: [sctp-dev] Using SctpMultiChannel In-Reply-To: <4E43D220.4030303@oracle.com> Message-ID: <1313068409.75749.YahooMailClassic@web29005.mail.ird.yahoo.com> Hi Chris and Johan big thanks for the replies. I guess I could try send(), but I won't have any data to send initially but would like to have the conneciton up so it sounds a bit messy compared to my current code. But with lack of other options, I'll try it. Would the association change be a COMM_UP event with a newly-created Association? And I guess that means the "attachment" will be null when reaching the handler... Chris Hegarty said: > It would appear that you want SctpChannel semantics but not > the overhead > of creating a new socket for each association. But once > branched the > returned SctpChannel will be assigned its own socket. > Does it? As far as I understood RFC4960, you use the same *socket* (since I'm using the same local IP/port) that handles multiple different associations. So I'd like a new association, which I guess is an SctpChannel but still bound to the same socket. But maybe that's what you mean and I'm just twisting words :) I'm very surprised by the difference between the SctpServerChannel and SctpMultiChannel since they are very similar in what they do. Could I pervert the SctpMultiChannel to do channel.register(OP_ACCEPT) and channel.accept() in a similar way as to using "send()" to create a connect()? I will need to run a single socket with that can do both accept() and connect() on the same port, and currently I'm not sure of which of these classes supports that. BR, Chris --- On Thu, 8/11/11, Chris Hegarty wrote: > From: Chris Hegarty > Subject: Re: [sctp-dev] Using SctpMultiChannel > To: "Johan L?bcke" > Cc: "Chris" , "sctp-dev at openjdk.java.net" > Date: Thursday, August 11, 2011, 2:59 PM > > > On 08/11/11 01:25 PM, Johan L?bcke wrote: > > I had the same problem and I ended up doing a "send" > call to the remote address. That way I get a > AssociationChangeNotification with an association id that > can be passed to "branch". > > Yes, this would be the best way to achieve what you are > looking for. > > SctpMultiChannel is a little like a datagram socket, in > that it can send > and receive messages to/from remote peers without > explicitly setting up > an association, i.e. no connect is required. The class > description and > send method describe this: > > ???"The channel will implicitly setup a new > association whenever it > ? ? sends or receives a message from a remote > peer if there is not > ? ? already an association with that peer." > > It would appear that you want SctpChannel semantics but not > the overhead > of creating a new socket for each association. But once > branched the > returned SctpChannel will be assigned its own socket. > > -Chris. > > > > This seems a bit awkward but it works. (Especially > since I need to have some actual data to send already when I > want to connect to the remote side). Doing a "connect" would > have been more natural. > > > > > > > If there is a better way I am equally interested! > > > >? ? / Johan > > > > > > 11 aug 2011 kl. 14.03 skrev Chris: > > > >> Hi, > >> > >> I'm trying to use SctpMultiChannel to get multiple > associations on the same socket (same local port/IP but > different remote endpoints), but I can't for the life of me > figure out the API (http://openjdk.java.net/projects/sctp/javadoc/com/sun/nio/sctp/SctpMultiChannel.html) > >> > >> I get that I should do SctpMultiChannel.open() to > create an instance and that I should bind it to my local > address(es). > >> But then I want to use something like connect() > (like on a regular SctpChannel), but there's no such method, > or anything similar as far as I can see. And the only way to > get a regular SctpChannel out of this class seems to be > branch(Accociation), but that's not either an option since > I? need to have an association to call that. > >> > >> What am I missing? > >> > >> TIA, > >>???Chris > > > From devnullaccount at yahoo.se Thu Aug 11 06:30:24 2011 From: devnullaccount at yahoo.se (Chris) Date: Thu, 11 Aug 2011 14:30:24 +0100 (BST) Subject: [sctp-dev] Using SctpMultiChannel In-Reply-To: <1313068409.75749.YahooMailClassic@web29005.mail.ird.yahoo.com> Message-ID: <1313069424.23324.YahooMailClassic@web29014.mail.ird.yahoo.com> I see now that my reading comprehension isn't so good. So the multi-channel does create new associations also for incoming connections :) But what I think I would really be after is a connect() method on SctpServerChannel that spawned a new SctpChannel. If so I wouldn't have to go to the multichannel and its somewhat different way of working. BR, Chris --- On Thu, 8/11/11, Chris wrote: > From: Chris > Subject: Re: [sctp-dev] Using SctpMultiChannel > To: "Johan L?bcke" , "Chris Hegarty" > Cc: "sctp-dev at openjdk.java.net" > Date: Thursday, August 11, 2011, 3:13 PM > Hi Chris and Johan > > big thanks for the replies. > > I guess I could try send(), but I won't have any data to > send initially but would like to have the conneciton up so > it sounds a bit messy compared to my current code. But with > lack of other options, I'll try it. > Would the association change be a COMM_UP event with a > newly-created Association? And I guess that means the > "attachment" will be null when reaching the handler... > > Chris Hegarty said: > > It would appear that you want SctpChannel semantics > but not > > the overhead > > of creating a new socket for each association. But > once > > branched the > > returned SctpChannel will be assigned its own socket. > > > > Does it? As far as I understood RFC4960, you use the same > *socket* (since I'm using the same local IP/port) that > handles multiple different associations. So I'd like a new > association, which I guess is an SctpChannel but still bound > to the same socket. But maybe that's what you mean and I'm > just twisting words :) > > I'm very surprised by the difference between the > SctpServerChannel and SctpMultiChannel since they are very > similar in what they do. Could I pervert the > SctpMultiChannel to do channel.register(OP_ACCEPT) and > channel.accept() in a similar way as to using "send()" to > create a connect()? > I will need to run a single socket with that can do both > accept() and connect() on the same port, and currently I'm > not sure of which of these classes supports that. > > BR, > ? Chris > > > > --- On Thu, 8/11/11, Chris Hegarty > wrote: > > > From: Chris Hegarty > > Subject: Re: [sctp-dev] Using SctpMultiChannel > > To: "Johan L?bcke" > > Cc: "Chris" , > "sctp-dev at openjdk.java.net" > > > Date: Thursday, August 11, 2011, 2:59 PM > > > > > > On 08/11/11 01:25 PM, Johan L?bcke wrote: > > > I had the same problem and I ended up doing a > "send" > > call to the remote address. That way I get a > > AssociationChangeNotification with an association id > that > > can be passed to "branch". > > > > Yes, this would be the best way to achieve what you > are > > looking for. > > > > SctpMultiChannel is a little like a datagram socket, > in > > that it can send > > and receive messages to/from remote peers without > > explicitly setting up > > an association, i.e. no connect is required. The > class > > description and > > send method describe this: > > > > ???"The channel will implicitly setup a new > > association whenever it > > ? ? sends or receives a message from a remote > > peer if there is not > > ? ? already an association with that peer." > > > > It would appear that you want SctpChannel semantics > but not > > the overhead > > of creating a new socket for each association. But > once > > branched the > > returned SctpChannel will be assigned its own socket. > > > > -Chris. > > > > > > > This seems a bit awkward but it works. > (Especially > > since I need to have some actual data to send already > when I > > want to connect to the remote side). Doing a "connect" > would > > have been more natural. > > > > > > > > > > > > If there is a better way I am equally > interested! > > > > > >? ? / Johan > > > > > > > > > 11 aug 2011 kl. 14.03 skrev Chris: > > > > > >> Hi, > > >> > > >> I'm trying to use SctpMultiChannel to get > multiple > > associations on the same socket (same local port/IP > but > > different remote endpoints), but I can't for the life > of me > > figure out the API (http://openjdk.java.net/projects/sctp/javadoc/com/sun/nio/sctp/SctpMultiChannel.html) > > >> > > >> I get that I should do > SctpMultiChannel.open() to > > create an instance and that I should bind it to my > local > > address(es). > > >> But then I want to use something like > connect() > > (like on a regular SctpChannel), but there's no such > method, > > or anything similar as far as I can see. And the only > way to > > get a regular SctpChannel out of this class seems to > be > > branch(Accociation), but that's not either an option > since > > I? need to have an association to call that. > > >> > > >> What am I missing? > > >> > > >> TIA, > > >>???Chris > > > > > > From Johan.Lubcke at symsoft.com Thu Aug 11 07:28:58 2011 From: Johan.Lubcke at symsoft.com (=?iso-8859-1?Q?Johan_L=FCbcke?=) Date: Thu, 11 Aug 2011 16:28:58 +0200 Subject: [sctp-dev] Using SctpMultiChannel In-Reply-To: <1313069424.23324.YahooMailClassic@web29014.mail.ird.yahoo.com> References: <1313069424.23324.YahooMailClassic@web29014.mail.ird.yahoo.com> Message-ID: <90F01D79-AAC2-4A46-9EA0-495936513344@symsoft.com> A "connect" would be preferable. Another way be to get similar results would be if it was possible to do a send with a zero-sized buffer just to get the connection. In my case we ended up with the multichannel due to our need use the same port and address for both incoming and outgoing connections. / Johan 11 aug 2011 kl. 15.30 skrev Chris: > I see now that my reading comprehension isn't so good. So the multi-channel does create new associations also for incoming connections :) > > But what I think I would really be after is a connect() method on SctpServerChannel that spawned a new SctpChannel. If so I wouldn't have to go to the multichannel and its somewhat different way of working. > > BR, > Chris > > --- On Thu, 8/11/11, Chris wrote: > >> From: Chris >> Subject: Re: [sctp-dev] Using SctpMultiChannel >> To: "Johan L?bcke" , "Chris Hegarty" >> Cc: "sctp-dev at openjdk.java.net" >> Date: Thursday, August 11, 2011, 3:13 PM >> Hi Chris and Johan >> >> big thanks for the replies. >> >> I guess I could try send(), but I won't have any data to >> send initially but would like to have the conneciton up so >> it sounds a bit messy compared to my current code. But with >> lack of other options, I'll try it. >> Would the association change be a COMM_UP event with a >> newly-created Association? And I guess that means the >> "attachment" will be null when reaching the handler... >> >> Chris Hegarty said: >>> It would appear that you want SctpChannel semantics >> but not >>> the overhead >>> of creating a new socket for each association. But >> once >>> branched the >>> returned SctpChannel will be assigned its own socket. >>> >> >> Does it? As far as I understood RFC4960, you use the same >> *socket* (since I'm using the same local IP/port) that >> handles multiple different associations. So I'd like a new >> association, which I guess is an SctpChannel but still bound >> to the same socket. But maybe that's what you mean and I'm >> just twisting words :) >> >> I'm very surprised by the difference between the >> SctpServerChannel and SctpMultiChannel since they are very >> similar in what they do. Could I pervert the >> SctpMultiChannel to do channel.register(OP_ACCEPT) and >> channel.accept() in a similar way as to using "send()" to >> create a connect()? >> I will need to run a single socket with that can do both >> accept() and connect() on the same port, and currently I'm >> not sure of which of these classes supports that. >> >> BR, >> Chris >> >> >> >> --- On Thu, 8/11/11, Chris Hegarty >> wrote: >> >>> From: Chris Hegarty >>> Subject: Re: [sctp-dev] Using SctpMultiChannel >>> To: "Johan L?bcke" >>> Cc: "Chris" , >> "sctp-dev at openjdk.java.net" >> >>> Date: Thursday, August 11, 2011, 2:59 PM >>> >>> >>> On 08/11/11 01:25 PM, Johan L?bcke wrote: >>>> I had the same problem and I ended up doing a >> "send" >>> call to the remote address. That way I get a >>> AssociationChangeNotification with an association id >> that >>> can be passed to "branch". >>> >>> Yes, this would be the best way to achieve what you >> are >>> looking for. >>> >>> SctpMultiChannel is a little like a datagram socket, >> in >>> that it can send >>> and receive messages to/from remote peers without >>> explicitly setting up >>> an association, i.e. no connect is required. The >> class >>> description and >>> send method describe this: >>> >>> "The channel will implicitly setup a new >>> association whenever it >>> sends or receives a message from a remote >>> peer if there is not >>> already an association with that peer." >>> >>> It would appear that you want SctpChannel semantics >> but not >>> the overhead >>> of creating a new socket for each association. But >> once >>> branched the >>> returned SctpChannel will be assigned its own socket. >>> >>> -Chris. >>> >>> >>>> This seems a bit awkward but it works. >> (Especially >>> since I need to have some actual data to send already >> when I >>> want to connect to the remote side). Doing a "connect" >> would >>> have been more natural. >>> >>> >>> >>>> >>>> If there is a better way I am equally >> interested! >>>> >>>> / Johan >>>> >>>> >>>> 11 aug 2011 kl. 14.03 skrev Chris: >>>> >>>>> Hi, >>>>> >>>>> I'm trying to use SctpMultiChannel to get >> multiple >>> associations on the same socket (same local port/IP >> but >>> different remote endpoints), but I can't for the life >> of me >>> figure out the API (http://openjdk.java.net/projects/sctp/javadoc/com/sun/nio/sctp/SctpMultiChannel.html) >>>>> >>>>> I get that I should do >> SctpMultiChannel.open() to >>> create an instance and that I should bind it to my >> local >>> address(es). >>>>> But then I want to use something like >> connect() >>> (like on a regular SctpChannel), but there's no such >> method, >>> or anything similar as far as I can see. And the only >> way to >>> get a regular SctpChannel out of this class seems to >> be >>> branch(Accociation), but that's not either an option >> since >>> I need to have an association to call that. >>>>> >>>>> What am I missing? >>>>> >>>>> TIA, >>>>> Chris >>>> >>> >> -------------- next part -------------- A non-text attachment was scrubbed... Name: PGP.sig Type: application/pgp-signature Size: 881 bytes Desc: =?iso-8859-1?Q?Detta_=E4r_en_digitalt_signerad_del_av_brevet?= Url : http://mail.openjdk.java.net/pipermail/sctp-dev/attachments/20110811/243aa851/attachment-0001.bin From chris.hegarty at oracle.com Fri Aug 12 05:50:49 2011 From: chris.hegarty at oracle.com (Chris Hegarty) Date: Fri, 12 Aug 2011 13:50:49 +0100 Subject: [sctp-dev] Using SctpMultiChannel In-Reply-To: <1313069424.23324.YahooMailClassic@web29014.mail.ird.yahoo.com> References: <1313069424.23324.YahooMailClassic@web29014.mail.ird.yahoo.com> Message-ID: <4E4521A9.7050007@oracle.com> The SCTP package provides two programming model styles. ( below taken partly from the package description ): The one-to-one style supported by SctpChannel and SctpServerChannel, and the one-to-many style supported by SctpMultiChannel. The semantics of the one-to-one style interface are very similar to TCP ( like ServerSocketChannel and SocketChanel). An SctpChannel can only control one SCTP association. The semantics of the one-to-many style interface are very similar to UDP (like DatagramChannel). An SctpMutliChannel can control multiple SCTP associations. These two styles are taken from the Sockets API Extensions for SCTP [1]. I see that the one-to-many style does support a connect function, we could expose this through the SCTP API, in a similar way to how it is done in DatagramChannel. I am curious about your need to use SctpMultiChannel. I do get the fact that you want the association to use the same local IP/port, but it is not correct to think that a branched (sctp_peeloff in native terms) will not incur additional OS resources. Taken from [1]: "After an association is established on a one-to-many style socket, the application may wish to branch off the association into a separate socket/file descriptor." -Chris. [1] http://tools.ietf.org/html/draft-ietf-tsvwg-sctpsocket-31 On 11/08/2011 14:30, Chris wrote: > I see now that my reading comprehension isn't so good. So the multi-channel does create new associations also for incoming connections :) > > But what I think I would really be after is a connect() method on SctpServerChannel that spawned a new SctpChannel. If so I wouldn't have to go to the multichannel and its somewhat different way of working. > > BR, > Chris > > --- On Thu, 8/11/11, Chris wrote: > >> From: Chris >> Subject: Re: [sctp-dev] Using SctpMultiChannel >> To: "Johan L?bcke", "Chris Hegarty" >> Cc: "sctp-dev at openjdk.java.net" >> Date: Thursday, August 11, 2011, 3:13 PM >> Hi Chris and Johan >> >> big thanks for the replies. >> >> I guess I could try send(), but I won't have any data to >> send initially but would like to have the conneciton up so >> it sounds a bit messy compared to my current code. But with >> lack of other options, I'll try it. >> Would the association change be a COMM_UP event with a >> newly-created Association? And I guess that means the >> "attachment" will be null when reaching the handler... >> >> Chris Hegarty said: >>> It would appear that you want SctpChannel semantics >> but not >>> the overhead >>> of creating a new socket for each association. But >> once >>> branched the >>> returned SctpChannel will be assigned its own socket. >>> >> >> Does it? As far as I understood RFC4960, you use the same >> *socket* (since I'm using the same local IP/port) that >> handles multiple different associations. So I'd like a new >> association, which I guess is an SctpChannel but still bound >> to the same socket. But maybe that's what you mean and I'm >> just twisting words :) >> >> I'm very surprised by the difference between the >> SctpServerChannel and SctpMultiChannel since they are very >> similar in what they do. Could I pervert the >> SctpMultiChannel to do channel.register(OP_ACCEPT) and >> channel.accept() in a similar way as to using "send()" to >> create a connect()? >> I will need to run a single socket with that can do both >> accept() and connect() on the same port, and currently I'm >> not sure of which of these classes supports that. >> >> BR, >> Chris >> >> >> >> --- On Thu, 8/11/11, Chris Hegarty >> wrote: >> >>> From: Chris Hegarty >>> Subject: Re: [sctp-dev] Using SctpMultiChannel >>> To: "Johan L?bcke" >>> Cc: "Chris", >> "sctp-dev at openjdk.java.net" >> >>> Date: Thursday, August 11, 2011, 2:59 PM >>> >>> >>> On 08/11/11 01:25 PM, Johan L?bcke wrote: >>>> I had the same problem and I ended up doing a >> "send" >>> call to the remote address. That way I get a >>> AssociationChangeNotification with an association id >> that >>> can be passed to "branch". >>> >>> Yes, this would be the best way to achieve what you >> are >>> looking for. >>> >>> SctpMultiChannel is a little like a datagram socket, >> in >>> that it can send >>> and receive messages to/from remote peers without >>> explicitly setting up >>> an association, i.e. no connect is required. The >> class >>> description and >>> send method describe this: >>> >>> "The channel will implicitly setup a new >>> association whenever it >>> sends or receives a message from a remote >>> peer if there is not >>> already an association with that peer." >>> >>> It would appear that you want SctpChannel semantics >> but not >>> the overhead >>> of creating a new socket for each association. But >> once >>> branched the >>> returned SctpChannel will be assigned its own socket. >>> >>> -Chris. >>> >>> >>>> This seems a bit awkward but it works. >> (Especially >>> since I need to have some actual data to send already >> when I >>> want to connect to the remote side). Doing a "connect" >> would >>> have been more natural. >>> >>> >>> >>>> >>>> If there is a better way I am equally >> interested! >>>> >>>> / Johan >>>> >>>> >>>> 11 aug 2011 kl. 14.03 skrev Chris: >>>> >>>>> Hi, >>>>> >>>>> I'm trying to use SctpMultiChannel to get >> multiple >>> associations on the same socket (same local port/IP >> but >>> different remote endpoints), but I can't for the life >> of me >>> figure out the API (http://openjdk.java.net/projects/sctp/javadoc/com/sun/nio/sctp/SctpMultiChannel.html) >>>>> >>>>> I get that I should do >> SctpMultiChannel.open() to >>> create an instance and that I should bind it to my >> local >>> address(es). >>>>> But then I want to use something like >> connect() >>> (like on a regular SctpChannel), but there's no such >> method, >>> or anything similar as far as I can see. And the only >> way to >>> get a regular SctpChannel out of this class seems to >> be >>> branch(Accociation), but that's not either an option >> since >>> I need to have an association to call that. >>>>> >>>>> What am I missing? >>>>> >>>>> TIA, >>>>> Chris >>>> >>> >> From chris.hegarty at oracle.com Fri Aug 12 07:26:24 2011 From: chris.hegarty at oracle.com (Chris Hegarty) Date: Fri, 12 Aug 2011 15:26:24 +0100 Subject: [sctp-dev] Setting "Traffic Class" to a SctpChannel In-Reply-To: References: <3D82F991-6495-4137-9CCB-ED5ADE3813A0@symsoft.com> <4E1C154F.7030800@oracle.com> <4E37DE41.7030909@oracle.com> Message-ID: <4E453810.2060508@oracle.com> Hi Petro, These variables are defined by the SCTP RFC itself, but the SCTP implementation in the JDK does not directly implement this RFC. It builds on top of the native OS implementation, and this exposes itself through the Socket Extension API (internet draft) [1]. So we can only alter whatever is exposed by this API. Retransmission Timeout Parameters are controlled by the SCTP_RTOINFO socket option. I haven't looked into others. It should be possible to add support for this, but I haven't yet tested to see if it is implemented on the major platforms, Solaris & LKSCTP. What I found when initially working on the Java SCTP implementation was that the native OS support in different platforms conforms to different levels of this internet draft. And most OS implementers are reluctant to rev their implementation now until the internet draft is finalized and an RFC published. This is long overdue, but I don't full understand what there process is, or what the complications are. I need to follow up with my contacts there. So your requirements so far is for the ability to set: SCTP_RTOINFO Traffic Class -Chris. [1] http://tools.ietf.org/html/draft-ietf-tsvwg-sctpsocket-31 On 03/08/2011 11:40, Petro Flomin wrote: > Hi Chris, > Thanks for your email, I have few comments: > > The sysctl parameters are actually exposing some of the Parameters > described in RFC, could be syntax and names are different but they are > listed in RFC (chapter 14): > RTO.Initial - 3 seconds > RTO.Min - 1 second > RTO.Max - 60 seconds > RTO.Alpha - 1/8 > RTO.Beta - 1/4 > Valid.Cookie.Life - 60 seconds > Association.Max.Retrans - 10 attempts > Path.Max.Retrans - 5 attempts (per destination address) > Max.Init.Retransmits - 8 attempts > HB.interval - 30 seconds > > > The question is it possible to have possibility to manage these > parameters per socket and not globally? Please note we want to set these > parameters upon creating socket and they shouldn't be changed during > live process. > > Thanks, > Petro > -----Original Message----- > From: Chris Hegarty [mailto:chris.hegarty at oracle.com] > Sent: Tuesday, August 02, 2011 2:24 PM > To: Michal Lefler > Cc: sctp-dev at openjdk.java.net; Gil Shafran; Lenny Ridel; Petro Flomin > Subject: Re: [sctp-dev] Setting "Traffic Class" to a SctpChannel > > On 8/1/2011 9:29 AM, Michal Lefler wrote: >> Chris. >> Thanks for your response. >> We are indeed interested in configuring the different SCTP parameters >> since it makes a significant difference in how the associations >> function in different scenarios (channel failover etc.). >> SCTP is very sensitive to the network condition and we interconnect >> different associations with different network condition, so we should >> be able to configure profile per each remote association. >> We would like to configure each server accepted channel differently. >> Is this possible? > > Socket-level options can be configured per accepted channel, but I'm not > sure if this is what you are really looking for. > >> We would like to be able to configure the traffic class. > > Currently this is not supported, but I don't see any problem with > supporting it. I'll file a bug in our bug database for this. > >> >> In addition, we are very interested to be able to configure the >> following parameters: >> * net.sctp.sack_timeout >> * net.sctp.prsctp_enable >> * net.sctp.addip_enable >> * net.sctp.rto_beta_exp_divisor >> * net.sctp.rto_alpha_exp_divisor >> * net.sctp.cookie_preserve_enable >> * net.sctp.hb_interval >> * net.sctp.max_init_retransmits >> * net.sctp.path_max_retrans >> * net.sctp.rcvbuf_policy >> * net.sctp.sndbuf_policy >> * net.sctp.association_max_retrans >> * net.sctp.max_burst >> * net.sctp.valid_cookie_life >> * net.sctp.rto_max >> * net.sctp.rto_min >> * net.sctp.rto_initial >> >> and in a lower priority: >> * net.sctp.sctp_wmem >> * net.sctp.sctp_rmem >> * net.sctp.sctp_mem > > These sysctl variables are not part of any RFC and I guess are > implementation specific to LKSCTP. Most are not appropriate to a higher > level API like Java, we could not provide consistent cross platform > support. Also it is not clear to me the implication of setting some of > these variables on a live process, e.g. can you enable/disable Dynamic > Address Reconfiguration support per association? > > -Chris. > >> >> Thanks, >> Michal. >> >> >> -----Original Message----- >> From: Chris Hegarty [mailto:chris.hegarty at oracle.com] >> Sent: Tuesday, July 12, 2011 12:35 PM >> To: Michal Lefler >> Cc: sctp-dev at openjdk.java.net >> Subject: Re: [sctp-dev] Setting "Traffic Class" to a SctpChannel >> >> On 07/ 7/11 03:09 PM, Michal Lefler wrote: >>> Hi. >>> Is there a way in which I can set the traffic class to a >>> com.sun.nio.sctp.SctpChannel instance? >> Currently there is no way of setting the traffic class on an >> SctpChannel. In our experience traffic class was not widely used and >> there were no requests for supping it in SCTP. >> >> Since socket options are supported through the SctpSocketOption >> interface and the channel can report its supported options, >> supportedOptions(), then it may be possible to support implementation >> specific options in the future. >> >> Is this something that is really important to you? >> >> -Chris. >> >>> I mean something similar to the TCP option: >>> java.net.Socket.setTrafficClass(int tc); >>> >>> Thanks, >>> Michal. >>> > > From devnullaccount at yahoo.se Sun Aug 14 10:06:17 2011 From: devnullaccount at yahoo.se (Chris) Date: Sun, 14 Aug 2011 18:06:17 +0100 (BST) Subject: [sctp-dev] Using SctpMultiChannel In-Reply-To: <4E4521A9.7050007@oracle.com> Message-ID: <1313341577.28611.YahooMailClassic@web29006.mail.ird.yahoo.com> Hi Chris, I guess I need to read that draft to see if I can get my head around it. But it would have been really nice if one could use the connect() type of model with the SctpServerChannel so one doeesn't have to re-implement a lot of stuff when going to the MultiChannel; I just want multiple associations that are can be either incoming or outgoing from a single socket. Regarding your question: I'd like to use branch() to get "out of" the SctpMultiChannel if only I could get to that point. Since before, I have implementations that use the SctpChannel and SctpServerChannel API for server/client behavior and those are interopping fine with other SCTP implementations (so those shouldn't be broken). I can get the multi-channel to create an outgoing connection to my "server" implementation, but I can't get my "client" to successfully connect to the multi-channel implementation. When I try to do finishConnect() on the SctpChannel, I just get "connection refused" from the multi-implementation, which seems strange since it didn't seem to mind the initial connect(). I'm probably doing something wrong, so I need to debug this more. I can't find any example code anywhere on the net for how SctpMultiChannel is to be used, and sicne the API seems to be very different from the other nio classes, it is difficult to get it working. BR, Chris --- On Fri, 8/12/11, Chris Hegarty wrote: > From: Chris Hegarty > Subject: Re: [sctp-dev] Using SctpMultiChannel > To: "Chris" > Cc: "Johan L?bcke" , "sctp-dev at openjdk.java.net" > Date: Friday, August 12, 2011, 2:50 PM > The SCTP package provides two > programming model styles. ( below taken > partly from the package description ): > > ???The one-to-one style supported by > SctpChannel and SctpServerChannel, > ???and the one-to-many style supported by > SctpMultiChannel. The > ???semantics of the one-to-one style > interface are very similar to TCP ( > ???like ServerSocketChannel and > SocketChanel). An SctpChannel can only > ???control one SCTP association. The > semantics of the one-to-many style > ???interface are very similar to UDP (like > DatagramChannel). An > ???SctpMutliChannel can control multiple > SCTP associations. > > These two styles are taken from the Sockets API Extensions > for SCTP [1]. > I see that the one-to-many style does support a connect > function, we > could expose this through the SCTP API, in a similar way to > how it is > done in DatagramChannel. > > I am curious about your need to use SctpMultiChannel. I do > get the fact > that you want the association to use the same local > IP/port, but it is > not correct to think that a branched (sctp_peeloff in > native terms) will > not incur additional OS resources. Taken from [1]: > > ? "After an association is established on a > one-to-many style socket, > ???the application may wish to branch off > the association into a > ???separate socket/file descriptor." > > -Chris. > > > [1] http://tools.ietf.org/html/draft-ietf-tsvwg-sctpsocket-31 > > On 11/08/2011 14:30, Chris wrote: > > I see now that my reading comprehension isn't so good. > So the multi-channel does create new associations also for > incoming connections :) > > > > But what I think I would really be after is a > connect() method on SctpServerChannel that spawned a new > SctpChannel. If so I wouldn't have to go to the multichannel > and its somewhat different way of working. > > > > BR, > >? ? Chris > > > > --- On Thu, 8/11/11, Chris? > wrote: > > > >> From: Chris > >> Subject: Re: [sctp-dev] Using SctpMultiChannel > >> To: "Johan L?bcke", > "Chris Hegarty" > >> Cc: "sctp-dev at openjdk.java.net" > >> Date: Thursday, August 11, 2011, 3:13 PM > >> Hi Chris and Johan > >> > >> big thanks for the replies. > >> > >> I guess I could try send(), but I won't have any > data to > >> send initially but would like to have the > conneciton up so > >> it sounds a bit messy compared to my current code. > But with > >> lack of other options, I'll try it. > >> Would the association change be a COMM_UP event > with a > >> newly-created Association? And I guess that means > the > >> "attachment" will be null when reaching the > handler... > >> > >> Chris Hegarty said: > >>> It would appear that you want SctpChannel > semantics > >> but not > >>> the overhead > >>> of creating a new socket for each association. > But > >> once > >>> branched the > >>> returned SctpChannel will be assigned its own > socket. > >>> > >> > >> Does it? As far as I understood RFC4960, you use > the same > >> *socket* (since I'm using the same local IP/port) > that > >> handles multiple different associations. So I'd > like a new > >> association, which I guess is an SctpChannel but > still bound > >> to the same socket. But maybe that's what you mean > and I'm > >> just twisting words :) > >> > >> I'm very surprised by the difference between the > >> SctpServerChannel and SctpMultiChannel since they > are very > >> similar in what they do. Could I pervert the > >> SctpMultiChannel to do channel.register(OP_ACCEPT) > and > >> channel.accept() in a similar way as to using > "send()" to > >> create a connect()? > >> I will need to run a single socket with that can > do both > >> accept() and connect() on the same port, and > currently I'm > >> not sure of which of these classes supports that. > >> > >> BR, > >>? ? Chris > >> > >> > >> > >> --- On Thu, 8/11/11, Chris Hegarty > >> wrote: > >> > >>> From: Chris Hegarty > >>> Subject: Re: [sctp-dev] Using > SctpMultiChannel > >>> To: "Johan L?bcke" > >>> Cc: "Chris", > >> "sctp-dev at openjdk.java.net" > >> > >>> Date: Thursday, August 11, 2011, 2:59 PM > >>> > >>> > >>> On 08/11/11 01:25 PM, Johan L?bcke wrote: > >>>> I had the same problem and I ended up > doing a > >> "send" > >>> call to the remote address. That way I get a > >>> AssociationChangeNotification with an > association id > >> that > >>> can be passed to "branch". > >>> > >>> Yes, this would be the best way to achieve > what you > >> are > >>> looking for. > >>> > >>> SctpMultiChannel is a little like a datagram > socket, > >> in > >>> that it can send > >>> and receive messages to/from remote peers > without > >>> explicitly setting up > >>> an association, i.e. no connect is required. > The > >> class > >>> description and > >>> send method describe this: > >>> > >>>? ???"The channel will > implicitly setup a new > >>> association whenever it > >>>? ? ? sends or receives a > message from a remote > >>> peer if there is not > >>>? ? ? already an association > with that peer." > >>> > >>> It would appear that you want SctpChannel > semantics > >> but not > >>> the overhead > >>> of creating a new socket for each association. > But > >> once > >>> branched the > >>> returned SctpChannel will be assigned its own > socket. > >>> > >>> -Chris. > >>> > >>> > >>>> This seems a bit awkward but it works. > >> (Especially > >>> since I need to have some actual data to send > already > >> when I > >>> want to connect to the remote side). Doing a > "connect" > >> would > >>> have been more natural. > >>> > >>> > >>> > >>>> > >>>> If there is a better way I am equally > >> interested! > >>>> > >>>>? ? ? / Johan > >>>> > >>>> > >>>> 11 aug 2011 kl. 14.03 skrev Chris: > >>>> > >>>>> Hi, > >>>>> > >>>>> I'm trying to use SctpMultiChannel to > get > >> multiple > >>> associations on the same socket (same local > port/IP > >> but > >>> different remote endpoints), but I can't for > the life > >> of me > >>> figure out the API (http://openjdk.java.net/projects/sctp/javadoc/com/sun/nio/sctp/SctpMultiChannel.html) > >>>>> > >>>>> I get that I should do > >> SctpMultiChannel.open() to > >>> create an instance and that I should bind it > to my > >> local > >>> address(es). > >>>>> But then I want to use something like > >> connect() > >>> (like on a regular SctpChannel), but there's > no such > >> method, > >>> or anything similar as far as I can see. And > the only > >> way to > >>> get a regular SctpChannel out of this class > seems to > >> be > >>> branch(Accociation), but that's not either an > option > >> since > >>> I? need to have an association to call > that. > >>>>> > >>>>> What am I missing? > >>>>> > >>>>> TIA, > >>>>>? ???Chris > >>>> > >>> > >> >