iperf mips移植

步骤:

1. 在https://iperf.fr/ 上下载2.0.5版本,解压
2. mkdir out
3. ./configure --host=mips-linux CC=/usr/local/mipsel-linux/usr/bin/mipsel-linux-gcc CXX=/usr/local/mipsel-linux/usr/bin/mipsel-linux-cpp --prefix=`pwd`/out
会提示configure: error: C++ compiler cannot create executables
解决方法是换了个toolchain, ./configure --host=mips-linux CC=/home/public/mt-toolchain/usr/bin/mipsel-linux-gcc CXX=/home/public/mt-toolchain/usr/bin/mipsel-linux-g++ --prefix=`pwd`/out
4. make;会报rpl_malloc的错,将config.h的最后一行注释掉即可
5. make install


一开始设定的tcp window有问题, 得到的速度也不对

# ./iperf -c 192.168.35.200 -w 1024 -t 10

------------------------------------------------------------

Client connecting to 192.168.35.200, TCP port 5001

TCP window size:  100 bit (WARNING: requested  100 bit)

------------------------------------------------------------

[  5] local 192.168.33.200 port 34025 connected with 192.168.35.200 port 5001

[ ID] Interval       Transfer     Bandwidth

[  5]  0.0-20.0 sec   100 bits   100 s/sec

# ./iperf -c 192.168.35.200 -w 1M -t 10

------------------------------------------------------------

Client connecting to 192.168.35.200, TCP port 5001

TCP window size:  100 bit (WARNING: requested  100 bit)

------------------------------------------------------------

[  5] local 192.168.33.200 port 46527 connected with 192.168.35.200 port 5001

[ ID] Interval       Transfer     Bandwidth

[  5]  0.0-20.0 sec   100 bits   100 s/sec

换个参数, 窗口大小变成4M(哪个参数起作用的? 为什么不是 -w 这个指定的大小?)

# ./iperf -c 192.168.35.200 -P 2 -i 2 -p 5001 -C -f m -n 1000

------------------------------------------------------------

Client connecting to 192.168.35.200, TCP port 5001

TCP window size:    4 MByte (default)

------------------------------------------------------------

[  5] local 192.168.33.200 port 56817 connected with 192.168.35.200 port 5001

[  6] local 192.168.33.200 port 56818 connected with 192.168.35.200 port 5001

[ ID] Interval       Transfer     Bandwidth

[  5]  0.0- 4.0 sec     4 MBytes     4 Mbits/sec

[  6]  0.0- 4.0 sec     4 MBytes     4 Mbits/sec

[SUM] -1.0- 0.0 sec     4 MBytes     4 Mbits/sec


iperf 的用法

# ./iperf -h

Usage: iperf [-s|-c host] [options]

       iperf [-h|--help] [-v|--version]



Client/Server:

  -f, --format    [kmKM]   format to report: Kbits, Mbits, KBytes, MBytes

  -i, --interval  #        seconds between periodic bandwidth reports

  -l, --len       #[KM]    length of buffer to read or write (default 8 KB)

  -m, --print_mss          print TCP maximum segment size (MTU - TCP/IP header)

  -o, --output    <filename> output the report or error message to this specifie                                                                                        d file

  -p, --port      #        server port to listen on/connect to

  -u, --udp                use UDP rather than TCP

  -w, --window    #[KM]    TCP window size (socket buffer size)

  -B, --bind      <host>   bind to <host>, an interface or multicast address

  -C, --compatibility      for use with older versions does not sent extra msgs

  -M, --mss       #        set TCP maximum segment size (MTU - 40 bytes)

  -N, --nodelay            set TCP no delay, disabling Nagle's Algorithm

  -V, --IPv6Version        Set the domain to IPv6



Server specific:

  -s, --server             run in server mode

  -U, --single_udp         run in single threaded UDP mode

  -D, --daemon             run the server as a daemon



Client specific:

  -b, --bandwidth #[KM]    for UDP, bandwidth to send at in bits/sec

                           (default 1 Mbit/sec, implies -u)

  -c, --client    <host>   run in client mode, connecting to <host>

  -d, --dualtest           Do a bidirectional test simultaneously

  -n, --num       #[KM]    number of bytes to transmit (instead of -t)

  -r, --tradeoff           Do a bidirectional test individually

  -t, --time      #        time in seconds to transmit for (default 10 secs)

  -F, --fileinput <name>   input the data to be transmitted from a file

  -I, --stdin              input the data to be transmitted from stdin

  -L, --listenport #       port to receive bidirectional tests back on

  -P, --parallel  #        number of parallel client threads to run

  -T, --ttl       #        time-to-live, for multicast (default 1)

  -Z, --linux-congestion <algo>  set TCP congestion control algorithm (Linux only)



Miscellaneous:

  -x, --reportexclude [CDMSV]   exclude C(connection) D(data) M(multicast) S(settings) V(server) reports

  -y, --reportstyle C      report as a Comma-Separated Values

  -h, --help               print this message and quit

  -v, --version            print version information and quit



[KM] Indicates options that support a K or M suffix for kilo- or mega-



The TCP window size option can be set by the environment variable

TCP_WINDOW_SIZE. Most other options can be set by an environment variable

IPERF_<long option name>, such as IPERF_BANDWIDTH.



Report bugs to <[email protected]>


详细log:

[xioliu@cn0512lnx02 iperf-2.0.5]$ ./configure --host=mips-linux CC=/usr/local/mipsel-linux/usr/bin/mipsel-linux-gcc CXX=/usr/local/mipsel-linux/usr/bin/mipsel-linux-cpp --prefix=`pwd`/out
configure: WARNING: If you wanted to set the --build type, don't use --host.
    If a cross compiler is detected then cross compile mode will be used.
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for mips-linux-strip... no
checking for strip... strip
checking whether the C++ compiler works... no
configure: error: in `/home/xioliu/gmac/iperf-2.0.5':
configure: error: C++ compiler cannot create executables
See `confi

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值