trim excess whitespace

This commit is contained in:
a1346054 2021-09-03 13:24:55 +00:00
parent 50d6cce65c
commit e919e8c21b
36 changed files with 324 additions and 337 deletions

View File

@ -6,7 +6,7 @@ os:
- linux
- osx
- freebsd
notifications:
slack:
secure: ImUmX7hcYotHWCDBfOcIvF6H7kkeGqiaUCy7SVPFtgPbz33ttpbRd94E7oxWVmZMLKb+i6+JCujTEWGwGBimzH+DjL0LLWs0ShzXZIUa1UzEPTc4hgV6VAxucYKFg2WrbXgOPWbulkMG1VZ6pX7GlAEGf0qyNqn44F7S2ay9m18=

View File

@ -60,7 +60,7 @@ Invoking iperf3
iperf3 includes a manual page listing all of the command-line options.
The manual page is the most up-to-date reference to the various flags and parameters.
For sample command line usage, see:
For sample command line usage, see:
https://fasterdata.es.net/performance-testing/network-troubleshooting-tools/iperf/
@ -119,7 +119,7 @@ Some iperf2 options are not available in iperf3:
-r, --tradeoff Do a bidirectional test individually
-T, --ttl time-to-live, for multicast (default 1)
-x, --reportexclude [CDMSV] exclude C(connection) D(data) M(multicast)
-x, --reportexclude [CDMSV] exclude C(connection) D(data) M(multicast)
S(settings) V(server) reports
-y, --reportstyle C report as a Comma-Separated Values

View File

@ -1,7 +1,7 @@
#
# sample Gnuplot command file for iperf3 results
set term x11
#set term png
#set term png
#set term postscript landscape color
set key width -12
@ -19,11 +19,11 @@ set grid linewidth 1
set title "TCP performance: 40G to 10G host"
set xlabel "time (seconds)"
set ylabel "Bandwidth (Gbits/second)"
set xrange [0:60]
set yrange [0:15]
set xrange [0:60]
set yrange [0:15]
set ytics nomirror
set y2tics
set y2range [0:2500]
set y2range [0:2500]
# dont plot when retransmits = 0
set datafile missing '0'
set pointsize 1.6
@ -34,4 +34,3 @@ plot "40Gto10G.old.dat" using 1:3 title '3.10 kernel' with linespoints lw 3 pt 5
#plot "iperf3.old.dat" using 1:3 title '3.10 kernel' with linespoints lw 3 pt 5, \
# "iperf3.new.dat" using 1:3 title '4.2 kernel' with linespoints lw 3 pt 7

View File

@ -7,7 +7,7 @@ State of the iperf3 World, as seen from ESnet...
------------------------------------------------
iperf3 was originally written to be a "better", more maintainable
follow-on to iperf2. This was seen to be necessary to fill the
follow-on to iperf2. This was seen to be necessary to fill the
requirements for the perfSONAR project (http://www.perfsonar.net).
In the past few years, iperf2 development has been restarted by Bob

View File

@ -24,4 +24,3 @@ help to run ``./bootstrap.sh`` first from the top-level directory.
By default, the ``libiperf`` library is built in both shared and
static forms. Either can be suppressed by using the
``--disabled-shared`` or ``--disable-static`` configure-time options.

View File

@ -25,7 +25,7 @@ Bug Reports
-----------
Before submitting a bug report, try checking out the latest version of
the code, and confirm that it's not already fixed. Also see the :doc:`faq`.
the code, and confirm that it's not already fixed. Also see the :doc:`faq`.
Then submit to the iperf3 issue tracker on GitHub:
https://github.com/esnet/iperf/issues
@ -47,7 +47,7 @@ for a complete list of iperf3 options)::
-T, --title str prefix every output line with this string
-F, --file name xmit/recv the specified file
-A, --affinity n/n,m set CPU affinity (Linux and FreeBSD only)
-k, --blockcount #[KMG] number of blocks (packets) to transmit (instead
-k, --blockcount #[KMG] number of blocks (packets) to transmit (instead
of -t or -n)
-L, --flowlabel set IPv6 flow label (Linux only)
@ -62,7 +62,7 @@ Deprecated flags (currently no plans to support)::
-d, --dualtest Do a bidirectional test simultaneously
-r, --tradeoff Do a bidirectional test individually
-T, --ttl time-to-live, for multicast (default 1)
-x, --reportexclude [CDMSV] exclude C(connection) D(data) M(multicast)
-x, --reportexclude [CDMSV] exclude C(connection) D(data) M(multicast)
S(settings) V(server) reports
-y, --reportstyle C report as a Comma-Separated Values
@ -176,7 +176,7 @@ Release Engineering Checklist
7. For extra points, actually try downloading, compiling, and
smoke-testing the results of the tarball on all supported
platforms.
8. Plug the SHA256 checksum into the release announcement.
9. PGP-sign the release announcement text using ``gpg --clearsign``.
@ -233,7 +233,7 @@ Code Authors
The main authors of iperf3 are (in alphabetical order): Jon Dugan,
Seth Elliott, Bruce A. Mah, Jeff Poskanzer, Kaustubh Prabhu.
Additional code contributions have come from (also in alphabetical
order): Mark Ashley, Aaron Brown, Aeneas Jaißle, Susant Sahani,
order): Mark Ashley, Aaron Brown, Aeneas Jaißle, Susant Sahani,
Bruce Simpson, Brian Tierney.
iperf3 contains some original code from iperf2. The authors of iperf2

View File

@ -13,27 +13,27 @@ What is the history of iperf3, and what is the difference between iperf2 and ipe
threaded, and not worry about backwards compatibility with
iperf2. Many of the feature requests for iperf3 came from the
perfSONAR project (http://www.perfsonar.net).
Then in 2014, Bob (Robert) McMahon from Broadcom restarted
development of iperf2 (See
https://sourceforge.net/projects/iperf2/). He fixed many of the
problems with iperf2, and added a number of new features similar to
iperf3. iperf2.0.8, released in 2015, made iperf2 a useful tool. iperf2's
iperf3. iperf2.0.8, released in 2015, made iperf2 a useful tool. iperf2's
current development is focused is on using UDP for latency testing, as well
as broad platform support.
As of this writing (2017), both iperf2 and iperf3 are being actively
(although independently) developed. We recommend being familiar with
both tools, and use whichever tools features best match your needs.
A feature comparison of iperf2, iperf3, and nuttcp is available at:
https://fasterdata.es.net/performance-testing/network-troubleshooting-tools/throughput-tool-comparision/
iperf3 parallel stream performance is much less than iperf2. Why?
iperf3 is single threaded, and iperf2 is multi-threaded. We
recommend using iperf2 for parallel streams.
If you want to use multiple iperf3 streams use the method described `here <https://fasterdata.es.net/performance-testing/network-troubleshooting-tools/iperf/multi-stream-iperf3/>`_.
Im trying to use iperf3 on Windows, but having trouble. What should I do?
iperf3 is not officially supported on Windows, but iperf2 is. We
recommend you use iperf2.
@ -41,7 +41,7 @@ Im trying to use iperf3 on Windows, but having trouble. What should I do?
Some people are using Cygwin to run iperf3 in Windows, but not all
options will work. Some community-provided binaries of iperf3 for
Windows exist.
How can I build a statically-linked executable of iperf3?
There are a number of reasons for building an iperf3 executable with
no dependencies on any shared libraries. Unfortunately this isn't
@ -123,10 +123,10 @@ I'm seeing quite a bit of unexpected UDP loss. Why?
issue with the default UDP send size that was fixed in
3.1.5. Second, try adding the flag ``-w2M`` to increase the socket
buffer sizes. That seems to make a big difference on some hosts.
iperf3 UDP does not seem to work at bandwidths less than 100Kbps. Why?
You'll need to reduce the default packet length to get UDP rates of less that 100Kbps. Try ``-l100``.
TCP throughput drops to (almost) zero during a test, what's going on?
A drop in throughput to almost zero, except maybe for the first
reported interval(s), may be related to problems in NIC TCP Offload,
@ -184,13 +184,13 @@ What congestion control algorithms are supported?
On Linux, run this command to see the available congestion control
algorithms (note that some algorithms are packaged as kernel
modules, which must be loaded before they can be used)::
/sbin/sysctl net.ipv4.tcp_available_congestion_control
On FreeBSD, the equivalent command is::
/sbin/sysctl net.inet.tcp.cc.available
Im using the ``--logfile`` option. How do I see file output in real time?
Use the ``--forceflush`` flag.
@ -252,5 +252,3 @@ I have a question regarding iperf3...what's the best way to get help?
We discourage the use of the iperf3 issue tracker on GitHub for
support questions. Actual bug reports, enhancement requests, or
pull requests are encouraged, however.

View File

@ -68,4 +68,3 @@ Indices and tables
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`

View File

@ -4,7 +4,7 @@ Invoking iperf3
iperf3 includes a manual page listing all of the command-line options.
The manual page is the most up-to-date reference to the various flags and parameters.
For sample command line usage, see:
For sample command line usage, see:
https://fasterdata.es.net/performance-testing/network-troubleshooting-tools/iperf/
@ -28,72 +28,72 @@ the executable.
::
IPERF3(1) User Manuals IPERF3(1)
NAME
iperf3 - perform network throughput tests
SYNOPSIS
iperf3 -s [ options ]
iperf3 -c server [ options ]
DESCRIPTION
iperf3 is a tool for performing network throughput measurements. It
can test TCP, UDP, or SCTP throughput. To perform an iperf3 test the
user must establish both a server and a client.
The iperf3 executable contains both client and server functionality.
An iperf3 server can be started using either of the -s or --server com-
mand-line parameters, for example:
iperf3 -s
iperf3 --server
Note that many iperf3 parameters have both short (-s) and long
(--server) forms. In this section we will generally use the short form
of command-line flags, unless only the long form of a flag is avail-
able.
By default, the iperf3 server listens on TCP port 5201 for connections
from an iperf3 client. A custom port can be specified by using the -p
flag, for example:
iperf3 -s -p 5002
After the server is started, it will listen for connections from iperf3
clients (in other words, the iperf3 program run in client mode). The
client mode can be started using the -c command-line option, which also
requires a host to which iperf3 should connect. The host can by speci-
fied by hostname, IPv4 literal, or IPv6 literal:
iperf3 -c iperf3.example.com
iperf3 -c 192.0.2.1
iperf3 -c 2001:db8::1
If the iperf3 server is running on a non-default TCP port, that port
number needs to be specified on the client as well:
iperf3 -c iperf3.example.com -p 5002
The initial TCP connection is used to exchange test parameters, control
the start and end of the test, and to exchange test results. This is
sometimes referred to as the "control connection". The actual test
data is sent over a separate TCP connection, as a separate flow of UDP
packets, or as an independent SCTP connection, depending on what proto-
col was specified by the client.
Normally, the test data is sent from the client to the server, and mea-
sures the upload speed of the client. Measuring the download speed
from the server can be done by specifying the -R flag on the client.
This causes data to be sent from the server to the client.
iperf3 -c iperf3.example.com -p 5202 -R
Results are displayed on both the client and server. There will be at
least one line of output per measurement interval (by default a mea-
surement interval lasts for one second, but this can be changed by the
@ -103,43 +103,43 @@ the executable.
measurement interval are taken from the point of view of the endpoint
process emitting that output (in other words, the output on the client
shows the measurement interval data for the client.
At the end of the test is a set of statistics that shows (at least as
much as possible) a summary of the test as seen by both the sender and
the receiver, with lines tagged accordingly. Recall that by default
the client is the sender and the server is the receiver, although as
indicated above, use of the -R flag will reverse these roles.
The client can be made to retrieve the server-side output for a given
test by specifying the --get-server-output flag.
Either the client or the server can produce its output in a JSON struc-
ture, useful for integration with other programs, by passing it the -J
flag. Because the contents of the JSON structure are only competely
known after the test has finished, no JSON output will be emitted until
the end of the test.
iperf3 has a (overly) large set of command-line options that can be
used to set the parameters of a test. They are given in the "GENERAL
OPTIONS" section of the manual page below, as well as summarized in
iperf3's help output, which can be viewed by running iperf3 with the -h
flag.
GENERAL OPTIONS
-p, --port n
set server port to listen on/connect to to n (default 5201)
-f, --format
[kmgtKMGT] format to report: Kbits/Mbits/Gbits/Tbits
-i, --interval n
pause n seconds between periodic throughput reports; default is
1, use 0 to disable
-I, --pidfile file
write a file with the process ID, most useful when running as a
daemon.
-F, --file name
Use a file as the source (on the sender) or sink (on the
receiver) of data, rather than just generating random data or
@ -148,7 +148,7 @@ the executable.
It does not turn iperf3 into a file transfer tool. The length,
attributes, and in some cases contents of the received file may
not match those of the original file.
-A, --affinity n/n,m
Set the CPU affinity, if possible (Linux, FreeBSD, and Windows
only). On both the client and server you can set the local
@ -158,26 +158,26 @@ the executable.
argument. Note that when using this feature, a process will
only be bound to a single CPU (as opposed to a set containing
potentialy multiple CPUs).
-B, --bind host
bind to the specific interface associated with address host.
--bind-dev dev.ft R bind to the specified network interface.
This option uses SO_BINDTODEVICE, and may require root permis-
sions. (Available on Linux and possibly other systems.)
-V, --verbose
give more detailed output
-J, --json
output in JSON format
--logfile file
send output to a log file.
--forceflush
force flushing output at every interval. Used to avoid buffer-
ing when sending output to pipe.
--timestamps[=format]
prepend a timestamp at the start of each output line. By
default, timestamps have the format emitted by ctime(1).
@ -185,33 +185,33 @@ the executable.
to customize the timestamps, see strftime(3). If this optional
format is given, the = must immediately follow the --timestamps
option with no whitespace intervening.
--rcv-timeout #
set idle timeout for receiving data during active tests. The
receiver will halt a test if no data is received from the sender
for this number of ms (default to 12000 ms, or 2 minutes).
-d, --debug
emit debugging output. Primarily (perhaps exclusively) of use
to developers.
-v, --version
show version information and quit
-h, --help
show a help synopsis
SERVER SPECIFIC OPTIONS
-s, --server
run in server mode
-D, --daemon
run the server in background as a daemon
-1, --one-off
handle one client connection, then exit.
--server-bitrate-limit n[KMGT]
set a limit on the server side, which will cause a test to abort
if the client specifies a test of more than n bits per second,
@ -221,41 +221,41 @@ the executable.
over which to average the data rate is 5 seconds by default, but
can be specified by adding a '/' and a number to the bitrate
specifier.
--rsa-private-key-path file
path to the RSA private key (not password-protected) used to
decrypt authentication credentials from the client (if built
with OpenSSL support).
--authorized-users-path file
path to the configuration file containing authorized users cre-
dentials to run iperf tests (if built with OpenSSL support).
The file is a comma separated list of usernames and password
hashes; more information on the structure of the file can be
found in the EXAMPLES section.
--time-skew-thresholdsecond seconds
time skew threshold (in seconds) between the server and client
during the authentication process.
CLIENT SPECIFIC OPTIONS
-c, --client host
run in client mode, connecting to the specified server. By
default, a test consists of sending data from the client to the
server, unless the -R flag is specified.
--sctp use SCTP rather than TCP (FreeBSD and Linux)
-u, --udp
use UDP rather than TCP
--connect-timeout n
set timeout for establishing the initial control connection to
the server, in milliseconds. The default behavior is the oper-
ating system's timeout for TCP connection establishment. Pro-
viding a shorter value may speed up detection of a down iperf3
server.
-b, --bitrate n[KMGT]
set target bitrate to n bits/sec (default 1 Mbit/sec for UDP,
unlimited for TCP/SCTP). If there are multiple streams (-P
@ -269,7 +269,7 @@ the executable.
inside iperf3, and is available on all platforms. Compare with
the --fq-rate flag. This option replaces the --bandwidth flag,
which is now deprecated but (at least for now) still accepted.
--pacing-timer n[KMGT]
set pacing timer interval in microseconds (default 1000
microseconds, or 1 ms). This controls iperf3's internal pacing
@ -278,7 +278,7 @@ the executable.
timer parameter smooth out the traffic emitted by iperf3, but
potentially at the cost of performance due to more frequent
timer processing.
--fq-rate n[KMGT]
Set a rate to be used with fair-queueing based socket-level pac-
ing, in bits per second. This pacing (if specified) will be in
@ -287,72 +287,72 @@ the executable.
test. Only available on platforms supporting the SO_MAX_PAC-
ING_RATE socket option (currently only Linux). The default is
no fair-queueing based pacing.
--no-fq-socket-pacing
This option is deprecated and will be removed. It is equivalent
to specifying --fq-rate=0.
-t, --time n
time in seconds to transmit for (default 10 secs)
-n, --bytes n[KMGT]
number of bytes to transmit (instead of -t)
-k, --blockcount n[KMGT]
number of blocks (packets) to transmit (instead of -t or -n)
-l, --length n[KMGT]
length of buffer to read or write. For TCP tests, the default
value is 128KB. In the case of UDP, iperf3 tries to dynamically
determine a reasonable sending size based on the path MTU; if
that cannot be determined it uses 1460 bytes as a sending size.
For SCTP tests, the default size is 64KB.
--cport port
bind data streams to a specific client port (for TCP and UDP
only, default is to use an ephemeral port)
-P, --parallel n
number of parallel client streams to run. Note that iperf3 is
single threaded, so if you are CPU bound, this will not yield
higher throughput.
-R, --reverse
reverse the direction of a test, so that the server sends data
to the client
--bidir
test in both directions (normal and reverse), with both the
client and server sending and receiving data simultaneously
-w, --window n[KMGT]
window size / socket buffer size (this gets sent to the server
and used on that side too)
-M, --set-mss n
set TCP/SCTP maximum segment size (MTU - 40 bytes)
-N, --no-delay
set TCP/SCTP no delay, disabling Nagle's Algorithm
-4, --version4
only use IPv4
-6, --version6
only use IPv6
-S, --tos n
set the IP type of service. The usual prefixes for octal and hex
can be used, i.e. 52, 064 and 0x34 all specify the same value.
--dscp dscp
set the IP DSCP bits. Both numeric and symbolic values are
accepted. Numeric values can be specified in decimal, octal and
hex (see --tos above).
-L, --flowlabel n
set the IPv6 flow label (currently only supported on Linux)
-X, --xbind name
Bind SCTP associations to a specific subset of links using
sctp_bindx(3). The --B flag will be ignored if this flag is
@ -366,30 +366,30 @@ the executable.
resolved using getaddrinfo(3). If the --4 or --6 flags are
specified, names which do not resolve to addresses within the
specified protocol family will be ignored.
--nstreams n
Set number of SCTP streams.
-Z, --zerocopy
Use a "zero copy" method of sending data, such as sendfile(2),
instead of the usual write(2).
-O, --omit n
Omit the first n seconds of the test, to skip past the TCP slow-
start period.
-T, --title str
Prefix every output line with this string.
--extra-data str
Specify an extra data string field to be included in JSON out-
put.
-C, --congestion algo
Set the congestion control algorithm (Linux and FreeBSD only).
An older --linux-congestion synonym for this flag is accepted
but is deprecated.
--get-server-output
Get the output from the server. The output format is determined
by the server (in particular, if the server was invoked with the
@ -397,14 +397,14 @@ the executable.
will be in human-readable format). If the client is run with
--json, the server output is included in a JSON object; other-
wise it is appended at the bottom of the human-readable output.
--udp-counters-64bit
Use 64-bit counters in UDP test packets. The use of this option
can help prevent counter overflows during long or high-bitrate
UDP tests. Both client and server need to be running at least
version 3.1 for this option to work. It may become the default
behavior at some point in the future.
--repeating-payload
Use repeating pattern in payload, instead of random bytes. The
same payload is used in iperf2 (ASCII '0..9' repeating). It
@ -412,11 +412,11 @@ the executable.
hardware compression (including some WiFi access points), where
iperf2 and iperf3 perform differently, just based on payload
entropy.
--dont-fragment
Set the IPv4 Don't Fragment (DF) bit on outgoing packets. Only
applicable to tests doing UDP over IPv4.
--username username
username to use for authentication to the iperf server (if built
with OpenSSL support). The password will be prompted for inter-
@ -424,12 +424,12 @@ the executable.
also be specified via the IPERF3_PASSWORD environment variable.
If this variable is present, the password prompt will be
skipped.
--rsa-public-key-path file
path to the RSA public key used to encrypt authentication cre-
dentials (if built with OpenSSL support)
EXAMPLES
Authentication - RSA Keypair
The authentication feature of iperf3 requires an RSA public keypair.
@ -440,16 +440,16 @@ the executable.
format and use SubjectPrefixKeyInfo encoding. An example of a set of
UNIX/Linux commands using OpenSSL to generate a correctly-formed key-
pair follows:
> openssl genrsa -des3 -out private.pem 2048
> openssl rsa -in private.pem -outform PEM -pubout -out public.pem
> openssl rsa -in private.pem -out private_not_protected.pem -out-
form PEM
After these commands, the public key will be contained in the file pub-
lic.pem and the private key will be contained in the file pri-
vate_not_protected.pem.
Authentication - Authorized users configuration file
A simple plaintext file must be provided to the iperf3 server in order
to specify the authorized user credentials. The file is a simple list
@ -458,31 +458,30 @@ the executable.
word". The file can also contain commented lines (starting with the #
character). An example of commands to generate the password hash on a
UNIX/Linux system is given below:
> S_USER=mario S_PASSWD=rossi
> echo -n "{$S_USER}$S_PASSWD" | sha256sum | awk '{ print $1 }'
An example of a password file (with an entry corresponding to the above
username and password) is given below:
> cat credentials.csv
# file format: username,sha256
mario,bf7a49a846d44b454a5d11e7acfaf13d138bbe0b7483aa3e050879700572709b
AUTHORS
A list of the contributors to iperf3 can be found within the documenta-
tion located at https://software.es.net/iperf/dev.html#authors.
SEE ALSO
libiperf(3), https://software.es.net/iperf
ESnet February 2021
IPERF3(1)
The iperf3 manual page will typically be installed in manual
section 1.

View File

@ -412,4 +412,3 @@ During development, there were various distributions of the source
code unofficially released carrying a 3.0.0 version number. Because
of the possibility for confusion, this first public release of iperf3
was numbered 3.0.1.

View File

@ -3,8 +3,8 @@ Version: @VERSION@
Release: 1%{?dist}
Summary: Measurement tool for TCP/UDP bandwidth performance
Group: Applications/Internet
License: BSD
Group: Applications/Internet
License: BSD
URL: https://github.com/esnet/iperf
Source0: https://downloads.es.net/pub/iperf/iperf-%{version}.tar.gz
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
@ -98,9 +98,8 @@ rm -rf $RPM_BUILD_ROOT
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
* Wed Apr 06 2011 G.Balaji <balajig81@gmail.com> 3.0b4-2
- Changed the Spec name, removed static libs generation and devel
- Changed the Spec name, removed static libs generation and devel
- package.
* Sat Mar 26 2011 G.Balaji <balajig81@gmail.com> 3.0b4-1
- Initial Version

View File

@ -30,8 +30,8 @@
#include <linux/types.h>
/*
It is just a stripped copy of the Linux kernel header "linux/in6.h"
/*
It is just a stripped copy of the Linux kernel header "linux/in6.h"
"Flow label" things are still not defined in "netinet/in*.h" headers,
but we cannot use "linux/in6.h" immediately because it currently
conflicts with "netinet/in.h" .

View File

@ -183,7 +183,7 @@ struct iperf_stream
int socket;
int id;
int sender;
/* XXX: is settings just a pointer to the same struct in iperf_test? if not,
/* XXX: is settings just a pointer to the same struct in iperf_test? if not,
should it be? */
struct iperf_settings *settings; /* pointer to structure settings */
@ -325,7 +325,7 @@ struct iperf_test
fd_set read_set; /* set of read sockets */
fd_set write_set; /* set of write sockets */
/* Interval related members */
/* Interval related members */
int omitting;
double stats_interval;
double reporter_interval;

View File

@ -6,7 +6,7 @@ iperf3 \- perform network throughput tests
.I options
.B ]
.br
.B iperf3 -c
.B iperf3 -c
.I server
.B [
.I options
@ -148,7 +148,7 @@ This option uses SO_BINDTODEVICE, and may require root permissions.
(Available on Linux and possibly other systems.)
.TP
.BR -V ", " --verbose " "
give more detailed output
give more detailed output
.TP
.BR -J ", " --json " "
output in JSON format
@ -213,12 +213,12 @@ the data rate is 5 seconds by default, but can be specified by adding
a '/' and a number to the bitrate specifier.
.TP
.BR --rsa-private-key-path " \fIfile\fR"
path to the RSA private key (not password-protected) used to decrypt
path to the RSA private key (not password-protected) used to decrypt
authentication credentials from the client (if built with OpenSSL
support).
.TP
.TP
.BR --authorized-users-path " \fIfile\fR"
path to the configuration file containing authorized users credentials to run
path to the configuration file containing authorized users credentials to run
iperf tests (if built with OpenSSL support).
The file is a comma separated list of usernames and password hashes;
more information on the structure of the file can be found in the
@ -418,41 +418,41 @@ perform differently, just based on payload entropy.
Set the IPv4 Don't Fragment (DF) bit on outgoing packets.
Only applicable to tests doing UDP over IPv4.
.TP
.BR --username " \fIusername\fR"
.BR --username " \fIusername\fR"
username to use for authentication to the iperf server (if built with
OpenSSL support).
The password will be prompted for interactively when the test is run. Note,
the password to use can also be specified via the IPERF3_PASSWORD environment
variable. If this variable is present, the password prompt will be skipped.
.TP
.BR --rsa-public-key-path " \fIfile\fR"
.BR --rsa-public-key-path " \fIfile\fR"
path to the RSA public key used to encrypt authentication credentials
(if built with OpenSSL support)
.SH EXAMPLES
.SS "Authentication - RSA Keypair"
The authentication feature of iperf3 requires an RSA public keypair.
The public key is used to encrypt the authentication token containing the
The public key is used to encrypt the authentication token containing the
user credentials, while the private key is used to decrypt the authentication token.
The private key must be in PEM format and additionally must not have a
password set.
The public key must be in PEM format and use SubjectPrefixKeyInfo encoding.
An example of a set of UNIX/Linux commands using OpenSSL
to generate a correctly-formed keypair follows:
.sp 1
.sp 1
.in +.5i
> openssl genrsa -des3 -out private.pem 2048
.sp 0
> openssl rsa -in private.pem -outform PEM -pubout -out public.pem
.sp 0
> openssl rsa -in private.pem -out private_not_protected.pem -outform PEM
> openssl rsa -in private.pem -out private_not_protected.pem -outform PEM
.in -.5i
.sp 1
After these commands, the public key will be contained in the file
public.pem and the private key will be contained in the file
private_not_protected.pem.
.SS "Authentication - Authorized users configuration file"
A simple plaintext file must be provided to the iperf3 server in order to specify
A simple plaintext file must be provided to the iperf3 server in order to specify
the authorized user credentials.
The file is a simple list of comma-separated pairs of a username and a
corresponding password hash.
@ -461,7 +461,7 @@ The file can also contain commented lines (starting with the \fC#\fR
character).
An example of commands to generate the password hash on a UNIX/Linux system
is given below:
.sp 1
.sp 1
.in +.5i
> S_USER=mario S_PASSWD=rossi
.sp 0

View File

@ -1202,7 +1202,7 @@ iperf_parse_arguments(struct iperf_test *test, int argc, char **argv)
break;
case 'w':
// XXX: This is a socket buffer, not specific to TCP
// Do sanity checks as double-precision floating point
// Do sanity checks as double-precision floating point
// to avoid possible integer overflows.
farg = unit_atof(optarg);
if (farg > (double) MAX_TCP_BUFFER) {
@ -1349,7 +1349,7 @@ iperf_parse_arguments(struct iperf_test *test, int argc, char **argv)
case 'A':
#if defined(HAVE_CPU_AFFINITY)
test->affinity = strtol(optarg, &endptr, 0);
if (endptr == optarg ||
if (endptr == optarg ||
test->affinity < 0 || test->affinity > 1024) {
i_errno = IEAFFINITY;
return -1;
@ -1478,7 +1478,7 @@ iperf_parse_arguments(struct iperf_test *test, int argc, char **argv)
if (test->role == 's' && (client_username || client_rsa_public_key)){
i_errno = IECLIENTONLY;
return -1;
} else if (test->role == 'c' && (client_username || client_rsa_public_key) &&
} else if (test->role == 'c' && (client_username || client_rsa_public_key) &&
!(client_username && client_rsa_public_key)) {
i_errno = IESETCLIENTAUTH;
return -1;
@ -1492,7 +1492,7 @@ iperf_parse_arguments(struct iperf_test *test, int argc, char **argv)
else if (iperf_getpass(&client_password, &s, stdin) < 0){
i_errno = IESETCLIENTAUTH;
return -1;
}
}
if (test_load_pubkey_from_file(client_rsa_public_key) < 0){
iperf_err(test, "%s\n", ERR_error_string(ERR_get_error(), NULL));
i_errno = IESETCLIENTAUTH;
@ -1515,7 +1515,7 @@ iperf_parse_arguments(struct iperf_test *test, int argc, char **argv)
} else if (test->role == 'c' && rcv_timeout_flag && test->mode == SENDER){
i_errno = IERVRSONLYRCVTIMEOUT;
return -1;
} else if (test->role == 's' && (server_rsa_private_key || test->server_authorized_users) &&
} else if (test->role == 's' && (server_rsa_private_key || test->server_authorized_users) &&
!(server_rsa_private_key && test->server_authorized_users)) {
i_errno = IESETSERVERAUTH;
return -1;
@ -1544,7 +1544,7 @@ iperf_parse_arguments(struct iperf_test *test, int argc, char **argv)
else
blksize = DEFAULT_TCP_BLKSIZE;
}
if ((test->protocol->id != Pudp && blksize <= 0)
if ((test->protocol->id != Pudp && blksize <= 0)
|| blksize > MAX_BLOCKSIZE) {
i_errno = IEBLOCKSIZE;
return -1;
@ -1563,8 +1563,8 @@ iperf_parse_arguments(struct iperf_test *test, int argc, char **argv)
/* if no bytes or blocks specified, nor a duration_flag, and we have -F,
** get the file-size as the bytes count to be transferred
*/
if (test->settings->bytes == 0 &&
test->settings->blocks == 0 &&
if (test->settings->bytes == 0 &&
test->settings->blocks == 0 &&
! duration_flag &&
test->diskfile_name != (char*) 0 &&
test->role == 'c'
@ -1572,12 +1572,12 @@ iperf_parse_arguments(struct iperf_test *test, int argc, char **argv)
struct stat st;
if( stat(test->diskfile_name, &st) == 0 ){
iperf_size_t file_bytes = st.st_size;
test->settings->bytes = file_bytes;
test->settings->bytes = file_bytes;
if (test->debug)
printf("End condition set to file-size: %d bytes\n", test->settings->bytes);
}
// if failing to read file stat, it should fallback to default duration mode
}
}
if ((test->settings->bytes != 0 || test->settings->blocks != 0) && ! duration_flag)
test->duration = 0;
@ -1687,7 +1687,7 @@ iperf_check_total_rate(struct iperf_test *test, iperf_size_t last_interval_bytes
if (test->done || test->settings->bitrate_limit == 0) // Continue only if check should be done
return;
/* Add last inetrval's transferred bytes to the array */
if (++test->bitrate_limit_last_interval_index >= test->settings->bitrate_limit_stats_per_interval)
test->bitrate_limit_last_interval_index = 0;
@ -1697,7 +1697,7 @@ iperf_check_total_rate(struct iperf_test *test, iperf_size_t last_interval_bytes
test->bitrate_limit_stats_count += 1;
if (test->bitrate_limit_stats_count < test->settings->bitrate_limit_stats_per_interval)
return;
/* Calculating total bytes traffic to be averaged */
for (total_bytes = 0, i = 0; i < test->settings->bitrate_limit_stats_per_interval; i++) {
total_bytes += test->bitrate_limit_intervals_traffic_bytes[i];
@ -2062,7 +2062,7 @@ send_parameters(struct iperf_test *test)
i_errno = IESENDPARAMS;
return -1;
}
cJSON_AddStringToObject(j, "authtoken", test->settings->authtoken);
}
#endif // HAVE_SSL
@ -2595,7 +2595,7 @@ iperf_new_test()
i_errno = IENEWTEST;
return NULL;
}
memset(test->bitrate_limit_intervals_traffic_bytes, 0, sizeof(sizeof(iperf_size_t) * MAX_INTERVAL));
memset(test->bitrate_limit_intervals_traffic_bytes, 0, sizeof(sizeof(iperf_size_t) * MAX_INTERVAL));
/* By default all output goes to stdout */
test->outfile = stdout;
@ -2622,7 +2622,7 @@ protocol_new(void)
void
protocol_free(struct protocol *proto)
{
free(proto);
free(proto);
}
/**************************************************************************/
@ -2827,7 +2827,7 @@ iperf_free_test(struct iperf_test *test)
/* Free protocol list */
while (!SLIST_EMPTY(&test->protocols)) {
prot = SLIST_FIRST(&test->protocols);
SLIST_REMOVE_HEAD(&test->protocols, protocols);
SLIST_REMOVE_HEAD(&test->protocols, protocols);
free(prot);
}
@ -2929,7 +2929,7 @@ iperf_reset_test(struct iperf_test *test)
CPU_ZERO(&test->cpumask);
#endif /* HAVE_CPUSET_SETAFFINITY */
test->state = 0;
test->ctrl_sck = -1;
test->prot_listener = -1;
@ -2954,7 +2954,7 @@ iperf_reset_test(struct iperf_test *test)
FD_ZERO(&test->read_set);
FD_ZERO(&test->write_set);
test->num_streams = 1;
test->settings->socket_bufsize = 0;
test->settings->blksize = DEFAULT_TCP_BLKSIZE;
@ -3061,7 +3061,7 @@ iperf_stats_callback(struct iperf_test *test)
// Total bytes transferred this interval
total_interval_bytes_transferred += rp->bytes_sent_this_interval + rp->bytes_received_this_interval;
irp = TAILQ_LAST(&rp->interval_results, irlisthead);
/* result->end_time contains timestamp of previous interval */
if ( irp != NULL ) /* not the 1st interval */
@ -3086,7 +3086,7 @@ iperf_stats_callback(struct iperf_test *test)
if (temp.snd_cwnd > rp->stream_max_snd_cwnd) {
rp->stream_max_snd_cwnd = temp.snd_cwnd;
}
temp.snd_wnd = get_snd_wnd(&temp);
if (temp.snd_wnd > rp->stream_max_snd_wnd) {
rp->stream_max_snd_wnd = temp.snd_wnd;
@ -3843,8 +3843,8 @@ iperf_print_results(struct iperf_test *test)
/**
* Main report-printing callback.
* Prints results either during a test (interval report only) or
* after the entire test has been run (last interval report plus
* Prints results either during a test (interval report only) or
* after the entire test has been run (last interval report plus
* overall summary).
*/
void
@ -3861,7 +3861,7 @@ iperf_reporter_callback(struct iperf_test *test)
iperf_print_intermediate(test);
iperf_print_results(test);
break;
}
}
}
@ -3939,12 +3939,12 @@ print_interval_results(struct iperf_test *test, struct iperf_stream *sp, cJSON *
bandwidth = 0.0;
}
unit_snprintf(nbuf, UNIT_LEN, bandwidth, test->settings->unit_format);
iperf_time_diff(&sp->result->start_time, &irp->interval_start_time, &temp_time);
st = iperf_time_in_secs(&temp_time);
iperf_time_diff(&sp->result->start_time, &irp->interval_end_time, &temp_time);
et = iperf_time_in_secs(&temp_time);
if (test->protocol->id == Ptcp || test->protocol->id == Psctp) {
if (test->sender_has_retransmits == 1 && sp->sender) {
/* Interval, TCP with retransmits. */
@ -4052,7 +4052,7 @@ iperf_new_stream(struct iperf_test *test, int s, int sender)
memset(sp->result, 0, sizeof(struct iperf_stream_result));
TAILQ_INIT(&sp->result->interval_results);
/* Create and randomize the buffer */
sp->buffer_fd = mkstemp(template);
if (sp->buffer_fd == -1) {
@ -4246,20 +4246,20 @@ diskfile_send(struct iperf_stream *sp)
buffer_left += r;
rtot += r;
if (sp->test->debug) {
printf("read %d bytes from file, %d total\n", r, rtot);
printf("read %d bytes from file, %d total\n", r, rtot);
}
// If the buffer doesn't contain a full buffer at this point,
// adjust the size of the data to send.
if (buffer_left != sp->test->settings->blksize) {
if (sp->test->debug)
if (sp->test->debug)
printf("possible eof\n");
// setting data size to be sent,
// which is less than full block/buffer size
// setting data size to be sent,
// which is less than full block/buffer size
// (to be used by iperf_tcp_send, etc.)
sp->pending_size = buffer_left;
sp->pending_size = buffer_left;
}
// If there's no work left, we're done.
if (buffer_left == 0) {
sp->test->done = 1;
@ -4268,9 +4268,9 @@ diskfile_send(struct iperf_stream *sp)
}
}
// If there's no data left in the file or in the buffer, we're done.
// No more data available to be sent.
// Return without sending data to the network
// If there's no data left in the file or in the buffer, we're done.
// No more data available to be sent.
// Return without sending data to the network
if( sp->test->done || buffer_left == 0 ){
if (sp->test->debug)
printf("already done\n");
@ -4391,10 +4391,10 @@ iperf_create_pidfile(struct iperf_test *test)
}
}
}
/*
* File didn't exist, we couldn't read it, or it didn't correspond to
* a running process. Try to create it.
* File didn't exist, we couldn't read it, or it didn't correspond to
* a running process. Try to create it.
*/
fd = open(test->pidfile, O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR|S_IWUSR);
if (fd < 0) {

View File

@ -429,7 +429,7 @@ enum {
/* Stream errors */
IECREATESTREAM = 200, // Unable to create a new stream (check herror/perror)
IEINITSTREAM = 201, // Unable to initialize stream (check herror/perror)
IESTREAMLISTEN = 202, // Unable to start stream listener (check perror)
IESTREAMLISTEN = 202, // Unable to start stream listener (check perror)
IESTREAMCONNECT = 203, // Unable to connect stream (check herror/perror)
IESTREAMACCEPT = 204, // Unable to accepte stream connection (check perror)
IESTREAMWRITE = 205, // Unable to write to stream socket (check perror)

View File

@ -163,11 +163,11 @@ EVP_PKEY *load_pubkey_from_file(const char *file) {
if (file) {
key = BIO_new_file(file, "r");
pkey = PEM_read_bio_PUBKEY(key, NULL, NULL, NULL);
BIO_free(key);
}
return (pkey);
}
}
EVP_PKEY *load_pubkey_from_base64(const char *buffer) {
unsigned char *key = NULL;
@ -250,14 +250,14 @@ int encrypt_rsa_message(const char *plaintext, EVP_PKEY *public_key, unsigned ch
fprintf(stderr, "%s\n", ERR_error_string(ERR_get_error(), NULL));
}
return encryptedtext_len;
return encryptedtext_len;
}
int decrypt_rsa_message(const unsigned char *encryptedtext, const int encryptedtext_len, EVP_PKEY *private_key, unsigned char **plaintext) {
RSA *rsa = NULL;
unsigned char *rsa_buffer = NULL, pad = RSA_PKCS1_PADDING;
int plaintext_len, rsa_buffer_len, keysize;
rsa = EVP_PKEY_get1_RSA(private_key);
keysize = RSA_size(rsa);
@ -385,5 +385,3 @@ ssize_t iperf_getpass (char **lineptr, size_t *n, FILE *stream) {
return nread;
}

View File

@ -78,7 +78,7 @@ iperf_create_streams(struct iperf_test *test, int sender)
errno = saved_errno;
i_errno = IESETCONGESTION;
return -1;
}
}
}
{
socklen_t len = TCP_CA_NAME_MAX;
@ -172,7 +172,7 @@ create_client_timers(struct iperf_test * test)
i_errno = IEINITTEST;
return -1;
}
}
}
if (test->stats_interval != 0) {
test->stats_timer = tmr_create(&now, client_stats_timer_proc, cd, test->stats_interval * SEC_TO_US, 1);
if (test->stats_timer == NULL) {
@ -548,7 +548,7 @@ iperf_run_client(struct iperf_test * test)
}
}
if (result > 0) {
if (rcv_timeout_us > 0) {
iperf_time_now(&last_receive_time);

View File

@ -400,7 +400,7 @@ iperf_strerror(int int_errno)
perr = 1;
break;
case IESETCONGESTION:
snprintf(errstr, len, "unable to set TCP_CONGESTION: "
snprintf(errstr, len, "unable to set TCP_CONGESTION: "
"Supplied congestion control algorithm not supported on this host");
break;
case IEPIDFILE:

View File

@ -1,4 +1,4 @@
/*---------------------------------------------------------------
/*---------------------------------------------------------------
* iperf, Copyright (c) 2014-2021, The Regents of the University of
* California, through Lawrence Berkeley National Laboratory (subject
* to receipt of any required approvals from the U.S. Dept. of
@ -27,49 +27,49 @@
* Based on code that is:
*
* Copyright (c) 1999,2000,2001,2002,2003
* The Board of Trustees of the University of Illinois
* All Rights Reserved.
*---------------------------------------------------------------
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software (Iperf) and associated
* documentation files (the "Software"), to deal in the Software
* without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute,
* sublicense, and/or sell copies of the Software, and to permit
* The Board of Trustees of the University of Illinois
* All Rights Reserved.
*---------------------------------------------------------------
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software (Iperf) and associated
* documentation files (the "Software"), to deal in the Software
* without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute,
* sublicense, and/or sell copies of the Software, and to permit
* persons to whom the Software is furnished to do
* so, subject to the following conditions:
* so, subject to the following conditions:
*
*
* Redistributions of source code must retain the above
* copyright notice, this list of conditions and
* the following disclaimers.
*
*
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimers in the documentation and/or other materials
* provided with the distribution.
*
*
* Neither the names of the University of Illinois, NCSA,
* nor the names of its contributors may be used to endorse
* Redistributions of source code must retain the above
* copyright notice, this list of conditions and
* the following disclaimers.
*
*
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimers in the documentation and/or other materials
* provided with the distribution.
*
*
* Neither the names of the University of Illinois, NCSA,
* nor the names of its contributors may be used to endorse
* or promote products derived from this Software without
* specific prior written permission.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS