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 | ------------------------------------------------------------ |
| 44 | Client connecting to 192.168.1.1, TCP port 5001 |
| 45 | TCP window size: 85.0 KByte (default) |
| 46 | ------------------------------------------------------------ |
| 47 | [ 3] local 192.168.1.2 port 45448 connected with 192.168.1.1 port 5001 |
| 48 | [ ID] Interval Transfer Bandwidth |
| 49 | [ 3] 0.0-10.0 sec 524 MBytes 439 Mbits/sec |
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 | ------------------------------------------------------------ |
| 55 | Server listening on TCP port 5001 |
| 56 | TCP 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 |
| 67 | Using iPerf, you can also test the maximum throughput achieved via UDP connections. |
| 68 | |
| 69 | - Start a UDP iperf server: |
| 70 | {{{ |
| 71 | iperf -s -u |
| 72 | }}} |
| 73 | |
| 74 | The output will be similar to: |
| 75 | {{{ |
| 76 | ------------------------------------------------------------ |
| 77 | Server listening on TCP port 5001 |
| 78 | Receiving 1470 byte datagrams |
| 79 | UDP 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 | {{{ |
| 85 | iperf -c 198.168.1.1 -u |
| 86 | }}} |
| 87 | |
| 88 | The -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 | ------------------------------------------------------------ |
| 91 | Client connecting to 192.168.1.1, UDP port 5001 |
| 92 | Sending 1470 byte datagrams |
| 93 | UDP 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 | |
| 106 | You 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 | {{{ |
| 108 | iperf -c 192.168.1.1 -u -b 100m |
| 109 | }}} |
| 110 | |
| 111 | This tells the client that we want to achieve a maximum of 100 Mbits per second if possible. |
| 112 | {{{ |
| 113 | ------------------------------------------------------------ |
| 114 | Client connecting to 192.168.1.1, UDP port 5001 |
| 115 | Sending 1470 byte datagrams |
| 116 | UDP 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 | |
| 128 | Now that is considerably better than the 1.05 Mbits/sec we were seeing earlier! |
| 129 | |
| 130 | == Bidirectional Tests == |
| 131 | |
| 132 | In 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 | |
| 134 | Run the following command to test both connections: |
| 135 | {{{ |
| 136 | iperf -c 192.168.1.1 -d |
| 137 | }}} |
| 138 | |
| 139 | The 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 | ------------------------------------------------------------ |
| 143 | Server listening on TCP port 5001 |
| 144 | TCP window size: 85.3 KByte (default) |
| 145 | ------------------------------------------------------------ |
| 146 | ------------------------------------------------------------ |
| 147 | Client connecting to 192.168.1.1, TCP port 5001 |
| 148 | TCP 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 | |
| 157 | On the original iPerf server, you will see: |
| 158 | {{{ |
| 159 | ------------------------------------------------------------ |
| 160 | Client connecting to 192.168.1.2, TCP port 5001 |
| 161 | TCP window size: 129 KByte (default) |
| 162 | ------------------------------------------------------------ |
| 163 | [ 6] local 192.168.1.1 port 50048 connected with 192.168.1.2 port 5001 |
| 164 | Waiting 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 | }}} |