* Untangle some problems with printing summary statistics.
There were (at least) two problems:
o The server cannot print summary statistics as seen from the
client, because the server has to generate its summaries
before receiving any statistics from the client. This
shortcoming is somewhat hard-coded into the semantics of
messages on the control channel, and probably can't be easily
changed.
o UDP summary statistics for each stream were ambiguous in that
it wasn't clear whether they were intended to apply to the
sender or receiver.
To fix this, we split UDP summary statistics into two lines,
one for the sender side and one for the receiver side. This
hopefully eliminates any ambiguity about the statistics. On the
server, we don't attempt to print the (not very meaningful and
potentially misleading) statistics corresponding to the client.
Possible fix for #560.
* Try to report more accurate ending statistics.
Basically the client side was using only its measured test duration
to compute figures such as bitrate, but the server's test duration
could be different due to network delays/jitter. So we make sure
that the test durations (for each stream) are passed in the test
results and used appropriately when we print statistics for the
sender and receiver.
Towards #560, also this could help towards #238.
* Silence a warning over an uninitialized variable.
Basically the client side was using only its measured test duration
to compute figures such as bitrate, but the server's test duration
could be different due to network delays/jitter. So we make sure
that the test durations (for each stream) are passed in the test
results and used appropriately when we print statistics for the
sender and receiver.
Towards #560, also this could help towards #238.
There were (at least) two problems:
o The server cannot print summary statistics as seen from the
client, because the server has to generate its summaries
before receiving any statistics from the client. This
shortcoming is somewhat hard-coded into the semantics of
messages on the control channel, and probably can't be easily
changed.
o UDP summary statistics for each stream were ambiguous in that
it wasn't clear whether they were intended to apply to the
sender or receiver.
To fix this, we split UDP summary statistics into two lines,
one for the sender side and one for the receiver side. This
hopefully eliminates any ambiguity about the statistics. On the
server, we don't attempt to print the (not very meaningful and
potentially misleading) statistics corresponding to the client.
Possible fix for #560.
On FreeBSD, unlike Linux (and NetBSD?) snd_cwnd is expressed in
octets instead of segments. Hilarity ensued when we erroneously
multiplied by snd_mss and integer overflows occureed.
Possible fix for #465, #475, #338. Testing from FreeBSD users
appreciated.
* fix Wstrict-prototypes warnings found by clang
also fix usage_long() call
Signed-off-by: Gabriel Ganne <gabriel.ganne@enea.com>
* fix Wunreachable-code-break warnings found by clang
Signed-off-by: Gabriel Ganne <gabriel.ganne@enea.com>
* fix Wshadow warnings found by clang
Signed-off-by: Gabriel Ganne <gabriel.ganne@enea.com>
* fix Wmissing-noreturn warning found by clang
Signed-off-by: Gabriel Ganne <gabriel.ganne@enea.com>
* ix memory leak found by clang
Signed-off-by: Gabriel Ganne <gabriel.ganne@enea.com>
* fix Wmisleading-indentation warnings raised by gcc-6
Signed-off-by: Gabriel Ganne <gabriel.ganne@enea.com>
* fix warning: Value stored to 'ptr' during its initialization is never read found by clang
Signed-off-by: Gabriel Ganne <gabriel.ganne@enea.com>
* fix warning: The left operand of '>' is a garbage value found by clang
Signed-off-by: Gabriel Ganne <gabriel.ganne@enea.com>
* fix memory leak in global cleanup
Signed-off-by: Gabriel Ganne <gabriel.ganne@enea.com>
Add an optional mode that requires clients to authenticate with the server.
In this mode, clients need to provide a username and a password, which are checked against a password file on the server. The authentication credentials are protected by an RSA public keypair...the encrypted credentials are sent along with the test parameters.
Operationally the use of this feature places the following additional requirements on the build and installation of iperf3:
o The presence of the OpenSSL headers and libraries to build iperf3, and the libraries available on the client and server at runtime.
o Generation of an RSA public keypair; the private part is used by the server and the public part must be distributed to the clients.
o Username/password pairs for all authorized users, to be stored in a file on the server.
o Loose time synchronization between the server and clients (to within approximately 30 seconds).
o Appropriate command-line flags given on the client and server.
Note that iperf3 can be built and run as before, without fulfilling any of these requirements.
Partial documentation for this feature is included in this commit. It is anticipated that additional documentation text and editing will follow this merge.
Submitted by @ralcini. First suggested by @codyhanson in pull request #242.
Change the internal command-line option code for --dscp from the literal
'5' to a constant defined as OPT_DSCP.
Add manpage text for --dscp option.
Tweak help text for --dscp (while here, fix problem in --tos text).
Using a command line adding dscp (instead of tos) you can:
--dscp EF,CS1,etc.
--dscp 0x08
--dscp 63
These will provide the correct shifted left 2 tos value for these, and
for people that think in terms of dscp values, this is a goodness.
Having this option available lets an enduser clearly distinguish between
an old version of iperf with a non-working --tos facility, vs a
version where it works, with something saner that lets just specify
the dscp.
I did not come up with a good -? option for it, and used -5 internally.
algorithm isn't available on the server. This can happen
if the client and server machines have different sets of
congestion control algorithms loaded in kernel modules, etc.
If the requested algorithm isn't available on the server, then
print a warning on the server side, but otherwise continue to
run the test.
Towards #549.
This is an attempt to avoid server-side crashes/exits when the
client abruptly closes its control connection, as found in some
testing for #549.
Fixes#550.
* Include stdint.h in files where its types are used
Signed-off-by: Moritz Kick <f1rebird@users.noreply.github.com>
* Fix type of len parameter passed to getsockopt
getsockopt expects socklen_t instead of int as its fifth argument
Signed-off-by: Moritz Kick <f1rebird@users.noreply.github.com>
* Remove unnecassary includes of netinet/tcp.h
also cleanup the second include of stdint.h in main.c
This commit fixes#331 and is a replacement for #344.
Signed-off-by: Moritz Kick <f1rebird@users.noreply.github.com>
* Remove unused hstrerror(), bad nanosleep() message in configure.ac (#503)
* Remove dead code involving h_errno and hstrerror()
h_errno was formerly set as a side effect of a failed
gethostbyname(3) call, but this function has been
deprecated.
This change is preparatory to removing known issues from the
README file. In place of duplicate text, we'll put a pointer to a
single SOT for this information.