Set it as the homepageBookmark this site

简体中文 繁體中文 English 日本語 Deutsch 한국 사람 بالعربية TÜRKÇE português คนไทย

 Retrieve your password
 Sign up now
img_loading
Intelligent detection

QQ login

Just one step, get started quickly

Search
Ad delivery contact QQ68610888Ad delivery contact QQ68610888
View: 16235|Reply: 22

How to test the line transmission speed with iperf3?

 fire [Copy link]
Posted on 2019-4-6 02:58 | Show all floors |Reading mode
This post was last edited by flylzy on 2020-1-1 15:24

To test the transmission speed of the network line, everyone's usual practice is basically to use the most earthy way, which is to copy and share files! But those who find it professional are using iperf2 or iperf3 tools. In order to be elegant and fashionable, I also Baidu, now I learn and sell, and share it with you. Please correct the fallacies, and welcome to add the omissions, and think together and make progress together.

Think about the goal: Use iperf3 to test the network speed

Knowledge points
1. In the windows system, iperf3.exe run through the cmd command line, that is, there is no UI;
2. iperf3 can run multiple instances at the same time. i.e. running multiple at the same time;
3. The test principle of iperf3 is realized by transferring data between the server and the client;
- The default test data transmission direction is client->server; To test the reverse bandwidth, you can use the parameter -R to flip the direction;
- Disadvantages: iperf3 no longer supports full-duplex mode testing, iperf2 is said to support full-duplex mode;
- Cons: Doesn't seem to support multiple clients for testing at the same time;
4. The iperf3 software itself is divided into serverless version and client version, but the working mode can be set by specifying parameters.
-s is server, table server mode;    -c is client, table client mode;
5. IP address 127.0.0.1 refers to local/local, that is, the device is self-body.
6. iperf3 supports lan<--> and wan<-->lan path testing

Experimental Methods
* Devices: PC, router, mobile phone
* Connection: PC --- Router --- Mobile Phone (PC and mobile phone, in the same LAN)
PC --- Router 1 --- Router 2 --- Mobile Phone (Upper/Lower-level Network; The WAN port of PC and Route 2 is connected to the LAN port of Route 1)
* Tools: iperf3.exe, magic iperf.apk,  

Attachment download:  Link: https://pan.baidu.com/s/149zMdPt8liDe-EFX7o84qg    Extraction code: XL3C

   

Install the software
Download the attachment, unzip it, and select the corresponding version based on the system.
For Windows system, for ease of use, it is recommended to copy all the program files directly after decompression to the C:\Windows\System32 folder, so that it can be run directly in cmd. If it is placed in another directory, you need to use the cd command to jump to it.
Android mobile version, the accessory program, the minimum system requirements for the installation and running environment is Android5.0

use

Example 1: Test the local loop speed of the computer to understand the CPU processing speed limit.
Run 2 instances on the computer, one as the server and one as the client.
cmd window 1, do the server, enter the command:  iperf3 -s                                            
cmd window 2, do the client, enter the command:  iperf3 -c 127.0.0.1 -t 5         #参数 -t 5 The table test is 5 seconds, and the duration can be customized





Example 2: Test the transmission speed of the computer-router-mobile phone. Assume that the PC intranet IP address is 192.168.2.100 and the mobile phone intranet IP address is 192.168.2.102
Run iperf3 on your computer and let it work in server mode, i.e.:
               iperf3 -s                                 # -s The table runs in server mode

Then run this app on your phone Magic iperf.apk and select iperf3 version. After entering the following command, click on the right side of STOPPED in the upper right corner, which is started
1) By default traffic direction (client-side --->-server)
             -c 192.168.2.100 -t 5                # -c table client mode; IP addressis the address where the server is located;  -t 5 The table test is 5 seconds, and the duration can be customized.
2) Flip the direction of the data flow (server-side --->-client)
             -c 192.168.2.100 -R -t 5            # -R The parameter, i.e., Reverse, flips the direction of the data stream




Note: This is only a one-way transmission test!

After giving these two simple examples, I believe you can roughly understand how it works, this is just for throwing bricks and jade, there are many other control parameters available, please refer to the manual, enter iperf3 -h enter to see.

ponder: The client and the server of iperf3 can communicate in the LAN at the same time, if the server is placed in the WAN port (i.e., the higher-level network), can it communicate? My guess is yes, to be verified.


   Attachment download:  Link: https://pan.baidu.com/s/149zMdPt8liDe-EFX7o84qg    Extraction code: XL3C



---------------------------------------------------
iperf3 syntax description:

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
  -C, --congestion <algo>   set TCP congestion control algorithm (Linux and FreeBSD only)
  -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'
  -L, --flowlabel N         set the IPv6 flow label (only supported on Linux)
  -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



-------------------------------------------------
Chinese instructions (I don't know which version, you can refer to it!) )


Grammar:

Common parameters for server and client:


-f [k|m|K| M|g| G] --format, which indicates that the report is displayed in Kbits, Mbits, KBytes, MBytes, Gbits, and GBytes, respectively.
By default, the unit is Mbits, e.g.: iperf -c 192.168.1.105 -f K
Note: Theoretical K = 1024, while in iperf K = 1000
-i # --interval sets the time interval between each report, which is 1 second by default. eg:iperf -c 222.35.11.23 –I 2
-l, --len # [KM] Sets the length of the read/write buffer. The default value is 8 KB in TCP mode and 1470 bytes in UDP mode.
-m, --print_mss output TCP MSS value (supported by TCP_MAXSEG). The MSS value is generally 40 bytes smaller than the MTU value. Usually
-p, --port # set the port to be the same as the listening port on the server. The default is port 5001, which is the same as for TTCP.
-u, --udp uses UDP instead of TCP. See -b option.
-w, --window # [KM] sets the socket buffer to the specified size. The default is 8 KB. For TCP mode, this setting is the TCP window size. For UDP mode, this setting is set to the buffer size that accepts UDP packets, limiting the maximum number of packets that can be accepted.
-B, --bind host is bound to one of the multiple addresses of the host. For the client, this parameter sets the e-stack interface. For the server, this parameter is set to the inbound interface. This parameter is only used for hosts with multiple network interfaces. In Iperf's UDP mode, this parameter is used to bind and join a multicast group. Multicast addresses in the range 224.0.0.0 to 239.255.255.255 are used. Refer to the -T parameter.
-C, --compatibility
Compatibility mode can be used when used with earlier versions of Iperf. It is not necessary to use compatibility mode on both ends, but it is highly recommended to use compatibility mode on both sides at the same time. In some cases, the use of certain data streams can cause a server-side crash in version 1.7 or cause unintended connection attempts.
-M, --mss #[KM}
Try to set the value of the TCP maximum information segment via the TCP_MAXSEG option. The size of the MSS value is usually TCP/IP header minus 40 bytes. In Ethernet, the MSS value is 1460 bytes (MTU1500 bytes). Many operating systems do not support this option.
-N, --nodelay
Set the TCP No Latency option and disable Nagle's algorithm. Usually this option is disabled for interactive programs, such as telnet.
-V (from v1.6 or higher)
Bind an IPv6 address.
Server: $ iperf -s –V
Client: $iperf -c <Server IPv6 Address> -V
Note: In 1.6.3 or later, specifying an IPv6 address does not require the -B parameter binding, and in versions prior to 1.6. In most operating systems, the IPv4 address mapped by the IPv4 client will be responded.


Server-side dedicated options

-s, --server runs as a server mode
-D (v1.2 or later) Iperf runs as a daemon on Unix platforms. Under the Win32 platform, Iperf will run as a service.
-R (v1.2 or later, Windows only) Uninstall the Iperf service if it is running.
-o (v1.2 or later, Windows only) Redirect output to the specified file

-c client host_ip --client host If you specify a host on the server side with the -c parameter, then Iperf will only accept connections from the specified host. This parameter cannot work in UDP mode.

-P # --The number of connections maintained before the parallel server was closed. The default is 0, which means that connections are always accepted.


Client-specific options

-c server ip --client host runs in client mode and connects to the specified Iperf server.
-b, #[KM] --bandwidth The bandwidth used in UDP mode, in bits/sec. This option is related to the -u option. The default value is 1 Mbit/sec.
-d,  --dualtest
Run a dual test mode. This will cause the server side to connect to the client in reverse, using the port specified in the -L parameter (or by default, using the port where the client connects to the server side). This is done immediately at the same time as the operation.
If you want an interactive test, try the -r parameter.
-n, --num #[KM]
The number of buffers transferred. Typically, Iperf sends data on a 10-second basis. The -n parameter crosses this limit to send a specified length of data as many times as it wants, regardless of how long the operation takes. Refer to the -l and -t options.
-r, --tradeoff
Reciprocating test mode. When the client-to-server test ends, the server backconnects to the client via the port specified in the -l option (or the port where the client connects to the server by default). When the client connection is terminated, the reverse connection begins.
If you need to test both sides at the same time, try the -d parameter.
-t, --time #
Sets the total time for the transfer. Iperf repeatedly sends packets of a specified length within a specified amount of time. The default is 10 seconds. Refer to the -l and -n options.
-L, --listenport #
Specifies the port to be used when the server backconnects to the client. By default, the port that connects the client to the server is used.
-P, --parallel #
Number of threads. Specifies the number of threads to be used between the client and the server. The default is 1 thread. This parameter needs to be used on both the client and server side.
-S, --tos #
The service type of the egress stack packet. Many routers ignore the TOS field. You can specify this value by using a hexadecimal number starting with "0x", or an octal or decimal number starting with "0".
For example, hexadecimal '0x10' = octal '020' = decimal '16'. The TOS value of 1349 is:
IPTOS_LOWDELAY minimize delay 0x10
IPTOS_THROUGHPUT maximize throughput 0x08
IPTOS_RELIABILITY maximize reliability 0x04
IPTOS_LOWCOST minimize cost 0x02
-T, --ttl #
The TTL value of the e-stack multicast packet. This is essentially the number of hops that data passes through the router. The default value is 1, and the link is local.
-F (from v1.2 or higher)
Bandwidth is measured using a specific data stream, such as a specified file.
   $ iperf -c <server address> -F <file-name>
-I (from v1.2 or higher)
As with -F, data is entered from a standard input output file.

other
-h, --help displays the command-line reference and exits .
-v, --version displays version and compilation information and exits.










More resources are included in this post

You need login Can you download or view without an account?Sign up now

×

Score

Number of participants 1Enshan coins +1 Collapse reason
boy516 + 1 Don't be intimidated, just do it

See all ratings

Only talk about technology, don't talk about politics! (Click for details) | Enshan Wireless Forum welcomes your visit, please respect each other, friendly exchanges, it is recommended to keep a normal mind to look at the comments of netizens, do not overreact.
Posted on 2019-4-6 06:38 From the phone | Show all floors
Good writing is at the top
Only talk about technology, don't talk about politics! (Click for details) | Enshan Wireless Forum welcomes your visit, please respect each other, friendly exchanges, it is recommended to keep a normal mind to look at the comments of netizens, do not overreact.
Posted on 2019-4-6 07:54 | Show all floors
But it's okay...
Only talk about technology, don't talk about politics! (Click for details) | Enshan Wireless Forum welcomes your visit, please respect each other, friendly exchanges, it is recommended to keep a normal mind to look at the comments of netizens, do not overreact.
Published on 2019-4-6 09:10 | Show all floors
Okay, go back and give it a try
Only talk about technology, don't talk about politics! (Click for details) | Enshan Wireless Forum welcomes your visit, please respect each other, friendly exchanges, it is recommended to keep a normal mind to look at the comments of netizens, do not overreact.
Posted on 2019-4-6 11:04 | Show all floors
Thanks for sharing!

Only talk about technology, don't talk about politics! (Click for details) | Enshan Wireless Forum welcomes your visit, please respect each other, friendly exchanges, it is recommended to keep a normal mind to look at the comments of netizens, do not overreact.
Posted on 2019-4-6 12:57 | Show all floors
This is a good drop for side wireless, and I also use this EEPROM to improve ~
Only talk about technology, don't talk about politics! (Click for details) | Enshan Wireless Forum welcomes your visit, please respect each other, friendly exchanges, it is recommended to keep a normal mind to look at the comments of netizens, do not overreact.
Posted on 2019-4-9 22:29 | Show all floors
Ask, is there this iperf3 in the old Maozi firmware? In this way, you can use the router as a server and directly measure the speed of a single line

Comments

ssh in and opkg install iperf3  detail Reply Published on 2019-4-10 08:38
Only talk about technology, don't talk about politics! (Click for details) | Enshan Wireless Forum welcomes your visit, please respect each other, friendly exchanges, it is recommended to keep a normal mind to look at the comments of netizens, do not overreact.
Published on 2019-4-10 08:38 | Show all floors
Dalin Posted on 2019-4-9 22:29
Ask, is there this iperf3 in the old Maozi firmware? In this way, you can use the router as a server and directly measure the speed of a single line

ssh in and opkg install iperf3

Comments

I tried, but it doesn't work[attachimg]281713[/attachimg]  detail Reply Posted on 2019-4-12 17:59
Only talk about technology, don't talk about politics! (Click for details) | Enshan Wireless Forum welcomes your visit, please respect each other, friendly exchanges, it is recommended to keep a normal mind to look at the comments of netizens, do not overreact.
Published on 2019-4-10 12:04 | Show all floors
It seems that only the transmission rate of the LAN can be measured

Comments

After experiments, it has been confirmed that iperf3 can realize the test of wanlan path!!  detail Reply Posted on 2019-4-13 03:38
Only talk about technology, don't talk about politics! (Click for details) | Enshan Wireless Forum welcomes your visit, please respect each other, friendly exchanges, it is recommended to keep a normal mind to look at the comments of netizens, do not overreact.
Landlord| Posted on 2019-4-12 17:59 | Show all floors
iwantcomputer 2019-4-10 08:38
ssh in and opkg install iperf3

I tried, but it didn't work

More resources are included in this post

You need login Can you download or view without an account?Sign up now

×

Comments

After the single file is decompressed, it can be executed directly in the NEWIFI router  detail Reply Posted on 2019-12-1 22:36
You're a PDV with a big light, right? I brush the h big Pdv with integrated opkg command, the big light may not have, I'm not very sure  detail Reply Posted on 2019-4-13 20:13
Only talk about technology, don't talk about politics! (Click for details) | Enshan Wireless Forum welcomes your visit, please respect each other, friendly exchanges, it is recommended to keep a normal mind to look at the comments of netizens, do not overreact.
Landlord| Posted on 2019-4-13 03:38 | Show all floors
SZ520sky 2019-4-10 12:04
It seems that only the transmission rate of the LAN can be measured

After experiments, it is confirmed that iperf3 can realize the test of wan<->lan path!!
Only talk about technology, don't talk about politics! (Click for details) | Enshan Wireless Forum welcomes your visit, please respect each other, friendly exchanges, it is recommended to keep a normal mind to look at the comments of netizens, do not overreact.
Posted on 2019-4-13 20:13 | Show all floors
Posted by flylzy on 2019-4-12 17:59
I tried, but it didn't work

You're a PDV with a big light, right?

I brush the h big Pdv with integrated opkg command, the big light may not have, I'm not very sure
Only talk about technology, don't talk about politics! (Click for details) | Enshan Wireless Forum welcomes your visit, please respect each other, friendly exchanges, it is recommended to keep a normal mind to look at the comments of netizens, do not overreact.
Posted on 2019-4-14 10:07 From the phone | Show all floors
What level can the mobile phone wireless generally reach,The connection rate shows 866,I actually measured it here200M-300M mostly,Occasionally up to 400M。

Comments

You're very good.,My new 3 route+Meizu mobile phone,The connection rate shows the highest 72Mbps,Occasionally it's still 54Mbps,The speed of downloading files is also 2~3MB/s。 What kind of mobile phone do you use, what kind of router?  detail Reply Published on 2019-4-14 15:55
Only talk about technology, don't talk about politics! (Click for details) | Enshan Wireless Forum welcomes your visit, please respect each other, friendly exchanges, it is recommended to keep a normal mind to look at the comments of netizens, do not overreact.
Landlord| Published on 2019-4-14 15:55 | Show all floors
xfree007 Posted on 2019-4-14 10:07
What level can the mobile phone wireless generally reach,The connection rate shows 866,I actually measured it here200M-300M mostly,Occasionally up to 400M。

You're very good.,My new 3 route+Meizu mobile phone,The connection rate shows the highest 72Mbps,Occasionally it's still 54Mbps,The speed of downloading files is also 2~3MB/s。
What kind of mobile phone do you use, what kind of router?

Comments

You use 2.4G.,He should be the speed of 5G measurement.。。。 The 2.4G single antenna connection speed is 72m at full speed, and the dual antenna is 144m; The 5G single antenna connection speed is 433m at full speed, and the dual antenna is 866m. . . But there are also 2.4G behind the improved 11n single antenna connection speed of 150m, dual antenna 300m...  detail Reply Posted on 2019-4-15 19:39
Only talk about technology, don't talk about politics! (Click for details) | Enshan Wireless Forum welcomes your visit, please respect each other, friendly exchanges, it is recommended to keep a normal mind to look at the comments of netizens, do not overreact.
Posted on 2019-4-15 19:39 | Show all floors
Posted by flylzy on 2019-4-14 15:55
You're very good.,My new 3 router + Meizu's mobile phone,The connection rate shows the highest 72Mbps,Occasionally, it's still 54Mbps,Download files ...

You use 2.4G.,He should be the speed of 5G measurement.。。。 The 2.4G single antenna connection speed is 72m at full speed, and the dual antenna is 144m; The 5G single antenna connection speed is 433m at full speed, and the dual antenna is 866m. . . But there are also 2.4G behind the improved 11n single antenna connection speed of 150m, dual antenna 300m...
Only talk about technology, don't talk about politics! (Click for details) | Enshan Wireless Forum welcomes your visit, please respect each other, friendly exchanges, it is recommended to keep a normal mind to look at the comments of netizens, do not overreact.
You'll need to be logged in to reply to posts login | Sign up now

This version of the points rules

Shut down

Welcome to the Enshan Wireless Forum

Only talk about technology, don't talk about politics! Don't spread rumors! For you and for others.
Only talk about technology, don't talk about politics! (Click for details) Remember not to spread rumors at will, just live your life in peace, for your own good and for the good of everyone. Enshan Wireless Forum welcomes your visit, please respect each other, friendly exchanges, it is recommended to keep a normal mind to look at the comments of netizens, do not overreact.

View »

If in doubt, add an administrator QQ86788181|Mobile version|Little dark house|Archiver|Enshan Wireless Forum (Changzhou Enshan Computer Development Co., Ltd. All rights reserved) ( Su ICP No. 05084872 )

GMT+8, 2025-5-31 06:31

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

| 江苏省互联网有害信息举报中心 举报信箱:js12377 | @jischina.com.cn 举报电话:025-88802724 本站不良内容举报信箱:68610888@qq.com

快速回复 返回顶部 返回列表