How fast is that network?

Ever need to know how fast two servers can move data between each other? I recently needed to show a client how much bandwidth was available between two database servers. To do this I used a tool called iperf. iperf is a simple network performance benchmarking tool, and it available for most platforms, including Solaris, AIX and Linux. In Solaris 11 you can install it simply using the command “pkg install iperf”. Optionally, you can download the source code from http://sourceforge.net/projects/iperf/files/?source=navbar and install from source, with a simple ./configure; make install in the extracted directory.

iperf not only measures the throughput, but it also can measure the jitter. Jitter is a measurement of the variation in the delay of received packets. At the sending side, packets are sent in a continuous stream with the packets spaced evenly apart. Jitter measures how far apart these packets are. High amounts of jitter can point to network congestion or routing issues.

Once you have iperf install, you need to start up a server. In my example, I am going to test a Linux server on my home lab against a Solaris server. The Linux server ( connected with 1G Ethernet) is 192.168.56.80 and the Solaris server (Connected with 10GEthernet ) is 192.168.56.200, I also have a second Solaris system, the .201 server. By default iperf uses TCP port 5001, so make sure your firewalls have that port opened on the target. Also, open up UDP, we will need that to test jitter.

On the Linux server, I first need to start iperf. When the server starts, you will see it is running on TCP port 5001

[root@ggdemo1 iperf-2.0.5]# iperf -s -i 2

------------------------------------------------------------

Server listening on TCP port 5001

TCP window size: 85.3 KByte (default)

------------------------------------------------------------

The “-s” sets it up as a servers, and the “-I 2” sets it to report every 2 seconds.

Next, on one of my Solaris 11 servers, I will start a simple throughput test to the Linux system. –n is the packet size, -I is the reporting interval and –c is the target.

------------------------------------------------------------

root@solaris-1:~# iperf -n 1024 -i 2 -c 192.168.56.80

Client connecting to 192.168.56.80, TCP port 5001

TCP window size: 48.0 KByte (default)

------------------------------------------------------------

[ 3] local 192.168.56.200 port 48157 connected with 192.168.56.80 port 5001

[ ID] Interval Transfer Bandwidth

[ 3] 0.0- 2.0 sec 59.6 MBytes 250 Mbits/sec

[ ID] Interval Transfer Bandwidth

[ 3] 2.0- 4.0 sec 59.9 MBytes 251 Mbits/sec

[ ID] Interval Transfer Bandwidth

[ 3] 4.0- 6.0 sec 58.9 MBytes 247 Mbits/sec

[ ID] Interval Transfer Bandwidth

[ 3] 6.0- 8.0 sec 58.9 MBytes 247 Mbits/sec

[ ID] Interval Transfer Bandwidth

[ 3] 8.0-10.0 sec 59.5 MBytes 249 Mbits/sec

^C[ ID] Interval Transfer Bandwidth

[ 3] 0.0-10.3 sec 304 MBytes 249 Mbits/sec

root@solaris-1:~#

 

Not bad, but when I use the 10G, the number get’s a bit more impressive.

root@solaris-1:~# iperf -n 1024 -i 2 -c 192.168.56.201

------------------------------------------------------------

Client connecting to 192.168.56.201, TCP port 5001

TCP window size: 48.0 KByte (default)

------------------------------------------------------------

[ 3] local 192.168.56.200 port 39967 connected with 192.168.56.201 port 5001

[ ID] Interval Transfer Bandwidth

[ 3] 0.0- 2.0 sec 1.14 GBytes 4.88 Gbits/sec

[ ID] Interval Transfer Bandwidth

[ 3] 2.0- 4.0 sec 1.15 GBytes 4.95 Gbits/sec

[ ID] Interval Transfer Bandwidth

[ 3] 4.0- 6.0 sec 1.16 GBytes 4.99 Gbits/sec

[ ID] Interval Transfer Bandwidth

[ 3] 6.0- 8.0 sec 1.14 GBytes 4.92 Gbits/sec

[ ID] Interval Transfer Bandwidth

[ 3] 0.0- 8.8 sec 5.06 GBytes 4.92 Gbits/sec

root@solaris-1:~#

Still not great, but I have a cheap 10G switch. Hopefully I can talk someone into loaning me an ES2-64 for a few months. J

Next, let’s switch to UPD and start measuring jitter.

On the target, we need to add a u parameter to use UDP. When the iperf server starts, you will see the UDP port now in use.

[root@ggdemo1 iperf-2.0.5]# iperf -us -i 2

------------------------------------------------------------

Server listening on UDP port 5001

Receiving 1470 byte datagrams

UDP buffer size: 256 KByte (default)

------------------------------------------------------------

Next, we will test with a slightly different set of commands, using –u to force UDP, and –t 5 , to only send for 5 seconds.

root@solaris-1:~# iperf -n 1024 -i 2 -c 192.168.56.80 -u -t 5

------------------------------------------------------------

Client connecting to 192.168.56.80, UDP port 5001

Sending 1470 byte datagrams

UDP buffer size: 56.0 KByte (default)

------------------------------------------------------------

[ 3] local 192.168.56.200 port 51542 connected with 192.168.56.80 port 5001

[ ID] Interval Transfer Bandwidth

[ 3] 0.0- 2.0 sec 257 KBytes 1.05 Mbits/sec

[ ID] Interval Transfer Bandwidth

[ 3] 2.0- 4.0 sec 256 KBytes 1.05 Mbits/sec

[ ID] Interval Transfer Bandwidth

[ 3] 0.0- 5.0 sec 642 KBytes 1.05 Mbits/sec

[ 3] Sent 447 datagrams

[ 3] Server Report:

[ ID] Interval Transfer Bandwidth Jitter Lost/Total Datagrams

[ 3] 0.0- 5.0 sec 642 KBytes 1.05 Mbits/sec 0.437 ms 0/ 447 (0%)

root@solaris-1:~#

.437 ms of jitter is not bad, but of course 10G does better J

root@solaris-1:~# iperf -n 1024 -i 2 -c 192.168.56.201 -u -t 5

------------------------------------------------------------

Client connecting to 192.168.56.201, UDP port 5001

Sending 1470 byte datagrams

UDP buffer size: 56.0 KByte (default)

------------------------------------------------------------

[ 3] local 192.168.56.200 port 52915 connected with 192.168.56.201 port 5001

[ ID] Interval Transfer Bandwidth

[ 3] 0.0- 2.0 sec 257 KBytes 5.05 Mbits/sec

[ ID] Interval Transfer Bandwidth

[ 3] 2.0- 4.0 sec 256 KBytes 5.05 Mbits/sec

[ ID] Interval Transfer Bandwidth

[ 3] 0.0- 5.0 sec 642 KBytes 5.05 Mbits/sec

[ 3] Sent 447 datagrams

[ 3] Server Report:

[ ID] Interval Transfer Bandwidth Jitter Lost/Total Datagrams

[ 3] 0.0- 5.0 sec 642 KBytes 5.05 Mbits/sec 0.222 ms 0/ 447 (0%)

root@solaris-1:~#

 

Now we dropped to .222ms, much faster

Hopefully you will now be able to use iperf to run down a few networking issues. When testing, it’s always a good idea to have multiple targets, as network topology and operating system configuration can make a difference.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.