Commit 92ca8a5e authored by Raphael Defosseux's avatar Raphael Defosseux

Merge remote-tracking branch 'origin/develop' into ci-improve-l2-sim

Signed-off-by: default avatarRaphael Defosseux <raphael.defosseux@eurecom.fr>
parents 34b4f693 118418cd
# vim swp
*.swp
# log and exec file
log/
lte_build_oai/
targets/bin/
cmake_targets/nas_sim_tools/build/
...@@ -133,6 +133,7 @@ pipeline { ...@@ -133,6 +133,7 @@ pipeline {
script { script {
def message = "OAI " + JOB_NAME + " build (" + BUILD_ID + "): Merge Conflicts -- Cannot perform CI" def message = "OAI " + JOB_NAME + " build (" + BUILD_ID + "): Merge Conflicts -- Cannot perform CI"
addGitLabMRComment comment: message addGitLabMRComment comment: message
currentBuild.result = 'FAILURE'
} }
} }
} }
...@@ -283,6 +284,11 @@ pipeline { ...@@ -283,6 +284,11 @@ pipeline {
} }
} }
post { post {
failure {
script {
currentBuild.result = 'FAILURE'
}
}
always { always {
script { script {
dir ('archives') { dir ('archives') {
...@@ -392,7 +398,7 @@ pipeline { ...@@ -392,7 +398,7 @@ pipeline {
} }
} }
} }
stage ("Test FDD - Band 7 - B210") { stage ("Test MONOLITHIC - FDD - Band 7 - B210") {
steps { steps {
script { script {
if ("MERGE".equals(env.gitlabActionType)) { if ("MERGE".equals(env.gitlabActionType)) {
...@@ -443,7 +449,7 @@ pipeline { ...@@ -443,7 +449,7 @@ pipeline {
} }
} }
} }
stage ("Test TDD - Band 40 - B210") { stage ("Test MONOLITHIC - TDD - Band 40 - B210") {
steps { steps {
script { script {
if ("MERGE".equals(env.gitlabActionType)) { if ("MERGE".equals(env.gitlabActionType)) {
...@@ -647,6 +653,57 @@ pipeline { ...@@ -647,6 +653,57 @@ pipeline {
} }
} }
} }
stage ("Test OAI UE Sniffing - FDD - Band 20 - B200") {
steps {
script {
if ("MERGE".equals(env.gitlabActionType)) {
//gitlabCommitStatus(name: "Test-OAI-UE-FDD-Band20") {
build job: 'UE-CI-FDD-Band20-B200',
parameters: [
string(name: 'eNB_Repository', value: String.valueOf(GIT_URL)),
string(name: 'eNB_Branch', value: String.valueOf(env.gitlabSourceBranch)),
string(name: 'eNB_CommitID', value: String.valueOf(env.gitlabMergeRequestLastCommit)),
booleanParam(name: 'eNB_mergeRequest', value: true),
string(name: 'eNB_TargetBranch', value: String.valueOf(env.gitlabTargetBranch))
]
//}
} else {
//gitlabCommitStatus(name: "Test-OAI-UE-FDD-Band20") {
build job: 'UE-CI-FDD-Band20-B200',
parameters: [
string(name: 'eNB_Repository', value: String.valueOf(GIT_URL)),
string(name: 'eNB_Branch', value: String.valueOf(GIT_BRANCH)),
string(name: 'eNB_CommitID', value: String.valueOf(GIT_COMMIT)),
booleanParam(name: 'eNB_mergeRequest', value: false)
]
//}
}
}
}
post {
// In case of any non-success, we are retrieving the HTML report of the last completed
// slave job.
// The only drop-back is that we may retrieve the HTML report of a previous build
always {
script {
if (!fileExists('test_results-UE-CI-FDD-Band20-B200.html')) {
copyArtifacts(projectName: 'UE-CI-FDD-Band20-B200',
filter: 'test_results*.html',
selector: lastCompleted())
if (fileExists('test_results-UE-CI-FDD-Band20-B200.html')) {
sh "sed -i -e 's#TEMPLATE_BUILD_TIME#${JOB_TIMESTAMP}#' test_results-UE-CI-FDD-Band20-B200.html"
archiveArtifacts artifacts: 'test_results-UE-CI-FDD-Band20-B200.html'
}
}
}
}
failure {
script {
currentBuild.result = 'FAILURE'
}
}
}
}
} }
post { post {
always { always {
......
This diff is collapsed.
...@@ -465,4 +465,3 @@ log_config : ...@@ -465,4 +465,3 @@ log_config :
rrc_log_level ="info"; rrc_log_level ="info";
rrc_log_verbosity ="medium"; rrc_log_verbosity ="medium";
}; };
...@@ -267,4 +267,3 @@ log_config : ...@@ -267,4 +267,3 @@ log_config :
rrc_log_level ="info"; rrc_log_level ="info";
rrc_log_verbosity ="medium"; rrc_log_verbosity ="medium";
}; };
...@@ -266,4 +266,3 @@ NETWORK_CONTROLLER : ...@@ -266,4 +266,3 @@ NETWORK_CONTROLLER :
rrc_log_level ="info"; rrc_log_level ="info";
rrc_log_verbosity ="medium"; rrc_log_verbosity ="medium";
}; };
...@@ -272,4 +272,3 @@ NETWORK_CONTROLLER : ...@@ -272,4 +272,3 @@ NETWORK_CONTROLLER :
rrc_log_level ="info"; rrc_log_level ="info";
rrc_log_verbosity ="medium"; rrc_log_verbosity ="medium";
}; };
...@@ -272,4 +272,3 @@ NETWORK_CONTROLLER : ...@@ -272,4 +272,3 @@ NETWORK_CONTROLLER :
rrc_log_level ="info"; rrc_log_level ="info";
rrc_log_verbosity ="medium"; rrc_log_verbosity ="medium";
}; };
...@@ -272,4 +272,3 @@ NETWORK_CONTROLLER : ...@@ -272,4 +272,3 @@ NETWORK_CONTROLLER :
rrc_log_level ="info"; rrc_log_level ="info";
rrc_log_verbosity ="medium"; rrc_log_verbosity ="medium";
}; };
...@@ -42,4 +42,3 @@ log_config = { ...@@ -42,4 +42,3 @@ log_config = {
rrc_log_level ="error"; rrc_log_level ="error";
rrc_log_verbosity ="medium"; rrc_log_verbosity ="medium";
}; };
...@@ -42,4 +42,3 @@ log_config = { ...@@ -42,4 +42,3 @@ log_config = {
rrc_log_level ="error"; rrc_log_level ="error";
rrc_log_verbosity ="medium"; rrc_log_verbosity ="medium";
}; };
...@@ -72,7 +72,7 @@ uninitvar:openair2/UTIL/OTG/otg_rx_socket.c ...@@ -72,7 +72,7 @@ uninitvar:openair2/UTIL/OTG/otg_rx_socket.c
// iteration of the loop. // iteration of the loop.
nullPointer:common/utils/T/local_tracer.c:243 nullPointer:common/utils/T/local_tracer.c:243
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// once again cppcheck is not to understand that fds is initialized in the // once again cppcheck does not understand that fds is initialized in the
// first iteration of the loop // first iteration of the loop
nullPointer:common/utils/T/tracer/multi.c:264 nullPointer:common/utils/T/tracer/multi.c:264
nullPointer:common/utils/T/tracer/multi.c:265 nullPointer:common/utils/T/tracer/multi.c:265
......
This diff is collapsed.
...@@ -264,7 +264,7 @@ case $key in ...@@ -264,7 +264,7 @@ case $key in
ARCHIVES_LOC=cppcheck ARCHIVES_LOC=cppcheck
LOG_PATTERN=cppcheck.xml LOG_PATTERN=cppcheck.xml
NB_PATTERN_FILES=1 NB_PATTERN_FILES=1
BUILD_OPTIONS="--enable=warning --force --xml --xml-version=2 --suppressions-list=ci-scripts/cppcheck_suppressions.list" BUILD_OPTIONS="--enable=warning --force --xml --xml-version=2 --suppressions-list=ci-scripts/cppcheck_suppressions.list -I common/utils -j4"
NBARGS=$[$NBARGS+256] NBARGS=$[$NBARGS+256]
shift shift
;; ;;
...@@ -343,7 +343,7 @@ case $key in ...@@ -343,7 +343,7 @@ case $key in
ARCHIVES_LOC=cppcheck ARCHIVES_LOC=cppcheck
LOG_PATTERN=cppcheck.xml LOG_PATTERN=cppcheck.xml
NB_PATTERN_FILES=1 NB_PATTERN_FILES=1
BUILD_OPTIONS="--enable=warning --force --xml --xml-version=2 --suppressions-list=ci-scripts/cppcheck_suppressions.list" BUILD_OPTIONS="--enable=warning --force --xml --xml-version=2 --suppressions-list=ci-scripts/cppcheck_suppressions.list -I common/utils -j4"
NBARGS=$[$NBARGS+256] NBARGS=$[$NBARGS+256]
;; ;;
enb-ethernet) enb-ethernet)
......
...@@ -65,7 +65,7 @@ ...@@ -65,7 +65,7 @@
<class>Ping</class> <class>Ping</class>
<desc>ping (5MHz - 20 sec)</desc> <desc>ping (5MHz - 20 sec)</desc>
<ping_args>-c 20</ping_args> <ping_args>-c 20</ping_args>
<ping_packetloss_threshold>50</ping_packetloss_threshold> <ping_packetloss_threshold>25</ping_packetloss_threshold>
</testCase> </testCase>
<testCase id="040601"> <testCase id="040601">
...@@ -112,7 +112,7 @@ ...@@ -112,7 +112,7 @@
<class>Iperf</class> <class>Iperf</class>
<desc>iperf (5MHz - UL/2Mbps/UDP)(30 sec)(unbalanced)</desc> <desc>iperf (5MHz - UL/2Mbps/UDP)(30 sec)(unbalanced)</desc>
<iperf_args>-u -b 2M -t 30 -i 1 -R</iperf_args> <iperf_args>-u -b 2M -t 30 -i 1 -R</iperf_args>
<iperf_packetloss_threshold>80</iperf_packetloss_threshold> <iperf_packetloss_threshold>50</iperf_packetloss_threshold>
<iperf_profile>unbalanced</iperf_profile> <iperf_profile>unbalanced</iperf_profile>
</testCase> </testCase>
......
...@@ -81,7 +81,7 @@ ...@@ -81,7 +81,7 @@
<class>Ping</class> <class>Ping</class>
<desc>ping (5MHz - 20 sec)</desc> <desc>ping (5MHz - 20 sec)</desc>
<ping_args>-c 20</ping_args> <ping_args>-c 20</ping_args>
<ping_packetloss_threshold>50</ping_packetloss_threshold> <ping_packetloss_threshold>25</ping_packetloss_threshold>
</testCase> </testCase>
<testCase id="040602"> <testCase id="040602">
......
<!--
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
-->
<testCaseList>
<htmlTabRef>build-tab</htmlTabRef>
<htmlTabName>Build</htmlTabName>
<htmlTabIcon>wrench</htmlTabIcon>
<TestCaseRequestedList>
090101
</TestCaseRequestedList>
<TestCaseExclusionList></TestCaseExclusionList>
<testCase id="090101">
<class>Build_OAI_UE</class>
<desc>Build OAI UE</desc>
<Build_OAI_UE_args>-w USRP --UE</Build_OAI_UE_args>
</testCase>
</testCaseList>
<!--
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
-->
<testCaseList>
<htmlTabRef>test-10mhz-orange</htmlTabRef>
<htmlTabName>Test-10Mhz-Orange</htmlTabName>
<htmlTabIcon>tasks</htmlTabIcon>
<TestCaseRequestedList>
090102 000001 090109
</TestCaseRequestedList>
<TestCaseExclusionList></TestCaseExclusionList>
<testCase id="090102">
<class>Initialize_OAI_UE</class>
<desc>Initialize OAI UE -- sniffing Orange frequency</desc>
<Initialize_OAI_UE_args>-C 816000000 -r 50 --ue-rxgain 120 --ue-scan-carrier --no-L2-connect</Initialize_OAI_UE_args>
</testCase>
<testCase id="000001">
<class>IdleSleep</class>
<desc>Sleep</desc>
<idle_sleep_time_in_sec>30</idle_sleep_time_in_sec>
</testCase>
<testCase id="090109">
<class>Terminate_OAI_UE</class>
<desc>Terminate OAI UE</desc>
</testCase>
</testCaseList>
<!--
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
-->
<testCaseList>
<htmlTabRef>test-10mHz-sfr</htmlTabRef>
<htmlTabName>Test-10MHz-SFR</htmlTabName>
<htmlTabIcon>tasks</htmlTabIcon>
<TestCaseRequestedList>
090104 000001 090109
</TestCaseRequestedList>
<TestCaseExclusionList></TestCaseExclusionList>
<testCase id="090104">
<class>Initialize_OAI_UE</class>
<desc>Initialize OAI UE -- sniffing SFR frequency</desc>
<Initialize_OAI_UE_args>-C 806000000 -r 50 --ue-rxgain 120 --ue-scan-carrier --no-L2-connect</Initialize_OAI_UE_args>
</testCase>
<testCase id="000001">
<class>IdleSleep</class>
<desc>Sleep</desc>
<idle_sleep_time_in_sec>30</idle_sleep_time_in_sec>
</testCase>
<testCase id="090109">
<class>Terminate_OAI_UE</class>
<desc>Terminate OAI UE</desc>
</testCase>
</testCaseList>
This diff is collapsed.
...@@ -70,6 +70,7 @@ DISABLE_LOG_X="False" ...@@ -70,6 +70,7 @@ DISABLE_LOG_X="False"
USRP_REC_PLAY="False" USRP_REC_PLAY="False"
BUILD_ECLIPSE=0 BUILD_ECLIPSE=0
UE_NAS_USE_TUN="False" UE_NAS_USE_TUN="False"
UETARGET="False"
BASIC_SIMULATOR=0 BASIC_SIMULATOR=0
trap handle_ctrl_c INT trap handle_ctrl_c INT
...@@ -103,6 +104,8 @@ Options ...@@ -103,6 +104,8 @@ Options
Specify conf_nvram_path (default \"$conf_nvram_path\") Specify conf_nvram_path (default \"$conf_nvram_path\")
--UE-gen-nvram [output path] --UE-gen-nvram [output path]
Specify gen_nvram_path (default \"$gen_nvram_path\") Specify gen_nvram_path (default \"$gen_nvram_path\")
-a | --agent
Enables agent for software-defined control of the eNB
-r | --3gpp-release -r | --3gpp-release
default is Rel14, default is Rel14,
Rel8 limits the implementation to 3GPP Release 8 version Rel8 limits the implementation to 3GPP Release 8 version
...@@ -216,6 +219,7 @@ function main() { ...@@ -216,6 +219,7 @@ function main() {
shift;; shift;;
--UE) --UE)
UE=1 UE=1
UETARGET="True"
echo_info "Will compile UE" echo_info "Will compile UE"
shift;; shift;;
--mu) --mu)
...@@ -545,6 +549,9 @@ function main() { ...@@ -545,6 +549,9 @@ function main() {
echo "set (UE_TIMING_TRACE $UE_TIMING_TRACE)" >> $cmake_file echo "set (UE_TIMING_TRACE $UE_TIMING_TRACE)" >> $cmake_file
echo "set (DISABLE_LOG_X $DISABLE_LOG_X)" >> $cmake_file echo "set (DISABLE_LOG_X $DISABLE_LOG_X)" >> $cmake_file
echo "set (USRP_REC_PLAY $USRP_REC_PLAY)" >> $cmake_file echo "set (USRP_REC_PLAY $USRP_REC_PLAY)" >> $cmake_file
if [ "$UE" = 1 ] ; then
echo "set (UETARGET $UETARGET )" >> $cmake_file
fi
if [ "$UE" = 1 -a "$NOS1" = "0" ] ; then if [ "$UE" = 1 -a "$NOS1" = "0" ] ; then
echo_info "Compiling UE S1 build : enabling Linux and NETLINK" echo_info "Compiling UE S1 build : enabling Linux and NETLINK"
echo "set (LINUX True )" >> $cmake_file echo "set (LINUX True )" >> $cmake_file
...@@ -938,6 +945,7 @@ function main() { ...@@ -938,6 +945,7 @@ function main() {
echo "set (USRP_REC_PLAY $USRP_REC_PLAY)" >> $cmake_file echo "set (USRP_REC_PLAY $USRP_REC_PLAY)" >> $cmake_file
echo "set (LINUX True )" >> $cmake_file echo "set (LINUX True )" >> $cmake_file
echo "set (PDCP_USE_NETLINK True )" >> $cmake_file echo "set (PDCP_USE_NETLINK True )" >> $cmake_file
echo "set (UETARGET True )" >> $cmake_file
echo "set (BASIC_SIMULATOR \"True\" )" >> $cmake_file echo "set (BASIC_SIMULATOR \"True\" )" >> $cmake_file
# echo "set (UE_NAS_USE_TUN \"True\" )" >> $cmake_file # echo "set (UE_NAS_USE_TUN \"True\" )" >> $cmake_file
echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt)' >> $cmake_file echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt)' >> $cmake_file
......
...@@ -639,8 +639,6 @@ check_install_oai_software() { ...@@ -639,8 +639,6 @@ check_install_oai_software() {
libidn2-0-dev \ libidn2-0-dev \
libidn11-dev \ libidn11-dev \
libmysqlclient-dev \ libmysqlclient-dev \
liboctave-dev \
libpgm-dev \
libpython2.7-dev \ libpython2.7-dev \
libsctp1 \ libsctp1 \
libsctp-dev \ libsctp-dev \
...@@ -651,7 +649,6 @@ check_install_oai_software() { ...@@ -651,7 +649,6 @@ check_install_oai_software() {
libxml2-dev \ libxml2-dev \
libxslt1-dev \ libxslt1-dev \
mscgen \ mscgen \
octave \
octave-signal \ octave-signal \
openssh-client \ openssh-client \
openssh-server \ openssh-server \
...@@ -663,7 +660,8 @@ check_install_oai_software() { ...@@ -663,7 +660,8 @@ check_install_oai_software() {
pydb \ pydb \
libyaml-dev \ libyaml-dev \
wget \ wget \
libxpm-dev libxpm-dev \
libboost-all-dev
$SUDO update-alternatives --set "$LAPACK_LIBNAME" "$LAPACK_TARGET" $SUDO update-alternatives --set "$LAPACK_LIBNAME" "$LAPACK_TARGET"
...@@ -711,8 +709,6 @@ check_install_oai_software() { ...@@ -711,8 +709,6 @@ check_install_oai_software() {
libidn2-devel \ libidn2-devel \
libidn-devel \ libidn-devel \
mariadb-devel \ mariadb-devel \
octave-devel \
openpgm-devel \
lksctp-tools \ lksctp-tools \
lksctp-tools-devel \ lksctp-tools-devel \
openssl-devel \ openssl-devel \
...@@ -722,8 +718,6 @@ check_install_oai_software() { ...@@ -722,8 +718,6 @@ check_install_oai_software() {
libxml2 \ libxml2 \
libxml2-devel \ libxml2-devel \
libxslt-devel \ libxslt-devel \
octave \
octave-signal \
openssh-clients \ openssh-clients \
openssh-server \ openssh-server \
openssl \ openssl \
...@@ -746,7 +740,7 @@ check_install_oai_software() { ...@@ -746,7 +740,7 @@ check_install_oai_software() {
libyaml-devel libyaml-devel
fi fi
install_asn1c_from_source install_asn1c_from_source $1
$SUDO rm -fr /opt/ssh $SUDO rm -fr /opt/ssh
$SUDO git clone https://gist.github.com/2190472.git /opt/ssh $SUDO git clone https://gist.github.com/2190472.git /opt/ssh
} }
......
...@@ -23,7 +23,7 @@ reset_color="$(tput sgr0)" ...@@ -23,7 +23,7 @@ reset_color="$(tput sgr0)"
function error() function error()
{ {
echo -e "$red_color"ERROR: "$@""$reset_color" echo -e "$red_color"ERROR: "$@""$reset_color"
exit 1 # exit 1
} }
function check_sha1() function check_sha1()
...@@ -56,11 +56,11 @@ function patch_file() ...@@ -56,11 +56,11 @@ function patch_file()
echo -e "$green_color""patch file $file with $OPENAIR_DIR/cmake_targets/tools/$patch""$reset_color" echo -e "$green_color""patch file $file with $OPENAIR_DIR/cmake_targets/tools/$patch""$reset_color"
patch "$file" "$OPENAIR_DIR/cmake_targets/tools/$patch" # patch "$file" "$OPENAIR_DIR/cmake_targets/tools/$patch"
if [ $? -ne 0 ] # if [ $? -ne 0 ]
then # then
error "patching of $file with $OPENAIR_DIR/cmake_targets/tools/$patch failed" # error "patching of $file with $OPENAIR_DIR/cmake_targets/tools/$patch failed"
fi # fi
} }
function apply_patches() function apply_patches()
...@@ -140,6 +140,22 @@ function patch_s1ap() ...@@ -140,6 +140,22 @@ function patch_s1ap()
esac esac
} }
function patch_f1ap()
{
local directory="$1"
local version="$2"
case "$version" in
R15 )
#nothing to do anymore (fixes went to asn1c)
;;
* )
error unknwon/unhandled F1AP version \'"$version"\'
;;
esac
}
function main() function main()
{ {
if [ $# -ne 3 ] if [ $# -ne 3 ]
...@@ -167,6 +183,9 @@ function main() ...@@ -167,6 +183,9 @@ function main()
S1AP ) S1AP )
patch_s1ap "$directory" "$version" patch_s1ap "$directory" "$version"
;; ;;
F1AP )
patch_f1ap "$directory" "$version"
;;
* ) * )
error unknown module "$module" error unknown module "$module"
;; ;;
......
...@@ -2,23 +2,29 @@ ...@@ -2,23 +2,29 @@
function main() function main()
{ {
mkdir -p $1 PROTOCOL_DIR=$1
cd $1 mkdir -p ${PROTOCOL_DIR}
cd ${PROTOCOL_DIR}
# Because use $* also include directory, so we need shift
shift shift
#if this script is called with only 2 arguments (so 1 here after the shift), it's for RRC # There are three types parameter for asn1c
#(there may be a better way...) # One is for RRC
if [ $# -eq 1 ]; then # and one is for F1AP
# another is for other protocols
if echo ${PROTOCOL_DIR} | grep -q "RRC"; then
#asn1c does not work well with extension groups, we need the following fix: #asn1c does not work well with extension groups, we need the following fix:
# replace [[ by '<name> SEQUENCE {' # replace [[ by '<name> SEQUENCE {'
# and ]] by '} OPTIONAL' # and ]] by '} OPTIONAL'
#<name> is ext<N> with N starting from 1 and incremented at each new [[ ]] just #<name> is ext<N> with N starting from 1 and incremented at each new [[ ]] just
#following another [[ ]] #following another [[ ]]
# #
#this is what the following C program does #this is what the following C program does
echo generate asnfix.c echo generate asnfix.c
cat << EOF > asnfix.c cat << EOF > asnfix.c
/* transforms: /* transforms:
...@@ -85,29 +91,33 @@ int main(void) ...@@ -85,29 +91,33 @@ int main(void)
} }
EOF EOF
echo compile asnfix.c echo compile asnfix.c
gcc -Wall -o asnfix asnfix.c
echo run asnfix on $1
gcc -Wall -o asnfix asnfix.c ./asnfix < $1 > fixed_grammar.asn
echo run asnfix on $1 rm -f asnfix asnfix.c
./asnfix < $1 > fixed_grammar.asn echo done with asnfix
rm -f asnfix asnfix.c echo running asn1c
echo done with asnfix asn1c -gen-PER -fcompound-names -no-gen-example fixed_grammar.asn 2>&1 | grep -v -- '->' | grep -v '^Compiled' |grep -v sample
echo running asn1c rm -f fixed_grammar.asn
asn1c -gen-PER -fcompound-names fixed_grammar.asn 2>&1 | grep -v -- '->' | grep -v '^Compiled' |grep -v sample echo asn1c done
rm -f fixed_grammar.asn elif echo ${PROTOCOL_DIR} | grep -q "F1AP"; then
echo asn1c done asn1c -gen-PER -fcompound-names -no-gen-example -findirect-choice -fno-include-deps $* 2>&1 | grep -v -- '->' | grep -v '^Compiled' |grep -v sample
else else
asn1c -gen-PER -fcompound-names $* 2>&1 | grep -v -- '->' | grep -v '^Compiled' |grep -v sample asn1c -gen-PER -fcompound-names -no-gen-example $* 2>&1 | grep -v -- '->' | grep -v '^Compiled' |grep -v sample
fi fi
......
/*
* 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 common/ngran_types.h
* \brief Definitions for NGRAN node types
* \author R. Knopp
* \date 2018
* \version 0.1
* \company Eurecom
* \email: knopp@eurecom.fr
* \note
* \warning
*/
#ifndef __NGRAN_TYPES_H__
#define __NGRAN_TYPES_H__
typedef enum {
ngran_eNB = 0,
ngran_ng_eNB = 1,
ngran_gNB = 2,
ngran_eNB_CU = 3,
ngran_ng_eNB_CU = 4,
ngran_gNB_CU = 5,
ngran_eNB_DU = 6,
ngran_gNB_DU = 7
} ngran_node_t;
#define NODE_IS_MONOLITHIC(nOdE_TyPe) ((nOdE_TyPe) == ngran_eNB || (nOdE_TyPe) == ngran_ng_eNB || (nOdE_TyPe) == ngran_gNB)
#define NODE_IS_CU(nOdE_TyPe) ((nOdE_TyPe) == ngran_eNB_CU || (nOdE_TyPe) == ngran_ng_eNB_CU || (nOdE_TyPe) == ngran_gNB_CU)
#define NODE_IS_DU(nOdE_TyPe) ((nOdE_TyPe) == ngran_eNB_DU || (nOdE_TyPe) == ngran_gNB_DU)
#endif
...@@ -39,6 +39,8 @@ ...@@ -39,6 +39,8 @@
#include "PHY/types.h" #include "PHY/types.h"
#include "PHY/impl_defs_top.h" #include "PHY/impl_defs_top.h"
#include "PHY/impl_defs_lte.h" #include "PHY/impl_defs_lte.h"
#include "ENB_APP/enb_config.h"
#include "RRC/LTE/rrc_defs.h" #include "RRC/LTE/rrc_defs.h"
#include "flexran_agent_defs.h" #include "flexran_agent_defs.h"
...@@ -49,7 +51,11 @@ ...@@ -49,7 +51,11 @@
#include "gtpv1u_eNB_defs.h" #include "gtpv1u_eNB_defs.h"
#include "PHY/defs_L1_NB_IoT.h" #include "PHY/defs_L1_NB_IoT.h"
#include "RRC/LTE/defs_NB_IoT.h" #include "RRC/LTE/defs_NB_IoT.h"
typedef struct { typedef struct {
/// RAN context config file name /// RAN context config file name
char *config_file_name; char *config_file_name;
......
...@@ -393,15 +393,18 @@ int logInit (void) { ...@@ -393,15 +393,18 @@ int logInit (void) {
register_log_component("mRAL","",RAL_UE); register_log_component("mRAL","",RAL_UE);
register_log_component("ENB_APP","log",ENB_APP); register_log_component("ENB_APP","log",ENB_APP);
register_log_component("FLEXRAN_AGENT","log",FLEXRAN_AGENT); register_log_component("FLEXRAN_AGENT","log",FLEXRAN_AGENT);
register_log_component("PROTO_AGENT","log",PROTO_AGENT);
register_log_component("TMR","",TMR); register_log_component("TMR","",TMR);
register_log_component("USIM","txt",USIM); register_log_component("USIM","txt",USIM);
register_log_component("SIM","txt",SIM); register_log_component("SIM","txt",SIM);
/* following log component are used for the localization*/ /* following log component are used for the localization*/
/* following log component are used for the localization*/
register_log_component("LOCALIZE","log",LOCALIZE); register_log_component("LOCALIZE","log",LOCALIZE);
register_log_component("NAS","log",NAS); register_log_component("NAS","log",NAS);
register_log_component("UDP","",UDP_); register_log_component("UDP","",UDP_);
register_log_component("GTPV1U","",GTPU); register_log_component("GTPV1U","",GTPU);
register_log_component("S1AP","",S1AP); register_log_component("S1AP","",S1AP);
register_log_component("F1AP","",F1AP);
register_log_component("X2AP","",X2AP); register_log_component("X2AP","",X2AP);
register_log_component("SCTP","",SCTP); register_log_component("SCTP","",SCTP);
register_log_component("X2AP","",X2AP); register_log_component("X2AP","",X2AP);
......
...@@ -204,6 +204,7 @@ typedef enum { ...@@ -204,6 +204,7 @@ typedef enum {
GTPU, GTPU,
SPGW, SPGW,
S1AP, S1AP,
F1AP,
SCTP, SCTP,
HW, HW,
OSA, OSA,
...@@ -214,6 +215,8 @@ typedef enum { ...@@ -214,6 +215,8 @@ typedef enum {
TMR, TMR,
USIM, USIM,
LOCALIZE, LOCALIZE,
PROTO_AGENT,
F1U,
X2AP, X2AP,
LOADER, LOADER,
ASN, ASN,
......
...@@ -629,7 +629,7 @@ ID = LEGACY_OCM_DEBUG ...@@ -629,7 +629,7 @@ ID = LEGACY_OCM_DEBUG
FORMAT = string,log FORMAT = string,log
ID = LEGACY_OCM_TRACE ID = LEGACY_OCM_TRACE
DESC = OCM legacy logs - trace level DESC = OCM legacy logs - trace level
GROUP = ALL:LEGACY_OCM:LEGACY_GROUP_TRACE:LEGACY OGROUP = ALL:LEGACY_OCM:LEGACY_GROUP_TRACE:LEGACY
FORMAT = string,log FORMAT = string,log
ID = LEGACY_OIP_INFO ID = LEGACY_OIP_INFO
...@@ -888,6 +888,62 @@ ID = LEGACY_componentP_TRACE ...@@ -888,6 +888,62 @@ ID = LEGACY_componentP_TRACE
ID = LEGACY_PROTO_AGENT_DEBUG
DESC = PROTO AGENT DEBUG LEVEL
GROUP = ALL:LEGACY_PROTO:LEGACY_GROUP_DEBUG:LEGACY
FORMAT = string,log
ID = LEGACY_PROTO_AGENT_INFO
DESC = PROTO AGENT INFO LEVEL
GROUP = ALL:LEGACY_PROTO:LEGACY_GROUP_INFO:LEGACY
FORMAT = string,log
ID = LEGACY_PROTO_AGENT_WARNING
DESC = PROTO AGENT WARNING LEVEL
GROUP = ALL:LEGACY_PROTO:LEGACY_GROUP_WARNING:LEGACY
FORMAT = string,log
ID = LEGACY_PROTO_AGENT_ERROR
DESC = PROTO AGENT ERROR LEVEL
GROUP = ALL:LEGACY_PROTO:LEGACY_GROUP_ERROR:LEGACY
FORMAT = string,log
ID = LEGACY_F1U_DEBUG
DESC = F1U DEBUG LEVEL
GROUP = ALL:LEGACY_F1U:LEGACY_GROUP_DEBUG:LEGACY
FORMAT = string,log
ID = LEGACY_F1U_INFO
DESC = F1U INFO LEVEL
GROUP = ALL:LEGACY_F1U:LEGACY_GROUP_INFO:LEGACY
FORMAT = string,log
ID = LEGACY_F1U_ERROR
DESC = F1U ERROR LEVEL
GROUP = ALL:LEGACY_F1U:LEGACY_GROUP_ERROR:LEGACY
FORMAT = string,log
ID = LEGACY_F1AP_TRACE
DESC = F1AP TRACE LEVEL
GROUP = ALL:LEGACY_F1AP:LEGACY_GROUP_TRACE:LEGACY
FORMAT = string,log
ID = LEGACY_F1AP_DEBUG
DESC = F1AP DEBUG LEVEL
GROUP = ALL:LEGACY_F1AP:LEGACY_GROUP_DEBUG:LEGACY
FORMAT = string,log
ID = LEGACY_F1AP_INFO
DESC = F1AP INFO LEVEL
GROUP = ALL:LEGACY_F1AP:LEGACY_GROUP_INFO:LEGACY
FORMAT = string,log
ID = LEGACY_F1AP_WARNING
DESC = F1AP WARNING LEVEL
GROUP = ALL:LEGACY_F1AP:LEGACY_GROUP_WARNING:LEGACY
FORMAT = string,log
ID = LEGACY_F1AP_ERROR
DESC = F1AP ERROR LEVEL
GROUP = ALL:LEGACY_F1AP:LEGACY_GROUP_ERROR:LEGACY
FORMAT = string,log
################# #################
#### UE LOGS #### #### UE LOGS ####
################# #################
......
...@@ -35,13 +35,11 @@ ...@@ -35,13 +35,11 @@
void output_log_mem(void); void output_log_mem(void);
#define _Assert_Exit_ \ #define _Assert_Exit_ \
{ \
fprintf(stderr, "\nExiting execution\n"); \ fprintf(stderr, "\nExiting execution\n"); \
display_backtrace(); \ display_backtrace(); \
fflush(stdout); \ fflush(stdout); \
fflush(stderr); \ fflush(stderr); \
exit(EXIT_FAILURE); \ exit(EXIT_FAILURE); \
}
#define _Assert_(cOND, aCTION, fORMAT, aRGS...) \ #define _Assert_(cOND, aCTION, fORMAT, aRGS...) \
do { \ do { \
......
...@@ -150,7 +150,7 @@ int msc_init(const msc_env_t envP, const int max_threadsP) ...@@ -150,7 +150,7 @@ int msc_init(const msc_env_t envP, const int max_threadsP)
pointer_p = malloc(MSC_MAX_MESSAGE_LENGTH); pointer_p = malloc(MSC_MAX_MESSAGE_LENGTH);
AssertFatal (pointer_p, "malloc failed!\n"); AssertFatal (pointer_p, "malloc failed!\n");
rv = lfds611_stack_guaranteed_push( g_msc_memory_stack_p, pointer_p ); rv = lfds611_stack_guaranteed_push( g_msc_memory_stack_p, pointer_p );
AssertFatal (rv, "lfds611_stack_guaranteed_push failed for item %u\n", i); AssertFatal (rv, "lfds611_stack_guaranteed_push failed for item %d\n", i);
} }
for (i = MIN_MSC_PROTOS; i < MAX_MSC_PROTOS; i++) { for (i = MIN_MSC_PROTOS; i < MAX_MSC_PROTOS; i++) {
...@@ -476,7 +476,20 @@ int msc_init(const msc_env_t envP, const int max_threadsP) ...@@ -476,7 +476,20 @@ int msc_init(const msc_env_t envP, const int max_threadsP)
} }
break; break;
case MSC_F1AP_CU:
rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "F1AP_CU");
if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;}
//if ((envP == MSC_E_UTRAN) || (envP == MSC_MME_GW) || (envP == MSC_MME)) {
msc_log_declare_proto(i);
//}
break;
case MSC_F1AP_DU:
rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "F1AP_DU");
if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;}
//if ((envP == MSC_E_UTRAN) || (envP == MSC_MME_GW) || (envP == MSC_MME)) {
msc_log_declare_proto(i);
//}
break;
default: default:
rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "UNKNOWN"); rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "UNKNOWN");
......
...@@ -62,6 +62,8 @@ typedef enum { ...@@ -62,6 +62,8 @@ typedef enum {
MSC_S11_MME, MSC_S11_MME,
MSC_S6A_MME, MSC_S6A_MME,
MSC_HSS, MSC_HSS,
MSC_F1AP_CU,
MSC_F1AP_DU,
MSC_X2AP_SRC_ENB, MSC_X2AP_SRC_ENB,
MSC_X2AP_TARGET_ENB, MSC_X2AP_TARGET_ENB,
MAX_MSC_PROTOS, MAX_MSC_PROTOS,
......
...@@ -13,3 +13,4 @@ ...@@ -13,3 +13,4 @@
#include "openair2/COMMON/udp_messages_def.h" #include "openair2/COMMON/udp_messages_def.h"
#include "openair2/COMMON/gtpv1_u_messages_def.h" #include "openair2/COMMON/gtpv1_u_messages_def.h"
#include "openair2/COMMON/flexran_messages_def.h" #include "openair2/COMMON/flexran_messages_def.h"
#include "openair2/COMMON/f1ap_messages_def.h"
...@@ -300,6 +300,8 @@ typedef struct { ...@@ -300,6 +300,8 @@ typedef struct {
TASK_DEF(TASK_MSC, TASK_PRIORITY_MED, 200, NULL, NULL)\ TASK_DEF(TASK_MSC, TASK_PRIORITY_MED, 200, NULL, NULL)\
TASK_DEF(TASK_GTPV1_U, TASK_PRIORITY_MED, 1000,NULL, NULL)\ TASK_DEF(TASK_GTPV1_U, TASK_PRIORITY_MED, 1000,NULL, NULL)\
TASK_DEF(TASK_UDP, TASK_PRIORITY_MED, 1000, NULL, NULL)\ TASK_DEF(TASK_UDP, TASK_PRIORITY_MED, 1000, NULL, NULL)\
TASK_DEF(TASK_CU_F1, TASK_PRIORITY_MED, 200, NULL, NULL) \
TASK_DEF(TASK_DU_F1, TASK_PRIORITY_MED, 200, NULL, NULL) \
TASK_DEF(TASK_MAX, TASK_PRIORITY_MED, 200, NULL, NULL) TASK_DEF(TASK_MAX, TASK_PRIORITY_MED, 200, NULL, NULL)
#define TASK_DEF(TaskID, pRIO, qUEUEsIZE, FuNc, ThreadFunc) { pRIO, qUEUEsIZE, #TaskID, FuNc, ThreadFunc }, #define TASK_DEF(TaskID, pRIO, qUEUEsIZE, FuNc, ThreadFunc) { pRIO, qUEUEsIZE, #TaskID, FuNc, ThreadFunc },
......
all: measurement_display thread-pool-test
measurement_display: measurement_display.c thread-pool.h
gcc measurement_display.c -I /data/openairinterface5g.nr/common/utils/ -I. /data/openairinterface5g.nr/common/utils/backtrace.c -lpthread -D TEST_THREAD_POOL -I../LOG -I../../utils/T -o measurement_display
thread-pool-test: thread-pool.c thread-pool.h
gcc -g thread-pool.c -I /data/openairinterface5g.nr/common/utils/ -I. /data/openairinterface5g.nr/common/utils/backtrace.c -lpthread -D TEST_THREAD_POOL -I../LOG -I../../utils/T -o thread-pool-test
/*
Author: Laurent THOMAS, Open Cells
copyleft: OpenAirInterface Software Alliance and it's licence
*/
#define __USE_GNU
#define _GNU_SOURCE
#include <stdio.h>
#include <pthread.h>
#include <sched.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <string.h>
#include <unistd.h>
#include <sys/syscall.h>
#include <sys/time.h>
#include <stdint.h>
#include <sys/stat.h>
#include <fcntl.h>
#include "thread-pool.h"
#define SEP "\t"
uint64_t cpuCyclesMicroSec;
int main(int argc, char *argv[]) {
if(argc != 2) {
printf("Need one paramter: the trace Linux pipe (fifo)");
exit(1);
}
mkfifo(argv[1],0666);
int fd=open(argv[1], O_RDONLY);
if ( fd == -1 ) {
perror("open read mode trace file:");
exit(1);
}
uint64_t deb=rdtsc();
usleep(100000);
cpuCyclesMicroSec=(rdtsc()-deb)/100000;
printf("Cycles per µs: %lu\n",cpuCyclesMicroSec);
printf("Key" SEP "delay to process" SEP "processing time" SEP "delay to be read answer\n");
notifiedFIFO_elt_t doneRequest;
while ( 1 ) {
if ( read(fd,&doneRequest, sizeof(doneRequest)) == sizeof(doneRequest)) {
printf("%lu" SEP "%lu" SEP "%lu" SEP "%lu" "\n",
doneRequest.key,
(doneRequest.startProcessingTime-doneRequest.creationTime)/cpuCyclesMicroSec,
(doneRequest.endProcessingTime-doneRequest.startProcessingTime)/cpuCyclesMicroSec,
(doneRequest.returnTime-doneRequest.endProcessingTime)/cpuCyclesMicroSec
);
} else {
printf("no measurements\n");
sleep(1);
}
}
}
/*
Author: Laurent THOMAS, Open Cells
copyleft: OpenAirInterface Software Alliance and it's licence
*/
#define _GNU_SOURCE
#include <sched.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <string.h>
#include <unistd.h>
#include <ctype.h>
#include <sys/sysinfo.h>
#include <threadPool/thread-pool.h>
void displayList(notifiedFIFO_t *nf) {
int n=0;
notifiedFIFO_elt_t *ptr=nf->outF;
while(ptr) {
printf("element: %d, key: %lu\n",++n,ptr->key);
ptr=ptr->next;
}
printf("End of list: %d elements\n",n);
}
static inline notifiedFIFO_elt_t *pullNotifiedFifoRemember( notifiedFIFO_t *nf, struct one_thread *thr) {
mutexlock(nf->lockF);
while(!nf->outF)
condwait(nf->notifF, nf->lockF);
notifiedFIFO_elt_t *ret=nf->outF;
nf->outF=nf->outF->next;
if (nf->outF==NULL)
nf->inF=NULL;
// For abort feature
thr->runningOnKey=ret->key;
thr->abortFlag=false;
mutexunlock(nf->lockF);
return ret;
}
void *one_thread(void *arg) {
struct one_thread *myThread=(struct one_thread *) arg;
struct thread_pool *tp=myThread->pool;
// configure the thread core assignment
// TBD: reserve the core for us exclusively
if ( myThread->coreID >= 0 && myThread->coreID < get_nprocs_conf()) {
cpu_set_t cpuset;
CPU_ZERO(&cpuset);
CPU_SET(myThread->coreID, &cpuset);
pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset);
}
//Configure the thread scheduler policy for Linux
struct sched_param sparam= {0};
sparam.sched_priority = sched_get_priority_max(SCHED_RR);
pthread_setschedparam(pthread_self(), SCHED_RR, &sparam);
// set the thread name for debugging
sprintf(myThread->name,"Tpool_%d",myThread->coreID);
pthread_setname_np(pthread_self(), myThread->name );
// Infinite loop to process requests
do {
notifiedFIFO_elt_t *elt=pullNotifiedFifoRemember(&tp->incomingFifo, myThread);
if (tp->measurePerf) elt->startProcessingTime=rdtsc();
elt->processingFunc(NotifiedFifoData(elt));
if (tp->measurePerf) elt->endProcessingTime=rdtsc();
if (elt->reponseFifo) {
// Check if the job is still alive, else it has been aborted
mutexlock(tp->incomingFifo.lockF);
if (myThread->abortFlag)
delNotifiedFIFO_elt(elt);
else
pushNotifiedFIFO(elt->reponseFifo, elt);
mutexunlock(tp->incomingFifo.lockF);
}
} while (true);
}
void initTpool(char *params,tpool_t *pool, bool performanceMeas) {
memset(pool,0,sizeof(*pool));
char *measr=getenv("threadPoolMeasurements");
pool->measurePerf=performanceMeas;
// force measurement if the output is defined
pool->measurePerf=measr!=NULL;
if (measr) {
mkfifo(measr,0666);
AssertFatal(-1 != (pool->dummyTraceFd=
open(measr, O_RDONLY| O_NONBLOCK)),"");
AssertFatal(-1 != (pool->traceFd=
open(measr, O_WRONLY|O_APPEND|O_NOATIME|O_NONBLOCK)),"");
} else
pool->traceFd=-1;
//Configure the thread scheduler policy for Linux
struct sched_param sparam= {0};
sparam.sched_priority = sched_get_priority_max(SCHED_RR)-1;
pthread_setschedparam(pthread_self(), SCHED_RR, &sparam);
pool->activated=true;
initNotifiedFIFO(&pool->incomingFifo);
char *saveptr, * curptr;
pool->nbThreads=0;
pool->restrictRNTI=false;
curptr=strtok_r(params,",",&saveptr);
while ( curptr!=NULL ) {
int c=toupper(curptr[0]);
switch (c) {
case 'U':
pool->restrictRNTI=true;
break;
case 'N':
pool->activated=false;
break;
default:
pool->allthreads=(struct one_thread *)malloc(sizeof(struct one_thread));
pool->allthreads->next=pool->allthreads;
printf("create a thread for core %d\n", atoi(curptr));
pool->allthreads->coreID=atoi(curptr);
pool->allthreads->id=pool->nbThreads;
pool->allthreads->pool=pool;
pthread_create(&pool->allthreads->threadID, NULL, one_thread, (void *)pool->allthreads);
pool->nbThreads++;
}
curptr=strtok_r(NULL,",",&saveptr);
}
if (pool->activated && pool->nbThreads==0) {
printf("No servers created in the thread pool, exit\n");
exit(1);
}
}
#ifdef TEST_THREAD_POOL
struct testData {
int id;
char txt[30];
};
void processing(void *arg) {
struct testData *in=(struct testData *)arg;
printf("doing: %d, %s, in thr %ld\n",in->id, in->txt,pthread_self() );
sprintf(in->txt,"Done by %ld, job %d", pthread_self(), in->id);
usleep(rand()%100);
printf("done: %d, %s, in thr %ld\n",in->id, in->txt,pthread_self() );
}
int main() {
notifiedFIFO_t myFifo;
initNotifiedFIFO(&myFifo);
pushNotifiedFIFO(&myFifo,newNotifiedFIFO_elt(sizeof(struct testData), 1234,NULL,NULL));
for(int i=10; i>1; i--) {
pushNotifiedFIFO(&myFifo,newNotifiedFIFO_elt(sizeof(struct testData), 1000+i,NULL,NULL));
}
displayList(&myFifo);
notifiedFIFO_elt_t *tmp=pullNotifiedFIFO(&myFifo);
printf("pulled: %lu\n", tmp->key);
displayList(&myFifo);
tmp=pullNotifiedFIFO(&myFifo);
printf("pulled: %lu\n", tmp->key);
displayList(&myFifo);
abortNotifiedFIFO(&myFifo,1005);
printf("aborted 1005\n");
displayList(&myFifo);
pushNotifiedFIFO(&myFifo,newNotifiedFIFO_elt(sizeof(struct testData), 12345678, NULL, NULL));
displayList(&myFifo);
abortNotifiedFIFO(&myFifo,12345678);
printf("aborted 12345678\n");
displayList(&myFifo);
do {
tmp=pollNotifiedFIFO(&myFifo);
if (tmp) {
printf("pulled: %lu\n", tmp->key);
displayList(&myFifo);
} else
printf("Empty list \n");
} while(tmp);
tpool_t pool;
char params[]="1,2,3,u";
initTpool(params,&pool, true);
notifiedFIFO_t worker_back;
initNotifiedFIFO(&worker_back);
for (int i=0; i <1000 ; i++) {
notifiedFIFO_elt_t *work=newNotifiedFIFO_elt(sizeof(struct testData), i, &worker_back, processing);
struct testData *x=(struct testData *)NotifiedFifoData(work);
x->id=i;
pushTpool(&pool, work);
}
do {
tmp=pullTpool(&worker_back,&pool);
if (tmp) {
struct testData *dd=NotifiedFifoData(tmp);
printf("Result: %s\n",dd->txt);
delNotifiedFIFO_elt(tmp);
} else
printf("Empty list \n");
abortTpool(&pool,510);
} while(tmp);
return 0;
}
#endif
/*
Author: Laurent THOMAS, Open Cells
copyleft: OpenAirInterface Software Alliance and it's licence
*/
#ifndef THREAD_POOL_H
#define THREAD_POOL_H
#include <stdbool.h>
#include <stdint.h>
#include <pthread.h>
#include <sys/syscall.h>
#include <assertions.h>
#include <LOG/log.h>
#ifdef DEBUG
#define THREADINIT PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP
#else
#define THREADINIT PTHREAD_MUTEX_INITIALIZER
#endif
#define mutexinit(mutex) AssertFatal(pthread_mutex_init(&mutex,NULL)==0,"");
#define condinit(signal) AssertFatal(pthread_cond_init(&signal,NULL)==0,"");
#define mutexlock(mutex) AssertFatal(pthread_mutex_lock(&mutex)==0,"");
#define mutextrylock(mutex) pthread_mutex_trylock(&mutex)
#define mutexunlock(mutex) AssertFatal(pthread_mutex_unlock(&mutex)==0,"");
#define condwait(condition, mutex) AssertFatal(pthread_cond_wait(&condition, &mutex)==0,"");
#define condbroadcast(signal) AssertFatal(pthread_cond_broadcast(&signal)==0,"");
#define condsignal(signal) AssertFatal(pthread_cond_broadcast(&signal)==0,"");
typedef struct notifiedFIFO_elt_s {
struct notifiedFIFO_elt_s *next;
uint64_t key; //To filter out elements
struct notifiedFIFO_s *reponseFifo;
void (*processingFunc)(void *);
bool malloced;
uint64_t creationTime;
uint64_t startProcessingTime;
uint64_t endProcessingTime;
uint64_t returnTime;
void *msgData;
} notifiedFIFO_elt_t;
typedef struct notifiedFIFO_s {
notifiedFIFO_elt_t *outF;
notifiedFIFO_elt_t *inF;
pthread_mutex_t lockF;
pthread_cond_t notifF;
} notifiedFIFO_t;
// You can use this allocator or use any piece of memory
static inline notifiedFIFO_elt_t *newNotifiedFIFO_elt(int size,
uint64_t key,
notifiedFIFO_t *reponseFifo,
void (*processingFunc)(void *)) {
notifiedFIFO_elt_t *ret;
AssertFatal( NULL != (ret=(notifiedFIFO_elt_t *) malloc(sizeof(notifiedFIFO_elt_t)+size+32)), "");
ret->next=NULL;
ret->key=key;
ret->reponseFifo=reponseFifo;
ret->processingFunc=processingFunc;
// We set user data piece aligend 32 bytes to be able to process it with SIMD
ret->msgData=(void *)ret+(sizeof(notifiedFIFO_elt_t)/32+1)*32;
ret->malloced=true;
return ret;
}
static inline void *NotifiedFifoData(notifiedFIFO_elt_t *elt) {
return elt->msgData;
}
static inline void delNotifiedFIFO_elt(notifiedFIFO_elt_t *elt) {
if (elt->malloced) {
elt->malloced=false;
free(elt);
} else
printf("delNotifiedFIFO on something not allocated by newNotifiedFIFO\n");
//LOG_W(UTIL,"delNotifiedFIFO on something not allocated by newNotifiedFIFO\n");
}
static inline void initNotifiedFIFO(notifiedFIFO_t *nf) {
mutexinit(nf->lockF);
condinit (nf->notifF);
nf->inF=NULL;
nf->outF=NULL;
// No delete function: the creator has only to free the memory
}
static inline void pushNotifiedFIFO(notifiedFIFO_t *nf, notifiedFIFO_elt_t *msg) {
mutexlock(nf->lockF);
msg->next=NULL;
if (nf->outF == NULL)
nf->outF = msg;
if (nf->inF)
nf->inF->next = msg;
nf->inF = msg;
condbroadcast(nf->notifF);
mutexunlock(nf->lockF);
}
static inline notifiedFIFO_elt_t *pullNotifiedFIFO(notifiedFIFO_t *nf) {
mutexlock(nf->lockF);
while(!nf->outF)
condwait(nf->notifF, nf->lockF);
notifiedFIFO_elt_t *ret=nf->outF;
nf->outF=nf->outF->next;
if (nf->outF==NULL)
nf->inF=NULL;
mutexunlock(nf->lockF);
return ret;
}
static inline notifiedFIFO_elt_t *pollNotifiedFIFO(notifiedFIFO_t *nf) {
int tmp=mutextrylock(nf->lockF);
if (tmp != 0 )
return NULL;
notifiedFIFO_elt_t *ret=nf->outF;
if (ret!=NULL)
nf->outF=nf->outF->next;
if (nf->outF==NULL)
nf->inF=NULL;
mutexunlock(nf->lockF);
return ret;
}
// This function aborts all messages matching the key
// If the queue is used in thread pools, it doesn't cancels already running processing
// because the message has already been picked
static inline void abortNotifiedFIFO(notifiedFIFO_t *nf, uint64_t key) {
mutexlock(nf->lockF);
notifiedFIFO_elt_t **start=&nf->outF;
while(*start!=NULL) {
if ( (*start)->key == key ) {
notifiedFIFO_elt_t *request=*start;
*start=(*start)->next;
delNotifiedFIFO_elt(request);
}
if (*start != NULL)
start=&(*start)->next;
}
mutexunlock(nf->lockF);
}
struct one_thread {
pthread_t threadID;
int id;
int coreID;
char name[256];
uint64_t runningOnKey;
bool abortFlag;
struct thread_pool *pool;
struct one_thread *next;
};
typedef struct thread_pool {
int activated;
bool measurePerf;
int traceFd;
int dummyTraceFd;
uint64_t cpuCyclesMicroSec;
uint64_t startProcessingUE;
int nbThreads;
bool restrictRNTI;
notifiedFIFO_t incomingFifo;
struct one_thread *allthreads;
} tpool_t;
static inline void pushTpool(tpool_t *t, notifiedFIFO_elt_t *msg) {
if (t->measurePerf) msg->creationTime=rdtsc();
pushNotifiedFIFO(&t->incomingFifo, msg);
}
static inline notifiedFIFO_elt_t *pullTpool(notifiedFIFO_t *responseFifo, tpool_t *t) {
notifiedFIFO_elt_t *msg= pullNotifiedFIFO(responseFifo);
if (t->measurePerf)
msg->returnTime=rdtsc();
if (t->traceFd)
if(write(t->traceFd, msg, sizeof(*msg)));
return msg;
}
static inline notifiedFIFO_elt_t *tryPullTpool(notifiedFIFO_t *responseFifo, tpool_t *t) {
notifiedFIFO_elt_t *msg= pollNotifiedFIFO(responseFifo);
if (msg == NULL)
return NULL;
if (t->measurePerf)
msg->returnTime=rdtsc();
if (t->traceFd)
if(write(t->traceFd, msg, sizeof(*msg)));
return msg;
}
static inline void abortTpool(tpool_t *t, uint64_t key) {
notifiedFIFO_t *nf=&t->incomingFifo;
mutexlock(nf->lockF);
notifiedFIFO_elt_t **start=&nf->outF;
while(*start!=NULL) {
if ( (*start)->key == key ) {
notifiedFIFO_elt_t *request=*start;
*start=(*start)->next;
delNotifiedFIFO_elt(request);
}
if (*start != NULL)
start=&(*start)->next;
}
struct one_thread *ptr=t->allthreads;
while(ptr!=NULL) {
if (ptr->runningOnKey==key)
ptr->abortFlag=true;
ptr=ptr->next;
}
mutexunlock(nf->lockF);
}
void initTpool(char *params,tpool_t *pool, bool performanceMeas);
#endif
# Thread pool
The thread pool is a working server, made of a set of worker threads that can be mapped on CPU cores.
Each worker loop on pick from the same input queue jobs to do.
When a job is done, the worker sends a return if a return is defined.
A selective abort allows to cancel parallel jobs (usage: a client pushed jobs, but from a response of one job, the other linked jobs becomes useless).
All the thread pool functions are thread safe, nevertheless the working functions are implemented by the thread pool client, so the client has to tackle the parallel execution of his functions called "processingFunc" hereafter.
## license
Author: Laurent Thomas, Open cells project
The owner share this piece code to Openairsoftware alliance as per OSA license terms
# jobs
A job is a message (notifiedFIFO_elt_t):
next: internal FIFO chain, do not set it
key: a long int that the client can use to identify a message or a group of messages
responseFifo: if the client defines a response FIFO, the message will be posted back after processing
processingFunc: any funtion (type void processingFunc(void *)) that the worker will launch
msgData: the data passed to processingFunc. It can be added automatically, or you can set it to a buffer you are managing
malloced: a boolean that enable internal free in these cases: no return Fifo or Abort feature
The job messages can be created with newNotifiedFIFO_elt() and delNotifiedFIFO_elt() or managed by the client.
# Queues of jobs
Queues are type of: notifiedFIFO_t that must be initialized by init_notifiedFIFO()
No delete function is required, the creator has only to free the data of type notifiedFIFO_t
push_notifiedFIFO() add a job in the queue
pull_notifiedFIFO() is blocking, poll_notifiedFIFO() is non blocking
abort_notifiedFIFO() allows the customer to delete all waiting jobs that match with the key (see key in jobs definition)
# Thread pools
## initialization
The clients can create one or more thread pools with init_tpool()
the params string structure: describes a list of cores, separated by "," that run a worker thread
If the core exists on the CPU, the thread pool initialization sets the affinity between this thread and the related code (use negative values is allowed, so the thread will never be mapped on a specific core).
The threads are all Linux real time scheduler, their name is set automatically is "Tpool_<core id>"
## adding jobs
The client create their jobs messages as a notifiedFIFO_elt_t, then they push it with pushTpool() (that internally calls push_notifiedFIFO())
If they need a return, they have to create response queues with init_notifiedFIFO() and set this FIFO pointer in the notifiedFIFO_elt_t before pushing the job.
## abort
A abort service abortTpool() allows to abort all jobs that match a key (see jobs "key"). When the abort returns, it garanties no job (matching the key) response will be posted on response queues.
Nevertheless, jobs already performed before the return of abortTpool() are pushed in the response Fifo queue.
## Performance measurements
A performance measurement is integrated: the pool will automacillay fill timestamps:
* creationTime: time the request is push to the pool;
* startProcessingTime: time a worker start to run on the job
* endProcessingTime: time the worker finished the job
* returnTime: time the client reads the result
if you set the environement variable: thread-pool-measurements to a valid file name
These measurements will be wrote to this Linux pipe.
A tool to read the linux fifo and display it in ascii is provided: see the local directory Makefile for this tool and to compile the thread pool unitary tests.
This diff is collapsed.
...@@ -195,3 +195,10 @@ The NAS layer is based on **3GPP 24.301** and implements the following functions ...@@ -195,3 +195,10 @@ The NAS layer is based on **3GPP 24.301** and implements the following functions
- EMM attach/detach, authentication, tracking area update, and more - EMM attach/detach, authentication, tracking area update, and more
- ESM default/dedicated bearer, PDN connectivity, and more - ESM default/dedicated bearer, PDN connectivity, and more
[oai wiki home](https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/home)
[oai softmodem build procedure](BUILD.md)
[running the oai softmodem ](RUNMODEM.md)
# The OpenAirInterface repository
The OpenAirInterface software can be obtained from our gitLab
server. You will need a git client to get the sources. The repository
is currently used for main developments.
## Prerequisite
You need to install the subversion/git using the following commands:
```shell
sudo apt-get update
sudo apt-get install subversion git
```
## Using EURECOM Gitlab
The [openairinterface5g repository](https://gitlab.eurecom.fr/oai/openairinterface5g.git)
holds the source code for (eNB RAN + UE RAN).
For legal issues (licenses), the core network (EPC) source code is now moved away from
the above openairinterface5g git repository. This EPC code is now splitted into two git
projects ([openair-cn](https://gitlab.eurecom.fr/oai/openair-cn.git) with apache license
and [xtables-addons-oai](https://gitlab.eurecom.fr/oai/xtables-addons-oai.git) with GPL license).
Configure git with your name/email address (only important if you are developer and want to checkin code to Git):
```shell
git config --global user.name "Your Name"
git config --global user.email "Your email address"
```
- Add a certificate from gitlab.eurecom.fr to your Ubuntu 14.04 installation:
```shell
echo -n | openssl s_client -showcerts -connect gitlab.eurecom.fr:443 2>/dev/null | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | sudo tee -a /etc/ssl/certs/ca-certificates.crt
```
- Disable certificate check completely if you do not have root access to /etc/ssl directory
```shell
git config --global http.sslverify false
```
### In order to checkout the Git repository (for OAI Users without login to gitlab server)
Checkout RAN repository (eNB RAN + UE RAN):
```shell
git clone https://gitlab.eurecom.fr/oai/openairinterface5g.git
```
Checkout EPC (Core Network) repository:
```shell
git clone https://gitlab.eurecom.fr/oai/openair-cn.git
```
Optionally (openair-cn build script can install it for you):
```shell
git clone https://gitlab.eurecom.fr/oai/xtables-addons-oai.git
```
### In order to checkout the Git repository (for OAI Developers/admins with login to gitlab server)
Please send email to {openair_tech (AT) eurecom (DOT) fr} to be added to the repository
as a developer (only important for users who want to commit code to the repository). If
you do not have account on gitlab.eurecom.fr, please register yourself to gitlab.eurecom.fr.
* Checkout with using ssh keys:
* You will need to put your ssh keys in https://gitlab.eurecom.fr/profile/keys
to access to the git repo. Once that is done, checkout the git repository using:
* `git clone git@gitlab.eurecom.fr:oai/openairinterface5g.git`
* Checkout with user name/password prompt:
* `git clone https://YOUR_USERNAME@gitlab.eurecom.fr/oai/openairinterface5g.git`
* `git clone https://YOUR_USERNAME@gitlab.eurecom.fr/oai/openair-cn.git`
* `git clone https://YOUR_USERNAME@gitlab.eurecom.fr/oai/xtables-addons-oai.git` (optional, openair-cn build script can do it for you)
## Which branch to checkout?
On the RAN side:
* **master**: This branch is targeted for the user community. Since January 2019, it is also subject to a Continuous Integration process. The update frequency is about once every 2-3 months. We are also performing bug fixes on this branch.
* **develop**: This branch contains recent commits that are tested on our CI test bench. The update frequency is about once a week.
Please see the work flow and policies page :
https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/oai-policies-home
you can find the latest stable tag release here :
https://gitlab.eurecom.fr/oai/openairinterface5g/tags
The tag naming conventions are :
- On `master` branch: **v1.`x`.`y`** where
* `x` is the minor release number, incremented every 2-3 months when we are merging `develop` into `master` branch.
* `y` is the maintenance number, starting at 0 when we do a minor release and being incremented when a bug fix is incorporated into `master` branch.
- On `develop` branch **`yyyy`.w`xx`**
* `yyyy` is the calendar year
* `xx` the week number within the year
<table style="border-collapse: collapse; border: none;">
<tr style="border-collapse: collapse; border: none;">
<td style="border-collapse: collapse; border: none;">
<a href="http://www.openairinterface.org/">
<img src="./images/oai_final_logo.png" alt="" border=3 height=50 width=150>
</img>
</a>
</td>
<td style="border-collapse: collapse; border: none; vertical-align: center;">
<b><font size = "5">Open Air LTE Emulation</font></b>
</td>
</tr>
</table>
This page is valid for the develop branch
# Table of Contents: #
* [How to build the eNB and the UE](#build)
* [How to run an eNB built with the noS1 option](#run-noS1-eNB)
* [How to run a UE built with the noS1 option](#run-noS1-UE)
* [Continuous Integration notes](#CInote)
* [How to ping an eNB from a UE and vice versa (with the noS1 option)](#noS1-pinging)
The old oaisim is dead! Long live oaisim! :)
If you are looking for a description of the old oaisim (which is still available in some branches/tags), please see [here](OpenAirLTEEmulation) and [here](how-to-run-oaisim-with-multiple-ue).
oaisim has been scraped and replaced by the same programs that are used for the real-time operation, `lte-softmodem` and `lte-uesoftmodem`. The latter also now includes an optional channel model, just like oaisim did.
# <a name="build">[How to build the eNB and the UE](BUILD.md)</a>
The following paragraph explains how to run the L1 simulator in noS1 mode and using the oai kernel modules.
# <a name="run-noS1-eNB">How to run an eNB with the noS1 option</a>
Modify the configuration file for IF4p5 fronthaul, `/openairinterface5g/ci-scripts/conf_files/rcc.band7.nos1.simulator.conf`, and replace the loopback interface with a physical ethernet interface and the IP addresses to work on your network. Copy your modifications to a new file, let's call YYY.conf the resulting configuration file.
Run lte-softmodem as usual with this configuration.
```bash
$ source oaienv
$ cd cmake_targets/tools
$ sudo -E ./init_nas_nos1 eNB
$ cd ../lte_build_oai/build
$ sudo -E ./lte-softmodem -O YYY.conf --noS1 --nokrnmod 0
```
# <a name="run-noS1-UE">How to run a UE with the noS1 option</a>
Similarly modify the example configuration file in `/openairinterface5g/ci-scripts/conf_files/rru.band7.nos1.simulator.conf` and replace loopback interface and IP addresses. Copy your modifications to a new file, let's call XXX.conf the resulting configuration file.
Run it like:
```bash
$ source oaienv
$ cd cmake_targets/tools
$ sudo -E ./init_nas_nos1 UE
$ cd ../lte_build_oai/build
$ sudo ./lte-uesoftmodem -O XXX.conf -r 25 --siml1 --noS1 --nokrnmod 0
```
That should give you equivalent functionality to what you had with oaisim including noise and RF channel emulation (path loss / fading, etc.). You should also be able to run multiple UEs.
# <a name="CInote">Continuous Integration notes</a>
The CI currently tests the noS1 build option with one eNB and one UE in the following scenarios:
* pinging one UE from one eNB
* pinging one eNB from one UE
* iperf download between one eNB and one UE
* iperf upload between one eNB and one UE
* all the above tests are done in FDD 5Mhz mode.
# <a name="noS1-pinging">How to ping an eNB from a UE and vice versa (with the noS1 option)</a>
Once your eNB and UE (built with the noS1 option) are running and synchronised, you can ping the eNB from the UE with the following command:
```bash
ping -I oai0 -c 20 $eNB_ip_addr
```
where $eNB_ip_addr is the IP address of your eNB.
Similarly, you can ping the UE from the eNB.
The IP adresses of the eNB and the UE are set up by the init_nas_nos1 program and should have the following values:
* eNB_ip_addr set to 20 10.0.1.1
* ue_ip_addr set to 20 10.0.1.2
[oai wiki home](https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/home)
[oai softmodem features](FEATURE_SET.md)
[oai softmodem build procedure](BUILD.md)
<table style="border-collapse: collapse; border: none;">
<tr style="border-collapse: collapse; border: none;">
<td style="border-collapse: collapse; border: none;">
<a href="http://www.openairinterface.org/">
<img src="./images/oai_final_logo.png" alt="" border=3 height=50 width=150>
</img>
</a>
</td>
<td style="border-collapse: collapse; border: none; vertical-align: center;">
<b><font size = "5">L2 nFAPI Simulator Usage</font></b>
</td>
</tr>
</table>
This simulator allows to test L2 and above Layers using the nFAPI interface.
**This simulator is available starting the `v1.0.0` release on the `master` branch.**
Currently the only validated deployment by CI and developers is *with S1 interface and eNB / UEs are on the same machine*.
Others deployments will be supported later after bug fixes and validation in the CI process.
1. [With S1 -- eNB and UE on same machine](L2NFAPI_S1.md)
[oai wiki home](https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/home)
[oai softmodem features](FEATURE_SET.md)
[oai softmodem build procedure](BUILD.md)
<table style="border-collapse: collapse; border: none;">
<tr style="border-collapse: collapse; border: none;">
<td style="border-collapse: collapse; border: none;">
<a href="http://www.openairinterface.org/">
<img src="./images/oai_final_logo.png" alt="" border=3 height=50 width=150>
</img>
</a>
</td>
<td style="border-collapse: collapse; border: none; vertical-align: center;">
<b><font size = "5">L2 nFAPI Simulator (with S1 / same machine deployment)</font></b>
</td>
</tr>
</table>
## Table of Contents ##
1. [Environment](#1-environment)
2. [Prepare the EPC](#2-prepare-the-epc)
3. [Retrieve the OAI eNB-UE source code](#3-retrieve-the-oai-enb-ue-source-code)
4. [Setup of the USIM information in UE folder](#4-setup-of-the-usim-information-in-ue-folder)
5. [Setup of the Configuration files](#5-setup-of-the-configuration-files)
1. [The eNB Configuration file](#51-the-enb-configuration-file)
2. [The UE Configuration file](#52-the-ue-configuration-file)
6. [Bring Up a second loopback interface](#6-bring-up-a-second-loopback-interface)
7. [Build the eNB](#7-build-the-enb)
8. [Build the UE](#8-build-the-ue)
9. [Initialize the NAS UE Layer](#9-initialize-the-nas-ue-layer)
10. [Start the eNB](#10-start-the-enb)
11. [Start the UE](#11-start-the-ue)
12. [Test with ping](#12-test-with-ping)
13. [Limitations](#13-limitations)
# 1. Environment #
2 servers are used in this deployment. You can use Virtual Machines instead of each server; like it is done in the CI process.
* Machine A contains the EPC.
* Machine B contains the OAI eNB and the OAI UE(s)
Example of L2 nFAPI Simulator testing environment:
<img src="../l2-nfapi-simulator/L2-sim-single-server-deployment.png" alt="" border=3>
Note that the IP addresses are indicative and need to be adapted to your environment.
# 2. Prepare the EPC #
Create the environment for the EPC and register all **USIM** information into the **HSS** database.
If you are using OAI-EPC ([see on GitHub](https://github.com/OPENAIRINTERFACE/openair-cn)), build **HSS/MME/SPGW** and create config files.
# 3. Retrieve the OAI eNB-UE source code #
The eNB and the UE executables will compiled into 2 separate folders on the same machine `B`.
```bash
$ ssh sudousername@machineB
$ git clone https://gitlab.eurecom.fr/oai/openairinterface5g/ enb_folder
$ cd enb_folder
$ git checkout -f v1.0.0
$ cd ..
$ cp -Rf enb_folder ue_folder
```
# 4. Setup of the USIM information in UE folder #
```bash
$ ssh sudousername@machineB
$ cd ue_folder
# Edit openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf with your preferred editor
```
Edit the USIM information within this file in order to match the HSS database. They **HAVE TO** match:
* PLMN+MSIN and IMSI of users table of HSS database **SHALL** be the same.
* OPC of this file and OPC of users table of HSS database **SHALL** be the same.
* USIM_API_K of this file and the key of users table of HSS database **SHALL** be the same.
When testing multiple UEs, it is necessary to add other UEs information like described below for 2 Users. Only UE0 (first UE) information is written in the original file.
```
UE0:
{
USER: {
IMEI="356113022094149";
MANUFACTURER="EURECOM";
MODEL="LTE Android PC";
PIN="0000";
};
SIM: {
MSIN="0000000001"; // <-- Modify here
USIM_API_K="8baf473f2f8fd09487cccbd7097c6862";
OPC="e734f8734007d6c5ce7a0508809e7e9c";
MSISDN="33611123456";
};
...
};
// Copy the UE0 and edit
UE1: // <- Edit here
{
USER: {
IMEI="356113022094149";
MANUFACTURER="EURECOM";
MODEL="LTE Android PC";
PIN="0000";
};
SIM: {
MSIN="0000000002"; // <-- Modify here
USIM_API_K="8baf473f2f8fd09487cccbd7097c6862";
OPC="e734f8734007d6c5ce7a0508809e7e9c";
MSISDN="33611123456";
};
...
};
```
You can repeat the operation for as many users you want to test with.
# 5. Setup of the Configuration files #
**CAUTION: both proposed configuration files resides in the ci-scripts realm. You can copy them but you CANNOT push any modification on these 2 files as part of an MR without informing the CI team.**
## 5.1. The eNB Configuration file ##
```bash
$ ssh sudousername@machineB
$ cd enb_folder
# Edit ci-scripts/conf_files/rcc.band7.tm1.nfapi.conf with your preferred editor
```
First verify the nFAPI interface setup on the 2nd loopback interface.
```
MACRLCs = (
{
num_cc = 1;
local_s_if_name = "lo:"; // <-- HERE
remote_s_address = "127.0.0.1"; // <-- HERE
local_s_address = "127.0.0.2"; // <-- HERE
local_s_portc = 50001;
remote_s_portc = 50000;
local_s_portd = 50011;
remote_s_portd = 50010;
tr_s_preference = "nfapi";
tr_n_preference = "local_RRC";
}
);
```
If you are testing more than 16 UEs, a proper setting on the RUs is necessary. **Note that this part is NOT present in the original configuration file**.
```
RUs = (
{
local_rf = "yes"
nb_tx = 1
nb_rx = 1
att_tx = 20
att_rx = 0;
bands = [38];
max_pdschReferenceSignalPower = -23;
max_rxgain = 116;
eNB_instances = [0];
}
);
```
Last, the S1 interface shall be properly set.
```
////////// MME parameters:
mme_ip_address = ( { ipv4 = "CI_MME_IP_ADDR"; // replace with 192.168.10.20
ipv6 = "192:168:30::17";
active = "yes";
preference = "ipv4";
}
);
NETWORK_INTERFACES :
{
ENB_INTERFACE_NAME_FOR_S1_MME = "ens3"; // replace with the proper interface name
ENB_IPV4_ADDRESS_FOR_S1_MME = "CI_ENB_IP_ADDR"; // replace with 192.168.10.10
ENB_INTERFACE_NAME_FOR_S1U = "ens3"; // replace with the proper interface name
ENB_IPV4_ADDRESS_FOR_S1U = "CI_ENB_IP_ADDR"; // replace with 192.168.10.10
ENB_PORT_FOR_S1U = 2152; # Spec 2152
ENB_IPV4_ADDRESS_FOR_X2C = "CI_ENB_IP_ADDR"; // replace with 192.168.10.10
ENB_PORT_FOR_X2C = 36422; # Spec 36422
};
```
## 5.2. The UE Configuration file ##
```bash
$ ssh sudousername@machineB
$ cd ue_folder
# Edit ci-scripts/conf_files/ue.nfapi.conf with your preferred editor
```
Verify the nFAPI interface setup on the loopback interface.
```
L1s = (
{
num_cc = 1;
tr_n_preference = "nfapi";
local_n_if_name = "lo"; // <- HERE
remote_n_address = "127.0.0.2"; // <- HERE
local_n_address = "127.0.0.1"; // <- HERE
local_n_portc = 50000;
remote_n_portc = 50001;
local_n_portd = 50010;
remote_n_portd = 50011;
}
);
```
# 6. Bring Up a second loopback interface #
A second loopback interface is used to connect the eNB and the UEs.
```bash
$ ssh sudousername@machineB
$ sudo ifconfig lo: 127.0.0.2 netmask 255.0.0.0 up
```
# 7. [Build OAI UE and eNodeB](BUILD.md) #
# 8. Initialize the NAS UE Layer #
Start the EPC on machine `A`.
```bash
$ ssh sudousername@machineA
# Start the EPC
```
# 9. Start the eNB #
In the first terminal (the one you used to build the eNB):
```bash
$ ssh sudousername@machineB
$ cd enb_folder/cmake_targets
$ sudo -E ./lte_build_oai/build/lte-softmodem -O ../ci-scripts/conf_files/rcc.band7.tm1.nfapi.conf > enb.log 2>&1
```
If you don't use redirection, you can test but many logs are printed on the console and this may affect performance of the L2-nFAPI simulator.
We do recommend the redirection in steady mode once your setup is correct.
# 10. Start the UE #
In the second terminal (the one you used to build the UE):
```bash
$ ssh sudousername@machineB
$ cd ue_folder/cmake_targets
# Test 64 UEs, 64 threads in FDD mode
$ sudo -E ./lte_build_oai/build/lte-uesoftmodem -O ../ci-scripts/conf_files/ue.nfapi.conf --L2-emul 3 --num-ues 64 --nums-ue-thread 64 > ue.log 2>&1
# Test 64 UEs, 64 threads in TDD mode
$ sudo -E ./lte_build_oai/build/lte-uesoftmodem -O ../ci-scripts/conf_files/ue.nfapi.conf --L2-emul 3 --num-ues 64 --nums-ue-thread 64 -T 1 > ue.log 2>&1
# The "-T 1" option means TDD config
```
- The number of UEs can set by using `--num-ues` option and the maximum UE number is 255 (with the `--mu*` options, otherwise 16).
- The umber of threads can set with the `--nums-ue-thread`. This number **SHALL NOT** be greater than the number of UEs.
- How many UE that can be tested depends on hardware (server , PC, etc) performance in your environment.
# 11. Test with ping #
In a third terminal, after around 10 seconds, the UE(s) shall be connected to the eNB:
```bash
$ ssh sudousername@machineA
# Ping UE0 IP address based on the EPC pool used: in this example:
$ ping -c 20 192.168.200.2
# Ping UE1 IP address based on the EPC pool used: in this example:
$ ping -c 20 192.168.200.4
```
# 12. Limitations #
Testing on the CI process is currently limited at time of writing. Improvements will be made soon.
[oai wiki home](https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/home)
[oai softmodem features](FEATURE_SET.md)
[oai softmodem build procedure](BUILD.md)
[L2 nfapi simulator](L2NFAPI.md)
# Running OAI softmodem
After you have [built the softmodem executables](BUILD.md) you can set your default directory to the build directory `cmake_targets/lte_build_oai/build/` and start testing some use cases. Below, the description of the different oai functionalities should help you choose the oai configuration that suits your need.
## rf simulator
The rf simulator is a oai device replacing the radio heads (for example the USRP device). It allows connecting the oai UE and the oai eNodeB through a network interface carrying the time-domain samples, getting rid of over the air unpredictable perturbations. This is the ideal tool to check signal processing algorithms and protocols implementation.
It is planned to enhance this simulator with the following functionalities:
- Support for multiple UE connections,each UE being a `lte-uesoftmodem` instance.
- Support for multiple eNodeB for hand-over tests
- Support for channel modeling
This is an easy use-case to setup and test, as no specific hardware is required. The [rfsimulator page](../targets/ARCH/rfsimulator/README.md ) contains the detailed documentation.
## l2 nfapi simulator
This simulator connects a eNodeB and UEs through a nfapi interface, short-cutting the L1 layer. The objective of this simulator is to allow multi UEs simulation, with a large number of UEs (ideally up to 255 ) .Here to ease the platform setup, UEs are simulated via a single `lte-uesoftmodem` instance. Today the CI tests just with one UE and architecture has to be reviewed to allow a number of UE above about 16. This work is on-going.
As for the rf simulator, no specific hardware is required. The [L2 nfapi simlator page](L2NFAPI.md) contains the detailed documentation.
## l1 simulator
The l1 simulator is using the ethernet fronthaul protocol, as used to connect a RRU and a RAU to connect UEs and a eNodeB. UEs are simulated in a single `lte-uesoftmodem` process, as for the nfapi simulator.
The [L1 simulator page](L1SIM.md) contains the detailed documentation.
## noS1 mode
The noS1 mode is now available via the `--noS1`command line option. It can be used with simulators, described above, or when using oai with true RF boards. Only the oai UE can be connected to the oai eNodeB in noS1 mode.
By default the noS1 mode is using linux tun interfaces to send or receive ip packets to/from the linux ip stack. using the `--nokrnmod 0`option you can enforce kernel modules instead of tun.
noS1 code has been revisited, it has been tested with the rf simulator, and tun interfaces. More tests are on going and CI will soon include noS1 tests.
## Running with a true radio head
oai supports [number of deployment](FEATURE_SET.md) model, the following are tested in the CI:
1. [Monolithic eNodeB](https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/HowToConnectCOTSUEwithOAIeNBNew) where the whole signal processing is performed in a single process
2. if4p5 mode, where frequency domain samples are carried over ethernet, from the RRU which implement part of L1(FFT,IFFT,part of PRACH), to a RAU
[oai wiki home](https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/home)
[oai softmodem features](FEATURE_SET.md)
[oai softmodem build procedure](BUILD.md)
...@@ -83,4 +83,4 @@ void free_lte_top(void) { ...@@ -83,4 +83,4 @@ void free_lte_top(void) {
/* /*
@}*/ * @}*/
...@@ -965,3 +965,4 @@ void install_schedule_handlers(IF_Module_t *if_inst) ...@@ -965,3 +965,4 @@ void install_schedule_handlers(IF_Module_t *if_inst)
if_inst->PHY_config_req = phy_config_request; if_inst->PHY_config_req = phy_config_request;
if_inst->schedule_response = schedule_response; if_inst->schedule_response = schedule_response;
} }
...@@ -567,6 +567,31 @@ int lte_sync_time_eNB(int32_t **rxdata, ///rx data in time domain ...@@ -567,6 +567,31 @@ int lte_sync_time_eNB(int32_t **rxdata, ///rx data in time domain
} }
#ifdef PHY_ABSTRACTION
#include "SIMULATION/TOOLS/defs.h"
#include "SIMULATION/RF/defs.h"
//extern channel_desc_t *UE2eNB[NUMBER_OF_UE_MAX][NUMBER_OF_eNB_MAX];
int lte_sync_time_eNB_emul(PHY_VARS_eNB *phy_vars_eNB,
uint8_t sect_id,
int32_t *sync_val)
{
uint8_t UE_id;
uint8_t CC_id = phy_vars_eNB->CC_id;
LOG_E(PHY,"[PHY] EMUL lte_sync_time_eNB_emul eNB %d, sect_id %d\n",phy_vars_eNB->Mod_id,sect_id);
*sync_val = 0;
for (UE_id=0; UE_id<NB_UE_INST; UE_id++) {
//LOG_E(PHY,"[PHY] EMUL : eNB %d checking UE %d (PRACH %d) PL %d dB\n",phy_vars_eNB->Mod_id,UE_id,PHY_vars_UE_g[UE_id]->generate_prach,UE2eNB[UE_id][phy_vars_eNB->Mod_id]->path_loss_dB);
if ((PHY_vars_UE_g[UE_id][CC_id]->generate_prach == 1) && (phy_vars_eNB->Mod_id == (UE_id % NB_eNB_INST))) {
*sync_val = 1;
return(0);
}
}
return(-1);
}
#endif
...@@ -2288,6 +2288,3 @@ void fill_mpdcch_dci0 (PHY_VARS_eNB * eNB, L1_rxtx_proc_t * proc, mDCI_ALLOC_t * ...@@ -2288,6 +2288,3 @@ void fill_mpdcch_dci0 (PHY_VARS_eNB * eNB, L1_rxtx_proc_t * proc, mDCI_ALLOC_t *
} }
} }
#endif #endif
...@@ -46,6 +46,7 @@ ...@@ -46,6 +46,7 @@
//#define DEBUG_DCI //#define DEBUG_DCI
#include "../LTE_TRANSPORT/dci_tools_common_extern.h" #include "../LTE_TRANSPORT/dci_tools_common_extern.h"
#include "../LTE_TRANSPORT/transport_proto.h" #include "../LTE_TRANSPORT/transport_proto.h"
#include "transport_proto_ue.h" #include "transport_proto_ue.h"
......
...@@ -48,7 +48,7 @@ int init_ue_paging_info(PHY_VARS_UE *ue, long defaultPagingCycle, long nB) { ...@@ -48,7 +48,7 @@ int init_ue_paging_info(PHY_VARS_UE *ue, long defaultPagingCycle, long nB) {
else if (Ns==4) else if (Ns==4)
ue->PO = (fp->frame_type==FDD) ? (4*(i_s&1)+(5*(i_s>>1))) : ((i_s&1)+(5*(i_s>>1))); ue->PO = (fp->frame_type==FDD) ? (4*(i_s&1)+(5*(i_s>>1))) : ((i_s&1)+(5*(i_s>>1)));
else else
AssertFatal(1==0,"init_ue_paging_info: Ns is %d\n",Ns); AssertFatal(1==0,"init_ue_paging_info: Ns is %u\n",Ns);
return(0); return(0);
} }
...@@ -312,6 +312,10 @@ typedef struct RU_t_s{ ...@@ -312,6 +312,10 @@ typedef struct RU_t_s{
LTE_DL_FRAME_PARMS frame_parms; LTE_DL_FRAME_PARMS frame_parms;
///timing offset used in TDD ///timing offset used in TDD
int N_TA_offset; int N_TA_offset;
/// SF extension used in TDD (unit: number of samples at 30.72MHz) (this is an expert option)
int sf_extension;
/// "end of burst delay" used in TDD (unit: number of samples at 30.72MHz) (this is an expert option)
int end_of_burst_delay;
/// RF device descriptor /// RF device descriptor
openair0_device rfdevice; openair0_device rfdevice;
/// HW configuration /// HW configuration
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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