I have a lot of experience with PCIe, some with USB, and little with Ethernet, so the following has got me confused:
I'm evaluating the performance of a USB-to-Ethernet controller, vs a PCIE-to-Ethernet controller (nic), in terms of latency. The precision is important in this experiment, down to the microsecond (I know that in real life it could have no real impact).
To get a baseline of comparison, I hooked up 2 identical PC motherboards directly with a 1 meter Ethernet cable, to their onboard Ethernet ports. Both PCs are running latest version of Windows 10 (build 1709), with no firewall, no virus protection, and no other network connections or WIFI enabled.
After a few seconds each host got an ip, and I tried from the command line:
ping <host ip> -n 100
The Windows ping.exe only shows "<1ms" latency, so I looked for a more accurate tool. I found hrping online, which has accuracy of microseconds: https://www.cfos.de/en/ping/ping.htm#options
Using hrping, I tried:
hrping <host ip> -n 100
and this time I got an average result of 0.426ms for the 100 packets.
After than I ran some tests - instead of using the on board Ethernet controller, on one of the hosts I used once my nic controller, and the next time I used my USB-to-Ethernet controller. Each time I used the same hrping command to send 100 pings.
After a couple of hours I again hooked up the 2 PCs directly with the 1m Ethernet cable, to their onboard Ethernet ports, and ran hrping again. I expected roughly the same 0.426ms as before, but this time I got 0.845ms. So I ran the tool again, and suddenly all the numbers were higher. I tested my nic and USB-ethernet controller again, and their results were higher too by roughly a 0.5ms, compared to the previous results.
My question is this - why do the ping values vary so much? In the case of the 2 PCs connected directly, what is interfering with the ping results? There are no switches in between them, and the PCs were not doing anything, so why so many different results? Is it just that hrping is not returning reliable numbers?
Is there a more accurate method of measuring the network latency between the 2 PC's, in order to compare it with the latency through my nic and USB Ethernet adapter?