From cec29bb240f9512f834223760e99f19be19af836 Mon Sep 17 00:00:00 2001 From: Francesco Mani Date: Fri, 12 Jun 2020 09:57:23 +0200 Subject: [PATCH 01/14] bugfix nr_initial_sync.c --- openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c b/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c index b2d0467d14..cee9a45fac 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c @@ -135,7 +135,7 @@ int nr_pbch_detection(UE_nr_rxtx_proc_t * proc, PHY_VARS_NR_UE *ue, int pbch_ini stop_meas(&ue->dlsch_channel_estimation_stats); #endif - current_ssb->metric = current_ssb->c_re*current_ssb->c_re + current_ssb->c_im+current_ssb->c_im; + current_ssb->metric = current_ssb->c_re*current_ssb->c_re + current_ssb->c_im*current_ssb->c_im; // generate a list of SSB structures if (best_ssb == NULL) From 21a775817d410b5aab985dcb1cd72e498f98dfee Mon Sep 17 00:00:00 2001 From: Florian Kaltenberger Date: Fri, 12 Jun 2020 10:41:35 +0200 Subject: [PATCH 02/14] Update RUNMODEM.md --- doc/RUNMODEM.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/RUNMODEM.md b/doc/RUNMODEM.md index 70074c65ed..7591111b4b 100644 --- a/doc/RUNMODEM.md +++ b/doc/RUNMODEM.md @@ -70,7 +70,7 @@ This setup requires an EPC, an OAI eNB and gNB, and a COTS Phone. A dedicated pa ### Launch eNB -```bash sudo ./lte-softmodem -O ../../../targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf +```bash sudo ./lte-softmodem -O ../../../targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf``` From f46e3d4c762063d0c16699f93d89b938e0a4dc52 Mon Sep 17 00:00:00 2001 From: Florian Kaltenberger Date: Fri, 12 Jun 2020 11:13:18 +0200 Subject: [PATCH 03/14] fixing an issue with libconfig --- common/config/libconfig/config_libconfig.c | 4 ++-- openair2/GNB_APP/gnb_config.c | 5 ----- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/common/config/libconfig/config_libconfig.c b/common/config/libconfig/config_libconfig.c index 2d861f2dc3..b510ca28bc 100644 --- a/common/config/libconfig/config_libconfig.c +++ b/common/config/libconfig/config_libconfig.c @@ -179,8 +179,8 @@ int config_libconfig_get(paramdef_t *cfgoptions,int numoptions, char *prefix ) { *(cfgoptions[i].u64ptr) = (uint64_t)llu; printf_params("[LIBCONFIG] %s: %llu\n", cfgpath,(long long unsigned)(*(cfgoptions[i].u64ptr)) ); } else { - *(cfgoptions[i].iptr) = llu; - printf_params("[LIBCONFIG] %s: %llu\n", cfgpath,(long long unsigned)(*(cfgoptions[i].i64ptr)) ); + *(cfgoptions[i].i64ptr) = llu; + printf_params("[LIBCONFIG] %s: %llu\n", cfgpath,(long long)(*(cfgoptions[i].i64ptr)) ); } } else { defval=config_setdefault_int64(&(cfgoptions[i]),prefix); diff --git a/openair2/GNB_APP/gnb_config.c b/openair2/GNB_APP/gnb_config.c index 3235dabb45..61aa10e47b 100644 --- a/openair2/GNB_APP/gnb_config.c +++ b/openair2/GNB_APP/gnb_config.c @@ -259,11 +259,6 @@ void fix_scc(NR_ServingCellConfigCommon_t *scc,uint64_t ssbmap) { if (*scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg3_transformPrecoder!=0) scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg3_transformPrecoder = NULL; - // fix libconfig (asn1c uses long) - scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.preambleReceivedTargetPower-=((long)1<<32); - *scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->p0_NominalWithGrant-=((long)1<<32); - *scc->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup->p0_nominal-=((long)1<<32); - // fix DL and UL Allocation lists for (int i=scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.count-1;i>=0;i--) { From 9be3e9f451ad9e88bbe2be5e4845c2bca21eb4f5 Mon Sep 17 00:00:00 2001 From: hardy Date: Thu, 11 Jun 2020 14:24:12 +0200 Subject: [PATCH 04/14] 4G scheduler update --- doc/FEATURE_SET.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/doc/FEATURE_SET.md b/doc/FEATURE_SET.md index f71b9acb33..adf85fc328 100644 --- a/doc/FEATURE_SET.md +++ b/doc/FEATURE_SET.md @@ -82,7 +82,11 @@ TDD UL: 20 MHz, 100 PRBS/ MCS **XX** | 3.0 Mbit/s | TM1: 4.21 Mbits/s The MAC layer implements a subset of the **3GPP 36.321** release v8.6 in support of BCH, DLSCH, RACH, and ULSCH channels. - RRC interface for CCCH, DCCH, and DTCH -- Proportional fair scheduler (round robin scheduler soon) +- Proportional fair scheduler (round robin scheduler soon), with the following improvements: + - Up to 30 users tested in the L2 simulator, CCE allocation in the preprocessor ; the scheduler was also simplified and made more modular + - Adaptative UL-HARQ + - Should remove out-of-sync UEs (to be clarified) + - No use of the `first_rb` in the UL scheduler ; respects `vrb_map_UL` and `vrb_map` in the DL - DCI generation - HARQ Support - RA procedures and RNTI management From e40835f96d8f690a0e7ed3acb52552cc1f5c8acf Mon Sep 17 00:00:00 2001 From: Remi Hardy Date: Thu, 11 Jun 2020 14:43:34 +0200 Subject: [PATCH 05/14] Update: eNB RRC version eNB X2AP section --- doc/FEATURE_SET.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/doc/FEATURE_SET.md b/doc/FEATURE_SET.md index adf85fc328..37e462979b 100644 --- a/doc/FEATURE_SET.md +++ b/doc/FEATURE_SET.md @@ -127,7 +127,7 @@ The current PDCP layer is header compliant with **3GPP 36.323** Rel 10.1.0 and i ## eNB RRC Layer ## -The RRC layer is based on **3GPP 36.331** v14.3.0 and implements the following functions: +The RRC layer is based on **3GPP 36.331** v15.6 and implements the following functions: - System Information broadcast (SIB 1, 2, 3, and 13) * SIB1: Up to 6 PLMN IDs broadcast @@ -154,6 +154,10 @@ The X2AP layer is based on **3GPP 36.423** v14.6.0 and implements the following - X2 timers (t_reloc_prep, tx2_reloc_overall) - Handover Cancel - X2-U interface implemented + - EN-DC is implemented + - X2AP : Handling of SgNB Addition Request / Addition Request Acknowledge / Reconfiguration Complete + - RRC : Handling of RRC Connection Reconfiguration with 5G cell info, configuration of 5G-NR measurements + - S1AP : Handling of E-RAB Modification Indication / Confirmation ## eNB/MCE M2AP ## @@ -175,9 +179,6 @@ The M3AP layer is based on **3GPP 36.444** v14.0.1: - M3 Session Start Request - M3 Session Start Response -## eNB Advanced Features ## - -**To be completed** # OpenAirInterface UE Feature Set # From 981d35a778d5ac30835926c9cb66101b6f25cf42 Mon Sep 17 00:00:00 2001 From: Remi Hardy Date: Thu, 11 Jun 2020 16:29:06 +0200 Subject: [PATCH 06/14] restructuring the 5G part update of the 5G feature set (gNB and UE) ref : Florian K ppt --- doc/FEATURE_SET.md | 162 ++++++++++++++++++++++++++++++--------------- 1 file changed, 108 insertions(+), 54 deletions(-) diff --git a/doc/FEATURE_SET.md b/doc/FEATURE_SET.md index 37e462979b..a539b030e4 100644 --- a/doc/FEATURE_SET.md +++ b/doc/FEATURE_SET.md @@ -1,6 +1,8 @@ **Table of Contents** -1. [OpenAirInterface eNB Feature Set](#openairinterface-enb-feature-set) +1. [Functional Split Architecture](#functional-split-architecture) +2. [OpenAirInterface Block Diagram](#openairinterface-block-diagram) +2. [OpenAirInterface 4G-LTE eNB Feature Set](#openairinterface-4g-lte-enb-feature-set) 1. [eNB PHY Layer](#enb-phy-layer) 2. [eNB MAC Layer](#enb-mac-layer) 3. [eNB RLC Layer](#enb-rlc-layer) @@ -9,29 +11,38 @@ 6. [eNB X2AP](#enb-x2ap) 7. [eNB/MCE M2AP](#enbmce-m2ap) 8. [MCE/MME M3AP](#mcemme-m3ap) - 9. [eNB Advanced Features](#enb-advanced-features) -2. [OpenAirInterface Functional Split](#openairinterface-functional-split) -3. [OpenAirInterface UE Feature Set](#openairinterface-ue-feature-set) +3. [OpenAirInterface 4G-LTE UE Feature Set](#openairinterface-4g-lte-ue-feature-set) 1. [LTE UE PHY Layer](#lte-ue-phy-layer) 2. [LTE UE MAC Layer](#lte-ue-mac-layer) 3. [LTE UE RLC Layer](#lte-ue-rlc-layer) 4. [LTE UE PDCP Layer](#lte-ue-pdcp-layer) 5. [LTE UE RRC Layer](#lte-ue-rrc-layer) -4. [OpenAirInterface Functional Split](#openairinterface-functional-split) -5. [OpenAirInterface 5G-NR Feature Set](#openairinterface-5g-nr-feature-set) +4. [OpenAirInterface 5G-NR gNB Feature Set](#openairinterface-5g-nr-feature-set) 1. [General Parameters](#general-parameters) - 2. [gNB Features](#gnb-features) - 1. [gNB Physical Layer](#gnb-phy-layer) - 2. [gNB Higher Layers](#gnb-higher-layers) - 3. [NR UE Features](#nr-ue-features) - 1. [NR UE Physical Layer](#nr-ue-phy-layer) - 2. [NR UE Higher Layers](#nr-ue-higher-layers) + 2. [gNB Physical Layer](#gnb-phy-layer) + 3. [gNB Higher Layers](#gnb-higher-layers) +5. [OpenAirInterface 5G-NR UE Feature Set](#openairinterface-5g-nr-ue-feature-set) + 1. [UE Physical Layer](#ue-phy-layer) + 2. [UE Higher Layers](#ue-higher-layers) -# OpenAirInterface Block diagram # + +# Functional Split Architecture # + +- RCC: Radio-Cloud Center +- RAU: Radio-Access Unit +- RRU: Remote Radio-Unit +- IF4.5 / IF5 : similar to IEEE P1914.1 +- FAPI (IF2) : specified by Small Cell Forum (open-nFAPI implementation) +- IF1 : F1 in 3GPP Release 15 + +![Functional Split Architecture](./oai_enb_func_split_arch.png) + + +# OpenAirInterface Block Diagram # ![Block Diagram](./oai_enb_block_diagram.png) -# OpenAirInterface eNB Feature Set # +# OpenAirInterface 4G LTE eNB Feature Set # ## eNB PHY Layer ## @@ -85,7 +96,7 @@ The MAC layer implements a subset of the **3GPP 36.321** release v8.6 in support - Proportional fair scheduler (round robin scheduler soon), with the following improvements: - Up to 30 users tested in the L2 simulator, CCE allocation in the preprocessor ; the scheduler was also simplified and made more modular - Adaptative UL-HARQ - - Should remove out-of-sync UEs (to be clarified) + - Remove out-of-sync UEs - No use of the `first_rb` in the UL scheduler ; respects `vrb_map_UL` and `vrb_map` in the DL - DCI generation - HARQ Support @@ -180,7 +191,7 @@ The M3AP layer is based on **3GPP 36.444** v14.0.1: - M3 Session Start Response -# OpenAirInterface UE Feature Set # +# OpenAirInterface 4G LTE UE Feature Set # ## LTE UE PHY Layer ## @@ -235,17 +246,6 @@ The NAS layer is based on **3GPP 24.301** and implements the following functions - EMM attach/detach, authentication, tracking area update, and more - ESM default/dedicated bearer, PDN connectivity, and more -# OpenAirInterface Functional Split # - -- RCC: Radio-Cloud Center -- RAU: Radio-Access Unit -- RRU: Remote Radio-Unit - -![Functional Split Architecture](./oai_enb_func_split_arch.png) - -- IF4.5 / IF5 : similar to IEEE P1914.1 -- FAPI (IF2) : specified by Small Cell Forum (open-nFAPI implementation) -- IF1 : F1 in 3GPP Release 15 # OpenAirInterface 5G-NR Feature Set # @@ -263,49 +263,103 @@ The following features are valid for the gNB and the 5G-NR UE. * Highly efficient 3GPP compliant polar encoder and decoder * Encoder and decoder for short blocks -## gNB Features ## -### gNB PHY Layer ### +## gNB PHY Layer ## -* Generation of PSS/SSS/PBCH for multiple beams and -* Generation of PDCCH for SIB1 (including generation of DCI, polar encoding, scrambling, modulation, RB mapping, etc) +* 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 -* Generation of PDSCH (including Segmentation, LDPC encoding, rate matching, scrambling, modulation, RB mapping, etc). - - Single symbol DMRS, dmrs-TypeA-Position Pos2, DMRS configuration type 1 - - PDSCH mapping type A + - DCI formats: 00, 10 (01 and 11 **under integration**) +* Generation of NR-PDSCH (including Segmentation, LDPC encoding, rate matching, scrambling, modulation, RB mapping, etc). + - Single symbol DMRS, DMRS-TypeA-Position Pos2, DMRS configuration type 1 + - PDSCH mapping type A +* NR-CSI Generation of sequence at PHY (**under integration**) * NR-PUSCH (including Segmentation, LDPC encoding, rate matching, scrambling, modulation, RB mapping, etc). * NR-PUCCH - - Format 0 (ACK/NACK) + - Format 0 (2 bits, mainly for ACK/NACK) + - Format 2 (up to 64 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) +* Highly efficient 3GPP compliant polar encoder and decoder +* Encoder and decoder for short block -### gNB higher Layers ### - +## 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 MIB +- Generation of CellGroupConfig (for eNB) and MIB - Application to read configuration file and program gNB RRC -- RRC -> MAC configuration -- MAC -> PHY configuration (using NR FAPI P5 interface) -- FAPI P7 interface for BCH PDU, DCI PDU, PDSCH PDU +- RRC can configure PDCP, RLC, MAC -For more details see [this document](https://gitlab.eurecom.fr/oai/openairinterface5g/uploads/ba5368448d627743a28c770c29e8978e/OAI_Software_Architecture_for_Dual_Connectivity_in_E-UTRA_and_5G-NR_and_nFAPI_for_MAC-PHY_Interface.docx) +**gNB X2AP** +- X2 setup with eNB +- Handling of SgNB Addition Request / Addition Request Acknowledge / Reconfiguration Complete -## NR UE Features ## +**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 for RA procedreat gNB +- MAC downlink scheduler (fixed allocations) +- 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 -### NR UE PHY Layer ### -- initial synchronization -- Time tracking based on PDCCH DMRS -- Frequency offset estimation -- PBCH RX -- PDCCH RX -- PDSCH RX - - including first version of dual stream receiver for PDSCH +# 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 + +## UE PHY Layer ## + +* Initial synchronization +* Time tracking based on PBCH DMRS +* Time tracking based on PBCH DMRS +* Frequency offset estimation +* PBCH RX +* PDCCH RX +* PDSCH RX, including a first version of dual stream receiver for PDSCH +* 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-PDSCH (including Segmentation, LDPC encoding, rate matching, scrambling, modulation, RB mapping, etc). + - Single symbol DMRS, DMRS-TypeA-Position Pos2, DMRS configuration type 1 + - PDSCH mapping type A +* NR-CSI Generation of sequence at PHY (**under integration**) +* NR-PUSCH (including Segmentation, LDPC encoding, rate matching, scrambling, modulation, RB mapping, etc). +* NR-PUCCH + - Format 0 (2 bits, mainly for ACK/NACK) + - Format 2 (up to 64 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) +* Highly efficient 3GPP compliant polar encoder and decoder +* Encoder and decoder for short block + + +## UE Higher Layers ## + +**gNB MAC** +- Initial sync and MIB detection +- MAC -> PHY configuration of PHY via UE FAPI P5 interface +- Basic MAC to control PHY via UE FAPI P7 interface +- Random ccess procedure + +**RLC** + +**PDCP** -### NR UE higher Layers ### -For more details see [this document](https://gitlab.eurecom.fr/oai/openairinterface5g/uploads/f7386f3a64806fd6b2ac1fc3d0252fff/UE_FAPI-like_interface.docx) [OAI wiki home](https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/home) From b9f9d69bfdf6bd286d224ee546001bff9a3821c2 Mon Sep 17 00:00:00 2001 From: Florian Kaltenberger Date: Fri, 12 Jun 2020 11:31:00 +0200 Subject: [PATCH 07/14] doc update --- doc/FEATURE_SET.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/doc/FEATURE_SET.md b/doc/FEATURE_SET.md index a539b030e4..1e55147163 100644 --- a/doc/FEATURE_SET.md +++ b/doc/FEATURE_SET.md @@ -303,11 +303,9 @@ The following features are valid for the gNB and the 5G-NR UE. **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 for RA procedreat gNB +- Scheduler for RA procedure at gNB - MAC downlink scheduler (fixed allocations) - 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 # OpenAirInterface 5G-NR UE Feature Set # @@ -353,7 +351,7 @@ The following features are valid for the gNB and the 5G-NR UE. - Initial sync and MIB detection - MAC -> PHY configuration of PHY via UE FAPI P5 interface - Basic MAC to control PHY via UE FAPI P7 interface -- Random ccess procedure +- Random access procedure **RLC** From 1552be348c357dc9014528902660c81fd0f4c395 Mon Sep 17 00:00:00 2001 From: matzakos Date: Fri, 12 Jun 2020 14:33:08 +0200 Subject: [PATCH 08/14] Fix ULSCH slot scheduling inconsistency between nrUE and gNB --- openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c | 3 +++ openair1/SCHED_NR_UE/fapi_nr_ue_l1.c | 1 + openair1/SCHED_NR_UE/phy_procedures_nr_ue.c | 4 +++- openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c | 2 +- 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c index 49ba3a83b2..9be4a16fb5 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c @@ -466,6 +466,9 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE, } //} + NR_UL_UE_HARQ_t *harq_process_ulsch=NULL; + harq_process_ulsch = UE->ulsch[thread_id][gNB_id][0]->harq_processes[harq_pid]; + harq_process_ulsch->status = SCH_IDLE; /////////// //////////////////////////////////////////////////////////////////////// diff --git a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c index 4d297f6461..6d4e995701 100644 --- a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c +++ b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c @@ -144,6 +144,7 @@ int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){ memcpy(pusch_pdu, pusch_config_pdu, sizeof(nfapi_nr_ue_pusch_pdu_t)); ulsch0->f_pusch = pusch_config_pdu->absolute_delta_PUSCH; + ulsch0->harq_processes[current_harq_pid]->status = ACTIVE; break; case (FAPI_NR_UL_CONFIG_TYPE_PUCCH): diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index 98aac92786..caf644932a 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -2233,7 +2233,9 @@ void phy_procedures_nrUE_TX(PHY_VARS_NR_UE *ue, #endif if (ue->UE_mode[gNB_id] == PUSCH || get_softmodem_params()->phy_test == 1){ - nr_ue_ulsch_procedures(ue, harq_pid, frame_tx, slot_tx, thread_id, gNB_id); + if (ue->ulsch[thread_id][gNB_id][0]->harq_processes[harq_pid]->status == ACTIVE) + nr_ue_ulsch_procedures(ue, harq_pid, frame_tx, slot_tx, thread_id, gNB_id); + /* if (ue->UE_mode[eNB_id] == PUSCH) { diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c index 2ccd1f369b..53ef0f62a3 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c @@ -755,7 +755,7 @@ NR_UE_L2_STATE_t nr_ue_scheduler(nr_downlink_indication_t *dl_info, nr_uplink_in } */ } - } else if (ul_info) { + } else if (ul_info && ul_info->slot_tx == 8) { module_id_t mod_id = ul_info->module_id; uint32_t gNB_index = ul_info->gNB_index; int cc_id = ul_info->cc_id; From 928c189ef08a4a750976553727e339bf552588b2 Mon Sep 17 00:00:00 2001 From: matzakos Date: Fri, 12 Jun 2020 14:44:52 +0200 Subject: [PATCH 09/14] Modify starting LCID for DTCH to start from 4 instead of 3 for both UL and DL - Make required adaptations in RLC and default DRB configuration --- openair2/LAYER2/NR_MAC_COMMON/nr_mac.h | 2 +- openair2/LAYER2/PDCP_v10.1.0/pdcp.c | 2 +- openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c | 26 +++++++++++----------- openair2/LAYER2/nr_rlc/nr_rlc_ue_manager.h | 2 +- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_COMMON/nr_mac.h b/openair2/LAYER2/NR_MAC_COMMON/nr_mac.h index 04b213b0d2..20b4c85dc6 100644 --- a/openair2/LAYER2/NR_MAC_COMMON/nr_mac.h +++ b/openair2/LAYER2/NR_MAC_COMMON/nr_mac.h @@ -176,7 +176,7 @@ typedef struct { #define DL_SCH_LCID_CCCH 0x00 #define DL_SCH_LCID_DCCH 0x01 #define DL_SCH_LCID_DCCH1 0x02 -#define DL_SCH_LCID_DTCH 0x03 +#define DL_SCH_LCID_DTCH 0x04 #define DL_SCH_LCID_RECOMMENDED_BITRATE 0x2F #define DL_SCH_LCID_SP_ZP_CSI_RS_RES_SET_ACT 0x30 #define DL_SCH_LCID_PUCCH_SPATIAL_RELATION_ACT 0x31 diff --git a/openair2/LAYER2/PDCP_v10.1.0/pdcp.c b/openair2/LAYER2/PDCP_v10.1.0/pdcp.c index b0e6143de1..617cb4d313 100644 --- a/openair2/LAYER2/PDCP_v10.1.0/pdcp.c +++ b/openair2/LAYER2/PDCP_v10.1.0/pdcp.c @@ -2390,7 +2390,7 @@ void nr_ip_over_LTE_DRB_preconfiguration(void){ // 1 + drb_identiy_index; DRB_config->drb_Identity = 1; DRB_config->logicalChannelIdentity = CALLOC(1, sizeof(long)); - *(DRB_config->logicalChannelIdentity) = DRB_config->drb_Identity + 2; //(long) (ue_context_pP->ue_context.e_rab[i].param.e_rab_id + 2); // value : x+2 + *(DRB_config->logicalChannelIdentity) = DRB_config->drb_Identity + 3; //(long) (ue_context_pP->ue_context.e_rab[i].param.e_rab_id + 2); // value : x+2 DRB_rlc_config = CALLOC(1, sizeof(*DRB_rlc_config)); DRB_config->rlc_Config = DRB_rlc_config; diff --git a/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c b/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c index ff0d446e3f..38ad658015 100644 --- a/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c +++ b/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c @@ -72,8 +72,8 @@ void mac_rlc_data_ind ( LOG_I(RLC, "RLC instance for the given UE was not found \n"); switch (channel_idP) { - case 1 ... 2: rb = ue->srb[channel_idP - 1]; break; - case 3 ... 7: rb = ue->drb[channel_idP - 3]; break; + case 1 ... 3: rb = ue->srb[channel_idP - 1]; break; + case 4 ... 7: rb = ue->drb[channel_idP - 4]; break; default: rb = NULL; break; } @@ -113,8 +113,8 @@ tbs_size_t mac_rlc_data_req( ue = nr_rlc_manager_get_ue(nr_rlc_ue_manager, rntiP); switch (channel_idP) { - case 1 ... 2: rb = ue->srb[channel_idP - 1]; break; - case 3 ... 7: rb = ue->drb[channel_idP - 3]; break; + case 1 ... 3: rb = ue->srb[channel_idP - 1]; break; + case 4 ... 7: rb = ue->drb[channel_idP - 4]; break; default: rb = NULL; break; } @@ -123,7 +123,7 @@ tbs_size_t mac_rlc_data_req( maxsize = tb_sizeP; ret = rb->generate_pdu(rb, buffer_pP, maxsize); } else { - LOG_E(RLC, "%s:%d:%s: fatal: data req for unknown RB\n", __FILE__, __LINE__, __FUNCTION__); + LOG_E(RLC, "%s:%d:%s: fatal: data req for unknown RB, channel_idP: %d\n", __FILE__, __LINE__, __FUNCTION__, channel_idP); exit(1); ret = 0; } @@ -166,8 +166,8 @@ mac_rlc_status_resp_t mac_rlc_status_ind( ue = nr_rlc_manager_get_ue(nr_rlc_ue_manager, rntiP); switch (channel_idP) { - case 1 ... 2: rb = ue->srb[channel_idP - 1]; break; - case 3 ... 7: rb = ue->drb[channel_idP - 3]; break; + case 1 ... 3: rb = ue->srb[channel_idP - 1]; break; + case 4 ... 7: rb = ue->drb[channel_idP - 4]; break; default: rb = NULL; break; } @@ -227,8 +227,8 @@ rlc_buffer_occupancy_t mac_rlc_get_buffer_occupancy_ind( ue = nr_rlc_manager_get_ue(nr_rlc_ue_manager, rntiP); switch (channel_idP) { - case 1 ... 2: rb = ue->srb[channel_idP - 1]; break; - case 3 ... 7: rb = ue->drb[channel_idP - 3]; break; + case 1 ... 3: rb = ue->srb[channel_idP - 1]; break; + case 4 ... 7: rb = ue->drb[channel_idP - 4]; break; default: rb = NULL; break; } @@ -654,11 +654,11 @@ static void add_drb_am(int rnti, struct LTE_DRB_ToAddMod *s) exit(1); } - if (channel_id != drb_id + 2) { + /*if (channel_id != drb_id + 2) { LOG_E(RLC, "%s:%d:%s: todo, remove this limitation\n", __FILE__, __LINE__, __FUNCTION__); exit(1); - } + }*/ logical_channel_group = *l->ul_SpecificParameters->logicalChannelGroup; @@ -737,11 +737,11 @@ static void add_drb_um(int rnti, struct LTE_DRB_ToAddMod *s) exit(1); } - if (channel_id != drb_id + 2) { + /*if (channel_id != drb_id + 2) { LOG_E(RLC, "%s:%d:%s: todo, remove this limitation\n", __FILE__, __LINE__, __FUNCTION__); exit(1); - } + }*/ logical_channel_group = *l->ul_SpecificParameters->logicalChannelGroup; diff --git a/openair2/LAYER2/nr_rlc/nr_rlc_ue_manager.h b/openair2/LAYER2/nr_rlc/nr_rlc_ue_manager.h index 464cf3d083..f578faaf38 100644 --- a/openair2/LAYER2/nr_rlc/nr_rlc_ue_manager.h +++ b/openair2/LAYER2/nr_rlc/nr_rlc_ue_manager.h @@ -28,7 +28,7 @@ typedef void nr_rlc_ue_manager_t; typedef struct nr_rlc_ue_t { int rnti; - nr_rlc_entity_t *srb[2]; + nr_rlc_entity_t *srb[3]; nr_rlc_entity_t *drb[5]; } nr_rlc_ue_t; From 9a177fd368446fcd91b8612e7da6290c5e3ef8f5 Mon Sep 17 00:00:00 2001 From: matzakos Date: Mon, 15 Jun 2020 10:42:04 +0200 Subject: [PATCH 10/14] Bring back mapping check between drb_id and channel_id --- openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c | 8 ++++---- openair2/LAYER2/nr_rlc/nr_rlc_ue_manager.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c b/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c index 38ad658015..47ffd6143c 100644 --- a/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c +++ b/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c @@ -654,11 +654,11 @@ static void add_drb_am(int rnti, struct LTE_DRB_ToAddMod *s) exit(1); } - /*if (channel_id != drb_id + 2) { + if (channel_id != drb_id + 3) { LOG_E(RLC, "%s:%d:%s: todo, remove this limitation\n", __FILE__, __LINE__, __FUNCTION__); exit(1); - }*/ + } logical_channel_group = *l->ul_SpecificParameters->logicalChannelGroup; @@ -737,11 +737,11 @@ static void add_drb_um(int rnti, struct LTE_DRB_ToAddMod *s) exit(1); } - /*if (channel_id != drb_id + 2) { + if (channel_id != drb_id + 3) { LOG_E(RLC, "%s:%d:%s: todo, remove this limitation\n", __FILE__, __LINE__, __FUNCTION__); exit(1); - }*/ + } logical_channel_group = *l->ul_SpecificParameters->logicalChannelGroup; diff --git a/openair2/LAYER2/nr_rlc/nr_rlc_ue_manager.h b/openair2/LAYER2/nr_rlc/nr_rlc_ue_manager.h index f578faaf38..3683e50abc 100644 --- a/openair2/LAYER2/nr_rlc/nr_rlc_ue_manager.h +++ b/openair2/LAYER2/nr_rlc/nr_rlc_ue_manager.h @@ -29,7 +29,7 @@ typedef void nr_rlc_ue_manager_t; typedef struct nr_rlc_ue_t { int rnti; nr_rlc_entity_t *srb[3]; - nr_rlc_entity_t *drb[5]; + nr_rlc_entity_t *drb[4]; } nr_rlc_ue_t; /***********************************************************************/ From 45ed1e80661325485a25db7704f2d5fd3ab381b9 Mon Sep 17 00:00:00 2001 From: Thomas Schlichter Date: Mon, 15 Jun 2020 14:44:32 +0200 Subject: [PATCH 11/14] revert the number of DRB from 4 back to 5 --- openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c | 8 ++++---- openair2/LAYER2/nr_rlc/nr_rlc_ue_manager.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c b/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c index 47ffd6143c..bbc4acbd56 100644 --- a/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c +++ b/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c @@ -73,7 +73,7 @@ void mac_rlc_data_ind ( switch (channel_idP) { case 1 ... 3: rb = ue->srb[channel_idP - 1]; break; - case 4 ... 7: rb = ue->drb[channel_idP - 4]; break; + case 4 ... 8: rb = ue->drb[channel_idP - 4]; break; default: rb = NULL; break; } @@ -114,7 +114,7 @@ tbs_size_t mac_rlc_data_req( switch (channel_idP) { case 1 ... 3: rb = ue->srb[channel_idP - 1]; break; - case 4 ... 7: rb = ue->drb[channel_idP - 4]; break; + case 4 ... 8: rb = ue->drb[channel_idP - 4]; break; default: rb = NULL; break; } @@ -167,7 +167,7 @@ mac_rlc_status_resp_t mac_rlc_status_ind( switch (channel_idP) { case 1 ... 3: rb = ue->srb[channel_idP - 1]; break; - case 4 ... 7: rb = ue->drb[channel_idP - 4]; break; + case 4 ... 8: rb = ue->drb[channel_idP - 4]; break; default: rb = NULL; break; } @@ -228,7 +228,7 @@ rlc_buffer_occupancy_t mac_rlc_get_buffer_occupancy_ind( switch (channel_idP) { case 1 ... 3: rb = ue->srb[channel_idP - 1]; break; - case 4 ... 7: rb = ue->drb[channel_idP - 4]; break; + case 4 ... 8: rb = ue->drb[channel_idP - 4]; break; default: rb = NULL; break; } diff --git a/openair2/LAYER2/nr_rlc/nr_rlc_ue_manager.h b/openair2/LAYER2/nr_rlc/nr_rlc_ue_manager.h index 3683e50abc..f578faaf38 100644 --- a/openair2/LAYER2/nr_rlc/nr_rlc_ue_manager.h +++ b/openair2/LAYER2/nr_rlc/nr_rlc_ue_manager.h @@ -29,7 +29,7 @@ typedef void nr_rlc_ue_manager_t; typedef struct nr_rlc_ue_t { int rnti; nr_rlc_entity_t *srb[3]; - nr_rlc_entity_t *drb[4]; + nr_rlc_entity_t *drb[5]; } nr_rlc_ue_t; /***********************************************************************/ From 456e6c9207d7003be1d4d57ca4eddc2c51b63862 Mon Sep 17 00:00:00 2001 From: matzakos Date: Tue, 16 Jun 2020 17:40:03 +0200 Subject: [PATCH 12/14] Change return type of nr_generate_ulsch_pdu() to avoid overflow on the offset variable --- openair2/LAYER2/NR_MAC_UE/mac_proto.h | 2 +- openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_UE/mac_proto.h b/openair2/LAYER2/NR_MAC_UE/mac_proto.h index 2d49cc0d76..38c9244014 100755 --- a/openair2/LAYER2/NR_MAC_UE/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_UE/mac_proto.h @@ -139,7 +139,7 @@ void nr_ue_process_mac_pdu(module_id_t module_idP, NR_UL_TIME_ALIGNMENT_t *ul_time_alignment); -unsigned char nr_generate_ulsch_pdu(uint8_t *sdus_payload, +uint16_t nr_generate_ulsch_pdu(uint8_t *sdus_payload, uint8_t *pdu, uint8_t num_sdus, uint16_t *sdu_lengths, diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c index 53ef0f62a3..8e4d092591 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c @@ -3723,7 +3723,7 @@ void nr_ue_process_mac_pdu(module_id_t module_idP, /////* ULSCH MAC PDU generation (6.1.2 TS 38.321) *///// //////////////////////////////////////////////////////// -unsigned char nr_generate_ulsch_pdu(uint8_t *sdus_payload, +uint16_t nr_generate_ulsch_pdu(uint8_t *sdus_payload, uint8_t *pdu, uint8_t num_sdus, uint16_t *sdu_lengths, @@ -3738,7 +3738,8 @@ unsigned char nr_generate_ulsch_pdu(uint8_t *sdus_payload, NR_MAC_SUBHEADER_FIXED *mac_pdu_ptr = (NR_MAC_SUBHEADER_FIXED *) pdu; unsigned char last_size = 0, i, mac_header_control_elements[16], *ce_ptr, bsr = 0; - int mac_ce_size, offset; + int mac_ce_size; + uint16_t offset = 0; LOG_D(MAC, "[UE] Generating ULSCH PDU : num_sdus %d\n", num_sdus); @@ -3888,7 +3889,7 @@ unsigned char nr_generate_ulsch_pdu(uint8_t *sdus_payload, // compute final offset offset = ((unsigned char *) mac_pdu_ptr - pdu); - //printf("Offset %d \n", ((unsigned char *) mac_pdu_ptr - mac_pdu)); + //printf("Offset %d \n", ((unsigned char *) mac_pdu_ptr - pdu)); return offset; } From 65b5a48ed196b2510c19472b38deb067bfe42d77 Mon Sep 17 00:00:00 2001 From: matzakos Date: Tue, 16 Jun 2020 17:41:34 +0200 Subject: [PATCH 13/14] Minor logs modifications at gNB ulsch scheduler --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index 88358060e0..0e42d79fdc 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -209,7 +209,7 @@ void nr_process_mac_pdu( mac_subheader_len = 2; } - LOG_D(MAC, "[UE %d] Frame %d : DLSCH -> DL-DTCH %d (gNB %d, %d bytes)\n", module_idP, frameP, rx_lcid, module_idP, mac_sdu_len); + LOG_D(MAC, "[UE %d] Frame %d : ULSCH -> UL-DTCH %d (gNB %d, %d bytes)\n", module_idP, frameP, rx_lcid, module_idP, mac_sdu_len); #if defined(ENABLE_MAC_PAYLOAD_DEBUG) LOG_T(MAC, "[UE %d] First 32 bytes of DLSCH : \n", module_idP); @@ -249,7 +249,7 @@ void nr_process_mac_pdu( pdu_len -= ( mac_subheader_len + mac_ce_len + mac_sdu_len ); if (pdu_len < 0) { - LOG_E(MAC, "%s() residual mac pdu length < 0!\n", __func__); + LOG_E(MAC, "%s() residual mac pdu length < 0!, pdu_len: %d\n", __func__, pdu_len); return; } } From 3bce9a7b85f6f8dff8ba2f98142451a90fd8f8bd Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Wed, 17 Jun 2020 14:19:40 +0200 Subject: [PATCH 14/14] CI: increase gNB VM RAM size; display memory usage during modems runs Signed-off-by: Raphael Defosseux --- ci-scripts/oai-ci-vm-tool | 2 +- ci-scripts/runTestOnVM.sh | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/ci-scripts/oai-ci-vm-tool b/ci-scripts/oai-ci-vm-tool index 3fa91b862c..9b9fe462f1 100755 --- a/ci-scripts/oai-ci-vm-tool +++ b/ci-scripts/oai-ci-vm-tool @@ -197,7 +197,7 @@ function variant__v4__cppcheck { } function variant__v5__gnb_usrp { - VM_MEMORY=8192 + VM_MEMORY=10240 VM_CPU=8 NB_PATTERN_FILES=9 BUILD_OPTIONS="--gNB -w USRP" diff --git a/ci-scripts/runTestOnVM.sh b/ci-scripts/runTestOnVM.sh index aa3f171770..21689351c8 100755 --- a/ci-scripts/runTestOnVM.sh +++ b/ci-scripts/runTestOnVM.sh @@ -89,6 +89,9 @@ function start_basic_sim_enb { fi done ENB_SYNC=0 + echo "echo \"free -m\"" > $1 + echo "free -m" >> $1 + ssh -T -o StrictHostKeyChecking=no ubuntu@$LOC_VM_IP_ADDR < $1 rm $1 if [ $i -lt 50 ] then @@ -151,6 +154,9 @@ function start_basic_sim_ue { i=$[$i+1] fi done + echo "echo \"free -m\"" > $1 + echo "free -m" >> $1 + ssh -T -o StrictHostKeyChecking=no ubuntu@$2 < $1 rm $1 if [ $i -lt 50 ] then @@ -764,6 +770,9 @@ function start_l2_sim_enb { i=$[$i+1] fi done + echo "echo \"free -m\"" > $1 + echo "free -m" >> $1 + ssh -T -o StrictHostKeyChecking=no ubuntu@$LOC_ENB_VM_IP_ADDR < $1 rm $1 ENB_SYNC=1 if [ $i -lt 50 ] @@ -872,6 +881,9 @@ function start_l2_sim_ue { i=$[$i+1] fi done + echo "echo \"free -m\"" > $1 + echo "free -m" >> $1 + ssh -T -o StrictHostKeyChecking=no ubuntu@$LOC_UE_VM_IP_ADDR < $1 rm $1 UE_SYNC=1 if [ $i -lt 50 ] @@ -985,6 +997,9 @@ function start_rf_sim_enb { i=$[$i+1] fi done + echo "echo \"free -m\"" > $1 + echo "free -m" >> $1 + ssh -T -o StrictHostKeyChecking=no ubuntu@$LOC_ENB_VM_IP_ADDR < $1 rm $1 if [ $i -lt 50 ] then @@ -1114,6 +1129,9 @@ function start_rf_sim_ue { i=$[$i+1] fi done + echo "echo \"free -m\"" > $1 + echo "free -m" >> $1 + ssh -T -o StrictHostKeyChecking=no ubuntu@$LOC_UE_VM_IP_ADDR < $1 rm $1 if [ $i -lt 50 ] then @@ -1236,6 +1254,10 @@ function start_rf_sim_gnb { fi fi sleep 10 + echo "echo \"free -m\"" > $1 + echo "free -m" >> $1 + ssh -T -o StrictHostKeyChecking=no ubuntu@$LOC_GNB_VM_IP_ADDR < $1 + rm $1 # Copy the RAW files from the gNB run for the NR-UE scp -o StrictHostKeyChecking=no ubuntu@$LOC_GNB_VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/ran_build/build/rbconfig.raw . scp -o StrictHostKeyChecking=no ubuntu@$LOC_GNB_VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/ran_build/build/reconfig.raw . @@ -1310,6 +1332,9 @@ function start_rf_sim_nr_ue { i=$[$i+1] fi done + echo "echo \"free -m\"" > $1 + echo "free -m" >> $1 + ssh -T -o StrictHostKeyChecking=no ubuntu@$LOC_NR_UE_VM_IP_ADDR < $1 rm $1 if [ $i -lt 50 ] then