iPerf allows an administrator to setup a receiver agent on a remote computer and a transmitter agent on another to then initiate a data transfer between them.

If you’ve ever experienced network latency or low bandwidth between WAN sites or even on a local network, a great tool to use is iPerf. It is a free tool that’s been around for a long time that allows an administrator to setup a receiver agent on a remote computer and a transmitter agent on another to then initiate a data transfer between them.

The iPerf tool is a wonderful project, but it’s not always the most intuitive to use. For example, here’s an example of a typical iPerf command.

iperf -c -u -p 12345 -t 30 -b 250M

iPerf on Windows uses the old-school, one-letter parameters because it is an EXE. Now we’ve got PowerShell, which gives us a more intuitive way to work with tools like this. The problem is that iPerf is an EXE and not a PowerShell function. We can fix this by creating a few wrapper functions that translate all of the values that iPerf.exe needs in a more intuitive way through PowerShell functions.

MORE: Best Free PowerShell Training Resources

To work with iPerf the PowerShell way, we can download a community module called iPerfAutomate. This module is available on the PowerShell Gallery and can be installed by running Install-Module -Name iPerfAutomate. Once installed, you can see there are only two commands available, but those two commands have a lot of code behind them.

PS C:> Get-Command -Module iPerfAutomate

CommandType     Name                                          Version    Source
     ———–         —-                                              ——-     ——
Function             New-IperfSchedule                          1.0.2      iPerfAutomate
Function             Start-IPerfMonitorTest                     1.0.2      iPerfAutomate

Technically, the only iPerf-specific commands are inside of the Start-IperfMonitorTest. This is the command that performs all of the necessary setup to perform a network test between two places. New-IperfSchedule is a command that allows you to set up scheduled tasks to routinely run Start-IperfMonitorTest. We’re going to stick with Start-iPerfMonitorTest.

Start-iPerfMonitorTest has two parameter sets; Site and Server. At its most basic, you can provide a FromServerName and a ToServerName to the command. Start-iPerfMonitorTest will then copy iPerf to both servers, initiate a transfer, return the results and clean up after itself.

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
[ 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
[  4]   0.00-10.00  sec  2.32 GBytes  1.99 Gbits/sec

r iperf Done.

You can see that instead of having to manually ensure the iPerf EXE is on the local and remote computer and fiddling with parameters, you can simply run a PowerShell function to initiate a quick test. Start-IPerfMonitorTest also has support for setting up tests from entire sites rather than individual servers as well. Perhaps you can’t remember the server in SITE A or SITE B. Instead of setting up tests by server name, you can “map” a server name to a site and just setup tests by sites as well.

Start-iPerfMonitorTest -FromSite Main -ToSite Vegas

The iPerfAutomate module greatly simplifies an already great tool and allows the lay person to quickly and easily setup one or multiple network tests quickly.

Leave a Reply