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 protocol\n\
82 -d, --dccp use DCCP as transport protocol\n\
83 -w, --window #[KM] TCP window size (socket buffer size)\n\
84 -B, --bind <host> bind to <host>, an interface or multicast address\n\
85 -C, --compatibility for use with older versions does not sent extra msgs\n\
86 -M, --mss # set TCP maximum segment size (MTU - 40 bytes)\n\
87 -N, --nodelay set TCP no delay, disabling Nagle's Algorithm\n\
88 -V, --IPv6Version Set the domain to IPv6\n\
91 -s, --server run in server mode\n\
92 -U, --single_udp run in single threaded UDP mode\n\
93 -D, --daemon run the server as a daemon\n\
96 -b, --bandwidth #[KM] for UDP/DCCP, bandwidth to send at in bits/sec\n\
97 (default 1 Mbit/sec, implies -u)\n\
98 -c, --client <host> run in client mode, connecting to <host>\n\
99 -2, --dualtest Do a bidirectional test simultaneously\n\
100 -r, --tradeoff Do a bidirectional test individually\n\
101 -t, --time # time in seconds to transmit for (default 10 secs)\n\
102 -n, --num #[KM] number of bytes to transmit (instead of -t)\n\
103 -F, --fileinput <name> input the data to be transmitted from a file\n\
104 -I, --stdin input the data to be transmitted from stdin\n\
105 -L, --listenport # port to receive bidirectional tests back on\n\
106 -P, --parallel # number of parallel client threads to run\n\
107 -T, --ttl # time-to-live, for multicast (default 1)\n\
110 -h, --help print this message and quit\n\
111 -v, --version print version information and quit\n\
113 [KM] Indicates options that support a K or M suffix for kilo- or mega-\n\
115 The TCP window size option can be set by the environment variable\n\
116 TCP_WINDOW_SIZE. Most other options can be set by an environment variable\n\
117 IPERF_<long option name>, such as IPERF_BANDWIDTH.\n\
119 Report bugs to <gerrit@erg.abdn.ac.uk>";
121 // include a description of the threading in the version
122 #if defined( HAVE_POSIX_THREAD )
123 #define IPERF_THREADS "pthreads"
125 #define IPERF_THREADS "single threaded"
128 const char version[] =
129 "iperf version " IPERF_VERSION " (" IPERF_VERSION_DATE ") " IPERF_THREADS;
131 /* -------------------------------------------------------------------
133 * ------------------------------------------------------------------- */
135 const char seperator_line[] =
136 "------------------------------------------------------------\n";
138 const char server_port[] =
139 "Server listening on %s port %d\n";
141 const char client_port[] =
142 "Client connecting to %s, %s port %d\n";
144 const char bind_address[] =
145 "Binding to local address %s\n";
147 const char multicast_ttl[] =
148 "Setting multicast TTL to %d\n";
150 const char join_multicast[] =
151 "Joining multicast group %s on %s\n";
153 const char client_datagram_size[] =
154 "Sending %d byte datagrams\n";
156 const char server_datagram_size[] =
157 "Receiving %d byte datagrams\n";
159 const char tcp_window_size[] =
162 const char dgram_buffer_size[] =
163 "datagram buffer size";
165 const char window_default[] =
168 const char wait_server_threads[] =
169 "Waiting for server threads to complete. Interrupt again to force quit.\n";
171 /* -------------------------------------------------------------------
173 * ------------------------------------------------------------------- */
175 const char report_read_lengths[] =
176 "[%3d] Read lengths occurring in more than 5%% of reads:\n";
178 const char report_read_length_times[] =
179 "[%3d] %5d bytes read %5d times (%.3g%%)\n";
181 const char report_bw_header[] =
182 "[ ID] Interval Transfer Bandwidth\n";
184 const char report_bw_format[] =
185 "[%3d] %4.1f-%4.1f sec %ss %ss/sec\n";
187 const char report_sum_bw_format[] =
188 "[SUM] %4.1f-%4.1f sec %ss %ss/sec\n";
190 const char report_bw_jitter_loss_header[] =
191 "[ ID] Interval Transfer Bandwidth Jitter Lost/Total \
194 const char report_bw_jitter_loss_format[] =
195 "[%3d] %4.1f-%4.1f sec %ss %ss/sec %6.3f ms %4d/%5d (%.2g%%)\n";
197 const char report_sum_bw_jitter_loss_format[] =
198 "[SUM] %4.1f-%4.1f sec %ss %ss/sec %6.3f ms %4d/%5d (%.2g%%)\n";
200 const char report_outoforder[] =
201 "[%3d] %4.1f-%4.1f sec %d datagrams received out-of-order\n";
203 const char report_sum_outoforder[] =
204 "[SUM] %4.1f-%4.1f sec %d datagrams received out-of-order\n";
206 const char report_peer[] =
207 "[%3d] local %s port %u connected with %s port %u\n";
209 const char report_mss_unsupported[] =
210 "[%3d] MSS and MTU size unknown (socket option not supported by OS?)\n";
212 const char report_mss[] =
213 "[%3d] MSS size %d bytes (MTU %d bytes, %s)\n";
215 const char report_datagrams[] =
216 "[%3d] Sent %d datagrams\n";
218 const char report_sum_datagrams[] =
219 "[SUM] Sent %d datagrams\n";
221 const char server_reporting[] =
222 "[%3d] Server Report:\n";
224 const char reportCSV_peer[] =
227 #ifdef HAVE_QUAD_SUPPORT
228 #ifdef HAVE_PRINTF_QD
229 const char reportCSV_bw_format[] =
230 "%s,%s,%d,%.1f-%.1f,%qd,%qd\n";
232 const char reportCSV_bw_jitter_loss_format[] =
233 "%s,%s,%d,%.1f-%.1f,%qd,%qd,%.3f,%d,%d,%.3f,%d\n";
234 #else // HAVE_PRINTF_QD
235 const char reportCSV_bw_format[] =
236 "%s,%s,%d,%.1f-%.1f,%lld,%lld\n";
238 const char reportCSV_bw_jitter_loss_format[] =
239 "%s,%s,%d,%.1f-%.1f,%lld,%lld,%.3f,%d,%d,%.3f,%d\n";
240 #endif // HAVE_PRINTF_QD
241 #else // HAVE_QUAD_SUPPORT
242 const char reportCSV_bw_format[] =
243 "%s,%s,%d,%.1f-%.1f,%d,%d\n";
245 const char reportCSV_bw_jitter_loss_format[] =
246 "%s,%s,%d,%.1f-%.1f,%d,%d,%.3f,%d,%d,%.3f,%d\n";
247 #endif //HAVE_QUAD_SUPPORT
248 /* -------------------------------------------------------------------
250 * ------------------------------------------------------------------- */
252 const char warn_window_requested[] =
253 " (WARNING: requested %s)";
255 const char warn_delay_large[] =
256 "WARNING: delay too large, reducing from %.1f to 1.0 seconds.\n";
258 const char warn_no_pathmtu[] =
259 "WARNING: Path MTU Discovery may not be enabled.\n";
261 const char warn_no_ack[]=
262 "[%3d] WARNING: did not receive ack of last datagram after %d tries.\n";
264 const char warn_ack_failed[]=
265 "[%3d] WARNING: ack of last datagram failed after %d tries.\n";
267 const char warn_fileopen_failed[]=
268 "WARNING: Unable to open file stream for transfer\n\
269 Using default data stream. \n";
271 const char unable_to_change_win[]=
272 "WARNING: Unable to change the window size\n";
274 const char opt_estimate[]=
275 "Optimal Estimate\n";
277 const char report_interval_small[] =
278 "WARNING: interval too small, increasing from %3.2f to 0.5 seconds.\n";
280 const char warn_invalid_server_option[] =
281 "WARNING: option -%c is not valid for server mode\n";
283 const char warn_invalid_client_option[] =
284 "WARNING: option -%c is not valid for client mode\n";
286 const char warn_invalid_compatibility_option[] =
287 "WARNING: option -%c is not valid in compatibility mode\n";
289 const char warn_implied_compatibility[] =
290 "WARNING: option -%c has implied compatibility mode\n";
292 const char warn_buffer_too_small[] =
293 "WARNING: the buffer was increased to %d for proper operation\n";
295 const char warn_invalid_single_threaded[] =
296 "WARNING: option -%c is not valid in single threaded versions\n";
298 const char warn_invalid_report_style[] =
299 "WARNING: unknown reporting style \"%s\", switching to default\n";
301 const char warn_invalid_report[] =
302 "WARNING: unknown reporting type \"%c\"\n";
305 } /* end extern "C" */