UDPspeeder
UDPspeeder copied to clipboard
Packet loss with iperf over UDPServer
I created a small setup to test UDPspeeder using iperf3.
As iperf uses TCP, I created a simple SSH tunnel just for TCP (ssh -g -L 5201:localhost:5201 -f -N ubuntu@SERVER
)
Running with the default configuration from the example:
server: ./speederv2 -s -l0.0.0.0:4096 -r 127.0.0.1:5201 -f20:10
client: ./speederv2 -c -l0.0.0.0:5201 -rSERVER:4096 -20:10
When I run iperf3 over UDPSpeeder: iperf3 -c -u local
, I get ~30% packet loss.
Accepted connection from 127.0.0.1, port 40414
[ 9] local 127.0.0.1 port 5201 connected to 127.0.0.1 port 37280
[ ID] Interval Transfer Bandwidth Jitter Lost/Total Datagrams
[ 9] 0.00-1.00 sec 52.7 KBytes 432 Kbits/sec 0.298 ms 2/15 (13%)
[ 9] 1.00-2.00 sec 56.2 KBytes 461 Kbits/sec 0.282 ms 4/15 (27%)
[ 9] 2.00-3.00 sec 56.2 KBytes 461 Kbits/sec 0.290 ms 6/16 (38%)
[ 9] 3.00-4.00 sec 56.2 KBytes 461 Kbits/sec 0.196 ms 3/16 (19%)
[ 9] 4.00-5.00 sec 56.2 KBytes 461 Kbits/sec 0.204 ms 5/16 (31%)
[ 9] 5.00-6.00 sec 56.2 KBytes 461 Kbits/sec 0.196 ms 4/16 (25%)
[ 9] 6.00-7.00 sec 56.2 KBytes 461 Kbits/sec 0.196 ms 6/16 (38%)
[ 9] 7.00-8.00 sec 56.2 KBytes 461 Kbits/sec 0.177 ms 6/16 (38%)
[ 9] 8.00-9.00 sec 56.2 KBytes 461 Kbits/sec 0.158 ms 6/16 (38%)
[ 9] 9.00-10.00 sec 56.2 KBytes 461 Kbits/sec 0.195 ms 5/16 (31%)
[ 9] 10.00-10.01 sec 0.00 Bytes 0.00 bits/sec 0.195 ms 0/0 (0%)
[ ID] Interval Transfer Bandwidth Jitter Lost/Total Datagrams [ 9] 0.00-10.01 sec 0.00 Bytes 0.00 bits/sec 0.195 ms 47/158 (30%)
There is no packet loss when running iperf directly. Any idea why?
Hi. I was able to reproduce the test.
The problem is that, when iperf3 see you are connecting to 127.0.0.1, it sends super large packets (on my side it's >8000) since the mtu on loopback is large.
Currently the size of udp recv buffer is set to be 3600 (this is practical since most time sending a packet larger than 1500 is a bad idea ), when you send super large packets to UDPspeeder, it got truncated.
Then it's a protential bug in iperf3, it can't detect truncated packets, whenever it sees truncated packet, it report the truncated part as packet loss(for me this is unreasonable).
to fix you test, use this instead:
iperf3 -c 127.0.0.1 -u -l3000
or
iperf3 -c 127.0.0.1 -u -l1400
any value less then 3600 works (with a zero packet loss).
It's my bad that UDPspeeder didn't warn you about packet being truncated. Thx for reporting this. I will add a warning later.
A new version is released, in this version UDPspeeder will remind you if a packet is being truncated. Hopefully this version fixed the problem/confusion.
https://github.com/wangyu-/UDPspeeder/releases/tag/20210116.0