Changes between Version 2 and Version 3 of netmon2017iperfw


Ignore:
Timestamp:
Nov 20, 2017, 1:40:55 PM (3 years ago)
Author:
admin
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • netmon2017iperfw

    v2 v3  
    11= iperf =
    22
    3 Linux systems administrators and network administrators often find diagnosing network speed degradation complicated, as there are very few tools available to diagnose these issues. iperf/iperf3 is a command-line tool used in the diagnostics of network speed issues. iperf/iperf3 measures the maximum network throughput a server can handle. It is particularly useful when experiencing network speed issues, as you can use iperf/iperf3 to determine which server is unable to reach maximum throughput.
     3Linux systems administrators and network administrators often find diagnosing network speed degradation complicated, as there are very few tools available to diagnose these issues. iperf is a command-line tool used in the diagnostics of network speed issues. iperf measures the maximum network throughput a server can handle. It is particularly useful when experiencing network speed issues, as you can use iperf to determine which server is unable to reach maximum throughput.
    44
    55== Installation ==
    66
    7 You can use apt-get to install iperf3 on Debian and Ubuntu:
     7You can use apt-get to install iperf on Debian and Ubuntu:
    88{{{
    9 apt-get install iperf3
     9apt-get install iperf
    1010}}}
    1111
    12 '''Note: Installation of perfsonar gives you iperf3 by default. Therefore you do not have to install iperf3.'''
     12'''Note: Installation of perfsonar gives you iperf3 by default. Therefore you do not have to install iperf.'''
    1313
    1414== How to Use iperf ==
     
    2727You should see output similar to:
    2828{{{
    29 -----------------------------------------------------------
    30 Server listening on 5201
    31 -----------------------------------------------------------
    32 
     29------------------------------------------------------------
     30Server listening on TCP port 5001
     31TCP window size:  128 KByte (default)
     32------------------------------------------------------------
    3333}}}
    3434
     
    3636
    3737{{{
    38     iperf -c 192.168.1.1
     38iperf -c 192.168.1.1
    3939}}}
    4040   
    4141The output should be similar to:
    4242{{{
    43 connecting to host 192.168.1.1, port 5201
    44 [  4] local 192.168.1.2 port 37988 connected to 192.168.1.1 port 5201
    45 [ ID] Interval           Transfer     Bandwidth       Retr  Cwnd
    46 [  4]   0.00-1.00   sec  47.7 MBytes   400 Mbits/sec    0   1.01 MBytes       
    47 4]   1.00-2.00   sec  51.2 MBytes   430 Mbits/sec   22   1.01 MBytes       
    48 [  4]   2.00-3.00   sec  35.0 MBytes   294 Mbits/sec    1   1.41 KBytes       
    49 4]   3.00-4.00   sec  0.00 Bytes  0.00 bits/sec    0   1.01 MBytes       
     43------------------------------------------------------------
     44Client connecting to 192.168.1.1, TCP port 5001
     45TCP window size: 85.0 KByte (default)
     46------------------------------------------------------------
     473] local 192.168.1.2 port 45448 connected with 192.168.1.1 port 5001
     48[ ID] Interval       Transfer     Bandwidth
     493]  0.0-10.0 sec   524 MBytes   439 Mbits/sec
    5050}}}
    5151   
    52 You will also see the connection and results on your iPerf server. This will look similar to:
     52You will also see the connection and results on your iperf server. This will look similar to:
    5353{{{
    54 -----------------------------------------------------------
    55 Server listening on 5201
    56 -----------------------------------------------------------
    57 Accepted connection from 192.168.1.1, port 37987
    58 [  5] local 192.168.1.2 port 5201 connected to 192.168.1.1 port 37988
    59 [ ID] Interval           Transfer     Bandwidth
    60 [  5]   0.00-1.00   sec  43.4 MBytes   364 Mbits/sec                 
    61 [  5]   1.00-2.00   sec  50.4 MBytes   423 Mbits/sec                 
    62 [  5]   2.00-3.00   sec  36.5 MBytes   305 Mbits/sec                 
    63 [  5]   3.00-4.00   sec  67.9 KBytes   556 Kbits/sec     
     54------------------------------------------------------------
     55Server listening on TCP port 5001
     56TCP window size:  128 KByte (default)
     57------------------------------------------------------------
     58[  4] local 192.168.1.1 port 5001 connected with 192.168.1.2 port 45448
     59[ ID] Interval       Transfer     Bandwidth
     60[  4]  0.0-10.1 sec   524 MBytes   437 Mbits/sec
    6461}}}
    6562
    66 - To stop the iPerf server process, press CTRL + c.
     63- To stop the iperf server process, press CTRL + c.
    6764
     65== UDP Clients & Servers ==
    6866
     67Using iPerf, you can also test the maximum throughput achieved via UDP connections.
     68
     69- Start a UDP iperf server:
     70{{{
     71iperf -s -u
     72}}}
     73
     74The output will be similar to:
     75{{{
     76------------------------------------------------------------
     77Server listening on TCP port 5001
     78Receiving 1470 byte datagrams
     79UDP buffer size:  192 KByte (default)
     80------------------------------------------------------------
     81}}}
     82
     83- '''-u''' Connect your client to your iperf UDP server. Replace 192.168.1.1 with your IP address:
     84{{{
     85iperf -c 198.168.1.1 -u
     86}}}
     87
     88The -u option we’ve passed tells iperf3 that we are connecting via UDP. This is important, because we want to see the maximum throughput achieved via UDP. The output should be similar to:
     89{{{
     90------------------------------------------------------------
     91Client connecting to 192.168.1.1, UDP port 5001
     92Sending 1470 byte datagrams
     93UDP buffer size:  208 KByte (default)
     94------------------------------------------------------------
     95[  3] local 192.168.1.2 port 35650 connected with 192.168.1.1 port 5001
     96[ ID] Interval       Transfer     Bandwidth
     97[  3]  0.0-10.0 sec  1.25 MBytes  1.05 Mbits/sec
     98[  3] Sent 893 datagrams
     99[  3] Server Report:
     100[  3]  0.0-10.0 sec  1.25 MBytes  1.05 Mbits/sec   0.408 ms    0/  893 (0%)
     101
     102}}}
     103
     104- Looking at the output we have received, 1.05 Mbits/sec is considerably less than what we received on the TCP tests. It is also considerably less than the maximum outbound bandwidth cap provided by the 1GB Linode. This is because iperf limits the bandwidth for UDP clients to 1 Mbit per second by default.
     105
     106You can change this with the -b flag, replacing the number after with the maximum bandwidth rate you wish to test against. If you are testing for network speed, we recommend setting this number above the maximum bandwidth cap provided by Linode. For example, this test was run on a 1GB Linode:
     107{{{
     108iperf -c 192.168.1.1 -u -b 100m
     109}}}
     110   
     111This tells the client that we want to achieve a maximum of 100 Mbits per second if possible.
     112{{{
     113------------------------------------------------------------
     114Client connecting to 192.168.1.1, UDP port 5001
     115Sending 1470 byte datagrams
     116UDP buffer size:  208 KByte (default)
     117------------------------------------------------------------
     118[  3] local 192.168.1.29 port 57998 connected with 192.168.1.1 port 5001
     119[ ID] Interval       Transfer     Bandwidth
     120[  3]  0.0-10.0 sec   120 MBytes   101 Mbits/sec
     121[  3] Sent 85471 datagrams
     122[  3] Server Report:
     123[  3]  0.0-10.0 sec   120 MBytes   101 Mbits/sec   0.147 ms    1/85470 (0.0012%)
     124[  3]  0.0-10.0 sec  1 datagrams received out-of-order
     125
     126}}}
     127
     128Now that is considerably better than the 1.05 Mbits/sec we were seeing earlier!
     129
     130== Bidirectional Tests ==
     131
     132In some cases, you may want to test both servers for the maximum amount of throughput. This can easily be done using the built-in bidirectional testing feature iperf offers.
     133
     134Run the following command to test both connections:
     135{{{
     136iperf -c 192.168.1.1 -d
     137}}}
     138
     139The result is that iperf will start a server and a client connection on the original client server (192.168.1.2). Once this has been done, iPerf will connect the original iperf server to the client connection, which is now acting as both a server connection and a client connection. This will look similar
     140
     141{{{
     142------------------------------------------------------------
     143Server listening on TCP port 5001
     144TCP window size: 85.3 KByte (default)
     145------------------------------------------------------------
     146------------------------------------------------------------
     147Client connecting to 192.168.1.1, TCP port 5001
     148TCP window size:  170 KByte (default)
     149------------------------------------------------------------
     150[  5] local 192.168.1.2 port 45544 connected with 192.168.1.1 port 5001
     151[  4] local 192.168.1.2 port 5001 connected with 192.168.1.1 port 50048
     152[ ID] Interval       Transfer     Bandwidth
     153[  5]  0.0-10.0 sec   304 MBytes   255 Mbits/sec
     154[  4]  0.0-10.0 sec   236 MBytes   197 Mbits/sec
     155}}}
     156
     157On the original iPerf server, you will see:
     158{{{
     159------------------------------------------------------------
     160Client connecting to 192.168.1.2, TCP port 5001
     161TCP window size:  129 KByte (default)
     162------------------------------------------------------------
     163[  6] local 192.168.1.1 port 50048 connected with 192.168.1.2 port 5001
     164Waiting for server threads to complete. Interrupt again to force quit.
     165[ ID] Interval       Transfer     Bandwidth
     166[  6]  0.0-10.0 sec   236 MBytes   198 Mbits/sec
     167[  4]  0.0-10.1 sec   304 MBytes   253 Mbits/sec
     168}}}