Skip to content

Commit

Permalink
Added start scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
mjarschel committed Feb 25, 2014
1 parent 976bab3 commit de69d23
Show file tree
Hide file tree
Showing 11 changed files with 143 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Start scripts/On Controller Host/beacon/start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#/bin/bash!
cd /home/openflow/controller/beacon-1.0.2/
screen -AmdS beacon bash -c './beacon configuration configurationSwitch'
3 changes: 3 additions & 0 deletions Start scripts/On Controller Host/beacon/stop.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#/bin/bash
#killall -9 screen
killall -9 beacon
4 changes: 4 additions & 0 deletions Start scripts/On Controller Host/flood/start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#/bin/bash
cd ~/controller/floodlight/target/
#cd ~/controller/latest_floodlight/target/
screen -AmdS floodlight sudo java -jar floodlight.jar
3 changes: 3 additions & 0 deletions Start scripts/On Controller Host/flood/stop.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#/bin/bash
#killall -9 screen
sudo killall -9 java
105 changes: 105 additions & 0 deletions Start scripts/On Controller Host/launch_config.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
#/bin/bash!
#BenchmarkingHosts:
IPS[0]="192.168.42.21"
#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

controller=$2
echo ">>Killing Controller"
stop_controller.sh
sleep 3s

maxswitchnum=100
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[@]}")


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 openflow@${ip} killall -9 java
done
sleep 8s

echo ">>Start BenchingTools"
for ip in ${IPS[@]}
do
ssh openflow@${ip} "~/ssh_redirector.sh $j"
done
sleep 111s

echo ">>Kill Controller"
stop_controller.sh
sleep 5s

echo ">>Moving Logfiles"
target=$(printf "%03d" $j)
for ip in ${IPS[@]}
do
ssh openflow@${ip} mv "/home/openflow/ofcprobe/MyLog.log" "/home/openflow/ofcprobe/statistics/$target/"
done
done

echo ">Moving statistics to statistics_$i"
for ip in ${IPS[@]}
do
ssh openflow@${ip} mv "/home/openflow/ofcprobe/statistics/" "/home/openflow/ofcprobe/statistics_$i/"
done

done

echo "Moving Statistics_* into new Dir and taring"
for ip in ${IPS[@]}
do
ssh openflow@${ip} mkdir "/home/openflow/ofcprobe/$controller"
ssh openflow@${ip} mv "/home/openflow/ofcprobe/statistics_*" "/home/openflow/ofcprobe/$controller/"
# ssh openflow@${ip} tar czf "/home/openflow/ofcprobe/$controller.tar.gz" "/home/openflow/ofcprobe/$controller/" &
done
4 changes: 4 additions & 0 deletions Start scripts/On Controller Host/nox/start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#/bin/bash
cd ~/controller/nox/build/src/
screen -AmdS nox bash -c './nox_core -t 4 -i ptcp: switch'
#screen -AmdS nox bash -c './nox_core -t 4 -i ptcp: openflow-manager'
1 change: 1 addition & 0 deletions Start scripts/On Controller Host/nox/stop.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sudo killall lt-nox_core
4 changes: 4 additions & 0 deletions Start scripts/On Controller Host/pox/start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#/bin/bash
cd ~/controller/pox/
screen -AmdS pox bash -c './pox.py forwarding.l2_learning'
#screen -AmdS pox bash -c './pox.py forwarding.l2_learning topology openflow.discovery openflow.topology'
3 changes: 3 additions & 0 deletions Start scripts/On Controller Host/pox/stop.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#/bin/bash
#killall -9 screen
sudo killall -9 python2.7
9 changes: 9 additions & 0 deletions Start scripts/On Controller Host/stop_controller.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#/bin/bash!
cd /home/openflow/controller/remote/flood/
./stop.sh
cd /home/openflow/controller/remote/nox/
./stop.sh
cd /home/openflow/controller/remote/beacon/
./stop.sh
cd /home/openflow/controller/remote/pox/
./stop.sh
4 changes: 4 additions & 0 deletions Start scripts/On OFCProbe Host/ssh_redirector.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#/bin/bash!
#path containing ofcprobe.jar
cd /home/openflow/ofcprobe/
screen -AmdS ofcprobe bash -c "java -jar ofcprobe.jar config.ini $1"

0 comments on commit de69d23

Please sign in to comment.