Commit 5c791b21 authored by Binh Nguyen's avatar Binh Nguyen

Fix scripts to work with 4 core routers

parent d3dc9854
......@@ -4,15 +4,11 @@ Scripts to run Free Range Routing's OSPF on profile sripv6-ovs in PhantomNet (ht
A. How to set up basic IPv6 with OSPF? Everything is running on Node1.
---------------------------------------------------------------------
1. Obtain interfaces information by: ./get_all_info.sh. Result is in net_info.sh
1. Obtain interfaces information by: ./get_all_info.sh. Result is in net_info.sh. Copy net_info.sh to /opt/ folder.
2. Add global IPv6 addresses to interfaces: ./add_global_ipv6.sh
3. Create and install configuration files for FRR's Zebra and OSPF6. The configuration is copied to /usr/local/etc/ on each node after running the command:
./create_all_zebra_conf.sh
./create_all_ospf_conf.sh
4. Run FRR on node 2, 3, 4:
./start_all_frr.sh
5. After several seconds, the routes are populated by OSPF. Check routes on node 2,3,4 using:
ip -6 route
6. Install default routes on the end hosts: node0 and node6
./install_default_route_on_hosts.sh
7. Enable SR on core routers:
......@@ -21,6 +17,9 @@ A. How to set up basic IPv6 with OSPF? Everything is running on Node1.
B. Run OVS with SR:
-------------------
+ Automatically:
1. ./start_all_ovs.sh
+ Manually:
1. Install ovs's kernel module: cd /opt/openvswitch; sudo ./re_compile.sh
2. Run OVS: cd /opt/openvswitch; sudo ./run_ovs.sh
3. Create ports for OVS: cd /opt/openvswitch; sudo ./run_srv6.sh <inport network (facing endhost)> <outport network (facing CR)> <controller's IP (node1's public IP)>
......@@ -29,17 +28,46 @@ B. Run OVS with SR:
4. Show the ports of OVS by: cd /opt/openvswitch; sudo ./ovs_port_desc.sh
5. The OVS will try to connect to the Ryu's SDN controller at node1.
C. Start OSPF and OSPF monitors:
-------------------------------
1. Start OSPF monitors:
cd ~/sripv6-linux/ospf_monitor; ./start_all_ospf_monitor.sh
2. Run FRR deamons on node 2, 3, 4:
./start_all_frr.sh
3. After several seconds, the routes are populated by OSPF. Check routes on node 2,3,4 using:
ip -6 route
C. Run Ryu SDN controller:
--------------------------
0. Copy net_info.sh to /opt: sudo cp net_info.sh /opt/
1. cd /opt/openvswitch/sdn_controller/; ryu-manager sr_controller_test.py
2. The controller will install SR encapsulation rules on node1 and node5 OVSes.
1. Copy net_info.sh to /opt: sudo cp net_info.sh /opt/
2. IT IS NEEDED that the SDN controller runs *after* the OSPF deamons in step C2. Thus, to run the SDN controller:
+ Kill OSPF deamons: cd ~/sripv6-linux/frr-ovs-new; ./kill_all_frr.sh
+ Start SDN controller: cd /opt/openvswitch/sdn_controller/; ryu-manager sr_controller_test.py
+ Start OSPF deamons: cd ~/sripv6-linux/frr-ovs-new; ./start_all_frr.sh
3. The OSPF monitors will send OSPF LSAs to the SDN controller. The SDN controller will print out the OSPF routers topology that it generates from the LSAs. The controller also hsow REST-API requests that it received, eg, install a segment path.
D. Test connectivity:
--------------------
After the controller installs the rules, node0 should be able to ping node6's net2
ping6 <node6's net2 IP>
E. Run and access the web portal:
--------------------------------
0. Install Apache web server:
sudo apt-get update; sudo apt-get install -y apache2
1. Copy web portal code to /var/www folder:
sudo cp -r sripv6-linux/www /var/
2. Modify the hostname in the "url" variable in www/netjsongraph.js/examples/te_app.js so that it points to node1 of your experiment.
3. Access the web portal using this url:
http://<node1 name>/netjsongraph.js/examples/
4. The web portal should show a topology of your OSPF routers. You can also implement a path using the portal.
5. PING test:
+ From node 0, ping node 6:
ping6 <node6's net2 IP address>
By default, there is a shortest path between node 0 and 6, implemented by OSPF. So the PING packets should go through this path.
+ In the web portal, enter your desired path from node 2 (the router with the subnet that node 0 is in) to node 3 (the router with the subnet that node 6 is in), then click 'submit'. You'll see the PING packets going through a new path.
Other scripts:
--------------
1. kill_frr.sh: kill zebra and ospf deamons on a OSPF router.
......
......@@ -2,12 +2,13 @@
hn=$(hostname)
domain=$(echo $hn | awk -F'.' '{print $2"."$3"."$4"."$5}')
SSH_ARGS=" -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null "
for i in 2 3 4 7
do
echo -e "\n========================="
echo "Create OSPF conf of node $i ..."
scp net_info.sh create_ospf_conf.sh node$i.$domain:~/ > /dev/null
ssh node$i.$domain "./create_ospf_conf.sh"
scp $SSH_ARGS net_info.sh create_ospf_conf.sh node$i.$domain:~/ > /dev/null
ssh $SSH_ARGS node$i.$domain "./create_ospf_conf.sh"
done
echo "DONE installing OSPF6 conf files on all nodes!"
......
......@@ -14,7 +14,8 @@
source net_info.sh
SSH_SD="ssh -t -t"
SSH_ARGS=" -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null "
SSH_SD="ssh -t -t $SSH_ARGS"
#Node name for SSH
......
#!/bin/bash
source net_info.sh
SSH_SD="ssh -t -t"
SSH_ARGS=" -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null "
SSH_SD="ssh -t -t $SSH_ARGS "
#Node name for SSH
DOMAIN=$(hostname | awk -F'.' '{print $2"."$3"."$4"."$5}')
$SSH_SD node0.$DOMAIN "sudo ip -6 route add $n6_2/80 dev $n0_1_dev"
$SSH_SD node0.$DOMAIN "sudo ip -6 route add $n2_a/80 dev $n0_1_dev"
$SSH_SD node0.$DOMAIN "sudo ip -6 route add default via $n2_a"
#$SSH_SD node0.$DOMAIN "sudo ip -6 neigh add $n6_2 lladdr $n1_1_mac dev $n0_1_dev"
#$SSH_SD node0.$DOMAIN "sudo ip -6 neigh replace $n6_2 lladdr $n1_1_mac dev $n0_1_dev"
$SSH_SD node6.$DOMAIN "sudo ip -6 route add $n0_1/80 dev $n6_2_dev"
$SSH_SD node6.$DOMAIN "sudo ip -6 route add $n3_e/80 dev $n6_2_dev"
$SSH_SD node6.$DOMAIN "sudo ip -6 route add default via $n3_e"
#$SSH_SD node6.$DOMAIN "sudo ip -6 neigh add $n0_1 dev $n6_2_dev"
#$SSH_SD node6.$DOMAIN "sudo ip -6 neigh replace $n0_1 lladdr $n5_2_mac dev $n6_2_dev"
......@@ -2,10 +2,11 @@
hn=$(hostname)
domain=$(echo $hn | awk -F'.' '{print $2"."$3"."$4"."$5}')
SSH_ARGS=" -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null "
for i in 2 3 4 7
do
echo -e "\n========================="
echo "Kill FRR on node $i ..."
scp kill_frr.sh start_frr.sh node$i.$domain:~/ > /dev/null
ssh node$i.$domain "sudo ./kill_frr.sh"
scp $SSH_ARGS kill_frr.sh start_frr.sh node$i.$domain:~/ > /dev/null
ssh $SSH_ARGS node$i.$domain "sudo ./kill_frr.sh"
done
#!/bin/bash
#Node node1...
n1_lb="198::1"
n1_a="2001::204:204:23ff:feb7:410c"
n1_a_mac="00:04:23:b7:41:0c"
n1_a_dev="eth4"
n1_1="2001::204:204:23ff:feb7:4090"
n1_1_mac="00:04:23:b7:40:90"
n1_1_dev="eth2"
n1_pub="155.98.39.99"
n1_a="2001::204:204:23ff:feb7:18eb"
n1_a_mac="00:04:23:b7:18:eb"
n1_a_dev="eth5"
n1_1="2001::204:204:23ff:feb7:18ea"
n1_1_mac="00:04:23:b7:18:ea"
n1_1_dev="eth4"
n1_pub="155.98.39.108"
#Node node0...
n0_lb="197::1"
n0_1="2001::204:204:23ff:feb6:cd68"
n0_1_mac="00:04:23:b6:cd:68"
n0_1_dev="enp9s4f0"
n0_1="2001::204:204:23ff:feb7:292e"
n0_1_mac="00:04:23:b7:29:2e"
n0_1_dev="enp10s3f0"
#Node node2...
n2_lb="199::1"
n2_a="2001::204:204:23ff:feb7:1768"
n2_a_mac="00:04:23:b7:17:68"
n2_a="2001::204:204:23ff:feb7:1ce2"
n2_a_mac="00:04:23:b7:1c:e2"
n2_a_dev="enp10s3f0"
n2_b="2001::205:204:23ff:feb7:1769"
n2_b_mac="00:04:23:b7:17:69"
n2_b="2001::205:204:23ff:feb7:1ce3"
n2_b_mac="00:04:23:b7:1c:e3"
n2_b_dev="enp10s3f1"
n2_c="2001::206:204:23ff:feb7:1536"
n2_c_mac="00:04:23:b7:15:36"
n2_c="2001::206:204:23ff:feb7:1afa"
n2_c_mac="00:04:23:b7:1a:fa"
n2_c_dev="enp9s4f0"
#Node node3...
n3_lb="200::1"
n3_b="2001::205:204:23ff:feb7:2132"
n3_b_mac="00:04:23:b7:21:32"
n3_b="2001::205:204:23ff:feb7:15fc"
n3_b_mac="00:04:23:b7:15:fc"
n3_b_dev="enp10s3f0"
n3_d="2001::207:204:23ff:feb7:2133"
n3_d_mac="00:04:23:b7:21:33"
n3_d="2001::207:204:23ff:feb7:15fd"
n3_d_mac="00:04:23:b7:15:fd"
n3_d_dev="enp10s3f1"
n3_e="2001::208:204:23ff:feb7:1d34"
n3_e_mac="00:04:23:b7:1d:34"
n3_e="2001::208:204:23ff:feb7:1e06"
n3_e_mac="00:04:23:b7:1e:06"
n3_e_dev="enp9s4f0"
n3_g="2001::210:204:23ff:feb7:1d35"
n3_g_mac="00:04:23:b7:1d:35"
n3_g="2001::210:204:23ff:feb7:1e07"
n3_g_mac="00:04:23:b7:1e:07"
n3_g_dev="enp9s4f1"
#Node node4...
n4_lb="201::1"
n4_c="2001::206:204:23ff:feb7:128a"
n4_c_mac="00:04:23:b7:12:8a"
n4_c="2001::206:204:23ff:feb7:1774"
n4_c_mac="00:04:23:b7:17:74"
n4_c_dev="enp9s4f0"
n4_d="2001::207:204:23ff:feb7:132a"
n4_d_mac="00:04:23:b7:13:2a"
n4_d="2001::207:204:23ff:feb7:18da"
n4_d_mac="00:04:23:b7:18:da"
n4_d_dev="enp10s3f0"
n4_f="2001::209:204:23ff:feb7:128b"
n4_f_mac="00:04:23:b7:12:8b"
n4_f="2001::209:204:23ff:feb7:1775"
n4_f_mac="00:04:23:b7:17:75"
n4_f_dev="enp9s4f1"
#Node node5...
n5_lb="202::1"
n5_e="2001::208:204:23ff:feb7:1bba"
n5_e_mac="00:04:23:b7:1b:ba"
n5_e_dev="eth2"
n5_2="2001::208:204:23ff:feb7:1a5e"
n5_2_mac="00:04:23:b7:1a:5e"
n5_2_dev="eth4"
n5_pub="155.98.39.85"
n5_e="2001::208:204:23ff:feb7:1301"
n5_e_mac="00:04:23:b7:13:01"
n5_e_dev="eth3"
n5_2="2001::208:204:23ff:feb7:1300"
n5_2_mac="00:04:23:b7:13:00"
n5_2_dev="eth2"
n5_pub="155.98.39.120"
#Node node6...
n6_lb="203::1"
n6_2="2001::208:204:23ff:feb2:607a"
n6_2_mac="00:04:23:b2:60:7a"
n6_2_dev="enp10s3f0"
n6_2="2001::208:204:23ff:feb7:1a14"
n6_2_mac="00:04:23:b7:1a:14"
n6_2_dev="enp9s4f0"
#Node node7...
n7_lb="204::1"
n7_f="2001::209:204:23ff:feb7:2654"
n7_f_mac="00:04:23:b7:26:54"
n7_f="2001::209:204:23ff:feb7:26de"
n7_f_mac="00:04:23:b7:26:de"
n7_f_dev="enp9s4f0"
n7_g="2001::210:204:23ff:feb7:2655"
n7_g_mac="00:04:23:b7:26:55"
n7_g="2001::210:204:23ff:feb7:26df"
n7_g_mac="00:04:23:b7:26:df"
n7_g_dev="enp9s4f1"
#!/bin/bash
#deploy and run myself
SSH_ARGS=" -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null "
domain=$(echo $(hostname) | awk -F'.' '{print $2"."$3"."$4"."$5}')
for i in 1 5
do
echo "Start OVS node $i ..."
scp $SSH_ARGS start_ovs.sh node$i.$domain:~/ > /dev/null
ssh -t -t ${SSH_ARGS} node$i.$domain "cd ~/; ./start_ovs.sh"
done
exit 0
#!/bin/bash
hn=$(hostname | awk -F'.' '{print $1}')
domain=$(hostname | awk -F'.' '{print $2"."$3"."$4"."$5}')
#NODE1
if [ "$hn" == "node1" ]; then
echo "Start OVS on Node $hn..."
cd /opt/openvswitch; sudo ./re_compile.sh
cd /opt/openvswitch; sudo ./run_ovs.sh
sudo ./run_srv6.sh net1 neta 127.0.0.1
fi
#NODE5
if [ "$hn" == "node5" ]; then
echo "Start OVS on Node $hn..."
cd /opt/openvswitch; sudo ./re_compile.sh
cd /opt/openvswitch; sudo ./run_ovs.sh
sudo ./run_srv6.sh net2 neta $(host node1.$domain | grep "has address" | awk -F" " '{print $4}')
fi
exit 0
......@@ -2,12 +2,13 @@
hn=$(hostname)
domain=$(echo $hn | awk -F'.' '{print $2"."$3"."$4"."$5}')
for i in 2 3 4
SSH_ARGS=" -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null "
for i in 2 3 4 7
do
echo -e "\n========================="
echo "Start OSPF monitor on node $i ..."
#ssh node$i.$domain "cd ~/sripv6-linux/ospf_monitor/; nohup sudo ./start_monitor.sh 2>&1 &"
ssh node$i.$domain "cd ~/sripv6-linux/ospf_monitor/; sudo ./kill_monitor.sh"
ssh $SSH_ARGS node$i.$domain "cd ~/ospf_monitor/; sudo ./kill_monitor.sh"
done
echo "DONE starting OSPF monitors on all nodes!"
......
......@@ -2,8 +2,7 @@
import sys, json, requests
import subprocess
sys.path.insert(0, '/users/binh/sripv6-linux/ospf_monitor/lib')
from ospfv3 import *
from lib.ospfv3 import *
class LSAR(object):
......
......@@ -2,8 +2,7 @@
import sys, select
from lsa_receiver import *
sys.path.insert(0, '/users/binh/sripv6-linux/ospf_monitor/lib')
from ospfv3 import *
from lib.ospfv3 import *
if __name__ == "__main__":
......@@ -14,8 +13,12 @@ if __name__ == "__main__":
DUMP_MRTD = 0
ADDRESS = "::"
LSAA_HOST = "node1.srv6.phantomnet.emulab.net"
LSAA_PORT = 8080
if len(sys.argv) != 3:
print "Usage: <OSPF listener's host, eg, node1.srv6.phantomnet.emulab.net> <OSPF listener's port number, eg, 8080>"
sys.exit(1)
LSAA_HOST = sys.argv[1]
LSAA_PORT = int(sys.argv[2])
#lsar = LSAR("155.98.39.112", 8080)
lsar = LSAR(LSAA_HOST, LSAA_PORT)
......
......@@ -2,12 +2,14 @@
hn=$(hostname)
domain=$(echo $hn | awk -F'.' '{print $2"."$3"."$4"."$5}')
for i in 2 3 4
SSH_ARGS=" -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null "
for i in 2 3 4 7
do
echo -e "\n========================="
echo "Start OSPF monitor on node $i ..."
#ssh node$i.$domain "cd ~/sripv6-linux/ospf_monitor/; nohup sudo ./start_monitor.sh 2>&1 &"
ssh node$i.$domain "cd ~/sripv6-linux/ospf_monitor/; sudo screen -S ospf_monitor -d -m ./start_monitor.sh"
scp $SSH_ARGS -r ~/sripv6-linux/ospf_monitor node$i.$domain:~/
ssh $SSH_ARGS node$i.$domain "cd ~/ospf_monitor/; sudo screen -S ospf_monitor -d -m ./start_monitor.sh $hn 8080"
done
echo "DONE starting OSPF monitors on all nodes!"
......
#!/bin/bash
if [ $# -ne 2 ]; then
echo "Usage: <OSPF LSA listener, eg, node1.srv6.phantomnet.emulab.net> <OSPF LSA listener's port number, eg, 8080>"
exit 1
fi
ps ax | grep main.py | grep -v grep | awk '{print $1; system("sudo kill -9 " $1)}'
sudo python main.py
sudo python main.py $1 $2
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