WIZnet Developer Forum

UDP send random timeouts

Hello,

I have a wiz820io which I`m using with conjunction with an Arduino mega 2560 and the Arduino Ethernet Library.

The program on the board consistently keeps sending requests to a PC. The current behavior is such that if the PC is disconnected in the beginning when the board is turned on, the endPacket() function of the Ethernet library retries the transmission for 8 times by default and throws a timeout after 1600ms(Because of not getting the ARP response/dest MAC address) which stops the program . If the PC is present then the MAC address is saved in SN_DHAR register and the programs keeps running flawlessly(theoretically) even if the PC is disconnected from the network .

However , there are random occurances where the timeout occurs and the program stops, maybe once a day if I keep it running continously. Please correct me if Im wrong but since the destination MAC address is already saved in the Sn_DHAR register, there should be no random re-try of ARP requests that can cause endPacket to timeout right?If Im not wrong, UDP send only retries the ARP if the IP or the port of the destination has changed from the previous time right?

Even if it tries ARP again, since the PC is still connected to the network it should be able to get the MAC address again and not fail with the UDP send. I can`t seem to figure out a reason for random timeouts like this. Anything on the Network side that can make this happen to the module?

Please can someone explain a possible reasoning for this?

The board has once obtained the MAC address through ARP, and if the destination IP has never been changed and the board has not been rebooted, then the board does not send ARP.

Yes.

To summarize your situation, you are sending a UDP send. Occasionally, the PC is disconnected, but since WIZ850io first obtained the MAC address through ARP, it is correct to send a UDP, but sometimes it sends out arp and timeout occurs. Even if the PC is connected.
is it right?
This is not a normal situation. I think there will be an issue of whether the board is rebooted and the board is not connected.

Copyright © 2017 WIZnet Co., Ltd. All Rights Reserved.