咸鱼

咸鱼是以盐腌渍后,晒干的鱼

0%

网络性能测试工具Iperf

【Iperf各个平台的下载地址】

帮助

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
❯ ./iperf3.exe -h
Usage: iperf [-s|-c host] [options]
iperf [-h|--help] [-v|--version]

Server or Client:
-p, --port # server port to listen on/connect to
-f, --format [kmgKMG] format to report: Kbits, Mbits, KBytes, MBytes
-i, --interval # seconds between periodic bandwidth reports
-F, --file name xmit/recv the specified file
-B, --bind <host> bind to a specific interface
-V, --verbose more detailed output
-J, --json output in JSON format
--logfile f send output to a log file
-d, --debug emit debugging output
-v, --version show version information and quit
-h, --help show this message and quit
Server specific:
-s, --server run in server mode
-D, --daemon run the server as a daemon
-I, --pidfile file write PID file
-1, --one-off handle one client connection then exit
Client specific:
-c, --client <host> run in client mode, connecting to <host>
-u, --udp use UDP rather than TCP
-b, --bandwidth #[KMG][/#] target bandwidth in bits/sec (0 for unlimited)
(default 1 Mbit/sec for UDP, unlimited for TCP)
(optional slash and packet count for burst mode)
-t, --time # time in seconds to transmit for (default 10 secs)
-n, --bytes #[KMG] number of bytes to transmit (instead of -t)
-k, --blockcount #[KMG] number of blocks (packets) to transmit (instead of -t or -n)
-l, --len #[KMG] length of buffer to read or write
(default 128 KB for TCP, 8 KB for UDP)
--cport <port> bind to a specific client port (TCP and UDP, default: ephemeral port)
-P, --parallel # number of parallel client streams to run
-R, --reverse run in reverse mode (server sends, client receives)

-w, --window #[KMG] set window size / socket buffer size
-M, --set-mss # set TCP/SCTP maximum segment size (MTU - 40 bytes)
-N, --no-delay set TCP/SCTP no delay, disabling Nagle's Algorithm
-4, --version4 only use IPv4
-6, --version6 only use IPv6
-S, --tos N set the IP 'type of service'
-Z, --zerocopy use a 'zero copy' method of sending data
-O, --omit N omit the first n seconds
-T, --title str prefix every output line with this string
--get-server-output get results from server
--udp-counters-64bit use 64-bit counters in UDP test packets

[KMG] indicates options that support a K/M/G suffix for kilo-, mega-, or giga-

iperf3 homepage at: http://software.es.net/iperf/
Report bugs to: https://github.com/esnet/iperf

内网测试

cs模式,需要在局域网部署一个服务

server

1
./iperf3.exe -s

client

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# -c client模式,后面跟server-ip 
# -b 带宽
# -i 时间间隔(单位秒)
# -t 持续时间(单位秒)
# -R(反向传输)
# -u(采用udp模式)

./iperf3.exe -u -c 192.168.0.199 -i 1 -t 60 -b 100M

Connecting to host 192.168.0.199, port 5201
[ 4] local 192.168.0.7 port 61150 connected to 192.168.0.199 port 5201
[ ID] Interval Transfer Bandwidth Total Datagrams
[ 4] 0.00-1.01 sec 4.52 MBytes 37.7 Mbits/sec 578
[ 4] 1.01-2.00 sec 3.32 MBytes 28.0 Mbits/sec 425
[ 4] 2.00-3.00 sec 4.40 MBytes 36.9 Mbits/sec 563
[ 4] 3.00-4.00 sec 5.20 MBytes 43.6 Mbits/sec 666
[ 4] 4.00-5.00 sec 4.66 MBytes 39.1 Mbits/sec 596
[ 4] 5.00-6.00 sec 4.30 MBytes 36.1 Mbits/sec 551
[ 4] 6.00-7.01 sec 4.36 MBytes 36.2 Mbits/sec 558
[ 4] 7.01-8.00 sec 4.30 MBytes 36.5 Mbits/sec 551
[ 4] 8.00-9.00 sec 3.64 MBytes 30.5 Mbits/sec 466
[ 4] 9.00-10.00 sec 5.10 MBytes 42.8 Mbits/sec 653
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bandwidth Jitter Lost/Total Datagrams
[ 4] 0.00-10.00 sec 43.8 MBytes 36.7 Mbits/sec 146.752 ms 1331/1562 (85%)
[ 4] Sent 1562 datagrams

iperf Done.

外网服务器

【iperf-servers】

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
./iperf3.exe -u -c ping.online.net -p 5200 -i 1 -t 5 -b 100M

Connecting to host ping.online.net, port 5200
[ 4] local 192.168.0.7 port 57131 connected to 62.210.18.40 port 5200
[ ID] Interval Transfer Bandwidth Total Datagrams
[ 4] 0.00-1.00 sec 6.52 MBytes 54.5 Mbits/sec 834
[ 4] 1.00-2.01 sec 6.71 MBytes 55.7 Mbits/sec 859
[ 4] 2.01-3.01 sec 4.41 MBytes 37.0 Mbits/sec 565
[ 4] 3.01-4.00 sec 6.53 MBytes 55.4 Mbits/sec 836
[ 4] 4.00-5.00 sec 7.14 MBytes 59.9 Mbits/sec 914
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bandwidth Jitter Lost/Total Datagrams
[ 4] 0.00-5.00 sec 31.3 MBytes 52.5 Mbits/sec 0.000 ms 0/0 (0%)
[ 4] Sent 0 datagrams

iperf Done.