2008-09-28 11:24:01 unreliable tcpip socket
Servaes Joordens (NETHERLANDS)
Message: 62871
I have an application with a continous loop of capturing an image with the ppi and sending data over ethernet to a host.
The problem I have is that sending 362347 bytes over ethernet takes an unpredictable amount of time, sometimes 38ms, sometimes 400ms. (sometimes multiple seconds)
This problem is solved when I reduce my send buffer size close to 0 bytes. Sending becomes reliable, but the maximal throughput of data decreases to approx. 5MB/s.
I use the Bluetechnix bf_537e
For testing purposes I disabled the capturing part of the application, but that did not solve anything.
Please help.
QuoteReplyEditDelete
2008-09-28 20:24:07 Re: unreliable tcpip socket
Robin Getz (UNITED STATES)
Message: 62875
Servaes:
If you test netperf on your hardware - do you see the same random patterns?
https://docs.blackfin.uclinux.org/doku.php?id=uclinux-dist:netperf
-Robin
QuoteReplyEditDelete
2008-09-29 03:58:29 Re: unreliable tcpip socket
Jean-Francois Argentino (FRANCE)
Message: 62881
Hello,
I play with MULTICAST on the blackfin for a while, and I know that tcpip on this plateform is a high CPU eater. I have made some tests on rev0.2 and rev0.3 with SVN uclinux, and I never exceed 50 Mbits/s, I think is mainly due to the CPU consumption which is at 75% for this throughput.
TranslateQuoteReplyEditDelete
2008-09-29 07:18:33 Re: unreliable tcpip socket
Robin Getz (UNITED STATES)
Message: 62889
Jean-Francois:
We normally get line rate - but I don't think we have played with multicast much.
Can you replicate 87 x 10^6 bits/sec (line rate) with netperf? (Just to make sure it is not a local issue you have?)
-Robin
QuoteReplyEditDelete
2008-09-29 11:54:01 Re: unreliable tcpip socket
Jean-Francois Argentino (FRANCE)
Message: 62898
Robin:
Here are my results when "netperf" run from the serial console, and "top" from a telnet console:
root:/> netperf -H 192.168.0.5 -l 30
TCP STREAM TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 192.168.0.5 (192.168.0.5) port 0 AF_INET
Recv Send Send
Socket Socket Message Elapsed
Size Size Size Time Throughput
bytes bytes bytes secs. 10^6bits/sec
87380 16384 16384 30.01 83.00
"top" shows a CPU used 100% by "netperf" (40% sys and 60% softIRQ)
root:/> netperf -H 192.168.0.5 -t UDP_STREAM -l 30
UDP UNIDIRECTIONAL SEND TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 192.168.0.5 (192.168.0.5) port 0 AF_INET
Socket Message Elapsed Messages
Size Size Time Okay Errors Throughput
bytes bytes secs # # 10^6bits/sec
104448 65507 30.01 3815 0 66.62
111616 30.01 3814 66.60
"top" shows a CPU used 100% by "netperf" (25% sys and 75% softIRQ)
My config is:
Bluetechnix CM-BF537E (but with a bfin rev0.3 instead of 0.2), uClinux and toolchain from SVN, up to date. MAC driver compiled with BFIN_MAC_USE_L1 option defined.
Server side: netperf 2.4.1 on a FEDORA core 8 up to date (kernel 2.6.26.3-14.fc8, libc 6 glibc-2.7-2), ethernet device Intel Corporation 82562V 10/100 rev02. Two gigabit switches between the server and the blackfin.
I found strange that througput are better in TCP than in UDP, I'll investigate a soon as possible. And maybe I'll understand then why netperf can do better throughput than my test app, I know my test app is surely naive but such a difference!
The last point is that "netperf" show that ETHERNET communication is a heavy CPU consummer, I hope that you have the same kind of results.
Regards
TranslateQuoteReplyEditDelete
2009-02-12 10:10:34 Re: unreliable tcpip socket
Servaes Joordens (NETHERLANDS)
Message: 69349
The problem with unreliable tcpip communication is with communicating to a PC with a 1000Mb ethernet card. There are no problems with a 100Mb ethernet card.
I have tested the same program with several configurations:
- blackfin device + PC with windows on 1000Mb: approx. 2MB/s (very instable throughput)
- blackfin device + PC with linux on 1000Mb: approx. 2MB/s (very instable throughput)
- blackfin device + PC with windows on 100Mb: approx. 6 MB/s (!faster than the 1000Mb ethernet situation!)
- blackfin device + PC with linux on 100Mb: approx. 6MB/s (!faster than the 1000Mb ethernet situation!)
I don't get 10MB/s because of the lay-out of my application. This is not due to the kernel or ethernet connection.
I am busy with a packet sniffer to do some debugging. I hope to tell you more in a few days.
Does anyone recognise this behaviour?
QuoteReplyEditDelete
2009-02-12 10:23:34 Re: unreliable tcpip socket
Servaes Joordens (NETHERLANDS)
Message: 69350
The device typically sends 5 packets of 1518 bytes in a ms. (throughput is appr. 1.5 MB/s)
The device sends two packets, than an acknowledge from the PC.
The device sends two packets, than an acknowledge from the PC.
etc...
Sometimes the time between packets is appr. 30ms.
Sometimes the acknowledge waits 200ms before an answer.
I disabled the Nagle algorithm.
regards,
Servaes