Improve Server Max Bit Rate Violation Messaging To Client
PLEASE NOTE the following text from the iperf3 license. Submitting a pull request to the iperf3 repository constitutes "[making] Enhancements available...publicly":
You are under no obligation whatsoever to provide any bug fixes, patches, or
upgrades to the features, functionality or performance of the source code
("Enhancements") to anyone; however, if you choose to make your Enhancements
available either publicly, or directly to Lawrence Berkeley National
Laboratory, without imposing a separate written license agreement for such
Enhancements, then you hereby grant the following license: a non-exclusive,
royalty-free perpetual license to install, use, modify, prepare derivative
works, incorporate into other computer software, distribute, and sublicense
such enhancements or derivative works thereof, in binary and source code form.
The complete iperf3 license is available in the LICENSE file in the
top directory of the iperf3 source tree.
-
Version of iperf3 (or development branch, such as
masteror3.1-STABLE) to which this pull request applies: master -
Issues fixed (if any): #937
-
Brief description of code changes (suitable for use as a commit message):
As per the ongoing discussion in iperf/#1684, as part of an effort to enhance the user experience of iperf3 clients, the enhancement proposed is to validate the client's input parameter for --bitrate when it is set and reject the measurement when it violates the server's configured --server-bitrate-limit value. When the client does not provide a limit and the test violates the configured bit rate, then the server should send an informative message to the client to indicate why the test was abruptly stopped.
Client's Requested Bit Rate Exceeds Server's Max
server
./src/iperf3 -s --server-bitrate-limit 5Mbit/1sec
-----------------------------------------------------------
Server listening on 5201 (test #1)
-----------------------------------------------------------
iperf3: error - client's requested bit rate exceeds the server's bitrate limit
-----------------------------------------------------------
Server listening on 5201 (test #2)
-----------------------------------------------------------
client
./src/iperf3 -c 127.0.0.1 --time 5 --parallel 4 --bitrate 10Mbit/1sec
Connecting to host 127.0.0.1, port 5201
iperf3: error - client's requested bit rate exceeds the server's bitrate limit
Client's Bit Rate Exceeds Server's Max Circumstantially
server
./src/iperf3 -s --server-bitrate-limit 5Mbit/1sec
-----------------------------------------------------------
Server listening on 5201 (test #1)
-----------------------------------------------------------
Accepted connection from 127.0.0.1, port 33512
[ 5] local 127.0.0.1 port 5201 connected to 127.0.0.1 port 33518
[ 8] local 127.0.0.1 port 5201 connected to 127.0.0.1 port 33526
[ 10] local 127.0.0.1 port 5201 connected to 127.0.0.1 port 33540
[ 12] local 127.0.0.1 port 5201 connected to 127.0.0.1 port 33544
[ ID] Interval Transfer Bitrate
[ 5] 0.00-1.01 sec 1.15 GBytes 9.86 Gbits/sec
[ 8] 0.00-1.01 sec 1.33 GBytes 11.4 Gbits/sec
[ 10] 0.00-1.01 sec 1.32 GBytes 11.2 Gbits/sec
[ 12] 0.00-1.01 sec 1.23 GBytes 10.5 Gbits/sec
[SUM] 0.00-1.01 sec 5.03 GBytes 43.0 Gbits/sec
iperf3: error - total required bandwidth is larger than server limit
-----------------------------------------------------------
Server listening on 5201 (test #2)
-----------------------------------------------------------
client
./src/iperf3 -c 127.0.0.1 --time 5 --parallel 4
Connecting to host 127.0.0.1, port 5201
[ 5] local 127.0.0.1 port 33518 connected to 127.0.0.1 port 5201
[ 7] local 127.0.0.1 port 33526 connected to 127.0.0.1 port 5201
[ 9] local 127.0.0.1 port 33540 connected to 127.0.0.1 port 5201
[ 11] local 127.0.0.1 port 33544 connected to 127.0.0.1 port 5201
[ ID] Interval Transfer Bitrate Retr Cwnd
[ 5] 0.00-1.00 sec 1.15 GBytes 9.86 Gbits/sec 0 1.12 MBytes
[ 7] 0.00-1.01 sec 1.33 GBytes 11.3 Gbits/sec 0 1023 KBytes
[ 9] 0.00-1.01 sec 1.32 GBytes 11.2 Gbits/sec 0 1.69 MBytes
[ 11] 0.00-1.01 sec 1.24 GBytes 10.6 Gbits/sec 0 1.56 MBytes
[SUM] 0.00-1.00 sec 5.05 GBytes 43.2 Gbits/sec 0
iperf3: error - total required bandwidth is larger than server limit