Commit fb34f9b9 authored by Navid Nikaein's avatar Navid Nikaein

updating the scripts for the distributed emulation

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@5768 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 222e7010
#!/bin/sh
GREEN='\E[32m'
NC='\e[0m'
# check the compilation
echo "Bringup eNB interface"
sudo rmmod nasmesh
make all
sudo insmod $OPENAIR2_DIR/NAS/DRIVER/MESH/nasmesh.ko
# set params
EMULATION_DEV_INTERFACE="eth0"
EMULATION_MULTICAST_GROUP=1
EMULATION_LOG_LEVEL=5 # 3 = error, 5 info, 7 debug, trace= 9
OAI_LOCAL_ADDRESS="10.0.1.1"
OAI_REMOTE_ADDRESS="10.0.1.2"
#EMULATION_DEV_ADDRESS= `hostname -I cut -f1 -d' '`
EMULATION_DEV_ADDRESS=`ifconfig $EMULATION_DEV_INTERFACE | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1}'`
echo "Setting Emulation Interface to $EMULATION_DEV_INTERFACE ($EMULATION_DEV_ADDRESS)"
#funcs
test_install_package() {
# usage: test_install_package package_name
if [ $# -eq 1 ]; then
dpkg -s "$1" > /dev/null 2>&1 && {
echo "$1 is installed."
} || {
echo "$1 is not installed."
sudo apt-get install --assume-yes $1
}
fi
}
#avoid conflict with reserved multicast addresses (224.0.0.11,224.0.0.13, 224.0.0.16)
#sudo route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0
sudo ip route add 239.0.0.160/28 dev eth0
echo "Make sure that eth0 is the interface between the machines, otherwise change"
sudo ip route add 239.0.0.160/28 dev $EMULATION_DEV_INTERFACE
sudo ifconfig oai0 $OAI_LOCAL_ADDRESS netmask 255.255.255.0 broadcast 10.0.1.255
echo "applying DRB classification"
echo "$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c0 -i0 -z0 -s $OAI_LOCAL_ADDRESS -t $OAI_REMOTE_ADDRESS -r 1"
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c0 -i0 -z0 -s $OAI_LOCAL_ADDRESS -t $OAI_REMOTE_ADDRESS -r 1
#PGM provide a reliable mutlicast data transport"
test_install_package libpgm-dev
test_install_package libpgm-5.1-0
PGM_FOUND=`dpkg-query -W -f='${Status}' libpgm-dev 2>/dev/null | grep -c "ok installed" `
sudo ifconfig oai0 10.0.1.1 netmask 255.255.255.0 broadcast 10.0.1.255
if [ $PGM_FOUND = 1 ]; then
PGM=-D$EMULATION_DEV_ADDRESS
else
PGM=" "
fi
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c0 -i0 -z0 -s 10.0.1.1 -t 10.0.1.2 -r 1
echo "to see eNB stats, pleasae run : watch_enb script"
if [ -z $1 ]; then
echo "nice -10 $OPENAIR_TARGETS/SIMU/USER/oaisim -u0 -M0 -p2 -g3 -l3 > /dev/null"
nice -10 $OPENAIR_TARGETS/SIMU/USER/oaisim -u0 -M0 -p2 -g3 -l3 > /dev/null
echo "$OPENAIR_TARGETS/SIMU/USER/oaisim -u0 -M0 -p2 -g$EMULATION_MULTICAST_GROUP -l$EMULATION_LOG_LEVEL $PGM > /dev/null"
sudo -E $OPENAIR_TARGETS/SIMU/USER/oaisim -u0 -M0 -p2 -g$EMULATION_MULTICAST_GROUP -l$EMULATION_LOG_LEVEL $PGM > /dev/null
else
if [ $1 = "all" ]; then
echo "nice -10 $OPENAIR_TARGETS/SIMU/USER/oaisim -u0 -M0 -p2 -g3 -l7"
nice -10 $OPENAIR_TARGETS/SIMU/USER/oaisim -u0 -M0 -p2 -g3 -l7
echo "$OPENAIR_TARGETS/SIMU/USER/oaisim -u0 -M0 -p2 -g$EMULATION_MULTICAST_GROUP -l$EMULATION_LOG_LEVEL $PGM"
sudo -E OPENAIR_TARGETS/SIMU/USER/oaisim -u0 -M0 -p2 -g$EMULATION_MULTICAST_GROUP -l$EMULATION_LOG_LEVEL $PGM
else
echo "nice -10 $OPENAIR_TARGETS/SIMU/USER/oaisim -u0 -M0 -p2 -g3 -l7 | grep -i $1"
nice -10 $OPENAIR_TARGETS/SIMU/USER/oaisim -u0 -M0 -p2 -g3 -l7 | grep -i $1
echo "$OPENAIR_TARGETS/SIMU/USER/oaisim -u0 -M0 -p2 -g$EMULATION_MULTICAST_GROUP -l$EMULATION_LOG_LEVEL $PGM | grep -i $1"
sudo -E $OPENAIR_TARGETS/SIMU/USER/oaisim -u0 -M0 -p2 -g$EMULATION_MULTICAST_GROUP -l$EMULATION_LOG_LEVEL $PGM | grep -i $1
fi
fi
echo "End"
#!/bin/sh
echo "Bringup UE interface"
sudo rmmod nasmesh
make nasmesh all
sudo insmod $OPENAIR2_DIR/NAS/DRIVER/MESH/nasmesh.ko
# set params
EMULATION_DEV_INTERFACE="eth0"
EMULATION_MULTICAST_GROUP=1
EMULATION_LOG_LEVEL=5 # 3 = error, 5 info, 7 debug, trace= 9
OAI_LOCAL_ADDRESS="10.0.1.2"
OAI_REMOTE_ADDRESS="10.0.1.1"
#EMULATION_DEV_ADDRESS= `hostname -I cut -f1 -d' '`
EMULATION_DEV_ADDRESS=`ifconfig $EMULATION_DEV_INTERFACE | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1}'`
echo "Setting Emulation Interface to $EMULATION_DEV_INTERFACE ($EMULATION_DEV_ADDRESS)"
#funcs
test_install_package() {
# usage: test_install_package package_name
if [ $# -eq 1 ]; then
dpkg -s "$1" > /dev/null 2>&1 && {
echo "$1 is installed."
} || {
echo "$1 is not installed."
sudo apt-get install --assume-yes $1
}
fi
}
#avoid conflict with reserved multicast addresses (224.0.0.11,224.0.0.13, 224.0.0.16)
#sudo route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0
sudo ip route add 239.0.0.160/28 dev eth0
echo "Make sure that eth0 is the interface between the machines, otherwise change"
sudo ip route add 239.0.0.160/28 dev $EMULATION_DEV_INTERFACE
sudo ifconfig oai0 10.0.1.2 netmask 255.255.255.0 broadcast 10.0.1.255
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c0 -i0 -z0 -s 10.0.1.2 -t 10.0.1.1 -r 1
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c0 -i0 -z0 -s $OAI_LOCAL_ADDRESS -t $OAI_REMOTE_ADDRESS -r 1
#PGM provide a reliable mutlicast data transport"
test_install_package libpgm-dev
test_install_package libpgm-5.1-0
PGM_FOUND=`dpkg-query -W -f='${Status}' libpgm-dev 2>/dev/null | grep -c "ok installed" `
if [ $PGM_FOUND = 1 ]; then
PGM=-D$EMULATION_DEV_ADDRESS
else
PGM=" "
fi
echo "to see UE stats, pleasae run : watch_ue script"
# running oaisim
if [ -z $1 ]; then
echo "nice -10 $OPENAIR_TARGETS/SIMU/USER/oaisim -b0 -M1 -p2 -g3 -l3 > /dev/null"
nice -10 $OPENAIR_TARGETS/SIMU/USER/oaisim -b0 -M1 -p2 -g3 -l3 > /dev/null
echo "$OPENAIR_TARGETS/SIMU/USER/oaisim -b0 -M1 -p2 -g$EMULATION_MULTICAST_GROUP -l$EMULATION_LOG_LEVEL $PGM > /dev/null"
sudo -E $OPENAIR_TARGETS/SIMU/USER/oaisim -b0 -M1 -p2 -g$EMULATION_MULTICAST_GROUP -l$EMULATION_LOG_LEVEL $PGM > /dev/null
else
if [ $1 = "all" ]; then
echo "nice -10 $OPENAIR_TARGETS/SIMU/USER/oaisim -b0 -M1 -p2 -g3 -l7"
nice -10 $OPENAIR_TARGETS/SIMU/USER/oaisim -b0 -M1 -p2 -g3 -l7
echo "$OPENAIR_TARGETS/SIMU/USER/oaisim -b0 -M1 -p2 -g$EMULATION_MULTICAST_GROUP -l$EMULATION_LOG_LEVEL $PGM "
sudo -E $OPENAIR_TARGETS/SIMU/USER/oaisim -b0 -M1 -p2 -g$EMULATION_MULTICAST_GROUP -l$EMULATION_LOG_LEVEL $PGM
else
echo "nice -10 $OPENAIR_TARGETS/SIMU/USER/oaisim -b0 -M1 -p2 -g3 -l7 | grep -i $1"
nice -10 $OPENAIR_TARGETS/SIMU/USER/oaisim -b0 -M1 -p2 -g3 -l7 | grep -i $1
echo "$OPENAIR_TARGETS/SIMU/USER/oaisim -b0 -M1 -p2 -g$EMULATION_MULTICAST_GROUP -l$EMULATION_LOG_LEVEL $PGM | grep -i $1"
sudo -E $OPENAIR_TARGETS/SIMU/USER/oaisim -b0 -M1 -p2 -g$EMULATION_MULTICAST_GROUP -l$EMULATION_LOG_LEVEL $PGM | grep -i $1
fi
fi
echo "End"
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