Maximum Ethernet Speed


I searched not only this site but everywhere Google could find to try to figure out what the maximum possible speed UDP data can be sent using the W5100 chipset based sheilds. A lot of the information suggested quite slow data rates so I thought I'd find out by testing.

I used a Freetronics Ethermega board connected to my PC and wrote a simple Delphi based receiver app to count the bytes received per second. This has a 4MHz SPI bus speed to the W5100.

I configured the Ethermega using the standard Ethernet Library and sent a byte array using UDPsend.
My byte array was 960 bytes long as this suited the size of the data I wanted to send (480 words).
I needed to send 960 bytes every 20ms which works out to 48000 bytes per second. This is 16bit ADC values being sent to a Windows PC to filter and analyse.

This worked perfectly so I decided to see where the limit was. I made the buffer slowly bigger and got up to 1200 bytes no problem which resulted in 60000 bytes/sec received. To make sure the data was valaid and in order I sent sequentially increasing values per sample. All data was received in order and with correct values.

I then started reducing the delay between 1200 byte packets. 19ms worked, 18ms worked but 17ms did not. The data rate seemed to max out at about 67000 bytes.

A lot of the discussions I found suggested the data rates would only by 5k bytes/s max and some even suggested only 5k bits/s.

It appears it's very possible to send much faster than this. It means I can use the Freetronic board as a basic data collector.

Another test I did was to have data being sent from the UDPsend at the same time as Windows copying a 50gb file from one PC to another. The copy data rate was 108MB/s across the gigibit network with the Ethermega stuffing it's UDP sends in as well. All data was still received perfectly with no loss or error.

Has anyone else managed to get reasonable data rates through the older Sheilds?

If you are doing a network speed test, that will give you a good transfer rate. But if you are doing any other processing, that rate will slow.

I can get a web server to transfer data fast if from memory, but if I use a SD card, the ethernet controller and the SD card share the SPI bus, cutting the transfer rate at least in half (if not slower) due to the overhead.

All I’m doing is reading 3 16 bit ADC values (from Port A and Port C) using PINA & PINC and writing these to a buffer. An ISR running at 8kHz (125us) reads from the 3 external 16 bit ADC’s, writes the values to 3 arrays of integers and updates the array offset. If the array offset reachs the size of the buffer the buffers are switched and a flag set to let the main loop know to send UDP data. The array is 160 samples long. The ADC is an Analog Devices ADS8328 which has a 16bit parallel bus…

This means I’m sending 2 x 3 x 160 bytes (960 bytes) every 20ms.

This is for a mains power monitor capturing 1 voltage and 2 current channels for 50Hz mains frequency. I’m sending the 16 bit ADC values via UDP to a Windows Server to do the filtering, true RMS and harmonic analysis then storing the results every minute into a database with live data at 1s intervals on the HMI.

So, yes, the microcontroller is fairly busy and 48000 bytes/s is about the maximum I can get and still read from the ADC’s. If I don’t read from the ADC’s then 60000 bytes/s is possible. The ISR overhead is limiting the max data rate.

digitalRead() is too slow and the on-board ADC is too slow and not enough resolution… If digitalRead() is used then 48000 bytes/s is not possible.