Commit 3e7ec35e authored by Robert Schmidt's avatar Robert Schmidt

Delete scripts referencing targets/bin

parent 87f4b9e7
...@@ -5,4 +5,3 @@ common/utils/T/T_IDs.h ...@@ -5,4 +5,3 @@ common/utils/T/T_IDs.h
common/utils/T/T_messages.txt.h common/utils/T/T_messages.txt.h
common/utils/T/genids common/utils/T/genids
common/utils/T/genids.o common/utils/T/genids.o
targets/bin/
...@@ -8,7 +8,6 @@ cmake_targets/ran_build/ ...@@ -8,7 +8,6 @@ cmake_targets/ran_build/
cmake_targets/nas_sim_tools/build/ cmake_targets/nas_sim_tools/build/
log/ log/
lte_build_oai/ lte_build_oai/
targets/bin/
# vscode # vscode
.vscode .vscode
......
#!/bin/bash
#/*
# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
# * contributor license agreements. See the NOTICE file distributed with
# * this work for additional information regarding copyright ownership.
# * The OpenAirInterface Software Alliance licenses this file to You under
# * the OAI Public License, Version 1.1 (the "License"); you may not use this file
# * except in compliance with the License.
# * You may obtain a copy of the License at
# *
# * http://www.openairinterface.org/?page_id=698
# *
# * Unless required by applicable law or agreed to in writing, software
# * distributed under the License is distributed on an "AS IS" BASIS,
# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# * See the License for the specific language governing permissions and
# * limitations under the License.
# *-------------------------------------------------------------------------------
# * For more information about the OpenAirInterface (OAI) Software Alliance:
# * contact@openairinterface.org
# */
# file build_test_epc_tools
# brief
# author Lionel Gauthier
# company Eurecom
# email: lionel.gauthier@eurecom.fr
#
################################
# include helper functions
################################
THIS_SCRIPT_PATH=$(dirname $(readlink -f $0))
source $THIS_SCRIPT_PATH/build_helper
function help()
{
echo_error " "
echo_error "Usage: build_test_epc_tools [OPTION]..."
echo_error "Build the executables for generating and running a test case for EPC."
echo_error " "
echo_error "Options:"
echo_error "Mandatory arguments to long options are mandatory for short options too."
echo_error " -c, --clean Clean the build generated files (build from scratch)"
echo_error " -d, --debug Compile with debug informations."
echo_error " -h, --help Print this help."
echo_error " -v, --verbose Build process verbose."
echo_error " "
}
function main()
{
local -i clean=0
local -i verbose=0
local cmake_args=" "
local make_args="-j $NUM_CPU"
local realm=""
until [ -z "$1" ]
do
case "$1" in
-c | --clean)
clean=1
echo "Clean the build generated files (build from scratch)"
shift;
;;
-d | --debug)
cmake_args="$cmake_args -DDEBUG=1"
echo "Compile with debug informations"
shift;
;;
-h | --help)
help
shift;
exit 0
;;
-v | --verbose)
echo "Make build process verbose"
cmake_args="$cmake_args -DCMAKE_VERBOSE_MAKEFILE=ON"
make_args="VERBOSE=1 $make_args"
verbose=1
shift;
;;
*)
echo "Unknown option $1"
help
exit 1
;;
esac
done
set_openair_env
if [[ $verbose -eq 1 ]]; then
cecho "OPENAIR_DIR = $OPENAIR_DIR" $green
fi
local dbin=$OPENAIR_DIR/targets/bin
local dlog=$OPENAIR_DIR/cmake_targets/log
local dconf=$OPENAIR_DIR/targets/bin
mkdir -m 777 -p $dbin $dlog
##############################################################################
# Compile userspace executable
##############################################################################
cd $OPENAIR_DIR/cmake_targets/epc_test
if [ $clean -ne 0 ]; then
if [[ $verbose -eq 1 ]]; then
echo "Cleaning TEST_EPC"
fi
rm -f $OPENAIR_DIR/targets/bin/test_epc_generate_scenario
rm -f $OPENAIR_DIR/targets/bin/test_epc_play_scenario
rm -Rf build 2>&1
mkdir -m 777 -p -v build
fi
##############################################################################
# Compile EPC
##############################################################################
cd $OPENAIR_DIR/cmake_targets/epc_test
if [ ! -d ./build ]; then
mkdir -m 777 -p -v build
fi
cmake_file=./CMakeLists.txt
cp $OPENAIR_DIR/cmake_targets/epc_test/CMakeLists.template $cmake_file
echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)' >> $cmake_file
cd ./build
cmake $cmake_args ..
compilations \
epc_test test_epc_generate_scenario \
test_epc_generate_scenario $dbin/test_epc_generate_scenario
compilations \
epc_test test_epc_play_scenario \
test_epc_play_scenario $dbin/test_epc_play_scenario
$SUDO cp -upv test_epc_generate_scenario /usr/local/bin
$SUDO cp -upv test_epc_play_scenario /usr/local/bin
}
main "$@"
#!/bin/bash
#/*
# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
# * contributor license agreements. See the NOTICE file distributed with
# * this work for additional information regarding copyright ownership.
# * The OpenAirInterface Software Alliance licenses this file to You under
# * the OAI Public License, Version 1.1 (the "License"); you may not use this file
# * except in compliance with the License.
# * You may obtain a copy of the License at
# *
# * http://www.openairinterface.org/?page_id=698
# *
# * Unless required by applicable law or agreed to in writing, software
# * distributed under the License is distributed on an "AS IS" BASIS,
# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# * See the License for the specific language governing permissions and
# * limitations under the License.
# *-------------------------------------------------------------------------------
# * For more information about the OpenAirInterface (OAI) Software Alliance:
# * contact@openairinterface.org
# */
# file init_nas_nos1
# brief loads the nasmesh module and sets up the radio bearers (used to provide ip interface without S1 interface)
# author Florian Kaltenberger
#
#######################################
load_module()
{
mod_name=${1##*/}
mod_name=${mod_name%.*}
if awk "/$mod_name/ {found=1 ;exit} END {if (found!=1) exit 1}" /proc/modules
then
echo "module $mod_name already loaded: I remove it first"
sudo rmmod $mod_name
fi
echo loading $mod_name
sudo insmod $1
}
function main()
{
PCI=`lspci -m | grep Xilinx`
if [ -z "$PCI" ]; then
echo "No card found. Stopping!"
return
fi
## This part corrects the wrong configuration of the endpoint done by the bios in some machines
echo "$PCI" | while read config_reg; do
SLOT_NUMBER=`echo $config_reg | awk -F\" '{print $1}'`
sudo setpci -s $SLOT_NUMBER 60.b=10
done
load_module $OPENAIR_DIR/targets/bin/openair_rf.ko
sleep 1
if [ ! -e /dev/openair0 ]; then
sudo mknod /dev/openair0 c 127 0
sudo chmod a+rw /dev/openair0
fi
$OPENAIR_DIR/targets/bin/updatefw -s 0x43fffff0 -b -f $OPENAIR_TARGETS/ARCH/EXMIMO/USERSPACE/OAI_FW_INIT/sdr_expressmimo2_v10
}
main "$@"
#/*
# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
# * contributor license agreements. See the NOTICE file distributed with
# * this work for additional information regarding copyright ownership.
# * The OpenAirInterface Software Alliance licenses this file to You under
# * the OAI Public License, Version 1.1 (the "License"); you may not use this file
# * except in compliance with the License.
# * You may obtain a copy of the License at
# *
# * http://www.openairinterface.org/?page_id=698
# *
# * Unless required by applicable law or agreed to in writing, software
# * distributed under the License is distributed on an "AS IS" BASIS,
# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# * See the License for the specific language governing permissions and
# * limitations under the License.
# *-------------------------------------------------------------------------------
# * For more information about the OpenAirInterface (OAI) Software Alliance:
# * contact@openairinterface.org
# */
# file build_oai.bash
# brief apply a traffic generator, send traffic and measure the performance of OAI
# OTG is mainly used for OASIM and D-ITG (or iperf) for LTE-SOFTMODEM
# author Navid Nikaein
# company Eurecom
# email: navid.nikaein@eurecom.fr
# date 2015
#!/bin/bash
################################
# include helper functions
################################
THIS_SCRIPT_PATH=$(dirname $(readlink -f $0))
. $THIS_SCRIPT_PATH/build_helper
#######################################
# Default PARAMETERS
######################################
#general
declare PERF_APP="OTG-OAISIM" # ITG, ITG_DECODE, PING, OTG,
declare TEST_MODE=0
declare KEEP_LOG_FILESNUM_PKTS=0
declare OWD="rttm"
declare DURATION=60000 # ms
declare NUM_PKTS=10000
declare KBYTES=1000 # KBYTES
declare START=0
declare DST="127.0.0.1"
declare DPORT="8999"
declare TP="UDP"
declare IDT_DIST="CONSTANT"
declare PS_DIST="CONSTANT"
#IDT
declare RATE=1000 # pkt / s
declare MIN_RATE=100
declare MAX_RATE=1000
# set paths to the required binaries and check if the required binaries are available
ENB_CONFIG=$OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf
OAISIM_EXEC=$OPENAIR_DIR/cmake_targets/oaisim_noS1_build_oai/build/oaisim_nos1
BYPASSE_ITTI=0
OTGPLOT="$OPENAIR2_DIR/UTIL/OTG/OTGplot"
PS2PDF="ps2pdf"
print_help_perf(){
echo_success "Name : perf_oai generate traffic and evaluate the performance "
echo_success "Usage: perf_oai -l ITG "
echo_success "-l | --perf-app : Set Performance evaluation app: ITGS, ITGD,PING, OTG-OAISIM, OTG-CBA, (default OTG-OAISIM)"
echo_success "-m | --owd : enable D-ITG one-way-delay meter (default disabled)"
echo_success "-e | --duration : set the duration of the experiment (default 60000ms)"
echo_success "-i | --idt-dist : set the distribution of the inter-departure time: CONSTANT, UNIFORM,EXPONENTIAL (default CONSTANT)"
echo_success "-s | --ps-dist : set the distribution of the inter-departure time (default CONSTANT, available options: UNIFORM,EXPONENTIAL)"
echo_success "-d | --dst : set the destination address (default 127.0.0.1)"
echo_success "-p | --dst-port : set the destination address (default NONE)"
echo_success "-t | --test : enable test mode to validate the functionality (default disabled)"
echo_success "-k | --keep-log-file : keep the log files (default disabled)"
echo_success "-c | --enb-config : set the eNB config path (default $ENB_CONFIG)"
echo_success "-x | --oaisim-exec : set oaisim exec path (default $OASIM_EXEC with nos1 and ITTI enabled)"
echo_success "-b | --bypass-itti : bypass ITTI interafce (default use itti)"
}
################################
# run ITGSEND
################################
itg_send(){
$SUDO apt-get install -y test_install_package d-itg
LOG_FILE="itg_log_template.txt"
touch results/${LOG_FILE}
if [ $TEST_MODE = 0 ] ; then
declare -a PS=(32 64 128 256 512 1024 1408)
declare -a IDT=(1 5 10 50 100 1000)
else
declare -a PS=(32 64)
declare -a IDT=(1)
fi
declare PS_LEN=${#PS[@]}
declare IDT_LEN=${#IDT[@]}
#echo_info "PS_LEN is $PS_LEN, IDT_LEN is $IDT_LEN"
declare i=0
declare j=0
declare e=0
# send traffic
for idt in ${IDT[@]}; do
# echo_info "IDT is set to $idt i is $i"
if [ $i -lt $IDT_LEN ]; then
let i++;
fi
if [ $IDT_DIST = "CONSTANT" ]; then
IDT_OPT="-C $idt "
fi
if [ $IDT_DIST = "UNIFORM" ]; then
IDT_OPT="-U $idt ${IDT[i]} "
fi
if [ $IDT_DIST = "EXPONENTIAL" ]; then
IDT_OPT="-E $idt "
fi
for ps in ${PS[@]}; do
# echo_info "PS is $ps j is $j"
if [ $j -lt $PS_LEN ]; then
let j++;
fi
if [ $PS_DIST = "CONSTANT" ]; then
PS_OPT="-c $ps "
fi
if [ $PS_DIST = "UNIFORM" ]; then
PS_OPT="-u $ps ${PS[j]} "
fi
if [ $PS_DIST = "EXPONENTIAL" ]; then
PS_OPT="-e $ps "
fi
start=$(date +%s)
RECV_FILE="recv_log_${IDT_DIST}_idt${idt}_${PS_DIST}_ps${ps}_${OWD}_${TP}"
echo_info "Start test_$i.$j:: ITGSend -a $DST $IDT_OPT $PS_OPT -m $OWD -d $START -T $TP -t $DURATION -x $RECV_FILE -l "
echo "Start test_$i.$j:: ITGSend -a $DST $IDT_OPT $PS_OPT -m $OWD -d $START -T $TP -t $DURATION -x $RECV_FILE -l " >> results/${oai_exp_date}
#sleep 1
ITGSend -a $DST $IDT_OPT $PS_OPT -m $OWD -d $START -T $TP -t $DURATION -x $RECV_FILE -l
itg_status=$?
end=$(date +%s)
diff=$(( $end - $start ))
if [ $itg_status = 0 ] ; then
echo_success "[$end] test_$i.$j passed"
echo "[$end] test_$i.$j passed" >> ./results/$LOG_FILE
STATUS="PASSED"
else
let e++;
echo_error "[$end] test_$i.$j failed :: D-ITG return exit code $itg_status"
echo "[$end]test_$i.$j failed :: ITG return exit code $itg_status" >> ./results/$LOG_FILE
STATUS="FAILED"
fi
echo_info "End test_$i.$j:: runtime: $diff"
echo "End test_$i.$j:: runtime: $diff" >> results/${oai_exp_date}
done
done
}
itg_decode(){
declare i=0
declare j=0
if [ $TEST_MODE = 0 ] ; then
declare -a PS=(32 64 128 256 512 1024 1408)
declare -a IDT=(1 5 10 50 100 1000)
else
declare -a PS=(32 64)
declare -a IDT=(1)
fi
for idt in ${IDT[@]}; do
for ps in ${PS[@]}; do
RECV_FILE="recv_log_${IDT_DIST}_idt${idt}_${PS_DIST}_ps${ps}_${OWD}_${TP}"
OUTPUT_FILE="results_${IDT_DIST}_idt${idt}_${PS_DIST}_ps${ps}_${OWD}_${TP}.txt"
OCTAVE_FILE="results_${IDT_DIST}_idt${idt}_${PS_DIST}_ps${ps}_${OWD}_${TP}.."
echo_info "decode test_$i.$j: ITGDec $RECV_FILE -v -t -l $OUTPUT_FILE -o $OCTAVE_FILE"
ITGDec $RECV_FILE -v -t -l $OUTPUT_FILE
done
done
}
ping_stats(){
status="failed"
failedhosts=""
# add ip / hostname separated by white space
if [ $TEST_MODE = 0 ]; then
declare COUNT=100
declare -a HOSTS=($DST)
declare -a PS=(64 768 2048 4096 8192)
declare -a IDT=(1 .8 .4 .2)
else
declare COUNT=10
declare -a HOSTS=(localhost)
declare -a PS=(64 2048)
declare -a IDT=(.5)
fi
declare i=0
declare j=0
declare k=0
start_exp=$(date +%s)
for host in ${HOSTS[@]}; do
let i++;
let j=0;
OUTPUT_FILE="rtt_host${host}.csv"
touch results/${OUTPUT_FILE}
for idt in ${IDT[@]}; do
let j++;
let k=0;
for ps in ${PS[@]}; do
let k++;
# | grep 'received' | awk -F',' '{ print $2 }' | awk '{ print $1 }')
start=$(date +%s)
LOG_FILE="recv_log_host${host}_idt${idt}_ps${ps}.txt"
touch results/${LOG_FILE}
echo_info "Start test_$i.$j.$k:: ping -c $COUNT -q -U $host -s $ps -i $idt"
echo "Start test_$i.$j.$k:: ping -c $COUNT -q -U $host -s $ps -i $idt" >> results/${oai_exp_date}
$(ping -c $COUNT -q -U $host -s $ps -i $idt 1>&2 >> ./results/$LOG_FILE )
end=$(date +%s)
diff=$(( $end - $start ))
count=$(cat ./results/$LOG_FILE | awk -F, '/received/{print $2*1}')
latency=$(cat ./results/$LOG_FILE | tail -1 |cut -f2- -d=)
MIN=$(cut -f1 -d/ <<< $latency)
AVG=$(cut -f2 -d/ <<< $latency)
MAX=$(cut -f3 -d/ <<< $latency)
MDEV=$(cut -f4 -d/ <<< $latency | cut -f1 -d" ")
UNIT=$(cut -f2 -d" " <<< $latency)
echo_success "Latency:: count $count min $MIN avg $AVG max $MAX mdev $MDEV ($UNIT)"
echo "$idt;$ps;$COUNT;$count;$MIN;$AVG;$MAX;$MDEV;" >> ./results/$OUTPUT_FILE
if [ $count -eq 0 ]; then
failedhosts="$failedhosts $host"
status="failed"
else
status="passed"
fi
echo_info "End test_$i.$j.$k:: runtime: $diff :: status $status "
echo "End test_$i.$j.$k:: runtime: $diff :; status $status" >> results/${oai_exp_date}
done
done
done
end_exp=$(date +%s)
diff_exp=$(( $end_exp - $start_exp ))
let total_tests=i*j*k;
echo_info "total tests: $total_tests for a duration $diff_exp (s)"
}
oaisim_otg_stats(){
# install the required packages
$SUDO apt-get install -y octave >> results/perf_log.txt 2>&1
$SUDO pkill oaisim
$SUDO pkill oaisim_nos1
$SUDO rmmod nasmesh > /dev/null 2>&1
echo_success "Bringup UE interface..."
$SUDO insmod $OPENAIR_DIR/cmake_targets/ran_build/build/nasmesh.ko
sync
if [ ! -f $OAISIM_EXEC ]; then
echo_info "3.1 compiling OAISIM ($OPENAIR_DIR/cmake_targets/build_oai --oaisim -c --noS1)"
($OPENAIR_DIR/cmake_targets/build_oai --oaisim -c --noS1 >> results/perf_log.txt 2>&1 )
build_stats=$?
if [ $build_stats != 0 ] ; then
echo_error "$OAISIM_EXEC cannot be built, check results/perf_log.txt file"
exit $?
fi
else
echo_info "ensure that OAISIM is not built with the S1 interface"
fi
if [ ! -f $OTGPLOT ]; then
echo_error "$OTGPLOT not found"
exit $?
fi
# Set the default Parameters
ABSTRACTION=1
#FRAME_TYPE=0 # FDD=0, TDD =1, 2,3,4,5,6
AGGR_RESULT=1
STATUS="PASSED"
EXTRA_STATS=0
declare NUM_UES=1
declare TRAFFIC_DIRECTIONS=2 # DL and UL
if [ $TEST_MODE = 0 ]; then
declare -a TEMPLATES=(120 121 122 123 124 125 126 127 128 129)
declare -a FRAME_TYPE=(0) # (0 3)
declare -a METRICS=(latency jitter goodput)
declare -a RB=(25 50 100)
else
declare -a TEMPLATES=(120 122 125 128)
declare -a FRAME_TYPE=(0)
declare -a METRICS=(latency)
declare -a RB=(25)
fi
if [ $ABSTRACTION = 1 ]; then
OPT="-a "
fi
if [ $BYPASSE_ITTI = 0 ]; then
OPT="$OPT -O $ENB_CONFIG "
fi
declare num_cols=0
let num_cols=(TRAFFIC_DIRECTIONS*NUM_UES)+1
if [ $AGGR_RESULT = 1 ]; then
COLUMN="[$num_cols:$num_cols]"
else
COLUMN="[1:$num_cols]"
fi
declare i=0
declare j=0
declare k=0
declare e=0
start_exp=$(date +%s)
for template in ${TEMPLATES[@]}; do
let i++;
let j=0;
for frame in ${FRAME_TYPE[@]}; do
let j++;
let k=0;
if [ $frame = 0 ]; then
OPT_FT="-F "
else
OPT_FT="-C $frame "
fi
for rb in ${RB[@]}; do
let k++;
start=$(date +%s)
LOG_FILE="oaisim_log_template${template}_frame${frame}_rb${rb}.txt"
touch results/${LOG_FILE}
echo_info "[$start] Start test_$i.$j.$k:: $OAISIM_EXEC $OPT_FT $OPT -R $RB -c $template"
echo "Start test_$i.$j.$k:: $OAISIM_EXEC $OPT_FT $OPT -R $RB -c $template" >> results/${oai_exp_date}
#sleep 1
$OAISIM_EXEC $OPT_FT $OPT -R $RB -c $template 1>&2 >> ./results/$LOG_FILE
# store exit status
oai_status=$?
end=$(date +%s)
diff=$(( $end - $start ))
#check the oaisim exit status
if [ $oai_status = 0 ] ; then
echo_success "[$end] test_$i.$j.$k passed"
echo "[$end] test_$i.$j.$k passed" >> ./results/$LOG_FILE
STATUS="PASSED"
else
let e++;
echo_error "[$end] test_$i.$j.$k failed :: OAISIM return exit code $oai_status"
echo "[$end]test_$i.$j.$k failed :: OAISIM return exit code $oai_status" >> ./results/$LOG_FILE
STATUS="FAILED"
fi
# create the curves
for metric in ${METRICS[@]}; do
if [ $metric = "goodput" ]; then
unit="(kB/s)"
else
unit="(ms)"
fi
if [ -f /tmp/otg_${metric}.dat ]; then
export TITLE="Application $metric $unit"
cp /tmp/otg_${metric}.dat ./results/otg-${metric}-template${template}-frame${frame}-rb${rb}.dat
echo_info "$OTGPLOT ./results/otg-${metric}-template${template}-frame${frame}-rb${rb}.dat $COLUMN"
echo "$OTGPLOT ./results/otg-${metric}-template${template}-frame${frame}-rb${rb}.dat $COLUMN" >> results/${oai_exp_date}
$($OTGPLOT ./results/otg-${metric}-template${template}-frame${frame}-rb${rb}.dat $COLUMN 1>&2 >> ./results/$LOG_FILE )
$($PS2PDF -dOptimize=true -dEmbedAllFonts=true ./otg-${metric}-template${template}-frame${frame}-rb${rb}.eps )
# remove the first line of the file
echo "$(tail -n+2 ./results/otg-${metric}-template${template}-frame${frame}-rb${rb}.dat)" > ./results/otg-${metric}-template${template}-frame${frame}-rb${rb}.dat
else
echo_error "file /tmp/otg_${metric}.dat does not exists"
fi
done
if [ $KEEP_LOG_FILESNUM_PKTS = 0 ]; then
rm -f ./results/$LOG_FILE
fi
mv *.eps ./results/
mv *.pdf ./results/
mv /tmp/otg.log ./results/otg-template${template}-frame${frame}-rb${rb}.log
echo_info "End test_$i.$j.$k:: runtime: $diff :: status $STATUS"
echo "End test_$i.$j.$k:: runtime: $diff :: status $STATUS" >> results/${oai_exp_date}
done
done
done
end_exp=$(date +%s)
diff_exp=$(( $end_exp - $start_exp ))
let total_tests=i*j*k;
echo_info "total tests: $total_tests for a duration $diff_exp (s) error ($e)"
echo "total tests: $total_tests for a duration $diff_exp (s) error ($e)" >> results/${oai_exp_date}
}
cba_otg_stats(){
test_install_package octave
ABSTRACTION=1
FRAME_TYPE=0 # FDD=0, TDD =1
AGGR_RESULT=1
#OAISIM="$OPENAIR_TARGETS/bin/oaisim"
OAISIM="bin/oaisim.cba" # to compile: make cleanall; make Rel10=1 CBA=1 in targets/SIMU/USER
OTGPLOT="$OPENAIR2_DIR/UTIL/OTG/OTGplot"
PS2PDF="ps2pdf"
STATUS="PASSED"
EXTRA_STATS=0
declare NUM_UES=7
declare TRAFFIC_DIRECTIONS=1 # DL and UL
if [ $TEST_MODE = 0 ]; then
declare -a TEMPLATES=(120 121 122 123 124 125 126 127 128 129 130)
declare -a CBA=(0 1 2 3 4)
declare -a BACKOFF=(0 15 30 60 120)
declare -a METRICS=(latency jitter goodput)
declare -a RB=(25)
else
declare -a TEMPLATES=(125)
declare -a CBA=(1)
declare -a BACKOFF=(0 15 30 60 120)
declare -a METRICS=(latency)
declare -a RB=(25)
fi
if [ ! -f $OAISIM_EXEC ]; then
echo_error "$OAISIM_EXEC not found"
exit $?
fi
if [ ! -f $OTGPLOT ]; then
echo_error "$OTGPLOT not found"
exit $?
fi
if [ $ABSTRACTION = 1 ]; then
OPT="-a "
fi
if [ $FRAME_TYPE = 0 ]; then
OPT="$OPT -F "
fi
declare num_cols=0
let num_cols=(TRAFFIC_DIRECTIONS*NUM_UES)+1
if [ $AGGR_RESULT = 1 ]; then
COLUMN="[$num_cols:$num_cols]"
else
COLUMN="[1:$num_cols]"
fi
declare collision=0
declare enb_cba_access=0
declare ue_cba_access=0
declare missed=0
declare unused=0
declare i=0
declare j=0
declare k=0
declare e=0
start_exp=$(date +%s)
STATS1="cba_stats1.txt"
touch results/${STATS1}
for template in ${TEMPLATES[@]}; do
let i++;
let j=0;
for group in ${CBA[@]}; do
let j++;
let k=0;
for backoff in ${BACKOFF[@]}; do
let k++;
start=$(date +%s)
LOG_FILE="oaisim_log_template${template}_group${group}_backoff${backoff}.txt"
touch results/${LOG_FILE}
echo_info "[$start] Start test_$i.$j.$k:: $OAISIM_EXEC $OPT -w $group -R $RB --cba-backoff $backoff -c $template"
echo "Start test_$i.$j.$k:: $OAISIM_EXEC $OPT -w $group -R $RB --cba-backoff $backoff -c $template" >> results/${oai_exp_date}
#sleep 1
$OAISIM_EXEC $OPT -w $group -R $RB --cba-backoff $backoff -c $template 1>&2 >> ./results/$LOG_FILE
# store exit status
oai_status=$?
end=$(date +%s)
diff=$(( $end - $start ))
#check the oaisim exit status
if [ $oai_status = 0 ] ; then
echo_success "[$end] test_$i.$j.$k passed"
echo "[$end] test_$i.$j.$k passed" >> ./results/$LOG_FILE
STATUS="PASSED"
else
let e++;
echo_error "[$end] test_$i.$j.$k failed :: OAISIM return exit code $oai_status"
echo "[$end]test_$i.$j.$k failed :: OAISIM return exit code $oai_status" >> ./results/$LOG_FILE
STATUS="FAILED"
fi
if [ $group -gt 0 ]; then
let ue_cba_access=$(cat ./results/$LOG_FILE | grep -c "CBA transmission oppurtunity" )
let enb_cba_access=$(cat ./results/$LOG_FILE | grep -c "schedule CBA access" )
let missed=$(cat ./results/$LOG_FILE | grep -c "wait for backoff to expire" )
let unused=enb_cba_access-ue_cba_access;
let collision=$(cat ./results/$LOG_FILE | grep -c "first CBA collision detected" )
#frame, subframe, ue, group
#collision_stats=$(cat ./results/$LOG_FILE | grep "collision" | cut -d " " -f3,5,12,15 )
if [ $EXTRA_STATS = 1 ]; then
STATS2="cba_template_${template}_stats2.txt"
touch results/${STATS2}
while read -r line
do
SFN=$(cut -f1 -d " " <<< $line)
SSFN=$(cut -f2 -d " " <<< $line)
UEID=$(cut -f3 -d " " <<< $line)
GPID=$(cut -f4 -d " " <<< $line)
#echo_success "$SFN;$SSFN;$UEID;$GPID;"
echo "$SFN;$SSFN;$UEID;$GPID;" >> ./results/$STATS2
done < <(cat ./results/$LOG_FILE | grep "CBA collision set SR for UE" | cut -d " " -f3,5,13,16 )
fi
echo_success "CBA stats:: template $template;group $group; backoff $backoff; enb cba allocation $enb_cba_access; ue cba access $ue_cba_access; collision $collision; missed $missed; unused $unused;"
echo "$template;$group;$backoff;$enb_cba_access;$ue_cba_access;$collision;$missed;$unused;" >> ./results/$STATS1
fi
# create the curves
for metric in ${METRICS[@]}; do
if [ $metric = "goodput" ]; then
unit="(kB/s)"
else
unit="(ms)"
fi
if [ -f /tmp/otg_${metric}.dat ]; then
export TITLE="Application $metric $unit"
cp /tmp/otg_${metric}.dat ./results/otg-${metric}-template${template}-group${group}-backoff${backoff}.dat
echo_info "$OTGPLOT ./results/otg-${metric}-template${template}-group${group}-backoff${backoff}.dat $COLUMN"
echo "$OTGPLOT ./results/otg-${metric}-template${template}-group${group}-backoff${backoff}.dat $COLUMN" >> results/${oai_exp_date}
$($OTGPLOT ./results/otg-${metric}-template${template}-group${group}-backoff${backoff}.dat $COLUMN 1>&2 >> ./results/$LOG_FILE )
$($PS2PDF -dOptimize=true -dEmbedAllFonts=true ./otg-${metric}-template${template}-group${group}-backoff${backoff}.eps )
# remove the first line of the file
echo "$(tail -n+2 ./results/otg-${metric}-template${template}-group${group}-backoff${backoff}.dat)" > ./results/otg-${metric}-template${template}-group${group}-backoff${backoff}.dat
else
echo_error "file /tmp/otg_${metric}.dat does not exists"
fi
done
if [ $KEEP_LOG_FILESNUM_PKTS = 0 ]; then
rm -f ./results/$LOG_FILE
fi
mv *.eps ./results/
mv *.pdf ./results/
mv /tmp/otg.log ./results/otg-template${template}-group${group}-backoff${backoff}.log
echo_info "End test_$i.$j.$k:: runtime: $diff :: status $STATUS"
echo "End test_$i.$j.$k:: runtime: $diff :: status $STATUS" >> results/${oai_exp_date}
# backoff not required when CBA is not used
if [ $group -eq 0 ]; then
break;
fi
done
done
done
end_exp=$(date +%s)
diff_exp=$(( $end_exp - $start_exp ))
let total_tests=i*j*k;
echo_info "total tests: $total_tests for a duration $diff_exp (s) error ($e)"
echo "total tests: $total_tests for a duration $diff_exp (s) error ($e)" >> results/${oai_exp_date}
}
function main()
{
############## script params #####################
until [ -z "$1" ]
do
case "$1" in
-c | --test)
TEST_MODE=1;
echo_info "enabling the test mode"
shift;
;;
-l | --perf-app)
PERF_APP=$2
echo_info "Setting the performance evaluation APP to $PERF_APP"
if [ $PERF_APP = "DITG" ]; then
echo_info "you need to run "
fi
shift 2;
;;
-m | --owd)
OWD="owdm"
echo_info "setting D-ITG one-way-delay meter"
shift;
;;
-e | --duration)
DURATION=$2
echo_info "Setting the traffic duration to $DURATION"
shift 2;
;;
-n | --num-pkts)
NUM_PKTS=$2
echo_info "Setting number of packets to $NUM_PKTS"
shift 2;
;;
-k | --keep-log-file)
KEEP_LOG_FILESNUM_PKTS=1
echo_info "Keep the log files"
shift;
;;
-i | --idt-dist)
IDT_DIST=$2
echo_info "setting IDT distribution to $IDT_DIST"
shift 2;
;;
-s | --ps-dist)
PS_DIST=$2
echo_info "setting PS distribution to $PS_DIST"
shift 2;
;;
-d | --dst)
DST=$2
echo_info "setting the destination address to $DST"
shift 2;
;;
-p | --dst-port)
DPORT=$2
echo_info "setting the destination port to $DPORT"
shift 2;
;;
-c | --enb-config)
ENB_CONFIG=$2
echo_info "setting the enb config file to $ENB_CONFIG"
shift 2;
;;
-x | --oaisim-exec)
OAISIM_EXEC=$2
echo_info "setting the oaisim exec to $OAISIM_EXEC"
shift 2;
;;
-b | --bypass-itti)
BYPASSE_ITTI=1
shift;;
-h | --help)
print_help_perf
exit -1
;;
*)
echo "Unknown option $1"
break ;
# unknown option
;;
esac
done
#####################
# create a bin dir
#####################
echo_info "1. Creating the results dir ..."
#rm -rf results
mkdir -m 777 -p results
exp_date=`date +%Y_%m_%d`
exp_time=`date +%H_%M_%S`
oai_exp_date="exp_date_${exp_date}"
touch results/${oai_exp_date}
touch results/perf_log.txt
chmod -f 777 results/perf_log.txt
echo "start experiment at date $exp_date time $exp_time " >> results/${oai_exp_date}
############################################
# setting and printing OAI envs, we should check here
############################################
echo_info "2. Setting the OAI PATHS ..."
set_openair_env
cecho "OPENAIR_HOME = $OPENAIR_HOME" $green
cecho "OPENAIR1_DIR = $OPENAIR1_DIR" $green
cecho "OPENAIR2_DIR = $OPENAIR2_DIR" $green
cecho "OPENAIR3_DIR = $OPENAIR3_DIR" $green
cecho "OPENAIR3_DIR = $OPENAIR3_DIR" $green
cecho "OPENAIR_TARGETS = $OPENAIR_TARGETS" $green
echo "OPENAIR_HOME = $OPENAIR_HOME" >> results/${oai_exp_date}
echo "OPENAIR1_DIR = $OPENAIR1_DIR" >> results/${oai_exp_date}
echo "OPENAIR2_DIR = $OPENAIR2_DIR" >> results/${oai_exp_date}
echo "OPENAIR3_DIR = $OPENAIR3_DIR" >> results/${oai_exp_date}
echo "OPENAIR3_DIR = $OPENAIR3_DIR" >> results/${oai_exp_date}
echo "OPENAIR_TARGETS = $OPENAIR_TARGETS" >> results/${oai_exp_date}
echo_info "eNB_CONFIG : " $ENB_CONFIG
echo_info "OAISIM_EXEC PATH: " $OAISIM_EXEC
echo_info "OTGPLOT PATH:" $OTGPLOT
case "$PERF_APP" in
'ITGS')
echo_info "3. running ITGSend (ensure that either oaisim or lte-softmodem is running)"
itg_send
;;
'ITGD')
echo_info "running ITGDECODE (At the end of the experiment, ensure that the results are in the current directory)"
itg_decode
;;
'PING')
echo_info "3. running ping (ensure that either oaisim or lte-softmodem is running)"
ping_stats
;;
'OTG-OAISIM')
echo_info "3. running OTG on oaisim (this will call oaisim as well)"
oaisim_otg_stats
;;
'OTG-CBA')
echo_info "3. running OTG on oaisim with cba"
cba_otg_stats
;;
'IPERF')
echo_warning "iperf not supported"
;;
'NONE')
;;
*)
echo_error "Unknown option $RUN_ITG"
;;
esac
}
main "$@"
#!/bin/bash
#/*
# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
# * contributor license agreements. See the NOTICE file distributed with
# * this work for additional information regarding copyright ownership.
# * The OpenAirInterface Software Alliance licenses this file to You under
# * the OAI Public License, Version 1.1 (the "License"); you may not use this file
# * except in compliance with the License.
# * You may obtain a copy of the License at
# *
# * http://www.openairinterface.org/?page_id=698
# *
# * Unless required by applicable law or agreed to in writing, software
# * distributed under the License is distributed on an "AS IS" BASIS,
# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# * See the License for the specific language governing permissions and
# * limitations under the License.
# *-------------------------------------------------------------------------------
# * For more information about the OpenAirInterface (OAI) Software Alliance:
# * contact@openairinterface.org
# */
# file run_enb_s1_exmimo
# brief run script for eNB EXMIMO.
# author Lionel GAUTHIER
# company Eurecom
# email: lionel.gauthier@eurecom.fr
################################
# include helper functions
################################
THIS_SCRIPT_PATH=$(dirname $(readlink -f $0))
source $THIS_SCRIPT_PATH/build_helper
function help()
{
echo_error " "
echo_error "Usage: run_enb_s1_exmimo -c config_file [OPTION]..."
echo_error "Run the eNB executable, hardware target is EXMIMO."
echo_error " "
echo_error "Mandatory arguments:"
echo_error " -c, -C, --config-file eNB_config_file eNB config file, (see $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF)"
echo_error " "
echo_error "Options:"
echo_error "Mandatory arguments to long options are mandatory for short options too."
echo_error " -g, --gdb Run with GDB."
echo_error " -h, --help Print this help."
echo_error " -K, --itti-dump-file filename ITTI dump file containing all ITTI events occuring during EPC runtime.(can omit file name if last argument)"
echo_error " -M, --target-dl-mcs mcs Downlink target MCS."
echo_error " -V, --vcd Dump timings of processing in a GTKWave compliant file format."
echo_error " -S, --enable-missed-slot Continue execution in case of missed slot."
echo_error " -T, --target-ul-mcs mcs Uplink target MCS."
echo_error " -W, --wireshark-l2 Dump MAC frames for visualization with wireshark."
echo_error " You need to open Wireshark, open the preferences, and check try heuristics for the UDP protocol, MAC-LTE, RLC-LTE,"
echo_error " and PDCP-LTE. Then capture for all the interfaces with the following filters: s1ap or lte_rrc or mac-lte or rlc-lte"
echo_error " or pdcp-lte. Note the L2 pdus are transmitted to the local interface."
echo_error " -x, --xforms Run XFORMS scope windows."
}
function main()
{
local -i run_gdb=0
local exe_arguments=""
until [ -z "$1" ]
do
case "$1" in
-c | -C | --config-file)
CONFIG_FILE=$2
# may be relative path
if [ -f $(dirname $(readlink -f $0))/$CONFIG_FILE ]; then
CONFIG_FILE=$(dirname $(readlink -f $0))/$CONFIG_FILE
echo "setting config file to: $CONFIG_FILE"
CONFIG_FILE_ACCESS_OK=1
else
# may be absolute path
if [ -f $CONFIG_FILE ]; then
echo "setting config file to: $CONFIG_FILE"
else
echo_fatal "config file $CONFIG_FILE not found"
fi
fi
exe_arguments="$exe_arguments -O $CONFIG_FILE -F $THIS_SCRIPT_PATH/exmimo2_2arxg.lime"
shift 2;
;;
-g | --gdb)
run_gdb=1
echo "setting GDB flag to: $GDB"
shift;
;;
-h | --help)
help
shift;
exit 0
;;
-K | --itti-dump-file)
ITTI_DUMP_FILE=$2
# can omit file name if last arg on the line
if [ "x$ITTI_DUMP_FILE" = "x" ]; then
ITTI_DUMP_FILE="/tmp/enb_s1_exmimo_itti.log"
shift 1;
else
shift 2;
fi
echo "setting ITTI dump file to: $ITTI_DUMP_FILE"
exe_arguments="$exe_arguments -K $ITTI_DUMP_FILE"
;;
-M | --target-dl-mcs)
echo "setting target dl MCS to $2"
exe_arguments="$exe_arguments -m $2"
shift 2;
;;
-V | --vcd)
"setting gtk-wave output"
exe_arguments="$exe_arguments -V /tmp/oai_gtk_wave.vcd"
shift ;
;;
-S | --enable-missed-slot)
echo "setting continue even if missed slot"
exe_arguments="$exe_arguments -S"
shift ;
;;
-T | --target-ul-mcs)
echo "setting target ul MCS to $2"
exe_arguments="$exe_arguments -t $2"
shift 2;
;;
-W | ----wireshark-l2)
echo "setting l2 pcap dump output"
exe_arguments="$exe_arguments -W"
shift ;
;;
-x | --xforms)
exe_arguments="$exe_arguments -d"
echo "setting xforms to: $XFORMS"
shift;
;;
*)
echo "Unknown option $1"
help
exit 0
;;
esac
done
set_openair_env
cecho "OPENAIR_DIR = $OPENAIR_DIR" $green
if [ ! -e $OPENAIR_DIR/targets/bin/lte-softmodem ]; then
echo_fatal "Cannot find $OPENAIR_DIR/targets/bin/lte-softmodem executable"
fi
if [ ! -e $OPENAIR_DIR/targets/bin/updatefw ]; then
echo_fatal "Cannot find $OPENAIR_DIR/targets/bin/updatefw executable"
fi
if [ ! -e $OPENAIR_DIR/targets/bin/openair_rf.ko ]; then
echo_fatal "Cannot find $OPENAIR_DIR/targets/bin/openair_rf.ko kernel module"
fi
for i in `seq 0 64`; do
have_rtfX=`ls /dev/ |grep -c rtf$i`;
if [ "$have_rtfX" -eq 0 ] ; then
$SUDO mknod -m 666 /dev/rtf$i c 150 $i;
fi;
done
$THIS_SCRIPT_PATH/init_exmimo2
if [ $run_gdb -eq 0 ]; then
exec $OPENAIR_DIR/targets/bin/lte-softmodem `echo $exe_arguments` 2>&1 > /tmp/lte_softmodem.stdout.txt
else
touch ~/.gdb_lte_softmodem
chmod 777 ~/.gdb_lte_softmodem
echo "file $OPENAIR_DIR/targets/bin/lte-softmodem" > ~/.gdb_lte_softmodem
echo "set args $exe_arguments" >> ~/.gdb_lte_softmodem
echo "run" >> ~/.gdb_lte_softmodem
cat ~/.gdb_lte_softmodem
gdb -n -x ~/.gdb_lte_softmodem 2>&1 > /tmp/gdb_lte_softmodem.stdout.txt
fi
}
main "$@"
#!/bin/bash
#/*
# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
# * contributor license agreements. See the NOTICE file distributed with
# * this work for additional information regarding copyright ownership.
# * The OpenAirInterface Software Alliance licenses this file to You under
# * the OAI Public License, Version 1.1 (the "License"); you may not use this file
# * except in compliance with the License.
# * You may obtain a copy of the License at
# *
# * http://www.openairinterface.org/?page_id=698
# *
# * Unless required by applicable law or agreed to in writing, software
# * distributed under the License is distributed on an "AS IS" BASIS,
# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# * See the License for the specific language governing permissions and
# * limitations under the License.
# *-------------------------------------------------------------------------------
# * For more information about the OpenAirInterface (OAI) Software Alliance:
# * contact@openairinterface.org
# */
# file run_enb_s1_usrp
# brief run script for eNB USRP.
# author Lionel GAUTHIER and Navid Nikaein
# company Eurecom
# email: lionel.gauthier@eurecom.fr and navid.nikaein@eurecom.fr
################################
# include helper functions
################################
THIS_SCRIPT_PATH=$(dirname $(readlink -f $0))
source $THIS_SCRIPT_PATH/build_helper
function help()
{
echo_error " "
echo_error "Usage: run_enb_s1_usrp -c config_file [OPTION]..."
echo_error "Run the eNB executable, hardware target is USRP."
echo_error " "
echo_error "Mandatory arguments:"
echo_error " -c, -C, --config-file eNB_config_file eNB config file, (see $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF)"
echo_error " "
echo_error "Options:"
echo_error "Mandatory arguments to long options are mandatory for short options too."
echo_error " -g, --gdb Run with GDB."
echo_error " -h, --help Print this help."
echo_error " -e, --ulsch-max-errors num-errs maximum allowed number of uplink errors"
echo_error " -f, --rf-config-file filename RF specific configuration file"
echo_error " -K, --itti-dump-file filename ITTI dump file containing all ITTI events occuring during EPC runtime.(can omit file name if last argument)"
echo_error " -M, --target-dl-mcs mcs Downlink target MCS."
echo_error " -n, --T-no-wait don't wait for tracer, start immediately"
echo_error " -p, --T-port port use given port"
echo_error " -s, --show-stdout Do not redirect stdout and stderr to file /tmp/lte_softmodem.stdout.txt."
echo_error " -S, --enable-missed-slot Continue execution in case of missed slot."
echo_error " -T, --target-ul-mcs mcs Uplink target MCS."
echo_error " -V, --vcd Dump timings of processing in a GTKWave compliant file format."
echo_error " -W, --wireshark-l2 Dump MAC frames for visualization with wireshark."
echo_error " You need to open Wireshark, open the preferences, and check try heuristics for the UDP protocol, MAC-LTE, RLC-LTE,"
echo_error " and PDCP-LTE. Then capture for all the interfaces with the following filters: s1ap or lte_rrc or mac-lte or rlc-lte"
echo_error " or pdcp-lte. Note the L2 pdus are transmitted to the local interface."
echo_error " -x, --xforms Run XFORMS scope windows."
}
function control_c()
# run if user hits control-c
{
echo_warning "\nExiting by ctrl+c\n"
exit $?
}
function main()
{
local -i run_gdb=0
local -i show_stdout=0
local exe_arguments=""
until [ -z "$1" ]
do
case "$1" in
-c | -C | --config-file)
CONFIG_FILE=$2
# may be relative path
if [ -f $(dirname $(readlink -f $0))/$CONFIG_FILE ]; then
CONFIG_FILE=$(dirname $(readlink -f $0))/$CONFIG_FILE
echo "setting config file to: $CONFIG_FILE"
CONFIG_FILE_ACCESS_OK=1
else
# may be absolute path
if [ -f $CONFIG_FILE ]; then
echo "setting config file to: $CONFIG_FILE"
else
echo_fatal "config file $CONFIG_FILE not found"
fi
fi
exe_arguments="$exe_arguments -O $CONFIG_FILE"
shift 2;
;;
-g | --gdb)
run_gdb=1
echo "setting GDB flag to: $run_gdb"
shift;
;;
-h | --help)
help
shift;
exit 0
;;
-e | --ulsch-max-errors)
ulsch_max_errors=$2
echo "setting --ulsch-max-errors to $ulsch_max_errors"
exe_arguments="$exe_arguments --ulsch-max-errors=$ulsch_max_errors"
shift 2;
;;
-f | --rf-config-file)
rf_config_file=$2
# can omit file name if last arg on the line
if [ "x$rf_config_file" = "x" ]; then
rf_config_file=null
shift 1;
else
shift 2;
fi
if [ "$rf_config_file" != "null" ]; then
echo "setting --rf-config-file to $rf_config_file"
exe_arguments="$exe_arguments --rf-config-file=$rf_config_file"
fi
;;
-M | --target-dl-mcs)
echo "setting target dl MCS to $2"
exe_arguments="$exe_arguments -m $2"
shift 2;
;;
-n | --T-no-wait)
echo "setting T tracer operation"
exe_arguments="$exe_arguments --T_nowait"
shift ;
;;
-p | --T-port)
echo "setting T tracer port"
exe_arguments="$exe_arguments --T_port $2"
shift 2;
;;
-V | --vcd)
echo "setting gtk-wave output"
exe_arguments="$exe_arguments -V /tmp/oai_gtk_wave.vcd"
shift ;
;;
-s | --show-stdout)
echo "setting show stdout"
show_stdout=1
shift ;
;;
-S | --enable-missed-slot)
echo "setting continue even if missed slot"
exe_arguments="$exe_arguments -S"
shift ;
;;
-T | --target-ul-mcs)
echo "setting target ul MCS to $2"
exe_arguments="$exe_arguments -t $2"
shift 2;
;;
-W | --wireshark-l2)
echo "setting l2 pcap dump output"
exe_arguments="$exe_arguments -W"
shift ;
;;
-x | --xforms)
exe_arguments="$exe_arguments -d"
echo "setting xforms"
shift;
;;
*)
echo "Unknown option $1"
help
exit 0
;;
esac
done
set_openair_env
cecho "OPENAIR_DIR = $OPENAIR_DIR" $green
if [ ! -e $OPENAIR_DIR/targets/bin/lte-softmodem.Rel10 ]; then
echo_fatal "Cannot find $OPENAIR_DIR/targets/bin/lte-softmodem.Rel10 executable"
fi
if [ $run_gdb -eq 0 ]; then
# trap keyboard interrupt (control-c)
trap control_c SIGINT
if [ $show_stdout -eq 0 ]; then
echo_warning "stdout/sderr of lte-softmodem executable redirected to /tmp/lte_softmodem.stdout.txt"
exec $OPENAIR_DIR/targets/bin/lte-softmodem.Rel10 `echo $exe_arguments` 2>&1 > /tmp/lte_softmodem.stdout.txt
else
exec $OPENAIR_DIR/targets/bin/lte-softmodem.Rel10 `echo $exe_arguments`
fi
else
# trap keyboard interrupt (control-c) is done by gdb
touch ~/.gdb_lte_softmodem
chmod 777 ~/.gdb_lte_softmodem
echo "file $OPENAIR_DIR/targets/bin/lte-softmodem.Rel10" > ~/.gdb_lte_softmodem
echo "set args $exe_arguments" >> ~/.gdb_lte_softmodem
echo "run" >> ~/.gdb_lte_softmodem
cat ~/.gdb_lte_softmodem
if [ $show_stdout -eq 0 ]; then
echo_warning "stdout/sderr of lte-softmodem executable redirected to /tmp/gdb_lte_softmodem.stdout.txt"
gdb -n -x ~/.gdb_lte_softmodem 2>&1 > /tmp/gdb_lte_softmodem.stdout.txt
else
gdb -n -x ~/.gdb_lte_softmodem
fi
fi
}
main "$@"
#!/bin/bash
#/*
# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
# * contributor license agreements. See the NOTICE file distributed with
# * this work for additional information regarding copyright ownership.
# * The OpenAirInterface Software Alliance licenses this file to You under
# * the OAI Public License, Version 1.1 (the "License"); you may not use this file
# * except in compliance with the License.
# * You may obtain a copy of the License at
# *
# * http://www.openairinterface.org/?page_id=698
# *
# * Unless required by applicable law or agreed to in writing, software
# * distributed under the License is distributed on an "AS IS" BASIS,
# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# * See the License for the specific language governing permissions and
# * limitations under the License.
# *-------------------------------------------------------------------------------
# * For more information about the OpenAirInterface (OAI) Software Alliance:
# * contact@openairinterface.org
# */
# file start_enb_ue_virt_noS1
# brief
# author Lionel Gauthier
# company Eurecom
# email: lionel.gauthier@eurecom.fr
###########################################
# INPUT OF THIS SCRIPT:
# THE DIRECTORY WHERE ARE LOCATED THE CONFIGURATION FILES
#########################################
# This script start ENB+UE (all in one executable, on one host)
# eNB is in standalone mode, it does not require a MME.
###########################################################
THIS_SCRIPT_PATH=$(dirname $(readlink -f $0))
. $THIS_SCRIPT_PATH/build_helper
###########################################################
function help()
{
echo_error " "
echo_error "Usage: start_enb_ue_virt_noS1 [OPTION]..."
echo_error "Run the eNB and/or UE executable with no hardware."
echo_error " "
echo_error "Options:"
echo_error "Mandatory arguments to long options are mandatory for short options too."
echo_error " -a, --abstraction enable phy abstraction mode"
echo_error " -c, -C, --config-file eNB_config_file eNB config file, (see $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF)"
echo_error " Default eNB config file if not set is $1"
echo_error " -g, --gdb Run with GDB."
echo_error " -l, --log-level set the global log level (8:trace, 7:debug, 6:info, 4:warn, 3:error). Note that the log configuration is eNB config file is ignored for oaisim."
echo_error " -h, --help Print this help."
echo_error " -K, --itti-dump-file filename ITTI dump file containing all ITTI events occuring during EPC runtime.(can omit file name if last argument)"
echo_error " -V, --vcd Dump timings of processing in a GTKWave compliant file format."
echo_error " -W, --wireshark-l2 Dump MAC frames for visualization with wireshark."
echo_error " You need to open Wireshark, open the preferences, and check try heuristics for the UDP protocol, MAC-LTE, RLC-LTE,"
echo_error " and PDCP-LTE. Then capture for all the interfaces with the following filters: s1ap or lte_rrc or mac-lte or rlc-lte"
echo_error " or pdcp-lte. Note the L2 pdus are transmitted to the local interface."
echo_error " -x, --xforms Run XFORMS scope windows."
echo_error " -n, --num-frames Set number of frames for simulation"
}
function main()
{
set_openair_env
cecho "OPENAIR_DIR = $OPENAIR_DIR" $green
local -i run_gdb=0
local exe_arguments=""
local DEFAULT_CONFIG_FILE_ENB=$OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf
local CONFIG_FILE_ENB=$DEFAULT_CONFIG_FILE_ENB
local abstraction_flag=0
until [ -z "$1" ]
do
case "$1" in
-a | --abstraction )
abstraction_flag=1
echo "enabling abstraction mode"
exe_arguments="$exe_arguments -a"
shift;
;;
-c | -C | --config-file)
CONFIG_FILE_ENB=$2
# may be relative path
if [ -f $(dirname $(readlink -f $0))/$CONFIG_FILE ]; then
CONFIG_FILE_ENB=$(dirname $(readlink -f $0))/$CONFIG_FILE
echo "setting config file to: $CONFIG_FILE"
config_FILE_ACCESS_OK=1
else
# may be absolute path
if [ -f $CONFIG_FILE_ENB ]; then
echo "setting config file to: $CONFIG_FILE_ENB"
else
echo_fatal "config file $CONFIG_FILE_ENB not found"
fi
fi
shift 2;
;;
-g | --gdb)
run_gdb=1
echo "setting GDB flag to: $GDB"
shift;
;;
-l | --log-level)
echo "setting the log level to $2"
exe_arguments="$exe_arguments -l $2"
shift 2;
;;
-h | --help)
help $DEFAULT_CONFIG_FILE_ENB
shift;
exit 0
;;
-K | --itti-dump-file)
ITTI_DUMP_FILE=$2
# can omit file name if last arg on the line
if [ "x$ITTI_DUMP_FILE" = "x" ]; then
ITTI_DUMP_FILE="/tmp/itti_enb_ue_s1.log"
shift 1;
else
shift 2;
fi
echo "setting ITTI dump file to: $ITTI_DUMP_FILE"
exe_arguments="$exe_arguments -K $ITTI_DUMP_FILE"
;;
# -u | --num-ue )
-V | --vcd)
echo "setting gtk-wave output"
exe_arguments="$exe_arguments -V /tmp/oai_gtk_wave.vcd"
shift ;
;;
-W | --wireshark-l2)
echo "setting l2 pcap dump output"
exe_arguments="$exe_arguments -P wireshark"
shift 1;
;;
-n | --num-frames)
echo "setting the number of frames in simulation to $2"
exe_arguments="$exe_arguments -n $2"
shift 2;
;;
-x | --xforms)
echo "running with xforms"
exe_arguments="$exe_arguments --xforms"
shift 1;
;;
*)
echo "Unknown option $1"
help
exit 0
;;
esac
done
# may use default config file
exe_arguments="$exe_arguments --enb-conf $CONFIG_FILE_ENB"
##################################################
# LAUNCH eNB + UE executable
##################################################
$SUDO pkill oaisim
$SUDO rmmod nasmesh > /dev/null 2>&1
echo_success "Bringup UE interface..."
$SUDO insmod $OPENAIR_DIR/targets/bin/nasmesh.ko
sync
echo "bring up oai0 interface for enb"
$SUDO ifconfig oai0 10.0.1.1 netmask 255.255.255.0 broadcast 10.0.1.255
sync
echo "bring up oai1 interface for ue 1"
$SUDO ifconfig oai1 10.0.2.2 netmask 255.255.255.0 broadcast 10.0.2.255
sync
# enb -> ue1
$OPENAIR_DIR/targets/bin/rb_tool -a -c0 -i0 -z0 -s 10.0.1.1 -t 10.0.1.2 -r 1
# ue1 -> enb
$OPENAIR_DIR/targets/bin/rb_tool -a -c0 -i1 -z0 -s 10.0.2.2 -t 10.0.2.1 -r 1
if [ "$abstraction_flag" -eq "0" ] ; then
exe_arguments="$exe_arguments -s15 -AAWGN -b1 -u1"
else
exe_arguments="$exe_arguments -b1 -u1"
fi
cd $OPENAIR_DIR/targets/bin
if [ $run_gdb -eq 0 ]; then
exec $SUDO $OPENAIR_DIR/targets/bin/oaisim_nos1.Rel14 $exe_arguments | tee /tmp/enb_ue_nos1.log.txt
else
touch ~/.gdb_enb_ue_nos1
chmod 777 ~/.gdb_enb_ue_nos1
echo "file $OPENAIR_DIR/targets/bin/oaisim_nos1.Rel14" > ~/.gdb_enb_ue_nos1
echo "set args $exe_arguments" >> ~/.gdb_enb_ue_nos1
echo "run" >> ~/.gdb_enb_ue_nos1
cat ~/.gdb_enb_ue_nos1
$SUDO gdb -n -x ~/.gdb_enb_ue_nos1
fi
}
main "$@"
#!/bin/bash
#/*
# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
# * contributor license agreements. See the NOTICE file distributed with
# * this work for additional information regarding copyright ownership.
# * The OpenAirInterface Software Alliance licenses this file to You under
# * the OAI Public License, Version 1.1 (the "License"); you may not use this file
# * except in compliance with the License.
# * You may obtain a copy of the License at
# *
# * http://www.openairinterface.org/?page_id=698
# *
# * Unless required by applicable law or agreed to in writing, software
# * distributed under the License is distributed on an "AS IS" BASIS,
# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# * See the License for the specific language governing permissions and
# * limitations under the License.
# *-------------------------------------------------------------------------------
# * For more information about the OpenAirInterface (OAI) Software Alliance:
# * contact@openairinterface.org
# */
# file start_enb_ue_virt_s1
# brief
# author Lionel Gauthier
# company Eurecom
# email: lionel.gauthier@eurecom.fr
###########################################
# INPUT OF THIS SCRIPT:
# THE DIRECTORY WHERE ARE LOCATED THE CONFIGURATION FILES
#########################################
# This script start ENB+UE (all in one executable, on one host)
# MME+SP-GW executable have to be launched by your own (run_hss, run_epc) before this script is invoked.
#
###########################################################
THIS_SCRIPT_PATH=$(dirname $(readlink -f $0))
. $THIS_SCRIPT_PATH/build_helper
###########################################################
function trim2()
{
local var=$@
var="${var#"${var%%[![:space:]]*}"}" # remove leading whitespace characters
var="${var%"${var##*[![:space:]]}"}" # remove trailing whitespace characters
echo -n "$var"
}
function is_tun_interface()
{
my_bool=1
for var in "$@"
do
if [ "a$var" == "a" ]; then
echo "0";
return;
fi
if [[ "$var" != *tun* ]]; then
echo "0";
return;
fi
done
echo "$my_bool"
}
function help()
{
echo_error " "
echo_error "Usage: start_enb_ue_virt_s1 [OPTION]..."
echo_error "Run the eNB and/or UE executable with no hardware."
echo_error " "
echo_error "Options:"
echo_error "Mandatory arguments to long options are mandatory for short options too."
echo_error " -a, --abstraction enable phy abstraction mode"
echo_error " -c, -C, --config-file eNB_config_file eNB config file, (see $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF)"
echo_error " Default eNB config file if not set is $1"
echo_error " -l, --log-level set the global log level (8:trace, 7:debug, 6:info, 4:warn, 3:error). Note that the log configuration is eNB config file is ignored for oaisim."
echo_error " -g, --gdb Run with GDB."
echo_error " -h, --help Print this help."
echo_error " -K, --itti-dump-file filename ITTI dump file containing all ITTI events occuring during EPC runtime.(can omit file name if last argument)"
echo_error " -V, --vcd Dump timings of processing in a GTKWave compliant file format."
echo_error " -W, --wireshark-l2 Dump MAC frames for visualization with wireshark."
echo_error " You need to open Wireshark, open the preferences, and check try heuristics for the UDP protocol, MAC-LTE, RLC-LTE,"
echo_error " and PDCP-LTE. Then capture for all the interfaces with the following filters: s1ap or lte_rrc or mac-lte or rlc-lte"
echo_error " or pdcp-lte. Note the L2 pdus are transmitted to the local interface."
echo_error " -x, --xforms Run XFORMS scope windows."
echo_error " "
echo_error " A simple data traffic test example: ping -m 1 -I oip1 192.168.12.100"
}
function main()
{
set_openair_env
cecho "OPENAIR_DIR = $OPENAIR_DIR" $green
local -i run_gdb=0
local exe_arguments=""
local DEFAULT_CONFIG_FILE_ENB=$OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_mme.conf
local CONFIG_FILE_ENB=$DEFAULT_CONFIG_FILE_ENB
until [ -z "$1" ]
do
case "$1" in
-a | --abstraction )
abstraction_flag=1
echo "enabling abstraction mode"
exe_arguments="$exe_arguments -a"
shift;
;;
-c | -C | --config-file)
CONFIG_FILE_ENB=$2
# may be relative path
if [ -f $(dirname $(readlink -f $0))/$CONFIG_FILE ]; then
CONFIG_FILE_ENB=$(dirname $(readlink -f $0))/$CONFIG_FILE
echo "setting config file to: $CONFIG_FILE"
CONFIG_FILE_ACCESS_OK=1
else
# may be absolute path
if [ -f $CONFIG_FILE_ENB ]; then
echo "setting config file to: $CONFIG_FILE_ENB"
else
echo_fatal "config file $CONFIG_FILE_ENB not found"
fi
fi
shift 2;
;;
-l | --log-level)
echo "setting the log level to $2"
exe_arguments="$exe_arguments -l $2"
shift 2;
;;
-g | --gdb)
run_gdb=1
echo "setting GDB flag to: $GDB"
shift;
;;
-h | --help)
help $DEFAULT_CONFIG_FILE_ENB
shift;
exit 0
;;
-K | --itti-dump-file)
ITTI_DUMP_FILE=$2
# can omit file name if last arg on the line
if [ "x$ITTI_DUMP_FILE" = "x" ]; then
ITTI_DUMP_FILE="/tmp/itti_enb_ue_s1.log"
shift 1;
else
shift 2;
fi
echo "setting ITTI dump file to: $ITTI_DUMP_FILE"
exe_arguments="$exe_arguments -K $ITTI_DUMP_FILE"
;;
-V | --vcd)
echo "setting gtk-wave output"
exe_arguments="$exe_arguments -V /tmp/oai_gtk_wave.vcd"
shift ;
;;
-W | ----wireshark-l2)
echo "setting l2 pcap dump output"
exe_arguments="$exe_arguments -P wireshark"
shift 2;
;;
-x | --xforms)
echo "running with xforms"
exe_arguments="$exe_arguments --xforms"
shift 1;
;;
*)
echo "Unknown option $1"
help
exit 0
;;
esac
done
# may use default config file
exe_arguments="$exe_arguments --enb-conf $CONFIG_FILE_ENB"
#######################################################
# SOURCE CONFIG FILE
#######################################################
rm -f /tmp/source.txt
VARIABLES="
ENB_INTERFACE_NAME_FOR_S1_MME\|\
ENB_IPV4_ADDRESS_FOR_S1_MME\|\
ENB_INTERFACE_NAME_FOR_S1U\|\
ENB_IPV4_ADDRESS_FOR_S1U"
VARIABLES=$(echo $VARIABLES | sed -e 's/\\r//g')
VARIABLES=$(echo $VARIABLES | tr -d ' ')
cat $CONFIG_FILE_ENB | grep -w "$VARIABLES"| tr -d " " | tr -d ";" > /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 '/')
is_tun=`is_tun_interface $ENB_INTERFACE_NAME_FOR_S1_MME $ENB_INTERFACE_NAME_FOR_S1U`
# if [ $is_tun = "1" ]; then
# openvpn --mktun --dev $ENB_INTERFACE_NAME_FOR_S1U;sync
# openvpn --mktun --dev $ENB_INTERFACE_NAME_FOR_S1_MME;sync
# ip -4 addr add $ENB_IPV4_ADDRESS_FOR_S1U/$ENB_IPV4_NETMASK_FOR_S1U dev $ENB_INTERFACE_NAME_FOR_S1U;sync
# ip -4 addr add $ENB_IPV4_ADDRESS_FOR_S1_MME/$ENB_IPV4_NETMASK_FOR_S1_MME dev $ENB_INTERFACE_NAME_FOR_S1_MME;sync
# ifconfig $ENB_INTERFACE_NAME_FOR_S1U up;sync
# ifconfig $ENB_INTERFACE_NAME_FOR_S1_MME up;sync
# echo_success "Configured local eNB S1 tun interfaces"
# else
# echo_success "eNB S1 tun interfaces should be ethernet interfaces (no tunnels configured)"
# fi
##################################################
# LAUNCH eNB + UE executable
##################################################
pkill oaisim
rmmod ue_ip > /dev/null 2>&1
echo_success "Bringup UE interface..."
insmod $OPENAIR_DIR/targets/bin/ue_ip.ko
ip route flush cache
# Check table 200 lte in /etc/iproute2/rt_tables
fgrep lte /etc/iproute2/rt_tables > /dev/null
if [ $? -ne 0 ]; then
echo "200 lte " >> /etc/iproute2/rt_tables
fi
exe_arguments="$exe_arguments -s15 -AAWGN -y1 -b1 -u1 -Q0"
cd $OPENAIR_DIR/targets/bin
if [ $run_gdb -eq 0 ]; then
exec $OPENAIR_DIR/targets/bin/oaisim.Rel14 $exe_arguments | tee /tmp/enb_ue_s1.log.txt
else
touch ~/.gdb_enb_ue_s1
chmod 777 ~/.gdb_enb_ue_s1
echo "file $OPENAIR_DIR/targets/bin/oaisim.Rel14" > ~/.gdb_enb_ue_s1
echo "set args $exe_arguments" >> ~/.gdb_enb_ue_s1
echo "run" >> ~/.gdb_enb_ue_s1
cat ~/.gdb_enb_ue_s1
gdb -n -x ~/.gdb_enb_ue_s1
fi
}
sudo echo
is_sudo=$?
if [[ "$is_sudo" -ne 0 ]]; then
echo_error "This script must be run by root or a sudo'er"
echo
exit 1
fi
main "$@"
#!/bin/bash
# Carrier frequency in Hz
#FREQ=2660000000 #FDD
FREQ=2350000000 #TDD
NRB=50
TA=0
#9:trace, 8/7:debug, 6:info, 4:warn, 3:error
LOGLEVEL=6
#enable or disable soft scope
#SCOPE=''
SCOPE='-d'
#enable or disable VCD logging
VCD=''
#VCD='-V'
ISTDD='-T'
#ISTDD=''
#use external clock
ECLK="--external-clock"
#ECLK=""
#UE scan carrier
#ISSCAN="--ue-scan-carrier"
ISSCAN=""
sudo sh -c './init_nas_s1 UE'
cd ../../targets/bin/
sudo -E ./lte-softmodem.Rel10 -U -C$FREQ -r$NRB $ISSCAN --ue-txgain 70 --ue-rxgain 80 -A $TA $ECLK -W $ISTDD -g $LOGLEVEL $SCOPE 2>&1 | sudo tee /tmp/UE.log
#!/bin/bash
#/*
# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
# * contributor license agreements. See the NOTICE file distributed with
# * this work for additional information regarding copyright ownership.
# * The OpenAirInterface Software Alliance licenses this file to You under
# * the OAI Public License, Version 1.1 (the "License"); you may not use this file
# * except in compliance with the License.
# * You may obtain a copy of the License at
# *
# * http://www.openairinterface.org/?page_id=698
# *
# * Unless required by applicable law or agreed to in writing, software
# * distributed under the License is distributed on an "AS IS" BASIS,
# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# * See the License for the specific language governing permissions and
# * limitations under the License.
# *-------------------------------------------------------------------------------
# * For more information about the OpenAirInterface (OAI) Software Alliance:
# * contact@openairinterface.org
# */
# \author Navid Nikaein, Rohit Gupta
echo "This script stops exmimo2 as it might be transmitting signal by itself if lte-softmodem terminates incorrectly"
if [ "$OPENAIR_DIR" == "" ]; then
echo "Is the OPENAIR_DIR path set correctly? Exiting now"
exit
fi
sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches'
exmimo_mod=`lsmod |grep openair_rf`
#load the module only if absent to avoid kernel crashes
if [ -z "$exmimo_mod" ]
then
sudo -E $OPENAIR_DIR/cmake_targets/tools/init_exmimo2
fi
#now we stop the card from transmitting anything
cd $OPENAIR_DIR/targets/bin
sudo -E octave -H --no-gui $OPENAIR_DIR/cmake_targets/tools/exmimo_stop_octave.m
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