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\
93 -s, --server run in server mode\n\
94 -U, --single_udp run in single threaded UDP mode\n\
95 -D, --daemon run the server as a daemon\n\
98 -b, --bandwidth #[KM] for UDP(-Lite)/DCCP, bandwidth to send at in bits/sec\n\
99 (default 1 Mbit/sec, implies -u)\n\
100 -c, --client <host> run in client mode, connecting to <host>\n\
101 -2, --dualtest Do a bidirectional test simultaneously\n\
102 -r, --tradeoff Do a bidirectional test individually\n\
103 -t, --time # time in seconds to transmit for (default 10 secs)\n\
104 or 0 for continuous\n\
105 -n, --num #[KM] number of bytes to transmit (instead of -t)\n\
106 -F, --fileinput <name> input the data to be transmitted from a file\n\
107 -I, --stdin input the data to be transmitted from stdin\n\
108 -L, --listenport # port to receive bidirectional tests back on\n\
109 -P, --parallel # number of parallel client threads to run\n\
110 -S --dscp # set the 6-bit IPv4/v6 DiffServ codepoint\n\
111 -T, --ttl # time-to-live, for multicast (default 1)\n\
114 -h, --help print this message and quit\n\
115 -v, --version print version information and quit\n\
117 [KM] Indicates options that support a K or M suffix for kilo- or mega-\n\
119 The TCP window size option can be set by the environment variable\n\
120 TCP_WINDOW_SIZE. Most other options can be set by an environment variable\n\
121 IPERF_<long option name>, such as IPERF_BANDWIDTH.\n\
123 Report bugs to <gerrit@erg.abdn.ac.uk>";
125 // include a description of the threading in the version
126 #if defined( HAVE_POSIX_THREAD )
127 #define IPERF_THREADS "pthreads"
129 #define IPERF_THREADS "single threaded"
132 const char version[] =
133 "iperf version " IPERF_VERSION " (" IPERF_VERSION_DATE ") " IPERF_THREADS;
135 /* -------------------------------------------------------------------
137 * ------------------------------------------------------------------- */
139 const char seperator_line[] =
140 "------------------------------------------------------------\n";
142 const char server_port[] =
143 "Server listening on %s port %d\n";
145 const char client_port[] =
146 "Client connecting to %s, %s port %d\n";
148 const char bind_address[] =
149 "Binding to local address %s\n";
151 const char multicast_ttl[] =
152 "Setting multicast TTL to %d\n";
154 const char join_multicast[] =
155 "Joining multicast group %s on %s\n";
157 const char client_datagram_size[] =
158 "Sending %d byte datagrams\n";
160 const char server_datagram_size[] =
161 "Receiving %d byte datagrams\n";
163 const char tcp_window_size[] =
166 const char dgram_buffer_size[] =
167 "datagram buffer size";
169 const char window_default[] =
172 const char wait_server_threads[] =
173 "Waiting for server threads to complete. Interrupt again to force quit.\n";
175 /* -------------------------------------------------------------------
177 * ------------------------------------------------------------------- */
179 const char report_read_lengths[] =
180 "[%3d] Read lengths occurring in more than 5%% of reads:\n";
182 const char report_read_length_times[] =
183 "[%3d] %5d bytes read %5d times (%.3g%%)\n";
185 const char report_bw_header[] =
186 "[ ID] Interval Transfer Bandwidth\n";
188 const char report_bw_format[] =
189 "[%3d] %4.1f-%4.1f sec %ss %ss/sec\n";
191 const char report_sum_bw_format[] =
192 "[SUM] %4.1f-%4.1f sec %ss %ss/sec\n";
194 const char report_bw_jitter_loss_header[] =
195 "[ ID] Interval Transfer Bandwidth Jitter Lost/Total \
198 const char report_bw_jitter_loss_format[] =
199 "[%3d] %4.1f-%4.1f sec %ss %ss/sec %6.3f ms %4d/%5d (%.2g%%)\n";
201 const char report_sum_bw_jitter_loss_format[] =
202 "[SUM] %4.1f-%4.1f sec %ss %ss/sec %6.3f ms %4d/%5d (%.2g%%)\n";
204 const char report_outoforder[] =
205 "[%3d] %4.1f-%4.1f sec %d datagrams received out-of-order\n";
207 const char report_sum_outoforder[] =
208 "[SUM] %4.1f-%4.1f sec %d datagrams received out-of-order\n";
210 const char report_peer[] =
211 "[%3d] local %s port %u connected with %s port %u\n";
213 const char report_mss_unsupported[] =
214 "[%3d] MSS and MTU size unknown (socket option not supported by OS?)\n";
216 const char report_mss[] =
217 "[%3d] MSS size %d bytes (MTU %d bytes, %s)\n";
219 const char report_datagrams[] =
220 "[%3d] Sent %d datagrams\n";
222 const char report_sum_datagrams[] =
223 "[SUM] Sent %d datagrams\n";
225 const char server_reporting[] =
226 "[%3d] Server Report:\n";
228 const char reportCSV_peer[] =
231 #ifdef HAVE_QUAD_SUPPORT
232 #ifdef HAVE_PRINTF_QD
233 const char reportCSV_bw_format[] =
234 "%s,%s,%d,%.1f-%.1f,%qd,%qd\n";
236 const char reportCSV_bw_jitter_loss_format[] =
237 "%s,%s,%d,%.1f-%.1f,%qd,%qd,%.3f,%d,%d,%.3f,%d\n";
238 #else // HAVE_PRINTF_QD
239 const char reportCSV_bw_format[] =
240 "%s,%s,%d,%.1f-%.1f,%lld,%lld\n";
242 const char reportCSV_bw_jitter_loss_format[] =
243 "%s,%s,%d,%.1f-%.1f,%lld,%lld,%.3f,%d,%d,%.3f,%d\n";
244 #endif // HAVE_PRINTF_QD
245 #else // HAVE_QUAD_SUPPORT
246 const char reportCSV_bw_format[] =
247 "%s,%s,%d,%.1f-%.1f,%d,%d\n";
249 const char reportCSV_bw_jitter_loss_format[] =
250 "%s,%s,%d,%.1f-%.1f,%d,%d,%.3f,%d,%d,%.3f,%d\n";
251 #endif //HAVE_QUAD_SUPPORT
252 /* -------------------------------------------------------------------
254 * ------------------------------------------------------------------- */
256 const char warn_window_requested[] =
257 " (WARNING: requested %s)";
259 const char warn_delay_large[] =
260 "WARNING: delay too large, reducing from %.1f to 1.0 seconds.\n";
262 const char warn_no_pathmtu[] =
263 "WARNING: Path MTU Discovery may not be enabled.\n";
265 const char warn_no_ack[]=
266 "[%3d] WARNING: did not receive ack of last datagram after %d tries.\n";
268 const char warn_ack_failed[]=
269 "[%3d] WARNING: ack of last datagram failed after %d tries.\n";
271 const char warn_fileopen_failed[]=
272 "WARNING: Unable to open file stream for transfer\n\
273 Using default data stream. \n";
275 const char unable_to_change_win[]=
276 "WARNING: Unable to change the window size\n";
278 const char opt_estimate[]=
279 "Optimal Estimate\n";
281 const char report_interval_small[] =
282 "WARNING: interval too small, increasing from %3.2f to 0.5 seconds.\n";
284 const char warn_invalid_server_option[] =
285 "WARNING: option -%c is not valid for server mode\n";
287 const char warn_invalid_client_option[] =
288 "WARNING: option -%c is not valid for client mode\n";
290 const char warn_invalid_compatibility_option[] =
291 "WARNING: option -%c is not valid in compatibility mode\n";
293 const char warn_implied_compatibility[] =
294 "WARNING: option -%c has implied compatibility mode\n";
296 const char warn_buffer_too_small[] =
297 "WARNING: the buffer was increased to %d for proper operation\n";
299 const char warn_invalid_single_threaded[] =
300 "WARNING: option -%c is not valid in single threaded versions\n";
302 const char warn_invalid_report_style[] =
303 "WARNING: unknown reporting style \"%s\", switching to default\n";
305 const char warn_invalid_report[] =
306 "WARNING: unknown reporting type \"%c\"\n";
309 } /* end extern "C" */