Global Linux Knowledge Base…
iperf : Network Throughput Monitoring Tool
|
Iperf is a commonly used network testing tool that can create TCP and UDP data streams and measure the throughput of a network. Iperf allows the user to set various parameters that can be used for testing a network, or alternately for optimizing or tuning a network. |
|
Features of Iperf: |
|
* TCP |
|
* Measure bandwidth
|
|
* Report MSS/MTU size and observed read sizes. |
|
* Support for TCP window size via socket buffers. |
|
* Multi-threaded if pthreads or Win32 threads are available. Client and server can have multiple simultaneous connections. |
|
* UDP |
|
* Client can create UDP streams of specified bandwidth. |
|
* Measure packet loss |
|
* Measure delay jitter |
|
* Multicast capable
|
|
* Multi-threaded if pthreads are available. Client and server can have multiple simultaneous connections. (This doesn’t work in Windows.)
|
|
* Where appropriate, options can be specified with K (kilo-) and M (mega-) suffices. So 128K instead of 131072 bytes.
|
|
* Can run for specified time, rather than a set amount of data to transfer.
|
|
* Picks the best units for the size of data being reported.
|
|
* Server handles multiple connections, rather than quitting after a single test.
|
|
* Print periodic, intermediate bandwidth, jitter, and loss reports at specified intervals.
|
|
* Run the server as a daemon (Check out Nettest for running it as a secure daemon).
|
|
* Run the server as a Windows NT Service
|
|
* Use representative streams to test out how link layer compression affects your achievable bandwidth.
|
|
Install iperf by, |
|
# yum install iperf -y |
|
Server side : To start iperf as “server” service, use the “-s” flag.
|
|
# iperf -s
|
|
—————————————
|
|
Server listening on TCP port 5001
|
|
TCP window size: 85.3 KByte (default)
|
|
—————————————
|
|
To stop the server, send Ctrl+C. |
|
Client side: For client side, iperf has to be initiated with “-c” option. There are lot of other options, which performs different kind of testing. Few examples are explained below. |
|
Measuring throughput using default iperf option. This connects to the iperf server mentioned and finds out the network throughput. |
|
# iperf -c server1
|
|
—————————————
|
|
Client connecting to server1, TCP port 5001
|
|
TCP window size: 16.0 KByte (default)
|
|
—————————————
|
|
[ 3] local 122.169.104.71 port 41505 connected with 122.169.104.72 port 5001
|
|
[ ID] Interval Transfer Bandwidth
|
|
[ 3] 0.0-12.1 sec 25.4 Mbytes 25.0 Mbits/sec
|
|
Measuring multi-thread throughput. Use -P option to specify the number of parallel threads to be started. |
|
# iperf -c server1 -P 3
|
|
—————————————
|
|
Client connecting to server1, TCP port 5001
|
|
TCP window size: 16.0 KByte (default)
|
|
—————————————
|
|
[ 5] local 122.169.104.71 port 41523 connected with 122.169.104.72 port 5001
|
|
[ 4] local 122.169.104.71 port 41522 connected with 122.169.104.72 port 5001
|
|
[ 3] local 122.169.104.71 port 41521 connected with 122.169.104.72 port 5001
|
|
[ ID] Interval Transfer Bandwidth
|
|
[ 5] 0.0-10.1 sec 25.9 MBytes 23.3 Mbits/sec
|
|
[ 4] 0.0-10.1 sec 25.9 MBytes 23.2 Mbits/sec
|
|
[ 3] 0.0-10.1 sec 25.8 MBytes 23.1 Mbits/sec
|
|
[SUM] 0.0-10.1 sec 83.6 MBytes 69.5 Mbits/sec
|
|
Note: You can even run the client side on regular intervals using cron daemon and plot graphs (using mrtg or rrd) for the throughput. |
| Print article | This entry was posted by Dhaval Soni on December 7, 2010 at 1:31 PM, and is filed under All, CentOS, Fedora, Linux OS, Monitoring, Red Hat. Follow any responses to this post through RSS 2.0. You can leave a response or trackback from your own site. |