|
| 1 | + |
| 2 | +Version 2.3 |
| 3 | + |
| 4 | +This program implements a network response time and throughput test. |
| 5 | + |
| 6 | +The program can be run as either a client or a server. The client opens one |
| 7 | +or more connections to a server and exchanges messages of a given size with |
| 8 | +the server for a given period of time. At the end of the test period, various |
| 9 | +performance metrics are displayed. |
| 10 | + |
| 11 | +The test can run in two modes. In synchronous (request/response) mode, each |
| 12 | +connection has a single thread in both the client and the server. Once the |
| 13 | +connection is established the client sends a message to the server and waits |
| 14 | +for a response. As soon as the server receives a message it sends it straight |
| 15 | +back to the client. This sequence is repeated until the test ends. |
| 16 | + |
| 17 | +In asynchronous (streaming) mode, each connection has two threads in both the |
| 18 | +client and the server. Once the connection is established the client sends a |
| 19 | +continuous stream of messages to the server and the server simultaneously |
| 20 | +sends a continuous stream of messages to the client. |
| 21 | + |
| 22 | +The size of the messages exchanged, the duration of the test measurement phase, |
| 23 | +the amount of load ramp-up and ramp-down time and the number of connections |
| 24 | +(and hence threads) are all configurable. |
| 25 | + |
| 26 | +The defaults for the various configurable parameters have been carefully chosen |
| 27 | +such that using the defaults will generally give a meaningful result. The main |
| 28 | +parameters that you might vary in normal usage are the message size and the |
| 29 | +number of connections. |
| 30 | + |
| 31 | + |
| 32 | +Usage: |
| 33 | + |
| 34 | + nwtest h[elp] { h[elp] | i[nfo] | u[sage] | g[eneral] | |
| 35 | + c[lient] | s[erver] | m[etrics] | f[ull] } |
| 36 | + |
| 37 | + nwtest i[nfo] |
| 38 | + |
| 39 | + nwtest s[erver] <port> [-4|-6] [-h[ost] <h>] [-m[sgsz] <m>] |
| 40 | + [-c[onn] <c>] [-l[og] <logpath>] |
| 41 | + |
| 42 | + nwtest c[lient] <host> <port> [-s[rc] <srcaddr>] [-4|-6] [-a[sync]] |
| 43 | + [-c[onn] <c>] [-d[ur] <d>] [-r[amp] <r>] |
| 44 | + [-m[sgsz] <m>] [-l[og] <logpath>] [-e[cn]] |
| 45 | + [-sbsz <sbsz> | [[-srvsbsz <srvsbsz>] [-cltsbsz <cltsbsz>]] |
| 46 | + [-rbsz <rbsz> | [[-srvrbsz <srvrbsz>] [-cltrbsz <cltrbsz>]] |
| 47 | + [-n[odelay]] [-q[uickack]] [-b[rief]|-v[erbose]] |
| 48 | + |
| 49 | + |
| 50 | +nwtest h[elp] { u[sage] | g[eneral] | c[lient] | s[erver] | m[etrics] | f[ull] } |
| 51 | + |
| 52 | +Display help on the specified topic. |
| 53 | + |
| 54 | + |
| 55 | +nwtest i[nfo] } |
| 56 | + |
| 57 | +Display information about this utility. |
| 58 | + |
| 59 | + |
| 60 | +nwtest s[erver] <port> [-4|-6] [-h[ost] <h>] [-m[sgsz] <m>] |
| 61 | + [-c[onn] <c>] [-l[og] <logpath>] |
| 62 | + |
| 63 | +Run as a server on local port <port>. If a specific host is specified (<h>) |
| 64 | +then bind to the address(es) for that host, otherwise bind to INADDR[6]_ANY. |
| 65 | +The host can be specified as a hostname or an IP address (IPv4 or IPv6); |
| 66 | +the address specified must be an address for an interface on the local system. |
| 67 | +If a hostname is specified then you can use the '-4' or '-6' options to limit |
| 68 | +communication to IPv4 or IPv6. |
| 69 | + |
| 70 | +The maximum message size, in bytes, that the server will accept is specified |
| 71 | +by <m> where 28 <= <m> <= 1,048,576. Connections requesting a message size |
| 72 | +larger than this will be rejected. The default is 1,048,576. This size |
| 73 | +represents the size of the user data; it excludes network protocol overheads |
| 74 | +(ethernet, IPv4/6 etc.). The size may be specified using a suffix of 'k' to |
| 75 | +repesent KB (1,024 bytes) or 'm' to represent MB (1,048,576 bytes). |
| 76 | + |
| 77 | +The maximum number of concurrent connections that the server will allow is set |
| 78 | +using <c> where 2 <= <c> <= 128. Connections that exceed this number will |
| 79 | +be rejected. The default is 32. |
| 80 | + |
| 81 | +Normally all output goes to stdout/stderr, but if '-log' is specified then |
| 82 | +after initial argument parsing any subsequent messages will be written only |
| 83 | +to <logpath> with microsecond resolution timestamps. A <logpath> of '-' |
| 84 | +equates to 'stdout' and '--' equates to 'stderr'. |
| 85 | + |
| 86 | + |
| 87 | +nwtest c[lient] <host> <port> [-s[rc] <srcaddr>] [-4|-6] [-a[sync]] |
| 88 | + [-c[onn] <c>] [-d[ur] <d>] [-r[amp] <r>] |
| 89 | + [-m[sgsz] <m>] [-l[og] <logpath>] [-e[cn]] |
| 90 | + [-sbsz <sbsz> | [[-srvsbsz <srvsbsz>] [-cltsbsz <cltsbsz>]] |
| 91 | + [-rbsz <rbsz> | [[-srvrbsz <srvrbsz>] [-cltrbsz <cltrbsz>]] |
| 92 | + [-n[odelay]] [-q[uickack]] [-b[rief]|-v[erbose]] |
| 93 | + |
| 94 | +Run as a client connecting to a server at host <host> and port <port>. The |
| 95 | +host can be specified as either a host name or an IP address (IPv4 or IPv6). |
| 96 | +If a hostname is specified then you can use the '-4' or '-6' options to limit |
| 97 | +communication to IPv4 or IPv6. |
| 98 | + |
| 99 | +Normally the OS will determine the local source IP address (interface) to use |
| 100 | +for the outgoing connection, but this can be overridden by specifying an |
| 101 | +explicit local address using the '-src' option. This value must be an IP |
| 102 | +address, not a hostname, and it must correspond to the address of an |
| 103 | +interface on the local system. If <host> has been specified using an IP |
| 104 | +address then the address type (IPv4 or IPv6) for <srcaddr> must be the same |
| 105 | +as that of <host>. Furthermore, if the allowed connection type has been |
| 106 | +restricted by way of '-4' or '-6' then the value of <srcaddr> must be of |
| 107 | +the selected type. |
| 108 | + |
| 109 | +By default the test is performed in request/response (synchronous) mode but |
| 110 | +if '-async' is specified the test is performed in streaming mode. |
| 111 | + |
| 112 | +The measurement part of the test will run for <d> seconds with a ramp-up/down |
| 113 | +of <r> seconds. 10 <= <d> <= 300 with a default of 30 and 0 <= <r> <= 30 |
| 114 | +with a default of 10. |
| 115 | + |
| 116 | +The message size used for the test is specified by <m> where 28 <= <m> <= |
| 117 | +1,048,576 with a default of 1,024. This size represents the size of the user |
| 118 | +data; it excludes network protocol overheads (ethernet, IPv4/6 etc.). The |
| 119 | +size may be specified using a suffix of 'k' to repesent KB (1,024 bytes) or |
| 120 | +'m' to represent MB (1,048,576 bytes). |
| 121 | + |
| 122 | +The number of concurrent connections used is specified by <c> where 1 <= <c> |
| 123 | +<= 64 with a default of 1. |
| 124 | + |
| 125 | +Normally all output goes to stdout/stderr, but if '-log' is specified then |
| 126 | +after initial argument parsing any subsequent messages will be written only |
| 127 | +to <logpath> with microsecond resolution timestamps. A <logpath> of '-' |
| 128 | +equates to 'stdout' and '--' equates to 'stderr'. |
| 129 | + |
| 130 | +If you specify '-ecn', Explicit Congestion Notification is requested for |
| 131 | +the connection. The system will attempt to negotiate ECN but there is no |
| 132 | +guarantee that it will succeed and no indication if the negotiation fails. |
| 133 | + |
| 134 | +Normally the OS will allocate the sizes for the socket send and receive |
| 135 | +buffers, and these sizes will be reported in the connection messages. If |
| 136 | +you want to use specific values for the socket send and receive buffer |
| 137 | +sizes then you can do so using '-sbsz' (sets size for send buffer on both |
| 138 | +client and server), '-rbsz' (sets size for the receive buffer on both client |
| 139 | +and server), '-srvsbsz' (sets size for send buffer on server), '-srvrbsz' |
| 140 | +(sets size for receive buffer on server), '-cltsbsz' (sets size for send |
| 141 | +buffer on client) and '-cltrbsz' (sets size for receive buffer on client). |
| 142 | +These values are specified in bytes and each must be between 4,096 and |
| 143 | +4,194,304. Also, the total of the sizes must be <= 4,194,304. These sizes may |
| 144 | +be specified using a suffix of 'k' to repesent KB (1,024 bytes) or 'm' to |
| 145 | +represent MB (1,048,576 bytes). |
| 146 | + |
| 147 | +Other factors, such as OS configuration, may place further constraints on |
| 148 | +the maximum allowed send and receive buffer sizes. Use 'nwtest info' to |
| 149 | +get more specific information. |
| 150 | + |
| 151 | +If '-nodelay' is specified then the TCP_NODELAY option is enabled on all |
| 152 | +sockets used for data transfer in both the client and the server. |
| 153 | + |
| 154 | +If '-quickack' is specified then the TCP_SENDMOREACKS option is enabled on |
| 155 | +all sockets used for data transfer in both the client and the server. |
| 156 | + |
| 157 | +Normally only aggregate performance metrics are displayed, but if '-verbose' |
| 158 | +is specified then per connection metrics are also displayed. If '-brief' is |
| 159 | +specified then just key metrics are displayed on a single line. |
| 160 | + |
| 161 | + |
| 162 | +For each connection successfully established, the client and server will |
| 163 | +report the TCP MSS (maxseg) value and the size of the socket send and |
| 164 | +receive buffers (sndbsz anb rcvbsz). |
| 165 | + |
| 166 | +The metrics measured and reported by this program for each test mode are |
| 167 | +as follows; all references to 'data' and 'throughput' refer to application |
| 168 | +data excluding network overheads. |
| 169 | + |
| 170 | +All modes |
| 171 | +--------- |
| 172 | + |
| 173 | +Elapsed time - The wall clock elapsed time for the measurement part |
| 174 | + of the test (excludes ramp up/down time). |
| 175 | + |
| 176 | +User CPU time - The amount of user CPU time consumed during the |
| 177 | + elapsed time. |
| 178 | + |
| 179 | +System CPU time - The amount of system CPU time consumed during the |
| 180 | + elapsed time. |
| 181 | + |
| 182 | +Total CPU time - User time plus system time. |
| 183 | + |
| 184 | +Process CPU usage - The average CPU usage for the nwtest process during |
| 185 | + the elapsed time, expressed as a percentage of one |
| 186 | + CPU core. |
| 187 | + |
| 188 | +System CPU usage - The average CPU usage for the nwtest process during |
| 189 | + the elapsed time, expressed as a percentage of total |
| 190 | + available system CPU resources. |
| 191 | + |
| 192 | +Sync (request/response) mode |
| 193 | +---------------------------- |
| 194 | + |
| 195 | +Total messages - The total number of data messages sent during the |
| 196 | + measurement period. The number of received messages |
| 197 | + is the same. |
| 198 | + |
| 199 | +Total data - The total number of bytes sent during the measurement |
| 200 | + period. The number of received bytes is the same. |
| 201 | + |
| 202 | +Avg measure time - The average measurement time across all threads (µs). |
| 203 | + |
| 204 | +Start variance - The maximum difference between the start times of all |
| 205 | + the threads (µs). Only displayed if connections > 1. |
| 206 | + |
| 207 | +Run variance - The maximum difference between the measurement times of |
| 208 | + all the threads (µs). Only displayed if connections > 1. |
| 209 | + |
| 210 | +Throughput - The send throughput, aggregated across all connections, |
| 211 | + during the measurement period (bytes/second). |
| 212 | + |
| 213 | +Minimum R/T - The lowest round trip time across all connections during |
| 214 | + the measurement period (µs). |
| 215 | + |
| 216 | +Average R/T - The average round trip time across all connections during |
| 217 | + the measurement period (µs). |
| 218 | + |
| 219 | +Maximum R/T - The highest round trip time across all connections during |
| 220 | + the measurement period (µs). |
| 221 | + |
| 222 | +In brief mode the output consists of a single line as follows: |
| 223 | + |
| 224 | +info: results S,<nconn>,<throughput>,<minrt>,<avgrt>,<maxrt>,<proccpu>,<syscpu> |
| 225 | + |
| 226 | +Async (streaming) mode |
| 227 | +---------------------- |
| 228 | + |
| 229 | +Total msg sent - The total number of messages sent during the measurement |
| 230 | + period. |
| 231 | + |
| 232 | +Total msg rcvd - The total number of messages received during the |
| 233 | + measurement period. |
| 234 | + |
| 235 | +Total data sent - The total number of bytes sent during the measurement |
| 236 | + period. |
| 237 | + |
| 238 | +Total data rcvd - The total number of bytes received during the measurement |
| 239 | + period. |
| 240 | + |
| 241 | +Avg measure time - The average measurement time across all threads (µs). |
| 242 | + |
| 243 | +Start variance - The maximum difference between the start times of all |
| 244 | + the threads (µs). |
| 245 | + |
| 246 | +Run variance - The maximum difference between the measurement times of |
| 247 | + all the threads (µs). |
| 248 | + |
| 249 | +Send throughput - The send throughput, aggregated across all connections, |
| 250 | + during the measurement period (bytes/second). |
| 251 | + |
| 252 | +Recv throughput - The receive throughput, aggregated across all connections, |
| 253 | + during the measurement period (bytes/second). |
| 254 | + |
| 255 | +Average throughput - The average of the send and receive throughputs. |
| 256 | + |
| 257 | +In brief mode the output consists of a single line as follows: |
| 258 | + |
| 259 | +info: results A,<nconn>,<sendthroughput>,<recvthroughput>,<proccpu>,<syscpu> |
| 260 | + |
| 261 | +Network overheads |
| 262 | +----------------- |
| 263 | + |
| 264 | +The message size that you specify defines the size of the 'application data' |
| 265 | +in each message sent or received. The actual amount of data for each message |
| 266 | +will be larger than this due to various network and protocol related overheads. |
| 267 | + |
| 268 | +For IPv4/TCP, there is at least 28 bytes of overhead per message and in unusual |
| 269 | +cases this may be as much as 36 bytes. In addition the TCPv4 header is another |
| 270 | +24 bytes. In most cases, for this program, the IPv4 packet size will be <message |
| 271 | +size> + 52 bytes. |
| 272 | + |
| 273 | +For IPv6/TCP, there is at least 72 bytes of overhead per message and in unusual |
| 274 | +cases this may be more due to additional header fields (each is 8 bytes). In |
| 275 | +most cases, for this program, the IPv6 packet size will be <message size> + 72 |
| 276 | +bytes. |
| 277 | + |
| 278 | +For Ethernet the standard Maximum Transmission Unit (MTU) is 1500 bytes. Each |
| 279 | +IP packet will be sent as a sequence of one or more Ethernet frames. Each frame |
| 280 | +has some overhead; normally this is 38 bytes but if 802.1q VLANs are being used |
| 281 | +it will be 42 bytes. |
| 282 | + |
| 283 | +For WiFi the standard Maximum Transmission Unit (MTU) is 1500 bytes. Each IP |
| 284 | +packet will be sent as a sequence of one or more WiFi frames. Each frame has |
| 285 | +some overhead; normally this is 36 bytes but it may be as much as 44 bytes. |
| 286 | + |
| 287 | +To give this some context, with the default test message size of 1024 bytes the |
| 288 | +IPv4 packet size will be 1076 bytes and the IPv6 packet size will be 1096 bytes. |
| 289 | +Both will therefore fit into a single Ethernet/WiFi frame. The associated |
| 290 | +Ethernet frame will be 1114 bytes for IPv4 and 1134 bytes for IPv6. |
| 291 | + |
| 292 | +With a 1 Gbit/s Ethernet network, the maximum theoretical throughput will be |
| 293 | +112,208 frames/s for IPv4 and 110,229 frames/s for IPv6. This translates to |
| 294 | +a theoretical maximum application data rate of 109.5 Mbyte/s for IPv4 and |
| 295 | +107.6 Mbyte/s for IPv6. |
| 296 | + |
0 commit comments