38 lines
608 B
Bash
38 lines
608 B
Bash
|
#!/bin/sh
|
||
|
|
||
|
set -x
|
||
|
|
||
|
if [ $# -ne 2 ]; then
|
||
|
echo "$0 host ip"
|
||
|
echo "host and ip of the iperf server"
|
||
|
fi
|
||
|
|
||
|
host=$1; shift
|
||
|
port=$1; shift
|
||
|
|
||
|
flags="-p $port -O 10 -t 190"
|
||
|
fbase="iperf-to-${host}"
|
||
|
|
||
|
if echo $host | grep -q ':'; then
|
||
|
flags="$flags -6"
|
||
|
fbase="${fbase}-from-v6"
|
||
|
else
|
||
|
flags="$flags -4"
|
||
|
fbase="${fbase}-from-v4"
|
||
|
fi
|
||
|
|
||
|
do_benchmark()
|
||
|
{
|
||
|
full_flags="$@"
|
||
|
iperf3_flags=$(echo $flags | sed 's/ //g')
|
||
|
filename="${fbase}-${iperf3_flags}"
|
||
|
|
||
|
iperf3 $flags -P$p | tee "${filename}"
|
||
|
|
||
|
}
|
||
|
|
||
|
for p in 1 10 20 50; do
|
||
|
do_benchmark $flags -P$p
|
||
|
do_benchmark $flags -P$p -u -b0
|
||
|
done
|