Commit d428222d authored by Lionel Gauthier's avatar Lionel 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
sudo ifconfig eth3 promisc
sudo ip -6 addr add $MR2_EG6_ADDR/64 dev eth3
sudo xterm -hold -e "$OPENAIR3_PMIP6D_PATH/pmip6d -m -s -L $CH1_IN6_ADDR -N $MR2_EG6_ADDR -E $MR2_IN6_ADDR1" &
#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 -m2 -t $OPENAIR2_DIR/SIMULATION/TOPOLOGIES/eth_3nodes.top"
#./stop_rf.sh
sleep 2
./del_mpls.sh
#sleep 2
#./del_mpls.sh
#!/bin/bash
#Lamia, Philippe huu nghia, 10 Oct 08
source params.sh
sudo sysctl -w net.ipv6.conf.all.forwarding=1
./mr2_conf_nas_barca_outdoor.sh
./mr2_mpls_nas_barca.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 $MR2_EG6_ADDR/64 dev eth0
sudo xterm -hold -e "$OPENAIR3_PMIP6D_PATH/pmip6d -m -s -L $CH1_IN6_ADDR -N $MR2_EG6_ADDR -E $MR2_IN6_ADDR1" &
watch -n1 "cat /proc/openair2/lchan_stats ; cat /proc/openair1/bch_stats"
./stop_rf.sh
./del_mpls.sh
sleep 2
./del_mpls.sh
#!/bin/bash
#Lamia, Philippe huu nghia, 10 Oct 08
source params.sh
sudo sysctl -w net.ipv6.conf.all.forwarding=1
./mr2_conf_nas_barca_parking.sh
./mr2_mpls_nas_barca.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 $MR2_EG6_ADDR/64 dev eth0
sudo xterm -hold -e "$OPENAIR3_PMIP6D_PATH/pmip6d -m -s -L $CH1_IN6_ADDR -N $MR2_EG6_ADDR -E $MR2_IN6_ADDR1" &
watch -n1 "cat /proc/openair2/lchan_stats ; cat /proc/openair1/bch_stats"
./stop_rf.sh
./del_mpls.sh
sleep 2
./del_mpls.sh
#!/bin/bash
#Lamia, Philippe huu nghia, 10 Oct 08
source params.sh
sudo sysctl -w net.ipv6.conf.all.forwarding=1
./mr2_conf_nas_barca_parking.sh
./mr2_mpls_nas_barca.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 $MR2_EG6_ADDR/64 dev eth0
#sudo xterm -hold -e "$OPENAIR3_PMIP6D_PATH/pmip6d -m -s -L $CH1_IN6_ADDR -N $MR2_EG6_ADDR -E $MR2_IN6_ADDR1" &
watch -n1 "cat /proc/openair2/lchan_stats ; cat /proc/openair1/bch_stats"
./stop_rf.sh
./del_mpls.sh
sleep 2
./del_mpls.sh
#!/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 1 10
echo Installing NASMESH Driver
sudo rmmod -f nasmesh
sudo insmod $OPENAIR2_DIR/NAS/DRIVER/MESH/nasmesh.ko nas_IMEI=0x12345678,0x02000000
sudo ifconfig nasmesh0 up
sudo ifconfig nasmesh0 10.0.0.5
sudo ip -6 addr add $MR3_IN6_ADDR/64 dev nasmesh0
echo Classification rules for MR3 - Default DTCH UL for L3 signaling
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c0 -i0 -z0 -x $MR3_IN6_ADDR -y $CH2_IN6_ADDR -r 4
echo Classification rules for MR3 - MPLS User-plane Bearer
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c1 -i0 -z0 -l $MN2_MR3_CH2_MN3 -m $MN3_CH2_MR3_MN2 -r 5
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c2 -i0 -z0 -l $MR3_LABEL_OUT -m $MR3_LABEL_IN -r 5
echo EADS Multicast for MR3
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c3 -i0 -z0 -s $CH2_IN_ADDR -t 226.30.10.10 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c4 -i0 -z0 -s $MR3_IN_ADDR -t 226.30.10.10 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c5 -i0 -z0 -s $CH2_IN_ADDR -t 226.30.10.11 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c6 -i0 -z0 -s $MR3_IN_ADDR -t 226.30.10.11 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c7 -i0 -z0 -s $CH2_IN_ADDR -t 226.30.10.12 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c8 -i0 -z0 -s $MR3_IN_ADDR -t 226.30.10.12 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c9 -i0 -z0 -s $CH2_IN_ADDR -t 226.30.10.13 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c10 -i0 -z0 -s $MR3_IN_ADDR -t 226.30.10.13 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c11 -i0 -z0 -s $CH2_IN_ADDR -t 226.30.10.14 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c12 -i0 -z0 -s $MR3_IN_ADDR -t 226.30.10.14 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c13 -i0 -z0 -s $MR3_IN_ADDR -t 226.30.10.15 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c14 -i0 -z0 -s $CH2_IN_ADDR -t 226.30.10.15 -r 12
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_mr3
xterm -hold -e /usr/bin/perl $REFLECTOR_DIR/reflector_launch.pl $REFLECTOR_DIR $REFLECTOR_DIR/config_mr3 &
#!/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 10
echo Installing NASMESH Driver
sudo rmmod -f nasmesh
sudo insmod $OPENAIR2_DIR/NAS/DRIVER/MESH/nasmesh.ko nas_IMEI=0x12345678,0x02000000
sudo ifconfig eth0 10.0.2.5
sudo ifconfig nasmesh0 up
sudo ifconfig nasmesh0 10.0.0.5
sudo ip -6 addr add $MR3_IN6_ADDR/64 dev nasmesh0
echo Classification rules for MR3 - Default DTCH UL for L3 signaling
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c0 -i0 -z0 -x $MR3_IN6_ADDR -y $CH2_IN6_ADDR -r 4
echo Classification rules for MR3 - MPLS User-plane Bearer
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c1 -i0 -z0 -l $MN2_MR3_CH2_MN3 -m $MN3_CH2_MR3_MN2 -r 5
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c2 -i0 -z0 -l $MR3_LABEL_OUT -m $MR3_LABEL_IN -r 5
echo EADS Multicast for MR3
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c3 -i0 -z0 -s $CH2_IN_ADDR -t 226.30.10.10 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c4 -i0 -z0 -s $MR3_IN_ADDR -t 226.30.10.10 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c5 -i0 -z0 -s $CH2_IN_ADDR -t 226.30.10.11 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c6 -i0 -z0 -s $MR3_IN_ADDR -t 226.30.10.11 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c7 -i0 -z0 -s $CH2_IN_ADDR -t 226.30.10.12 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c8 -i0 -z0 -s $MR3_IN_ADDR -t 226.30.10.12 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c9 -i0 -z0 -s $CH2_IN_ADDR -t 226.30.10.13 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c10 -i0 -z0 -s $MR3_IN_ADDR -t 226.30.10.13 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c11 -i0 -z0 -s $CH2_IN_ADDR -t 226.30.10.14 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c12 -i0 -z0 -s $MR3_IN_ADDR -t 226.30.10.14 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c13 -i0 -z0 -s $MR3_IN_ADDR -t 226.30.10.15 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c14 -i0 -z0 -s $CH2_IN_ADDR -t 226.30.10.15 -r 12
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_mr3
xterm -hold -e /usr/bin/perl $REFLECTOR_DIR/reflector_launch.pl $REFLECTOR_DIR $REFLECTOR_DIR/config_mr3 &
#!/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 6 10
echo Installing NASMESH Driver
sudo rmmod -f nasmesh
sudo insmod $OPENAIR2_DIR/NAS/DRIVER/MESH/nasmesh.ko nas_IMEI=0x12345678,0x02000000
sudo ifconfig eth0 10.0.2.5
sudo ifconfig nasmesh0 up
sudo ifconfig nasmesh0 10.0.0.5
sudo ip -6 addr add $MR3_IN6_ADDR/64 dev nasmesh0
echo Classification rules for MR3 - Default DTCH UL for L3 signaling
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c0 -i0 -z0 -x $MR3_IN6_ADDR -y $CH2_IN6_ADDR -r 12
echo Classification rules for MR3 - MPLS User-plane Bearer
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c1 -i0 -z0 -l $MN2_MR3_CH2_MN3 -m $MN3_CH2_MR3_MN2 -r 13
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c2 -i0 -z0 -l $MR3_LABEL_OUT -m $MR3_LABEL_IN -r 13
echo EADS Multicast for MR3
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c3 -i0 -z0 -s $CH2_IN_ADDR -t 226.30.10.10 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c4 -i0 -z0 -s $MR3_IN_ADDR -t 226.30.10.10 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c5 -i0 -z0 -s $CH2_IN_ADDR -t 226.30.10.11 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c6 -i0 -z0 -s $MR3_IN_ADDR -t 226.30.10.11 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c7 -i0 -z0 -s $CH2_IN_ADDR -t 226.30.10.12 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c8 -i0 -z0 -s $MR3_IN_ADDR -t 226.30.10.12 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c9 -i0 -z0 -s $CH2_IN_ADDR -t 226.30.10.13 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c10 -i0 -z0 -s $MR3_IN_ADDR -t 226.30.10.13 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c11 -i0 -z0 -s $CH2_IN_ADDR -t 226.30.10.14 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c12 -i0 -z0 -s $MR3_IN_ADDR -t 226.30.10.14 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c13 -i0 -z0 -s $MR3_IN_ADDR -t 226.30.10.15 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c14 -i0 -z0 -s $CH2_IN_ADDR -t 226.30.10.15 -r 12
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_mr3
xterm -hold -e /usr/bin/perl $REFLECTOR_DIR/reflector_launch.pl $REFLECTOR_DIR $REFLECTOR_DIR/config_mr3 &
#!/bin/bash
# Script by Lamia Romdhani, Nghia, Philippe, Hicham 18 Feb 2009
source params.sh
sudo modprobe mpls6
echo Setting MPLS for mr3
echo "0" > /sys/mpls/debug
echo 'MN1->MN2'
sudo mpls labelspace set dev nasmesh0 labelspace 0
sudo mpls ilm add label gen $MR3_LABEL_IN labelspace 0 proto ipv6
echo 'MN2->MN1'
var=`mpls nhlfe add key 0 instructions push gen $MR3_LABEL_OUT nexthop nasmesh0 ipv6 $CH2_IN6_ADDR |grep key | cut -c 17-26`
echo "Creating routes"
sudo ip -6 route add $MN1_IN6_ADDR/128 via $CH2_IN6_ADDR mpls $var
sudo ip -6 route add $MN2_IN6_ADDR/128 dev $ETH_MR3
echo 'MN3->MN2'
sudo mpls labelspace set dev nasmesh0 labelspace 0
sudo mpls ilm add label gen $MN3_CH2_MR3_MN2 labelspace 0 proto ipv6
echo 'MN2->MN3'
var=`mpls nhlfe add key 0 instructions push gen $MN2_MR3_CH2_MN3 nexthop nasmesh0 ipv6 $CH2_IN6_ADDR |grep key | cut -c 17-26`
echo "Creating routes"
sudo ip -6 route add $MN3_IN6_ADDR/128 via $CH2_IN6_ADDR mpls $var
#!/bin/bash
# Script by Lamia Romdhani, Nghia, Philippe, Hicham 18 Feb 2009
source params.sh
sudo modprobe mpls6
echo Setting MPLS for mr3
echo "0" > /sys/mpls/debug
echo 'MN1->MN2'
sudo mpls labelspace set dev nasmesh0 labelspace 0
sudo mpls ilm add label gen $MR3_LABEL_IN labelspace 0 proto ipv6
echo 'MN2->MN1'
var=`mpls nhlfe add key 0 instructions push gen $MR3_LABEL_OUT nexthop nasmesh0 ipv6 $CH2_IN6_ADDR |grep key | cut -c 17-26`
echo "Creating routes"
sudo ip -6 route add $MN1_IN6_ADDR/128 via $CH2_IN6_ADDR mpls $var
sudo ip -6 route add $MN2_IN6_ADDR/128 dev $ETH_MR3
echo 'MN3->MN2'
sudo mpls labelspace set dev nasmesh0 labelspace 0
sudo mpls ilm add label gen $MN3_CH2_MR3_MN2 labelspace 0 proto ipv6
echo 'MN2->MN3'
var=`mpls nhlfe add key 0 instructions push gen $MN2_MR3_CH2_MN3 nexthop nasmesh0 ipv6 $CH2_IN6_ADDR |grep key | cut -c 17-26`
echo "Creating routes"
sudo ip -6 route add $MN3_IN6_ADDR/128 via $CH2_IN6_ADDR mpls $var
#Phil, Lamia 10 Oct 08
source params.sh
sudo sysctl -w net.ipv6.conf.all.forwarding=1
./mr3_conf_nas_barca.sh
./mr3_mpls_nas_barca.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 $MR3_EG6_ADDR/64 dev eth0
sudo xterm -hold -e "$OPENAIR3_PMIP6D_PATH/pmip6d -m -s -L $CH2_IN6_ADDR -N $MR3_EG6_ADDR -E $MR3_IN6_ADDR" &
watch -n1 "cat /proc/openair2/lchan_stats ; cat /proc/openair1/bch_stats"
./stop_rf.sh
./del_mpls.sh
sleep 2
./del_mpls.sh
#Phil, Lamia 10 Oct 08
source params.sh
sudo sysctl -w net.ipv6.conf.all.forwarding=1
./mr3_conf_nas_barca_outdoor.sh
./mr3_mpls_nas_barca.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 $MR3_EG6_ADDR/64 dev eth0
#sudo xterm -hold -e "$OPENAIR3_PMIP6D_PATH/pmip6d -m -s -L $CH2_IN6_ADDR -N $MR3_EG6_ADDR -E $MR3_IN6_ADDR" &
watch -n1 "cat /proc/openair2/lchan_stats ; cat /proc/openair1/bch_stats"
./stop_rf.sh
./del_mpls.sh
sleep 2
./del_mpls.sh
#Phil, Lamia 10 Oct 08
source params.sh
sudo sysctl -w net.ipv6.conf.all.forwarding=1
./mr3_conf_nas_barca_parking.sh
./mr3_mpls_nas_barca.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 $MR3_EG6_ADDR/64 dev eth0
#sudo xterm -hold -e "$OPENAIR3_PMIP6D_PATH/pmip6d -m -s -L $CH2_IN6_ADDR -N $MR3_EG6_ADDR -E $MR3_IN6_ADDR" &
watch -n1 "cat /proc/openair2/lchan_stats ; cat /proc/openair1/bch_stats"
./stop_rf.sh
./del_mpls.sh
sleep 2
./del_mpls.sh
#!/bin/bash
MR1_IN_ADDR=10.0.1.3
MR1_IN6_ADDR=2001:10:0:1:7856:3412:0:2
MR1_EG_ADDR=192.168.9.1
MR1_EG6_ADDR=2001:660:5502::100
# Flow CH1->MR1
MR1_LABEL_IN=1001
# Flow MR1->CH1
MR1_LABEL_OUT=1000
ETH_MR1=eth0
MR2_IN_ADDR=10.0.1.4
MR2_IN6_ADDR1=2001:10:0:1:7856:3412:0:3
MR2_IN6_ADDR2=2001:10:0:2:7856:3412:0:3
MR2_EG6_ADDR=2001:660:5502::300
ETH_MR2=eth0
# Flow CH1->MR2
MR2_CH1_LABEL_IN=2000
# Flow MR2->CH1
MR2_CH1_LABEL_OUT=2001
# Flow CH2->MR2
MR2_CH2_LABEL_IN=3001
# Flow MR2->CH2
MR2_CH2_LABEL_OUT=3000
MR3_IN_ADDR=10.0.1.5
MR3_IN6_ADDR=2001:10:0:2:7856:3412:0:2
MR3_EG_ADDR=192.168.10.1
MR3_EG6_ADDR=2001:660:5502::200
# Flow CH2->MR3
MR3_LABEL_IN=4000
# Flow MR3->CH2
MR3_LABEL_OUT=4001
ETH_MR3=eth2
CH1_IN_ADDR=10.0.1.1
CH2_IN_ADDR=10.0.1.2
CH1_IN6_ADDR=2001:10:0:1:7856:3412:0:1
CH2_IN6_ADDR=2001:10:0:2:7856:3412:0:1
## Communication between the CHs
CH1_MR2_CH2_LABEL_IN=8001
CH1_MR2_CH2_LABEL_OUT=8000
CH2_MR2_CH1_LABEL_IN=9001
CH2_MR2_CH1_LABEL_OUT=9000
## Com between MN1 and MN3
MN1_MR1_CH1_MN3=1500
MN3_CH1_MR1_MN1=1501
MN1_CH1_MR2_MN3=2500
MN3_MR2_CH1_MN1=2501
## Com between MN2 and MN3
MN3_MR2_CH2_MN2=3500
MN2_CH2_MR2_MN3=3501
MN3_CH2_MR3_MN2=4500
MN2_MR3_CH2_MN3=4501
#MN1_IN6_ADDR=2001:660:5502::20
#MN2_IN6_ADDR=2001:660:5502::25
#MN1_IN6_ADDR=2001:660:5502::110
MN1_IN6_ADDR=2001:660:5502:0:211:43ff:fe74:77bb
MN1_IN_ADDR=192.168.9.2
MN2_IN6_ADDR=2001:660:5502::210
#MN3_IN6_ADDR=2001:660:5502::310
#MN3_IN6_ADDR=2001:660:5502:0:240:8cff:fe77:9b79
MN3_IN6_ADDR=2001:660:5502:0:218:8bff:feb0:50aa
MN2_IN_ADDR=192.168.10.2
# Put the right OPENAIR3 path here
OPENAIR3_HOME=~/Openair/openair3
OPENAIR3_PMIP6D_PATH=$OPENAIR3_HOME/pmip6d
OPENAIR3_SCRIPTS_PATH=$OPENAIR3_HOME/scripts
REFLECTOR_DIR=$OPENAIR3_HOME/EXAMPLES/BARCA_TRIALS/REFLECTOR
# Put the right OPENAIR2 path here
#OPENAIR2_DIR=~/openair2_r234/openair2/
OPENAIR2_DIR=~/Openair/openair2
if [ "$1" == "" ]; then
echo "Please provide a TX power level (0-8)"
exit
fi
if [ "$2" == "" ]; then
echo "Please provide a Node ID (0-7 for CH, 8-15 for MR/UE)"
exit
fi
if [ "$OPENAIR1_DIR" == "" ] ; then
echo "Please set OPENAIR1_DIR environment variable"
exit
else
echo "OPENAIR1_DIR Set to $OPENAIR1_DIR"
fi
cd $OPENAIR1_DIR/USERSPACE_TOOLS/OPENAIR_RF
source ./txgains.sh
case $1 in
0)
CBMIMO1_POWER=$CBMIMO1_m20_dBm
echo "Configuring CBMIMO1 for -20dBm ($CBMIMO1_POWER)"
;;
1)
CBMIMO1_POWER=$CBMIMO1_m15_dBm
echo Configuring CBMIMO1 for -15dBm
;;
2)
CBMIMO1_POWER=$CBMIMO1_m10_dBm
echo Configuring CBMIMO1 for -10dBm
;;
3)
CBMIMO1_POWER=$CBMIMO1_m5_dBm
echo Configuring CBMIMO1 for -5dBm
;;
4)
CBMIMO1_POWER=$CBMIMO1_0_dBm
echo Configuring CBMIMO1 for 0dBm
;;
5)
CBMIMO1_POWER=$CBMIMO1_5_dBm
echo Configuring CBMIMO1 for 5dBm
;;
6)
CBMIMO1_POWER=$CBMIMO1_10_dBm
echo Configuring CBMIMO1 for 10dBm
;;
7)
CBMIMO1_POWER=$CBMIMO1_15_dBm
echo Configuring CBMIMO1 for 15dBm
;;
8)
CBMIMO1_POWER=$CBMIMO1_20_dBm
echo Configuring CBMIMO1 for 20dBm
;;
*)
echo Invalid TX power
exit
esac
echo Removing openair_rf,openair_l2 and openair_rrc modules
sudo rmmod -f openair_rrc
sudo rmmod -f openair_l2
sudo rmmod -f openair_rf
sudo insmod $OPENAIR1_DIR/ARCH/CBMIMO1/DEVICE_DRIVER/openair_rf_l2.ko
OARF_RET=`lsmod | grep -e openair_rf`
if [ "$OARF_RET" = "" ]; then
echo Error loading openair1 module
exit
fi
sudo insmod $OPENAIR2_DIR/LAYER2/openair_layer2.ko
OA2_RET=`lsmod | grep -e openair_l2`
if [ "$OA2_RET" = "" ]; then
echo Error loading openair2 module
exit
fi
sudo insmod $OPENAIR2_DIR/RRC/MESH/openair_RRC.ko
OARRC_RET=`lsmod | grep -e openair_rrc`
if [ "$OARRC_RET" = "" ]; then
echo Error loading openair RRC module
exit
fi
OA_DEV="/dev/openair0"
if [ -c "$OA_DEV" ]; then
echo "$OA_DEV exists"
else
echo "creating $OA_DEV"
sudo mknod $OA_DEV c 127 0
sudo chmod a+rw /dev/openair0
fi
./openair_rf_cbmimo1 1 0
./openair_rf_cbmimo1 1 6 $CBMIMO1_POWER
if [ $2 -lt "8" ]; then
./openair_rf_cbmimo1 1 1 1 $2
elif [ $2 -lt "16" ]; then
./openair_rf_cbmimo1 1 3 1 $2
else
echo Illegal Node ID, exiting
exit
fi
sleep 1
# Watch the status of the radio to check for hardware exit event
#OA1_STATE=`cat /proc/openair1/openair1_state`
#while [ "$OA1_STATE" != "EXITED" ]; do
# OA1_STATE=`cat /proc/openair1/openair1_state`
# sleep .5
#done
#./openair_rf_cbmimo1 1 4 1
#echo CBMIMO1 Hardware exit, restarting ...
cd $OPENAIR1_DIR/USERSPACE_TOOLS/OPENAIR_RF
echo STOP STARTS...
./openair_rf_cbmimo1 1 4 1
sleep 2
echo STOP RF DONE
sudo killall chbch_scope
echo STOP CHBCH SCOPE DONE
sudo killall sach_scope
echo STOP_SACH SCOPE DONE
sleep 1
sudo rmmod nasmesh
sleep 1
echo REMOVE NASMESH MODULE DONE
sudo rmmod openair_rrc
sleep 1
echo REMOVE RRC MODULE DONE
sudo rmmod openair_l2
sleep 1
echo REMOVE LAYER2 MODULE DONE
sudo rmmod openair_rf
echo REMOVE RF MODULE DONE
echo STOP FINISHED SUCCESSFULLY
# Configuration file of CH1 (SP4-Wimaxhead1)
# side linked to MR1 (Chorist Edge 1) : name of interface, IPv4, TTL
int_1=nasmesh0
ipv_1=4
ttl_1=65
# side linked to MR2 (SP4-Wimaxrelay-2) : name of interface, IPv4, TTL
int_2=nasmesh0
ipv_2=4
ttl_2=65
#multicast group label on side 1 then group label on side 2
groupes=226.30.10.10,226.40.10.10
groupes=226.30.10.11,226.40.10.11
groupes=226.30.10.12,226.40.10.12
groupes=226.30.10.13,226.40.10.13
groupes=226.30.10.14,226.40.10.14
groupes=226.30.10.15,226.40.10.15
#Port ranges
ports=1234,1234
ports=6300,6308
ports=6340,6348
ports=6360,6368
# Configuration file of CH1 (SP4-Wimaxhead2)
# side linked to MR2 (SP4-Wimaxrelay-2) : name of interface, IPv4, TTL
int_1=nasmesh0
ipv_1=4
ttl_1=65
# side linked to MR3 (SP4-Edge2) : name of interface, IPv4, TTL
int_2=nasmesh0
ipv_2=4
ttl_2=65
#multicast group label on side 1 then group label on side 2
groupes=226.50.10.10,226.30.10.10
groupes=226.50.10.11,226.30.10.11
groupes=226.50.10.12,226.30.10.12
groupes=226.50.10.13,226.30.10.13
groupes=226.50.10.14,226.30.10.14
groupes=226.50.10.15,226.30.10.15
#Port ranges
ports=1234,1234
ports=6300,6308
ports=6340,6348
ports=6360,6368
# Configuration file of MN1 (Dieppe)
# side linked to EADS End-users (Wifi side) : name of interface, IPv4, TTL
int_1=wifi0
ipv_1=4
ttl_1=65
# side linked to MR1 (CHORIST-Edge1): name of interface, IPv4, TTL
int_2=eth0
ipv_2=4
ttl_2=65
#multicast group label on side 1 then group label on side 2
groupes=224.0.55.55,224.0.66.66
groupes=226.10.10.10,226.20.10.10
groupes=226.10.10.11,226.20.10.11
groupes=226.10.10.12,226.20.10.12
groupes=226.10.10.13,226.20.10.13
groupes=226.10.10.14,226.20.10.14
groupes=226.10.10.15,226.20.10.15
#Port ranges
ports=1234,1234
ports=6300,6308
ports=6340,6348
ports=6360,6368
# Configuration file of MN2 (Sarlat)
# side linked to MR3 (CHORIST-Edge2) : name of interface, IPv4, TTL
int_2=eth0
ipv_2=4
ttl_2=65
# side linked to EADS End-users (Wifi side) : name of interface, IPv4, TTL
int_1=wifi0
ipv_1=4
ttl_1=65
#multicast group label on side 1 then group label on side 2
groupes=226.20.10.10,226.10.10.10
groupes=226.20.10.11,226.10.10.11
groupes=226.20.10.12,226.10.10.12
groupes=226.20.10.13,226.10.10.13
groupes=226.20.10.14,226.10.10.14
groupes=226.20.10.15,226.10.10.15
#Port ranges
ports=1234,1234
ports=6300,6308
ports=6340,6348
ports=6360,6368
# Configuration file MR1 (Chorist-Edge1)
# side linked to MN1 (DIEPPE) : name of interface, IPv4, TTL
int_1=eth0
ipv_1=4
ttl_1=65
# side linked to CH1 (SP4-Wimaxhead1) : name of interface, IPv4, TTL
int_2=nasmesh0
ipv_2=4
ttl_2=65
#multicast group label on side 1 then group label on side 2
groupes=226.20.10.10,226.30.10.10
groupes=226.20.10.11,226.30.10.11
groupes=226.20.10.12,226.30.10.12
groupes=226.20.10.13,226.30.10.13
groupes=226.20.10.14,226.30.10.14
groupes=226.20.10.15,226.30.10.15
# different port ranges
ports=1234,1234
ports=6300,6308
ports=6340,6348
ports=6360,6368
# Configuration file MR2 (SP4-Wimaxrelay-2)
# side linked to CH1 (SP4-Wimaxhead1) : name of interface, IPv4, TTL
int_1=nasmesh0
ipv_1=4
ttl_1=65
# side linked to CH1 (SP4-Wimaxhead2) : name of interface, IPv4, TTL
int_2=nasmesh0
ipv_2=4
ttl_2=65
#multicast group label on side 1 then group label on side 2
groupes=226.40.10.10,226.50.10.10
groupes=226.40.10.11,226.50.10.11
groupes=226.40.10.12,226.50.10.12
groupes=226.40.10.13,226.50.10.13
groupes=226.40.10.14,226.50.10.14
groupes=226.40.10.15,226.50.10.15
# different port ranges
ports=1234,1234
ports=6300,6308
ports=6340,6348
ports=6360,6368
# Configuration file MR3 (Chorist-Edge2)
# side linked to CH2 (SP4-Wimaxhead2) : name of interface, IPv4, TTL
int_1=nasmesh0
ipv_1=4
ttl_1=65
# side linked to MN2 (SARLAT) : name of interface, IPv4, TTL
int_2=eth0
ipv_2=4
ttl_2=65
#multicast group label on side 1 then group label on side 2
groupes=226.30.10.10,226.20.10.10
groupes=226.30.10.11,226.20.10.11
groupes=226.30.10.12,226.20.10.12
groupes=226.30.10.13,226.20.10.13
groupes=226.30.10.14,226.20.10.14
groupes=226.30.10.15,226.20.10.15
# different port ranges
ports=1234,1234
ports=6300,6308
ports=6340,6348
ports=6360,6368
/*******************************/
/* reflector-forwarding-v4m by */
/*******************************/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <strings.h>
#include <netdb.h>
#include <sys/types.h>
#include <sys/time.h>
#include <sys/unistd.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <sys/signal.h>
#include <sys/param.h>
#include <errno.h>
#include <arpa/inet.h>
#include <pthread.h>
#include <syslog.h>
/* To get ifreq */
#include <arpa/inet.h>
#include <sys/socket.h>
#include <net/if.h>
#include <sys/ioctl.h>
#include <limits.h>
#include <netinet/in_systm.h>
#include <netinet/in.h>
#include <netinet/ip.h>
#include <netinet/udp.h>
#define _PATH_PROCNET_IFINET6 "/proc/net/if_inet6"
#define MSGBUF_SIZE 32768
#define IFNAMSIZE 11
#define INLINE inline __attribute__((always_inline))
struct ipaddr_str {
char buf[MAX(INET6_ADDRSTRLEN, INET_ADDRSTRLEN)];
};
int IP_VERSION;
static INLINE const char *ip4_to_string(struct ipaddr_str * const buf, const struct in_addr addr4)
{
return inet_ntop(AF_INET, &addr4, buf->buf, sizeof(buf->buf));
}
static INLINE const char *ip6_to_string(struct ipaddr_str * const buf, const struct in6_addr * const addr6)
{
return inet_ntop(AF_INET6, addr6, buf->buf, sizeof(buf->buf));
}
static INLINE const char *sockaddr4_to_string(struct ipaddr_str * const buf, const struct sockaddr * const addr)
{
const struct sockaddr_in * const addr4 = (const struct sockaddr_in *)addr;
return ip4_to_string(buf, addr4->sin_addr);
}
int programshutdown (void);
#define NUM_THREADS 200
struct thread_data {
int thread_id;
char interface1[11];
char multicast_addr1[41];
char interface2[11];
char multicast_addr2[41];
int ttl1;
int ttl2;
int port1;
int port2;
};
struct thread_data thread_data_array[NUM_THREADS];
/*******************************************************************
*From net-tools lib/interface.c
*
*******************************************************************/
int
get_ipv6_address(char *ifname, struct sockaddr_in6 *saddr6, int scope_in)
{
char addr6[40], devname[IFNAMSIZE];
char addr6p[8][5];
int plen, scope, dad_status, if_idx;
FILE *f;
struct sockaddr_in6 tmp_sockaddr6;
if ((f = fopen(_PATH_PROCNET_IFINET6, "r")) != NULL) {
while (fscanf(f, "%4s%4s%4s%4s%4s%4s%4s%4s %02x %02x %02x %02x %20s\n",
addr6p[0], addr6p[1], addr6p[2], addr6p[3],
addr6p[4], addr6p[5], addr6p[6], addr6p[7],
&if_idx, &plen, &scope, &dad_status, devname) != EOF) {
if (!strcmp(devname, ifname)) {
sprintf(addr6, "%s:%s:%s:%s:%s:%s:%s:%s",
addr6p[0], addr6p[1], addr6p[2], addr6p[3],
addr6p[4], addr6p[5], addr6p[6], addr6p[7]);
printf( "\t inet6 addr: %s\n", addr6);
printf("\t Scope: %d\n", scope);
if(scope == scope_in) {
printf( "\tFound GLOBAL addr: %s:%s:%s:%s:%s:%s:%s:%s\n",
addr6p[0], addr6p[1], addr6p[2], addr6p[3],
addr6p[4], addr6p[5], addr6p[6], addr6p[7]);
inet_pton(AF_INET6,addr6,&tmp_sockaddr6);
memcpy(&saddr6->sin6_addr, &tmp_sockaddr6, sizeof(struct in6_addr));
fclose(f);
return 1;
}
}
}
fclose(f);
}
return 0;
}
/*****************************************************/
/* Threaded routine */
/*****************************************************/
void *Reflector(void *threadarg)
{
int ioctl_s;
struct thread_data *my_data;
my_data = (struct thread_data *)threadarg;
struct in_addr multicastaddress_in; //IPv4 multicast address from command line
struct in_addr multicastaddress_out;
struct sockaddr_in6 tmp_saddr6;
struct ifreq ifr;
struct ipaddr_str buf;
int mcdataport4; //IPv4 multicast port 1
int mcdataport; //IPv4 multicast port 2
/*define variables*/
int mcdatarecvfd4; //multicast data receive socket side 1
int mcdatarecvfd; //multicast data receive socket side 2
int sendfd4; //local send socket IPv4 side 1
int sendfd; //local send socket IPv4 side 2
int ttl1; //time to live IPv4 side 1
int ttl2; //time to live IPv4 side 2
struct sockaddr_in mcdataaddr4; //reception IPv4 sockaddr
struct sockaddr_in mcdataaddr; //reception IPv44 sockaddr
char myhostnameipaddress4[20]; // IPv4 reflector's address string
char myhostnameipaddress[20]; // IPv44 reflector's address string
char addressstring4[20]; // IPv4 address string
char addressstring[20]; // IPv44 address string
struct sockaddr_in localsendaddr4; //IPv4 address of outgoing packets interface 1
struct sockaddr_in localsendaddr; //IPv4 address of outgoing packets interface 2
struct sockaddr_in sourceaddr4; //IPv4 address of incoming packets interface 1
struct sockaddr_in sourceaddr; //IPv4 address of incoming packets interface 2
struct ip_mreq mcdatareq4; //IPv4 join group structure
struct ip_mreq mcdatareq; //IPv44 join group structure
int mcdataaddrlen; //IPv4 multicast address length
unsigned int sourceaddrlen; //IPv4 source address length
char mcdatarecvbuf4[MSGBUF_SIZE]; //IPv4 multicast receive buffer
char mcdatarecvbuf[MSGBUF_SIZE]; //IPv44 multicast receive buffer
fd_set readfds; // file descriptors set
int maxfds; // max number of file descriptors
int nfds;
int nr; // number of bytes read with recvfrom
int ns; // number of bytes sent with sendto
int chksrc; // asserts if source address is not the reflector's one
int debugon=1;
int n2;
char inputbuf[32];
/* IPv4 multicast address */
if((inet_pton(AF_INET,my_data->multicast_addr1,&multicastaddress_in.s_addr))!=1) {
printf("bad multicast IPv4 address format\n");
exit (1);
}
//printf("multicastaddress side 1 v4 =%s\n",my_data->multicast_addr1);
/* IPv4 multicast address */
if((inet_pton(AF_INET,my_data->multicast_addr2,&multicastaddress_out.s_addr))!=1) {
printf("bad multicast IPv4 address format\n");
exit (1);
}
//printf("multicastaddress side 2 v4 =%s\n",my_data->multicast_addr2);
/* IPv4 multicast ports */
mcdataport4 = my_data->port1;
mcdataport = my_data->port2;
/* Time to live for IPv4 multicast */
ttl1 = my_data->ttl1;
/* Time to live for IPv4 multicast */
ttl2 = my_data->ttl2;
IP_VERSION=4;
if (IP_VERSION==4 ) { //
ioctl_s = socket(AF_INET, SOCK_DGRAM, 0);
if (ioctl_s < 0) {
syslog(LOG_ERR, "ioctl socket: %m");
exit (0);
}
/* INTERFACE 1 */
memset(&ifr, 0, sizeof(struct ifreq));
strncpy(ifr.ifr_name, my_data->interface1, IFNAMSIZE);
/* Check interface address (IPv4) */
if(ioctl(ioctl_s, SIOCGIFADDR, &ifr) < 0) {
printf( "\tCould not get address of interface 1 - removing it\n");
exit(0);
}
sockaddr4_to_string(&myhostnameipaddress4, &ifr.ifr_addr);
/* INTERFACE 2 */
memset(&ifr, 0, sizeof(struct ifreq));
strncpy(ifr.ifr_name, my_data->interface2, IFNAMSIZE);
/* Check interface address (IPv4) */
if(ioctl(ioctl_s, SIOCGIFADDR, &ifr) < 0) {
printf( "\tCould not get address of interface 2 - removing it\n");
exit(0);
}
sockaddr4_to_string(&myhostnameipaddress, &ifr.ifr_addr);
} else {
/* Global address mode */
int ipv6_addrtype = 0; /* global */
/* Get IPV6 GLOBAL interface address */
memset(&ifr, 0, sizeof(struct ifreq));
strncpy(ifr.ifr_name, my_data->interface2, IFNAMSIZE);
if(get_ipv6_address(ifr.ifr_name, &tmp_saddr6, ipv6_addrtype ) <= 0) {
printf( "\tCould not find site-local IPv6 address for %s\n", ifr.ifr_name);
}
memset(&ifr, 0, sizeof(struct ifreq));
strncpy(ifr.ifr_name, my_data->interface2, IFNAMSIZE);
// printf("\n Adding interface : %s \n", my_data->interface2);
/* Get IPV6 GLOBAL interface address */
if(get_ipv6_address(ifr.ifr_name, &tmp_saddr6, ipv6_addrtype ) <= 0) {
printf( "\tCould not find site-local IPv6 address for %s\n", ifr.ifr_name);
}
}
/* Structures initialization */
/*enter the address/port data into the mcdataaddr structure for IPv4*/
bzero((char *) &mcdataaddr4, sizeof(mcdataaddr4));
mcdataaddr4.sin_family=AF_INET;
mcdataaddr4.sin_addr.s_addr = multicastaddress_in.s_addr;
mcdataaddr4.sin_port = htons(mcdataport4);
/*enter the address/port data into the mcdataaddr structure for IPv4*/
bzero((char *) &mcdataaddr, sizeof(mcdataaddr));
mcdataaddr.sin_family=AF_INET;
mcdataaddr.sin_addr.s_addr = multicastaddress_out.s_addr;
mcdataaddr.sin_port = htons(mcdataport);
/*enter the address/port data into the localsendaddr structure for IPv4*/
bzero((char *) &localsendaddr4, sizeof(localsendaddr4));
localsendaddr4.sin_family=AF_INET;
inet_pton(AF_INET, myhostnameipaddress4 , &localsendaddr4.sin_addr.s_addr);
localsendaddr4.sin_port = htons(0);
//LL
// inet_ntop(AF_INET, &localsendaddr4.sin_addr.s_addr,addressstring ,sizeof(addressstring));
// printf("threaded function local sender addr side 1=%s \t",addressstring);
/*enter the address/port data into the localsendaddr structure for IPv4*/
bzero((char *) &localsendaddr, sizeof(localsendaddr));
localsendaddr.sin_family=AF_INET;
inet_pton(AF_INET, myhostnameipaddress , &localsendaddr.sin_addr.s_addr);
localsendaddr.sin_port = htons(0);
//LL
// inet_ntop(AF_INET, &localsendaddr.sin_addr.s_addr,addressstring ,sizeof(addressstring));
// printf("threaded function local sender addr side 2=%s\n", addressstring);
/*enter the address/port data into the mcdatareq structure for IPv4*/
bzero((char *) &mcdatareq4, sizeof(mcdatareq4));
// mcdatareq4.imr_interface.s_addr=htonl(INADDR_ANY); < force to add a multicast route
inet_pton(AF_INET, myhostnameipaddress4 ,&mcdatareq4.imr_interface.s_addr );
mcdatareq4.imr_multiaddr.s_addr=multicastaddress_in.s_addr;
// inet_pton(AF_INET, myhostnameipaddress4 , &mcdatareq4.imr_interface.s_addr);
/*enter the address/port data into the mcdatareq structure for IPv4*/
bzero((char *) &mcdatareq, sizeof(mcdatareq));
inet_pton(AF_INET, myhostnameipaddress ,&mcdatareq.imr_interface.s_addr );
// mcdatareq.imr_interface.s_addr=htonl(INADDR_ANY);
mcdatareq.imr_multiaddr.s_addr=multicastaddress_out.s_addr;
/*get the sendfd socket linked to the first address of the current host */
if ((sendfd4 = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
perror("can't open sendfd socket!");
exit (1);
}
if (bind(sendfd4, (struct sockaddr *) &localsendaddr4, \
sizeof(localsendaddr4)) < 0) {
perror("can't bind localsendaddr v4 to socket!");
exit(1);
}
/*get the sendfd socket linked to the first address of the current host*/
if ((sendfd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
perror("can't open sendfd socket!");
exit (1);
}
if (bind(sendfd, (struct sockaddr *) &localsendaddr, \
sizeof(localsendaddr)) < 0) {
perror("can't bind localsendaddr v4 side 2 to socket!");
exit(1);
}
if ((mcdatarecvfd4 = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
perror("can't open mcdatarecvfd4 socket!");
exit(1);
}
/*allow multiple processes per host to read from IPv4 sockets side 2*/
if (setsockopt(mcdatarecvfd4, SOL_SOCKET, SO_REUSEADDR, &mcdataaddr4, sizeof(mcdataaddr4)) < 0) {
perror("SO_REUSEADDR setsockopt v4\n");
}
if (bind(mcdatarecvfd4, (struct sockaddr *) &mcdataaddr4, \
sizeof(mcdataaddr4)) < 0) {
inet_ntop(AF_INET, &mcdataaddr4.sin_addr.s_addr,addressstring ,sizeof(addressstring));
printf("with address of bind %s\n", addressstring);
perror("can't bind mcdataaddr v4 to socket!");
exit(1);
}
if (multicastaddress_out.s_addr!=multicastaddress_in.s_addr) {
//multicast data receive socket side 2
/*get a mcdatarecvfd socket, bind to address for IPv4*/
if ((mcdatarecvfd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
perror("can't open mcdatarecvfd4 socket!");
exit(1);
}
/*allow multiple processes per host to read from IPv4 sockets side 2*/
if (setsockopt(mcdatarecvfd, SOL_SOCKET, SO_REUSEADDR, &mcdataaddr, sizeof(mcdataaddr)) < 0) {
perror("SO_REUSEADDR setsockopt v4\n");
}
if (bind(mcdatarecvfd, (struct sockaddr *) &mcdataaddr, \
sizeof(mcdataaddr)) < 0) {
perror("can't bind mcdataaddr v4 side 2 to socket!");
exit(1);
}
} else {
mcdatarecvfd= mcdatarecvfd4;
}
/*set socket options to join multicast group in IPv4*/
if (setsockopt(mcdatarecvfd4, IPPROTO_IP, IP_ADD_MEMBERSHIP, &mcdatareq4,\
sizeof(mcdatareq4)) < 0) {
perror("can't set socket options to join multicast group data v4 side 1!");
exit(1);
}
/*set socket options to join multicast group in IPv4*/
if (setsockopt(mcdatarecvfd, IPPROTO_IP, IP_ADD_MEMBERSHIP, &mcdatareq,\
sizeof(mcdatareq)) < 0) {
perror("can't set socket options to join multicast group data v4 side 2!");
exit(1);
}
/*now set multicast socket TTL option for IPv4*/
if (setsockopt(sendfd4, IPPROTO_IP, IP_MULTICAST_TTL, \
&ttl1, sizeof(ttl1)) < 0)
perror("can't set multicast ttl v4 socket option!");
/*now set multicast socket TTL option for IPv4*/
if (setsockopt(sendfd, IPPROTO_IP, IP_MULTICAST_TTL, \
&ttl2, sizeof(ttl2)) < 0)
perror("can't set multicast ttl v4 socket option!");
/*define the sizes of the address structures*/
mcdataaddrlen=sizeof(mcdataaddr4);
sourceaddrlen=sizeof(sourceaddr4);
/*start infinite while loop*/
/*and check for activity on sockets*/
/*set up the select sytem call parameters*/
/*zero out the readfds and writefds lists, then add*/
/*the file descriptors of interest*/
while(1) {
FD_ZERO(&readfds);
FD_SET(mcdatarecvfd4, &readfds);
FD_SET(mcdatarecvfd, &readfds);
if (debugon >= 1) {
FD_SET(0, &readfds);
}
maxfds = mcdatarecvfd4 + 5;
/*check for activity*/
nfds = select(maxfds, &readfds, NULL, NULL, NULL);
/*if specified on the command line, check for input on stdin*/
if (debugon >= 1) {
if (FD_ISSET(0, &readfds)) {
n2 = read(0,inputbuf, sizeof(inputbuf));
inputbuf[n2>0? n2-1: 0] = '\0';
if (!strcmp(inputbuf,"q")) {
programshutdown();
}
}
fflush(stdout);
}
/*1:receive from IPv4, send on IPv44 - data*/
if (FD_ISSET(mcdatarecvfd4, &readfds)) {
nr = recvfrom(mcdatarecvfd4, mcdatarecvbuf4, MSGBUF_SIZE, 0, (struct sockaddr *) \
&sourceaddr4, &sourceaddrlen);
if (debugon >= 2) {
inet_ntop(AF_INET, &sourceaddr4.sin_addr.s_addr, addressstring4 , sizeof(addressstring4));
printf("\nreading from mcdatarecvfd4, got data from %s\n", addressstring4);
}
if (sourceaddr4.sin_addr.s_addr == localsendaddr4.sin_addr.s_addr) {
chksrc = 0;
if (debugon >= 2)
printf("don't retransmit multicastv4 sourced from gateway machine\n");
} else {
chksrc = 1;
if (debugon >= 2)
printf("retransmit to multicast address\n");
}
if (chksrc) {
if (nr < 0)
printf ("mcdatarecvfd4:recvfrom over multicast v4 address error!(1)\n");
/*now send to IPv4*/
if (multicastaddress_out.s_addr != INADDR_ANY) {
if (debugon >= 2) {
inet_ntop(AF_INET, &mcdataaddr.sin_addr.s_addr,addressstring4 ,sizeof(addressstring4));
printf("sending to %s\n", addressstring4);
}
ns = sendto(sendfd, mcdatarecvbuf4, nr, 0, (struct sockaddr *)&mcdataaddr, \
sizeof(mcdataaddr));
} else {
if (debugon >= 2) printf("not resending to ORIGINATOR! or array entry = 0\n");
}
}
}
/*2:receive from IPv4 side 2, send on IPv44 side 1 - data*/
if (FD_ISSET(mcdatarecvfd, &readfds)) {
nr = recvfrom(mcdatarecvfd, mcdatarecvbuf, MSGBUF_SIZE, 0, (struct sockaddr *) \
&sourceaddr, &sourceaddrlen);
if (debugon >= 2) {
inet_ntop(AF_INET, &sourceaddr.sin_addr.s_addr, addressstring , sizeof(addressstring));
printf("\nreading from mcdatarecvfd side 2, got data from %s\n", addressstring);
}
if (sourceaddr.sin_addr.s_addr == localsendaddr.sin_addr.s_addr) {
chksrc = 0;
if (debugon >= 2)
printf("don't retransmit multicastv4 sourced from gateway machine\n");
} else {
chksrc = 1;
if (debugon >= 2)
printf("retransmit to multicast address side 1\n");
}
if (chksrc) {
if (nr < 0)
printf ("mcdatarecvfd:recvfrom over multicast v4 address error!(1)\n");
/*now send to IPv4*/
if (multicastaddress_in.s_addr != INADDR_ANY) {
if (debugon >= 2) {
inet_ntop(AF_INET, &mcdataaddr4.sin_addr.s_addr,addressstring ,sizeof(addressstring));
printf("sending to %s\n", addressstring);
}
ns = sendto(sendfd4, mcdatarecvbuf, nr, 0, (struct sockaddr *)&mcdataaddr4, \
sizeof(mcdataaddr4));
} else {
if (debugon >= 2) printf("not resending to ORIGINATOR! or array entry = 0\n");
}
}
}
} //end of while loop
}
/*****************************************************/
int
main (argc, argv)
int argc;
char **argv;
{
char interface1[11], interface2[11];
int ttl1; //time to live side1
int ttl2; //time to live side 2
struct couple {
char multicast_addr1[41]; /* address multicast for the group side 1 */
char multicast_addr2[41]; /* address multicast for the group side 2 */
};
int nb_port_range;
int nb_multicast_couple;
int ip_version, ip_version2;
int displayon=0;
struct couple *multi_group;
int i,j, k, rc,port;
pthread_t threads[NUM_THREADS];
struct port_range {
int port_begin;
int port_end;
};
struct port_range *prt_range;
if (argc < 12) {
fprintf (stderr, "Error in the syntax\n");
exit(1);
}
strcpy(interface1,argv[1]);
strcpy(interface2,argv[2]);
ip_version= atoi(argv[3]);
ip_version2=atoi(argv[4]);
/* Time to live for IPv4 multicast */
ttl1 = atoi(argv[5]);
/* Time to live for IPv4 multicast */
ttl2 = atoi(argv[6]);
nb_multicast_couple=atoi(argv[7]);
if (nb_multicast_couple !=0) {
if ((multi_group=(struct couple *)malloc(nb_multicast_couple*sizeof(struct couple)))==NULL) {
printf("Memory problem to allocate struct couple !\n") ;
exit (1);
}
for (i=0; i <nb_multicast_couple; i++) {
strcpy(multi_group[i].multicast_addr1,argv[8+2*i]);
strcpy(multi_group[i].multicast_addr2,argv[8+2*i +1]);
}
} else {
exit(0);
}
nb_port_range=atoi(argv[8 + nb_multicast_couple*2]);
if (nb_port_range !=0) {
if ((prt_range=(struct port_range *)malloc(nb_port_range*sizeof(struct port_range)))==NULL) {
printf("Memory problem to allocate struct port !\n") ;
exit (1);
}
for (i=0; i <nb_port_range; i++) {
prt_range[i].port_begin= atoi(argv[8+1 + nb_multicast_couple*2+2*i]);
prt_range[i].port_end = atoi(argv[8+1 + nb_multicast_couple*2+2*i +1]);
}
} else {
exit(0);
}
k=0;
printf( "Multicast state : for interface %s and interface %s for %d multicast group(s) on %d port range(s) \n", interface1, interface2, nb_multicast_couple, nb_port_range);
for (i=0; i <nb_multicast_couple; i++) {
for(j=0; j <nb_port_range; j++) {
for (port= prt_range[j].port_begin; port <=prt_range[j].port_end; port++) {
strcpy (thread_data_array[k].interface1, interface1);
strcpy (thread_data_array[k].interface2, interface2);
thread_data_array[k].ttl1=ttl1;
thread_data_array[k].ttl2=ttl2;
strcpy (thread_data_array[k].multicast_addr1, multi_group[i].multicast_addr1);
strcpy (thread_data_array[k].multicast_addr2, multi_group[i].multicast_addr2);
thread_data_array[k].thread_id=k;
thread_data_array[k].port1=port;
thread_data_array[k].port2=port;
if (displayon >= 1) printf("Creating thread %d for group %d for port %d\n", k,i ,port);
rc=pthread_create(&threads[k], NULL, Reflector, (void *)&thread_data_array[k]);
if (rc) {
printf("Error; return code from pthreade_create() is %d\n", rc);
exit(-1);
}
k=k+1;
if (k> NUM_THREADS) {
printf("Number of created threads over the fixed limited!" );
exit(-1);
}
}
}
}
pthread_exit(NULL);
}
int programshutdown ()
{
exit (1);
}
#!/usr/bin/perl -w
use Switch;
$dir = $ARGV[0];
$file = $ARGV[1];
$nb_groupes = `grep groupes $ARGV[0]|wc -l|sed \'s/ //g\'`;
$nb_plages = `grep port $ARGV[0]|wc -l|sed \'s/ //g\'`;
chomp($nb_plages);
chomp($nb_groupes);
#les structures dans lesquelles on stocke les données
@groupes=();
@ports=();
@int_1=();
@int_2=();
@ipv_1=();
@ipv_2=();
@ttl_1=();
@ttl_2=();
#on compte le nombre de lignes, pour signaler l'erreur
$num_ligne = 0;
open(fFile, "< $file") or die "cannot open file $file";
while($line = <fFile>){
$num_ligne++;
#on ignore les lignes commentées ou vides
if ((substr ($line,0,1) ne "#") && ($line =~ /=/)) {
@ligne=split("=", $line);
#si l'argument est vide, alors le programme sort avec une erreur
chomp($ligne[1]);
if(!length($ligne[1])){
printf "Erreur dans le fichier de conf à la ligne $num_ligne.\n";
exit;
}
#on met les données dans les structures adéquates
switch ($ligne[0]){
case "int_1" {push(@int_1,$ligne[1])}
case "int_2" {push(@int_2,$ligne[1])}
case "ipv_1" {push(@ipv_1,$ligne[1])}
case "ipv_2" {push(@ipv_2,$ligne[1])}
case "ttl_1" {push(@ttl_1,$ligne[1])}
case "ttl_2" {push(@ttl_2,$ligne[1])}
case "groupes" {push(@groupes,$ligne[1])}
case "ports" {push(@ports,$ligne[1])}
}
}
}
close(fFile);
#On construit la commande et on l'affiche
$commande = "$dir/reflector $int_1[0] $int_2[0] $ipv_1[0] $ipv_2[0] $ttl_1[0] $ttl_2[0]";
#on rajoute le nb de groupes et les groupes
$commande = $commande." ".@groupes;
foreach $groupe (@groupes){
@couple = split (",", $groupe);
$commande = $commande." $couple[0] $couple[1]";
}
#on rajoute le nb de ports et les ports
$commande = $commande." ".@ports;
foreach $port (@ports){
@couple = split (",", $port);
$commande = $commande." $couple[0] $couple[1]";
}
$commande = $commande."\n";
system($commande);
#!/bin/bash
source params.sh
sleep 1
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
## Est ce bon ?
#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 &
#!/bin/bash
source params.sh
sleep 1
echo Clusterhead address is $CH1_IN6_ADDR
echo Launching AS and RF
./start_openair.sh 6 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
## Est ce bon ?
#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 &
#!/bin/bash
source params.sh
sudo ./ch1_conf_nas_barca_outdoor.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" &
watch -n .1 "cat /proc/openair2/lchan_stats ; cat /proc/openair1/bch_stats ; cat /proc/openair1/openair1_state"
./stop_rf.sh
./del_mpls.sh
sleep 2
./del_mpls.sh
#!/bin/bash
source params.sh
sudo ./ch1_conf_nas_barca_outdoor.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" &
watch -n .1 "cat /proc/openair2/lchan_stats ; cat /proc/openair1/bch_stats ; cat /proc/openair1/openair1_state"
./stop_rf.sh
./del_mpls.sh
sleep 2
./del_mpls.sh
#!/bin/bash
source params.sh
sudo ./ch1_conf_nas_barca_parking.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" &
watch -n .5 "cat /proc/openair2/lchan_stats ; cat /proc/openair1/bch_stats ; cat /proc/openair1/openair1_state"
./stop_rf.sh
./del_mpls.sh
sleep 2
./del_mpls.sh
#!/bin/bash
source params.sh
sudo ./ch1_conf_nas_barca_parking.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" &
watch -n .5 "cat /proc/openair2/lchan_stats ; cat /proc/openair1/bch_stats ; cat /proc/openair1/openair1_state"
./stop_rf.sh
./del_mpls.sh
sleep 2
./del_mpls.sh
#!/bin/bash
source params.sh
sleep 1
echo ClusterHead address is $CH2_IN6_ADDR
echo Launching AS and RF
./start_openair.sh 8 1
# Installing NASMESH driver
sudo rmmod -f nasmesh
sudo insmod $OPENAIR2_DIR/NAS/DRIVER/MESH/nasmesh.ko nas_IMEI=0x12345678,0x01000000
echo Classification rules for CH2
#CH2 Broadcast (transmission of Router ADV)
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c0 -i0 -z0 -x $CH2_IN6_ADDR -y ff02::1 -r 3
#CH2<-> MR2 IP Signaling
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c1 -i0 -z0 -x $CH2_IN6_ADDR -y $MR2_IN6_ADDR2 -r 20
#CH<-> MR1 MPLS user-plane bearer
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c2 -i0 -z0 -l $MR2_CH2_LABEL_IN -m $MR2_CH2_LABEL_OUT -r 21
#CH2<-> MR2 MPLS PMIP Signaling
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c3 -i0 -z0 -l $CH2_MR2_CH1_LABEL_OUT -m $CH2_MR2_CH1_LABEL_IN -r 21
#CH2<-> MR2 MPLS Signaling - For com between MN3 and MN2
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c4 -i0 -z0 -l $MN2_CH2_MR2_MN3 -m $MN3_MR2_CH2_MN2 -r 21
#CH2<-> MR2 Imulticast
echo EADS Multicast for MR2
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c5 -i0 -z0 -s $CH2_IN_ADDR -t 226.50.10.10 -r 20
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c6 -i0 -z0 -s $MR2_IN_ADDR -t 226.50.10.10 -r 20
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c7 -i0 -z0 -s $CH2_IN_ADDR -t 226.50.10.11 -r 20
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c8 -i0 -z0 -s $MR2_IN_ADDR -t 226.50.10.11 -r 20
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c9 -i0 -z0 -s $CH2_IN_ADDR -t 226.50.10.12 -r 20
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c10 -i0 -z0 -s $MR2_IN_ADDR -t 226.50.10.12 -r 20
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c11 -i0 -z0 -s $CH2_IN_ADDR -t 226.50.10.13 -r 20
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c12 -i0 -z0 -s $MR2_IN_ADDR -t 226.50.10.13 -r 20
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c13 -i0 -z0 -s $CH2_IN_ADDR -t 226.50.10.14 -r 20
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c14 -i0 -z0 -s $MR2_IN_ADDR -t 226.50.10.14 -r 20
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c15 -i0 -z0 -s $MR2_IN_ADDR -t 226.50.10.15 -r 20
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c16 -i0 -z0 -s $CH2_IN_ADDR -t 226.50.10.15 -r 20
#CH2<-> MR3 (IP Signaling)
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c17 -i0 -z0 -x $CH2_IN6_ADDR -y $MR3_IN6_ADDR -r 28
#CH2<-> MR3 (MPLS user-plane bearer)
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c18 -i0 -z0 -l $MR3_LABEL_IN -m $MR3_LABEL_OUT -r 29
#CH2<-> MR3 (MPLS for com between MN2 and MN3)
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c19 -i0 -z0 -l $MN3_CH2_MR3_MN2 -m $MN2_MR3_CH2_MN3 -r 29
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c20 -i0 -z0 -s $MR3_IN_ADDR -t 226.30.10.10 -r 28
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c21 -i0 -z0 -s $CH2_IN_ADDR -t 226.30.10.10 -r 28
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c22 -i0 -z0 -s $MR3_IN_ADDR -t 226.30.10.11 -r 28
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c23 -i0 -z0 -s $CH2_IN_ADDR -t 226.30.10.11 -r 28
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c24 -i0 -z0 -s $MR3_IN_ADDR -t 226.30.10.12 -r 28
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c25 -i0 -z0 -s $CH2_IN_ADDR -t 226.30.10.12 -r 28
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c26 -i0 -z0 -s $MR3_IN_ADDR -t 226.30.10.13 -r 28
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c27 -i0 -z0 -s $CH2_IN_ADDR -t 226.30.10.13 -r 28
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c28 -i0 -z0 -s $MR3_IN_ADDR -t 226.30.10.14 -r 28
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c29 -i0 -z0 -s $CH2_IN_ADDR -t 226.30.10.14 -r 28
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c30 -i0 -z0 -s $MR3_IN_ADDR -t 226.30.10.15 -r 28
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c31 -i0 -z0 -s $CH2_IN_ADDR -t 226.30.10.15 -r 28
# Bring up openair NASMESH device and set IPv6 address
sudo ifconfig nasmesh0 up
sudo ip addr add 10.0.0.2/24 dev nasmesh0
sudo ip -6 addr add $CH2_IN6_ADDR/64 dev nasmesh0
echo No MPLS debug
echo "0" >/sys/mpls/debug
echo Multicast state launched with config_ch2
xterm -hold -e /usr/bin/perl $REFLECTOR_DIR/reflector_launch.pl $REFLECTOR_DIR $REFLECTOR_DIR/config_ch2 &
#!/bin/bash
source params.sh
sleep 1
echo ClusterHead address is $CH2_IN6_ADDR
echo Launching AS and RF
./start_openair.sh 8 1
# Installing NASMESH driver
sudo rmmod -f nasmesh
sudo insmod $OPENAIR2_DIR/NAS/DRIVER/MESH/nasmesh.ko nas_IMEI=0x12345678,0x01000000
echo Classification rules for CH2
#CH2 Broadcast (transmission of Router ADV)
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c0 -i0 -z0 -x $CH2_IN6_ADDR -y ff02::1 -r 3
#CH2<-> MR2 IP Signaling
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c1 -i0 -z0 -x $CH2_IN6_ADDR -y $MR2_IN6_ADDR2 -r 20
#CH<-> MR1 MPLS user-plane bearer
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c2 -i0 -z0 -l $MR2_CH2_LABEL_IN -m $MR2_CH2_LABEL_OUT -r 21
#CH2<-> MR2 MPLS PMIP Signaling
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c3 -i0 -z0 -l $CH2_MR2_CH1_LABEL_OUT -m $CH2_MR2_CH1_LABEL_IN -r 21
#CH2<-> MR2 MPLS Signaling - For com between MN3 and MN2
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c4 -i0 -z0 -l $MN2_CH2_MR2_MN3 -m $MN3_MR2_CH2_MN2 -r 21
#CH2<-> MR2 Imulticast
echo EADS Multicast for MR2
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c5 -i0 -z0 -s $CH2_IN_ADDR -t 226.50.10.10 -r 20
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c6 -i0 -z0 -s $MR2_IN_ADDR -t 226.50.10.10 -r 20
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c7 -i0 -z0 -s $CH2_IN_ADDR -t 226.50.10.11 -r 20
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c8 -i0 -z0 -s $MR2_IN_ADDR -t 226.50.10.11 -r 20
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c9 -i0 -z0 -s $CH2_IN_ADDR -t 226.50.10.12 -r 20
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c10 -i0 -z0 -s $MR2_IN_ADDR -t 226.50.10.12 -r 20
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c11 -i0 -z0 -s $CH2_IN_ADDR -t 226.50.10.13 -r 20
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c12 -i0 -z0 -s $MR2_IN_ADDR -t 226.50.10.13 -r 20
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c13 -i0 -z0 -s $CH2_IN_ADDR -t 226.50.10.14 -r 20
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c14 -i0 -z0 -s $MR2_IN_ADDR -t 226.50.10.14 -r 20
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c15 -i0 -z0 -s $MR2_IN_ADDR -t 226.50.10.15 -r 20
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c16 -i0 -z0 -s $CH2_IN_ADDR -t 226.50.10.15 -r 20
#CH2<-> MR3 (IP Signaling)
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c17 -i0 -z0 -x $CH2_IN6_ADDR -y $MR3_IN6_ADDR -r 28
#CH2<-> MR3 (MPLS user-plane bearer)
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c18 -i0 -z0 -l $MR3_LABEL_IN -m $MR3_LABEL_OUT -r 29
#CH2<-> MR3 (MPLS for com between MN2 and MN3)
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c19 -i0 -z0 -l $MN3_CH2_MR3_MN2 -m $MN2_MR3_CH2_MN3 -r 29
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c20 -i0 -z0 -s $MR3_IN_ADDR -t 226.30.10.10 -r 28
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c21 -i0 -z0 -s $CH2_IN_ADDR -t 226.30.10.10 -r 28
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c22 -i0 -z0 -s $MR3_IN_ADDR -t 226.30.10.11 -r 28
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c23 -i0 -z0 -s $CH2_IN_ADDR -t 226.30.10.11 -r 28
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c24 -i0 -z0 -s $MR3_IN_ADDR -t 226.30.10.12 -r 28
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c25 -i0 -z0 -s $CH2_IN_ADDR -t 226.30.10.12 -r 28
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c26 -i0 -z0 -s $MR3_IN_ADDR -t 226.30.10.13 -r 28
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c27 -i0 -z0 -s $CH2_IN_ADDR -t 226.30.10.13 -r 28
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c28 -i0 -z0 -s $MR3_IN_ADDR -t 226.30.10.14 -r 28
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c29 -i0 -z0 -s $CH2_IN_ADDR -t 226.30.10.14 -r 28
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c30 -i0 -z0 -s $MR3_IN_ADDR -t 226.30.10.15 -r 28
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c31 -i0 -z0 -s $CH2_IN_ADDR -t 226.30.10.15 -r 28
# Bring up openair NASMESH device and set IPv6 address
sudo ifconfig nasmesh0 up
sudo ip addr add 10.0.0.2/24 dev nasmesh0
sudo ip -6 addr add $CH2_IN6_ADDR/64 dev nasmesh0
echo No MPLS debug
echo "0" >/sys/mpls/debug
echo Multicast state launched with config_ch2
xterm -hold -e /usr/bin/perl $REFLECTOR_DIR/reflector_launch.pl $REFLECTOR_DIR $REFLECTOR_DIR/config_ch2 &
#!/bin/bash
#CH2_NAS.SH
#Cluster Head (2)– with NAS_MPLS_PMIP working
#Phil, 25 july 08
source params.sh
./ch2_conf_nas_barca_outdoor.sh
#MN1->MN2
./mpls_nas.sh $MR2_CH2_LABEL_OUT $MR3_IN6_ADDR $MR3_LABEL_IN
#MN2->MN1
./mpls_nas.sh $MR3_LABEL_OUT $MR2_IN6_ADDR2 $MR2_CH2_LABEL_IN
#CH1->MR2->CH2
echo 'CH1->MR2->CH2'
mpls labelspace set dev nasmesh0 labelspace 0
mpls ilm add label gen $CH2_MR2_CH1_LABEL_IN labelspace 0 proto ipv6
echo 'CH1->MR2->CH2'
var=`mpls nhlfe add key 0 instructions push gen $CH2_MR2_CH1_LABEL_OUT nexthop nasmesh0 ipv6 $MR2_IN6_ADDR2 | grep key |cut -c 17-26`
echo "Creating routes from CH2 to CH1"
sudo ip -6 route add $CH1_IN6_ADDR/128 via $MR2_IN6_ADDR2 mpls $var
#MN3->MN2
./mpls_nas.sh $MN3_MR2_CH2_MN1 $MR3_IN6_ADDR $MN3_CH2_MR3_MN2
#MN2->MN3
./mpls_nas.sh $MN2_MR3_CH2_MN3 $MR2_IN6_ADDR2 $MN1_CH2_MR2_MN3
echo $OPENAIR3_HOME/pmip6d/pmip6d -c -L $CH2_IN6_ADDR -A $CH1_IN6_ADDR
#sudo xterm -hold -e "$OPENAIR3_HOME/pmip6d/pmip6d -c -L $CH2_IN6_ADDR -A $CH1_IN6_ADDR" &
watch -n .1 "cat /proc/openair2/lchan_stats ; cat /proc/openair1/bch_stats ; cat /proc/openair1/openair1_state"
./stop_rf.sh
./del_mpls.sh
sleep 2
./del_mpls.sh
#!/bin/bash
#CH2_NAS.SH
#Cluster Head (2)– with NAS_MPLS_PMIP working
#Phil, 25 july 08
source params.sh
./ch2_conf_nas_barca_parking.sh
echo "0" > /sys/mpls/debug
#MN1->MN2
./mpls_nas.sh $MR2_CH2_LABEL_OUT $MR3_IN6_ADDR $MR3_LABEL_IN
#MN2->MN1
./mpls_nas.sh $MR3_LABEL_OUT $MR2_IN6_ADDR2 $MR2_CH2_LABEL_IN
echo "0" > /sys/mpls/debug
#CH1->MR2->CH2
echo 'CH1->MR2->CH2'
mpls labelspace set dev nasmesh0 labelspace 0
mpls ilm add label gen $CH2_MR2_CH1_LABEL_IN labelspace 0 proto ipv6
echo 'CH1->MR2->CH2'
var=`mpls nhlfe add key 0 instructions push gen $CH2_MR2_CH1_LABEL_OUT nexthop nasmesh0 ipv6 $MR2_IN6_ADDR2 | grep key |cut -c 17-26`
echo "Creating routes from CH2 to CH1"
sudo ip -6 route add $CH1_IN6_ADDR/128 via $MR2_IN6_ADDR2 mpls $var
#MN3->MN2
./mpls_nas.sh $MN3_MR2_CH2_MN1 $MR3_IN6_ADDR $MN3_CH2_MR3_MN2
#MN2->MN3
./mpls_nas.sh $MN2_MR3_CH2_MN3 $MR2_IN6_ADDR2 $MN1_CH2_MR2_MN3
echo $OPENAIR3_HOME/pmip6d/pmip6d -c -L $CH2_IN6_ADDR -A $CH1_IN6_ADDR
#sudo xterm -hold -e "$OPENAIR3_HOME/pmip6d/pmip6d -c -L $CH2_IN6_ADDR -A $CH1_IN6_ADDR" &
watch -n .5 "cat /proc/openair2/lchan_stats ; cat /proc/openair1/bch_stats ; cat /proc/openair1/openair1_state"
./stop_rf.sh
./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 eth0 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 &
#!/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 6 8
echo Installing NASMESH Driver
sudo rmmod -f nasmesh
sudo insmod $OPENAIR2_DIR/NAS/DRIVER/MESH/nasmesh.ko nas_IMEI=0x12345678,0x02000000
sudo ifconfig eth0 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 &
#!/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 0 8
echo Installing NASMESH Driver
sudo rmmod -f nasmesh
sudo insmod $OPENAIR2_DIR/NAS/DRIVER/MESH/nasmesh.ko nas_IMEI=0x12345678,0x02000000
sudo ifconfig eth0 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 &
#!/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 eth0
# 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_barca_outdoor.sh
./mr1_mpls_nas_barca.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 eth0
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"
./stop_rf.sh
./del_mpls.sh
sleep 2
./del_mpls.sh
#Phil, Lamia 10 Oct 08
source params.sh
sudo sysctl -w net.ipv6.conf.all.forwarding=1
./mr1_conf_nas_barca_outdoor.sh
./mr1_mpls_nas_barca.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 eth0
#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"
./stop_rf.sh
./del_mpls.sh
sleep 2
./del_mpls.sh
#Phil, Lamia 10 Oct 08
source params.sh
sudo sysctl -w net.ipv6.conf.all.forwarding=1
./mr1_conf_nas_barca_parking.sh
./mr1_mpls_nas_barca.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 eth0
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"
./stop_rf.sh
./del_mpls.sh
sleep 2
./del_mpls.sh
#Phil, Lamia 10 Oct 08
source params.sh
sudo sysctl -w net.ipv6.conf.all.forwarding=1
./mr1_conf_nas_barca_parking.sh
./mr1_mpls_nas_barca.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 eth0
#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"
./stop_rf.sh
./del_mpls.sh
sleep 2
./del_mpls.sh
#Phil, Lamia 10 Oct 08
source params.sh
sudo sysctl -w net.ipv6.conf.all.forwarding=1
./mr1_conf_nas_barca_room_nopmip.sh
./mr1_mpls_nas_barca.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 eth0
#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"
./stop_rf.sh
./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 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
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
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 eth0
#MN1->MN3
mpls labelspace set dev nasmesh0 labelspace 0
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
mpls labelspace set dev nasmesh0 labelspace 0
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_barca_outdoor.sh
./mr2_mpls_nas_barca.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 $MR2_EG6_ADDR/64 dev eth0
sudo xterm -hold -e "$OPENAIR3_PMIP6D_PATH/pmip6d -m -s -L $CH1_IN6_ADDR -N $MR2_EG6_ADDR -E $MR2_IN6_ADDR1" &
watch -n1 "cat /proc/openair2/lchan_stats ; cat /proc/openair1/bch_stats"
./stop_rf.sh
./del_mpls.sh
sleep 2
./del_mpls.sh
#!/bin/bash
#Lamia, Philippe huu nghia, 10 Oct 08
source params.sh
sudo sysctl -w net.ipv6.conf.all.forwarding=1
./mr2_conf_nas_barca_outdoor.sh
./mr2_mpls_nas_barca.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 $MR2_EG6_ADDR/64 dev eth0
#sudo xterm -hold -e "$OPENAIR3_PMIP6D_PATH/pmip6d -m -s -L $CH1_IN6_ADDR -N $MR2_EG6_ADDR -E $MR2_IN6_ADDR1" &
watch -n1 "cat /proc/openair2/lchan_stats ; cat /proc/openair1/bch_stats"
./stop_rf.sh
./del_mpls.sh
sleep 2
./del_mpls.sh
#!/bin/bash
#Lamia, Philippe huu nghia, 10 Oct 08
source params.sh
sudo sysctl -w net.ipv6.conf.all.forwarding=1
./mr2_conf_nas_barca_parking.sh
./mr2_mpls_nas_barca.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 $MR2_EG6_ADDR/64 dev eth0
sudo xterm -hold -e "$OPENAIR3_PMIP6D_PATH/pmip6d -m -s -L $CH1_IN6_ADDR -N $MR2_EG6_ADDR -E $MR2_IN6_ADDR1" &
watch -n1 "cat /proc/openair2/lchan_stats ; cat /proc/openair1/bch_stats"
./stop_rf.sh
./del_mpls.sh
sleep 2
./del_mpls.sh
#!/bin/bash
#Lamia, Philippe huu nghia, 10 Oct 08
source params.sh
sudo sysctl -w net.ipv6.conf.all.forwarding=1
./mr2_conf_nas_barca_parking.sh
./mr2_mpls_nas_barca.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 $MR2_EG6_ADDR/64 dev eth0
#sudo xterm -hold -e "$OPENAIR3_PMIP6D_PATH/pmip6d -m -s -L $CH1_IN6_ADDR -N $MR2_EG6_ADDR -E $MR2_IN6_ADDR1" &
watch -n1 "cat /proc/openair2/lchan_stats ; cat /proc/openair1/bch_stats"
./stop_rf.sh
./del_mpls.sh
sleep 2
./del_mpls.sh
#!/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 1 10
echo Installing NASMESH Driver
sudo rmmod -f nasmesh
sudo insmod $OPENAIR2_DIR/NAS/DRIVER/MESH/nasmesh.ko nas_IMEI=0x12345678,0x02000000
sudo ifconfig nasmesh0 up
sudo ifconfig nasmesh0 10.0.0.5
sudo ip -6 addr add $MR3_IN6_ADDR/64 dev nasmesh0
echo Classification rules for MR3 - Default DTCH UL for L3 signaling
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c0 -i0 -z0 -x $MR3_IN6_ADDR -y $CH2_IN6_ADDR -r 4
echo Classification rules for MR3 - MPLS User-plane Bearer
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c1 -i0 -z0 -l $MN2_MR3_CH2_MN3 -m $MN3_CH2_MR3_MN2 -r 5
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c2 -i0 -z0 -l $MR3_LABEL_OUT -m $MR3_LABEL_IN -r 5
echo EADS Multicast for MR3
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c3 -i0 -z0 -s $CH2_IN_ADDR -t 226.30.10.10 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c4 -i0 -z0 -s $MR3_IN_ADDR -t 226.30.10.10 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c5 -i0 -z0 -s $CH2_IN_ADDR -t 226.30.10.11 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c6 -i0 -z0 -s $MR3_IN_ADDR -t 226.30.10.11 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c7 -i0 -z0 -s $CH2_IN_ADDR -t 226.30.10.12 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c8 -i0 -z0 -s $MR3_IN_ADDR -t 226.30.10.12 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c9 -i0 -z0 -s $CH2_IN_ADDR -t 226.30.10.13 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c10 -i0 -z0 -s $MR3_IN_ADDR -t 226.30.10.13 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c11 -i0 -z0 -s $CH2_IN_ADDR -t 226.30.10.14 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c12 -i0 -z0 -s $MR3_IN_ADDR -t 226.30.10.14 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c13 -i0 -z0 -s $MR3_IN_ADDR -t 226.30.10.15 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c14 -i0 -z0 -s $CH2_IN_ADDR -t 226.30.10.15 -r 12
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_mr3
xterm -hold -e /usr/bin/perl $REFLECTOR_DIR/reflector_launch.pl $REFLECTOR_DIR $REFLECTOR_DIR/config_mr3 &
#!/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 10
echo Installing NASMESH Driver
sudo rmmod -f nasmesh
sudo insmod $OPENAIR2_DIR/NAS/DRIVER/MESH/nasmesh.ko nas_IMEI=0x12345678,0x02000000
sudo ifconfig eth0 10.0.2.5
sudo ifconfig nasmesh0 up
sudo ifconfig nasmesh0 10.0.0.5
sudo ip -6 addr add $MR3_IN6_ADDR/64 dev nasmesh0
echo Classification rules for MR3 - Default DTCH UL for L3 signaling
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c0 -i0 -z0 -x $MR3_IN6_ADDR -y $CH2_IN6_ADDR -r 4
echo Classification rules for MR3 - MPLS User-plane Bearer
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c1 -i0 -z0 -l $MN2_MR3_CH2_MN3 -m $MN3_CH2_MR3_MN2 -r 5
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c2 -i0 -z0 -l $MR3_LABEL_OUT -m $MR3_LABEL_IN -r 5
echo EADS Multicast for MR3
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c3 -i0 -z0 -s $CH2_IN_ADDR -t 226.30.10.10 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c4 -i0 -z0 -s $MR3_IN_ADDR -t 226.30.10.10 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c5 -i0 -z0 -s $CH2_IN_ADDR -t 226.30.10.11 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c6 -i0 -z0 -s $MR3_IN_ADDR -t 226.30.10.11 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c7 -i0 -z0 -s $CH2_IN_ADDR -t 226.30.10.12 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c8 -i0 -z0 -s $MR3_IN_ADDR -t 226.30.10.12 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c9 -i0 -z0 -s $CH2_IN_ADDR -t 226.30.10.13 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c10 -i0 -z0 -s $MR3_IN_ADDR -t 226.30.10.13 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c11 -i0 -z0 -s $CH2_IN_ADDR -t 226.30.10.14 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c12 -i0 -z0 -s $MR3_IN_ADDR -t 226.30.10.14 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c13 -i0 -z0 -s $MR3_IN_ADDR -t 226.30.10.15 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c14 -i0 -z0 -s $CH2_IN_ADDR -t 226.30.10.15 -r 12
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_mr3
xterm -hold -e /usr/bin/perl $REFLECTOR_DIR/reflector_launch.pl $REFLECTOR_DIR $REFLECTOR_DIR/config_mr3 &
#!/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 6 10
echo Installing NASMESH Driver
sudo rmmod -f nasmesh
sudo insmod $OPENAIR2_DIR/NAS/DRIVER/MESH/nasmesh.ko nas_IMEI=0x12345678,0x02000000
sudo ifconfig eth0 10.0.2.5
sudo ifconfig nasmesh0 up
sudo ifconfig nasmesh0 10.0.0.5
sudo ip -6 addr add $MR3_IN6_ADDR/64 dev nasmesh0
echo Classification rules for MR3 - Default DTCH UL for L3 signaling
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c0 -i0 -z0 -x $MR3_IN6_ADDR -y $CH2_IN6_ADDR -r 12
echo Classification rules for MR3 - MPLS User-plane Bearer
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c1 -i0 -z0 -l $MN2_MR3_CH2_MN3 -m $MN3_CH2_MR3_MN2 -r 13
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c2 -i0 -z0 -l $MR3_LABEL_OUT -m $MR3_LABEL_IN -r 13
echo EADS Multicast for MR3
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c3 -i0 -z0 -s $CH2_IN_ADDR -t 226.30.10.10 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c4 -i0 -z0 -s $MR3_IN_ADDR -t 226.30.10.10 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c5 -i0 -z0 -s $CH2_IN_ADDR -t 226.30.10.11 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c6 -i0 -z0 -s $MR3_IN_ADDR -t 226.30.10.11 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c7 -i0 -z0 -s $CH2_IN_ADDR -t 226.30.10.12 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c8 -i0 -z0 -s $MR3_IN_ADDR -t 226.30.10.12 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c9 -i0 -z0 -s $CH2_IN_ADDR -t 226.30.10.13 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c10 -i0 -z0 -s $MR3_IN_ADDR -t 226.30.10.13 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c11 -i0 -z0 -s $CH2_IN_ADDR -t 226.30.10.14 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c12 -i0 -z0 -s $MR3_IN_ADDR -t 226.30.10.14 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c13 -i0 -z0 -s $MR3_IN_ADDR -t 226.30.10.15 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c14 -i0 -z0 -s $CH2_IN_ADDR -t 226.30.10.15 -r 12
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_mr3
xterm -hold -e /usr/bin/perl $REFLECTOR_DIR/reflector_launch.pl $REFLECTOR_DIR $REFLECTOR_DIR/config_mr3 &
#!/bin/bash
# Script by Lamia Romdhani, Nghia, Philippe, Hicham 18 Feb 2009
source params.sh
sudo modprobe mpls6
echo Setting MPLS for mr3
echo "0" > /sys/mpls/debug
echo 'MN1->MN2'
sudo mpls labelspace set dev nasmesh0 labelspace 0
sudo mpls ilm add label gen $MR3_LABEL_IN labelspace 0 proto ipv6
echo 'MN2->MN1'
var=`mpls nhlfe add key 0 instructions push gen $MR3_LABEL_OUT nexthop nasmesh0 ipv6 $CH2_IN6_ADDR |grep key | cut -c 17-26`
echo "Creating routes"
sudo ip -6 route add $MN1_IN6_ADDR/128 via $CH2_IN6_ADDR mpls $var
sudo ip -6 route add $MN2_IN6_ADDR/128 dev $ETH_MR3
echo 'MN3->MN2'
sudo mpls labelspace set dev nasmesh0 labelspace 0
sudo mpls ilm add label gen $MN3_CH2_MR3_MN2 labelspace 0 proto ipv6
echo 'MN2->MN3'
var=`mpls nhlfe add key 0 instructions push gen $MN2_MR3_CH2_MN3 nexthop nasmesh0 ipv6 $CH2_IN6_ADDR |grep key | cut -c 17-26`
echo "Creating routes"
sudo ip -6 route add $MN3_IN6_ADDR/128 via $CH2_IN6_ADDR mpls $var
#!/bin/bash
# Script by Lamia Romdhani, Nghia, Philippe, Hicham 18 Feb 2009
source params.sh
sudo modprobe mpls6
echo Setting MPLS for mr3
echo "0" > /sys/mpls/debug
echo 'MN1->MN2'
sudo mpls labelspace set dev nasmesh0 labelspace 0
sudo mpls ilm add label gen $MR3_LABEL_IN labelspace 0 proto ipv6
echo 'MN2->MN1'
var=`mpls nhlfe add key 0 instructions push gen $MR3_LABEL_OUT nexthop nasmesh0 ipv6 $CH2_IN6_ADDR |grep key | cut -c 17-26`
echo "Creating routes"
sudo ip -6 route add $MN1_IN6_ADDR/128 via $CH2_IN6_ADDR mpls $var
sudo ip -6 route add $MN2_IN6_ADDR/128 dev $ETH_MR3
echo 'MN3->MN2'
sudo mpls labelspace set dev nasmesh0 labelspace 0
sudo mpls ilm add label gen $MN3_CH2_MR3_MN2 labelspace 0 proto ipv6
echo 'MN2->MN3'
var=`mpls nhlfe add key 0 instructions push gen $MN2_MR3_CH2_MN3 nexthop nasmesh0 ipv6 $CH2_IN6_ADDR |grep key | cut -c 17-26`
echo "Creating routes"
sudo ip -6 route add $MN3_IN6_ADDR/128 via $CH2_IN6_ADDR mpls $var
#Phil, Lamia 10 Oct 08
source params.sh
sudo sysctl -w net.ipv6.conf.all.forwarding=1
./mr3_conf_nas_barca.sh
./mr3_mpls_nas_barca.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 $MR3_EG6_ADDR/64 dev eth0
sudo xterm -hold -e "$OPENAIR3_PMIP6D_PATH/pmip6d -m -s -L $CH2_IN6_ADDR -N $MR3_EG6_ADDR -E $MR3_IN6_ADDR" &
watch -n1 "cat /proc/openair2/lchan_stats ; cat /proc/openair1/bch_stats"
./stop_rf.sh
./del_mpls.sh
sleep 2
./del_mpls.sh
#Phil, Lamia 10 Oct 08
source params.sh
sudo sysctl -w net.ipv6.conf.all.forwarding=1
./mr3_conf_nas_barca_outdoor.sh
./mr3_mpls_nas_barca.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 $MR3_EG6_ADDR/64 dev eth0
#sudo xterm -hold -e "$OPENAIR3_PMIP6D_PATH/pmip6d -m -s -L $CH2_IN6_ADDR -N $MR3_EG6_ADDR -E $MR3_IN6_ADDR" &
watch -n1 "cat /proc/openair2/lchan_stats ; cat /proc/openair1/bch_stats"
./stop_rf.sh
./del_mpls.sh
sleep 2
./del_mpls.sh
#Phil, Lamia 10 Oct 08
source params.sh
sudo sysctl -w net.ipv6.conf.all.forwarding=1
./mr3_conf_nas_barca_parking.sh
./mr3_mpls_nas_barca.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 $MR3_EG6_ADDR/64 dev eth0
#sudo xterm -hold -e "$OPENAIR3_PMIP6D_PATH/pmip6d -m -s -L $CH2_IN6_ADDR -N $MR3_EG6_ADDR -E $MR3_IN6_ADDR" &
watch -n1 "cat /proc/openair2/lchan_stats ; cat /proc/openair1/bch_stats"
./stop_rf.sh
./del_mpls.sh
sleep 2
./del_mpls.sh
#!/bin/bash
MR1_IN_ADDR=10.0.1.3
MR1_IN6_ADDR=2001:10:0:1:7856:3412:0:2
MR1_EG_ADDR=192.168.9.1
MR1_EG6_ADDR=2001:660:5502::100
# Flow CH1->MR1
MR1_LABEL_IN=1001
# Flow MR1->CH1
MR1_LABEL_OUT=1000
ETH_MR1=eth0
MR2_IN_ADDR=10.0.1.4
MR2_IN6_ADDR1=2001:10:0:1:7856:3412:0:3
MR2_IN6_ADDR2=2001:10:0:2:7856:3412:0:3
MR2_EG6_ADDR=2001:660:5502::300
ETH_MR2=eth0
# Flow CH1->MR2
MR2_CH1_LABEL_IN=2000
# Flow MR2->CH1
MR2_CH1_LABEL_OUT=2001
# Flow CH2->MR2
MR2_CH2_LABEL_IN=3001
# Flow MR2->CH2
MR2_CH2_LABEL_OUT=3000
MR3_IN_ADDR=10.0.1.5
MR3_IN6_ADDR=2001:10:0:2:7856:3412:0:2
MR3_EG_ADDR=192.168.10.1
MR3_EG6_ADDR=2001:660:5502::200
# Flow CH2->MR3
MR3_LABEL_IN=4000
# Flow MR3->CH2
MR3_LABEL_OUT=4001
ETH_MR3=eth2
CH1_IN_ADDR=10.0.1.1
CH2_IN_ADDR=10.0.1.2
CH1_IN6_ADDR=2001:10:0:1:7856:3412:0:1
CH2_IN6_ADDR=2001:10:0:2:7856:3412:0:1
## Communication between the CHs
CH1_MR2_CH2_LABEL_IN=8001
CH1_MR2_CH2_LABEL_OUT=8000
CH2_MR2_CH1_LABEL_IN=9001
CH2_MR2_CH1_LABEL_OUT=9000
## Com between MN1 and MN3
MN1_MR1_CH1_MN3=1500
MN3_CH1_MR1_MN1=1501
MN1_CH1_MR2_MN3=2500
MN3_MR2_CH1_MN1=2501
## Com between MN2 and MN3
MN3_MR2_CH2_MN2=3500
MN2_CH2_MR2_MN3=3501
MN3_CH2_MR3_MN2=4500
MN2_MR3_CH2_MN3=4501
#MN1_IN6_ADDR=2001:660:5502::20
#MN2_IN6_ADDR=2001:660:5502::25
MN1_IN6_ADDR=2001:660:5502::110
MN1_IN_ADDR=192.168.9.2
MN2_IN6_ADDR=2001:660:5502::210
MN3_IN6_ADDR=2001:660:5502::310
MN2_IN_ADDR=192.168.10.2
# Put the right OPENAIR3 path here
OPENAIR3_HOME=/root/openair_trials_2/openair3
OPENAIR3_PMIP6D_PATH=$OPENAIR3_HOME/pmip6d
OPENAIR3_SCRIPTS_PATH=$OPENAIR3_HOME/scripts
REFLECTOR_DIR=$OPENAIR3_HOME/EXAMPLES/BARCA_TRIALS/REFLECTOR
# Put the right OPENAIR2 path here
#OPENAIR2_DIR=~/openair2_r234/openair2/
OPENAIR2_DIR=/root/openair_trials_2/openair2
if [ "$1" == "" ]; then
echo "Please provide a TX power level (0-8)"
exit
fi
if [ "$2" == "" ]; then
echo "Please provide a Node ID (0-7 for CH, 8-15 for MR/UE)"
exit
fi
if [ "$OPENAIR1_DIR" == "" ] ; then
echo "Please set OPENAIR1_DIR environment variable"
exit
else
echo "OPENAIR1_DIR Set to $OPENAIR1_DIR"
fi
cd $OPENAIR1_DIR/USERSPACE_TOOLS/OPENAIR_RF
source ./txgains.sh
case $1 in
0)
CBMIMO1_POWER=$CBMIMO1_m20_dBm
echo "Configuring CBMIMO1 for -20dBm ($CBMIMO1_POWER)"
;;
1)
CBMIMO1_POWER=$CBMIMO1_m15_dBm
echo Configuring CBMIMO1 for -15dBm
;;
2)
CBMIMO1_POWER=$CBMIMO1_m10_dBm
echo Configuring CBMIMO1 for -10dBm
;;
3)
CBMIMO1_POWER=$CBMIMO1_m5_dBm
echo Configuring CBMIMO1 for -5dBm
;;
4)
CBMIMO1_POWER=$CBMIMO1_0_dBm
echo Configuring CBMIMO1 for 0dBm
;;
5)
CBMIMO1_POWER=$CBMIMO1_5_dBm
echo Configuring CBMIMO1 for 5dBm
;;
6)
CBMIMO1_POWER=$CBMIMO1_10_dBm
echo Configuring CBMIMO1 for 10dBm
;;
7)
CBMIMO1_POWER=$CBMIMO1_15_dBm
echo Configuring CBMIMO1 for 15dBm
;;
8)
CBMIMO1_POWER=$CBMIMO1_20_dBm
echo Configuring CBMIMO1 for 20dBm
;;
*)
echo Invalid TX power
exit
esac
echo Removing openair_rf,openair_l2 and openair_rrc modules
sudo rmmod -f openair_rrc
sudo rmmod -f openair_l2
sudo rmmod -f openair_rf
sudo insmod $OPENAIR1_DIR/ARCH/CBMIMO1/DEVICE_DRIVER/openair_rf_l2.ko
OARF_RET=`lsmod | grep -e openair_rf`
if [ "$OARF_RET" = "" ]; then
echo Error loading openair1 module
exit
fi
sudo insmod $OPENAIR2_DIR/LAYER2/openair_layer2.ko
OA2_RET=`lsmod | grep -e openair_l2`
if [ "$OA2_RET" = "" ]; then
echo Error loading openair2 module
exit
fi
sudo insmod $OPENAIR2_DIR/RRC/MESH/openair_RRC.ko
OARRC_RET=`lsmod | grep -e openair_rrc`
if [ "$OARRC_RET" = "" ]; then
echo Error loading openair RRC module
exit
fi
OA_DEV="/dev/openair0"
if [ -c "$OA_DEV" ]; then
echo "$OA_DEV exists"
else
echo "creating $OA_DEV"
sudo mknod $OA_DEV c 127 0
sudo chmod a+rw /dev/openair0
fi
./openair_rf_cbmimo1 1 0
./openair_rf_cbmimo1 1 6 $CBMIMO1_POWER
if [ $2 -lt "8" ]; then
./openair_rf_cbmimo1 1 1 1 $2
elif [ $2 -lt "16" ]; then
./openair_rf_cbmimo1 1 3 1 $2
else
echo Illegal Node ID, exiting
exit
fi
sleep 1
# Watch the status of the radio to check for hardware exit event
#OA1_STATE=`cat /proc/openair1/openair1_state`
#while [ "$OA1_STATE" != "EXITED" ]; do
# OA1_STATE=`cat /proc/openair1/openair1_state`
# sleep .5
#done
#./openair_rf_cbmimo1 1 4 1
#echo CBMIMO1 Hardware exit, restarting ...
cd $OPENAIR1_DIR/USERSPACE_TOOLS/OPENAIR_RF
echo STOP STARTS...
./openair_rf_cbmimo1 1 4 1
sleep 2
echo STOP RF DONE
sudo killall chbch_scope
echo STOP CHBCH SCOPE DONE
sudo killall sach_scope
echo STOP_SACH SCOPE DONE
sleep 1
sudo rmmod nasmesh
sleep 1
echo REMOVE NASMESH MODULE DONE
sudo rmmod openair_rrc
sleep 1
echo REMOVE RRC MODULE DONE
sudo rmmod openair_l2
sleep 1
echo REMOVE LAYER2 MODULE DONE
sudo rmmod openair_rf
echo REMOVE RF MODULE DONE
echo STOP FINISHED SUCCESSFULLY
Cluster Head (1) – with NAS_MPLS_PMIP working
CH1_NAS.SH
#!/bin/bash
#Phil, 25 july 08
source params.sh
./ch1_conf_nas.sh
#MN1MN2
./ch1_mpls_nas.sh $MR1_LABEL_OUT $MR2_IN_ADDR $MR2_LABEL_IN
#MN2MN1
./ch1_mpls_nas.sh $MR2_LABEL_OUT $MR1_IN_ADDR $MR1_LABEL_IN
echo /openair3/pmip6d/pmip6d -c -L $CH1_ADDR
/openair3/pmip6d/pmip6d -c -L $CH1_ADDR
./ch1_del_mpls.sh
CH1_CONF_NAS.SH
#!/bin/bash
source params.sh
echo Clusterhead address is $CH_ADDR
# Installing NASMESH driver
rmmod -f nasmesh
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 -c1 -i0 -z0 -x $CH1_ADDR -y $MR1_IN_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<-> 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
#CH1<-> MR2 (MPLS user-plane bearer)
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c2 -i0 -z0 -l $MR2_LABEL_IN -m $MR2_LABEL_OUT -r 21
#CH1 Broadcast (transmission of Router ADV)
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c0 -i0 -z0 -x $CH1_ADDR -y ff02::1 -r 3
echo Configuring interfaces on CH
# Setup IPv4 multicast route for openair emulation
route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0
# Bring up openair NASMESH device and set IPv6 address
ifconfig nasmesh0 up
ip addr add 10.0.0.1/24 dev nasmesh0
ip -6 addr add $CH1_ADDR/64 dev nasmesh0
echo nasmesh0 is $CH1_ADDR
echo No MPLS debug
echo "0" >/sys/mpls/debug
sleep 1
echo Launching AS simulator
export OPENAIR2_DIR
xterm -hold -e sh start_openair2_ch1.sh &
sleep 1
CH1_MPLS_NAS.SH
#!/bin/bash
#Script by Lamia Romdhani
#June 2008
echo Setting MPLS for CH
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'
mpls labelspace set dev nasmesh0 labelspace 0
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`
mpls xc add ilm_label gen $LABEL_IN ilm_labelspace 0 nhlfe_key $var
else
echo usage: ch1_mpls_dyntest_nas.sh LABEL_IN IP_NEXT_HOP LABEL_OUT
fi
Cluster Head (2)– with NAS_MPLS_PMIP working
CH2_NAS.SH
#!/bin/bash
#Phil, 25 july 08
source params.sh
./ch2_conf_nas.sh
#MN1MN2
./ch2_mpls_nas.sh $MR2_CH2_LABEL_OUT $MR3_IN_ADDR $MR2_LABEL_IN
#MN2MN1
./ch_mpls_nas.sh $MR2_LABEL_OUT $MR2_IN_ADDR $MR2_CH2_LABEL_IN
echo /openair3/pmip6d/pmip6d -c -L $CH2_ADDR
/openair3/pmip6d/pmip6d -c -L $CH2_ADDR
./ch2_del_mpls.sh
CH2_CONF_NAS.SH
#!/bin/bash
source params.sh
echo Clusterhead address is $CH2_ADDR
# Installing NASMESH driver
rmmod -f nasmesh
insmod $OPENAIR2_DIR/NAS/DRIVER/MESH/nasmesh.ko nas_IMEI=0x12345678,0x01000000
echo Classification rules for CH2
#CH2<-> MR2 IP Signaling
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c1 -i0 -z0 -x $CH2_ADDR -y $MR2_IN_ADDR -r 12
#CH<-> MR1 MPLS user-plane bearer
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c1 -i0 -z0 -l $MR2_CH2_LABEL_IN -m $MR2_CH2_LABEL_OUT -r 13
#CH2<-> MR3 (IP Signaling)
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c2 -i0 -z0 -x $CH2_ADDR -y $MR3_IN_ADDR -r 20
#CH2<-> MR3 (MPLS user-plane bearer)
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c2 -i0 -z0 -l $MR3_LABEL_IN -m $MR3_LABEL_OUT -r 21
#CH2 Broadcast (transmission of Router ADV)
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c0 -i0 -z0 -x $CH2_ADDR -y ff02::1 -r 3
echo Configuring interfaces on CH2
# Setup IPv4 multicast route for openair emulation
route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0
# Bring up openair NASMESH device and set IPv6 address
ifconfig nasmesh0 up
ip addr add 10.0.0.1/24 dev nasmesh0
ip -6 addr add $CH2_ADDR/64 dev nasmesh0
echo nasmesh0 is $CH2_ADDR
echo No MPLS debug
echo "0" >/sys/mpls/debug
sleep 1
echo Launching AS simulator
export OPENAIR2_DIR
xterm -hold -e sh start_openair2_ch2.sh &
sleep 1
CH2_MPLS_NAS.SH
#!/bin/bash
#Script by Lamia Romdhani
#June 2008
echo Setting MPLS for CH2
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'
mpls labelspace set dev nasmesh0 labelspace 0
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`
mpls xc add ilm_label gen $LABEL_IN ilm_labelspace 0 nhlfe_key $var
else
echo usage: ch_mpls_dyntest_nas.sh LABEL_IN IP_NEXT_HOP LABEL_OUT
fi
MR1_NAS.SH
source params.sh
sysctl -w net.ipv6.conf.all.forwarding=1
$OPENAIR3_SCRIPTS_PATH/mr1_conf_nas.sh
$OPENAIR3_SCRIPTS_PATH/mr1_mpls_nas.sh
sysctl -w net.ipv6.conf.eth0.proxy_ndp=1
sysctl -w net.ipv6.conf.nasmesh0.proxy_ndp=1
ifconfig eth0 promisc
ip -6 addr add $MR1_EG_ADDR/64 dev eth0
$OPENAIR3_PMIP6D_PATH/pmip6d -m -s -L $CH1_ADDR -N $MR1_EG_ADDR -E $MR1_IN_ADDR
$OPENAIR3_SCRIPTS_PATH/mr1_del_mpls.sh
MR1_CONF_NAS.SH
source params.sh
export OPENAIR2_DIR
#echo "0" >/proc/sys/net/ipv6/conf/all/forwarding
echo Installing NASMESH Driver
rmmod -f nasmesh
insmod $OPENAIR2_DIR/NAS/DRIVER/MESH/nasmesh.ko nas_IMEI=0x12345678,0x02000000
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
echo Configuring interfaces on mr1
route add -net 224.0.0.0 netmask 240.0.0.0 dev eth4
ifconfig nasmesh0 up
ifconfig namsesh0 10.0.1.2
ip -6 addr add 2001:10:0:1:7856:3412:0:2/64 dev nasmesh0
echo Launching AS simulator
xterm -hold -e sh start_openair2_mr1.sh &
#echo "Waiting for Router ADV from CH (DTCH Broadcast test)"
#IPv6ADR=`ip addr show dev nasmesh0 | grep -e inet6 | egrep -v fe80 | cut -d " " -f6 | cut -d "/" -f1`
#while [ -z $IPv6ADR ] ; do
# sleep 1
# IPv6ADR=`ip addr show dev nasmesh0 | grep -e inet6 | egrep -v fe80 | cut -d " " -f6 | cut -d "/" -f1`
#done
#echo Got Router ADV : IPv6 address is $IPv6ADR
echo Classification rules for MR1 - Default DTCH UL for L3 signaling
#$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c1 -i0 -z0 -x $IPv6ADR -y $CH1_ADDR -r 4
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c1 -i0 -z0 -x 2001:10:0:1:7856:3412:0:2 -y $CH1_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 $MR1_LABEL_OUT -m $MR1_LABEL_IN -r 5
echo eth0 is $MR1_EG_ADDR
#echo Starting routing ...
#echo No MPLS debug
#echo "1" >/sys/mpls/debug
MR1_MPLS_NAS.SH
#!/bin/bash
# Script by Lamia Romdhani, Nghia, Philippe 08 july 2008
# June 2008
source params.sh
modprobe mpls6
echo Setting MPLS for mr1
echo "0" > /sys/mpls/debug
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_ADDR | grep key |cut -c 17-26`
echo "Creating routes"
ip -6 route add $MN2_ADDR/128 via $CH1_ADDR mpls $var
ip -6 route add $MN1_ADDR/128 dev eth0
Mobile Router 2 – with NAS_MPLS_PMIP working
MR2_NAS.SH
source params.sh
sysctl -w net.ipv6.conf.all.forwarding=1
$OPENAIR3_SCRIPTS_PATH/mr2_del_mpls.sh
$OPENAIR3_SCRIPTS_PATH/mr2_conf_nas.sh
#$OPENAIR3_SCRIPTS_PATH/mr2_mpls_nas.sh
#MN1MN2
$OPENAIR3_SCRIPTS_PATH/mr2_mpls_nas.sh $MR2_CH1_LABEL_IN $CH2_IN_ADDR $MR2_CH2_LABEL_OUT
#MN2MN1
$OPENAIR3_SCRIPTS_PATH/mr2_mpls_nas.sh $MR2_CH2_LABEL_IN $CH1_IN_ADDR $MR1_CH1_LABEL_OUT
#/etc/init.d/radvd status
#/etc/init.d/radvd start
#radvdump
sysctl -w net.ipv6.conf.eth0.proxy_ndp=1
sysctl -w net.ipv6.conf.nasmesh0.proxy_ndp=1
ifconfig eth0 promisc
ip -6 addr add $MR2_EG_ADDR/64 dev eth0
$OPENAIR3_PMIP6D_PATH/pmip6d -m -s -L $CH_ADDR -N $MR2_EG_ADDR -E $MR2_IN_ADDR
$OPENAIR3_SCRIPTS_PATH/mr2_del_mpls.sh
MR2_CONF_NAS.SH
source params.sh
export OPENAIR2_DIR
#echo "0" >/proc/sys/net/ipv6/conf/all/forwarding
echo Installing NASMESH Driver
rmmod -f nasmesh
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
echo Configuring interfaces on mr2
route add -net 224.0.0.0 netmask 240.0.0.0 dev eth2
ifconfig nasmesh0 up
ifconfig nasmesh0 10.0.0.3
ip -6 addr add 2001:10:0:1:7856:3412:0:3/64 dev nasmesh0
echo Launching AS simulator
xterm -hold -e sh start_openair2_mr2.sh &
#echo Waiting for Router ADV from CH
#IPv6ADR=`ip addr show dev nasmesh0 | grep -e inet6 | egrep -v fe80 | cut -d " " -f6 | cut -d "/" -f1`
#while [ -z $IPv6ADR ] ; do
# sleep 1
# IPv6ADR=`ip addr show dev nasmesh0 | grep -e inet6 | egrep -v fe80 | cut -d " " -f6 | cut -d "/" -f1`
#done
#echo Got Router ADV : IPv6 address is $IPv6ADR
echo Classification rules for MR2 - Default DTCH UL for L3 signaling
#$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c1 -i0 -z0 -x $IPv6ADR -y $CH_ADDR -r 4
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c1 -i0 -z0 -x 2001:10:0:1:7856:3412:0:3 -y $CH_ADDR -r 4
#$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c1 -i0 -z0 -x 2001:10:0:1::9a03 -y 2001:10:0:1::1 -r 4
echo Classification rules for MR2 - MPLS User-plane Bearer
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c1 -i0 -z0 -l $MR2_LABEL_OUT -m $MR2_LABEL_IN -r 5
echo eth0 is $MR1_EG_ADDR
MR2_MPLS_NAS.SH
#!/bin/bash
#Script by Lamia Romdhani
#September 2008
echo No MPLS debug
echo "0" >/sys/mpls/debug
echo Setting MPLS for CH
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'
mpls labelspace set dev nasmesh0 labelspace 0
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`
mpls xc add ilm_label gen $LABEL_IN ilm_labelspace 0 nhlfe_key $var
else
echo usage: ch_mpls_dyntest_nas.sh LABEL_IN IP_NEXT_HOP LABEL_OUT
fi
Mobile Router 3 – with NAS_MPLS_PMIP working
MR3_NAS.SH
source params.sh
sysctl -w net.ipv6.conf.all.forwarding=1
$OPENAIR3_SCRIPTS_PATH/mr3_del_mpls.sh
$OPENAIR3_SCRIPTS_PATH/mr3_conf_nas.sh
$OPENAIR3_SCRIPTS_PATH/mr3_mpls_nas.sh
#/etc/init.d/radvd status
#/etc/init.d/radvd start
#radvdump
sysctl -w net.ipv6.conf.eth0.proxy_ndp=1
sysctl -w net.ipv6.conf.nasmesh0.proxy_ndp=1
ifconfig eth0 promisc
ip -6 addr add $MR3_EG_ADDR/64 dev eth0
$OPENAIR3_PMIP6D_PATH/pmip6d -m -s -L $CH2_ADDR -N $MR3_EG_ADDR -E $MR3_IN_ADDR
$OPENAIR3_SCRIPTS_PATH/mr3_del_mpls.sh
MR3_CONF_NAS.SH
source params.sh
export OPENAIR2_DIR
#echo "0" >/proc/sys/net/ipv6/conf/all/forwarding
echo Installing NASMESH Driver
rmmod -f nasmesh
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
echo Configuring interfaces on mr3
route add -net 224.0.0.0 netmask 240.0.0.0 dev eth2
ifconfig nasmesh0 up
ifconfig nasmesh0 10.0.0.3
ip -6 addr add 2001:10:0:1:7856:3412:0:3/64 dev nasmesh0
echo Launching AS simulator
xterm -hold -e sh start_openair2_mr3.sh &
#echo Waiting for Router ADV from CH
#IPv6ADR=`ip addr show dev nasmesh0 | grep -e inet6 | egrep -v fe80 | cut -d " " -f6 | cut -d "/" -f1`
#while [ -z $IPv6ADR ] ; do
# sleep 1
# IPv6ADR=`ip addr show dev nasmesh0 | grep -e inet6 | egrep -v fe80 | cut -d " " -f6 | cut -d "/" -f1`
#done
#echo Got Router ADV : IPv6 address is $IPv6ADR
echo Classification rules for MR3 - Default DTCH UL for L3 signaling
#$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c1 -i0 -z0 -x $IPv6ADR -y $CH2_ADDR -r 4
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c1 -i0 -z0 -x 2001:10:0:1:7856:3412:0:3 -y $CH2_ADDR -r 4
#$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c1 -i0 -z0 -x 2001:10:0:1::9a03 -y 2001:10:0:1::1 -r 4
echo Classification rules for MR3 - MPLS User-plane Bearer
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c1 -i0 -z0 -l $MR3_LABEL_OUT -m $MR3_LABEL_IN -r 5
echo eth0 is $MR1_EG_ADDR
MR3_MPLS_NAS.SH
#!/bin/bash
# Author: Lamia Romdhani
#June 2008
source params.sh
modprobe mpls6
echo Starting routing ...
echo No MPLS debug
echo "0" >/sys/mpls/debug
echo Setting MPLS for mr2
echo 'MN2->MN1'
# add label 3000 and forward the packets to mr2, for destination MN1
var=`mpls nhlfe add key 0 instructions push gen $MR3_LABEL_OUT nexthop nasmesh0 ipv6 $CH2_ADDR |grep key | cut -c 17-26`
ip -6 route add $MN1_ADDR/128 via $CH2_ADDR mpls $var
ip -6 route add $MN2_ADDR/128 dev eth0
echo 'MN1->MN2'
#pop label 1003 and do Ip lookup.
mpls labelspace set dev nasmesh0 labelspace 0
# MR3_LABEL_IN is 1003
mpls ilm add label gen $MR3_LABEL_IN labelspace 0 proto ipv6
#!/bin/bash
source params.sh
echo Clusterhead address is $CH_ADDR
# 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 -c1 -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<-> MR2 (IP Signaling)
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c2 -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 -c2 -i0 -z0 -l $MR2_CH1_LABEL_IN -m $MR2_CH1_LABEL_OUT -r 21
#CH1 Broadcast (transmission of Router ADV)
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c0 -i0 -z0 -x $CH1_IN6_ADDR -y ff02::1 -r 3
echo Configuring interfaces on CH
# Bring up openair NASMESH device and set IPv6 address
sudo ifconfig nasmesh0 up
sudo ip addr add $CH1_IN_ADDR/24 dev nasmesh0
sudo ip -6 addr add $CH1_IN6_ADDR/64 dev nasmesh0
echo nasmesh0 is $CH1_IN6_ADDR
echo No MPLS debug
sudo sh -c 'echo "0" >/sys/mpls/debug'
sleep 1
echo Launching AS simulator
export OPENAIR2_DIR
xterm -hold -e sh start_openair2_ch1.sh &
sleep 1
#Cluster Head (1) – with NAS_MPLS_PMIP working
#!/bin/bash
#Phil, 25 july 08
source params.sh
./ch1_conf_nas.sh
#MN1MN2
./mpls_nas.sh $MR1_LABEL_OUT $MR2_IN6_ADDR1 $MR2_CH1_LABEL_IN
#MN2MN1
./mpls_nas.sh $MR2_CH1_LABEL_OUT $MR1_IN6_ADDR $MR1_LABEL_IN
#echo $OPENAIR3_HOME/pmip6d/pmip6d -c -L $CH1_IN6_ADDR
#$OPENAIR3_HOME/pmip6d/pmip6d -c -L $CH1_IN6_ADDR
#./del_mpls.sh
#!/bin/bash
source params.sh
echo Clusterhead address is $CH2_IN6_ADDR
# Installing NASMESH driver
sudo rmmod -f nasmesh
sudo insmod $OPENAIR2_DIR/NAS/DRIVER/MESH/nasmesh.ko nas_IMEI=0x12345678,0x01000000
echo Classification rules for CH2
#CH2<-> MR2 IP Signaling
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c1 -i0 -z0 -x $CH2_IN6_ADDR -y $MR2_IN6_ADDR2 -r 20
#CH<-> MR1 MPLS user-plane bearer
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c1 -i0 -z0 -l $MR2_CH2_LABEL_IN -m $MR2_CH2_LABEL_OUT -r 21
#CH2<-> MR3 (IP Signaling)
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c2 -i0 -z0 -x $CH2_IN6_ADDR -y $MR3_IN6_ADDR -r 28
#CH2<-> MR3 (MPLS user-plane bearer)
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c2 -i0 -z0 -l $MR3_LABEL_IN -m $MR3_LABEL_OUT -r 29
#CH2 Broadcast (transmission of Router ADV)
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c0 -i0 -z0 -x $CH2_IN6_ADDR -y ff02::1 -r 3
echo Configuring interfaces on CH2
# Bring up openair NASMESH device and set IPv6 address
sudo ifconfig nasmesh0 up
sudo ip addr add $CH2_IN_ADDR/24 dev nasmesh0
sudo ip -6 addr add $CH2_IN6_ADDR/64 dev nasmesh0
echo nasmesh0 is $CH2_IN6_ADDR
echo No MPLS debug
sudo sh -c 'echo "0" >/sys/mpls/debug'
sleep 1
echo Launching AS simulator
export OPENAIR2_DIR
xterm -hold -e sh start_openair2_ch2.sh &
sleep 1
#Cluster Head (2)– with NAS_MPLS_PMIP working
#CH2_NAS.SH
#!/bin/bash
#Phil, 25 july 08
source params.sh
./ch2_conf_nas.sh
#MN1MN2
./mpls_nas.sh $MR2_CH2_LABEL_OUT $MR3_IN6_ADDR $MR3_LABEL_IN
#MN2MN1
./mpls_nas.sh $MR3_LABEL_OUT $MR2_IN6_ADDR2 $MR2_CH2_LABEL_IN
#echo $OPENAIR3_HOME/pmip6d/pmip6d -c -L $CH2_IN6_ADDR
#$OPENAIR3_HOME/pmip6d/pmip6d -c -L $CH2_IN6_ADDR
#./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
#Huu-Nghia, Philippe, Lamia 28 june 2008
#echo Deleting MN1 autoconfigured addresse
#$OPENAIR3_SCRIPTS_PATH/mn1_del.sh
#ip -6 route add 2001:660:5502::25/128 via 2001:660:5502::10 dev eth0
ip -6 addr del 2001:660:5502::15/64 dev eth0
ip -6 addr add 2001:660:5502::15/64 dev eth0
#!/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
source params.sh
export OPENAIR2_DIR
#echo "0" >/proc/sys/net/ipv6/conf/all/forwarding
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
echo Configuring interfaces on mr1
sudo ifconfig nasmesh0 up
sudo ifconfig nasmesh0 $MR1_IN_ADDR
sudo ip -6 addr add $MR1_IN6_ADDR/64 dev nasmesh0
sudo ip -6 addr add $MR1_EG6_ADDR/64 dev eth1
echo Launching AS simulator
xterm -hold -e sh start_openair2_mr1.sh &
echo Classification rules for MR1 - Default DTCH UL for L3 signaling
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c1 -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 $MR1_LABEL_OUT -m $MR1_LABEL_IN -r 5
#!/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
ip -6 route del $MN2_ADDR/128 via $CH_ADDR
ip -6 route del $MN1_ADDR/128 dev eth0
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
# Author: Lamia Romdhani
#June 2008
source params.sh
sudo modprobe mpls6
echo Starting routing ...
echo No MPLS debug
sudo sh -c 'echo 0 >/sys/mpls/debug'
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"
echo Setting MPLS for mr1
echo 'MN2->MN1'
sudo mpls labelspace set dev nasmesh0 labelspace 0
sudo mpls ilm add label gen $MR1_LABEL_IN labelspace 0 proto ipv6
sudo ip -6 route add $MN1_IN6_ADDR/128 dev eth1
sudo ip -6 route add $MN2_IN6_ADDR/128 via $CH1_IN6_ADDR mpls $var
source params.sh
sudo sysctl -w net.ipv6.conf.all.forwarding=1
#./del_mpls.sh
./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 eth1 promisc
sudo ip -6 addr add $MR1_EG6_ADDR/64 dev eth1
#$OPENAIR3_PMIP6D_PATH/pmip6d -m -s -L $CH2_IN6_ADDR -N $MR3_EG6_ADDR -E $MR3_IN6_ADDR
#./del_mpls.sh
source params.sh
export OPENAIR2_DIR
#echo "0" >/proc/sys/net/ipv6/conf/all/forwarding
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
echo Configuring interfaces on mr2
sudo ifconfig nasmesh0 up
sudo ifconfig nasmesh0 $MR2_IN_ADDR
sudo ip -6 addr add $MR2_IN6_ADDR1/64 dev nasmesh0
sudo ip -6 addr add $MR2_IN6_ADDR2/64 dev nasmesh0
echo Launching AS simulator
xterm -hold -e sh start_openair2_mr2.sh &
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 -c1 -i0 -z0 -l $MR2_CH1_LABEL_OUT -m $MR2_CH1_LABEL_IN -r 5
echo Classification rules for MR2 -Cluster 2 - Default DTCH UL for L3 signaling
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c2 -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 -c2 -i0 -z0 -l $MR2_CH2_LABEL_OUT -m $MR2_CH2_LABEL_IN -r 13
source params.sh
sysctl -w net.ipv6.conf.all.forwarding=1
./del_mpls.sh
./mr2_conf_nas.sh
#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
sudo sysctl -w net.ipv6.conf.eth0.proxy_ndp=1
sudo sysctl -w net.ipv6.conf.nasmesh0.proxy_ndp=1
source params.sh
export OPENAIR2_DIR
#echo "0" >/proc/sys/net/ipv6/conf/all/forwarding
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 11
echo Configuring interfaces on mr3
sudo ifconfig nasmesh0 up
sudo ifconfig nasmesh0 $MR3_IN_ADDR
sudo ip -6 addr add $MR3_IN6_ADDR/64 dev nasmesh0
sudo ip -6 addr add $MR3_EG6_ADDR/64 dev eth3
echo Launching AS simulator
sudo xterm -hold -e sh start_openair2_mr3.sh &
echo Classification rules for MR3 - Default DTCH UL for L3 signaling
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c1 -i0 -z0 -x $MR3_IN6_ADDR -y $CH2_IN6_ADDR -r 12
echo Classification rules for MR3 - MPLS User-plane Bearer
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c1 -i0 -z0 -l $MR3_LABEL_OUT -m $MR3_LABEL_IN -r 13
#!/bin/bash
# Author: Lamia Romdhani
#June 2008
source params.sh
sudo modprobe mpls6
echo Starting routing ...
echo No MPLS debug
sudo sh -c 'echo 0 >/sys/mpls/debug'
echo Setting MPLS for mr3
echo 'MN1->MN2'
#pop label 4000 and do Ip lookup.
sudo mpls labelspace set dev nasmesh0 labelspace 0
sudo mpls ilm add label gen $MR3_LABEL_IN labelspace 0 proto ipv6
echo 'MN2->MN1'
# add label 3000 and forward the packets to mr2, for destination MN1
var=`mpls nhlfe add key 0 instructions push gen $MR3_LABEL_OUT nexthop nasmesh0 ipv6 $CH2_IN6_ADDR |grep key | cut -c 17-26`
echo "Creating routes"
sudo ip -6 route add $MN1_IN6_ADDR/128 via $CH2_IN6_ADDR mpls $var
sudo ip -6 route add $MN2_IN6_ADDR/128 dev eth3
source params.sh
sudo sysctl -w net.ipv6.conf.all.forwarding=1
#./del_mpls.sh
./mr3_conf_nas.sh
./mr3_mpls_nas.sh
#/etc/init.d/radvd status
#/etc/init.d/radvd start
#radvdump
sudo sysctl -w net.ipv6.conf.eth0.proxy_ndp=1
sudo sysctl -w net.ipv6.conf.nasmesh0.proxy_ndp=1
sudo ifconfig eth3 promisc
sudo ip -6 addr add $MR3_EG6_ADDR/64 dev eth3
#$OPENAIR3_PMIP6D_PATH/pmip6d -m -s -L $CH2_IN6_ADDR -N $MR3_EG6_ADDR -E $MR3_IN6_ADDR
#./del_mpls.sh
#!/bin/bash
MR1_IN_ADDR=10.0.1.3
MR1_IN6_ADDR=2001:10:0:1:7856:3412:0:2
MR1_EG_ADDR=10.0.2.3
MR1_EG6_ADDR=2001:660:5502::10
# Flow CH1->MR1
MR1_LABEL_IN=1001
# Flow MR1->CH1
MR1_LABEL_OUT=1000
MR2_IN_ADDR=10.0.1.4
MR2_IN6_ADDR1=2001:10:0:1:7856:3412:0:3
MR2_IN6_ADDR2=2001:10:0:2:7856:3412:0:3
MR2_EG6_ADDR=2001:660:5502::30
# Flow CH1->MR2
MR2_CH1_LABEL_IN=2000
# Flow MR2->CH1
MR2_CH1_LABEL_OUT=2001
# Flow CH2->MR2
MR2_CH2_LABEL_IN=3001
# Flow MR2->CH2
MR2_CH2_LABEL_OUT=3000
MR3_IN_ADDR=10.0.1.5
MR3_IN6_ADDR=2001:10:0:2:7856:3412:0:2
MR3_EG6_ADDR=2001:660:5502::15
# Flow CH2->MR3
MR3_LABEL_IN=4000
# Flow MR3->CH2
MR3_LABEL_OUT=4001
CH1_IN_ADDR=10.0.1.1
CH2_IN_ADDR=10.0.1.2
CH1_IN6_ADDR=2001:10:0:1:7856:3412:0:1
CH2_IN6_ADDR=2001:10:0:2:7856:3412:0:1
MN1_IN6_ADDR=2001:660:5502::20
MN2_IN6_ADDR=2001:660:5502::25
# Put the right OPENAIR3 path here
OPENAIR3_HOME=~/openair3
OPENAIR3_PMIP6D_PATH=$OPENAIR3_HOME/pmip6d
OPENAIR3_SCRIPTS_PATH=$OPENAIR3_HOME/scripts
# Put the right OPENAIR2 path here
OPENAIR2_DIR=~/openair2_r220/
source params.sh
cd $OPENAIR2_DIR/SIMULATION/USER_TOOLS/LAYER2_SIM
./mac_sim -m0 -t $OPENAIR2_DIR/SIMULATION/TOPOLOGIES/eth_5nodes.top
source params.sh
cd $OPENAIR2_DIR/SIMULATION/USER_TOOLS/LAYER2_SIM
./mac_sim -m1 -t $OPENAIR2_DIR/SIMULATION/TOPOLOGIES/eth_5nodes.top
#!/bin/bash
source params.sh
cd $OPENAIR2_DIR/SIMULATION/USER_TOOLS/LAYER2_SIM
./mac_sim -m2 -t $OPENAIR2_DIR/SIMULATION/TOPOLOGIES/eth_5nodes.top
source params.sh
cd $OPENAIR2_DIR/SIMULATION/USER_TOOLS/LAYER2_SIM
./mac_sim -m3 -t $OPENAIR2_DIR/SIMULATION/TOPOLOGIES/eth_5nodes.top
source params.sh
cd $OPENAIR2_DIR/SIMULATION/USER_TOOLS/LAYER2_SIM
./mac_sim -m4 -t $OPENAIR2_DIR/SIMULATION/TOPOLOGIES/eth_5nodes.top
#!/bin/bash
source params.sh
sleep 1
echo Clusterhead address is $CH1_IN6_ADDR
echo Launching AS and RF
./start_openair.sh 0 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
## Est ce bon ?
#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
#!/bin/bash
source params.sh
sleep 1
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
## Est ce bon ?
#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
#!/bin/bash
source params.sh
sudo ./ch1_conf_nas_barca_indoor.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" &
watch -n .5 "cat /proc/openair2/lchan_stats ; cat /proc/openair1/bch_stats ; cat /proc/openair1/openair1_state"
./stop_rf.sh
./del_mpls.sh
sleep 2
./del_mpls.sh
#!/bin/bash
source params.sh
sudo ./ch1_conf_nas_barca_outdoor.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" &
watch -n .1 "cat /proc/openair2/lchan_stats ; cat /proc/openair1/bch_stats ; cat /proc/openair1/openair1_state"
./stop_rf.sh
./del_mpls.sh
sleep 2
./del_mpls.sh
#!/bin/bash
source params.sh
sudo ./ch1_conf_nas_barca_outdoor.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" &
watch -n .1 "cat /proc/openair2/lchan_stats ; cat /proc/openair1/bch_stats ; cat /proc/openair1/openair1_state"
./stop_rf.sh
./del_mpls.sh
sleep 2
./del_mpls.sh
#!/bin/bash
source params.sh
sleep 1
echo ClusterHead address is $CH2_IN6_ADDR
echo Launching AS and RF
./start_openair.sh 2 1
# Installing NASMESH driver
sudo rmmod -f nasmesh
sudo insmod $OPENAIR2_DIR/NAS/DRIVER/MESH/nasmesh.ko nas_IMEI=0x12345678,0x01000000
echo Classification rules for CH2
#CH2 Broadcast (transmission of Router ADV)
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c0 -i0 -z0 -x $CH2_IN6_ADDR -y ff02::1 -r 3
#CH2<-> MR2 IP Signaling
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c1 -i0 -z0 -x $CH2_IN6_ADDR -y $MR2_IN6_ADDR2 -r 20
#CH<-> MR1 MPLS user-plane bearer
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c2 -i0 -z0 -l $MR2_CH2_LABEL_IN -m $MR2_CH2_LABEL_OUT -r 21
#CH2<-> MR2 MPLS PMIP Signaling
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c3 -i0 -z0 -l $CH2_MR2_CH1_LABEL_OUT -m $CH2_MR2_CH1_LABEL_IN -r 21
#CH2<-> MR2 MPLS Signaling - For com between MN3 and MN2
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c4 -i0 -z0 -l $MN2_CH2_MR2_MN3 -m $MN3_MR2_CH2_MN2 -r 21
#CH2<-> MR2 Imulticast
echo EADS Multicast for MR2
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c5 -i0 -z0 -s $CH2_IN_ADDR -t 226.50.10.10 -r 20
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c6 -i0 -z0 -s $MR2_IN_ADDR -t 226.50.10.10 -r 20
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c7 -i0 -z0 -s $CH2_IN_ADDR -t 226.50.10.11 -r 20
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c8 -i0 -z0 -s $MR2_IN_ADDR -t 226.50.10.11 -r 20
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c9 -i0 -z0 -s $CH2_IN_ADDR -t 226.50.10.12 -r 20
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c10 -i0 -z0 -s $MR2_IN_ADDR -t 226.50.10.12 -r 20
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c11 -i0 -z0 -s $CH2_IN_ADDR -t 226.50.10.13 -r 20
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c12 -i0 -z0 -s $MR2_IN_ADDR -t 226.50.10.13 -r 20
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c13 -i0 -z0 -s $CH2_IN_ADDR -t 226.50.10.14 -r 20
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c14 -i0 -z0 -s $MR2_IN_ADDR -t 226.50.10.14 -r 20
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c15 -i0 -z0 -s $MR2_IN_ADDR -t 226.50.10.15 -r 20
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c16 -i0 -z0 -s $CH2_IN_ADDR -t 226.50.10.15 -r 20
#CH2<-> MR3 (IP Signaling)
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c17 -i0 -z0 -x $CH2_IN6_ADDR -y $MR3_IN6_ADDR -r 28
#CH2<-> MR3 (MPLS user-plane bearer)
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c18 -i0 -z0 -l $MR3_LABEL_IN -m $MR3_LABEL_OUT -r 29
#CH2<-> MR3 (MPLS for com between MN2 and MN3)
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c19 -i0 -z0 -l $MN3_CH2_MR3_MN2 -m $MN2_MR3_CH2_MN3 -r 29
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c20 -i0 -z0 -s $MR3_IN_ADDR -t 226.30.10.10 -r 28
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c21 -i0 -z0 -s $CH2_IN_ADDR -t 226.30.10.10 -r 28
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c22 -i0 -z0 -s $MR3_IN_ADDR -t 226.30.10.11 -r 28
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c23 -i0 -z0 -s $CH2_IN_ADDR -t 226.30.10.11 -r 28
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c24 -i0 -z0 -s $MR3_IN_ADDR -t 226.30.10.12 -r 28
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c25 -i0 -z0 -s $CH2_IN_ADDR -t 226.30.10.12 -r 28
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c26 -i0 -z0 -s $MR3_IN_ADDR -t 226.30.10.13 -r 28
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c27 -i0 -z0 -s $CH2_IN_ADDR -t 226.30.10.13 -r 28
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c28 -i0 -z0 -s $MR3_IN_ADDR -t 226.30.10.14 -r 28
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c29 -i0 -z0 -s $CH2_IN_ADDR -t 226.30.10.14 -r 28
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c30 -i0 -z0 -s $MR3_IN_ADDR -t 226.30.10.15 -r 28
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c31 -i0 -z0 -s $CH2_IN_ADDR -t 226.30.10.15 -r 28
# Bring up openair NASMESH device and set IPv6 address
sudo ifconfig nasmesh0 up
sudo ip addr add 10.0.0.2/24 dev nasmesh0
sudo ip -6 addr add $CH2_IN6_ADDR/64 dev nasmesh0
echo No MPLS debug
echo "0" >/sys/mpls/debug
#!/bin/bash
source params.sh
sleep 1
echo ClusterHead address is $CH2_IN6_ADDR
echo Launching AS and RF
./start_openair.sh 4 1
# Installing NASMESH driver
sudo rmmod -f nasmesh
sudo insmod $OPENAIR2_DIR/NAS/DRIVER/MESH/nasmesh.ko nas_IMEI=0x12345678,0x01000000
echo Classification rules for CH2
#CH2 Broadcast (transmission of Router ADV)
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c0 -i0 -z0 -x $CH2_IN6_ADDR -y ff02::1 -r 3
#CH2<-> MR2 IP Signaling
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c1 -i0 -z0 -x $CH2_IN6_ADDR -y $MR2_IN6_ADDR2 -r 20
#CH<-> MR1 MPLS user-plane bearer
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c2 -i0 -z0 -l $MR2_CH2_LABEL_IN -m $MR2_CH2_LABEL_OUT -r 21
#CH2<-> MR2 MPLS PMIP Signaling
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c3 -i0 -z0 -l $CH2_MR2_CH1_LABEL_OUT -m $CH2_MR2_CH1_LABEL_IN -r 21
#CH2<-> MR2 MPLS Signaling - For com between MN3 and MN2
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c4 -i0 -z0 -l $MN2_CH2_MR2_MN3 -m $MN3_MR2_CH2_MN2 -r 21
#CH2<-> MR2 Imulticast
echo EADS Multicast for MR2
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c5 -i0 -z0 -s $CH2_IN_ADDR -t 226.50.10.10 -r 20
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c6 -i0 -z0 -s $MR2_IN_ADDR -t 226.50.10.10 -r 20
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c7 -i0 -z0 -s $CH2_IN_ADDR -t 226.50.10.11 -r 20
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c8 -i0 -z0 -s $MR2_IN_ADDR -t 226.50.10.11 -r 20
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c9 -i0 -z0 -s $CH2_IN_ADDR -t 226.50.10.12 -r 20
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c10 -i0 -z0 -s $MR2_IN_ADDR -t 226.50.10.12 -r 20
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c11 -i0 -z0 -s $CH2_IN_ADDR -t 226.50.10.13 -r 20
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c12 -i0 -z0 -s $MR2_IN_ADDR -t 226.50.10.13 -r 20
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c13 -i0 -z0 -s $CH2_IN_ADDR -t 226.50.10.14 -r 20
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c14 -i0 -z0 -s $MR2_IN_ADDR -t 226.50.10.14 -r 20
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c15 -i0 -z0 -s $MR2_IN_ADDR -t 226.50.10.15 -r 20
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c16 -i0 -z0 -s $CH2_IN_ADDR -t 226.50.10.15 -r 20
#CH2<-> MR3 (IP Signaling)
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c17 -i0 -z0 -x $CH2_IN6_ADDR -y $MR3_IN6_ADDR -r 28
#CH2<-> MR3 (MPLS user-plane bearer)
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c18 -i0 -z0 -l $MR3_LABEL_IN -m $MR3_LABEL_OUT -r 29
#CH2<-> MR3 (MPLS for com between MN2 and MN3)
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c19 -i0 -z0 -l $MN3_CH2_MR3_MN2 -m $MN2_MR3_CH2_MN3 -r 29
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c20 -i0 -z0 -s $MR3_IN_ADDR -t 226.30.10.10 -r 28
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c21 -i0 -z0 -s $CH2_IN_ADDR -t 226.30.10.10 -r 28
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c22 -i0 -z0 -s $MR3_IN_ADDR -t 226.30.10.11 -r 28
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c23 -i0 -z0 -s $CH2_IN_ADDR -t 226.30.10.11 -r 28
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c24 -i0 -z0 -s $MR3_IN_ADDR -t 226.30.10.12 -r 28
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c25 -i0 -z0 -s $CH2_IN_ADDR -t 226.30.10.12 -r 28
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c26 -i0 -z0 -s $MR3_IN_ADDR -t 226.30.10.13 -r 28
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c27 -i0 -z0 -s $CH2_IN_ADDR -t 226.30.10.13 -r 28
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c28 -i0 -z0 -s $MR3_IN_ADDR -t 226.30.10.14 -r 28
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c29 -i0 -z0 -s $CH2_IN_ADDR -t 226.30.10.14 -r 28
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c30 -i0 -z0 -s $MR3_IN_ADDR -t 226.30.10.15 -r 28
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c31 -i0 -z0 -s $CH2_IN_ADDR -t 226.30.10.15 -r 28
# Bring up openair NASMESH device and set IPv6 address
sudo ifconfig nasmesh0 up
sudo ip addr add 10.0.0.2/24 dev nasmesh0
sudo ip -6 addr add $CH2_IN6_ADDR/64 dev nasmesh0
echo No MPLS debug
echo "0" >/sys/mpls/debug
#!/bin/bash
#CH2_NAS.SH
#Cluster Head (2)– with NAS_MPLS_PMIP working
#Phil, 25 july 08
source params.sh
./ch2_conf_nas_barca_indoor.sh
echo "0" > /sys/mpls/debug
#MN1->MN2
./mpls_nas.sh $MR2_CH2_LABEL_OUT $MR3_IN6_ADDR $MR3_LABEL_IN
#MN2->MN1
./mpls_nas.sh $MR3_LABEL_OUT $MR2_IN6_ADDR2 $MR2_CH2_LABEL_IN
echo "0" > /sys/mpls/debug
#CH1->MR2->CH2
echo 'CH1->MR2->CH2'
mpls labelspace set dev nasmesh0 labelspace 0
mpls ilm add label gen $CH2_MR2_CH1_LABEL_IN labelspace 0 proto ipv6
echo 'CH1->MR2->CH2'
var=`mpls nhlfe add key 0 instructions push gen $CH2_MR2_CH1_LABEL_OUT nexthop nasmesh0 ipv6 $MR2_IN6_ADDR2 | grep key |cut -c 17-26`
echo "Creating routes from CH2 to CH1"
sudo ip -6 route add $CH1_IN6_ADDR/128 via $MR2_IN6_ADDR2 mpls $var
#MN3->MN2
./mpls_nas.sh $MN3_MR2_CH2_MN1 $MR3_IN6_ADDR $MN3_CH2_MR3_MN2
#MN2->MN3
./mpls_nas.sh $MN2_MR3_CH2_MN3 $MR2_IN6_ADDR2 $MN1_CH2_MR2_MN3
echo $OPENAIR3_PMIP6D_PATH/pmip6d -c -L $CH2_IN6_ADDR -A $CH1_IN6_ADDR
sudo xterm -hold -e "$OPENAIR3_PMIP6D_PATH/pmip6d -c -L $CH2_IN6_ADDR -A $CH1_IN6_ADDR" &
watch -n .5 "cat /proc/openair2/lchan_stats ; cat /proc/openair1/bch_stats ; cat /proc/openair1/openair1_state"
./stop_rf.sh
./del_mpls.sh
sleep 2
./del_mpls.sh
#!/bin/bash
#CH2_NAS.SH
#Cluster Head (2)– with NAS_MPLS_PMIP working
#Phil, 25 july 08
source params.sh
./ch2_conf_nas_barca_outdoor.sh
#MN1->MN2
./mpls_nas.sh $MR2_CH2_LABEL_OUT $MR3_IN6_ADDR $MR3_LABEL_IN
#MN2->MN1
./mpls_nas.sh $MR3_LABEL_OUT $MR2_IN6_ADDR2 $MR2_CH2_LABEL_IN
#CH1->MR2->CH2
echo 'CH1->MR2->CH2'
mpls labelspace set dev nasmesh0 labelspace 0
mpls ilm add label gen $CH2_MR2_CH1_LABEL_IN labelspace 0 proto ipv6
echo 'CH1->MR2->CH2'
var=`mpls nhlfe add key 0 instructions push gen $CH2_MR2_CH1_LABEL_OUT nexthop nasmesh0 ipv6 $MR2_IN6_ADDR2 | grep key |cut -c 17-26`
echo "Creating routes from CH2 to CH1"
sudo ip -6 route add $CH1_IN6_ADDR/128 via $MR2_IN6_ADDR2 mpls $var
#MN3->MN2
./mpls_nas.sh $MN3_MR2_CH2_MN1 $MR3_IN6_ADDR $MN3_CH2_MR3_MN2
#MN2->MN3
./mpls_nas.sh $MN2_MR3_CH2_MN3 $MR2_IN6_ADDR2 $MN1_CH2_MR2_MN3
echo $OPENAIR3_HOME/PMIP6D/pmip6d -c -L $CH2_IN6_ADDR -A $CH1_IN6_ADDR
sudo xterm -hold -e "$OPENAIR3_HOME/PMIP6D/pmip6d -c -L $CH2_IN6_ADDR -A $CH1_IN6_ADDR" &
watch -n .1 "cat /proc/openair2/lchan_stats ; cat /proc/openair1/bch_stats ; cat /proc/openair1/openair1_state"
./stop_rf.sh
./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 2 8
echo Installing NASMESH Driver
sudo rmmod -f nasmesh
sudo insmod $OPENAIR2_DIR/NAS/DRIVER/MESH/nasmesh.ko nas_IMEI=0x12345678,0x02000000
#sudo ifconfig eth0 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
#!/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 40
echo Installing NASMESH Driver
sudo rmmod -f nasmesh
sudo insmod $OPENAIR2_DIR/NAS/DRIVER/MESH/nasmesh.ko nas_IMEI=0x12345678,0x02000000
sudo ifconfig eth0 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
#!/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 eth0
# 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_barca_indoor.sh
./mr1_mpls_nas_barca.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 eth0
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"
./stop_rf.sh
./del_mpls.sh
sleep 2
./del_mpls.sh
#Phil, Lamia 10 Oct 08
source params.sh
sudo sysctl -w net.ipv6.conf.all.forwarding=1
./mr1_conf_nas_barca_outdoor.sh
./mr1_mpls_nas_barca.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 eth0
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"
./stop_rf.sh
./del_mpls.sh
sleep 2
./del_mpls.sh
#Phil, Lamia 10 Oct 08
source params.sh
sudo sysctl -w net.ipv6.conf.all.forwarding=1
./mr1_conf_nas_barca_outdoor.sh
./mr1_mpls_nas_barca.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 eth0
#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"
./stop_rf.sh
./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 0 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
#!/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 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
#!/bin/bash
# Author: Lamia Romdhani
#June 2008
source params.sh
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 eth0
#MN1->MN3
mpls labelspace set dev nasmesh0 labelspace 0
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
mpls labelspace set dev nasmesh0 labelspace 0
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_barca_indoor.sh
./mr2_mpls_nas_barca.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 $MR2_EG6_ADDR/64 dev eth0
sudo xterm -hold -e "$OPENAIR3_PMIP6D_PATH/pmip6d -m -s -L $CH1_IN6_ADDR -N $MR2_EG6_ADDR -E $MR2_IN6_ADDR1" &
watch -n1 "cat /proc/openair2/lchan_stats ; cat /proc/openair1/bch_stats"
./stop_rf.sh
./del_mpls.sh
sleep 2
./del_mpls.sh
#!/bin/bash
#Lamia, Philippe huu nghia, 10 Oct 08
source params.sh
sudo sysctl -w net.ipv6.conf.all.forwarding=1
./mr2_conf_nas_barca_outdoor.sh
./mr2_mpls_nas_barca.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 $MR2_EG6_ADDR/64 dev eth0
sudo xterm -hold -e "$OPENAIR3_PMIP6D_PATH/pmip6d -m -s -L $CH1_IN6_ADDR -N $MR2_EG6_ADDR -E $MR2_IN6_ADDR1" &
watch -n1 "cat /proc/openair2/lchan_stats ; cat /proc/openair1/bch_stats"
./stop_rf.sh
./del_mpls.sh
sleep 2
./del_mpls.sh
#!/bin/bash
#Lamia, Philippe huu nghia, 10 Oct 08
source params.sh
sudo sysctl -w net.ipv6.conf.all.forwarding=1
./mr2_conf_nas_barca_outdoor.sh
./mr2_mpls_nas_barca.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 $MR2_EG6_ADDR/64 dev eth0
#sudo xterm -hold -e "$OPENAIR3_PMIP6D_PATH/pmip6d -m -s -L $CH1_IN6_ADDR -N $MR2_EG6_ADDR -E $MR2_IN6_ADDR1" &
watch -n1 "cat /proc/openair2/lchan_stats ; cat /proc/openair1/bch_stats"
./stop_rf.sh
./del_mpls.sh
sleep 2
./del_mpls.sh
#!/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 1 10
echo Installing NASMESH Driver
sudo rmmod -f nasmesh
sudo insmod $OPENAIR2_DIR/NAS/DRIVER/MESH/nasmesh.ko nas_IMEI=0x12345678,0x02000000
sudo ifconfig nasmesh0 up
sudo ifconfig nasmesh0 10.0.0.5
sudo ip -6 addr add $MR3_IN6_ADDR/64 dev nasmesh0
echo Classification rules for MR3 - Default DTCH UL for L3 signaling
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c0 -i0 -z0 -x $MR3_IN6_ADDR -y $CH2_IN6_ADDR -r 12
echo Classification rules for MR3 - MPLS User-plane Bearer
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c1 -i0 -z0 -l $MN2_MR3_CH2_MN3 -m $MN3_CH2_MR3_MN2 -r 13
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c2 -i0 -z0 -l $MR3_LABEL_OUT -m $MR3_LABEL_IN -r 13
echo EADS Multicast for MR3
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c3 -i0 -z0 -s $CH2_IN_ADDR -t 226.30.10.10 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c4 -i0 -z0 -s $MR3_IN_ADDR -t 226.30.10.10 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c5 -i0 -z0 -s $CH2_IN_ADDR -t 226.30.10.11 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c6 -i0 -z0 -s $MR3_IN_ADDR -t 226.30.10.11 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c7 -i0 -z0 -s $CH2_IN_ADDR -t 226.30.10.12 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c8 -i0 -z0 -s $MR3_IN_ADDR -t 226.30.10.12 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c9 -i0 -z0 -s $CH2_IN_ADDR -t 226.30.10.13 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c10 -i0 -z0 -s $MR3_IN_ADDR -t 226.30.10.13 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c11 -i0 -z0 -s $CH2_IN_ADDR -t 226.30.10.14 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c12 -i0 -z0 -s $MR3_IN_ADDR -t 226.30.10.14 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c13 -i0 -z0 -s $MR3_IN_ADDR -t 226.30.10.15 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c14 -i0 -z0 -s $CH2_IN_ADDR -t 226.30.10.15 -r 12
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
#!/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 4 10
echo Installing NASMESH Driver
sudo rmmod -f nasmesh
sudo insmod $OPENAIR2_DIR/NAS/DRIVER/MESH/nasmesh.ko nas_IMEI=0x12345678,0x02000000
sudo ifconfig eth0 10.0.2.5
sudo ifconfig nasmesh0 up
sudo ifconfig nasmesh0 10.0.0.5
sudo ip -6 addr add $MR3_IN6_ADDR/64 dev nasmesh0
echo Classification rules for MR3 - Default DTCH UL for L3 signaling
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c0 -i0 -z0 -x $MR3_IN6_ADDR -y $CH2_IN6_ADDR -r 12
echo Classification rules for MR3 - MPLS User-plane Bearer
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c1 -i0 -z0 -l $MN2_MR3_CH2_MN3 -m $MN3_CH2_MR3_MN2 -r 13
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c2 -i0 -z0 -l $MR3_LABEL_OUT -m $MR3_LABEL_IN -r 13
echo EADS Multicast for MR3
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c3 -i0 -z0 -s $CH2_IN_ADDR -t 226.30.10.10 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c4 -i0 -z0 -s $MR3_IN_ADDR -t 226.30.10.10 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c5 -i0 -z0 -s $CH2_IN_ADDR -t 226.30.10.11 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c6 -i0 -z0 -s $MR3_IN_ADDR -t 226.30.10.11 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c7 -i0 -z0 -s $CH2_IN_ADDR -t 226.30.10.12 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c8 -i0 -z0 -s $MR3_IN_ADDR -t 226.30.10.12 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c9 -i0 -z0 -s $CH2_IN_ADDR -t 226.30.10.13 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c10 -i0 -z0 -s $MR3_IN_ADDR -t 226.30.10.13 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c11 -i0 -z0 -s $CH2_IN_ADDR -t 226.30.10.14 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c12 -i0 -z0 -s $MR3_IN_ADDR -t 226.30.10.14 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c13 -i0 -z0 -s $MR3_IN_ADDR -t 226.30.10.15 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c14 -i0 -z0 -s $CH2_IN_ADDR -t 226.30.10.15 -r 12
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
#!/bin/bash
# Script by Lamia Romdhani, Nghia, Philippe, Hicham 18 Feb 2009
source params.sh
sudo modprobe mpls6
echo Setting MPLS for mr3
echo "0" > /sys/mpls/debug
echo 'MN1->MN2'
sudo mpls labelspace set dev nasmesh0 labelspace 0
sudo mpls ilm add label gen $MR3_LABEL_IN labelspace 0 proto ipv6
echo 'MN2->MN1'
var=`mpls nhlfe add key 0 instructions push gen $MR3_LABEL_OUT nexthop nasmesh0 ipv6 $CH2_IN6_ADDR |grep key | cut -c 17-26`
echo "Creating routes"
sudo ip -6 route add $MN1_IN6_ADDR/128 via $CH2_IN6_ADDR mpls $var
sudo ip -6 route add $MN2_IN6_ADDR/128 dev $ETH_MR3
echo 'MN3->MN2'
sudo mpls labelspace set dev nasmesh0 labelspace 0
sudo mpls ilm add label gen $MN3_CH2_MR3_MN2 labelspace 0 proto ipv6
echo 'MN2->MN3'
var=`mpls nhlfe add key 0 instructions push gen $MN2_MR3_CH2_MN3 nexthop nasmesh0 ipv6 $CH2_IN6_ADDR |grep key | cut -c 17-26`
echo "Creating routes"
sudo ip -6 route add $MN3_IN6_ADDR/128 via $CH2_IN6_ADDR mpls $var
#!/bin/bash
# Script by Lamia Romdhani, Nghia, Philippe, Hicham 18 Feb 2009
source params.sh
sudo modprobe mpls6
echo Setting MPLS for mr3
echo "0" > /sys/mpls/debug
echo 'MN1->MN2'
sudo mpls labelspace set dev nasmesh0 labelspace 0
sudo mpls ilm add label gen $MR3_LABEL_IN labelspace 0 proto ipv6
echo 'MN2->MN1'
var=`mpls nhlfe add key 0 instructions push gen $MR3_LABEL_OUT nexthop nasmesh0 ipv6 $CH2_IN6_ADDR |grep key | cut -c 17-26`
echo "Creating routes"
sudo ip -6 route add $MN1_IN6_ADDR/128 via $CH2_IN6_ADDR mpls $var
sudo ip -6 route add $MN2_IN6_ADDR/128 dev $ETH_MR3
echo 'MN3->MN2'
sudo mpls labelspace set dev nasmesh0 labelspace 0
sudo mpls ilm add label gen $MN3_CH2_MR3_MN2 labelspace 0 proto ipv6
echo 'MN2->MN3'
var=`mpls nhlfe add key 0 instructions push gen $MN2_MR3_CH2_MN3 nexthop nasmesh0 ipv6 $CH2_IN6_ADDR |grep key | cut -c 17-26`
echo "Creating routes"
sudo ip -6 route add $MN3_IN6_ADDR/128 via $CH2_IN6_ADDR mpls $var
#Phil, Lamia 10 Oct 08
source params.sh
sudo sysctl -w net.ipv6.conf.all.forwarding=1
./mr3_conf_nas_barca.sh
./mr3_mpls_nas_barca.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 $MR3_EG6_ADDR/64 dev eth0
sudo xterm -hold -e "$OPENAIR3_PMIP6D_PATH/pmip6d -m -s -L $CH2_IN6_ADDR -N $MR3_EG6_ADDR -E $MR3_IN6_ADDR" &
watch -n1 "cat /proc/openair2/lchan_stats ; cat /proc/openair1/bch_stats"
./stop_rf.sh
./del_mpls.sh
sleep 2
./del_mpls.sh
#Phil, Lamia 10 Oct 08
source params.sh
sudo sysctl -w net.ipv6.conf.all.forwarding=1
./mr3_conf_nas_barca_outdoor.sh
./mr3_mpls_nas_barca.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 $MR3_EG6_ADDR/64 dev eth0
sudo xterm -hold -e "$OPENAIR3_PMIP6D_PATH/pmip6d -m -s -L $CH2_IN6_ADDR -N $MR3_EG6_ADDR -E $MR3_IN6_ADDR" &
watch -n1 "cat /proc/openair2/lchan_stats ; cat /proc/openair1/bch_stats"
./stop_rf.sh
./del_mpls.sh
sleep 2
./del_mpls.sh
#!/bin/bash
MR1_IN_ADDR=10.0.1.3
MR1_IN6_ADDR=2001:10:0:1:7856:3412:0:2
MR1_EG_ADDR=192.168.9.1
MR1_EG6_ADDR=2001:660:5502::100
# Flow CH1->MR1
MR1_LABEL_IN=1001
# Flow MR1->CH1
MR1_LABEL_OUT=1000
ETH_MR1=eth0
MR2_IN_ADDR=10.0.1.4
MR2_IN6_ADDR1=2001:10:0:1:7856:3412:0:3
MR2_IN6_ADDR2=2001:10:0:2:7856:3412:0:3
MR2_EG6_ADDR=2001:660:5502::300
ETH_MR2=eth0
# Flow CH1->MR2
MR2_CH1_LABEL_IN=2000
# Flow MR2->CH1
MR2_CH1_LABEL_OUT=2001
# Flow CH2->MR2
MR2_CH2_LABEL_IN=3001
# Flow MR2->CH2
MR2_CH2_LABEL_OUT=3000
MR3_IN_ADDR=10.0.1.5
MR3_IN6_ADDR=2001:10:0:2:7856:3412:0:2
MR3_EG_ADDR=192.168.10.1
MR3_EG6_ADDR=2001:660:5502::200
# Flow CH2->MR3
MR3_LABEL_IN=4000
# Flow MR3->CH2
MR3_LABEL_OUT=4001
ETH_MR3=eth0
CH1_IN_ADDR=10.0.1.1
CH2_IN_ADDR=10.0.1.2
CH1_IN6_ADDR=2001:10:0:1:7856:3412:0:1
CH2_IN6_ADDR=2001:10:0:2:7856:3412:0:1
## Communication between the CHs
CH1_MR2_CH2_LABEL_IN=8001
CH1_MR2_CH2_LABEL_OUT=8000
CH2_MR2_CH1_LABEL_IN=9001
CH2_MR2_CH1_LABEL_OUT=9000
## Com between MN1 and MN3
MN1_MR1_CH1_MN3=1500
MN3_CH1_MR1_MN1=1501
MN1_CH1_MR2_MN3=2500
MN3_MR2_CH1_MN1=2501
## Com between MN2 and MN3
MN3_MR2_CH2_MN2=3500
MN2_CH2_MR2_MN3=3501
MN3_CH2_MR3_MN2=4500
MN2_MR3_CH2_MN3=4501
#MN1_IN6_ADDR=2001:660:5502::20
#MN2_IN6_ADDR=2001:660:5502::25
#MN1_IN6_ADDR=2001:660:5502::110
#MN1_IN6_ADDR=2001:660:5502:0:21c:23ff:fe5a:d6c -> SOPRANO
# MN1 - COOKIEMONSTER
MN1_IN6_ADDR=2001:660:5502:0:21c:23ff:fe28:5809
MN1_IN_ADDR=192.168.9.2
MN2_IN_ADDR=192.168.10.2
# MN2 - OSCAR
MN2_IN6_ADDR=2001:660:5502:0:21c:23ff:fe2f:151b
#MN3_IN6_ADDR=2001:660:5502::310
# CAMERA IP
MN3_IN6_ADDR=2001:660:5502:0:240:8cff:fe77:9b79
# Put the right OPENAIR3 path here
OPENAIR3_HOME=/root/openair_trials_2/openair3
OPENAIR3_PMIP6D_PATH=$OPENAIR3_HOME/PMIP6D
OPENAIR3_SCRIPTS_PATH=$OPENAIR3_HOME/scripts
REFLECTOR_DIR=$OPENAIR3_HOME/EXAMPLES/BARCA_TRIALS/REFLECTOR
# Put the right OPENAIR2 path here
#OPENAIR2_DIR=~/openair2_r234/openair2/
OPENAIR2_DIR=/root/openair_trials_2/openair2
if [ "$1" == "" ]; then
echo "Please provide a TX power level (0-8)"
exit
fi
if [ "$2" == "" ]; then
echo "Please provide a Node ID (0-7 for CH, 8-15 for MR/UE)"
exit
fi
if [ "$3" != "" ]; then
echo "Setting timing advance to" $3
else
echo "Using standard timing advance"
fi
if [ "$OPENAIR1_DIR" == "" ] ; then
echo "Please set OPENAIR1_DIR environment variable"
exit
else
echo "OPENAIR1_DIR Set to $OPENAIR1_DIR"
fi
cd $OPENAIR1_DIR/USERSPACE_TOOLS/OPENAIR_RF
source ./txgains.sh
case $1 in
0)
CBMIMO1_POWER=$CBMIMO1_m20_dBm
echo "Configuring CBMIMO1 for -20dBm ($CBMIMO1_POWER)"
;;
1)
CBMIMO1_POWER=$CBMIMO1_m15_dBm
echo Configuring CBMIMO1 for -15dBm
;;
2)
CBMIMO1_POWER=$CBMIMO1_m10_dBm
echo Configuring CBMIMO1 for -10dBm
;;
3)
CBMIMO1_POWER=$CBMIMO1_m5_dBm
echo Configuring CBMIMO1 for -5dBm
;;
4)
CBMIMO1_POWER=$CBMIMO1_0_dBm
echo Configuring CBMIMO1 for 0dBm
;;
5)
CBMIMO1_POWER=$CBMIMO1_5_dBm
echo Configuring CBMIMO1 for 5dBm
;;
6)
CBMIMO1_POWER=$CBMIMO1_10_dBm
echo Configuring CBMIMO1 for 10dBm
;;
7)
CBMIMO1_POWER=$CBMIMO1_15_dBm
echo Configuring CBMIMO1 for 15dBm
;;
8)
CBMIMO1_POWER=$CBMIMO1_20_dBm
echo Configuring CBMIMO1 for 20dBm
;;
*)
echo Invalid TX power
exit
esac
echo Removing openair_rf,openair_l2 and openair_rrc modules
sudo rmmod -f openair_rrc
sudo rmmod -f openair_l2
sudo rmmod -f openair_rf
sudo insmod $OPENAIR1_DIR/ARCH/CBMIMO1/DEVICE_DRIVER/openair_rf_l2.ko
OARF_RET=`lsmod | grep -e openair_rf`
if [ "$OARF_RET" = "" ]; then
echo Error loading openair1 module
exit
fi
sudo insmod $OPENAIR2_DIR/LAYER2/openair_layer2.ko
OA2_RET=`lsmod | grep -e openair_l2`
if [ "$OA2_RET" = "" ]; then
echo Error loading openair2 module
exit
fi
sudo insmod $OPENAIR2_DIR/RRC/MESH/openair_RRC.ko
OARRC_RET=`lsmod | grep -e openair_rrc`
if [ "$OARRC_RET" = "" ]; then
echo Error loading openair RRC module
exit
fi
OA_DEV="/dev/openair0"
if [ -c "$OA_DEV" ]; then
echo "$OA_DEV exists"
else
echo "creating $OA_DEV"
sudo mknod $OA_DEV c 127 0
sudo chmod a+rw /dev/openair0
fi
./openair_rf_cbmimo1 1 0
./openair_rf_cbmimo1 1 6 $CBMIMO1_POWER
if [ "$3" != "" ]; then
./openair_rf_cbmimo1 1 25 $3
fi
if [ $2 -eq "0" ]; then
./openair_rf_cbmimo1 1 1 1 $2
elif [ $2 -lt "8" ]; then
./openair_rf_cbmimo1 1 2 1 $2
elif [ $2 -lt "16" ]; then
./openair_rf_cbmimo1 1 3 1 $2
else
echo Illegal Node ID, exiting
exit
fi
sleep 1
# Watch the status of the radio to check for hardware exit event
#OA1_STATE=`cat /proc/openair1/openair1_state`
#while [ "$OA1_STATE" != "EXITED" ]; do
# OA1_STATE=`cat /proc/openair1/openair1_state`
# sleep .5
#done
#./openair_rf_cbmimo1 1 4 1
#echo CBMIMO1 Hardware exit, restarting ...
cd $OPENAIR1_DIR/USERSPACE_TOOLS/OPENAIR_RF
echo STOP STARTS...
./openair_rf_cbmimo1 1 4 1
sleep 2
echo STOP RF DONE
sudo killall chbch_scope
echo STOP CHBCH SCOPE DONE
sudo killall sach_scope
echo STOP_SACH SCOPE DONE
sleep 1
sudo rmmod nasmesh
sleep 1
echo REMOVE NASMESH MODULE DONE
sudo rmmod openair_rrc
sleep 1
echo REMOVE RRC MODULE DONE
sudo rmmod openair_l2
sleep 1
echo REMOVE LAYER2 MODULE DONE
sudo rmmod openair_rf
echo REMOVE RF MODULE DONE
echo STOP FINISHED SUCCESSFULLY
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
#!/bin/sh
# transfered from HA
ntpdate -b 2001:1::1
OUTBOUNDIF=eth0
INBOUNDIF=eth1
tc qdisc change dev $INBOUNDIF root netem loss 0%
tc qdisc change dev $OUTBOUNDIF root netem loss 0%
#!/bin/bash
DEMO_DIR=$OPENAIR3_DIR"/EXAMPLES/IDROMEL_DEMO_NEMO_MCOA_SHO/CH1"
RADVD_CONF_FILE=$DEMO_DIR/etc/radvd.conf
#----------------------------------------------
HOME_AGENT_NW=2001:4::/32
HOME_AGENT_ADDR_HL=2001:4::1/64
HOME_AGENT_ADDR_CN=2001:1::1/64
#----------------------------------------------
CH1_EGRESS_ETHERNET_INTERFACE=eth0
CH1_INGRESS_ETHERNET_INTERFACE=eth3
CH1_IN6_ADDR=2001:2f0:110:6000::1/64
CH1_IN6_NW=2001:2f0:110:6000::/64
CH1_IN6_ADDR_CN=2001:1::6/64
CH1_IN_ADDR=10.0.1.1/24
CH1_IN_BROADCAST_ADDR=10.0.1.255
#----------------------------------------------
CH2_EGRESS_ETHERNET_INTERFACE=eth0
CH2_INGRESS_ETHERNET_INTERFACE=eth1
CH2_IN6_ADDR=2001:2f0:110:7000::1/64
CH2_IN6_NW=2001:2f0:110:7000::/64
CH2_IN6_ADDR_CN=2001:1::7/64
CH2_IN_ADDR=10.0.2.2/24
CH2_IN_BROADCAST_ADDR=10.0.2.255
#----------------------------------------------
MR_IN_ADDR=10.0.1.3/24
MR_IN_ADDR2=10.0.2.3/24
MR_IN6_ADDR1=2001:2f0:110:6000:3d6:5200:300:1/64
MR_IN6_LLADDR1=fe80:0:0:0:3d6:5200:300:1/64
MR_IN6_ADDR2=2001:2f0:110:7000:3d6:5200:300:2/64
MR_IN6_LLADDR2=fe80:0:0:0:3d6:5200:300:2/64
#----------------------------------------------
#!/bin/sh
# transfered from HA
#DOWNWARD HO
#ER_START="30.0"
#ER_END="1"
#UPWARD HO
ER_START="10"
ER_END="30"
###############
OUTBOUNDIF=eth0
INBOUNDIF=eth1
LOG_AR="log3G.log"
DURATION=10000
TIMESLICE=100
#LGtc qdisc change dev $INBOUNDIF root netem loss $ER_START%
#LGtc qdisc change dev $OUTBOUNDIF root netem loss $ER_START%
#LG./waitfortime $1
TIMESECOND=`date +%s`
TIMENANO=`date +%N`
echo $TIMESECOND.$TIMENANO $ER_START > $LOG_AR
sleep 5
#./radio_emulation $OUTBOUNDIF $ER_START $ER_END $INBOUNDIF $ER_START $ER_END $DURATION $TIMESLICE >> $LOG_AR
sleep 5
TIMESECOND=`date +%s`
TIMENANO=`date +%N`
echo $TIMESECOND.$TIMENANO $ER_END >> $LOG_AR
exit 0
#!/bin/bash
ip_no_mask ()
{
echo $1 | cut -d '/' -f1
}
source $OPENAIR3_DIR"/EXAMPLES/IDROMEL_DEMO_NEMO_MCOA_SHO/CH1/bin/params.sh"
HOME_AGENT_ADDR_HL_NO_MASK=`ip_no_mask $HOME_AGENT_ADDR_HL`
HOME_AGENT_ADDR_CN_NO_MASK=`ip_no_mask $HOME_AGENT_ADDR_CN`
#----------------------------------------------
CH1_IN6_ADDR_NO_MASK=`ip_no_mask $CH1_IN6_ADDR`
CH1_IN6_ADDR_CN_NO_MASK=`ip_no_mask $CH1_IN6_ADDR_CN`
CH1_IN_ADDR_NO_MASK=`ip_no_mask $CH1_IN_ADDR`
#----------------------------------------------
CH2_IN6_ADDR_NO_MASK=`ip_no_mask $CH2_IN6_ADDR`
CH2_IN6_ADDR_CN_NO_MASK=`ip_no_mask $CH2_IN6_ADDR_CN`
CH2_IN_ADDR_NO_MASK=`ip_no_mask $CH2_IN_ADDR`
#----------------------------------------------
MR_IN_ADDR_NO_MASK=`ip_no_mask $MR_IN_ADDR`
MR_IN_ADDR2_NO_MASK=`ip_no_mask $MR_IN_ADDR2`
MR_IN6_ADDR1_NO_MASK=`ip_no_mask $MR_IN6_ADDR1`
MR_IN6_LLADDR1_NO_MASK=`ip_no_mask $MR_IN6_LLADDR1`
MR_IN6_ADDR2_NO_MASK=`ip_no_mask $MR_IN6_ADDR2`
MR_IN6_LLADDR2_NO_MASK=`ip_no_mask $MR_IN6_LLADDR2`
/etc/init.d/radvd stop
killall -q mac_sim_rrm rrm emul_int xterm
rmmod nasmesh
sysctl -w net.ipv6.conf.all.accept_ra=0
sysctl -w net.ipv6.conf.all.forwarding=1
sysctl -w net.ipv6.conf.$CH1_EGRESS_ETHERNET_INTERFACE.accept_ra=0
sysctl -w net.ipv6.conf.$CH1_EGRESS_ETHERNET_INTERFACE.forwarding=1
sysctl -w net.ipv6.conf.$CH1_INGRESS_ETHERNET_INTERFACE.accept_ra=0
sysctl -w net.ipv6.conf.$CH1_INGRESS_ETHERNET_INTERFACE.forwarding=1
ifconfig $CH1_EGRESS_ETHERNET_INTERFACE down
ifconfig $CH1_INGRESS_ETHERNET_INTERFACE down
ifconfig $CH1_EGRESS_ETHERNET_INTERFACE up
ifconfig $CH1_INGRESS_ETHERNET_INTERFACE up
ip -6 addr add $CH1_IN6_ADDR_CN scope global dev $CH1_INGRESS_ETHERNET_INTERFACE
ip -6 route add $HOME_AGENT_NW via $HOME_AGENT_ADDR_CN_NO_MASK
ip -6 route add $CH2_IN6_NW via $CH2_IN6_ADDR_CN_NO_MASK
cd $OPENAIR2_DIR
insmod $OPENAIR2_DIR/NAS/DRIVER/MESH/nasmesh.ko nas_IMEI=0x12345678,0x01000000
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c0 -i0 -z0 -x $CH1_IN6_ADDR_NO_MASK -y ff02:0:0:0:0:0:0:1 -r 3
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c1 -i0 -z0 -x $CH1_IN6_ADDR_NO_MASK -y ff02:0:0:0:0:0:0:2 -r 3
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c2 -i0 -z0 -x $CH1_IN6_ADDR_NO_MASK -y ff02:0:0:0:0:0:0:3 -r 3
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c3 -i0 -z0 -x $CH1_IN6_ADDR_NO_MASK -y ff02:0:0:0:0:0:0:16 -r 3
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c4 -i0 -z0 -x $CH1_IN6_ADDR_NO_MASK -y $MR_IN6_ADDR1_NO_MASK -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c5 -i0 -z0 -x $CH1_IN6_ADDR_NO_MASK -y $MR_IN6_LLADDR1_NO_MASK -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c6 -i0 -z0 -s $CH1_IN_ADDR_NO_MASK -t $MR_IN_ADDR_NO_MASK -r 12
ifconfig nasmesh0 up
ip -4 addr add $CH1_IN_ADDR broadcast $CH1_IN_BROADCAST_ADDR dev nasmesh0
ip -6 addr add $CH1_IN6_ADDR scope global dev nasmesh0
route add -net 224.0.0.0 netmask 240.0.0.0 dev $CH1_EGRESS_ETHERNET_INTERFACE
sleep 1
sudo rm -f /tmp/*socket*
cd $OPENAIR3_DIR/MESH/RRM/
xterm -T RRM -hold -e sh rrm_idromel.sh &
sleep 5
cd $OPENAIR2_DIR/SIMULATION/USER_TOOLS/LAYER2_SIM
./mac_sim_rrm -m0 -t ../../TOPOLOGIES/eth_2chs_1node.top &
sysctl -w net.ipv6.conf.nasmesh0.accept_ra=0
sysctl -w net.ipv6.conf.nasmesh0.forwarding=1
sleep 5
cp $RADVD_CONF_FILE /etc/radvd.conf
/etc/init.d/radvd start
127.0.0.1 localhost
127.0.1.1 daidal5
192.168.12.100 carne
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
auto lo
iface lo inet loopback
iface eth0 inet static
address 192.168.100.1
netmask 255.255.255.0
auto eth0
iface eth1 inet static
address 192.168.12.82
netmask 255.255.255.0
gateway 192.168.12.100
auto eth1
iface eth3 inet static
address 192.168.1.2
netmask 255.255.255.0
auto eth3
# /etc/nsswitch.conf
#
# Example configuration of GNU Name Service Switch functionality.
# If you have the `glibc-doc' and `info' packages installed, try:
# `info libc "Name Service Switch"' for information about this file.
passwd: nis files
group: nis files
shadow: nis files
hosts: nis files dns mdns
networks: files
protocols: db files
services: db files
ethers: db files
rpc: db files
netgroup: nis
interface nasmesh0
{
AdvSendAdvert on;
MaxRtrAdvInterval 3;
MinRtrAdvInterval 0.03;
MinDelayBetweenRAs 0.03;
AdvHomeAgentFlag off;
AdvHomeAgentInfo off;
AdvDefaultLifetime 360;
prefix 2001:2f0:110:6000::/64
{
AdvOnLink on;
AdvAutonomous on;
AdvRouterAddr on;
};
};
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
exit 0
#!/bin/sh
# transfered from HA
ntpdate -b 2001:1::1
OUTBOUNDIF=eth0
INBOUNDIF=eth1
tc qdisc change dev $INBOUNDIF root netem loss 0%
tc qdisc change dev $OUTBOUNDIF root netem loss 0%
#!/bin/bash
/etc/init.d/radvd stop
sysctl -w net.ipv6.conf.all.accept_ra=0
sysctl -w net.ipv6.conf.all.forwarding=1
sysctl -w net.ipv6.conf.eth0.accept_ra=0
sysctl -w net.ipv6.conf.eth0.forwarding=1
sysctl -w net.ipv6.conf.eth1.accept_ra=0
sysctl -w net.ipv6.conf.eth1.forwarding=1
ifconfig eth0 down
ifconfig eth0 up
ifconfig eth1 down
ifconfig eth1 up
#ifconfig eth0 inet6 add 2001:1::6/64
#ifconfig eth1 inet6 add 2001:2f0:110:6000::1/64
route -A inet6 add 2001:4::/32 gw 2001:1::1
route -A inet6 add 2001:2f0:110:7000::/64 gw 2001:1::7
cp -f ../etc/radvd.conf /etc
#/etc/init.d/radvd stop
#/etc/init.d/radvd start
tc qdisc add dev eth0 root netem loss 0%
tc qdisc add dev eth1 root netem loss 0%
cd $OPENAIR2_DIR/EXAMPLES/ETH_EMUL_2CHS_1NODE && ./start_ch1_user
#!/bin/bash
ifconfig eth0 down
ifconfig eth1 down
ifconfig eth0 up
ifconfig eth1 up
ifconfig eth1 add 2001:1::7/64
ifconfig eth0 add 2001:2f0:110:7000::1/64
ethtool -s eth0 autoneg on
ethtool -s eth0 speed 100
route -A inet6 add 2001:4::/32 gw 2001:1::1
route -A inet6 add 2001:2f0:110:6000::/64 gw 2001:1::6
# radvd service is not installed on this host
radvd -m logfile -C /opt/bin/radvd_ar2.conf
tc qdisc add dev eth0 root netem loss 0%
tc qdisc add dev eth1 root netem loss 0%
1234366542.100669000 0.014
1234366552.126226000 0.004
#!/bin/bash
DEMO_DIR=$OPENAIR3_DIR"/EXAMPLES/IDROMEL_DEMO_NEMO_MCOA_SHO/CH2"
RADVD_CONF_FILE=$DEMO_DIR/etc/radvd.conf
#----------------------------------------------
HOME_AGENT_NW=2001:4::/32
HOME_AGENT_ADDR_HL=2001:4::1/64
HOME_AGENT_ADDR_CN=2001:1::1/64
#----------------------------------------------
CH1_EGRESS_ETHERNET_INTERFACE=eth0
CH1_INGRESS_ETHERNET_INTERFACE=eth3
CH1_IN6_ADDR=2001:2f0:110:6000::1/64
CH1_IN6_NW=2001:2f0:110:6000::/64
CH1_IN6_ADDR_CN=2001:1::6/64
CH1_IN_ADDR=10.0.1.1/24
CH1_IN_BROADCAST_ADDR=10.0.1.255
#----------------------------------------------
CH2_EGRESS_ETHERNET_INTERFACE=eth0
CH2_INGRESS_ETHERNET_INTERFACE=eth1
CH2_IN6_ADDR=2001:2f0:110:7000::1/64
CH2_IN6_NW=2001:2f0:110:7000::/64
CH2_IN6_ADDR_CN=2001:1::7/64
CH2_IN_ADDR=10.0.2.2/24
CH2_IN_BROADCAST_ADDR=10.0.2.255
#----------------------------------------------
MR_IN_ADDR=10.0.1.3/24
MR_IN_ADDR2=10.0.2.3/24
MR_IN6_ADDR1=2001:2f0:110:6000:3d6:5200:300:1/64
MR_IN6_LLADDR1=fe80:0:0:0:3d6:5200:300:1/64
MR_IN6_ADDR2=2001:2f0:110:7000:3d6:5200:300:2/64
MR_IN6_LLADDR2=fe80:0:0:0:3d6:5200:300:2/64
#----------------------------------------------
#!/bin/sh
# transfered from HA
#DOWNWARD HO
#ER_START="0.004"
#ER_END="0.016"
#UPWARD HO
ER_START="0.014"
ER_END="0.004"
###############
OUTBOUNDIF=eth1
INBOUNDIF=eth0
LOG_AR="logWLAN.log"
DURATION=10000
TIMESLICE=100
#tc qdisc change dev $INBOUNDIF root netem loss $ER_START%
#tc qdisc change dev $OUTBOUNDIF root netem loss $ER_START%
pwd
./waitfortime $1
TIMESECOND=`date +%s`
TIMENANO=`date +%N`
echo $TIMESECOND.$TIMENANO $ER_START > $LOG_AR
sleep 5
#./radio_emulation $OUTBOUNDIF $ER_START $ER_END $INBOUNDIF $ER_START $ER_END $DURATION $TIMESLICE >> $LOG_AR
sleep 5
TIMESECOND=`date +%s`
TIMENANO=`date +%N`
echo $TIMESECOND.$TIMENANO $ER_END >> $LOG_AR
exit 0
#!/bin/bash
ip_no_mask ()
{
echo $1 | cut -d '/' -f1
}
source $OPENAIR3_DIR"/EXAMPLES/IDROMEL_DEMO_NEMO_MCOA_SHO/CH2/bin/params.sh"
HOME_AGENT_ADDR_HL_NO_MASK=`ip_no_mask $HOME_AGENT_ADDR_HL`
HOME_AGENT_ADDR_CN_NO_MASK=`ip_no_mask $HOME_AGENT_ADDR_CN`
#----------------------------------------------
CH1_IN6_ADDR_NO_MASK=`ip_no_mask $CH1_IN6_ADDR`
CH1_IN6_ADDR_CN_NO_MASK=`ip_no_mask $CH1_IN6_ADDR_CN`
CH1_IN_ADDR_NO_MASK=`ip_no_mask $CH1_IN_ADDR`
#----------------------------------------------
CH2_IN6_ADDR_NO_MASK=`ip_no_mask $CH2_IN6_ADDR`
CH2_IN6_ADDR_CN_NO_MASK=`ip_no_mask $CH2_IN6_ADDR_CN`
CH2_IN_ADDR_NO_MASK=`ip_no_mask $CH2_IN_ADDR`
#----------------------------------------------
MR_IN_ADDR_NO_MASK=`ip_no_mask $MR_IN_ADDR`
MR_IN_ADDR2_NO_MASK=`ip_no_mask $MR_IN_ADDR2`
MR_IN6_ADDR1_NO_MASK=`ip_no_mask $MR_IN6_ADDR1`
MR_IN6_LLADDR1_NO_MASK=`ip_no_mask $MR_IN6_LLADDR1`
MR_IN6_ADDR2_NO_MASK=`ip_no_mask $MR_IN6_ADDR2`
MR_IN6_LLADDR2_NO_MASK=`ip_no_mask $MR_IN6_LLADDR2`
/etc/init.d/radvd stop
killall -q mac_sim_rrm rrm emul_int xterm
rmmod nasmesh
sysctl -w net.ipv6.conf.all.accept_ra=0
sysctl -w net.ipv6.conf.all.forwarding=1
sysctl -w net.ipv6.conf.$CH2_EGRESS_ETHERNET_INTERFACE.accept_ra=0
sysctl -w net.ipv6.conf.$CH2_EGRESS_ETHERNET_INTERFACE.forwarding=1
sysctl -w net.ipv6.conf.$CH2_INGRESS_ETHERNET_INTERFACE.accept_ra=0
sysctl -w net.ipv6.conf.$CH2_INGRESS_ETHERNET_INTERFACE.forwarding=1
ifconfig $CH2_EGRESS_ETHERNET_INTERFACE down
ifconfig $CH2_INGRESS_ETHERNET_INTERFACE down
ifconfig $CH2_EGRESS_ETHERNET_INTERFACE up
ifconfig $CH2_INGRESS_ETHERNET_INTERFACE up
ip -6 addr add $CH2_IN6_ADDR_CN scope global dev $CH2_INGRESS_ETHERNET_INTERFACE
ip -6 route add $HOME_AGENT_NW via $HOME_AGENT_ADDR_CN_NO_MASK
ip -6 route add $CH1_IN6_NW via $CH1_IN6_ADDR_CN_NO_MASK
cd $OPENAIR2_DIR
insmod $OPENAIR2_DIR/NAS/DRIVER/MESH/nasmesh.ko nas_IMEI=0x22225678,0x02000000
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c0 -i0 -z0 -x $CH2_IN6_ADDR_NO_MASK -y ff02:0:0:0:0:0:0:1 -r 3
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c1 -i0 -z0 -x $CH2_IN6_ADDR_NO_MASK -y ff02:0:0:0:0:0:0:2 -r 3
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c2 -i0 -z0 -x $CH2_IN6_ADDR_NO_MASK -y ff02:0:0:0:0:0:0:3 -r 3
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c3 -i0 -z0 -x $CH2_IN6_ADDR_NO_MASK -y ff02:0:0:0:0:0:0:16 -r 3
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c4 -i0 -z0 -x $CH2_IN6_ADDR_NO_MASK -y $MR_IN6_ADDR2_NO_MASK -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c5 -i0 -z0 -x $CH2_IN6_ADDR_NO_MASK -y $MR_IN6_LLADDR2_NO_MASK -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c6 -i0 -z0 -s $CH2_IN_ADDR_NO_MASK -t $MR_IN_ADDR2_NO_MASK -r 12
ifconfig nasmesh0 up
ip -4 addr add $CH2_IN_ADDR broadcast $CH2_IN_BROADCAST_ADDR dev nasmesh0
ip -6 addr add $CH2_IN6_ADDR scope global dev nasmesh0
route add -net 224.0.0.0 netmask 240.0.0.0 dev $CH2_EGRESS_ETHERNET_INTERFACE
sleep 1
sudo rm -f /tmp/*socket*
cd $OPENAIR3_DIR/MESH/RRM/
xterm -T RRM -hold -e sh rrm_idromel.sh &
sleep 5
cd $OPENAIR2_DIR/SIMULATION/USER_TOOLS/LAYER2_SIM
./mac_sim_rrm -m1 -t ../../TOPOLOGIES/eth_2chs_1node.top &
sysctl -w net.ipv6.conf.nasmesh0.accept_ra=0
sysctl -w net.ipv6.conf.nasmesh0.forwarding=1
sleep 5
cp $RADVD_CONF_FILE /etc/radvd.conf
/etc/init.d/radvd start
127.0.0.1 localhost
127.0.1.1 handel
192.168.12.100 carne
2001:192:168:3:206:5bff:feb8:abba cn CN
2001:192:168:100::3 ar11 AR11
2001:192:168:200::2 ar12 AR12
2001:192:168:101::2 ar21 AR21
2001:192:168:201::2 ar22 AR22
2001:192:168:100::2 ha1 HA1
2001:192:168:101::2 ha2 HA2
2001:192:168:106::2 ha HA
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
2001:1::6 umts_ar
2001:2f0:110:6000::1 umts_ar_eth1
2001:1::7 wlan_ar
2001:2f0:110:7000::1 wlan_ar_eth1
2001:4::1 ha
2001:4::3 cn_ha
2001:4::20f:1fff:fe28:43e2 cn_coa
2001:4::4 mr mr_ha
2001:2f0:110:6000:201:2ff:fef5:aa4f mr_eth0
2001:2f0:110:7000:20e:cff:fea2:cbcc mr_eth2
2001:4:0:2::1 mr_nl
2001:4:0:2:20e:a5ff:fe3f:57c4 mr_nl_eth0
2001:4:0:2:218:8bff:feb0:50aa lfn_rd1
# /etc/nsswitch.conf
#
# Example configuration of GNU Name Service Switch functionality.
# If you have the `glibc-doc' and `info' packages installed, try:
# `info libc "Name Service Switch"' for information about this file.
passwd: nis files
group: nis files
shadow: nis files
hosts: nis files dns mdns
networks: files
protocols: db files
services: db files
ethers: db files
rpc: db files
netgroup: nis
interface nasmesh0
{
AdvSendAdvert on;
MaxRtrAdvInterval 3;
MinRtrAdvInterval 0.03;
MinDelayBetweenRAs 0.03;
AdvHomeAgentFlag off;
AdvHomeAgentInfo off;
AdvDefaultLifetime 360;
# prefix 2001:192:168:201::2/64
prefix 2001:2f0:110:7000::/64
{
AdvOnLink on;
AdvAutonomous on;
AdvRouterAddr on;
};
};
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
exit 0
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
exit 0
#!/bin/bash
# NEMO-SHO configuration for HA
WORKING_DIRECTORY=$OPENAIR3_DIR"/EXAMPLES/IDROMEL_DEMO_NEMO_MCOA_SHO/HA"
DATE=`date +"%Y_%b_%d.%HH%MMin"`
LOG_FILE=$WORKING_DIRECTORY"/log/ha_sho_"$DATE".log"
echo "enable forwarding:"
#Enable Forwarding
echo "1" >/proc/sys/net/ipv6/conf/all/forwarding
echo "1" >/proc/sys/net/ipv6/conf/eth0/forwarding
echo "1" >/proc/sys/net/ipv6/conf/eth1/forwarding
echo "0" >/proc/sys/net/ipv6/conf/all/accept_ra
echo "0" >/proc/sys/net/ipv6/conf/all/autoconf
echo "0" >/proc/sys/net/ipv6/conf/all/accept_redirects
echo "1" >/proc/sys/net/ipv6/conf/all/proxy_ndp
#MRLLADDR=fe80::20a:5eff:fe45:f14d
killall mip6d tee radvd
ip6tables -F
ip tunnel del ip6tnl1
ip tunnel del ip6tnl2
echo "set ipv6 @ on interfaces:"
#Set IPv6 addresses on two IFs
#ifconfig eth0 inet add 192.168.2.1 netmask 255.255.255.0
ip -6 addr add 2001:4::1/64 scope global dev eth0
ip -6 addr add 2001:1::1/64 scope global dev eth1
echo "adding routes:"
# UMTS-AR
ip -6 route add 2001:2f0:110:6000::/64 via 2001:1::6
# WLAN-AR
ip -6 route add 2001:2f0:110:7000::/64 via 2001:1::7
echo "restarting radvd:"
/etc/init.d/radvd stop
/etc/init.d/radvd start
echo "sleep 3 seconds"
sleep 3
echo "starting mip6d:"
mip6d -c $WORKING_DIRECTORY/etc/ha_mcoa_sho.conf 2>&1 | tee $LOG_FILE &
tcpdump -s 256 -i eth0 -v -w $WORKING_DIRECTORY"/log/ha_sho_tcpdump_eth0_"$DATE".log" &
tcpdump -s 256 -i eth1 -v -w $WORKING_DIRECTORY"/log/ha_sho_tcpdump_eth1_"$DATE".log" &
echo "sleep 1 hour (type Ctrl+C to end)"
sleep 3600
#!/bin/sh
# transfered from HA
IF_UMTS=eth0
IF_WLAN=eth2
./waitfortime $1
#Make-Before-Break HO
#sleep 8
#ifconfig $IF_WLAN up
#ifconfig $IF_UMTS up
#SHO(UPWARD)
sleep 3
ifconfig $IF_WLAN up
sleep 10
ifconfig $IF_UMTS down
sleep 10
ifconfig $IF_UMTS up
sleep 10
ifconfig $IF_WLAN down
sleep 10
ifconfig $IF_WLAN up
sleep 10
ifconfig $IF_UMTS down
#SHO(DOWNWARD)
#sleep 3
#ifconfig $IF_UMTS up
#sleep 11
#ifconfig $IF_WLAN down
#!/bin/sh
# transfered from HA
PID_TCPDUMP=`ps -A|grep tcpdump|cut -c1-5`
kill -9 $PID_TCPDUMP
#!/bin/sh
# transfered from HA
PID_TCPDUMP=`ps -A|grep tcpdump|cut -c1-5`
PID_IPERF=`ps -A|grep iperf|cut -c1-5`
kill -9 $PID_TCPDUMP
kill -9 $PID_IPERF
#!/bin/sh
TIME=`date +%R`
HOUR=${TIME%:*}
MIN=${TIME#*:}
FOLDER="log`date +%Y``date +%m``date +%d`_$HOUR$MIN"
CN=cn
LFN=lfn_rd1
MR=mr
UMTSAR=umts_ar
WLANAR=wlan_ar
LOG_LFN=logLFN.log
LOG_CN=logCN.log
LOG_HA_TMP=/var/log/kernel/info
LOG_HA=logHA.log
LOG_MR_TMP=/var/log/kmessages
LOG_MR=logMR.log
LOG_3GAR="log3G.log"
LOG_WLANAR="logWLAN.log"
CN_DIR="/opt/TESTBED_NEMO_MCOA_SHO/log"
LFN_DIR="/opt/TESTBED_NEMO_MCOA_SHO/log"
MR_DIR="/opt/TESTBED_NEMO_MCOA_SHO/log"
AR_DIR="/opt/TESTBED_NEMO_MCOA_SHO/log"
SCRIPT_LFN="deinitLFN.sh"
SCRIPT_CN="deinitCN.sh"
PRESCRIPT_AR="initAR.sh"
CMD_LFN="cd $LFN_DIR;sh $SCRIPT_LFN"
CMD_CN="cd $CN_DIR;sh $SCRIPT_CN"
CMD_MR="cd $MR_DIR;at -f $SCRIPT_MR $START_TIME"
PRECMD_AR="cd $AR_DIR;sh $PRESCRIPT_AR"
# on HA
PID_TCPDUMP=`ps -A|grep tcpdump|cut -c1-5`
kill -9 $PID_TCPDUMP
# on CN
scp -26 root@$CN:$CN_DIR/$LOG_CN $LOG_CN
scp -26 $SCRIPT_CN root@$CN:$CN_DIR/.
ssh -26 -l root $CN $CMD_CN
scp -26 root@$CN:$CN_DIR/"logCNtcpdump.log" .
# on ARs
ssh -26 -l root $WLANAR $PRECMD_AR
ssh -26 -l root $UMTSAR $PRECMD_AR
scp -26 root@$UMTSAR:$AR_DIR/$LOG_3GAR $LOG_3GAR
scp -26 root@$WLANAR:$AR_DIR/$LOG_WLANAR $LOG_WLANAR
# on LFN
scp -26 $SCRIPT_LFN root@$LFN:$LFN_DIR/.
ssh -26 -l root $LFN $CMD_LFN
scp -26 root@$LFN:$LFN_DIR/$LOG_LFN $LOG_LFN
scp -26 root@$LFN:$LFN_DIR/"logLFNtcpdump.log" .
# on MR
scp -26 root@$MR:$LOG_MR_TMP $LOG_MR
#rename
mkdir $FOLDER
mv $LOG_CN ./$FOLDER/$LOG_CN
mv $LOG_LFN ./$FOLDER/$LOG_LFN
mv "logLFNtcpdump.log" ./$FOLDER/.
mv $LOG_HA_TMP ./$FOLDER/$LOG_HA
mv $LOG_MR ./$FOLDER/$LOG_MR
mv "logHAtcpdump.log" ./$FOLDER/.
mv $LOG_3GAR ./$FOLDER/.
mv $LOG_WLANAR ./$FOLDER/.
mv "logCNtcpdump.log" ./$FOLDER/.
#!/bin/sh
# transfered from HA
ntpdate -b 2001:1::1
OUTBOUNDIF=eth0
INBOUNDIF=eth1
tc qdisc change dev $INBOUNDIF root netem loss 0%
tc qdisc change dev $OUTBOUNDIF root netem loss 0%
#!/bin/sh
# transfered from HA
OUTGOINGIF=eth1
LOGFILE=logHAtcpdump.log
tcpdump -i $OUTGOINGIF -w $LOGFILE -s 1500 &
#!/bin/bash
KERNEL_LOGMR=/var/log/kmessages
if [ -f $KERNEL_LOGMR ] ; then
rm $KERNEL_LOGMR
fi
/etc/init.d/sysklogd restart
ntpdate -b 2001:4::1
#!/bin/sh
# transfered from HA
#DOWNWARD HO
#ER_START="30.0"
#ER_END="1"
#UPWARD HO
ER_START="10"
ER_END="30"
###############
OUTBOUNDIF=eth0
INBOUNDIF=eth1
LOG_AR="log3G.log"
DURATION=10000
TIMESLICE=100
#LGtc qdisc change dev $INBOUNDIF root netem loss $ER_START%
#LGtc qdisc change dev $OUTBOUNDIF root netem loss $ER_START%
#LG./waitfortime $1
TIMESECOND=`date +%s`
TIMENANO=`date +%N`
echo $TIMESECOND.$TIMENANO $ER_START > $LOG_AR
sleep 5
#./radio_emulation $OUTBOUNDIF $ER_START $ER_END $INBOUNDIF $ER_START $ER_END $DURATION $TIMESLICE >> $LOG_AR
sleep 5
TIMESECOND=`date +%s`
TIMENANO=`date +%N`
echo $TIMESECOND.$TIMENANO $ER_END >> $LOG_AR
exit 0
#!/bin/sh
# transfered from HA
#DOWNWARD HO
#ER_START="0.004"
#ER_END="0.016"
#UPWARD HO
ER_START="0.014"
ER_END="0.004"
###############
OUTBOUNDIF=eth1
INBOUNDIF=eth0
LOG_AR="logWLAN.log"
DURATION=10000
TIMESLICE=100
#tc qdisc change dev $INBOUNDIF root netem loss $ER_START%
#tc qdisc change dev $OUTBOUNDIF root netem loss $ER_START%
pwd
./waitfortime $1
TIMESECOND=`date +%s`
TIMENANO=`date +%N`
echo $TIMESECOND.$TIMENANO $ER_START > $LOG_AR
sleep 5
#./radio_emulation $OUTBOUNDIF $ER_START $ER_END $INBOUNDIF $ER_START $ER_END $DURATION $TIMESLICE >> $LOG_AR
sleep 5
TIMESECOND=`date +%s`
TIMENANO=`date +%N`
echo $TIMESECOND.$TIMENANO $ER_END >> $LOG_AR
exit 0
#!/bin/bash
date +%s
START_TIME=`date +%s`
START_TIME=`expr $START_TIME + 30`
CN=cn
LFN=lfn_rd1
MR=mr
UMTSAR=umts_ar
WLANAR=wlan_ar
START_CN="tcp_send.sh"
#START_CN="tcp_send_CBR.sh"
INIT1_LFN="tcp_recv.sh"
INIT2_LFN="tcp_recv_dump.sh"
INIT_MR="initMR.sh"
SCRIPT_MR="HOtrigger.sh"
INIT_HA="initHA.sh"
INIT_AR="initAR.sh"
RADIOCONFIG_UMTSAR="radioconfig_3G.sh"
RADIOCONFIG_WLANAR="radioconfig_WLAN.sh"
echo "START TIME=$START_TIME"
echo "set variables"
CN_DIR="/opt/TESTBED_NEMO_MCOA_SHO/bin"
LFN_DIR="/opt/TESTBED_NEMO_MCOA_SHO/bin"
MR_DIR="/opt/TESTBED_NEMO_MCOA_SHO/bin"
AR_DIR="/opt/TESTBED_NEMO_MCOA_SHO/bin"
CMD_CN="cd $CN_DIR && sh $START_CN $START_TIME $LFN"
CMD_MR="cd $MR_DIR;sh $SCRIPT_MR $START_TIME"
PRECMD_MR="cd $MR_DIR;sh $INIT_MR"
CMD1_LFN="cd $LFN_DIR;sh $INIT1_LFN"
CMD2_LFN="cd $LFN_DIR;sh $INIT2_LFN"
PRECMD_AR="cd $AR_DIR;sh $INIT_AR"
CMD_UMTSAR="cd $AR_DIR;sh $RADIOCONFIG_UMTSAR $START_TIME"
CMD_WLANAR="cd $AR_DIR && sh $RADIOCONFIG_WLANAR $START_TIME"
KERNEL_LOGHA=/var/log/kernel/info
#start measurements
echo "-----Start Measurement"
# on HA
echo "on HA"
if [ -f $KERNEL_LOGHA ] ; then
rm /var/log/kernel/info
fi
/etc/init.d/sysklogd restart
sh $INIT_HA
#on ARs
echo "on ARs"
ssh -l root $WLANAR $PRECMD_AR
ssh -l root $UMTSAR $PRECMD_AR
ssh -f -l root $UMTSAR $CMD_UMTSAR
ssh -f -l root $WLANAR $CMD_WLANAR
#on CN
echo "on CN"
ssh -f -l root $CN $CMD_CN
#on MR
echo "on MR"
ssh -l root $MR $PRECMD_MR
ssh -f -l root $MR $CMD_MR
#on LFN
echo "on LFN"
ssh -f -l root $LFN $CMD1_LFN
ssh -f -l root $LFN $CMD2_LFN
echo "starting measurements on $1"
#!/bin/bash
CN=cn_ha
LFN=lfn_rd1
MR=mr
UMTSAR=umts_ar
WLANAR=wlan_ar
START_CN="tcp_send.sh"
#START_CN="tcp_send_CBR.sh"
INIT1_LFN="tcp_recv.sh"
INIT2_LFN="tcp_recv_dump.sh"
INIT_MR="initMR.sh"
INIT_HA="initHA.sh"
INIT_AR="initAR.sh"
WAIT_FOR_TIME="waitfortime"
SCRIPT_MR="HOtrigger.sh"
RADIOCONFIG_UMTSAR="radioconfig_3G.sh"
RADIOCONFIG_WLANAR="radioconfig_WLAN.sh"
echo "set variables"
#CN_DIR="/opt/TESTBED_NEMO_MCOA_SHO"
CN_DIR="/opt/TESTBED_NEMO_MCOA_SHO/bin"
#LFN_DIR="/opt/TESTBED_NEMO_MCOA_SHO"
LFN_DIR="/opt/TESTBED_NEMO_MCOA_SHO/bin"
#MR_DIR="/opt/TESTBED_NEMO_MCOA_SHO"
MR_DIR="/opt/TESTBED_NEMO_MCOA_SHO/bin"
#AR_DIR="/opt/TESTBED_NEMO_MCOA_SHO"
AR_DIR="/opt/TESTBED_NEMO_MCOA_SHO/bin"
CMD1_AR="tc qdisc change dev eth0 root netem loss 0%"
CMD2_AR="tc qdisc change dev eth1 root netem loss 0%"
#preparation
echo "-----Preparation"
echo "-----Changing Radio Emulation Settings on 3G_AR"
ssh -l root $UMTSAR $CMD1_AR
ssh -l root $UMTSAR $CMD2_AR
echo "-----Changing Radio Emulation Settings on WLAN_AR"
ssh -l root $WLANAR $CMD1_AR
ssh -l root $WLANAR $CMD2_AR
# on CN
echo "-----copying file to CN"
scp $WAIT_FOR_TIME root@$CN:$CN_DIR
scp $START_CN root@$CN:$CN_DIR
# on AR1
echo "-----copying file to ARs"
scp $WAIT_FOR_TIME root@$UMTSAR:$AR_DIR
scp $WAIT_FOR_TIME root@$WLANAR:$AR_DIR
scp $RADIOCONFIG_UMTSAR root@$UMTSAR:$AR_DIR
scp $RADIOCONFIG_WLANAR root@$WLANAR:$AR_DIR
scp $INIT_AR root@$UMTSAR:$AR_DIR
scp $INIT_AR root@$WLANAR:$AR_DIR
# on MR
echo "-----copying file to MR"
scp $WAIT_FOR_TIME root@$MR:$MR_DIR
scp $SCRIPT_MR root@$MR:$MR_DIR
scp $INIT_MR root@$MR:$MR_DIR
# on LFN
echo "-----copying file to LFN"
scp $WAIT_FOR_TIME root@$LFN:$LFN_DIR
scp $INIT1_LFN root@$LFN:$LFN_DIR
scp $INIT2_LFN root@$LFN:$LFN_DIR
echo "-----Preparation was done"
#!/bin/sh
# transfered from HA
BASELOG=logLFN.log
ntpdate -b 2001:4::1 > /dev/null
iperf -V -s -i 1 >$BASELOG
exit 0
#!/bin/sh
# transfered from HA
BASELOG=logLFNtcpdump.log
tcpdump -i eth0 -w $BASELOG -s 1500 > /dev/null
exit 0
#!/bin/sh
# transfered from HA
LOGFILE=logCN.log
TCPDUMPLOG=logCNtcpdump.log
WAITTIME=5
DURATION=60
tcpdump -i eth0 -w $TCPDUMPLOG -s 1500 > /dev/null &
echo "start" > $LOGFILE
date -R >> $LOGFILE
netstat -s|grep retrans >> $LOGFILE
ntpdate -b 2001:4::1 > /dev/null
./waitfortime $1
#WARNING
#iperf -V -c $2 -t $DURATION > /dev/null
netstat -s|grep retrans >> $LOGFILE
sleep $WAITTIME
echo "end" >> $LOGFILE
exit 0
#!/bin/sh
# transfered from HA
LOGFILE=logCN.log
TCPDUMPLOG=logCNtcpdump.log
WAITTIME=5
DURATION=20
BITRATE=128000
tcpdump -i eth0 -w $TCPDUMPLOG -s 1500 > /dev/null &
echo "start" > $LOGFILE
date -R >> $LOGFILE
netstat -s|grep retrans >> $LOGFILE
ntpdate -b 2001:4::1 > /dev/null
./waitfortime $1
iperf_CBR -V -c $2 -t $DURATION -g $BITRATE> /dev/null
netstat -s|grep retrans >> $LOGFILE
sleep $WAITTIME
echo "end" >> $LOGFILE
exit 0
#include <sys/socket.h>
#include <sys/time.h>
#include <signal.h>
#include <netinet/in.h>
#include <netinet/ip6.h>
#include <netinet/icmp6.h>
#include <netdb.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
#include <stdio.h>
#include <argp.h>
#include <ctype.h>
#include <errno.h>
#include <limits.h>
#define MSTOUS 1000000
int main (int argc, char **argv)
{
fd_set fdset;
int fdmax;
struct timeval timeout;
struct timeval last, intvl, now;
struct timeval *t = NULL;
long target_time;
fdmax = 1;
intvl.tv_sec = 0;
intvl.tv_usec = 1000;
if (argc != 2) {
printf("waitfortime time(in sec)\n");
return -1;
}
target_time = atol(argv[1]);
gettimeofday (&last, NULL);
if (last.tv_sec >= target_time) {
return -1;
} else while (last.tv_sec != target_time) {
int n;
FD_ZERO (&fdset);
gettimeofday (&now, NULL);
timeout.tv_sec = last.tv_sec + intvl.tv_sec - now.tv_sec;
timeout.tv_usec = last.tv_usec + intvl.tv_usec - now.tv_usec;
while (timeout.tv_usec < 0) {
timeout.tv_usec += 1000000;
timeout.tv_sec--;
}
while (timeout.tv_usec >= 1000000) {
timeout.tv_usec -= 1000000;
timeout.tv_sec++;
}
if (timeout.tv_sec < 0)
timeout.tv_sec = timeout.tv_usec = 0;
n = select (fdmax, &fdset, NULL, NULL, &timeout);
if (n < 0) {
perror ("select");
continue;
} else if (n == 1) {
break;
} else {
gettimeofday (&last, NULL);
}
}
return 0;
}
# This is an example of nemod NEMO enabled Home Agent configuration file
NodeConfig HA;
## If set to > 0, will not detach from tty
DebugLevel 10;
## List of interfaces where we serve as Home Agent
Interface "eth0";
HaAcceptMobRtr enabled;
HaAcceptMCoAReg enabled;
HaServedPrefix 2001:4::/64;
#DefaultBindingAclPolicy allow;
DefaultBindingAclPolicy deny;
#BindingAclPolicy 2001:4::230:1bff:feaf:3203 (2001:4:0:1::/64) MCoAReg allow;
#BindingAclPolicy 2001:4::2d0:59ff:fef8:2ed1 (2001:4:0:2::/64) MCoAReg allow;
BindingAclPolicy 2001:4::2 MCoAReg allow;
BindingAclPolicy 2001:4::3 MCoAReg allow;
BindingAclPolicy 2001:4::4 (2001:4:0:2::/64) MCoAReg allow;
##
## IPsec configuration
##
#UseMnHaIPsec enabled;
UseMnHaIPsec disabled;
## Key Management Mobility Capability
KeyMngMobCapability disabled;
# This is an example of nemod NEMO enabled Home Agent configuration file
NodeConfig HA;
## If set to > 0, will not detach from tty
DebugLevel 10;
## List of interfaces where we serve as Home Agent
Interface "eth0";
HaAcceptMobRtr enabled;
HaAcceptMCoAReg enabled;
HaServedPrefix 2001:4::/64;
#DefaultBindingAclPolicy allow;
DefaultBindingAclPolicy deny;
#BindingAclPolicy 2001:4::230:1bff:feaf:3203 (2001:4:0:1::/64) MCoAReg allow;
#BindingAclPolicy 2001:4::2d0:59ff:fef8:2ed1 (2001:4:0:2::/64) MCoAReg allow;
BindingAclPolicy 2001:4::2 MCoAReg allow;
BindingAclPolicy 2001:4::3 MCoAReg allow;
BindingAclPolicy 2001:4::4 (2001:4:0:2::/64) MCoAReg allow;
##
## IPsec configuration
##
#UseMnHaIPsec enabled;
UseMnHaIPsec disabled;
## Key Management Mobility Capability
KeyMngMobCapability disabled;
127.0.0.1 localhost
127.0.1.1 knoppal
#2001:192:168:3:206:5bff:feb8:abba cn CN
#2001:192:168:100::3 ar11 AR11
#2001:192:168:200::2 ar12 AR12
#2001:192:168:101::2 ar21 AR21
#2001:192:168:201::2 ar22 AR22
#2001:192:168:100::2 ha1 HA1
#2001:192:168:101::2 ha2 HA2
#2001:192:168:106::2 ha HA
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
2001:1::6 umts_ar
2001:2f0:110:6000::1 umts_ar_eth1
2001:1::7 wlan_ar
2001:2f0:110:7000::1 wlan_ar_eth1
2001:4::1 ha
2001:4::3 cn_ha
2001:4::20f:1fff:fe28:43e2 cn_coa cn
2001:4::4 mr mr_ha
2001:2f0:110:6000:201:2ff:fef5:aa4f mr_eth0
2001:2f0:110:7000:20e:cff:fea2:cbcc mr_eth2
2001:4:0:2::1 mr_nl
2001:4:0:2:20e:a5ff:fe3f:57c4 mr_nl_eth0
2001:4:0:2:218:8bff:feb0:50aa lfn_rd1
auto lo
iface lo inet loopback
iface eth1 inet static
address 192.168.1.1
netmask 255.255.255.0
auto eth1
iface eth2 inet static
address 192.168.100.2
netmask 255.255.255.0
iface eth0 inet static
address 192.168.2.1
netmask 255.255.255.0
iface eth3 inet static
address 192.168.12.144
netmask 255.255.255.0
gateway 192.168.12.100
auto eth3
auto eth2
auto eth0
# This is an example of mip6d Mobile Node configuration file
NodeConfig MN;
## If set to > 0, will not detach from tty
DebugLevel 10;
## Support route optimization with other MNs
DoRouteOptimizationCN disabled;
## Use route optimization with CNs
DoRouteOptimizationMN disabled;
UseCnBuAck disabled;
Interface "eth0" {
Bid 100;
BidPriority 1;
Reliable true;
}
Interface "eth2" {
Bid 200;
BidPriority 1;
Reliable false;
}
MnRouterProbes 1;
MnHomeLink "eth0" {
IsMobRtr enabled;
MnUseSHO enabled;
# MnUseSHO disabled;
# MnUseAdaptiveCombining enabled;
MnUseAdaptiveCombining disabled;
HomeAgentAddress 2001:4::1;
HomeAddress 2001:4::4/64 (2001:4:0:2::/64);
RegMultipleCoA enabled;
IfMultipleCoA "eth0", "eth2";
# proto type code route opt.
# MnRoPolicy ICMP 129 0 enabled;
# MnRoPolicy ICMP any any disabled;
# proto dst src route opt.
# MnRoPolicy TCP 80 any enabled;
# MnRoPolicy TCP any any disabled;
}
##
## IPsec configuration
##
UseMnHaIPsec disabled;
## Key Management Mobility Capability
KeyMngMobCapability disabled;
IPsecPolicySet {
HomeAgentAddress 3ffe:2620:6:1::1;
HomeAddress 3ffe:2620:6:1::1234/64;
IPsecPolicy HomeRegBinding UseESP;
IPsecPolicy MobPfxDisc UseESP;
IPsecPolicy TunnelMh UseESP;
}
# /etc/nsswitch.conf
#
# Example configuration of GNU Name Service Switch functionality.
# If you have the `glibc-doc' and `info' packages installed, try:
# `info libc "Name Service Switch"' for information about this file.
passwd: nis files
group: nis files
shadow: nis files
hosts: nis files dns mdns
networks: files
protocols: db files
services: db files
ethers: db files
rpc: db files
netgroup: nis
# /etc/ntp.conf, configuration for ntpd
driftfile /var/lib/ntp/ntp.drift
# Enable this if you want statistics to be logged.
#statsdir /var/log/ntpstats/
statistics loopstats peerstats clockstats
filegen loopstats file loopstats type day enable
filegen peerstats file peerstats type day enable
filegen clockstats file clockstats type day enable
# You do need to talk to an NTP server or two (or three).
server ntp.ubuntu.com
# By default, exchange time with everybody, but don't allow configuration.
# See /usr/share/doc/ntp-doc/html/accopt.html for details.
restrict -4 default kod notrap nomodify nopeer noquery
restrict -6 default kod notrap nomodify nopeer noquery
# Local users may interrogate the ntp server more closely.
restrict 127.0.0.1
restrict ::1
# Clients from this (example!) subnet have unlimited access,
# but only if cryptographically authenticated
#restrict 192.168.123.0 mask 255.255.255.0 notrust
# If you want to provide time to your local subnet, change the next line.
# (Again, the address is an example only.)
#broadcast 192.168.123.255
# If you want to listen to time broadcasts on your local subnet,
# de-comment the next lines. Please do this only if you trust everybody
# on the network!
#disable auth
#broadcastclient
interface eth0
{
AdvSendAdvert on;
MaxRtrAdvInterval 4;
MinRtrAdvInterval 1;
AdvHomeAgentFlag on;
prefix 2001:4::/64
{
AdvOnLink on;
AdvAutonomous on;
AdvRouterAddr on;
};
};
interface eth1
{
AdvSendAdvert on;
MaxRtrAdvInterval 4;
MinRtrAdvInterval 1;
AdvHomeAgentFlag off;
prefix 2001:1::/64
{
AdvOnLink on;
AdvAutonomous on;
AdvRouterAddr on;
};
};
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
exit 0
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
#CN ROLE FOR SHO
sysctl -w net.ipv6.conf.all.accept_ra=1
sysctl -w net.ipv6.conf.eth0.accept_ra=1
sysctl -w net.ipv6.conf.all.forwarding=0
ifconfig eth0 down
ifconfig eth0 up
echo "0" > /proc/sys/net/ipv4/tcp_window_scaling
ifconfig eth0 mtu 1380
ifconfig eth0 add 2001:4::3/64
exit 0
#!/bin/sh
# transfered from HA
IF_UMTS=eth0
IF_WLAN=eth2
./waitfortime $1
#Make-Before-Break HO
#sleep 8
#ifconfig $IF_WLAN up
#ifconfig $IF_UMTS up
#SHO(UPWARD)
sleep 3
ifconfig $IF_WLAN up
sleep 10
ifconfig $IF_UMTS down
sleep 10
ifconfig $IF_UMTS up
sleep 10
ifconfig $IF_WLAN down
sleep 10
ifconfig $IF_WLAN up
sleep 10
ifconfig $IF_UMTS down
#SHO(DOWNWARD)
#sleep 3
#ifconfig $IF_UMTS up
#sleep 11
#ifconfig $IF_WLAN down
#!/bin/bash
KERNEL_LOGMR=/var/log/kmessages
if [ -f $KERNEL_LOGMR ] ; then
rm $KERNEL_LOGMR
fi
/etc/init.d/sysklogd restart
ntpdate -b 2001:4::1
#/bin/bash
# File : ip_config_mr_sho.sh
# Authors
# Lionel Gauthier
# Philippe Foubert
# V1 2009 Fev 06
DATE=`date +"%Y_%b_%d.%HH%MMin"`
LOG_FILE="/opt/TESTBED_NEMO_MCOA_SHO/log/mr_sho_"$DATE".log"
IF0=eth0
IF1=eth1
IF2=eth2
NEMOD=`which mip6d`
echo "Stopping radvd service"
/etc/init.d/radvd stop
echo "Shutting down all ethx interfaces"
ifconfig $IF0 down
ifconfig $IF1 down
ifconfig $IF2 down
echo "Flushing ip6tables"
ip6tables -F
sysctl -w net.ipv6.conf.all.accept_ra=0
sysctl -w net.ipv6.conf.all.forwarding=1
echo "Bringing up eth0, eth1"
ifconfig $IF0 up
ifconfig $IF1 up
#ifconfig $IF2 up
echo "Configuring address on NEMO link"
ip -6 addr add 2001:4:0:2::1/64 dev $IF1
echo "Starting radvd service"
/etc/init.d/radvd start
echo "Sleep 3 seconds"
sleep 3
echo "Lauching tcpdump s on all interfaces logs are in /opt/TESTBED_NEMO_MCOA_SHO/log folder"
tcpdump -s 256 -i eth1 -v -w "/opt/TESTBED_NEMO_MCOA_SHO/log/mr_tcpdump_eth1_"$DATE".log" &
tcpdump -s 256 -i eth2 -v -w "/opt/TESTBED_NEMO_MCOA_SHO/log/mr_tcpdump_eth2_"$DATE".log" &
tcpdump -s 256 -i eth0 -v -w "/opt/TESTBED_NEMO_MCOA_SHO/log/mr_tcpdump_eth0_"$DATE".log" &
echo "Starting NEMO daemon logfile is $LOG_FILE"
$NEMOD -c /opt/TESTBED_NEMO_MCOA_SHO/etc/mr_mcoa_sho.conf 2>&1 | tee $LOG_FILE &
sleep 20
#ip6tables -A PREROUTING -t mangle -p icmpv6 --destination 2001:2f0:110:6000::1 -j MARK --set-mark 100
#ip6tables -A PREROUTING -t mangle -p icmpv6 --destination 2001:2f0:110:7000::1 -j MARK --set-mark 200
#ip6tables -A PREROUTING -t mangle --destination 2001:2f0:110:6000::1 -j MARK --set-mark 100
#ip6tables -A PREROUTING -t mangle --destination 2001:2f0:110:7000::1 -j MARK --set-mark 200
#ip6tables -A PREROUTING -t mangle --destination 2001:2f0:110:6000::1 -j MARK --set-mark 100
#ip6tables -A PREROUTING -t mangle --destination 2001:2f0:110:7000::1 -j MARK --set-mark 200
echo '\n\n####################################################'
echo '# PACKETS ARE MARKED NOW YOU CAN START TRAFFIC #\n'
echo '####################################################\n\n'
echo "sleep 1 hour (type ctrl+C to end)"
sleep 3600
#killall tcpdump
#tc qdisc add dev eth0 root netem loss 0%
#tc qdisc add dev eth1 root netem loss 0%
MR_IN_ADDR=10.0.1.3
MR_IN_ADDR2=10.0.2.3
MR_IN6_ADDR1=2001:2f0:110:6000:3d6:5200:300:1
MR_IN6_ADDR2=2001:2f0:110:7000:3d6:5200:300:2
CH1_IN_ADDR=10.0.1.1
CH2_IN_ADDR=10.0.2.2
CH1_IN6_ADDR=2001:2f0:110:6000::1
CH1_IN6_LLADDR=fe80::3d6:5200:100:1
CH2_IN6_ADDR=2001:2f0:110:7000::1
CH2_IN6_LLADDR=fe80::3d6:4200:200:1
LFN_IN_ADDR=192.168.2.222
LFN_IN6_ADDR=2001:4:0:2:211:43ff:fe6f:66e1
#/bin/bash
# File : ip_config_mr_sho.sh
# Authors
# Lionel Gauthier
# Philippe Foubert
# V1 2009 Fev 06
######################################################################
DEMO_DIR=$OPENAIR3_DIR"/EXAMPLES/IDROMEL_DEMO_NEMO_MCOA_SHO/MR"
DATE=`date +"%Y_%b_%d.%HH%MMin"`
LOG_FILE=$DEMO_DIR"/log/mr_sho_"$DATE".log"
IF0=eth0
IF1=eth1
IF2=eth2
NEMOD=`which mip6d`
source $DEMO_DIR"/bin/params.sh"
######################################################################
black='\E[30m'
red='\E[31m'
green='\E[32m'
yellow='\E[33m'
blue='\E[34m'
magenta='\E[35m'
cyan='\E[36m'
white='\E[37m'
check_ch1 ()
{
#check ipv4 connectivity
echo_warning "CHECKING IPV4/nasmesh0 CH1"
lskdfto 2>/dev/null
while [ $? -ne 0 ]; do
ping -c 2 $CH1_IN_ADDR
done
echo_success "CH1 IPV4 CONNECTIVITY OK"
#check ipv6 connectivity
echo_warning "CHECKING IPV6/nasmesh0 CH1"
lskdfto 2>/dev/null
while [ $? -ne 0 ]; do
ping6 -I nasmesh0 -c 2 $CH1_IN6_LLADDR
done
echo_success "CH1 IPV6 CONNECTIVITY OK"
}
check_ch2 ()
{
#check ipv4 connectivity
echo_warning "CHECKING IPV4/nasmesh1 CH2"
lskdfto 2>/dev/null
while [ $? -ne 0 ]; do
ping -c 2 $CH2_IN_ADDR
done
echo_success "CH2 IPV4 CONNECTIVITY OK"
#check ipv6 connectivity
echo_warning "CHECKING IPV6/nasmesh1 CH2"
lskdfto 2>/dev/null
while [ $? -ne 0 ]; do
ping6 -I nasmesh1 -c 2 $CH2_IN6_LLADDR
done
echo_success "CH2 IPV6 CONNECTIVITY OK"
}
check_lfn ()
{
#check ipv4 connectivity
echo_warning "CHECKING IPV4 LFN"
lskdfto 2>/dev/null
while [ $? -ne 0 ]; do
ping -c 2 $LFN_IN_ADDR
done
echo_success "LFN IPV4 CONNECTIVITY OK"
#check ipv6 connectivity
echo_warning "CHECKING IPV6 LFN"
lskdfto 2>/dev/null
while [ $? -ne 0 ]; do
ping6 -c 2 $LFN_IN6_ADDR
done
echo_success "LFN IPV6 CONNECTIVITY OK"
}
######################################################################
cecho() # Color-echo
# arg1 = message
# arg2 = color
{
local default_msg="No Message."
message=${1:-$default_msg}
color=${2:-$black}
echo -e "$color"
echo -n "$message"
tput sgr0
echo
return
}
echo_error() {
local my_string=""
until [ -z "$1" ]
do
my_string="$my_string$1"
shift
done
cecho "$my_string" $red
}
echo_warning() {
local my_string=""
until [ -z "$1" ]
do
my_string="$my_string$1"
shift
done
cecho "$my_string" $yellow
}
echo_success() {
local my_string=""
until [ -z "$1" ]
do
my_string="$my_string$1"
shift
done
cecho "$my_string" $green
}
isanumber () {
echo $1 | egrep "^[0-9]+$" > /dev/null 2>&1
if [ "$?" -eq "0" ]; then
# The grep found only 0-9, so it's an integer. We can safely do a test on it.
return 0
else
# If the grep found something other than 0-9, then it's not an integer.
return 2
fi
}
wait_process_started () {
if [ -z "$1" ]
then
echo_error "WAITING FOR PROCESS START: NO PROCESS"
return 1
fi
while [ `ps -C $1` -neq 0 ]; do
echo_warning "WAITING FOR $1 START"
sleep 2
done
echo_success "PROCESS $1 STARTED"
return 0
}
######################################################################
echo_warning "Stopping radvd service"
/etc/init.d/radvd stop
#/etc/init.d/radvd start
#sleep 2
#/etc/init.d/radvd stop
echo_warning "Shutting down all ethx interfaces"
ip link set $IF0 down
ip link set $IF1 down
ip link set $IF2 down
echo_warning "Flushing ip6tables"
ip6tables -F
sysctl -w net.ipv6.conf.all.accept_ra=0
sysctl -w net.ipv6.conf.all.forwarding=1
echo_warning "Bringing up eth0, eth1"
ip link set $IF0 up
ip link set $IF1 up
ip link set $IF2 up
echo_warning "Configuring address on NEMO link"
ip -6 addr add 2001:4:0:2::1/64 scope global dev $IF1
######################################################################
killall -q mac_sim_rrm rrm emul_int xterm
cd $OPENAIR2_DIR
sudo rmmod nasmesh
sudo insmod $OPENAIR2_DIR/NAS/DRIVER/MESH/nasmesh_mr.ko nas_IMEI=0x12345678,0x03000000
echo_warning "Classification rule for DTCH-Broadcast -reception of Router Advertisement"
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c0 -i0 -z0 -x ff02::1 -y ff02:0:0:0:0:0:0:1 -r 3 > /dev/null
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c1 -i0 -z0 -x ff02::2 -y ff02:0:0:0:0:0:0:2 -r 3 > /dev/null
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c2 -i0 -z0 -x ff02::3 -y ff02:0:0:0:0:0:0:3 -r 3 > /dev/null
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c3 -i0 -z0 -x $MR_IN6_ADDR1 -y 2001:2f0:110:6000:0:0:0:1 -r 4 > /dev/null
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c4 -i0 -z0 -x $MR_IN6_ADDR1 -y 2001:1:0:0:0:0:0:6 -r 4 > /dev/null
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c5 -i0 -z0 -x $MR_IN6_ADDR1 -y 2001:4:0:0:0:0:0:1 -r 4 > /dev/null
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c6 -i0 -z0 -x $MR_IN6_ADDR1 -y fe80:0:0:0:3d6:5200:100:1 -r 4 > /dev/null
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c7 -i0 -z0 -s $MR_IN_ADDR -t $CH1_IN_ADDR -r 4 > /dev/null
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c8 -i1 -z0 -x ff02::1 -y ff02:0:0:0:0:0:0:1 -r 11 > /dev/null
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c9 -i1 -z0 -x ff02::2 -y ff02:0:0:0:0:0:0:2 -r 11 > /dev/null
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c10 -i1 -z0 -x ff02::3 -y ff02:0:0:0:0:0:0:3 -r 11 > /dev/null
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c11 -i1 -z0 -x $MR_IN6_ADDR2 -y 2001:2f0:110:7000:0:0:0:1 -r 12 > /dev/null
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c12 -i1 -z0 -x $MR_IN6_ADDR2 -y 2001:1:0:0:0:0:0:7 -r 12 > /dev/null
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c13 -i1 -z0 -x $MR_IN6_ADDR2 -y 2001:4:0:0:0:0:0:1 -r 12 > /dev/null
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c14 -i1 -z0 -x $MR_IN6_ADDR2 -y fe80:0:0:0:3d6:4200:200:1 -r 12 > /dev/null
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c15 -i1 -z0 -s $MR_IN_ADDR2 -t $CH2_IN_ADDR -r 12 > /dev/null
echo_warning "Setting nasmesh1 interface"
ip link set nasmesh1 up
ip -4 addr add $MR_IN_ADDR2/24 broadcast 10.0.2.255 dev nasmesh1
sysctl -w net.ipv6.conf.nasmesh1.accept_ra=0
sysctl -w net.ipv6.conf.nasmesh1.forwarding=1
echo_warning "Setting nasmesh0 interface"
ip link set nasmesh0 up
ip -4 addr add $MR_IN_ADDR/24 broadcast 10.0.1.255 dev nasmesh0
sysctl -w net.ipv6.conf.nasmesh0.accept_ra=0
sysctl -w net.ipv6.conf.nasmesh0.forwarding=1
route add -net 224.0.0.0 netmask 240.0.0.0 dev eth2
echo_warning "Starting radvd service"
/etc/init.d/radvd start
#sleep 3
######################################################################
sudo rm -f /tmp/*socket*
cd $OPENAIR3_DIR/MESH/RRM/
xterm -T RRM -hold -e sh rrm_idromel.sh &
sleep 5
cd $OPENAIR2_DIR/SIMULATION/USER_TOOLS/LAYER2_SIM
xterm -e ./mac_sim_rrm -m2 -t ../../TOPOLOGIES/eth_2chs_1node.top &
wait_process_started mac_sim
sleep 3
check_ch1
check_ch2
check_lfn
ip link set nasmesh1 down
check_ch1
check_lfn
######################################################################
sleep 5
echo_warning "Starting NEMO daemon logfile is $LOG_FILE"
xterm -e $NEMOD -c $DEMO_DIR/etc/mr_mcoa_sho.conf 2>&1 | tee $LOG_FILE &
wait_process_started mip6d
read user_keyboard
ip link set nasmesh1 up
echo '######################################################################'
echo "nasmesh1 is UP"
echo '######################################################################'
read user_keyboard
ip link set nasmesh1 down
echo '######################################################################'
echo "nasmesh1 is DOWN"
echo '######################################################################'
read user_keyboard
ip link set nasmesh1 up
echo '######################################################################'
echo "nasmesh1 is UP"
echo '######################################################################'
read user_keyboard
ip link set nasmesh0 down
echo '######################################################################'
echo "nasmesh0 is DOWN"
echo '######################################################################'
read user_keyboard
ip link set nasmesh0 up
echo '######################################################################'
echo "nasmesh0 is UP"
echo '######################################################################'
read user_keyboard
ip link set nasmesh1 down
echo '######################################################################'
echo "nasmesh1 is DOWN"
echo '######################################################################'
#echo "Lauching tcpdump s on all interfaces logs are in /opt/TESTBED_NEMO_MCOA_SHO/log folder"
#tcpdump -s 256 -i eth1 -v -w $DEMO_DIR"/log/mr_tcpdump_eth1_"$DATE".log" &
#tcpdump -s 256 -i nasmesh0 -v -w $DEMO_DIR"/log/mr_tcpdump_nasmesh0_"$DATE".log" &
#tcpdump -s 256 -i nasmesh1 -v -w $DEMO_DIR"/log/mr_tcpdump_nasmesh1_"$DATE".log" &
echo '######################################################################'
ip link show
echo '######################################################################'
ip addr show
echo '######################################################################'
######################################################################
echo "sleep 1 hour (type ctrl+C to end)"
sleep 3600
127.0.0.1 localhost
127.0.1.1 teraclope-desktop
2001:192:168:106::2 ha HA
2001:192:168:106::4 cn CN
192.168.12.100 carne
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
auto lo
iface lo inet loopback
iface eth0 inet static
address 192.168.210.85
netmask 255.255.255.0
#gateway 192.168.12.100
auto eth0
iface eth2 inet static
address 192.168.100.85
netmask 255.255.255.0
auto eth2
iface eth1 inet static
address 192.168.2.1
netmask 255.255.255.0
auto eth1
iface eth3 inet static
address 192.168.12.86
netmask 255.255.255.0
gateway 192.168.12.100
auto eth3
# This is an example of mip6d Mobile Node configuration file
NodeConfig MN;
## If set to > 0, will not detach from tty
DebugLevel 10;
## Support route optimization with other MNs
DoRouteOptimizationCN disabled;
## Use route optimization with CNs
DoRouteOptimizationMN disabled;
UseCnBuAck disabled;
# We use explicit Mode
#MobRtrUseExplicitMode enabled;
Interface "nasmesh0" {
Bid 100;
BidPriority 1;
Reliable true;
DefaultDelay 0;
#LGIDROReliable false;
#LGIDRODefaultDelay 3000;
}
Interface "nasmesh1" {
Bid 200;
#LG WAS 1 IDRO
BidPriority 10;
Reliable true;
DefaultDelay 0;
}
MnRouterProbes 1;
MnHomeLink "nasmesh0" {
IsMobRtr enabled;
MnUseSHO enabled;
# MnUseSHO disabled;
# MnUseAdaptiveCombining enabled;
MnUseAdaptiveCombining disabled;
HomeAgentAddress 2001:4::1;
HomeAddress 2001:4::4/64 (2001:4:0:2::/64);
RegMultipleCoA enabled;
IfMultipleCoA "nasmesh0", "nasmesh1";
# proto type code route opt.
# MnRoPolicy ICMP 129 0 enabled;
# MnRoPolicy ICMP any any disabled;
# proto dst src route opt.
# MnRoPolicy TCP 80 any enabled;
# MnRoPolicy TCP any any disabled;
}
##
## IPsec configuration
##
UseMnHaIPsec disabled;
## Key Management Mobility Capability
KeyMngMobCapability disabled;
# /etc/nsswitch.conf
#
# Example configuration of GNU Name Service Switch functionality.
# If you have the `glibc-doc' and `info' packages installed, try:
# `info libc "Name Service Switch"' for information about this file.
passwd: nis files
group: nis files
shadow: nis files
hosts: nis files dns mdns
networks: files
protocols: db files
services: db files
ethers: db files
rpc: db files
netgroup: nis
interface eth1
{
AdvSendAdvert on;
MaxRtrAdvInterval 4;
MinRtrAdvInterval 1;
AdvHomeAgentFlag off;
#
# new EUI-64 prefixes
#
prefix 2001:4:0:2::/64
{
AdvOnLink on;
AdvAutonomous on;
AdvRouterAddr on;
};
};
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
exit 0
#!/bin/bash
# Author: Lamia Romdhani, Raymond Knopp
source params.sh
echo Clusterhead address is $CH_ADDR
sleep 1
echo Launching AS and RF
./start_openair.sh 1 0
sleep 1
# 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
#CH<-> MR1 IP Signaling
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c1 -i0 -z0 -x $CH_ADDR -y $MR1_IN_ADDR -r 12
#CH<-> 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
#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
#CH<-> MR2 (MPLS user-plane bearer)
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c2 -i0 -z0 -l $MR2_LABEL_IN -m $MR2_LABEL_OUT -r 21
#CH Broadcast (transmission of Router ADV)
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c0 -i0 -z0 -x $CH_ADDR -y ff02::1 -r 3
echo Configuring interfaces on CH
# Setup IPv4 multicast route for openair emulation
sudo route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0
# 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 $CH_ADDR/64 dev nasmesh0
echo nasmesh0 is $CH_ADDR
echo No MPLS debug
echo "0" >/sys/mpls/debug
#/etc/init.d/radvd restart
#!/bin/bash
#Script by Irina Dumitrascu (dumitrascu.irina@gmail.com) and Adrian Popa (adrian.popa.gh@gmail.com)
#June 2006
#Released under GPL
echo Deleting all mpls settings ...
echo Deleting all mpls - xc settings
xc_output="`mpls xc show | cut -c 9-75`"
#parse by line, if there are multiple lines
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 - 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
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
sleep 1
mpls nhlfe del key $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
#test Philippe
var5=`tc qdisc show |grep nasmesh0 |grep htb`
if [ ! -z "$var5" ]; then
tc qdisc del dev nasmesh0 root
echo "tc clear nasmesh0"
fi
#!/bin/bash
#Script by Lamia Romdhani
#June 2008
echo Setting MPLS for CH
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'
mpls labelspace set dev nasmesh0 labelspace 0
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`
mpls xc add ilm_label gen $LABEL_IN ilm_labelspace 0 nhlfe_key $var
else
echo usage: ch_mpls_dyntest_nas.sh LABEL_IN IP_NEXT_HOP LABEL_OUT
fi
#!/bin/bash
#Phil,lamia 10 Oct 08
###Without PMIP
source params.sh
sudo ./ch_conf_nas.sh
sudo ./ch_mpls_nas.sh $MR1_LABEL_OUT $MR2_IN_ADDR $MR2_LABEL_IN
sudo ./ch_mpls_nas.sh $MR2_LABEL_OUT $MR1_IN_ADDR $MR1_LABEL_IN
echo /openair3/pmip6d/pmip6d -c -L $CH_ADDR
sudo xterm -hold -e "$OPENAIR3_PMIP6D_PATH/pmip6d -c -L $CH_ADDR" &
#./ch_del_mpls.sh
watch -n .1 "cat /proc/openair2/lchan_stats ; cat /proc/openair1/bch_stats ; cat /proc/openair1/openair1_state"
./stop_rf.sh
#!/bin/bash
#Huu-Nghia, Philippe, Lamia 28 june 2008
#echo Deleting MN1 autoconfigured addresse
#$OPENAIR3_SCRIPTS_PATH/mn1_del.sh
#ip -6 route add 2001:660:5502::25/128 via 2001:660:5502::10 dev eth0
ip -6 addr del 2001:660:5502::15/64 dev eth0
ip -6 addr add 2001:660:5502::15/64 dev eth0
#!/bin/bash
# Author: Lamia Romdhani, Raymond Knopp
source params.sh
export OPENAIR2_DIR
#echo "0" >/proc/sys/net/ipv6/conf/all/forwarding
echo Launching AS and RF
./start_openair.sh 1 8
#Sleep to allow L2 modules to load
sleep 1
echo Installing NASMESH Driver
sudo rmmod -f nasmesh
sudo insmod $OPENAIR2_DIR/NAS/DRIVER/MESH/nasmesh.ko nas_IMEI=0x12345678,0x02000000
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
echo Configuring interfaces on mr1
sudo route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0
sudo ifconfig nasmesh0 up
sudo ifconfig nasmesh0 10.0.1.2
sudo ip -6 addr add 2001:10:0:1:7856:3412:0:2/64 dev nasmesh0
#echo "Waiting for Router ADV from CH (DTCH Broadcast test)"
#IPv6ADR=`ip addr show dev nasmesh0 | grep -e inet6 | egrep -v fe80 | cut -d " " -f6 | cut -d "/" -f1`
#while [ -z $IPv6ADR ] ; do
# sleep 1
# IPv6ADR=`ip addr show dev nasmesh0 | grep -e inet6 | egrep -v fe80 | cut -d " " -f6 | cut -d "/" -f1`
#done
#echo Got Router ADV : IPv6 address is $IPv6ADR
echo Classification rules for MR1 - Default DTCH UL for L3 signaling
#$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c1 -i0 -z0 -x $IPv6ADR -y $CH_ADDR -r 4
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c1 -i0 -z0 -x 2001:10:0:1:7856:3412:0:2 -y $CH_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 $MR1_LABEL_OUT -m $MR1_LABEL_IN -r 5
echo eth0 is $MR1_EG_ADDR
#echo Starting routing ...
#echo No MPLS debug
#echo "1" >/sys/mpls/debug
#!/bin/bash
# Script by Lamia Romdhani, Nghia, Philippe 08 july 2008
# June 2008
source params.sh
sudo modprobe mpls6
echo Setting MPLS for mr1
echo "0" > /sys/mpls/debug
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 $CH_ADDR | grep key |cut -c 17-26`
echo "Creating routes"
sudo ip -6 route add $MN2_ADDR/128 via $CH_ADDR mpls $var
sudo ip -6 route add $MN1_ADDR/128 dev eth0
#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_EG_ADDR/64 dev eth0
sudo xterm -hold -e "$OPENAIR3_PMIP6D_PATH/pmip6d -m -s -L $CH_ADDR -N $MR1_EG_ADDR -E $MR1_IN_ADDR" &
#$OPENAIR3_SCRIPTS_PATH/mr1_del_mpls.sh
watch -n.1 "cat /proc/openair2/lchan_stats ; cat /proc/openair1/bch_stats ; cat /proc/openair1/openair1_state"
./stop_rf.sh
./ch_del_mpls.sh
#!/bin/bash
# Author: Lamia Romdhani, Raymond Knopp
source params.sh
export OPENAIR2_DIR
#echo "0" >/proc/sys/net/ipv6/conf/all/forwarding
echo Launching AS and RF
./start_openair.sh 1 9
#Sleep to allow L2 modules to load
sleep 1
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
echo Configuring interfaces on mr2
sudo route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0
sudo ifconfig nasmesh0 up
sudo ifconfig nasmesh0 10.0.1.3
sudo ip -6 addr add 2001:10:0:1:7856:3412:0:3/64 dev nasmesh0
#echo "Waiting for Router ADV from CH (DTCH Broadcast test)"
#IPv6ADR=`ip addr show dev nasmesh0 | grep -e inet6 | egrep -v fe80 | cut -d " " -f6 | cut -d "/" -f1`
#while [ -z $IPv6ADR ] ; do
# sleep 1
# IPv6ADR=`ip addr show dev nasmesh0 | grep -e inet6 | egrep -v fe80 | cut -d " " -f6 | cut -d "/" -f1`
#done
#echo Got Router ADV : IPv6 address is $IPv6ADR
echo Classification rules for MR1 - Default DTCH UL for L3 signaling
#$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c1 -i0 -z0 -x $IPv6ADR -y $CH_ADDR -r 4
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c1 -i0 -z0 -x 2001:10:0:1:7856:3412:0:3 -y $CH_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 $MR2_LABEL_OUT -m $MR1_LABEL_IN -r 5
echo eth0 is $MR2_EG_ADDR
#echo Starting routing ...
#echo No MPLS debug
#echo "1" >/sys/mpls/debug
#!/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 Nghia and Philippe - 8 July 08
source params.sh
ip -6 route del $MN1_ADDR/128 via $CH_ADDR
ip -6 route del $MN2_ADDR/128 dev eth0
echo Deleting all mpls settings ...
echo Deleting all mpls - xc settings
xc_output="`mpls xc show | cut -c 9-75`"
#parse by line, if there are multiple lines
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
# Author: Lamia Romdhani
#June 2008
source params.sh
modprobe mpls6
echo Starting routing ...
echo No MPLS debug
echo "0" >/sys/mpls/debug
echo Setting MPLS for mr2
echo 'MN2->MN1'
# add label 2000 and forward the packets to mr2 , for destination MN1
#Changed by Huu-Nghia, Philippe
var=`mpls nhlfe add key 0 instructions push gen $MR2_LABEL_OUT nexthop nasmesh0 ipv6 $CH_ADDR |grep key | cut -c 17-26`
sudo ip -6 route add $MN1_ADDR/128 via $CH_ADDR mpls $var
sudo ip -6 route add $MN2_ADDR/128 dev eth0
echo 'MN1->MN2'
#pop label 1001 and do Ip lookup.
mpls labelspace set dev nasmesh0 labelspace 0
mpls ilm add label gen 1001 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_del_mpls.sh
./mr2_conf_nas.sh
./mr2_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 $MR2_EG_ADDR/64 dev eth0
sudo xterm -hold -e "$OPENAIR3_PMIP6D_PATH/pmip6d -m -s -L $CH_ADDR -N $MR2_EG_ADDR -E $MR2_IN_ADDR" &
#$OPENAIR3_SCRIPTS_PATH/mr2_del_mpls.sh
#telnet localhost 7777 and then type pmip to see all binding entries
#ip -6 rule
#ip -6 route
watch -n.1 "cat /proc/openair2/lchan_stats ; cat /proc/openair1/bch_stats"
./stop_rf.sh
./ch_del_mpls.sh
#!/bin/bash
MR1_IN_ADDR=2001:10:0:1:7856:3412:0:2
MR1_EG_ADDR=2001:660:5502::10
MR1_LABEL_IN=2001
MR1_LABEL_OUT=1000
MR2_IN_ADDR=2001:10:0:1:7856:3412:0:3
MR2_EG_ADDR=2001:660:5502::20
MR2_LABEL_IN=1001
MR2_LABEL_OUT=2000
CH_ADDR=2001:10:0:1:7856:3412:0:1
#MN1_ADDR=2001:660:5502::211:43ff:fe6f:66e1
#MN2_ADDR=2001:660:5502::211:43ff:fe75:cfc0
MN1_ADDR=2001:660:5502::15
MN2_ADDR=2001:660:5502::25
OPENAIR3_HOME=/homes/knopp/Devel/openair/trunk/openair3
OPENAIR3_PMIP6D_PATH=$OPENAIR3_HOME/PMIP6D
OPENAIR3_SCRIPTS_PATH=$OPENAIR3_HOME/scripts/static
if [ "$1" == "" ]; then
echo "Please provide a TX power level (0-8)"
exit
fi
if [ "$2" == "" ]; then
echo "Please provide a Node ID (0-7 for CH, 8-15 for MR/UE)"
exit
fi
if [ "$OPENAIR1_DIR" == "" ] ; then
echo "Please set OPENAIR1_DIR environment variable"
exit
else
echo "OPENAIR1_DIR Set to $OPENAIR1_DIR"
fi
cd $OPENAIR1_DIR/USERSPACE_TOOLS/OPENAIR_RF
source ./txgains.sh
case $1 in
0)
CBMIMO1_POWER=$CBMIMO1_m20_dBm
echo "Configuring CBMIMO1 for -20dBm ($CBMIMO1_POWER)"
;;
1)
CBMIMO1_POWER=$CBMIMO1_m15_dBm
echo Configuring CBMIMO1 for -15dBm
;;
2)
CBMIMO1_POWER=$CBMIMO1_m10_dBm
echo Configuring CBMIMO1 for -10dBm
;;
3)
CBMIMO1_POWER=$CBMIMO1_m5_dBm
echo Configuring CBMIMO1 for -5dBm
;;
4)
CBMIMO1_POWER=$CBMIMO1_0_dBm
echo Configuring CBMIMO1 for 0dBm
;;
5)
CBMIMO1_POWER=$CBMIMO1_5_dBm
echo Configuring CBMIMO1 for 5dBm
;;
6)
CBMIMO1_POWER=$CBMIMO1_10_dBm
echo Configuring CBMIMO1 for 10dBm
;;
7)
CBMIMO1_POWER=$CBMIMO1_15_dBm
echo Configuring CBMIMO1 for 15dBm
;;
8)
CBMIMO1_POWER=$CBMIMO1_20_dBm
echo Configuring CBMIMO1 for 20dBm
;;
*)
echo Invalid TX power
exit
esac
echo Removing openair_rf,openair_l2 and openair_rrc modules
sudo rmmod -f openair_rrc
sudo rmmod -f openair_l2
sudo rmmod -f openair_rf
sudo insmod $OPENAIR1_DIR/ARCH/CBMIMO1/DEVICE_DRIVER/openair_rf_l2.ko
OARF_RET=`lsmod | grep -e openair_rf`
if [ "$OARF_RET" = "" ]; then
echo Error loading openair1 module
exit
fi
sudo insmod $OPENAIR2_DIR/LAYER2/openair_layer2.ko
OA2_RET=`lsmod | grep -e openair_l2`
if [ "$OA2_RET" = "" ]; then
echo Error loading openair2 module
exit
fi
sudo insmod $OPENAIR2_DIR/RRC/MESH/openair_RRC.ko
OARRC_RET=`lsmod | grep -e openair_rrc`
if [ "$OARRC_RET" = "" ]; then
echo Error loading openair RRC module
exit
fi
OA_DEV="/dev/openair0"
if [ -c "$OA_DEV" ]; then
echo "$OA_DEV exists"
else
echo "creating $OA_DEV"
sudo mknod $OA_DEV c 127 0
sudo chmod a+rw /dev/openair0
fi
./openair_rf_cbmimo1 1 0
./openair_rf_cbmimo1 1 6 $CBMIMO1_POWER
if [ $2 -lt "8" ]; then
./openair_rf_cbmimo1 1 1 1 $2
elif [ $2 -lt "16" ]; then
./openair_rf_cbmimo1 1 3 1 $2
else
echo Illegal Node ID, exiting
exit
fi
sleep 1
# Watch the status of the radio to check for hardware exit event
#OA1_STATE=`cat /proc/openair1/openair1_state`
#while [ "$OA1_STATE" != "EXITED" ]; do
# OA1_STATE=`cat /proc/openair1/openair1_state`
# sleep .5
#done
#./openair_rf_cbmimo1 1 4 1
#echo CBMIMO1 Hardware exit, restarting ...
cd $OPENAIR1_DIR/USERSPACE_TOOLS/OPENAIR_RF
./openair_rf_cbmimo1 1 4 1
sudo killall chbch_scope
sudo killall sach_scope
sudo rmmod nasmesh
sudo rmmod openair_rrc
sudo rmmod openair_l2
sudo rmmod openair_rf
# Configuration file of CH1 (SP4-Wimaxhead1)
# side linked to MR1 (Chorist Edge 1) : name of interface, IPv4, TTL
int_1=nasmesh0
ipv_1=4
ttl_1=65
# side linked to MR2 (SP4-Wimaxrelay-2) : name of interface, IPv4, TTL
int_2=nasmesh0
ipv_2=4
ttl_2=65
#multicast group label on side 1 then group label on side 2
groupes=226.30.10.10,226.40.10.10
groupes=226.30.10.11,226.40.10.11
groupes=226.30.10.12,226.40.10.12
groupes=226.30.10.13,226.40.10.13
groupes=226.30.10.14,226.40.10.14
groupes=226.30.10.15,226.40.10.15
#Port ranges
ports=1234,1234
ports=6300,6308
ports=6340,6348
ports=6360,6368
# Configuration file of CH1 (SP4-Wimaxhead2)
# side linked to MR2 (SP4-Wimaxrelay-2) : name of interface, IPv4, TTL
int_1=nasmesh0
ipv_1=4
ttl_1=65
# side linked to MR3 (SP4-Edge2) : name of interface, IPv4, TTL
int_2=nasmesh0
ipv_2=4
ttl_2=65
#multicast group label on side 1 then group label on side 2
groupes=226.50.10.10,226.30.10.10
groupes=226.50.10.11,226.30.10.11
groupes=226.50.10.12,226.30.10.12
groupes=226.50.10.13,226.30.10.13
groupes=226.50.10.14,226.30.10.14
groupes=226.50.10.15,226.30.10.15
#Port ranges
ports=1234,1234
ports=6300,6308
ports=6340,6348
ports=6360,6368
# Configuration file of MN1 (Dieppe)
# side linked to EADS End-users (Wifi side) : name of interface, IPv4, TTL
int_1=wifi0
ipv_1=4
ttl_1=65
# side linked to MR1 (CHORIST-Edge1): name of interface, IPv4, TTL
int_2=eth0
ipv_2=4
ttl_2=65
#multicast group label on side 1 then group label on side 2
groupes=224.0.55.55,224.0.66.66
groupes=226.10.10.10,226.20.10.10
groupes=226.10.10.11,226.20.10.11
groupes=226.10.10.12,226.20.10.12
groupes=226.10.10.13,226.20.10.13
groupes=226.10.10.14,226.20.10.14
groupes=226.10.10.15,226.20.10.15
#Port ranges
ports=1234,1234
ports=6300,6308
ports=6340,6348
ports=6360,6368
# Configuration file of MN2 (Sarlat)
# side linked to MR3 (CHORIST-Edge2) : name of interface, IPv4, TTL
int_2=eth0
ipv_2=4
ttl_2=65
# side linked to EADS End-users (Wifi side) : name of interface, IPv4, TTL
int_1=wifi0
ipv_1=4
ttl_1=65
#multicast group label on side 1 then group label on side 2
groupes=226.20.10.10,226.10.10.10
groupes=226.20.10.11,226.10.10.11
groupes=226.20.10.12,226.10.10.12
groupes=226.20.10.13,226.10.10.13
groupes=226.20.10.14,226.10.10.14
groupes=226.20.10.15,226.10.10.15
#Port ranges
ports=1234,1234
ports=6300,6308
ports=6340,6348
ports=6360,6368
# Configuration file MR1 (Chorist-Edge1)
# side linked to MN1 (DIEPPE) : name of interface, IPv4, TTL
int_1=eth0
ipv_1=4
ttl_1=65
# side linked to CH1 (SP4-Wimaxhead1) : name of interface, IPv4, TTL
int_2=nasmesh0
ipv_2=4
ttl_2=65
#multicast group label on side 1 then group label on side 2
groupes=226.20.10.10,226.30.10.10
groupes=226.20.10.11,226.30.10.11
groupes=226.20.10.12,226.30.10.12
groupes=226.20.10.13,226.30.10.13
groupes=226.20.10.14,226.30.10.14
groupes=226.20.10.15,226.30.10.15
# different port ranges
ports=1234,1234
ports=6300,6308
ports=6340,6348
ports=6360,6368
# Configuration file MR2 (SP4-Wimaxrelay-2)
# side linked to CH1 (SP4-Wimaxhead1) : name of interface, IPv4, TTL
int_1=nasmesh0
ipv_1=4
ttl_1=65
# side linked to CH1 (SP4-Wimaxhead2) : name of interface, IPv4, TTL
int_2=nasmesh0
ipv_2=4
ttl_2=65
#multicast group label on side 1 then group label on side 2
groupes=226.40.10.10,226.50.10.10
groupes=226.40.10.11,226.50.10.11
groupes=226.40.10.12,226.50.10.12
groupes=226.40.10.13,226.50.10.13
groupes=226.40.10.14,226.50.10.14
groupes=226.40.10.15,226.50.10.15
# different port ranges
ports=1234,1234
ports=6300,6308
ports=6340,6348
ports=6360,6368
# Configuration file MR3 (Chorist-Edge2)
# side linked to CH2 (SP4-Wimaxhead2) : name of interface, IPv4, TTL
int_1=nasmesh0
ipv_1=4
ttl_1=65
# side linked to MN2 (SARLAT) : name of interface, IPv4, TTL
int_2=eth0
ipv_2=4
ttl_2=65
#multicast group label on side 1 then group label on side 2
groupes=226.30.10.10,226.20.10.10
groupes=226.30.10.11,226.20.10.11
groupes=226.30.10.12,226.20.10.12
groupes=226.30.10.13,226.20.10.13
groupes=226.30.10.14,226.20.10.14
groupes=226.30.10.15,226.20.10.15
# different port ranges
ports=1234,1234
ports=6300,6308
ports=6340,6348
ports=6360,6368
/*******************************/
/* reflector-forwarding-v4m by */
/*******************************/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <strings.h>
#include <netdb.h>
#include <sys/types.h>
#include <sys/time.h>
#include <sys/unistd.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <sys/signal.h>
#include <sys/param.h>
#include <errno.h>
#include <arpa/inet.h>
#include <pthread.h>
#include <syslog.h>
/* To get ifreq */
#include <arpa/inet.h>
#include <sys/socket.h>
#include <net/if.h>
#include <sys/ioctl.h>
#include <limits.h>
#include <netinet/in_systm.h>
#include <netinet/in.h>
#include <netinet/ip.h>
#include <netinet/udp.h>
#define _PATH_PROCNET_IFINET6 "/proc/net/if_inet6"
#define MSGBUF_SIZE 32768
#define IFNAMSIZE 11
#define INLINE inline __attribute__((always_inline))
struct ipaddr_str {
char buf[MAX(INET6_ADDRSTRLEN, INET_ADDRSTRLEN)];
};
int IP_VERSION;
static INLINE const char *ip4_to_string(struct ipaddr_str * const buf, const struct in_addr addr4)
{
return inet_ntop(AF_INET, &addr4, buf->buf, sizeof(buf->buf));
}
static INLINE const char *ip6_to_string(struct ipaddr_str * const buf, const struct in6_addr * const addr6)
{
return inet_ntop(AF_INET6, addr6, buf->buf, sizeof(buf->buf));
}
static INLINE const char *sockaddr4_to_string(struct ipaddr_str * const buf, const struct sockaddr * const addr)
{
const struct sockaddr_in * const addr4 = (const struct sockaddr_in *)addr;
return ip4_to_string(buf, addr4->sin_addr);
}
int programshutdown (void);
#define NUM_THREADS 200
struct thread_data {
int thread_id;
char interface1[11];
char multicast_addr1[41];
char interface2[11];
char multicast_addr2[41];
int ttl1;
int ttl2;
int port1;
int port2;
};
struct thread_data thread_data_array[NUM_THREADS];
/*******************************************************************
*From net-tools lib/interface.c
*
*******************************************************************/
int
get_ipv6_address(char *ifname, struct sockaddr_in6 *saddr6, int scope_in)
{
char addr6[40], devname[IFNAMSIZE];
char addr6p[8][5];
int plen, scope, dad_status, if_idx;
FILE *f;
struct sockaddr_in6 tmp_sockaddr6;
if ((f = fopen(_PATH_PROCNET_IFINET6, "r")) != NULL) {
while (fscanf(f, "%4s%4s%4s%4s%4s%4s%4s%4s %02x %02x %02x %02x %20s\n",
addr6p[0], addr6p[1], addr6p[2], addr6p[3],
addr6p[4], addr6p[5], addr6p[6], addr6p[7],
&if_idx, &plen, &scope, &dad_status, devname) != EOF) {
if (!strcmp(devname, ifname)) {
sprintf(addr6, "%s:%s:%s:%s:%s:%s:%s:%s",
addr6p[0], addr6p[1], addr6p[2], addr6p[3],
addr6p[4], addr6p[5], addr6p[6], addr6p[7]);
printf( "\t inet6 addr: %s\n", addr6);
printf("\t Scope: %d\n", scope);
if(scope == scope_in) {
printf( "\tFound GLOBAL addr: %s:%s:%s:%s:%s:%s:%s:%s\n",
addr6p[0], addr6p[1], addr6p[2], addr6p[3],
addr6p[4], addr6p[5], addr6p[6], addr6p[7]);
inet_pton(AF_INET6,addr6,&tmp_sockaddr6);
memcpy(&saddr6->sin6_addr, &tmp_sockaddr6, sizeof(struct in6_addr));
fclose(f);
return 1;
}
}
}
fclose(f);
}
return 0;
}
/*****************************************************/
/* Threaded routine */
/*****************************************************/
void *Reflector(void *threadarg)
{
int ioctl_s;
struct thread_data *my_data;
my_data = (struct thread_data *)threadarg;
struct in_addr multicastaddress_in; //IPv4 multicast address from command line
struct in_addr multicastaddress_out;
struct sockaddr_in6 tmp_saddr6;
struct ifreq ifr;
struct ipaddr_str buf;
int mcdataport4; //IPv4 multicast port 1
int mcdataport; //IPv4 multicast port 2
/*define variables*/
int mcdatarecvfd4; //multicast data receive socket side 1
int mcdatarecvfd; //multicast data receive socket side 2
int sendfd4; //local send socket IPv4 side 1
int sendfd; //local send socket IPv4 side 2
int ttl1; //time to live IPv4 side 1
int ttl2; //time to live IPv4 side 2
struct sockaddr_in mcdataaddr4; //reception IPv4 sockaddr
struct sockaddr_in mcdataaddr; //reception IPv44 sockaddr
char myhostnameipaddress4[20]; // IPv4 reflector's address string
char myhostnameipaddress[20]; // IPv44 reflector's address string
char addressstring4[20]; // IPv4 address string
char addressstring[20]; // IPv44 address string
struct sockaddr_in localsendaddr4; //IPv4 address of outgoing packets interface 1
struct sockaddr_in localsendaddr; //IPv4 address of outgoing packets interface 2
struct sockaddr_in sourceaddr4; //IPv4 address of incoming packets interface 1
struct sockaddr_in sourceaddr; //IPv4 address of incoming packets interface 2
struct ip_mreq mcdatareq4; //IPv4 join group structure
struct ip_mreq mcdatareq; //IPv44 join group structure
int mcdataaddrlen; //IPv4 multicast address length
unsigned int sourceaddrlen; //IPv4 source address length
char mcdatarecvbuf4[MSGBUF_SIZE]; //IPv4 multicast receive buffer
char mcdatarecvbuf[MSGBUF_SIZE]; //IPv44 multicast receive buffer
fd_set readfds; // file descriptors set
int maxfds; // max number of file descriptors
int nfds;
int nr; // number of bytes read with recvfrom
int ns; // number of bytes sent with sendto
int chksrc; // asserts if source address is not the reflector's one
int debugon=1;
int n2;
char inputbuf[32];
/* IPv4 multicast address */
if((inet_pton(AF_INET,my_data->multicast_addr1,&multicastaddress_in.s_addr))!=1) {
printf("bad multicast IPv4 address format\n");
exit (1);
}
//printf("multicastaddress side 1 v4 =%s\n",my_data->multicast_addr1);
/* IPv4 multicast address */
if((inet_pton(AF_INET,my_data->multicast_addr2,&multicastaddress_out.s_addr))!=1) {
printf("bad multicast IPv4 address format\n");
exit (1);
}
//printf("multicastaddress side 2 v4 =%s\n",my_data->multicast_addr2);
/* IPv4 multicast ports */
mcdataport4 = my_data->port1;
mcdataport = my_data->port2;
/* Time to live for IPv4 multicast */
ttl1 = my_data->ttl1;
/* Time to live for IPv4 multicast */
ttl2 = my_data->ttl2;
IP_VERSION=4;
if (IP_VERSION==4 ) { //
ioctl_s = socket(AF_INET, SOCK_DGRAM, 0);
if (ioctl_s < 0) {
syslog(LOG_ERR, "ioctl socket: %m");
exit (0);
}
/* INTERFACE 1 */
memset(&ifr, 0, sizeof(struct ifreq));
strncpy(ifr.ifr_name, my_data->interface1, IFNAMSIZE);
/* Check interface address (IPv4) */
if(ioctl(ioctl_s, SIOCGIFADDR, &ifr) < 0) {
printf( "\tCould not get address of interface 1 - removing it\n");
exit(0);
}
sockaddr4_to_string(&myhostnameipaddress4, &ifr.ifr_addr);
/* INTERFACE 2 */
memset(&ifr, 0, sizeof(struct ifreq));
strncpy(ifr.ifr_name, my_data->interface2, IFNAMSIZE);
/* Check interface address (IPv4) */
if(ioctl(ioctl_s, SIOCGIFADDR, &ifr) < 0) {
printf( "\tCould not get address of interface 2 - removing it\n");
exit(0);
}
sockaddr4_to_string(&myhostnameipaddress, &ifr.ifr_addr);
} else {
/* Global address mode */
int ipv6_addrtype = 0; /* global */
/* Get IPV6 GLOBAL interface address */
memset(&ifr, 0, sizeof(struct ifreq));
strncpy(ifr.ifr_name, my_data->interface2, IFNAMSIZE);
if(get_ipv6_address(ifr.ifr_name, &tmp_saddr6, ipv6_addrtype ) <= 0) {
printf( "\tCould not find site-local IPv6 address for %s\n", ifr.ifr_name);
}
memset(&ifr, 0, sizeof(struct ifreq));
strncpy(ifr.ifr_name, my_data->interface2, IFNAMSIZE);
// printf("\n Adding interface : %s \n", my_data->interface2);
/* Get IPV6 GLOBAL interface address */
if(get_ipv6_address(ifr.ifr_name, &tmp_saddr6, ipv6_addrtype ) <= 0) {
printf( "\tCould not find site-local IPv6 address for %s\n", ifr.ifr_name);
}
}
/* Structures initialization */
/*enter the address/port data into the mcdataaddr structure for IPv4*/
bzero((char *) &mcdataaddr4, sizeof(mcdataaddr4));
mcdataaddr4.sin_family=AF_INET;
mcdataaddr4.sin_addr.s_addr = multicastaddress_in.s_addr;
mcdataaddr4.sin_port = htons(mcdataport4);
/*enter the address/port data into the mcdataaddr structure for IPv4*/
bzero((char *) &mcdataaddr, sizeof(mcdataaddr));
mcdataaddr.sin_family=AF_INET;
mcdataaddr.sin_addr.s_addr = multicastaddress_out.s_addr;
mcdataaddr.sin_port = htons(mcdataport);
/*enter the address/port data into the localsendaddr structure for IPv4*/
bzero((char *) &localsendaddr4, sizeof(localsendaddr4));
localsendaddr4.sin_family=AF_INET;
inet_pton(AF_INET, myhostnameipaddress4 , &localsendaddr4.sin_addr.s_addr);
localsendaddr4.sin_port = htons(0);
//LL
// inet_ntop(AF_INET, &localsendaddr4.sin_addr.s_addr,addressstring ,sizeof(addressstring));
// printf("threaded function local sender addr side 1=%s \t",addressstring);
/*enter the address/port data into the localsendaddr structure for IPv4*/
bzero((char *) &localsendaddr, sizeof(localsendaddr));
localsendaddr.sin_family=AF_INET;
inet_pton(AF_INET, myhostnameipaddress , &localsendaddr.sin_addr.s_addr);
localsendaddr.sin_port = htons(0);
//LL
// inet_ntop(AF_INET, &localsendaddr.sin_addr.s_addr,addressstring ,sizeof(addressstring));
// printf("threaded function local sender addr side 2=%s\n", addressstring);
/*enter the address/port data into the mcdatareq structure for IPv4*/
bzero((char *) &mcdatareq4, sizeof(mcdatareq4));
// mcdatareq4.imr_interface.s_addr=htonl(INADDR_ANY); < force to add a multicast route
inet_pton(AF_INET, myhostnameipaddress4 ,&mcdatareq4.imr_interface.s_addr );
mcdatareq4.imr_multiaddr.s_addr=multicastaddress_in.s_addr;
// inet_pton(AF_INET, myhostnameipaddress4 , &mcdatareq4.imr_interface.s_addr);
/*enter the address/port data into the mcdatareq structure for IPv4*/
bzero((char *) &mcdatareq, sizeof(mcdatareq));
inet_pton(AF_INET, myhostnameipaddress ,&mcdatareq.imr_interface.s_addr );
// mcdatareq.imr_interface.s_addr=htonl(INADDR_ANY);
mcdatareq.imr_multiaddr.s_addr=multicastaddress_out.s_addr;
/*get the sendfd socket linked to the first address of the current host */
if ((sendfd4 = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
perror("can't open sendfd socket!");
exit (1);
}
if (bind(sendfd4, (struct sockaddr *) &localsendaddr4, \
sizeof(localsendaddr4)) < 0) {
perror("can't bind localsendaddr v4 to socket!");
exit(1);
}
/*get the sendfd socket linked to the first address of the current host*/
if ((sendfd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
perror("can't open sendfd socket!");
exit (1);
}
if (bind(sendfd, (struct sockaddr *) &localsendaddr, \
sizeof(localsendaddr)) < 0) {
perror("can't bind localsendaddr v4 side 2 to socket!");
exit(1);
}
if ((mcdatarecvfd4 = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
perror("can't open mcdatarecvfd4 socket!");
exit(1);
}
/*allow multiple processes per host to read from IPv4 sockets side 2*/
if (setsockopt(mcdatarecvfd4, SOL_SOCKET, SO_REUSEADDR, &mcdataaddr4, sizeof(mcdataaddr4)) < 0) {
perror("SO_REUSEADDR setsockopt v4\n");
}
if (bind(mcdatarecvfd4, (struct sockaddr *) &mcdataaddr4, \
sizeof(mcdataaddr4)) < 0) {
inet_ntop(AF_INET, &mcdataaddr4.sin_addr.s_addr,addressstring ,sizeof(addressstring));
printf("with address of bind %s\n", addressstring);
perror("can't bind mcdataaddr v4 to socket!");
exit(1);
}
if (multicastaddress_out.s_addr!=multicastaddress_in.s_addr) {
//multicast data receive socket side 2
/*get a mcdatarecvfd socket, bind to address for IPv4*/
if ((mcdatarecvfd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
perror("can't open mcdatarecvfd4 socket!");
exit(1);
}
/*allow multiple processes per host to read from IPv4 sockets side 2*/
if (setsockopt(mcdatarecvfd, SOL_SOCKET, SO_REUSEADDR, &mcdataaddr, sizeof(mcdataaddr)) < 0) {
perror("SO_REUSEADDR setsockopt v4\n");
}
if (bind(mcdatarecvfd, (struct sockaddr *) &mcdataaddr, \
sizeof(mcdataaddr)) < 0) {
perror("can't bind mcdataaddr v4 side 2 to socket!");
exit(1);
}
} else {
mcdatarecvfd= mcdatarecvfd4;
}
/*set socket options to join multicast group in IPv4*/
if (setsockopt(mcdatarecvfd4, IPPROTO_IP, IP_ADD_MEMBERSHIP, &mcdatareq4,\
sizeof(mcdatareq4)) < 0) {
perror("can't set socket options to join multicast group data v4 side 1!");
exit(1);
}
/*set socket options to join multicast group in IPv4*/
if (setsockopt(mcdatarecvfd, IPPROTO_IP, IP_ADD_MEMBERSHIP, &mcdatareq,\
sizeof(mcdatareq)) < 0) {
perror("can't set socket options to join multicast group data v4 side 2!");
exit(1);
}
/*now set multicast socket TTL option for IPv4*/
if (setsockopt(sendfd4, IPPROTO_IP, IP_MULTICAST_TTL, \
&ttl1, sizeof(ttl1)) < 0)
perror("can't set multicast ttl v4 socket option!");
/*now set multicast socket TTL option for IPv4*/
if (setsockopt(sendfd, IPPROTO_IP, IP_MULTICAST_TTL, \
&ttl2, sizeof(ttl2)) < 0)
perror("can't set multicast ttl v4 socket option!");
/*define the sizes of the address structures*/
mcdataaddrlen=sizeof(mcdataaddr4);
sourceaddrlen=sizeof(sourceaddr4);
/*start infinite while loop*/
/*and check for activity on sockets*/
/*set up the select sytem call parameters*/
/*zero out the readfds and writefds lists, then add*/
/*the file descriptors of interest*/
while(1) {
FD_ZERO(&readfds);
FD_SET(mcdatarecvfd4, &readfds);
FD_SET(mcdatarecvfd, &readfds);
if (debugon >= 1) {
FD_SET(0, &readfds);
}
maxfds = mcdatarecvfd4 + 5;
/*check for activity*/
nfds = select(maxfds, &readfds, NULL, NULL, NULL);
/*if specified on the command line, check for input on stdin*/
if (debugon >= 1) {
if (FD_ISSET(0, &readfds)) {
n2 = read(0,inputbuf, sizeof(inputbuf));
inputbuf[n2>0? n2-1: 0] = '\0';
if (!strcmp(inputbuf,"q")) {
programshutdown();
}
}
fflush(stdout);
}
/*1:receive from IPv4, send on IPv44 - data*/
if (FD_ISSET(mcdatarecvfd4, &readfds)) {
nr = recvfrom(mcdatarecvfd4, mcdatarecvbuf4, MSGBUF_SIZE, 0, (struct sockaddr *) \
&sourceaddr4, &sourceaddrlen);
if (debugon >= 2) {
inet_ntop(AF_INET, &sourceaddr4.sin_addr.s_addr, addressstring4 , sizeof(addressstring4));
printf("\nreading from mcdatarecvfd4, got data from %s\n", addressstring4);
}
if (sourceaddr4.sin_addr.s_addr == localsendaddr4.sin_addr.s_addr) {
chksrc = 0;
if (debugon >= 2)
printf("don't retransmit multicastv4 sourced from gateway machine\n");
} else {
chksrc = 1;
if (debugon >= 2)
printf("retransmit to multicast address\n");
}
if (chksrc) {
if (nr < 0)
printf ("mcdatarecvfd4:recvfrom over multicast v4 address error!(1)\n");
/*now send to IPv4*/
if (multicastaddress_out.s_addr != INADDR_ANY) {
if (debugon >= 2) {
inet_ntop(AF_INET, &mcdataaddr.sin_addr.s_addr,addressstring4 ,sizeof(addressstring4));
printf("sending to %s\n", addressstring4);
}
ns = sendto(sendfd, mcdatarecvbuf4, nr, 0, (struct sockaddr *)&mcdataaddr, \
sizeof(mcdataaddr));
} else {
if (debugon >= 2) printf("not resending to ORIGINATOR! or array entry = 0\n");
}
}
}
/*2:receive from IPv4 side 2, send on IPv44 side 1 - data*/
if (FD_ISSET(mcdatarecvfd, &readfds)) {
nr = recvfrom(mcdatarecvfd, mcdatarecvbuf, MSGBUF_SIZE, 0, (struct sockaddr *) \
&sourceaddr, &sourceaddrlen);
if (debugon >= 2) {
inet_ntop(AF_INET, &sourceaddr.sin_addr.s_addr, addressstring , sizeof(addressstring));
printf("\nreading from mcdatarecvfd side 2, got data from %s\n", addressstring);
}
if (sourceaddr.sin_addr.s_addr == localsendaddr.sin_addr.s_addr) {
chksrc = 0;
if (debugon >= 2)
printf("don't retransmit multicastv4 sourced from gateway machine\n");
} else {
chksrc = 1;
if (debugon >= 2)
printf("retransmit to multicast address side 1\n");
}
if (chksrc) {
if (nr < 0)
printf ("mcdatarecvfd:recvfrom over multicast v4 address error!(1)\n");
/*now send to IPv4*/
if (multicastaddress_in.s_addr != INADDR_ANY) {
if (debugon >= 2) {
inet_ntop(AF_INET, &mcdataaddr4.sin_addr.s_addr,addressstring ,sizeof(addressstring));
printf("sending to %s\n", addressstring);
}
ns = sendto(sendfd4, mcdatarecvbuf, nr, 0, (struct sockaddr *)&mcdataaddr4, \
sizeof(mcdataaddr4));
} else {
if (debugon >= 2) printf("not resending to ORIGINATOR! or array entry = 0\n");
}
}
}
} //end of while loop
}
/*****************************************************/
int
main (argc, argv)
int argc;
char **argv;
{
char interface1[11], interface2[11];
int ttl1; //time to live side1
int ttl2; //time to live side 2
struct couple {
char multicast_addr1[41]; /* address multicast for the group side 1 */
char multicast_addr2[41]; /* address multicast for the group side 2 */
};
int nb_port_range;
int nb_multicast_couple;
int ip_version, ip_version2;
int displayon=0;
struct couple *multi_group;
int i,j, k, rc,port;
pthread_t threads[NUM_THREADS];
struct port_range {
int port_begin;
int port_end;
};
struct port_range *prt_range;
if (argc < 12) {
fprintf (stderr, "Error in the syntax\n");
exit(1);
}
strcpy(interface1,argv[1]);
strcpy(interface2,argv[2]);
ip_version= atoi(argv[3]);
ip_version2=atoi(argv[4]);
/* Time to live for IPv4 multicast */
ttl1 = atoi(argv[5]);
/* Time to live for IPv4 multicast */
ttl2 = atoi(argv[6]);
nb_multicast_couple=atoi(argv[7]);
if (nb_multicast_couple !=0) {
if ((multi_group=(struct couple *)malloc(nb_multicast_couple*sizeof(struct couple)))==NULL) {
printf("Memory problem to allocate struct couple !\n") ;
exit (1);
}
for (i=0; i <nb_multicast_couple; i++) {
strcpy(multi_group[i].multicast_addr1,argv[8+2*i]);
strcpy(multi_group[i].multicast_addr2,argv[8+2*i +1]);
}
} else {
exit(0);
}
nb_port_range=atoi(argv[8 + nb_multicast_couple*2]);
if (nb_port_range !=0) {
if ((prt_range=(struct port_range *)malloc(nb_port_range*sizeof(struct port_range)))==NULL) {
printf("Memory problem to allocate struct port !\n") ;
exit (1);
}
for (i=0; i <nb_port_range; i++) {
prt_range[i].port_begin= atoi(argv[8+1 + nb_multicast_couple*2+2*i]);
prt_range[i].port_end = atoi(argv[8+1 + nb_multicast_couple*2+2*i +1]);
}
} else {
exit(0);
}
k=0;
printf( "Multicast state : for interface %s and interface %s for %d multicast group(s) on %d port range(s) \n", interface1, interface2, nb_multicast_couple, nb_port_range);
for (i=0; i <nb_multicast_couple; i++) {
for(j=0; j <nb_port_range; j++) {
for (port= prt_range[j].port_begin; port <=prt_range[j].port_end; port++) {
strcpy (thread_data_array[k].interface1, interface1);
strcpy (thread_data_array[k].interface2, interface2);
thread_data_array[k].ttl1=ttl1;
thread_data_array[k].ttl2=ttl2;
strcpy (thread_data_array[k].multicast_addr1, multi_group[i].multicast_addr1);
strcpy (thread_data_array[k].multicast_addr2, multi_group[i].multicast_addr2);
thread_data_array[k].thread_id=k;
thread_data_array[k].port1=port;
thread_data_array[k].port2=port;
if (displayon >= 1) printf("Creating thread %d for group %d for port %d\n", k,i ,port);
rc=pthread_create(&threads[k], NULL, Reflector, (void *)&thread_data_array[k]);
if (rc) {
printf("Error; return code from pthreade_create() is %d\n", rc);
exit(-1);
}
k=k+1;
if (k> NUM_THREADS) {
printf("Number of created threads over the fixed limited!" );
exit(-1);
}
}
}
}
pthread_exit(NULL);
}
int programshutdown ()
{
exit (1);
}
#!/usr/bin/perl -w
use Switch;
$dir = $ARGV[0];
$file = $ARGV[1];
$nb_groupes = `grep groupes $ARGV[0]|wc -l|sed \'s/ //g\'`;
$nb_plages = `grep port $ARGV[0]|wc -l|sed \'s/ //g\'`;
chomp($nb_plages);
chomp($nb_groupes);
#les structures dans lesquelles on stocke les données
@groupes=();
@ports=();
@int_1=();
@int_2=();
@ipv_1=();
@ipv_2=();
@ttl_1=();
@ttl_2=();
#on compte le nombre de lignes, pour signaler l'erreur
$num_ligne = 0;
open(fFile, "< $file") or die "cannot open file $file";
while($line = <fFile>){
$num_ligne++;
#on ignore les lignes commentées ou vides
if ((substr ($line,0,1) ne "#") && ($line =~ /=/)) {
@ligne=split("=", $line);
#si l'argument est vide, alors le programme sort avec une erreur
chomp($ligne[1]);
if(!length($ligne[1])){
printf "Erreur dans le fichier de conf à la ligne $num_ligne.\n";
exit;
}
#on met les données dans les structures adéquates
switch ($ligne[0]){
case "int_1" {push(@int_1,$ligne[1])}
case "int_2" {push(@int_2,$ligne[1])}
case "ipv_1" {push(@ipv_1,$ligne[1])}
case "ipv_2" {push(@ipv_2,$ligne[1])}
case "ttl_1" {push(@ttl_1,$ligne[1])}
case "ttl_2" {push(@ttl_2,$ligne[1])}
case "groupes" {push(@groupes,$ligne[1])}
case "ports" {push(@ports,$ligne[1])}
}
}
}
close(fFile);
#On construit la commande et on l'affiche
$commande = "$dir/reflector $int_1[0] $int_2[0] $ipv_1[0] $ipv_2[0] $ttl_1[0] $ttl_2[0]";
#on rajoute le nb de groupes et les groupes
$commande = $commande." ".@groupes;
foreach $groupe (@groupes){
@couple = split (",", $groupe);
$commande = $commande." $couple[0] $couple[1]";
}
#on rajoute le nb de ports et les ports
$commande = $commande." ".@ports;
foreach $port (@ports){
@couple = split (",", $port);
$commande = $commande." $couple[0] $couple[1]";
}
$commande = $commande."\n";
system($commande);
#!/bin/bash
source params.sh
echo Clusterhead address is $CH_ADDR
# 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 -c1 -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 multicast (rajout THC)
echo EADS Multicast for CH1
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c2 -i0 -z0 -s CH1_IN_ADDR -t 226.30.10.10 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c2 -i0 -z0 -s MR1_IN_ADDR -t 226.30.10.10 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c3 -i0 -z0 -s CH1_IN_ADDR -t 226.30.10.11 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c3 -i0 -z0 -s MR1_IN_ADDR -t 226.30.10.11 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c4 -i0 -z0 -s CH1_IN_ADDR -t 226.30.10.12 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c4 -i0 -z0 -s MR1_IN_ADDR -t 226.30.10.12 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c5 -i0 -z0 -s CH1_IN_ADDR -t 226.30.10.13 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c5 -i0 -z0 -s MR1_IN_ADDR -t 226.30.10.13 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c6 -i0 -z0 -s CH1_IN_ADDR -t 226.30.10.14 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c6 -i0 -z0 -s MR1_IN_ADDR -t 226.30.10.14 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c7 -i0 -z0 -s MR1_IN_ADDR -t 226.30.10.15 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c7 -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 -c2 -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 -c2 -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 -c3 -i0 -z0 -l $CH1_MR2_CH2_LABEL_OUT -m $CH1_MR2_CH2_LABEL_IN -r 20
#CH1<-> MR2 multicast EADS (rajout THC)
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c2 -i0 -z0 -s MR2_IN_ADDR -t 226.40.10.10 -r 20
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c2 -i0 -z0 -s CH1_IN_ADDR -t 226.40.10.10 -r 20
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c3 -i0 -z0 -s MR2_IN_ADDR -t 226.40.10.11 -r 20
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c3 -i0 -z0 -s CH1_IN_ADDR -t 226.40.10.11 -r 20
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c4 -i0 -z0 -s MR2_IN_ADDR -t 226.40.10.12 -r 20
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c4 -i0 -z0 -s CH1_IN_ADDR -t 226.40.10.12 -r 20
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c5 -i0 -z0 -s MR2_IN_ADDR -t 226.40.10.13 -r 20
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c5 -i0 -z0 -s CH1_IN_ADDR -t 226.40.10.13 -r 20
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c6 -i0 -z0 -s MR2_IN_ADDR -t 226.40.10.14 -r 20
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c6 -i0 -z0 -s CH1_IN_ADDR -t 226.40.10.14 -r 20
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c7 -i0 -z0 -s MR2_IN_ADDR -t 226.40.10.15 -r 20
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c7 -i0 -z0 -s CH1_IN_ADDR -t 226.40.10.15 -r 20
#CH1 Broadcast (transmission of Router ADV)
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c0 -i0 -z0 -x $CH1_IN6_ADDR -y ff02::1 -r 3
echo Configuring interfaces on CH
#Multicast
#sudo ifconfig eth0 192.168.8.2
sudo route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0
# Bring up openair NASMESH device and set IPv6 address
sudo ifconfig nasmesh0 up
sudo ip addr add $CH1_IN_ADDR/24 dev nasmesh0
sudo ip -6 addr add $CH1_IN6_ADDR/64 dev nasmesh0
echo nasmesh0 is $CH1_IN6_ADDR
echo No MPLS debug
sudo sh -c 'echo "0" >/sys/mpls/debug'
sleep 1
#rajout THC pour MULTICAST
echo Multicast state launched with config_ch2
xterm -hold -e /usr/bin/perl $REFLECTOR_DIR/reflector_launch.pl $REFLECTOR_DIR $REFLECTOR_DIR/config_ch2 &
sleep 1
echo Launching AS simulator
export OPENAIR2_DIR
xterm -T CH1 -hold -e sh start_openair2_ch1.sh &
sleep 1
#!/bin/bash
#Phil, 25 july 08
#Cluster Head (1) – with NAS_MPLS_PMIP working
source params.sh
./ch1_conf_nas_eads.sh
#MN1->MN2
./mpls_nas.sh $MR1_LABEL_OUT $MR2_IN6_ADDR1 $MR2_CH1_LABEL_IN
#MN2->MN1
./mpls_nas.sh $MR2_CH1_LABEL_OUT $MR1_IN6_ADDR $MR1_LABEL_IN
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 $OPENAIR3_HOME/pmip6d/pmip6d -c -L $CH1_IN6_ADDR -A $CH2_IN6_ADDR
sudo $OPENAIR3_HOME/pmip6d/pmip6d -c -L $CH1_IN6_ADDR -A $CH2_IN6_ADDR
./del_mpls.sh
#!/bin/bash
#Phil, 25 july 08
#Cluster Head (1) – with NAS_MPLS_PMIP working
source params.sh
./ch1_conf_nas_eads.sh
#MN1->MN2
./mpls_nas.sh $MR1_LABEL_OUT $MR2_IN6_ADDR1 $MR2_CH1_LABEL_IN
#MN2->MN1
./mpls_nas.sh $MR2_CH1_LABEL_OUT $MR1_IN6_ADDR $MR1_LABEL_IN
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 $OPENAIR3_HOME/pmip6d/pmip6d -c -L $CH1_IN6_ADDR -A $CH2_IN6_ADDR
sudo $OPENAIR3_HOME/pmip6d/pmip6d -c -L $CH1_IN6_ADDR -A $CH2_IN6_ADDR
sleep 2
./del_mpls.sh
#!/bin/bash
#Phil, 25 july 08
#Cluster Head (1) – with NAS_MPLS_PMIP working
source params.sh
./ch1_conf_nas_eads.sh
#MN1->MN2
./mpls_nas.sh $MR1_LABEL_OUT $MR2_IN6_ADDR1 $MR2_CH1_LABEL_IN
#MN2->MN1
./mpls_nas.sh $MR2_CH1_LABEL_OUT $MR1_IN6_ADDR $MR1_LABEL_IN
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 $OPENAIR3_HOME/PMIP6D/pmip6d -c -L $CH1_IN6_ADDR -A $CH2_IN6_ADDR -P 7778
sudo xterm -hold -e $OPENAIR3_HOME/PMIP6D/pmip6d -c -L $CH1_IN6_ADDR -A $CH2_IN6_ADDR -P 7778 &
sleep 1
echo $OPENAIR3_HOME/PMIP6D/pmip6d -m -s -L $CH1_IN6_ADDR -N $CH1_EG6_ADDR -E $CH1_IN6_ADDR
sudo $OPENAIR3_HOME/PMIP6D/pmip6d -m -s -L $CH1_IN6_ADDR -N $CH1_EG6_ADDR -E $CH1_IN6_ADDR
sleep 2
./del_mpls.sh
#!/bin/bash
source params.sh
echo Clusterhead address is $CH2_IN6_ADDR
# Installing NASMESH driver
sudo rmmod -f nasmesh
sudo insmod $OPENAIR2_DIR/NAS/DRIVER/MESH/nasmesh.ko nas_IMEI=0x12345678,0x01000000
echo Classification rules for CH2
#CH2<-> MR2 IP Signaling
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c1 -i0 -z0 -x $CH2_IN6_ADDR -y $MR2_IN6_ADDR2 -r 20
#CH<-> MR1 MPLS user-plane bearer
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c1 -i0 -z0 -l $MR2_CH2_LABEL_IN -m $MR2_CH2_LABEL_OUT -r 21
#CH2<-> MR2 MPLS PMIP Signaling
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c3 -i0 -z0 -l $CH2_MR2_CH1_LABEL_OUT -m $CH2_MR2_CH1_LABEL_IN -r 20
#CH2<-> MR2 Imulticast
echo EADS Multicast for MR2
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c2 -i0 -z0 -s CH2_IN_ADDR -t 226.50.10.10 -r 20
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c2 -i0 -z0 -s MR2_IN_ADDR -t 226.50.10.10 -r 20
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c3 -i0 -z0 -s CH2_IN_ADDR -t 226.50.10.11 -r 20
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c3 -i0 -z0 -s MR2_IN_ADDR -t 226.50.10.11 -r 20
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c4 -i0 -z0 -s CH2_IN_ADDR -t 226.50.10.12 -r 20
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c4 -i0 -z0 -s MR2_IN_ADDR -t 226.50.10.12 -r 20
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c5 -i0 -z0 -s CH2_IN_ADDR -t 226.50.10.13 -r 20
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c5 -i0 -z0 -s MR2_IN_ADDR -t 226.50.10.13 -r 20
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c6 -i0 -z0 -s CH2_IN_ADDR -t 226.50.10.14 -r 20
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c6 -i0 -z0 -s MR2_IN_ADDR -t 226.50.10.14 -r 20
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c7 -i0 -z0 -s MR2_IN_ADDR -t 226.50.10.15 -r 20
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c7 -i0 -z0 -s CH2_IN_ADDR -t 226.50.10.15 -r 20
#CH2<-> MR3 (IP Signaling)
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c2 -i0 -z0 -x $CH2_IN6_ADDR -y $MR3_IN6_ADDR -r 28
#CH2<-> MR3 (MPLS user-plane bearer)
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c2 -i0 -z0 -l $MR3_LABEL_IN -m $MR3_LABEL_OUT -r 29
#CH2 Broadcast (transmission of Router ADV)
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c0 -i0 -z0 -x $CH2_IN6_ADDR -y ff02::1 -r 3
#CH2<-> MR3 multicast EADS (rajout THC)
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c2 -i0 -z0 -s MR3_IN_ADDR -t 226.30.10.10 -r 28
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c2 -i0 -z0 -s CH2_IN_ADDR -t 226.30.10.10 -r 28
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c3 -i0 -z0 -s MR3_IN_ADDR -t 226.30.10.11 -r 28
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c3 -i0 -z0 -s CH2_IN_ADDR -t 226.30.10.11 -r 28
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c4 -i0 -z0 -s MR3_IN_ADDR -t 226.30.10.12 -r 28
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c4 -i0 -z0 -s CH2_IN_ADDR -t 226.30.10.12 -r 28
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c5 -i0 -z0 -s MR3_IN_ADDR -t 226.30.10.13 -r 28
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c5 -i0 -z0 -s CH2_IN_ADDR -t 226.30.10.13 -r 28
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c6 -i0 -z0 -s MR3_IN_ADDR -t 226.30.10.14 -r 28
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c6 -i0 -z0 -s CH2_IN_ADDR -t 226.30.10.14 -r 28
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c7 -i0 -z0 -s MR3_IN_ADDR -t 226.30.10.15 -r 28
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c7 -i0 -z0 -s CH2_IN_ADDR -t 226.30.10.15 -r 28
echo Configuring interfaces on CH2
##Multicast
#ifconfig eth0 192.168.8.4
sudo route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0
# Bring up openair NASMESH device and set IPv6 address
sudo ifconfig nasmesh0 up
sudo ip addr add $CH2_IN_ADDR/24 dev nasmesh0
sudo ip -6 addr add $CH2_IN6_ADDR/64 dev nasmesh0
echo nasmesh0 is $CH2_IN6_ADDR
echo No MPLS debug
sudo sh -c 'echo "0" >/sys/mpls/debug'
sleep 1
#rajout THC pour MULTICAST
echo Multicast state launched with config_ch2
xterm -hold -e /usr/bin/perl $REFLECTOR_DIR/reflector_launch.pl $REFLECTOR_DIR $REFLECTOR_DIR/config_ch2 &
sleep 1
echo Launching AS simulator
export OPENAIR2_DIR
xterm -T CH2 -hold -e sh start_openair2_ch2.sh &
sleep 1
#!/bin/bash
#CH2_NAS.SH
#Cluster Head (2)– with NAS_MPLS_PMIP working
#Phil, 25 july 08
source params.sh
./ch2_conf_nas_eads.sh
#MN1->MN2
./mpls_nas.sh $MR2_CH2_LABEL_OUT $MR3_IN6_ADDR $MR3_LABEL_IN
#MN2->MN1
./mpls_nas.sh $MR3_LABEL_OUT $MR2_IN6_ADDR2 $MR2_CH2_LABEL_IN
echo 'CH1->MR2->CH2'
mpls labelspace set dev nasmesh0 labelspace 0
mpls ilm add label gen $CH2_MR2_CH1_LABEL_IN labelspace 0 proto ipv6
echo 'CH1->MR2->CH2'
var=`mpls nhlfe add key 0 instructions push gen $CH2_MR2_CH1_LABEL_OUT nexthop nasmesh0 ipv6 $MR2_IN6_ADDR2 | grep key |cut -c 17-26`
echo "Creating routes"
sudo ip -6 route add $CH1_IN6_ADDR/128 via $MR2_IN6_ADDR2 mpls $var
echo $OPENAIR3_HOME/pmip6d/pmip6d -c -L $CH2_IN6_ADDR -A $CH1_IN6_ADDR
sudo $OPENAIR3_HOME/pmip6d/pmip6d -c -L $CH2_IN6_ADDR -A $CH1_IN6_ADDR
./del_mpls.sh
#!/bin/bash
#CH2_NAS.SH
#Cluster Head (2)– with NAS_MPLS_PMIP working
#Phil, 25 july 08
source params.sh
./ch2_conf_nas_eads.sh
#MN1->MN2
./mpls_nas.sh $MR2_CH2_LABEL_OUT $MR3_IN6_ADDR $MR3_LABEL_IN
#MN2->MN1
./mpls_nas.sh $MR3_LABEL_OUT $MR2_IN6_ADDR2 $MR2_CH2_LABEL_IN
echo 'CH1->MR2->CH2'
mpls labelspace set dev nasmesh0 labelspace 0
mpls ilm add label gen $CH2_MR2_CH1_LABEL_IN labelspace 0 proto ipv6
echo 'CH1->MR2->CH2'
var=`mpls nhlfe add key 0 instructions push gen $CH2_MR2_CH1_LABEL_OUT nexthop nasmesh0 ipv6 $MR2_IN6_ADDR2 | grep key |cut -c 17-26`
echo "Creating routes"
sudo ip -6 route add $CH1_IN6_ADDR/128 via $MR2_IN6_ADDR2 mpls $var
echo $OPENAIR3_HOME/PMIP6D/pmip6d -c -L $CH2_IN6_ADDR -A $CH1_IN6_ADDR
sudo $OPENAIR3_HOME/PMIP6D/pmip6d -c -L $CH2_IN6_ADDR -A $CH1_IN6_ADDR
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
#Huu-Nghia, Philippe, Lamia 28 june 2008
#echo Deleting MN1 autoconfigured addresse
#$OPENAIR3_SCRIPTS_PATH/mn1_del.sh
#ip -6 route add 2001:660:5502::25/128 via 2001:660:5502::10 dev eth0
ip addr add $MN1_IN_ADDR/32 dev eth0
ip -6 addr del 2001:660:5502::15/64 dev eth0
ip -6 addr add 2001:660:5502::15/64 dev eth0
#!/bin/bash
#Huu-Nghia, Philippe, Lamia 28 june 2008
#echo Deleting MN1 autoconfigured addresse
#$OPENAIR3_SCRIPTS_PATH/mn1_del.sh
#ip -6 route add 2001:660:5502::25/128 via 2001:660:5502::10 dev eth0
ip addr add $MN2_IN_ADDR/32 dev eth0
ip -6 addr del 2001:660:5502::25/64 dev eth0
ip -6 addr add 2001:660:5502::25/64 dev eth0
#!/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
source params.sh
export OPENAIR2_DIR
#echo "0" >/proc/sys/net/ipv6/conf/all/forwarding
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
#Multicast
#ifconfig eth1 192.168.8.1
sudo route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0
echo Configuring interfaces on mr1
#sudo ifconfig nasmesh0 up
#sudo ifconfig nasmesh0 up
sudo ip link set nasmesh0 up
sudo ip addr add $MR1_IN_ADDR/32 dev nasmesh0
sudo ip -6 addr add $MR1_IN6_ADDR/64 dev nasmesh0
sudo ip addr add $MR1_EG_ADDR/32 dev $ETH_MR1
sudo ip -6 addr add $MR1_EG6_ADDR/64 dev $ETH_MR1
echo Classification rules for MR1 - Default DTCH UL for L3 signaling
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c1 -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 $MR1_LABEL_OUT -m $MR1_LABEL_IN -r 5
#MR1<-> CH1 multicast (rajout THC)
echo EADS Multicast for MR1
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c2 -i0 -z0 -s CH1_IN_ADDR -t 226.30.10.10 -r 4
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c2 -i0 -z0 -s MR1_IN_ADDR -t 226.30.10.10 -r 4
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c3 -i0 -z0 -s CH1_IN_ADDR -t 226.30.10.11 -r 4
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c3 -i0 -z0 -s MR1_IN_ADDR -t 226.30.10.11 -r 4
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c4 -i0 -z0 -s CH1_IN_ADDR -t 226.30.10.12 -r 4
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c4 -i0 -z0 -s MR1_IN_ADDR -t 226.30.10.12 -r 4
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c5 -i0 -z0 -s CH1_IN_ADDR -t 226.30.10.13 -r 4
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c5 -i0 -z0 -s MR1_IN_ADDR -t 226.30.10.13 -r 4
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c6 -i0 -z0 -s CH1_IN_ADDR -t 226.30.10.14 -r 4
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c6 -i0 -z0 -s MR1_IN_ADDR -t 226.30.10.14 -r 4
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c7 -i0 -z0 -s MR1_IN_ADDR -t 226.30.10.15 -r 4
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c7 -i0 -z0 -s CH1_IN_ADDR -t 226.30.10.15 -r 4
sleep 1
#rajout THC pour MULTICAST
echo Multicast state launched with config_ch2
xterm -hold -e /usr/bin/perl $REFLECTOR_DIR/reflector_launch.pl $REFLECTOR_DIR $REFLECTOR_DIR/config_mr1 &
sleep 1
echo Launching AS simulator
xterm -T MR1 -hold -e sh start_openair2_mr1.sh &
#!/bin/bash
# Author: Lamia Romdhani
#June 2008
source params.sh
sudo modprobe mpls6
echo Starting routing ...
echo No MPLS debug
sudo sh -c 'echo 0 >/sys/mpls/debug'
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"
sudo ip -6 route add $MN2_IN6_ADDR/128 via $CH1_IN6_ADDR mpls $var
echo Setting MPLS for mr1
echo 'MN2->MN1'
sudo mpls labelspace set dev nasmesh0 labelspace 0
sudo mpls ilm add label gen $MR1_LABEL_IN labelspace 0 proto ipv6
sudo ip -6 route add $MN1_IN6_ADDR/128 dev $ETH_MR1
#!/bin/bash
source params.sh
sudo sysctl -w net.ipv6.conf.all.forwarding=1
#./del_mpls.sh
./mr1_conf_nas_eads.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 $ETH_MR1 promisc
sudo ip -6 addr add $MR1_EG6_ADDR/64 dev $ETH_MR1
sudo $OPENAIR3_PMIP6D_PATH/pmip6d -m -s -L $CH1_IN6_ADDR -N $MR1_EG6_ADDR -E $MR1_IN6_ADDR
./del_mpls.sh
#!/bin/bash
source params.sh
sudo sysctl -w net.ipv6.conf.all.forwarding=1
#./del_mpls.sh
./mr1_conf_nas_eads.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 $ETH_MR1 promisc
sudo ip -6 addr add $MR1_EG6_ADDR/64 dev $ETH_MR1
sudo $OPENAIR3_PMIP6D_PATH/pmip6d -m -s -L $CH1_IN6_ADDR -N $MR1_EG6_ADDR -E $MR1_IN6_ADDR
./del_mpls.sh
#!/bin/bash
source params.sh
export OPENAIR2_DIR
#echo "0" >/proc/sys/net/ipv6/conf/all/forwarding
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
echo Configuring interfaces on mr2
sudo ifconfig nasmesh0 up
sudo ifconfig nasmesh0 $MR2_IN_ADDR
sudo ip -6 addr add $MR2_IN6_ADDR1/64 dev nasmesh0
sudo ip -6 addr add $MR2_IN6_ADDR2/64 dev nasmesh0
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 -c1 -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 4
#MR2<-> CH1 multicast (rajout THC)
echo EADS Multicast for MR2
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c2 -i0 -z0 -s CH1_IN_ADDR -t 226.40.10.10 -r 4
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c2 -i0 -z0 -s MR2_IN_ADDR -t 226.40.10.10 -r 4
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c3 -i0 -z0 -s CH1_IN_ADDR -t 226.40.10.11 -r 4
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c3 -i0 -z0 -s MR2_IN_ADDR -t 226.40.10.11 -r 4
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c4 -i0 -z0 -s CH1_IN_ADDR -t 226.40.10.12 -r 4
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c4 -i0 -z0 -s MR2_IN_ADDR -t 226.40.10.12 -r 4
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c5 -i0 -z0 -s CH1_IN_ADDR -t 226.40.10.13 -r 4
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c5 -i0 -z0 -s MR2_IN_ADDR -t 226.40.10.13 -r 4
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c6 -i0 -z0 -s CH1_IN_ADDR -t 226.40.10.14 -r 4
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c6 -i0 -z0 -s MR2_IN_ADDR -t 226.40.10.14 -r 4
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c7 -i0 -z0 -s MR2_IN_ADDR -t 226.40.10.15 -r 4
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c7 -i0 -z0 -s CH1_IN_ADDR -t 226.40.10.15 -r 4
echo Classification rules for MR2 -Cluster 2 - Default DTCH UL for L3 signaling
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c2 -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 -c2 -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 -c4 -i0 -z0 -l $CH2_MR2_CH1_LABEL_IN -m $CH2_MR2_CH1_LABEL_OUT -r 12
#MR2<-> CH2 multicast
echo EADS Multicast for MR2
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c2 -i0 -z0 -s CH2_IN_ADDR -t 226.50.10.10 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c2 -i0 -z0 -s MR2_IN_ADDR -t 226.50.10.10 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c3 -i0 -z0 -s CH2_IN_ADDR -t 226.50.10.11 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c3 -i0 -z0 -s MR2_IN_ADDR -t 226.50.10.11 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c4 -i0 -z0 -s CH2_IN_ADDR -t 226.50.10.12 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c4 -i0 -z0 -s MR2_IN_ADDR -t 226.50.10.12 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c5 -i0 -z0 -s CH2_IN_ADDR -t 226.50.10.13 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c5 -i0 -z0 -s MR2_IN_ADDR -t 226.50.10.13 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c6 -i0 -z0 -s CH2_IN_ADDR -t 226.50.10.14 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c6 -i0 -z0 -s MR2_IN_ADDR -t 226.50.10.14 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c7 -i0 -z0 -s MR2_IN_ADDR -t 226.50.10.15 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c7 -i0 -z0 -s CH2_IN_ADDR -t 226.50.10.15 -r 12
sleep 1
#rajout THC pour MULTICAST
echo Multicast state launched with config_ch2
xterm -hold -e /usr/bin/perl $REFLECTOR_DIR/reflector_launch.pl $REFLECTOR_DIR $REFLECTOR_DIR/config_mr2 &
sleep 1
echo Launching AS simulator
xterm -T MR2 -hold -e sh start_openair2_mr2.sh &
#!/bin/bash
source params.sh
sudo sysctl -w net.ipv6.conf.all.forwarding=1
#sudo sh -c 'echo 0 >/sys/mpls/debug
./del_mpls.sh
./mr2_conf_nas_eads.sh
#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
sudo sysctl -w net.ipv6.conf.eth0.proxy_ndp=1
sudo sysctl -w net.ipv6.conf.nasmesh0.proxy_ndp=1
#!/bin/bash
source params.sh
sudo sysctl -w net.ipv6.conf.all.forwarding=1
#sudo sh -c 'echo 0 >/sys/mpls/debug
./del_mpls.sh
./mr2_conf_nas_eads.sh
#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
sudo sysctl -w net.ipv6.conf.eth0.proxy_ndp=1
sudo sysctl -w net.ipv6.conf.nasmesh0.proxy_ndp=1
source params.sh
export OPENAIR2_DIR
#echo "0" >/proc/sys/net/ipv6/conf/all/forwarding
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 11
echo Configuring interfaces on mr3
#Multicast
#ifconfig eth1 192.168.8.5
sudo route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0
#sudo ifconfig nasmesh0 up
#sudo ifconfig nasmesh0 $MR3_IN_ADDR
sudo ip link set nasmesh0 up
sudo ip addr add $MR3_IN_ADDR/32 dev nasmesh0
sudo ip -6 addr add $MR3_IN6_ADDR/64 dev nasmesh0
sudo ip addr add $MR3_EG_ADDR/32 dev $ETH_MR3
sudo ip -6 addr add $MR3_EG6_ADDR/64 dev $ETH_MR3
echo Classification rules for MR3 - Default DTCH UL for L3 signaling
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c1 -i0 -z0 -x $MR3_IN6_ADDR -y $CH2_IN6_ADDR -r 12
echo Classification rules for MR3 - MPLS User-plane Bearer
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c1 -i0 -z0 -l $MR3_LABEL_OUT -m $MR3_LABEL_IN -r 13
#MR3<-> CH2 multicast (rajout THC)
echo EADS Multicast for MR3
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c2 -i0 -z0 -s CH2_IN_ADDR -t 226.30.10.10 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c2 -i0 -z0 -s MR3_IN_ADDR -t 226.30.10.10 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c3 -i0 -z0 -s CH2_IN_ADDR -t 226.30.10.11 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c3 -i0 -z0 -s MR3_IN_ADDR -t 226.30.10.11 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c4 -i0 -z0 -s CH2_IN_ADDR -t 226.30.10.12 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c4 -i0 -z0 -s MR3_IN_ADDR -t 226.30.10.12 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c5 -i0 -z0 -s CH2_IN_ADDR -t 226.30.10.13 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c5 -i0 -z0 -s MR3_IN_ADDR -t 226.30.10.13 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c6 -i0 -z0 -s CH2_IN_ADDR -t 226.30.10.14 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c6 -i0 -z0 -s MR3_IN_ADDR -t 226.30.10.14 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c7 -i0 -z0 -s MR3_IN_ADDR -t 226.30.10.15 -r 12
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c7 -i0 -z0 -s CH2_IN_ADDR -t 226.30.10.15 -r 12
#rajout THC pour MULTICAST
echo Multicast state launched with config_ch2
xterm -hold -e /usr/bin/perl $REFLECTOR_DIR/reflector_launch.pl $REFLECTOR_DIR $REFLECTOR_DIR/config_mr3 &
sleep 1
echo Launching AS simulator
sudo xterm -T MR3 -hold -e sh start_openair2_mr3.sh &
#!/bin/bash
# Author: Lamia Romdhani
#June 2008
source params.sh
sudo modprobe mpls6
echo Starting routing ...
echo No MPLS debug
sudo sh -c 'echo 0 >/sys/mpls/debug'
echo Setting MPLS for mr3
echo 'MN1->MN2'
#pop label 4000 and do Ip lookup.
sudo mpls labelspace set dev nasmesh0 labelspace 0
sudo mpls ilm add label gen $MR3_LABEL_IN labelspace 0 proto ipv6
echo 'MN2->MN1'
# add label 3000 and forward the packets to mr2, for destination MN1
var=`mpls nhlfe add key 0 instructions push gen $MR3_LABEL_OUT nexthop nasmesh0 ipv6 $CH2_IN6_ADDR |grep key | cut -c 17-26`
echo "Creating routes"
sudo ip -6 route add $MN1_IN6_ADDR/128 via $CH2_IN6_ADDR mpls $var
sudo ip -6 route add $MN2_IN6_ADDR/128 dev $ETH_MR3
sudo ip -6 route add $MN3_IN6_ADDR/128 dev $ETH_MR3
#!/bin/bash
source params.sh
sudo sysctl -w net.ipv6.conf.all.forwarding=1
#./del_mpls.sh
./mr3_conf_nas_eads.sh
./mr3_mpls_nas.sh
#/etc/init.d/radvd status
#/etc/init.d/radvd start
#radvdump
sudo sysctl -w net.ipv6.conf.eth0.proxy_ndp=1
sudo sysctl -w net.ipv6.conf.nasmesh0.proxy_ndp=1
sudo ifconfig $ETH_MR3 promisc
sudo ip -6 addr add $MR3_EG6_ADDR/64 dev $ETH_MR3
sudo $OPENAIR3_PMIP6D_PATH/pmip6d -m -s -L $CH2_IN6_ADDR -N $MR3_EG6_ADDR -E $MR3_IN6_ADDR
./del_mpls.sh
#!/bin/bash
source params.sh
sudo sysctl -w net.ipv6.conf.all.forwarding=1
#./del_mpls.sh
./mr3_conf_nas_eads.sh
./mr3_mpls_nas.sh
#/etc/init.d/radvd status
#/etc/init.d/radvd start
#radvdump
sudo sysctl -w net.ipv6.conf.eth0.proxy_ndp=1
sudo sysctl -w net.ipv6.conf.nasmesh0.proxy_ndp=1
sudo ifconfig $ETH_MR3 promisc
sudo ip -6 addr add $MR3_EG6_ADDR/64 dev $ETH_MR3
sudo $OPENAIR3_PMIP6D_PATH/pmip6d -m -s -L $CH2_IN6_ADDR -N $MR3_EG6_ADDR -E $MR3_IN6_ADDR
./del_mpls.sh
#!/bin/bash
MR1_IN_ADDR=10.0.1.3
MR1_IN6_ADDR=2001:10:0:1:7856:3412:0:2
MR1_EG_ADDR=192.168.9.1
MR1_EG6_ADDR=2001:660:5502::100
# Flow CH1->MR1
MR1_LABEL_IN=1001
# Flow MR1->CH1
MR1_LABEL_OUT=1000
ETH_MR1=eth2
MR2_IN_ADDR=10.0.1.4
MR2_IN6_ADDR1=2001:10:0:1:7856:3412:0:3
MR2_IN6_ADDR2=2001:10:0:2:7856:3412:0:3
MR2_EG6_ADDR=2001:660:5502::300
# Flow CH1->MR2
MR2_CH1_LABEL_IN=2000
# Flow MR2->CH1
MR2_CH1_LABEL_OUT=2001
# Flow CH2->MR2
MR2_CH2_LABEL_IN=3000
# Flow MR2->CH2
MR2_CH2_LABEL_OUT=3001
MR3_IN_ADDR=10.0.1.5
MR3_IN6_ADDR=2001:10:0:2:7856:3412:0:2
MR3_EG_ADDR=192.168.10.1
MR3_EG6_ADDR=2001:660:5502::200
# Flow CH2->MR3
MR3_LABEL_IN=4000
# Flow MR3->CH2
MR3_LABEL_OUT=4001
ETH_MR3=eth3
CH1_IN_ADDR=10.0.1.1
CH2_IN_ADDR=10.0.1.2
CH1_IN6_ADDR=2001:10:0:1:7856:3412:0:1
CH1_EG6_ADDR=2001:660:5502::400
CH2_IN6_ADDR=2001:10:0:2:7856:3412:0:1
## Communication between the CHs
CH1_MR2_CH2_LABEL_IN=8001
CH1_MR2_CH2_LABEL_OUT=8000
CH2_MR2_CH1_LABEL_IN=9001
CH2_MR2_CH1_LABEL_OUT=9000
#MN1_IN6_ADDR=2001:660:5502::20
#MN2_IN6_ADDR=2001:660:5502::25
MN1_IN6_ADDR=2001:660:5502::110
MN1_IN_ADDR=192.168.9.2
MN2_IN6_ADDR=2001:660:5502::210
MN3_IN6_ADDR=2001:660:5502::220
MN2_IN_ADDR=192.168.10.2
# Put the right OPENAIR3 path here
OPENAIR3_HOME=/homes/foubert/Openair/openair3
OPENAIR3_PMIP6D_PATH=$OPENAIR3_HOME/PMIP6D
#OPENAIR3_SCRIPTS_PATH=$OPENAIR3_HOME/scripts
#REFLECTOR_DIR=$OPENAIR3_HOME/EXAMPLES/MULTICAST_2CHS/REFLECTOR
# Put the right OPENAIR2 path here
#OPENAIR2_DIR=~/openair2_r234/openair2/
#OPENAIR2_DIR=~/CHORIST_2CHs_EMULATION_MULTICAST_20090119/openair2
# Multicast Reflector
#REFLECTOR_DIR=~/CHORIST_2CHs_EMULATION_MULTICAST_20090119/openair3/EXAMPLES/MULTICAST_2CHS/REFLECTOR
source params.sh
ip -6 route add 2001:660::/4 dev eth0
modprobe ip6_tunnel
ip -6 tunnel add tunMN1toMN2 mode ipip6 remote $MN2_IN6_ADDR local $MN1_IN6_ADDR dev eth0
ip link set dev tunMN1toMN2 up
sudo ip -6 addr add 4001:660:5502::20 dev tunMN1toMN2
echo "redirection of the ipv4 traffic to the tunMN1toMN2 tunnel"
ip route add 192.168.1.0/24 dev tunMN1toMN2
echo "1" >/proc/sys/net/ipv6/conf/all/forwarding
echo "1" >/proc/sys/net/ipv4/ip_forward
source params.sh
ip -6 route add 2001:660::/4 dev eth0
modprobe ip6_tunnel
/opt/iproute2-2.6.26/ip/ip -6 tunnel add tunMN2toMN1 mode ipip6 remote $MN1_IN6_ADDR local $MN2_IN6_ADDR dev eth0
/opt/iproute2-2.6.26/ip/ip link set dev tunMN2toMN1 up
sudo ip -6 addr add 4001:660:5502::25 dev tunMN2toMN1
echo "redirection of the ipv4 traffic to our tunnel"
ip route add 192.168.3.0/24 dev tunMN2toMN1
echo "1" >/proc/sys/net/ipv6/conf/all/forwarding
echo "1" >/proc/sys/net/ipv4/ip_forward
source params.sh
cd $OPENAIR2_DIR/SIMULATION/USER_TOOLS/LAYER2_SIM
./mac_sim -m0 -t $OPENAIR2_DIR/SIMULATION/TOPOLOGIES/eth_5nodes.top
source params.sh
cd $OPENAIR2_DIR/SIMULATION/USER_TOOLS/LAYER2_SIM
./mac_sim -m1 -t $OPENAIR2_DIR/SIMULATION/TOPOLOGIES/eth_5nodes.top
#!/bin/bash
source params.sh
cd $OPENAIR2_DIR/SIMULATION/USER_TOOLS/LAYER2_SIM
./mac_sim -m2 -t $OPENAIR2_DIR/SIMULATION/TOPOLOGIES/eth_5nodes.top
#!/bin/bash
source params.sh
cd $OPENAIR2_DIR/SIMULATION/USER_TOOLS/LAYER2_SIM
./mac_sim -m3 -t $OPENAIR2_DIR/SIMULATION/TOPOLOGIES/eth_5nodes.top
source params.sh
cd $OPENAIR2_DIR/SIMULATION/USER_TOOLS/LAYER2_SIM
./mac_sim -m4 -t $OPENAIR2_DIR/SIMULATION/TOPOLOGIES/eth_5nodes.top
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