Commit f2477eab authored by Lionel Gauthier's avatar Lionel Gauthier

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@6169 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 268578e5
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
# email: lionel.gauthier@eurecom.fr # email: lionel.gauthier@eurecom.fr
########################################### ###########################################
# INPUT OF THIS SCRIPT: # INPUT OF THIS SCRIPT:
# THE DIRECTORY WHERE ARE LOCATED THE CONFIGURATION FILES # The eNB config file
######################################### #########################################
# This script start ENB # This script start ENB
# Depending on configuration files, it can be instanciated a virtual switch # Depending on configuration files, it can be instanciated a virtual switch
...@@ -48,47 +48,32 @@ ...@@ -48,47 +48,32 @@
########################################################### ###########################################################
declare EMULATION_DEV_INTERFACE="eth1" declare EMULATION_DEV_INTERFACE="eth1"
declare EMULATION_MULTICAST_GROUP=1 declare EMULATION_MULTICAST_GROUP=1
declare EMULATION_DEV_ADDRESS=`ifconfig $EMULATION_DEV_INTERFACE | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1}'`
declare MAKE_LTE_ACCESS_STRATUM_TARGET="oaisim DEBUG=1 ENABLE_ITTI=1 USE_MME=R10 LINK_PDCP_TO_GTPV1U=1 NAS=1 SECU=1 RRC_MSG_PRINT=1" declare MAKE_LTE_ACCESS_STRATUM_TARGET="oaisim DEBUG=1 ENABLE_ITTI=1 USE_MME=R10 LINK_PDCP_TO_GTPV1U=1 NAS=1 SECU=1 RRC_MSG_PRINT=1"
declare MAKE_LTE_ACCESS_STRATUM_TARGET_RTAI="lte-softmodem DEBUG=1 RTAI=1 HARD_RT=1 EXMIMO=1 ENABLE_ITTI=1 USE_MME=R10 LINK_PDCP_TO_GTPV1U=1 DISABLE_XER_PRINT=1 SECU=1 RRC_MSG_PRINT=1 " declare MAKE_LTE_ACCESS_STRATUM_TARGET_RTAI="lte-softmodem DEBUG=1 RTAI=1 HARD_RT=1 EXMIMO=1 ENABLE_ITTI=1 USE_MME=R10 LINK_PDCP_TO_GTPV1U=1 DISABLE_XER_PRINT=1 SECU=1 RRC_MSG_PRINT=1 "
declare MAKE_LTE_ACCESS_STRATUM_TARGET_LINUX_KERNEL="lte-softmodem DEBUG=1 RTAI=0 EXMIMO=1 ENABLE_ITTI=1 USE_MME=R10 LINK_PDCP_TO_GTPV1U=1 DISABLE_XER_PRINT=1 SECU=1 RRC_MSG_PRINT=1 " declare MAKE_LTE_ACCESS_STRATUM_TARGET_LINUX_KERNEL="lte-softmodem DEBUG=1 RTAI=0 EXMIMO=1 ENABLE_ITTI=1 USE_MME=R10 LINK_PDCP_TO_GTPV1U=1 DISABLE_XER_PRINT=1 SECU=1 RRC_MSG_PRINT=1 "
########################################################### ###########################################################
THIS_SCRIPT_PATH=$(dirname $(readlink -f $0)) THIS_SCRIPT_PATH=$(dirname $(readlink -f $0))
. $THIS_SCRIPT_PATH/utils.bash . $THIS_SCRIPT_PATH/utils.bash
. $THIS_SCRIPT_PATH/interfaces.bash . $THIS_SCRIPT_PATH/interfaces.bash
. $THIS_SCRIPT_PATH/networks.bash . $THIS_SCRIPT_PATH/networks.bash
########################################################### ###########################################################
if [ $# -eq 1 ]; then
declare -x CONFIG_FILE_DIR=$1
if [ ! -d $CONFIG_FILE_DIR ]; then
echo_error "ERROR while invoking this script, as first argument to this script you have to provide the path to a directory (./CONF/VLAN.VIRTUAL.$HOSTNAME for example) containing valid epc and enb config files"
exit 1
fi
else
echo_error "ERROR while invoking this script, as first argument to this script you have to provide the path to a directory (./CONF/VLAN.VIRTUAL.$HOSTNAME for example) containing valid epc and enb config files"
exit 1
fi
#check_install_epc_software #check_install_epc_software
cd $THIS_SCRIPT_PATH cd $THIS_SCRIPT_PATH
EMULATION_DEV_ADDRESS=`ifconfig $EMULATION_DEV_INTERFACE | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1}'`
####################################################### #######################################################
# FIND CONFIG FILE # FIND CONFIG FILE
####################################################### #######################################################
SEARCHED_CONFIG_FILE_ENB="enb*.conf" DEFAULT_CONFIG_FILE="enb.`hostname -s`.conf"
CONFIG_FILE_ENB=$THIS_SCRIPT_PATH/`find $CONFIG_FILE_DIR -iname $SEARCHED_CONFIG_FILE_ENB` CONFIG_FILE_ENB=${1:-DEFAULT_CONFIG_FILE}
echo "CONFIG_FILE_ENB=$CONFIG_FILE_ENB"
if [ -f $CONFIG_FILE_ENB ]; then if [ -f $CONFIG_FILE_ENB ]; then
echo_warning "eNB config file found is now $CONFIG_FILE_ENB" echo_warning "ENB config file found is now $CONFIG_FILE_ENB"
else else
echo_error "eNB config file not found, exiting" echo_error "ENB config file not found, exiting (searched for $CONFIG_FILE_ENB)"
exit 1 exit 1
fi fi
...@@ -96,88 +81,22 @@ fi ...@@ -96,88 +81,22 @@ fi
# SOURCE CONFIG FILE # SOURCE CONFIG FILE
####################################################### #######################################################
rm -f /tmp/source.txt rm -f /tmp/source.txt
VARIABLES=" VARIABLES="real_time"
ENB_INTERFACE_NAME_FOR_S1_MME\|\
ENB_IPV4_ADDRESS_FOR_S1_MME\|\
ENB_INTERFACE_NAME_FOR_S1U\|\
ENB_IPV4_ADDRESS_FOR_S1U\|\
real_time"
VARIABLES=$(echo $VARIABLES | sed -e 's/\\r//g') VARIABLES=$(echo $VARIABLES | sed -e 's/\\r//g')
VARIABLES=$(echo $VARIABLES | tr -d ' ') VARIABLES=$(echo $VARIABLES | tr -d ' ')
cat $CONFIG_FILE_ENB | grep -w "$VARIABLES"| tr -d " " | tr -d ";" > /tmp/source.txt cat $CONFIG_FILE_ENB | grep -w "$VARIABLES"| tr -d " " | tr -d ";" > /tmp/source.txt
source /tmp/source.txt source /tmp/source.txt
declare ENB_IPV4_NETMASK_FOR_S1_MME=$( echo $ENB_IPV4_ADDRESS_FOR_S1_MME | cut -f2 -d '/')
declare ENB_IPV4_NETMASK_FOR_S1U=$( echo $ENB_IPV4_ADDRESS_FOR_S1U | cut -f2 -d '/')
ENB_IPV4_ADDRESS_FOR_S1_MME=$( echo $ENB_IPV4_ADDRESS_FOR_S1_MME | cut -f1 -d '/')
ENB_IPV4_ADDRESS_FOR_S1U=$( echo $ENB_IPV4_ADDRESS_FOR_S1U | cut -f1 -d '/')
################################################## ##################################################
# LAUNCH eNB executable # LAUNCH eNB executable
################################################## ##################################################
pkill oaisim
pkill tshark
if [ ! -d $THIS_SCRIPT_PATH/OUTPUT/$HOSTNAME ]; then
mkdir -m 777 -p $THIS_SCRIPT_PATH/OUTPUT/$HOSTNAME
fi
if [ x$real_time == "xemulation" ]; then
ITTI_LOG_FILE=$THIS_SCRIPT_PATH/OUTPUT/$HOSTNAME/itti_enb_ue.$HOSTNAME.log
touch $ITTI_LOG_FILE
#rotate_log_file $ITTI_LOG_FILE
STDOUT_LOG_FILE=$THIS_SCRIPT_PATH/OUTPUT/$HOSTNAME/stdout_enb_ue.$HOSTNAME.log
#rotate_log_file $STDOUT_LOG_FILE
#rotate_log_file $STDOUT_LOG_FILE.filtered
touch $STDOUT_LOG_FILE
PCAP_LOG_FILE=$THIS_SCRIPT_PATH/OUTPUT/$HOSTNAME/tshark_enb_ue.$HOSTNAME.pcap
#rotate_log_file $PCAP_LOG_FILE
touch $PCAP_LOG_FILE
else
ITTI_LOG_FILE=$THIS_SCRIPT_PATH/OUTPUT/$HOSTNAME/itti_enb_rf.$HOSTNAME.log
#rotate_log_file $ITTI_LOG_FILE
touch $ITTI_LOG_FILE
STDOUT_LOG_FILE=$THIS_SCRIPT_PATH/OUTPUT/$HOSTNAME/stdout_enb_rf.$HOSTNAME.log
#rotate_log_file $STDOUT_LOG_FILE
#rotate_log_file $STDOUT_LOG_FILE.filtered
touch $STDOUT_LOG_FILE
PCAP_LOG_FILE=$THIS_SCRIPT_PATH/OUTPUT/$HOSTNAME/tshark_enb_rf.$HOSTNAME.pcap
#rotate_log_file $PCAP_LOG_FILE
touch $PCAP_LOG_FILE
fi
cd $THIS_SCRIPT_PATH
bash_exec "ethtool -A $ENB_INTERFACE_NAME_FOR_S1_MME autoneg off rx off tx off"
bash_exec "ethtool -G $ENB_INTERFACE_NAME_FOR_S1_MME rx 4096 tx 4096"
bash_exec "ethtool -C $ENB_INTERFACE_NAME_FOR_S1_MME rx-usecs 3"
bash_exec "ifconfig $ENB_INTERFACE_NAME_FOR_S1_MME txqueuelen 1000"
if [ x$ENB_INTERFACE_NAME_FOR_S1_MME != x$ENB_INTERFACE_NAME_FOR_S1U ]; then
nohup tshark -i $ENB_INTERFACE_NAME_FOR_S1_MME -w $PCAP_LOG_FILE &
else
bash_exec "ethtool -A $ENB_INTERFACE_NAME_FOR_S1U autoneg off rx off tx off"
bash_exec "ethtool -G $ENB_INTERFACE_NAME_FOR_S1U rx 4096 tx 4096"
bash_exec "ethtool -C $ENB_INTERFACE_NAME_FOR_S1U rx-usecs 3"
bash_exec "ifconfig $ENB_INTERFACE_NAME_FOR_S1U txqueuelen 1000"
nohup tshark -i $ENB_INTERFACE_NAME_FOR_S1_MME -i $ENB_INTERFACE_NAME_FOR_S1U -w $PCAP_LOG_FILE &
fi
if [ x$real_time == "xemulation" ]; then if [ x$real_time == "xemulation" ]; then
echo_warning "USER MODE" echo_warning "USER MODE"
make --directory=$OPENAIR_TARGETS/SIMU/USER $MAKE_LTE_ACCESS_STRATUM_TARGET -j`grep -c ^processor /proc/cpuinfo ` || exit 1 make --directory=$OPENAIR_TARGETS/SIMU/USER $MAKE_LTE_ACCESS_STRATUM_TARGET -j`grep -c ^processor /proc/cpuinfo ` || exit 1
bash_exec "ip route add 239.0.0.160/28 dev $EMULATION_DEV_INTERFACE" bash_exec "ip route add 239.0.0.160/28 dev $EMULATION_DEV_INTERFACE"
gdb --args $OPENAIR_TARGETS/SIMU/USER/oaisim -a -l9 -u0 -b1 -M0 -p2 -g$EMULATION_MULTICAST_GROUP -D $EMULATION_DEV_ADDRESS -K $ITTI_LOG_FILE --enb-conf $CONFIG_FILE_ENB 2>&1 | tee $STDOUT_LOG_FILE gdb --args $OPENAIR_TARGETS/SIMU/USER/oaisim -a -l9 -u0 -b1 -M0 -p2 -g$EMULATION_MULTICAST_GROUP -D $EMULATION_DEV_ADDRESS -K /tmp/itti_enb_emul.log --enb-conf $CONFIG_FILE_ENB 2>&1 | tee /tmp/stdout_enb_emul.log
else else
if [ x$real_time == "xrtai" ]; then if [ x$real_time == "xrtai" ]; then
echo_warning "HARD REAL TIME MODE" echo_warning "HARD REAL TIME MODE"
...@@ -214,7 +133,7 @@ else ...@@ -214,7 +133,7 @@ else
echo "run" >> ~/.gdbinit echo "run" >> ~/.gdbinit
gdb 2>&1 gdb 2>&1
#> $STDOUT_LOG_FILE #> $STDOUT_LOG_FILE
#gdb --args ./lte-softmodem -K $ITTI_LOG_FILE -V -O $CONFIG_FILE_ENB 2>&1 #gdb --args ./lte-softmodem -K /tmp/itti_enb_rtai.log -V -O $CONFIG_FILE_ENB 2>&1
cd $THIS_SCRIPT_PATH cd $THIS_SCRIPT_PATH
else else
if [ x$real_time == "xlinux-kernel" ]; then if [ x$real_time == "xlinux-kernel" ]; then
...@@ -233,18 +152,18 @@ else ...@@ -233,18 +152,18 @@ else
echo_warning "STARTING SOFTMODEM..." echo_warning "STARTING SOFTMODEM..."
touch .gdbinit_enb touch .gdbinit_enb
echo "file $OPENAIR_TARGETS/RT/USER/lte-softmodem" > ~/.gdbinit_enb echo "file $OPENAIR_TARGETS/RT/USER/lte-softmodem" > ~/.gdbinit_enb
echo "set args -K $ITTI_LOG_FILE -V -O $CONFIG_FILE_ENB" >> ~/.gdbinit_enb echo "set args -K /tmp/itti_enb_low_latency.log -V -O $CONFIG_FILE_ENB" >> ~/.gdbinit_enb
echo "run" >> ~/.gdbinit_enb echo "run" >> ~/.gdbinit_enb
gdb -nh -x ~/.gdbinit_enb 2>&1 gdb -nh -x ~/.gdbinit_enb 2>&1
#> $STDOUT_LOG_FILE #> /tmp/stdout_enb_low_latency.log
cd $THIS_SCRIPT_PATH cd $THIS_SCRIPT_PATH
else
echo_error "UNKNOWN REAL-TIME MODE real_time"
fi fi
fi fi
fi fi
pkill tshark
#cat $STDOUT_LOG_FILE | grep -v '[PHY]' | grep -v '[MAC]' | grep -v '[EMU]' | \ #cat $STDOUT_LOG_FILE | grep -v '[PHY]' | grep -v '[MAC]' | grep -v '[EMU]' | \
# grep -v '[OCM]' | grep -v '[OMG]' | \ # grep -v '[OCM]' | grep -v '[OMG]' | \
# grep -v 'RLC not configured' | grep -v 'check if serving becomes' | \ # grep -v 'RLC not configured' | grep -v 'check if serving becomes' | \
......
...@@ -134,6 +134,7 @@ source /tmp/source.txt ...@@ -134,6 +134,7 @@ source /tmp/source.txt
check_epc_s6a_certificate $REALM check_epc_s6a_certificate $REALM
iptables -F FORWARD
iptables -A FORWARD -m state --state INVALID -j LOG --log-prefix "FW: INVALID STATE:" iptables -A FORWARD -m state --state INVALID -j LOG --log-prefix "FW: INVALID STATE:"
#iptables -I PREROUTING -t raw -i $SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP -j LOG --log-level crit --log-ip-options --log-prefix "PREROUTING raw:" #iptables -I PREROUTING -t raw -i $SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP -j LOG --log-level crit --log-ip-options --log-prefix "PREROUTING raw:"
......
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