Commit d428222d authored by gauthier's avatar gauthier

Clean


git-svn-id: http://svn.eurecom.fr/openair4G/trunk@7379 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent e179ab0e
#!/bin/bash
source params.sh
sleep 1
export OPENAIR1_DIR=~/Openair/openair1
export OPENAIR2_DIR=~/Openair/openair2
export OPENAIR3_DIR=~/Openair/openair3
export OPENAIR3_HOME=~/Openair/openair3
echo Clusterhead address is $CH1_IN6_ADDR
#echo Launching AS and RF
#./start_openair.sh 8 0
# Installing NASMESH driver
sudo rmmod -f nasmesh
sudo insmod $OPENAIR2_DIR/NAS/DRIVER/MESH/nasmesh.ko nas_IMEI=0x12345678,0x01000000
echo Classification rules for CH
#CH1<-> MR1 IP Signaling
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c0 -i0 -z0 -x $CH1_IN6_ADDR -y $MR1_IN6_ADDR -r 12
#CH1<-> MR1 MPLS user-plane bearer
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c1 -i0 -z0 -l $MR1_LABEL_IN -m $MR1_LABEL_OUT -r 13
#CH1<->MR1 - For com between MN1 and MN3 - MPLS user-plane bearer
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c2 -i0 -z0 -l $MN3_CH1_MR1_MN1 -m $MN1_MR1_CH1_MN3 -r 13
#CH1<-> MR1 multicast (rajout THC)
echo EADS Multicast for CH1
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c3 -i0 -z0 -s $CH1_IN_ADDR -t 226.30.10.10 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c4 -i0 -z0 -s $MR1_IN_ADDR -t 226.30.10.10 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c5 -i0 -z0 -s $CH1_IN_ADDR -t 226.30.10.11 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c6 -i0 -z0 -s $MR1_IN_ADDR -t 226.30.10.11 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c7 -i0 -z0 -s $CH1_IN_ADDR -t 226.30.10.12 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c8 -i0 -z0 -s $MR1_IN_ADDR -t 226.30.10.12 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c9 -i0 -z0 -s $CH1_IN_ADDR -t 226.30.10.13 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c10 -i0 -z0 -s $MR1_IN_ADDR -t 226.30.10.13 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c11 -i0 -z0 -s $CH1_IN_ADDR -t 226.30.10.14 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c12 -i0 -z0 -s $MR1_IN_ADDR -t 226.30.10.14 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c13 -i0 -z0 -s $MR1_IN_ADDR -t 226.30.10.15 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c14 -i0 -z0 -s $CH1_IN_ADDR -t 226.30.10.15 -r 12
#CH1<-> MR2 (IP Signaling)
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c15 -i0 -z0 -x $CH1_IN6_ADDR -y $MR2_IN6_ADDR1 -r 20
#CH1<-> MR2 (MPLS user-plane bearer)
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c16 -i0 -z0 -l $MR2_CH1_LABEL_IN -m $MR2_CH1_LABEL_OUT -r 21
#CH1<-> MR2 (MPLS PMIP signaling bearer)
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c17 -i0 -z0 -l $CH1_MR2_CH2_LABEL_OUT -m $CH1_MR2_CH2_LABEL_IN -r 21
#CH1<-> MR2 - For com between MN1 and MN3 - (MPLS signaling bearer)
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c18 -i0 -z0 -l $MN1_CH1_MR2_MN3 -m $MN3_MR2_CH1_MN1 -r 21
#CH1<-> MR2 multicast EADS (rajout THC)
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c19 -i0 -z0 -s $MR2_IN_ADDR -t 226.40.10.10 -r 20
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c20 -i0 -z0 -s $CH1_IN_ADDR -t 226.40.10.10 -r 20
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c21 -i0 -z0 -s $MR2_IN_ADDR -t 226.40.10.11 -r 20
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c22 -i0 -z0 -s $CH1_IN_ADDR -t 226.40.10.11 -r 20
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c23 -i0 -z0 -s $MR2_IN_ADDR -t 226.40.10.12 -r 20
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c24 -i0 -z0 -s $CH1_IN_ADDR -t 226.40.10.12 -r 20
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c25 -i0 -z0 -s $MR2_IN_ADDR -t 226.40.10.13 -r 20
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c26 -i0 -z0 -s $CH1_IN_ADDR -t 226.40.10.13 -r 20
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c27 -i0 -z0 -s $MR2_IN_ADDR -t 226.40.10.14 -r 20
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c28 -i0 -z0 -s $CH1_IN_ADDR -t 226.40.10.14 -r 20
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c29 -i0 -z0 -s $MR2_IN_ADDR -t 226.40.10.15 -r 20
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c30 -i0 -z0 -s $CH1_IN_ADDR -t 226.40.10.15 -r 20
#CH Broadcast (transmission of Router ADV)
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c31 -i0 -z0 -x $CH1_IN6_ADDR -y ff02::1 -r 3
#CH<-> MR1 Imulticast
#$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c1 -i0 -z0 -x ff3e:30:2001:660:5502:ffff:e000:3737 -y $MR1_IN_ADDR -r 14
#$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c1 -i0 -z0 -s 10.0.0.2 -t 224.0.55.55 -r 12
#$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c1 -i0 -z0 -s 10.0.0.1 -t 224.0.55.55 -r 12
#CH<-> MR2 (IP Signaling)
#$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c2 -i0 -z0 -x $CH_ADDR -y $MR2_IN_ADDR -r 20
#$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c2 -i0 -z0 -s 10.0.0.1 -t 224.0.66.66 -r 20
#$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c2 -i0 -z0 -s 10.0.0.3 -t 224.0.66.66 -r 20
#CH<-> MR2 (MPLS user-plane bearer)
# Bring up openair NASMESH device and set IPv6 address
sudo ifconfig nasmesh0 up
sudo ip addr add 10.0.0.1/24 dev nasmesh0
sudo ip -6 addr add $CH1_IN6_ADDR/64 dev nasmesh0
echo No MPLS debug
echo "0" > /sys/mpls/debug
#echo Multicast state launched with config_ch1
#xterm -hold -e /usr/bin/perl $REFLECTOR_DIR/reflector_launch.pl $REFLECTOR_DIR $REFLECTOR_DIR/config_ch1 &
#xterm -hold -e ./mac_sim -m0 -t $OPENAIR2_DIR/SIMULATION/TOPOLOGIES/eth_3nodes.top &
#!/bin/bash
source params.sh
sudo ./ch_conf_nas.sh
# MN1 -> MN2
sudo ./mpls_nas.sh $MR1_LABEL_OUT $MR2_IN6_ADDR1 $MR2_CH1_LABEL_IN
# MN2 -> MN1
sudo ./mpls_nas.sh $MR2_CH1_LABEL_OUT $MR1_IN6_ADDR $MR1_LABEL_IN
# MN1 -> MN3
sudo ./mpls_nas.sh $MN1_MR1_CH1_MN3 $MR2_IN6_ADDR1 $MN1_CH1_MR2_MN3
# MN3 -> MN1
sudo ./mpls_nas.sh $MN3_MR2_CH1_MN1 $MR1_IN6_ADDR $MN3_CH1_MR1_MN1
# CH1 -> CH2
#echo 'CH2->MR2->CH1'
mpls labelspace set dev nasmesh0 labelspace 0
mpls ilm add label gen $CH1_MR2_CH2_LABEL_IN labelspace 0 proto ipv6
#echo 'CH1->MR2->CH2'
var=`mpls nhlfe add key 0 instructions push gen $CH1_MR2_CH2_LABEL_OUT nexthop nasmesh0 ipv6 $MR2_IN6_ADDR1 | grep key |cut -c 17-26`
echo "Creating routes"
sudo ip -6 route add $CH2_IN6_ADDR/128 via $MR2_IN6_ADDR1 mpls $var
echo 0 > /sys/mpls/debug
# PMIP
echo /openair3/pmip6d/pmip6d -c -L $CH1_IN6_ADDR -A $CH2_IN6_ADDR
sudo xterm -hold -e "$OPENAIR3_PMIP6D_PATH/pmip6d -c -L $CH1_IN6_ADDR -A $CH2_IN6_ADDR" &
xterm -hold -e "cd /homes/foubert/Openair/openair2/SIMULATION/USER_TOOLS/LAYER2_SIM ; ./mac_sim -m0 -t $OPENAIR2_DIR/SIMULATION/TOPOLOGIES/eth_3nodes.top"
#watch -n .1 "cat /proc/openair2/lchan_stats ; cat /proc/openair1/bch_stats ; cat /proc/openair1/openair1_state"
#./stop_rf.sh
sleep 2
./del_mpls.sh
#sleep 2
#./del_mpls.sh
#!/bin/bash
#Script by Irina Dumitrascu (dumitrascu.irina@gmail.com) and Adrian Popa (adrian.popa.gh@gmail.com)
#June 2006
#Released under GPL
#Added by phil, Huu Nghia, 8 July 08
echo Deleting all mpls - xc settings
xc_output="`mpls xc show | cut -c 9-75`"
number_of_lines=`echo $xc_output|wc -l`
for i in `seq 1 $number_of_lines`
do
xc_output_line="`echo $xc_output| head -$i | tail -1`"
echo Deleting: mpls xc del $xc_output_line
mpls xc del $xc_output
#increment i
i=`expr $i+1`
done
echo Deleting all mpls - ip route settings
nr_of_lines=` ip route show |grep mpls |wc -l`
for i in `seq 1 $nr_of_lines `
do
output=`ip route show |grep mpls |head -1`
echo Deleting: ip route del $output
ip route del $output
i=`expr $i+1`
done
var1=`ip route show table 1`
if [ ! -z "$var1" ]; then
ip route del table 1
#var1=`ip route show table 1`
#ip route del $var1 table 1
ip route flush table 1
echo "clearing ip route table 1"
fi
var1=`ip route show table 2`
if [ ! -z "$var1" ]; then
ip route del table 2
# var1=`ip route show table 2`
# ip route del $var1 table 2
ip route flush table 2
echo "clearing ip route table 2"
fi
#echo Flushing iptables chains
#iptables -F
#echo Flushing iptables -t nat
#iptables -t nat -F
#echo Flushing iptables -t mangle
#iptables -t mangle -F
echo Deleting all mpls - nhlfe settings
nr_of_lines=` mpls nhlfe show |grep key |wc -l`
for i in `seq 1 $nr_of_lines `
do
output=`mpls nhlfe show |grep key |cut -c 17-26 |head -1`
echo Deleting: mpls nhlfe del key $output
mpls nhlfe del key $output
i=`expr $i+1`
done
echo Deleting all mpls - labelspace settings
nr_of_lines=`mpls labelspace show |grep -v "labelspace -1" |wc -l`
for i in `seq 1 $nr_of_lines `
do
output=`mpls labelspace show |grep -v "labelspace -1"|cut -c 17-37 |head -1`
echo Deleting: mpls labelspace set $output -1
mpls labelspace set $output -1
i=`expr $i+1`
done
echo Deleting all mpls - ilm settings
nr_of_lines=`mpls ilm show |grep ILM |wc -l`
for i in `seq 1 $nr_of_lines `
do
output=`mpls ilm show |grep ILM |cut -c 10-37 |head -1`
echo Deleting: mpls ilm del $output
mpls ilm del $output
i=`expr $i+1`
done
var1=`tc qdisc show |grep eth0 |grep htb`
if [ ! -z "$var1" ]; then
tc qdisc del dev eth0 root
echo "tc clear eth0"
fi
var2=`tc qdisc show |grep eth3 |grep htb`
if [ ! -z "$var2" ]; then
tc qdisc del dev eth3 root
echo "tc clear eth3"
fi
var3=`tc qdisc show |grep eth1 |grep htb`
if [ ! -z "$var3" ]; then
tc qdisc del dev eth1 root
echo "tc clear eth1"
fi
var4=`tc qdisc show |grep eth2 |grep htb`
if [ ! -z "$var4" ]; then
tc qdisc del dev eth2 root
echo "tc clear eth2"
fi
#!/bin/bash
#Script by Lamia Romdhani
#June 2008
echo Setting MPLS
sudo modprobe mpls6
echo Number of params = $#
if [ $# -eq 3 ]; then
LABEL_IN=$1
IP_NEXT_HOP=$2
LABEL_OUT=$3
echo "IP Next Hop is $IP_NEXT_HOP"
echo 'Starting mpls'
sudo mpls labelspace set dev nasmesh0 labelspace 0
sudo mpls ilm add label gen $LABEL_IN labelspace 0 proto ipv6
var=`mpls nhlfe add key 0 instructions push gen $LABEL_OUT nexthop nasmesh0 ipv6 $IP_NEXT_HOP |grep key | cut -c 17-26`
sudo mpls xc add ilm_label gen $LABEL_IN ilm_labelspace 0 nhlfe_key $var
else
echo usage: mpls_nas.sh LABEL_IN IP_NEXT_HOP LABEL_OUT
fi
#!/bin/bash
source params.sh
sleep 1
export OPENAIR1_DIR
export OPENAIR2_DIR
#echo "0" >/proc/sys/net/ipv6/conf/all/forwarding
#echo Launching AS and RF
#./start_openair.sh 8 8
echo Installing NASMESH Driver
sudo rmmod -f nasmesh
sudo insmod $OPENAIR2_DIR/NAS/DRIVER/MESH/nasmesh.ko nas_IMEI=0x12345678,0x02000000
#sudo ifconfig eth2 10.0.1.3
sudo ifconfig nasmesh0 up
sudo ifconfig nasmesh0 10.0.0.3
sudo ip -6 addr add $MR1_IN6_ADDR/64 dev nasmesh0
echo Classification rules for MR1 - Default DTCH UL for L3 signaling
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c0 -i0 -z0 -x $MR1_IN6_ADDR -y $CH1_IN6_ADDR -r 4
echo Classification rules for MR1 - MPLS User-plane Bearer
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c1 -i0 -z0 -l $MN1_MR1_CH1_MN3 -m $MN3_CH1_MR1_MN1 -r 5
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c2 -i0 -z0 -l $MR1_LABEL_OUT -m $MR1_LABEL_IN -r 5
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c3 -i0 -z0 -s $CH1_IN_ADDR -t 226.30.10.10 -r 4
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c4 -i0 -z0 -s $MR1_IN_ADDR -t 226.30.10.10 -r 4
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c5 -i0 -z0 -s $CH1_IN_ADDR -t 226.30.10.11 -r 4
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c6 -i0 -z0 -s $MR1_IN_ADDR -t 226.30.10.11 -r 4
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c7 -i0 -z0 -s $CH1_IN_ADDR -t 226.30.10.12 -r 4
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c8 -i0 -z0 -s $MR1_IN_ADDR -t 226.30.10.12 -r 4
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c9 -i0 -z0 -s $CH1_IN_ADDR -t 226.30.10.13 -r 4
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c10 -i0 -z0 -s $MR1_IN_ADDR -t 226.30.10.13 -r 4
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c11 -i0 -z0 -s $CH1_IN_ADDR -t 226.30.10.14 -r 4
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c12 -i0 -z0 -s $MR1_IN_ADDR -t 226.30.10.14 -r 4
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c13 -i0 -z0 -s $MR1_IN_ADDR -t 226.30.10.15 -r 4
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c14 -i0 -z0 -s $CH1_IN_ADDR -t 226.30.10.15 -r 4
echo Classifcation rule for DTCH-Broadcast - reception of Router ADV
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c15 -i0 -z0 -x ff02::1 -y ff02::1 -r 3
#echo Multicast state launched with config_mr1
#xterm -hold -e /usr/bin/perl $REFLECTOR_DIR/reflector_launch.pl $REFLECTOR_DIR $REFLECTOR_DIR/config_mr1 &
#xterm -hold -e ./mac_sim -m0 -t $OPENAIR2_DIR/SIMULATION/TOPOLOGIES/eth_3nodes.top &
#!/bin/bash
# Script by Lamia Romdhani, Nghia, Philippe, Hicham 18 Feb 2009
source params.sh
sudo modprobe mpls6
echo Setting MPLS for mr1
echo "0" > /sys/mpls/debug
# MN1 <-> MN3
echo 'MN3->MN1'
mpls labelspace set dev nasmesh0 labelspace 0
mpls ilm add label gen $MN3_CH1_MR1_MN1 labelspace 0 proto ipv6
echo 'MN1->MN3'
var=`mpls nhlfe add key 0 instructions push gen $MN1_MR1_CH1_MN3 nexthop nasmesh0 ipv6 $CH1_IN6_ADDR | grep key |cut -c 17-26`
echo "Creating routes from MN1 to MN3"
sudo ip -6 route add $MN3_IN6_ADDR/128 via $CH1_IN6_ADDR mpls $var
sudo ip -6 route add $MN1_IN6_ADDR/128 dev eth2
# MN1 <-> MN2
echo 'MN2->MN1'
mpls labelspace set dev nasmesh0 labelspace 0
mpls ilm add label gen $MR1_LABEL_IN labelspace 0 proto ipv6
echo 'MN1->MN2'
var=`mpls nhlfe add key 0 instructions push gen $MR1_LABEL_OUT nexthop nasmesh0 ipv6 $CH1_IN6_ADDR | grep key |cut -c 17-26`
echo "Creating routes from MN1 to MN2"
sudo ip -6 route add $MN2_IN6_ADDR/128 via $CH1_IN6_ADDR mpls $var
#Phil, Lamia 10 Oct 08
source params.sh
sudo sysctl -w net.ipv6.conf.all.forwarding=1
./mr1_conf_nas.sh
./mr1_mpls_nas.sh
sudo sysctl -w net.ipv6.conf.eth0.proxy_ndp=1
sudo sysctl -w net.ipv6.conf.nasmesh0.proxy_ndp=1
sudo ifconfig eth0 promisc
sudo ip -6 addr add $MR1_EG6_ADDR/64 dev eth2
sudo xterm -hold -e "$OPENAIR3_PMIP6D_PATH/pmip6d -m -s -L $CH1_IN6_ADDR -N $MR1_EG6_ADDR -E $MR1_IN6_ADDR" &
#watch -n1 "cat /proc/openair2/lchan_stats ; cat /proc/openair1/bch_stats"
xterm -hold -e "cd /homes/foubert/Openair/openair2/SIMULATION/USER_TOOLS/LAYER2_SIM ; ./mac_sim -m1 -t $OPENAIR2_DIR/SIMULATION/TOPOLOGIES/eth_3nodes.top"
#./stop_rf.sh
sleep 2
./del_mpls.sh
#sleep 2
#./del_mpls.sh
#!/bin/bash
source params.sh
sleep 1
export OPENAIR2_DIR
#echo "0" >/proc/sys/net/ipv6/conf/all/forwarding
#echo Launching AS and RF
#./start_openair.sh 8 9
echo Installing NASMESH Driver
sudo rmmod -f nasmesh
sudo insmod $OPENAIR2_DIR/NAS/DRIVER/MESH/nasmesh.ko nas_IMEI=0x12345678,0x03000000
echo Classifcation rule for DTCH-Broadcast - reception of Router ADV
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c0 -i0 -z0 -x ff02::1 -y ff02::1 -r 3
sudo ifconfig nasmesh0 up
sudo ifconfig nasmesh0 10.0.0.4
#sudo ifconfig eth3 10.0.3.3
sudo ip -6 addr add $MR2_IN6_ADDR1/64 dev nasmesh0
sudo ip -6 addr add $MR2_IN6_ADDR2/64 dev nasmesh0
# Com between MR2 <-> CH1
echo Classification rules for MR2- Cluster 1 - Default DTCH UL for L3 signaling
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c1 -i0 -z0 -x $MR2_IN6_ADDR1 -y $CH1_IN6_ADDR -r 4
echo Classification rules for MR2- Cluster 1 - MPLS User-plane Bearer
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c2 -i0 -z0 -l $MR2_CH1_LABEL_OUT -m $MR2_CH1_LABEL_IN -r 5
echo Classification rules for MR2- Cluster 1 - MPLS PMIP Signaling
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c3 -i0 -z0 -l $CH1_MR2_CH2_LABEL_IN -m $CH1_MR2_CH2_LABEL_OUT -r 5
echo Classification rules for MR2- Cluster 1 - MPLS for com between MN3 and MN1
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c4 -i0 -z0 -l $MN3_MR2_CH1_MN1 -m $MN1_CH1_MR2_MN3 -r 5
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c5 -i0 -z0 -s $CH1_IN_ADDR -t 226.40.10.10 -r 4
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c6 -i0 -z0 -s $MR2_IN_ADDR -t 226.40.10.10 -r 4
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c7 -i0 -z0 -s $CH1_IN_ADDR -t 226.40.10.11 -r 4
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c8 -i0 -z0 -s $MR2_IN_ADDR -t 226.40.10.11 -r 4
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c9 -i0 -z0 -s $CH1_IN_ADDR -t 226.40.10.12 -r 4
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c10 -i0 -z0 -s $MR2_IN_ADDR -t 226.40.10.12 -r 4
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c11 -i0 -z0 -s $CH1_IN_ADDR -t 226.40.10.13 -r 4
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c12 -i0 -z0 -s $MR2_IN_ADDR -t 226.40.10.13 -r 4
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c13 -i0 -z0 -s $CH1_IN_ADDR -t 226.40.10.14 -r 4
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c14 -i0 -z0 -s $MR2_IN_ADDR -t 226.40.10.14 -r 4
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c15 -i0 -z0 -s $MR2_IN_ADDR -t 226.40.10.15 -r 4
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c16 -i0 -z0 -s $CH1_IN_ADDR -t 226.40.10.15 -r 4
# Com between MR2 <-> CH2
#echo Classification rules for MR2 -Cluster 2 - Default DTCH UL for L3 signaling
#$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c17 -i0 -z0 -x ff02::1 -y ff02::1 -r 11
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c18 -i0 -z0 -x $MR2_IN6_ADDR2 -y $CH2_IN6_ADDR -r 12
#echo Classification rules for MR2 -Cluster 2 - MPLS User-plane Bearer
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c19 -i0 -z0 -l $MR2_CH2_LABEL_OUT -m $MR2_CH2_LABEL_IN -r 13
#echo Classification rules for MR2- Cluster 2 - MPLS PMIP Signaling
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c20 -i0 -z0 -l $CH2_MR2_CH1_LABEL_IN -m $CH2_MR2_CH1_LABEL_OUT -r 13
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c21 -i0 -z0 -l $MN3_MR2_CH2_MN2 -m $MN2_CH2_MR2_MN3 -r 13
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c22 -i0 -z0 -s $CH2_IN_ADDR -t 226.50.10.10 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c23 -i0 -z0 -s $MR2_IN_ADDR -t 226.50.10.10 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c24 -i0 -z0 -s $CH2_IN_ADDR -t 226.50.10.11 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c25 -i0 -z0 -s $MR2_IN_ADDR -t 226.50.10.11 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c26 -i0 -z0 -s $CH2_IN_ADDR -t 226.50.10.12 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c27 -i0 -z0 -s $MR2_IN_ADDR -t 226.50.10.12 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c28 -i0 -z0 -s $CH2_IN_ADDR -t 226.50.10.13 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c29 -i0 -z0 -s $MR2_IN_ADDR -t 226.50.10.13 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c30 -i0 -z0 -s $CH2_IN_ADDR -t 226.50.10.14 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c31 -i0 -z0 -s $MR2_IN_ADDR -t 226.50.10.14 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c32 -i0 -z0 -s $MR2_IN_ADDR -t 226.50.10.15 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c33 -i0 -z0 -s $CH2_IN_ADDR -t 226.50.10.15 -r 12
#echo Multicast state launched with config_mr2
#xterm -hold -e /usr/bin/perl $REFLECTOR_DIR/reflector_launch.pl $REFLECTOR_DIR $REFLECTOR_DIR/config_mr2_mesh &
#xterm -hold -e /usr/bin/perl $REFLECTOR_DIR/reflector_launch.pl $REFLECTOR_DIR $REFLECTOR_DIR/config_mr2_mn3 &
#xterm -hold -e ./mac_sim -m0 -t $OPENAIR2_DIR/SIMULATION/TOPOLOGIES/eth_3nodes.top &
#!/bin/bash
source params.sh
sleep 1
export OPENAIR2_DIR
#echo "0" >/proc/sys/net/ipv6/conf/all/forwarding
echo Launching AS and RF
./start_openair.sh 5 9
echo Installing NASMESH Driver
sudo rmmod -f nasmesh
sudo insmod $OPENAIR2_DIR/NAS/DRIVER/MESH/nasmesh.ko nas_IMEI=0x12345678,0x03000000
echo Classifcation rule for DTCH-Broadcast - reception of Router ADV
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c0 -i0 -z0 -x ff02::1 -y ff02::1 -r 3
sudo ifconfig nasmesh0 up
sudo ifconfig nasmesh0 10.0.0.4
sudo ifconfig eth0 10.0.3.3
sudo ip -6 addr add $MR2_IN6_ADDR1/64 dev nasmesh0
sudo ip -6 addr add $MR2_IN6_ADDR2/64 dev nasmesh0
# Com between MR2 <-> CH1
echo Classification rules for MR2- Cluster 1 - Default DTCH UL for L3 signaling
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c1 -i0 -z0 -x $MR2_IN6_ADDR1 -y $CH1_IN6_ADDR -r 4
echo Classification rules for MR2- Cluster 1 - MPLS User-plane Bearer
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c2 -i0 -z0 -l $MR2_CH1_LABEL_OUT -m $MR2_CH1_LABEL_IN -r 5
echo Classification rules for MR2- Cluster 1 - MPLS PMIP Signaling
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c3 -i0 -z0 -l $CH1_MR2_CH2_LABEL_IN -m $CH1_MR2_CH2_LABEL_OUT -r 5
echo Classification rules for MR2- Cluster 1 - MPLS for com between MN3 and MN1
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c4 -i0 -z0 -l $MN3_MR2_CH1_MN1 -m $MN1_CH1_MR2_MN3 -r 5
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c5 -i0 -z0 -s $CH1_IN_ADDR -t 226.40.10.10 -r 4
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c6 -i0 -z0 -s $MR2_IN_ADDR -t 226.40.10.10 -r 4
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c7 -i0 -z0 -s $CH1_IN_ADDR -t 226.40.10.11 -r 4
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c8 -i0 -z0 -s $MR2_IN_ADDR -t 226.40.10.11 -r 4
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c9 -i0 -z0 -s $CH1_IN_ADDR -t 226.40.10.12 -r 4
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c10 -i0 -z0 -s $MR2_IN_ADDR -t 226.40.10.12 -r 4
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c11 -i0 -z0 -s $CH1_IN_ADDR -t 226.40.10.13 -r 4
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c12 -i0 -z0 -s $MR2_IN_ADDR -t 226.40.10.13 -r 4
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c13 -i0 -z0 -s $CH1_IN_ADDR -t 226.40.10.14 -r 4
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c14 -i0 -z0 -s $MR2_IN_ADDR -t 226.40.10.14 -r 4
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c15 -i0 -z0 -s $MR2_IN_ADDR -t 226.40.10.15 -r 4
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c16 -i0 -z0 -s $CH1_IN_ADDR -t 226.40.10.15 -r 4
# Com between MR2 <-> CH2
#echo Classification rules for MR2 -Cluster 2 - Default DTCH UL for L3 signaling
#$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c17 -i0 -z0 -x ff02::1 -y ff02::1 -r 11
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c18 -i0 -z0 -x $MR2_IN6_ADDR2 -y $CH2_IN6_ADDR -r 12
#echo Classification rules for MR2 -Cluster 2 - MPLS User-plane Bearer
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c19 -i0 -z0 -l $MR2_CH2_LABEL_OUT -m $MR2_CH2_LABEL_IN -r 13
#echo Classification rules for MR2- Cluster 2 - MPLS PMIP Signaling
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c20 -i0 -z0 -l $CH2_MR2_CH1_LABEL_IN -m $CH2_MR2_CH1_LABEL_OUT -r 13
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c21 -i0 -z0 -l $MN3_MR2_CH2_MN2 -m $MN2_CH2_MR2_MN3 -r 13
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c22 -i0 -z0 -s $CH2_IN_ADDR -t 226.50.10.10 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c23 -i0 -z0 -s $MR2_IN_ADDR -t 226.50.10.10 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c24 -i0 -z0 -s $CH2_IN_ADDR -t 226.50.10.11 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c25 -i0 -z0 -s $MR2_IN_ADDR -t 226.50.10.11 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c26 -i0 -z0 -s $CH2_IN_ADDR -t 226.50.10.12 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c27 -i0 -z0 -s $MR2_IN_ADDR -t 226.50.10.12 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c28 -i0 -z0 -s $CH2_IN_ADDR -t 226.50.10.13 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c29 -i0 -z0 -s $MR2_IN_ADDR -t 226.50.10.13 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c30 -i0 -z0 -s $CH2_IN_ADDR -t 226.50.10.14 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c31 -i0 -z0 -s $MR2_IN_ADDR -t 226.50.10.14 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c32 -i0 -z0 -s $MR2_IN_ADDR -t 226.50.10.15 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c33 -i0 -z0 -s $CH2_IN_ADDR -t 226.50.10.15 -r 12
echo Multicast state launched with config_mr2
xterm -hold -e /usr/bin/perl $REFLECTOR_DIR/reflector_launch.pl $REFLECTOR_DIR $REFLECTOR_DIR/config_mr2_mesh &
xterm -hold -e /usr/bin/perl $REFLECTOR_DIR/reflector_launch.pl $REFLECTOR_DIR $REFLECTOR_DIR/config_mr2_mn3 &
#!/bin/bash
# Author: Lamia Romdhani
#June 2008
source params.sh
sudo modprobe mpls6
echo Starting routing ...
echo No MPLS debug
echo "0" >/sys/mpls/debug
#MN1->MN2
./mpls_nas.sh $MR2_CH1_LABEL_IN $CH2_IN6_ADDR $MR2_CH2_LABEL_OUT
#MN2->MN1
./mpls_nas.sh $MR2_CH2_LABEL_IN $CH1_IN6_ADDR $MR2_CH1_LABEL_OUT
#CH1->CH2
./mpls_nas.sh $CH1_MR2_CH2_LABEL_OUT $CH2_IN6_ADDR $CH2_MR2_CH1_LABEL_IN
#CH2->CH1
./mpls_nas.sh $CH2_MR2_CH1_LABEL_OUT $CH1_IN6_ADDR $CH1_MR2_CH2_LABEL_IN
#MN3->MN1
var=`mpls nhlfe add key 0 instructions push gen $MN3_MR2_CH1_MN1 nexthop nasmesh0 ipv6 $CH1_IN6_ADDR |grep key | cut -c 17-26`
sudo ip -6 route add $MN1_IN6_ADDR/128 via $CH1_IN6_ADDR mpls $var
sudo ip -6 route add $MN3_IN6_ADDR/128 dev eth3
#MN1->MN3
sudo mpls labelspace set dev nasmesh0 labelspace 0
sudo mpls ilm add label gen $MN1_CH1_MR2_MN3 labelspace 0 proto ipv6
#MN3->MN2
var=`mpls nhlfe add key 0 instructions push gen $MN3_MR2_CH2_MN2 nexthop nasmesh0 ipv6 $CH2_IN6_ADDR |grep key | cut -c 17-26`
sudo ip -6 route add $MN2_IN6_ADDR/128 via $CH2_IN6_ADDR mpls $var
#MN2->MN3
sudo mpls labelspace set dev nasmesh0 labelspace 0
sudo mpls ilm add label gen $MN2_CH2_MR2_MN3 labelspace 0 proto ipv6
#!/bin/bash
#Lamia, Philippe huu nghia, 10 Oct 08
source params.sh
sudo sysctl -w net.ipv6.conf.all.forwarding=1
./mr2_conf_nas.sh
./mr2_mpls_nas.sh
sudo sysctl -w net.ipv6.conf.eth3.proxy_ndp=1
sudo sysctl -w net.ipv6.conf.nasmesh0.proxy_ndp=1