Wireshark-users: Re: [Wireshark-users] windows 10 / udp packet loss, off-topic ?
From: Frédéric LOCHON <f.lochon@xxxxxxxx>
Date: Thu, 16 Mar 2017 14:54:52 +0100
Le 18/07/2016 à 15:50, Frédéric LOCHON a écrit :
Hello,

I'm facing a strange behavior on Windows 10 computers.
That's a little bit off-topic, but I give it a try.

Since I upgraded to Windows 10, I get some packet loss from Windows:
- I get an UDP packet every 10 ms or so coming from some equipment I have on my network.
- I do see every packet in Wireshark (which means the link is OK).
- I don't see every packet in "Windows" (using winsock API), I loose about 1 to 5 packets every second (not very regularly).

Hello,

I think I found the problem.

In fact, I found a solution some time ago and was lacking of time to share it.


In my application, I get a UDP packet roughly every 16 ms (very regularly) and I was doing something like this:

setsockopt(socketHandle, SOL_SOCKET, SO_RCVTIMEO, (char*)&timeout, sizeof(int)); if(recvfrom(socketHandle, data, maxSize, 0, (LPSOCKADDR)&sin, &fromSize) < 0)
...

With a timeout value of 10 ms, I loose some packets (Wireshark sees them, not my application).
With a timeout value of 100 ms, I don't loose any packets.

I don't quite understand the relationship. But it has proven to be the solution. To me, that sounds like a bug in Windows, unless anybody has some other explanation.

Anyway, maybe that will be useful to someone one day...

Best regards,

Frédéric Lochon.