Commit bb2f486e authored by Binh Nguyen's avatar Binh Nguyen

Add scripts

parent 791021b9
......@@ -25,6 +25,10 @@ echo "==========Starting eNBs and MF .... ============"
cd $EPC
bash $EPC/restart_epc.sh
echo "==========Copying IMSI data into $DATA ==========="
scp -o StrictHostKeyChecking=no 'epc.$domain:/tmp/IMSI_*' /tmp/
sudo cp /tmp/IMSI_* $DATA/
echo "==========Starting MC .... ============"
cd $MC_PATH
sudo pip install MySQL-python
......
......@@ -40,10 +40,11 @@ sudo sed -i "s/CELLID/$cellid/g" /opt/OpenEPC/etc/enodeb-ip.xml
sudo sed -i "s/eNodeB/$enb_name/g" /opt/OpenEPC/etc/enodeb-ip.xml
sudo sed -i "s/MGN/$mgn/g" /opt/OpenEPC/etc/enodeb-ip.xml
sudo cp /opt/OpenEPC/etc/enodeb.xml /opt/OpenEPC/etc/enodeb.bk.xml
sudo cp /opt/OpenEPC/etc/enodeb-ip.xml /opt/OpenEPC/etc/enodeb.xml
cd $SIMECA_EPC/wharf_rel5
screen -S enode -L -d -m -h 10000 /bin/bash -c "./wharf -f /opt/OpenEPC/etc/enodeb-ip.xml"
screen -S enodeb -L -d -m -h 10000 /bin/bash -c "./wharf -f /opt/OpenEPC/etc/enodeb.xml"
screen -wipe
......
......@@ -3,7 +3,9 @@
domain=$(hostname | awk -F'.' '{print $2"."$3"."$4"."$5}')
for i in client1 epc penb1 enb2 enb3 access1 access2 access3 tor hsw1 server1
#for i in tor
do
ssh -YA -t -t $i.$domain "cd /usr/local/src; sudo -E git clone git@gitlab.flux.utah.edu:binh/simeca-minimum.git simeca"
ssh -YA -t -t $i.$domain "sudo rm -rf /usr/local/src/simeca"
ssh -YA -t -t $i.$domain "sudo rm -rf /usr/local/src/simeca; cd /usr/local/src; sudo -E git clone git@gitlab.flux.utah.edu:binh/simeca-minimum.git simeca"
done
......@@ -6,6 +6,7 @@ SQL="$E_PATH/load_clients.sql"
CLEAN_SQL="$E_PATH/clear_db.sql"
USER_DATA="$SIMECA_PATH/data/user.dat"
sudo mkdir -p $SIMECA_PATH/data
if [ $# -lt 2 ]; then
echo "Usage: <Starting ID> <Number of IMSI entries>"
exit 1
......@@ -33,4 +34,4 @@ done
#python $SCRIPTS/iot-controller-eval/e2e_delay_exp/generate_p2p_path.py
#cp $SCRIPTS/iot-controller-eval/P2P.data $SCRIPTS/iot-controller/
echo "Done! inserted $2 IMSIs to database. Added IMSIs to the offload database $SCRIPTS/iot-controller-eval/user.dat"
echo "Done! inserted $2 IMSIs to database. Added IMSIs to the offload database $USER_DATA"
......@@ -18,3 +18,4 @@ START_SCRIPTS="$SIMECA_PATH/start_scripts"
HSS_PROVISION="$SIMECA_PATH/hss_provision"
EPC="$SIMECA_PATH/epc"
XML="$SIMECA_PATH/xml"
DATA="$SIMECA_PATH/data"
......@@ -57,6 +57,8 @@ ENABLE_OVS_GTP = 0
class SMORE_controller(app_manager.RyuApp):
_SCRIPTS = "/usr/local/src/simeca/start_scripts"
XML = "/usr/local/src/simeca/xml"
XML_TEMPLATE = "%s/input-template-penb.xml" % (XML)
OFP_VERSIONS = [ofproto_v1_3.OFP_VERSION]
#OFP_VERSIONS = [ofproto_v1_0.OFP_VERSION]
_LISTEN_INF = "eth2" #Todo: should be SGW's net_d interface
......@@ -76,7 +78,6 @@ class SMORE_controller(app_manager.RyuApp):
tor_switch = None
hsw_switches = {}
XML_TEMPLATE = "input-template-penb.xml"
_CONTEXTS = {
'dpset': dpset.DPSet,
......@@ -247,8 +248,8 @@ class SMORE_controller(app_manager.RyuApp):
def _write_dpid_to_xml(self, xml_file):
#Replace HARDCODED dpid with new dpid
print "Replace input-template.xml with %s" % xml_file
subprocess.check_output(['sudo cp %s %s'%(self.XML_TEMPLATE,xml_file)], shell=True)
tree = ET.parse(xml_file) #hardcoding file name for now
subprocess.check_output(['sudo cp %s %s/%s'%(self.XML_TEMPLATE,self.XML, xml_file)], shell=True)
tree = ET.parse("%s/%s" % (self.XML,xml_file)) #hardcoding file name for now
xmlroot = tree.getroot()
name_to_olddpid = {}
name_to_newdpid = {}
......@@ -265,10 +266,10 @@ class SMORE_controller(app_manager.RyuApp):
#replace dpid
for name in name_to_olddpid:
subprocess.check_output(['sudo sed -i \'s/>%s</>%s</\' %s'%(name_to_olddpid[name],name_to_newdpid[name], xml_file)], shell=True)
subprocess.check_output(['sudo sed -i \'s/>%s</>%s</\' %s/%s'%(name_to_olddpid[name],name_to_newdpid[name], self.XML, xml_file)], shell=True)
#replace portnumber
for interfacename in self.interface_to_portnumber:
subprocess.check_output(['sudo sed -i \'s/>%s</>%s</\' %s'%(interfacename, self.interface_to_portnumber[interfacename], xml_file)], shell=True)
subprocess.check_output(['sudo sed -i \'s/>%s</>%s</\' %s/%s'%(interfacename, self.interface_to_portnumber[interfacename], self.XML, xml_file)], shell=True)
......
......@@ -43,6 +43,7 @@ LOG.setLevel(logging.INFO)
ENABLE_OVS_GTP = 0
class LocationRouting:
XML="/usr/local/src/simeca/xml"
switch_server_port = {}
access_switches = {}
switchname_to_dpid = {}
......@@ -519,7 +520,7 @@ class LocationRouting:
def createNetworkGraph(self, **kwargs):
self.G=nx.DiGraph()
#print "adding switches and hosts"
tree = ET.parse('input.xml') #hardcoding file name for now
tree = ET.parse('%s/input.xml'% self.XML) #hardcoding file name for now
xmlroot = tree.getroot()
for child in xmlroot.findall('switch'):
......
......@@ -65,7 +65,8 @@ supported_ofctl = {
class RestIoTApi(app_manager.RyuApp):
_SCRIPTS = "/usr/local/src/simeca/script"
_SCRIPTS = "/usr/local/src/simeca"
DATA="/usr/local/src/simeca/data"
_CONF = "/usr/local/src/simeca/CONF"
OFP_VERSIONS = [ofproto_v1_0.OFP_VERSION,
ofproto_v1_2.OFP_VERSION,
......@@ -198,9 +199,9 @@ class RestIoTApi(app_manager.RyuApp):
#Dispatcher.attached_ue_ip = open('../iot-controller-eval/e2e_delay_exp/ATTACHED_IP.data','w',0)
#Dispatcher.p2p_existed_ip = open('../iot-controller-eval/e2e_delay_exp/P2P_IP.data','w',0)
Dispatcher.get_imsi_server_name_map('%s/multiple_UEs/IMSI_1.data' % (self._SCRIPTS))
Dispatcher.get_imsi_server_name_map('%s/multiple_UEs/IMSI_2.data' % (self._SCRIPTS))
Dispatcher.get_imsi_server_name_map('%s/multiple_UEs/IMSI_3.data' % (self._SCRIPTS))
Dispatcher.get_imsi_server_name_map('%s/IMSI_1.data' % (self.DATA))
Dispatcher.get_imsi_server_name_map('%s/IMSI_2.data' % (self.DATA))
Dispatcher.get_imsi_server_name_map('%s/IMSI_3.data' % (self.DATA))
LOG.debug("Got ims_server_name map")
Dispatcher.imsi_to_ue_ip = {}
......
<?xml version="1.0"?>
<data>
<switch>
<name>access1</name>
<dpid>0000000000000001</dpid>
</switch>
<switch>
<name>access2</name>
<dpid>0000000000000002</dpid>
</switch>
<switch>
<name>access3</name>
<dpid>0000000000000009</dpid>
</switch>
<switch>
<name>tor</name>
<dpid>0000000000000003</dpid>
</switch>
<switch>
<name>hsw1</name>
<dpid>0000000000000004</dpid>
</switch>
<links>
<src>0000000000000001</src>
<dst>0000000000000003</dst>
<port>access1-offload</port>
</links>
<links>
<src>0000000000000003</src>
<dst>0000000000000001</dst>
<port>tor-offload</port>
</links>
<links>
<src>0000000000000002</src>
<dst>0000000000000003</dst>
<port>access2-offload</port>
</links>
<links>
<src>0000000000000009</src>
<dst>0000000000000003</dst>
<port>access3-offload</port>
</links>
<links>
<src>0000000000000003</src>
<dst>0000000000000002</dst>
<port>tor-offload</port>
</links>
<links>
<src>0000000000000003</src>
<dst>0000000000000009</dst>
<port>tor-offload</port>
</links>
<links>
<src>0000000000000003</src>
<dst>0000000000000010</dst>
<port>tor-offload</port>
</links>
<links>
<src>0000000000000003</src>
<dst>0000000000000004</dst>
<port>tor-net-tor21</port>
</links>
<links>
<src>0000000000000004</src>
<dst>0000000000000003</dst>
<port>hsw1-net-tor2</port>
</links>
<host>
<name>enb2</name>
<mac>00:00:00:00:00:11</mac>
<switch>0000000000000001</switch>
<port>access2-net-d-enb</port>
</host>
<host>
<name>enb3</name>
<mac>00:00:00:00:00:22</mac>
<switch>0000000000000002</switch>
<port>access3-net-d-enb</port>
</host>
<host>
<name>penb1</name>
<mac>00:00:00:00:00:10</mac>
<switch>0000000000000010</switch>
<port>access1-net-d-enb</port>
</host>
<host>
<name>server1</name>
<mac>00:00:00:00:00:33</mac>
<switch>0000000000000004</switch>
<port>hsw1-net-server</port>
</host>
</data>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment