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.

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.

How to measure network performance using iPerf and PowerShell Picture 1How to measure network performance using iPerf and PowerShell Picture 1

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:

  1. 7 free network tools for Admin
  2. Increase network performance by installing Tomato on the Router
  3. Check network performance with PRTG for free version
4 ★ | 229 Vote