ikshwak / iperf

Automatically exported from code.google.com/p/iperf
Other
0 stars 0 forks source link

better error message when a iperf3 client tries to connect to an iperf2 server #74

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Currently if I start an iperf2 server, and try to connect to it with an iperf3 
client, it just hangs.

It should return an error saying "iperf version 3.x clients are not compatible 
with iperf 2.x servers. Please update your server."

Original issue reported on code.google.com by bltier...@es.net on 30 May 2013 at 11:21

GoogleCodeExporter commented 8 years ago
Ok, so when an iperf3 client tries to connect to an iperf2 server, the client 
loops forever in iperf_run_client() waiting for a response.  I need to do a 
little more investigation to figure out if it's possible/reasonable to add a 
check in that loop for iperf2.

Original comment by jef.posk...@gmail.com on 3 Jun 2013 at 12:54

GoogleCodeExporter commented 8 years ago
Hard to do. Will try in future release.

Original comment by bltier...@es.net on 23 Jul 2013 at 5:35

GoogleCodeExporter commented 8 years ago

Original comment by bltier...@es.net on 18 Dec 2013 at 9:17

GoogleCodeExporter commented 8 years ago

Original comment by bltier...@es.net on 18 Dec 2013 at 10:40

GoogleCodeExporter commented 8 years ago
  Iperf3 and iperf 2 works in a diff way and iperf3 control socket does not have TMO it just hangs on select waiting to for some response.

socket(PF_INET, SOCK_STREAM, IPPROTO_IP) = 3 connect(3, {sa_family=AF_INET, sin_port=htons(5001), sin_addr=inet_addr("127.0.0.1")}, 16) = 0 write(3, "XXX.1387736273.832197.4c21154a48"..., 37) = 37 clock_gettime(CLOCK_PROCESS_CPUTIME_ID, {0, 1689286}) = 0 getrusage(RUSAGE_SELF, {ru_utime={0, 0}, ru_stime={0, 1000}, ...}) = 0 select(4, [3], [], NULL, NULL <================ Iperf3 client hangs here ..


   Well to handle this scenario code also changes required  for iperf2 which I dont think really possible or is it ? This is not something we can control .   I do have some approches

1. Control socket Setting non-block
2. Control socket TMO

Original comment by susant%redhat.com@gtempaccount.com on 22 Dec 2013 at 6:27

GoogleCodeExporter commented 8 years ago
Noting that iperf2 and iperf3 have different default ports (5001 vs. 5021), I 
think that this problem won't come up real often.

Original comment by bmah@es.net on 3 Feb 2014 at 10:50

GoogleCodeExporter commented 8 years ago
In that case it should be doable to check if 5001 is open/iperf2 when iperf3 
gets a 'connection refused' on 5021.

I also (naively) assumed that iperf3 would be able to connect to an iperf2 
server, all i got was:

iperf3: error - unable to connect to server: Connection refused

would be helpful if it would mention the incompatibility.

Original comment by goo...@vanbragt.com on 12 Feb 2015 at 5:12