SCTP Discussions

Text archives Help


Re: [SCTP-Discussion] ext_sendmsg() fails to send data


Chronological Thread 
  • From: Michael Tuexen <Michael.Tuexen AT micmac.franken.de>
  • To: "Heywood, Simon " <Simon.Heywood AT thalesgroup.com>
  • Cc: "SCTP discussion (E-mail)" <discussion AT sctp.de>
  • Subject: Re: [SCTP-Discussion] ext_sendmsg() fails to send data
  • Date: Wed Jul 7 13:37:06 2004
  • List-id: SCTP Discussions <discussion.sctp.de>

OK, I where able to run your programs (very nice way to
submit the example, it compiled without any problems on
Mac OS X).

One remark: When the client has sent all its data, this means
after

for (i = 0; i < num_to_send; ++i)
sctp_send_msg(sock, STREAM, buf, sizeof buf);

it just terminates. The problem is that the SCTP implementation
(in another thread) has not finished sending everything. So the
association is ABORTED, when you force the SCTP implementation to
give up. Just insert a
sleep(10)
before
return 0;
or so to give enough time for the transfer. Using a kernel implementation
this would not be necessary, because the association would stay alive
in the kernel even if the application process finishes.

Best regards
Michael

On Jul 7, 2004, at 12:58 PM, Heywood, Simon wrote:

I've been experiencing problems when sending a few KiB of data over an SCTP
link. I'm using ext_sendmsg() and ext_recvmsg() to transmit the data. I may
be doing something wrong in the code that calls those functions, but the
results are a little strange and I wondered if anyone else had encountered
this behaviour.

I knocked up the attached test code to investigate the problems. After
building it ('tar zxf <file>', 'cd bug_test', 'make') run 'sudo ./server' in
one virtual terminal and 'sudo ./client 1' in another. The number passed to
the client specifies the number of 1300 byte buffers to send, the rest
should be obvious from the code. When I pass '5', '50' or '500' I just get
three messages at the server (like the output below except for the last two
lines). With Ethereal, I also verified that there were only three data
messages on the wire. When I pass '5000' I get a lot of messages arriving
(as expected). Most odd. (BTW, you have to restart the server every time
before you run the client.)

The precise output varies; sometimes I get an internal error from one of the
SCTP libraries. The following output is typical of this.

----- client -----
heywood@bridge:~/src/bug_test$ sudo ./client 500
Sending 500 buffers.
----- client -----

----- server -----
heywood@bridge:~/src/bug_test$ sudo ./server
SCTP handling client '127.0.0.1:31943'.

recvtotal == 1300
UNITS == 1024
numdots == 0
recvtotal / UNITS == 1
.
recvtotal == 2600
UNITS == 1024
numdots == 1
recvtotal / UNITS == 2
.
recvtotal == 3900
UNITS == 1024
numdots == 2
recvtotal / UNITS == 3
.WARNING: SCTPSocket::internalReceive() - Data buffer size is zero!
sctp_recv_msg(): ext_recvmsg() failed: Invalid argument
----- server -----

I'm using the latest version of the Essen SCTP libraries (sctplib-1.0.1 and
socketapi-1.3.1) on Linux 2.4.26. I'd be grateful if someone could have a
look at this test code to see if I'm doing anything wrong, or at least to
try to reproduce these results.

Thanks,
Simon

<bug_test.tgz>





Archive powered by MHonArc 2.6.19+.

Top of page