How to measure network performance using iPerf and PowerShell
iPerf allows administrators to set up a receiving program on a remote computer and a broadcast program on another computer to start transferring data between them.
If you've ever had problems with network latency or low bandwidth in wide area networks WAN or even on a local area network, a great tool can be used here is iPerf. This is a free tool that allows administrators to set up a receiving program on a remote computer and a broadcast program on another computer to transfer data between them. iPerf is a great tool, but a bit difficult to use. This is an example of a typical iPerf command.
iperf -c 10.12.240.32 -u -p 12345 -t 30 -b 250M
On Windows, iPerf uses the old parameters, one word because it is EXE. But now we have PowerShell to work with tools like this, but the problem here is that iPerf is an EXE and not a PowerShell function. We can fix this problem by creating a few wrapper functions that compile all the values that iPerf.exe needs through the PowerShell function.
To work with iPerf in the way PowerShell, download a community module called iPerfAutomate. This module is available on PowerShell Gallery and can be installed by running Install-iPerfAutomate -Name Module. After installation, you can see only two commands, but these two commands have a lot of code behind.
PS C:> Get-Command -Module iPerfAutomate
Command Type Name Version Source
----------- ---- ------- ------
Function New-IperfSchedule 1.0.2 iPerfAutomate
Function Start-IPerfMonitorTest 1.0.2 iPerfAutomate
Technically, only specific iPerf commands are located in Start-IperfMonitorTest. This is the command to perform all necessary settings to perform network testing between the two places. New-IperfSchedule is a command that allows users to set scheduled tasks to run Start-IperfMonitorTest.
Start-iPerfMonitorTest has two sets of parameters: Site and Server. Basically, in a command, you need to provide FromServerName and ToServerName. Then Start-iPerfMonitorTest will copy iPerf to both servers, start transferring, return results and clean up.
Start-iPerfMonitorTest -FromServerName SQLSRV1 -ToServerName WEBSRV1
Connecting to host SQLSRV1, port 5201
[4] local 2607: fcc8: ace7: 1700: 60d4: c299: d02e: 3c43 port 55739
connected to 2607: fcc8: ace7: 1700: e4e1: c511: e38b: 4f05 port
5201
[ID] Interval Transfer Bandwidth
[4] 0.00-1.00 sec 208 MBytes 1.73 Gbits / sec
[4] 1.00-2.00 sec 223 MBytes 1.87 Gbits / sec
[4] 2.00-3.00 sec 218 MBytes 1.83 Gbits / sec
[4] 3.00-4.00 sec 220 MBytes 1.85 Gbits / sec
[4] 4.00-5.00 sec 245 MBytes 2.05 Gbits / sec
[4] 5.00-6.00 sec 251 MBytes 2.10 Gbits / sec
[4] 6.00-7.00 sec 248 MBytes 2.09 Gbits / sec
[4] 7.00-8.00 sec 266 MBytes 2.23 Gbits / sec
[4] 8.00-9.00 sec 243 MBytes 2.04 Gbits / sec
[4] 9.00-10.00 sec 255 MBytes 2.14 Gbits / sec
- - - - - - - - - - - - - - - - - - - - - - - - -
[ID] Interval Transfer Bandwidth
[4] 0.00-10.00 sec 2.32 GBytes 1.99 Gbits / sec
sender
[4] 0.00-10.00 sec 2.32 GBytes 1.99 Gbits / sec
receive
r iperf Done.
You can see that instead of having to make sure iPerf EXE is on a local and remote computer, you just need to run a PowerShell function to start the quick check. Start-IPerfMonitorTest also supports setting up tests from the entire site instead of a separate server. Maybe you can't remember the server in SITE A or SITE B, instead of setting up the test by server name, you can "map" the server name to a website and just set up the tests according to websites.
Start-iPerfMonitorTest -FromSite Main -ToSite Vegas
The iPerfAutomate module simplifies a lot of great tools and allows users to quickly and easily set up one or more network performance tests.
See more:
- 7 free network tools for Admin
- Increase network performance by installing Tomato on the Router
- Check network performance with PRTG for free version
You should read it
- Check network performance with PRTG for free version
- How to check Internet speed with cmd command
- Checking Internet speed, Wifi FPT, VNPT network, Viettel does not need software
- 'Measure' server - Costly but worthwhile
- Measuring the speed of Viettel, VNPT and FPT using Speed Of Me
- How to measure network speed
- Check SD and USB memory card performance
- How to measure network speed on laptop, if the speed is slow, what to do?
May be interested
- Set up your own VPN server at home with 4 simple waysvirtual private networks (vpns) are very useful when traveling or using public wi-fi networks in cafes. but you don't have to pay for a vpn service, instead you can host your own vpn server at home.
- Learn about the mechanism of NAT (Network Address Translation) (Part 1)nat allows one (or more) local ip addresses to be mapped to one (or more) external ip addresses. to understand more about nat as well as nat's operation mechanism, refer to the article below.
- Learn about NAT configuration (part 2)nat can be configured in different ways. for example, compiling a private ip address (usually a private ip: inside local address) into a public ip address (ip public).
- How does Dynamic NAT (dynamic NAT) and Overloading NAT work? (Part 3)in dynamic nat, a private ip address will be mapped with a public ip address in the public ip address group. to learn more about the dynamic mechanism of dynamic nat, please refer to the article below.
- Learn about Stub Domainhow computers on the stub domain can be connected to external networks. the following article the network administrator will introduce you to the mechanism of operation on stub domain.
- Learn about NAT (Last part)the biggest benefit of nat is that network administration (network administation) is clear. for example, you can move your web server or ftp server to another host computer without worrying about broken links.