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 * ------------------------------------------------------------------- */
63 /* -------------------------------------------------------------------
65 * ------------------------------------------------------------------- */
67 const char usage_short[] = "\
68 Usage: %s [-s|-c host] [options]\n\
69 Try `%s --help' for more information.\n";
71 const char usage_long[] = "\
72 Usage: iperf [-s|-c host] [options]\n\
73 iperf [-h|--help] [-v|--version]\n\
76 -f, --format [kmKM] format to report: Kbits, Mbits, KBytes, MBytes\n\
77 -i, --interval # seconds between periodic bandwidth reports\n\
78 -l, --len #[KM] length of buffer to read or write (default 8 KB)\n\
79 -m, --print_mss print TCP maximum segment size (MTU - TCP/IP header)\n\
80 -p, --port # server port to listen on/connect to\n\
81 -u, --udp use UDP as transport; no argument may follow\n\
82 -u --udplite # use UDP-Lite as transport; arg: cscov (0=full coverage)\n\
83 -d, --dccp use DCCP as transport\n\
84 -w, --window #[KM] TCP window size (socket buffer size)\n\
85 -A, --algorithm set TCP congestion control algorithm\n\
86 -B, --bind <host> bind to <host>, an interface or multicast address\n\
87 -C, --compatibility for use with older versions does not sent extra msgs\n\
88 -M, --mss # set TCP maximum segment size (MTU - 40 bytes)\n\
89 -N, --nodelay set TCP no delay, disabling Nagle's Algorithm\n\
90 -V, --IPv6Version Set the domain to IPv6\n\
91 -Z, --ccid # Set DCCP congestion control algorithm\n\
92 -O, --bindport <port> bind to <port>\
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\
100 -b, --bandwidth #[KM] for UDP(-Lite)/DCCP, bandwidth to send at in bits/sec\n\
101 (default 1 Mbit/sec, implies -u)\n\
102 -c, --client <host> run in client mode, connecting to <host>\n\
103 -2, --dualtest Do a bidirectional test simultaneously\n\
104 -r, --tradeoff Do a bidirectional test individually\n\
105 -t, --time # time in seconds to transmit for (default 10 secs)\n\
106 or 0 for continuous\n\
107 -n, --num #[KM] number of bytes to transmit (instead of -t)\n\
108 -F, --fileinput <name> input the data to be transmitted from a file\n\
109 -I, --stdin input the data to be transmitted from stdin\n\
110 -L, --listenport # port to receive bidirectional tests back on\n\
111 -P, --parallel # number of parallel client threads to run\n\
112 -S --dscp # set the 6-bit IPv4/v6 DiffServ codepoint\n\
113 -T, --ttl # time-to-live, for multicast (default 1)\n\
116 -h, --help print this message and quit\n\
117 -v, --version print version information and quit\n\
119 [KM] Indicates options that support a K or M suffix for kilo- or mega-\n\
121 The TCP window size option can be set by the environment variable\n\
122 TCP_WINDOW_SIZE. Most other options can be set by an environment variable\n\
123 IPERF_<long option name>, such as IPERF_BANDWIDTH.\n\
125 Report bugs to <gerrit@erg.abdn.ac.uk>";
127 // include a description of the threading in the version
128 #if defined( HAVE_POSIX_THREAD )
129 #define IPERF_THREADS "pthreads"
131 #define IPERF_THREADS "single threaded"
134 const char version[] =
135 "iperf version " IPERF_VERSION " (" IPERF_VERSION_DATE ") " IPERF_THREADS;
137 /* -------------------------------------------------------------------
139 * ------------------------------------------------------------------- */
141 const char seperator_line[] =
142 "------------------------------------------------------------\n";
144 const char server_port[] =
145 "Server listening on %s port %d\n";
147 const char client_port[] =
148 "Client connecting to %s, %s port %d\n";
150 const char bind_address[] =
151 "Binding to local address %s\n";
153 const char multicast_ttl[] =
154 "Setting multicast TTL to %d\n";
156 const char join_multicast[] =
157 "Joining multicast group %s on %s\n";
159 const char client_datagram_size[] =
160 "Sending %d byte datagrams\n";
162 const char server_datagram_size[] =
163 "Receiving %d byte datagrams\n";
165 const char tcp_window_size[] =
168 const char dgram_buffer_size[] =
169 "datagram buffer size";
171 const char window_default[] =
174 const char wait_server_threads[] =
175 "Waiting for server threads to complete. Interrupt again to force quit.\n";
177 const char dccp_byte_stream_mode[]=
178 "NOTE: running in bytestream-mode (maximum speed)\n";
180 const char dccp_ccid_default[]=
183 const char dccp_ccid_val[]=
186 /* -------------------------------------------------------------------
188 * ------------------------------------------------------------------- */
190 const char report_read_lengths[] =
191 "[%3d] Read lengths occurring in more than 5%% of reads:\n";
193 const char report_read_length_times[] =
194 "[%3d] %5d bytes read %5d times (%.3g%%)\n";
196 const char report_bw_header[] =
197 "[ ID] Interval Transfer Bandwidth\n";
199 const char report_bw_format[] =
200 "[%3d] %4.1f-%4.1f sec %ss %ss/sec\n";
202 const char report_sum_bw_format[] =
203 "[SUM] %4.1f-%4.1f sec %ss %ss/sec\n";
205 const char report_bw_jitter_loss_header[] =
206 "[ ID] Interval Transfer Bandwidth Jitter Lost/Total \
209 const char report_bw_jitter_loss_format[] =
210 "[%3d] %4.1f-%4.1f sec %ss %ss/sec %6.3f ms %4d/%5d (%.2g%%)\n";
212 const char report_sum_bw_jitter_loss_format[] =
213 "[SUM] %4.1f-%4.1f sec %ss %ss/sec %6.3f ms %4d/%5d (%.2g%%)\n";
215 const char report_outoforder[] =
216 "[%3d] %4.1f-%4.1f sec %d datagrams received out-of-order\n";
218 const char report_sum_outoforder[] =
219 "[SUM] %4.1f-%4.1f sec %d datagrams received out-of-order\n";
221 const char report_peer[] =
222 "[%3d] local %s port %u connected with %s port %u\n";
224 const char report_mss_unsupported[] =
225 "[%3d] MSS and MTU size unknown (socket option not supported by OS?)\n";
227 const char report_mss[] =
228 "[%3d] MSS size %d bytes (MTU %d bytes, %s)\n";
230 const char report_datagrams[] =
231 "[%3d] Sent %d datagrams\n";
233 const char report_sum_datagrams[] =
234 "[SUM] Sent %d datagrams\n";
236 const char server_reporting[] =
237 "[%3d] Server Report:\n";
239 const char reportCSV_peer[] =
242 #ifdef HAVE_QUAD_SUPPORT
243 #ifdef HAVE_PRINTF_QD
244 const char reportCSV_bw_format[] =
245 "%s,%s,%d,%.1f-%.1f,%qd,%qd\n";
247 const char reportCSV_bw_jitter_loss_format[] =
248 "%s,%s,%d,%.1f-%.1f,%qd,%qd,%.3f,%d,%d,%.3f,%d\n";
249 #else // HAVE_PRINTF_QD
250 const char reportCSV_bw_format[] =
251 "%s,%s,%d,%.1f-%.1f,%lld,%lld\n";
253 const char reportCSV_bw_jitter_loss_format[] =
254 "%s,%s,%d,%.1f-%.1f,%lld,%lld,%.3f,%d,%d,%.3f,%d\n";
255 #endif // HAVE_PRINTF_QD
256 #else // HAVE_QUAD_SUPPORT
257 const char reportCSV_bw_format[] =
258 "%s,%s,%d,%.1f-%.1f,%d,%d\n";
260 const char reportCSV_bw_jitter_loss_format[] =
261 "%s,%s,%d,%.1f-%.1f,%d,%d,%.3f,%d,%d,%.3f,%d\n";
262 #endif //HAVE_QUAD_SUPPORT
263 /* -------------------------------------------------------------------
265 * ------------------------------------------------------------------- */
267 const char warn_window_requested[] =
268 " (WARNING: requested %s)";
270 const char warn_delay_large[] =
271 "WARNING: delay too large, reducing from %.1f to 1.0 seconds.\n";
273 const char warn_no_pathmtu[] =
274 "WARNING: Path MTU Discovery may not be enabled.\n";
276 const char warn_no_ack[]=
277 "[%3d] WARNING: did not receive ack of last datagram after %d tries.\n";
279 const char warn_ack_failed[]=
280 "[%3d] WARNING: ack of last datagram failed after %d tries.\n";
282 const char warn_fileopen_failed[]=
283 "WARNING: Unable to open file stream for transfer\n\
284 Using default data stream. \n";
286 const char unable_to_change_win[]=
287 "WARNING: Unable to change the window size\n";
289 const char opt_estimate[]=
290 "Optimal Estimate\n";
292 const char report_interval_small[] =
293 "WARNING: interval too small, increasing from %3.2f to 0.5 seconds.\n";
295 const char warn_invalid_server_option[] =
296 "WARNING: option -%c is not valid for server mode\n";
298 const char warn_invalid_client_option[] =
299 "WARNING: option -%c is not valid for client mode\n";
301 const char warn_invalid_compatibility_option[] =
302 "WARNING: option -%c is not valid in compatibility mode\n";
304 const char warn_implied_compatibility[] =
305 "WARNING: option -%c has implied compatibility mode\n";
307 const char warn_buffer_too_small[] =
308 "WARNING: the buffer was increased to %d for proper operation\n";
310 const char warn_invalid_single_threaded[] =
311 "WARNING: option -%c is not valid in single threaded versions\n";
313 const char warn_invalid_report_style[] =
314 "WARNING: unknown reporting style \"%s\", switching to default\n";
316 const char warn_invalid_report[] =
317 "WARNING: unknown reporting type \"%c\"\n";
320 } /* end extern "C" */