Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

udp mode doesn't work #371

Closed
pjebs opened this issue Mar 2, 2016 · 5 comments
Closed

udp mode doesn't work #371

pjebs opened this issue Mar 2, 2016 · 5 comments

Comments

@pjebs
Copy link

pjebs commented Mar 2, 2016

I'm running the example client code (found in examples folder).
TCP mode works fine.
When I add set_protocol(test, Pudp); to make it UDP mode I get error:

error - unable to read from stream socket: Connection refused
Is this a bug?

According to this old bug report, the bug was fixed: #26

@pjebs
Copy link
Author

pjebs commented Mar 2, 2016

Does the server have to be in udp mode too?
The documentation suggests client solely determines that configuration.
But some examples on the internet have the server set up with -u flag.

@sambonator
Copy link

Server only has to be running. I have it working with UDP although I question the jitter numbers I get from it. Make sure firewall is not blocking UDP port.

@rlusian1
Copy link

I was running into this problem as well and spent hours checking firewalls and routing and everything was good. I started writing up a problem description when I found out what was going on:

iperf3 was working with IPv4 TCP, IPv4 UDP, IPv6 TCP, but not IPv6 UDP.

I would use this command line on the server: iperf3 -i1 -s -p 8080
and this on the client: iperf3 -c 2620:222:10:200:823f:5dff:fe08:f716 -i 1 -6 -p 8080 -u

The client would hang and the server would print this out:

iperf3 -i1 -s -p 8080


Server listening on 8080


Accepted connection from 2620:222:10:200:5851:f08:8d7c:806e, port 49710
[ 5] local 2620:222:10:200:342e:b936:bd37:a649 port 8080 connected to 2620:222:10:200:5851:f08:8d7c:806e port 43287
iperf3: error - unable to read from stream socket: Connection refused

Here's what's going on: the client is trying to connect to the server with the server's dynamic IPv6 address: 2620:222:10:200:823f:5dff:fe08:f716. When the server is trying to connect to the client, it's using the server's latest temporary dynamic IPv6 address: 2620:222:10:200:342e:b936:bd37:a649. The client then refuses the connection from the server.

This article has a lot of information about temporary dynamic IPv6 addresses:
http://www.ipsidixit.net/2012/08/09/ipv6-temporary-addresses-and-privacy-extensions/

If I change the client to use this same temporary dynamic IPv6 address, iperf3 works fine.

iperf3 -c 2620:222:10:200:342e:b936:bd37:a649 -i 1 -6 -p 8080 -u


Server listening on 8080


^[[AAccepted connection from 2620:222:10:200:5851:f08:8d7c:806e, port 42991
[ 6] local 2620:222:10:200:342e:b936:bd37:a649 port 8080 connected to 2620:222:10:200:5851:f08:8d7c:806e port 43583
... works fine now...

If it is possible, it would be good to have the iperf server try to use the same IPv6 address as the one the client is trying to connect with. Otherwise people will have weird problems and think it doesn't work. If changing the behavior is not possible, could you put it somewhere in the help or the documentation?

I'm good now that I know what's going on, but I'm sure this behavior is going to cause a lot of headaches for other people.

@pjebs
Copy link
Author

pjebs commented Apr 25, 2016

I simply can't work out why UDP mode doesn't work on my public Speed Test server:
#380

screen shot 2016-03-14 at 12 09 02 pm

@rlusian1 can you see anything I am doing wrong?

@sambonator
Copy link

@rlusian1 what makes you think its not working? Looks alright to me...
root@iperf:# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
abe23dc8240c iperf3:3.1.2 "/usr/bin/iperf3 -s" 8 weeks ago Up 2 weeks 0.0.0.0:5202->5201/tcp, 0.0.0.0:5202->5201/udp boring_lalande
d7825c716c6e iperf3:3.1.2 "/usr/bin/iperf3 -s" 8 weeks ago Up 2 weeks 0.0.0.0:5201->5201/tcp, 0.0.0.0:5201->5201/udp naughty_lalande
root@iperf:
# netstat -atun
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN
tcp 0 0 10.100.0.201:22 10.32.1.100:63600 ESTABLISHED
tcp6 0 0 :::5201 :::* LISTEN
tcp6 0 0 :::5202 :::* LISTEN
tcp6 0 0 :::22 :::* LISTEN
udp6 0 0 :::5201 :::*
udp6 0 0 :::5202 :::*
root@iperf:~#

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants