-
Notifications
You must be signed in to change notification settings - Fork 1
/
run_experiments.sh
executable file
·52 lines (40 loc) · 1.57 KB
/
run_experiments.sh
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
#! /bin/bash
resultdir="results"
mkdir -p "$resultdir"
# Repeat 22 times with different RNG to have plenty of data.
maxrun=21
# Parallelization
procs=${1:-1} # 1 process per default
# Build modules once, then run without building.
waf build
function exprun {
# First arg: rng run, secong arg: experiment name.
# Run with some default settings
cmd="NS_GLOBAL_VALUE=\"RngRun=$1\" waf --run-no-build \"trafficgen ${@:3} --prefix=$resultdir/$2_$1\""
echo "STARTING $2($1):"
echo "$cmd"
output=$(eval "$cmd" 2>&1)
output="OUTPUT $2($1):\n${output}\n"
printf "$output"
}
export -f exprun # make it visible for xargs
export resultdir # same same
function run { # First argument is experiment name, others are passed through.
args=$@
seq 0 $maxrun | xargs --max-procs $procs -n1 -I {} bash -c "exprun {} $args"
}
# Simulate different traffic mixes
# By default, for each workload we start 20 apps that send a combined
# 20 Mbps, and the link capacity is 30 Mbps (66% utilization on average).
run "w1" --w1=1 --w2=0 --w3=0 --congestion=0
run "w2" --w1=0 --w2=1 --w3=0 --congestion=0
run "w3" --w1=0 --w2=0 --w3=1 --congestion=0
# Also simulate congestion levels
# 100% average network utilization
run "w1_c100" --w1=1 --w2=0 --w3=0 --congestion=10Mbps
run "w2_c100" --w1=0 --w2=1 --w3=0 --congestion=10Mbps
run "w3_c100" --w1=0 --w2=0 --w3=1 --congestion=10Mbps
# 133% average network utilization
run "w1_c133" --w1=1 --w2=0 --w3=0 --congestion=20Mbps
run "w2_c133" --w1=0 --w2=1 --w3=0 --congestion=20Mbps
run "w3_c133" --w1=0 --w2=0 --w3=1 --congestion=20Mbps