aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2017-05-12Grab TCP PMTU during tests (on Linux only). Towards #569. (#578)Bruce A. Mah
2017-05-12Don't free memory in uninitialized structuresBruce A. Mah
Also, tighten up the scope/lifetime of some memory structures. Inspired by #577.
2017-05-11Bunch of reporting fixes found while investigating bug #236. (#575)Bruce A. Mah
For the case of multiple TCP streams, compute the grand total summaries using the appropriate times for the sender and receiver ends. Add some divide-by-zero checks. On the server side, only print the side of the grand total lines where we have data. (This follows the behavior of the other end-of-test output lines.) Fix a minor (compared to all the other problems) bug with UDP output printing the wrong ending timestamp.
2017-05-11Print the cJSON version in our version info.Bruce A. Mah
2017-05-11Fix NaN in summaries with a client talking to an iperf 3.1/3.0 server.Bruce A. Mah
Recent code changes require the server to send the start and end timestamps for a test, so that the client can accurately compute statistics for the sender side of a test. iperf 3.1 and 3.0 servers won't do this, so if this information isn't passed back in the results at the end of a test, we fall back to using the client's timestamps. The results might not match what's displayed on the server, but this is basically what iperf 3.1 and earlier did anyway. Fixes #574.
2017-05-11Import cjson 1.5.2 (#573)Bruce A. Mah
* Import source files for cJSON 1.5.2. * Portability and 64-bit changes for cJSON.
2017-05-09Fix problems in human-readable UDP outputBruce A. Mah
Keep track of UDP packets sent/received and use appropriately. We were using the number of UDP packets seen on the server (regardless of whether it was the sender or receiver) for computing loss percentages, etc. This caused confusion in the case that the last UDP packet doesn't make it to the server before the test finishes (or if a packet gets lost), because the client and server had different ideas of how many packets were sent (OK) and we used the wrong number when computing statistics. This fix changes the human-readable output to make more sense. It doesn't change the JSON output. That needs some more review. I'm reluctant to make structural changes to the JSON output, because other programs rely on that format. We also need to investigate whether the last UDP packet can be still in flight when the test ends (per hypothesis), and if so what we should do about this. We apply similar fixes for human-readable summaries for multi-stream UDP tests. The fixes are similar to those already done for the stream summary statistics, but these cover a type of output that's only done if there is more than one stream. Adjust the JSON computations / output to do a better job of figuring out the total number of packets sent. We really need to disentangle the computation and output formatting, these two operations shouldn't be mixed together like this. Fixes #252.
2017-05-08Improve error handling and documentation for -f/--format. (#568)Bruce A. Mah
We now reject all invalid format characters given as the argument to the -f/--format flag. All valid characters are now documented in the usage message and manual page. Towards #566.
2017-05-05Improve / fix comments regarding UDP jitter calculation.Bruce A. Mah
Internal documentation fix only, no functional change.
2017-05-04Fix a heap corruption issue leading to a server-side crash. (#564)Bruce A. Mah
Commit 5ab2132c (PR #551) fixed, among other things, a memory leak. The solution, however, causes a hazard where a free() of an invalid pointer can corrupt the heap. We've observed this fairly repeatably while running the test_commands.sh script on CentOS 7. To remedy this, we NULL out a pointer after the object it pointed to has been free-d, just like a number of other similar objects.
2017-05-04IRIX 6.5 compatibility, via a patch from @canavan in #368.Bruce A. Mah
Not independently tested.
2017-05-03Pacing timer (#563)Bruce A. Mah
* Add --pacing-timer option to allow tuning of -b timers. These control the granularity of the timer and hence burstiness of iperf3's sends. The default is 1ms (1000), which is the default starting with iperf 3.2. Follow-on to the commit in #460. * Update manpage and release notes for --pacing-timer.
2017-05-03Normalize socket buffer debugging output, put socket buffer sizes in JSON.Bruce A. Mah
These values show up in the start structure as sock_bufsize (requested size), sndbuf_actual (actual SO_SNDBUF value) and rcvbuf_actual (actual SO_RCVBUF value). These values are available for both TCP and UDP. Both client and server emit these values in their JSON output for their respective sides, but don't exchange them. Towards #558.
2017-05-03Remove some dead code.Bruce A. Mah
2017-05-03Fix various problems with summary statistics (#562)Bruce A. Mah
* 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.
2017-05-02Fix possible integer overflow in tera prefix conversions.Bruce A. Mah
Follow-on commit for #402, possible fix for #561.
2017-05-01Fix bug introduced in 03224c9 where we fail on default UDP blocksize.Bruce A. Mah
Fixes #559, follow up to #390..
2017-04-27Print TOS byte value.Bruce A. Mah
It's at the start of the test output for human-readable output, and in the test_start object in the JSON. Fixes #226.
2017-04-27Do sanity checks on -w argument as floating point to avoid integerBruce A. Mah
overflows. There might be some other places where this applies, but this commit at least fixes the observed bug. Fixes #557.
2017-04-26fix invalid sizeof on pointer instead of type (#556)Gabriel Ganne
This is only a coherency fix since sizeof(char*) >> sizeof(char) There should be no functional nor stability impact whatsoever
2017-04-22Fix a problem when getting snd_cwnd on FreeBSD.Bruce A. Mah
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.
2017-04-20Manpage fixups. Follow-up to #517.Bruce A. Mah
2017-04-20Merge branch 'master' of git://github.com/dmdailey/iperf into dmdailey-masterBruce A. Mah
2017-04-20warning fixes (#551)Gabriel Ganne
* 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>
2017-04-20Regen.Bruce A. Mah
2017-04-20Fix some help text. Add authentication as a feature in --version.Bruce A. Mah
Follow-up to #517.
2017-04-20fix missing source files in src/Makefile.am (#554)asavah
Follow-up fix for #517.
2017-04-20Service Authentication (#517)ralcini
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.
2017-04-14Minor follow-ups to #508.Bruce A. Mah
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).
2017-04-14Regen, follow up to #508.Bruce A. Mah
2017-04-14add support for specifying --dscp symbolically and numerically (#508)Dave Täht
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.
2017-04-14Add support for tera- prefix [Tt] in input and output.Bruce A. Mah
Also add some more unit tests for this and prune unused code from unit test program. Fixes #402.
2017-04-14Make explicitly requested usage output (--help) go to stdout.Bruce A. Mah
Also in this case make the process exit code 0. Fixes #405.
2017-04-14Be more explicit about the direction of data during tests.Bruce A. Mah
Documentation change only, no functional change. Fixes #384.
2017-04-11More gracefully handle the case where a congestion controlBruce A. Mah
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.
2017-04-11Ignore SIGPIPE signals to simplify error handling.Bruce A. Mah
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.
2017-04-11Prevent specifying a UDP send size that's too small.Bruce A. Mah
We need at least 16 bytes to hold counters and timestamps. Avoids a problem noted in issue #390.
2017-03-30add tcp rttvar to stream info (#534)Tran Viet Hoang
Fixes #525.
2017-03-30Fix divide-by-zero / weird output with -F and a zero-length file.Bruce A. Mah
Fixes #361.
2017-03-22Fix header includes and build failures on musl (#518)f1rebird
* 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>
2017-03-17Change "iperf" to "iperf3" in usage strings. Fixes #529.Bruce A. Mah
2017-03-13Remove unused hstrerror(), bad nanosleep() message in configure.ac (#503) (#523)ShaunCurrier
* 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.
2017-02-02Prevent two recently added messages from spamming JSON output on UDP tests.Bruce A. Mah
Stumbled on by: @daldoyle
2017-01-25Fix a bug where specifying --title leaked into server JSON in future runs.Bruce A. Mah
Fixes #500, based on pull request in #501 submitted by @slankes.
2017-01-25Revert "Fail gracefully if --fq-rate or --no-fq-socket-pacing are specified on"Bruce A. Mah
This reverts commit 9c83a707eb0454994a7d42356981ff3ccd93c7a9. Fixes #504.
2017-01-11Add 1KB to default UDP socket buffer sizes under certain circumstances.Bruce A. Mah
This fixes a problem observed on FreeBSD and macOS where the MTU on the loopback interface is larger than the default socket buffer size. We adjusted the socket buffer size upwards to match the UDP payload size, but that's apparently not enough and we ended up dropping packets. This is bad. Add a 1KB fudge factor, which seesm to avoid this problem. Affects UDP tests only, not TCP or SCTP. Part of #496. (cherry picked from commit d76198944d210e8a575747d3ddbee41a886a10c9) Signed-off-by: Bruce A. Mah <bmah@es.net>
2017-01-10Issue 496 (#498)Bruce A. Mah
* Dynamically determine an appropriate default UDP send size. We use the TCP MSS for the control connection as the default UDP sending length, if the --length parameter is not specified for a UDP test. This computation replaces the former hard-coded 8K default, which was way too large for non-jumbo-frame Ethernet networks. The concept for this solution was adapted from nuttcp. The iperf3 implementation is pretty easy since we already were getting the MSS for the control connection anyway (although we needed to get it slightly earlier in the setup process to be useful). Towards issue #496. While here, s/int/socklen_t/ in one place to fix a compile warning, and bump a few copyright dates. * Warn if doing a UDP test and the socket buffer isn't big enough. This is surprisingly an issue on FreeBSD and macOS, where the MTU over the loopback interface is actually larger than the default UDP socket buffer size. In these cases, doing a UDP test over the loopback interface (with the new UDP defaults) will fail unless a smaller --length or a larger --window size is set explicitly. Linux has larger UDP socket buffers by default (much larger than the largest possible MTU), but even in the case that the socket buffers are too small to hold an MTU-sized send, the kernel seems to do the send correctly anyway. Still working towards a good solution for issue #496. * Further refinement on UDP buffer size settings. If the default buffer size on a UDP test can't hold a packet, then increase the buffer size to be large enough to hold one packet payload. (If the buffer size was explicitly set, but too small to hold a packet payload, then warn but don't change the buffer size.) Minor code refactoring to...factor out some common code into a new iperf_udp_buffercheck() function. Still working towards issue #496.
2016-12-14Fail gracefully if --fq-rate or --no-fq-socket-pacing are specified onBruce A. Mah
platforms where they aren't supported. Requested by: @bltierney
2016-12-12Separate out application-level and fair-queueing-based pacing (#488)Bruce A. Mah
* First try to fix pacing issues. Code compiles, lightly run-tested. Make --bandwidth only control application-level pacing, refecting behavior of iperf 3.1.2 and earlier. Add a new --fq-rate that controls only FQ-based per-socket pacing. A given test can use application-level pacing, FQ pacing, both, or neither. Deprecate the --no-fq-socket-pacing option; specifying this generates a warning and is equivalent to --fq-rate=0. Towards issue #467 and related to issue #325. * Move --fq-rate in the help text to be just below --b, tweak wording. * Sigh. One more tweak on help text. Some day I probably need to review and rewrite the whole thing. Still working towards #467.
2016-12-08Revert "Fix a bug in FQ pacing, where application pacing wasn't completely ↵Bruce A. Mah
disabled." This reverts commit 1fa41308fe0da6bd6e00902d587dc7ffb1fc2a30. This doesn't really do what we want. Start over.