High UDP packet loss, compare with nuttcp #1707
-
Context
I'm running UDP tests with iperf3 and nuttcp-6.1.2 on 1Gb net and getting big difference in datagrams loss. With iperf3 27% loss and with nuttcp nearly zero loss. iperf3:
nuttcp:
Dropwatch shows drops in
There are a lot of UDP InErrors and RcvbufErrors in /proc/net/snmp :
So, I think UDP drops here. Overhead comparison, iperf3:
nuttcp:
Since select in iperf3 has a lot of overhead, as an experiment I tried to remove all selects during read in src/net.c and get nearly zero packet loss:
There are no such problems with TCP with both utilities. |
Beta Was this translation helpful? Give feedback.
Replies: 7 comments 6 replies
-
You might want to try increasing the socket buffer size(s), using the iperf3 does a lot of select() calls. One of the reasons for that is to implement bounds on how long tests are supposed to run. We could consider doing that some other way. |
Beta Was this translation helpful? Give feedback.
-
I was not able to recreate the issue is my environment (single computer), but while trying to do that I found a problem in the iperf3 server, that cause it to use almost twice the CPU really needed for a single stream UDP test. I fixed the issue in PR #1708. As the CPU overhead may cause loosing UDP packets, can you try building and testing using the PR code, to see if the reduced CPU overhead helps? |
Beta Was this translation helpful? Give feedback.
-
I tried running iperf3 with two streams, which showed zero drops:
With two streams, iperf3 utilizes two CPUs (I monitored this with
In Reverse mode, iperf3 uses only CPU 3:
As a result, there is a slight difference in bandwidth between these two modes. Additionally, I compared iperf3.16 with iperf3.13, which is default in buildroot 2023.05 that I'm using. The earlier version shows worse bandwidth:
At this moment, I see two options to achieve better performance results in my case:
|
Beta Was this translation helpful? Give feedback.
-
Hi @IlorDash, |
Beta Was this translation helpful? Give feedback.
-
I am reporting that I also hit the same issue. I had a use case where UDP loss was suspected across a private WAN circuit, Unfortunately, this defect confirmed the suspicion and led to further testing/troubleshooting that ended up being incorrect based on the |
Beta Was this translation helpful? Give feedback.
-
@IlorDash, I hope you are still interested in a solution to this issue or at least are willing to test possible solution. I now suspect that the issue is the Will you be able to test using this iperf3 version and see if it improves the UDP message loss? It is available in my iperf3 repository: https://github.com/davidBar-On/iperf, branch "issue-1707-UDP-higher-packet-loss-compared-to-nuttcp". (To get it, use |
Beta Was this translation helpful? Give feedback.
-
Submitted PR #1787 with the suggested change. |
Beta Was this translation helpful? Give feedback.
@IlorDash, I hope you are still interested in a solution to this issue or at least are willing to test possible solution.
I now suspect that the issue is the
select()
(with a timeout) that is done before reading input, to make sure that input is available, so the read will not be stuck forever. Since each stream is handled by a separate thread (since 3.16), I believe that this is done to make sure that the main thread will not get stuck when waiting for control messages, etc. Therefore, I created a version that don't do the select when reading from data streams.Will you be able to test using this iperf3 version and see if it improves the UDP message loss?
It is available in my iperf3 rep…