-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathexperiment-vary-rtt
executable file
·66 lines (55 loc) · 2.12 KB
/
experiment-vary-rtt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/bin/bash
resdir=VaryRTT
source utils
if [[ $1 == "run" ]]; then
if [[ ! -d $resdir ]]; then
mkdir $resdir
fi
for rtt in 1 300 50 250 100 200 150; do
for rat in "rats/fig4-rtt/150-alone.dna.2" "rats/fig4-rtt/rtt_20x.dna.4" "rats/fig4-rtt/140-160.dna.5"; do
rat_nice=`expr "$rat" : ".*/\([^/]*\)"`
./long-run.sh run remy ~/traces/trace-32Mbps $(( $rtt / 2 )) 0 $resdir 2:exponential 0 $rat
if [[ -d $resdir/remy-$rat::$rtt ]]; then
mv $resdir/remy-$rat::$rtt $resdir/old-remy-$rat_nice::$rtt
echo "Warning: directory '$resdir/remy-$rat::$rtt' already present"
fi
mv $resdir/remy $resdir/remy-$rat_nice::$rtt
done
done
elif [[ $1 == "graph" ]]; then
if [[ -d $resdir/graphdir ]]; then
trash $resdir/graphdir
fi
mkdir $resdir/graphdir
for file in $resdir/*; do
if [[ $file == *old* ]] || [[ $file == *graphdir ]]; then
continue
fi
nice_name=`expr "$file" : ".*/\([^/]*\)"`
protocol=`expr "$nice_name" : "\([^-]*\)\-.*"`
protocol_long=`expr "$nice_name" : "\([^:]*\)::.*"`
min_rtt=`expr "$nice_name" : ".*::\([0-9]*\)"`
read_genericcc_output $file/$protocol.stdout
echo $min_rtt $throughput $delay >>$resdir/graphdir/$protocol_long
done
printf "
set terminal svg fsize 14; set output '$resdir/graphdir/rtt-tpt.svg'
set xlabel 'Min. RTT (ms)'; set ylabel 'Throughput (Mbps)';
plot " >$resdir/graphdir/rtt-tpt.gnuplot
printf "
set terminal svg fsize 14; set output '$resdir/graphdir/rtt-del.svg'
set xlabel 'Min. RTT (ms)'; set ylabel 'Queuing Delay (ms)';
plot " >$resdir/graphdir/rtt-del.gnuplot
for file in $resdir/graphdir/*; do
if [[ $file == *.gnuplot ]]; then continue; fi
sort -n $file >$file-tmp
mv $file-tmp $file
printf "'$file' using 1:(\$2 * 8 / 1000000) with lines, ">>$resdir/graphdir/rtt-tpt.gnuplot
printf "'$file' using 1:(\$3 * 1000 - \$1) with lines, ">>$resdir/graphdir/rtt-del.gnuplot
done
gnuplot -p $resdir/graphdir/rtt-tpt.gnuplot
gnuplot -p $resdir/graphdir/rtt-del.gnuplot
else
echo "Unexpected command '$1'."
echo "Expected one of [run|graph]."
fi