Commit f1c7cdd4 authored by Robert Schmidt's avatar Robert Schmidt

Merge remote-tracking branch 'origin/NR_F1C_F1U_extensions' into integration_2021_wk51_d

parents 264e8299 792b6b4e
......@@ -93,6 +93,7 @@ class Containerize():
self.allImagesSize = {}
self.collectInfo = {}
self.tsharkStarted = False
self.pingContName = ''
self.pingOptions = ''
self.pingLossThreshold = ''
......@@ -670,6 +671,10 @@ class Containerize():
time.sleep(10)
if count == 100 and healthy == self.nb_healthy[0]:
if self.tsharkStarted == False:
logging.debug('Starting tshark on public network')
self.CaptureOnDockerNetworks()
self.tsharkStarted = True
HTML.CreateHtmlTestRow('n/a', 'OK', CONST.ALL_PROCESSES_OK)
logging.info('\u001B[1m Deploying OAI Object(s) PASS\u001B[0m')
else:
......@@ -677,8 +682,24 @@ class Containerize():
HTML.CreateHtmlTestRow('Could not deploy in time', 'KO', CONST.ALL_PROCESSES_OK)
logging.error('\u001B[1m Deploying OAI Object(s) FAILED\u001B[0m')
def CaptureOnDockerNetworks(self):
cmd = 'cd ' + self.yamlPath[0] + ' && docker-compose -f docker-compose-ci.yml config | grep com.docker.network.bridge.name | sed -e "s@^.*name: @@"'
networkNames = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=10)
cmd = 'sudo nohup tshark -f "not tcp and not arp and not port 53 and not host archive.ubuntu.com and not host security.ubuntu.com"'
for name in networkNames.split('\n'):
res = re.search('rfsim', name)
if res is not None:
cmd += ' -i ' + name
cmd += ' -w /tmp/capture_'
ymlPath = self.yamlPath[0].split('/')
cmd += ymlPath[1] + '.pcap > /tmp/tshark.log 2>&1 &'
logging.debug(cmd)
networkNames = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=10)
def UndeployGenObject(self, HTML):
self.exitStatus = 0
ymlPath = self.yamlPath[0].split('/')
logPath = '../cmake_targets/log/' + ymlPath[1]
if (self.ranAllowMerge):
cmd = 'cd ' + self.yamlPath[0] + ' && sed -e "s@develop@ci-temp@" docker-compose.y*ml > docker-compose-ci.yml'
......@@ -706,9 +727,21 @@ class Containerize():
logging.debug(cmd)
deployStatus = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=30)
if anyLogs:
cmd = 'mkdir -p ../cmake_targets/log && mv ' + self.yamlPath[0] + '/*.log ../cmake_targets/log'
cmd = 'mkdir -p '+ logPath + ' && mv ' + self.yamlPath[0] + '/*.log ' + logPath
logging.debug(cmd)
deployStatus = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=10)
if self.tsharkStarted:
self.tsharkStarted = True
ymlPath = self.yamlPath[0].split('/')
cmd = 'sudo chmod 666 /tmp/capture_' + ymlPath[1] + '.pcap'
logging.debug(cmd)
copyStatus = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=10)
cmd = 'cp /tmp/capture_' + ymlPath[1] + '.pcap ' + logPath
logging.debug(cmd)
copyStatus = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=10)
cmd = 'sudo rm /tmp/capture_' + ymlPath[1] + '.pcap'
logging.debug(cmd)
copyStatus = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=10)
cmd = 'cd ' + self.yamlPath[0] + ' && docker-compose -f docker-compose-ci.yml down'
logging.debug(cmd)
......@@ -726,10 +759,13 @@ class Containerize():
def PingFromContainer(self, HTML):
self.exitStatus = 0
cmd = 'mkdir -p ../cmake_targets/log'
ymlPath = self.yamlPath[0].split('/')
logPath = '../cmake_targets/log/' + ymlPath[1]
cmd = 'mkdir -p ' + logPath
deployStatus = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=10)
cmd = 'docker exec ' + self.pingContName + ' /bin/bash -c "ping ' + self.pingOptions + '" 2>&1 | tee ../cmake_targets/log/ping_' + HTML.testCase_id + '.log || true'
cmd = 'docker exec ' + self.pingContName + ' /bin/bash -c "ping ' + self.pingOptions + '" 2>&1 | tee ' + logPath + '/ping_' + HTML.testCase_id + '.log || true'
logging.debug(cmd)
deployStatus = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=100)
......@@ -784,14 +820,23 @@ class Containerize():
if status:
HTML.CreateHtmlTestRowQueue(self.pingOptions, 'OK', 1, html_queue)
else:
self.exitStatus = 1
logging.error('\u001B[1;37;41m ' + message + ' \u001B[0m')
logging.error('\u001B[1;37;41m ping test FAIL -- ' + message + ' \u001B[0m')
HTML.CreateHtmlTestRowQueue(self.pingOptions, 'KO', 1, html_queue)
# Automatic undeployment
logging.debug('----------------------------------------')
logging.debug('\u001B[1m Starting Automatic undeployment \u001B[0m')
logging.debug('----------------------------------------')
HTML.testCase_id = 'AUTO-UNDEPLOY'
HTML.desc = 'Automatic Un-Deployment'
self.UndeployGenObject(HTML)
self.exitStatus = 1
def IperfFromContainer(self, HTML):
self.exitStatus = 0
cmd = 'mkdir -p ../cmake_targets/log'
ymlPath = self.yamlPath[0].split('/')
logPath = '../cmake_targets/log/' + ymlPath[1]
cmd = 'mkdir -p ' + logPath
logStatus = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=10)
# Start the server process
......@@ -801,7 +846,8 @@ class Containerize():
time.sleep(5)
# Start the client process
cmd = 'docker exec ' + self.cliContName + ' /bin/bash -c "iperf ' + self.cliOptions + '" 2>&1 | tee ../cmake_targets/log/iperf_client_' + HTML.testCase_id + '.log || true'
cmd = 'docker exec ' + self.cliContName + ' /bin/bash -c "iperf ' + self.cliOptions + '" 2>&1 | tee '+ logPath + '/iperf_client_' + HTML.testCase_id + '.log || true'
logging.debug(cmd)
clientStatus = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=100)
......@@ -810,7 +856,7 @@ class Containerize():
logging.debug(cmd)
serverStatus = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=10)
time.sleep(5)
cmd = 'docker cp ' + self.svrContName + ':/tmp/iperf_server.log ../cmake_targets/log/iperf_server_' + HTML.testCase_id + '.log'
cmd = 'docker cp ' + self.svrContName + ':/tmp/iperf_server.log '+ logPath + '/iperf_server_' + HTML.testCase_id + '.log'
logging.debug(cmd)
serverStatus = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=30)
......@@ -906,9 +952,10 @@ class Containerize():
if status:
HTML.CreateHtmlTestRowQueue(self.cliOptions, 'OK', 1, html_queue)
else:
self.exitStatus = 1
logging.error('\u001B[1m Iperf Test FAIL -- ' + message + ' \u001B[0m')
HTML.CreateHtmlTestRowQueue(self.cliOptions, 'KO', 1, html_queue)
def CheckAndAddRoute(self, svrName, ipAddr, userName, password):
logging.debug('Checking IP routing on ' + svrName)
mySSH = SSH.SSHConnection()
......@@ -1019,3 +1066,4 @@ class Containerize():
if result is None:
mySSH.command('echo ' + password + ' | sudo -S iptables -P FORWARD ACCEPT', '\$', 10)
mySSH.close()
Active_gNBs = ( "gNB-Eurecom-CU");
# Asn1_verbosity, choice in: none, info, annoying
Asn1_verbosity = "none";
Num_Threads_PUSCH = 8;
gNBs =
(
{
////////// Identification parameters:
gNB_CU_ID = 0xe00;
# cell_type = "CELL_MACRO_GNB";
gNB_name = "gNB-Eurecom-CU";
// Tracking area code, 0x0000 and 0xfffe are reserved values
tracking_area_code = 1;
plmn_list = ({
mcc = 208;
mnc = 99;
mnc_length = 2;
snssaiList = (
{
sst = 1;
sd = 0x010203; // 0 false, else true
},
{
sst = 1;
sd = 0x112233; // 0 false, else true
}
);
});
nr_cellid = 12345678L
tr_s_preference = "f1";
local_s_if_name = "lo";
local_s_address = "127.0.0.4";
remote_s_address = "127.0.0.3";
local_s_portc = 501;
local_s_portd = 2152;
remote_s_portc = 500;
remote_s_portd = 2152;
# ------- SCTP definitions
SCTP :
{
# Number of streams to use in input/output
SCTP_INSTREAMS = 2;
SCTP_OUTSTREAMS = 2;
};
////////// AMF parameters:
amf_ip_address = ( { ipv4 = "192.168.5.233";
ipv6 = "192:168:30::17";
active = "yes";
preference = "ipv4";
}
);
NETWORK_INTERFACES :
{
GNB_INTERFACE_NAME_FOR_NG_AMF = "eth0";
GNB_IPV4_ADDRESS_FOR_NG_AMF = "CI_GNB_IP_ADDR";
GNB_INTERFACE_NAME_FOR_NGU = "eth0";
GNB_IPV4_ADDRESS_FOR_NGU = "CI_GNB_IP_ADDR";
GNB_PORT_FOR_S1U = 2152; # Spec 2152
};
}
);
log_config :
{
global_log_level ="info";
global_log_verbosity ="medium";
hw_log_level ="info";
hw_log_verbosity ="medium";
phy_log_level ="info";
phy_log_verbosity ="medium";
mac_log_level ="info";
mac_log_verbosity ="high";
rlc_log_level ="debug";
rlc_log_verbosity ="medium";
pdcp_log_level ="info";
pdcp_log_verbosity ="medium";
rrc_log_level ="info";
rrc_log_verbosity ="medium";
f1ap_log_level ="debug";
f1ap_log_verbosity ="medium";
ngap_log_level ="debug";
ngap_log_verbosity ="medium";
};
This diff is collapsed.
......@@ -22,7 +22,7 @@
-->
<testCaseList>
<htmlTabRef>rfsim-4glte</htmlTabRef>
<htmlTabName>Testing 4G LTE RF sim in containers</htmlTabName>
<htmlTabName>Testing 4G LTE RF sim - Monolithic eNB</htmlTabName>
<htmlTabIcon>wrench</htmlTabIcon>
<repeatCount>2</repeatCount>
<TestCaseRequestedList>
......
......@@ -22,7 +22,7 @@
-->
<testCaseList>
<htmlTabRef>rfsim-4glte-down</htmlTabRef>
<htmlTabName>CleanUp 4G RF</htmlTabName>
<htmlTabName>CleanUp 4G RF - Monolithic eNB</htmlTabName>
<htmlTabIcon>trash</htmlTabIcon>
<TestCaseRequestedList>
100011
......
<!--
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>rfsim-5gnr-f1</htmlTabRef>
<htmlTabName>Testing 5G NR RF sim in containers - CU-DU F1 split</htmlTabName>
<htmlTabIcon>wrench</htmlTabIcon>
<TestCaseRequestedList>
100021
000020
000021
000022
000023
000024
020021
020022
030021
100021
</TestCaseRequestedList>
<TestCaseExclusionList></TestCaseExclusionList>
<testCase id="000020">
<class>DeployGenObject</class>
<desc>Deploy MySql Database</desc>
<yaml_path>yaml_files/5g_f1_rfsimulator</yaml_path>
<services>mysql</services>
<nb_healthy>1</nb_healthy>
</testCase>
<testCase id="000021">
<class>DeployGenObject</class>
<desc>Deploy OAI 5G CoreNetwork</desc>
<yaml_path>yaml_files/5g_f1_rfsimulator</yaml_path>
<services>oai-nrf oai-amf oai-smf oai-spgwu oai-ext-dn</services>
<nb_healthy>6</nb_healthy>
</testCase>
<testCase id="000022">
<class>DeployGenObject</class>
<desc>Deploy OAI 5G CU RF sim SA</desc>
<yaml_path>yaml_files/5g_f1_rfsimulator</yaml_path>
<services>oai-cu</services>
<nb_healthy>7</nb_healthy>
</testCase>
<testCase id="000023">
<class>DeployGenObject</class>
<desc>Deploy OAI 5G DU RF sim SA</desc>
<yaml_path>yaml_files/5g_f1_rfsimulator</yaml_path>
<services>oai-du</services>
<nb_healthy>8</nb_healthy>
</testCase>
<testCase id="000024">
<class>DeployGenObject</class>
<desc>Deploy OAI 5G NR-UE RF sim SA</desc>
<yaml_path>yaml_files/5g_f1_rfsimulator</yaml_path>
<services>oai-nr-ue</services>
<nb_healthy>9</nb_healthy>
</testCase>
<testCase id="020021">
<class>PingFromContainer</class>
<desc>Ping ext-dn from NR-UE</desc>
<container_name>rfsim5g-oai-nr-ue</container_name>
<options>-I oaitun_ue1 -c 20 192.168.72.135</options>
<loss_threshold>5</loss_threshold>
</testCase>
<testCase id="020022">
<class>PingFromContainer</class>
<desc>Ping NR-UE from ext-dn</desc>
<container_name>rfsim5g-oai-ext-dn</container_name>
<options>-c 20 12.1.1.2</options>
<loss_threshold>5</loss_threshold>
</testCase>
<testCase id="030021">
<class>IperfFromContainer</class>
<desc>Iperf UDP Downlink</desc>
<server_container_name>rfsim5g-oai-nr-ue</server_container_name>
<client_container_name>rfsim5g-oai-ext-dn</client_container_name>
<server_options>-B 12.1.1.2 -u -i 1 -s</server_options>
<client_options>-c 12.1.1.2 -u -i 1 -t 30 -b 200K</client_options>
</testCase>
<testCase id="030022">
<class>IperfFromContainer</class>
<desc>Iperf UDP Uplink</desc>
<server_container_name>rfsim5g-oai-ext-dn</server_container_name>
<client_container_name>rfsim5g-oai-nr-ue</client_container_name>
<server_options>-u -i 1 -s</server_options>
<client_options>-B 12.1.1.2 -c 192.168.72.135 -u -i 1 -t 30 -b 5K</client_options>
</testCase>
<testCase id="100021">
<class>UndeployGenObject</class>
<desc>Undeploy all OAI 5G stack</desc>
<yaml_path>yaml_files/5g_f1_rfsimulator</yaml_path>
</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>rfsim-5gnr-down-f1</htmlTabRef>
<htmlTabName>CleanUp 5G RF - CU-DU F1 split</htmlTabName>
<htmlTabIcon>trash</htmlTabIcon>
<TestCaseRequestedList>
100022
</TestCaseRequestedList>
<TestCaseExclusionList></TestCaseExclusionList>
<testCase id="100022">
<class>UndeployGenObject</class>
<desc>Undeploy all OAI 5G stack</desc>
<yaml_path>yaml_files/5g_f1_rfsimulator</yaml_path>
</testCase>
</testCaseList>
......@@ -22,11 +22,12 @@
-->
<testCaseList>
<htmlTabRef>rfsim-5gnr</htmlTabRef>
<htmlTabName>Testing 5G NR RF sim in containers</htmlTabName>
<htmlTabName>Testing 5G NR RF sim - Monolithic gNB</htmlTabName>
<htmlTabIcon>wrench</htmlTabIcon>
<repeatCount>4</repeatCount>
<TestCaseRequestedList>
100001
000000
000001
000002
000003
......@@ -38,11 +39,19 @@
</TestCaseRequestedList>
<TestCaseExclusionList></TestCaseExclusionList>
<testCase id="000000">
<class>DeployGenObject</class>
<desc>Deploy MySql Database</desc>
<yaml_path>yaml_files/5g_rfsimulator</yaml_path>
<services>mysql</services>
<nb_healthy>1</nb_healthy>
</testCase>
<testCase id="000001">
<class>DeployGenObject</class>
<desc>Deploy OAI 5G CoreNetwork</desc>
<yaml_path>yaml_files/5g_rfsimulator</yaml_path>
<services>mysql oai-nrf oai-amf oai-smf oai-spgwu oai-ext-dn</services>
<services>oai-nrf oai-amf oai-smf oai-spgwu oai-ext-dn</services>
<nb_healthy>6</nb_healthy>
</testCase>
......
......@@ -22,7 +22,7 @@
-->
<testCaseList>
<htmlTabRef>rfsim-5gnr-down</htmlTabRef>
<htmlTabName>CleanUp 5G RF</htmlTabName>
<htmlTabName>CleanUp 5G RF - Monolithic gNB</htmlTabName>
<htmlTabIcon>trash</htmlTabIcon>
<TestCaseRequestedList>
100002
......
#!/bin/bash
set -eo pipefail
STATUS=0
AMF_PORT_FOR_NGAP=38412
AMF_PORT_FOR_N11_HTTP=80
AMF_IP_NGAP_INTERFACE=$(ifconfig $AMF_INTERFACE_NAME_FOR_NGAP | grep inet | awk {'print $2'})
AMF_IP_N11_INTERFACE=$(ifconfig $AMF_INTERFACE_NAME_FOR_N11 | grep inet | awk {'print $2'})
N2_PORT_STATUS=$(netstat -Snpl | grep -o "$AMF_IP_NGAP_INTERFACE:$AMF_PORT_FOR_NGAP")
N11_PORT_STATUS=$(netstat -tnpl | grep -o "$AMF_IP_N11_INTERFACE:$AMF_PORT_FOR_N11_HTTP")
#Check if entrypoint properly configured the conf file and no parameter is unset (optional)
NB_UNREPLACED_AT=`cat /openair-amf/etc/*.conf | grep -v contact@openairinterface.org | grep -c @ || true`
if [ $NB_UNREPLACED_AT -ne 0 ]; then
STATUS=1
echo "Healthcheck error: configuration file is not configured properly"
fi
if [[ -z $N2_PORT_STATUS ]]; then
STATUS=1
echo "Healthcheck error: N2 SCTP port $AMF_PORT_FOR_NGAP is not listening"
fi
if [[ -z $N11_PORT_STATUS ]]; then
STATUS=1
echo "Healthcheck error: N11/SBI TCP/HTTP port $AMF_PORT_FOR_N11_HTTP is not listening"
fi
#host="${MYSQL_SERVER}"
#user="${MYSQL_USER:-root}"
#export MYSQL_PWD="${MYSQL_PASS}"
#args=(
# -h"$host"
# -u"$user"
# --silent
#)
#if ! command -v mysql &> /dev/null; then
# echo "Installing mysql command"
# apt update
# apt-get -y install mysql-client
#else
# if select="$(echo 'SELECT 1' | mysql "${args[@]}")" && [ "$select" = '1' ]; then
# database_check=$(mysql -h$host -u$user -D oai_db --silent -e "SELECT * FROM users;")
# if [[ -z $database_check ]]; then
# echo "Healthcheck error: oai_db not populated"
# STATUS=1
# fi
# STATUS=0
# else
# echo "Healthcheck error: Mysql port inactive"
# STATUS=1
# fi
#fi
exit $STATUS
This diff is collapsed.
#!/bin/bash
set -eo pipefail
if [ "$MYSQL_ROOT_PASSWORD" ] && [ -z "$MYSQL_USER" ] && [ -z "$MYSQL_PASSWORD" ]; then
echo >&2 'Healthcheck error: cannot determine root password (and MYSQL_USER and MYSQL_PASSWORD were not set)'
exit 0
fi
host="$(hostname --ip-address || echo '127.0.0.1')"
user="${MYSQL_USER:-root}"
export MYSQL_PWD="${MYSQL_PASSWORD:-$MYSQL_ROOT_PASSWORD}"
args=(
# force mysql to not use the local "mysqld.sock" (test "external" connectivity)
-h"$host"
-u"$user"
--silent
)
STATUS=0
if command -v mysqladmin &> /dev/null; then
if mysqladmin "${args[@]}" ping > /dev/null; then
database_check=$(mysql -u$user -D oai_db --silent -e "SELECT * FROM users;")
if [[ -z $database_check ]]; then
echo "Healthcheck error: oai_db not populated"
STATUS=1
fi
STATUS=0
else
echo "Healthcheck error: Mysql port inactive"
STATUS=1
fi
else
if select="$(echo 'SELECT 1' | mysql "${args[@]}")" && [ "$select" = '1' ]; then
database_check=$(mysql -u$user -D oai_db --silent -e "SELECT * FROM users;")
if [[ -z $database_check ]]; then
echo "Healthcheck error: oai_db not populated"
STATUS=1
fi
STATUS=0
else
echo "Healthcheck error: Mysql port inactive"
STATUS=1
fi
fi
exit $STATUS
#!/bin/bash
set -eo pipefail
STATUS=0
NRF_IP_SBI_INTERFACE=$(ifconfig $NRF_INTERFACE_NAME_FOR_SBI | grep inet | awk {'print $2'})
NRF_SBI_PORT_STATUS=$(netstat -tnpl | grep -o "$NRF_IP_SBI_INTERFACE:$NRF_INTERFACE_PORT_FOR_SBI")
#Check if entrypoint properly configured the conf file and no parameter is unset(optional)
NB_UNREPLACED_AT=`cat /openair-nrf/etc/*.conf | grep -v contact@openairinterface.org | grep -c @ || true`
if [ $NB_UNREPLACED_AT -ne 0 ]; then
STATUS=1
echo "Healthcheck error: UNHEALTHY configuration file is not configured properly"
fi
if [[ -z $NRF_SBI_PORT_STATUS ]]; then
STATUS=1
echo "Healthcheck error: UNHEALTHY SBI TCP/HTTP port $NRF_INTERFACE_PORT_FOR_SBI is not listening."
fi
exit $STATUS
\ No newline at end of file
################################################################################
# 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
################################################################################
SMF =
{
FQDN = "oai-smf-svc";
INSTANCE = 0; # 0 is the default
PID_DIRECTORY = "/var/run"; # /var/run is the default
INTERFACES :
{
N4 :
{
# SMF binded interface for N4 communication (UPF)
INTERFACE_NAME = "eth0"; # YOUR NETWORK CONFIG HERE
IPV4_ADDRESS = "read";
};
SBI :
{
# SMF binded interface for SBI interface (e.g., communication with AMF, UDM)
INTERFACE_NAME = "eth0"; # YOUR NETWORK CONFIG HERE
IPV4_ADDRESS = "read";
PORT = 80; # YOUR NETWORK CONFIG HERE (default: 80)
HTTP2_PORT = 9090; # YOUR NETWORK CONFIG HERE
API_VERSION = "v1"; # YOUR SMF API VERSION CONFIG HERE
};
};
# Pool of UE assigned IP addresses
# Do not make IP pools overlap
# first IPv4 address X.Y.Z.1 is reserved for GTP network device on UPF
IP_ADDRESS_POOL :
{
IPV4_LIST = (
{RANGE = "12.1.1.2 - 12.1.1.128";}, # STRING, IPv4 RANGE IP_start - IP_end, YOUR NETWORK CONFIG HERE.
{RANGE = "12.1.1.129 - 12.1.1.224";}, # STRING, IPv4 RANGE IP_start - IP_end, YOUR NETWORK CONFIG HERE.
{RANGE = "10.10.10.2 - 10.10.10.253";} # STRING, IPv4 RANGE IP_start - IP_end, YOUR NETWORK CONFIG HERE.
);
IPV6_LIST = (
{PREFIX = "2001:1:2::/64";}, # STRING, IPv6 prefix, YOUR NETWORK CONFIG HERE.
{PREFIX = "3001:1:2::/64";}, # STRING, IPv6 prefix, YOUR NETWORK CONFIG HERE.
{PREFIX = "4001:1:2::/64";} # STRING, IPv6 prefix, YOUR NETWORK CONFIG HERE.
);
};
DNN_LIST = (
# IPV4_POOL, IPV6_POOL are index in IPV4_LIST, IPV6_LIST, PDU_SESSION_TYPE choice in {IPv4, IPv6, IPv4v6}
{DNN_NI = "default"; PDU_SESSION_TYPE = "IPv4"; IPV4_POOL = 2; IPV6_POOL = -1},
{DNN_NI = "carrier.com"; PDU_SESSION_TYPE = "IPv4"; IPV4_POOL = 1; IPV6_POOL = -1},
{DNN_NI = "oai"; PDU_SESSION_TYPE = "IPv4"; IPV4_POOL = 0; IPV6_POOL = -1}
);
# DNS address communicated to UEs
DEFAULT_DNS_IPV4_ADDRESS = "192.168.18.129"; # YOUR DNS CONFIG HERE
DEFAULT_DNS_SEC_IPV4_ADDRESS = "192.168.18.129"; # YOUR DNS CONFIG HERE
DEFAULT_DNS_IPV6_ADDRESS = "2001:4860:4860::8888"; # YOUR DNS CONFIG HERE
DEFAULT_DNS_SEC_IPV6_ADDRESS = "2001:4860:4860::8844"; # YOUR DNS CONFIG HERE
SUPPORT_FEATURES:
{
# STRING, {"yes", "no"},
REGISTER_NRF = "yes"; # Set to yes if SMF resgisters to an NRF
DISCOVER_UPF = "yes"; # Set to yes to enable UPF discovery and selection
FORCE_PUSH_PROTOCOL_CONFIGURATION_OPTIONS = "no"; # Non standard feature, normally should be set to "no",
# but you may need to set to yes for UE that do not explicitly request a PDN address through NAS signalling
USE_LOCAL_SUBSCRIPTION_INFO = "yes"; # Set to yes if SMF uses local subscription information instead of from an UDM
USE_FQDN_DNS = "yes"; # Set to yes if AMF/UDM/NRF/UPF will relying on a DNS to resolve FQDN
}
AMF :
{
IPV4_ADDRESS = "0.0.0.0"; # YOUR AMF CONFIG HERE
PORT = 80; # YOUR AMF CONFIG HERE (default: 80)
API_VERSION = "v1"; # YOUR AMF API VERSION FOR SBI CONFIG HERE
FQDN = "oai-amf" # YOUR AMF FQDN CONFIG HERE
};
UDM :
{
IPV4_ADDRESS = "127.0.0.1"; # YOUR UDM CONFIG HERE
PORT = 80; # YOUR UDM CONFIG HERE (default: 80)
API_VERSION = "v1"; # YOUR UDM API VERSION FOR SBI CONFIG HERE
FQDN = "localhost" # YOUR UDM FQDN CONFIG HERE
};
NRF :
{
IPV4_ADDRESS = "192.168.71.130"; # YOUR NRF CONFIG HERE
PORT = 80; # YOUR NRF CONFIG HERE (default: 80)
API_VERSION = "v1"; # YOUR NRF API VERSION FOR SBI CONFIG HERE
FQDN = "oai-nrf" # YOUR NRF FQDN CONFIG HERE
};
UPF_LIST = (
{IPV4_ADDRESS = "192.168.71.134" ; FQDN = "oai-spgwu"} # YOUR UPF CONFIG HERE
);
LOCAL_CONFIGURATION :
{
SESSION_MANAGEMENT_SUBSCRIPTION_LIST = (
{ NSSAI_SST = 222, NSSAI_SD = "123", DNN = "default", DEFAULT_SESSION_TYPE = "IPV4", DEFAULT_SSC_MODE = 1,
QOS_PROFILE_5QI = 7, QOS_PROFILE_PRIORITY_LEVEL = 1, QOS_PROFILE_ARP_PRIORITY_LEVEL = 1, QOS_PROFILE_ARP_PREEMPTCAP = "NOT_PREEMPT",
QOS_PROFILE_ARP_PREEMPTVULN = "NOT_PREEMPTABLE", SESSION_AMBR_UL = "20Mbps", SESSION_AMBR_DL = "22Mbps"},
{ NSSAI_SST = 1; NSSAI_SD = "1", DNN = "oai", DEFAULT_SESSION_TYPE = "IPV4", DEFAULT_SSC_MODE = 1,
QOS_PROFILE_5QI = 6, QOS_PROFILE_PRIORITY_LEVEL = 1, QOS_PROFILE_ARP_PRIORITY_LEVEL = 1, QOS_PROFILE_ARP_PREEMPTCAP = "NOT_PREEMPT",
QOS_PROFILE_ARP_PREEMPTVULN = "NOT_PREEMPTABLE", SESSION_AMBR_UL = "20Mbps", SESSION_AMBR_DL = "22Mbps"}
);
};
};
This diff is collapsed.
#!/bin/bash
set -eo pipefail
STATUS=0
SMF_IP_SBI_INTERFACE=$(ifconfig $SMF_INTERFACE_NAME_FOR_SBI | grep inet | awk {'print $2'})
SMF_SBI_PORT_STATUS=$(netstat -tnpl | grep -o "$SMF_IP_SBI_INTERFACE:$SMF_INTERFACE_PORT_FOR_SBI")
#Check if entrypoint properly configured the conf file and no parameter is unset(optional)
#NB_UNREPLACED_AT=`cat /openair-smf/etc/*.conf | grep -v contact@openairinterface.org | grep -c @ || true`
#if [ $NB_UNREPLACED_AT -ne 0 ]; then
# STATUS=-1
# echo "Healthcheck error: UNHEALTHY configuration file is not configured properly"
#fi
#
if [[ -z $SMF_SBI_PORT_STATUS ]]; then
STATUS=-1
echo "Healthcheck error: UNHEALTHY SBI TCP/HTTP port $SMF_INTERFACE_PORT_FOR_SBI is not listening."
fi
exit $STATUS
#!/bin/bash
set -eo pipefail
STATUS=0
SGW_PORT_FOR_S1U_S12_S4_UP=2152
SGW_PORT_FOR_SX=8805
SGW_IP_S1U_INTERFACE=$(ifconfig $SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP | grep inet | awk {'print $2'})
SGW_IP_SX_INTERFACE=$(ifconfig $SGW_INTERFACE_NAME_FOR_SX | grep inet | awk {'print $2'})
S1U_S12_S4_UP_PORT_STATUS=$(netstat -unpl | grep -o "$SGW_IP_S1U_INTERFACE:$SGW_PORT_FOR_S1U_S12_S4_UP")
SX_PORT_STATUS=$(netstat -unpl | grep -o "$SGW_IP_SX_INTERFACE:$SGW_PORT_FOR_SX")
#Check if entrypoint properly configured the conf file and no parameter is unset (optional)
NB_UNREPLACED_AT=`cat /openair-spgwu/etc/*.conf | grep -v contact@openairinterface.org | grep -c @ || true`
if [ $NB_UNREPLACED_AT -ne 0 ]; then
STATUS=1
echo "Healthcheck error: UNHEALTHY configuration file is not configured properly"
fi
if [[ -z $S1U_S12_S4_UP_PORT_STATUS ]]; then
STATUS=1
echo "Healthcheck error: UNHEALTHY S1U port $SGW_PORT_FOR_S1U_S12_S4_UP is not listening."
fi
if [[ -z $SX_PORT_STATUS ]]; then
STATUS=1
echo "Healthcheck error: UNHEALTHY SX port $SGW_PORT_FOR_SX is not listening."
fi
exit $STATUS
\ No newline at end of file
......@@ -88,7 +88,9 @@ $ docker logout
**Just `docker-compose up -d` WILL NOT WORK!**
All the following commands **SHALL** be run from the `ci-scripts/yaml_files/5g_rfsimulator` folder.
All the following commands **SHALL** be run from the `ci-scripts/yaml_files/5g_rfsimulator` folder for a deployment with monolithic gNB.
For a deployment with the gNB split in CU and DU components, the following commands **SHALL** be run from the `ci-scripts/yaml_files/5g_f1_rfsimulator` folder.
## 2.1. Deploy OAI 5G Core Network ##
......@@ -148,6 +150,9 @@ rfsim5g-traffic: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
**CAUTION: To execute this 2nd step, the whole `CN5G` SHALL be in `healthy` state (especially the `mysql` container).**
The gNB can be deployed either in monolithic mode, or in CU/DU split mode.
- For a deployment with a monolithic gNB:
```bash
$ docker-compose up -d oai-gnb
rfsim5g-oai-nrf is up-to-date
......@@ -155,7 +160,16 @@ rfsim5g-oai-spgwu is up-to-date
rfsim5g-oai-ext-dn is up-to-date
Creating rfsim5g-oai-gnb ... done
```
- For a deployment with the gNB split in CU and DU components:
```bash
#Deployment of the CU
$ docker-compose up -d oai-cu
```
```bash
#Deployment of the DU
$ docker-compose up -d oai-du
```
Wait for a bit.
```bash
......
......@@ -396,14 +396,13 @@ set (FIRMWARE_VERSION "No svn information")
add_definitions("-DFIRMWARE_VERSION=\"${FIRMWARE_VERSION}\"")
add_definitions("-DPACKAGE_VERSION=\"Branch: ${GIT_BRANCH} Abrev. Hash: ${GIT_COMMIT_HASH} Date: ${GIT_COMMIT_DATE}\"")
add_definitions("-DPACKAGE_BUGREPORT=\"openair4g-devel@lists.eurecom.fr\"")
#add_definitions("-DEMIT_ASN_DEBUG=1")
# Debug related options
#########################################
add_boolean_option(ASN_DEBUG False "ASN1 coder/decoder Debug")
add_boolean_option(EMIT_ASN_DEBUG False "ASN1 coder/decoder Debug")
add_boolean_option(MSG_PRINT False "print debug messages")
add_boolean_option(ASN_EMIT_DEBUG False "ASN1 coder/decoder Debug")
add_boolean_option(ASN_THREAD_SAFE True "ASN1 coder/decoder Debug")
add_boolean_option(MSG_PRINT True "print debug messages")
add_boolean_option(DISABLE_XER_PRINT False "print XER Format")
add_boolean_option(XER_PRINT False "print XER Format")
add_boolean_option(RRC_MSG_PRINT False "print RRC messages")
......@@ -600,10 +599,13 @@ set(M2AP_ASN_DIR ${M2AP_DIR}/MESSAGES/ASN1/${M2AP_RELEASE})
set(M2AP_C_DIR ${asn1_generated_dir}/M2AP_${M2AP_RELEASE})
# Warning: if you modify ASN.1 source file to generate new C files, cmake should be re-run instead of make
set(m2ap_cmd ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "M2AP_" "-fno-include-deps -DEMIT_ASN_DEBUG=1" "${M2AP_C_DIR}")
compile_asn1("${M2AP_ASN_DIR}/${M2AP_ASN_FILES}" "${m2ap_cmd}" m2_flag)
file(GLOB M2AP_source ${M2AP_C_DIR}/*.c)
add_library(M2AP_LIB
${M2AP_source}
${M2AP_DIR}/m2ap_common.c
......@@ -755,6 +757,7 @@ set(F1AP_ASN_FILES
${F1AP_ASN_DIR}/F1AP-Containers.asn
)
set(F1AP_ASN_GENERATED_C_DIR ${asn1_generated_dir}/F1AP_${ASN1RELDIR})
set(f1_cmd ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "F1AP_" "-findirect-choice -fno-include-deps" "${F1AP_ASN_GENERATED_C_DIR}")
......@@ -773,6 +776,7 @@ include_directories ("${F1AP_DIR}")
file(GLOB F1AP_C_FILES ${F1AP_DIR}/*.c)
add_library(F1AP ${F1AP_C_FILES} )
# Hardware dependant options
###################################
add_list1_option(NB_ANTENNAS_RX "4" "Number of antennas in reception" "1" "2" "4")
......@@ -1011,6 +1015,7 @@ add_boolean_option(TRACE_RLC_UM_TX_STATUS False "TRACE for RLC UM, TO BE CHANGE
##########################
#add_boolean_option(LINK_ENB_PDCP_TO_IP_DRIVER False "For eNB, PDCP communicate with a IP driver")
#add_boolean_option(LINK_ENB_PDCP_TO_GTPV1U True "For eNB, PDCP communicate with GTP-U protocol (eNB<->S-GW)")
add_definitions(-DNEW_GTPU=1)
##########################
# RRC LAYER OPTIONS
......@@ -2788,7 +2793,7 @@ add_dependencies(lte-softmodem rrc_flag s1ap_flag x2_flag oai_iqplayer)
target_link_libraries (lte-softmodem
-Wl,--start-group
RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB F1AP_LIB F1AP M2AP_LIB M2AP_ENB X2AP_LIB X2AP_ENB M3AP_LIB M3AP_ENB NR_GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT MME_APP UDP SCHED_LIB SCHED_RU_LIB
RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB M2AP_LIB M2AP_ENB X2AP_LIB X2AP_ENB M3AP_LIB M3AP_ENB GTPV1U_OCP F1AP_LIB F1AP SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT MME_APP UDP SCHED_LIB SCHED_RU_LIB
PHY_COMMON PHY PHY_RU LFDS L2 L2_LTE NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB MISC_NFAPI_LTE_LIB LFDS7
${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} ${FSPT_MSG_LIB} ${PROTO_AGENT_LIB}
-Wl,--end-group z dl)
......@@ -2831,7 +2836,7 @@ add_dependencies(ocp-enb rrc_flag s1ap_flag x2_flag oai_iqplayer coding params_l
target_link_libraries (ocp-enb
-Wl,--start-group
RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB F1AP_LIB F1AP M2AP_LIB M2AP_ENB X2AP_LIB X2AP_ENB M3AP_LIB M3AP_ENB NR_GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT MME_APP UDP SCHED_LIB SCHED_RU_LIB
RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB F1AP_LIB F1AP M2AP_LIB M2AP_ENB X2AP_LIB X2AP_ENB M3AP_LIB M3AP_ENB GTPV1U_OCP SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT MME_APP UDP SCHED_LIB SCHED_RU_LIB
PHY_COMMON PHY PHY_RU LFDS L2 L2_LTE NFAPI_COMMON_LIB NFAPI_LIB MISC_NFAPI_LTE_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB LFDS7 SIMU_COMMON
${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} ${FSPT_MSG_LIB} ${PROTO_AGENT_LIB}
-Wl,--end-group z dl)
......@@ -2926,9 +2931,8 @@ if (NOT ${NOS1})
endif()
target_link_libraries (lte-uesoftmodem
-Wl,--start-group
RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB X2AP_ENB M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB F1AP F1AP_LIB
NR_GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT MME_APP UDP SCHED_RU_LIB SCHED_UE_LIB PHY_COMMON
RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB X2AP_ENB M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB
SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT MME_APP UDP SCHED_RU_LIB SCHED_UE_LIB PHY_COMMON
PHY_UE PHY_RU LFDS L2_UE L2_LTE LFDS7 SIMU_COMMON SIMU NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB NFAPI_USER_LIB MISC_NFAPI_LTE_LIB
${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${ATLAS_LIBRARIES}
-Wl,--end-group z dl)
......@@ -3302,7 +3306,7 @@ add_executable(test_epc_generate_scenario
${OPENAIR3_DIR}/S1AP/s1ap_eNB_defs.h
)
target_link_libraries (test_epc_generate_scenario
-Wl,--start-group RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB X2AP_ENB M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB F1AP_LIB F1AP NR_GTPV1U LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT MME_APP UDP SCHED_LIB PHY LFDS ITTI ${MSC_LIB} L2 -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${CONFIG_LIB}
-Wl,--start-group RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB X2AP_ENB M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB F1AP_LIB F1AP GTPV1U_OCP LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT MME_APP UDP SCHED_LIB PHY LFDS ITTI ${MSC_LIB} L2 -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${CONFIG_LIB}
)
add_executable(test_epc_play_scenario
......@@ -3321,7 +3325,7 @@ add_executable(test_epc_play_scenario
)
target_include_directories(test_epc_play_scenario PUBLIC /usr/local/share/asn1c)
target_link_libraries (test_epc_play_scenario
-Wl,--start-group RRC_LIB S1AP_LIB X2AP_LIB X2AP_ENB M3AP_LIB M3AP_ENB F1AP_LIB F1AP NR_GTPV1U LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT MME_APP UDP SCHED_LIB PHY_NR_COMMON PHY_COMMON PHY PHY_UE LFDS ITTI ${MSC_LIB} -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${CONFIG_LIB}
-Wl,--start-group RRC_LIB S1AP_LIB X2AP_LIB X2AP_ENB M3AP_LIB M3AP_ENB F1AP_LIB F1AP GTPV1U_OCP LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT MME_APP UDP SCHED_LIB PHY_NR_COMMON PHY_COMMON PHY PHY_UE LFDS ITTI ${MSC_LIB} -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${CONFIG_LIB}
)
......@@ -3367,7 +3371,7 @@ if (${T_TRACER})
NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB NFAPI_VNF_LIB NFAPI_USER_LIB
PHY_COMMON PHY PHY_UE PHY_NR PHY_NR_COMMON PHY_NR_UE PHY_RU PHY_MEX
L2 L2_LTE L2_NR L2_LTE_NR L2_UE NR_L2_UE L2_UE_LTE_NR MAC_NR_COMMON MAC_NR MAC_UE_NR NGAP_GNB
CN_UTILS NR_GTPV1U GTPV1U_OCP SCTP_CLIENT MME_APP UDP LIB_NAS_UE NB_IoT LFDS LFDS7 SIMU_COMMON SIMU SIMU_ETH OPENAIR0_LIB
CN_UTILS GTPV1U_OCP GTPV1U_OCP SCTP_CLIENT MME_APP UDP LIB_NAS_UE NB_IoT LFDS LFDS7 SIMU_COMMON SIMU SIMU_ETH OPENAIR0_LIB
ldpc_orig ldpc_optim ldpc_optim8seg ldpc PROTO_AGENT dfts)
if (TARGET ${i})
add_dependencies(${i} generate_T)
......
......@@ -182,8 +182,8 @@ int config_cmdlineonly_get(paramdef_t *cfgoptions,int numoptions, char *prefix )
}
configmodule_interface_t *load_configmodule(int argc,
char **argv,
uint32_t initflags)
char **argv,
uint32_t initflags)
{
char *cfgparam=NULL;
char *modeparams=NULL;
......
......@@ -122,7 +122,7 @@ int config_libconfig_get(paramdef_t *cfgoptions,int numoptions, char *prefix ) {
switch(cfgoptions[i].type) {
case TYPE_STRING:
if ( config_lookup_string(&(libconfig_privdata.cfg),cfgpath, (const char **)&str)) {
if ( config_lookup_string(&(libconfig_privdata.cfg), cfgpath, (const char**)&str)) {
if ( cfgoptions[i].numelt > 0 && str != NULL && strlen(str) >= cfgoptions[i].numelt ) {
fprintf(stderr,"[LIBCONFIG] %s: %s exceeds maximum length of %i bytes, value truncated\n",
cfgpath,str,cfgoptions[i].numelt);
......
......@@ -476,6 +476,8 @@ int logInit (void)
register_log_component("NR_MAC","log",NR_MAC);
register_log_component("NR_PHY","log",NR_PHY);
register_log_component("NGAP","",NGAP);
register_log_component("ITTI","log",ITTI);
register_log_component("UTIL","log",UTIL);
for (int i=0 ; log_level_names[i].name != NULL ; i++)
g_log->level2string[i] = toupper(log_level_names[i].name[0]); // uppercased first letter of level name
......
......@@ -237,6 +237,8 @@ typedef enum {
ASN,
NFAPI_VNF,
NFAPI_PNF,
ITTI,
UTIL,
MAX_LOG_PREDEF_COMPONENTS,
}
comp_name_t;
......
......@@ -1061,6 +1061,48 @@ ID = LEGACY_NFAPI_PNF_TRACE
DESC = NFAPI_PNF legacy logs - trace level
GROUP = ALL:LEGACY_NFAPI_PNF:LEGACY_GROUP_TRACE:LEGACY
FORMAT = string,log
ID = LEGACY_ITTI_INFO
DESC = ITTI legacy logs - info level
GROUP = ALL:LEGACY_ITTI:LEGACY_GROUP_INFO:LEGACY
FORMAT = string,log
ID = LEGACY_ITTI_ERROR
DESC = ITTI legacy logs - error level
GROUP = ALL:LEGACY_ITTI:LEGACY_GROUP_ERROR:LEGACY
FORMAT = string,log
ID = LEGACY_ITTI_WARNING
DESC = ITTI legacy logs - warning level
GROUP = ALL:LEGACY_ITTI:LEGACY_GROUP_WARNING:LEGACY
FORMAT = string,log
ID = LEGACY_ITTI_DEBUG
DESC = ITTI legacy logs - debug level
GROUP = ALL:LEGACY_ITTI:LEGACY_GROUP_DEBUG:LEGACY
FORMAT = string,log
ID = LEGACY_ITTI_TRACE
DESC = ITTI legacy logs - trace level
GROUP = ALL:LEGACY_ITTI:LEGACY_GROUP_TRACE:LEGACY
FORMAT = string,log
ID = LEGACY_UTIL_INFO
DESC = UTIL legacy logs - info level
GROUP = ALL:LEGACY_UTIL:LEGACY_GROUP_INFO:LEGACY
FORMAT = string,log
ID = LEGACY_UTIL_ERROR
DESC = UTIL legacy logs - error level
GROUP = ALL:LEGACY_UTIL:LEGACY_GROUP_ERROR:LEGACY
FORMAT = string,log
ID = LEGACY_UTIL_WARNING
DESC = UTIL legacy logs - warning level
GROUP = ALL:LEGACY_UTIL:LEGACY_GROUP_WARNING:LEGACY
FORMAT = string,log
ID = LEGACY_UTIL_DEBUG
DESC = UTIL legacy logs - debug level
GROUP = ALL:LEGACY_UTIL:LEGACY_GROUP_DEBUG:LEGACY
FORMAT = string,log
ID = LEGACY_UTIL_TRACE
DESC = UTIL legacy logs - trace level
GROUP = ALL:LEGACY_UTIL:LEGACY_GROUP_TRACE:LEGACY
FORMAT = string,log
# this is a bad hack but I won't fix (function util_print_hex_octets
# in openairinterface5g/openair2/LAYER2/PDCP_v10.1.0/pdcp_util.c
# does funky things with the LOG_x macros but we work on the C pre-processor
......
......@@ -26,17 +26,10 @@
#include <stdlib.h>
#include <inttypes.h>
#include <platform_types.h>
#include "backtrace.h"
#if defined(ENB_MODE)
# define display_backtrace()
#else
# include "backtrace.h"
#endif
void output_log_mem(void);
#define _Assert_Exit_ \
fprintf(stderr, "\nExiting execution\n"); \
display_backtrace(); \
fflush(stdout); \
fflush(stderr); \
abort();
......
......@@ -28,7 +28,7 @@
#include <signal.h>
#include <execinfo.h>
#include "backtrace.h"
#include <common/utils/backtrace.h>
/* Obtain a backtrace and print it to stdout. */
void display_backtrace(void) {
......@@ -49,8 +49,3 @@ void display_backtrace(void) {
free(strings);
}
void backtrace_handle_signal(siginfo_t *info) {
display_backtrace();
//exit(EXIT_FAILURE);
}
......@@ -26,10 +26,7 @@
#ifdef __cplusplus
extern "C" {
#endif
void display_backtrace(void);
void backtrace_handle_signal(siginfo_t *info);
#ifdef __cplusplus
}
#endif
......
......@@ -136,12 +136,12 @@ extern "C" {
LOG_E(TMR,"Queue for %s task contains %ld messages\n", itti_get_task_name(destination_task_id), s );
if ( s > 50 )
LOG_I(TMR,"Queue for %s task size: %ld (last message %s)\n",itti_get_task_name(destination_task_id), s+1,ITTI_MSG_NAME(message));
LOG_I(ITTI,"Queue for %s task size: %ld (last message %s)\n",itti_get_task_name(destination_task_id), s+1,ITTI_MSG_NAME(message));
t->message_queue.insert(t->message_queue.begin(), message);
eventfd_t sem_counter = 1;
AssertFatal ( sizeof(sem_counter) == write(t->sem_fd, &sem_counter, sizeof(sem_counter)), "");
LOG_D(TMR,"sent messages id=%d to %s\n",message_id, t->admin.name);
LOG_D(ITTI,"sent messages id=%d to %s\n",message_id, t->admin.name);
return 0;
}
......@@ -152,7 +152,7 @@ extern "C" {
while ( t->message_queue.size()>0 && t->admin.func != NULL ) {
if (t->message_queue.size()>1)
LOG_W(TMR,"queue in no thread mode is %ld\n", t->message_queue.size());
LOG_W(ITTI,"queue in no thread mode is %ld\n", t->message_queue.size());
pthread_mutex_unlock (&t->queue_cond_lock);
t->admin.func(NULL);
......@@ -208,7 +208,7 @@ extern "C" {
message->ittiMsg.timer_has_expired.arg=it->second.timer_arg;
if (itti_send_msg_to_task_locked(task_id, it->second.instance, message) < 0) {
LOG_W(TMR,"Failed to send msg TIMER_HAS_EXPIRED to task %u\n", task_id);
LOG_W(ITTI,"Failed to send msg TIMER_HAS_EXPIRED to task %u\n", task_id);
free(message);
t->timer_map.erase(it);
return -1;
......@@ -233,7 +233,7 @@ extern "C" {
epoll_timeout = t->next_timer-current_time;
pthread_mutex_unlock(&t->queue_cond_lock);
LOG_D(TMR,"enter blocking wait for %s\n", itti_get_task_name(task_id));
LOG_D(ITTI,"enter blocking wait for %s, timeout: %d ms\n", itti_get_task_name(task_id), epoll_timeout);
t->nb_events = epoll_wait(t->epoll_fd,t->events,t->nb_fd_epoll, epoll_timeout);
if ( t->nb_events < 0 && (errno == EINTR || errno == EAGAIN ) )
......@@ -243,7 +243,7 @@ extern "C" {
AssertFatal (t->nb_events >=0,
"epoll_wait failed for task %s, nb fds %d, timeout %lu: %s!\n",
itti_get_task_name(task_id), t->nb_fd_epoll, t->next_timer != UINT64_MAX ? t->next_timer-current_time : -1, strerror(errno));
LOG_D(TMR,"receive on %d descriptors for %s\n", t->nb_events, itti_get_task_name(task_id));
LOG_D(ITTI,"receive on %d descriptors for %s\n", t->nb_events, itti_get_task_name(task_id));
if (t->nb_events == 0)
/* No data to read -> return */
......@@ -292,11 +292,11 @@ extern "C" {
// in this case, *received_msg is NULL
if (t->message_queue.empty()) {
*received_msg=NULL;
LOG_D(TMR,"task %s received even from other fd (total fds: %d), returning msg NULL\n",t->admin.name, t->nb_fd_epoll);
LOG_D(ITTI,"task %s received even from other fd (total fds: %d), returning msg NULL\n",t->admin.name, t->nb_fd_epoll);
} else {
*received_msg=t->message_queue.back();
t->message_queue.pop_back();
LOG_D(TMR,"task %s received a message\n",t->admin.name);
LOG_D(ITTI,"task %s received a message\n",t->admin.name);
}
pthread_mutex_unlock (&t->queue_cond_lock);
......@@ -308,7 +308,7 @@ extern "C" {
pthread_mutex_lock(&t->queue_cond_lock);
if (!t->message_queue.empty()) {
LOG_D(TMR,"task %s received a message in polling mode\n",t->admin.name);
LOG_D(ITTI,"task %s received a message in polling mode\n",t->admin.name);
*received_msg=t->message_queue.back();
t->message_queue.pop_back();
} else
......@@ -322,7 +322,7 @@ extern "C" {
void *args_p) {
task_list_t *t=tasks[task_id];
threadCreate (&t->thread, start_routine, args_p, (char *)itti_get_task_name(task_id),-1,OAI_PRIORITY_RT);
LOG_I(TMR,"Created Posix thread %s\n", itti_get_task_name(task_id) );
LOG_I(ITTI,"Created Posix thread %s\n", itti_get_task_name(task_id) );
return 0;
}
......@@ -344,7 +344,7 @@ extern "C" {
tasks = new_tasks;
tasks[newQueue]= new task_list_t;
pthread_mutex_unlock (&lock_nb_queues);
LOG_I(TMR,"Starting itti queue: %s as task %d\n", taskInfo->name, newQueue);
LOG_I(ITTI,"Starting itti queue: %s as task %d\n", taskInfo->name, newQueue);
pthread_mutex_init(&tasks[newQueue]->queue_cond_lock, NULL);
memcpy(&tasks[newQueue]->admin, taskInfo, sizeof(task_info_t));
AssertFatal( ( tasks[newQueue]->epoll_fd = epoll_create1(0) ) >=0, "");
......@@ -392,7 +392,7 @@ extern "C" {
clock_gettime(CLOCK_MONOTONIC, &tp);
if (interval_us%1000 != 0)
LOG_W(TMR, "Can't set timer precision below 1ms, rounding it\n");
LOG_W(ITTI, "Can't set timer precision below 1ms, rounding it\n");
timer.duration = interval_sec*1000+interval_us/1000;
timer.timeout= ((uint64_t)tp.tv_sec*1000+tp.tv_nsec/(1000*1000)+timer.duration);
......@@ -421,7 +421,7 @@ extern "C" {
if (ret==1)
return 0;
else {
LOG_W(TMR, "tried to remove a non existing timer\n");
LOG_W(ITTI, "tried to remove a non existing timer\n");
return 1;
}
}
......
# interthread interface (ITTI)
A Middleware called “itti” (interthread interface) provides classical send/receive message queues between threads.
A simpler thread safe message queue is available in the thread-pool, as it is a required lower level feature.
ITTI is providing more feature, to be used as the thread event main loop.
It is also made for strong type definition is source code.
It is able to add in the managed events: external sockets, timers
All queues are created in .h files, as static permanent queues, nevertheless the possibility to add queues during runtime is available.
The queues are called tasks because it is often read in a single thread that have the same name.
# API definition
## itti_send_msg_to_task, itti_receive_msg, itti_poll_msg
Standard messages queues, thread safe
The reader is responsible of freeing the message
## itti_subscribe_event_fd, itti_get_events
Add external sockets to itti based main loop
## timer_setup timer_remove
When a timer expire, it adds a message in a itti queue
## itti_terminate_tasks
Calling this function push a “terminate” message on each itti queue
# Example code of a thread using ITTI
```
Thread_aLayer_main(void * context) {
// initialize the layer data
// and register in itti the external sockets (like S1AP, GTP)
aLayer_init();
while (1) {
MessageDef * msg
itti_receive_msg(TASK_aLayer, &msg);
// itti receive released, so we have incoming data
// Can be a itti message
if ( msg != NULL) {
switch(ITTI_MSG_ID(msg)) {
case …:
processThisMsgType1(msg);
break;
case …:
processThisMsgType2(msg);
break;
}
Itti_free(msg);
}
// or data/event on external entries (sockets)
Struct eppol_events* events;
int nbEvents=itti_get_events(TASK_aLayer, &events);
if ( nbEvents > 0)
processLayerEvents(events, nbEvents);
}
}
```
# Current usage in OpenAir
## UDP, SCTP
Simple threads that interface itti internal messages to Linux
## GTPV1-U, S1AP
Threads to implement S1AP and GTP protocols
## PDCP
4G Pdcp is not following itti design pattern, but it uses itti internally , 5G PDCP uses ad hoc design
## RRC
Implements 3GPP Rrc features
Interfaces the layer 1 and the above itti tasks
## X2, ENP_APP (configuration), L1L2
Are declared itti queues with a dedicated thread, but they are almost empty
\ No newline at end of file
......@@ -95,53 +95,16 @@ static void read_pipe(int p, char *b, int size) {
size -= ret;
}
}
static int baseRunTimeCommand(char* cmd, size_t cmdSize) {
FILE *fp;
size_t retSize = 0;
fp = popen(cmd, "r");
if(fp) {
memset(cmd, 0, cmdSize);
retSize = fread(cmd, 1, cmdSize, fp);
fclose(fp);
} else {
LOG_D(HW,"%s:%d:%s: Cannot open %s\n", __FILE__, __LINE__, __FUNCTION__, cmd);
}
if (retSize == 0) {
return 0;
}
return atoi(cmd);
}
int checkIfFedoraDistribution(void) {
char cmd[200];
memset(cmd, 0, 200);
sprintf(cmd, "cat /etc/os-release | grep ID_LIKE | grep -ic fedora || true");
return baseRunTimeCommand(cmd, 200);
return !system("grep -iq 'ID_LIKE.*fedora' /etc/os-release ");
}
int checkIfGenericKernelOnFedora(void) {
char cmd[200];
memset(cmd, 0, 200);
sprintf(cmd, "uname -a | grep -c rt || true");
return (1 - baseRunTimeCommand(cmd, 200));
return system("uname -a | grep -q rt");
}
int checkIfInsideContainer(void) {
char cmd[200];
int res = 0;
memset(cmd, 0, 200);
sprintf(cmd, "cat /proc/self/cgroup | egrep -c 'libpod|podman|kubepods' || true");
res = baseRunTimeCommand(cmd, 200);
if (res > 0)
return 1;
else
return 0;
return !system("egrep -q 'libpod|podman|kubepods' /proc/self/cgroup");
}
/********************************************************************/
......@@ -257,21 +220,21 @@ void threadCreate(pthread_t* t, void * (*func)(void*), void * param, char* name,
AssertFatal(ret==0,"ret: %d, errno: %d\n",ret, errno);
ret=pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
AssertFatal(ret==0,"ret: %d, errno: %d\n",ret, errno);
ret=pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED);
AssertFatal(ret==0,"ret: %d, errno: %d\n",ret, errno);
if (checkIfFedoraDistribution())
if (checkIfGenericKernelOnFedora())
if (checkIfInsideContainer())
settingPriority = 0;
if (system("grep -iq 'ID_LIKE.*fedora' /etc/os-release && uname -a | grep -c rt")==0)
if (system("cat /proc/self/cgroup | egrep -c 'libpod|podman|kubepods'")==0)
settingPriority = 0;
if (settingPriority) {
ret=pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED);
AssertFatal(ret==0,"ret: %d, errno: %d\n",ret, errno);
ret=pthread_attr_setschedpolicy(&attr, SCHED_OAI);
AssertFatal(ret==0,"ret: %d, errno: %d\n",ret, errno);
if(priority<sched_get_priority_min(SCHED_OAI) || priority>sched_get_priority_max(SCHED_FIFO)) {
LOG_E(TMR,"Prio not possible: %d, min is %d, max: %d, forced in the range\n",
priority,
sched_get_priority_min(SCHED_OAI),
sched_get_priority_max(SCHED_OAI));
if(priority<sched_get_priority_min(SCHED_OAI) || priority>sched_get_priority_max(SCHED_OAI)) {
LOG_E(UTIL,"Prio not possible: %d, min is %d, max: %d, forced in the range\n",
priority,
sched_get_priority_min(SCHED_OAI),
sched_get_priority_max(SCHED_OAI));
if(priority<sched_get_priority_min(SCHED_OAI))
priority=sched_get_priority_min(SCHED_OAI);
if(priority>sched_get_priority_max(SCHED_OAI))
......@@ -283,10 +246,10 @@ void threadCreate(pthread_t* t, void * (*func)(void*), void * param, char* name,
ret=pthread_attr_setschedparam(&attr, &sparam);
AssertFatal(ret==0,"ret: %d, errno: %d\n",ret, errno);
}
ret=pthread_create(t, &attr, func, param);
AssertFatal(ret==0,"ret: %d, errno: %d\n",ret, errno);
pthread_setname_np(*t, name);
if (affinity != -1 ) {
cpu_set_t cpuset;
......
......@@ -142,7 +142,7 @@ static inline notifiedFIFO_elt_t *pullNotifiedFIFO_nothreadSafe(notifiedFIFO_t
notifiedFIFO_elt_t *ret=nf->outF;
if (nf->outF==nf->outF->next)
LOG_E(TMR,"Circular list in thread pool: push several times the same buffer is forbidden\n");
LOG_E(UTIL,"Circular list in thread pool: push several times the same buffer is forbidden\n");
nf->outF=nf->outF->next;
......
<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">F1 split design</font></b>
</td>
</tr>
</table>
# 1. Introduction
We use OpenAirInterface source code, and it's regular deployment scheme.
F1 specification is in 3GPP documents: TS 38.470 header document and all documents listed in chapter 2 References of TS 38.470.
This document explains how the source code works.
Offered features and deployment instructions are described in:
https://gitlab.eurecom.fr/oai/openairinterface5g/-/wikis/f1-interface
# 2. Common multi-threading architecture #
The CU and DU interfaces are based on ITTI threads (see oai/common/utils/ocp_itti/itti.md)
All OAI upper layers use the ITTI framework to run isolated threads dedicated to one feature.
The lower layers adopt case by case specific software architecture.
```mermaid
graph TD
Linux[configuration file] --> APP[gNB_app_task]
Socks[Linux UDP] --> GTP[nr_gtpv1u_gNB_task]
APP --> CU
APP --> DU
A[Linux SCTP] -->|sockets| SCTP(OAI itti thread TASK_SCTP)
SCTP-->|TASK_NGAP| NG[ngap_gNB_task]
NG-->|TASK_SCTP| SCTP
SCTP-->|TASK_DU_F1| DU[F1AP_DU_task]
SCTP-->|TASK_CU_F1| CU[F1AP_CU_task]
CU-->|TASK_RRC_GNB| RRC
RRC -->|non ITTI| PHY[OAI L1+L2]
RRC -->|API calls to create tunnels| GTP
PHY --> |user plane| GTP
CU --> |TASK_GTPV1_U| GTP
DU --> |TASK_GTPV1_U| GTP
```
A "task" is a Linux thread running infinite waiting loop on one ITTI queue
app task manages the initial configuration
sctp task mamanges the SCTP Linux sockets
CU code runs in the task F1AP_CU_task. It stores it's private data context in a static variable. No mutex is used, as the single interface to CU ITTI tast in incoming ITTI messages. CU task is a single ITTI queue, but multiple CU could exist in one Linux process, using the "instance id" (called "module id" also) to create separate contextual information for each CU instance.
DU code runs in the task F1AP_DU_task. The design is similar to CU task
All GTP-U tunnels are managed in a Linux Thread, that have partially ITTI design:
1. tunnel creation/deletion is by C API functions direct calls (a mutex protects it)
2. outgoing packets are pushed in a ITTI queue to the gtp thread
3. incoming packets are sent to the tunnel creator using a C callback (the callback function is given in tunnel creation order). The callback should not block
# 3. CU F1AP messages #
## startup
CU thread starts when the CU starts. It opens listening socket on F1AP_PORT_NUMBER by sending the appropriate message to TASK_SCTP.
It will accept the first incoming connection on this port
## F1 SETUP
DU has connected, and sent this message.
The CU receives, decode it and send relevant information to RRC thread by message F1AP_SETUP_REQ
## F1 SETUP response
RRC sends two messages to CU F1 task: the information to encode the F1 setup response and a second message to encode F1AP_GNB_CU_CONFIGURATION_UPDATE
Upon reception of these two messages the CU task encodes and sends the messages to the DU
## UE entry
When CCH channel decoding finds a new UE identity, it call rrc_gNB_generate_RRCSetup() that will send F1AP_DL_RRC_MESSAGE to the CU task.
The CU encodes and sends to DU DLRRCMessageTransfer
## UE attach/detach
When rrc_gNB_process_RRCReconfigurationComplete() occurs, the RRC sends to CU task the message F1AP_UE_CONTEXT_SETUP_REQ. The CU task encodes the F1 message UEContextSetup and send it to the DU over F1AP.
This function rrc_gNB_process_RRCReconfigurationComplete() also creates the GTP-U user plane bearers.
## F1AP incoming messages
SCTP tasks sends a ITTI message SCTP_DATA_IND to the CU task.
A array of functions pointers and the F1AP standard identifier "procedureCode", the CU calls the appropriate function
Hereafter the most significant messages processing
### CU_handle_F1_SETUP_REQUEST
Transcodes information to the same message toward RRC (F1AP_SETUP_REQ)
### CU_handle_INITIAL_UL_RRC_MESSAGE_TRANSFER
Transcodes information to the same message toward RRC (NR_RRC_MAC_CCCH_DATA_IND)
### CU_handle_UL_RRC_MESSAGE_TRANSFER
Encode and send data to PDCP (calling pdcp_data_ind ()) for processing UL data.
# DU F1 Messages
## Startup
The task "gNB app" after rzading the configuration file, sends a first message F1AP_SETUP_REQ to DU task
Using this message, the uniq DU task (Linux Thread) creates a DU instance context memory space, calls SCTP task to create a socket to the CU.
When it receives from the SCTP task the socket creation success, the DU task encodes+sends the F1 setup message to the CU.
## F1AP_INITIAL_UL_RRC_MESSAGE
When MAC layer push UL data to DU task, the DU sends to CU the message InitialULRRCMessageTransfer
## F1AP_UL_RRC_MESSAGE
In case of SRB bearer, the RLC layer use this message to push rlc bearer payload to DU task, that forward to CU
## pdcp_data_ind
This function call in RLC, when it is a DRB will be replaced by F1-U transport to CU
## F1AP incoming messages
SCTP tasks sends a ITTI message SCTP_DATA_IND to the DU task.
A array of functions pointers and the F1AP standard identifier "procedureCode", the DU calls the appropriate function
Hereafter the most significant messages processing
### DU_send_F1_SETUP_RESPONSE
Decode the CU message, then encode a message to TASK_GNB_APP. The thread "APP" extracts the system information block and reconfigure the DU with: du_extract_and_decode_SI(), configure_gnb_du_mac()
### DU_handle_gNB_CU_CONFIGURATION_UPDATE
No developped
### DU_handle_UE_CONTEXT_SETUP_REQUEST
Push data to RLC layer for transmisstion in DL (to the UE) by calling enqueue_rlc_data_req()
### DU_handle_DL_RRC_MESSAGE_TRANSFER
Depending on the content, adds UE context in DU low layers and/or send data to the UE with rlc_data_req()
# F1-U messages
The data path by itself doesn't make any difficulty:
1. for UL, rlc calls pdcp_data_ind (DRB) or sends a message to RRC (SRB). So, we can replace pdcp_data_ind() by du_pdcp_data_ind() that will push the message in the GTP tunnel. In CU, assuming the tunnel is in place, the right call back decapsulate the transport (cu_ul_recv()), then calls pdcp_data_ind() in CU
The SRB are sent in DU RRC tasks via itti F1AP_UL_RRC_MESSAGE (see above the processing)
2. For DL, pdcp (in CU for DRBs) calls rlc_data_req (by a decoupling queue and thread rlc_data_req_thread, so function du_rlc_data_req() or enqueue_rlc_data_req()). in DU, assuming the gtp-u tunnel exists, a reception call back (du_dl_recv()) decapsulate the gtp-u packet and calls du_rlc_data_req()
Hereafter the processing design, that doesn't require to setup a new context storage, as we can use the GTP-U internal tables: rnti+rb=>teid for outgoing gtp-u packets and teid=>rnti+rb for incoming gtp-u packets
In CU case, the DRB tunnel to DU and the tunnel on N3 have the same key (rnti, rb id), but they run in two different GTP-U instances.
Each instance binds on diffrent sockets.
For F1-U, both DU and CU binds on the full quadruplet (IP source, port source, IP destination, port destination) from the configuration file parameters:
local_s_address, remote_s_address,local_s_portd, remote_s_portd
These 4 values are in:
CU: at cell level (same level as nr_cellid parameter), they are read if tr_s_preference = "f1"; is set
DU: in block MACRLCs, if tr_n_preference = "f1"; is set in this block
## tunnels setup
In GTP-U, TS 29.281 specifies a option header (NR RAN Container This extension header may be transmitted in a G-PDU over the X2-U, Xn-U and F1-U user plane interfaces), but it is not mandatory optional header (as is the N3 one).
So, we can use this header a something reliable with other vendors implementation.
In DL, we need to associate the packet with: rnti, rb (radio bearer) and "mui" (a OAI internal id that is optional and may be removed soon) to call rlc_data_req()
In UL, we need also the RNTI, the rb
So, we need to create a gtp-u tunnel for each rb over F1, then manage in CU and DU the association between a uniq TEid and the pair(rnti, rb). This is already what we have in existing OAI GTP-U layer interface.
In F1AP, for each "DRB to Be Setup Item IEs", we have a field TNL (transport network layer) to set a specific GTP tunnel (@IP, TEid, udp port is always 2152). This is the same for each message related to DRBs. (F1AP carries the SRB payload inside F1AP).
So, For each F1AP containing DRB setup/modification/deletion, the related GTP-U tunnels will be modified one to one.
The exception is the intialisation of new tunnel: in the call to tunnel creation, we need to send the remote TEID, but we don't know yet if we are the initial source. In this case, we issue a dummy (0xFFFF) remote teid; when we receive the remote answer, we get the source teid, that we can inform GTP-U with (using update tunnel).
## processing on GTP-U incoming message
Du_dl_recv() or cu_ul_recv() are called because we have set this callbacks in creat/update tunnel calls to gtp-u. As gtp-u maintains a pair(rnti,rbid) associated to each tunnel, the functions can be very simple stateless callback that calls pdcp_data_ind() or rlc_data_req() to get back in normal processing path
## CU/DU outgoing
DU rlc north output goes to du_pdcp_data_ind() that push a outgoing packet request to gtp-u, using the rnti+rb as ids. GTP-U must have the tunnel existing, then it simply implement the same as in N3 for exemple.
CU pdcp south output calls cu_rlc_data_ind() that do the same symetric processing.
......@@ -304,25 +304,36 @@ gtpv1u_create_s1u_tunnel(), delete tunnel, ... functions are called inside the o
# New GTP
## initialization
Coexistance until full merge with legacy GTP
cmake new option: NEW_GTPU to use the new implementation (it changes for the entire executable)
It is possible to use both old and new GTP in same executable because the itti task and all functions names are different
Current status of new implementation: not tested, X2 not developped, 5G new GTP option not developped, remain issues on data coming from void: muid, enb_flag, ...
ocp_gtpv1uTask(): this creates only the thread, doesn't configure anything
gtpv1Init(): creates a listening socket to Linux for a given reception and select a local IP address
newGtpuCreateTunnel() this function will replace the xxx_create_tunnel_xxx() for various cases
This creates a outgoing context for a teid (in input), it computes and return the incoming teid that will be used for incoming packets
These teids and in a "instance", so in a Linux socket: same teid can co-exist for different sockets
Remain here a lack to fill: the information given in the legacy funtions is not enough to fullfil the data needed by the callback
stuff like enb_flag, but also mui and more important data are not given explicitly by any legacy function (gtpv1u_create_s1u_tunnel), but the legacy and the new interface to lower layer (like pdcp) require this data.
The datamodel is still not fully understood, so this data source remain unknown
A new parameter is the callback function: will be pdpcp_data_req() and gtpv_data_req() (x2 case) for existing implementation and later other call backs like the F1-U implementation.
incoming packets
the gtp layer retrieves the data, the teid, find out the related data: rnti, bearer and quite a lot of other parameters (not clear why, because it looks like all is statefull, so the lower layer should have the context)
if lower layers can be stateless, it is a good idea to keep the context in the gtp layer and pass it to the callback, but the design remain obfuscated.
## newGtpuCreateTunnel()
this function will replace the xxx_create_tunnel_xxx() for various cases
The parameters are:
1. outgoing TEid, associated with outpoing pair(rnti, id)
2. incoming packets callback, incoming pair(rnti,id) and a callback function for incoming data
## outgoing packets
Each call to newGtpuCreateTunnel() creates a outgoing context for a teid (given as function input), a pair(rnti,outgoing id).
Each outgoing packet received on GTP-U ITTI queue must match one pair(rnti,id), so the gtp-u thread can lookup the related TEid and use it to encode the outpoing GTP-U tunneled packet.
## incoming packets
newGtpuCreateTunnel() computes and return the incoming teid that will be used for incoming packets.
When a incoming packet arrives on this incoming teid, the GTP-U thread calls the defined callback, with the associated pair(rnti, incoming id).
stuff like enb_flag, mui and more important data are not given explicitly by any legacy function (gtpv1u_create_s1u_tunnel), but the legacy and the new interface to lower layer (like pdcp) require this data. We hardcode it in first version.
## remaining work
These teids and "instance", so in a Linux socket: same teid can co-exist for different sockets
Remain here a lack to fill: the information given in the legacy funtions is not enough to fullfil the data needed by the callback
Coexistance until full merge with legacy GTP
cmake new option: NEW_GTPU to use the new implementation (it changes for the entire executable)
It is possible to use both old and new GTP in same executable because the itti task and all functions names are different
Current status of new implementation: not tested, X2 not developped, 5G new GTP option not developped, remain issues on data coming from void: muid, enb_flag, ...
# NGAP
NGAP would be a itti thread as is S1AP (+twin thread SCTP that is almost void processing)?
......
......@@ -95,7 +95,7 @@ To get the code and build the gNB executable:
./build_oai --gNB -w USRP
```
A reference configuration file for the gNB is provided [here](https://gitlab.eurecom.fr/oai/openairinterface5g/-/blob/develop/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf).
A reference configuration file for the **monolithic** gNB is provided [here](https://gitlab.eurecom.fr/oai/openairinterface5g/-/blob/develop/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf).
In the following, we highlight the fields of the file that have to be configured according to the configuration and interfaces of the Core Network. First, the PLMN section has to be filled with the proper values that match the configuration of the AMF and the UE USIM.
......@@ -194,6 +194,8 @@ The SA setup with OAI UE has been validated with **RFSIMULATOR**. Both control p
In the following, we provide the instructions on how to build, configure and execute this SA setup.
As another option, if you do not want to build anything and instead deploy the OAI RAN (RFSIMULATOR) and Core Network components directly using docker images and docker-compose, please have a look at [this tutorial](https://gitlab.eurecom.fr/oai/openairinterface5g/-/blob/develop/ci-scripts/yaml_files/5g_rfsimulator/README.md).
### NAS configuration for the OAI UE
The NAS configuration parameters of the OAI UE can be set as input parameters, configuration file or can be hardcoded. More specifically:
- SUCI (*Subscription Concealed Identifier*)
......@@ -245,7 +247,6 @@ The gNB configuration can be performed according to what is described in [sectio
## 2.2 OAI 5G Core Network installation and configuration
The instructions for the installation of OAI CN components (AMF, SMF, NRF, UPF) using `docker-compose` can be found [here](https://gitlab.eurecom.fr/oai/cn5g/oai-cn5g-fed/-/blob/master/README.md).
In addition, if you do not want to build anything, please have a look at [this tutorial](https://gitlab.eurecom.fr/oai/openairinterface5g/-/blob/develop/ci-scripts/yaml_files/5g_rfsimulator/README.md).
## 2.3 Execution of SA scenario
......
......@@ -55,6 +55,8 @@ def main():
"rcc.band40.tm1.25PRB": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}',
"gnb.band78.tm1.fr1.106PRB.usrpb210.conf": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}',
"gnb.band78.sa.fr1.106PRB.usrpn310.conf": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}',
"gNB_SA_CU.conf": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}',
"gNB_SA_DU.conf": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}',
"ue.nfapi": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}',
"ue_sim_ci": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}'
}
......@@ -77,6 +79,10 @@ def main():
templine = re.sub(r'sd = 0x1;', 'sd = 0x@NSSAI_SD0@;', line)
outputfile.write(templine)
continue
if re.search(r'sd = 0x010203;', line):
templine = re.sub(r'sd = 0x010203;', 'sd = 0x@NSSAI_SD0@;', line)
outputfile.write(templine)
continue
if re.search(r'sd = 0x112233;', line):
templine = re.sub(r'sd = 0x112233;', 'sd = 0x@NSSAI_SD1@;', line)
outputfile.write(templine)
......
......@@ -7,8 +7,10 @@ ENABLE_X2=${ENABLE_X2:-yes}
THREAD_PARALLEL_CONFIG=${THREAD_PARALLEL_CONFIG:-PARALLEL_SINGLE_THREAD}
# Based another env var, pick one template to use
if [[ -v USE_NSA_TDD_MONO ]]; then cp $PREFIX/etc/gnb.nsa.tdd.conf $PREFIX/etc/gnb.conf; fi
if [[ -v USE_SA_TDD_MONO ]]; then cp $PREFIX/etc/gnb.sa.tdd.conf $PREFIX/etc/gnb.conf; fi
if [[ -v USE_SA_TDD_MONO ]]; then cp $PREFIX/etc/gnb.sa.tdd.conf $PREFIX/etc/gnb.conf; fiif [[ -v USE_SA_CU ]]; then ln -s $PREFIX/etc/gnb.sa.cu.conf $PREFIX/etc/gnb.conf; fi
if [[ -v USE_SA_TDD_CU ]]; then cp $PREFIX/etc/gnb.sa.du.tdd.conf $PREFIX/etc/gnb.conf; fi
# Sometimes, the templates are not enough. We mount a conf file on $PREFIX/etc. It can be a template itself.
if [[ -v USE_VOLUMED_CONF ]]; then cp $PREFIX/etc/mounted.conf $PREFIX/etc/gnb.conf; fi
......
......@@ -94,3 +94,81 @@
- key: parallel_config
env: "@THREAD_PARALLEL_CONFIG@"
- filePrefix: gNB_SA_CU.conf
outputfilename: "gnb.sa.cu.conf"
config:
- key: Active_gNBs
env: "@GNB_NAME@"
- key: gNB_name
env: "@GNB_NAME@"
- key: mcc
env: "@MCC@"
- key: mnc
env: "@MNC@"
- key: mnc_length
env: "@MNC_LENGTH@"
- key: tracking_area_code
env: "@TAC@"
- key: sst
env: "@NSSAI_SST@"
- key: ipv4
env: "@AMF_IP_ADDRESS@"
- key: GNB_INTERFACE_NAME_FOR_NG_AMF
env: "@GNB_NGA_IF_NAME@"
- key: GNB_IPV4_ADDRESS_FOR_NG_AMF
env: "@GNB_NGA_IP_ADDRESS@"
- key: GNB_INTERFACE_NAME_FOR_NGU
env: "@GNB_NGU_IF_NAME@"
- key: GNB_IPV4_ADDRESS_FOR_NGU
env: "@GNB_NGU_IP_ADDRESS@"
- key: local_s_if_name
env: "@F1_IF_NAME@"
- key: local_s_address
env: "@F1_CU_IP_ADDRESS@"
- key: local_s_portd
env: "@F1_CU_D_PORT@"
- key: remote_s_address
env: "@F1_DU_IP_ADDRESS@"
- key: remote_s_portd
env: "@F1_DU_D_PORT@"
- filePrefix: gNB_SA_DU.conf
outputfilename: "gnb.sa.du.tdd.conf"
config:
- key: Active_gNBs
env: "@GNB_NAME@"
- key: gNB_name
env: "@GNB_NAME@"
- key: mcc
env: "@MCC@"
- key: mnc
env: "@MNC@"
- key: mnc_length
env: "@MNC_LENGTH@"
- key: tracking_area_code
env: "@TAC@"
- key: sst
env: "@NSSAI_SST@"
- key: ipv4
env: "@AMF_IP_ADDRESS@"
- key: GNB_INTERFACE_NAME_FOR_NG_AMF
env: "@GNB_NGA_IF_NAME@"
- key: GNB_IPV4_ADDRESS_FOR_NG_AMF
env: "@GNB_NGA_IP_ADDRESS@"
- key: GNB_INTERFACE_NAME_FOR_NGU
env: "@GNB_NGU_IF_NAME@"
- key: GNB_IPV4_ADDRESS_FOR_NGU
env: "@GNB_NGU_IP_ADDRESS@"
- key: parallel_config
env: "@THREAD_PARALLEL_CONFIG@"
- key: local_n_if_name
env: "@F1_IF_NAME@"
- key: local_n_address
env: "@F1_DU_IP_ADDRESS@"
- key: local_n_portd
env: "@F1_DU_D_PORT@"
- key: remote_n_address
env: "@F1_CU_IP_ADDRESS@"
- key: remote_n_portd
env: "@F1_CU_D_PORT@"
......@@ -85,7 +85,6 @@ char * split73_config;
int split73;
AGENT_RRC_xface *agent_rrc_xface[NUM_MAX_ENB]= {0};
AGENT_MAC_xface *agent_mac_xface[NUM_MAX_ENB]= {0};
uint8_t proto_agent_flag = 0;
void flexran_agent_slice_update(mid_t module_idP) {
}
int proto_agent_start(mod_id_t mod_id, const cudu_params_t *p){
......@@ -1047,13 +1046,13 @@ void init_pdcp(void) {
pdcp_module_init(pdcp_initmask);
if (NODE_IS_CU(RC.rrc[0]->node_type)) {
//pdcp_set_rlc_data_req_func((send_rlc_data_req_func_t)proto_agent_send_rlc_data_req);
//pdcp_set_rlc_data_req_func(proto_agent_send_rlc_data_req);
} else {
pdcp_set_rlc_data_req_func((send_rlc_data_req_func_t) rlc_data_req);
pdcp_set_pdcp_data_ind_func((pdcp_data_ind_func_t) pdcp_data_ind);
pdcp_set_rlc_data_req_func(rlc_data_req);
pdcp_set_pdcp_data_ind_func(pdcp_data_ind);
}
} else {
//pdcp_set_pdcp_data_ind_func((pdcp_data_ind_func_t) proto_agent_send_pdcp_data_ind);
//pdcp_set_pdcp_data_ind_func(proto_agent_send_pdcp_data_ind);
}
}
......
......@@ -324,48 +324,36 @@ int create_gNB_tasks(uint32_t gnb_nb) {
}
}
paramdef_t NETParams[] = GNBNETPARAMS_DESC;
char aprefix[MAX_OPTNAME_SIZE*2 + 8];
sprintf(aprefix,"%s.[%i].%s",GNB_CONFIG_STRING_GNB_LIST,0,GNB_CONFIG_STRING_NETWORK_INTERFACES_CONFIG);
config_get( NETParams,sizeof(NETParams)/sizeof(paramdef_t),aprefix);
for(int i = GNB_INTERFACE_NAME_FOR_NG_AMF_IDX; i <= GNB_IPV4_ADDRESS_FOR_NG_AMF_IDX; i++) {
if( NETParams[i].strptr == NULL) {
LOG_E(NGAP, "No configuration in the file.\n");
NGAP_CONF_MODE = 0;
} else {
LOG_D(NGAP, "Configuration in the file: %s.\n",*NETParams[i].strptr);
if (AMF_MODE_ENABLED) {
char* gnb_ipv4_address_for_NGU = NULL;
uint32_t gnb_port_for_NGU = 0;
char* gnb_ipv4_address_for_S1U = NULL;
uint32_t gnb_port_for_S1U = 0;
paramdef_t NETParams[] = GNBNETPARAMS_DESC;
char aprefix[MAX_OPTNAME_SIZE*2 + 8];
sprintf(aprefix,"%s.[%i].%s",GNB_CONFIG_STRING_GNB_LIST,0,GNB_CONFIG_STRING_NETWORK_INTERFACES_CONFIG);
config_get( NETParams,sizeof(NETParams)/sizeof(paramdef_t),aprefix);
for(int i = GNB_INTERFACE_NAME_FOR_NG_AMF_IDX; i <= GNB_IPV4_ADDRESS_FOR_NG_AMF_IDX; i++) {
if( NETParams[i].strptr == NULL) {
LOG_E(NGAP, "No configuration in the file.\n");
NGAP_CONF_MODE = 0;
} else {
LOG_D(NGAP, "Configuration in the file: %s.\n",*NETParams[i].strptr);
}
}
}
if (AMF_MODE_ENABLED) {
if (gnb_nb > 0) {
/*
if (itti_create_task (TASK_SCTP, sctp_eNB_task, NULL) < 0) {
LOG_E(SCTP, "Create task for SCTP failed\n");
return -1;
}
*/
if(NGAP_CONF_MODE) {
if (itti_create_task (TASK_NGAP, ngap_gNB_task, NULL) < 0) {
LOG_E(NGAP, "Create task for NGAP failed\n");
return -1;
}
} else {
LOG_E(NGAP, "Ngap task not created\n");
LOG_I(NGAP, "Ngap task not created\n");
}
if(!emulate_rf) {
if (itti_create_task (TASK_UDP, udp_eNB_task, NULL) < 0) {
LOG_E(UDP_, "Create task for UDP failed\n");
return -1;
}
}
/*if (itti_create_task (TASK_GTPV1_U, &nr_gtpv1u_gNB_task, NULL) < 0) {
LOG_E(GTPU, "Create task for GTPV1U failed\n");
return -1;
}*/
}
}
......@@ -622,15 +610,15 @@ void init_pdcp(void) {
if (NODE_IS_CU(RC.nrrrc[0]->node_type)) {
LOG_I(PDCP, "node is CU, pdcp send rlc_data_req by proto_agent \n");
pdcp_set_rlc_data_req_func((send_rlc_data_req_func_t)proto_agent_send_rlc_data_req);
pdcp_set_rlc_data_req_func(proto_agent_send_rlc_data_req);
} else {
LOG_I(PDCP, "node is gNB \n");
pdcp_set_rlc_data_req_func((send_rlc_data_req_func_t) rlc_data_req);
pdcp_set_pdcp_data_ind_func((pdcp_data_ind_func_t) pdcp_data_ind);
pdcp_set_rlc_data_req_func(rlc_data_req);
pdcp_set_pdcp_data_ind_func(pdcp_data_ind);
}
} else {
LOG_I(PDCP, "node is DU, rlc send pdcp_data_ind by proto_agent \n");
pdcp_set_pdcp_data_ind_func((pdcp_data_ind_func_t) proto_agent_send_pdcp_data_ind);
pdcp_set_pdcp_data_ind_func(proto_agent_send_pdcp_data_ind);
}
}
......@@ -701,7 +689,8 @@ int main( int argc, char **argv ) {
RCconfig_NR_L1();
// don't create if node doesn't connect to RRC/S1/GTP
AssertFatal(create_gNB_tasks(1) == 0,"cannot create ITTI tasks\n");
int ret=create_gNB_tasks(1);
AssertFatal(ret==0,"cannot create ITTI tasks\n");
/* Start the agent. If it is turned off in the configuration, it won't start */
/*
RCconfig_nr_flexran();
......@@ -814,7 +803,9 @@ int main( int argc, char **argv ) {
}
printf("About to call end_configmodule() from %s() %s:%d\n", __FUNCTION__, __FILE__, __LINE__);
// We have to set PARAMFLAG_NOFREE on right paramters before re-enabling end_configmodule()
//end_configmodule();
printf("Called end_configmodule() from %s() %s:%d\n", __FUNCTION__, __FILE__, __LINE__);
// wait for end of program
......
......@@ -99,7 +99,9 @@ pthread_mutex_t sync_mutex;
int sync_var=-1; //!< protected by mutex \ref sync_mutex.
int config_sync_var=-1;
// not used in UE
instance_t CUuniqInstance=0;
instance_t DUuniqInstance=0;
RAN_CONTEXT_t RC;
volatile int oai_exit = 0;
......@@ -369,7 +371,7 @@ void init_openair0(void) {
}
}
void init_pdcp(void) {
static void init_pdcp(void) {
uint32_t pdcp_initmask = (!IS_SOFTMODEM_NOS1) ? LINK_ENB_PDCP_TO_GTPV1U_BIT : (LINK_ENB_PDCP_TO_GTPV1U_BIT | PDCP_USE_NETLINK_BIT | LINK_ENB_PDCP_TO_IP_DRIVER_BIT);
/*if (IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM || (nfapi_getmode()==NFAPI_UE_STUB_PNF)) {
......@@ -386,8 +388,8 @@ void init_pdcp(void) {
nr_DRB_preconfiguration();*/
pdcp_layer_init();
pdcp_module_init(pdcp_initmask);
pdcp_set_rlc_data_req_func((send_rlc_data_req_func_t) rlc_data_req);
pdcp_set_pdcp_data_ind_func((pdcp_data_ind_func_t) pdcp_data_ind);
pdcp_set_rlc_data_req_func(rlc_data_req);
pdcp_set_pdcp_data_ind_func(pdcp_data_ind);
}
// Stupid function addition because UE itti messages queues definition is common with eNB
......
......@@ -329,8 +329,8 @@ static void init_pdcp(void) {
}
pdcp_module_init(pdcp_initmask);
pdcp_set_rlc_data_req_func((send_rlc_data_req_func_t) rlc_data_req);
pdcp_set_pdcp_data_ind_func((pdcp_data_ind_func_t) pdcp_data_ind);
pdcp_set_rlc_data_req_func(rlc_data_req);
pdcp_set_pdcp_data_ind_func(pdcp_data_ind);
}
void init_main_gNB(void) {
......
......@@ -180,15 +180,18 @@ void softmodem_printresources(int sig, telnet_printfunc_t pf) {
}
void signal_handler(int sig) {
void *array[10];
size_t size;
//void *array[10];
//size_t size;
if (sig==SIGSEGV) {
// get void*'s for all entries on the stack
/* backtrace uses malloc, that is not good in signal handlers
* I let the code, because it would be nice to make it better
size = backtrace(array, 10);
// print out all the frames to stderr
fprintf(stderr, "Error: signal %d:\n", sig);
backtrace_symbols_fd(array, size, 2);
*/
exit(-1);
} else {
if(sig==SIGINT ||sig==SOFTMODEM_RTSIGNAL)
......
......@@ -111,7 +111,7 @@ NR_gNB_ULSCH_t *new_gNB_ulsch(uint8_t max_ldpc_iterations,uint16_t N_RB_UL, uint
{
NR_gNB_ULSCH_t *ulsch;
uint8_t exit_flag = 0,i,r;
uint8_t i,r;
uint16_t a_segments = MAX_NUM_NR_ULSCH_SEGMENTS; //number of segments to be allocated
if (N_RB_UL != 273) {
......@@ -120,68 +120,26 @@ NR_gNB_ULSCH_t *new_gNB_ulsch(uint8_t max_ldpc_iterations,uint16_t N_RB_UL, uint
}
uint16_t ulsch_bytes = a_segments*1056; // allocated bytes per segment
ulsch = (NR_gNB_ULSCH_t *)malloc16(sizeof(NR_gNB_ULSCH_t));
if (ulsch) {
memset(ulsch,0,sizeof(NR_gNB_ULSCH_t));
ulsch->max_ldpc_iterations = max_ldpc_iterations;
ulsch->Mlimit = 4;
for (i=0; i<NR_MAX_ULSCH_HARQ_PROCESSES; i++) {
ulsch->harq_processes[i] = (NR_UL_gNB_HARQ_t *)malloc16(sizeof(NR_UL_gNB_HARQ_t));
if (ulsch->harq_processes[i]) {
memset(ulsch->harq_processes[i],0,sizeof(NR_UL_gNB_HARQ_t));
ulsch->harq_processes[i]->b = (uint8_t*)malloc16(ulsch_bytes);
if (ulsch->harq_processes[i]->b)
memset(ulsch->harq_processes[i]->b,0,ulsch_bytes);
else
exit_flag=3;
if (abstraction_flag == 0) {
for (r=0; r<a_segments; r++) {
ulsch->harq_processes[i]->p_nrLDPC_procBuf[r] = nrLDPC_init_mem();
ulsch->harq_processes[i]->c[r] = (uint8_t*)malloc16(8448*sizeof(uint8_t));
if (ulsch->harq_processes[i]->c[r])
memset(ulsch->harq_processes[i]->c[r],0,8448*sizeof(uint8_t));
else
exit_flag=2;
ulsch->harq_processes[i]->d[r] = (int16_t*)malloc16((68*384)*sizeof(int16_t));
if (ulsch->harq_processes[i]->d[r])
memset(ulsch->harq_processes[i]->d[r],0,(68*384)*sizeof(int16_t));
else
exit_flag=2;
ulsch->harq_processes[i]->w[r] = (int16_t*)malloc16((3*(6144+64))*sizeof(int16_t));
if (ulsch->harq_processes[i]->w[r])
memset(ulsch->harq_processes[i]->w[r],0,(3*(6144+64))*sizeof(int16_t));
else
exit_flag=2;
}
}
} else {
exit_flag=1;
ulsch = (NR_gNB_ULSCH_t *)malloc16_clear(sizeof(NR_gNB_ULSCH_t));
ulsch->max_ldpc_iterations = max_ldpc_iterations;
ulsch->Mlimit = 4;
for (i=0; i<NR_MAX_ULSCH_HARQ_PROCESSES; i++) {
ulsch->harq_processes[i] = (NR_UL_gNB_HARQ_t *)malloc16_clear(sizeof(NR_UL_gNB_HARQ_t));
ulsch->harq_processes[i]->b = (uint8_t*)malloc16_clear(ulsch_bytes);
if (abstraction_flag == 0) {
for (r=0; r<a_segments; r++) {
ulsch->harq_processes[i]->p_nrLDPC_procBuf[r] = nrLDPC_init_mem();
ulsch->harq_processes[i]->c[r] = (uint8_t*)malloc16_clear(8448*sizeof(uint8_t));
ulsch->harq_processes[i]->d[r] = (int16_t*)malloc16_clear((68*384)*sizeof(int16_t));
ulsch->harq_processes[i]->w[r] = (int16_t*)malloc16_clear((3*(6144+64))*sizeof(int16_t));
}
}
if (exit_flag==0)
return(ulsch);
}
printf("new_gNB_ulsch with size %zu: exit_flag = %hhu\n",sizeof(NR_UL_gNB_HARQ_t), exit_flag);
free_gNB_ulsch(&ulsch,N_RB_UL);
return(NULL);
return(ulsch);
}
void clean_gNB_ulsch(NR_gNB_ULSCH_t *ulsch)
......
......@@ -605,7 +605,7 @@ int nr_rx_pbch( PHY_VARS_NR_UE *ue,
uint16_t number_pdus = 1;
nr_fill_dl_indication(&dl_indication, NULL, &rx_ind, proc, ue, gNB_id);
nr_fill_rx_indication(&rx_ind, FAPI_NR_RX_PDU_TYPE_SSB, gNB_id, ue, NULL, NULL, number_pdus);
nr_fill_rx_indication(&rx_ind, FAPI_NR_RX_PDU_TYPE_SSB, gNB_id, ue, NULL, NULL, number_pdus, proc);
if (ue->if_inst && ue->if_inst->dl_indication)
ue->if_inst->dl_indication(&dl_indication, NULL);
......
......@@ -258,7 +258,6 @@ int nr_ulsch_encoding(PHY_VARS_NR_UE *ue,
Ilbrm = 0;
Tbslbrm = 950984; //max tbs
Coderate = 0.0;
trace_NRpdu(DIRECTION_UPLINK, harq_process->a, harq_process->pusch_pdu.pusch_data.tb_size, 0, WS_C_RNTI, 0, 0, 0,0, 0);
///////////
/////////////////////////////////////////////////////////////////////////////////////////
......
......@@ -45,6 +45,7 @@
#include "executables/nr-softmodem.h"
#include "executables/softmodem-common.h"
#include "PHY/NR_REFSIG/ul_ref_seq_nr.h"
#include <openair2/UTIL/OPT/opt.h>
//#define DEBUG_PUSCH_MAPPING
//#define DEBUG_MAC_PDU
......@@ -163,9 +164,15 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
nb_dmrs_re_per_rb, number_dmrs_symbols, mod_order, Nl);
trace_NRpdu(DIRECTION_UPLINK,
ulsch_ue->harq_processes[harq_pid]->a,
ulsch_ue->harq_processes[harq_pid]->pusch_pdu.pusch_data.tb_size,
0, WS_C_RNTI, rnti, frame, slot, 0, 0);
if (nr_ulsch_encoding(UE, ulsch_ue, frame_parms, harq_pid, G) == -1)
return;
///////////
////////////////////////////////////////////////////////////////////
......
......@@ -477,9 +477,10 @@ void nr_feptx_prec(RU_t *ru,int frame_tx,int tti_tx) {
memcpy((void*)ru->common.txdataF[i],
(void*)&gNB->common_vars.txdataF[i][txdataF_offset],
fp->samples_per_slot_wCP*sizeof(int32_t));
memcpy((void*)&ru->common.beam_id[i][slot_tx*fp->symbols_per_slot],
(void*)&gNB->common_vars.beam_id[i][slot_tx*fp->symbols_per_slot],
fp->symbols_per_slot*sizeof(uint8_t));
if (ru->do_precoding == 1)
memcpy((void*)&ru->common.beam_id[i][slot_tx*fp->symbols_per_slot],
(void*)&gNB->common_vars.beam_id[i][slot_tx*fp->symbols_per_slot],
fp->symbols_per_slot*sizeof(uint8_t));
}
if (ru->nb_tx == 1 && ru->nb_log_antennas == 1) {
......
......@@ -416,7 +416,8 @@ void nr_fill_rx_indication(fapi_nr_rx_indication_t *rx_ind,
PHY_VARS_NR_UE *ue,
NR_UE_DLSCH_t *dlsch0,
NR_UE_DLSCH_t *dlsch1,
uint16_t n_pdus);
uint16_t n_pdus,
UE_nr_rxtx_proc_t *proc);
bool nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue,
UE_nr_rxtx_proc_t *proc,
......
......@@ -121,7 +121,8 @@ void nr_fill_rx_indication(fapi_nr_rx_indication_t *rx_ind,
PHY_VARS_NR_UE *ue,
NR_UE_DLSCH_t *dlsch0,
NR_UE_DLSCH_t *dlsch1,
uint16_t n_pdus){
uint16_t n_pdus,
UE_nr_rxtx_proc_t *proc ){
NR_DL_FRAME_PARMS *frame_parms = &ue->frame_parms;
......@@ -130,6 +131,16 @@ void nr_fill_rx_indication(fapi_nr_rx_indication_t *rx_ind,
LOG_E(PHY, "In %s: multiple number of DL PDUs not supported yet...\n", __FUNCTION__);
}
if (pdu_type != FAPI_NR_RX_PDU_TYPE_SSB)
trace_NRpdu(DIRECTION_DOWNLINK,
dlsch0->harq_processes[dlsch0->current_harq_pid]->b,
dlsch0->harq_processes[dlsch0->current_harq_pid]->TBS / 8,
pdu_type,
WS_C_RNTI,
dlsch0->rnti,
proc->frame_rx,
proc->nr_slot_rx,
0,0);
switch (pdu_type){
case FAPI_NR_RX_PDU_TYPE_SIB:
rx_ind->rx_indication_body[n_pdus - 1].pdsch_pdu.harq_pid = dlsch0->current_harq_pid;
......@@ -1003,16 +1014,16 @@ bool nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue,
switch (pdsch) {
case RA_PDSCH:
nr_fill_dl_indication(&dl_indication, NULL, &rx_ind, proc, ue, gNB_id);
nr_fill_rx_indication(&rx_ind, FAPI_NR_RX_PDU_TYPE_RAR, gNB_id, ue, dlsch0, NULL, number_pdus);
nr_fill_rx_indication(&rx_ind, FAPI_NR_RX_PDU_TYPE_RAR, gNB_id, ue, dlsch0, NULL, number_pdus, proc);
ue->UE_mode[gNB_id] = RA_RESPONSE;
break;
case PDSCH:
nr_fill_dl_indication(&dl_indication, NULL, &rx_ind, proc, ue, gNB_id);
nr_fill_rx_indication(&rx_ind, FAPI_NR_RX_PDU_TYPE_DLSCH, gNB_id, ue, dlsch0, NULL, number_pdus);
nr_fill_rx_indication(&rx_ind, FAPI_NR_RX_PDU_TYPE_DLSCH, gNB_id, ue, dlsch0, NULL, number_pdus, proc);
break;
case SI_PDSCH:
nr_fill_dl_indication(&dl_indication, NULL, &rx_ind, proc, ue, gNB_id);
nr_fill_rx_indication(&rx_ind, FAPI_NR_RX_PDU_TYPE_SIB, gNB_id, ue, dlsch0, NULL, number_pdus);
nr_fill_rx_indication(&rx_ind, FAPI_NR_RX_PDU_TYPE_SIB, gNB_id, ue, dlsch0, NULL, number_pdus, proc);
break;
default:
break;
......
......@@ -70,7 +70,7 @@ static int tun_alloc(char *dev) {
int fd, err;
if( (fd = open("/dev/net/tun", O_RDWR)) < 0 ) {
printf("[TUN] failed to open /dev/net/tun\n");
LOG_E(PDCP, "[TUN] failed to open /dev/net/tun\n");
return -1;
}
......@@ -103,7 +103,7 @@ int netlink_init_mbms_tun(char *ifprefix) {
nas_sock_mbms_fd = tun_alloc(ifname);
if (nas_sock_mbms_fd == -1) {
printf("[NETLINK] Error opening socket %s (%d:%s)\n",ifname,errno, strerror(errno));
printf("[NETLINK] Error opening mbms socket %s (%d:%s)\n",ifname,errno, strerror(errno));
exit(1);
}
......@@ -123,31 +123,6 @@ int netlink_init_mbms_tun(char *ifprefix) {
nas_src_addr.nl_pid = 1;//getpid(); /* self pid */
nas_src_addr.nl_groups = 0; /* not in mcast groups */
ret = bind(nas_sock_mbms_fd, (struct sockaddr *)&nas_src_addr, sizeof(nas_src_addr));
memset(&nas_dest_addr, 0, sizeof(nas_dest_addr));
nas_dest_addr.nl_family = AF_NETLINK;
nas_dest_addr.nl_pid = 0; /* For Linux Kernel */
nas_dest_addr.nl_groups = 0; /* unicast */
// TX PART
nas_nlh_tx=(struct nlmsghdr *)malloc(NLMSG_SPACE(NL_MAX_PAYLOAD));
memset(nas_nlh_tx, 0, NLMSG_SPACE(NL_MAX_PAYLOAD));
/* Fill the netlink message header */
nas_nlh_tx->nlmsg_len = NLMSG_SPACE(NL_MAX_PAYLOAD);
nas_nlh_tx->nlmsg_pid = 1;//getpid(); /* self pid */
nas_nlh_tx->nlmsg_flags = 0;
nas_iov_tx.iov_base = (void *)nas_nlh_tx;
nas_iov_tx.iov_len = nas_nlh_tx->nlmsg_len;
memset(&nas_msg_tx,0,sizeof(nas_msg_tx));
nas_msg_tx.msg_name = (void *)&nas_dest_addr;
nas_msg_tx.msg_namelen = sizeof(nas_dest_addr);
nas_msg_tx.msg_iov = &nas_iov_tx;
nas_msg_tx.msg_iovlen = 1;
// RX PART
memset(&nas_msg_rx,0,sizeof(nas_msg_rx));
nas_msg_rx.msg_name = (void *)&nas_src_addr;
nas_msg_rx.msg_namelen = sizeof(nas_src_addr);
nas_msg_rx.msg_iov = &nas_iov_rx;
nas_msg_rx.msg_iovlen = 1;
return 1;
}
......@@ -160,51 +135,21 @@ int netlink_init_tun(char *ifprefix, int num_if) {
nas_sock_fd[i] = tun_alloc(ifname);
if (nas_sock_fd[i] == -1) {
printf("[NETLINK] Error opening socket %s (%d:%s)\n",ifname,errno, strerror(errno));
LOG_E(PDCP, "TUN: Error opening socket %s (%d:%s)\n",ifname,errno, strerror(errno));
exit(1);
}
printf("[NETLINK]Opened socket %s with fd nas_sock_fd[%d]=%d\n",
LOG_I(PDCP, "TUN: Opened socket %s with fd nas_sock_fd[%d]=%d\n",
ifname, i, nas_sock_fd[i]);
ret = fcntl(nas_sock_fd[i],F_SETFL,O_NONBLOCK);
if (ret == -1) {
printf("[NETLINK] Error fcntl (%d:%s)\n",errno, strerror(errno));
LOG_E(PDCP, "TUN: Error fcntl (%d:%s)\n",errno, strerror(errno));
if (LINK_ENB_PDCP_TO_IP_DRIVER) {
exit(1);
}
}
memset(&nas_src_addr, 0, sizeof(nas_src_addr));
nas_src_addr.nl_family = AF_NETLINK;
nas_src_addr.nl_pid = 1;//getpid(); /* self pid */
nas_src_addr.nl_groups = 0; /* not in mcast groups */
ret = bind(nas_sock_fd[i], (struct sockaddr *)&nas_src_addr, sizeof(nas_src_addr));
memset(&nas_dest_addr, 0, sizeof(nas_dest_addr));
nas_dest_addr.nl_family = AF_NETLINK;
nas_dest_addr.nl_pid = 0; /* For Linux Kernel */
nas_dest_addr.nl_groups = 0; /* unicast */
// TX PART
nas_nlh_tx=(struct nlmsghdr *)malloc(NLMSG_SPACE(NL_MAX_PAYLOAD));
memset(nas_nlh_tx, 0, NLMSG_SPACE(NL_MAX_PAYLOAD));
/* Fill the netlink message header */
nas_nlh_tx->nlmsg_len = NLMSG_SPACE(NL_MAX_PAYLOAD);
nas_nlh_tx->nlmsg_pid = 1;//getpid(); /* self pid */
nas_nlh_tx->nlmsg_flags = 0;
nas_iov_tx.iov_base = (void *)nas_nlh_tx;
nas_iov_tx.iov_len = nas_nlh_tx->nlmsg_len;
memset(&nas_msg_tx,0,sizeof(nas_msg_tx));
nas_msg_tx.msg_name = (void *)&nas_dest_addr;
nas_msg_tx.msg_namelen = sizeof(nas_dest_addr);
nas_msg_tx.msg_iov = &nas_iov_tx;
nas_msg_tx.msg_iovlen = 1;
// RX PART
memset(&nas_msg_rx,0,sizeof(nas_msg_rx));
nas_msg_rx.msg_name = (void *)&nas_src_addr;
nas_msg_rx.msg_namelen = sizeof(nas_src_addr);
nas_msg_rx.msg_iov = &nas_iov_rx;
nas_msg_rx.msg_iovlen = 1;
} /* for */
return 1;
......@@ -216,7 +161,7 @@ int netlink_init(void) {
nas_sock_fd[0] = socket(PF_NETLINK, SOCK_RAW,GRAAL_NETLINK_ID);
if (nas_sock_fd[0] == -1) {
printf("[NETLINK] Error opening socket %d (%d:%s)\n",nas_sock_fd[0],errno, strerror(errno));
printf("[NETLINK] Error opening GRAAL_NETLINK_ID socket %d (%d:%s)\n",nas_sock_fd[0],errno, strerror(errno));
if (LINK_ENB_PDCP_TO_IP_DRIVER) {
exit(1);
......
......@@ -134,16 +134,16 @@ struct option * parse_oai_options(paramdef_t *options) {
void display_options_values(paramdef_t *options, int verbose) {
for(paramdef_t * ptr=options; ptr->optname[0]!=0; ptr++) {
char varText[256]="need specific display";
char varText[256]={0};
if (ptr->voidptr != NULL) {
if ( (ptr->paramflags & PARAMFLAG_BOOL) )
strcpy(varText, *(bool *)ptr->iptr ? "True": "False" );
else switch (ptr->type) {
case TYPE_INT:
sprintf(varText,"%d",*ptr->iptr);
break;
case TYPE_INT:
sprintf(varText,"%d",*ptr->iptr);
break;
case TYPE_DOUBLE:
sprintf(varText,"%.2f",*ptr->dblptr);
break;
......@@ -157,6 +157,7 @@ void display_options_values(paramdef_t *options, int verbose) {
break;
default:
strcpy(varText,"Need specific display");
printf("not decoded type\n");
exit(1);
}
......
......@@ -634,7 +634,7 @@ int main(int argc, char **argv) {
// num_layers = 1;
perfect_ce = 0;
static paramdef_t options[] = {
{ "awgn", "Use AWGN channel and not multipath", PARAMFLAG_BOOL, strptr:NULL, defintval:0, TYPE_INT, 0, NULL, NULL },
{ "awgn", "Use AWGN channel and not multipath", PARAMFLAG_BOOL, iptr:&awgn_flag, defintval:0, TYPE_INT, 0, NULL, NULL },
{ "Abstx", "Turns on calibration mode for abstraction.", PARAMFLAG_BOOL, iptr:&abstx, defintval:0, TYPE_INT, 0 },
{ "bTDD", "Set the tdd configuration mode",0, iptr:&tdd_config, defintval:3, TYPE_INT, 0 },
{ "BnbRBs", "The LTE bandwith in RBs (100 is 20MHz)",0, iptr:&N_RB_DL, defintval:25, TYPE_INT, 0 },
......
......@@ -71,6 +71,7 @@
#include <openair2/RRC/LTE/rrc_vars.h>
#include <executables/softmodem-common.h>
#include <openair3/ocp-gtpu/gtp_itf.h>
LCHAN_DESC DCCH_LCHAN_DESC,DTCH_DL_LCHAN_DESC,DTCH_UL_LCHAN_DESC;
rlc_info_t Rlc_info_um,Rlc_info_am_config;
......@@ -89,6 +90,13 @@ uint64_t downlink_frequency[MAX_NUM_CCs][4];
THREAD_STRUCT thread_struct;
nfapi_ue_release_request_body_t release_rntis;
uint32_t N_RB_DL = 106;
//Fixme: Uniq dirty DU instance, by global var, datamodel need better management
instance_t DUuniqInstance=0;
instance_t CUuniqInstance=0;
teid_t newGtpuCreateTunnel(instance_t instance, rnti_t rnti, int incoming_bearer_id, int outgoing_bearer_id, teid_t outgoing_teid,
transport_layer_addr_t remoteAddr, int port, gtpCallback callBack) {
return 0;
}
// dummy functions
int dummy_nr_ue_ul_indication(nr_uplink_indication_t *ul_info) { return(0); }
......@@ -131,12 +139,6 @@ rrc_data_ind(
{
}
int ocp_gtpv1u_create_s1u_tunnel(instance_t instance,
const gtpv1u_enb_create_tunnel_req_t *create_tunnel_req,
gtpv1u_enb_create_tunnel_resp_t *create_tunnel_resp) {
return 0;
}
int
gtpv1u_create_s1u_tunnel(
const instance_t instanceP,
......
......@@ -34,4 +34,5 @@ void nr_fill_rx_indication(fapi_nr_rx_indication_t *rx_ind,
PHY_VARS_NR_UE *ue,
NR_UE_DLSCH_t *dlsch0,
NR_UE_DLSCH_t *dlsch1,
uint16_t n_pdus) {}
uint16_t n_pdus,
UE_nr_rxtx_proc_t *proc) {}
......@@ -52,6 +52,7 @@
#include <executables/softmodem-common.h>
#include <openair2/RRC/NR_UE/rrc_defs.h>
//#include "openair1/SIMULATION/NR_PHY/nr_dummy_functions.c"
#include <openair3/ocp-gtpu/gtp_itf.h>
#define NR_PRACH_DEBUG 1
#define PRACH_WRITE_OUTPUT_DEBUG 1
......@@ -88,6 +89,13 @@ int oai_nfapi_nr_crc_indication(nfapi_nr_crc_indication_t *ind) { return(0); }
int oai_nfapi_nr_srs_indication(nfapi_nr_srs_indication_t *ind) { return(0); }
int oai_nfapi_nr_uci_indication(nfapi_nr_uci_indication_t *ind) { return(0); }
int oai_nfapi_nr_rach_indication(nfapi_nr_rach_indication_t *ind) { return(0); }
//Fixme: Uniq dirty DU instance, by global var, datamodel need better management
instance_t DUuniqInstance=0;
instance_t CUuniqInstance=0;
teid_t newGtpuCreateTunnel(instance_t instance, rnti_t rnti, int incoming_bearer_id, int outgoing_bearer_id, teid_t outgoing_teid,
transport_layer_addr_t remoteAddr, int port, gtpCallback callBack) {
return 0;
}
void
rrc_data_ind(
......@@ -99,12 +107,6 @@ rrc_data_ind(
{
}
int ocp_gtpv1u_create_s1u_tunnel(instance_t instance,
const gtpv1u_enb_create_tunnel_req_t *create_tunnel_req,
gtpv1u_enb_create_tunnel_resp_t *create_tunnel_resp) {
return 0;
}
int
gtpv1u_create_s1u_tunnel(
const instance_t instanceP,
......
......@@ -65,6 +65,7 @@
#include <executables/softmodem-common.h>
#include "PHY/NR_REFSIG/ul_ref_seq_nr.h"
#include <openair3/ocp-gtpu/gtp_itf.h>
//#define DEBUG_ULSIM
LCHAN_DESC DCCH_LCHAN_DESC,DTCH_DL_LCHAN_DESC,DTCH_UL_LCHAN_DESC;
......@@ -85,6 +86,13 @@ THREAD_STRUCT thread_struct;
nfapi_ue_release_request_body_t release_rntis;
uint32_t N_RB_DL = 106;
//Fixme: Uniq dirty DU instance, by global var, datamodel need better management
instance_t DUuniqInstance=0;
instance_t CUuniqInstance=0;
teid_t newGtpuCreateTunnel(instance_t instance, rnti_t rnti, int incoming_bearer_id, int outgoing_bearer_id, teid_t outgoing_teid,
transport_layer_addr_t remoteAddr, int port, gtpCallback callBack) {
return 0;
}
extern void fix_scd(NR_ServingCellConfig_t *scd);// forward declaration
int8_t nr_mac_rrc_data_ind_ue(const module_id_t module_id,
......@@ -120,11 +128,6 @@ rrc_data_ind(
{
}
int ocp_gtpv1u_create_s1u_tunnel(instance_t instance,
const gtpv1u_enb_create_tunnel_req_t *create_tunnel_req,
gtpv1u_enb_create_tunnel_resp_t *create_tunnel_resp) {
return 0;
}
int
gtpv1u_create_s1u_tunnel(
......
......@@ -44,7 +44,8 @@ MESSAGE_DEF(F1AP_UE_CONTEXT_RELEASE_CMD, MESSAGE_PRIORITY_MED, f1ap_ue_context_r
/* RRC -> F1AP messages */
MESSAGE_DEF(F1AP_DL_RRC_MESSAGE , MESSAGE_PRIORITY_MED, f1ap_dl_rrc_message_t , f1ap_dl_rrc_message )
//MESSAGE_DEF(F1AP_INITIAL_CONTEXT_SETUP_REQ , MESSAGE_PRIORITY_MED, f1ap_initial_context_setup_req_t , f1ap_initial_context_setup_req )
MESSAGE_DEF(F1AP_UE_CONTEXT_SETUP_REQ, MESSAGE_PRIORITY_MED, f1ap_ue_context_setup_req_t, f1ap_ue_context_setup_req)
MESSAGE_DEF(F1AP_UE_CONTEXT_SETUP_REQ, MESSAGE_PRIORITY_MED, f1ap_ue_context_setup_t, f1ap_ue_context_setup_req)
MESSAGE_DEF(F1AP_UE_CONTEXT_SETUP_RESP, MESSAGE_PRIORITY_MED, f1ap_ue_context_setup_t, f1ap_ue_context_setup_resp)
......
......@@ -39,6 +39,7 @@
#define F1AP_INITIAL_UL_RRC_MESSAGE(mSGpTR) (mSGpTR)->ittiMsg.f1ap_initial_ul_rrc_message
#define F1AP_UL_RRC_MESSAGE(mSGpTR) (mSGpTR)->ittiMsg.f1ap_ul_rrc_message
#define F1AP_UE_CONTEXT_SETUP_REQ(mSGpTR) (mSGpTR)->ittiMsg.f1ap_ue_context_setup_req
#define F1AP_UE_CONTEXT_SETUP_RESP(mSGpTR) (mSGpTR)->ittiMsg.f1ap_ue_context_setup_resp
#define F1AP_UE_CONTEXT_RELEASE_RESP(mSGpTR) (mSGpTR)->ittiMsg.f1ap_ue_context_release_resp
#define F1AP_UE_CONTEXT_MODIFICATION_RESP(mSGpTR) (mSGpTR)->ittiMsg.f1ap_ue_context_modification_resp
#define F1AP_UE_CONTEXT_MODIFICATION_FAIL(mSGpTR) (mSGpTR)->ittiMsg.f1ap_ue_context_modification_fail
......@@ -71,6 +72,29 @@ typedef struct f1ap_cu_setup_req_s {
//
} f1ap_cu_setup_req_t;
typedef struct cellIDs_s {
// Served Cell Information
/* Tracking area code */
uint32_t tac;
/* Mobile Country Codes
* Mobile Network Codes
*/
uint16_t mcc;
uint16_t mnc;
uint8_t mnc_digit_length;
// NR Global Cell Id
uint64_t nr_cellid;
// NR Physical Cell Ids
uint16_t nr_pci;
// Number of slide support items (max 16, could be increased to as much as 1024)
uint16_t num_ssi;
uint8_t sst;
uint8_t sd;
} cellIDs_t;
typedef struct f1ap_setup_req_s {
// Midhaul networking parameters
......@@ -84,6 +108,8 @@ typedef struct f1ap_setup_req_s {
/* The eNB IP address to bind */
f1ap_net_ip_address_t CU_f1_ip_address;
f1ap_net_ip_address_t DU_f1_ip_address;
uint16_t CUport;
uint16_t DUport;
/* Number of SCTP streams used for a mme association */
uint16_t sctp_in_streams;
......@@ -100,26 +126,7 @@ typedef struct f1ap_setup_req_s {
/// number of DU cells available
uint16_t num_cells_available; //0< num_cells_available <= 512;
// Served Cell Information
/* Tracking area code */
uint32_t tac[F1AP_MAX_NB_CELLS];
/* Mobile Country Codes
* Mobile Network Codes
*/
uint16_t mcc[F1AP_MAX_NB_CELLS];//[6];
uint16_t mnc[F1AP_MAX_NB_CELLS];//[6];
uint8_t mnc_digit_length[F1AP_MAX_NB_CELLS];//[6];
// NR Global Cell Id
uint64_t nr_cellid[F1AP_MAX_NB_CELLS];
// NR Physical Cell Ids
uint16_t nr_pci[F1AP_MAX_NB_CELLS];
// Number of slide support items (max 16, could be increased to as much as 1024)
uint16_t num_ssi[F1AP_MAX_NB_CELLS];//[6];
uint8_t sst[F1AP_MAX_NB_CELLS];//[16][6];
uint8_t sd[F1AP_MAX_NB_CELLS];//[16][6];
cellIDs_t cell[F1AP_MAX_NB_CELLS];
// fdd_flag = 1 means FDD, 0 means TDD
int fdd_flag;
......@@ -195,6 +202,7 @@ typedef struct served_cells_to_activate_s {
/// SI message containers (up to 21 messages per cell)
uint8_t *SI_container[21];
int SI_container_length[21];
int SI_type[21];
} served_cells_to_activate_t;
typedef struct f1ap_setup_resp_s {
......@@ -299,7 +307,7 @@ typedef struct f1ap_initial_ul_rrc_message_s {
uint16_t crnti;
uint8_t *rrc_container;
int rrc_container_length;
int8_t *du2cu_rrc_container;
char du2cu_rrc_container[200];
int du2cu_rrc_container_length;
} f1ap_initial_ul_rrc_message_t;
......@@ -312,19 +320,32 @@ typedef struct f1ap_ul_rrc_message_s {
typedef struct f1ap_up_tnl_s {
in_addr_t tl_address; // currently only IPv4 supported
uint32_t gtp_teid;
teid_t teid;
uint16_t port;
} f1ap_up_tnl_t;
typedef struct f1ap_drb_to_be_setup_s {
uint8_t drb_id;
long drb_id;
f1ap_up_tnl_t up_ul_tnl[2];
uint8_t up_ul_tnl_length;
f1ap_up_tnl_t up_dl_tnl[2];
uint8_t up_dl_tnl_length;
rlc_mode_t rlc_mode;
} f1ap_drb_to_be_setup_t;
typedef struct f1ap_ue_context_setup_req_s {
typedef struct f1ap_srb_to_be_setup_s {
long srb_id;
rlc_mode_t rlc_mode;
uint8_t lcid;
} f1ap_srb_to_be_setup_t;
typedef struct f1ap_rb_failed_to_be_setup_s {
long rb_id;
} f1ap_rb_failed_to_be_setup_t;
typedef struct f1ap_ue_context_setup_s {
uint32_t gNB_CU_ue_id; // BK: need to replace by use from rnti
uint32_t *gNB_DU_ue_id;
uint32_t gNB_DU_ue_id;
uint16_t rnti;
// SpCell Info
uint16_t mcc;
......@@ -336,13 +357,37 @@ typedef struct f1ap_ue_context_setup_req_s {
uint32_t servCellId;
uint8_t *cu_to_du_rrc_information;
uint8_t cu_to_du_rrc_information_length;
uint8_t *du_to_cu_rrc_information;
uint8_t du_to_cu_rrc_information_length;
f1ap_drb_to_be_setup_t *drbs_to_be_setup; // BK: need to replace by s1ap_initial_context_setup_req
uint8_t drbs_to_be_setup_length; // BK: need to replace by s1ap_initial_context_setup_req
uint8_t drbs_failed_to_be_setup_length;
f1ap_rb_failed_to_be_setup_t *drbs_failed_to_be_setup;
f1ap_srb_to_be_setup_t *srbs_to_be_setup;
uint8_t srbs_to_be_setup_length;
uint8_t srbs_failed_to_be_setup_length;
f1ap_rb_failed_to_be_setup_t *srbs_failed_to_be_setup;
s1ap_initial_context_setup_req_t *s1ap_initial_context_setup_req;
// coniatner for the rrc_eNB_generate_SecurityModeCommand message
uint8_t *rrc_container;
int rrc_container_length;
} f1ap_ue_context_setup_req_t;
} f1ap_ue_context_setup_t;
typedef struct f1ap_ue_context_setup_resp_s {
uint32_t gNB_CU_ue_id; // BK: need to replace by use from rnti
uint32_t gNB_DU_ue_id;
uint16_t rnti;
uint8_t du_to_cu_rrc_information[1024 /*Arbitrarily big enough*/];
uint32_t du_to_cu_rrc_information_length;
f1ap_drb_to_be_setup_t *drbs_setup; // BK: need to replace by s1ap_initial_context_setup_req
uint8_t drbs_setup_length; // BK: need to replace by s1ap_initial_context_setup_req
f1ap_srb_to_be_setup_t *srbs_setup;
uint8_t srbs_setup_length;
uint8_t srbs_failed_to_be_setup_length;
f1ap_rb_failed_to_be_setup_t *srbs_failed_to_be_setup;
uint8_t drbs_failed_to_be_setup_length;
f1ap_rb_failed_to_be_setup_t *drbs_failed_to_be_setup;
} f1ap_ue_context_setup_resp_t;
typedef enum F1ap_Cause_e {
F1AP_CAUSE_NOTHING, /* No components present */
......
......@@ -29,9 +29,8 @@ MESSAGE_DEF(GTPV1U_ENB_DATA_FORWARDING_REQ, MESSAGE_PRIORITY_MED, gtpv1u_enb_dat
MESSAGE_DEF(GTPV1U_ENB_DATA_FORWARDING_IND, MESSAGE_PRIORITY_MED, gtpv1u_enb_data_forwarding_ind_t,Gtpv1uDataForwardingInd)
MESSAGE_DEF(GTPV1U_ENB_END_MARKER_REQ, MESSAGE_PRIORITY_MED, gtpv1u_enb_end_marker_req_t, Gtpv1uEndMarkerReq)
MESSAGE_DEF(GTPV1U_ENB_END_MARKER_IND, MESSAGE_PRIORITY_MED, gtpv1u_enb_end_marker_ind_t, Gtpv1uEndMarkerInd)
MESSAGE_DEF(GTPV1U_ENB_S1_REQ, MESSAGE_PRIORITY_MED, Gtpv1uS1Req, gtpv1uS1Req)
MESSAGE_DEF(GTPV1U_REQ, MESSAGE_PRIORITY_MED, Gtpv1uReq, gtpv1uReq)
MESSAGE_DEF(GTPV1U_GNB_DELETE_TUNNEL_REQ, MESSAGE_PRIORITY_MED, gtpv1u_gnb_delete_tunnel_req_t, NRGtpv1uDeleteTunnelReq)
MESSAGE_DEF(GTPV1U_GNB_DELETE_TUNNEL_RESP, MESSAGE_PRIORITY_MED, gtpv1u_gnb_delete_tunnel_resp_t, NRGtpv1uDeleteTunnelResp)
MESSAGE_DEF(GTPV1U_GNB_NG_REQ, MESSAGE_PRIORITY_MED, Gtpv1uNGReq, gtpv1uNGReq)
MESSAGE_DEF(GTPV1U_GNB_TUNNEL_DATA_REQ, MESSAGE_PRIORITY_MED, gtpv1u_gnb_tunnel_data_req_t, NRGtpv1uTunnelDataReq)
......@@ -39,11 +39,10 @@
#define GTPV1U_ENB_END_MARKER_REQ(mSGpTR) (mSGpTR)->ittiMsg.Gtpv1uEndMarkerReq
#define GTPV1U_ENB_END_MARKER_IND(mSGpTR) (mSGpTR)->ittiMsg.Gtpv1uEndMarkerInd
#define GTPV1U_ENB_S1_REQ(mSGpTR) (mSGpTR)->ittiMsg.gtpv1uS1Req
#define GTPV1U_REQ(mSGpTR) (mSGpTR)->ittiMsg.gtpv1uReq
#define GTPV1U_GNB_DELETE_TUNNEL_REQ(mSGpTR) (mSGpTR)->ittiMsg.NRGtpv1uDeleteTunnelReq
#define GTPV1U_GNB_DELETE_TUNNEL_RESP(mSGpTR) (mSGpTR)->ittiMsg.NRGtpv1uDeleteTunnelResp
#define GTPV1U_GNB_NG_REQ(mSGpTR) (mSGpTR)->ittiMsg.gtpv1uNGReq
#define GTPV1U_GNB_TUNNEL_DATA_REQ(mSGpTR) (mSGpTR)->ittiMsg.NRGtpv1uTunnelDataReq
#define GTPV1U_ALL_TUNNELS_TEID (teid_t)0xFFFFFFFF
......@@ -174,25 +173,23 @@ typedef struct gtpv1u_enb_end_marker_ind_s {
} gtpv1u_enb_end_marker_ind_t;
typedef struct {
in_addr_t enb_ip_address_for_S1u_S12_S4_up;
tcp_udp_port_t enb_port_for_S1u_S12_S4_up;
char addrStr[256];
char portStr[256];
} Gtpv1uS1Req;
in_addr_t localAddr;
tcp_udp_port_t localPort;
char localAddrStr[256];
char localPortStr[256];
} Gtpv1uReq;
typedef struct {
in_addr_t gnb_ip_address_for_NGu_up;
tcp_udp_port_t gnb_port_for_NGu_up;
char addrStr[256];
char portStr[256];
} Gtpv1uNGReq;
typedef struct gtpv1u_gnb_create_tunnel_req_s {
rnti_t rnti;
int num_tunnels;
teid_t upf_NGu_teid[NR_GTPV1U_MAX_BEARERS_PER_UE]; ///< Tunnel Endpoint Identifier
//teid_t upf_NGu_teid[NR_GTPV1U_MAX_BEARERS_PER_UE]; ///< Tunnel Endpoint Identifier
teid_t outgoing_teid[NR_GTPV1U_MAX_BEARERS_PER_UE];
pdusessionid_t pdusession_id[NR_GTPV1U_MAX_BEARERS_PER_UE];
ebi_t incoming_rb_id[NR_GTPV1U_MAX_BEARERS_PER_UE];
transport_layer_addr_t upf_addr[NR_GTPV1U_MAX_BEARERS_PER_UE];
//ebi_t outgoing_rb_id[NR_GTPV1U_MAX_BEARERS_PER_UE];
//transport_layer_addr_t upf_addr[NR_GTPV1U_MAX_BEARERS_PER_UE];
transport_layer_addr_t dst_addr[NR_GTPV1U_MAX_BEARERS_PER_UE];
} gtpv1u_gnb_create_tunnel_req_t;
typedef struct gtpv1u_gnb_create_tunnel_resp_s {
......
......@@ -147,6 +147,7 @@ typedef struct NRRrcMacCcchDataInd_s {
OCTET_STRING_t *du_to_cu_rrc_container;
uint8_t gnb_index;
int CC_id;
uint64_t nr_cellid;
} NRRrcMacCcchDataInd;
typedef struct RrcMacMcchDataReq_s {
......
......@@ -233,7 +233,6 @@ typedef struct protocol_ctxt_s {
frame_t frame; /*!< \brief LTE frame number.*/
sub_frame_t subframe; /*!< \brief LTE sub frame number.*/
eNB_index_t eNB_index; /*!< \brief valid for UE indicating the index of connected eNB(s) */
boolean_t configured; /*!< \brief flag indicating whether the instance is configured or not */
boolean_t brOption;
} protocol_ctxt_t;
// warning time hardcoded
......
......@@ -79,3 +79,5 @@ MESSAGE_DEF(RRC_SUBFRAME_PROCESS, MESSAGE_PRIORITY_MED, RrcSubframeP
// eNB: RLC -> RRC messages
MESSAGE_DEF(RLC_SDU_INDICATION, MESSAGE_PRIORITY_MED, RlcSduIndication, rlc_sdu_indication)
MESSAGE_DEF(NR_DU_RRC_DL_INDICATION, MESSAGE_PRIORITY_MED, NRDuDlReq_t, nr_du_dl_req)
......@@ -89,6 +89,7 @@
#define RRC_SUBFRAME_PROCESS(mSGpTR) (mSGpTR)->ittiMsg.rrc_subframe_process
#define RLC_SDU_INDICATION(mSGpTR) (mSGpTR)->ittiMsg.rlc_sdu_indication
#define NRDuDlReq(mSGpTR) (mSGpTR)->ittiMsg.nr_du_dl_req
//-------------------------------------------------------------------------------------------//
typedef struct RrcStateInd_s {
......@@ -418,6 +419,11 @@ typedef struct NRRrcConfigurationReq_s {
int pucch_TargetSNRx10;
} gNB_RrcConfigurationReq;
typedef struct NRDuDlReq_s {
rnti_t rnti;
mem_block_t * buf;
uint64_t srb_id;
} NRDuDlReq_t;
// UE: NAS -> RRC messages
typedef kenb_refresh_req_t NasKenbRefreshReq;
......
......@@ -1925,6 +1925,7 @@ int RCconfig_DU_F1(MessageDef *msg_p, uint32_t i) {
AssertFatal(ENBParamList.paramarray[i][ENB_ENB_ID_IDX].uptr != NULL,
"eNB id %u is not defined in configuration file\n",i);
F1AP_SETUP_REQ (msg_p).num_cells_available = 0;
F1AP_SETUP_REQ (msg_p).cell_type = CELL_MACRO_ENB;
for (k=0; k <num_enbs ; k++) {
if (strcmp(ENBSParams[ENB_ACTIVE_ENBS_IDX].strlistptr[k], *(ENBParamList.paramarray[i][ENB_ENB_NAME_IDX].strptr) )== 0) {
......@@ -1945,20 +1946,20 @@ int RCconfig_DU_F1(MessageDef *msg_p, uint32_t i) {
LOG_I(ENB_APP,"F1AP: gNB_DU_id[%d] %ld\n",k,F1AP_SETUP_REQ (msg_p).gNB_DU_id);
F1AP_SETUP_REQ (msg_p).gNB_DU_name = strdup(*(ENBParamList.paramarray[0][ENB_ENB_NAME_IDX].strptr));
LOG_I(ENB_APP,"F1AP: gNB_DU_name[%d] %s\n",k,F1AP_SETUP_REQ (msg_p).gNB_DU_name);
F1AP_SETUP_REQ (msg_p).tac[k] = *ENBParamList.paramarray[i][ENB_TRACKING_AREA_CODE_IDX].uptr;
LOG_I(ENB_APP,"F1AP: tac[%d] %d\n",k,F1AP_SETUP_REQ (msg_p).tac[k]);
F1AP_SETUP_REQ (msg_p).mcc[k] = *PLMNParamList.paramarray[0][ENB_MOBILE_COUNTRY_CODE_IDX].uptr;
LOG_I(ENB_APP,"F1AP: mcc[%d] %d\n",k,F1AP_SETUP_REQ (msg_p).mcc[k]);
F1AP_SETUP_REQ (msg_p).mnc[k] = *PLMNParamList.paramarray[0][ENB_MOBILE_NETWORK_CODE_IDX].uptr;
LOG_I(ENB_APP,"F1AP: mnc[%d] %d\n",k,F1AP_SETUP_REQ (msg_p).mnc[k]);
F1AP_SETUP_REQ (msg_p).mnc_digit_length[k] = *PLMNParamList.paramarray[0][ENB_MNC_DIGIT_LENGTH].u8ptr;
LOG_I(ENB_APP,"F1AP: mnc_digit_length[%d] %d\n",k,F1AP_SETUP_REQ (msg_p).mnc_digit_length[k]);
AssertFatal((F1AP_SETUP_REQ (msg_p).mnc_digit_length[k] == 2) ||
(F1AP_SETUP_REQ (msg_p).mnc_digit_length[k] == 3),
F1AP_SETUP_REQ (msg_p).cell[k].tac = *ENBParamList.paramarray[i][ENB_TRACKING_AREA_CODE_IDX].uptr;
LOG_I(ENB_APP,"F1AP: tac[%d] %d\n",k,F1AP_SETUP_REQ (msg_p).cell[k].tac);
F1AP_SETUP_REQ (msg_p).cell[k].mcc = *PLMNParamList.paramarray[0][ENB_MOBILE_COUNTRY_CODE_IDX].uptr;
LOG_I(ENB_APP,"F1AP: mcc[%d] %d\n",k,F1AP_SETUP_REQ (msg_p).cell[k].mcc);
F1AP_SETUP_REQ (msg_p).cell[k].mnc = *PLMNParamList.paramarray[0][ENB_MOBILE_NETWORK_CODE_IDX].uptr;
LOG_I(ENB_APP,"F1AP: mnc[%d] %d\n",k,F1AP_SETUP_REQ (msg_p).cell[k].mnc);
F1AP_SETUP_REQ (msg_p).cell[k].mnc_digit_length = *PLMNParamList.paramarray[0][ENB_MNC_DIGIT_LENGTH].u8ptr;
LOG_I(ENB_APP,"F1AP: mnc_digit_length[%d] %d\n",k,F1AP_SETUP_REQ (msg_p).cell[k].mnc_digit_length);
AssertFatal((F1AP_SETUP_REQ (msg_p).cell[k].mnc_digit_length == 2) ||
(F1AP_SETUP_REQ (msg_p).cell[k].mnc_digit_length == 3),
"BAD MNC DIGIT LENGTH %d",
F1AP_SETUP_REQ (msg_p).mnc_digit_length[k]);
F1AP_SETUP_REQ (msg_p).nr_cellid[k] = (uint64_t)*(ENBParamList.paramarray[i][ENB_NRCELLID_IDX].u64ptr);
LOG_I(ENB_APP,"F1AP: nr_cellid[%d] %ld\n",k,F1AP_SETUP_REQ (msg_p).nr_cellid[k]);
F1AP_SETUP_REQ (msg_p).cell[k].mnc_digit_length);
F1AP_SETUP_REQ (msg_p).cell[k].nr_cellid = (uint64_t)*(ENBParamList.paramarray[i][ENB_NRCELLID_IDX].u64ptr);
LOG_I(ENB_APP,"F1AP: nr_cellid[%d] %ld\n",k,F1AP_SETUP_REQ (msg_p).cell[k].nr_cellid);
LOG_I(ENB_APP,"F1AP: CU_ip4_address in DU %s\n",RC.mac[k]->eth_params_n.remote_addr);
LOG_I(ENB_APP,"FIAP: CU_ip4_address in DU %p, strlen %d\n",F1AP_SETUP_REQ (msg_p).CU_f1_ip_address.ipv4_address,(int)strlen(RC.mac[k]->eth_params_n.remote_addr));
F1AP_SETUP_REQ (msg_p).CU_f1_ip_address.ipv6 = 0;
......@@ -1969,8 +1970,11 @@ int RCconfig_DU_F1(MessageDef *msg_p, uint32_t i) {
LOG_I(ENB_APP,"FIAP: DU_ip4_address in DU %p, strlen %d\n",F1AP_SETUP_REQ (msg_p).DU_f1_ip_address.ipv4_address,(int)strlen(RC.mac[k]->eth_params_n.my_addr));
F1AP_SETUP_REQ (msg_p).DU_f1_ip_address.ipv6 = 0;
F1AP_SETUP_REQ (msg_p).DU_f1_ip_address.ipv4 = 1;
//strcpy(F1AP_SETUP_REQ (msg_p).DU_f1_ip_address.ipv6_address, "");
strcpy(F1AP_SETUP_REQ (msg_p).DU_f1_ip_address.ipv4_address, RC.mac[k]->eth_params_n.my_addr);
F1AP_SETUP_REQ (msg_p).DUport= RC.mac[k]->eth_params_n.my_portd;
F1AP_SETUP_REQ (msg_p).CUport= RC.mac[k]->eth_params_n.remote_portd;
//strcpy(F1AP_SETUP_REQ (msg_p).CU_ip_address[l].ipv6_address,*(F1ParamList.paramarray[l][ENB_CU_IPV6_ADDRESS_IDX].strptr));
//F1AP_SETUP_REQ (msg_p).CU_port = RC.mac[k]->eth_params_n.remote_portc; // maybe we dont need it
sprintf(aprefix,"%s.[%i].%s",ENB_CONFIG_STRING_ENB_LIST,k,ENB_CONFIG_STRING_SCTP_CONFIG);
......@@ -1989,12 +1993,12 @@ int RCconfig_DU_F1(MessageDef *msg_p, uint32_t i) {
pthread_mutex_unlock(&rrc->cell_info_mutex);
} while (cell_info_configured ==0);
rrc->configuration.mcc[0] = F1AP_SETUP_REQ (msg_p).mcc[k];
rrc->configuration.mnc[0] = F1AP_SETUP_REQ (msg_p).mnc[k];
rrc->configuration.tac = F1AP_SETUP_REQ (msg_p).tac[k];
rrc->nr_cellid = F1AP_SETUP_REQ (msg_p).nr_cellid[k];
F1AP_SETUP_REQ (msg_p).nr_pci[k] = rrc->carrier[0].physCellId;
F1AP_SETUP_REQ (msg_p).num_ssi[k] = 0;
rrc->configuration.mcc[0] = F1AP_SETUP_REQ (msg_p).cell[k].mcc;
rrc->configuration.mnc[0] = F1AP_SETUP_REQ (msg_p).cell[k].mnc;
rrc->configuration.tac = F1AP_SETUP_REQ (msg_p).cell[k].tac;
rrc->nr_cellid = F1AP_SETUP_REQ (msg_p).cell[k].nr_cellid;
F1AP_SETUP_REQ (msg_p).cell[k].nr_pci = rrc->carrier[0].physCellId;
F1AP_SETUP_REQ (msg_p).cell[k].num_ssi = 0;
if (rrc->carrier[0].sib1->tdd_Config) {
LOG_I(ENB_APP,"ngran_DU: Configuring Cell %d for TDD\n",k);
......@@ -2070,12 +2074,12 @@ int RCconfig_gtpu(void ) {
if (address) {
MessageDef *message;
AssertFatal((message = itti_alloc_new_message(TASK_ENB_APP, 0, GTPV1U_ENB_S1_REQ))!=NULL,"");
IPV4_STR_ADDR_TO_INT_NWBO ( address, GTPV1U_ENB_S1_REQ(message).enb_ip_address_for_S1u_S12_S4_up, "BAD IP ADDRESS FORMAT FOR eNB S1_U !\n" );
LOG_I(GTPU,"Configuring GTPu address : %s -> %x\n",address,GTPV1U_ENB_S1_REQ(message).enb_ip_address_for_S1u_S12_S4_up);
GTPV1U_ENB_S1_REQ(message).enb_port_for_S1u_S12_S4_up = enb_port_for_S1U;
strcpy(GTPV1U_ENB_S1_REQ(message).addrStr,address);
sprintf(GTPV1U_ENB_S1_REQ(message).portStr,"%d", enb_port_for_S1U);
AssertFatal((message = itti_alloc_new_message(TASK_ENB_APP, 0, GTPV1U_REQ))!=NULL,"");
IPV4_STR_ADDR_TO_INT_NWBO ( address, GTPV1U_REQ(message).localAddr, "BAD IP ADDRESS FORMAT FOR eNB S1_U !\n" );
LOG_I(GTPU,"Configuring GTPu address : %s -> %x\n",address,GTPV1U_REQ(message).localAddr);
GTPV1U_REQ(message).localPort = enb_port_for_S1U;
strcpy(GTPV1U_REQ(message).localAddrStr,address);
sprintf(GTPV1U_REQ(message).localPortStr,"%d", enb_port_for_S1U);
itti_send_msg_to_task (TASK_VARIABLE, 0, message); // data model is wrong: gtpu doesn't have enb_id (or module_id)
} else
LOG_E(GTPU,"invalid address for S1U\n");
......@@ -3167,7 +3171,7 @@ void handle_f1ap_setup_resp(f1ap_setup_resp_t *resp) {
(check_plmn_identity(carrier, resp->cells_to_activate[j].mcc, resp->cells_to_activate[j].mnc, resp->cells_to_activate[j].mnc_digit_length)>0 &&
resp->cells_to_activate[j].nrpci == carrier->physCellId)) {
// copy system information and decode it
for (si_ind=2; si_ind<resp->cells_to_activate[j].num_SI + 2; si_ind++) {
for (si_ind=0; si_ind<resp->cells_to_activate[j].num_SI; si_ind++) {
//printf("SI %d size %d: ", si_ind, resp->cells_to_activate[j].SI_container_length[si_ind]);
//for (int n=0;n<resp->cells_to_activate[j].SI_container_length[si_ind];n++)
// printf("%02x ",resp->cells_to_activate[j].SI_container[si_ind][n]);
......@@ -3175,7 +3179,7 @@ void handle_f1ap_setup_resp(f1ap_setup_resp_t *resp) {
if (si_ind==6) si_ind=9;
if (resp->cells_to_activate[j].SI_container[si_ind] != NULL) {
extract_and_decode_SI(i,
si_ind,
resp->cells_to_activate[j].SI_type[si_ind],
resp->cells_to_activate[j].SI_container[si_ind],
resp->cells_to_activate[j].SI_container_length[si_ind]);
}
......
......@@ -29,6 +29,19 @@
void apply_macrlc_config(gNB_RRC_INST *rrc,
rrc_gNB_ue_context_t *const ue_context_pP,
const protocol_ctxt_t *const ctxt_pP ) {
abort();
abort();
}
boolean_t sdap_gnb_data_req(protocol_ctxt_t *ctxt_p,
const srb_flag_t srb_flag,
const rb_id_t rb_id,
const mui_t mui,
const confirm_t confirm,
const sdu_size_t sdu_buffer_size,
unsigned char *const sdu_buffer,
const pdcp_transmission_mode_t pt_mode,
const uint32_t *sourceL2Id,
const uint32_t *destinationL2Id
) {
abort();
}
......@@ -32,19 +32,22 @@
#include "f1ap_common.h"
static f1ap_cudu_inst_t *f1_du_inst[NUMBER_OF_eNB_MAX]= {0};
static f1ap_cudu_inst_t *f1_cu_inst[NUMBER_OF_eNB_MAX]= {0};
#if defined(EMIT_ASN_DEBUG_EXTERN)
int asn_debug = 0;
int asn1_xer_print = 0;
inline void ASN_DEBUG(const char *fmt, ...)
{
inline void ASN_DEBUG(const char *fmt, ...) {
if (asn_debug) {
int adi = asn_debug_indent;
va_list ap;
va_start(ap, fmt);
fprintf(stderr, "[ASN1]");
while(adi--) fprintf(stderr, " ");
while(adi--)
fprintf(stderr, " ");
vfprintf(stderr, fmt, ap);
fprintf(stderr, "\n");
......@@ -53,142 +56,157 @@ inline void ASN_DEBUG(const char *fmt, ...)
}
#endif
uint8_t F1AP_get_next_transaction_identifier(module_id_t enb_mod_idP, module_id_t cu_mod_idP)
{
uint8_t F1AP_get_next_transaction_identifier(instance_t enb_mod_idP, instance_t cu_mod_idP) {
static uint8_t transaction_identifier[NUMBER_OF_eNB_MAX];
transaction_identifier[enb_mod_idP+cu_mod_idP] =
(transaction_identifier[enb_mod_idP+cu_mod_idP] + 1) % F1AP_TRANSACTION_IDENTIFIER_NUMBER;
(transaction_identifier[enb_mod_idP+cu_mod_idP] + 1) % F1AP_TRANSACTION_IDENTIFIER_NUMBER;
//LOG_T(F1AP,"generated xid is %d\n",transaction_identifier[enb_mod_idP+cu_mod_idP]);
return transaction_identifier[enb_mod_idP+cu_mod_idP];
}
int f1ap_add_ue(f1ap_cudu_inst_t *f1_inst,
module_id_t module_idP,
int CC_idP,
int UE_id,
f1ap_cudu_inst_t *getCxt(F1_t isCU, instance_t instanceP) {
//Fixme: 4G F1 has race condtions, someone may debug it, using this test
/*
static pid_t t=-1;
pid_t tNew=gettid();
AssertFatal ( t==-1 || t==tNew, "This is not thread safe\n");
t=tNew;
*/
AssertFatal( instanceP < sizeofArray(f1_cu_inst), "");
return isCU == CUtype ? f1_cu_inst[ instanceP]: f1_du_inst[ instanceP];
}
void createF1inst(F1_t isCU, instance_t instanceP, f1ap_setup_req_t *req) {
if (isCU == CUtype) {
AssertFatal(f1_cu_inst[instanceP] == NULL, "Double call to F1 CU init\n");
f1_cu_inst[instanceP]=( f1ap_cudu_inst_t *) calloc(1, sizeof( f1ap_cudu_inst_t));
//memcpy(f1_cu_inst[instanceP]->setupReq, req, sizeof(f1ap_setup_req_t) );
} else {
AssertFatal(f1_du_inst[instanceP] == NULL, "Double call to F1 DU init\n");
f1_du_inst[instanceP]=( f1ap_cudu_inst_t *) calloc(1, sizeof(f1ap_cudu_inst_t));
memcpy(&f1_du_inst[instanceP]->setupReq, req, sizeof(f1ap_setup_req_t) );
}
}
int f1ap_add_ue(F1_t isCu,
instance_t instanceP,
rnti_t rntiP) {
f1ap_cudu_inst_t *f1_inst=getCxt(isCu, instanceP);
for (int i = 0; i < MAX_MOBILES_PER_ENB; i++) {
if (f1_inst->f1ap_ue[i].rnti == rntiP) {
f1_inst->f1ap_ue[i].f1ap_uid = i;
f1_inst->f1ap_ue[i].mac_uid = UE_id;
LOG_I(F1AP, "Updating the index of UE with RNTI %x and du_ue_f1ap_id %d\n", f1_inst->f1ap_ue[i].rnti, f1_inst->f1ap_ue[i].du_ue_f1ap_id);
LOG_I(F1AP, "Updating the index of UE with RNTI %x and du_ue_f1ap_id %ld\n", f1_inst->f1ap_ue[i].rnti, f1_inst->f1ap_ue[i].du_ue_f1ap_id);
return i;
}
}
// We didn't find the rnti
for (int i = 0; i < MAX_MOBILES_PER_ENB; i++) {
if (f1_inst->f1ap_ue[i].rnti == 0 ) {
f1_inst->f1ap_ue[i].rnti = rntiP;
f1_inst->f1ap_ue[i].f1ap_uid = i;
f1_inst->f1ap_ue[i].mac_uid = UE_id;
f1_inst->f1ap_ue[i].du_ue_f1ap_id = rntiP;
f1_inst->f1ap_ue[i].cu_ue_f1ap_id = rntiP;
f1_inst->num_ues++;
LOG_I(F1AP, "Adding a new UE with RNTI %x and cu/du ue_f1ap_id %d\n", f1_inst->f1ap_ue[i].rnti, f1_inst->f1ap_ue[i].du_ue_f1ap_id);
LOG_I(F1AP, "Adding a new UE with RNTI %x and cu/du ue_f1ap_id %ld\n", f1_inst->f1ap_ue[i].rnti, f1_inst->f1ap_ue[i].du_ue_f1ap_id);
return i;
}
}
return -1;
}
int f1ap_remove_ue(f1ap_cudu_inst_t *f1_inst,
int f1ap_remove_ue(F1_t isCu, instance_t instanceP,
rnti_t rntiP) {
f1ap_cudu_inst_t *f1_inst=getCxt(isCu, instanceP);
for (int i = 0; i < MAX_MOBILES_PER_ENB; i++) {
if (f1_inst->f1ap_ue[i].rnti == rntiP) {
f1_inst->f1ap_ue[i].rnti = 0;
break;
}
}
f1_inst->num_ues--;
return 0;
}
int f1ap_get_du_ue_f1ap_id(f1ap_cudu_inst_t *f1_inst,
rnti_t rntiP) {
int f1ap_get_du_ue_f1ap_id(F1_t isCu, instance_t instanceP,
rnti_t rntiP) {
f1ap_cudu_inst_t *f1_inst=getCxt(isCu, instanceP);
for (int i = 0; i < MAX_MOBILES_PER_ENB; i++) {
if (f1_inst->f1ap_ue[i].rnti == rntiP) {
return f1_inst->f1ap_ue[i].du_ue_f1ap_id;
}
}
return -1;
}
int f1ap_get_cu_ue_f1ap_id(f1ap_cudu_inst_t *f1_inst,
rnti_t rntiP) {
int f1ap_get_cu_ue_f1ap_id(F1_t isCu, instance_t instanceP,
rnti_t rntiP) {
f1ap_cudu_inst_t *f1_inst=getCxt(isCu, instanceP);
for (int i = 0; i < MAX_MOBILES_PER_ENB; i++) {
if (f1_inst->f1ap_ue[i].rnti == rntiP) {
return f1_inst->f1ap_ue[i].cu_ue_f1ap_id;
}
}
return -1;
}
int f1ap_get_rnti_by_du_id(f1ap_cudu_inst_t *f1_inst,
module_id_t du_ue_f1ap_id ) {
int f1ap_get_rnti_by_du_id(F1_t isCu, instance_t instanceP,
instance_t du_ue_f1ap_id ) {
f1ap_cudu_inst_t *f1_inst=getCxt(isCu, instanceP);
for (int i = 0; i < MAX_MOBILES_PER_ENB; i++) {
if (f1_inst->f1ap_ue[i].du_ue_f1ap_id == du_ue_f1ap_id) {
return f1_inst->f1ap_ue[i].rnti;
}
}
return -1;
}
int f1ap_get_rnti_by_cu_id(f1ap_cudu_inst_t *f1_inst,
module_id_t cu_ue_f1ap_id ) {
int f1ap_get_rnti_by_cu_id(F1_t isCu, instance_t instanceP,
instance_t cu_ue_f1ap_id ) {
f1ap_cudu_inst_t *f1_inst=getCxt(isCu, instanceP);
for (int i = 0; i < MAX_MOBILES_PER_ENB; i++) {
if (f1_inst->f1ap_ue[i].cu_ue_f1ap_id == cu_ue_f1ap_id) {
return f1_inst->f1ap_ue[i].rnti;
}
}
return -1;
}
int f1ap_get_du_uid(f1ap_cudu_inst_t *f1_inst,
module_id_t du_ue_f1ap_id ) {
for (int i = 0; i < MAX_MOBILES_PER_ENB; i++) {
if (f1_inst->f1ap_ue[i].du_ue_f1ap_id == du_ue_f1ap_id) {
return i;
}
}
return -1;
}
int f1ap_get_cu_uid(f1ap_cudu_inst_t *f1_inst,
module_id_t cu_ue_f1ap_id ) {
for (int i = 0; i < MAX_MOBILES_PER_ENB; i++) {
if (f1_inst->f1ap_ue[i].cu_ue_f1ap_id == cu_ue_f1ap_id) {
return i;
}
}
return -1;
}
int f1ap_du_add_cu_ue_id(instance_t instanceP,
instance_t du_ue_f1ap_id,
instance_t cu_ue_f1ap_id) {
f1ap_cudu_inst_t *f1_inst=getCxt(DUtype, instanceP);
instance_t f1ap_uid=-1;
int f1ap_get_uid_by_rnti(f1ap_cudu_inst_t *f1_inst,
rnti_t rntiP ) {
for (int i = 0; i < MAX_MOBILES_PER_ENB; i++) {
if (f1_inst->f1ap_ue[i].rnti == rntiP) {
return i;
if (f1_inst->f1ap_ue[i].du_ue_f1ap_id == du_ue_f1ap_id) {
f1ap_uid=i;
break;
}
}
return -1;
}
int f1ap_du_add_cu_ue_id(f1ap_cudu_inst_t *f1_inst,
module_id_t du_ue_f1ap_id,
module_id_t cu_ue_f1ap_id) {
module_id_t f1ap_uid = f1ap_get_du_uid(f1_inst,du_ue_f1ap_id);
if (f1ap_uid < 0 || f1ap_uid >= MAX_MOBILES_PER_ENB) return -1;
if (f1ap_uid < 0 || f1ap_uid >= MAX_MOBILES_PER_ENB)
return -1;
f1_inst->f1ap_ue[f1ap_uid].cu_ue_f1ap_id = cu_ue_f1ap_id;
LOG_I(F1AP, "Adding cu_ue_f1ap_id %d for UE with RNTI %x\n", cu_ue_f1ap_id, f1_inst->f1ap_ue[f1ap_uid].rnti);
LOG_I(F1AP, "Adding cu_ue_f1ap_id %ld for UE with RNTI %x\n", cu_ue_f1ap_id, f1_inst->f1ap_ue[f1ap_uid].rnti);
return 0;
}
int f1ap_cu_add_du_ue_id(f1ap_cudu_inst_t *f1_inst,
module_id_t cu_ue_f1ap_id,
module_id_t du_ue_f1ap_id) {
module_id_t f1ap_uid = f1ap_get_cu_uid(f1_inst,cu_ue_f1ap_id);
if (f1ap_uid < 0 || f1ap_uid >= MAX_MOBILES_PER_ENB) return -1;
f1_inst->f1ap_ue[f1ap_uid].du_ue_f1ap_id = du_ue_f1ap_id;
LOG_I(F1AP, "Adding du_ue_f1ap_id %d for UE with RNTI %x\n", du_ue_f1ap_id, f1_inst->f1ap_ue[f1ap_uid].rnti);
return 0;
int f1ap_assoc_id(F1_t isCu, instance_t instanceP) {
f1ap_setup_req_t *f1_inst=f1ap_req(isCu, instanceP);
return f1_inst->assoc_id;
}
......@@ -31,19 +31,20 @@
*/
#if HAVE_CONFIG_H_
# include "config.h"
#include "config.h"
#endif
#ifndef F1AP_COMMON_H_
#define F1AP_COMMON_H_
#include "openairinterface5g_limits.h"
#include <openair2/RRC/NR/MESSAGES/asn1_msg.h>
#define F1AP_UE_IDENTIFIER_NUMBER 3
#define F1AP_TRANSACTION_IDENTIFIER_NUMBER 3
#if defined(EMIT_ASN_DEBUG_EXTERN)
inline void ASN_DEBUG(const char *fmt, ...);
inline void ASN_DEBUG(const char *fmt, ...);
#endif
#include "F1AP_RAT-FrequencyPriorityInformation.h"
......@@ -360,14 +361,14 @@ inline void ASN_DEBUG(const char *fmt, ...);
/* Checking version of ASN1C compiler */
#if (ASN1C_ENVIRONMENT_VERSION < ASN1C_MINIMUM_VERSION)
# error "You are compiling f1ap with the wrong version of ASN1C"
# error "You are compiling f1ap with the wrong version of ASN1C"
#endif
#ifndef FALSE
# define FALSE (0)
#define FALSE (0)
#endif
#ifndef TRUE
# define TRUE (!FALSE)
#define TRUE (!FALSE)
#endif
#define F1AP_UE_ID_FMT "0x%06"PRIX32
......@@ -375,20 +376,20 @@ inline void ASN_DEBUG(const char *fmt, ...);
#include "assertions.h"
#if defined(ENB_MODE)
# include "common/utils/LOG/log.h"
# include "f1ap_default_values.h"
# define F1AP_ERROR(x, args...) LOG_E(F1AP, x, ##args)
# define F1AP_WARN(x, args...) LOG_W(F1AP, x, ##args)
# define F1AP_TRAF(x, args...) LOG_I(F1AP, x, ##args)
# define F1AP_INFO(x, args...) LOG_I(F1AP, x, ##args)
# define F1AP_DEBUG(x, args...) LOG_I(F1AP, x, ##args)
#include "common/utils/LOG/log.h"
#include "f1ap_default_values.h"
#define F1AP_ERROR(x, args...) LOG_E(F1AP, x, ##args)
#define F1AP_WARN(x, args...) LOG_W(F1AP, x, ##args)
#define F1AP_TRAF(x, args...) LOG_I(F1AP, x, ##args)
#define F1AP_INFO(x, args...) LOG_I(F1AP, x, ##args)
#define F1AP_DEBUG(x, args...) LOG_I(F1AP, x, ##args)
#else
//# include "mme_default_values.h"
# define F1AP_ERROR(x, args...) do { fprintf(stdout, "[F1AP][E]"x, ##args); } while(0)
# define F1AP_WARN(x, args...) do { fprintf(stdout, "[F1AP][W]"x, ##args); } while(0)
# define F1AP_TRAF(x, args...) do { fprintf(stdout, "[F1AP][T]"x, ##args); } while(0)
# define F1AP_INFO(x, args...) do { fprintf(stdout, "[F1AP][I]"x, ##args); } while(0)
# define F1AP_DEBUG(x, args...) do { fprintf(stdout, "[F1AP][D]"x, ##args); } while(0)
//# include "mme_default_values.h"
#define F1AP_ERROR(x, args...) do { fprintf(stdout, "[F1AP][E]"x, ##args); } while(0)
#define F1AP_WARN(x, args...) do { fprintf(stdout, "[F1AP][W]"x, ##args); } while(0)
#define F1AP_TRAF(x, args...) do { fprintf(stdout, "[F1AP][T]"x, ##args); } while(0)
#define F1AP_INFO(x, args...) do { fprintf(stdout, "[F1AP][I]"x, ##args); } while(0)
#define F1AP_DEBUG(x, args...) do { fprintf(stdout, "[F1AP][D]"x, ##args); } while(0)
#endif
//Forward declaration
......@@ -407,73 +408,85 @@ inline void ASN_DEBUG(const char *fmt, ...);
if (mandatory) DevAssert(ie != NULL); \
} while(0)
/** \brief Function callback prototype.
/** \brief Function array prototype.
**/
typedef int (*f1ap_message_decoded_callback)(
typedef int (*f1ap_message_processing_t)(
instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *message_p
);
int f1ap_handle_message(instance_t instance, uint32_t assoc_id, int32_t stream,
const uint8_t *const data, const uint32_t data_length);
typedef struct f1ap_cudu_ue_inst_s {
// used for eNB stats generation
rnti_t rnti;
module_id_t f1ap_uid;
module_id_t mac_uid;
module_id_t du_ue_f1ap_id;
module_id_t cu_ue_f1ap_id;
instance_t f1ap_uid;
instance_t du_ue_f1ap_id;
instance_t cu_ue_f1ap_id;
} f1ap_cudu_ue_t;
typedef struct f1ap_cudu_inst_s {
f1ap_setup_req_t setupReq;
uint16_t sctp_in_streams;
uint16_t sctp_out_streams;
uint16_t default_sctp_stream_id;
instance_t gtpInst;
uint64_t gNB_DU_id;
uint16_t num_ues;
f1ap_cudu_ue_t f1ap_ue[MAX_MOBILES_PER_ENB];
} f1ap_cudu_inst_t;
typedef enum {
DUtype=0,
CUtype
} F1_t;
uint8_t F1AP_get_next_transaction_identifier(module_id_t enb_mod_idP, module_id_t cu_mod_idP);
uint8_t F1AP_get_next_transaction_identifier(instance_t enb_mod_idP, instance_t cu_mod_idP);
f1ap_cudu_inst_t *getCxt(F1_t isCU, instance_t instanceP);
int f1ap_add_ue(f1ap_cudu_inst_t *f1_inst,
module_id_t module_idP,
int CC_idP,
int UE_id,
void createF1inst(F1_t isCU, instance_t instanceP, f1ap_setup_req_t *req);
int f1ap_add_ue(F1_t isCu,
instance_t instanceP,
rnti_t rntiP);
int f1ap_remove_ue(f1ap_cudu_inst_t *f1_inst,
int f1ap_remove_ue(F1_t isCu, instance_t instanceP,
rnti_t rntiP);
int f1ap_get_du_ue_f1ap_id (f1ap_cudu_inst_t *f1_inst,
int f1ap_get_du_ue_f1ap_id (F1_t isCu, instance_t instanceP,
rnti_t rntiP);
int f1ap_get_cu_ue_f1ap_id (f1ap_cudu_inst_t *f1_inst,
int f1ap_get_cu_ue_f1ap_id (F1_t isCu, instance_t instanceP,
rnti_t rntiP);
int f1ap_get_rnti_by_du_id(f1ap_cudu_inst_t *f1_inst,
module_id_t du_ue_f1ap_id );
int f1ap_get_rnti_by_du_id(F1_t isCu, instance_t instanceP,
instance_t du_ue_f1ap_id );
int f1ap_get_rnti_by_cu_id(f1ap_cudu_inst_t *f1_inst,
module_id_t cu_ue_f1ap_id );
int f1ap_get_rnti_by_cu_id(F1_t isCu, instance_t instanceP,
instance_t cu_ue_f1ap_id );
int f1ap_du_add_cu_ue_id(instance_t instanceP,
instance_t du_ue_f1ap_id,
instance_t cu_ue_f1ap_id);
int f1ap_get_du_uid(f1ap_cudu_inst_t *f1_inst,
module_id_t du_ue_f1ap_id );
int f1ap_assoc_id(F1_t isCu, instance_t instanceP);
int f1ap_get_cu_uid(f1ap_cudu_inst_t *f1_inst,
module_id_t cu_ue_f1ap_id );
static inline f1ap_setup_req_t *f1ap_req(F1_t isCu, instance_t instanceP) {
return &getCxt(isCu, instanceP)->setupReq;
}
int f1ap_get_uid_by_rnti(f1ap_cudu_inst_t *f1_inst,
rnti_t rntiP );
#define TASK_F1APP f1ap_req(false, instance)->cell_type==CELL_MACRO_GNB?TASK_GNB_APP:TASK_ENB_APP
int f1ap_du_add_cu_ue_id(f1ap_cudu_inst_t *f1_inst,
module_id_t du_ue_f1ap_id,
module_id_t cu_ue_f1ap_id);
int f1ap_cu_add_du_ue_id(f1ap_cudu_inst_t *f1_inst,
module_id_t cu_ue_f1ap_id,
module_id_t du_ue_f1ap_id);
//lts: C struct type is not homogeneous, so we need macros instead of functions
#define addnRCGI(nRCGi, servedCelL) \
MCC_MNC_TO_PLMNID((servedCelL)->mcc,(servedCelL)-> mnc,(servedCelL)->mnc_digit_length, \
&((nRCGi).pLMN_Identity)); \
NR_CELL_ID_TO_BIT_STRING((servedCelL)->nr_cellid, &((nRCGi).nRCellIdentity));
extern RAN_CONTEXT_t RC;
#endif /* F1AP_COMMON_H_ */
......@@ -72,39 +72,39 @@ int CU_send_F1_SETUP_FAILURE(instance_t instance);
* gNB-DU Configuration Update
*/
int CU_handle_gNB_DU_CONFIGURATION_UPDATE(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
int CU_send_gNB_DU_CONFIGURATION_FAILURE(instance_t instance,
F1AP_GNBDUConfigurationUpdateFailure_t *GNBDUConfigurationUpdateFailure);
F1AP_GNBDUConfigurationUpdateFailure_t *GNBDUConfigurationUpdateFailure);
int CU_send_gNB_DU_CONFIGURATION_UPDATE_ACKNOWLEDGE(instance_t instance,
F1AP_GNBDUConfigurationUpdateAcknowledge_t *GNBDUConfigurationUpdateAcknowledge);
F1AP_GNBDUConfigurationUpdateAcknowledge_t *GNBDUConfigurationUpdateAcknowledge);
/*
* gNB-CU Configuration Update
*/
int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, f1ap_gnb_cu_configuration_update_t *f1ap_gnb_cu_configuration_update);
int CU_handle_gNB_CU_CONFIGURATION_UPDATE_FAILURE(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
int CU_handle_gNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
/*
* gNB-DU Resource Coordination
*/
int CU_handle_gNB_DU_RESOURCE_COORDINATION_REQUEST(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
int CU_send_gNB_DU_RESOURCE_COORDINATION_RESPONSE(instance_t instance,
F1AP_GNBDUResourceCoordinationResponse_t *GNBDUResourceCoordinationResponse);
F1AP_GNBDUResourceCoordinationResponse_t *GNBDUResourceCoordinationResponse);
#endif /* F1AP_CU_INTERFACE_MANAGEMENT_H_ */
......@@ -34,9 +34,9 @@
#define F1AP_CU_RRC_MESSAGE_TRANSFER_H_
int CU_handle_INITIAL_UL_RRC_MESSAGE_TRANSFER(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
int CU_send_DL_RRC_MESSAGE_TRANSFER(instance_t instance,
f1ap_dl_rrc_message_t *f1ap_dl_rrc);
......
This diff is collapsed.
......@@ -22,11 +22,6 @@
#ifndef F1AP_CU_TASK_H_
#define F1AP_CU_TASK_H_
void cu_task_handle_sctp_association_ind(instance_t instance, sctp_new_association_ind_t *sctp_new_association_ind);
void cu_task_handle_sctp_association_resp(instance_t instance, sctp_new_association_resp_t *sctp_new_association_resp);
void cu_task_handle_sctp_data_ind(instance_t instance, sctp_data_ind_t *sctp_data_ind);
void cu_task_send_sctp_init_req(instance_t enb_id);
void *F1AP_CU_task(void *arg);
#endif /* F1AP_CU_TASK_H_ */
......@@ -37,7 +37,7 @@
* UE Context Setup
*/
int CU_send_UE_CONTEXT_SETUP_REQUEST(instance_t instance,
f1ap_ue_context_setup_req_t *f1ap_ue_context_setup_req);
f1ap_ue_context_setup_t *f1ap_ue_context_setup_req);
int CU_handle_UE_CONTEXT_SETUP_RESPONSE(instance_t instance,
uint32_t assoc_id,
......@@ -54,9 +54,9 @@ int CU_handle_UE_CONTEXT_SETUP_FAILURE(instance_t instance,
* UE Context Release Request (gNB-DU initiated)
*/
int CU_handle_UE_CONTEXT_RELEASE_REQUEST(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
/*
* UE Context Release (gNB-CU initiated)
......@@ -65,32 +65,32 @@ int CU_send_UE_CONTEXT_RELEASE_COMMAND(instance_t instance,
f1ap_ue_context_release_cmd_t *cmd);
int CU_handle_UE_CONTEXT_RELEASE_COMPLETE(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
/*
* UE Context Modification (gNB-CU initiated)
*/
int CU_send_UE_CONTEXT_MODIFICATION_REQUEST(instance_t instance);
int CU_handle_UE_CONTEXT_MODIFICATION_RESPONSE(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
int CU_handle_UE_CONTEXT_MODIFICATION_FAILURE(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
/*
* UE Context Modification Required (gNB-DU initiated)
*/
int CU_handle_UE_CONTEXT_MODIFICATION_REQUIRED(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
int CU_send_UE_CONTEXT_MODIFICATION_CONFIRM(instance_t instance,
F1AP_UEContextModificationConfirm_t UEContextModificationConfirm_t);
F1AP_UEContextModificationConfirm_t UEContextModificationConfirm_t);
/*
* UE Inactivity Notification
......
This diff is collapsed.
......@@ -76,43 +76,44 @@ int DU_handle_F1_SETUP_FAILURE(instance_t instance,
* gNB-DU Configuration Update
*/
int DU_send_gNB_DU_CONFIGURATION_UPDATE(instance_t instance,
instance_t du_mod_idP,
f1ap_setup_req_t *f1ap_du_data);
instance_t du_mod_idP,
f1ap_setup_req_t *f1ap_du_data);
int DU_handle_gNB_DU_CONFIGURATION_FAILURE(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
int DU_handle_gNB_DU_CONFIGURATION_UPDATE_ACKNOWLEDGE(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
/*
* gNB-CU Configuration Update
*/
int DU_handle_gNB_CU_CONFIGURATION_UPDATE(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
int DU_send_gNB_CU_CONFIGURATION_UPDATE_FAILURE(instance_t instance,
f1ap_gnb_cu_configuration_update_failure_t *GNBCUConfigurationUpdateFailure);
f1ap_gnb_cu_configuration_update_failure_t *GNBCUConfigurationUpdateFailure);
int DU_send_gNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(instance_t instance,
f1ap_gnb_cu_configuration_update_acknowledge_t *GNBCUConfigurationUpdateAcknowledge);
f1ap_gnb_cu_configuration_update_acknowledge_t *GNBCUConfigurationUpdateAcknowledge);
/*
* gNB-DU Resource Coordination
*/
int DU_send_gNB_DU_RESOURCE_COORDINATION_REQUEST(instance_t instance,
F1AP_GNBDUResourceCoordinationRequest_t *GNBDUResourceCoordinationRequest);
F1AP_GNBDUResourceCoordinationRequest_t *GNBDUResourceCoordinationRequest);
int DU_handle_gNB_DU_RESOURCE_COORDINATION_RESPONSE(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
#endif /* F1AP_DU_INTERFACE_MANAGEMENT_H_ */
......@@ -44,13 +44,13 @@ int DU_handle_DL_RRC_MESSAGE_TRANSFER(instance_t instance,
int DU_send_UL_RRC_MESSAGE_TRANSFER(instance_t instance, const f1ap_ul_rrc_message_t *msg);
int DU_send_UL_NR_RRC_MESSAGE_TRANSFER(instance_t instance, const f1ap_ul_rrc_message_t *msg);
int DU_send_INITIAL_UL_RRC_MESSAGE_TRANSFER(module_id_t module_idP,
int CC_idP,
int UE_id,
rnti_t rntiP,
const uint8_t *sduP,
sdu_size_t sdu_lenP,
const int8_t *sdu2P,
sdu_size_t sdu2_lenP);
int DU_send_INITIAL_UL_RRC_MESSAGE_TRANSFER(instance_t instanceP,
int CC_idP,
int UE_id,
rnti_t rntiP,
const uint8_t *sduP,
sdu_size_t sdu_lenP,
const char *sdu2P,
sdu_size_t sdu2_lenP);
#endif /* F1AP_DU_RRC_MESSAGE_TRANSFER_H_ */
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