Networking weirdness (retransmit timeouts ?)

Rolf Schroedter Rolf.Schroedter at
Thu Oct 2 19:41:17 UTC 2003

When trying to measure the network throughput of RTEMS
using TCP/IP I noticed a weird thing:
- If I connect to a simple Echo server then packets
are transmitted almost quickly and without errors.
- If the Echo server *additionally* sends a few "HELLO"
messages, then the transmission becomes unstable
and slow (downto ~2 KByte/sec).

 From TCP statistics (rtems_bsdnet_show_tcp_stats) I see
that there are "retransmit timeouts" and sometimes read()
returns "connection timeout" errors. Guess, this may have
to do with scheduling of the RTEMS-TCP tasks.

Running ETHEREAL on the Linux-Server I see that there
are indeed gaps of 1-4 seconds where the RTEMS-client
doesn't send anything.

Any help and/or ideas are welcome. I even don't know
whether the problem is located in the LEON open_eth
driver or the RTEMS TCP stack.

I'm ready to send a short sample program illustrating the
problem and the corresponding EchoServer (Tcl ~70 lines).

Thanks and regards,

- Open socket, connect tor server, non-blocking I/O
- Two tasks: Reader and Writer
- Callbacks for SO_RCVWAKEUP, SO_SNDWAKEUP sending
   events to Reader/Writer tasks
- Reader task loop:
	Wait for RCVWAKEUP event
	Do read() all available data until (errno==EAGAIN)
- Writer task loop:
	sleep 10 milliseconds
	write(1000 bytes)
	if (errno==EAGAIN) then wait until SNDWAKEUP event

Echo-server (Linux, written in TCL):
- Echo all incoming data to the client
- (Optionally) send a "HELLO" message every second

Separate subnet (10 Mbps) with only two hosts:
Server = Linux-PC (Suse 8.1)
Client = RTEMS 4.6beta (Leon-Sparc, open_eth driver)
connected with a crossed cable, no hub/switch

Test results:
The test runs 30 seconds and should normally transmit+receive
3000 packets, 1000 bytes each ==> 98 kByte/sec.

Echo server *without* "HELLO" messages:
TestNo.  Rate        Remarks
1	 98 kB/sec   okay, no errors
2        72 kB/sec   1 retransmit timeout
3,4,5	 98 kB/sec   okay, no errors

Echo server *with* "HELLO" messages every second:
TestNo.  Rate        Remarks
1	 98 kB/sec   okay, no errors
2        50 kB/sec   12 retransmit timeouts
3        3.6 kB/sec  17 retransmit timeouts, 26 retransmitted,
                      12 checksum errors
4        30 kB/sec   12 retransmit timeouts, 12 retransmitted
5        1.8 kB/sec  read(): "connection timeout"

Rolf Schrödter
German Aerospace Center

More information about the users mailing list