---
title: "UDP Loopback Timing"
url: "https://maker.wiznet.io/forum/13075"
markdown_url: "https://maker.wiznet.io/forum/13075/md"
type: "Forum topic"
category: "Ethernet Chips"
author: "Conan"
created: "2018-10-08T09:08:32+09:00"
last_activity: "2018-11-16T00:19:24+09:00"
language: "en"
views: 1198
replies: 4
source: "WIZnet Makers forum (https://maker.wiznet.io/forum/)"
---

# UDP Loopback Timing

## Question

Asked by Conan on 2018-10-08 in Ethernet Chips.

I initialized Wiznet w5100 and then I created UDP socket of 2kb buffer size. I connected Linux System with W5100. The loop back time I saw in Linux system is 3.5 milli seconds, which is more than the excepted time.
The MCU that connected with wiznet is operating at 48 MHz with 12 MHz SPI Speed. The following is the time excepted to loop back data of size 1 byte:

Total read using interrupt: 57 micro seconds
Total write : 42 micro seconds

Total time : 99 micro seconds

I have also integrated the Wiznet API driver, but the loop back time is still around 3.7 milli seconds. Please help me resolve this ASAP.

Thanks in advance,
Conan.

## Replies

### Reply 1 by Eugeny, 2018-10-08

Resolve what? You want some application of your linux host to show 99 microseconds?
Your post misses a lot of information, and it is not clear how did you get 99 us.

And your post sounds like statement of work rather than problem desciprion (“I want byte to return in 99 us”), and performance tuning requires deep knowledge about networking and platforms/software you use.

### Reply 2 by Conan, 2018-10-08

Hi Eugeny,
Thanks for the quick response!

The Linux system is having a UDP Client code. I calculated the time before sending and after receiving the data. For Linux to Linux it shows a total time of 0.5 milliseconds, but using the Wiznet W5100 IC, it takes around 3 milliseconds (instead of the expected 99microseconds). This 99 microseconds is the total expected time for writing and reading SPI registers based on calculations. The Wiznet IC is connected directly to the system (No Ethernet Hub is used).

I want to know the response time of the Wiznet w5100 after receiving data from client using RECV interrupt and send response time after send command (The communication response time of the IC), as I cant find any availiable information regarding this; and also how I can optimize it, if optimization is possible.

### Reply 3 by Eugeny, 2018-10-08 (in reply to reply 2)

![](https://avatars.discourse-cdn.com/v4/letter/c/13edae/48.png) Conan:

> I cant find any availiable information regarding this

I bet you will not; this info seems to be proprietary and can be ontained only through experience and from this [page](https://www.wiznet.io/product/tcpip-chip/) listing max speeds.

![](https://avatars.discourse-cdn.com/v4/letter/c/13edae/48.png) Conan:

> and also how I can optimize it, if optimization is possible.

Possible, but for this full unsderstanding of what’s going is needed. And also because of precise understanding how chip works internally there could be cases when optimizations applied will not be effective (e.g. errors and jams on highly loaded networks).

W5x00 works as intermediary and queue for network access, thus total throughput and speed will depend on how quick (and properly) chip is being driven, and what is going on the network. Look into all parts is necessary to find the bottlenecks out.

While MCU may be clocked quickly, it is algorithm which matters - see the datasheet, it has good explanation on how to handle the UDP operation. Also look at the Wireshark output (installed on Linux) to find out patterns and possible issues in timing. Finally perform send-only from W5100 in loop and measure time between arriving UDP packets.

### Reply 4 by Conan, 2018-10-08

[@wizteam](https://maker.wiznet.io/groups/wizteam) Can you provide any information/suggestions on the matter as well?

---

Source: https://maker.wiznet.io/forum/13075
