trim excess whitespace
This commit is contained in:
parent
50d6cce65c
commit
e919e8c21b
@ -6,7 +6,7 @@ os:
|
|||||||
- linux
|
- linux
|
||||||
- osx
|
- osx
|
||||||
- freebsd
|
- freebsd
|
||||||
|
|
||||||
notifications:
|
notifications:
|
||||||
slack:
|
slack:
|
||||||
secure: ImUmX7hcYotHWCDBfOcIvF6H7kkeGqiaUCy7SVPFtgPbz33ttpbRd94E7oxWVmZMLKb+i6+JCujTEWGwGBimzH+DjL0LLWs0ShzXZIUa1UzEPTc4hgV6VAxucYKFg2WrbXgOPWbulkMG1VZ6pX7GlAEGf0qyNqn44F7S2ay9m18=
|
secure: ImUmX7hcYotHWCDBfOcIvF6H7kkeGqiaUCy7SVPFtgPbz33ttpbRd94E7oxWVmZMLKb+i6+JCujTEWGwGBimzH+DjL0LLWs0ShzXZIUa1UzEPTc4hgV6VAxucYKFg2WrbXgOPWbulkMG1VZ6pX7GlAEGf0qyNqn44F7S2ay9m18=
|
||||||
|
@ -60,7 +60,7 @@ Invoking iperf3
|
|||||||
iperf3 includes a manual page listing all of the command-line options.
|
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.
|
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/
|
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
|
-r, --tradeoff Do a bidirectional test individually
|
||||||
-T, --ttl time-to-live, for multicast (default 1)
|
-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
|
S(settings) V(server) reports
|
||||||
-y, --reportstyle C report as a Comma-Separated Values
|
-y, --reportstyle C report as a Comma-Separated Values
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# sample Gnuplot command file for iperf3 results
|
# sample Gnuplot command file for iperf3 results
|
||||||
set term x11
|
set term x11
|
||||||
#set term png
|
#set term png
|
||||||
#set term postscript landscape color
|
#set term postscript landscape color
|
||||||
set key width -12
|
set key width -12
|
||||||
|
|
||||||
@ -19,11 +19,11 @@ set grid linewidth 1
|
|||||||
set title "TCP performance: 40G to 10G host"
|
set title "TCP performance: 40G to 10G host"
|
||||||
set xlabel "time (seconds)"
|
set xlabel "time (seconds)"
|
||||||
set ylabel "Bandwidth (Gbits/second)"
|
set ylabel "Bandwidth (Gbits/second)"
|
||||||
set xrange [0:60]
|
set xrange [0:60]
|
||||||
set yrange [0:15]
|
set yrange [0:15]
|
||||||
set ytics nomirror
|
set ytics nomirror
|
||||||
set y2tics
|
set y2tics
|
||||||
set y2range [0:2500]
|
set y2range [0:2500]
|
||||||
# dont plot when retransmits = 0
|
# dont plot when retransmits = 0
|
||||||
set datafile missing '0'
|
set datafile missing '0'
|
||||||
set pointsize 1.6
|
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, \
|
#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
|
# "iperf3.new.dat" using 1:3 title '4.2 kernel' with linespoints lw 3 pt 7
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@ State of the iperf3 World, as seen from ESnet...
|
|||||||
------------------------------------------------
|
------------------------------------------------
|
||||||
|
|
||||||
iperf3 was originally written to be a "better", more maintainable
|
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).
|
requirements for the perfSONAR project (http://www.perfsonar.net).
|
||||||
|
|
||||||
In the past few years, iperf2 development has been restarted by Bob
|
In the past few years, iperf2 development has been restarted by Bob
|
||||||
|
@ -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
|
By default, the ``libiperf`` library is built in both shared and
|
||||||
static forms. Either can be suppressed by using the
|
static forms. Either can be suppressed by using the
|
||||||
``--disabled-shared`` or ``--disable-static`` configure-time options.
|
``--disabled-shared`` or ``--disable-static`` configure-time options.
|
||||||
|
|
||||||
|
10
docs/dev.rst
10
docs/dev.rst
@ -25,7 +25,7 @@ Bug Reports
|
|||||||
-----------
|
-----------
|
||||||
|
|
||||||
Before submitting a bug report, try checking out the latest version of
|
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:
|
Then submit to the iperf3 issue tracker on GitHub:
|
||||||
|
|
||||||
https://github.com/esnet/iperf/issues
|
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
|
-T, --title str prefix every output line with this string
|
||||||
-F, --file name xmit/recv the specified file
|
-F, --file name xmit/recv the specified file
|
||||||
-A, --affinity n/n,m set CPU affinity (Linux and FreeBSD only)
|
-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)
|
of -t or -n)
|
||||||
-L, --flowlabel set IPv6 flow label (Linux only)
|
-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
|
-d, --dualtest Do a bidirectional test simultaneously
|
||||||
-r, --tradeoff Do a bidirectional test individually
|
-r, --tradeoff Do a bidirectional test individually
|
||||||
-T, --ttl time-to-live, for multicast (default 1)
|
-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
|
S(settings) V(server) reports
|
||||||
-y, --reportstyle C report as a Comma-Separated Values
|
-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
|
7. For extra points, actually try downloading, compiling, and
|
||||||
smoke-testing the results of the tarball on all supported
|
smoke-testing the results of the tarball on all supported
|
||||||
platforms.
|
platforms.
|
||||||
|
|
||||||
8. Plug the SHA256 checksum into the release announcement.
|
8. Plug the SHA256 checksum into the release announcement.
|
||||||
|
|
||||||
9. PGP-sign the release announcement text using ``gpg --clearsign``.
|
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,
|
The main authors of iperf3 are (in alphabetical order): Jon Dugan,
|
||||||
Seth Elliott, Bruce A. Mah, Jeff Poskanzer, Kaustubh Prabhu.
|
Seth Elliott, Bruce A. Mah, Jeff Poskanzer, Kaustubh Prabhu.
|
||||||
Additional code contributions have come from (also in alphabetical
|
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.
|
Bruce Simpson, Brian Tierney.
|
||||||
|
|
||||||
iperf3 contains some original code from iperf2. The authors of iperf2
|
iperf3 contains some original code from iperf2. The authors of iperf2
|
||||||
|
24
docs/faq.rst
24
docs/faq.rst
@ -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
|
threaded, and not worry about backwards compatibility with
|
||||||
iperf2. Many of the feature requests for iperf3 came from the
|
iperf2. Many of the feature requests for iperf3 came from the
|
||||||
perfSONAR project (http://www.perfsonar.net).
|
perfSONAR project (http://www.perfsonar.net).
|
||||||
|
|
||||||
Then in 2014, Bob (Robert) McMahon from Broadcom restarted
|
Then in 2014, Bob (Robert) McMahon from Broadcom restarted
|
||||||
development of iperf2 (See
|
development of iperf2 (See
|
||||||
https://sourceforge.net/projects/iperf2/). He fixed many of the
|
https://sourceforge.net/projects/iperf2/). He fixed many of the
|
||||||
problems with iperf2, and added a number of new features similar to
|
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
|
current development is focused is on using UDP for latency testing, as well
|
||||||
as broad platform support.
|
as broad platform support.
|
||||||
|
|
||||||
As of this writing (2017), both iperf2 and iperf3 are being actively
|
As of this writing (2017), both iperf2 and iperf3 are being actively
|
||||||
(although independently) developed. We recommend being familiar with
|
(although independently) developed. We recommend being familiar with
|
||||||
both tools, and use whichever tool’s features best match your needs.
|
both tools, and use whichever tool’s features best match your needs.
|
||||||
|
|
||||||
A feature comparison of iperf2, iperf3, and nuttcp is available at:
|
A feature comparison of iperf2, iperf3, and nuttcp is available at:
|
||||||
https://fasterdata.es.net/performance-testing/network-troubleshooting-tools/throughput-tool-comparision/
|
https://fasterdata.es.net/performance-testing/network-troubleshooting-tools/throughput-tool-comparision/
|
||||||
|
|
||||||
iperf3 parallel stream performance is much less than iperf2. Why?
|
iperf3 parallel stream performance is much less than iperf2. Why?
|
||||||
iperf3 is single threaded, and iperf2 is multi-threaded. We
|
iperf3 is single threaded, and iperf2 is multi-threaded. We
|
||||||
recommend using iperf2 for parallel streams.
|
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/>`_.
|
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/>`_.
|
||||||
|
|
||||||
I’m trying to use iperf3 on Windows, but having trouble. What should I do?
|
I’m trying to use iperf3 on Windows, but having trouble. What should I do?
|
||||||
iperf3 is not officially supported on Windows, but iperf2 is. We
|
iperf3 is not officially supported on Windows, but iperf2 is. We
|
||||||
recommend you use iperf2.
|
recommend you use iperf2.
|
||||||
@ -41,7 +41,7 @@ I’m 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
|
Some people are using Cygwin to run iperf3 in Windows, but not all
|
||||||
options will work. Some community-provided binaries of iperf3 for
|
options will work. Some community-provided binaries of iperf3 for
|
||||||
Windows exist.
|
Windows exist.
|
||||||
|
|
||||||
How can I build a statically-linked executable of iperf3?
|
How can I build a statically-linked executable of iperf3?
|
||||||
There are a number of reasons for building an iperf3 executable with
|
There are a number of reasons for building an iperf3 executable with
|
||||||
no dependencies on any shared libraries. Unfortunately this isn't
|
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
|
issue with the default UDP send size that was fixed in
|
||||||
3.1.5. Second, try adding the flag ``-w2M`` to increase the socket
|
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.
|
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?
|
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``.
|
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?
|
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
|
A drop in throughput to almost zero, except maybe for the first
|
||||||
reported interval(s), may be related to problems in NIC TCP Offload,
|
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
|
On Linux, run this command to see the available congestion control
|
||||||
algorithms (note that some algorithms are packaged as kernel
|
algorithms (note that some algorithms are packaged as kernel
|
||||||
modules, which must be loaded before they can be used)::
|
modules, which must be loaded before they can be used)::
|
||||||
|
|
||||||
/sbin/sysctl net.ipv4.tcp_available_congestion_control
|
/sbin/sysctl net.ipv4.tcp_available_congestion_control
|
||||||
|
|
||||||
On FreeBSD, the equivalent command is::
|
On FreeBSD, the equivalent command is::
|
||||||
|
|
||||||
/sbin/sysctl net.inet.tcp.cc.available
|
/sbin/sysctl net.inet.tcp.cc.available
|
||||||
|
|
||||||
I’m using the ``--logfile`` option. How do I see file output in real time?
|
I’m using the ``--logfile`` option. How do I see file output in real time?
|
||||||
Use the ``--forceflush`` flag.
|
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
|
We discourage the use of the iperf3 issue tracker on GitHub for
|
||||||
support questions. Actual bug reports, enhancement requests, or
|
support questions. Actual bug reports, enhancement requests, or
|
||||||
pull requests are encouraged, however.
|
pull requests are encouraged, however.
|
||||||
|
|
||||||
|
|
||||||
|
@ -68,4 +68,3 @@ Indices and tables
|
|||||||
* :ref:`genindex`
|
* :ref:`genindex`
|
||||||
* :ref:`modindex`
|
* :ref:`modindex`
|
||||||
* :ref:`search`
|
* :ref:`search`
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@ Invoking iperf3
|
|||||||
iperf3 includes a manual page listing all of the command-line options.
|
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.
|
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/
|
https://fasterdata.es.net/performance-testing/network-troubleshooting-tools/iperf/
|
||||||
|
|
||||||
@ -28,72 +28,72 @@ the executable.
|
|||||||
::
|
::
|
||||||
|
|
||||||
IPERF3(1) User Manuals IPERF3(1)
|
IPERF3(1) User Manuals IPERF3(1)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
NAME
|
NAME
|
||||||
iperf3 - perform network throughput tests
|
iperf3 - perform network throughput tests
|
||||||
|
|
||||||
SYNOPSIS
|
SYNOPSIS
|
||||||
iperf3 -s [ options ]
|
iperf3 -s [ options ]
|
||||||
iperf3 -c server [ options ]
|
iperf3 -c server [ options ]
|
||||||
|
|
||||||
|
|
||||||
DESCRIPTION
|
DESCRIPTION
|
||||||
iperf3 is a tool for performing network throughput measurements. It
|
iperf3 is a tool for performing network throughput measurements. It
|
||||||
can test TCP, UDP, or SCTP throughput. To perform an iperf3 test the
|
can test TCP, UDP, or SCTP throughput. To perform an iperf3 test the
|
||||||
user must establish both a server and a client.
|
user must establish both a server and a client.
|
||||||
|
|
||||||
The iperf3 executable contains both client and server functionality.
|
The iperf3 executable contains both client and server functionality.
|
||||||
An iperf3 server can be started using either of the -s or --server com-
|
An iperf3 server can be started using either of the -s or --server com-
|
||||||
mand-line parameters, for example:
|
mand-line parameters, for example:
|
||||||
|
|
||||||
iperf3 -s
|
iperf3 -s
|
||||||
|
|
||||||
iperf3 --server
|
iperf3 --server
|
||||||
|
|
||||||
Note that many iperf3 parameters have both short (-s) and long
|
Note that many iperf3 parameters have both short (-s) and long
|
||||||
(--server) forms. In this section we will generally use the short form
|
(--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-
|
of command-line flags, unless only the long form of a flag is avail-
|
||||||
able.
|
able.
|
||||||
|
|
||||||
By default, the iperf3 server listens on TCP port 5201 for connections
|
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
|
from an iperf3 client. A custom port can be specified by using the -p
|
||||||
flag, for example:
|
flag, for example:
|
||||||
|
|
||||||
iperf3 -s -p 5002
|
iperf3 -s -p 5002
|
||||||
|
|
||||||
After the server is started, it will listen for connections from iperf3
|
After the server is started, it will listen for connections from iperf3
|
||||||
clients (in other words, the iperf3 program run in client mode). The
|
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
|
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-
|
requires a host to which iperf3 should connect. The host can by speci-
|
||||||
fied by hostname, IPv4 literal, or IPv6 literal:
|
fied by hostname, IPv4 literal, or IPv6 literal:
|
||||||
|
|
||||||
iperf3 -c iperf3.example.com
|
iperf3 -c iperf3.example.com
|
||||||
|
|
||||||
iperf3 -c 192.0.2.1
|
iperf3 -c 192.0.2.1
|
||||||
|
|
||||||
iperf3 -c 2001:db8::1
|
iperf3 -c 2001:db8::1
|
||||||
|
|
||||||
If the iperf3 server is running on a non-default TCP port, that port
|
If the iperf3 server is running on a non-default TCP port, that port
|
||||||
number needs to be specified on the client as well:
|
number needs to be specified on the client as well:
|
||||||
|
|
||||||
iperf3 -c iperf3.example.com -p 5002
|
iperf3 -c iperf3.example.com -p 5002
|
||||||
|
|
||||||
The initial TCP connection is used to exchange test parameters, control
|
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
|
the start and end of the test, and to exchange test results. This is
|
||||||
sometimes referred to as the "control connection". The actual test
|
sometimes referred to as the "control connection". The actual test
|
||||||
data is sent over a separate TCP connection, as a separate flow of UDP
|
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-
|
packets, or as an independent SCTP connection, depending on what proto-
|
||||||
col was specified by the client.
|
col was specified by the client.
|
||||||
|
|
||||||
Normally, the test data is sent from the client to the server, and mea-
|
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
|
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.
|
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.
|
This causes data to be sent from the server to the client.
|
||||||
|
|
||||||
iperf3 -c iperf3.example.com -p 5202 -R
|
iperf3 -c iperf3.example.com -p 5202 -R
|
||||||
|
|
||||||
Results are displayed on both the client and server. There will be at
|
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-
|
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
|
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
|
measurement interval are taken from the point of view of the endpoint
|
||||||
process emitting that output (in other words, the output on the client
|
process emitting that output (in other words, the output on the client
|
||||||
shows the measurement interval data for 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
|
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
|
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 receiver, with lines tagged accordingly. Recall that by default
|
||||||
the client is the sender and the server is the receiver, although as
|
the client is the sender and the server is the receiver, although as
|
||||||
indicated above, use of the -R flag will reverse these roles.
|
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
|
The client can be made to retrieve the server-side output for a given
|
||||||
test by specifying the --get-server-output flag.
|
test by specifying the --get-server-output flag.
|
||||||
|
|
||||||
Either the client or the server can produce its output in a JSON struc-
|
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
|
ture, useful for integration with other programs, by passing it the -J
|
||||||
flag. Because the contents of the JSON structure are only competely
|
flag. Because the contents of the JSON structure are only competely
|
||||||
known after the test has finished, no JSON output will be emitted until
|
known after the test has finished, no JSON output will be emitted until
|
||||||
the end of the test.
|
the end of the test.
|
||||||
|
|
||||||
iperf3 has a (overly) large set of command-line options that can be
|
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
|
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
|
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
|
iperf3's help output, which can be viewed by running iperf3 with the -h
|
||||||
flag.
|
flag.
|
||||||
|
|
||||||
GENERAL OPTIONS
|
GENERAL OPTIONS
|
||||||
-p, --port n
|
-p, --port n
|
||||||
set server port to listen on/connect to to n (default 5201)
|
set server port to listen on/connect to to n (default 5201)
|
||||||
|
|
||||||
-f, --format
|
-f, --format
|
||||||
[kmgtKMGT] format to report: Kbits/Mbits/Gbits/Tbits
|
[kmgtKMGT] format to report: Kbits/Mbits/Gbits/Tbits
|
||||||
|
|
||||||
-i, --interval n
|
-i, --interval n
|
||||||
pause n seconds between periodic throughput reports; default is
|
pause n seconds between periodic throughput reports; default is
|
||||||
1, use 0 to disable
|
1, use 0 to disable
|
||||||
|
|
||||||
-I, --pidfile file
|
-I, --pidfile file
|
||||||
write a file with the process ID, most useful when running as a
|
write a file with the process ID, most useful when running as a
|
||||||
daemon.
|
daemon.
|
||||||
|
|
||||||
-F, --file name
|
-F, --file name
|
||||||
Use a file as the source (on the sender) or sink (on the
|
Use a file as the source (on the sender) or sink (on the
|
||||||
receiver) of data, rather than just generating random data or
|
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,
|
It does not turn iperf3 into a file transfer tool. The length,
|
||||||
attributes, and in some cases contents of the received file may
|
attributes, and in some cases contents of the received file may
|
||||||
not match those of the original file.
|
not match those of the original file.
|
||||||
|
|
||||||
-A, --affinity n/n,m
|
-A, --affinity n/n,m
|
||||||
Set the CPU affinity, if possible (Linux, FreeBSD, and Windows
|
Set the CPU affinity, if possible (Linux, FreeBSD, and Windows
|
||||||
only). On both the client and server you can set the local
|
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
|
argument. Note that when using this feature, a process will
|
||||||
only be bound to a single CPU (as opposed to a set containing
|
only be bound to a single CPU (as opposed to a set containing
|
||||||
potentialy multiple CPUs).
|
potentialy multiple CPUs).
|
||||||
|
|
||||||
-B, --bind host
|
-B, --bind host
|
||||||
bind to the specific interface associated with address host.
|
bind to the specific interface associated with address host.
|
||||||
--bind-dev dev.ft R bind to the specified network interface.
|
--bind-dev dev.ft R bind to the specified network interface.
|
||||||
This option uses SO_BINDTODEVICE, and may require root permis-
|
This option uses SO_BINDTODEVICE, and may require root permis-
|
||||||
sions. (Available on Linux and possibly other systems.)
|
sions. (Available on Linux and possibly other systems.)
|
||||||
|
|
||||||
-V, --verbose
|
-V, --verbose
|
||||||
give more detailed output
|
give more detailed output
|
||||||
|
|
||||||
-J, --json
|
-J, --json
|
||||||
output in JSON format
|
output in JSON format
|
||||||
|
|
||||||
--logfile file
|
--logfile file
|
||||||
send output to a log file.
|
send output to a log file.
|
||||||
|
|
||||||
--forceflush
|
--forceflush
|
||||||
force flushing output at every interval. Used to avoid buffer-
|
force flushing output at every interval. Used to avoid buffer-
|
||||||
ing when sending output to pipe.
|
ing when sending output to pipe.
|
||||||
|
|
||||||
--timestamps[=format]
|
--timestamps[=format]
|
||||||
prepend a timestamp at the start of each output line. By
|
prepend a timestamp at the start of each output line. By
|
||||||
default, timestamps have the format emitted by ctime(1).
|
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
|
to customize the timestamps, see strftime(3). If this optional
|
||||||
format is given, the = must immediately follow the --timestamps
|
format is given, the = must immediately follow the --timestamps
|
||||||
option with no whitespace intervening.
|
option with no whitespace intervening.
|
||||||
|
|
||||||
--rcv-timeout #
|
--rcv-timeout #
|
||||||
set idle timeout for receiving data during active tests. The
|
set idle timeout for receiving data during active tests. The
|
||||||
receiver will halt a test if no data is received from the sender
|
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).
|
for this number of ms (default to 12000 ms, or 2 minutes).
|
||||||
|
|
||||||
-d, --debug
|
-d, --debug
|
||||||
emit debugging output. Primarily (perhaps exclusively) of use
|
emit debugging output. Primarily (perhaps exclusively) of use
|
||||||
to developers.
|
to developers.
|
||||||
|
|
||||||
-v, --version
|
-v, --version
|
||||||
show version information and quit
|
show version information and quit
|
||||||
|
|
||||||
-h, --help
|
-h, --help
|
||||||
show a help synopsis
|
show a help synopsis
|
||||||
|
|
||||||
|
|
||||||
SERVER SPECIFIC OPTIONS
|
SERVER SPECIFIC OPTIONS
|
||||||
-s, --server
|
-s, --server
|
||||||
run in server mode
|
run in server mode
|
||||||
|
|
||||||
-D, --daemon
|
-D, --daemon
|
||||||
run the server in background as a daemon
|
run the server in background as a daemon
|
||||||
|
|
||||||
-1, --one-off
|
-1, --one-off
|
||||||
handle one client connection, then exit.
|
handle one client connection, then exit.
|
||||||
|
|
||||||
--server-bitrate-limit n[KMGT]
|
--server-bitrate-limit n[KMGT]
|
||||||
set a limit on the server side, which will cause a test to abort
|
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,
|
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
|
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
|
can be specified by adding a '/' and a number to the bitrate
|
||||||
specifier.
|
specifier.
|
||||||
|
|
||||||
--rsa-private-key-path file
|
--rsa-private-key-path file
|
||||||
path to the RSA private key (not password-protected) used to
|
path to the RSA private key (not password-protected) used to
|
||||||
decrypt authentication credentials from the client (if built
|
decrypt authentication credentials from the client (if built
|
||||||
with OpenSSL support).
|
with OpenSSL support).
|
||||||
|
|
||||||
--authorized-users-path file
|
--authorized-users-path file
|
||||||
path to the configuration file containing authorized users cre-
|
path to the configuration file containing authorized users cre-
|
||||||
dentials to run iperf tests (if built with OpenSSL support).
|
dentials to run iperf tests (if built with OpenSSL support).
|
||||||
The file is a comma separated list of usernames and password
|
The file is a comma separated list of usernames and password
|
||||||
hashes; more information on the structure of the file can be
|
hashes; more information on the structure of the file can be
|
||||||
found in the EXAMPLES section.
|
found in the EXAMPLES section.
|
||||||
|
|
||||||
--time-skew-thresholdsecond seconds
|
--time-skew-thresholdsecond seconds
|
||||||
time skew threshold (in seconds) between the server and client
|
time skew threshold (in seconds) between the server and client
|
||||||
during the authentication process.
|
during the authentication process.
|
||||||
|
|
||||||
CLIENT SPECIFIC OPTIONS
|
CLIENT SPECIFIC OPTIONS
|
||||||
-c, --client host
|
-c, --client host
|
||||||
run in client mode, connecting to the specified server. By
|
run in client mode, connecting to the specified server. By
|
||||||
default, a test consists of sending data from the client to the
|
default, a test consists of sending data from the client to the
|
||||||
server, unless the -R flag is specified.
|
server, unless the -R flag is specified.
|
||||||
|
|
||||||
--sctp use SCTP rather than TCP (FreeBSD and Linux)
|
--sctp use SCTP rather than TCP (FreeBSD and Linux)
|
||||||
|
|
||||||
-u, --udp
|
-u, --udp
|
||||||
use UDP rather than TCP
|
use UDP rather than TCP
|
||||||
|
|
||||||
--connect-timeout n
|
--connect-timeout n
|
||||||
set timeout for establishing the initial control connection to
|
set timeout for establishing the initial control connection to
|
||||||
the server, in milliseconds. The default behavior is the oper-
|
the server, in milliseconds. The default behavior is the oper-
|
||||||
ating system's timeout for TCP connection establishment. Pro-
|
ating system's timeout for TCP connection establishment. Pro-
|
||||||
viding a shorter value may speed up detection of a down iperf3
|
viding a shorter value may speed up detection of a down iperf3
|
||||||
server.
|
server.
|
||||||
|
|
||||||
-b, --bitrate n[KMGT]
|
-b, --bitrate n[KMGT]
|
||||||
set target bitrate to n bits/sec (default 1 Mbit/sec for UDP,
|
set target bitrate to n bits/sec (default 1 Mbit/sec for UDP,
|
||||||
unlimited for TCP/SCTP). If there are multiple streams (-P
|
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
|
inside iperf3, and is available on all platforms. Compare with
|
||||||
the --fq-rate flag. This option replaces the --bandwidth flag,
|
the --fq-rate flag. This option replaces the --bandwidth flag,
|
||||||
which is now deprecated but (at least for now) still accepted.
|
which is now deprecated but (at least for now) still accepted.
|
||||||
|
|
||||||
--pacing-timer n[KMGT]
|
--pacing-timer n[KMGT]
|
||||||
set pacing timer interval in microseconds (default 1000
|
set pacing timer interval in microseconds (default 1000
|
||||||
microseconds, or 1 ms). This controls iperf3's internal pacing
|
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
|
timer parameter smooth out the traffic emitted by iperf3, but
|
||||||
potentially at the cost of performance due to more frequent
|
potentially at the cost of performance due to more frequent
|
||||||
timer processing.
|
timer processing.
|
||||||
|
|
||||||
--fq-rate n[KMGT]
|
--fq-rate n[KMGT]
|
||||||
Set a rate to be used with fair-queueing based socket-level pac-
|
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
|
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-
|
test. Only available on platforms supporting the SO_MAX_PAC-
|
||||||
ING_RATE socket option (currently only Linux). The default is
|
ING_RATE socket option (currently only Linux). The default is
|
||||||
no fair-queueing based pacing.
|
no fair-queueing based pacing.
|
||||||
|
|
||||||
--no-fq-socket-pacing
|
--no-fq-socket-pacing
|
||||||
This option is deprecated and will be removed. It is equivalent
|
This option is deprecated and will be removed. It is equivalent
|
||||||
to specifying --fq-rate=0.
|
to specifying --fq-rate=0.
|
||||||
|
|
||||||
-t, --time n
|
-t, --time n
|
||||||
time in seconds to transmit for (default 10 secs)
|
time in seconds to transmit for (default 10 secs)
|
||||||
|
|
||||||
-n, --bytes n[KMGT]
|
-n, --bytes n[KMGT]
|
||||||
number of bytes to transmit (instead of -t)
|
number of bytes to transmit (instead of -t)
|
||||||
|
|
||||||
-k, --blockcount n[KMGT]
|
-k, --blockcount n[KMGT]
|
||||||
number of blocks (packets) to transmit (instead of -t or -n)
|
number of blocks (packets) to transmit (instead of -t or -n)
|
||||||
|
|
||||||
-l, --length n[KMGT]
|
-l, --length n[KMGT]
|
||||||
length of buffer to read or write. For TCP tests, the default
|
length of buffer to read or write. For TCP tests, the default
|
||||||
value is 128KB. In the case of UDP, iperf3 tries to dynamically
|
value is 128KB. In the case of UDP, iperf3 tries to dynamically
|
||||||
determine a reasonable sending size based on the path MTU; if
|
determine a reasonable sending size based on the path MTU; if
|
||||||
that cannot be determined it uses 1460 bytes as a sending size.
|
that cannot be determined it uses 1460 bytes as a sending size.
|
||||||
For SCTP tests, the default size is 64KB.
|
For SCTP tests, the default size is 64KB.
|
||||||
|
|
||||||
--cport port
|
--cport port
|
||||||
bind data streams to a specific client port (for TCP and UDP
|
bind data streams to a specific client port (for TCP and UDP
|
||||||
only, default is to use an ephemeral port)
|
only, default is to use an ephemeral port)
|
||||||
|
|
||||||
-P, --parallel n
|
-P, --parallel n
|
||||||
number of parallel client streams to run. Note that iperf3 is
|
number of parallel client streams to run. Note that iperf3 is
|
||||||
single threaded, so if you are CPU bound, this will not yield
|
single threaded, so if you are CPU bound, this will not yield
|
||||||
higher throughput.
|
higher throughput.
|
||||||
|
|
||||||
-R, --reverse
|
-R, --reverse
|
||||||
reverse the direction of a test, so that the server sends data
|
reverse the direction of a test, so that the server sends data
|
||||||
to the client
|
to the client
|
||||||
|
|
||||||
--bidir
|
--bidir
|
||||||
test in both directions (normal and reverse), with both the
|
test in both directions (normal and reverse), with both the
|
||||||
client and server sending and receiving data simultaneously
|
client and server sending and receiving data simultaneously
|
||||||
|
|
||||||
-w, --window n[KMGT]
|
-w, --window n[KMGT]
|
||||||
window size / socket buffer size (this gets sent to the server
|
window size / socket buffer size (this gets sent to the server
|
||||||
and used on that side too)
|
and used on that side too)
|
||||||
|
|
||||||
-M, --set-mss n
|
-M, --set-mss n
|
||||||
set TCP/SCTP maximum segment size (MTU - 40 bytes)
|
set TCP/SCTP maximum segment size (MTU - 40 bytes)
|
||||||
|
|
||||||
-N, --no-delay
|
-N, --no-delay
|
||||||
set TCP/SCTP no delay, disabling Nagle's Algorithm
|
set TCP/SCTP no delay, disabling Nagle's Algorithm
|
||||||
|
|
||||||
-4, --version4
|
-4, --version4
|
||||||
only use IPv4
|
only use IPv4
|
||||||
|
|
||||||
-6, --version6
|
-6, --version6
|
||||||
only use IPv6
|
only use IPv6
|
||||||
|
|
||||||
-S, --tos n
|
-S, --tos n
|
||||||
set the IP type of service. The usual prefixes for octal and hex
|
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.
|
can be used, i.e. 52, 064 and 0x34 all specify the same value.
|
||||||
|
|
||||||
--dscp dscp
|
--dscp dscp
|
||||||
set the IP DSCP bits. Both numeric and symbolic values are
|
set the IP DSCP bits. Both numeric and symbolic values are
|
||||||
accepted. Numeric values can be specified in decimal, octal and
|
accepted. Numeric values can be specified in decimal, octal and
|
||||||
hex (see --tos above).
|
hex (see --tos above).
|
||||||
|
|
||||||
-L, --flowlabel n
|
-L, --flowlabel n
|
||||||
set the IPv6 flow label (currently only supported on Linux)
|
set the IPv6 flow label (currently only supported on Linux)
|
||||||
|
|
||||||
-X, --xbind name
|
-X, --xbind name
|
||||||
Bind SCTP associations to a specific subset of links using
|
Bind SCTP associations to a specific subset of links using
|
||||||
sctp_bindx(3). The --B flag will be ignored if this flag is
|
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
|
resolved using getaddrinfo(3). If the --4 or --6 flags are
|
||||||
specified, names which do not resolve to addresses within the
|
specified, names which do not resolve to addresses within the
|
||||||
specified protocol family will be ignored.
|
specified protocol family will be ignored.
|
||||||
|
|
||||||
--nstreams n
|
--nstreams n
|
||||||
Set number of SCTP streams.
|
Set number of SCTP streams.
|
||||||
|
|
||||||
-Z, --zerocopy
|
-Z, --zerocopy
|
||||||
Use a "zero copy" method of sending data, such as sendfile(2),
|
Use a "zero copy" method of sending data, such as sendfile(2),
|
||||||
instead of the usual write(2).
|
instead of the usual write(2).
|
||||||
|
|
||||||
-O, --omit n
|
-O, --omit n
|
||||||
Omit the first n seconds of the test, to skip past the TCP slow-
|
Omit the first n seconds of the test, to skip past the TCP slow-
|
||||||
start period.
|
start period.
|
||||||
|
|
||||||
-T, --title str
|
-T, --title str
|
||||||
Prefix every output line with this string.
|
Prefix every output line with this string.
|
||||||
|
|
||||||
--extra-data str
|
--extra-data str
|
||||||
Specify an extra data string field to be included in JSON out-
|
Specify an extra data string field to be included in JSON out-
|
||||||
put.
|
put.
|
||||||
|
|
||||||
-C, --congestion algo
|
-C, --congestion algo
|
||||||
Set the congestion control algorithm (Linux and FreeBSD only).
|
Set the congestion control algorithm (Linux and FreeBSD only).
|
||||||
An older --linux-congestion synonym for this flag is accepted
|
An older --linux-congestion synonym for this flag is accepted
|
||||||
but is deprecated.
|
but is deprecated.
|
||||||
|
|
||||||
--get-server-output
|
--get-server-output
|
||||||
Get the output from the server. The output format is determined
|
Get the output from the server. The output format is determined
|
||||||
by the server (in particular, if the server was invoked with the
|
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
|
will be in human-readable format). If the client is run with
|
||||||
--json, the server output is included in a JSON object; other-
|
--json, the server output is included in a JSON object; other-
|
||||||
wise it is appended at the bottom of the human-readable output.
|
wise it is appended at the bottom of the human-readable output.
|
||||||
|
|
||||||
--udp-counters-64bit
|
--udp-counters-64bit
|
||||||
Use 64-bit counters in UDP test packets. The use of this option
|
Use 64-bit counters in UDP test packets. The use of this option
|
||||||
can help prevent counter overflows during long or high-bitrate
|
can help prevent counter overflows during long or high-bitrate
|
||||||
UDP tests. Both client and server need to be running at least
|
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
|
version 3.1 for this option to work. It may become the default
|
||||||
behavior at some point in the future.
|
behavior at some point in the future.
|
||||||
|
|
||||||
--repeating-payload
|
--repeating-payload
|
||||||
Use repeating pattern in payload, instead of random bytes. The
|
Use repeating pattern in payload, instead of random bytes. The
|
||||||
same payload is used in iperf2 (ASCII '0..9' repeating). It
|
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
|
hardware compression (including some WiFi access points), where
|
||||||
iperf2 and iperf3 perform differently, just based on payload
|
iperf2 and iperf3 perform differently, just based on payload
|
||||||
entropy.
|
entropy.
|
||||||
|
|
||||||
--dont-fragment
|
--dont-fragment
|
||||||
Set the IPv4 Don't Fragment (DF) bit on outgoing packets. Only
|
Set the IPv4 Don't Fragment (DF) bit on outgoing packets. Only
|
||||||
applicable to tests doing UDP over IPv4.
|
applicable to tests doing UDP over IPv4.
|
||||||
|
|
||||||
--username username
|
--username username
|
||||||
username to use for authentication to the iperf server (if built
|
username to use for authentication to the iperf server (if built
|
||||||
with OpenSSL support). The password will be prompted for inter-
|
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.
|
also be specified via the IPERF3_PASSWORD environment variable.
|
||||||
If this variable is present, the password prompt will be
|
If this variable is present, the password prompt will be
|
||||||
skipped.
|
skipped.
|
||||||
|
|
||||||
--rsa-public-key-path file
|
--rsa-public-key-path file
|
||||||
path to the RSA public key used to encrypt authentication cre-
|
path to the RSA public key used to encrypt authentication cre-
|
||||||
dentials (if built with OpenSSL support)
|
dentials (if built with OpenSSL support)
|
||||||
|
|
||||||
|
|
||||||
EXAMPLES
|
EXAMPLES
|
||||||
Authentication - RSA Keypair
|
Authentication - RSA Keypair
|
||||||
The authentication feature of iperf3 requires an RSA public 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
|
format and use SubjectPrefixKeyInfo encoding. An example of a set of
|
||||||
UNIX/Linux commands using OpenSSL to generate a correctly-formed key-
|
UNIX/Linux commands using OpenSSL to generate a correctly-formed key-
|
||||||
pair follows:
|
pair follows:
|
||||||
|
|
||||||
> openssl genrsa -des3 -out private.pem 2048
|
> openssl genrsa -des3 -out private.pem 2048
|
||||||
> openssl rsa -in private.pem -outform PEM -pubout -out public.pem
|
> openssl rsa -in private.pem -outform PEM -pubout -out public.pem
|
||||||
> openssl rsa -in private.pem -out private_not_protected.pem -out-
|
> openssl rsa -in private.pem -out private_not_protected.pem -out-
|
||||||
form PEM
|
form PEM
|
||||||
|
|
||||||
After these commands, the public key will be contained in the file pub-
|
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-
|
lic.pem and the private key will be contained in the file pri-
|
||||||
vate_not_protected.pem.
|
vate_not_protected.pem.
|
||||||
|
|
||||||
Authentication - Authorized users configuration file
|
Authentication - Authorized users configuration file
|
||||||
A simple plaintext file must be provided to the iperf3 server in order
|
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
|
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 #
|
word". The file can also contain commented lines (starting with the #
|
||||||
character). An example of commands to generate the password hash on a
|
character). An example of commands to generate the password hash on a
|
||||||
UNIX/Linux system is given below:
|
UNIX/Linux system is given below:
|
||||||
|
|
||||||
> S_USER=mario S_PASSWD=rossi
|
> S_USER=mario S_PASSWD=rossi
|
||||||
> echo -n "{$S_USER}$S_PASSWD" | sha256sum | awk '{ print $1 }'
|
> echo -n "{$S_USER}$S_PASSWD" | sha256sum | awk '{ print $1 }'
|
||||||
|
|
||||||
An example of a password file (with an entry corresponding to the above
|
An example of a password file (with an entry corresponding to the above
|
||||||
username and password) is given below:
|
username and password) is given below:
|
||||||
> cat credentials.csv
|
> cat credentials.csv
|
||||||
# file format: username,sha256
|
# file format: username,sha256
|
||||||
mario,bf7a49a846d44b454a5d11e7acfaf13d138bbe0b7483aa3e050879700572709b
|
mario,bf7a49a846d44b454a5d11e7acfaf13d138bbe0b7483aa3e050879700572709b
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
AUTHORS
|
AUTHORS
|
||||||
A list of the contributors to iperf3 can be found within the documenta-
|
A list of the contributors to iperf3 can be found within the documenta-
|
||||||
tion located at https://software.es.net/iperf/dev.html#authors.
|
tion located at https://software.es.net/iperf/dev.html#authors.
|
||||||
|
|
||||||
|
|
||||||
SEE ALSO
|
SEE ALSO
|
||||||
libiperf(3), https://software.es.net/iperf
|
libiperf(3), https://software.es.net/iperf
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ESnet February 2021
|
ESnet February 2021
|
||||||
IPERF3(1)
|
IPERF3(1)
|
||||||
|
|
||||||
The iperf3 manual page will typically be installed in manual
|
The iperf3 manual page will typically be installed in manual
|
||||||
section 1.
|
section 1.
|
||||||
|
|
||||||
|
@ -412,4 +412,3 @@ During development, there were various distributions of the source
|
|||||||
code unofficially released carrying a 3.0.0 version number. Because
|
code unofficially released carrying a 3.0.0 version number. Because
|
||||||
of the possibility for confusion, this first public release of iperf3
|
of the possibility for confusion, this first public release of iperf3
|
||||||
was numbered 3.0.1.
|
was numbered 3.0.1.
|
||||||
|
|
||||||
|
@ -3,8 +3,8 @@ Version: @VERSION@
|
|||||||
Release: 1%{?dist}
|
Release: 1%{?dist}
|
||||||
Summary: Measurement tool for TCP/UDP bandwidth performance
|
Summary: Measurement tool for TCP/UDP bandwidth performance
|
||||||
|
|
||||||
Group: Applications/Internet
|
Group: Applications/Internet
|
||||||
License: BSD
|
License: BSD
|
||||||
URL: https://github.com/esnet/iperf
|
URL: https://github.com/esnet/iperf
|
||||||
Source0: https://downloads.es.net/pub/iperf/iperf-%{version}.tar.gz
|
Source0: https://downloads.es.net/pub/iperf/iperf-%{version}.tar.gz
|
||||||
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
|
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
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
|
||||||
|
|
||||||
* Wed Apr 06 2011 G.Balaji <balajig81@gmail.com> 3.0b4-2
|
* 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.
|
- package.
|
||||||
|
|
||||||
* Sat Mar 26 2011 G.Balaji <balajig81@gmail.com> 3.0b4-1
|
* Sat Mar 26 2011 G.Balaji <balajig81@gmail.com> 3.0b4-1
|
||||||
- Initial Version
|
- Initial Version
|
||||||
|
|
||||||
|
@ -30,8 +30,8 @@
|
|||||||
|
|
||||||
#include <linux/types.h>
|
#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,
|
"Flow label" things are still not defined in "netinet/in*.h" headers,
|
||||||
but we cannot use "linux/in6.h" immediately because it currently
|
but we cannot use "linux/in6.h" immediately because it currently
|
||||||
conflicts with "netinet/in.h" .
|
conflicts with "netinet/in.h" .
|
||||||
|
@ -183,7 +183,7 @@ struct iperf_stream
|
|||||||
int socket;
|
int socket;
|
||||||
int id;
|
int id;
|
||||||
int sender;
|
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? */
|
should it be? */
|
||||||
struct iperf_settings *settings; /* pointer to structure settings */
|
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 read_set; /* set of read sockets */
|
||||||
fd_set write_set; /* set of write sockets */
|
fd_set write_set; /* set of write sockets */
|
||||||
|
|
||||||
/* Interval related members */
|
/* Interval related members */
|
||||||
int omitting;
|
int omitting;
|
||||||
double stats_interval;
|
double stats_interval;
|
||||||
double reporter_interval;
|
double reporter_interval;
|
||||||
|
24
src/iperf3.1
24
src/iperf3.1
@ -6,7 +6,7 @@ iperf3 \- perform network throughput tests
|
|||||||
.I options
|
.I options
|
||||||
.B ]
|
.B ]
|
||||||
.br
|
.br
|
||||||
.B iperf3 -c
|
.B iperf3 -c
|
||||||
.I server
|
.I server
|
||||||
.B [
|
.B [
|
||||||
.I options
|
.I options
|
||||||
@ -148,7 +148,7 @@ This option uses SO_BINDTODEVICE, and may require root permissions.
|
|||||||
(Available on Linux and possibly other systems.)
|
(Available on Linux and possibly other systems.)
|
||||||
.TP
|
.TP
|
||||||
.BR -V ", " --verbose " "
|
.BR -V ", " --verbose " "
|
||||||
give more detailed output
|
give more detailed output
|
||||||
.TP
|
.TP
|
||||||
.BR -J ", " --json " "
|
.BR -J ", " --json " "
|
||||||
output in JSON format
|
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.
|
a '/' and a number to the bitrate specifier.
|
||||||
.TP
|
.TP
|
||||||
.BR --rsa-private-key-path " \fIfile\fR"
|
.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
|
authentication credentials from the client (if built with OpenSSL
|
||||||
support).
|
support).
|
||||||
.TP
|
.TP
|
||||||
.BR --authorized-users-path " \fIfile\fR"
|
.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).
|
iperf tests (if built with OpenSSL support).
|
||||||
The file is a comma separated list of usernames and password hashes;
|
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
|
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.
|
Set the IPv4 Don't Fragment (DF) bit on outgoing packets.
|
||||||
Only applicable to tests doing UDP over IPv4.
|
Only applicable to tests doing UDP over IPv4.
|
||||||
.TP
|
.TP
|
||||||
.BR --username " \fIusername\fR"
|
.BR --username " \fIusername\fR"
|
||||||
username to use for authentication to the iperf server (if built with
|
username to use for authentication to the iperf server (if built with
|
||||||
OpenSSL support).
|
OpenSSL support).
|
||||||
The password will be prompted for interactively when the test is run. Note,
|
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
|
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.
|
variable. If this variable is present, the password prompt will be skipped.
|
||||||
.TP
|
.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
|
path to the RSA public key used to encrypt authentication credentials
|
||||||
(if built with OpenSSL support)
|
(if built with OpenSSL support)
|
||||||
|
|
||||||
.SH EXAMPLES
|
.SH EXAMPLES
|
||||||
.SS "Authentication - RSA Keypair"
|
.SS "Authentication - RSA Keypair"
|
||||||
The authentication feature of iperf3 requires an RSA public 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.
|
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
|
The private key must be in PEM format and additionally must not have a
|
||||||
password set.
|
password set.
|
||||||
The public key must be in PEM format and use SubjectPrefixKeyInfo encoding.
|
The public key must be in PEM format and use SubjectPrefixKeyInfo encoding.
|
||||||
An example of a set of UNIX/Linux commands using OpenSSL
|
An example of a set of UNIX/Linux commands using OpenSSL
|
||||||
to generate a correctly-formed keypair follows:
|
to generate a correctly-formed keypair follows:
|
||||||
.sp 1
|
.sp 1
|
||||||
.in +.5i
|
.in +.5i
|
||||||
> openssl genrsa -des3 -out private.pem 2048
|
> openssl genrsa -des3 -out private.pem 2048
|
||||||
.sp 0
|
.sp 0
|
||||||
> openssl rsa -in private.pem -outform PEM -pubout -out public.pem
|
> openssl rsa -in private.pem -outform PEM -pubout -out public.pem
|
||||||
.sp 0
|
.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
|
.in -.5i
|
||||||
.sp 1
|
.sp 1
|
||||||
After these commands, the public key will be contained in the file
|
After these commands, the public key will be contained in the file
|
||||||
public.pem and the private key will be contained in the file
|
public.pem and the private key will be contained in the file
|
||||||
private_not_protected.pem.
|
private_not_protected.pem.
|
||||||
.SS "Authentication - Authorized users configuration file"
|
.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 authorized user credentials.
|
||||||
The file is a simple list of comma-separated pairs of a username and a
|
The file is a simple list of comma-separated pairs of a username and a
|
||||||
corresponding password hash.
|
corresponding password hash.
|
||||||
@ -461,7 +461,7 @@ The file can also contain commented lines (starting with the \fC#\fR
|
|||||||
character).
|
character).
|
||||||
An example of commands to generate the password hash on a UNIX/Linux system
|
An example of commands to generate the password hash on a UNIX/Linux system
|
||||||
is given below:
|
is given below:
|
||||||
.sp 1
|
.sp 1
|
||||||
.in +.5i
|
.in +.5i
|
||||||
> S_USER=mario S_PASSWD=rossi
|
> S_USER=mario S_PASSWD=rossi
|
||||||
.sp 0
|
.sp 0
|
||||||
|
@ -1202,7 +1202,7 @@ iperf_parse_arguments(struct iperf_test *test, int argc, char **argv)
|
|||||||
break;
|
break;
|
||||||
case 'w':
|
case 'w':
|
||||||
// XXX: This is a socket buffer, not specific to TCP
|
// 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.
|
// to avoid possible integer overflows.
|
||||||
farg = unit_atof(optarg);
|
farg = unit_atof(optarg);
|
||||||
if (farg > (double) MAX_TCP_BUFFER) {
|
if (farg > (double) MAX_TCP_BUFFER) {
|
||||||
@ -1349,7 +1349,7 @@ iperf_parse_arguments(struct iperf_test *test, int argc, char **argv)
|
|||||||
case 'A':
|
case 'A':
|
||||||
#if defined(HAVE_CPU_AFFINITY)
|
#if defined(HAVE_CPU_AFFINITY)
|
||||||
test->affinity = strtol(optarg, &endptr, 0);
|
test->affinity = strtol(optarg, &endptr, 0);
|
||||||
if (endptr == optarg ||
|
if (endptr == optarg ||
|
||||||
test->affinity < 0 || test->affinity > 1024) {
|
test->affinity < 0 || test->affinity > 1024) {
|
||||||
i_errno = IEAFFINITY;
|
i_errno = IEAFFINITY;
|
||||||
return -1;
|
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)){
|
if (test->role == 's' && (client_username || client_rsa_public_key)){
|
||||||
i_errno = IECLIENTONLY;
|
i_errno = IECLIENTONLY;
|
||||||
return -1;
|
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)) {
|
!(client_username && client_rsa_public_key)) {
|
||||||
i_errno = IESETCLIENTAUTH;
|
i_errno = IESETCLIENTAUTH;
|
||||||
return -1;
|
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){
|
else if (iperf_getpass(&client_password, &s, stdin) < 0){
|
||||||
i_errno = IESETCLIENTAUTH;
|
i_errno = IESETCLIENTAUTH;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (test_load_pubkey_from_file(client_rsa_public_key) < 0){
|
if (test_load_pubkey_from_file(client_rsa_public_key) < 0){
|
||||||
iperf_err(test, "%s\n", ERR_error_string(ERR_get_error(), NULL));
|
iperf_err(test, "%s\n", ERR_error_string(ERR_get_error(), NULL));
|
||||||
i_errno = IESETCLIENTAUTH;
|
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){
|
} else if (test->role == 'c' && rcv_timeout_flag && test->mode == SENDER){
|
||||||
i_errno = IERVRSONLYRCVTIMEOUT;
|
i_errno = IERVRSONLYRCVTIMEOUT;
|
||||||
return -1;
|
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)) {
|
!(server_rsa_private_key && test->server_authorized_users)) {
|
||||||
i_errno = IESETSERVERAUTH;
|
i_errno = IESETSERVERAUTH;
|
||||||
return -1;
|
return -1;
|
||||||
@ -1544,7 +1544,7 @@ iperf_parse_arguments(struct iperf_test *test, int argc, char **argv)
|
|||||||
else
|
else
|
||||||
blksize = DEFAULT_TCP_BLKSIZE;
|
blksize = DEFAULT_TCP_BLKSIZE;
|
||||||
}
|
}
|
||||||
if ((test->protocol->id != Pudp && blksize <= 0)
|
if ((test->protocol->id != Pudp && blksize <= 0)
|
||||||
|| blksize > MAX_BLOCKSIZE) {
|
|| blksize > MAX_BLOCKSIZE) {
|
||||||
i_errno = IEBLOCKSIZE;
|
i_errno = IEBLOCKSIZE;
|
||||||
return -1;
|
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,
|
/* 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
|
** get the file-size as the bytes count to be transferred
|
||||||
*/
|
*/
|
||||||
if (test->settings->bytes == 0 &&
|
if (test->settings->bytes == 0 &&
|
||||||
test->settings->blocks == 0 &&
|
test->settings->blocks == 0 &&
|
||||||
! duration_flag &&
|
! duration_flag &&
|
||||||
test->diskfile_name != (char*) 0 &&
|
test->diskfile_name != (char*) 0 &&
|
||||||
test->role == 'c'
|
test->role == 'c'
|
||||||
@ -1572,12 +1572,12 @@ iperf_parse_arguments(struct iperf_test *test, int argc, char **argv)
|
|||||||
struct stat st;
|
struct stat st;
|
||||||
if( stat(test->diskfile_name, &st) == 0 ){
|
if( stat(test->diskfile_name, &st) == 0 ){
|
||||||
iperf_size_t file_bytes = st.st_size;
|
iperf_size_t file_bytes = st.st_size;
|
||||||
test->settings->bytes = file_bytes;
|
test->settings->bytes = file_bytes;
|
||||||
if (test->debug)
|
if (test->debug)
|
||||||
printf("End condition set to file-size: %d bytes\n", test->settings->bytes);
|
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 failing to read file stat, it should fallback to default duration mode
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((test->settings->bytes != 0 || test->settings->blocks != 0) && ! duration_flag)
|
if ((test->settings->bytes != 0 || test->settings->blocks != 0) && ! duration_flag)
|
||||||
test->duration = 0;
|
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
|
if (test->done || test->settings->bitrate_limit == 0) // Continue only if check should be done
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* Add last inetrval's transferred bytes to the array */
|
/* Add last inetrval's transferred bytes to the array */
|
||||||
if (++test->bitrate_limit_last_interval_index >= test->settings->bitrate_limit_stats_per_interval)
|
if (++test->bitrate_limit_last_interval_index >= test->settings->bitrate_limit_stats_per_interval)
|
||||||
test->bitrate_limit_last_interval_index = 0;
|
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;
|
test->bitrate_limit_stats_count += 1;
|
||||||
if (test->bitrate_limit_stats_count < test->settings->bitrate_limit_stats_per_interval)
|
if (test->bitrate_limit_stats_count < test->settings->bitrate_limit_stats_per_interval)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* Calculating total bytes traffic to be averaged */
|
/* Calculating total bytes traffic to be averaged */
|
||||||
for (total_bytes = 0, i = 0; i < test->settings->bitrate_limit_stats_per_interval; i++) {
|
for (total_bytes = 0, i = 0; i < test->settings->bitrate_limit_stats_per_interval; i++) {
|
||||||
total_bytes += test->bitrate_limit_intervals_traffic_bytes[i];
|
total_bytes += test->bitrate_limit_intervals_traffic_bytes[i];
|
||||||
@ -2062,7 +2062,7 @@ send_parameters(struct iperf_test *test)
|
|||||||
i_errno = IESENDPARAMS;
|
i_errno = IESENDPARAMS;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
cJSON_AddStringToObject(j, "authtoken", test->settings->authtoken);
|
cJSON_AddStringToObject(j, "authtoken", test->settings->authtoken);
|
||||||
}
|
}
|
||||||
#endif // HAVE_SSL
|
#endif // HAVE_SSL
|
||||||
@ -2595,7 +2595,7 @@ iperf_new_test()
|
|||||||
i_errno = IENEWTEST;
|
i_errno = IENEWTEST;
|
||||||
return NULL;
|
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 */
|
/* By default all output goes to stdout */
|
||||||
test->outfile = stdout;
|
test->outfile = stdout;
|
||||||
@ -2622,7 +2622,7 @@ protocol_new(void)
|
|||||||
void
|
void
|
||||||
protocol_free(struct protocol *proto)
|
protocol_free(struct protocol *proto)
|
||||||
{
|
{
|
||||||
free(proto);
|
free(proto);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**************************************************************************/
|
/**************************************************************************/
|
||||||
@ -2827,7 +2827,7 @@ iperf_free_test(struct iperf_test *test)
|
|||||||
/* Free protocol list */
|
/* Free protocol list */
|
||||||
while (!SLIST_EMPTY(&test->protocols)) {
|
while (!SLIST_EMPTY(&test->protocols)) {
|
||||||
prot = SLIST_FIRST(&test->protocols);
|
prot = SLIST_FIRST(&test->protocols);
|
||||||
SLIST_REMOVE_HEAD(&test->protocols, protocols);
|
SLIST_REMOVE_HEAD(&test->protocols, protocols);
|
||||||
free(prot);
|
free(prot);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2929,7 +2929,7 @@ iperf_reset_test(struct iperf_test *test)
|
|||||||
CPU_ZERO(&test->cpumask);
|
CPU_ZERO(&test->cpumask);
|
||||||
#endif /* HAVE_CPUSET_SETAFFINITY */
|
#endif /* HAVE_CPUSET_SETAFFINITY */
|
||||||
test->state = 0;
|
test->state = 0;
|
||||||
|
|
||||||
test->ctrl_sck = -1;
|
test->ctrl_sck = -1;
|
||||||
test->prot_listener = -1;
|
test->prot_listener = -1;
|
||||||
|
|
||||||
@ -2954,7 +2954,7 @@ iperf_reset_test(struct iperf_test *test)
|
|||||||
|
|
||||||
FD_ZERO(&test->read_set);
|
FD_ZERO(&test->read_set);
|
||||||
FD_ZERO(&test->write_set);
|
FD_ZERO(&test->write_set);
|
||||||
|
|
||||||
test->num_streams = 1;
|
test->num_streams = 1;
|
||||||
test->settings->socket_bufsize = 0;
|
test->settings->socket_bufsize = 0;
|
||||||
test->settings->blksize = DEFAULT_TCP_BLKSIZE;
|
test->settings->blksize = DEFAULT_TCP_BLKSIZE;
|
||||||
@ -3061,7 +3061,7 @@ iperf_stats_callback(struct iperf_test *test)
|
|||||||
|
|
||||||
// Total bytes transferred this interval
|
// Total bytes transferred this interval
|
||||||
total_interval_bytes_transferred += rp->bytes_sent_this_interval + rp->bytes_received_this_interval;
|
total_interval_bytes_transferred += rp->bytes_sent_this_interval + rp->bytes_received_this_interval;
|
||||||
|
|
||||||
irp = TAILQ_LAST(&rp->interval_results, irlisthead);
|
irp = TAILQ_LAST(&rp->interval_results, irlisthead);
|
||||||
/* result->end_time contains timestamp of previous interval */
|
/* result->end_time contains timestamp of previous interval */
|
||||||
if ( irp != NULL ) /* not the 1st 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) {
|
if (temp.snd_cwnd > rp->stream_max_snd_cwnd) {
|
||||||
rp->stream_max_snd_cwnd = temp.snd_cwnd;
|
rp->stream_max_snd_cwnd = temp.snd_cwnd;
|
||||||
}
|
}
|
||||||
|
|
||||||
temp.snd_wnd = get_snd_wnd(&temp);
|
temp.snd_wnd = get_snd_wnd(&temp);
|
||||||
if (temp.snd_wnd > rp->stream_max_snd_wnd) {
|
if (temp.snd_wnd > rp->stream_max_snd_wnd) {
|
||||||
rp->stream_max_snd_wnd = temp.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.
|
* Main report-printing callback.
|
||||||
* Prints results either during a test (interval report only) or
|
* Prints results either during a test (interval report only) or
|
||||||
* after the entire test has been run (last interval report plus
|
* after the entire test has been run (last interval report plus
|
||||||
* overall summary).
|
* overall summary).
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
@ -3861,7 +3861,7 @@ iperf_reporter_callback(struct iperf_test *test)
|
|||||||
iperf_print_intermediate(test);
|
iperf_print_intermediate(test);
|
||||||
iperf_print_results(test);
|
iperf_print_results(test);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3939,12 +3939,12 @@ print_interval_results(struct iperf_test *test, struct iperf_stream *sp, cJSON *
|
|||||||
bandwidth = 0.0;
|
bandwidth = 0.0;
|
||||||
}
|
}
|
||||||
unit_snprintf(nbuf, UNIT_LEN, bandwidth, test->settings->unit_format);
|
unit_snprintf(nbuf, UNIT_LEN, bandwidth, test->settings->unit_format);
|
||||||
|
|
||||||
iperf_time_diff(&sp->result->start_time, &irp->interval_start_time, &temp_time);
|
iperf_time_diff(&sp->result->start_time, &irp->interval_start_time, &temp_time);
|
||||||
st = iperf_time_in_secs(&temp_time);
|
st = iperf_time_in_secs(&temp_time);
|
||||||
iperf_time_diff(&sp->result->start_time, &irp->interval_end_time, &temp_time);
|
iperf_time_diff(&sp->result->start_time, &irp->interval_end_time, &temp_time);
|
||||||
et = iperf_time_in_secs(&temp_time);
|
et = iperf_time_in_secs(&temp_time);
|
||||||
|
|
||||||
if (test->protocol->id == Ptcp || test->protocol->id == Psctp) {
|
if (test->protocol->id == Ptcp || test->protocol->id == Psctp) {
|
||||||
if (test->sender_has_retransmits == 1 && sp->sender) {
|
if (test->sender_has_retransmits == 1 && sp->sender) {
|
||||||
/* Interval, TCP with retransmits. */
|
/* 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));
|
memset(sp->result, 0, sizeof(struct iperf_stream_result));
|
||||||
TAILQ_INIT(&sp->result->interval_results);
|
TAILQ_INIT(&sp->result->interval_results);
|
||||||
|
|
||||||
/* Create and randomize the buffer */
|
/* Create and randomize the buffer */
|
||||||
sp->buffer_fd = mkstemp(template);
|
sp->buffer_fd = mkstemp(template);
|
||||||
if (sp->buffer_fd == -1) {
|
if (sp->buffer_fd == -1) {
|
||||||
@ -4246,20 +4246,20 @@ diskfile_send(struct iperf_stream *sp)
|
|||||||
buffer_left += r;
|
buffer_left += r;
|
||||||
rtot += r;
|
rtot += r;
|
||||||
if (sp->test->debug) {
|
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,
|
// If the buffer doesn't contain a full buffer at this point,
|
||||||
// adjust the size of the data to send.
|
// adjust the size of the data to send.
|
||||||
if (buffer_left != sp->test->settings->blksize) {
|
if (buffer_left != sp->test->settings->blksize) {
|
||||||
if (sp->test->debug)
|
if (sp->test->debug)
|
||||||
printf("possible eof\n");
|
printf("possible eof\n");
|
||||||
// setting data size to be sent,
|
// setting data size to be sent,
|
||||||
// which is less than full block/buffer size
|
// which is less than full block/buffer size
|
||||||
// (to be used by iperf_tcp_send, etc.)
|
// (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 there's no work left, we're done.
|
||||||
if (buffer_left == 0) {
|
if (buffer_left == 0) {
|
||||||
sp->test->done = 1;
|
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.
|
// If there's no data left in the file or in the buffer, we're done.
|
||||||
// No more data available to be sent.
|
// No more data available to be sent.
|
||||||
// Return without sending data to the network
|
// Return without sending data to the network
|
||||||
if( sp->test->done || buffer_left == 0 ){
|
if( sp->test->done || buffer_left == 0 ){
|
||||||
if (sp->test->debug)
|
if (sp->test->debug)
|
||||||
printf("already done\n");
|
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
|
* File didn't exist, we couldn't read it, or it didn't correspond to
|
||||||
* a running process. Try to create it.
|
* a running process. Try to create it.
|
||||||
*/
|
*/
|
||||||
fd = open(test->pidfile, O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR|S_IWUSR);
|
fd = open(test->pidfile, O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR|S_IWUSR);
|
||||||
if (fd < 0) {
|
if (fd < 0) {
|
||||||
|
@ -429,7 +429,7 @@ enum {
|
|||||||
/* Stream errors */
|
/* Stream errors */
|
||||||
IECREATESTREAM = 200, // Unable to create a new stream (check herror/perror)
|
IECREATESTREAM = 200, // Unable to create a new stream (check herror/perror)
|
||||||
IEINITSTREAM = 201, // Unable to initialize 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)
|
IESTREAMCONNECT = 203, // Unable to connect stream (check herror/perror)
|
||||||
IESTREAMACCEPT = 204, // Unable to accepte stream connection (check perror)
|
IESTREAMACCEPT = 204, // Unable to accepte stream connection (check perror)
|
||||||
IESTREAMWRITE = 205, // Unable to write to stream socket (check perror)
|
IESTREAMWRITE = 205, // Unable to write to stream socket (check perror)
|
||||||
|
@ -163,11 +163,11 @@ EVP_PKEY *load_pubkey_from_file(const char *file) {
|
|||||||
if (file) {
|
if (file) {
|
||||||
key = BIO_new_file(file, "r");
|
key = BIO_new_file(file, "r");
|
||||||
pkey = PEM_read_bio_PUBKEY(key, NULL, NULL, NULL);
|
pkey = PEM_read_bio_PUBKEY(key, NULL, NULL, NULL);
|
||||||
|
|
||||||
BIO_free(key);
|
BIO_free(key);
|
||||||
}
|
}
|
||||||
return (pkey);
|
return (pkey);
|
||||||
}
|
}
|
||||||
|
|
||||||
EVP_PKEY *load_pubkey_from_base64(const char *buffer) {
|
EVP_PKEY *load_pubkey_from_base64(const char *buffer) {
|
||||||
unsigned char *key = NULL;
|
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));
|
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) {
|
int decrypt_rsa_message(const unsigned char *encryptedtext, const int encryptedtext_len, EVP_PKEY *private_key, unsigned char **plaintext) {
|
||||||
RSA *rsa = NULL;
|
RSA *rsa = NULL;
|
||||||
unsigned char *rsa_buffer = NULL, pad = RSA_PKCS1_PADDING;
|
unsigned char *rsa_buffer = NULL, pad = RSA_PKCS1_PADDING;
|
||||||
int plaintext_len, rsa_buffer_len, keysize;
|
int plaintext_len, rsa_buffer_len, keysize;
|
||||||
|
|
||||||
rsa = EVP_PKEY_get1_RSA(private_key);
|
rsa = EVP_PKEY_get1_RSA(private_key);
|
||||||
|
|
||||||
keysize = RSA_size(rsa);
|
keysize = RSA_size(rsa);
|
||||||
@ -385,5 +385,3 @@ ssize_t iperf_getpass (char **lineptr, size_t *n, FILE *stream) {
|
|||||||
|
|
||||||
return nread;
|
return nread;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -78,7 +78,7 @@ iperf_create_streams(struct iperf_test *test, int sender)
|
|||||||
errno = saved_errno;
|
errno = saved_errno;
|
||||||
i_errno = IESETCONGESTION;
|
i_errno = IESETCONGESTION;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
socklen_t len = TCP_CA_NAME_MAX;
|
socklen_t len = TCP_CA_NAME_MAX;
|
||||||
@ -172,7 +172,7 @@ create_client_timers(struct iperf_test * test)
|
|||||||
i_errno = IEINITTEST;
|
i_errno = IEINITTEST;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (test->stats_interval != 0) {
|
if (test->stats_interval != 0) {
|
||||||
test->stats_timer = tmr_create(&now, client_stats_timer_proc, cd, test->stats_interval * SEC_TO_US, 1);
|
test->stats_timer = tmr_create(&now, client_stats_timer_proc, cd, test->stats_interval * SEC_TO_US, 1);
|
||||||
if (test->stats_timer == NULL) {
|
if (test->stats_timer == NULL) {
|
||||||
@ -548,7 +548,7 @@ iperf_run_client(struct iperf_test * test)
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (result > 0) {
|
if (result > 0) {
|
||||||
if (rcv_timeout_us > 0) {
|
if (rcv_timeout_us > 0) {
|
||||||
iperf_time_now(&last_receive_time);
|
iperf_time_now(&last_receive_time);
|
||||||
|
@ -400,7 +400,7 @@ iperf_strerror(int int_errno)
|
|||||||
perr = 1;
|
perr = 1;
|
||||||
break;
|
break;
|
||||||
case IESETCONGESTION:
|
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");
|
"Supplied congestion control algorithm not supported on this host");
|
||||||
break;
|
break;
|
||||||
case IEPIDFILE:
|
case IEPIDFILE:
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/*---------------------------------------------------------------
|
/*---------------------------------------------------------------
|
||||||
* iperf, Copyright (c) 2014-2021, The Regents of the University of
|
* iperf, Copyright (c) 2014-2021, The Regents of the University of
|
||||||
* California, through Lawrence Berkeley National Laboratory (subject
|
* California, through Lawrence Berkeley National Laboratory (subject
|
||||||
* to receipt of any required approvals from the U.S. Dept. of
|
* to receipt of any required approvals from the U.S. Dept. of
|
||||||
@ -27,49 +27,49 @@
|
|||||||
* Based on code that is:
|
* Based on code that is:
|
||||||
*
|
*
|
||||||
* Copyright (c) 1999,2000,2001,2002,2003
|
* Copyright (c) 1999,2000,2001,2002,2003
|
||||||
* The Board of Trustees of the University of Illinois
|
* The Board of Trustees of the University of Illinois
|
||||||
* All Rights Reserved.
|
* All Rights Reserved.
|
||||||
*---------------------------------------------------------------
|
*---------------------------------------------------------------
|
||||||
* Permission is hereby granted, free of charge, to any person
|
* Permission is hereby granted, free of charge, to any person
|
||||||
* obtaining a copy of this software (Iperf) and associated
|
* obtaining a copy of this software (Iperf) and associated
|
||||||
* documentation files (the "Software"), to deal in the Software
|
* documentation files (the "Software"), to deal in the Software
|
||||||
* without restriction, including without limitation the
|
* without restriction, including without limitation the
|
||||||
* rights to use, copy, modify, merge, publish, distribute,
|
* rights to use, copy, modify, merge, publish, distribute,
|
||||||
* sublicense, and/or sell copies of the Software, and to permit
|
* sublicense, and/or sell copies of the Software, and to permit
|
||||||
* persons to whom the Software is furnished to do
|
* 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 of source code must retain the above
|
||||||
* Redistributions in binary form must reproduce the above
|
* copyright notice, this list of conditions and
|
||||||
* copyright notice, this list of conditions and the following
|
* the following disclaimers.
|
||||||
* disclaimers in the documentation and/or other materials
|
*
|
||||||
* provided with the distribution.
|
*
|
||||||
*
|
* Redistributions in binary form must reproduce the above
|
||||||
*
|
* copyright notice, this list of conditions and the following
|
||||||
* Neither the names of the University of Illinois, NCSA,
|
* disclaimers in the documentation and/or other materials
|
||||||
* nor the names of its contributors may be used to endorse
|
* 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
|
* or promote products derived from this Software without
|
||||||
* specific prior written permission.
|
* specific prior written permission.
|
||||||
*
|
*
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||||
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE CONTIBUTORS OR COPYRIGHT
|
* NONINFRINGEMENT. IN NO EVENT SHALL THE CONTIBUTORS OR COPYRIGHT
|
||||||
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
* ________________________________________________________________
|
* ________________________________________________________________
|
||||||
* National Laboratory for Applied Network Research
|
* National Laboratory for Applied Network Research
|
||||||
* National Center for Supercomputing Applications
|
* National Center for Supercomputing Applications
|
||||||
* University of Illinois at Urbana-Champaign
|
* University of Illinois at Urbana-Champaign
|
||||||
* http://www.ncsa.uiuc.edu
|
* http://www.ncsa.uiuc.edu
|
||||||
* ________________________________________________________________
|
* ________________________________________________________________
|
||||||
*
|
*
|
||||||
* Locale.c
|
* Locale.c
|
||||||
* by Ajay Tirumala <tirumala@ncsa.uiuc.edu>
|
* by Ajay Tirumala <tirumala@ncsa.uiuc.edu>
|
||||||
@ -115,7 +115,7 @@ const char usage_longstr[] = "Usage: iperf3 [-s|-c host] [options]\n"
|
|||||||
" --forceflush force flushing output at every interval\n"
|
" --forceflush force flushing output at every interval\n"
|
||||||
" --timestamps<=format> emit a timestamp at the start of each output line\n"
|
" --timestamps<=format> emit a timestamp at the start of each output line\n"
|
||||||
" (optional \"=\" and format string as per strftime(3))\n"
|
" (optional \"=\" and format string as per strftime(3))\n"
|
||||||
|
|
||||||
" --rcv-timeout # idle timeout for receiving data\n"
|
" --rcv-timeout # idle timeout for receiving data\n"
|
||||||
" (default %d ms)\n"
|
" (default %d ms)\n"
|
||||||
" -d, --debug emit debugging output\n"
|
" -d, --debug emit debugging output\n"
|
||||||
@ -201,7 +201,7 @@ const char usage_longstr[] = "Usage: iperf3 [-s|-c host] [options]\n"
|
|||||||
" --rsa-public-key-path path to the RSA public key used to encrypt\n"
|
" --rsa-public-key-path path to the RSA public key used to encrypt\n"
|
||||||
" authentication credentials\n"
|
" authentication credentials\n"
|
||||||
#endif //HAVESSL
|
#endif //HAVESSL
|
||||||
|
|
||||||
#ifdef NOT_YET_SUPPORTED /* still working on these */
|
#ifdef NOT_YET_SUPPORTED /* still working on these */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -82,7 +82,7 @@ iperf_sctp_recv(struct iperf_stream *sp)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* iperf_sctp_send
|
/* iperf_sctp_send
|
||||||
*
|
*
|
||||||
* sends the data for SCTP
|
* sends the data for SCTP
|
||||||
*/
|
*/
|
||||||
@ -94,7 +94,7 @@ iperf_sctp_send(struct iperf_stream *sp)
|
|||||||
|
|
||||||
r = Nwrite(sp->socket, sp->buffer, sp->settings->blksize, Psctp);
|
r = Nwrite(sp->socket, sp->buffer, sp->settings->blksize, Psctp);
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
return r;
|
return r;
|
||||||
|
|
||||||
sp->result->bytes_sent += r;
|
sp->result->bytes_sent += r;
|
||||||
sp->result->bytes_sent_this_interval += r;
|
sp->result->bytes_sent_this_interval += r;
|
||||||
@ -165,7 +165,7 @@ iperf_sctp_listen(struct iperf_test *test)
|
|||||||
int s, opt, saved_errno;
|
int s, opt, saved_errno;
|
||||||
|
|
||||||
close(test->listener);
|
close(test->listener);
|
||||||
|
|
||||||
snprintf(portstr, 6, "%d", test->server_port);
|
snprintf(portstr, 6, "%d", test->server_port);
|
||||||
memset(&hints, 0, sizeof(hints));
|
memset(&hints, 0, sizeof(hints));
|
||||||
/*
|
/*
|
||||||
@ -227,13 +227,13 @@ iperf_sctp_listen(struct iperf_test *test)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if defined(IPV6_V6ONLY) && !defined(__OpenBSD__)
|
#if defined(IPV6_V6ONLY) && !defined(__OpenBSD__)
|
||||||
if (res->ai_family == AF_INET6 && (test->settings->domain == AF_UNSPEC ||
|
if (res->ai_family == AF_INET6 && (test->settings->domain == AF_UNSPEC ||
|
||||||
test->settings->domain == AF_INET6)) {
|
test->settings->domain == AF_INET6)) {
|
||||||
if (test->settings->domain == AF_UNSPEC)
|
if (test->settings->domain == AF_UNSPEC)
|
||||||
opt = 0;
|
opt = 0;
|
||||||
else
|
else
|
||||||
opt = 1;
|
opt = 1;
|
||||||
if (setsockopt(s, IPPROTO_IPV6, IPV6_V6ONLY,
|
if (setsockopt(s, IPPROTO_IPV6, IPV6_V6ONLY,
|
||||||
(char *) &opt, sizeof(opt)) < 0) {
|
(char *) &opt, sizeof(opt)) < 0) {
|
||||||
saved_errno = errno;
|
saved_errno = errno;
|
||||||
close(s);
|
close(s);
|
||||||
@ -280,7 +280,7 @@ iperf_sctp_listen(struct iperf_test *test)
|
|||||||
}
|
}
|
||||||
|
|
||||||
test->listener = s;
|
test->listener = s;
|
||||||
|
|
||||||
return s;
|
return s;
|
||||||
#else
|
#else
|
||||||
i_errno = IENOSCTP;
|
i_errno = IENOSCTP;
|
||||||
|
@ -141,14 +141,14 @@ iperf_accept(struct iperf_test *test)
|
|||||||
return -1;
|
return -1;
|
||||||
if (iperf_exchange_parameters(test) < 0)
|
if (iperf_exchange_parameters(test) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
if (test->server_affinity != -1)
|
if (test->server_affinity != -1)
|
||||||
if (iperf_setaffinity(test, test->server_affinity) != 0)
|
if (iperf_setaffinity(test, test->server_affinity) != 0)
|
||||||
return -1;
|
return -1;
|
||||||
if (test->on_connect)
|
if (test->on_connect)
|
||||||
test->on_connect(test);
|
test->on_connect(test);
|
||||||
} else {
|
} else {
|
||||||
/*
|
/*
|
||||||
* Don't try to read from the socket. It could block an ongoing test.
|
* Don't try to read from the socket. It could block an ongoing test.
|
||||||
* Just send ACCESS_DENIED.
|
* Just send ACCESS_DENIED.
|
||||||
* Also, if sending failed, don't return an error, as the request is not related
|
* Also, if sending failed, don't return an error, as the request is not related
|
||||||
* to the ongoing test, and returning an error will terminate the test.
|
* to the ongoing test, and returning an error will terminate the test.
|
||||||
@ -325,7 +325,7 @@ create_server_timers(struct iperf_test * test)
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
server_omit_timer_proc(TimerClientData client_data, struct iperf_time *nowP)
|
server_omit_timer_proc(TimerClientData client_data, struct iperf_time *nowP)
|
||||||
{
|
{
|
||||||
struct iperf_test *test = client_data.p;
|
struct iperf_test *test = client_data.p;
|
||||||
|
|
||||||
test->omit_timer = NULL;
|
test->omit_timer = NULL;
|
||||||
@ -345,7 +345,7 @@ static int
|
|||||||
create_server_omit_timer(struct iperf_test * test)
|
create_server_omit_timer(struct iperf_test * test)
|
||||||
{
|
{
|
||||||
struct iperf_time now;
|
struct iperf_time now;
|
||||||
TimerClientData cd;
|
TimerClientData cd;
|
||||||
|
|
||||||
if (test->omit == 0) {
|
if (test->omit == 0) {
|
||||||
test->omit_timer = NULL;
|
test->omit_timer = NULL;
|
||||||
@ -353,11 +353,11 @@ create_server_omit_timer(struct iperf_test * test)
|
|||||||
} else {
|
} else {
|
||||||
if (iperf_time_now(&now) < 0) {
|
if (iperf_time_now(&now) < 0) {
|
||||||
i_errno = IEINITTEST;
|
i_errno = IEINITTEST;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
test->omitting = 1;
|
test->omitting = 1;
|
||||||
cd.p = test;
|
cd.p = test;
|
||||||
test->omit_timer = tmr_create(&now, server_omit_timer_proc, cd, test->omit * SEC_TO_US, 0);
|
test->omit_timer = tmr_create(&now, server_omit_timer_proc, cd, test->omit * SEC_TO_US, 0);
|
||||||
if (test->omit_timer == NULL) {
|
if (test->omit_timer == NULL) {
|
||||||
i_errno = IEINITTEST;
|
i_errno = IEINITTEST;
|
||||||
return -1;
|
return -1;
|
||||||
@ -439,7 +439,7 @@ iperf_run_server(struct iperf_test *test)
|
|||||||
if (iperf_open_logfile(test) < 0)
|
if (iperf_open_logfile(test) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (test->affinity != -1)
|
if (test->affinity != -1)
|
||||||
if (iperf_setaffinity(test, test->affinity) != 0)
|
if (iperf_setaffinity(test, test->affinity) != 0)
|
||||||
return -2;
|
return -2;
|
||||||
|
|
||||||
@ -475,7 +475,7 @@ iperf_run_server(struct iperf_test *test)
|
|||||||
if (test->bitrate_limit_exceeded) {
|
if (test->bitrate_limit_exceeded) {
|
||||||
cleanup_server(test);
|
cleanup_server(test);
|
||||||
i_errno = IETOTALRATE;
|
i_errno = IETOTALRATE;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
memcpy(&read_set, &test->read_set, sizeof(fd_set));
|
memcpy(&read_set, &test->read_set, sizeof(fd_set));
|
||||||
@ -576,12 +576,12 @@ iperf_run_server(struct iperf_test *test)
|
|||||||
cleanup_server(test);
|
cleanup_server(test);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
FD_CLR(test->ctrl_sck, &read_set);
|
FD_CLR(test->ctrl_sck, &read_set);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (test->state == CREATE_STREAMS) {
|
if (test->state == CREATE_STREAMS) {
|
||||||
if (FD_ISSET(test->prot_listener, &read_set)) {
|
if (FD_ISSET(test->prot_listener, &read_set)) {
|
||||||
|
|
||||||
if ((s = test->protocol->accept(test)) < 0) {
|
if ((s = test->protocol->accept(test)) < 0) {
|
||||||
cleanup_server(test);
|
cleanup_server(test);
|
||||||
return -1;
|
return -1;
|
||||||
@ -613,7 +613,7 @@ iperf_run_server(struct iperf_test *test)
|
|||||||
i_errno = IESETCONGESTION;
|
i_errno = IESETCONGESTION;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
socklen_t len = TCP_CA_NAME_MAX;
|
socklen_t len = TCP_CA_NAME_MAX;
|
||||||
@ -628,7 +628,7 @@ iperf_run_server(struct iperf_test *test)
|
|||||||
i_errno = IESETCONGESTION;
|
i_errno = IESETCONGESTION;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* If not the first connection, discard prior
|
* If not the first connection, discard prior
|
||||||
* congestion algorithm name so we don't leak
|
* congestion algorithm name so we don't leak
|
||||||
* duplicated strings. We probably don't need
|
* duplicated strings. We probably don't need
|
||||||
@ -696,7 +696,7 @@ iperf_run_server(struct iperf_test *test)
|
|||||||
if (test->protocol->id != Ptcp) {
|
if (test->protocol->id != Ptcp) {
|
||||||
FD_CLR(test->prot_listener, &test->read_set);
|
FD_CLR(test->prot_listener, &test->read_set);
|
||||||
close(test->prot_listener);
|
close(test->prot_listener);
|
||||||
} else {
|
} else {
|
||||||
if (test->no_delay || test->settings->mss || test->settings->socket_bufsize) {
|
if (test->no_delay || test->settings->mss || test->settings->socket_bufsize) {
|
||||||
FD_CLR(test->listener, &test->read_set);
|
FD_CLR(test->listener, &test->read_set);
|
||||||
close(test->listener);
|
close(test->listener);
|
||||||
@ -794,11 +794,11 @@ iperf_run_server(struct iperf_test *test)
|
|||||||
if (test->json_output) {
|
if (test->json_output) {
|
||||||
if (iperf_json_finish(test) < 0)
|
if (iperf_json_finish(test) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
iflush(test);
|
iflush(test);
|
||||||
|
|
||||||
if (test->server_affinity != -1)
|
if (test->server_affinity != -1)
|
||||||
if (iperf_clearaffinity(test) != 0)
|
if (iperf_clearaffinity(test) != 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
@ -76,7 +76,7 @@ iperf_tcp_recv(struct iperf_stream *sp)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* iperf_tcp_send
|
/* iperf_tcp_send
|
||||||
*
|
*
|
||||||
* sends the data for TCP
|
* sends the data for TCP
|
||||||
*/
|
*/
|
||||||
@ -282,9 +282,9 @@ iperf_tcp_listen(struct iperf_test *test)
|
|||||||
if (res->ai_family == AF_INET6 && (test->settings->domain == AF_UNSPEC || test->settings->domain == AF_INET)) {
|
if (res->ai_family == AF_INET6 && (test->settings->domain == AF_UNSPEC || test->settings->domain == AF_INET)) {
|
||||||
if (test->settings->domain == AF_UNSPEC)
|
if (test->settings->domain == AF_UNSPEC)
|
||||||
opt = 0;
|
opt = 0;
|
||||||
else
|
else
|
||||||
opt = 1;
|
opt = 1;
|
||||||
if (setsockopt(s, IPPROTO_IPV6, IPV6_V6ONLY,
|
if (setsockopt(s, IPPROTO_IPV6, IPV6_V6ONLY,
|
||||||
(char *) &opt, sizeof(opt)) < 0) {
|
(char *) &opt, sizeof(opt)) < 0) {
|
||||||
saved_errno = errno;
|
saved_errno = errno;
|
||||||
close(s);
|
close(s);
|
||||||
@ -314,7 +314,7 @@ iperf_tcp_listen(struct iperf_test *test)
|
|||||||
|
|
||||||
test->listener = s;
|
test->listener = s;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Read back and verify the sender socket buffer size */
|
/* Read back and verify the sender socket buffer size */
|
||||||
optlen = sizeof(sndbuf_actual);
|
optlen = sizeof(sndbuf_actual);
|
||||||
if (getsockopt(s, SOL_SOCKET, SO_SNDBUF, &sndbuf_actual, &optlen) < 0) {
|
if (getsockopt(s, SOL_SOCKET, SO_SNDBUF, &sndbuf_actual, &optlen) < 0) {
|
||||||
@ -589,7 +589,7 @@ iperf_tcp_connect(struct iperf_test *test)
|
|||||||
errno = saved_errno;
|
errno = saved_errno;
|
||||||
i_errno = IESETFLOW;
|
i_errno = IESETFLOW;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /* HAVE_FLOWLABEL */
|
#endif /* HAVE_FLOWLABEL */
|
||||||
|
@ -89,13 +89,13 @@ iperf_time_in_usecs(struct iperf_time *time)
|
|||||||
double
|
double
|
||||||
iperf_time_in_secs(struct iperf_time *time)
|
iperf_time_in_secs(struct iperf_time *time)
|
||||||
{
|
{
|
||||||
return time->secs + time->usecs / 1000000.0;
|
return time->secs + time->usecs / 1000000.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* iperf_time_compare
|
/* iperf_time_compare
|
||||||
*
|
*
|
||||||
* Compare two timestamps
|
* Compare two timestamps
|
||||||
*
|
*
|
||||||
* Returns -1 if time1 is earlier, 1 if time1 is later,
|
* Returns -1 if time1 is earlier, 1 if time1 is later,
|
||||||
* or 0 if the timestamps are equal.
|
* or 0 if the timestamps are equal.
|
||||||
*/
|
*/
|
||||||
@ -121,7 +121,7 @@ iperf_time_compare(struct iperf_time *time1, struct iperf_time *time2)
|
|||||||
*
|
*
|
||||||
* Returns 1 if the time1 is less than or equal to time2, otherwise 0.
|
* Returns 1 if the time1 is less than or equal to time2, otherwise 0.
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
iperf_time_diff(struct iperf_time *time1, struct iperf_time *time2, struct iperf_time *diff)
|
iperf_time_diff(struct iperf_time *time1, struct iperf_time *time2, struct iperf_time *diff)
|
||||||
{
|
{
|
||||||
int past = 0;
|
int past = 0;
|
||||||
@ -132,7 +132,7 @@ iperf_time_diff(struct iperf_time *time1, struct iperf_time *time2, struct iperf
|
|||||||
diff->secs = 0;
|
diff->secs = 0;
|
||||||
diff->usecs = 0;
|
diff->usecs = 0;
|
||||||
past = 1;
|
past = 1;
|
||||||
}
|
}
|
||||||
else if (cmp == 1) {
|
else if (cmp == 1) {
|
||||||
diff->secs = time1->secs - time2->secs;
|
diff->secs = time1->secs - time2->secs;
|
||||||
diff->usecs = time1->usecs;
|
diff->usecs = time1->usecs;
|
||||||
|
@ -150,7 +150,7 @@ iperf_udp_recv(struct iperf_stream *sp)
|
|||||||
sp->packet_count = pcount;
|
sp->packet_count = pcount;
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Sequence number went backward (or was stationary?!?).
|
* Sequence number went backward (or was stationary?!?).
|
||||||
* This counts as an out-of-order packet.
|
* This counts as an out-of-order packet.
|
||||||
*/
|
*/
|
||||||
@ -164,9 +164,9 @@ iperf_udp_recv(struct iperf_stream *sp)
|
|||||||
*/
|
*/
|
||||||
if (sp->cnt_error > 0)
|
if (sp->cnt_error > 0)
|
||||||
sp->cnt_error--;
|
sp->cnt_error--;
|
||||||
|
|
||||||
/* Log the out-of-order packet */
|
/* Log the out-of-order packet */
|
||||||
if (sp->test->debug)
|
if (sp->test->debug)
|
||||||
fprintf(stderr, "OUT OF ORDER - incoming packet sequence %" PRIu64 " but expected sequence %d on stream %d", pcount, sp->packet_count + 1, sp->socket);
|
fprintf(stderr, "OUT OF ORDER - incoming packet sequence %" PRIu64 " but expected sequence %d on stream %d", pcount, sp->packet_count + 1, sp->socket);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -228,11 +228,11 @@ iperf_udp_send(struct iperf_stream *sp)
|
|||||||
sec = htonl(before.secs);
|
sec = htonl(before.secs);
|
||||||
usec = htonl(before.usecs);
|
usec = htonl(before.usecs);
|
||||||
pcount = htobe64(sp->packet_count);
|
pcount = htobe64(sp->packet_count);
|
||||||
|
|
||||||
memcpy(sp->buffer, &sec, sizeof(sec));
|
memcpy(sp->buffer, &sec, sizeof(sec));
|
||||||
memcpy(sp->buffer+4, &usec, sizeof(usec));
|
memcpy(sp->buffer+4, &usec, sizeof(usec));
|
||||||
memcpy(sp->buffer+8, &pcount, sizeof(pcount));
|
memcpy(sp->buffer+8, &pcount, sizeof(pcount));
|
||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
||||||
@ -241,11 +241,11 @@ iperf_udp_send(struct iperf_stream *sp)
|
|||||||
sec = htonl(before.secs);
|
sec = htonl(before.secs);
|
||||||
usec = htonl(before.usecs);
|
usec = htonl(before.usecs);
|
||||||
pcount = htonl(sp->packet_count);
|
pcount = htonl(sp->packet_count);
|
||||||
|
|
||||||
memcpy(sp->buffer, &sec, sizeof(sec));
|
memcpy(sp->buffer, &sec, sizeof(sec));
|
||||||
memcpy(sp->buffer+4, &usec, sizeof(usec));
|
memcpy(sp->buffer+4, &usec, sizeof(usec));
|
||||||
memcpy(sp->buffer+8, &pcount, sizeof(pcount));
|
memcpy(sp->buffer+8, &pcount, sizeof(pcount));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
r = Nwrite(sp->socket, sp->buffer, size, Pudp);
|
r = Nwrite(sp->socket, sp->buffer, size, Pudp);
|
||||||
@ -291,7 +291,7 @@ iperf_udp_buffercheck(struct iperf_test *test, int s)
|
|||||||
*/
|
*/
|
||||||
int opt;
|
int opt;
|
||||||
socklen_t optlen;
|
socklen_t optlen;
|
||||||
|
|
||||||
if ((opt = test->settings->socket_bufsize)) {
|
if ((opt = test->settings->socket_bufsize)) {
|
||||||
if (setsockopt(s, SOL_SOCKET, SO_RCVBUF, &opt, sizeof(opt)) < 0) {
|
if (setsockopt(s, SOL_SOCKET, SO_RCVBUF, &opt, sizeof(opt)) < 0) {
|
||||||
i_errno = IESETBUF;
|
i_errno = IESETBUF;
|
||||||
@ -412,7 +412,7 @@ iperf_udp_accept(struct iperf_test *test)
|
|||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(HAVE_SO_MAX_PACING_RATE)
|
#if defined(HAVE_SO_MAX_PACING_RATE)
|
||||||
/* If socket pacing is specified, try it. */
|
/* If socket pacing is specified, try it. */
|
||||||
if (test->settings->fqrate) {
|
if (test->settings->fqrate) {
|
||||||
@ -524,7 +524,7 @@ iperf_udp_connect(struct iperf_test *test)
|
|||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(HAVE_SO_MAX_PACING_RATE)
|
#if defined(HAVE_SO_MAX_PACING_RATE)
|
||||||
/* If socket pacing is available and not disabled, try it. */
|
/* If socket pacing is available and not disabled, try it. */
|
||||||
if (test->settings->fqrate) {
|
if (test->settings->fqrate) {
|
||||||
@ -562,7 +562,7 @@ iperf_udp_connect(struct iperf_test *test)
|
|||||||
*/
|
*/
|
||||||
buf = 123456789; /* this can be pretty much anything */
|
buf = 123456789; /* this can be pretty much anything */
|
||||||
if (write(s, &buf, sizeof(buf)) < 0) {
|
if (write(s, &buf, sizeof(buf)) < 0) {
|
||||||
// XXX: Should this be changed to IESTREAMCONNECT?
|
// XXX: Should this be changed to IESTREAMCONNECT?
|
||||||
i_errno = IESTREAMWRITE;
|
i_errno = IESTREAMWRITE;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -128,7 +128,7 @@ make_cookie(const char *cookie)
|
|||||||
/* is_closed
|
/* is_closed
|
||||||
*
|
*
|
||||||
* Test if the file descriptor fd is closed.
|
* Test if the file descriptor fd is closed.
|
||||||
*
|
*
|
||||||
* Iperf uses this function to test whether a TCP stream socket
|
* Iperf uses this function to test whether a TCP stream socket
|
||||||
* is closed, because accepting and denying an invalid connection
|
* is closed, because accepting and denying an invalid connection
|
||||||
* in iperf_tcp_accept is not considered an error.
|
* in iperf_tcp_accept is not considered an error.
|
||||||
@ -176,7 +176,7 @@ double
|
|||||||
timeval_diff(struct timeval * tv0, struct timeval * tv1)
|
timeval_diff(struct timeval * tv0, struct timeval * tv1)
|
||||||
{
|
{
|
||||||
double time1, time2;
|
double time1, time2;
|
||||||
|
|
||||||
time1 = tv0->tv_sec + (tv0->tv_usec / 1000000.0);
|
time1 = tv0->tv_sec + (tv0->tv_usec / 1000000.0);
|
||||||
time2 = tv1->tv_sec + (tv1->tv_usec / 1000000.0);
|
time2 = tv1->tv_sec + (tv1->tv_usec / 1000000.0);
|
||||||
|
|
||||||
@ -232,7 +232,7 @@ get_system_info(void)
|
|||||||
memset(buf, 0, 1024);
|
memset(buf, 0, 1024);
|
||||||
uname(&uts);
|
uname(&uts);
|
||||||
|
|
||||||
snprintf(buf, sizeof(buf), "%s %s %s %s %s", uts.sysname, uts.nodename,
|
snprintf(buf, sizeof(buf), "%s %s %s %s %s", uts.sysname, uts.nodename,
|
||||||
uts.release, uts.version, uts.machine);
|
uts.release, uts.version, uts.machine);
|
||||||
|
|
||||||
return buf;
|
return buf;
|
||||||
@ -249,44 +249,44 @@ get_optional_features(void)
|
|||||||
|
|
||||||
#if defined(HAVE_CPU_AFFINITY)
|
#if defined(HAVE_CPU_AFFINITY)
|
||||||
if (numfeatures > 0) {
|
if (numfeatures > 0) {
|
||||||
strncat(features, ", ",
|
strncat(features, ", ",
|
||||||
sizeof(features) - strlen(features) - 1);
|
sizeof(features) - strlen(features) - 1);
|
||||||
}
|
}
|
||||||
strncat(features, "CPU affinity setting",
|
strncat(features, "CPU affinity setting",
|
||||||
sizeof(features) - strlen(features) - 1);
|
sizeof(features) - strlen(features) - 1);
|
||||||
numfeatures++;
|
numfeatures++;
|
||||||
#endif /* HAVE_CPU_AFFINITY */
|
#endif /* HAVE_CPU_AFFINITY */
|
||||||
|
|
||||||
#if defined(HAVE_FLOWLABEL)
|
#if defined(HAVE_FLOWLABEL)
|
||||||
if (numfeatures > 0) {
|
if (numfeatures > 0) {
|
||||||
strncat(features, ", ",
|
strncat(features, ", ",
|
||||||
sizeof(features) - strlen(features) - 1);
|
sizeof(features) - strlen(features) - 1);
|
||||||
}
|
}
|
||||||
strncat(features, "IPv6 flow label",
|
strncat(features, "IPv6 flow label",
|
||||||
sizeof(features) - strlen(features) - 1);
|
sizeof(features) - strlen(features) - 1);
|
||||||
numfeatures++;
|
numfeatures++;
|
||||||
#endif /* HAVE_FLOWLABEL */
|
#endif /* HAVE_FLOWLABEL */
|
||||||
|
|
||||||
#if defined(HAVE_SCTP_H)
|
#if defined(HAVE_SCTP_H)
|
||||||
if (numfeatures > 0) {
|
if (numfeatures > 0) {
|
||||||
strncat(features, ", ",
|
strncat(features, ", ",
|
||||||
sizeof(features) - strlen(features) - 1);
|
sizeof(features) - strlen(features) - 1);
|
||||||
}
|
}
|
||||||
strncat(features, "SCTP",
|
strncat(features, "SCTP",
|
||||||
sizeof(features) - strlen(features) - 1);
|
sizeof(features) - strlen(features) - 1);
|
||||||
numfeatures++;
|
numfeatures++;
|
||||||
#endif /* HAVE_SCTP_H */
|
#endif /* HAVE_SCTP_H */
|
||||||
|
|
||||||
#if defined(HAVE_TCP_CONGESTION)
|
#if defined(HAVE_TCP_CONGESTION)
|
||||||
if (numfeatures > 0) {
|
if (numfeatures > 0) {
|
||||||
strncat(features, ", ",
|
strncat(features, ", ",
|
||||||
sizeof(features) - strlen(features) - 1);
|
sizeof(features) - strlen(features) - 1);
|
||||||
}
|
}
|
||||||
strncat(features, "TCP congestion algorithm setting",
|
strncat(features, "TCP congestion algorithm setting",
|
||||||
sizeof(features) - strlen(features) - 1);
|
sizeof(features) - strlen(features) - 1);
|
||||||
numfeatures++;
|
numfeatures++;
|
||||||
#endif /* HAVE_TCP_CONGESTION */
|
#endif /* HAVE_TCP_CONGESTION */
|
||||||
|
|
||||||
#if defined(HAVE_SENDFILE)
|
#if defined(HAVE_SENDFILE)
|
||||||
if (numfeatures > 0) {
|
if (numfeatures > 0) {
|
||||||
strncat(features, ", ",
|
strncat(features, ", ",
|
||||||
@ -338,7 +338,7 @@ get_optional_features(void)
|
|||||||
#endif /* HAVE_DONT_FRAGMENT */
|
#endif /* HAVE_DONT_FRAGMENT */
|
||||||
|
|
||||||
if (numfeatures == 0) {
|
if (numfeatures == 0) {
|
||||||
strncat(features, "None",
|
strncat(features, "None",
|
||||||
sizeof(features) - strlen(features) - 1);
|
sizeof(features) - strlen(features) - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -476,8 +476,8 @@ int daemon(int nochdir, int noclose)
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Fork again to avoid becoming a session leader.
|
* Fork again to avoid becoming a session leader.
|
||||||
* This might only matter on old SVr4-derived OSs.
|
* This might only matter on old SVr4-derived OSs.
|
||||||
* Note in particular that glibc and FreeBSD libc
|
* Note in particular that glibc and FreeBSD libc
|
||||||
* only fork once.
|
* only fork once.
|
||||||
*/
|
*/
|
||||||
pid = fork();
|
pid = fork();
|
||||||
|
@ -74,7 +74,7 @@ main(int argc, char **argv)
|
|||||||
fprintf(stderr, "setting priority to valid level\n");
|
fprintf(stderr, "setting priority to valid level\n");
|
||||||
rc = setpriority(PRIO_PROCESS, 0, 0);
|
rc = setpriority(PRIO_PROCESS, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* setting the affinity of the process */
|
/* setting the affinity of the process */
|
||||||
cpu_set_t cpu_set;
|
cpu_set_t cpu_set;
|
||||||
int affinity = -1;
|
int affinity = -1;
|
||||||
|
10
src/net.c
10
src/net.c
@ -241,7 +241,7 @@ netannounce(int domain, int proto, const char *local, const char *bind_dev, int
|
|||||||
|
|
||||||
snprintf(portstr, 6, "%d", port);
|
snprintf(portstr, 6, "%d", port);
|
||||||
memset(&hints, 0, sizeof(hints));
|
memset(&hints, 0, sizeof(hints));
|
||||||
/*
|
/*
|
||||||
* If binding to the wildcard address with no explicit address
|
* If binding to the wildcard address with no explicit address
|
||||||
* family specified, then force us to get an AF_INET6 socket. On
|
* family specified, then force us to get an AF_INET6 socket. On
|
||||||
* CentOS 6 and MacOS, getaddrinfo(3) with AF_UNSPEC in ai_family,
|
* CentOS 6 and MacOS, getaddrinfo(3) with AF_UNSPEC in ai_family,
|
||||||
@ -262,7 +262,7 @@ netannounce(int domain, int proto, const char *local, const char *bind_dev, int
|
|||||||
hints.ai_socktype = proto;
|
hints.ai_socktype = proto;
|
||||||
hints.ai_flags = AI_PASSIVE;
|
hints.ai_flags = AI_PASSIVE;
|
||||||
if ((gerror = getaddrinfo(local, portstr, &hints, &res)) != 0)
|
if ((gerror = getaddrinfo(local, portstr, &hints, &res)) != 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
s = socket(res->ai_family, proto, 0);
|
s = socket(res->ai_family, proto, 0);
|
||||||
if (s < 0) {
|
if (s < 0) {
|
||||||
@ -285,7 +285,7 @@ netannounce(int domain, int proto, const char *local, const char *bind_dev, int
|
|||||||
}
|
}
|
||||||
|
|
||||||
opt = 1;
|
opt = 1;
|
||||||
if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR,
|
if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR,
|
||||||
(char *) &opt, sizeof(opt)) < 0) {
|
(char *) &opt, sizeof(opt)) < 0) {
|
||||||
saved_errno = errno;
|
saved_errno = errno;
|
||||||
close(s);
|
close(s);
|
||||||
@ -307,7 +307,7 @@ netannounce(int domain, int proto, const char *local, const char *bind_dev, int
|
|||||||
opt = 0;
|
opt = 0;
|
||||||
else
|
else
|
||||||
opt = 1;
|
opt = 1;
|
||||||
if (setsockopt(s, IPPROTO_IPV6, IPV6_V6ONLY,
|
if (setsockopt(s, IPPROTO_IPV6, IPV6_V6ONLY,
|
||||||
(char *) &opt, sizeof(opt)) < 0) {
|
(char *) &opt, sizeof(opt)) < 0) {
|
||||||
saved_errno = errno;
|
saved_errno = errno;
|
||||||
close(s);
|
close(s);
|
||||||
@ -327,7 +327,7 @@ netannounce(int domain, int proto, const char *local, const char *bind_dev, int
|
|||||||
}
|
}
|
||||||
|
|
||||||
freeaddrinfo(res);
|
freeaddrinfo(res);
|
||||||
|
|
||||||
if (proto == SOCK_STREAM) {
|
if (proto == SOCK_STREAM) {
|
||||||
if (listen(s, INT_MAX) < 0) {
|
if (listen(s, INT_MAX) < 0) {
|
||||||
saved_errno = errno;
|
saved_errno = errno;
|
||||||
|
@ -49,12 +49,12 @@
|
|||||||
# define htole16(x) OSSwapHostToLittleInt16(x)
|
# define htole16(x) OSSwapHostToLittleInt16(x)
|
||||||
# define be16toh(x) OSSwapBigToHostInt16(x)
|
# define be16toh(x) OSSwapBigToHostInt16(x)
|
||||||
# define le16toh(x) OSSwapLittleToHostInt16(x)
|
# define le16toh(x) OSSwapLittleToHostInt16(x)
|
||||||
|
|
||||||
# define htobe32(x) OSSwapHostToBigInt32(x)
|
# define htobe32(x) OSSwapHostToBigInt32(x)
|
||||||
# define htole32(x) OSSwapHostToLittleInt32(x)
|
# define htole32(x) OSSwapHostToLittleInt32(x)
|
||||||
# define be32toh(x) OSSwapBigToHostInt32(x)
|
# define be32toh(x) OSSwapBigToHostInt32(x)
|
||||||
# define le32toh(x) OSSwapLittleToHostInt32(x)
|
# define le32toh(x) OSSwapLittleToHostInt32(x)
|
||||||
|
|
||||||
# define htobe64(x) OSSwapHostToBigInt64(x)
|
# define htobe64(x) OSSwapHostToBigInt64(x)
|
||||||
# define htole64(x) OSSwapHostToLittleInt64(x)
|
# define htole64(x) OSSwapHostToLittleInt64(x)
|
||||||
# define be64toh(x) OSSwapBigToHostInt64(x)
|
# define be64toh(x) OSSwapBigToHostInt64(x)
|
||||||
@ -95,12 +95,12 @@
|
|||||||
# define htole16(x) (x)
|
# define htole16(x) (x)
|
||||||
# define be16toh(x) ntohs(x)
|
# define be16toh(x) ntohs(x)
|
||||||
# define le16toh(x) (x)
|
# define le16toh(x) (x)
|
||||||
|
|
||||||
# define htobe32(x) htonl(x)
|
# define htobe32(x) htonl(x)
|
||||||
# define htole32(x) (x)
|
# define htole32(x) (x)
|
||||||
# define be32toh(x) ntohl(x)
|
# define be32toh(x) ntohl(x)
|
||||||
# define le32toh(x) (x)
|
# define le32toh(x) (x)
|
||||||
|
|
||||||
# define htobe64(x) htonll(x)
|
# define htobe64(x) htonll(x)
|
||||||
# define htole64(x) (x)
|
# define htole64(x) (x)
|
||||||
# define be64toh(x) ntohll(x)
|
# define be64toh(x) ntohll(x)
|
||||||
@ -113,12 +113,12 @@
|
|||||||
# define htole16(x) __builtin_bswap16(x)
|
# define htole16(x) __builtin_bswap16(x)
|
||||||
# define be16toh(x) (x)
|
# define be16toh(x) (x)
|
||||||
# define le16toh(x) __builtin_bswap16(x)
|
# define le16toh(x) __builtin_bswap16(x)
|
||||||
|
|
||||||
# define htobe32(x) (x)
|
# define htobe32(x) (x)
|
||||||
# define htole32(x) __builtin_bswap32(x)
|
# define htole32(x) __builtin_bswap32(x)
|
||||||
# define be32toh(x) (x)
|
# define be32toh(x) (x)
|
||||||
# define le32toh(x) __builtin_bswap32(x)
|
# define le32toh(x) __builtin_bswap32(x)
|
||||||
|
|
||||||
# define htobe64(x) (x)
|
# define htobe64(x) (x)
|
||||||
# define htole64(x) __builtin_bswap64(x)
|
# define htole64(x) __builtin_bswap64(x)
|
||||||
# define be64toh(x) (x)
|
# define be64toh(x) (x)
|
||||||
@ -173,4 +173,3 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
14
src/queue.h
14
src/queue.h
@ -36,7 +36,7 @@
|
|||||||
#define _SYS_QUEUE_H_
|
#define _SYS_QUEUE_H_
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This file defines five types of data structures: singly-linked lists,
|
* This file defines five types of data structures: singly-linked lists,
|
||||||
* lists, simple queues, tail queues, and circular queues.
|
* lists, simple queues, tail queues, and circular queues.
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
@ -95,15 +95,15 @@
|
|||||||
struct name { \
|
struct name { \
|
||||||
struct type *slh_first; /* first element */ \
|
struct type *slh_first; /* first element */ \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define SLIST_HEAD_INITIALIZER(head) \
|
#define SLIST_HEAD_INITIALIZER(head) \
|
||||||
{ NULL }
|
{ NULL }
|
||||||
|
|
||||||
#define SLIST_ENTRY(type) \
|
#define SLIST_ENTRY(type) \
|
||||||
struct { \
|
struct { \
|
||||||
struct type *sle_next; /* next element */ \
|
struct type *sle_next; /* next element */ \
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Singly-linked List access methods.
|
* Singly-linked List access methods.
|
||||||
*/
|
*/
|
||||||
@ -318,8 +318,8 @@ struct { \
|
|||||||
struct type **tqe_prev; /* address of previous next element */ \
|
struct type **tqe_prev; /* address of previous next element */ \
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* tail queue access methods
|
* tail queue access methods
|
||||||
*/
|
*/
|
||||||
#define TAILQ_FIRST(head) ((head)->tqh_first)
|
#define TAILQ_FIRST(head) ((head)->tqh_first)
|
||||||
#define TAILQ_END(head) NULL
|
#define TAILQ_END(head) NULL
|
||||||
@ -426,7 +426,7 @@ struct { \
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Circular queue access methods
|
* Circular queue access methods
|
||||||
*/
|
*/
|
||||||
#define CIRCLEQ_FIRST(head) ((head)->cqh_first)
|
#define CIRCLEQ_FIRST(head) ((head)->cqh_first)
|
||||||
#define CIRCLEQ_LAST(head) ((head)->cqh_last)
|
#define CIRCLEQ_LAST(head) ((head)->cqh_last)
|
||||||
|
@ -54,7 +54,7 @@ main(int argc, char **argv)
|
|||||||
const char sha256String[] = "This is a SHA256 test.";
|
const char sha256String[] = "This is a SHA256 test.";
|
||||||
const char sha256Digest[] = "4816482f8b4149f687a1a33d61a0de6b611364ec0fb7adffa59ff2af672f7232"; /* echo -n "This is a SHA256 test." | shasum -a256 */
|
const char sha256Digest[] = "4816482f8b4149f687a1a33d61a0de6b611364ec0fb7adffa59ff2af672f7232"; /* echo -n "This is a SHA256 test." | shasum -a256 */
|
||||||
char sha256Output[65];
|
char sha256Output[65];
|
||||||
|
|
||||||
sha256(sha256String, sha256Output);
|
sha256(sha256String, sha256Output);
|
||||||
assert(strcmp(sha256Output, sha256Digest) == 0);
|
assert(strcmp(sha256Output, sha256Digest) == 0);
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ timer_proc( TimerClientData client_data, struct iperf_time* nowP )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
main(int argc, char **argv)
|
main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
Timer *tp;
|
Timer *tp;
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
#include "iperf.h"
|
#include "iperf.h"
|
||||||
#include "units.h"
|
#include "units.h"
|
||||||
|
|
||||||
int
|
int
|
||||||
main(int argc, char **argv)
|
main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
iperf_size_t llu;
|
iperf_size_t llu;
|
||||||
|
@ -27,9 +27,9 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* routines related to collection TCP_INFO using getsockopt()
|
* routines related to collection TCP_INFO using getsockopt()
|
||||||
*
|
*
|
||||||
* Brian Tierney, ESnet (bltierney@es.net)
|
* Brian Tierney, ESnet (bltierney@es.net)
|
||||||
*
|
*
|
||||||
* Note that this is only really useful on Linux.
|
* Note that this is only really useful on Linux.
|
||||||
* XXX: only standard on linux versions 2.4 and later
|
* XXX: only standard on linux versions 2.4 and later
|
||||||
#
|
#
|
||||||
@ -75,7 +75,7 @@ has_tcpinfo_retransmits(void)
|
|||||||
#if defined(linux) && defined(TCP_MD5SIG)
|
#if defined(linux) && defined(TCP_MD5SIG)
|
||||||
/* TCP_MD5SIG doesn't actually have anything to do with TCP
|
/* TCP_MD5SIG doesn't actually have anything to do with TCP
|
||||||
** retransmits, it just showed up in the same rev of the header
|
** retransmits, it just showed up in the same rev of the header
|
||||||
** file. If it's present then struct tcp_info has the
|
** file. If it's present then struct tcp_info has the
|
||||||
** tcpi_total_retrans field that we need; if not, not.
|
** tcpi_total_retrans field that we need; if not, not.
|
||||||
*/
|
*/
|
||||||
return 1;
|
return 1;
|
||||||
@ -220,7 +220,7 @@ build_tcpinfo_message(struct iperf_interval_results *r, char *message)
|
|||||||
#if defined(linux) && defined(TCP_INFO)
|
#if defined(linux) && defined(TCP_INFO)
|
||||||
sprintf(message, report_tcpInfo, r->tcpInfo.tcpi_snd_cwnd, r->tcpInfo.tcpi_snd_ssthresh,
|
sprintf(message, report_tcpInfo, r->tcpInfo.tcpi_snd_cwnd, r->tcpInfo.tcpi_snd_ssthresh,
|
||||||
r->tcpInfo.tcpi_rcv_ssthresh, r->tcpInfo.tcpi_unacked, r->tcpInfo.tcpi_sacked,
|
r->tcpInfo.tcpi_rcv_ssthresh, r->tcpInfo.tcpi_unacked, r->tcpInfo.tcpi_sacked,
|
||||||
r->tcpInfo.tcpi_lost, r->tcpInfo.tcpi_retrans, r->tcpInfo.tcpi_fackets,
|
r->tcpInfo.tcpi_lost, r->tcpInfo.tcpi_retrans, r->tcpInfo.tcpi_fackets,
|
||||||
r->tcpInfo.tcpi_rtt, r->tcpInfo.tcpi_reordering);
|
r->tcpInfo.tcpi_rtt, r->tcpInfo.tcpi_reordering);
|
||||||
#endif
|
#endif
|
||||||
#if defined(__FreeBSD__) && defined(TCP_INFO)
|
#if defined(__FreeBSD__) && defined(TCP_INFO)
|
||||||
|
@ -203,7 +203,7 @@ void
|
|||||||
tmr_reset( struct iperf_time* nowP, Timer* t )
|
tmr_reset( struct iperf_time* nowP, Timer* t )
|
||||||
{
|
{
|
||||||
struct iperf_time now;
|
struct iperf_time now;
|
||||||
|
|
||||||
getnow( nowP, &now );
|
getnow( nowP, &now );
|
||||||
t->time = now;
|
t->time = now;
|
||||||
iperf_time_add_usecs( &t->time, t->usecs );
|
iperf_time_add_usecs( &t->time, t->usecs );
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
#
|
#
|
||||||
# This is a set of commands to run and verify they work before doing a new release.
|
# This is a set of commands to run and verify they work before doing a new release.
|
||||||
# Eventually they should also use the -J flag to generate JSON output, and a program should
|
# Eventually they should also use the -J flag to generate JSON output, and a program should
|
||||||
# be written to check the output.
|
# be written to check the output.
|
||||||
# Be sure to test both client and server on Linux, BSD, and OSX
|
# Be sure to test both client and server on Linux, BSD, and OSX
|
||||||
#
|
#
|
||||||
@ -35,7 +35,7 @@ host=$1
|
|||||||
# SCTP
|
# SCTP
|
||||||
./src/iperf3 -c "$host" --sctp -V -t 5
|
./src/iperf3 -c "$host" --sctp -V -t 5
|
||||||
# parallel streams
|
# parallel streams
|
||||||
./src/iperf3 -c "$host" -P 3 -t 5
|
./src/iperf3 -c "$host" -P 3 -t 5
|
||||||
./src/iperf3 -c "$host" -u -P 3 -t 5
|
./src/iperf3 -c "$host" -u -P 3 -t 5
|
||||||
# reverse mode
|
# reverse mode
|
||||||
./src/iperf3 -c "$host" -P 2 -t 5 -R
|
./src/iperf3 -c "$host" -P 2 -t 5 -R
|
||||||
@ -44,12 +44,12 @@ host=$1
|
|||||||
./src/iperf3 -c "$host" -P 2 -t 5 --bidir
|
./src/iperf3 -c "$host" -P 2 -t 5 --bidir
|
||||||
./src/iperf3 -c "$host" -u -P 2 -t 5 --bidir
|
./src/iperf3 -c "$host" -u -P 2 -t 5 --bidir
|
||||||
# zero copy
|
# zero copy
|
||||||
./src/iperf3 -c "$host" -Z -t 5
|
./src/iperf3 -c "$host" -Z -t 5
|
||||||
./src/iperf3 -c "$host" -Z -t 5 -R
|
./src/iperf3 -c "$host" -Z -t 5 -R
|
||||||
# window size
|
# window size
|
||||||
./src/iperf3 -c "$host" -t 5 -w 8M
|
./src/iperf3 -c "$host" -t 5 -w 8M
|
||||||
# -n flag
|
# -n flag
|
||||||
./src/iperf3 -c "$host" -n 5M
|
./src/iperf3 -c "$host" -n 5M
|
||||||
./src/iperf3 -c "$host" -n 5M -u -b1G
|
./src/iperf3 -c "$host" -n 5M -u -b1G
|
||||||
# -n flag with -R
|
# -n flag with -R
|
||||||
./src/iperf3 -c "$host" -n 5M -R
|
./src/iperf3 -c "$host" -n 5M -R
|
||||||
@ -57,7 +57,7 @@ host=$1
|
|||||||
# conflicting -n -t flags
|
# conflicting -n -t flags
|
||||||
./src/iperf3 -c "$host" -n 5M -t 5
|
./src/iperf3 -c "$host" -n 5M -t 5
|
||||||
# -k mode
|
# -k mode
|
||||||
./src/iperf3 -c "$host" -k 1K
|
./src/iperf3 -c "$host" -k 1K
|
||||||
./src/iperf3 -c "$host" -k 1K -u -b1G
|
./src/iperf3 -c "$host" -k 1K -u -b1G
|
||||||
# -k mode with -R
|
# -k mode with -R
|
||||||
./src/iperf3 -c "$host" -k 1K -R
|
./src/iperf3 -c "$host" -k 1K -R
|
||||||
@ -71,5 +71,3 @@ host=$1
|
|||||||
./src/iperf3 -c "$host" -M 1000 -V
|
./src/iperf3 -c "$host" -M 1000 -V
|
||||||
# test congestion control option (linux only)
|
# test congestion control option (linux only)
|
||||||
./src/iperf3 -c "$host" -C reno -V
|
./src/iperf3 -c "$host" -C reno -V
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user