diff --git a/tests/tcp/01-iperf-advanced.npf b/tests/tcp/01-iperf-advanced.npf new file mode 100644 index 0000000..fd5b89d --- /dev/null +++ b/tests/tcp/01-iperf-advanced.npf @@ -0,0 +1,28 @@ +%info +IPerf 2 Throughput Experiment + +%config +n_runs=5 +var_names+={PARALLEL:Number of parallel connections,WINDOW:Window size (kB),NODELAY:No delay option,CONGESTION:Congestion control} +timeout=25 +default_repo=iperf + +%import graph-beautiful + +%variables +PARALLEL=[1-8] +WINDOW=[1*32768] +CONGESTION={bbr,cubic,vegas,newreno} +NODELAY={-N:Nagle disabled,:Nagle enabled} +TIME={2,10} + +fastregression:PARALLEL={1,8} +fastregression:CONGESTION=cubic +fastregression:TIME=2 + +%script@server +iperf -s + +%script@client delay=1 +result=$(iperf -w ${WINDOW}k -t $TIME -P $PARALLEL $NODELAY -Z $CONGESTION -c ${server:0:ip} | tail -n 3 | grep -ioE "[0-9.]+ [kmg]bits") +echo "RESULT-THROUGHPUT $result" diff --git a/tests/tcp/01-iperf.npf b/tests/tcp/01-iperf.npf index 1bf00d2..60b3a62 100644 --- a/tests/tcp/01-iperf.npf +++ b/tests/tcp/01-iperf.npf @@ -3,23 +3,25 @@ IPerf 2 Throughput Experiment %config n_runs=5 -var_names+={PARALLEL:Number of parallel connexions,ZEROCOPY:Zero-Copy} +var_names+={PARALLEL:Number of parallel connections,WINDOW:Window size (kB),THROUGHPUT:Throughput (Gbps)} timeout=25 default_repo=iperf2 - +graph_background=7 %import graph-beautiful %variables PARALLEL=[1-8] -ZEROCOPY={:without,-Z:with} +WINDOW={16,512} TIME=2 -fastregression:PARALLEL={1,8} - %script@server iperf -s -%script@client delay=2 -result=$(iperf -f k -t $TIME -P $PARALLEL $ZEROCOPY -c ${server:0:ip} | tail -n 3 | grep -ioE "[0-9.]+ [kmg]bits") +%script@client delay=1 +//Launch the program, copy the output to a log +iperf -c ${server:0:ip} -w ${WINDOW}k -t $TIME -P $PARALLEL 2>&1 | tee iperf.log +//Parse the log to find the throughput +result=$(cat iperf.log | grep -ioE "[0-9.]+ [kmg]bits" | tail -n 1) +//Give the throughput to NPF through stdout echo "RESULT-THROUGHPUT $result" diff --git a/tests/tcp/02-iperf3.npf b/tests/tcp/03-iperf3.npf similarity index 76% rename from tests/tcp/02-iperf3.npf rename to tests/tcp/03-iperf3.npf index 04ffe15..ede8074 100644 --- a/tests/tcp/02-iperf3.npf +++ b/tests/tcp/03-iperf3.npf @@ -22,5 +22,5 @@ fastregression:PARALLEL={1,8} iperf3 -s %script@client delay=2 -result=$(iperf3 -f k -t $TIME -P $PARALLEL $ZEROCOPY -c ${server:0:ip} | tail -n 3 | grep -ioE "[0-9.]+ [kmg]bits") +result=$(iperf3 -c ${server:0:ip} -f k -t $TIME -P $PARALLEL $ZEROCOPY | grep -ioE "[0-9.]+ [kmg]bits" | tail -n 1) echo "RESULT-THROUGHPUT $result"