esnet / iperf

iperf3: A TCP, UDP, and SCTP network bandwidth measurement tool
Other
6.95k stars 1.28k forks source link

multiple UDP testing causes connection refused #41

Closed bmah888 closed 10 years ago

bmah888 commented 10 years ago

From eduade.2001 on May 22, 2011 22:43:49

What steps will reproduce the problem? 1.server execute command - iperf3 -u -s -i 1 2.client execute command - iperf3 -c ip_address -u 3.re-running command - iperf3 -c ip_address -u after previous execution on client causes error "Unable to read from stream socket : Connection refused What is the expected output? What do you see instead? should provide output for latency and loss on UDP tests What version of the product are you using? On what operating system? Ubuntu server version 11 64bit Please provide any additional information below.

Attachment: error.png

Original issue: http://code.google.com/p/iperf/issues/detail?id=41

bmah888 commented 10 years ago

From kridgway@harris.com on July 21, 2011 12:07:53

Update the code as shown under issue 36 and recompile. This problem will go away! Keith

bmah888 commented 10 years ago

From busylee on July 22, 2011 02:40:10

Hi, I'm Jackie who joined a few days ago. Once you see a source code, you can understand why it works just one time in case of UDP testing. Speaking of the code level, let's see the ipfer_run() in main.c.

After completion of 'iperf_run_server(test)' data struction of "test" is reset by 'iperf_reset_test(test)'.

127 int 128 iperf_run(struct iperf_test * test) 129 { 130 switch (test->role) { 131 case 's': 132 for (;;) { 133 if (iperf_run_server(test) < 0) { 134 iperf_error("error"); 135 printf("\n"); 136 } 137 iperf_reset_test(test); 138 } (snipped)

BTW, One of iperf_reset_test() routine is always set protocol to the "TCP". Hence you can fix the code as follows,

1141 #if DEBUG /* busylee */ 1142 printf("####[%s:%d]protocol:%s\n", FUNCTION, LINE, test->protocol->name); 1143 #endif 1144 if (test->protocol->id == Ptcp) { 1145 set_protocol(test, Ptcp); 1146 } else if (test->protocol->id == Pudp) { 1147 set_protocol(test, Pudp); 1148 }

Take care...

bmah888 commented 10 years ago

From milutz on February 08, 2012 16:36:40

I can confirm that the fix referenced in issue 36 comment 3 resolve this problem for me beta 4.

bmah888 commented 10 years ago

From bltierney on September 06, 2012 20:58:08

fixed

Status: Verified