-1

As title, I want to test the throughput of a network containing 2 servers(h1,h3) ,only 1 client(h2) and some switches between the hosts and destination , the topology may look like this , I have implemented the topology using mininet, and controlled the routing rule using pox controller.

enter image description here

Now I want to test the throughput of the network and I hope h3 and h1 sent data to h2 at the same time, how can I do that using iperf ?

I haved tried the code below(python code) , but the data in first 10 seconds when h3->h2 will disappear(if I wrote h3->h2 before h1->h2 , than the data in first 10 seconds of h1->h2 will disappear)

h1.cmd('iperf -s -p 5201 -u -i 1 > results &')
print h2.cmd('iperf -c 10.0.0.1 -p 5201 -u -b 10m -t 20')
h3.cmd('iperf -s -p 5205 -u -i 1 > results2 &')
print h2.cmd('iperf -c 10.0.0.3 -p 5205 -u -b 10m -t 20')
h1.cmd('kill %iperf') 
h3.cmd('kill %iperf')

How can I fixed this problem or someone can tell me how to let h3 and h1 sent data to h2 at the same time using other methods, thanks.

BooAA
  • 173
  • 3
  • 11

2 Answers2

0

This is because you may be using a port that could be busy with other job. 1. Initially when you use that port 5201 for iperf among h1,h2 it is in usage you get the details of the flow 2. But after that when you used port 5205 for iperf among h1,h3 it may not be free. Even I have faced the same problem because I used a single port in 5201 . I sorted it by closing the port after every consequent iperf between client and server.

Your case is similar to that of mine. The reason that you are not getting the traffic statistics among h2,h3 is because the port 5205 could not be free. My suggestion is as you have used the port 5201 use it again by closing the connection and then use it again. So, assign a single port for iperf purpose and use it. Don't forget to close the port after every consequent iperf transmission.
In order to close a port that is active use command as follows:

fuser -k -n tcp 3000

where tcp is type of connection that we use and 5201 is port number

-1

you might want to consider using iperf 2.0.10+ and the flows code base on asyncio which requires python 3.5 or better. If you try it and have questions, let me know. It does assume ssh and passwordless operation to control the hosts running iperf.

rjmcmahon
  • 324
  • 1
  • 3