From xieqiang at zbeninfo.com Wed Mar 25 06:52:30 2015 From: xieqiang at zbeninfo.com (xieqiang at zbeninfo.com) Date: Wed, 25 Mar 2015 14:52:30 +0800 Subject: [sctp-dev] We need your help: sctp sends more than 2000pakage/1secend Message-ID: <2015032514515077523843@zbeninfo.com> Hi, My project uses sctp(sigtran),but We find a problem. OS:linux centos 6.4 X64 JDK:jdk-7u51-linux-x64 When client sends more than 2000pakage/1secend,throws some exception: java.net.SocketException: Connection reset by peer at sun.nio.ch.SctpChannelImpl.send0(Native Method) at sun.nio.ch.SctpChannelImpl.sendFromNativeBuffer(SctpChannelImpl.java:1039) at sun.nio.ch.SctpChannelImpl.send(SctpChannelImpl.java:991) at sun.nio.ch.SctpChannelImpl.send(SctpChannelImpl.java:971) at com.zbeninfo.protocols.sctp.AssociationImpl.doSendSctp(AssociationImpl.java:659) java.net.SocketException: Socket is shutdown for writing at sun.nio.ch.SctpChannelImpl.send0(Native Method) at sun.nio.ch.SctpChannelImpl.sendFromNativeBuffer(SctpChannelImpl.java:1039) at sun.nio.ch.SctpChannelImpl.send(SctpChannelImpl.java:991) at sun.nio.ch.SctpChannelImpl.send(SctpChannelImpl.java:971) at com.zbeninfo.protocols.sctp.AssociationImpl.doSendSctp(AssociationImpl.java:659) The connection is ok: [root at server-84 bin]# netstat -an|grep 2050 sctp 192.168.1.84:2050 LISTEN sctp 231688 150296 192.168.1.84:2050 192.168.1.85:2050 ESTABLISHED Use tcp for test is ok. After Analysis ,We find: The client send INIT(outbound stream 32,inbound stream 32) , The server receive INIT(outbound stream 32,inbound stream 32), But,com.sun.nio.sctp.Association.maxOutboundStreams() is 10. End of comm_up,the server send INIT_ACK (outbound stream 10,inbound stream 32). Could you please tell us what problem about this? Attach is pcap file for tcpdump catch. snippets of code : class AssociationHandler extends AbstractNotificationHandler { @Override public HandlerResult handleNotification(AssociationChangeNotification not, AssociationImpl associtaion) { switch (not.event()) { case COMM_UP: if (not.association() != null) { this.maxOutboundStreams = not.association().maxOutboundStreams();//get the vlaue is 10 this.maxInboundStreams = not.association().maxInboundStreams(); } if (logger.isInfoEnabled()) { logger.info(String.format("New association setup for Association=%s with %d outbound streams, and %d inbound streams.\n", associtaion.getName(), this.maxOutboundStreams, this.maxInboundStreams)); } associtaion.createworkerThreadTable(Math.max(this.maxInboundStreams, this.maxOutboundStreams)); try { associtaion.markAssociationUp(); associtaion.getAssociationListener().onCommunicationUp(associtaion, this.maxInboundStreams, this.maxOutboundStreams); } catch (Exception e) { logger.error(String.format("Exception while calling onCommunicationUp on AssociationListener for Association=%s", associtaion.getName()), e); } return HandlerResult.CONTINUE; Toney from china. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 22.pcap Type: application/octet-stream Size: 1760 bytes Desc: not available URL: From chris.hegarty at oracle.com Wed Mar 25 16:27:22 2015 From: chris.hegarty at oracle.com (Chris Hegarty) Date: Wed, 25 Mar 2015 16:27:22 +0000 Subject: [sctp-dev] We need your help: sctp sends more than 2000pakage/1secend In-Reply-To: <2015032514515077523843@zbeninfo.com> References: <2015032514515077523843@zbeninfo.com> Message-ID: <5512E1EA.9040001@oracle.com> Hi, I am not aware of any issues in this area. Would it be possible for you to create a minimal testcase that duplicates the issue, so that I can try it locally? -Chris. On 25/03/15 06:52, xieqiang at zbeninfo.com wrote: > Hi, > My project uses sctp(sigtran),but We find a problem. > OS:linux centos 6.4 X64 > JDK:jdk-7u51-linux-x64 > When client sends more than 2000pakage/1secend,throws some exception: > java.net.SocketException: Connection reset by peer > at sun.nio.ch.SctpChannelImpl.send0(Native Method) > at > sun.nio.ch.SctpChannelImpl.sendFromNativeBuffer(SctpChannelImpl.java:1039) > at sun.nio.ch.SctpChannelImpl.send(SctpChannelImpl.java:991) > at sun.nio.ch.SctpChannelImpl.send(SctpChannelImpl.java:971) > at > com.zbeninfo.protocols.sctp.AssociationImpl.doSendSctp(AssociationImpl.java:659) > java.net.SocketException: Socket is shutdown for writing > at sun.nio.ch.SctpChannelImpl.send0(Native Method) > at > sun.nio.ch.SctpChannelImpl.sendFromNativeBuffer(SctpChannelImpl.java:1039) > at sun.nio.ch.SctpChannelImpl.send(SctpChannelImpl.java:991) > at sun.nio.ch.SctpChannelImpl.send(SctpChannelImpl.java:971) > at > com.zbeninfo.protocols.sctp.AssociationImpl.doSendSctp(AssociationImpl.java:659) > The connection is ok: > [root at server-84 bin]# netstat -an|grep 2050 > sctp 192.168.1.84:2050 LISTEN > sctp 231688 150296 192.168.1.84:2050 192.168.1.85:2050 ESTABLISHED > Use tcp for test is ok. > After Analysis ,We find: > The client send INIT(outbound stream 32,inbound stream 32) , > The server receive INIT(outbound stream 32,inbound stream 32), > But,com.sun.nio.sctp.Association.maxOutboundStreams() is 10. > End of comm_up,the server send INIT_ACK (outbound stream 10,inbound > stream 32). > Could you please tell us what problem about this? > Attach is pcap file for tcpdump catch. > snippetsofcode : > class AssociationHandler extends > AbstractNotificationHandler { > @Override > public HandlerResult handleNotification(AssociationChangeNotification > not, AssociationImpl associtaion) { > switch (not.event()) { > case COMM_UP: > if (not.association() != null) { > this.maxOutboundStreams = not.association().maxOutboundStreams();//get > the vlaue is 10 > this.maxInboundStreams = not.association().maxInboundStreams(); > } > if (logger.isInfoEnabled()) { > logger.info(String.format("New association setup for Association=%s with > %d outbound streams, and %d inbound streams.\n", > associtaion.getName(), this.maxOutboundStreams, this.maxInboundStreams)); > } > associtaion.createworkerThreadTable(Math.max(this.maxInboundStreams, > this.maxOutboundStreams)); > try { > associtaion.markAssociationUp(); > associtaion.getAssociationListener().onCommunicationUp(associtaion, > this.maxInboundStreams, this.maxOutboundStreams); > } catch (Exception e) { > logger.error(String.format("Exception while calling onCommunicationUp on > AssociationListener for Association=%s", associtaion.getName()), e); > } > return HandlerResult.CONTINUE; > Toney > from china.