-
Notifications
You must be signed in to change notification settings - Fork 1
/
launch_config.sh
123 lines (104 loc) · 2.28 KB
/
launch_config.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
#/bin/bash!
#BenchmarkingHosts:
IPS[0]="172.16.45.17"
#IPS[1]="192.168.42.22"
#IPS[2]="192.168.42.31"
#IPS[3]="192.168.42.32"
EXPECTED_ARGS=2
if [ $# -ne $EXPECTED_ARGS ]
then
echo "Usage: 'launch.sh runCount Controllername'"
exit -1
fi
#scripts starting the controller
if [[ $2 == *"flood"* ]]
then
controllerstart=flood/start.sh
fi
if [[ $2 == *"nox"* ]]
then
controllerstart=nox/start.sh
fi
if [[ $2 == *"beacon"* ]]
then
controllerstart=beacon/start.sh
fi
if [[ $2 == *"pox"* ]]
then
controllerstart=pox/start.sh
fi
if [[ $2 == *"ryu"* ]]
then
controllerstart=ryu/start.sh
fi
if [[ $2 == *"openD"* ]]
then
controllerstart=openD/start.sh
fi
if [[ $2 == *"onos"* ]]
then
controllstart=onos/start.sh
fi
controller=$2
echo ">>Killing Controller"
./stop_controller.sh
sleep 3s
maxswitchnum=4
if [ ${#IPS[@]} -eq 2 ]
then
maxswitchnum=50
fi
if [ ${#IPS[@]} -eq 4 ]
then
maxswitchnum=25
fi
#runArray=$(seq 5 5 $maxswitchnum)
#runArray=("1" "${runArray[@]}")
#runArray=("${runArray[@]}" "${runArray[@]}")
runArray=4
for i in $(seq 1 1 $1)
do
#runs 1,5-maxswitchnum
for j in ${runArray[@]}
do
echo ">Run #$i, Switch #$j"
echo ">>Starting Controller"
$controllerstart
echo ">>Kill all alive BenchingTools"
for ip in ${IPS[@]}
do
ssh onos@${ip} killall -9 java
done
sleep 30s
echo ">>Start BenchingTools"
./tcpdumper.sh $i\.pcap
for ip in ${IPS[@]}
do
ssh onos@${ip} "~/ssh_redirector.sh $j"
done
sleep 50s
echo ">>Kill Controller"
./stop_controller.sh
./tcpstopper.sh
sleep 5s
echo ">>Moving Logfiles"
target=$(printf "%03d" $j)
for ip in ${IPS[@]}
do
ssh onos@${ip} mv "/home/onos/ofcprobe/MyLog.log" "/home/onos/ofcprobe/statistics/"
done
done
echo ">Moving statistics to statistics_$i"
./tcpmover.sh $controller
for ip in ${IPS[@]}
do
ssh onos@${ip} mv "/home/onos/ofcprobe/statistics/" "/home/onos/ofcprobe/statistics_$i/"
done
done
echo "Moving Statistics_* into new Dir and taring"
for ip in ${IPS[@]}
do
ssh onos@${ip} mkdir "/home/onos/ofcprobe/$controller"
ssh onos@${ip} mv "/home/onos/ofcprobe/statistics_*" "/home/onos/ofcprobe/$controller/"
# ssh openflow@${ip} tar czf "/home/openflow/ofcprobe_sdnflex/$controller.tar.gz" "/home/openflow/ofcprobe_sdnflex/$controller/" &
done