How to use iperf over mininet ? -- gnuplot


http://csie.nqu.edu.tw/smallko/sdn/iperf_mininet.htm


[Description]

   In this lab, I will show howto use iperf to do basic performance evaluation over mininet. Also, I will usesimple shell script to get the evaluation results and then use gnuplot to drawthe graph.

 

[Operations].

1. Create one switch and two hostsenvironment.

 

2. use xterm to open windows for h1 and h2

 

3. Basic TCP transmission evaluation.

3.1 Start the TCP server (-s) at h2 withport 5566 (-p). Also, monitor the results every one second (-i). Note: thedefault setting is using TCP.

 

3.2 Start the TCP client (-c) at h1. Also,set the transmission duration (-t) to 15 seconds. Note: after -c, you need tospecify the server ip address.

 

3.3. Results.

results at h1. (From 0~15 seconds, theaverage throughput is 14.2 Gbps)

 

results at h2. (The following figure showsthe throughput every second)

 

3.4 If we want to draw the throughputgraph, we need to do the evaluation again. But this time, we need to save theresult into a file. Then do some post-processing. After that, use gnuplot todraw the graph.

3.4.1 start the iperf server again. (use> to redirect the results to "result" file)

 

3.5. do the post-processing to get the datafor plotting. (| grep sec: reserve the line containing "sec"; head-15: from beginning, get the first 15 lines(1~15 seconds); tr - " ":using " " to replace "-";  awk '{print $4, $8}: getthe 4th and 8th columns)

The final results: the first column istime, and the second column is throughput.

 

3.6 use gnuplot to draw the graph. (Installgnuplot if needed)

 

start gnuplot. [plot "new_result"title "tcp flow" with linespoints"] is draw the graph using datain new_result file.

 

 

 

save the graph into result.gif

 

exit the gnuplot program.

 

4. Basic UDP transmission evaluation.

4.1 Start the UDP (-u) server (-s) at h2with port 5566 (-p). Also, monitor the results every one second (-i).

 

4.2 Start the UDP (-u) client (-c) at h1.Also, set the transmission duration (-t) to 15 seconds. Note: after -c, youneed to specify the server ip address. Also, you can use -b to specify thesending rate.

 

4.3 Results.

 

4.4 use similar shell script to get thedata and draw the figure. (Please do it by yourself.)

 

Dr. Chih-Heng Ke

Department of Computer Scienceand Information Engineering, National Quemoy University, Kinmen, Taiwan

Email: smallko@gmail.com


<think>嗯,用户想用iperf3启动服务器并设置自定义端口,但不太清楚具体怎么操作。首先,我需要回忆一下iperf3的基本命令结构。记得启动服务器通常用-s参数,而指定端口的话应该用-p选项,后面跟端口号。不过要注意顺序,可能有些参数需要放在正确的位置。 用户提供的引用里提到,引用[1]里的命令是“iperf3 -s -p 5208”,这说明在服务器模式下,-s参数后面可以接-p和端口号。而引用[2]也提到使用-p选项来指定自定义端口,比如“iperf3 -s -p 5002”。看起来正确的语法应该是先加-s,然后-p加上端口号。 不过有时候可能会有疑问,比如是否必须把-p放在-s后面,或者有没有其他顺序。比如,有些工具的参数顺序可能有影响,但根据示例和常规用法,应该是先指定-s表示服务器模式,再设置端口。需要确认是否有其他可能的写法,或者是否有默认端口的问题。默认端口是5201,如果用户不指定-p的话,就会用这个默认的,但用户显然想自定义。 然后,用户的问题是如何启动服务器并设置端口,所以正确的命令应该是“iperf3 -s -p 端口号”。例如,如果端口是5208,就写成“iperf3 -s -p 5208”。另外,可能需要提醒用户确保该端口在防火墙中是开放的,否则可能无法连接。不过用户的问题主要是命令的用法,所以重点应该放在命令的正确结构上。 总结下来,步骤应该是:1. 使用-s启动服务器;2. 使用-p指定端口。然后给出示例命令,比如“iperf3 -s -p 12345”,并说明替换成所需的端口号。同时,可以引用提供的引用内容来支持答案的正确性,比如引用[1]和引用[2]中的例子。</think>### 如何用 `iperf3` 启动服务器并设置自定义端口? 1. **启动 `iperf3` 服务器** 使用 `-s` 参数表示以服务器模式运行: ```bash iperf3 -s ``` 默认监听 **TCP 端口 5201**[^2]。 2. **指定自定义端口** 通过 `-p` 参数设置自定义端口(需 `-s` 结合使用),例如监听 **端口 5208**: ```bash iperf3 -s -p 5208 ``` 命令格式为:`iperf3 -s -p <自定义端口号>`[^1][^2]。 3. **验证服务状态** 运行后终端会显示: ``` Server listening on 5208 ``` 表示服务器已在指定端口成功启动。
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值