Commit 4fa94692 authored by Binh Nguyen's avatar Binh Nguyen

Use node and adj segments for SR

parent 9eb7de97
......@@ -22,12 +22,12 @@ B. Combining OSPF with SR. Again, everything is run on node1:
------------------------------------------------------------
1. After part A, enable SR flags on the routers:
./enable_sr_flags.sh
2. Install SR rules, for high bandwidth path (1->2->4->3->5):
2. Install SR rules, for high bandwidth path (1->2->4->3->5): Using adjacency segments (interface addresses)
./ul_adj.sh
./dl_adj.sh
3. Install SR rules, for low delay, low bandwidth path (1->2->3->5) the path is enable by OSPF as default:
./del_sr.sh
3. Install SR rules, for low delay, low bandwidth path (1->2->3->5) the path is enable by OSPF as default: Using node segments (loopback's addresses)
./ul_node_seg.sh
./dl_node_seg.sh
Other scripts:
--------------
......
......@@ -11,25 +11,25 @@ $SSH_SD "node1.$DOMAIN" "sudo ip -6 addr add $n1_a dev $n1_a_dev"
#$SSH_SD "node1.$DOMAIN" "sudo ip -6 addr add $n1_lb dev lo"
#----------node2---------
#echo "Add IPv6 addresses on node 2"
echo "Add IPv6 addresses on node 2"
#$SSH_SD "node2.$DOMAIN" "sudo ip -6 addr add $n2_a dev $n2_a_dev"
#$SSH_SD "node2.$DOMAIN" "sudo ip -6 addr add $n2_b dev $n2_b_dev"
#$SSH_SD "node2.$DOMAIN" "sudo ip -6 addr add $n2_c dev $n2_c_dev"
#$SSH_SD "node2.$DOMAIN" "sudo ip -6 addr add $n2_lb dev lo"
$SSH_SD "node2.$DOMAIN" "sudo ip -6 addr add $n2_lb dev lo"
#----------node3---------
#echo "Add IPv6 addresses on node 3"
echo "Add IPv6 addresses on node 3"
#$SSH_SD "node3.$DOMAIN" "sudo ip -6 addr add $n3_b dev $n3_b_dev"
#$SSH_SD "node3.$DOMAIN" "sudo ip -6 addr add $n3_d dev $n3_d_dev"
#$SSH_SD "node3.$DOMAIN" "sudo ip -6 addr add $n3_e dev $n3_e_dev"
#$SSH_SD "node3.$DOMAIN" "sudo ip -6 addr add $n3_lb dev lo"
$SSH_SD "node3.$DOMAIN" "sudo ip -6 addr add $n3_lb dev lo"
#----------node4---------
#echo "Add IPv6 addresses on node 4"
echo "Add IPv6 addresses on node 4"
#$SSH_SD "node4.$DOMAIN" "sudo ip -6 addr add $n4_d dev $n4_d_dev"
#$SSH_SD "node4.$DOMAIN" "sudo ip -6 addr add $n4_c dev $n4_c_dev"
#$SSH_SD "node4.$DOMAIN" "sudo ip -6 addr add $n4_lb dev lo"
$SSH_SD "node4.$DOMAIN" "sudo ip -6 addr add $n4_lb dev lo"
#----------node5---------
echo "Add IPv6 addresses on node 5"
......
......@@ -24,6 +24,8 @@ if [ "$hn" == "node2" ]; then
echo " interface $n2_b_dev area 0.0.0.0" >> $OSPF
echo " area 0.0.0.0 range $n2_c/80" >> $OSPF
echo " interface $n2_c_dev area 0.0.0.0" >> $OSPF
echo " area 0.0.0.0 range $n2_lb/80" >> $OSPF
echo " interface lo area 0.0.0.0" >> $OSPF
fi
......@@ -43,6 +45,8 @@ if [ "$hn" == "node3" ]; then
echo " interface $n3_d_dev area 0.0.0.0" >> $OSPF
echo " area 0.0.0.0 range $n3_e/80" >> $OSPF
echo " interface $n3_e_dev area 0.0.0.0" >> $OSPF
echo " area 0.0.0.0 range $n3_lb/80" >> $OSPF
echo " interface lo area 0.0.0.0" >> $OSPF
fi
......@@ -59,6 +63,8 @@ if [ "$hn" == "node4" ]; then
echo " interface $n4_c_dev area 0.0.0.0" >> $OSPF
echo " area 0.0.0.0 range $n4_d/80" >> $OSPF
echo " interface $n4_d_dev area 0.0.0.0" >> $OSPF
echo " area 0.0.0.0 range $n4_lb/80" >> $OSPF
echo " interface lo area 0.0.0.0" >> $OSPF
fi
echo "line vty" >> $OSPF
......
......@@ -7,8 +7,8 @@ META="hostname Router\n
password zebra\n
enable password zebra\n
log file zebra.log\n!"
LB="interface lo\n
ip forwarding\n
#LB="interface lo\n
LB="ip forwarding\n
line vty"
echo "!" > $ZEBRA
echo -e $META >> $ZEBRA
......@@ -24,6 +24,8 @@ if [ "$hn" == "node2" ]; then
echo " ipv6 address $n2_b/80" >> $ZEBRA
echo "interface $n2_c_dev" >> $ZEBRA
echo " ipv6 address $n2_c/80" >> $ZEBRA
echo "interface lo" >> $ZEBRA
echo " ipv6 address $n2_lb/80" >> $ZEBRA
fi
......@@ -37,7 +39,8 @@ if [ "$hn" == "node3" ]; then
echo " ipv6 address $n3_d/80" >> $ZEBRA
echo "interface $n3_e_dev" >> $ZEBRA
echo " ipv6 address $n3_e/80" >> $ZEBRA
echo "interface lo" >> $ZEBRA
echo " ipv6 address $n3_lb/80" >> $ZEBRA
fi
......@@ -49,6 +52,8 @@ if [ "$hn" == "node4" ]; then
echo " ipv6 address $n4_c/80" >> $ZEBRA
echo "interface $n4_d_dev" >> $ZEBRA
echo " ipv6 address $n4_d/80" >> $ZEBRA
echo "interface lo" >> $ZEBRA
echo " ipv6 address $n4_lb/80" >> $ZEBRA
fi
echo -e $LB >> $ZEBRA
......
......@@ -13,8 +13,8 @@ INGRESS_NODE="node3.$DOMAIN"
DST_IP=$n1_a
#segments
MID_SEGS=("$n2_b") #via node3's netd adjacency and node2.
MID_SEG_DEVS="$n3_b_dev"
MID_SEGS=("$n2_lb") #via node3's netd adjacency and node2.
MID_SEG_DEVS="$n3_b_dev" #this is bogus. But the ip route command seems to need this to pass the format check.
......
#!/bin/bash
LB_IP="fc01::1"
LB_IP=197
INF="/proj/PhantomNet/binh/simeca_scripts/get_interface_map.pl"
......@@ -10,7 +10,8 @@ if [ "$hn" == "node1" ]; then
n1_a_dev=$($INF | grep neta | awk '{print $3}')
n1_a_mac=$(ifconfig | grep $n1_a_dev | awk '{print $5}')
n1_a=$(ifconfig | grep -A3 $n1_a_dev | grep inet6 | grep "fe80::" | awk '{print $3}' | awk -F'/' '{print $1}' | sed s/fe80::*:/2001::204:/ )
echo "n1_lb=\"$LB_IP\""
let lb=$LB_IP+1
echo "n1_lb=\"$lb::1\""
echo "n1_a=\"$n1_a\""
echo "n1_a_mac=\"$n1_a_mac\""
echo "n1_a_dev=\"$n1_a_dev\""
......@@ -33,7 +34,8 @@ if [ "$hn" == "node2" ]; then
n2_c_mac=$(ifconfig | grep $n2_c_dev | awk '{print $5}')
n2_c=$(ifconfig | grep -A3 $n2_c_dev | grep inet6 | grep "fe80::" | awk '{print $3}' | awk -F'/' '{print $1}' | sed s/fe80::*:/2001::206:/ )
echo "n2_lb=\"$LB_IP\""
let lb=$LB_IP+2
echo "n2_lb=\"$lb::1\""
echo "n2_a=\"$n2_a\""
echo "n2_a_mac=\"$n2_a_mac\""
echo "n2_a_dev=\"$n2_a_dev\""
......@@ -62,7 +64,8 @@ if [ "$hn" == "node3" ]; then
n3_e_mac=$(ifconfig | grep $n3_e_dev | awk '{print $5}')
n3_e=$(ifconfig | grep -A3 $n3_e_dev | grep inet6 | grep "fe80::" | awk '{print $3}' | awk -F'/' '{print $1}' | sed s/fe80::*:/2001::208:/ )
echo "n3_lb=\"$LB_IP\""
let lb=$LB_IP+3
echo "n3_lb=\"$lb::1\""
echo "n3_b=\"$n3_b\""
echo "n3_b_mac=\"$n3_b_mac\""
echo "n3_b_dev=\"$n3_b_dev\""
......@@ -88,7 +91,8 @@ if [ "$hn" == "node4" ]; then
n4_d_mac=$(ifconfig | grep $n4_d_dev | awk '{print $5}')
n4_d=$(ifconfig | grep -A3 $n4_d_dev | grep inet6 | grep "fe80::" | awk '{print $3}' | awk -F'/' '{print $1}' | sed s/fe80::*/2001::207:/ )
echo "n4_lb=\"$LB_IP\""
let lb=$LB_IP+4
echo "n4_lb=\"$lb::1\""
echo "n4_c=\"$n4_c\""
echo "n4_c_mac=\"$n4_c_mac\""
echo "n4_c_dev=\"$n4_c_dev\""
......@@ -106,7 +110,8 @@ if [ "$hn" == "node5" ]; then
n5_e_mac=$(ifconfig | grep $n5_e_dev | awk '{print $5}')
n5_e=$(ifconfig | grep -A3 $n5_e_dev | grep inet6 | grep "fe80::" | awk '{print $3}' | awk -F'/' '{print $1}' | sed s/fe80::*:/2001::208:/ )
echo "n5_lb=\"$LB_IP\""
let lb=$LB_IP+5
echo "n5_lb=\"$lb::1\""
echo "n5_e=\"$n5_e\""
echo "n5_e_mac=\"$n5_e_mac\""
echo "n5_e_dev=\"$n5_e_dev\""
......
#!/bin/bash
#Node node1...
n1_lb="fc01::1"
n1_a=""
n1_a_mac="00:04:23:b7:21:2a"
n1_lb="198::1"
n1_a="2001::204:204:23ff:feb7:176c"
n1_a_mac="00:04:23:b7:17:6c"
n1_a_dev="enp9s4f0"
#Node node2...
n2_lb="fc01::1"
n2_a="2001::204:23ff:feb7:176c"
n2_a_mac="00:04:23:b7:17:6c"
n2_lb="199::1"
n2_a="2001::204:204:23ff:feb7:1df4"
n2_a_mac="00:04:23:b7:1d:f4"
n2_a_dev="enp9s4f0"
n2_b="2001::205:23ff:feb7:176d"
n2_b_mac="00:04:23:b7:17:6d"
n2_b="2001::205:204:23ff:feb7:1df5"
n2_b_mac="00:04:23:b7:1d:f5"
n2_b_dev="enp9s4f1"
n2_c="2001::206:23ff:feb7:1488"
n2_c_mac="00:04:23:b7:14:88"
n2_c="2001::206:204:23ff:feb7:190a"
n2_c_mac="00:04:23:b7:19:0a"
n2_c_dev="enp10s3f0"
#Node node3...
n3_lb="fc01::1"
n3_b="2001::205:23ff:feb7:2046"
n3_lb="200::1"
n3_b="2001::205:204:23ff:feb7:2046"
n3_b_mac="00:04:23:b7:20:46"
n3_b_dev="enp9s4f0"
n3_d="2001::207:23ff:feb7:2047"
n3_d="2001::207:204:23ff:feb7:2047"
n3_d_mac="00:04:23:b7:20:47"
n3_d_dev="enp9s4f1"
n3_e="2001::208:23ff:feb7:1ab8"
n3_e="2001::208:204:23ff:feb7:1ab8"
n3_e_mac="00:04:23:b7:1a:b8"
n3_e_dev="enp10s3f0"
#Node node4...
n4_lb="fc01::1"
n4_c="2001::206:23ff:feb7:23a0"
n4_c_mac="00:04:23:b7:23:a0"
n4_lb="201::1"
n4_c="2001::206:204:23ff:feb7:406e"
n4_c_mac="00:04:23:b7:40:6e"
n4_c_dev="enp9s4f0"
n4_d="2001::207:23ff:feb7:23a1"
n4_d_mac="00:04:23:b7:23:a1"
n4_d_dev="enp9s4f1"
n4_d="2001::207:204:23ff:feb7:41f4"
n4_d_mac="00:04:23:b7:41:f4"
n4_d_dev="enp10s3f0"
#Node node5...
n5_lb="fc01::1"
n5_e="2001::208:23ff:feb7:1df4"
n5_e_mac="00:04:23:b7:1d:f4"
n5_lb="202::1"
n5_e="2001::208:204:23ff:feb7:23a0"
n5_e_mac="00:04:23:b7:23:a0"
n5_e_dev="enp9s4f0"
......@@ -13,8 +13,8 @@ INGRESS_NODE="node2.$DOMAIN"
DST_IP=$n5_e
#segments
MID_SEGS=("$n3_b") #via node3.
MID_SEG_DEVS="$n2_b_dev"
MID_SEGS=("$n3_lb") #via node3.
MID_SEG_DEVS="$n2_b_dev" #this is bogus. But the ip route command seems to need this to pass the format check.
......@@ -24,4 +24,5 @@ echo "Install rules on ingress nodes $INGRESS_NODE"
echo "--------------------------------------"
#ip forwarding for pkts to DST_IP
$SSH_SD $INGRESS_NODE "sudo ip -6 route add $DST_IP/128 dev $MID_SEG_DEVS encap seg6 mode encap segs ${MID_SEGS[0]}"
#$SSH_SD $INGRESS_NODE "sudo ip -6 route add $DST_IP/128 encap seg6 mode encap segs ${MID_SEGS[0]}"
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