master-thesis/bin/run-benchmark.sh

40 lines
697 B
Bash
Raw Normal View History

2019-08-15 10:16:27 +00:00
#!/bin/sh
set -x
2019-08-15 10:26:49 +00:00
if [ $# -ne 3 ]; then
echo "$0 prefix host ip"
2019-08-15 10:16:27 +00:00
echo "host and ip of the iperf server"
fi
2019-08-15 10:26:49 +00:00
prefix=$1; shift
2019-08-15 10:16:27 +00:00
host=$1; shift
port=$1; shift
2019-08-15 10:19:51 +00:00
flags="-c ${host} -p $port -O 10 -t 190"
2019-08-15 10:26:49 +00:00
fbase="iperf-${prefix}"
2019-08-15 10:16:27 +00:00
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="$@"
2019-08-15 10:19:51 +00:00
iperf3_flags=$(echo $full_flags | sed 's/ //g')
2019-08-15 10:16:27 +00:00
2019-08-15 10:26:49 +00:00
for run in 1 2 3; do
filename="${fbase}${iperf3_flags}-run${run}"
iperf3 $full_flags | tee "${filename}"
done
2019-08-15 10:16:27 +00:00
}
for p in 1 10 20 50; do
do_benchmark $flags -P$p
do_benchmark $flags -P$p -u -b0
done