From 3eafdff63a37cf56c22909ff631054b188fbaed9 Mon Sep 17 00:00:00 2001 From: Melissa <melissa@episci.com> Date: Thu, 30 Sep 2021 23:16:46 +0000 Subject: [PATCH] Syncing our OAI merge branch with our internal NSA master branch --- ci-scripts/Jenkinsfile-tmp-multi-enb-nsa | 20 +- ci-scripts/ran_dashboard.py | 2 +- doc/BUILD.md | 2 +- doc/FEATURE_SET.md | 198 +++++++++--- doc/TESTING_5GSA_setup.md | 264 +++++++++++----- executables/nr-softmodem.c | 46 ++- executables/nr-ue.c | 16 +- executables/nr-uesoftmodem.c | 11 +- executables/nr-uesoftmodem.h | 5 +- executables/softmodem-common.c | 12 +- nfapi/open-nFAPI/nfapi/src/nfapi_p7.c | 5 +- nfapi/open-nFAPI/pnf/src/pnf_p7.c | 5 +- nfapi/open-nFAPI/vnf/src/vnf_interface.c | 2 +- openair1/PHY/INIT/lte_init.c | 28 +- openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c | 11 +- openair1/PHY/NR_TRANSPORT/pucch_rx.c | 11 +- .../NR_UE_TRANSPORT/nr_transport_proto_ue.h | 2 +- .../PHY/NR_UE_TRANSPORT/nr_ue_rf_helpers.c | 18 +- openair1/PHY/defs_nr_UE.h | 4 + openair1/SCHED_NR/nr_prach_procedures.c | 2 - openair1/SCHED_NR/phy_procedures_nr_gNB.c | 14 +- openair1/SCHED_NR_UE/fapi_nr_ue_l1.c | 4 +- openair1/SCHED_NR_UE/phy_procedures_nr_ue.c | 2 +- .../SIMULATION/ETH_TRANSPORT/netlink_init.c | 8 +- openair2/COMMON/as_message.h | 2 +- openair2/GNB_APP/gnb_app.c | 4 +- openair2/LAYER2/NR_MAC_UE/nr_ra_procedures.c | 15 +- openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c | 6 +- openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c | 2 +- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c | 1 - openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c | 1 + .../LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 3 +- .../LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c | 5 +- .../LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 9 + openair2/LAYER2/PDCP_v10.1.0/pdcp.h | 4 +- openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c | 13 +- openair2/LAYER2/nr_pdcp/nr_pdcp_entity_srb.c | 9 +- openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c | 14 +- openair2/LAYER2/nr_rlc/nr_rlc_entity_am.c | 34 +-- openair2/LAYER2/nr_rlc/nr_rlc_entity_tm.c | 1 - openair2/LAYER2/nr_rlc/nr_rlc_entity_um.c | 38 +-- openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c | 6 +- openair2/LAYER2/nr_rlc/nr_rlc_pdu.c | 7 +- openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c | 12 +- openair2/RRC/LTE/MESSAGES/asn1_msg.c | 140 ++------- openair2/RRC/LTE/rrc_UE.c | 20 +- openair2/RRC/LTE/rrc_eNB.c | 7 +- openair2/RRC/LTE/rrc_proto.h | 1 + openair2/RRC/NR/MESSAGES/asn1_msg.c | 1 - openair2/RRC/NR/rrc_gNB_internode.c | 1 + openair2/RRC/NR/rrc_gNB_nsa.c | 4 +- openair2/RRC/NR_UE/rrc_UE.c | 45 +-- openair2/X2AP/x2ap_eNB_generate_messages.c | 2 +- openair3/NAS/UE/ESM/esm_ebr_context.c | 8 +- openair3/NAS/UE/nas_ue_task.c | 2 +- .../PROJECTS/GENERIC-NR-5GC/CONF/cu_gnb.conf | 283 +++--------------- .../PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf | 86 +++--- targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.conf | 8 + targets/RT/USER/lte-enb.c | 1 - 59 files changed, 662 insertions(+), 825 deletions(-) create mode 100644 targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.conf diff --git a/ci-scripts/Jenkinsfile-tmp-multi-enb-nsa b/ci-scripts/Jenkinsfile-tmp-multi-enb-nsa index 1e4933838b9..95aa4046d7e 100644 --- a/ci-scripts/Jenkinsfile-tmp-multi-enb-nsa +++ b/ci-scripts/Jenkinsfile-tmp-multi-enb-nsa @@ -24,6 +24,7 @@ // Location of the python executor node shall be in the same subnet as the others servers def pythonExecutor = params.pythonExecutor +def DataBaseHost = params.DataBaseHost // Location of the test XML file to be run def testXMLFile = params.pythonTestXmlFile @@ -45,10 +46,12 @@ def eNB_CommitID def eNB_AllowMergeRequestProcess def eNB_TargetBranch +//Status fed to the database +def StatusForDb = "" + + pipeline { - agent { - label pythonExecutor - } + agent {label pythonExecutor} options { disableConcurrentBuilds() ansiColor('xterm') @@ -270,9 +273,18 @@ pipeline { } } } + stage ("SQL Collect"){ + agent {label DataBaseHost} + steps { + script { + if (currentBuild.result=='FAILURE') {StatusForDb = 'FAIL'} else {StatusForDb = 'PASS'} + sh "python3 /home/oaicicd/mysql/sql_connect.py ${JOB_NAME} ${params.eNB_MR} ${params.eNB_Branch} ${env.BUILD_ID} ${env.BUILD_URL} ${StatusForDb} ''" + } + } + } } } - } + } post { always { diff --git a/ci-scripts/ran_dashboard.py b/ci-scripts/ran_dashboard.py index 4f18638e682..d9ce62b3b66 100644 --- a/ci-scripts/ran_dashboard.py +++ b/ci-scripts/ran_dashboard.py @@ -286,7 +286,7 @@ class gDashboard: def main(): - my_gDashboard=gDashboard("/home/oaicicd/remi/creds.json", 'OAI RAN Dashboard', 'MR Status') + my_gDashboard=gDashboard("/opt/dashboard/g_creds.json", 'OAI RAN Dashboard', 'MR Status') cmd="""curl --silent "https://gitlab.eurecom.fr/api/v4/projects/oai%2Fopenairinterface5g/merge_requests?state=opened&per_page=100" """ my_gDashboard.fetchData(cmd) my_gDashboard.gBuild("MR Status") diff --git a/doc/BUILD.md b/doc/BUILD.md index bbb06a1e698..166563877ef 100644 --- a/doc/BUILD.md +++ b/doc/BUILD.md @@ -77,7 +77,7 @@ cd cmake_targets/ ./build_oai -I -w USRP --eNB --UE --nrUE --gNB ``` -- The `-I` option is to install pre-requisites, you only need it the first time you build the softmodem or when some oai dependencies have changed. +- The `-I` option is to install pre-requisites, you only need it the first time you build the softmodem or when some oai dependencies have changed. Note: for Ubuntu 20 use cmake_targets/install_external_packages.ubuntu20 instead! - The `-w` option is to select the radio head support you want to include in your build. Radio head support is provided via a shared library, which is called the "oai device" The build script creates a soft link from `liboai_device.so` to the true device which will be used at run-time (here the USRP one,`liboai_usrpdevif.so` . USRP is the only hardware tested today in the Continuous Integration process. The RF simulator[RF simulator](../targets/ARCH/rfsimulator/README.md) is implemented as a specific device replacing RF hardware, it can be specifically built using `-w SIMU` option, but is also built during any softmodem build. - `--eNB` is to build the `lte-softmodem` executable and all required shared libraries - `--gNB` is to build the `nr-softmodem` executable and all required shared libraries diff --git a/doc/FEATURE_SET.md b/doc/FEATURE_SET.md index c2f38332039..4105d17511b 100644 --- a/doc/FEATURE_SET.md +++ b/doc/FEATURE_SET.md @@ -272,10 +272,10 @@ The following features are valid for the gNB and the 5G-NR UE. * 30KHz SCS for FR1 and 120 KHz SCS for FR2 * Generation of NR-PSS/NR-SSS * NR-PBCH supports multiple SSBs and flexible periodicity -* Generation of NR-PDCCH for SIB1 (including generation of DCI, polar encoding, scrambling, modulation, RB mapping, etc) - - common search space configured by MIB - - user-specific search space configured by RRC - - DCI formats: 00, 10 (01 and 11 **under integration**) +* Generation of NR-PDCCH (including generation of DCI, polar encoding, scrambling, modulation, RB mapping, etc) + - common search space + - user-specific search space + - DCI formats: 00, 10, 01 and 11 * Generation of NR-PDSCH (including Segmentation, LDPC encoding, rate matching, scrambling, modulation, RB mapping, etc). - PDSCH mapping type A and B - DMRS configuration type 1 and 2 @@ -292,8 +292,8 @@ The following features are valid for the gNB and the 5G-NR UE. - Support for 1 RX antenna - Support for 1 layer * NR-PUCCH - - Format 0 (2 bits, mainly for ACK/NACK) - - Format 2 (up to 64 bits, mainly for CSI feedback) + - Format 0 (2 bits, for ACK/NACK and SR) + - Format 2 (up to 11 bits, mainly for CSI feedback) * NR-PRACH - Formats 0,1,2,3, A1-A3, B1-B3 * Highly efficient 3GPP compliant LDPC encoder and decoder (BG1 and BG2 are supported) @@ -302,34 +302,103 @@ The following features are valid for the gNB and the 5G-NR UE. ## gNB Higher Layers ## -**gNB RRC** -- NR RRC (38.331) Rel 15 messages using new asn1c -- LTE RRC (36.331) also updated to Rel 15 -- Generation of CellGroupConfig (for eNB) and MIB -- Generation of system information block 1 (SIB1) -- Application to read configuration file and program gNB RRC -- RRC can configure PDCP, RLC, MAC - -**gNB X2AP** -- X2 setup with eNB -- Handling of SgNB Addition Request / Addition Request Acknowledge / Reconfiguration Complete - **gNB MAC** - MAC -> PHY configuration using NR FAPI P5 interface - MAC <-> PHY data interface using FAPI P7 interface for BCH PDU, DCI PDU, PDSCH PDU - Scheduler procedures for SIB1 - Scheduler procedures for RA + - Contention free RA procedure + - Contention based RA procedure - Scheduler procedures for CSI-RS -- MAC downlink scheduler (fixed allocations) +- MAC downlink scheduler + - phy-test scheduler (fixed allocation and usable also without UE) + - regular scheduler with dynamic allocation - MAC header generation (including timing advance) - ACK / NACK handling and HARQ procedures for downlink -- **As of May 2020** only DL was validated with COTS phone ; UL in progress, validated with OAI UE in noS1 mode +- MAC uplink scheduler + - phy-test scheduler (fixed allocation) + - regular scheduler with dynamic allocation + - HARQ procedures for uplink +- MAC procedures to handle CSI measurement report + - evalution of RSRP report + - evaluation of CQI report +- MAC scheduling of SR reception + +**gNB RLC** +- Send/Receive operations according to 38.322 Rel.16 + - Segmentation and reassembly procedures + - RLC Acknowledged mode supporting PDU retransmissions + - RLC Unacknowledged mode + - DRBs and SRBs establishment/handling and association with RLC entities + - Timers implementation + - Interfaces with PDCP, MAC + - Interfaces with gtp-u (data Tx/Rx over F1-U at the DU) + +**gNB PDCP** +- Send/Receive operations according to 38.323 Rel.16 + - Integrity protection and ciphering procedures + - Sequence number management, SDU dicard and in-order delivery + - Radio bearer establishment/handling and association with PDCP entities + - Interfaces with RRC, RLC + - Interfaces with gtp-u (data Tx/Rx over N3 and F1-U interfaces) + +**gNB RRC** +- NR RRC (38.331) Rel 16 messages using new asn1c +- LTE RRC (36.331) also updated to Rel 15 +- Generation of CellGroupConfig (for eNB) and MIB +- Generation of system information block 1 (SIB1) +- Generation of system information block 2 (SIB2) +- Application to read configuration file and program gNB RRC +- RRC can configure PDCP, RLC, MAC +- Interface with gtp-u (tunnel creation/handling for S1-U (NSA), N3 (SA) interfaces) +- Integration of RRC messages and procedures supporting UE 5G SA connection + - RRCSetupRequest/RRCSetup/RRCSetupComplete + - RRC Uplink/Downlink Information transfer carrying NAS messages transparently + - RRC Reconfiguration/Reconfiguration complete + - Support for master cell group configuration + - Interface with NGAP for the interactions with the AMF + - Interface with F1AP for CU/DU split deployment option + +**gNB X2AP** +- Integration of X2AP messages and procedures for the exchanges with the eNB over X2 interface supporting the NSA setup according to 36.423 Rel. 15 + - X2 setup with eNB + - Handling of SgNB Addition Request / Addition Request Acknowledge / Reconfiguration Complete + +**gNB NGAP** + +- Integration of NGAP messages and procedures for the exchanges with the AMF over N2 interface according to 38.413 Rel. 15 + - NGAP Setup request/response + - NGAP Initial UE message + - NGAP Initial context setup request/response + - NGAP Downlink/Uplink NAS transfer + - NGAP UE context release request/complete + - NGAP UE radio capability info indication + - NGAP PDU session resource setup request/response +- Interface with RRC + +**gNB F1AP** + +- Integration of F1AP messages and procedures for the control plane exchanges between the CU and DU entities according to 38.473 Rel. 16 + - F1 Setup request/response + - F1 DL/UL RRC message transfer + - F1 Initial UL RRC message transfer + - F1 UE Context setup request/response + - F1 gNB CU configuration update +- Interface with RRC +- Interface with gtp-u (tunnel creation/handling for F1-U interface) + +**gNB GTP-U** +- New gtp-u implementation supporting both N3 and F1-U interfaces according to 29.281 Rel.15 + - Interfaces with RRC, F1AP for tunnel creation + - Interfaces with PDCP and RLC for data send/receive at the CU and DU respectively (F1-U interface) # OpenAirInterface 5G-NR UE Feature Set # -**as of May 2020** only supporting "noS1" mode (DL): -- Creates TUN interface to PDCP to inject and receive user-place traffic -- Will only work with OAI gNB configured in the same mode +* Supporting "noS1" mode (DL and UL): + - Creates TUN interface to PDCP to inject and receive user-place traffic + - No connection to the core network +* Supporting Standalone (SA) mode: + - UE can register with the 5G Core Network, establish a PDU Session and exchange user-plane traffic ## NR UE PHY Layer ## @@ -339,10 +408,10 @@ The following features are valid for the gNB and the 5G-NR UE. * 30KHz SCS for FR1 and 120 KHz SCS for FR2 * Reception of NR-PSS/NR-SSS * NR-PBCH supports multiple SSBs and flexible periodicity -* Reception of NR-PDCCH for SIB1 (including reception of DCI, polar decoding, de-scrambling, de-modulation, RB de-mapping, etc) +* Reception of NR-PDCCH (including reception of DCI, polar decoding, de-scrambling, de-modulation, RB de-mapping, etc) - common search space configured by MIB - user-specific search space configured by RRC - - DCI formats: 00, 10 (01 and 11 **under integration**) + - DCI formats: 00, 10, 01 and 11 * Reception of NR-PDSCH (including Segmentation, LDPC decoding, rate de-matching, de-scrambling, de-modulation, RB de-mapping, etc). - PDSCH mapping type A and B - DMRS configuration type 1 and 2 @@ -358,29 +427,86 @@ The following features are valid for the gNB and the 5G-NR UE. - Support for 1 TX antenna - Support for 1 layer * NR-PUCCH - - Format 0 (2 bits, mainly for ACK/NACK) + - Format 0 (2 bits for ACK/NACK and SR) - Format 2 (up to 64 bits, mainly for CSI feedback) + - Format 1, 3 and 4 present but old code never dested (need restructuring before verification) * NR-PRACH - Formats 0,1,2,3, A1-A3, B1-B3 +* NR-SRS + - Old code never dested (need restructuring before verification) +* SS-RSRP + - RSRP measured on synchronization SSB (ok only for single SSB) * Highly efficient 3GPP compliant LDPC encoder and decoder (BG1 and BG2 are supported) * Highly efficient 3GPP compliant polar encoder and decoder * Encoder and decoder for short block +## NR UE FAPI ## + +* MAC -> PHY configuration via UE FAPI P5 interface +* Basic MAC to control PHY via UE FAPI P7 interface +* PHY -> MAC indication (needs some improvement) ## NR UE Higher Layers ## **UE MAC** * Minimum system information (MSI) - - Initial sync and MIB detection - - System information block 1 (SIB1) reception -* MAC -> PHY configuration of PHY via UE FAPI P5 interface -* Basic MAC to control PHY via UE FAPI P7 interface -* Random access procedure - - -**RLC** - -**PDCP** + - MIB processing + - Scheduling of system information block 1 (SIB1) reception +* Random access procedure (needs improvement, there is still not a clear separation between MAC and PHY) + - Mapping SSBs to multiple ROs + - Scheduling of PRACH + - Processing of RAR + - Transmission and re-transmission of Msg3 + - Msg4 and contention resolution +* DCI processing + - format 10 (RA-RNTI, C-RNTI, SI-RNTI, TC-RNTI) + - format 00 (C-RNTI, TC-RNTI) + - format 11 (C-RNTI) + - format 01 (C-RNTI) +* UCI processing + - ACK/NACK processing + - Triggering periodic SR + - CSI measurement reporting (SSB RSRP only) +* DLSH scheduler + - Configuration of fapi PDU according to DCI + - HARQ procedures +* ULSCH scheduler + - Configuration of fapi PDU according to DCI + + +**UE RLC** +* Tx/Rx operations according to 38.322 Rel.16 + - Segmentation and reassembly procedures + - RLC Acknowledged mode supporting PDU retransmissions + - RLC Unacknowledged mode + - DRBs and SRBs establishment and handling + - Timers implementation + - Interfaces with PDCP, MAC + +**UE PDCP** +* Tx/Rx operations according to 38.323 Rel.16 + - Integrity protection and ciphering procedures + - Sequence number management, SDU dicard and in-order delivery + - Radio bearer establishment/handling and association with PDCP entities + - Interfaces with RRC, RLC + +**UE RRC** +* Integration of RRC messages and procedures supporting UE 5G SA connection according to 38.331 Rel.16 + - RRCSetupRequest/RRCSetup/RRCSetupComplete + - RRC Uplink/Downlink Information transfer carrying NAS messages transparently + - RRC Reconfiguration/Reconfiguration complete + - Support for master cell group configuration +* Interface with PDCP: configuration, DCCH and CCCH message handling +* Interface with RLC and MAC for configuration + +**UE NAS** +* Transfer of NAS messages between the AMF and the UE supporting the UE registration with the core network and the PDU session establishment according to 24.501 Rel.16 + - Identity Request/Response + - Authentication Request/Response + - Security Mode Command/Complete + - Registration Request/Accept/Complete + - PDU Session Establishment Request/Accept + - NAS configuration and basic interfacing with RRC diff --git a/doc/TESTING_5GSA_setup.md b/doc/TESTING_5GSA_setup.md index 786af5e27cc..475123c9909 100644 --- a/doc/TESTING_5GSA_setup.md +++ b/doc/TESTING_5GSA_setup.md @@ -1,5 +1,27 @@ +<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">OAI 5G SA tutorial</font></b> + </td> + </tr> +</table> -# OAI 5G SA tutorial [Under construction] +**TABLE OF CONTENTS** + +1. [SA setup with COTS UE](#1--sa-setup-with-cots-ue) + 1. [gNB build and configuration](#11--gnb-build-and-configuration) + 2. [OAI 5G Core Network installation and configuration](#12--oai-5g-core-network-installation-and-configuration) + 3. [Execution of SA scenario](#13--execution-of-sa-scenario) +2. [SA Setup with OAI NR UE Softmodem](#2-sa-setup-with-oai-nr-ue-softmodem) + 1. [Build and configuration](#21-build-and-configuration) + 2. [OAI 5G Core Network installation and configuration](#22--oai-5g-core-network-installation-and-configuration) + 3. [Execution of SA scenario](#23-execution-of-sa-scenario) In the following tutorial we describe how to deploy configure and test the two SA OAI setups: @@ -12,10 +34,10 @@ The operating system and hardware requirements to support OAI 5G NR are describe At the moment of writing this document interoperability with the following COTS UE devices is being tested: - [Quectel RM500Q-GL](https://www.quectel.com/product/5g-rm500q-gl/) - - [Simcom SIMCOM8200EA](https://www.simcom.com/product/SIM8200G.html) + - [Simcom SIMCOM8200EA](https://www.simcom.com/product/SIM8200EA_M2.html) - Huawei Mate 30 Pro - End-to-end control plane signaling to achieve a 5G SA connection, UE registration and PDU session establishment with the CN, as well as some basic user-plane traffic tests have been validated so far using the Quectel module and Huawei Mate 30 pro and partially validated with SIMCOM module. In terms of interoperability with different 5G Core Networks, so far this setup has been tested with: + End-to-end control plane signaling to achieve a 5G SA connection, UE registration and PDU session establishment with the CN, as well as some basic user-plane traffic tests have been validated so far using SIMCOM/Quectel modules and Huawei Mate 30 pro. In terms of interoperability with different 5G Core Networks, so far this setup has been tested with: - [OAI CN](https://openairinterface.org/oai-5g-core-network-project/) @@ -23,20 +45,57 @@ At the moment of writing this document interoperability with the following COTS - [Free CN](https://www.free5gc.org/) - ## 1.1 gNB build and configuration -At the moment of writing this document, most of the code to support the SA setup is not merged into develop branch yet, but it is accessible through the following branches: - - - NR_SA_F1AP_5GRECORDS - - develop-NR_SA_F1AP_5GRECORDS (up-to-date with latest develop branch) +## 1.1 gNB build and configuration +To get the code and build the gNB executable: -To build the gNB executable: +### Ubuntu 18.04 ```bash - cd cmake_targets + git clone https://gitlab.eurecom.fr/oai/openairinterface5g.git + git checkout develop + cd openairinterface5g/ + source oaienv + cd cmake_targets/ ./build_oai -I -w USRP #For OAI first time installation only to install software dependencies ./build_oai --gNB -w USRP ``` -A reference configuration file for the gNB is provided [here](https://gitlab.eurecom.fr/oai/openairinterface5g/-/blob/develop-NR_SA_F1AP_5GRECORDS/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf). +### Ubuntu 20.04 +```bash + # Build UHD from source + # https://files.ettus.com/manual/page_build_guide.html + sudo apt-get install libboost-all-dev libusb-1.0-0-dev doxygen python3-docutils python3-mako python3-numpy python3-requests python3-ruamel.yaml python3-setuptools cmake build-essential + + git clone https://github.com/EttusResearch/uhd.git + cd uhd/host + mkdir build + cd build + cmake ../ + make -j 4 + make test # This step is optional + sudo make install + sudo ldconfig + sudo uhd_images_downloader + + + git clone https://gitlab.eurecom.fr/oai/openairinterface5g.git + git checkout develop + + # Install dependencies in Ubuntu 20.04 + cd + cd openairinterface5g/ + source oaienv + cd cmake_targets/ + ./install_external_packages.ubuntu20 + + # Build OAI gNB + cd + cd openairinterface5g/ + source oaienv + cd cmake_targets/ + ./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). 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. @@ -58,42 +117,69 @@ In the following, we highlight the fields of the file that have to be configured } ); }); -``` +``` Then, the source and destination IP interfaces for the communication with the Core Network also need to be set as shown below. ```bash - ////////// MME parameters: - amf_ip_address = ( { ipv4 = "192.168.70.132"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - NETWORK_INTERFACES : - { - GNB_INTERFACE_NAME_FOR_NG_AMF = "demo-oai"; - GNB_IPV4_ADDRESS_FOR_NG_AMF = "192.168.70.129/24"; - GNB_INTERFACE_NAME_FOR_NGU = "demo-oai"; - GNB_IPV4_ADDRESS_FOR_NGU = "192.168.70.129/24"; - GNB_PORT_FOR_S1U = 2152; # Spec 2152 - }; -``` + ////////// AMF parameters: + amf_ip_address = ( { ipv4 = "192.168.70.132"; + ipv6 = "192:168:30::17"; + active = "yes"; + preference = "ipv4"; + } + ); + + + NETWORK_INTERFACES : + { + GNB_INTERFACE_NAME_FOR_NG_AMF = "demo-oai"; + GNB_IPV4_ADDRESS_FOR_NG_AMF = "192.168.70.129/24"; + GNB_INTERFACE_NAME_FOR_NGU = "demo-oai"; + GNB_IPV4_ADDRESS_FOR_NGU = "192.168.70.129/24"; + GNB_PORT_FOR_S1U = 2152; # Spec 2152 + }; +``` In the first part (*amf_ip_address*) we specify the IP of the AMF and in the second part (*NETWORK_INTERFACES*) we specify the gNB local interface with AMF (N2 interface) and the UPF (N3 interface). +**CAUTION:** the `192.168.70.132` AMF IF address is the OAI-CN5G `AMF` Container IP address. You certainly will need to do some networking manipulations for the `gNB` server to be able to see this AMF container. + +Please read [CN5G tutorial for more details](https://gitlab.eurecom.fr/oai/cn5g/oai-cn5g-fed/-/blob/master/README.md). + ### **gNB configuration in CU/DU split mode** -For the configuration of the gNB in CU and DU blocks the following sample configuration files are provided for the CU and DU entities respectively. -...... -At the point of writing this document the control-plane exchanges between the CU and the DU over *F1-C* interface have been validated. The integration of *F1-U* over gtp-u for the support of data plane traffic is ongoing. +For the configuration of the gNB in CU and DU blocks, the following sample configuration files are provided for the [CU](https://gitlab.eurecom.fr/oai/openairinterface5g/-/blob/develop/targets/PROJECTS/GENERIC-NR-5GC/CONF/cu_gnb.conf) and the [DU](https://gitlab.eurecom.fr/oai/openairinterface5g/-/blob/develop/targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf) entities respectively. These configuration files have to be updated with the IP addresses of the CU and the DU over the F1 interface. For example, in the following section from the DU configuration file, *local_n_address* corresponds to the DU address and *remote_n_address* corresponds to the CU address: + +```bash +MACRLCs = ( + { + num_cc = 1; + tr_s_preference = "local_L1"; + tr_n_preference = "f1"; + local_n_if_name = "lo"; + local_n_address = "127.0.0.3"; + remote_n_address = "127.0.0.4"; + local_n_portc = 601; + local_n_portd = 2152; + remote_n_portc = 600; + remote_n_portd = 2152; + + } +); +``` + + +At the point of writing this document the control-plane exchanges between the CU and the DU over *F1-C* interface, as well as some IP traffic tests over *F1-U* have been validated using the OAI gNB/nrUE in RFSIMULATOR mode. + +*These extensions are not yet fully integrated into develop branch, as they are under merge request. Until they get fully integrated, the CU/DU functionalities can be tested in [NR_F1C_F1U_extensions](https://gitlab.eurecom.fr/oai/openairinterface5g/-/tree/NR_F1C_F1U_extensions) branch.* ## 1.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). Below are some complementary instructions which can be useful for the deployment. +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). - ## 1.3 Execution of SA scenario +## 1.3 Execution of SA scenario After having configured the gNB, we can start the individual components in the following sequence: - - Launch Core Network + - Launch 5G Core Network - Launch gNB - Launch COTS UE (disable airplane mode) @@ -101,62 +187,94 @@ The execution command to start the gNB (in monolithic mode) is the following: ```bash cd cmake_targets/ran_build/build sudo ./nr-softmodem -E --sa -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf -``` +``` -# 2. SA Setup with OAI UE -The SA setup with OAI UE has been validated with RFSIMULATOR for the moment. The control plane for the successful UE registration and PDU Session establishment has been verified with OAI and Nokia SA Box CNs. User-plane traffic validation after the establishment of the 5G connection is still pending for this setup. +# 2. SA Setup with OAI NR UE Softmodem +The SA setup with OAI UE has been validated with **RFSIMULATOR**. Both control plane and user plane for the successful UE registration and PDU Session establishment has been verified with OAI and Nokia SA Box CNs. + +In the following, we provide the instructions on how to build, configure and execute this SA setup. + +### 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*) +- USIM_API_K and OPc keys +- NSSAI (*Network Slice Assistance Information*) +- DNN (*Data Network Name*) + +Below is a sample configuration file that can be parsed through the execution command ([section 2.3](#23-execution-of-sa-scenario)). + +```bash +uicc0 = { +imsi = "208990000007487"; +key = "fec86ba6eb707ed08905757b1bb44b8f"; +opc= "C42449363BBAD02B66D16BC975D77CC1"; +dnn= "oai"; +nssai_sst=1; +nssai_sd=1; +} +``` + +Alternatively, the values can be hardcoded/edited in source file ***openair3/UICC/usim_interface.c*** through the following lines: +```bash +#define UICC_PARAMS_DESC {\ + {"imsi", "USIM IMSI\n", 0, strptr:&(uicc->imsiStr), defstrval:"2089900007487", TYPE_STRING, 0 },\ + {"nmc_size" "number of digits in NMC", 0, iptr:&(uicc->nmc_size), defintval:2, TYPE_INT, 0 },\ + {"key", "USIM Ki\n", 0, strptr:&(uicc->keyStr), defstrval:"fec86ba6eb707ed08905757b1bb44b8f", TYPE_STRING, 0 },\ + {"opc", "USIM OPc\n", 0, strptr:&(uicc->opcStr), defstrval:"c42449363bbad02b66d16bc975d77cc1", TYPE_STRING, 0 },\ + {"amf", "USIM amf\n", 0, strptr:&(uicc->amfStr), defstrval:"8000", TYPE_STRING, 0 },\ + {"sqn", "USIM sqn\n", 0, strptr:&(uicc->sqnStr), defstrval:"000000", TYPE_STRING, 0 },\ + {"dnn", "UE dnn (apn)\n", 0, strptr:&(uicc->dnnStr), defstrval:"oai", TYPE_STRING, 0 },\ + {"nssai_sst", "UE nssai\n", 0, iptr:&(uicc->nssai_sst), defintval:1, TYPE_INT, 0 }, \ + {"nssai_sd", "UE nssai\n", 0, iptr:&(uicc->nssai_sd), defintval:1, TYPE_INT, 0 }, \ + }; +``` + +For interoperability with OAI or other CNs, it should be ensured that the configuration of the aforementioned parameters match the configuration of the corresponding subscribed user at the core network. -In the following, we provide the instructions on how to build, configure and execute this SA setup. ## 2.1 Build and configuration To build the gNB and OAI UE executables: ```bash cd cmake_targets - ./build_oai -I #For OAI first time installation only to install software dependencies + # Note: For OAI first time installation please install software dependencies as described in 1.1. ./build_oai --gNB --nrUE -w SIMU ``` -The gNB configuration can be performed according to what is described in section 1.1, using the same reference configuration file as with the RF scenario. +The gNB configuration can be performed according to what is described in [section 1.1](#11--gnb-build-and-configuration), using the same reference configuration file as with the RF scenario. -### NAS configuration for the OAI UE -At the moment, the NAS configuration parameters of the OAI UE are hardcoded in ***openair3/NAS/NR_UE/nr_nas_msg_sim.c***. More specifically: +## 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). - - The SUCI (*Subscription Concealed Identifier*) corresponding to default IMSI 2089900007487 is hardcoded in functions *generateRegistrationRequest()* and *generateIdentityResponse()* through the following lines: -```bash - mm_msg->registration_request.fgsmobileidentity.suci.typeofidentity = FGS_MOBILE_IDENTITY_SUCI; - mm_msg->registration_request.fgsmobileidentity.suci.mncdigit1 = 9; - mm_msg->registration_request.fgsmobileidentity.suci.mncdigit2 = 9; - mm_msg->registration_request.fgsmobileidentity.suci.mncdigit3 = 0xf; - mm_msg->registration_request.fgsmobileidentity.suci.mccdigit1 = 2; - mm_msg->registration_request.fgsmobileidentity.suci.mccdigit2 = 0; - mm_msg->registration_request.fgsmobileidentity.suci.mccdigit3 = 8; - mm_msg->registration_request.fgsmobileidentity.suci.schemeoutput = 0x4778; -``` - - USIM_API_K and OPc keys are hardcoded at the beginning of the file: -```bash -// USIM_API_K: fe c8 6b a6 eb 70 7e d0 89 05 75 7b 1b b4 4b 8f -uint8_t k[16] = {0xfe, 0xc8, 0x6b, 0xa6, 0xeb, 0x70, 0x7e, 0xd0, 0x89, 0x05, 0x75, 0x7b, 0x1b, 0xb4, 0x4b, 0x8f}; -// OPC: c4 24 49 36 3b ba d0 2b 66 d1 6b c9 75 d7 7c c1 -const uint8_t opc[16] = {0xc4, 0x24, 0x49, 0x36, 0x3b, 0xba, 0xd0, 0x2b, 0x66, 0xd1, 0x6b, 0xc9, 0x75, 0xd7, 0x7c, 0xc1}; -``` -- The NSSAI (*Network Slice Assistance Information*) and DNN (*Data Network Name*) are hardcoded in function *generatePduSessionEstablishRequest()* -```bash - uint8_t nssai[]={1,0,0,1}; //Corresponding to SST:1, SD:1 - uint8_t dnn[4]={0x4,0x6f,0x61,0x69}; //Corresponding to dnn:"oai" -``` -For interoperability with OAI or other CNs, it should be ensured that the configuration of the aforementioned parameters match the configuration of the corresponding subscribed user at the core network. -Hardcoding of the USIM information will soon be substituted with parsing those parameters from a configuration file. +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 -## 2.2 Execution of SA scenario +The order of starting the different components should be the same as the one described in [section 1.3](#13--execution-of-sa-scenario). -The order of starting the different components should be the same as the one described in section 1.3. +the gNB can be launched in 2 modes: - - To launch the gNB: +- To launch the gNB in `monolithic` mode: ```bash - sudo RFSIMULATOR=server ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf --rfsim --sa + sudo RFSIMULATOR=server ./nr-softmodem --rfsim --sa \ + -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf ``` -- To launch the OAI UE: +- To launch the gNB in `CU/DU split` mode: + + 1. Launch the CU component: + ```bash + sudo RFSIMULATOR=server ./nr-softmodem --rfsim --sa \ + -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/cu_gnb.conf + ``` + 2. Launch the DU component: + ```bash + sudo RFSIMULATOR=server ./nr-softmodem --rfsim --sa \ + -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf + ``` + +- To launch the OAI UE (valid in `monolithic` gNB and `CU/DU split` gNB): ```bash -sudo RFSIMULATOR=127.0.0.1 ./nr-uesoftmodem -r 106 --numerology 1 --band 78 -C 3619200000 --rfsim --sa --nokrnmod +sudo RFSIMULATOR=127.0.0.1 ./nr-uesoftmodem -r 106 --numerology 1 --band 78 -C 3619200000 \ + --rfsim --sa --nokrnmod -O <PATH_TO_UE_CONF_FILE> ``` + The IP address at the execution command of the OAI UE corresponds to the target IP of the gNB host that the RFSIMULATOR at the UE will connect to. In the above example, we assume that the gNB and UE are running on the same host so the specified address (127.0.0.1) is the one of the loopback interface. diff --git a/executables/nr-softmodem.c b/executables/nr-softmodem.c index f0817a92133..3765b0f6648 100644 --- a/executables/nr-softmodem.c +++ b/executables/nr-softmodem.c @@ -612,7 +612,29 @@ static void wait_nfapi_init(char *thread_name) { } void init_pdcp(void) { - //if (!NODE_IS_DU(RC.nrrrc[0]->node_type)) { + if (!get_softmodem_params()->nsa) { + if (!NODE_IS_DU(RC.nrrrc[0]->node_type)) { + //pdcp_layer_init(); + uint32_t pdcp_initmask = (IS_SOFTMODEM_NOS1) ? + (PDCP_USE_NETLINK_BIT | LINK_ENB_PDCP_TO_IP_DRIVER_BIT) : LINK_ENB_PDCP_TO_GTPV1U_BIT; + + if (IS_SOFTMODEM_NOS1) { + printf("IS_SOFTMODEM_NOS1 option enabled \n"); + pdcp_initmask = pdcp_initmask | ENB_NAS_USE_TUN_BIT | SOFTMODEM_NOKRNMOD_BIT; + } + + nr_pdcp_module_init(pdcp_initmask, 0); + + 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); + } 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); + } + } + } else if (get_softmodem_params()->nsa) { pdcp_layer_init(); uint32_t pdcp_initmask = (IS_SOFTMODEM_NOS1) ? (PDCP_USE_NETLINK_BIT | LINK_ENB_PDCP_TO_IP_DRIVER_BIT) : LINK_ENB_PDCP_TO_GTPV1U_BIT; @@ -623,17 +645,12 @@ void init_pdcp(void) { } nr_pdcp_module_init(pdcp_initmask, 0); - - /*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); - } 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); - //} - /*} else { + } 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); - }*/ - + } } @@ -694,21 +711,20 @@ int main( int argc, char **argv ) { init_opt(); #ifdef PDCP_USE_NETLINK -if(!IS_SOFTMODEM_NOS1) - netlink_init(); + + if(!IS_SOFTMODEM_NOS1) { + netlink_init(); + init_pdcp(); + } #if defined(PDCP_USE_NETLINK_QUEUES) pdcp_netlink_init(); #endif #endif - #ifndef PACKAGE_VERSION # define PACKAGE_VERSION "UNKNOWN-EXPERIMENTAL" #endif LOG_I(HW, "Version: %s\n", PACKAGE_VERSION); - if(!IS_SOFTMODEM_NOS1) - init_pdcp(); - if (RC.nb_nr_L1_inst > 0) RCconfig_NR_L1(); diff --git a/executables/nr-ue.c b/executables/nr-ue.c index 3ae4f3c655e..2297f6bf250 100644 --- a/executables/nr-ue.c +++ b/executables/nr-ue.c @@ -27,8 +27,8 @@ #include "SCHED_NR_UE/phy_frame_config_nr.h" #include "SCHED_NR_UE/defs.h" #include "PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h" +#include "executables/softmodem-common.h" #include "LAYER2/nr_pdcp/nr_pdcp_entity.h" -//#include "executables/softmodem-common.h" #include "SCHED_NR_UE/pucch_uci_ue_nr.h" /* @@ -190,7 +190,7 @@ static void L1_nsa_prach_procedures(frame_t frame, int slot, fapi_nr_ul_config_p free(rach_ind->pdu_list); free(rach_ind); } - LOG_I(NR_MAC, "Melissa, We have successfully filled the rach_ind queue with the recently filled rach ind\n"); + LOG_D(NR_MAC, "We have successfully filled the rach_ind queue with the recently filled rach ind\n"); } static bool sfn_slot_matcher(void *wanted, void *candidate) @@ -286,7 +286,7 @@ static void *NRUE_phy_stub_standalone_pnf_task(void *arg) int slot = NFAPI_SFNSLOT2SLOT(sfn_slot); nr_uplink_indication_t ul_info; int slots_per_frame = 20; //30 kHZ subcarrier spacing - int slot_ahead = 2; // Melissa lets make this dynamic + int slot_ahead = 2; // TODO: Make this dynamic ul_info.cc_id = CC_id; ul_info.gNB_index = gNB_id; ul_info.module_id = mod_id; @@ -407,14 +407,6 @@ static void UE_synch(void *arg) { if (UE->UE_scan == 0) { - #ifdef FR2_TEST - // Overwrite DL frequency (for FR2 testing) - if (downlink_frequency[0][0]!=0){ - UE->frame_parms.dl_CarrierFreq = downlink_frequency[0][0]; - UE->frame_parms.ul_CarrierFreq = downlink_frequency[0][0]; - } - #endif - for (i=0; i<openair0_cfg[UE->rf_map.card].rx_num_channels; i++) { LOG_I( PHY, "[SCHED][UE] Check absolute frequency DL %f, UL %f (RF card %d, oai_exit %d, channel %d, rx_num_channels %d)\n", @@ -480,7 +472,7 @@ static void UE_synch(void *arg) { LOG_I(PHY, "[UE thread Synch] Running Initial Synch (mode %d)\n",UE->mode); uint64_t dl_carrier, ul_carrier; - nr_get_carrier_frequencies(&UE->frame_parms, &dl_carrier, &ul_carrier); + nr_get_carrier_frequencies(UE, &dl_carrier, &ul_carrier); if (nr_initial_sync(&syncD->proc, UE, 2, get_softmodem_params()->sa, get_nrUE_params()->nr_dlsch_parallel) == 0) { freq_offset = UE->common_vars.freq_offset; // frequency offset computed with pss in initial sync diff --git a/executables/nr-uesoftmodem.c b/executables/nr-uesoftmodem.c index 95c643a876e..611460e8790 100644 --- a/executables/nr-uesoftmodem.c +++ b/executables/nr-uesoftmodem.c @@ -376,7 +376,7 @@ void init_openair0(void) { openair0_cfg[card].rx_num_channels, duplex_mode[openair0_cfg[card].duplex_mode]); - nr_get_carrier_frequencies(frame_parms, &dl_carrier, &ul_carrier); + nr_get_carrier_frequencies(PHY_vars_UE_g[0][0], &dl_carrier, &ul_carrier); nr_rf_card_config_freq(&openair0_cfg[card], ul_carrier, dl_carrier, freq_off); nr_rf_card_config_gain(&openair0_cfg[card], rx_gain_off); @@ -433,7 +433,7 @@ int main( int argc, char **argv ) { get_options (); //Command-line options specific for NRUE - get_common_options(SOFTMODEM_5GUE_BIT ); + get_common_options(SOFTMODEM_5GUE_BIT); init_tpools(nrUE_params.nr_dlsch_parallel); CONFIG_CLEARRTFLAG(CONFIG_NOEXITONHELP); #if T_TRACER @@ -541,13 +541,6 @@ int main( int argc, char **argv ) { // wait for end of program printf("TYPE <CTRL-C> TO TERMINATE\n"); -#if 0 - if (create_tasks_nrue(1) < 0) { - printf("cannot create ITTI tasks\n"); - exit(-1); // need a softer mode - } -#endif - // Sleep a while before checking all parameters have been used // Some are used directly in external threads, asynchronously sleep(20); diff --git a/executables/nr-uesoftmodem.h b/executables/nr-uesoftmodem.h index 7ebc17e4fce..8e0af8e0023 100644 --- a/executables/nr-uesoftmodem.h +++ b/executables/nr-uesoftmodem.h @@ -7,7 +7,8 @@ - +#define CONFIG_HLP_IF_FREQ "IF frequency for RF, if needed" +#define CONFIG_HLP_IF_FREQ_OFF "UL IF frequency offset for RF, if needed" #define CONFIG_HLP_DLSCH_PARA "number of threads for dlsch processing 0 for no parallelization\n" #define CONFIG_HLP_OFFSET_DIV "Divisor for computing OFDM symbol offset in Rx chain (num samples in CP/<the value>). Default value is 8. To set the sample offset to 0, set this value ~ 10e6\n" /***************************************************************************************************************************************/ @@ -63,6 +64,8 @@ {"r" , CONFIG_HLP_PRB_SA, 0, iptr:&(fp->N_RB_DL), defintval:106, TYPE_UINT, 0}, \ {"s" , CONFIG_HLP_SSC, 0, u16ptr:&(fp->ssb_start_subcarrier), defintval:516, TYPE_UINT16,0}, \ {"T" , CONFIG_HLP_TDD, PARAMFLAG_BOOL, iptr:&tddflag, defintval:0, TYPE_INT, 0}, \ + {"if_freq" , CONFIG_HLP_IF_FREQ, 0, u64ptr:&(UE->if_freq), defuintval:0, TYPE_UINT64,0}, \ + {"if_freq_off" , CONFIG_HLP_IF_FREQ_OFF, 0, iptr:&(UE->if_freq_off), defuintval:0, TYPE_INT, 0}, \ {"do-prb-interpolation", CONFIG_HLP_PRBINTER, PARAMFLAG_BOOL, iptr:&(UE->prb_interpolation), defintval:0, TYPE_INT, 0}, \ {"ue-timing-correction-disable", CONFIG_HLP_DISABLETIMECORR, PARAMFLAG_BOOL, iptr:&(UE->no_timing_correction), defintval:0, TYPE_INT, 0}, \ } diff --git a/executables/softmodem-common.c b/executables/softmodem-common.c index d8d5427d5d6..318fd6b0085 100644 --- a/executables/softmodem-common.c +++ b/executables/softmodem-common.c @@ -209,10 +209,12 @@ void set_softmodem_sighandler(void) { act.sa_handler=signal_handler; sigaction(SOFTMODEM_RTSIGNAL,&act,&oldact); // Disabled in order generate a core dump for analysis with gdb - // printf("Send signal %d to display resource usage...\n",SIGRTMIN+1); - // signal(SIGSEGV, signal_handler); - // signal(SIGINT, signal_handler); - // signal(SIGTERM, signal_handler); - // signal(SIGABRT, signal_handler); + # if 0 + printf("Send signal %d to display resource usage...\n",SIGRTMIN+1); + signal(SIGSEGV, signal_handler); + signal(SIGINT, signal_handler); + signal(SIGTERM, signal_handler); + signal(SIGABRT, signal_handler); + #endif } diff --git a/nfapi/open-nFAPI/nfapi/src/nfapi_p7.c b/nfapi/open-nFAPI/nfapi/src/nfapi_p7.c index 919fc577a9d..eae45fbba50 100644 --- a/nfapi/open-nFAPI/nfapi/src/nfapi_p7.c +++ b/nfapi/open-nFAPI/nfapi/src/nfapi_p7.c @@ -3301,8 +3301,9 @@ static uint8_t pack_nr_uci_indication(void *msg, uint8_t **ppWritePackedMsg, uin for(int i=0; i<pNfapiMsg->num_ucis;i++) { - if(!pack_nr_uci_indication_body(pNfapiMsg->uci_list,ppWritePackedMsg,end)) - return 0; + if (!pack_nr_uci_indication_body(&pNfapiMsg->uci_list[i], ppWritePackedMsg, end)) + return 0; + } return 1; diff --git a/nfapi/open-nFAPI/pnf/src/pnf_p7.c b/nfapi/open-nFAPI/pnf/src/pnf_p7.c index 42e4e5e6ed0..fb1a713e565 100644 --- a/nfapi/open-nFAPI/pnf/src/pnf_p7.c +++ b/nfapi/open-nFAPI/pnf/src/pnf_p7.c @@ -3264,10 +3264,6 @@ int pnf_nr_p7_message_pump(pnf_p7_t* pnf_p7) struct timespec pselect_start; - struct timespec timeout; - timeout.tv_sec = 0; - timeout.tv_nsec = 500000; - struct timespec slot_duration; slot_duration.tv_sec = 0; slot_duration.tv_nsec = 0.5e6; @@ -3286,6 +3282,7 @@ int pnf_nr_p7_message_pump(pnf_p7_t* pnf_p7) struct timespec timeout; timeout.tv_sec = 100; timeout.tv_nsec = 0; + clock_gettime(CLOCK_MONOTONIC, &pselect_start); //setting the timeout diff --git a/nfapi/open-nFAPI/vnf/src/vnf_interface.c b/nfapi/open-nFAPI/vnf/src/vnf_interface.c index 41a357ab34c..633dd18f240 100644 --- a/nfapi/open-nFAPI/vnf/src/vnf_interface.c +++ b/nfapi/open-nFAPI/vnf/src/vnf_interface.c @@ -1154,7 +1154,7 @@ int nfapi_vnf_allocate_phy(nfapi_vnf_config_t* config, int p5_idx, uint16_t* phy info->timing_window = 30; // This seems to override what gets set by the user - why??? //TODO: Change in NR in terms of microsecends,what should be the value? info->timing_info_mode = 0x03; - info->timing_info_period = 10; // Melissa come back to this + info->timing_info_period = 10; nfapi_vnf_phy_info_list_add(config, info); diff --git a/openair1/PHY/INIT/lte_init.c b/openair1/PHY/INIT/lte_init.c index 21a1010cf9e..308a059d514 100644 --- a/openair1/PHY/INIT/lte_init.c +++ b/openair1/PHY/INIT/lte_init.c @@ -553,14 +553,12 @@ void phy_free_lte_eNB(PHY_VARS_eNB *eNB) { LTE_eNB_PRACH *const prach_vars_br = &eNB->prach_vars_br; int i, UE_id; - if (common_vars->txdataF) { - for (i = 0; i < NB_ANTENNA_PORTS_ENB; i++) { - if (i < fp->nb_antenna_ports_eNB || i == 5) { - free_and_zero(common_vars->txdataF[i]); - } + for (i = 0; i < NB_ANTENNA_PORTS_ENB; i++) { + if (i < fp->nb_antenna_ports_eNB || i == 5) { + free_and_zero(common_vars->txdataF[i]); + /* rxdataF[i] is not allocated -> don't free */ } } - /* rxdataF[i] is not allocated -> don't free */ free_and_zero(common_vars->txdataF); free_and_zero(common_vars->rxdataF); @@ -582,20 +580,14 @@ void phy_free_lte_eNB(PHY_VARS_eNB *eNB) { free_and_zero(prach_vars->prachF); - if (prach_vars->prach_ifft[0]) { - for (i = 0; i < 64; i++) { - free_and_zero(prach_vars->prach_ifft[0][i]); - } - free_and_zero(prach_vars->prach_ifft[0]); - } + for (i = 0; i < 64; i++) free_and_zero(prach_vars->prach_ifft[0][i]); + + free_and_zero(prach_vars->prach_ifft[0]); for (int ce_level = 0; ce_level < 4; ce_level++) { - if (prach_vars_br->prach_ifft[ce_level]) { - for (i = 0; i < 64; i++) { - free_and_zero(prach_vars_br->prach_ifft[ce_level][i]); - } - free_and_zero(prach_vars_br->prach_ifft[ce_level]); - } + for (i = 0; i < 64; i++) free_and_zero(prach_vars_br->prach_ifft[ce_level][i]); + + free_and_zero(prach_vars_br->prach_ifft[ce_level]); free_and_zero(prach_vars->rxsigF[ce_level]); } diff --git a/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c b/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c index b731dcda3cb..3aad4980bc8 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c +++ b/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c @@ -430,22 +430,20 @@ void nr_processULSegment(void* arg) { p_procTime); if (check_crc((uint8_t*)llrProcBuf,length_dec,ulsch_harq->F,crc_type)) { -// #ifdef PRINT_CRC_CHECK +#ifdef PRINT_CRC_CHECK LOG_I(PHY, "Segment %d CRC OK\n",r); -// #endif +#endif rdata->decodeIterations = no_iteration_ldpc; } else { -// #ifdef PRINT_CRC_CHECK +#ifdef PRINT_CRC_CHECK LOG_I(PHY, "CRC NOK\n"); -// #endif +#endif rdata->decodeIterations = max_ldpc_iterations + 1; } for (int m=0; m < Kr>>3; m ++) { ulsch_harq->c[r][m]= (uint8_t) llrProcBuf[m]; - //printf("%x ", ulsch_harq->c[r][m]); } - //printf("\n"); //stop_meas(&phy_vars_gNB->ulsch_ldpc_decoding_stats); } @@ -513,7 +511,6 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB, A = (harq_process->TBS)<<3; LOG_D(PHY,"ULSCH Decoding, harq_pid %d TBS %d G %d mcs %d Nl %d nb_rb %d, Qm %d, n_layers %d\n",harq_pid,A,G, mcs, n_layers, nb_rb, Qm, n_layers); - //printf("ULSCH in %d.%d \n", frame, nr_tti_rx); if (R<1024) Coderate = (float) R /(float) 1024; diff --git a/openair1/PHY/NR_TRANSPORT/pucch_rx.c b/openair1/PHY/NR_TRANSPORT/pucch_rx.c index bd5001628a3..3e0c16a07ed 100644 --- a/openair1/PHY/NR_TRANSPORT/pucch_rx.c +++ b/openair1/PHY/NR_TRANSPORT/pucch_rx.c @@ -169,15 +169,10 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB, int slot, nfapi_nr_uci_pucch_pdu_format_0_1_t* uci_pdu, nfapi_nr_pucch_pdu_t* pucch_pdu) { - printf("Inside nr_decode_pucch0. \n"); + int32_t **rxdataF = gNB->common_vars.rxdataF; NR_DL_FRAME_PARMS *frame_parms = &gNB->frame_parms; - //Gokul - // printf("rxdataf buff: \n"); - // for(int i = 1;i<=5*7*14*512;++i){ - // if(gNB->RU_list[0]->common.rxdataF[0][i] != 0) - // printf("%d ",gNB->RU_list[0]->common.rxdataF[0][i]); - // } + int nr_sequences; const uint8_t *mcs; @@ -1073,7 +1068,7 @@ void nr_decode_pucch2(PHY_VARS_gNB *gNB, int slot, nfapi_nr_uci_pucch_pdu_format_2_3_4_t* uci_pdu, nfapi_nr_pucch_pdu_t* pucch_pdu) { - printf("Inside nr_decode_pucch2. \n"); + int32_t **rxdataF = gNB->common_vars.rxdataF; NR_DL_FRAME_PARMS *frame_parms = &gNB->frame_parms; //pucch_GroupHopping_t pucch_GroupHopping = pucch_pdu->group_hop_flag + (pucch_pdu->sequence_hop_flag<<1); diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h b/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h index c277a8ffcc2..046ca927a6a 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h @@ -1466,7 +1466,7 @@ int nr_initial_sync(UE_nr_rxtx_proc_t *proc, @param dl_Carrier Pointer to DL carrier to be set @param ul_Carrier Pointer to UL carrier to be set */ -void nr_get_carrier_frequencies(NR_DL_FRAME_PARMS *fp, +void nr_get_carrier_frequencies(PHY_VARS_NR_UE *ue, uint64_t *dl_Carrier, uint64_t *ul_Carrier); diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_ue_rf_helpers.c b/openair1/PHY/NR_UE_TRANSPORT/nr_ue_rf_helpers.c index 29cccdcf881..6530dd9512c 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_ue_rf_helpers.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_ue_rf_helpers.c @@ -33,19 +33,17 @@ #include "nr_transport_proto_ue.h" #include "executables/softmodem-common.h" -void nr_get_carrier_frequencies(NR_DL_FRAME_PARMS *fp, uint64_t *dl_carrier, uint64_t *ul_carrier){ +void nr_get_carrier_frequencies(PHY_VARS_NR_UE *ue, uint64_t *dl_carrier, uint64_t *ul_carrier){ - if (get_softmodem_params()->phy_test==1 || get_softmodem_params()->do_ra==1 || !downlink_frequency[0][0]) { + NR_DL_FRAME_PARMS *fp = &ue->frame_parms; + if (ue->if_freq!=0) { + *dl_carrier = ue->if_freq; + *ul_carrier = *dl_carrier + ue->if_freq_off; + } + else{ *dl_carrier = fp->dl_CarrierFreq; - } else { - *dl_carrier = downlink_frequency[0][0]; + *ul_carrier = fp->ul_CarrierFreq; } - - if (uplink_frequency_offset[0][0]) - *ul_carrier = *dl_carrier + uplink_frequency_offset[0][0]; - else - *ul_carrier = *dl_carrier + fp->ul_CarrierFreq - fp->dl_CarrierFreq; - } diff --git a/openair1/PHY/defs_nr_UE.h b/openair1/PHY/defs_nr_UE.h index 33322bccb23..8ce18aa667d 100644 --- a/openair1/PHY/defs_nr_UE.h +++ b/openair1/PHY/defs_nr_UE.h @@ -767,6 +767,10 @@ typedef struct { int UE_scan_carrier; /// \brief Indicator that UE should enable estimation and compensation of frequency offset int UE_fo_compensation; + /// IF frequency for RF + uint64_t if_freq; + /// UL IF frequency offset for RF + int if_freq_off; /// \brief Indicator that UE is synchronized to a gNB int is_synchronized; /// \brief Indicator that UE lost frame synchronization diff --git a/openair1/SCHED_NR/nr_prach_procedures.c b/openair1/SCHED_NR/nr_prach_procedures.c index ced25e3772f..e1e35b3c637 100644 --- a/openair1/SCHED_NR/nr_prach_procedures.c +++ b/openair1/SCHED_NR/nr_prach_procedures.c @@ -51,8 +51,6 @@ extern uint8_t nfapi_mode; extern int oai_nfapi_nr_rach_ind(nfapi_rach_indication_t *rach_ind); -/* Melissa, this is what fills the rach ind. It gets filled here in - the gNB. This is then sent to the proxy. */ void L1_nr_prach_procedures(PHY_VARS_gNB *gNB,int frame,int slot) { uint16_t max_preamble[4]={0},max_preamble_energy[4]={0},max_preamble_delay[4]={0}; diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index 9f63a590356..325d659e67c 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -168,7 +168,7 @@ void phy_procedures_gNB_TX(PHY_VARS_gNB *gNB, gNB->Mod_id, frame, slot, gNB->ul_pdcch_pdu[ul_pdcch_pdu_id].pdcch_pdu.pdcch_pdu.pdcch_pdu_rel15.numDlDci, gNB->pdcch_pdu[pdcch_pdu_id].pdcch_pdu.pdcch_pdu_rel15.numDlDci); - + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_gNB_PDCCH_TX,1); nr_generate_dci_top(gNB, @@ -186,7 +186,7 @@ void phy_procedures_gNB_TX(PHY_VARS_gNB *gNB, if (pdcch_pdu_id >= 0) gNB->pdcch_pdu[pdcch_pdu_id].frame = -1; if (ul_pdcch_pdu_id >= 0) gNB->ul_pdcch_pdu[ul_pdcch_pdu_id].frame = -1; } - + for (int i=0; i<gNB->num_pdsch_rnti[slot]; i++) { VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_GENERATE_DLSCH,1); LOG_D(PHY, "PDSCH generation started (%d) in frame %d.%d\n", gNB->num_pdsch_rnti[slot],frame,slot); @@ -222,7 +222,7 @@ void phy_procedures_gNB_TX(PHY_VARS_gNB *gNB, /* - if ((cfg->subframe_config.duplex_mode.value == TDD) && + if ((cfg->subframe_config.duplex_mode.value == TDD) && ((nr_slot_select(fp,frame,slot)&NR_DOWNLINK_SLOT)==SF_DL)) return; // VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_RX,1); @@ -241,7 +241,7 @@ void nr_postDecode(PHY_VARS_gNB *gNB, notifiedFIFO_elt_t *req) { rdata->segment_r, ulsch_harq->processedSegments, rdata->nbSegments); gNB->nbDecode--; LOG_D(PHY,"remain to decoded in subframe: %d\n", gNB->nbDecode); - + if (decodeSuccess) { memcpy(ulsch_harq->b+rdata->offset, ulsch_harq->c[r], @@ -260,7 +260,7 @@ void nr_postDecode(PHY_VARS_gNB *gNB, notifiedFIFO_elt_t *req) { } } - // if all segments are done + // if all segments are done if (rdata->nbSegments == ulsch_harq->processedSegments) { if (decodeSuccess) { LOG_D(PHY,"[gNB %d] ULSCH: Setting ACK for slot %d TBS %d\n", @@ -296,7 +296,7 @@ void nr_ulsch_procedures(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, int ULSCH { NR_DL_FRAME_PARMS *frame_parms = &gNB->frame_parms; nfapi_nr_pusch_pdu_t *pusch_pdu = &gNB->ulsch[ULSCH_id][0]->harq_processes[harq_pid]->ulsch_pdu; - + uint8_t l, number_dmrs_symbols = 0; uint32_t G; uint16_t start_symbol, number_symbols, nb_re_dmrs; @@ -318,7 +318,7 @@ void nr_ulsch_procedures(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, int ULSCH number_dmrs_symbols, // number of dmrs symbols irrespective of single or double symbol dmrs pusch_pdu->qam_mod_order, pusch_pdu->nrOfLayers); - + AssertFatal(G>0,"G is 0 : rb_size %u, number_symbols %d, nb_re_dmrs %d, number_dmrs_symbols %d, qam_mod_order %u, nrOfLayer %u\n", pusch_pdu->rb_size, number_symbols, diff --git a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c index 954b9867dca..2111933216e 100644 --- a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c +++ b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c @@ -95,7 +95,7 @@ int8_t nr_ue_scheduled_response_stub(nr_scheduled_response_t *scheduled_response rx_ind->pdu_list[j].ul_cqi = scheduled_response->tx_request->tx_config.ul_cqi; char buffer[1024]; hexdump(rx_ind->pdu_list[j].pdu, rx_ind->pdu_list[j].pdu_length, buffer, sizeof(buffer)); - LOG_D(MAC, "Melissa Elkadi, this is hexdump of pdu %s before queuing rx_ind\n", + LOG_D(NR_MAC, "Hexdump of pdu %s before queuing rx_ind\n", buffer); } @@ -184,7 +184,7 @@ int8_t nr_ue_scheduled_response_stub(nr_scheduled_response_t *scheduled_response uci_ind->uci_list[j].pdu_size = sizeof(nfapi_nr_uci_pucch_pdu_format_0_1_t); pdu_0_1->pduBitmap = 2; // (value->pduBitmap >> 1) & 0x01) == HARQ and (value->pduBitmap) & 0x01) == SR pdu_0_1->handle = 0; - pdu_0_1->rnti = dl_config->dl_config_list[0].dlsch_config_pdu.rnti; + pdu_0_1->rnti = dl_config->dl_config_list[i].dlsch_config_pdu.rnti; pdu_0_1->pucch_format = 1; pdu_0_1->ul_cqi = 27; pdu_0_1->timing_advance = 0; diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index ff9fd3af6a7..4e47eb2865d 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -2177,7 +2177,7 @@ void nr_ue_prach_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, uint8_t ue->prach_vars[gNB_id]->amp); if (ue->mac_enabled == 1) - nr_Msg1_transmitted(mod_id, ue->CC_id, frame_tx, gNB_id); //Once rach is = 1, then call this + nr_Msg1_transmitted(mod_id, ue->CC_id, frame_tx, gNB_id); } else if (nr_prach == WAIT_CONTENTION_RESOLUTION) { LOG_D(PHY, "In %s: [UE %d] RA waiting contention resolution\n", __FUNCTION__, mod_id); diff --git a/openair1/SIMULATION/ETH_TRANSPORT/netlink_init.c b/openair1/SIMULATION/ETH_TRANSPORT/netlink_init.c index 150165203e0..953fb228853 100644 --- a/openair1/SIMULATION/ETH_TRANSPORT/netlink_init.c +++ b/openair1/SIMULATION/ETH_TRANSPORT/netlink_init.c @@ -99,11 +99,11 @@ int netlink_init_mbms_tun(char *ifprefix, int id) {//for UE, id = 1, 2, ..., int ret; char ifname[64]; - if ( id > 0 ){ - sprintf(ifname, "oaitun_%.3s%d",ifprefix, id-1); + if (id > 0) { + sprintf(ifname, "oaitun_%.3s%d", ifprefix, id-1); } - else{ - sprintf(ifname, "oaitun_%.3s1",ifprefix); // added "1": for historical reasons + else { + sprintf(ifname, "oaitun_%.3s1", ifprefix); // added "1": for historical reasons } nas_sock_mbms_fd = tun_alloc(ifname); diff --git a/openair2/COMMON/as_message.h b/openair2/COMMON/as_message.h index 630a021588d..b0ca06daec6 100644 --- a/openair2/COMMON/as_message.h +++ b/openair2/COMMON/as_message.h @@ -220,7 +220,7 @@ typedef struct kenb_refresh_req_s { } kenb_refresh_req_t; typedef struct nsa_oai_tun_nsa_s { - uint8_t buffer[500]; //Melissa TODO + uint8_t buffer[500]; } nas_oai_tun_nsa_t; /* diff --git a/openair2/GNB_APP/gnb_app.c b/openair2/GNB_APP/gnb_app.c index 5b1e1aab5be..49a415d9f04 100644 --- a/openair2/GNB_APP/gnb_app.c +++ b/openair2/GNB_APP/gnb_app.c @@ -206,8 +206,8 @@ void *gNB_app_task(void *args_p) configure_nr_rrc(gnb_id); } - if (RC.nb_nr_inst > 0) { - //init_pdcp(); + if (RC.nb_nr_inst > 0 && !get_softmodem_params()->nsa) { + init_pdcp(); } if (is_x2ap_enabled() ) { //&& !NODE_IS_DU(RC.rrc[0]->node_type) diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ra_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ra_procedures.c index 05e9b44f778..5a49f122fbf 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ra_procedures.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ra_procedures.c @@ -421,7 +421,6 @@ uint16_t set_ra_rnti(NR_UE_MAC_INST_t *mac, fapi_nr_ul_config_prach_pdu *prach_p uint8_t s_id = prach_pdu->prach_start_symbol; ra->ra_rnti = 1 + s_id + 14 * t_id + 1120 * f_id + 8960 * ul_carrier_id; - //gNB: ra_rnti = 1 + symbol + (slotP * 14) + (freq_index * 14 * 80) + (ul_carrier_id * 14 * 80 * 8); LOG_D(MAC, "Computed ra_RNTI is %x \n", ra->ra_rnti); @@ -543,7 +542,6 @@ uint8_t nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources, NR_UE_MAC_INST_t *mac = get_mac_inst(mod_id); RA_config_t *ra = &mac->ra; uint8_t mac_sdus[MAX_NR_ULSCH_PAYLOAD_BYTES]; - uint8_t lcid = UL_SCH_LCID_CCCH; uint8_t *payload; uint16_t size_sdu = 0; unsigned short post_padding; @@ -554,9 +552,7 @@ uint8_t nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources, NR_RACH_ConfigGeneric_t *rach_ConfigGeneric = &setup->rach_ConfigGeneric; NR_RACH_ConfigDedicated_t *rach_ConfigDedicated = ra->rach_ConfigDedicated; - uint8_t sdu_lcids[NB_RB_MAX] = {0}; uint16_t sdu_lengths[NB_RB_MAX] = {0}; - int num_sdus = 0; int offset = 0; int TBS_bytes = 848; int header_length_total=0; @@ -564,8 +560,8 @@ uint8_t nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources, // Delay init RA procedure to allow the convergence of the IIR filter on PRACH noise measurements at gNB side if (!prach_resources->init_msg1) { - if ( (mac->common_configuration_complete>0 || get_softmodem_params()->do_ra==1 || get_softmodem_params()->nsa) && - ((MAX_FRAME_NUMBER + frame - prach_resources->sync_frame) % MAX_FRAME_NUMBER) > 150){ + if ((mac->common_configuration_complete > 0 || get_softmodem_params()->do_ra || get_softmodem_params()->nsa) && + ((MAX_FRAME_NUMBER + frame - prach_resources->sync_frame) % MAX_FRAME_NUMBER) > 150) { prach_resources->init_msg1 = 1; } else { LOG_D(NR_MAC,"PRACH Condition not met: frame %d, prach_resources->sync_frame %d\n",frame,prach_resources->sync_frame); @@ -574,7 +570,7 @@ uint8_t nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources, } LOG_D(NR_MAC,"frame %d prach_resources->init_msg1 %d, ra->ra_state %d, ra->RA_active %d\n", - frame,prach_resources->init_msg1,ra->ra_state,ra->RA_active); + frame, prach_resources->init_msg1, ra->ra_state, ra->RA_active); if (prach_resources->init_msg1 && ra->ra_state != RA_SUCCEEDED) { @@ -586,9 +582,7 @@ uint8_t nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources, int TBS_max = 848; //8 + sizeof(NR_MAC_SUBHEADER_SHORT) + sizeof(NR_MAC_SUBHEADER_SHORT); payload = (uint8_t*) mac->CCCH_pdu.payload; mac_ce_len = 0; - num_sdus = 1; post_padding = 1; - sdu_lcids[0] = lcid; // initialisation by RRC @@ -605,8 +599,7 @@ uint8_t nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources, mac_sdus[i] = (unsigned char) (lrand48()&0xff); } //Sending SDUs with size 1 - //Initialize elements of sdu_lcids and sdu_lengths - sdu_lcids[0] = lcid; + //Initialize elements of sdu_lengths sdu_lengths[0] = TBS_bytes - 3 - post_padding - mac_ce_len; header_length_total += 2 + (sdu_lengths[0] >= 128); size_sdu += sdu_lengths[0]; diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c index ad2627e1bcd..7353c93f6a1 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c @@ -539,7 +539,7 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr else if (mac->scc_SIB) n_RB_DLBWP = NRRIV2BW(mac->scc_SIB->uplinkConfigCommon->initialUplinkBWP.genericParameters.locationAndBandwidth,MAX_BWP_SIZE); else n_RB_DLBWP = mac->type0_PDCCH_CSS_config.num_rbs; - LOG_I(MAC, "In %s: Processing received DCI format %s (DL BWP %d)\n", __FUNCTION__, dci_formats[dci_format], n_RB_DLBWP); + LOG_D(MAC, "In %s: Processing received DCI format %s (DL BWP %d)\n", __FUNCTION__, dci_formats[dci_format], n_RB_DLBWP); switch(dci_format){ case NR_UL_DCI_FORMAT_0_0: { @@ -3379,7 +3379,7 @@ void nr_ue_process_mac_pdu(nr_downlink_indication_t *dl_info, mac_subheader_len = 2; } - LOG_I(MAC, "Melissa Elkadi [UE %d] Frame %d : DLSCH -> DL-DTCH %d (gNB %d, %d bytes)\n", module_idP, frameP, rx_lcid, gNB_index, mac_sdu_len); + LOG_D(NR_MAC, "[UE %d] Frame %d : DLSCH -> DL-DTCH %d (gNB %d, %d bytes)\n", module_idP, frameP, rx_lcid, gNB_index, mac_sdu_len); #if defined(ENABLE_MAC_PAYLOAD_DEBUG) LOG_T(MAC, "[UE %d] First 32 bytes of DLSCH : \n", module_idP); @@ -3572,8 +3572,6 @@ int nr_ue_process_rar(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_t return 0; } - int cc_id = dl_info->cc_id; - uint8_t gNB_id = dl_info->gNB_index; NR_UE_MAC_INST_t *mac = get_mac_inst(mod_id); RA_config_t *ra = &mac->ra; uint8_t n_subPDUs = 0; // number of RAR payloads diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c index f44b1e48776..31874d479f1 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c @@ -1893,7 +1893,7 @@ void nr_ue_prach_scheduler(module_id_t module_idP, frame_t frameP, sub_frame_t s prach_config_pdu = &ul_config->ul_config_list[ul_config->number_pdus].prach_config_pdu; memset(prach_config_pdu, 0, sizeof(fapi_nr_ul_config_prach_pdu)); - ul_config->number_pdus += 1; //Melissa Elkadi come back here! + ul_config->number_pdus += 1; fill_ul_config(ul_config, frameP, slotP, FAPI_NR_UL_CONFIG_TYPE_PRACH); LOG_D(PHY, "In %s: (%p) %d UL PDUs:\n", __FUNCTION__, ul_config, ul_config->number_pdus); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c index 07c8b7b75aa..252144be3b7 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c @@ -356,7 +356,6 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP, const int bwp_id = 1; gNB_MAC_INST *gNB = RC.nrmac[module_idP]; - NR_COMMON_channels_t *cc = gNB->common_channels; NR_ServingCellConfigCommon_t *scc = cc->ServingCellConfigCommon; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c index d66c8df0195..7d123be41b9 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c @@ -288,6 +288,7 @@ void schedule_nr_prach(module_id_t module_idP, frame_t frameP, sub_frame_t slotP }else if (N_RA_slot <= 1) { //1 PRACH slot in a subframe slot_index = 0; } + UL_tti_req->SFN = frameP; UL_tti_req->Slot = slotP; for (int fdm_index=0; fdm_index < fdm; fdm_index++) { // one structure per frequency domain occasion diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 44cde6137a8..809ff39cd8c 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -135,7 +135,6 @@ void calculate_preferred_dl_tda(module_id_t module_id, const NR_BWP_Downlink_t * } } - // Compute and write all MAC CEs and subheaders, and return number of written // bytes int nr_write_ce_dlsch_pdu(module_id_t module_idP, @@ -883,7 +882,7 @@ void nr_schedule_ue_spec(module_id_t module_id, const int coresetid = bwp ? sched_ctrl->coreset->controlResourceSetId : gNB_mac->sched_ctrlCommon->coreset->controlResourceSetId; nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu = gNB_mac->pdcch_pdu_idx[CC_id][bwpid][coresetid]; if (!pdcch_pdu) { - LOG_I(NR_MAC, "creating pdcch pdu, pdcch_pdu = NULL. \n"); + LOG_D(NR_MAC, "creating pdcch pdu, pdcch_pdu = NULL. \n"); nfapi_nr_dl_tti_request_pdu_t *dl_tti_pdcch_pdu = &dl_req->dl_tti_pdu_list[dl_req->nPDUs]; memset(dl_tti_pdcch_pdu, 0, sizeof(nfapi_nr_dl_tti_request_pdu_t)); dl_tti_pdcch_pdu->PDUType = NFAPI_NR_DL_TTI_PDCCH_PDU_TYPE; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c index b56f57c0562..960ae4008b1 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c @@ -1086,8 +1086,8 @@ void handle_nr_uci_pucch_0_1(module_id_t mod_id, DevAssert(harq->is_waiting); const int8_t pid = sched_ctrl->feedback_dl_harq.head; remove_front_nr_list(&sched_ctrl->feedback_dl_harq); - /* Melissa: according to nfapi_nr_interface_scf.h, harq_value = 0 is a pass - (check below was for harq_value == 1 in develop branch) */ + /* According to nfapi_nr_interface_scf.h, harq_value = 0 is a pass + (The check below was for harq_value == 1 in the develop branch) */ handle_dl_harq(mod_id, UE_id, pid, harq_value == 0 && harq_confidence == 0); } } @@ -1273,7 +1273,6 @@ int nr_acknack_scheduling(int mod_id, * scheduled a lot and used all AckNacks, pucch->frame might have been * wrapped around to next frame */ if (frame != pucch->frame || pucch->ul_slot < first_ul_slot_tdd) { - AssertFatal(pucch->sr_flag + pucch->dai_c == 0, "expected no SR/AckNack for UE %d in %4d.%2d, but has %d/%d for %4d.%2d\n", UE_id, frame, slot, pucch->sr_flag, pucch->dai_c, pucch->frame, pucch->ul_slot); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index 378a7293971..4d33f7cdd81 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -812,6 +812,14 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP, if( (frameP!=ra->Msg3_frame) || (slotP!=ra->Msg3_slot)) continue; + // for CFRA (NSA) do not schedule retransmission of msg3 + if (ra->cfra) { + LOG_W(NR_MAC, "Random Access %i failed at state %i (NSA msg3 reception failed)\n", i, ra->state); + nr_mac_remove_ra_rnti(gnb_mod_idP, ra->rnti); + nr_clear_ra_proc(gnb_mod_idP, CC_idP, frameP, ra); + return; + } + if (ra->msg3_round >= MAX_HARQ_ROUNDS - 1) { LOG_W(NR_MAC, "Random Access %i failed at state %i (Reached msg3 max harq rounds)\n", i, ra->state); nr_mac_remove_ra_rnti(gnb_mod_idP, ra->rnti); @@ -1458,6 +1466,7 @@ void nr_schedule_ulsch(module_id_t module_id, frame_t frame, sub_frame_t slot) sched_ctrl->sched_ul_bytes, sched_ctrl->estimated_ul_buffer - sched_ctrl->sched_ul_bytes); + /* PUSCH in a later slot, but corresponding DCI now! */ nfapi_nr_ul_tti_request_t *future_ul_tti_req = &RC.nrmac[module_id]->UL_tti_req_ahead[0][sched_pusch->slot]; AssertFatal(future_ul_tti_req->SFN == sched_pusch->frame diff --git a/openair2/LAYER2/PDCP_v10.1.0/pdcp.h b/openair2/LAYER2/PDCP_v10.1.0/pdcp.h index eed4f04312e..46abbba7611 100644 --- a/openair2/LAYER2/PDCP_v10.1.0/pdcp.h +++ b/openair2/LAYER2/PDCP_v10.1.0/pdcp.h @@ -45,6 +45,7 @@ #include "LTE_MBMS-SessionInfoList-r9.h" #include "LTE_PMCH-InfoList-r9.h" + typedef rlc_op_status_t (*send_rlc_data_req_func_t)(const protocol_ctxt_t *const, const srb_flag_t, const MBMS_flag_t, const rb_id_t, const mui_t, @@ -91,9 +92,6 @@ extern int pdcp_instance_cnt; int init_pdcp_thread(void); void cleanup_pdcp_thread(void); -// Global variable to identify each UE. Updated in main() of lte-uesoftmodem.c -//extern uint16_t ue_id_g; - extern uint32_t Pdcp_stats_tx_window_ms[MAX_eNB][MAX_MOBILES_PER_ENB]; extern uint32_t Pdcp_stats_tx_bytes[MAX_eNB][MAX_MOBILES_PER_ENB][NB_RB_MAX]; extern uint32_t Pdcp_stats_tx_bytes_w[MAX_eNB][MAX_MOBILES_PER_ENB][NB_RB_MAX]; diff --git a/openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c b/openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c index 81d5c68f446..ed88dbcefe8 100644 --- a/openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c +++ b/openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c @@ -89,7 +89,7 @@ extern struct msghdr nas_msg_rx; extern int gtpv1u_new_data_req( uint8_t enb_module_idP, rnti_t ue_rntiP, uint8_t rab_idP, uint8_t *buffer_pP, uint32_t buf_lenP, uint32_t buf_offsetP); -uint16_t ue_id_g;// global variable to identify ue id for each ue. Change happens only in main function of lte-uesoftmodem.c +uint16_t ue_id_g; // Global variable to identify the ID for each UE. It is updated in main() of lte-uesoftmodem.c void debug_pdcp_pc5s_sdu(sidelink_pc5s_element *sl_pc5s_msg, char *title) { LOG_I(PDCP,"%s: \nPC5S message, header traffic_type: %d)\n", title, sl_pc5s_msg->pc5s_header.traffic_type); @@ -147,7 +147,7 @@ int pdcp_fifo_flush_sdus(const protocol_ctxt_t *const ctxt_pP) { nas_nlh_tx->nlmsg_len = sizeToWrite; ret = sendmsg(nas_sock_fd[0],&nas_msg_tx,0); } // PDCP_USE_NETLINK - + AssertFatal(ret >= 0,"[PDCP_FIFOS] pdcp_fifo_flush_sdus (errno: %d %s), nas_sock_fd[0]: %d\n", errno, strerror(errno), nas_sock_fd[0]); if( LOG_DEBUGFLAG(DEBUG_PDCP) ) @@ -562,8 +562,8 @@ int pdcp_fifo_read_input_sdus_fromnetlinksock (const protocol_ctxt_t *const ctx pdcp_read_header_g.data_size, (unsigned char *)NLMSG_DATA(nas_nlh_rx), PDCP_TRANSMISSION_MODE_DATA, - (NFAPI_MODE == NFAPI_UE_STUB_PNF || NFAPI_MODE == NFAPI_MODE_STANDALONE_PNF)?NULL:&pdcp_read_header_g.sourceL2Id, - (NFAPI_MODE == NFAPI_UE_STUB_PNF || NFAPI_MODE == NFAPI_MODE_STANDALONE_PNF)?NULL:&pdcp_read_header_g.destinationL2Id + (NFAPI_MODE == NFAPI_UE_STUB_PNF || NFAPI_MODE == NFAPI_MODE_STANDALONE_PNF) ? NULL : &pdcp_read_header_g.sourceL2Id, + (NFAPI_MODE == NFAPI_UE_STUB_PNF || NFAPI_MODE == NFAPI_MODE_STANDALONE_PNF) ? NULL : &pdcp_read_header_g.destinationL2Id ); } else { /* else of h_rc == HASH_TABLE_OK */ MSC_LOG_RX_DISCARDED_MESSAGE( @@ -607,8 +607,8 @@ int pdcp_fifo_read_input_sdus_fromnetlinksock (const protocol_ctxt_t *const ctx pdcp_read_header_g.data_size, (unsigned char *)NLMSG_DATA(nas_nlh_rx), PDCP_TRANSMISSION_MODE_DATA, - (NFAPI_MODE == NFAPI_UE_STUB_PNF|| NFAPI_MODE == NFAPI_MODE_STANDALONE_PNF) ? NULL :&pdcp_read_header_g.sourceL2Id, - (NFAPI_MODE == NFAPI_UE_STUB_PNF|| NFAPI_MODE == NFAPI_MODE_STANDALONE_PNF) ? NULL :&pdcp_read_header_g.destinationL2Id + (NFAPI_MODE == NFAPI_UE_STUB_PNF|| NFAPI_MODE == NFAPI_MODE_STANDALONE_PNF) ? NULL : &pdcp_read_header_g.sourceL2Id, + (NFAPI_MODE == NFAPI_UE_STUB_PNF|| NFAPI_MODE == NFAPI_MODE_STANDALONE_PNF) ? NULL : &pdcp_read_header_g.destinationL2Id ); } /* rab_id == 0 */ } /*pdcp_read_state_g != 0 */ @@ -875,3 +875,4 @@ pdcp_pc5_socket_init() { exit(1); } } + diff --git a/openair2/LAYER2/nr_pdcp/nr_pdcp_entity_srb.c b/openair2/LAYER2/nr_pdcp/nr_pdcp_entity_srb.c index 2ee819c819e..31862982a20 100644 --- a/openair2/LAYER2/nr_pdcp/nr_pdcp_entity_srb.c +++ b/openair2/LAYER2/nr_pdcp/nr_pdcp_entity_srb.c @@ -42,10 +42,7 @@ void nr_pdcp_entity_srb_recv_sdu(nr_pdcp_entity_t *_entity, char *buffer, int si nr_pdcp_entity_srb_t *entity = (nr_pdcp_entity_srb_t *)_entity; int sn; char buf[size+6]; - char buf_mel[1024]; - hexdump(buffer, size, buf_mel, sizeof(buf_mel)); - LOG_I(PDCP, "Melissa Elkadi in %s, this is hexdump of pdu %s recevied in PDCP layer directly\n", - __FUNCTION__, buf_mel); + sn = entity->common.next_nr_pdcp_tx_sn; entity->common.next_nr_pdcp_tx_sn++; @@ -65,10 +62,6 @@ void nr_pdcp_entity_srb_recv_sdu(nr_pdcp_entity_t *_entity, char *buffer, int si entity->common.deliver_pdu(entity->common.deliver_pdu_data, (nr_pdcp_entity_t *)entity, buf, size+6, sdu_id); - char buf_meli[1024]; - hexdump(buf, size + 3, buf_meli, sizeof(buf_meli)); - LOG_I(PDCP, "Melissa Elkadi in %s, this is hexdump of pdu %s After delivering to RLC\n", - __FUNCTION__, buf_meli); } void nr_pdcp_entity_srb_set_integrity_key(nr_pdcp_entity_t *_entity, char *key) diff --git a/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c b/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c index 6729aa6eeb1..decf40e9ed8 100644 --- a/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c +++ b/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c @@ -296,9 +296,6 @@ static void *ue_tun_read_thread(void *_) } LOG_D(PDCP, "%s(): nas_sock_fd read returns len %d\n", __func__, len); - char buffer[1024]; - hexdump(rx_buf, len, buffer, sizeof(buffer)); - LOG_I(MAC, "Melissa Elkadi, this is hexdump of pdu %s from tunnel interface\n", buffer); nr_pdcp_manager_lock(nr_pdcp_ue_manager); rnti = nr_pdcp_get_first_rnti(nr_pdcp_ue_manager); @@ -416,9 +413,6 @@ uint64_t nr_pdcp_module_init(uint64_t _pdcp_optmask, int id) nas_getparams(); if(UE_NAS_USE_TUN) { - /* Melissa TODO: Brute force changes made below to allow nr-UE to have unique tunnel interfaces. - When the NODE_NUMBER param is not used to determine functionality and LTE tunnel - interfaces, we should update the netlink_init_tun() and nas_config() calls below as well. */ int num_if = (NFAPI_MODE == NFAPI_UE_STUB_PNF || IS_SOFTMODEM_SIML1 || NFAPI_MODE == NFAPI_MODE_STANDALONE_PNF)? MAX_MOBILES_PER_ENB : 1; netlink_init_tun("nrue", num_if, id); //Add --nr-ip-over-lte option check for next line @@ -836,10 +830,9 @@ static void add_drb_am(int is_gnb, int rnti, struct NR_DRB_ToAddMod *s, nr_pdcp_manager_lock(nr_pdcp_ue_manager); ue = nr_pdcp_manager_get_ue(nr_pdcp_ue_manager, rnti); if (ue->drb[drb_id-1] != NULL) { - LOG_I(PDCP, "Melissa Elkadi %s:%d:%s: warning DRB %d already exist for ue %d, do nothing\n", + LOG_D(PDCP, "%s:%d:%s: warning DRB %d already exist for ue %d, do nothing\n", __FILE__, __LINE__, __FUNCTION__, drb_id, rnti); } else { - LOG_I(PDCP, "%s:%d:%s: Melissa Elkadi, we will call deliver_sdu_drb\n", __FILE__, __LINE__, __FUNCTION__); pdcp_drb = new_nr_pdcp_entity(NR_PDCP_DRB_AM, is_gnb, drb_id,pdusession_id,has_sdap, has_sdapULheader,has_sdapDLheader, deliver_sdu_drb, ue, deliver_pdu_drb, ue, @@ -1207,10 +1200,7 @@ static boolean_t pdcp_data_req_drb( nr_pdcp_manager_unlock(nr_pdcp_ue_manager); return 0; } - char buffer[1024]; - hexdump((char *)sdu_buffer, sdu_buffer_size, buffer, sizeof(buffer)); - LOG_I(PDCP, "Melissa Elkadi in %s, this is hexdump of pdu %s from tunnel interface in PDCP layer\n", - __FUNCTION__, buffer); + rb->recv_sdu(rb, (char *)sdu_buffer, sdu_buffer_size, muiP); nr_pdcp_manager_unlock(nr_pdcp_ue_manager); diff --git a/openair2/LAYER2/nr_rlc/nr_rlc_entity_am.c b/openair2/LAYER2/nr_rlc/nr_rlc_entity_am.c index c3a0856e561..8db5ce31adf 100644 --- a/openair2/LAYER2/nr_rlc/nr_rlc_entity_am.c +++ b/openair2/LAYER2/nr_rlc/nr_rlc_entity_am.c @@ -204,7 +204,6 @@ static void reassemble_and_deliver(nr_rlc_entity_am_t *entity, int sn) int so = 0; int bad_sdu = 0; - LOG_I(RLC, "Melissa Elkadi, we are in %s(): at %d\n", __FUNCTION__, __LINE__); /* go to first segment of sn */ pdu = entity->rx_list; while (pdu->sn != sn) @@ -232,7 +231,6 @@ static void reassemble_and_deliver(nr_rlc_entity_am_t *entity, int sn) return; /* deliver */ - LOG_I(RLC, "Melissa Elkadi, we are in %s(): at %d\n", __FUNCTION__, __LINE__); entity->common.deliver_sdu(entity->common.deliver_sdu_data, (nr_rlc_entity_t *)entity, sdu, so); @@ -246,16 +244,13 @@ static void reception_actions(nr_rlc_entity_am_t *entity, nr_rlc_pdu_t *pdu) entity->rx_next_highest = (x + 1) % entity->sn_modulus; /* todo: room for optimization: we can run through rx_list only once */ - LOG_I(RLC, "Melissa Elkadi, checking if sdu_full is true %s()\n", __FUNCTION__); if (sdu_full(entity, x)) { - LOG_I(RLC, "Melissa Elkadi, we are in %s(): at %d\n", __FUNCTION__, __LINE__); reassemble_and_deliver(entity, x); if (x == entity->rx_highest_status) { int rx_highest_status = entity->rx_highest_status; while (sdu_delivered(entity, rx_highest_status)) rx_highest_status = (rx_highest_status + 1) % entity->sn_modulus; - LOG_I(RLC, "Melissa Elkadi, we are in %s(): at %d\n", __FUNCTION__, __LINE__); entity->rx_highest_status = rx_highest_status; } @@ -278,10 +273,8 @@ static void reception_actions(nr_rlc_entity_am_t *entity, nr_rlc_pdu_t *pdu) entity->rx_next = rx_next; } } - LOG_I(RLC, "Melissa Elkadi, we are in %s(): at %d\n", __FUNCTION__, __LINE__); if (entity->t_reassembly_start) { - LOG_I(RLC, "Melissa Elkadi, we are in %s(): at %d\n", __FUNCTION__, __LINE__); if (entity->rx_next_status_trigger == entity->rx_next || (entity->rx_next_status_trigger == (entity->rx_next + 1) % entity->sn_modulus && @@ -294,7 +287,6 @@ static void reception_actions(nr_rlc_entity_am_t *entity, nr_rlc_pdu_t *pdu) } if (entity->t_reassembly_start == 0) { - LOG_I(RLC, "Melissa Elkadi, we are in %s(): at %d\n", __FUNCTION__, __LINE__); if (sn_compare_rx(entity, entity->rx_next_highest, (entity->rx_next + 1) % entity->sn_modulus) > 0 || (entity->rx_next_highest == (entity->rx_next + 1) @@ -552,13 +544,9 @@ void nr_rlc_entity_am_recv_pdu(nr_rlc_entity_t *_entity, int control_e2; int control_e3; unsigned char sn_set[32768]; /* used to dec retx_count only once per sdu */ - char buf_3[1024]; - hexdump(buffer, size, buf_3, sizeof(buf_3)); - LOG_I(MAC, "Melissa Elkadi, %s in %s():%d\n", - buf_3, __FUNCTION__, __LINE__); + nr_rlc_pdu_decoder_init(&decoder, buffer, size); dc = nr_rlc_pdu_decoder_get_bits(&decoder, 1); R(decoder); - LOG_I(RLC, "Melissa Elkadi, we are here %s(): %d. dc = %d\n", __FUNCTION__, __LINE__, dc); if (dc == 0) goto control; /* data PDU */ @@ -622,7 +610,6 @@ void nr_rlc_entity_am_recv_pdu(nr_rlc_entity_t *_entity, entity->rx_list, pdu); /* do reception actions (38.322 5.2.3.2.3) */ - LOG_I(RLC, "Melissa Elkadi, we are calling reception_actions from %s()\n", __FUNCTION__); reception_actions(entity, pdu); if (p) { @@ -831,20 +818,9 @@ static int serialize_sdu(nr_rlc_entity_am_t *entity, nr_rlc_pdu_encoder_put_bits(&encoder, 1, 1); /* D/C: 1 = data */ nr_rlc_pdu_encoder_put_bits(&encoder, 0, 1); /* P: reserve, set later */ - char buf_1[1024]; - hexdump(sdu->sdu->data, sdu->size, buf_1, sizeof(buf_1)); - LOG_I(MAC, "Melissa Elkadi, %s in %s():%d\n", - buf_1, __FUNCTION__, __LINE__); + nr_rlc_pdu_encoder_put_bits(&encoder, 1-sdu->is_first,1);/* 1st bit of SI */ - char buf_2[1024]; - hexdump(sdu->sdu->data, sdu->size, buf_2, sizeof(buf_2)); - LOG_I(MAC, "Melissa Elkadi, %s in %s():%d\n", - buf_2, __FUNCTION__, __LINE__); nr_rlc_pdu_encoder_put_bits(&encoder, 1-sdu->is_last,1); /* 2nd bit of SI */ - char buf_3[1024]; - hexdump(sdu->sdu->data, sdu->size, buf_3, sizeof(buf_3)); - LOG_I(MAC, "Melissa Elkadi, %s in %s():%d\n", - buf_3, __FUNCTION__, __LINE__); if (entity->sn_field_length == 18) nr_rlc_pdu_encoder_put_bits(&encoder, 0, 2); /* R */ @@ -860,10 +836,7 @@ static int serialize_sdu(nr_rlc_entity_am_t *entity, if (p) include_poll(entity, buffer); - char buf[1024]; - hexdump(buffer + encoder.byte, sdu->size, buf, sizeof(buf)); - LOG_I(MAC, "Melissa Elkadi, this is hexdump of pdu %s right after calling generate_pdu in %s\n", - buf, __FUNCTION__); + return encoder.byte + sdu->size; } @@ -1599,6 +1572,7 @@ int nr_rlc_entity_am_generate_pdu(nr_rlc_entity_t *_entity, if (ret != 0) return ret; } + return generate_tx_pdu(entity, buffer, size); } diff --git a/openair2/LAYER2/nr_rlc/nr_rlc_entity_tm.c b/openair2/LAYER2/nr_rlc/nr_rlc_entity_tm.c index 2e09452f14d..26ae4818891 100644 --- a/openair2/LAYER2/nr_rlc/nr_rlc_entity_tm.c +++ b/openair2/LAYER2/nr_rlc/nr_rlc_entity_tm.c @@ -104,7 +104,6 @@ int nr_rlc_entity_tm_generate_pdu(nr_rlc_entity_t *_entity, char *buffer, int size) { nr_rlc_entity_tm_t *entity = (nr_rlc_entity_tm_t *)_entity; - LOG_I(MAC, "Melissa Elkadi, in %s(): %d\n", __FUNCTION__, __LINE__); return generate_tx_pdu(entity, buffer, size); } diff --git a/openair2/LAYER2/nr_rlc/nr_rlc_entity_um.c b/openair2/LAYER2/nr_rlc/nr_rlc_entity_um.c index 07b2d7b9f3a..71173eee5af 100644 --- a/openair2/LAYER2/nr_rlc/nr_rlc_entity_um.c +++ b/openair2/LAYER2/nr_rlc/nr_rlc_entity_um.c @@ -353,20 +353,9 @@ static int serialize_sdu(nr_rlc_entity_um_t *entity, /* generate header */ nr_rlc_pdu_encoder_init(&encoder, buffer, bufsize); - char buf_1[1024]; - hexdump(sdu->sdu->data, sdu->size, buf_1, sizeof(buf_1)); - LOG_I(MAC, "Melissa Elkadi, %s in %s():%d\n", - buf_1, __FUNCTION__, __LINE__); nr_rlc_pdu_encoder_put_bits(&encoder, 1-sdu->is_first,1);/* 1st bit of SI */ - char buf_2[1024]; - hexdump(sdu->sdu->data, sdu->size, buf_2, sizeof(buf_2)); - LOG_I(MAC, "Melissa Elkadi, %s in %s():%d\n", - buf_2, __FUNCTION__, __LINE__); nr_rlc_pdu_encoder_put_bits(&encoder, 1-sdu->is_last,1); /* 2nd bit of SI */ - char buf_3[1024]; - hexdump(sdu->sdu->data, sdu->size, buf_3, sizeof(buf_3)); - LOG_I(MAC, "Melissa Elkadi, %s in %s():%d\n", - buf_3, __FUNCTION__, __LINE__); + /* SN, if required */ if (sdu->is_first == 1 && sdu->is_last == 1) { nr_rlc_pdu_encoder_put_bits(&encoder, 0, 6); /* R */ @@ -380,23 +369,9 @@ static int serialize_sdu(nr_rlc_entity_um_t *entity, if (!sdu->is_first) nr_rlc_pdu_encoder_put_bits(&encoder, sdu->so, 16); /* SO */ - char buf_sdu[1024]; - hexdump(sdu->sdu->data, sdu->size, buf_sdu, sizeof(buf_sdu)); - LOG_I(MAC, "Melissa Elkadi, this is hexdump of sdu->data %s in %s\n", - buf_sdu, __FUNCTION__); - /* data */ memcpy(buffer + encoder.byte, sdu->sdu->data + sdu->so, sdu->size); - char buf_5[1024]; - hexdump(buffer, sdu->size, buf_5, sizeof(buf_5)); - LOG_I(MAC, "Melissa Elkadi, this is hexdump of pdu %s right after memcpy of just buffer %s\n", - buf_5, __FUNCTION__); - - char buf[1024]; - hexdump(buffer + encoder.byte, sdu->size, buf, sizeof(buf)); - LOG_I(MAC, "Melissa Elkadi, this is hexdump of pdu %s right after memcpy sdu into buffer in %s\n", - buf, __FUNCTION__); return encoder.byte + sdu->size; } @@ -504,15 +479,9 @@ static int generate_tx_pdu(nr_rlc_entity_um_t *entity, char *buffer, int size) /* update tx_next if the SDU is an SDU segment and is the last */ if (!sdu->is_first && sdu->is_last) entity->tx_next = (entity->tx_next + 1) % entity->sn_modulus; - char buf[1024]; - hexdump(buffer, sdu->size, buf, sizeof(buf)); - LOG_I(MAC, "Melissa Elkadi, this is hexdump of pdu %s right before calling serialize_sdu in %s\n", - buf, __FUNCTION__); + ret = serialize_sdu(entity, sdu, buffer, size); - char buf_1[1024]; - hexdump(buffer, size, buf_1, sizeof(buf_1)); - LOG_I(MAC, "Melissa Elkadi, this is hexdump of pdu %s right after calling serialize_sdu in %s\n", - buf_1, __FUNCTION__); + entity->tx_size -= sdu->size; nr_rlc_free_sdu_segment(sdu); @@ -554,7 +523,6 @@ int nr_rlc_entity_um_generate_pdu(nr_rlc_entity_t *_entity, char *buffer, int size) { nr_rlc_entity_um_t *entity = (nr_rlc_entity_um_t *)_entity; - LOG_I(MAC, "Melissa Elkadi, in %s(): %d\n", __FUNCTION__, __LINE__); return generate_tx_pdu(entity, buffer, size); } diff --git a/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c b/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c index e87f2cb9211..6de81ff71ff 100644 --- a/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c +++ b/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c @@ -218,10 +218,6 @@ tbs_size_t mac_rlc_data_req( rb->set_time(rb, nr_rlc_current_time); maxsize = tb_sizeP; ret = rb->generate_pdu(rb, buffer_pP, maxsize); - char buffer[1024]; - hexdump(buffer_pP, ret, buffer, sizeof(buffer)); - LOG_I(MAC, "Melissa Elkadi, this is hexdump of pdu %s right after calling generate_pdu in %s\n", - buffer, __FUNCTION__); } else { ret = 0; } @@ -508,7 +504,7 @@ rb_found: return; } } - LOG_I(PDCP, "Melissa Elkadi we are calling PDCP layer from RLC in %s\n", __FUNCTION__); + LOG_D(PDCP, "Calling PDCP layer from RLC in %s\n", __FUNCTION__); if (!pdcp_data_ind(&ctx, is_srb, 0, rb_id, size, memblock)) { LOG_E(RLC, "%s:%d:%s: ERROR: pdcp_data_ind failed\n", __FILE__, __LINE__, __FUNCTION__); /* what to do in case of failure? for the moment: nothing */ diff --git a/openair2/LAYER2/nr_rlc/nr_rlc_pdu.c b/openair2/LAYER2/nr_rlc/nr_rlc_pdu.c index a5d2c90d5b6..b42410ab720 100644 --- a/openair2/LAYER2/nr_rlc/nr_rlc_pdu.c +++ b/openair2/LAYER2/nr_rlc/nr_rlc_pdu.c @@ -106,16 +106,11 @@ void nr_rlc_pdu_decoder_init(nr_rlc_pdu_decoder_t *decoder, static int get_bit(nr_rlc_pdu_decoder_t *decoder) { int ret; - LOG_I(RLC, "Melissa Elkadi, in %s():. bytes = %d size = %d, bit %d, shifted bit %d \n", - __FUNCTION__, decoder->byte, decoder->size, decoder->bit, (7-decoder->bit)); + if (decoder->byte >= decoder->size) { decoder->error = 1; return 0; } - LOG_I(RLC, "Melissa Elkadi, in %s():. (%d >> (7 - decoder->bit)) & 1 = %d (returned val) \n", - __FUNCTION__, - decoder->buffer[decoder->byte], - ((decoder->buffer[decoder->byte] >> (7 - decoder->bit)) & 1)); ret = (decoder->buffer[decoder->byte] >> (7 - decoder->bit)) & 1; diff --git a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c index 318efebfd70..c64ae2e4275 100644 --- a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c @@ -320,9 +320,9 @@ static void copy_tx_data_req_to_dl_info(nr_downlink_indication_t *dl_info, nfapi memcpy(pdu, ptr, pdu_list->TLVs[j].length); pdu += pdu_list->TLVs[j].length; } - dl_info->rx_ind->rx_indication_body[i].pdsch_pdu.ack_nack = 1; // Melissa we will come back during channel modelling + dl_info->rx_ind->rx_indication_body[i].pdsch_pdu.ack_nack = 1; dl_info->rx_ind->rx_indication_body[i].pdsch_pdu.pdu_length = length; - if (tx_data_request->Slot == 7 && mac->ra.ra_state <= WAIT_RAR) { //Melissa this means we have an RAR, sorta hacky though + if (tx_data_request->Slot == 7 && mac->ra.ra_state <= WAIT_RAR) { dl_info->rx_ind->rx_indication_body[i].pdu_type = FAPI_NR_RX_PDU_TYPE_RAR; } else { @@ -539,7 +539,7 @@ static void check_and_process_dci(nfapi_nr_dl_tti_request_t *dl_tti_request, nr_uplink_indication_t ul_info; memset(&ul_info, 0, sizeof(ul_info)); int slots_per_frame = 20; //30 kHZ subcarrier spacing - int slot_ahead = 2; // Melissa lets make this dynamic + int slot_ahead = 2; // TODO: Make this dynamic ul_info.frame_rx = frame; ul_info.slot_rx = slot; ul_info.slot_tx = (slot + slot_ahead) % slots_per_frame; @@ -551,7 +551,7 @@ static void check_and_process_dci(nfapi_nr_dl_tti_request_t *dl_tti_request, } - #if 0 //Melissa may want to free this + #if 0 // TODO: Heap use after free caught by sanitizer free(dl_info.dci_ind); dl_info.dci_ind = NULL; @@ -884,7 +884,7 @@ int nr_ue_dl_indication(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_ NR_UE_MAC_INST_t *mac = get_mac_inst(module_id); fapi_nr_dl_config_request_t *dl_config = &mac->dl_config_request; - if ((!dl_info->dci_ind && !dl_info->rx_ind)) { //Melissa review this with Raymond|| !def_dci_pdu_rel15 + if ((!dl_info->dci_ind && !dl_info->rx_ind)) { // UL indication to schedule DCI reception nr_ue_scheduler(dl_info, NULL); } else { @@ -980,7 +980,7 @@ nr_ue_if_module_t *nr_ue_if_module_init(uint32_t module_id){ nr_ue_if_module_inst[module_id]->current_frame = 0; nr_ue_if_module_inst[module_id]->current_slot = 0; nr_ue_if_module_inst[module_id]->phy_config_request = nr_ue_phy_config_request; - if (get_softmodem_params()->nsa) //Melissa, this is also a hack. Get a better flag. + if (get_softmodem_params()->nsa) //TODO: Get a better flag for using stub nr_ue_if_module_inst[module_id]->scheduled_response = nr_ue_scheduled_response_stub; else nr_ue_if_module_inst[module_id]->scheduled_response = nr_ue_scheduled_response; diff --git a/openair2/RRC/LTE/MESSAGES/asn1_msg.c b/openair2/RRC/LTE/MESSAGES/asn1_msg.c index 33d76770aab..b1f2e6d9b3c 100644 --- a/openair2/RRC/LTE/MESSAGES/asn1_msg.c +++ b/openair2/RRC/LTE/MESSAGES/asn1_msg.c @@ -2380,7 +2380,6 @@ uint8_t do_RRCConnectionSetupComplete(uint8_t Mod_id, uint8_t *buffer, const uin static void assign_scg_ConfigResponseNR_r15(LTE_RRCConnectionReconfigurationComplete_t *rrc, OCTET_STRING_t *str) { - /* Melissa TODO: Need to free this memory when we are done. */ LTE_RRCConnectionReconfigurationComplete_r8_IEs_t *rrc_r8 = &rrc->criticalExtensions.choice. rrcConnectionReconfigurationComplete_r8; typeof(rrc_r8->nonCriticalExtension) nce1; @@ -2444,7 +2443,7 @@ do_RRCConnectionReconfigurationComplete( buffer_size); AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %lu)!\n", enc_rval.failed_type->name, enc_rval.encoded); - LOG_I(RRC,"RRCConnectionReconfigurationComplete Encoded %zd bits (%zd bytes)\n",enc_rval.encoded,(enc_rval.encoded+7)/8); + LOG_D(RRC,"RRCConnectionReconfigurationComplete Encoded %zd bits (%zd bytes)\n",enc_rval.encoded,(enc_rval.encoded+7)/8); return((enc_rval.encoded+7)/8); } @@ -4259,6 +4258,13 @@ uint8_t do_MeasurementReport(uint8_t Mod_id, uint8_t *buffer, size_t buffer_size return((enc_rval.encoded+7)/8); } +#define asn1cCallocOne(VaR, VaLue) \ + VaR = calloc(1,sizeof(*VaR)); *VaR=VaLue; +#define asn1cCalloc(VaR, lOcPtr) \ + typeof(VaR) lOcPtr = VaR = calloc(1,sizeof(*VaR)); +#define asn1cSequenceAdd(VaR, TyPe, lOcPtr) \ + TyPe *lOcPtr= calloc(1,sizeof(TyPe)); \ + ASN_SEQUENCE_ADD(&VaR,lOcPtr); ssize_t do_nrMeasurementReport(uint8_t *buffer, size_t bufsize, @@ -4269,8 +4275,7 @@ ssize_t do_nrMeasurementReport(uint8_t *buffer, long rsrp_tar, long rsrq_tar) { - LTE_UL_DCCH_Message_t ul_dcch_msg; - memset(&ul_dcch_msg, 0, sizeof(ul_dcch_msg)); + LTE_UL_DCCH_Message_t ul_dcch_msg={0}; ul_dcch_msg.message.present = LTE_UL_DCCH_MessageType_PR_c1; ul_dcch_msg.message.choice.c1.present = LTE_UL_DCCH_MessageType__c1_PR_measurementReport; @@ -4282,98 +4287,20 @@ ssize_t do_nrMeasurementReport(uint8_t *buffer, measurementReport->criticalExtensions.choice.c1.choice.measurementReport_r8.measResults.measId = measid; measurementReport->criticalExtensions.choice.c1.choice.measurementReport_r8.measResults.measResultPCell.rsrpResult = rsrp_s; measurementReport->criticalExtensions.choice.c1.choice.measurementReport_r8.measResults.measResultPCell.rsrqResult = rsrq_s; - measurementReport->criticalExtensions.choice.c1.choice.measurementReport_r8.measResults.measResultNeighCells = - calloc(1, sizeof(*measurementReport->criticalExtensions.choice.c1.choice.measurementReport_r8.measResults.measResultNeighCells)); - measurementReport->criticalExtensions.choice.c1.choice.measurementReport_r8.measResults.measResultNeighCells->present = - LTE_MeasResults__measResultNeighCells_PR_measResultNeighCellListNR_r15; - LTE_MeasResultListEUTRA_t *measResultListEUTRA2; - measResultListEUTRA2 = CALLOC(1, sizeof(*measResultListEUTRA2)); - struct LTE_MeasResultEUTRA *measresulteutra_list; - measresulteutra_list = CALLOC(1, sizeof(*measresulteutra_list)); + asn1cCalloc(measurementReport->criticalExtensions.choice.c1.choice.measurementReport_r8.measResults.measResultNeighCells, + measResultNeighCells); + measResultNeighCells->present = LTE_MeasResults__measResultNeighCells_PR_measResultNeighCellListNR_r15; + LTE_MeasResultListEUTRA_t *measResultListEUTRA2=&measResultNeighCells->choice.measResultListEUTRA; + asn1cSequenceAdd(measResultListEUTRA2->list, struct LTE_MeasResultEUTRA, measresulteutra_list); measresulteutra_list->physCellId = phy_id; - //struct LTE_MeasResultEUTRA *eutra_array; - //eutra_array = CALLOC(1, sizeof(*eutra_array)); - struct LTE_MeasResultEUTRA__cgi_Info *measresult_cgi2; - measresult_cgi2 = CALLOC(1, sizeof(*measresult_cgi2)); - memset(&measresult_cgi2->cellGlobalId, 0, sizeof(measresult_cgi2->cellGlobalId)); - memset(&measresult_cgi2->trackingAreaCode, 0, sizeof(measresult_cgi2->trackingAreaCode)); - struct LTE_PLMN_IdentityList2 *plmn_id_list; - plmn_id_list = CALLOC(1, sizeof(*plmn_id_list)); - struct LTE_MeasResultEUTRA__measResult measResult; - //measResult = CALLOC(1, sizeof(*measResult)); - //measResult->rsrpResult = CALLOC(1, sizeof(*measResult->rsrpResult)); - measResult.rsrpResult = &rsrp_tar; - //measResult->rsrqResult = CALLOC(1, sizeof(*measResult->rsrqResult)); - measResult.rsrqResult = &rsrq_tar; - measResult.ext1 = NULL; - //struct LTE_MeasResultEUTRA__measResult__ext1 *measResult_ext; - //measResult_ext = CALLOC(1, sizeof(*measResult_ext)); - measresulteutra_list->measResult = measResult; - measresulteutra_list->cgi_Info = measresult_cgi2; - ASN_SEQUENCE_ADD(&measResultListEUTRA2->list, measresulteutra_list); - measurementReport->criticalExtensions.choice.c1.choice.measurementReport_r8.measResults.measResultNeighCells->choice.measResultListEUTRA=*(measResultListEUTRA2); - - #if 0 //Melissa: This was a hack. Incomplete filling of ul_dcch_msg is done above - measurementReport->criticalExtensions.choice.c1.choice.measurementReport_r8.measResults.measResultNeighCells->choice.measResultListEUTRA.list.array = - calloc(1, sizeof(*measurementReport->criticalExtensions.choice.c1.choice.measurementReport_r8.measResults.measResultNeighCells->choice.measResultListEUTRA.list.array)); - measurementReport->criticalExtensions.choice.c1.choice.measurementReport_r8.measResults.measResultNeighCells->choice.measResultListEUTRA.list.array[0] = - calloc(1, sizeof(*measurementReport->criticalExtensions.choice.c1.choice.measurementReport_r8.measResults.measResultNeighCells->choice.measResultListEUTRA.list.array[0])); - measurementReport->criticalExtensions.choice.c1.choice.measurementReport_r8.measResults.measResultNeighCells->choice.measResultListEUTRA.list.array[0]->measResult.rsrpResult = - calloc(1, sizeof(*measurementReport->criticalExtensions.choice.c1.choice.measurementReport_r8.measResults.measResultNeighCells->choice.measResultListEUTRA.list.array[0]->measResult.rsrpResult)); - measurementReport->criticalExtensions.choice.c1.choice.measurementReport_r8.measResults.measResultNeighCells->choice.measResultListEUTRA.list.array[0]->measResult.rsrqResult = - calloc(1, sizeof(*measurementReport->criticalExtensions.choice.c1.choice.measurementReport_r8.measResults.measResultNeighCells->choice.measResultListEUTRA.list.array[0]->measResult.rsrqResult)); - if (measurementReport->criticalExtensions.choice.c1.choice.measurementReport_r8.measResults.measResultNeighCells == NULL) - LOG_E(MAC, "Melissa, the calloc failed on neighcells.....!!\n"); - LTE_MeasResults_t *mr_r8 = &measurementReport->criticalExtensions.choice.c1.choice.measurementReport_r8.measResults; - mr_r8->measId = measid; - mr_r8->measResultPCell.rsrpResult = rsrp_s; - mr_r8->measResultPCell.rsrqResult = rsrq_s; - mr_r8->measResultNeighCells = CALLOC(1, sizeof(*mr_r8->measResultNeighCells)); - mr_r8->measResultNeighCells->present = LTE_MeasResults__measResultNeighCells_PR_measResultNeighCellListNR_r15; - mr_r8->measResultNeighCells->choice.measResultNeighCellListNR_r15.list.count = 1; - - mr_r8->measResultNeighCells->choice.measResultNeighCellListNR_r15.list.array = - calloc(1, sizeof(*mr_r8->measResultNeighCells->choice.measResultNeighCellListNR_r15.list.array)); - mr_r8->measResultNeighCells->choice.measResultNeighCellListNR_r15.list.array[0] = - calloc(1, sizeof(*mr_r8->measResultNeighCells->choice.measResultNeighCellListNR_r15.list.array[0])); - mr_r8->measResultNeighCells->choice.measResultNeighCellListNR_r15.list.array[0]->measResultCell_r15.rsrpResult_r15 = - calloc(1, sizeof(*mr_r8->measResultNeighCells->choice.measResultNeighCellListNR_r15.list.array[0]->measResultCell_r15.rsrpResult_r15)); - mr_r8->measResultNeighCells->choice.measResultNeighCellListNR_r15.list.array[0]->measResultCell_r15.rsrqResult_r15 = - calloc(1, sizeof(*mr_r8->measResultNeighCells->choice.measResultNeighCellListNR_r15.list.array[0]->measResultCell_r15.rsrqResult_r15)); - //mr_r8->measResultNeighCells->choice.measResultNeighCellListNR_r15.list.array[0]->measResultCell_r15.rsrpResult_r15 = rsrp_tar; - //mr_r8->measResultNeighCells->choice.measResultNeighCellListNR_r15.list.array[0]->measResultCell_r15.rsrqResult_r15 = rsrq_tar; - LOG_D(RRC, "Melissa Elkadi RSRQ of Target %ld\n", - *mr_r8->measResultNeighCells->choice.measResultNeighCellListNR_r15.list.array[0]->measResultCell_r15.rsrqResult_r15); - LOG_D(RRC, "Melissa Elkadi RSRP of Target %ld\n", - *mr_r8->measResultNeighCells->choice.measResultNeighCellListNR_r15.list.array[0]->measResultCell_r15.rsrpResult_r15); - - //mr_r8->measResultNeighCells->choice.measResultListEUTRA.list.count = 1; - //mr_r8->measResultNeighCells->choice.measResultListEUTRA.list.array[0]->physCellId = 0; - mr_r8->measResultNeighCells->choice.measResultListEUTRA.list.array = - calloc(1, sizeof(*mr_r8->measResultNeighCells->choice.measResultListEUTRA.list.array)); - mr_r8->measResultNeighCells->choice.measResultListEUTRA.list.array[0] = - calloc(1, sizeof(*mr_r8->measResultNeighCells->choice.measResultListEUTRA.list.array[0])); - mr_r8->measResultNeighCells->choice.measResultListEUTRA.list.array[0]->measResult.rsrpResult = - calloc(1, sizeof(*mr_r8->measResultNeighCells->choice.measResultListEUTRA.list.array[0]->measResult.rsrpResult)); - mr_r8->measResultNeighCells->choice.measResultListEUTRA.list.array[0]->measResult.rsrqResult = - calloc(1, sizeof(*mr_r8->measResultNeighCells->choice.measResultListEUTRA.list.array[0]->measResult.rsrqResult)); - - LTE_MeasResultCellNR_r15_t *measResultCellNR_r15; - measResultCellNR_r15 = CALLOC(1, sizeof(*measResultCellNR_r15)); - measResultCellNR_r15->ext1 //Melissa should be null - measResultCellNR_r15->pci_r15 = phy_id; - measResultCellNR_r15->measResultCell_r15.rsrpResult_r15 = &rsrp_tar; - measResultCellNR_r15->measResultCell_r15.rsrqResult_r15 = &rsrq_tar; - - LTE_MeasResultCellListNR_r15_t *measResultListNR_r15; - measResultListNR_r15 = CALLOC(1, sizeof(*measResultListNR_r15)); - ASN_SEQUENCE_ADD(&measResultListNR_r15->list, measResultCellNR_r15); - - ASN_SEQUENCE_ADD(&mr_r8->measResultNeighCells->choice.measResultNeighCellListNR_r15.list, measResultListNR_r15); - - //xer_fprint(stdout, &asn_DEF_LTE_UL_DCCH_Message, &ul_dcch_msg); - #endif - + asn1cCalloc(measresulteutra_list->cgi_Info, measresult_cgi2); + //measresult_cgi2->cellGlobalId= {0}; + //measresult_cgi2->trackingAreaCode= {0}; + struct LTE_MeasResultEUTRA__measResult* measResult= &measresulteutra_list->measResult; + asn1cCallocOne(measResult->rsrpResult, rsrp_tar); + asn1cCallocOne(measResult->rsrqResult, rsrq_tar); + + asn_enc_rval_t enc_rval = uper_encode_to_buffer(&asn_DEF_LTE_UL_DCCH_Message, NULL, &ul_dcch_msg, @@ -4385,28 +4312,7 @@ ssize_t do_nrMeasurementReport(uint8_t *buffer, SEQUENCE_free(&asn_DEF_LTE_UL_DCCH_Message, &ul_dcch_msg, ASFM_FREE_UNDERLYING_AND_RESET); return -1; } - #if 0 - LTE_UL_DCCH_Message_t *ul_dcch_msg_dec = NULL; - asn_dec_rval_t dec_rval = uper_decode( - NULL, - &asn_DEF_LTE_UL_DCCH_Message, - (void **)&ul_dcch_msg_dec, - buffer, - bufsize, - 0, - 0); - if (1) { - xer_fprint(stdout, &asn_DEF_LTE_UL_DCCH_Message, (void *)&ul_dcch_msg_dec); - } - LOG_I(RRC, "Melissa, this is rsrp_result %ld\n", - *ul_dcch_msg_dec->message.choice.c1.choice.measurementReport.criticalExtensions. - choice.c1.choice.measurementReport_r8.measResults.measResultNeighCells-> - choice.measResultNeighCellListNR_r15.list.array[0]->measResultCell_r15.rsrpResult_r15); - AssertFatal(ul_dcch_msg_dec->message.choice.c1.choice.measurementReport.criticalExtensions. - choice.c1.choice.measurementReport_r8.measResults. - measResultNeighCells->choice.measResultListEUTRA.list.array[0]->measResult.rsrqResult != NULL, "rsrq not allocated! and dec_val = %lu", dec_rval.consumed); - SEQUENCE_free(&asn_DEF_LTE_UL_DCCH_Message, &ul_dcch_msg, ASFM_FREE_UNDERLYING_AND_RESET); Melissa, might want to figure this out! - #endif + return((enc_rval.encoded+7)/8); } diff --git a/openair2/RRC/LTE/rrc_UE.c b/openair2/RRC/LTE/rrc_UE.c index bb6364dfbd0..e158b1ac736 100644 --- a/openair2/RRC/LTE/rrc_UE.c +++ b/openair2/RRC/LTE/rrc_UE.c @@ -788,6 +788,7 @@ rrc_ue_establish_drb( return(0); } + //----------------------------------------------------------------------------- void rrc_ue_process_measConfig( @@ -1734,7 +1735,7 @@ rrc_ue_process_nrueCapabilityEnquiry( OCTET_STRING_fromBuf(&ue_CapabilityRAT_Container.ue_CapabilityRAT_Container, (const char *)nrue_cap_info->mesg, nrue_cap_info->mesg_len); - # if(1) //Melissa: This is a hack. The MRDC capabilites should be filled in the NR UE + # if(1) // TODO: The MRDC capabilites should be filled in the NR UE NR_UE_CapabilityRAT_Container_t ue_CapabilityRAT_Container_mrdc; memset(&ue_CapabilityRAT_Container_mrdc, 0, sizeof(ue_CapabilityRAT_Container_mrdc)); uint8_t buffer_mrdc[RRC_BUF_SIZE]; @@ -1971,15 +1972,6 @@ rrc_ue_process_rrcConnectionReconfiguration( nsa_sendmsg_to_nrue(&msg, sizeof(msg), RRC_CONFIG_COMPLETE_REQ); LOG_A(RRC, "Sent RRC_CONFIG_COMPLETE_REQ to the NR UE\n"); - #if 0 //Melissa, this is a hack. We need the transaction_id from latest dl_dcch_msg the LTE UE received. (Ln 6658) - LTE_RRCConnectionReconfiguration_t *rrc = &UE_rrc_inst[ctxt_pP->module_id].Info[eNB_index].dl_dcch_msg->message. - choice.c1.choice.rrcConnectionReconfiguration; - if (rrc != NULL) { - SEQUENCE_free(&asn_DEF_LTE_RRCConnectionReconfiguration, rrc, ASFM_FREE_EVERYTHING); - } - rrc->rrc_TransactionIdentifier = rrcConnectionReconfiguration->rrc_TransactionIdentifier; - rrcConnectionReconfiguration = NULL; - #endif } if (r_r8->mobilityControlInfo) { @@ -2059,7 +2051,7 @@ rrc_ue_process_rrcConnectionReconfiguration( NAS_CONN_ESTABLI_CNF(msg_p).nasMsg.data = pdu_buffer; itti_send_msg_to_task(TASK_NAS_UE, ctxt_pP->instance, msg_p); } - LOG_I(RRC, "Melissa Elkadi, we have sent NAS_CONN_ESTABLI_CNF to NAS layer via itti!\n"); + LOG_D(RRC, "Sent NAS_CONN_ESTABLI_CNF to NAS layer via itti!\n"); free (r_r8->dedicatedInfoNASList); } @@ -2517,7 +2509,6 @@ rrc_ue_decode_dcch( UE_RRC_INFO *info = &UE_rrc_inst[ctxt_pP->module_id].Info[eNB_indexP]; if (info->dl_dcch_msg != NULL) { info->dl_dcch_msg = NULL; - //SEQUENCE_free(&asn_DEF_LTE_DL_DCCH_Message, info->dl_dcch_msg, ASFM_FREE_EVERYTHING); Melissa } info->dl_dcch_msg = dl_dcch_msg; dl_dcch_msg = NULL; @@ -2533,7 +2524,6 @@ rrc_ue_decode_dcch( UE_RRC_INFO *info = &UE_rrc_inst[ctxt_pP->module_id].Info[eNB_indexP]; if (info->dl_dcch_msg != NULL) { info->dl_dcch_msg = NULL; - //SEQUENCE_free(&asn_DEF_LTE_DL_DCCH_Message, info->dl_dcch_msg, ASFM_FREE_EVERYTHING); Melissa } info->dl_dcch_msg = dl_dcch_msg; dl_dcch_msg = NULL; @@ -2571,7 +2561,7 @@ rrc_ue_decode_dcch( #ifndef NO_RRM send_msg(&S_rrc,msg_rrc_end_scan_req(ctxt_pP->module_id,eNB_indexP)); #endif - if (0) //Melissa hack: Were not done with underlying members of dl_dcch_msg (Use after free) + if (0) //We're not done with underlying members of dl_dcch_msg (Use after free error when enabled) { SEQUENCE_free(&asn_DEF_LTE_DL_DCCH_Message, dl_dcch_msg, ASFM_FREE_EVERYTHING); } @@ -5067,7 +5057,7 @@ void *rrc_ue_task( void *args_p ) { } case NAS_OAI_TUN_NSA: { - LOG_I(NAS, "Melissa Elkadi Received %s: length %lu. About to send this to the NR UE\n", ITTI_MSG_NAME (msg_p), + LOG_D(NAS, "Received %s: length %lu. About to send this to the NR UE\n", ITTI_MSG_NAME (msg_p), sizeof(NAS_OAI_TUN_NSA (msg_p).buffer)); char buffer[RRC_BUF_SIZE]; memcpy(buffer, NAS_OAI_TUN_NSA(msg_p).buffer, sizeof(buffer)); diff --git a/openair2/RRC/LTE/rrc_eNB.c b/openair2/RRC/LTE/rrc_eNB.c index e84d946e0ac..8c4c2d56d40 100644 --- a/openair2/RRC/LTE/rrc_eNB.c +++ b/openair2/RRC/LTE/rrc_eNB.c @@ -90,6 +90,7 @@ #include <openair3/ocp-gtpu/gtp_itf.h> #include "intertask_interface.h" +#include "softmodem-common.h" #if ENABLE_RAL #include "rrc_eNB_ral.h" @@ -4600,8 +4601,8 @@ rrc_eNB_process_MeasurementReport( if(is_en_dc_supported(ue_context_pP->ue_context.UE_Capability)) { - //AssertFatal(measResults2->measResultNeighCells!=NULL,"no measResultNeighCells, shouldn't happen!\n"); - //AssertFatal(measResults2->measResultNeighCells->present==LTE_MeasResults__measResultNeighCells_PR_measResultNeighCellListNR_r15,"field is not LTE_MeasResults__measResultNeighCells_PR_measResultNeighCellListNR_r15"); + AssertFatal(measResults2->measResultNeighCells!=NULL,"no measResultNeighCells, shouldn't happen!\n"); + AssertFatal(measResults2->measResultNeighCells->present==LTE_MeasResults__measResultNeighCells_PR_measResultNeighCellListNR_r15,"field is not LTE_MeasResults__measResultNeighCells_PR_measResultNeighCellListNR_r15"); /** to add gNB as Secondary node CG-ConfigInfo to be added as per 36.423 r15 **/ if(encode_CG_ConfigInfo(enc_buf,sizeof(enc_buf),ue_context_pP,&enc_size) == RRC_OK) LOG_I(RRC,"CG-ConfigInfo encoded successfully\n"); @@ -7990,7 +7991,7 @@ rrc_eNB_decode_dcch( /*FK: left the condition as is for the case MME is used (S1 mode) but setting dedicated_DRB = 1 otherwise (noS1 mode) so that no second RRCReconfiguration message activationg more DRB is sent as this causes problems with the nasmesh driver.*/ int flexran_agent_handover = 0; - if (1) { //Melissa: This is a hack. We are bypassing EPC mode here. if(EPC_MODE_ENABLED) + if (EPC_MODE_ENABLED || get_softmodem_params()->nsa) { if (ue_context_p->ue_context.StatusRrc == RRC_RECONFIGURED) { dedicated_DRB = 1; LOG_I(RRC, diff --git a/openair2/RRC/LTE/rrc_proto.h b/openair2/RRC/LTE/rrc_proto.h index da6057aafd3..f0456005f52 100644 --- a/openair2/RRC/LTE/rrc_proto.h +++ b/openair2/RRC/LTE/rrc_proto.h @@ -529,6 +529,7 @@ rrc_data_req_ue( const pdcp_transmission_mode_t modeP ); + void rrc_data_ind( const protocol_ctxt_t *const ctxt_pP, diff --git a/openair2/RRC/NR/MESSAGES/asn1_msg.c b/openair2/RRC/NR/MESSAGES/asn1_msg.c index 53643eea8f4..57aaa87ea56 100755 --- a/openair2/RRC/NR/MESSAGES/asn1_msg.c +++ b/openair2/RRC/NR/MESSAGES/asn1_msg.c @@ -1031,7 +1031,6 @@ void fill_initial_SpCellConfig(rnti_t rnti, // one symbol (13) NR_PUCCH_Resource_t *pucchres0=calloc(1,sizeof(*pucchres0)); pucchres0->pucch_ResourceId=0; - //pucchres0->startingPRB=0; pucchres0->startingPRB=(8+rnti) % curr_bwp; LOG_D(NR_RRC, "pucchres0->startPRB %ld rnti %d curr_bwp %d\n", pucchres0->startingPRB, rnti, curr_bwp); pucchres0->intraSlotFrequencyHopping=NULL; diff --git a/openair2/RRC/NR/rrc_gNB_internode.c b/openair2/RRC/NR/rrc_gNB_internode.c index 04749b28000..c4cd41c5b4e 100644 --- a/openair2/RRC/NR/rrc_gNB_internode.c +++ b/openair2/RRC/NR/rrc_gNB_internode.c @@ -59,6 +59,7 @@ int parse_CG_ConfigInfo(gNB_RRC_INST *rrc, NR_CG_ConfigInfo_t *CG_ConfigInfo, x2 AssertFatal(1==0,"[InterNode] Failed to decode NR_UE_CapabilityRAT_ContainerList (%zu bits), size of OCTET_STRING %lu\n", dec_rval.consumed, cg_ConfigInfo->ue_CapabilityInfo->size); } + rrc_parse_ue_capabilities(rrc,UE_CapabilityRAT_ContainerList, m,cg_ConfigInfo); } diff --git a/openair2/RRC/NR/rrc_gNB_nsa.c b/openair2/RRC/NR/rrc_gNB_nsa.c index cf70c90bced..52985a09618 100644 --- a/openair2/RRC/NR/rrc_gNB_nsa.c +++ b/openair2/RRC/NR/rrc_gNB_nsa.c @@ -297,7 +297,7 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_ PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, rrc->module_id, GNB_FLAG_YES, ue_context_p->ue_id_rnti, 0, 0,rrc->module_id); memset(&create_tunnel_resp, 0, sizeof(create_tunnel_resp)); if (!IS_SOFTMODEM_NOS1) { - LOG_I(RRC, "Melissa Elkadi calling gtpv1u_create_s1u_tunnel()\n"); + LOG_D(RRC, "Calling gtpv1u_create_s1u_tunnel()\n"); gtpv1u_create_s1u_tunnel( ctxt.instance, &create_tunnel_req, @@ -404,7 +404,7 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_ (LTE_PMCH_InfoList_r9_t *) NULL, ue_context_p->ue_context.secondaryCellGroup->rlc_BearerToAddModList); - LOG_I(RRC, "%s:%d: done RRC PDCP/RLC ASN1 request for UE rnti %x\n", __FUNCTION__, __LINE__, ctxt.rnti); + LOG_D(RRC, "%s:%d: done RRC PDCP/RLC ASN1 request for UE rnti %x\n", __FUNCTION__, __LINE__, ctxt.rnti); } diff --git a/openair2/RRC/NR_UE/rrc_UE.c b/openair2/RRC/NR_UE/rrc_UE.c index 8cd93b80481..ff9855b70c7 100644 --- a/openair2/RRC/NR_UE/rrc_UE.c +++ b/openair2/RRC/NR_UE/rrc_UE.c @@ -2025,15 +2025,6 @@ nr_rrc_ue_establish_srb2( } } - /*rrc_data_req_nr_ue ( - ctxt_pP, - DCCH, - nr_rrc_mui++, - SDU_CONFIRM_NO, - size, - buffer, - PDCP_TRANSMISSION_MODE_CONTROL); Melissa Elkadi come back here!*/ - if (measConfig->s_MeasureConfig->present == NR_MeasConfig__s_MeasureConfig_PR_ssb_RSRP) { NR_UE_rrc_inst[ctxt_pP->module_id].s_measure = measConfig->s_MeasureConfig->choice.ssb_RSRP; } else if (measConfig->s_MeasureConfig->present == NR_MeasConfig__s_MeasureConfig_PR_csi_RSRP) { @@ -2699,38 +2690,6 @@ nr_rrc_ue_process_ueCapabilityEnquiry( } } -//----------------------------------------------------------------------------- -#if 0 -static void nr_rrc_ue_generate_RRCReestablishmentRequest( const protocol_ctxt_t *const ctxt_pP, const uint8_t gNB_index ) -{ - NR_UE_rrc_inst[ctxt_pP->module_id].Srb0[gNB_index].Tx_buffer.payload_size = - do_RRCReestablishmentRequest( - ctxt_pP->module_id, - (uint8_t *)NR_UE_rrc_inst[ctxt_pP->module_id].Srb0[gNB_index].Tx_buffer.Payload, 1); - LOG_I(NR_RRC,"[UE %d] : Frame %d, Logical Channel UL-CCCH (SRB0), Generating RRCReestablishmentRequest (bytes %d, gNB %d)\n", - ctxt_pP->module_id, ctxt_pP->frame, NR_UE_rrc_inst[ctxt_pP->module_id].Srb0[gNB_index].Tx_buffer.payload_size, gNB_index); - - for (int i=0; i<NR_UE_rrc_inst[ctxt_pP->module_id].Srb0[gNB_index].Tx_buffer.payload_size; i++) { - LOG_T(NR_RRC,"%x.",NR_UE_rrc_inst[ctxt_pP->module_id].Srb0[gNB_index].Tx_buffer.Payload[i]); - } - - LOG_T(NR_RRC,"\n"); - -#ifdef ITTI_SIM - MessageDef *message_p; - uint8_t *message_buffer; - message_buffer = itti_malloc (TASK_RRC_NRUE,TASK_RRC_GNB_SIM, - NR_UE_rrc_inst[ctxt_pP->module_id].Srb0[gNB_index].Tx_buffer.payload_size); - memcpy (message_buffer, (uint8_t*)NR_UE_rrc_inst[ctxt_pP->module_id].Srb0[gNB_index].Tx_buffer.Payload, - NR_UE_rrc_inst[ctxt_pP->module_id].Srb0[gNB_index].Tx_buffer.payload_size); - message_p = itti_alloc_new_message (TASK_RRC_NRUE, 0, UE_RRC_CCCH_DATA_IND); - UE_RRC_CCCH_DATA_IND (message_p).sdu = message_buffer; - UE_RRC_CCCH_DATA_IND (message_p).size = NR_UE_rrc_inst[ctxt_pP->module_id].Srb0[gNB_index].Tx_buffer.payload_size; - itti_send_msg_to_task (TASK_RRC_GNB_SIM, ctxt_pP->instance, message_p); -#endif -} -#endif - void nr_rrc_ue_generate_rrcReestablishmentComplete( const protocol_ctxt_t *const ctxt_pP, @@ -2890,7 +2849,7 @@ static void nsa_rrc_ue_process_ueCapabilityEnquiry(void) UECap->sdu_size = (enc_rval.encoded + 7) / 8; LOG_A(NR_RRC, "[NR_RRC] NRUE Capability encoded, %d bytes (%zd bits)\n", UECap->sdu_size, enc_rval.encoded + 7); - /* Melissa: Hack. Need to add ctxt->mod_id as array indices */ + NR_UE_rrc_inst[0].UECap = UECap; NR_UE_rrc_inst[0].UECapability = UECap->sdu; NR_UE_rrc_inst[0].UECapability_size = UECap->sdu_size; @@ -3031,7 +2990,7 @@ void process_lte_nsa_msg(nsa_msg_t *msg, int msg_len) LOG_I(NR_RRC, "We got an OAI_TUN_IFACE_NSA!!\n"); char cmd_line[RRC_BUF_SIZE]; memcpy(cmd_line, msg_buffer, sizeof(cmd_line)); - LOG_I(NR_RRC, "Melissa Elkadi, this is the command line we got: %s\n", cmd_line); + LOG_D(NR_RRC, "Command line: %s\n", cmd_line); if (background_system(cmd_line) != 0) { LOG_E(NR_RRC, "ESM-PROC - failed command '%s'", cmd_line); diff --git a/openair2/X2AP/x2ap_eNB_generate_messages.c b/openair2/X2AP/x2ap_eNB_generate_messages.c index 13618a921ca..9724e0cc381 100644 --- a/openair2/X2AP/x2ap_eNB_generate_messages.c +++ b/openair2/X2AP/x2ap_eNB_generate_messages.c @@ -1734,7 +1734,7 @@ int x2ap_eNB_generate_ENDC_x2_SgNB_addition_request( X2AP_ERROR("Failed to encode ENDC X2 SgNB_addition request message\n"); return -1; } - # if 0 //Melissa: This is a hack becasue we are trying to access this after free. + # if 0 // TODO: Sanitizer complains we are trying to access this after free. free(ie->value.choice.MeNBtoSgNBContainer.buf); #endif MSC_LOG_TX_MESSAGE (MSC_X2AP_SRC_ENB, MSC_X2AP_TARGET_ENB, NULL, 0, "0 X2Setup/initiatingMessage assoc_id %u", x2ap_eNB_data_p->assoc_id); diff --git a/openair3/NAS/UE/ESM/esm_ebr_context.c b/openair3/NAS/UE/ESM/esm_ebr_context.c index 6ba3fc2a860..b801ca2ad54 100644 --- a/openair3/NAS/UE/ESM/esm_ebr_context.c +++ b/openair3/NAS/UE/ESM/esm_ebr_context.c @@ -263,7 +263,7 @@ int esm_ebr_context_create( netmask = 32; strcpy(broadcast, ipv4_addr); } - LOG_I(NAS, "Melissa Elkadi setting commandline string: " + LOG_D(NAS, "setting commandline string: " "ip address add %s/%d broadcast %s dev %s%d && " "ip link set %s%d up && " "ip rule add from %s/32 table %d && " @@ -276,7 +276,7 @@ int esm_ebr_context_create( ipv4_addr, ueid + 10000, UE_NAS_USE_TUN ? "oaitun_ue" : "oip", ueid + 1, ueid + 10000); - if (get_softmodem_params()->nsa == 0) + if (!get_softmodem_params()->nsa) { res = sprintf(command_line, "ip address add %s/%d broadcast %s dev %s%d && " @@ -307,7 +307,7 @@ int esm_ebr_context_create( * common/utils/system.c for details. */ - LOG_TRACE(INFO, "Melissa Elkadi ESM-PROC - executing %s ", + LOG_TRACE(INFO, "ESM-PROC - executing %s ", command_line); if (background_system(command_line) != 0) { @@ -332,7 +332,7 @@ int esm_ebr_context_create( if ( res<0 ) { LOG_TRACE(WARNING, "ESM-PROC - Failed to system command string"); } - LOG_I(NAS, "Melissa Elkadi, sending NAS_OAI_TUN_NSA msg to LTE UE via itti\n"); + LOG_D(NAS, "Sending NAS_OAI_TUN_NSA msg to LTE UE via itti\n"); MessageDef *msg_p = itti_alloc_new_message(TASK_NAS_UE, 0, NAS_OAI_TUN_NSA); memcpy(NAS_OAI_TUN_NSA(msg_p).buffer, command_line, sizeof(NAS_OAI_TUN_NSA(msg_p).buffer)); itti_send_msg_to_task(TASK_RRC_UE, 0, msg_p); diff --git a/openair3/NAS/UE/nas_ue_task.c b/openair3/NAS/UE/nas_ue_task.c index 8c03fe43be4..670600e0ade 100644 --- a/openair3/NAS/UE/nas_ue_task.c +++ b/openair3/NAS/UE/nas_ue_task.c @@ -252,7 +252,7 @@ void *nas_ue_task(void *args_p) break; case NAS_CONN_ESTABLI_CNF: - LOG_I(NAS, "Melissa Elkadi [UE %d] Received %s: errCode %u, length %u\n", Mod_id, ITTI_MSG_NAME (msg_p), + LOG_I(NAS, "[UE %d] Received %s: errCode %u, length %u\n", Mod_id, ITTI_MSG_NAME (msg_p), NAS_CONN_ESTABLI_CNF (msg_p).errCode, NAS_CONN_ESTABLI_CNF (msg_p).nasMsg.length); if ((NAS_CONN_ESTABLI_CNF (msg_p).errCode == AS_SUCCESS) diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/cu_gnb.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/cu_gnb.conf index bfb268fef84..680a6cb4ae6 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/cu_gnb.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/cu_gnb.conf @@ -1,4 +1,4 @@ -Active_gNBs = ( "gNB-CU-Eurecom-5GNRBox"); +Active_gNBs = ( "gNB-Eurecom-CU"); # Asn1_verbosity, choice in: none, info, annoying Asn1_verbosity = "none"; Num_Threads_PUSCH = 8; @@ -7,203 +7,44 @@ gNBs = ( { ////////// Identification parameters: - gNB_ID = 0xe00; + gNB_CU_ID = 0xe00; - cell_type = "CELL_MACRO_GNB"; +# cell_type = "CELL_MACRO_GNB"; - gNB_name = "gNB-CU-Eurecom-5GNRBox"; + gNB_name = "gNB-Eurecom-CU"; + // Tracking area code, 0x0000 and 0xfffe are reserved values // Tracking area code, 0x0000 and 0xfffe are reserved values tracking_area_code = 1; - - plmn_list = ({mcc = 208; mnc = 93; mnc_length = 2;}); - - nr_cellid = 12345678L - - tr_s_preference = "f1" - - local_s_if_name = "lo"; + plmn_list = ({ + mcc = 208; + mnc = 99; + mnc_length = 2; + snssaiList = ( + { + sst = 1; + sd = 0x010203; // 0 false, else true + }, + { + sst = 1; + sd = 0x1; #112233; // 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_address = "127.0.0.4"; - local_s_portc = 501; - remote_s_portc = 500; - local_s_portd = 601; - remote_s_portd = 600; - - ////////// Physical parameters: - - ssb_SubcarrierOffset = 0; - pdsch_AntennaPorts = 1; - pusch_AntennaPorts = 1; - sib1_tda = 0; - - servingCellConfigCommon = ( - { - #spCellConfigCommon - - physCellId = 0; - -# downlinkConfigCommon - #frequencyInfoDL - # this is 3600 MHz + 43 PRBs@30kHz SCS (same as initial BWP) - absoluteFrequencySSB = 641032; - dl_frequencyBand = 78; - # this is 3600 MHz - dl_absoluteFrequencyPointA = 640000; - #scs-SpecificCarrierList - dl_offstToCarrier = 0; -# subcarrierSpacing -# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 - dl_subcarrierSpacing = 1; - dl_carrierBandwidth = 106; - #initialDownlinkBWP - #genericParameters - # this is RBstart=41,L=24 (275*(L-1))+RBstart - initialDLBWPlocationAndBandwidth = 6366; -# subcarrierSpacing -# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 - initialDLBWPsubcarrierSpacing = 1; - #pdcch-ConfigCommon - initialDLBWPcontrolResourceSetZero = 12; - initialDLBWPsearchSpaceZero = 0; - #pdsch-ConfigCommon - #pdschTimeDomainAllocationList (up to 16 entries) - initialDLBWPk0_0 = 0; - #initialULBWPmappingType - #0=typeA,1=typeB - initialDLBWPmappingType_0 = 0; - #this is SS=1,L=13 - initialDLBWPstartSymbolAndLength_0 = 40; - - initialDLBWPk0_1 = 0; - initialDLBWPmappingType_1 = 0; - #this is SS=2,L=12 - initialDLBWPstartSymbolAndLength_1 = 53; - - initialDLBWPk0_2 = 0; - initialDLBWPmappingType_2 = 0; - #this is SS=1,L=12 - initialDLBWPstartSymbolAndLength_2 = 54; - - initialDLBWPk0_3 = 0; - initialDLBWPmappingType_3 = 0; - #this is SS=1,L=5 - initialDLBWPstartSymbolAndLength_3 = 57; - - #uplinkConfigCommon - #frequencyInfoUL - ul_frequencyBand = 78; - #scs-SpecificCarrierList - ul_offstToCarrier = 0; -# subcarrierSpacing -# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 - ul_subcarrierSpacing = 1; - ul_carrierBandwidth = 106; - pMax = 20; - #initialUplinkBWP - #genericParameters - initialULBWPlocationAndBandwidth = 6366; -# subcarrierSpacing -# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 - initialULBWPsubcarrierSpacing = 1; - #rach-ConfigCommon - #rach-ConfigGeneric - prach_ConfigurationIndex = 98; -#prach_msg1_FDM -#0 = one, 1=two, 2=four, 3=eight - prach_msg1_FDM = 0; - prach_msg1_FrequencyStart = 0; - zeroCorrelationZoneConfig = 13; - preambleReceivedTargetPower = -118; -#preamblTransMax (0...10) = (3,4,5,6,7,8,10,20,50,100,200) - preambleTransMax = 6; -#powerRampingStep -# 0=dB0,1=dB2,2=dB4,3=dB6 - powerRampingStep = 1; -#ra_ReponseWindow -#1,2,4,8,10,20,40,80 - ra_ResponseWindow = 4; -#ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR -#1=oneeighth,2=onefourth,3=half,4=one,5=two,6=four,7=eight,8=sixteen - ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR = 4; -#oneHalf (0..15) 4,8,12,16,...60,64 - ssb_perRACH_OccasionAndCB_PreamblesPerSSB = 15; -#ra_ContentionResolutionTimer -#(0..7) 8,16,24,32,40,48,56,64 - ra_ContentionResolutionTimer = 7; - rsrp_ThresholdSSB = 19; -#prach-RootSequenceIndex_PR -#1 = 839, 2 = 139 - prach_RootSequenceIndex_PR = 2; - prach_RootSequenceIndex = 1; - # SCS for msg1, can only be 15 for 30 kHz < 6 GHz, takes precendence over the one derived from prach-ConfigIndex - # - msg1_SubcarrierSpacing = 1, -# restrictedSetConfig -# 0=unrestricted, 1=restricted type A, 2=restricted type B - restrictedSetConfig = 0, - - # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 6; - initialULBWPmappingType_0 = 1 - # this is SS=0 L=11 - initialULBWPstartSymbolAndLength_0 = 55; - - initialULBWPk2_1 = 6; - initialULBWPmappingType_1 = 1; - # this is SS=0 L=12 - initialULBWPstartSymbolAndLength_1 = 69; - - initialULBWPk2_2 = 7; - initialULBWPmappingType_2 = 1; - # this is SS=10 L=4 - initialULBWPstartSymbolAndLength_2 = 52; - - msg3_DeltaPreamble = 1; - p0_NominalWithGrant =-90; - -# pucch-ConfigCommon setup : -# pucchGroupHopping -# 0 = neither, 1= group hopping, 2=sequence hopping - pucchGroupHopping = 0; - hoppingId = 40; - p0_nominal = -90; -# ssb_PositionsInBurs_BitmapPR -# 1=short, 2=medium, 3=long - ssb_PositionsInBurst_PR = 2; - ssb_PositionsInBurst_Bitmap = 1; - -# ssb_periodicityServingCell -# 0 = ms5, 1=ms10, 2=ms20, 3=ms40, 4=ms80, 5=ms160, 6=spare2, 7=spare1 - ssb_periodicityServingCell = 2; - -# dmrs_TypeA_position -# 0 = pos2, 1 = pos3 - dmrs_TypeA_Position = 0; - -# subcarrierSpacing -# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 - subcarrierSpacing = 1; - - - #tdd-UL-DL-ConfigurationCommon -# subcarrierSpacing -# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 - referenceSubcarrierSpacing = 1; - # pattern1 - # dl_UL_TransmissionPeriodicity - # 0=ms0p5, 1=ms0p625, 2=ms1, 3=ms1p25, 4=ms2, 5=ms2p5, 6=ms5, 7=ms10 - dl_UL_TransmissionPeriodicity = 6; - nrofDownlinkSlots = 7; - nrofDownlinkSymbols = 6; - nrofUplinkSlots = 2; - nrofUplinkSymbols = 4; - - ssPBCH_BlockPower = 10; - } - - ); - + local_s_portc = 501; + local_s_portd = 2152; + remote_s_portc = 501; + remote_s_portd = 2152; # ------- SCTP definitions SCTP : @@ -214,8 +55,8 @@ gNBs = }; - ////////// MME parameters: - mme_ip_address = ( { ipv4 = "192.168.12.26"; + ////////// AMF parameters: + amf_ip_address = ( { ipv4 = "192.168.69.131"; ipv6 = "192:168:30::17"; active = "yes"; preference = "ipv4"; @@ -225,49 +66,15 @@ gNBs = NETWORK_INTERFACES : { - GNB_INTERFACE_NAME_FOR_S1_MME = "eth0"; - GNB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.111/24"; - GNB_INTERFACE_NAME_FOR_S1U = "eth0"; - GNB_IPV4_ADDRESS_FOR_S1U = "192.168.12.111/24"; + GNB_INTERFACE_NAME_FOR_NG_AMF = "bond0"; + GNB_IPV4_ADDRESS_FOR_NG_AMF = "192.168.18.207/24"; + GNB_INTERFACE_NAME_FOR_NGU = "bond0"; + GNB_IPV4_ADDRESS_FOR_NGU = "192.168.18.207/24"; GNB_PORT_FOR_S1U = 2152; # Spec 2152 }; } ); -# RUs = ( -# { -# local_rf = "yes" -# nb_tx = 1 -# nb_rx = 1 -# att_tx = 0 -# att_rx = 0; -# bands = [7]; -# max_pdschReferenceSignalPower = -27; -# max_rxgain = 75; -# eNB_instances = [0]; -# ##beamforming 1x2 matrix: 1 layer x 2 antennas -# bf_weights = [0x00007fff, 0x0000]; -# ##beamforming 1x4 matrix: 1 layer x 4 antennas -# #bf_weights = [0x00007fff, 0x0000,0x0000, 0x0000]; -# ## beamforming 2x2 matrix: -# # bf_weights = [0x00007fff, 0x00000000, 0x00000000, 0x00007fff]; -# ## beamforming 4x4 matrix: -# #bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000, 0x00000000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff]; - -# sdr_addrs = "addr=192.168.10.2,mgmt_addr=192.168.10.2,second_addr=192.168.20.2"; -# clock_src = "external"; -# } -# ); - -THREAD_STRUCT = ( - { - #three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT" - parallel_config = "PARALLEL_RU_L1_TRX_SPLIT"; - #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE" - worker_config = "WORKER_ENABLE"; - } -); - log_config : { global_log_level ="info"; @@ -278,13 +85,15 @@ THREAD_STRUCT = ( phy_log_verbosity ="medium"; mac_log_level ="info"; mac_log_verbosity ="high"; - rlc_log_level ="info"; + rlc_log_level ="debug"; rlc_log_verbosity ="medium"; - pdcp_log_level ="debug"; + pdcp_log_level ="info"; pdcp_log_verbosity ="medium"; - rrc_log_level ="debug"; + rrc_log_level ="info"; rrc_log_verbosity ="medium"; - f1ap_log_level ="info"; - f1ap_log_verbosity ="medium"; + f1ap_log_level ="debug"; + f1ap_log_verbosity ="medium"; + ngap_log_level ="debug"; + ngap_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf index 7b3535ce1fb..05e441d3964 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf @@ -1,7 +1,6 @@ Active_gNBs = ( "gNB-Eurecom-DU"); # Asn1_verbosity, choice in: none, info, annoying Asn1_verbosity = "none"; -Num_Threads_PUSCH = 8; gNBs = ( @@ -13,10 +12,26 @@ gNBs = gNB_name = "gNB-Eurecom-DU"; + // Tracking area code, 0x0000 and 0xfffe are reserved values // 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 = 0x1; #112233; // 0 false, else true + } + ); + + }); - plmn_list = ({mcc = 208; mnc = 93; mnc_length = 2;}); nr_cellid = 12345678L @@ -29,6 +44,14 @@ gNBs = pusch_AntennaPorts = 1; sib1_tda = 0; + + pdcch_ConfigSIB1 = ( + { + controlResourceSetZero = 12; + searchSpaceZero = 0; + } + ); + servingCellConfigCommon = ( { #spCellConfigCommon @@ -38,10 +61,10 @@ gNBs = # downlinkConfigCommon #frequencyInfoDL # this is 3600 MHz + 43 PRBs@30kHz SCS (same as initial BWP) - absoluteFrequencySSB = 641032; + absoluteFrequencySSB = 641280; dl_frequencyBand = 78; # this is 3600 MHz - dl_absoluteFrequencyPointA = 640000; + dl_absoluteFrequencyPointA = 640008; #scs-SpecificCarrierList dl_offstToCarrier = 0; # subcarrierSpacing @@ -50,8 +73,8 @@ gNBs = dl_carrierBandwidth = 106; #initialDownlinkBWP #genericParameters - # this is RBstart=41,L=24 (275*(L-1))+RBstart - initialDLBWPlocationAndBandwidth = 6366; + # this is RBstart=27,L=48 (275*(L-1))+RBstart + initialDLBWPlocationAndBandwidth = 12952; # subcarrierSpacing # 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 initialDLBWPsubcarrierSpacing = 1; @@ -65,12 +88,12 @@ gNBs = #0=typeA,1=typeB initialDLBWPmappingType_0 = 0; #this is SS=1,L=13 - initialDLBWPstartSymbolAndLength_0 = 40; + initialDLBWPstartSymbolAndLength_0 = 53; initialDLBWPk0_1 = 0; initialDLBWPmappingType_1 = 0; #this is SS=2,L=12 - initialDLBWPstartSymbolAndLength_1 = 53; + initialDLBWPstartSymbolAndLength_1 = 81; initialDLBWPk0_2 = 0; initialDLBWPmappingType_2 = 0; @@ -94,7 +117,7 @@ gNBs = pMax = 20; #initialUplinkBWP #genericParameters - initialULBWPlocationAndBandwidth = 6366; + initialULBWPlocationAndBandwidth = 12952; # subcarrierSpacing # 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 initialULBWPsubcarrierSpacing = 1; @@ -117,7 +140,7 @@ gNBs = ra_ResponseWindow = 4; #ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR #1=oneeighth,2=onefourth,3=half,4=one,5=two,6=four,7=eight,8=sixteen - ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR = 4; + ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR = 3; #oneHalf (0..15) 4,8,12,16,...60,64 ssb_perRACH_OccasionAndCB_PreamblesPerSSB = 15; #ra_ContentionResolutionTimer @@ -138,8 +161,8 @@ gNBs = # pusch-ConfigCommon (up to 16 elements) initialULBWPk2_0 = 6; initialULBWPmappingType_0 = 1 - # this is SS=0 L=11 - initialULBWPstartSymbolAndLength_0 = 55; + # this is SS=2 L=12 + initialULBWPstartSymbolAndLength_0 = 53; initialULBWPk2_1 = 6; initialULBWPmappingType_1 = 1; @@ -191,8 +214,8 @@ gNBs = nrofUplinkSlots = 2; nrofUplinkSymbols = 4; - ssPBCH_BlockPower = 10; - } + ssPBCH_BlockPower = 10; + } ); @@ -204,25 +227,6 @@ gNBs = SCTP_INSTREAMS = 2; SCTP_OUTSTREAMS = 2; }; - - - ////////// MME parameters: - mme_ip_address = ( { ipv4 = "192.168.12.26"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - - GNB_INTERFACE_NAME_FOR_S1_MME = "eth0"; - GNB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.111/24"; - GNB_INTERFACE_NAME_FOR_S1U = "eth0"; - GNB_IPV4_ADDRESS_FOR_S1U = "192.168.12.111/24"; - GNB_PORT_FOR_S1U = 2152; # Spec 2152 - }; } ); @@ -231,13 +235,14 @@ MACRLCs = ( num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "f1"; - local_n_if_name = "lo"; + local_n_if_name = "lo"; + local_n_address = "127.0.0.3"; remote_n_address = "127.0.0.4"; - local_n_address = "127.0.0.3"; - local_n_portc = 500; - remote_n_portc = 501; - local_n_portd = 600; - remote_n_portd = 601; + local_n_portc = 601; + local_n_portd = 2152; + remote_n_portc = 600; + remote_n_portd = 2152; + } ); @@ -245,6 +250,7 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; + pusch_proc_threads = 2; } ); @@ -300,5 +306,7 @@ THREAD_STRUCT = ( rrc_log_verbosity ="medium"; f1ap_log_level ="debug"; f1ap_log_verbosity ="medium"; + ngap_log_level ="debug"; + ngap_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.conf new file mode 100644 index 00000000000..545b44f888e --- /dev/null +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.conf @@ -0,0 +1,8 @@ +uicc0 = { +imsi = "2089900007487"; +key = "fec86ba6eb707ed08905757b1bb44b8f"; +opc= "C42449363BBAD02B66D16BC975D77CC1"; +dnn= "oai"; +nssai_sst=1; +nssai_sd=1; +} diff --git a/targets/RT/USER/lte-enb.c b/targets/RT/USER/lte-enb.c index ef250c08655..0bdf29227f8 100644 --- a/targets/RT/USER/lte-enb.c +++ b/targets/RT/USER/lte-enb.c @@ -958,7 +958,6 @@ void init_eNB_proc(int inst) { // Original Code from Fujitsu w/ old structure/field name //pthread_create( &proc_rxtx[0].pthread_rxtx, attr0, eNB_thread_rxtx, &proc_rxtx[0] ); //pthread_create( &proc_rxtx[1].pthread_rxtx, attr1, eNB_thread_rxtx, &proc_rxtx[1] ); - pthread_create( &L1_proc->pthread, attr0, L1_thread, L1_proc ); if (pthread_setname_np(L1_proc->pthread, "oai:enb-L1-rx") != 0) { -- GitLab