Chinaunix首页 | 论坛 | 博客
  • 博客访问: 15492398
  • 博文数量: 2005
  • 博客积分: 11986
  • 博客等级: 上将
  • 技术积分: 22535
  • 用 户 组: 普通用户
  • 注册时间: 2007-05-17 13:56
文章分类

全部博文(2005)

文章存档

2014年(2)

2013年(2)

2012年(16)

2011年(66)

2010年(368)

2009年(743)

2008年(491)

2007年(317)

分类: 系统运维

2008-11-25 17:30:55

交叉编译iperf测试arm开发板上wifi模块的网络流量速度

1.在pc机端安装iperf软件
luther@gliethttp:~$ sudo apt-get install iperf
2.交叉编译iperf到arm开发板上
luther@gliethttp:~$ wget
luther@gliethttp:~$ tar zxvf iperf-2.0.4.tar.gz
luther@gliethttp:~/iperf-2.0.4$ ./configure --help
luther@gliethttp:~/iperf-2.0.4$ ./configure --host=arm-linux
luther@gliethttp:~/iperf-2.0.4$ vim config.h
修改如下内容:可以通过./configure查看正常编译的配置信息,将差异修改到arm交叉编译生成的config.h中
...
#define HAVE_MALLOC 0           改为    #define HAVE_MALLOC 1
/* #undef HAVE_QUAD_SUPPORT */  改为    #define HAVE_QUAD_SUPPORT 1
#define malloc rpl_malloc       改为    /* #undef malloc */
luther@gliethttp:~/iperf-2.0.4$ make -j4 //我的pc为双核
luther@gliethttp:~/iperf-2.0.4$ ll src/iperf
-rwxr-xr-x 1 luther luther 75K 2008-11-25 16:07 src/iperf
这样我们运行到arm上的iperf程序就编译成功了,将它拷贝到arm板子上.
1.在pc上以服务器模式启动iperf
luther@gliethttp:~$ iperf -s
2.将交叉编译的iperf拷贝到arm开发板上
/ # tftp -r iperf -g 192.168.100
/ # chmod 755 iperf
/ # ./iperf -c 192.168.2.65 -i 5 -t 60
//192.168.2.65是我的pc端ip地址
//-i 5表示arm板子上启动的client每5s打印一下速度信息;
//-t 60表示测试60s;
//默认使用tcp传输
/ # ./iperf -c 192.168.2.65 -i 5 -t 60
------------------------------------------------------------
Client connecting to 192.168.2.65, TCP port 5001
TCP window size: 16.0 KByte (default)
------------------------------------------------------------
[  3] local 192.168.2.101 port 35071 connected with 192.168.2.65 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0- 5.0 sec  5.14 MBytes  8.62 Mbits/sec
[ ID] Interval       Transfer     Bandwidth
[  3]  5.0-10.0 sec  3.45 MBytes  5.78 Mbits/sec
[ ID] Interval       Transfer     Bandwidth
[  3] 10.0-15.0 sec  2.61 MBytes  4.38 Mbits/sec
[ ID] Interval       Transfer     Bandwidth
[  3] 15.0-20.0 sec  3.14 MBytes  5.27 Mbits/sec
[ ID] Interval       Transfer     Bandwidth
[  3] 20.0-25.0 sec  3.20 MBytes  5.36 Mbits/sec
[ ID] Interval       Transfer     Bandwidth
[  3] 25.0-30.0 sec  4.56 MBytes  7.65 Mbits/sec
[ ID] Interval       Transfer     Bandwidth
[  3] 30.0-35.0 sec  5.48 MBytes  9.19 Mbits/sec
[ ID] Interval       Transfer     Bandwidth
[  3] 35.0-40.0 sec  4.56 MBytes  7.65 Mbits/sec
[ ID] Interval       Transfer     Bandwidth
[  3] 40.0-45.0 sec  3.05 MBytes  5.12 Mbits/sec
[ ID] Interval       Transfer     Bandwidth
[  3] 45.0-50.0 sec  3.02 MBytes  5.06 Mbits/sec
[ ID] Interval       Transfer     Bandwidth
[  3] 50.0-55.0 sec  3.60 MBytes  6.04 Mbits/sec
[ ID] Interval       Transfer     Bandwidth
[  3] 55.0-60.0 sec  3.29 MBytes  5.52 Mbits/sec
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0-60.1 sec  45.1 MBytes  6.30 Mbits/sec
/ #
在pc端经过60s之后,打印最终log如下:
luther@gliethttp:~$ iperf -s
------------------------------------------------------------
Server listening on TCP port 5001
TCP window size: 85.3 KByte (default)
------------------------------------------------------------
[  4] local 192.168.2.65 port 5001 connected with 192.168.2.101 port 35071
[  4]  0.0-60.1 sec  45.1 MBytes  6.29 Mbits/sec

上面
192.168.2.65为以服务器模式运行的iperf所在pc的ip地址
192.168.2.101为wifi通过dhcpcd eth0动态获取的ip

实例2:
/ # ./iperf -c 192.168.2.65 -i 1 -t 60
------------------------------------------------------------
Client connecting to 192.168.2.65, TCP port 5001
TCP window size: 16.0 KByte (default)
------------------------------------------------------------
[  3] local 192.168.2.101 port 51537 connected with 192.168.2.65 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0- 1.0 sec  1.63 MBytes  13.7 Mbits/sec
[ ID] Interval       Transfer     Bandwidth
[  3]  1.0- 2.0 sec  1.50 MBytes  12.6 Mbits/sec
[ ID] Interval       Transfer     Bandwidth
[  3]  2.0- 3.0 sec  1.61 MBytes  13.5 Mbits/sec
[ ID] Interval       Transfer     Bandwidth
[  3]  3.0- 4.0 sec  2.05 MBytes  17.2 Mbits/sec
[ ID] Interval       Transfer     Bandwidth
[  3]  4.0- 5.0 sec  1.54 MBytes  12.9 Mbits/sec
[ ID] Interval       Transfer     Bandwidth
[  3]  5.0- 6.0 sec  1.99 MBytes  16.7 Mbits/sec
[ ID] Interval       Transfer     Bandwidth
[  3]  6.0- 7.0 sec  1.45 MBytes  12.2 Mbits/sec
[ ID] Interval       Transfer     Bandwidth
[  3]  7.0- 8.0 sec  1.12 MBytes  9.44 Mbits/sec
[ ID] Interval       Transfer     Bandwidth
[  3]  8.0- 9.0 sec  1.18 MBytes  9.90 Mbits/sec
[ ID] Interval       Transfer     Bandwidth
[  3]  9.0-10.0 sec  1.23 MBytes  10.3 Mbits/sec
[ ID] Interval       Transfer     Bandwidth
[  3] 10.0-11.0 sec  1.20 MBytes  10.1 Mbits/sec
[ ID] Interval       Transfer     Bandwidth
[  3] 11.0-12.0 sec  1.20 MBytes  10.1 Mbits/sec
[ ID] Interval       Transfer     Bandwidth
[  3] 12.0-13.0 sec  1.20 MBytes  10.0 Mbits/sec
[ ID] Interval       Transfer     Bandwidth
[  3] 13.0-14.0 sec  1.25 MBytes  10.5 Mbits/sec
[ ID] Interval       Transfer     Bandwidth
[  3] 14.0-15.0 sec  1.12 MBytes  9.44 Mbits/sec
[ ID] Interval       Transfer     Bandwidth
[  3] 15.0-16.0 sec  1.23 MBytes  10.4 Mbits/sec
[ ID] Interval       Transfer     Bandwidth
[  3] 16.0-17.0 sec  1.23 MBytes  10.3 Mbits/sec
[ ID] Interval       Transfer     Bandwidth
[  3] 17.0-18.0 sec  1.22 MBytes  10.2 Mbits/sec
[ ID] Interval       Transfer     Bandwidth
[  3] 18.0-19.0 sec    824 KBytes  6.75 Mbits/sec
[ ID] Interval       Transfer     Bandwidth
[  3] 19.0-20.0 sec  1.00 MBytes  8.39 Mbits/sec
[ ID] Interval       Transfer     Bandwidth
[  3] 20.0-21.0 sec  1.77 MBytes  14.9 Mbits/sec
[ ID] Interval       Transfer     Bandwidth
[  3] 21.0-22.0 sec  1.60 MBytes  13.4 Mbits/sec
[ ID] Interval       Transfer     Bandwidth
[  3] 22.0-23.0 sec  1.45 MBytes  12.1 Mbits/sec
[ ID] Interval       Transfer     Bandwidth
[  3] 23.0-24.0 sec  1.72 MBytes  14.4 Mbits/sec
[ ID] Interval       Transfer     Bandwidth
[  3] 24.0-25.0 sec  1.65 MBytes  13.8 Mbits/sec
[ ID] Interval       Transfer     Bandwidth
[  3] 25.0-26.0 sec  1.40 MBytes  11.7 Mbits/sec
[ ID] Interval       Transfer     Bandwidth
[  3] 26.0-27.0 sec  1.67 MBytes  14.0 Mbits/sec
[ ID] Interval       Transfer     Bandwidth
[  3] 27.0-28.0 sec  1.66 MBytes  13.9 Mbits/sec
[ ID] Interval       Transfer     Bandwidth
[  3] 28.0-29.0 sec  1.59 MBytes  13.3 Mbits/sec
[ ID] Interval       Transfer     Bandwidth
[  3] 29.0-30.0 sec  1.77 MBytes  14.9 Mbits/sec
[ ID] Interval       Transfer     Bandwidth
[  3] 30.0-31.0 sec  1.40 MBytes  11.7 Mbits/sec
[ ID] Interval       Transfer     Bandwidth
[  3] 31.0-32.0 sec  1.73 MBytes  14.5 Mbits/sec
[ ID] Interval       Transfer     Bandwidth
[  3] 32.0-33.0 sec  1.75 MBytes  14.7 Mbits/sec
[ ID] Interval       Transfer     Bandwidth
[  3] 33.0-34.0 sec  1.20 MBytes  10.1 Mbits/sec
[ ID] Interval       Transfer     Bandwidth
[  3] 34.0-35.0 sec  1.77 MBytes  14.9 Mbits/sec
[ ID] Interval       Transfer     Bandwidth
[  3] 35.0-36.0 sec  1.80 MBytes  15.1 Mbits/sec
[ ID] Interval       Transfer     Bandwidth
[  3] 36.0-37.0 sec  1.70 MBytes  14.3 Mbits/sec
[ ID] Interval       Transfer     Bandwidth
[  3] 37.0-38.0 sec  1.40 MBytes  11.7 Mbits/sec
[ ID] Interval       Transfer     Bandwidth
[  3] 38.0-39.0 sec  1.43 MBytes  12.0 Mbits/sec
[ ID] Interval       Transfer     Bandwidth
[  3] 39.0-40.0 sec  1.20 MBytes  10.1 Mbits/sec
[ ID] Interval       Transfer     Bandwidth
[  3] 40.0-41.0 sec  1.73 MBytes  14.5 Mbits/sec
[ ID] Interval       Transfer     Bandwidth
[  3] 41.0-42.0 sec  1.71 MBytes  14.4 Mbits/sec
[ ID] Interval       Transfer     Bandwidth
[  3] 42.0-43.0 sec  1.31 MBytes  11.0 Mbits/sec
[ ID] Interval       Transfer     Bandwidth
[  3] 43.0-44.0 sec  1.15 MBytes  9.63 Mbits/sec
[ ID] Interval       Transfer     Bandwidth
[  3] 44.0-45.0 sec    272 KBytes  2.23 Mbits/sec
[ ID] Interval       Transfer     Bandwidth
[  3] 45.0-46.0 sec  1.15 MBytes  9.63 Mbits/sec
[ ID] Interval       Transfer     Bandwidth
[  3] 46.0-47.0 sec  1.66 MBytes  13.9 Mbits/sec
[ ID] Interval       Transfer     Bandwidth
[  3] 47.0-48.0 sec  1.54 MBytes  12.9 Mbits/sec
[ ID] Interval       Transfer     Bandwidth
[  3] 48.0-49.0 sec  1.36 MBytes  11.4 Mbits/sec
[ ID] Interval       Transfer     Bandwidth
[  3] 49.0-50.0 sec  1.73 MBytes  14.5 Mbits/sec
[ ID] Interval       Transfer     Bandwidth
[  3] 50.0-51.0 sec  1.73 MBytes  14.5 Mbits/sec
[ ID] Interval       Transfer     Bandwidth
[  3] 51.0-52.0 sec  1.70 MBytes  14.2 Mbits/sec
[ ID] Interval       Transfer     Bandwidth
[  3] 52.0-53.0 sec  1.41 MBytes  11.8 Mbits/sec
[ ID] Interval       Transfer     Bandwidth
[  3] 53.0-54.0 sec  1.80 MBytes  15.1 Mbits/sec
[ ID] Interval       Transfer     Bandwidth
[  3] 54.0-55.0 sec  1.47 MBytes  12.3 Mbits/sec
[ ID] Interval       Transfer     Bandwidth
[  3] 55.0-56.0 sec  1.66 MBytes  13.9 Mbits/sec
[ ID] Interval       Transfer     Bandwidth
[  3] 56.0-57.0 sec  1.64 MBytes  13.8 Mbits/sec
[ ID] Interval       Transfer     Bandwidth
[  3] 57.0-58.0 sec  1.77 MBytes  14.9 Mbits/sec
[ ID] Interval       Transfer     Bandwidth
[  3] 58.0-59.0 sec  1.62 MBytes  13.6 Mbits/sec
[ ID] Interval       Transfer     Bandwidth
[  3] 59.0-60.0 sec  1.60 MBytes  13.4 Mbits/sec
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0-60.0 sec  88.5 MBytes  12.4 Mbits/sec
在pc端经过60s之后,打印最终log如下:
luther@gliethttp:~$ iperf -s
------------------------------------------------------------
Server listening on TCP port 5001
TCP window size: 85.3 KByte (default)
------------------------------------------------------------
[  4] local 192.168.2.65 port 5001 connected with 192.168.2.101 port 35071
[  4]  0.0-60.1 sec  45.1 MBytes  6.29 Mbits/sec
[  5] local 192.168.2.65 port 5001 connected with 192.168.2.101 port 51537
[  5]  0.0-60.1 sec  88.5 MBytes  12.4 Mbits/sec

从这里来看指定-i参数似乎影响到实际速度,所以可以将其去掉:
/ # ./iperf -c 192.168.2.65 -t 10
------------------------------------------------------------
Client connecting to 192.168.2.65, TCP port 5001
TCP window size: 16.0 KByte (default)
------------------------------------------------------------
[  3] local 192.168.2.101 port 51692 connected with 192.168.2.65 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0-10.0 sec  16.5 MBytes  13.8 Mbits/sec
/ # ./iperf -c 192.168.2.65 -t 60
------------------------------------------------------------
Client connecting to 192.168.2.65, TCP port 5001
TCP window size: 16.0 KByte (default)
------------------------------------------------------------
[  3] local 192.168.2.101 port 51693 connected with 192.168.2.65 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0-60.0 sec  71.4 MBytes  9.98 Mbits/sec
/ # ./iperf -c 192.168.2.65 -t 60
------------------------------------------------------------
Client connecting to 192.168.2.65, TCP port 5001
TCP window size: 16.0 KByte (default)
------------------------------------------------------------
[  3] local 192.168.2.101 port 40898 connected with 192.168.2.65 port 500
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0-60.0 sec    100 MBytes  14.0 Mbits/sec
在pc端经过60s之后,打印最终log如下:
luther@gliethttp:~$ iperf -s
------------------------------------------------------------
Server listening on TCP port 5001
TCP window size: 85.3 KByte (default)
------------------------------------------------------------
[  4] local 192.168.2.65 port 5001 connected with 192.168.2.101 port 51692
[  4]  0.0-10.1 sec  16.5 MBytes  13.8 Mbits/sec
[  5] local 192.168.2.65 port 5001 connected with 192.168.2.101 port 51693
[  5]  0.0-60.1 sec  71.4 MBytes  9.97 Mbits/sec
[  4] local 192.168.2.65 port 5001 connected with 192.168.2.101 port 51694
[  4]  0.0-10.0 sec  16.2 MBytes  13.6 Mbits/sec
[  5] local 192.168.2.65 port 5001 connected with 192.168.2.101 port 40898
[  5]  0.0-60.1 sec    100 MBytes  14.0 Mbits/sec
[  5] local 192.168.2.65 port 5001 connected with 192.168.2.101 port 34409
[  5]  0.0-60.1 sec    102 MBytes  14.2 Mbits/sec

阅读(7863) | 评论(7) | 转发(0) |
给主人留下些什么吧!~~

chinaunix网友2009-09-16 19:32:25

搂主 我用你说的./configure --host=arm-linux 得到有如下的提示: checking for arm-linux-strip... no checking for strip... strip checking for arm-linux-g++... no checking for arm-linux-c++... no checking for arm-linux-gpp... no 请问是那儿出了问题?

gliethttp2009-08-05 17:47:30

开发板上需要移植libstdc++.so库,如果有别名的库的话,需要ln -s链接一下

chinaunix网友2009-08-05 15:56:18

arm-linux 交叉编译后到板子上用的时候报错./iperf: error while loading shared libraries: libstdc++.so.是什么原因

chinaunix网友2009-05-20 17:32:05

感谢博主,按照你的描述,成功交叉编译iperf

chinaunix网友2009-03-03 18:17:59

直接编译是存在错误,根据错误,修改一下源码就可以了