Go Down

Topic: Faster Ethernet Anyone? (Read 10485 times) previous topic - next topic

pv_bgm

With more experimentation, I could get *53 KBytes/sec* on ethernet using  ENC28J60 card.  It all has to do with experimenting with already provided configurations for IP.  (This is for UIP Ethernet stack.)

There are three configurations: UIP_CONF_BUFFER_SIZE, UIP_CONF_TCP_MSS, UIP_CONF_RECEIVE_WINDOW. All these are set in ./utility/uip-conf.h. In distribution, some of these values are already set, and I got only 7-8KBytes/sec.  When I simply commented all these values, the defaults are set in ./utility/uip-opt.h. Only UIP_BUFSIZE is set to 400, and others are set from this value. With this really default configuration, I could get more than 50KBytes/sec.

And seeing the tcpdump, this time, it was perfect - with no duplications, or any opportunity to tune further. Neverthles, UDP performance was almost 80-90KBytes/sec, so perhaps we should try further.

Attaching the file with which I measured the bandwidth.




pv_bgm

I am now happy to report that my receive performance problem with W5100 is also solved.  Now I am able to get 60KBytes/sec TCP performance.

This is what I discovered: Earlier, I was uploading a file to web server (using Curl) running on arduino. Here there were no packets sent back during the transfer.

But when I tried the interactive TCP code (attached to the previous post), I could see 60KBytes/sec. So the delay of 200ms was being caused by W5100 waiting for something to be sent back to client. When you explicitly send short lines, I think W5100 doesn't do extra wait, and so, no more delay.

Perhaps there are some timers or something in Ethernet client codebase; I will checkout.




pjrc

In case anyone's following this old thread, I've released Ethernet 2.0.0 today.  It features greatly improved performance, especially on the older W5100 chip.

Here's an article I wrote about the changes, which includes benchmark testing on 15 different boards and a variety of shields with all 3 Wiznet chips.

https://www.pjrc.com/arduino-ethernet-library-2-0-0/


westfw

Cool.   Those benchmarks really show the difference between the W5100 chips and the "next generation" chips!

Are you running on 10Mbps ethernet or 100Mbps?  (Now that the numbers are getting big enough where it might make a difference.)

nitrof

Really great work Paul.

Just tested it on my project:
 
  • Arduino DUE
  • W5500
  • webserver HTTP
  • webserver UDP
  • webserver webSocket


First http seem really more fast. A simple get request was on the ethernet2 library about 370ms for 1.2K of data.
Now I get a score of 195ms !

I use UDP server to call NTP getTime routine. It was unstable before, it had get no response 20% of the time. By now, it seem more stable. Look like to be related...

I have a websocket library modify from Links2004 /arduinoWebSockets.
Works well also. Great that I could remove some #ifdef to select the chip. Maybe more could be remove if the Ethernet library support ESP8266... but there I'm not equip neither qualified to help...
Also Ethernet2 did not have client.remoteIP(), great to have it now.  

Again congratulation for the good work. perhaps a new tread could be good to follow your further development.


Regards.

Nitrof

pert

Maybe more could be remove if the Ethernet library support ESP8266...
The barrier to ESP8266 support is in the ESP8266 core for Arduino, not the Ethernet library:
https://github.com/esp8266/Arduino/issues/2677
and it looks like that's been fixed:
https://github.com/esp8266/Arduino/pull/4925/files
but there has not been a release of the core since then.

Go Up