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 rather than TCP\n\
82 -w, --window #[KM] TCP window size (socket buffer size)\n\
83 -B, --bind <host> bind to <host>, an interface or multicast address\n\
84 -C, --compatibility for use with older versions does not sent extra msgs\n\
85 -M, --mss # set TCP maximum segment size (MTU - 40 bytes)\n\
86 -N, --nodelay set TCP no delay, disabling Nagle's Algorithm\n\
87 -V, --IPv6Version Set the domain to IPv6\n\
90 -s, --server run in server mode\n\
91 -U, --single_udp run in single threaded UDP mode\n\
92 -D, --daemon run the server as a daemon\n\
95 -b, --bandwidth #[KM] for UDP, bandwidth to send at in bits/sec\n\
96 (default 1 Mbit/sec, implies -u)\n\
97 -c, --client <host> run in client mode, connecting to <host>\n\
98 -d, --dualtest Do a bidirectional test simultaneously\n\
99 -n, --num #[KM] number of bytes to transmit (instead of -t)\n\
100 -r, --tradeoff Do a bidirectional test individually\n\
101 -t, --time # time in seconds to transmit for (default 10 secs)\n\
102 -F, --fileinput <name> input the data to be transmitted from a file\n\
103 -I, --stdin input the data to be transmitted from stdin\n\
104 -L, --listenport # port to recieve bidirectional tests back on\n\
105 -P, --parallel # number of parallel client threads to run\n\
106 -T, --ttl # time-to-live, for multicast (default 1)\n\
109 -h, --help print this message and quit\n\
110 -v, --version print version information and quit\n\
112 [KM] Indicates options that support a K or M suffix for kilo- or mega-\n\
114 The TCP window size option can be set by the environment variable\n\
115 TCP_WINDOW_SIZE. Most other options can be set by an environment variable\n\
116 IPERF_<long option name>, such as IPERF_BANDWIDTH.\n\
118 Report bugs to <dast@nlanr.net>\n";
120 // include a description of the threading in the version
121 #if defined( HAVE_POSIX_THREAD )
122 #define IPERF_THREADS "pthreads"
124 #define IPERF_THREADS "single threaded"
127 const char version[] =
128 "iperf version " IPERF_VERSION " (" IPERF_VERSION_DATE ") " IPERF_THREADS "\n";
130 /* -------------------------------------------------------------------
132 * ------------------------------------------------------------------- */
134 const char seperator_line[] =
135 "------------------------------------------------------------\n";
137 const char server_port[] =
138 "Server listening on %s port %d\n";
140 const char client_port[] =
141 "Client connecting to %s, %s port %d\n";
143 const char bind_address[] =
144 "Binding to local address %s\n";
146 const char multicast_ttl[] =
147 "Setting multicast TTL to %d\n";
149 const char join_multicast[] =
150 "Joining multicast group %s\n";
152 const char client_datagram_size[] =
153 "Sending %d byte datagrams\n";
155 const char server_datagram_size[] =
156 "Receiving %d byte datagrams\n";
158 const char tcp_window_size[] =
161 const char udp_buffer_size[] =
164 const char window_default[] =
167 const char wait_server_threads[] =
168 "Waiting for server threads to complete. Interrupt again to force quit.\n";
170 /* -------------------------------------------------------------------
172 * ------------------------------------------------------------------- */
174 const char report_read_lengths[] =
175 "[%3d] Read lengths occurring in more than 5%% of reads:\n";
177 const char report_read_length_times[] =
178 "[%3d] %5d bytes read %5d times (%.3g%%)\n";
180 const char report_bw_header[] =
181 "[ ID] Interval Transfer Bandwidth\n";
183 const char report_bw_format[] =
184 "[%3d] %4.1f-%4.1f sec %ss %ss/sec\n";
186 const char report_sum_bw_format[] =
187 "[SUM] %4.1f-%4.1f sec %ss %ss/sec\n";
189 const char report_bw_jitter_loss_header[] =
190 "[ ID] Interval Transfer Bandwidth Jitter Lost/Total \
193 const char report_bw_jitter_loss_format[] =
194 "[%3d] %4.1f-%4.1f sec %ss %ss/sec %5.3f ms %4d/%5d (%.2g%%)\n";
196 const char report_sum_bw_jitter_loss_format[] =
197 "[SUM] %4.1f-%4.1f sec %ss %ss/sec %5.3f ms %4d/%5d (%.2g%%)\n";
199 const char report_outoforder[] =
200 "[%3d] %4.1f-%4.1f sec %d datagrams received out-of-order\n";
202 const char report_sum_outoforder[] =
203 "[SUM] %4.1f-%4.1f sec %d datagrams received out-of-order\n";
205 const char report_peer[] =
206 "[%3d] local %s port %u connected with %s port %u\n";
208 const char report_mss_unsupported[] =
209 "[%3d] MSS and MTU size unknown (TCP_MAXSEG not supported by OS?)\n";
211 const char report_mss[] =
212 "[%3d] MSS size %d bytes (MTU %d bytes, %s)\n";
214 const char report_datagrams[] =
215 "[%3d] Sent %d datagrams\n";
217 const char report_sum_datagrams[] =
218 "[SUM] Sent %d datagrams\n";
220 const char server_reporting[] =
221 "[%3d] Server Report:\n";
223 const char reportCSV_peer[] =
226 #ifdef HAVE_QUAD_SUPPORT
227 #ifdef HAVE_PRINTF_QD
228 const char reportCSV_bw_format[] =
229 "%s,%s,%d,%.1f-%.1f,%qd,%qd\n";
231 const char reportCSV_bw_jitter_loss_format[] =
232 "%s,%s,%d,%.1f-%.1f,%qd,%qd,%.3f,%d,%d,%.3f,%d\n";
233 #else // HAVE_PRINTF_QD
234 const char reportCSV_bw_format[] =
235 "%s,%s,%d,%.1f-%.1f,%lld,%lld\n";
237 const char reportCSV_bw_jitter_loss_format[] =
238 "%s,%s,%d,%.1f-%.1f,%lld,%lld,%.3f,%d,%d,%.3f,%d\n";
239 #endif // HAVE_PRINTF_QD
240 #else // HAVE_QUAD_SUPPORT
241 const char reportCSV_bw_format[] =
242 "%s,%s,%d,%.1f-%.1f,%d,%d\n";
244 const char reportCSV_bw_jitter_loss_format[] =
245 "%s,%s,%d,%.1f-%.1f,%d,%d,%.3f,%d,%d,%.3f,%d\n";
246 #endif //HAVE_QUAD_SUPPORT
247 /* -------------------------------------------------------------------
249 * ------------------------------------------------------------------- */
251 const char warn_window_requested[] =
252 " (WARNING: requested %s)";
254 const char warn_window_small[] = "\
255 WARNING: TCP window size set to %d bytes. A small window size\n\
256 will give poor performance. See the Iperf documentation.\n";
258 const char warn_delay_large[] =
259 "WARNING: delay too large, reducing from %.1f to 1.0 seconds.\n";
261 const char warn_no_pathmtu[] =
262 "WARNING: Path MTU Discovery may not be enabled.\n";
264 const char warn_no_ack[]=
265 "[%3d] WARNING: did not receive ack of last datagram after %d tries.\n";
267 const char warn_ack_failed[]=
268 "[%3d] WARNING: ack of last datagram failed after %d tries.\n";
270 const char warn_fileopen_failed[]=
271 "WARNING: Unable to open file stream for transfer\n\
272 Using default data stream. \n";
274 const char unable_to_change_win[]=
275 "WARNING: Unable to change the window size\n";
277 const char opt_estimate[]=
278 "Optimal Estimate\n";
280 const char report_interval_small[] =
281 "WARNING: interval too small, increasing from %3.2f to 0.5 seconds.\n";
283 const char warn_invalid_server_option[] =
284 "WARNING: option -%c is not valid for server mode\n";
286 const char warn_invalid_client_option[] =
287 "WARNING: option -%c is not valid for client mode\n";
289 const char warn_invalid_compatibility_option[] =
290 "WARNING: option -%c is not valid in compatibility mode\n";
292 const char warn_implied_udp[] =
293 "WARNING: option -%c implies udp testing\n";
295 const char warn_implied_compatibility[] =
296 "WARNING: option -%c has implied compatibility mode\n";
298 const char warn_buffer_too_small[] =
299 "WARNING: the UDP buffer was increased to %d for proper operation\n";
301 const char warn_invalid_single_threaded[] =
302 "WARNING: option -%c is not valid in single threaded versions\n";
304 const char warn_invalid_report_style[] =
305 "WARNING: unknown reporting style \"%s\", switching to default\n";
307 const char warn_invalid_report[] =
308 "WARNING: unknown reporting type \"%c\"\n";
311 } /* end extern "C" */