2 /*---------------------------------------------------------------
3 * Copyright (c) 1999,2000,2001,2002,2003
4 * The Board of Trustees of the University of Illinois
6 *---------------------------------------------------------------
7 * Permission is hereby granted, free of charge, to any person
8 * obtaining a copy of this software (Iperf) and associated
9 * documentation files (the "Software"), to deal in the Software
10 * without restriction, including without limitation the
11 * rights to use, copy, modify, merge, publish, distribute,
12 * sublicense, and/or sell copies of the Software, and to permit
13 * persons to whom the Software is furnished to do
14 * so, subject to the following conditions:
17 * Redistributions of source code must retain the above
18 * copyright notice, this list of conditions and
19 * the following disclaimers.
22 * Redistributions in binary form must reproduce the above
23 * copyright notice, this list of conditions and the following
24 * disclaimers in the documentation and/or other materials
25 * provided with the distribution.
28 * Neither the names of the University of Illinois, NCSA,
29 * nor the names of its contributors may be used to endorse
30 * or promote products derived from this Software without
31 * specific prior written permission.
33 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
34 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
35 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
36 * NONINFRINGEMENT. IN NO EVENT SHALL THE CONTIBUTORS OR COPYRIGHT
37 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
38 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
39 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE
40 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
41 * ________________________________________________________________
42 * National Laboratory for Applied Network Research
43 * National Center for Supercomputing Applications
44 * University of Illinois at Urbana-Champaign
45 * http://www.ncsa.uiuc.edu
46 * ________________________________________________________________
49 * by Ajay Tirumala <tirumala@ncsa.uiuc.edu>
50 * & Mark Gates <mgates@nlanr.net>
51 * -------------------------------------------------------------------
52 * Strings and other stuff that is locale specific.
53 * ------------------------------------------------------------------- */
59 #include "config.win32.h"
66 /* -------------------------------------------------------------------
68 * ------------------------------------------------------------------- */
70 const char usage_short[] = "\
71 Usage: %s [-s|-c host] [options]\n\
72 Try `%s --help' for more information.\n";
75 const char usage_long1[] = "\
76 Usage: iperf [-s|-c host] [options]\n\
77 iperf [-h|--help] [-v|--version]\n\
80 -f, --format [kmKM] format to report: Kbits, Mbits, KBytes, MBytes\n\
81 -i, --interval # seconds between periodic bandwidth reports\n\
82 -l, --len #[KM] length of buffer to read or write (default 8 KB)\n\
83 -m, --print_mss print TCP maximum segment size (MTU - TCP/IP header)\n\
84 -o, --output <filename> output the report or error message to this specified file\n\
85 -p, --port # server port to listen on/connect to\n\
86 -u, --udp use UDP rather than TCP\n\
87 -w, --window #[KM] TCP window size (socket buffer size)\n\
88 -B, --bind <host> bind to <host>, an interface or multicast address\n\
89 -C, --compatibility for use with older versions does not sent extra msgs\n\
90 -M, --mss # set TCP maximum segment size (MTU - 40 bytes)\n\
91 -N, --nodelay set TCP no delay, disabling Nagle's Algorithm\n\
92 -V, --IPv6Version Set the domain to IPv6\n\
95 -s, --server run in server mode\n\
96 -U, --single_udp run in single threaded UDP mode\n\
97 -D, --daemon run the server as a daemon\n\
98 -R, --remove remove service in win32\n";
100 const char usage_long2[] = "\
103 -b, --bandwidth #[KM] for UDP, bandwidth to send at in bits/sec\n\
104 (default 1 Mbit/sec, implies -u)\n\
105 -c, --client <host> run in client mode, connecting to <host>\n\
106 -d, --dualtest Do a bidirectional test simultaneously\n\
107 -n, --num #[KM] number of bytes to transmit (instead of -t)\n\
108 -r, --tradeoff Do a bidirectional test individually\n\
109 -t, --time # time in seconds to transmit for (default 10 secs)\n\
110 -F, --fileinput <name> input the data to be transmitted from a file\n\
111 -I, --stdin input the data to be transmitted from stdin\n\
112 -L, --listenport # port to recieve bidirectional tests back on\n\
113 -P, --parallel # number of parallel client threads to run\n\
114 -T, --ttl # time-to-live, for multicast (default 1)\n\
117 -h, --help print this message and quit\n\
118 -v, --version print version information and quit\n\
120 [KM] Indicates options that support a K or M suffix for kilo- or mega-\n\
122 The TCP window size option can be set by the environment variable\n\
123 TCP_WINDOW_SIZE. Most other options can be set by an environment variable\n\
124 IPERF_<long option name>, such as IPERF_BANDWIDTH.\n\
126 Report bugs to <dast@nlanr.net>\n";
129 const char usage_long[] = "\
130 Usage: iperf [-s|-c host] [options]\n\
131 iperf [-h|--help] [-v|--version]\n\
134 -f, --format [kmKM] format to report: Kbits, Mbits, KBytes, MBytes\n\
135 -i, --interval # seconds between periodic bandwidth reports\n\
136 -l, --len #[KM] length of buffer to read or write (default 8 KB)\n\
137 -m, --print_mss print TCP maximum segment size (MTU - TCP/IP header)\n\
138 -p, --port # server port to listen on/connect to\n\
139 -u, --udp use UDP rather than TCP\n\
140 -w, --window #[KM] TCP window size (socket buffer size)\n\
141 -B, --bind <host> bind to <host>, an interface or multicast address\n\
142 -C, --compatibility for use with older versions does not sent extra msgs\n\
143 -M, --mss # set TCP maximum segment size (MTU - 40 bytes)\n\
144 -N, --nodelay set TCP no delay, disabling Nagle's Algorithm\n\
145 -V, --IPv6Version Set the domain to IPv6\n\
148 -s, --server run in server mode\n\
149 -U, --single_udp run in single threaded UDP mode\n\
150 -D, --daemon run the server as a daemon\n\
153 -b, --bandwidth #[KM] for UDP, bandwidth to send at in bits/sec\n\
154 (default 1 Mbit/sec, implies -u)\n\
155 -c, --client <host> run in client mode, connecting to <host>\n\
156 -d, --dualtest Do a bidirectional test simultaneously\n\
157 -n, --num #[KM] number of bytes to transmit (instead of -t)\n\
158 -r, --tradeoff Do a bidirectional test individually\n\
159 -t, --time # time in seconds to transmit for (default 10 secs)\n\
160 -F, --fileinput <name> input the data to be transmitted from a file\n\
161 -I, --stdin input the data to be transmitted from stdin\n\
162 -L, --listenport # port to recieve bidirectional tests back on\n\
163 -P, --parallel # number of parallel client threads to run\n\
164 -T, --ttl # time-to-live, for multicast (default 1)\n\
167 -h, --help print this message and quit\n\
168 -v, --version print version information and quit\n\
170 [KM] Indicates options that support a K or M suffix for kilo- or mega-\n\
172 The TCP window size option can be set by the environment variable\n\
173 TCP_WINDOW_SIZE. Most other options can be set by an environment variable\n\
174 IPERF_<long option name>, such as IPERF_BANDWIDTH.\n\
176 Report bugs to <dast@nlanr.net>\n";
179 // include a description of the threading in the version
180 #if defined( HAVE_POSIX_THREAD )
181 #define IPERF_THREADS "pthreads"
182 #elif defined( HAVE_WIN32_THREAD )
183 #define IPERF_THREADS "win32 threads"
185 #define IPERF_THREADS "single threaded"
188 const char version[] =
189 "iperf version " IPERF_VERSION " (" IPERF_VERSION_DATE ") " IPERF_THREADS "\n";
191 /* -------------------------------------------------------------------
193 * ------------------------------------------------------------------- */
195 const char seperator_line[] =
196 "------------------------------------------------------------\n";
198 const char server_port[] =
199 "Server listening on %s port %d\n";
201 const char client_port[] =
202 "Client connecting to %s, %s port %d\n";
204 const char bind_address[] =
205 "Binding to local address %s\n";
207 const char multicast_ttl[] =
208 "Setting multicast TTL to %d\n";
210 const char join_multicast[] =
211 "Joining multicast group %s\n";
213 const char client_datagram_size[] =
214 "Sending %d byte datagrams\n";
216 const char server_datagram_size[] =
217 "Receiving %d byte datagrams\n";
219 const char tcp_window_size[] =
222 const char udp_buffer_size[] =
225 const char window_default[] =
228 const char wait_server_threads[] =
229 "Waiting for server threads to complete. Interrupt again to force quit.\n";
231 /* -------------------------------------------------------------------
233 * ------------------------------------------------------------------- */
235 const char report_read_lengths[] =
236 "[%3d] Read lengths occurring in more than 5%% of reads:\n";
238 const char report_read_length_times[] =
239 "[%3d] %5d bytes read %5d times (%.3g%%)\n";
241 const char report_bw_header[] =
242 "[ ID] Interval Transfer Bandwidth\n";
244 const char report_bw_format[] =
245 "[%3d] %4.1f-%4.1f sec %ss %ss/sec\n";
247 const char report_sum_bw_format[] =
248 "[SUM] %4.1f-%4.1f sec %ss %ss/sec\n";
250 const char report_bw_jitter_loss_header[] =
251 "[ ID] Interval Transfer Bandwidth Jitter Lost/Total \
254 const char report_bw_jitter_loss_format[] =
255 "[%3d] %4.1f-%4.1f sec %ss %ss/sec %5.3f ms %4d/%5d (%.2g%%)\n";
257 const char report_sum_bw_jitter_loss_format[] =
258 "[SUM] %4.1f-%4.1f sec %ss %ss/sec %5.3f ms %4d/%5d (%.2g%%)\n";
260 const char report_outoforder[] =
261 "[%3d] %4.1f-%4.1f sec %d datagrams received out-of-order\n";
263 const char report_sum_outoforder[] =
264 "[SUM] %4.1f-%4.1f sec %d datagrams received out-of-order\n";
266 const char report_peer[] =
267 "[%3d] local %s port %u connected with %s port %u\n";
269 const char report_mss_unsupported[] =
270 "[%3d] MSS and MTU size unknown (TCP_MAXSEG not supported by OS?)\n";
272 const char report_mss[] =
273 "[%3d] MSS size %d bytes (MTU %d bytes, %s)\n";
275 const char report_datagrams[] =
276 "[%3d] Sent %d datagrams\n";
278 const char report_sum_datagrams[] =
279 "[SUM] Sent %d datagrams\n";
281 const char server_reporting[] =
282 "[%3d] Server Report:\n";
284 const char reportCSV_peer[] =
287 #ifdef HAVE_QUAD_SUPPORT
288 #ifdef HAVE_PRINTF_QD
289 const char reportCSV_bw_format[] =
290 "%s,%s,%d,%.1f-%.1f,%qd,%qd\n";
292 const char reportCSV_bw_jitter_loss_format[] =
293 "%s,%s,%d,%.1f-%.1f,%qd,%qd,%.3f,%d,%d,%.3f,%d\n";
294 #else // HAVE_PRINTF_QD
295 const char reportCSV_bw_format[] =
296 "%s,%s,%d,%.1f-%.1f,%lld,%lld\n";
298 const char reportCSV_bw_jitter_loss_format[] =
299 "%s,%s,%d,%.1f-%.1f,%lld,%lld,%.3f,%d,%d,%.3f,%d\n";
300 #endif // HAVE_PRINTF_QD
301 #else // HAVE_QUAD_SUPPORT
303 const char reportCSV_bw_format[] =
304 "%s,%s,%d,%.1f-%.1f,%I64d,%I64d\n";
306 const char reportCSV_bw_jitter_loss_format[] =
307 "%s,%s,%d,%.1f-%.1f,%I64d,%I64d,%.3f,%d,%d,%.3f,%d\n";
309 const char reportCSV_bw_format[] =
310 "%s,%s,%d,%.1f-%.1f,%d,%d\n";
312 const char reportCSV_bw_jitter_loss_format[] =
313 "%s,%s,%d,%.1f-%.1f,%d,%d,%.3f,%d,%d,%.3f,%d\n";
315 #endif //HAVE_QUAD_SUPPORT
316 /* -------------------------------------------------------------------
318 * ------------------------------------------------------------------- */
320 const char warn_window_requested[] =
321 " (WARNING: requested %s)";
323 const char warn_window_small[] = "\
324 WARNING: TCP window size set to %d bytes. A small window size\n\
325 will give poor performance. See the Iperf documentation.\n";
327 const char warn_delay_large[] =
328 "WARNING: delay too large, reducing from %.1f to 1.0 seconds.\n";
330 const char warn_no_pathmtu[] =
331 "WARNING: Path MTU Discovery may not be enabled.\n";
333 const char warn_no_ack[]=
334 "[%3d] WARNING: did not receive ack of last datagram after %d tries.\n";
336 const char warn_ack_failed[]=
337 "[%3d] WARNING: ack of last datagram failed after %d tries.\n";
339 const char warn_fileopen_failed[]=
340 "WARNING: Unable to open file stream for transfer\n\
341 Using default data stream. \n";
343 const char unable_to_change_win[]=
344 "WARNING: Unable to change the window size\n";
346 const char opt_estimate[]=
347 "Optimal Estimate\n";
349 const char report_interval_small[] =
350 "WARNING: interval too small, increasing from %3.2f to 0.5 seconds.\n";
352 const char warn_invalid_server_option[] =
353 "WARNING: option -%c is not valid for server mode\n";
355 const char warn_invalid_client_option[] =
356 "WARNING: option -%c is not valid for client mode\n";
358 const char warn_invalid_compatibility_option[] =
359 "WARNING: option -%c is not valid in compatibility mode\n";
361 const char warn_implied_udp[] =
362 "WARNING: option -%c implies udp testing\n";
364 const char warn_implied_compatibility[] =
365 "WARNING: option -%c has implied compatibility mode\n";
367 const char warn_buffer_too_small[] =
368 "WARNING: the UDP buffer was increased to %d for proper operation\n";
370 const char warn_invalid_single_threaded[] =
371 "WARNING: option -%c is not valid in single threaded versions\n";
373 const char warn_invalid_report_style[] =
374 "WARNING: unknown reporting style \"%s\", switching to default\n";
376 const char warn_invalid_report[] =
377 "WARNING: unknown reporting type \"%c\"\n";
380 } /* end extern "C" */