Max transfer speed possible for the Ethernet 2 Shield, with UDP connections?

Hi, I was wondering if there’s anyway to speed up UDP transfer for sending with the Ethernet 2 Shield using an Arduino Uno. I’m using the Ethernet 2 library.

So far what I’ve tried is commenting out this from "utility/socket.cpp since I know the UDP packet size I have to send:

uint16_t bufferData(SOCKET s, uint16_t offset, const uint8_t* buf, uint16_t len)
{
  uint16_t ret =0;
  /*
  if (len > w5500.getTXFreeSize(s))
  {
    ret = w5500.getTXFreeSize(s); // check size not to exceed MAX size.
  }
  else
  {
    ret = len;
  }
  */
 ret = len;
  w5500.send_data_processing_offset(s, offset, buf, ret);
  return ret;
}

Which then increased my sending rate from 2.84Mbits/sec to 2.93Mbits/sec.

What I did to track this was test with iPerf 2.0.5 over a 10 second interval, sending 1024byte packets.

As far as I know, the Ethernet 2 shield has a 100mbps speed, so I expected something closer to that.

Any ideas/help would be appreciated. Thanks!

Any ideas/help would be appreciated.

The abbreviations M and m cause the values to be many orders of magnitude different. Proper use of M or m is extremely important.

UDP is used when you don't really care that the data got to the intended recipients - like posting a notice on a bulletin board. Speed is rarely an issue with UDP.

If speed IS an issue, then UDP is likely to NOT be the correct protocol to use.

Finally, there is a big difference in bits/second and bytes/second. The mbps value that you (incorrectly) quote is not clear whether that is bits per second or bytes per second.

valcroft:
As far as I know, the Ethernet 2 shield has a 100mbps speed, so I expected something closer to that.

The UNO could at very best load the Ethernet card with data at 8Mbit/s, thats the limit of the SPI interface between the UNO and the Ethernet device.

Given some software overhead on the UNO side, 3Mbit/s seems about right.

Hi thanks for the replies!

PaulS:
The abbreviations M and m cause the values to be many orders of magnitude different. Proper use of M or m is extremely important.

UDP is used when you don’t really care that the data got to the intended recipients - like posting a notice on a bulletin board. Speed is rarely an issue with UDP.

If speed IS an issue, then UDP is likely to NOT be the correct protocol to use.

Finally, there is a big difference in bits/second and bytes/second. The mbps value that you (incorrectly) quote is not clear whether that is bits per second or bytes per second.

Sorry about the 100Mbps mistake. It should be 100 megabits per second sorry, and hence 100Mbps. For my use case I really intended for UDP since I was looking at the bandwidth an Arduino is capable of. Turns out that 8Mhz SPi transfer speed is the limit.

But sorry I think what you’re trying to correct me on is wrong, the small “m” matters if for “milli”. It’s the “B” that matters for “B” Bytes or “b” bytes.

srnet:
The UNO could at very best load the Ethernet card with data at 8Mbit/s, thats the limit of the SPI interface between the UNO and the Ethernet device.

Given some software overhead on the UNO side, 3Mbit/s seems about right.

Thanks for confirming! It does make sense that the SPI transfer is the limit for that case. I’ll do a computation for it to prove it to my peers. It’s just that someone at our lab did a similar project, and had really high performance which was dubious.

For others looking at this post, someone also did this comparison, altho for W5200 but is comparable: DUEZoo/wizperf.txt at master · manitou48/DUEZoo · GitHub

*not sure it tagging is done right with this post. Is my first time I think posting here and I’m replying with my phone