From a6d9d8a2d181dc3755c132fff6b9e2999231ba36 Mon Sep 17 00:00:00 2001 From: francescomani Date: Tue, 19 Oct 2021 16:56:25 +0200 Subject: [PATCH 01/39] ue capabilities xml file in SA conf files --- .../PROJECTS/GENERIC-NR-5GC/CONF/uecap.xml | 1375 +++++++++++++++++ 1 file changed, 1375 insertions(+) create mode 100644 targets/PROJECTS/GENERIC-NR-5GC/CONF/uecap.xml diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/uecap.xml b/targets/PROJECTS/GENERIC-NR-5GC/CONF/uecap.xml new file mode 100644 index 0000000000..00d74af54b --- /dev/null +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/uecap.xml @@ -0,0 +1,1375 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 11 + + + + + + + 01 + + + + + + + + + + + + + + + + + 8 + 64 + + + + 4 + 32 + + + 2 + 2 + 0 + 2 + 2 + + + + 0 + 4 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 78 + + + + + + + + + + + + + + + + + + + + + + 2 + 8 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 8 + 64 + + + + + + 8 + 32 + + + + + + 4 + 64 + + + + + + 2 + 64 + + + + + + 4 + + + + + 8 + 64 + + + + 4 + 32 + + + 2 + 2 + 0 + 2 + 2 + + + + 0 + 4 + + + 2 + 1 + 8 + 16 + + + + + + + + + + + + + + 0000000000 + 0001011111 + 0000000000 + + + + + 0000000000 + 0001011111 + 0000000000 + + + + + + + + 1000000000000000 + + + + + 1000000000000000 + + + + + + + + + 78 + + + + + + + + + 0 + + + + + + + + 78 + + + + + + + + + + + + + + + + 8 + 64 + + 8 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + 2 + + + + + + + + 3 + + + + + + + + 4 + + + + + + + + 5 + + + + + + + + 6 + + + + + + + + 7 + + + + + + + + 8 + + + + + + + + 9 + + + + + + + + 10 + + + + + + + + 11 + + + + + + + + 12 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + + + + 6 + + + + 6 + + + + 2 + + + + + + + + 2 + + + + + + 6 + + + + 6 + + + + 2 + + + + + + + + 3 + + + + + + 6 + + + + 6 + + + + 2 + + + + + + + + 4 + + + + + + 6 + + + + 6 + + + + 2 + + + + + + + + 5 + + + + + + 6 + + + + 6 + + + + 2 + + + + + + + + 6 + + + + + + 6 + + + + 6 + + + + 2 + + + + + + + + 7 + + + + + + 6 + + + + 6 + + + + 2 + + + + + + + + 8 + + + + + + 6 + + + + 6 + + + + 2 + + + + + + + + 9 + + + + + + 6 + + + + 6 + + + + 2 + + + + + + + + 10 + + + + + + 6 + + + + 6 + + + + 2 + + + + + + + + 11 + + + + + + 6 + + + + 6 + + + + 2 + + + + + + + + 12 + + + + + + 6 + + + + 6 + + + + 2 + + + + + + + + 11 + + + + + + 6 + + + + 6 + + + + 2 + + + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 2 + 2 + + + + + + + + + 7 + 38 + + + + + + + + + + + + + + + + + + + + + From 3556423cf083597dc15df3239983700fc26bfc3d Mon Sep 17 00:00:00 2001 From: francescomani Date: Tue, 26 Oct 2021 13:55:29 +0200 Subject: [PATCH 02/39] read uecap file in nr_rrc_ue_process_ueCapabilityEnquiry --- openair2/RRC/NR_UE/rrc_UE.c | 34 +- .../PROJECTS/GENERIC-NR-5GC/CONF/uecap.xml | 2731 ++++++++--------- 2 files changed, 1383 insertions(+), 1382 deletions(-) diff --git a/openair2/RRC/NR_UE/rrc_UE.c b/openair2/RRC/NR_UE/rrc_UE.c index 7c664d292d..99f60a1660 100644 --- a/openair2/RRC/NR_UE/rrc_UE.c +++ b/openair2/RRC/NR_UE/rrc_UE.c @@ -2597,14 +2597,22 @@ nr_rrc_ue_process_ueCapabilityEnquiry( //----------------------------------------------------------------------------- { asn_enc_rval_t enc_rval; + asn_dec_rval_t dec_rval; NR_UL_DCCH_Message_t ul_dcch_msg; NR_UE_CapabilityRAT_Container_t ue_CapabilityRAT_Container; + char UE_NR_Capability_xer_fname[1024]; + char UE_NR_Capability_xer[8192]; + size_t size; uint8_t buffer[200]; int i; LOG_I(NR_RRC,"[UE %d] Frame %d: Receiving from SRB1 (DL-DCCH), Processing UECapabilityEnquiry (gNB %d)\n", ctxt_pP->module_id, ctxt_pP->frame, gNB_index); + + sprintf(UE_NR_Capability_xer_fname,"%stargets/PROJECTS/GENERIC-NR-5GC/CONF/uecap.xml",getenv("OPENAIR_HOME")); + FILE *f = fopen(UE_NR_Capability_xer_fname, "r"); + memset((void *)&ul_dcch_msg,0,sizeof(NR_UL_DCCH_Message_t)); memset((void *)&ue_CapabilityRAT_Container,0,sizeof(NR_UE_CapabilityRAT_Container_t)); ul_dcch_msg.message.present = NR_UL_DCCH_MessageType_PR_c1; @@ -2613,14 +2621,26 @@ nr_rrc_ue_process_ueCapabilityEnquiry( ul_dcch_msg.message.choice.c1->choice.ueCapabilityInformation = CALLOC(1, sizeof(struct NR_UECapabilityInformation)); ul_dcch_msg.message.choice.c1->choice.ueCapabilityInformation->rrc_TransactionIdentifier = UECapabilityEnquiry->rrc_TransactionIdentifier; ue_CapabilityRAT_Container.rat_Type = NR_RAT_Type_nr; - NR_UE_NR_Capability_t* UE_Capability_nr; + NR_UE_NR_Capability_t* UE_Capability_nr; UE_Capability_nr = CALLOC(1,sizeof(NR_UE_NR_Capability_t)); - NR_BandNR_t *nr_bandnr; - nr_bandnr = CALLOC(1,sizeof(NR_BandNR_t)); - nr_bandnr->bandNR = 1; - ASN_SEQUENCE_ADD( - &UE_Capability_nr->rf_Parameters.supportedBandListNR.list, - nr_bandnr); + + if(f){ + size = fread(UE_NR_Capability_xer, 1, sizeof UE_NR_Capability_xer, f); + if (size == 0 || size == sizeof UE_NR_Capability_xer) { + LOG_E(NR_RRC,"UE Capabilities XER file %s is too large\n", UE_NR_Capability_xer_fname); + free(UE_Capability_nr); + return; + } + dec_rval = xer_decode(0, &asn_DEF_NR_UE_NR_Capability, (void *)UE_Capability_nr, UE_NR_Capability_xer, size); + assert(dec_rval.code == RC_OK); + } + else { + NR_BandNR_t *nr_bandnr; + nr_bandnr = CALLOC(1,sizeof(NR_BandNR_t)); + nr_bandnr->bandNR = 1; + ASN_SEQUENCE_ADD(&UE_Capability_nr->rf_Parameters.supportedBandListNR.list, + nr_bandnr); + } OAI_NR_UECapability_t *UECap; UECap = CALLOC(1,sizeof(OAI_NR_UECapability_t)); UECap->UE_NR_Capability = UE_Capability_nr; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/uecap.xml b/targets/PROJECTS/GENERIC-NR-5GC/CONF/uecap.xml index 00d74af54b..994b64e4ae 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/uecap.xml +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/uecap.xml @@ -1,1375 +1,1356 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 11 - - - - - - - 01 - - - - - - - - - - - - - - - - - 8 - 64 - - - - 4 - 32 - - - 2 - 2 - 0 - 2 - 2 - - - - 0 - 4 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 78 - - - - - - - - - - - - - - - - - - - - - - 2 - 8 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 8 - 64 - - - - - - 8 - 32 - - - - - - 4 - 64 - - - - - - 2 - 64 - - - - - - 4 - - - - - 8 - 64 - - - - 4 - 32 - - - 2 - 2 - 0 - 2 - 2 - - - - 0 - 4 - - - 2 - 1 - 8 - 16 - - - - - - - - - - - - - - 0000000000 - 0001011111 - 0000000000 - - - - - 0000000000 - 0001011111 - 0000000000 - - - - - - - - 1000000000000000 - - - - - 1000000000000000 - - - - - - - - - 78 - - - - - - - - - 0 - - - - - - - - 78 - - - - - - - - - - - - - - - - 8 - 64 - - 8 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1 - - - - - - - - 2 - - - - - - - - 3 - - - - - - - - 4 - - - - - - - - 5 - - - - - - - - 6 - - - - - - - - 7 - - - - - - - - 8 - - - - - - - - 9 - - - - - - - - 10 - - - - - - - - 11 - - - - - - - - 12 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1 - - - - - - 6 - - - - 6 - - - - 2 - - - - - - - - 2 - - - - - - 6 - - - - 6 - - - - 2 - - - - - - - - 3 - - - - - - 6 - - - - 6 - - - - 2 - - - - - - - - 4 - - - - - - 6 - - - - 6 - - - - 2 - - - - - - - - 5 - - - - - - 6 - - - - 6 - - - - 2 - - - - - - - - 6 - - - - - - 6 - - - - 6 - - - - 2 - - - - - - - - 7 - - - - - - 6 - - - - 6 - - - - 2 - - - - - - - - 8 - - - - - - 6 - - - - 6 - - - - 2 - - - - - - - - 9 - - - - - - 6 - - - - 6 - - - - 2 - - - - - - - - 10 - - - - - - 6 - - - - 6 - - - - 2 - - - - - - - - 11 - - - - - - 6 - - - - 6 - - - - 2 - - - - - - - - 12 - - - - - - 6 - - - - 6 - - - - 2 - - - - - - - - 11 - - - - - - 6 - - - - 6 - - - - 2 - - - - - - - - - - - - - - - - - - - - - 1 - - - - - - - - - - - - - - - - - - - - - - 1 - - - - - - - - - - - - - - - - - - - 1 - - - - - - - - - - - - - - - - - - - 1 - - - - - - - - - - - - - - - - - - - 1 - - - - - - - - - - - - - - - - - - - 1 - - - - - - - - - - - - - - - - - - - 1 - - - - - - - - - - - - - - - - - - - 1 - - - - - - - - - - - - - - - - - - - 1 - - - - - - - - - - - - - - - - - - - 1 - - - - - - - - - - - - - - - - - - - - - - 1 - - - - - - - - - - - - - - - - - - - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 2 - 2 - - - - - - - - - 7 - 38 - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 11 + + + + + + + 01 + + + + + + + + + + + + + + + + + 8 + 64 + + + + 4 + 32 + + + 2 + 2 + 0 + 2 + 2 + + + + 0 + 4 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 78 + + + + + + + + + + + + + + + + + + + + + + 2 + 8 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 8 + 64 + + + + + + 8 + 32 + + + + + + 4 + 64 + + + + + + 2 + 64 + + + + + + 4 + + + + + 8 + 64 + + + + 4 + 32 + + + 2 + 2 + 0 + 2 + 2 + + + + 0 + 4 + + + 2 + 1 + 8 + 16 + + + + + + + + + + + + + + 0000000000 + 0001011111 + 0000000000 + + + + + 0000000000 + 0001011111 + 0000000000 + + + + + + + + 1000000000000000 + + + + + 1000000000000000 + + + + + + + + + 78 + + + + + + + + + 0 + + + + + + + + 78 + + + + + + + + + + + + + + + + 8 + 64 + + 8 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + 2 + + + + + + + + 3 + + + + + + + + 4 + + + + + + + + 5 + + + + + + + + 6 + + + + + + + + 7 + + + + + + + + 8 + + + + + + + + 9 + + + + + + + + 10 + + + + + + + + 11 + + + + + + + + 12 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + + + + 6 + + + + 6 + + + + 2 + + + + + + + + 2 + + + + + + 6 + + + + 6 + + + + 2 + + + + + + + + 3 + + + + + + 6 + + + + 6 + + + + 2 + + + + + + + + 4 + + + + + + 6 + + + + 6 + + + + 2 + + + + + + + + 5 + + + + + + 6 + + + + 6 + + + + 2 + + + + + + + + 6 + + + + + + 6 + + + + 6 + + + + 2 + + + + + + + + 7 + + + + + + 6 + + + + 6 + + + + 2 + + + + + + + + 8 + + + + + + 6 + + + + 6 + + + + 2 + + + + + + + + 9 + + + + + + 6 + + + + 6 + + + + 2 + + + + + + + + 10 + + + + + + 6 + + + + 6 + + + + 2 + + + + + + + + 11 + + + + + + 6 + + + + 6 + + + + 2 + + + + + + + + 12 + + + + + + 6 + + + + 6 + + + + 2 + + + + + + + + 11 + + + + + + 6 + + + + 6 + + + + 2 + + + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 2 + 2 + + + + + + + + + 7 + 38 + + + + + + + + + + + + + From 35c4623bf2a68050ff3b22f74a16f6fabc8217ca Mon Sep 17 00:00:00 2001 From: francescomani Date: Wed, 27 Oct 2021 12:16:03 +0200 Subject: [PATCH 03/39] fixes in uecap function --- openair2/RRC/NR_UE/rrc_UE.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/openair2/RRC/NR_UE/rrc_UE.c b/openair2/RRC/NR_UE/rrc_UE.c index 99f60a1660..1e2f10aaaa 100644 --- a/openair2/RRC/NR_UE/rrc_UE.c +++ b/openair2/RRC/NR_UE/rrc_UE.c @@ -2601,7 +2601,7 @@ nr_rrc_ue_process_ueCapabilityEnquiry( NR_UL_DCCH_Message_t ul_dcch_msg; NR_UE_CapabilityRAT_Container_t ue_CapabilityRAT_Container; char UE_NR_Capability_xer_fname[1024]; - char UE_NR_Capability_xer[8192]; + char UE_NR_Capability_xer[65536]; size_t size; uint8_t buffer[200]; int i; @@ -2610,7 +2610,7 @@ nr_rrc_ue_process_ueCapabilityEnquiry( ctxt_pP->frame, gNB_index); - sprintf(UE_NR_Capability_xer_fname,"%stargets/PROJECTS/GENERIC-NR-5GC/CONF/uecap.xml",getenv("OPENAIR_HOME")); + sprintf(UE_NR_Capability_xer_fname,"../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/uecap.xml"); FILE *f = fopen(UE_NR_Capability_xer_fname, "r"); memset((void *)&ul_dcch_msg,0,sizeof(NR_UL_DCCH_Message_t)); @@ -2627,7 +2627,7 @@ nr_rrc_ue_process_ueCapabilityEnquiry( if(f){ size = fread(UE_NR_Capability_xer, 1, sizeof UE_NR_Capability_xer, f); if (size == 0 || size == sizeof UE_NR_Capability_xer) { - LOG_E(NR_RRC,"UE Capabilities XER file %s is too large\n", UE_NR_Capability_xer_fname); + LOG_E(NR_RRC,"UE Capabilities XER file %s is too large (%ld)\n", UE_NR_Capability_xer_fname,size); free(UE_Capability_nr); return; } @@ -2644,9 +2644,7 @@ nr_rrc_ue_process_ueCapabilityEnquiry( OAI_NR_UECapability_t *UECap; UECap = CALLOC(1,sizeof(OAI_NR_UECapability_t)); UECap->UE_NR_Capability = UE_Capability_nr; - if ( LOG_DEBUGFLAG(DEBUG_ASN1) ) { - xer_fprint(stdout,&asn_DEF_NR_UE_NR_Capability,(void *)UE_Capability_nr); - } + xer_fprint(stdout,&asn_DEF_NR_UE_NR_Capability,(void *)UE_Capability_nr); enc_rval = uper_encode_to_buffer(&asn_DEF_NR_UE_NR_Capability, NULL, From c830f78f8a9e5d0f17c5c66aabfb1533af42b5a2 Mon Sep 17 00:00:00 2001 From: francescomani Date: Fri, 12 Nov 2021 16:42:03 +0100 Subject: [PATCH 04/39] UE capabilities directly from file for phy-test and do-ra --- openair2/RRC/NR/rrc_gNB_nsa.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/openair2/RRC/NR/rrc_gNB_nsa.c b/openair2/RRC/NR/rrc_gNB_nsa.c index 52f451d7bb..2d858f6d02 100644 --- a/openair2/RRC/NR/rrc_gNB_nsa.c +++ b/openair2/RRC/NR/rrc_gNB_nsa.c @@ -144,6 +144,27 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_ unsigned char *kUPenc = NULL; unsigned char *kUPint = NULL; int i; + + // In case of phy-test and do-ra mode, read UE capabilities directly from file + if (get_softmodem_params()->phy_test == 1 || get_softmodem_params()->do_ra == 1) { + NR_UE_NR_Capability_t* UE_Capability_nr = NULL; + char UE_NR_Capability_xer_fname[1024]; + char UE_NR_Capability_xer[65536]; + sprintf(UE_NR_Capability_xer_fname,"../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/uecap.xml"); + FILE *f = fopen(UE_NR_Capability_xer_fname, "r"); + if(f){ + size_t size = fread(UE_NR_Capability_xer, 1, sizeof UE_NR_Capability_xer, f); + if (size == 0 || size == sizeof UE_NR_Capability_xer) + LOG_E(NR_RRC,"UE Capabilities XER file %s is too large (%ld)\n", UE_NR_Capability_xer_fname,size); + else { + UE_Capability_nr = CALLOC(1,sizeof(NR_UE_NR_Capability_t)); + asn_dec_rval_t dec_rval = xer_decode(0, &asn_DEF_NR_UE_NR_Capability, (void *)UE_Capability_nr, UE_NR_Capability_xer, size); + assert(dec_rval.code == RC_OK); + } + } + ue_context_p->ue_context.UE_Capability_nr = UE_Capability_nr; + } + // NR RRCReconfiguration AssertFatal(rrc->Nb_ue < MAX_NR_RRC_UE_CONTEXTS,"cannot add another UE\n"); ue_context_p->ue_context.reconfig = calloc(1,sizeof(NR_RRCReconfiguration_t)); From 220e568c81a72ec7f78219ca064672513064ed52 Mon Sep 17 00:00:00 2001 From: francescomani Date: Thu, 16 Dec 2021 17:18:20 +0100 Subject: [PATCH 05/39] xml file that works, thanks to Cedric --- .../PROJECTS/GENERIC-NR-5GC/CONF/uecap.xml | 2218 +++++++---------- 1 file changed, 862 insertions(+), 1356 deletions(-) diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/uecap.xml b/targets/PROJECTS/GENERIC-NR-5GC/CONF/uecap.xml index 994b64e4ae..baca6649cb 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/uecap.xml +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/uecap.xml @@ -1,1356 +1,862 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 11 - - - - - - - 01 - - - - - - - - - - - - - - - - - 8 - 64 - - - - 4 - 32 - - - 2 - 2 - 0 - 2 - 2 - - - - 0 - 4 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 78 - - - - - - - - - - - - - - - - - - - - - - 2 - 8 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 8 - 64 - - - - - - 8 - 32 - - - - - - 4 - 64 - - - - - - 2 - 64 - - - - - - 4 - - - - - 8 - 64 - - - - 4 - 32 - - - 2 - 2 - 0 - 2 - 2 - - - - 0 - 4 - - - 2 - 1 - 8 - 16 - - - - - - - - - - - - - - 0000000000 - 0001011111 - 0000000000 - - - - - 0000000000 - 0001011111 - 0000000000 - - - - - - - - 1000000000000000 - - - - - 1000000000000000 - - - - - - - - - 78 - - - - - - - - - 0 - - - - - - - - 78 - - - - - - - - - - - - - - - - 8 - 64 - - 8 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1 - - - - - - - - 2 - - - - - - - - 3 - - - - - - - - 4 - - - - - - - - 5 - - - - - - - - 6 - - - - - - - - 7 - - - - - - - - 8 - - - - - - - - 9 - - - - - - - - 10 - - - - - - - - 11 - - - - - - - - 12 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1 - - - - - - 6 - - - - 6 - - - - 2 - - - - - - - - 2 - - - - - - 6 - - - - 6 - - - - 2 - - - - - - - - 3 - - - - - - 6 - - - - 6 - - - - 2 - - - - - - - - 4 - - - - - - 6 - - - - 6 - - - - 2 - - - - - - - - 5 - - - - - - 6 - - - - 6 - - - - 2 - - - - - - - - 6 - - - - - - 6 - - - - 6 - - - - 2 - - - - - - - - 7 - - - - - - 6 - - - - 6 - - - - 2 - - - - - - - - 8 - - - - - - 6 - - - - 6 - - - - 2 - - - - - - - - 9 - - - - - - 6 - - - - 6 - - - - 2 - - - - - - - - 10 - - - - - - 6 - - - - 6 - - - - 2 - - - - - - - - 11 - - - - - - 6 - - - - 6 - - - - 2 - - - - - - - - 12 - - - - - - 6 - - - - 6 - - - - 2 - - - - - - - - 11 - - - - - - 6 - - - - 6 - - - - 2 - - - - - - - - - - - - - - - - - - - - - 1 - - - - - - - - - - - - - - - - - - - - - - 1 - - - - - - - - - - - - - - - - - - - 1 - - - - - - - - - - - - - - - - - - - 1 - - - - - - - - - - - - - - - - - - - 1 - - - - - - - - - - - - - - - - - - - 1 - - - - - - - - - - - - - - - - - - - 1 - - - - - - - - - - - - - - - - - - - 1 - - - - - - - - - - - - - - - - - - - 1 - - - - - - - - - - - - - - - - - - - 1 - - - - - - - - - - - - - - - - - - - - - - 1 - - - - - - - - - - - - - - - - - - - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 2 - 2 - - - - - - - - - 7 - 38 - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 11 + + + + + 01 + + + + + + + + + 8 + 64 + + 4 + 32 + + + 2 + 2 + 0 + 2 + 2 + + 0 + 4 + + + + + + + + + + + + + + + + + + + + 78 + + + + + + + + + + 2 + 8 + + + + + + + + + + + + + + + + + + + 8 + 64 + + + + 8 + 32 + + + + 4 + 64 + + + + 2 + 64 + + + + 4 + + + + + 8 + 64 + + 4 + 32 + + + 2 + 2 + 0 + 2 + 2 + + 0 + 4 + + + 2 + 1 + 8 + 16 + + + + + + + + + + 0000000000 + + + 0001011111 + + + 0000000000 + + + + + + + 0000000000 + + + 0001011111 + + + 0000000000 + + + + + + + + + + + 1000000000000000 + + + + + + + 1000000000000000 + + + + + + + + + + + 78 + + + + + 0 + + + + + + 78 + + + + + + + + + + + + + + + 8 + 64 + + 8 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + + + + 2 + + + + + + 3 + + + + + + 4 + + + + + + 5 + + + + + + 6 + + + + + + 7 + + + + + + 8 + + + + + + 9 + + + + + + 10 + + + + + + 11 + + + + + + 12 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + + 6 + + 6 + + 2 + + + + + + 2 + + + + 6 + + 6 + + 2 + + + + + + 3 + + + + 6 + + 6 + + 2 + + + + + + 4 + + + + 6 + + 6 + + 2 + + + + + + 5 + + + + 6 + + 6 + + 2 + + + + + + 6 + + + + 6 + + 6 + + 2 + + + + + + 7 + + + + 6 + + 6 + + 2 + + + + + + 8 + + + + 6 + + 6 + + 2 + + + + + + 9 + + + + 6 + + 6 + + 2 + + + + + + 10 + + + + 6 + + 6 + + 2 + + + + + + 11 + + + + 6 + + 6 + + 2 + + + + + + 12 + + + + 6 + + 6 + + 2 + + + + + + 11 + + + + 6 + + 6 + + 2 + + + + + + + + + + + + + 1 + + + + + + + + + + + + 1 + + + + + + + + + + + 1 + + + + + + + + + + + 1 + + + + + + + + + + + 1 + + + + + + + + + + + 1 + + + + + + + + + + + 1 + + + + + + + + + + + 1 + + + + + + + + + + + 1 + + + + + + + + + + + 1 + + + + + + + + + + + + 1 + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 2 + 2 + + + + + + + + + 7 + 38 + + + + + + + + + From 9f87b9dd155596655f2676cacafb6e7f1cef05de Mon Sep 17 00:00:00 2001 From: francescomani Date: Fri, 17 Dec 2021 12:03:44 +0100 Subject: [PATCH 06/39] bugfix, thanks to Cedric --- openair2/RRC/NR/rrc_gNB_nsa.c | 3 ++- openair2/RRC/NR_UE/rrc_UE.c | 5 ++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/openair2/RRC/NR/rrc_gNB_nsa.c b/openair2/RRC/NR/rrc_gNB_nsa.c index 109d8bb8c3..399754bd00 100644 --- a/openair2/RRC/NR/rrc_gNB_nsa.c +++ b/openair2/RRC/NR/rrc_gNB_nsa.c @@ -156,8 +156,9 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_ LOG_E(NR_RRC,"UE Capabilities XER file %s is too large (%ld)\n", UE_NR_Capability_xer_fname,size); else { UE_Capability_nr = CALLOC(1,sizeof(NR_UE_NR_Capability_t)); - asn_dec_rval_t dec_rval = xer_decode(0, &asn_DEF_NR_UE_NR_Capability, (void *)UE_Capability_nr, UE_NR_Capability_xer, size); + asn_dec_rval_t dec_rval = xer_decode(0, &asn_DEF_NR_UE_NR_Capability, (void *)&UE_Capability_nr, UE_NR_Capability_xer, size); assert(dec_rval.code == RC_OK); + xer_fprint(stdout,&asn_DEF_NR_UE_NR_Capability,(void *)UE_Capability_nr); } } ue_context_p->ue_context.UE_Capability_nr = UE_Capability_nr; diff --git a/openair2/RRC/NR_UE/rrc_UE.c b/openair2/RRC/NR_UE/rrc_UE.c index fcd66624fd..beaa74fa2f 100644 --- a/openair2/RRC/NR_UE/rrc_UE.c +++ b/openair2/RRC/NR_UE/rrc_UE.c @@ -2643,8 +2643,7 @@ nr_rrc_ue_process_ueCapabilityEnquiry( ul_dcch_msg.message.choice.c1->choice.ueCapabilityInformation = CALLOC(1, sizeof(struct NR_UECapabilityInformation)); ul_dcch_msg.message.choice.c1->choice.ueCapabilityInformation->rrc_TransactionIdentifier = UECapabilityEnquiry->rrc_TransactionIdentifier; ue_CapabilityRAT_Container.rat_Type = NR_RAT_Type_nr; - NR_UE_NR_Capability_t* UE_Capability_nr; - UE_Capability_nr = CALLOC(1,sizeof(NR_UE_NR_Capability_t)); + NR_UE_NR_Capability_t* UE_Capability_nr = NULL; if(f){ size = fread(UE_NR_Capability_xer, 1, sizeof UE_NR_Capability_xer, f); @@ -2653,7 +2652,7 @@ nr_rrc_ue_process_ueCapabilityEnquiry( free(UE_Capability_nr); return; } - dec_rval = xer_decode(0, &asn_DEF_NR_UE_NR_Capability, (void *)UE_Capability_nr, UE_NR_Capability_xer, size); + dec_rval = xer_decode(0, &asn_DEF_NR_UE_NR_Capability, (void *)&UE_Capability_nr, UE_NR_Capability_xer, size); assert(dec_rval.code == RC_OK); } else { From fcfcc6050bf79e0fd08f63f92cac201a76ce7592 Mon Sep 17 00:00:00 2001 From: francescomani Date: Mon, 20 Dec 2021 09:13:01 +0100 Subject: [PATCH 07/39] fix in ue capability size --- openair2/RRC/NR_UE/rrc_defs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair2/RRC/NR_UE/rrc_defs.h b/openair2/RRC/NR_UE/rrc_defs.h index b79cbb4bae..790da98f1b 100644 --- a/openair2/RRC/NR_UE/rrc_defs.h +++ b/openair2/RRC/NR_UE/rrc_defs.h @@ -70,7 +70,7 @@ typedef enum { nr_RadioBearerConfigX_r15=1 } nsa_message_t; -#define MAX_UE_NR_CAPABILITY_SIZE 255 +#define MAX_UE_NR_CAPABILITY_SIZE 2048 typedef struct OAI_NR_UECapability_s { uint8_t sdu[MAX_UE_NR_CAPABILITY_SIZE]; uint8_t sdu_size; From 25bd60a96a9ca95f6f1cf52d9d2df099549e4eda Mon Sep 17 00:00:00 2001 From: francescomani Date: Thu, 23 Dec 2021 18:02:30 +0100 Subject: [PATCH 08/39] fixes in case of no uecap file found --- openair2/RRC/NR/rrc_gNB_nsa.c | 2 ++ openair2/RRC/NR_UE/rrc_UE.c | 1 + 2 files changed, 3 insertions(+) diff --git a/openair2/RRC/NR/rrc_gNB_nsa.c b/openair2/RRC/NR/rrc_gNB_nsa.c index 399754bd00..4fde0a1a0f 100644 --- a/openair2/RRC/NR/rrc_gNB_nsa.c +++ b/openair2/RRC/NR/rrc_gNB_nsa.c @@ -161,6 +161,8 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_ xer_fprint(stdout,&asn_DEF_NR_UE_NR_Capability,(void *)UE_Capability_nr); } } + else + LOG_E(NR_RRC,"Could not open UE Capabilities input file. Not handling OAI UE Capabilities.\n"); ue_context_p->ue_context.UE_Capability_nr = UE_Capability_nr; } diff --git a/openair2/RRC/NR_UE/rrc_UE.c b/openair2/RRC/NR_UE/rrc_UE.c index beaa74fa2f..e444b45fff 100644 --- a/openair2/RRC/NR_UE/rrc_UE.c +++ b/openair2/RRC/NR_UE/rrc_UE.c @@ -2656,6 +2656,7 @@ nr_rrc_ue_process_ueCapabilityEnquiry( assert(dec_rval.code == RC_OK); } else { + UE_Capability_nr = CALLOC(1,sizeof(NR_UE_NR_Capability_t)); NR_BandNR_t *nr_bandnr; nr_bandnr = CALLOC(1,sizeof(NR_BandNR_t)); nr_bandnr->bandNR = 1; From 0d3ee346bff9bbadba4ded2452286dc79355031b Mon Sep 17 00:00:00 2001 From: francescomani Date: Thu, 30 Dec 2021 12:17:11 +0100 Subject: [PATCH 09/39] uecap file path from command line at UE --- executables/nr-softmodem-common.h | 3 ++- executables/nr-ue.c | 6 ++++-- executables/nr-uesoftmodem.c | 3 ++- executables/nr-uesoftmodem.h | 7 ++++--- openair2/RRC/NR_UE/main_ue.c | 4 ++-- openair2/RRC/NR_UE/rrc_UE.c | 14 ++++++++++---- openair2/RRC/NR_UE/rrc_defs.h | 2 ++ openair2/RRC/NR_UE/rrc_proto.h | 4 ++-- 8 files changed, 28 insertions(+), 15 deletions(-) diff --git a/executables/nr-softmodem-common.h b/executables/nr-softmodem-common.h index c02155326b..22b616f29e 100644 --- a/executables/nr-softmodem-common.h +++ b/executables/nr-softmodem-common.h @@ -88,7 +88,8 @@ #define CONFIG_HLP_TNOFORK "to ease debugging with gdb\n" #define CONFIG_HLP_DISABLNBIOT "disable nb-iot, even if defined in config\n" #define CONFIG_HLP_DISABLETIMECORR "disable UE timing correction\n" -#define CONFIG_HLP_RRC_CFG_PATH "path for RRC configuration\n" +#define CONFIG_HLP_RRC_CFG_PATH "path for RRC configuration\n" +#define CONFIG_HLP_UECAP_PATH "path for UE Capabilities file\n" #define CONFIG_HLP_NUMEROLOGY "adding numerology for 5G\n" #define CONFIG_HLP_EMULATE_RF "Emulated RF enabled(disable by defult)\n" diff --git a/executables/nr-ue.c b/executables/nr-ue.c index 60ff40abeb..ee9c4cd174 100644 --- a/executables/nr-ue.c +++ b/executables/nr-ue.c @@ -756,13 +756,15 @@ void *UE_thread(void *arg) { return NULL; } -void init_NR_UE(int nb_inst, char* rrc_config_path) { +void init_NR_UE(int nb_inst, + char* uecap_path, + char* rrc_config_path) { int inst; NR_UE_MAC_INST_t *mac_inst; NR_UE_RRC_INST_t* rrc_inst; for (inst=0; inst < nb_inst; inst++) { - AssertFatal((rrc_inst = nr_l3_init_ue(rrc_config_path)) != NULL, "can not initialize RRC module\n"); + AssertFatal((rrc_inst = nr_l3_init_ue(uecap_path,rrc_config_path)) != NULL, "can not initialize RRC module\n"); AssertFatal((mac_inst = nr_l2_init_ue(rrc_inst)) != NULL, "can not initialize L2 module\n"); AssertFatal((mac_inst->if_module = nr_ue_if_module_init(inst)) != NULL, "can not initialize IF module\n"); } diff --git a/executables/nr-uesoftmodem.c b/executables/nr-uesoftmodem.c index ad5ea982c9..746297e6fb 100644 --- a/executables/nr-uesoftmodem.c +++ b/executables/nr-uesoftmodem.c @@ -115,6 +115,7 @@ int vcdflag = 0; double rx_gain_off = 0.0; char *usrp_args = NULL; char *rrc_config_path = NULL; +char *uecap_path = NULL; int dumpframe = 0; uint64_t downlink_frequency[MAX_NUM_CCs][4]; @@ -443,7 +444,7 @@ int main( int argc, char **argv ) { #endif LOG_I(HW, "Version: %s\n", PACKAGE_VERSION); - init_NR_UE(1,rrc_config_path); + init_NR_UE(1,uecap_path,rrc_config_path); if(IS_SOFTMODEM_NOS1 || get_softmodem_params()->sa) init_pdcp(); diff --git a/executables/nr-uesoftmodem.h b/executables/nr-uesoftmodem.h index 7f47ed5eb3..0def34dd39 100644 --- a/executables/nr-uesoftmodem.h +++ b/executables/nr-uesoftmodem.h @@ -33,8 +33,9 @@ {"dlsch-parallel", CONFIG_HLP_DLSCH_PARA, 0, iptr:(int32_t *)&nrUE_params.nr_dlsch_parallel, defintval:0, TYPE_UINT8, 0}, \ {"offset-divisor", CONFIG_HLP_OFFSET_DIV, 0, uptr:(uint32_t *)&nrUE_params.ofdm_offset_divisor, defuintval:UINT_MAX, TYPE_UINT32, 0}, \ {"nr-dlsch-demod-shift", CONFIG_HLP_DLSHIFT, 0, iptr:(int32_t *)&nr_dlsch_demod_shift, defintval:0, TYPE_INT, 0}, \ - {"V" , CONFIG_HLP_VCD, PARAMFLAG_BOOL, iptr:&vcdflag, defintval:0, TYPE_INT, 0}, \ - {"rrc_config_path", CONFIG_HLP_RRC_CFG_PATH,0, strptr:(char **)&rrc_config_path, defstrval:"./", TYPE_STRING, 0} \ + {"V" , CONFIG_HLP_VCD, PARAMFLAG_BOOL, iptr:&vcdflag, defintval:0, TYPE_INT, 0}, \ + {"uecap_path", CONFIG_HLP_UECAP_PATH, 0, strptr:(char **)&uecap_path, defstrval:"./", TYPE_STRING, 0}, \ + {"rrc_config_path", CONFIG_HLP_RRC_CFG_PATH,0, strptr:(char **)&rrc_config_path, defstrval:"./", TYPE_STRING, 0} \ } @@ -84,7 +85,7 @@ extern nrUE_params_t *get_nrUE_params(void); // In nr-ue.c extern int setup_nr_ue_buffers(PHY_VARS_NR_UE **phy_vars_ue, openair0_config_t *openair0_cfg); extern void fill_ue_band_info(void); -extern void init_NR_UE(int, char*); +extern void init_NR_UE(int, char*, char*); extern void init_NR_UE_threads(int); extern void reset_opp_meas(void); extern void print_opp_meas(void); diff --git a/openair2/RRC/NR_UE/main_ue.c b/openair2/RRC/NR_UE/main_ue.c index 07409c6026..5e2bc429eb 100644 --- a/openair2/RRC/NR_UE/main_ue.c +++ b/openair2/RRC/NR_UE/main_ue.c @@ -34,8 +34,8 @@ #include "rrc_proto.h" #include "common/utils/LOG/log.h" -NR_UE_RRC_INST_t* nr_l3_init_ue(char* rrc_config_path){ +NR_UE_RRC_INST_t* nr_l3_init_ue(char* uecap, char* rrc_config_path){ //LOG_I(RRC, "[MAIN] NR UE MAC initialization...\n"); - return openair_rrc_top_init_ue_nr(rrc_config_path); + return openair_rrc_top_init_ue_nr(uecap,rrc_config_path); } diff --git a/openair2/RRC/NR_UE/rrc_UE.c b/openair2/RRC/NR_UE/rrc_UE.c index e444b45fff..f2868e9c97 100644 --- a/openair2/RRC/NR_UE/rrc_UE.c +++ b/openair2/RRC/NR_UE/rrc_UE.c @@ -410,7 +410,7 @@ void process_nsa_message(NR_UE_RRC_INST_t *rrc, nsa_message_t nsa_message_type, } -NR_UE_RRC_INST_t* openair_rrc_top_init_ue_nr(char* rrc_config_path){ +NR_UE_RRC_INST_t* openair_rrc_top_init_ue_nr(char* uecap_path, char* rrc_config_path){ int nr_ue; if(NB_NR_UE_INST > 0){ NR_UE_rrc_inst = (NR_UE_RRC_INST_t *)malloc(NB_NR_UE_INST * sizeof(NR_UE_RRC_INST_t)); @@ -485,6 +485,8 @@ NR_UE_RRC_INST_t* openair_rrc_top_init_ue_nr(char* rrc_config_path){ RRC_LIST_INIT(NR_UE_rrc_inst[nr_ue].CSI_ReportConfig_list, NR_maxNrofCSI_ReportConfigurations); } + NR_UE_rrc_inst->uecap_path = uecap_path; + if (get_softmodem_params()->phy_test==1 || get_softmodem_params()->do_ra==1) { // read in files for RRCReconfiguration and RBconfig FILE *fd; @@ -494,7 +496,7 @@ NR_UE_RRC_INST_t* openair_rrc_top_init_ue_nr(char* rrc_config_path){ else sprintf(filename,"reconfig.raw"); fd = fopen(filename,"r"); - char buffer[1024]; + char buffer[1024]; AssertFatal(fd, "cannot read file %s: errno %d, %s\n", filename, @@ -2632,8 +2634,12 @@ nr_rrc_ue_process_ueCapabilityEnquiry( ctxt_pP->frame, gNB_index); - sprintf(UE_NR_Capability_xer_fname,"../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/uecap.xml"); - FILE *f = fopen(UE_NR_Capability_xer_fname, "r"); + FILE *f = NULL; + char *file_path = NR_UE_rrc_inst[ctxt_pP->module_id].uecap_path; + if (file_path) { + sprintf(UE_NR_Capability_xer_fname,"%s/uecap.xml",file_path); + f = fopen(UE_NR_Capability_xer_fname, "r"); + } memset((void *)&ul_dcch_msg,0,sizeof(NR_UL_DCCH_Message_t)); memset((void *)&ue_CapabilityRAT_Container,0,sizeof(NR_UE_CapabilityRAT_Container_t)); diff --git a/openair2/RRC/NR_UE/rrc_defs.h b/openair2/RRC/NR_UE/rrc_defs.h index 790da98f1b..d623481c81 100644 --- a/openair2/RRC/NR_UE/rrc_defs.h +++ b/openair2/RRC/NR_UE/rrc_defs.h @@ -120,6 +120,8 @@ typedef struct NR_UE_RRC_INST_s { NR_DRB_ToAddMod_t *DRB_config[NB_CNX_UE][8]; rb_id_t *defaultDRB; // remember the ID of the default DRB + char *uecap_path; + NR_SRB_INFO Srb0[NB_SIG_CNX_UE]; NR_SRB_INFO_TABLE_ENTRY Srb1[NB_CNX_UE]; NR_SRB_INFO_TABLE_ENTRY Srb2[NB_CNX_UE]; diff --git a/openair2/RRC/NR_UE/rrc_proto.h b/openair2/RRC/NR_UE/rrc_proto.h index 534da0112b..78237a709c 100644 --- a/openair2/RRC/NR_UE/rrc_proto.h +++ b/openair2/RRC/NR_UE/rrc_proto.h @@ -43,14 +43,14 @@ // main_rrc.c // /**\brief Layer 3 initialization*/ -NR_UE_RRC_INST_t* nr_l3_init_ue(char*); +NR_UE_RRC_INST_t* nr_l3_init_ue(char*,char*); // // UE_rrc.c // /**\brief Initial the top level RRC structure instance*/ -NR_UE_RRC_INST_t* openair_rrc_top_init_ue_nr(char*); +NR_UE_RRC_INST_t* openair_rrc_top_init_ue_nr(char*,char*); From f3874a21ad07b3f63399a903ae7ad5a3bf714616 Mon Sep 17 00:00:00 2001 From: francescomani Date: Fri, 24 Dec 2021 10:11:42 +0100 Subject: [PATCH 10/39] some tentative fixes in config files --- .../gnb.band78.sa.fr1.106PRB.usrpn310.conf | 659 +++++++++--------- .../gnb.band78.sa.fr1.162PRB.usrpn310.conf | 316 +++++++++ .../gnb.band78.tm1.fr1.106PRB.usrpn310.conf | 1 + 3 files changed, 633 insertions(+), 343 deletions(-) create mode 100644 ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf index f00a343089..70892930c9 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf @@ -1,343 +1,316 @@ -Active_gNBs = ( "gNB-OAI"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -gNBs = -( - { - ////////// Identification parameters: - gNB_CU_ID = 0xe00; - -# cell_type = "CELL_MACRO_GNB"; - - gNB_name = "gNB-OAI"; - min_rxtxtime_pdsch = 6; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = 1; - - plmn_list = ({ - mcc = 208; - mnc = 97; - mnc_length = 2; - snssaiList = ( - { - sst = 1; - sd = 0x010203; // 0 false, else true - }, - { - sst = 1; - sd = 0x112233; // 0 false, else true - } - ); - }); - - nr_cellid = 12345678L - -# tr_s_preference = "local_mac" - - ////////// Physical parameters: - - ssb_SubcarrierOffset = 0; - pdsch_AntennaPorts = 1; - pusch_AntennaPorts = 1; - #pusch_TargetSNRx10 = 200; - #pucch_TargetSNRx10 = 200; - ul_prbblacklist = "51,52,53,54" - - pdcch_ConfigSIB1 = ( - { - controlResourceSetZero = 11; - searchSpaceZero = 0; - } - ); - - servingCellConfigCommon = ( - { - #spCellConfigCommon - - physCellId = 0; - -# downlinkConfigCommon - #frequencyInfoDL - # this is 3301.68 MHz + 22*12*30e-3 MHz = 3309.6 - #absoluteFrequencySSB = 620640; - # this is 3300.60 MHz + 53*12*30e-3 MHz = 3319.68 - absoluteFrequencySSB = 621312; - # this is 3503.28 MHz + 22*12*30e-3 MHz = 3511.2 - #absoluteFrequencySSB = 634080; - # this is 3600.48 MHz - #absoluteFrequencySSB = 640032; - #dl_frequencyBand = 78; - # this is 3301.68 MHz - #dl_absoluteFrequencyPointA = 620112; - # this is 3300.60 MHz - dl_absoluteFrequencyPointA = 620040; - # this is 3502.56 MHz - #dl_absoluteFrequencyPointA = 633552; - # this is 3600.48 MHz - #dl_absoluteFrequencyPointA = 640032; - #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=0,L=106 (275*(L-1))+RBstart - initialDLBWPlocationAndBandwidth = 28875; -# subcarrierSpacing -# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 - initialDLBWPsubcarrierSpacing = 1; - #pdcch-ConfigCommon - initialDLBWPcontrolResourceSetZero = 11; - 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=1,L=5 - initialDLBWPstartSymbolAndLength_1 = 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 = 28875; -# 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 = 12; - preambleReceivedTargetPower = -104; -#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 = 3; -#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=2 L=13 - initialULBWPstartSymbolAndLength_0 = 41; - - initialULBWPk2_1 = 6; - initialULBWPmappingType_1 = 1; - # this is SS=0 L=4 - initialULBWPstartSymbolAndLength_1 = 52; - - 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 = -25; - } - - ); - - - # ------- SCTP definitions - SCTP : - { - # Number of streams to use in input/output - SCTP_INSTREAMS = 2; - SCTP_OUTSTREAMS = 2; - }; - - ////////// AMF parameters: - amf_ip_address = ( { ipv4 = "CI_MME_IP_ADDR"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - - GNB_INTERFACE_NAME_FOR_NG_AMF = "em1"; - GNB_IPV4_ADDRESS_FOR_NG_AMF = "CI_GNB_IP_ADDR"; - GNB_INTERFACE_NAME_FOR_NGU = "em1"; - GNB_IPV4_ADDRESS_FOR_NGU = "CI_GNB_IP_ADDR"; - GNB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - } -); - -MACRLCs = ( - { - num_cc = 1; - tr_s_preference = "local_L1"; - tr_n_preference = "local_RRC"; - pusch_TargetSNRx10 = 200; - pucch_TargetSNRx10 = 200; - ulsch_max_frame_inactivity = 1; - } -); - -L1s = ( - { - num_cc = 1; - tr_n_preference = "local_mac"; - pusch_proc_threads = 2; - prach_dtx_threshold = 120; -# pucch0_dtx_threshold = 150; - } -); - -RUs = ( - { - local_rf = "yes" - nb_tx = 1 - nb_rx = 1 - att_tx = 0 - att_rx = 0; - bands = [78]; - 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]; - sf_extension = 0 - sdr_addrs = "mgmt_addr=192.168.18.240,addr=192.168.10.2,second_addr=192.168.20.2,clock_source=internal,time_source=internal" - } -); - -THREAD_STRUCT = ( - { - #three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT" - parallel_config = "PARALLEL_SINGLE_THREAD"; - #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE" - worker_config = "WORKER_ENABLE"; - } -); - -security = { - # preferred ciphering algorithms - # the first one of the list that an UE supports in chosen - # valid values: nea0, nea1, nea2, nea3 - ciphering_algorithms = ( "nea0" ); - - # preferred integrity algorithms - # the first one of the list that an UE supports in chosen - # valid values: nia0, nia1, nia2, nia3 - integrity_algorithms = ( "nia2", "nia0" ); - - # setting 'drb_ciphering' to "no" disables ciphering for DRBs, no matter - # what 'ciphering_algorithms' configures; same thing for 'drb_integrity' - drb_ciphering = "yes"; - drb_integrity = "no"; -}; - - log_config : - { - global_log_level ="info"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - f1ap_log_level ="debug"; - f1ap_log_verbosity ="medium"; - }; +Active_gNBs = ( "gNB-OAI"); +# Asn1_verbosity, choice in: none, info, annoying +Asn1_verbosity = "none"; + +gNBs = +( + { + ////////// Identification parameters: + gNB_CU_ID = 0xe00; + +# cell_type = "CELL_MACRO_GNB"; + + gNB_name = "gNB-OAI"; + + // Tracking area code, 0x0000 and 0xfffe are reserved values + tracking_area_code = 1; + + plmn_list = ({ + mcc = 208; + mnc = 97; + mnc_length = 2; + snssaiList = ( + { + sst = 1; + sd = 0x010203; // 0 false, else true + }, + { + sst = 1; + sd = 0x112233; // 0 false, else true + } + ); + }); + + nr_cellid = 12345678L + +# tr_s_preference = "local_mac" + + ////////// Physical parameters: + + ssb_SubcarrierOffset = 0; + pdsch_AntennaPorts = 1; + pusch_AntennaPorts = 1; + #pusch_TargetSNRx10 = 200; + #pucch_TargetSNRx10 = 200; + ul_prbblacklist = "51,52,53,54" + min_rxtxtime = 6; + + pdcch_ConfigSIB1 = ( + { + controlResourceSetZero = 11; + searchSpaceZero = 0; + } + ); + + servingCellConfigCommon = ( + { + #spCellConfigCommon + + physCellId = 0; + +# downlinkConfigCommon + #frequencyInfoDL + # this is 3301.68 MHz + 22*12*30e-3 MHz = 3309.6 + #absoluteFrequencySSB = 620640; + # this is 3300.60 MHz + 53*12*30e-3 MHz = 3319.68 + absoluteFrequencySSB = 621312; + # this is 3503.28 MHz + 22*12*30e-3 MHz = 3511.2 + #absoluteFrequencySSB = 634080; + # this is 3600.48 MHz + #absoluteFrequencySSB = 640032; + #dl_frequencyBand = 78; + # this is 3301.68 MHz + #dl_absoluteFrequencyPointA = 620112; + # this is 3300.60 MHz + dl_absoluteFrequencyPointA = 620040; + # this is 3502.56 MHz + #dl_absoluteFrequencyPointA = 633552; + # this is 3600.48 MHz + #dl_absoluteFrequencyPointA = 640032; + #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=0,L=106 (275*(L-1))+RBstart + initialDLBWPlocationAndBandwidth = 28875; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + initialDLBWPsubcarrierSpacing = 1; + #pdcch-ConfigCommon + initialDLBWPcontrolResourceSetZero = 11; + initialDLBWPsearchSpaceZero = 0; + + + + #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 = 28875; +# 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 = 12; + preambleReceivedTargetPower = -104; +#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 = 3; +#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, + + 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 = -25; + } + + ); + + + # ------- SCTP definitions + SCTP : + { + # Number of streams to use in input/output + SCTP_INSTREAMS = 2; + SCTP_OUTSTREAMS = 2; + }; + + ////////// AMF parameters: + amf_ip_address = ( { ipv4 = "CI_MME_IP_ADDR"; + ipv6 = "192:168:30::17"; + active = "yes"; + preference = "ipv4"; + } + ); + + NETWORK_INTERFACES : + { + + GNB_INTERFACE_NAME_FOR_NG_AMF = "em1"; + GNB_IPV4_ADDRESS_FOR_NG_AMF = "CI_GNB_IP_ADDR"; + GNB_INTERFACE_NAME_FOR_NGU = "em1"; + GNB_IPV4_ADDRESS_FOR_NGU = "CI_GNB_IP_ADDR"; + GNB_PORT_FOR_S1U = 2152; # Spec 2152 + }; + + } +); + +MACRLCs = ( + { + num_cc = 1; + tr_s_preference = "local_L1"; + tr_n_preference = "local_RRC"; + pusch_TargetSNRx10 = 200; + pucch_TargetSNRx10 = 200; + ulsch_max_frame_inactivity = 1; + } +); + +L1s = ( + { + num_cc = 1; + tr_n_preference = "local_mac"; + pusch_proc_threads = 4; + prach_dtx_threshold = 120; +# pucch0_dtx_threshold = 150; + } +); + +RUs = ( + { + local_rf = "yes" + nb_tx = 1 + nb_rx = 1 + att_tx = 0 + att_rx = 0; + bands = [78]; + 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]; + sf_extension = 0 + sdr_addrs = "mgmt_addr=192.168.18.240,addr=192.168.10.2,second_addr=192.168.20.2,clock_source=internal,time_source=internal" + } +); + +THREAD_STRUCT = ( + { + #three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT" + parallel_config = "PARALLEL_SINGLE_THREAD"; + #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE" + worker_config = "WORKER_ENABLE"; + } +); + +security = { + # preferred ciphering algorithms + # the first one of the list that an UE supports in chosen + # valid values: nea0, nea1, nea2, nea3 + ciphering_algorithms = ( "nea0" ); + + # preferred integrity algorithms + # the first one of the list that an UE supports in chosen + # valid values: nia0, nia1, nia2, nia3 + integrity_algorithms = ( "nia2", "nia0" ); + + # setting 'drb_ciphering' to "no" disables ciphering for DRBs, no matter + # what 'ciphering_algorithms' configures; same thing for 'drb_integrity' + drb_ciphering = "yes"; + drb_integrity = "no"; +}; + + log_config : + { + global_log_level ="info"; + global_log_verbosity ="medium"; + hw_log_level ="info"; + hw_log_verbosity ="medium"; + phy_log_level ="info"; + phy_log_verbosity ="medium"; + mac_log_level ="info"; + mac_log_verbosity ="high"; + rlc_log_level ="info"; + rlc_log_verbosity ="medium"; + pdcp_log_level ="info"; + pdcp_log_verbosity ="medium"; + rrc_log_level ="info"; + rrc_log_verbosity ="medium"; + f1ap_log_level ="debug"; + f1ap_log_verbosity ="medium"; + }; diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf new file mode 100644 index 0000000000..70892930c9 --- /dev/null +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf @@ -0,0 +1,316 @@ +Active_gNBs = ( "gNB-OAI"); +# Asn1_verbosity, choice in: none, info, annoying +Asn1_verbosity = "none"; + +gNBs = +( + { + ////////// Identification parameters: + gNB_CU_ID = 0xe00; + +# cell_type = "CELL_MACRO_GNB"; + + gNB_name = "gNB-OAI"; + + // Tracking area code, 0x0000 and 0xfffe are reserved values + tracking_area_code = 1; + + plmn_list = ({ + mcc = 208; + mnc = 97; + mnc_length = 2; + snssaiList = ( + { + sst = 1; + sd = 0x010203; // 0 false, else true + }, + { + sst = 1; + sd = 0x112233; // 0 false, else true + } + ); + }); + + nr_cellid = 12345678L + +# tr_s_preference = "local_mac" + + ////////// Physical parameters: + + ssb_SubcarrierOffset = 0; + pdsch_AntennaPorts = 1; + pusch_AntennaPorts = 1; + #pusch_TargetSNRx10 = 200; + #pucch_TargetSNRx10 = 200; + ul_prbblacklist = "51,52,53,54" + min_rxtxtime = 6; + + pdcch_ConfigSIB1 = ( + { + controlResourceSetZero = 11; + searchSpaceZero = 0; + } + ); + + servingCellConfigCommon = ( + { + #spCellConfigCommon + + physCellId = 0; + +# downlinkConfigCommon + #frequencyInfoDL + # this is 3301.68 MHz + 22*12*30e-3 MHz = 3309.6 + #absoluteFrequencySSB = 620640; + # this is 3300.60 MHz + 53*12*30e-3 MHz = 3319.68 + absoluteFrequencySSB = 621312; + # this is 3503.28 MHz + 22*12*30e-3 MHz = 3511.2 + #absoluteFrequencySSB = 634080; + # this is 3600.48 MHz + #absoluteFrequencySSB = 640032; + #dl_frequencyBand = 78; + # this is 3301.68 MHz + #dl_absoluteFrequencyPointA = 620112; + # this is 3300.60 MHz + dl_absoluteFrequencyPointA = 620040; + # this is 3502.56 MHz + #dl_absoluteFrequencyPointA = 633552; + # this is 3600.48 MHz + #dl_absoluteFrequencyPointA = 640032; + #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=0,L=106 (275*(L-1))+RBstart + initialDLBWPlocationAndBandwidth = 28875; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + initialDLBWPsubcarrierSpacing = 1; + #pdcch-ConfigCommon + initialDLBWPcontrolResourceSetZero = 11; + initialDLBWPsearchSpaceZero = 0; + + + + #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 = 28875; +# 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 = 12; + preambleReceivedTargetPower = -104; +#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 = 3; +#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, + + 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 = -25; + } + + ); + + + # ------- SCTP definitions + SCTP : + { + # Number of streams to use in input/output + SCTP_INSTREAMS = 2; + SCTP_OUTSTREAMS = 2; + }; + + ////////// AMF parameters: + amf_ip_address = ( { ipv4 = "CI_MME_IP_ADDR"; + ipv6 = "192:168:30::17"; + active = "yes"; + preference = "ipv4"; + } + ); + + NETWORK_INTERFACES : + { + + GNB_INTERFACE_NAME_FOR_NG_AMF = "em1"; + GNB_IPV4_ADDRESS_FOR_NG_AMF = "CI_GNB_IP_ADDR"; + GNB_INTERFACE_NAME_FOR_NGU = "em1"; + GNB_IPV4_ADDRESS_FOR_NGU = "CI_GNB_IP_ADDR"; + GNB_PORT_FOR_S1U = 2152; # Spec 2152 + }; + + } +); + +MACRLCs = ( + { + num_cc = 1; + tr_s_preference = "local_L1"; + tr_n_preference = "local_RRC"; + pusch_TargetSNRx10 = 200; + pucch_TargetSNRx10 = 200; + ulsch_max_frame_inactivity = 1; + } +); + +L1s = ( + { + num_cc = 1; + tr_n_preference = "local_mac"; + pusch_proc_threads = 4; + prach_dtx_threshold = 120; +# pucch0_dtx_threshold = 150; + } +); + +RUs = ( + { + local_rf = "yes" + nb_tx = 1 + nb_rx = 1 + att_tx = 0 + att_rx = 0; + bands = [78]; + 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]; + sf_extension = 0 + sdr_addrs = "mgmt_addr=192.168.18.240,addr=192.168.10.2,second_addr=192.168.20.2,clock_source=internal,time_source=internal" + } +); + +THREAD_STRUCT = ( + { + #three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT" + parallel_config = "PARALLEL_SINGLE_THREAD"; + #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE" + worker_config = "WORKER_ENABLE"; + } +); + +security = { + # preferred ciphering algorithms + # the first one of the list that an UE supports in chosen + # valid values: nea0, nea1, nea2, nea3 + ciphering_algorithms = ( "nea0" ); + + # preferred integrity algorithms + # the first one of the list that an UE supports in chosen + # valid values: nia0, nia1, nia2, nia3 + integrity_algorithms = ( "nia2", "nia0" ); + + # setting 'drb_ciphering' to "no" disables ciphering for DRBs, no matter + # what 'ciphering_algorithms' configures; same thing for 'drb_integrity' + drb_ciphering = "yes"; + drb_integrity = "no"; +}; + + log_config : + { + global_log_level ="info"; + global_log_verbosity ="medium"; + hw_log_level ="info"; + hw_log_verbosity ="medium"; + phy_log_level ="info"; + phy_log_verbosity ="medium"; + mac_log_level ="info"; + mac_log_verbosity ="high"; + rlc_log_level ="info"; + rlc_log_verbosity ="medium"; + pdcp_log_level ="info"; + pdcp_log_verbosity ="medium"; + rrc_log_level ="info"; + rrc_log_verbosity ="medium"; + f1ap_log_level ="debug"; + f1ap_log_verbosity ="medium"; + }; diff --git a/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpn310.conf index e6bbbf2d41..3441cf39ec 100644 --- a/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpn310.conf @@ -23,6 +23,7 @@ gNBs = ssb_SubcarrierOffset = 31; //0; pdsch_AntennaPorts = 1; pusch_AntennaPorts = 1; + min_rxtxtime = 6; servingCellConfigCommon = ( { From a54c1f239ea52bccde06483516d782da2fb3f3a8 Mon Sep 17 00:00:00 2001 From: francescomani Date: Tue, 4 Jan 2022 14:11:21 +0100 Subject: [PATCH 11/39] passing the file name on top of the path for uecap --- executables/nr-softmodem-common.h | 4 ++-- executables/nr-ue.c | 4 ++-- executables/nr-uesoftmodem.c | 14 ++------------ executables/nr-uesoftmodem.h | 2 +- openair2/RRC/NR_UE/rrc_UE.c | 18 +++++++++--------- openair2/RRC/NR_UE/rrc_defs.h | 6 +++--- 6 files changed, 19 insertions(+), 29 deletions(-) diff --git a/executables/nr-softmodem-common.h b/executables/nr-softmodem-common.h index 22b616f29e..45d7852adc 100644 --- a/executables/nr-softmodem-common.h +++ b/executables/nr-softmodem-common.h @@ -87,9 +87,9 @@ #define CONFIG_HLP_NOTWAIT "don't wait for tracer, start immediately\n" #define CONFIG_HLP_TNOFORK "to ease debugging with gdb\n" #define CONFIG_HLP_DISABLNBIOT "disable nb-iot, even if defined in config\n" -#define CONFIG_HLP_DISABLETIMECORR "disable UE timing correction\n" +#define CONFIG_HLP_DISABLETIMECORR "disable UE timing correction\n" #define CONFIG_HLP_RRC_CFG_PATH "path for RRC configuration\n" -#define CONFIG_HLP_UECAP_PATH "path for UE Capabilities file\n" +#define CONFIG_HLP_UECAP_FILE "path for UE Capabilities file\n" #define CONFIG_HLP_NUMEROLOGY "adding numerology for 5G\n" #define CONFIG_HLP_EMULATE_RF "Emulated RF enabled(disable by defult)\n" diff --git a/executables/nr-ue.c b/executables/nr-ue.c index 03ae537e04..23846b70fc 100644 --- a/executables/nr-ue.c +++ b/executables/nr-ue.c @@ -757,14 +757,14 @@ void *UE_thread(void *arg) { } void init_NR_UE(int nb_inst, - char* uecap_path, + char* uecap_file, char* rrc_config_path) { int inst; NR_UE_MAC_INST_t *mac_inst; NR_UE_RRC_INST_t* rrc_inst; for (inst=0; inst < nb_inst; inst++) { - AssertFatal((rrc_inst = nr_l3_init_ue(uecap_path,rrc_config_path)) != NULL, "can not initialize RRC module\n"); + AssertFatal((rrc_inst = nr_l3_init_ue(uecap_file,rrc_config_path)) != NULL, "can not initialize RRC module\n"); AssertFatal((mac_inst = nr_l2_init_ue(rrc_inst)) != NULL, "can not initialize L2 module\n"); AssertFatal((mac_inst->if_module = nr_ue_if_module_init(inst)) != NULL, "can not initialize IF module\n"); } diff --git a/executables/nr-uesoftmodem.c b/executables/nr-uesoftmodem.c index 6deca88eb8..c63b553fce 100644 --- a/executables/nr-uesoftmodem.c +++ b/executables/nr-uesoftmodem.c @@ -115,7 +115,7 @@ int vcdflag = 0; double rx_gain_off = 0.0; char *usrp_args = NULL; char *rrc_config_path = NULL; -char *uecap_path = NULL; +char *uecap_file = NULL; int dumpframe = 0; uint64_t downlink_frequency[MAX_NUM_CCs][4]; @@ -148,8 +148,6 @@ int numerology = 0; int oaisim_flag = 0; int emulate_rf = 0; uint32_t N_RB_DL = 106; -char uecap_xer_in = 0; -char uecap_xer[1024]; /* see file openair2/LAYER2/MAC/main.c for why abstraction_flag is needed * this is very hackish - find a proper solution @@ -254,14 +252,6 @@ static void get_options(void) { if (vcdflag > 0) ouput_vcd = 1; - - if ( !(CONFIG_ISFLAGSET(CONFIG_ABORT)) && (!(CONFIG_ISFLAGSET(CONFIG_NOOOPT))) ) { - // Here the configuration file is the XER encoded UE capabilities - // Read it in and store in asn1c data structures - sprintf(uecap_xer,"%stargets/PROJECTS/GENERIC-LTE-EPC/CONF/UE_config.xml",getenv("OPENAIR_HOME")); - printf("%s\n",uecap_xer); - uecap_xer_in=1; - } /* UE with config file */ } // set PHY vars from command line @@ -439,7 +429,7 @@ int main( int argc, char **argv ) { #endif LOG_I(HW, "Version: %s\n", PACKAGE_VERSION); - init_NR_UE(1,uecap_path,rrc_config_path); + init_NR_UE(1,uecap_file,rrc_config_path); if(IS_SOFTMODEM_NOS1 || get_softmodem_params()->sa) init_pdcp(); diff --git a/executables/nr-uesoftmodem.h b/executables/nr-uesoftmodem.h index 0def34dd39..0cb7c072a0 100644 --- a/executables/nr-uesoftmodem.h +++ b/executables/nr-uesoftmodem.h @@ -34,7 +34,7 @@ {"offset-divisor", CONFIG_HLP_OFFSET_DIV, 0, uptr:(uint32_t *)&nrUE_params.ofdm_offset_divisor, defuintval:UINT_MAX, TYPE_UINT32, 0}, \ {"nr-dlsch-demod-shift", CONFIG_HLP_DLSHIFT, 0, iptr:(int32_t *)&nr_dlsch_demod_shift, defintval:0, TYPE_INT, 0}, \ {"V" , CONFIG_HLP_VCD, PARAMFLAG_BOOL, iptr:&vcdflag, defintval:0, TYPE_INT, 0}, \ - {"uecap_path", CONFIG_HLP_UECAP_PATH, 0, strptr:(char **)&uecap_path, defstrval:"./", TYPE_STRING, 0}, \ + {"uecap_file", CONFIG_HLP_UECAP_FILE, 0, strptr:(char **)&uecap_file, defstrval:"./", TYPE_STRING, 0}, \ {"rrc_config_path", CONFIG_HLP_RRC_CFG_PATH,0, strptr:(char **)&rrc_config_path, defstrval:"./", TYPE_STRING, 0} \ } diff --git a/openair2/RRC/NR_UE/rrc_UE.c b/openair2/RRC/NR_UE/rrc_UE.c index f2868e9c97..93e7e0b8fe 100644 --- a/openair2/RRC/NR_UE/rrc_UE.c +++ b/openair2/RRC/NR_UE/rrc_UE.c @@ -410,7 +410,7 @@ void process_nsa_message(NR_UE_RRC_INST_t *rrc, nsa_message_t nsa_message_type, } -NR_UE_RRC_INST_t* openair_rrc_top_init_ue_nr(char* uecap_path, char* rrc_config_path){ +NR_UE_RRC_INST_t* openair_rrc_top_init_ue_nr(char* uecap_file, char* rrc_config_path){ int nr_ue; if(NB_NR_UE_INST > 0){ NR_UE_rrc_inst = (NR_UE_RRC_INST_t *)malloc(NB_NR_UE_INST * sizeof(NR_UE_RRC_INST_t)); @@ -485,7 +485,7 @@ NR_UE_RRC_INST_t* openair_rrc_top_init_ue_nr(char* uecap_path, char* rrc_config_ RRC_LIST_INIT(NR_UE_rrc_inst[nr_ue].CSI_ReportConfig_list, NR_maxNrofCSI_ReportConfigurations); } - NR_UE_rrc_inst->uecap_path = uecap_path; + NR_UE_rrc_inst->uecap_file = uecap_file; if (get_softmodem_params()->phy_test==1 || get_softmodem_params()->do_ra==1) { // read in files for RRCReconfiguration and RBconfig @@ -2634,13 +2634,6 @@ nr_rrc_ue_process_ueCapabilityEnquiry( ctxt_pP->frame, gNB_index); - FILE *f = NULL; - char *file_path = NR_UE_rrc_inst[ctxt_pP->module_id].uecap_path; - if (file_path) { - sprintf(UE_NR_Capability_xer_fname,"%s/uecap.xml",file_path); - f = fopen(UE_NR_Capability_xer_fname, "r"); - } - memset((void *)&ul_dcch_msg,0,sizeof(NR_UL_DCCH_Message_t)); memset((void *)&ue_CapabilityRAT_Container,0,sizeof(NR_UE_CapabilityRAT_Container_t)); ul_dcch_msg.message.present = NR_UL_DCCH_MessageType_PR_c1; @@ -2651,6 +2644,13 @@ nr_rrc_ue_process_ueCapabilityEnquiry( ue_CapabilityRAT_Container.rat_Type = NR_RAT_Type_nr; NR_UE_NR_Capability_t* UE_Capability_nr = NULL; + FILE *f = NULL; + char *file_path = NR_UE_rrc_inst[ctxt_pP->module_id].uecap_file; + if (file_path) { + sprintf(UE_NR_Capability_xer_fname,"%s",file_path); + f = fopen(UE_NR_Capability_xer_fname, "r"); + } + if(f){ size = fread(UE_NR_Capability_xer, 1, sizeof UE_NR_Capability_xer, f); if (size == 0 || size == sizeof UE_NR_Capability_xer) { diff --git a/openair2/RRC/NR_UE/rrc_defs.h b/openair2/RRC/NR_UE/rrc_defs.h index d623481c81..3aa98951f2 100644 --- a/openair2/RRC/NR_UE/rrc_defs.h +++ b/openair2/RRC/NR_UE/rrc_defs.h @@ -120,15 +120,15 @@ typedef struct NR_UE_RRC_INST_s { NR_DRB_ToAddMod_t *DRB_config[NB_CNX_UE][8]; rb_id_t *defaultDRB; // remember the ID of the default DRB - char *uecap_path; + char *uecap_file; - NR_SRB_INFO Srb0[NB_SIG_CNX_UE]; + NR_SRB_INFO Srb0[NB_SIG_CNX_UE]; NR_SRB_INFO_TABLE_ENTRY Srb1[NB_CNX_UE]; NR_SRB_INFO_TABLE_ENTRY Srb2[NB_CNX_UE]; uint8_t MBMS_flag; OAI_NR_UECapability_t *UECap; - uint8_t *UECapability; + uint8_t *UECapability; uint8_t UECapability_size; RA_trigger_t ra_trigger; From 3606c3814536d39b4344f487174e2a03a094bc1e Mon Sep 17 00:00:00 2001 From: francescomani Date: Fri, 7 Jan 2022 14:48:09 +0100 Subject: [PATCH 12/39] uecap file from command line at gnb for phytest and dora mode --- executables/nr-softmodem.c | 10 ++----- executables/nr-softmodem.h | 2 ++ openair2/GNB_APP/gnb_config.c | 2 +- openair2/RRC/NR/nr_rrc_defs.h | 2 ++ openair2/RRC/NR/rrc_gNB.c | 56 ++++------------------------------- openair2/RRC/NR/rrc_gNB_nsa.c | 8 +++-- openair2/RRC/NR_UE/rrc_UE.c | 3 +- 7 files changed, 21 insertions(+), 62 deletions(-) diff --git a/executables/nr-softmodem.c b/executables/nr-softmodem.c index a2b5c18b6c..12728434ad 100644 --- a/executables/nr-softmodem.c +++ b/executables/nr-softmodem.c @@ -111,16 +111,11 @@ int32_t uplink_frequency_offset[MAX_NUM_CCs][4]; //Temp fix for inexistent NR upper layer unsigned char NB_gNB_INST = 1; +char *uecap_file; - -int UE_scan = 1; -int UE_scan_carrier = 0; runmode_t mode = normal_txrx; static double snr_dB=20; -FILE *input_fd=NULL; - - #if MAX_NUM_CCs == 1 rx_gain_t rx_gain_mode[MAX_NUM_CCs][4] = {{max_gain,max_gain,max_gain,max_gain}}; double tx_gain[MAX_NUM_CCs][4] = {{20,0,0,0}}; @@ -193,8 +188,6 @@ openair0_config_t openair0_cfg[MAX_CARDS]; double cpuf; -extern char uecap_xer[1024]; -char uecap_xer_in=0; /* see file openair2/LAYER2/MAC/main.c for why abstraction_flag is needed * this is very hackish - find a proper solution @@ -702,6 +695,7 @@ int main( int argc, char **argv ) { // don't create if node doesn't connect to RRC/S1/GTP AssertFatal(create_gNB_tasks(1) == 0,"cannot create ITTI tasks\n"); + /* Start the agent. If it is turned off in the configuration, it won't start */ /* RCconfig_nr_flexran(); diff --git a/executables/nr-softmodem.h b/executables/nr-softmodem.h index 896c363cbf..926b4b1f0f 100644 --- a/executables/nr-softmodem.h +++ b/executables/nr-softmodem.h @@ -29,6 +29,7 @@ {"D" , CONFIG_HLP_DLBM_PHYTEST,0, u64ptr:&dlsch_slot_bitmap, defintval:0, TYPE_UINT64, 0}, \ {"U" , CONFIG_HLP_ULBM_PHYTEST,0, u64ptr:&ulsch_slot_bitmap, defintval:0, TYPE_UINT64, 0}, \ {"usrp-tx-thread-config", CONFIG_HLP_USRP_THREAD, 0, iptr:&usrp_tx_thread, defstrval:0, TYPE_INT, 0}, \ + {"uecap_file", CONFIG_HLP_UECAP_FILE, 0, strptr:(char **)&uecap_file, defstrval:"./", TYPE_STRING, 0}, \ {"s" , CONFIG_HLP_SNR, 0, dblptr:&snr_dB, defdblval:25, TYPE_DOUBLE, 0}, \ } @@ -41,6 +42,7 @@ extern uint32_t target_dl_bw; extern uint32_t target_ul_bw; extern uint64_t dlsch_slot_bitmap; extern uint64_t ulsch_slot_bitmap; +extern char *uecap_file; // In nr-gnb.c extern void init_gNB(int single_thread_flag,int wait_for_sync); diff --git a/openair2/GNB_APP/gnb_config.c b/openair2/GNB_APP/gnb_config.c index d069bfe2f4..ef464f4976 100644 --- a/openair2/GNB_APP/gnb_config.c +++ b/openair2/GNB_APP/gnb_config.c @@ -1533,7 +1533,7 @@ void NRRCConfig(void) { config_get( GNBSParams,sizeof(GNBSParams)/sizeof(paramdef_t),NULL); RC.nb_nr_inst = GNBSParams[GNB_ACTIVE_GNBS_IDX].numelt; - // Get num MACRLC instances + // Get num MACRLC instances config_getlist( &MACRLCParamList,NULL,0, NULL); RC.nb_nr_macrlc_inst = MACRLCParamList.numelt; // Get num L1 instances diff --git a/openair2/RRC/NR/nr_rrc_defs.h b/openair2/RRC/NR/nr_rrc_defs.h index d71393bc2d..7f0612dbdd 100644 --- a/openair2/RRC/NR/nr_rrc_defs.h +++ b/openair2/RRC/NR/nr_rrc_defs.h @@ -520,6 +520,8 @@ typedef struct gNB_RRC_INST_s { int cell_info_configured; pthread_mutex_t cell_info_mutex; + char *uecap_file; + // security configuration (preferred algorithms) nr_security_configuration_t security; } gNB_RRC_INST; diff --git a/openair2/RRC/NR/rrc_gNB.c b/openair2/RRC/NR/rrc_gNB.c index 7f7353f9af..184bfd6384 100755 --- a/openair2/RRC/NR/rrc_gNB.c +++ b/openair2/RRC/NR/rrc_gNB.c @@ -178,56 +178,12 @@ static void init_NR_SI(gNB_RRC_INST *rrc, gNB_RrcConfigurationReq *configuration pthread_mutex_unlock(&rrc->cell_info_mutex); if (get_softmodem_params()->phy_test > 0 || get_softmodem_params()->do_ra > 0) { - // This is for phytest only, emulate first X2 message if uecap.raw file is present - FILE *fd; - fd = fopen("uecap.raw","r"); - - if (fd != NULL) { - char buffer[4096]; - int msg_len=fread(buffer,1,4096,fd); - LOG_I(RRC,"Read in %d bytes for uecap\n",msg_len); - LTE_UL_DCCH_Message_t *LTE_UL_DCCH_Message; - asn_dec_rval_t dec_rval = uper_decode_complete( NULL, - &asn_DEF_LTE_UL_DCCH_Message, - (void **)<E_UL_DCCH_Message, - (uint8_t *)buffer, - msg_len); - - if ((dec_rval.code != RC_OK) && (dec_rval.consumed == 0)) { - AssertFatal(1==0,"NR_UL_DCCH_MESSAGE decode error\n"); - // free the memory - SEQUENCE_free( &asn_DEF_LTE_UL_DCCH_Message, LTE_UL_DCCH_Message, 1 ); - return; - } - - fclose(fd); - xer_fprint(stdout,&asn_DEF_LTE_UL_DCCH_Message, LTE_UL_DCCH_Message); - // recreate enough of X2 EN-DC Container - AssertFatal(LTE_UL_DCCH_Message->message.choice.c1.present == LTE_UL_DCCH_MessageType__c1_PR_ueCapabilityInformation, - "ueCapabilityInformation not present\n"); - NR_CG_ConfigInfo_t *CG_ConfigInfo = calloc(1,sizeof(*CG_ConfigInfo)); - CG_ConfigInfo->criticalExtensions.present = NR_CG_ConfigInfo__criticalExtensions_PR_c1; - CG_ConfigInfo->criticalExtensions.choice.c1 = calloc(1,sizeof(*CG_ConfigInfo->criticalExtensions.choice.c1)); - CG_ConfigInfo->criticalExtensions.choice.c1->present = NR_CG_ConfigInfo__criticalExtensions__c1_PR_cg_ConfigInfo; - CG_ConfigInfo->criticalExtensions.choice.c1->choice.cg_ConfigInfo = calloc(1,sizeof(*CG_ConfigInfo->criticalExtensions.choice.c1->choice.cg_ConfigInfo)); - NR_CG_ConfigInfo_IEs_t *cg_ConfigInfo = CG_ConfigInfo->criticalExtensions.choice.c1->choice.cg_ConfigInfo; - cg_ConfigInfo->ue_CapabilityInfo = calloc(1,sizeof(*cg_ConfigInfo->ue_CapabilityInfo)); - asn_enc_rval_t enc_rval = uper_encode_to_buffer(&asn_DEF_LTE_UE_CapabilityRAT_ContainerList,NULL, - (void *)<E_UL_DCCH_Message->message.choice.c1.choice.ueCapabilityInformation.criticalExtensions.choice.c1.choice.ueCapabilityInformation_r8.ue_CapabilityRAT_ContainerList,buffer,4096); - AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %jd)!\n", - enc_rval.failed_type->name, enc_rval.encoded); - OCTET_STRING_fromBuf(cg_ConfigInfo->ue_CapabilityInfo, - (const char *)buffer, - (enc_rval.encoded+7)>>3); - parse_CG_ConfigInfo(rrc,CG_ConfigInfo,NULL); - } else { - struct rrc_gNB_ue_context_s *ue_context_p = rrc_gNB_allocate_new_UE_context(rrc); - ue_context_p->ue_context.spCellConfig = calloc(1, sizeof(struct NR_SpCellConfig)); - ue_context_p->ue_context.spCellConfig->spCellConfigDedicated = configuration->scd; - LOG_I(NR_RRC,"Adding new user (%p)\n",ue_context_p); - if (!NODE_IS_CU(RC.nrrrc[0]->node_type)) { - rrc_add_nsa_user(rrc,ue_context_p,NULL); - } + struct rrc_gNB_ue_context_s *ue_context_p = rrc_gNB_allocate_new_UE_context(rrc); + ue_context_p->ue_context.spCellConfig = calloc(1, sizeof(struct NR_SpCellConfig)); + ue_context_p->ue_context.spCellConfig->spCellConfigDedicated = configuration->scd; + LOG_I(NR_RRC,"Adding new user (%p)\n",ue_context_p); + if (!NODE_IS_CU(RC.nrrrc[0]->node_type)) { + rrc_add_nsa_user(rrc,ue_context_p,NULL); } } } diff --git a/openair2/RRC/NR/rrc_gNB_nsa.c b/openair2/RRC/NR/rrc_gNB_nsa.c index 70abaccc8d..5ac2f4ee02 100644 --- a/openair2/RRC/NR/rrc_gNB_nsa.c +++ b/openair2/RRC/NR/rrc_gNB_nsa.c @@ -38,6 +38,7 @@ #include "openair2/LAYER2/NR_MAC_gNB/mac_proto.h" #include "openair2/RRC/LTE/rrc_eNB_GTPV1U.h" #include "executables/softmodem-common.h" +#include "executables/nr-softmodem.h" #include #include #include "UTIL/OSA/osa_defs.h" @@ -148,8 +149,11 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_ NR_UE_NR_Capability_t* UE_Capability_nr = NULL; char UE_NR_Capability_xer_fname[1024]; char UE_NR_Capability_xer[65536]; - sprintf(UE_NR_Capability_xer_fname,"../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/uecap.xml"); - FILE *f = fopen(UE_NR_Capability_xer_fname, "r"); + FILE *f = NULL; + if (uecap_file) { + sprintf(UE_NR_Capability_xer_fname,"%s",uecap_file); + f = fopen(UE_NR_Capability_xer_fname, "r"); + } if(f){ size_t size = fread(UE_NR_Capability_xer, 1, sizeof UE_NR_Capability_xer, f); if (size == 0 || size == sizeof UE_NR_Capability_xer) diff --git a/openair2/RRC/NR_UE/rrc_UE.c b/openair2/RRC/NR_UE/rrc_UE.c index 93e7e0b8fe..b0d84960e8 100644 --- a/openair2/RRC/NR_UE/rrc_UE.c +++ b/openair2/RRC/NR_UE/rrc_UE.c @@ -2644,8 +2644,9 @@ nr_rrc_ue_process_ueCapabilityEnquiry( ue_CapabilityRAT_Container.rat_Type = NR_RAT_Type_nr; NR_UE_NR_Capability_t* UE_Capability_nr = NULL; - FILE *f = NULL; char *file_path = NR_UE_rrc_inst[ctxt_pP->module_id].uecap_file; + + FILE *f = NULL; if (file_path) { sprintf(UE_NR_Capability_xer_fname,"%s",file_path); f = fopen(UE_NR_Capability_xer_fname, "r"); From 42bf5765967cc6150336e7af629d4c9d82f9c4b6 Mon Sep 17 00:00:00 2001 From: francescomani Date: Mon, 10 Jan 2022 14:09:21 +0100 Subject: [PATCH 13/39] review fixes --- executables/nr-softmodem.h | 2 +- executables/nr-uesoftmodem.h | 2 +- openair2/RRC/NR/rrc_gNB_nsa.c | 9 +++------ openair2/RRC/NR_UE/rrc_UE.c | 10 +++------- 4 files changed, 8 insertions(+), 15 deletions(-) diff --git a/executables/nr-softmodem.h b/executables/nr-softmodem.h index 926b4b1f0f..4190a6074b 100644 --- a/executables/nr-softmodem.h +++ b/executables/nr-softmodem.h @@ -29,7 +29,7 @@ {"D" , CONFIG_HLP_DLBM_PHYTEST,0, u64ptr:&dlsch_slot_bitmap, defintval:0, TYPE_UINT64, 0}, \ {"U" , CONFIG_HLP_ULBM_PHYTEST,0, u64ptr:&ulsch_slot_bitmap, defintval:0, TYPE_UINT64, 0}, \ {"usrp-tx-thread-config", CONFIG_HLP_USRP_THREAD, 0, iptr:&usrp_tx_thread, defstrval:0, TYPE_INT, 0}, \ - {"uecap_file", CONFIG_HLP_UECAP_FILE, 0, strptr:(char **)&uecap_file, defstrval:"./", TYPE_STRING, 0}, \ + {"uecap_file", CONFIG_HLP_UECAP_FILE, 0, strptr:(char **)&uecap_file, defstrval:"./uecap.xml", TYPE_STRING, 0}, \ {"s" , CONFIG_HLP_SNR, 0, dblptr:&snr_dB, defdblval:25, TYPE_DOUBLE, 0}, \ } diff --git a/executables/nr-uesoftmodem.h b/executables/nr-uesoftmodem.h index b1810a1f4f..95914678e5 100644 --- a/executables/nr-uesoftmodem.h +++ b/executables/nr-uesoftmodem.h @@ -34,7 +34,7 @@ {"offset-divisor", CONFIG_HLP_OFFSET_DIV, 0, uptr:(uint32_t *)&nrUE_params.ofdm_offset_divisor, defuintval:UINT_MAX, TYPE_UINT32, 0}, \ {"nr-dlsch-demod-shift", CONFIG_HLP_DLSHIFT, 0, iptr:(int32_t *)&nr_dlsch_demod_shift, defintval:0, TYPE_INT, 0}, \ {"V" , CONFIG_HLP_VCD, PARAMFLAG_BOOL, iptr:&vcdflag, defintval:0, TYPE_INT, 0}, \ - {"uecap_file", CONFIG_HLP_UECAP_FILE, 0, strptr:(char **)&uecap_file, defstrval:"./", TYPE_STRING, 0}, \ + {"uecap_file", CONFIG_HLP_UECAP_FILE, 0, strptr:(char **)&uecap_file, defstrval:"./uecap.xml", TYPE_STRING, 0}, \ {"rrc_config_path", CONFIG_HLP_RRC_CFG_PATH,0, strptr:(char **)&rrc_config_path, defstrval:"./", TYPE_STRING, 0}, \ {"ue-idx-standalone", NULL, 0, u16ptr:&ue_idx_standalone, defuintval:0xFFFF, TYPE_UINT16, 0} \ } diff --git a/openair2/RRC/NR/rrc_gNB_nsa.c b/openair2/RRC/NR/rrc_gNB_nsa.c index 414d6d809d..15caff0b4d 100644 --- a/openair2/RRC/NR/rrc_gNB_nsa.c +++ b/openair2/RRC/NR/rrc_gNB_nsa.c @@ -148,17 +148,14 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_ // In case of phy-test and do-ra mode, read UE capabilities directly from file if (get_softmodem_params()->phy_test == 1 || get_softmodem_params()->do_ra == 1) { NR_UE_NR_Capability_t* UE_Capability_nr = NULL; - char UE_NR_Capability_xer_fname[1024]; char UE_NR_Capability_xer[65536]; FILE *f = NULL; - if (uecap_file) { - sprintf(UE_NR_Capability_xer_fname,"%s",uecap_file); - f = fopen(UE_NR_Capability_xer_fname, "r"); - } + if (uecap_file) + f = fopen(uecap_file, "r"); if(f){ size_t size = fread(UE_NR_Capability_xer, 1, sizeof UE_NR_Capability_xer, f); if (size == 0 || size == sizeof UE_NR_Capability_xer) - LOG_E(NR_RRC,"UE Capabilities XER file %s is too large (%ld)\n", UE_NR_Capability_xer_fname,size); + LOG_E(NR_RRC,"UE Capabilities XER file %s is too large (%ld)\n", uecap_file, size); else { UE_Capability_nr = CALLOC(1,sizeof(NR_UE_NR_Capability_t)); asn_dec_rval_t dec_rval = xer_decode(0, &asn_DEF_NR_UE_NR_Capability, (void *)&UE_Capability_nr, UE_NR_Capability_xer, size); diff --git a/openair2/RRC/NR_UE/rrc_UE.c b/openair2/RRC/NR_UE/rrc_UE.c index 21ccd4226b..bc209afd02 100644 --- a/openair2/RRC/NR_UE/rrc_UE.c +++ b/openair2/RRC/NR_UE/rrc_UE.c @@ -2639,7 +2639,6 @@ nr_rrc_ue_process_ueCapabilityEnquiry( asn_dec_rval_t dec_rval; NR_UL_DCCH_Message_t ul_dcch_msg; NR_UE_CapabilityRAT_Container_t ue_CapabilityRAT_Container; - char UE_NR_Capability_xer_fname[1024]; char UE_NR_Capability_xer[65536]; size_t size; uint8_t buffer[200]; @@ -2662,15 +2661,12 @@ nr_rrc_ue_process_ueCapabilityEnquiry( char *file_path = NR_UE_rrc_inst[ctxt_pP->module_id].uecap_file; FILE *f = NULL; - if (file_path) { - sprintf(UE_NR_Capability_xer_fname,"%s",file_path); - f = fopen(UE_NR_Capability_xer_fname, "r"); - } - + if (file_path) + f = fopen(file_path, "r"); if(f){ size = fread(UE_NR_Capability_xer, 1, sizeof UE_NR_Capability_xer, f); if (size == 0 || size == sizeof UE_NR_Capability_xer) { - LOG_E(NR_RRC,"UE Capabilities XER file %s is too large (%ld)\n", UE_NR_Capability_xer_fname,size); + LOG_E(NR_RRC,"UE Capabilities XER file %s is too large (%ld)\n", file_path,size); free(UE_Capability_nr); return; } From bcc68d6597b84b30d3f072bf9e41178dc87870e0 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Fri, 7 Jan 2022 17:37:01 +0100 Subject: [PATCH 14/39] CI: store both core dump and executable in zip --- ci-scripts/ran.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ci-scripts/ran.py b/ci-scripts/ran.py index 4caa876719..b35b73e9d3 100644 --- a/ci-scripts/ran.py +++ b/ci-scripts/ran.py @@ -738,7 +738,10 @@ class RANManagement(): mySSH.command('echo ' + self.eNBPassword + ' | sudo -S mv /tmp/enb_*.pcap .','\$',20) mySSH.command('echo ' + self.eNBPassword + ' | sudo -S mv /tmp/gnb_*.pcap .','\$',20) mySSH.command('echo ' + self.eNBPassword + ' | sudo -S rm -f enb.log.zip', '\$', 5) - mySSH.command('echo ' + self.eNBPassword + ' | sudo -S zip enb.log.zip enb*.log core* enb_*record.raw enb_*.pcap gnb_*.pcap enb_*txt physim_*.log *stats.log *monitor.pickle *monitor*.png ping*.log.png log/*/*.log log/*/*.pcap', '\$', 60) + mySSH.command('echo ' + self.eNBPassword + ' | sudo -S zip enb.log.zip enb*.log enb_*record.raw enb_*.pcap gnb_*.pcap enb_*txt physim_*.log *stats.log *monitor.pickle *monitor*.png ping*.log.png log/*/*.log log/*/*.pcap', '\$', 60) + result = re.search('core.\d+', mySSH.getBefore()) + if result is not None: + mySSH.command('echo ' + self.eNBPassword + ' | sudo -S zip enb.log.zip core* ran_build/build/{lte,nr}-softmodem', '\$', 60) # add core and executable to zip mySSH.command('echo ' + self.eNBPassword + ' | sudo -S rm enb*.log core* enb_*record.raw enb_*.pcap gnb_*.pcap enb_*txt physim_*.log *stats.log *monitor.pickle *monitor*.png ping*.log.png log/*/*.log log/*/*.pcap', '\$', 15) mySSH.close() From f5d949742e7a786311e4625759b36bcedb85ec94 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Fri, 7 Jan 2022 18:59:20 +0100 Subject: [PATCH 15/39] CI: refine tshark capture filters The CI pcaps are too large if we have large data traffic, as they include all the GTP capture (they contain basically the data that we send in the tests). This commit reduces this: - in the RAN: capture only S1AP (port 36412), X2AP (36422), NGAP (38412) traffic - in the CN: exclude GTP traffic (port 2152) --- ci-scripts/cls_containerize.py | 2 +- ci-scripts/epc.py | 6 +++--- ci-scripts/ran.py | 10 ++++++---- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/ci-scripts/cls_containerize.py b/ci-scripts/cls_containerize.py index db51f2647c..ef382a8c6c 100644 --- a/ci-scripts/cls_containerize.py +++ b/ci-scripts/cls_containerize.py @@ -689,7 +689,7 @@ class Containerize(): def CaptureOnDockerNetworks(self): cmd = 'cd ' + self.yamlPath[0] + ' && docker-compose -f docker-compose-ci.yml config | grep com.docker.network.bridge.name | sed -e "s@^.*name: @@"' networkNames = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=10) - cmd = 'sudo nohup tshark -f "not tcp and not arp and not port 53 and not host archive.ubuntu.com and not host security.ubuntu.com"' + cmd = 'sudo nohup tshark -f "not tcp and not arp and not port 53 and not host archive.ubuntu.com and not host security.ubuntu.com and not port 2152"' for name in networkNames.split('\n'): res = re.search('rfsim', name) if res is not None: diff --git a/ci-scripts/epc.py b/ci-scripts/epc.py index a7d923ca90..a62bb96ed1 100644 --- a/ci-scripts/epc.py +++ b/ci-scripts/epc.py @@ -133,7 +133,7 @@ class EPCManagement(): mySSH.open(self.IPAddress, self.UserName, self.Password) if re.match('OAI-Rel14-Docker', self.Type, re.IGNORECASE): logging.debug('Using the OAI EPC Release 14 MME in Docker') - mySSH.command('docker exec -d ' + self.containerPrefix + '-oai-mme /bin/bash -c "nohup tshark -i eth0 -i lo:s10 -w /tmp/mme_check_run.pcap 2>&1 > /dev/null"', '\$', 5) + mySSH.command('docker exec -d ' + self.containerPrefix + '-oai-mme /bin/bash -c "nohup tshark -i eth0 -i lo:s10 -f "not port 2152" -w /tmp/mme_check_run.pcap 2>&1 > /dev/null"', '\$', 5) time.sleep(5) mySSH.command('docker exec -d ' + self.containerPrefix + '-oai-mme /bin/bash -c "nohup ./bin/oai_mme -c ./etc/' + self.mmeConfFile + ' > mme_check_run.log 2>&1"', '\$', 5) elif re.match('OAI-Rel14-CUPS', self.Type, re.IGNORECASE): @@ -198,8 +198,8 @@ class EPCManagement(): mySSH.open(self.IPAddress, self.UserName, self.Password) if re.match('OAI-Rel14-Docker', self.Type, re.IGNORECASE): logging.debug('Using the OAI EPC Release 14 SPGW-CUPS in Docker') - mySSH.command('docker exec -d ' + self.containerPrefix + '-oai-spgwc /bin/bash -c "nohup tshark -i eth0 -i lo:p5c -i lo:s5c -w /tmp/spgwc_check_run.pcap 2>&1 > /dev/null"', '\$', 5) - mySSH.command('docker exec -d ' + self.containerPrefix + '-oai-spgwu-tiny /bin/bash -c "nohup tshark -i eth0 -w /tmp/spgwu_check_run.pcap 2>&1 > /dev/null"', '\$', 5) + mySSH.command('docker exec -d ' + self.containerPrefix + '-oai-spgwc /bin/bash -c "nohup tshark -i eth0 -i lo:p5c -i lo:s5c -f "not port 2152" -w /tmp/spgwc_check_run.pcap 2>&1 > /dev/null"', '\$', 5) + mySSH.command('docker exec -d ' + self.containerPrefix + '-oai-spgwu-tiny /bin/bash -c "nohup tshark -i eth0 -f "not port 2152" -w /tmp/spgwu_check_run.pcap 2>&1 > /dev/null"', '\$', 5) time.sleep(5) mySSH.command('docker exec -d ' + self.containerPrefix + '-oai-spgwc /bin/bash -c "nohup ./bin/oai_spgwc -o -c ./etc/spgw_c.conf > spgwc_check_run.log 2>&1"', '\$', 5) time.sleep(5) diff --git a/ci-scripts/ran.py b/ci-scripts/ran.py index b35b73e9d3..3c0abccdbf 100644 --- a/ci-scripts/ran.py +++ b/ci-scripts/ran.py @@ -371,10 +371,11 @@ class RANManagement(): result = re.search('interfaceToUse=(?P[a-zA-Z0-9\-\_]+)done', mySSH.getBefore()) if result is not None: eth_interface = result.group('eth_interface') - logging.debug('\u001B[1m Launching tshark on interface ' + eth_interface + '\u001B[0m') + fltr = 'port 38412 or port 36412 or port 36422' # NGAP, S1AP, X2AP + logging.debug('\u001B[1m Launching tshark on interface ' + eth_interface + ' with filter "' + fltr + '"\u001B[0m') pcapfile = pcapfile_prefix + self.testCase_id + '_log.pcap' mySSH.command('echo ' + lPassWord + ' | sudo -S rm -f /tmp/' + pcapfile , '\$', 5) - mySSH.command('echo $USER; nohup sudo -E tshark -i ' + eth_interface + ' -w /tmp/' + pcapfile + ' > /dev/null 2>&1 &','\$', 5) + mySSH.command('echo $USER; nohup sudo -E tshark -i ' + eth_interface + ' -f "' + fltr + '" -w /tmp/' + pcapfile + ' > /dev/null 2>&1 &','\$', 5) mySSH.close() @@ -390,10 +391,11 @@ class RANManagement(): result = re.search('interfaceToUse=(?P[a-zA-Z0-9\-\_]+)done', mySSH.getBefore()) if result is not None: eth_interface = result.group('eth_interface') - logging.debug('\u001B[1m Launching tshark on interface ' + eth_interface + '\u001B[0m') + fltr = 'port 38412 or port 36412 or port 36422' # NGAP, S1AP, X2AP + logging.debug('\u001B[1m Launching tshark on interface ' + eth_interface + ' with filter "' + fltr + '"\u001B[0m') self.epcPcapFile = 'enb_' + self.testCase_id + '_s1log.pcap' mySSH.command('echo ' + localEpcPassword + ' | sudo -S rm -f /tmp/' + self.epcPcapFile , '\$', 5) - mySSH.command('echo $USER; nohup sudo tshark -f "host ' + lIpAddr +'" -i ' + eth_interface + ' -w /tmp/' + self.epcPcapFile + ' > /tmp/tshark.log 2>&1 &', localEpcUserName, 5) + mySSH.command('echo $USER; nohup sudo tshark -f "host ' + lIpAddr +'" -i ' + eth_interface + ' -f "' + fltr + '" -w /tmp/' + self.epcPcapFile + ' > /tmp/tshark.log 2>&1 &', localEpcUserName, 5) mySSH.close() mySSH.open(lIpAddr, lUserName, lPassWord) mySSH.command('cd ' + lSourcePath, '\$', 5) From 9240d51774e46444c2cf59544a763194ed26659a Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Wed, 1 Dec 2021 14:29:48 +0100 Subject: [PATCH 16/39] Complete build_oai usage --- cmake_targets/build_oai | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/cmake_targets/build_oai b/cmake_targets/build_oai index b427b161e5..e5a806c0ad 100755 --- a/cmake_targets/build_oai +++ b/cmake_targets/build_oai @@ -99,25 +99,23 @@ Options Makes the LTE softmodem --eNBocp Makes the OCP LTE softmodem --gNB +--gNB Makes the NR softmodem ---nrUE - Makes the NR UE softmodem --RU Makes the OAI RRU --UE Makes the UE specific parts (ue_ip, usim, nvram) from the given configuration file +--nrUE + Makes the NR UE softmodem --UE-conf-nvram [configuration file] Specify conf_nvram_path (default \"$conf_nvram_path\") --UE-gen-nvram [output path] Specify gen_nvram_path (default \"$gen_nvram_path\") ---HWLAT - Makes test program for haw latency tests --a | --agent - Enables agent for software-defined control of the eNB -w | --hardware EXMIMO, USRP, BLADERF, LMSSDR, IRIS, ADRV9371_ZC706, SIMU, AW2SORI, None (Default) Adds this RF board support (in external packages installation and in compilation) +-t | --transport + Selects the transport protocol type, options: None, ETHERNET -P | --phy_simulators Makes the unitary tests Layer 1 simulators -S | --core_simulators @@ -128,6 +126,14 @@ Options runs only specified test cases specified here. This flag is only valid with -s -V | --vcd Adds a debgging facility to the binary files: GUI with major internal synchronization events +-x | --xforms + Will compile with software oscilloscope features +--HWLAT + Makes test program for haw latency tests +--HWLAT_TEST + Compiles a hw latency test program +--verbose-ci + Compile with verbose instructions in CI Docker env --verbose-compile Shows detailed compilation instructions in makefile --cflags_processor @@ -163,6 +169,10 @@ Options Build for I/Q record-playback modes -k | --skip-shared-libraries Skip build for shared libraries to reduce compilation time when building frequently for debugging purposes +--ninja + Tell cmake to use the Ninja build system. Without, will generate make files +--sanitize-address | -fsanitize=address + Enable the address sanitizer on all targets --ittiSIM Makes the itti simulator -h | --help From 0c9c716fbc0debc86eace57867da943334d0ec7f Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 14 Dec 2021 18:08:14 +0100 Subject: [PATCH 17/39] Build all libraries in Ubuntu/RHEL containers --- docker/Dockerfile.build.rhel8.2 | 2 +- docker/Dockerfile.build.ubuntu18 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docker/Dockerfile.build.rhel8.2 b/docker/Dockerfile.build.rhel8.2 index 7ddfcdc034..22486c5e68 100644 --- a/docker/Dockerfile.build.rhel8.2 +++ b/docker/Dockerfile.build.rhel8.2 @@ -35,4 +35,4 @@ COPY . . RUN /bin/sh oaienv && \ cd cmake_targets && \ mkdir -p log && \ - ./build_oai --eNB --gNB --RU --UE --nrUE --ninja -w USRP --verbose-ci + ./build_oai --eNB --gNB --RU --UE --nrUE --ninja --build-lib all -w USRP --verbose-ci diff --git a/docker/Dockerfile.build.ubuntu18 b/docker/Dockerfile.build.ubuntu18 index b479ee90d9..3ba1e41442 100644 --- a/docker/Dockerfile.build.ubuntu18 +++ b/docker/Dockerfile.build.ubuntu18 @@ -35,4 +35,4 @@ COPY . . RUN /bin/sh oaienv && \ cd cmake_targets && \ mkdir -p log && \ - ./build_oai --eNB --gNB --RU --UE --nrUE --ninja -w USRP --verbose-ci + ./build_oai --eNB --gNB --RU --UE --nrUE --ninja --build-lib all -w USRP --verbose-ci From 8c38dc0fbf50da70317ebe7f0c77604d33aa7187 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Fri, 24 Dec 2021 13:20:32 +0100 Subject: [PATCH 18/39] Include telnet SOs in container images --- docker/Dockerfile.eNB.rhel8.2 | 2 ++ docker/Dockerfile.eNB.ubuntu18 | 2 ++ docker/Dockerfile.gNB.rhel8.2 | 1 + docker/Dockerfile.gNB.ubuntu18 | 1 + docker/Dockerfile.lteUE.rhel8.2 | 1 + docker/Dockerfile.lteUE.ubuntu18 | 1 + docker/Dockerfile.nrUE.rhel8.2 | 2 ++ docker/Dockerfile.nrUE.ubuntu18 | 2 ++ 8 files changed, 12 insertions(+) diff --git a/docker/Dockerfile.eNB.rhel8.2 b/docker/Dockerfile.eNB.rhel8.2 index bb0a9cb064..6c921a4932 100644 --- a/docker/Dockerfile.eNB.rhel8.2 +++ b/docker/Dockerfile.eNB.rhel8.2 @@ -69,6 +69,8 @@ COPY --from=enb-build \ /oai-ran/cmake_targets/ran_build/build/libparams_libconfig.so \ /oai-ran/cmake_targets/ran_build/build/libdfts.so \ /oai-ran/cmake_targets/ran_build/build/liboai_iqplayer.so \ + /oai-ran/cmake_targets/ran_build/build/libtelnetsrv.so \ + /oai-ran/cmake_targets/ran_build/build/libtelnetsrv_enb.so \ /usr/local/lib/ COPY --from=enb-base \ diff --git a/docker/Dockerfile.eNB.ubuntu18 b/docker/Dockerfile.eNB.ubuntu18 index 23cea729ca..1f375a20dc 100644 --- a/docker/Dockerfile.eNB.ubuntu18 +++ b/docker/Dockerfile.eNB.ubuntu18 @@ -76,6 +76,8 @@ COPY --from=enb-build \ /oai-ran/cmake_targets/ran_build/build/libparams_libconfig.so \ /oai-ran/cmake_targets/ran_build/build/libdfts.so \ /oai-ran/cmake_targets/ran_build/build/liboai_iqplayer.so \ + /oai-ran/cmake_targets/ran_build/build/libtelnetsrv.so \ + /oai-ran/cmake_targets/ran_build/build/libtelnetsrv_enb.so \ /usr/local/lib/ # Now we are copying from builder-image the UHD files. diff --git a/docker/Dockerfile.gNB.rhel8.2 b/docker/Dockerfile.gNB.rhel8.2 index 832fa17153..703f4c67b5 100644 --- a/docker/Dockerfile.gNB.rhel8.2 +++ b/docker/Dockerfile.gNB.rhel8.2 @@ -74,6 +74,7 @@ COPY --from=gnb-build \ /oai-ran/cmake_targets/ran_build/build/libldpc_optim.so \ /oai-ran/cmake_targets/ran_build/build/libldpc_optim8seg.so \ /oai-ran/cmake_targets/ran_build/build/libldpc_orig.so \ + /oai-ran/cmake_targets/ran_build/build/libtelnetsrv.so \ /usr/local/lib/ COPY --from=gnb-base \ diff --git a/docker/Dockerfile.gNB.ubuntu18 b/docker/Dockerfile.gNB.ubuntu18 index 66c5d7703f..24e4bcbc7c 100644 --- a/docker/Dockerfile.gNB.ubuntu18 +++ b/docker/Dockerfile.gNB.ubuntu18 @@ -78,6 +78,7 @@ COPY --from=gnb-build \ /oai-ran/cmake_targets/ran_build/build/libldpc_optim.so \ /oai-ran/cmake_targets/ran_build/build/libldpc_optim8seg.so \ /oai-ran/cmake_targets/ran_build/build/libldpc_orig.so \ + /oai-ran/cmake_targets/ran_build/build/libtelnetsrv.so \ /usr/local/lib/ # Now we are copying from builder-image the UHD files. diff --git a/docker/Dockerfile.lteUE.rhel8.2 b/docker/Dockerfile.lteUE.rhel8.2 index 2580b95278..f547558bdb 100644 --- a/docker/Dockerfile.lteUE.rhel8.2 +++ b/docker/Dockerfile.lteUE.rhel8.2 @@ -73,6 +73,7 @@ COPY --from=lte-ue-build \ /oai-ran/cmake_targets/ran_build/build/libparams_libconfig.so \ /oai-ran/cmake_targets/ran_build/build/libSIMU.so \ /oai-ran/cmake_targets/ran_build/build/libdfts.so \ + /oai-ran/cmake_targets/ran_build/build/libtelnetsrv.so \ /usr/local/lib/ COPY --from=lte-ue-base \ diff --git a/docker/Dockerfile.lteUE.ubuntu18 b/docker/Dockerfile.lteUE.ubuntu18 index 70394d8a4b..a5bf4cfe94 100644 --- a/docker/Dockerfile.lteUE.ubuntu18 +++ b/docker/Dockerfile.lteUE.ubuntu18 @@ -80,6 +80,7 @@ COPY --from=lte-ue-build \ /oai-ran/cmake_targets/ran_build/build/libparams_libconfig.so \ /oai-ran/cmake_targets/ran_build/build/libSIMU.so \ /oai-ran/cmake_targets/ran_build/build/libdfts.so \ + /oai-ran/cmake_targets/ran_build/build/libtelnetsrv.so \ /usr/local/lib/ # Now we are copying from builder-image the UHD files. diff --git a/docker/Dockerfile.nrUE.rhel8.2 b/docker/Dockerfile.nrUE.rhel8.2 index f774638f47..cbc8d8c65f 100644 --- a/docker/Dockerfile.nrUE.rhel8.2 +++ b/docker/Dockerfile.nrUE.rhel8.2 @@ -76,6 +76,8 @@ COPY --from=nr-ue-build \ /oai-ran/cmake_targets/ran_build/build/libldpc_optim.so \ /oai-ran/cmake_targets/ran_build/build/libldpc_optim8seg.so \ /oai-ran/cmake_targets/ran_build/build/libldpc_orig.so \ + /oai-ran/cmake_targets/ran_build/build/libtelnetsrv.so \ + /oai-ran/cmake_targets/ran_build/build/libtelnetsrv_5Gue.so \ /usr/local/lib/ COPY --from=nr-ue-base \ diff --git a/docker/Dockerfile.nrUE.ubuntu18 b/docker/Dockerfile.nrUE.ubuntu18 index 021e8d39cf..126f268e00 100644 --- a/docker/Dockerfile.nrUE.ubuntu18 +++ b/docker/Dockerfile.nrUE.ubuntu18 @@ -81,6 +81,8 @@ COPY --from=nr-ue-build \ /oai-ran/cmake_targets/ran_build/build/libldpc_optim.so \ /oai-ran/cmake_targets/ran_build/build/libldpc_optim8seg.so \ /oai-ran/cmake_targets/ran_build/build/libldpc_orig.so \ + /oai-ran/cmake_targets/ran_build/build/libtelnetsrv.so \ + /oai-ran/cmake_targets/ran_build/build/libtelnetsrv_5Gue.so \ /usr/local/lib/ # Now we are copying from builder-image the UHD files. From 2a4d4d9cbddbe76c331b3615f709c72dda4587aa Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Fri, 24 Dec 2021 14:27:37 +0100 Subject: [PATCH 19/39] Add readline library: telnetsrv depends on it --- cmake_targets/tools/build_helper | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmake_targets/tools/build_helper b/cmake_targets/tools/build_helper index 06f32183b7..05075bb8ed 100755 --- a/cmake_targets/tools/build_helper +++ b/cmake_targets/tools/build_helper @@ -756,6 +756,7 @@ check_install_oai_software() { libidn11-dev \ libmysqlclient-dev \ libpython2.7-dev \ + libreadline-dev \ libsctp1 \ libsctp-dev \ libssl-dev \ @@ -842,6 +843,7 @@ check_install_oai_software() { patch \ psmisc \ python \ + readline-devel \ subversion \ xmlstarlet \ python-pip \ From bd08a828cfd7504e82dfaad7408ab03ed6226704 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 27 Dec 2021 14:42:48 +0100 Subject: [PATCH 20/39] Give container image delete some time --- ci-scripts/cls_containerize.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci-scripts/cls_containerize.py b/ci-scripts/cls_containerize.py index ef382a8c6c..60e755e9cd 100644 --- a/ci-scripts/cls_containerize.py +++ b/ci-scripts/cls_containerize.py @@ -341,7 +341,7 @@ class Containerize(): # Remove all intermediate build images if self.ranAllowMerge and forceBaseImageBuild: mySSH.command(self.cli + ' image rm ' + baseImage + ':' + baseTag + ' || true', '\$', 30) - mySSH.command(self.cli + ' image rm ran-build:' + imageTag + ' || true','\$', 5) + mySSH.command(self.cli + ' image rm ran-build:' + imageTag + ' || true','\$', 30) # Cleaning any created tmp volume mySSH.command(self.cli + ' volume prune --force || true','\$', 15) mySSH.close() From ac9ee8e206996444c0ee077cc6168b996dda07fd Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 2 Dec 2021 14:49:20 +0100 Subject: [PATCH 21/39] Increase 5G/SA/RFsimulator throughput test --- ci-scripts/xml_files/container_5g_rfsim.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ci-scripts/xml_files/container_5g_rfsim.xml b/ci-scripts/xml_files/container_5g_rfsim.xml index d930886d0b..d1114616a8 100644 --- a/ci-scripts/xml_files/container_5g_rfsim.xml +++ b/ci-scripts/xml_files/container_5g_rfsim.xml @@ -93,7 +93,7 @@ rfsim5g-oai-nr-ue rfsim5g-oai-ext-dn -B 12.1.1.2 -u -i 1 -s - -c 12.1.1.2 -u -i 1 -t 30 -b 400K + -c 12.1.1.2 -u -i 1 -t 30 -b 3M @@ -102,7 +102,7 @@ rfsim5g-oai-ext-dn rfsim5g-oai-nr-ue -u -i 1 -s - -B 12.1.1.2 -c 192.168.72.135 -u -i 1 -t 30 -b 20K + -B 12.1.1.2 -c 192.168.72.135 -u -i 1 -t 30 -b 1M From d02a65c82476ec5fa89ebcdbc975239ad1026ce0 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 27 Dec 2021 15:55:42 +0100 Subject: [PATCH 22/39] Tentatively analyze log files of RFsims --- ci-scripts/cls_containerize.py | 21 +++++++++++++++++++-- ci-scripts/main.py | 2 +- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/ci-scripts/cls_containerize.py b/ci-scripts/cls_containerize.py index 60e755e9cd..9248eba4b8 100644 --- a/ci-scripts/cls_containerize.py +++ b/ci-scripts/cls_containerize.py @@ -700,7 +700,7 @@ class Containerize(): logging.debug(cmd) networkNames = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=10) - def UndeployGenObject(self, HTML): + def UndeployGenObject(self, HTML, RAN): self.exitStatus = 0 ymlPath = self.yamlPath[0].split('/') logPath = '../cmake_targets/log/' + ymlPath[1] @@ -731,7 +731,24 @@ class Containerize(): logging.debug(cmd) deployStatus = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=30) if anyLogs: - cmd = 'mkdir -p '+ logPath + ' && mv ' + self.yamlPath[0] + '/*.log ' + logPath + cmd = 'mkdir -p '+ logPath + ' && cp ' + self.yamlPath[0] + '/*.log ' + logPath + logging.debug(cmd) + deployStatus = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=10) + + # Analyzing log file! + filename = self.yamlPath[0] + '/rfsim?g_oai_?nb.log' + logging.debug('\u001B[1m Analyzing xNB logfile \u001B[0m ' + filename) + cmd = 'ls ' + filename + logfileLs = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=5) + logging.debug(logfileLs) + # For the moment just assume this exists + logStatus = RAN.AnalyzeLogFile_eNB(filename, HTML) + if (logStatus < 0): + HTML.CreateHtmlTestRow(RAN.runtime_stats, 'KO', logStatus) + else: + HTML.CreateHtmlTestRow(RAN.runtime_stats, 'OK', CONST.ALL_PROCESSES_OK) + + cmd = 'rm ' + self.yamlPath[0] + '/*.log' logging.debug(cmd) deployStatus = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=10) if self.tsharkStarted: diff --git a/ci-scripts/main.py b/ci-scripts/main.py index 3a5a69573d..5b5eec285c 100644 --- a/ci-scripts/main.py +++ b/ci-scripts/main.py @@ -909,7 +909,7 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re if CONTAINERS.exitStatus==1: RAN.prematureExit = True elif action == 'UndeployGenObject': - CONTAINERS.UndeployGenObject(HTML) + CONTAINERS.UndeployGenObject(HTML, RAN) if CONTAINERS.exitStatus==1: RAN.prematureExit = True elif action == 'PingFromContainer': From 06bbea7f10aa46e4acc627c881c9d1df90aae834 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 10 Jan 2022 15:44:01 +0100 Subject: [PATCH 23/39] CI: Check for correct files --- ci-scripts/ran.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/ci-scripts/ran.py b/ci-scripts/ran.py index 3c0abccdbf..f20539b21e 100644 --- a/ci-scripts/ran.py +++ b/ci-scripts/ran.py @@ -1021,12 +1021,9 @@ class RANManagement(): datalog_rt_stats = yaml.load(f,Loader=yaml.FullLoader) rt_keys = datalog_rt_stats['Ref'] #we use the keys from the Ref field - if (os.path.isfile('./nrL1_stats.log')) and (os.path.isfile('./nrL1_stats.log')): - stat_files_present=True - else: - stat_files_present=False - logging.debug("NR Stats files for RT analysis not found") - if stat_files_present: + if os.path.isfile('./nrL1_stats.log') and os.path.isfile('./nrMAC_stats.log'): + # don't use CI-nrL1_stats.log, as this will increase the processing time for + # no reason, we just need the last occurence nrL1_stats = open('./nrL1_stats.log', 'r') nrMAC_stats = open('./nrMAC_stats.log', 'r') for line in nrL1_stats.readlines(): @@ -1047,6 +1044,8 @@ class RANManagement(): real_time_stats[k]=tmp.group(1) nrL1_stats.close() nrMAC_stats.close() + else: + logging.debug("NR Stats files for RT analysis not found") #stdout log file and stat log files analysis completed logging.debug(' File analysis (stdout, stats) completed') From 74a4c2f6ef81334d2642170711c90734fa3efb57 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 10 Jan 2022 15:44:46 +0100 Subject: [PATCH 24/39] CI: Log repo cloning/merging instructions --- ci-scripts/ran.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ci-scripts/ran.py b/ci-scripts/ran.py index f20539b21e..3f9c1a8e9e 100644 --- a/ci-scripts/ran.py +++ b/ci-scripts/ran.py @@ -159,6 +159,7 @@ class RANManagement(): # Raphael: here add a check if git clone or git fetch went smoothly mySSH.command('git config user.email "jenkins@openairinterface.org"', '\$', 5) mySSH.command('git config user.name "OAI Jenkins"', '\$', 5) + mySSH.command('git advice.detachedHead false', '\$', 5) # Checking the BUILD INFO file if not self.backgroundBuild: mySSH.command('ls *.txt', '\$', 5) @@ -203,6 +204,7 @@ class RANManagement(): else: logging.debug('Merging with the target branch: ' + self.ranTargetBranch) mySSH.command('git merge --ff origin/' + self.ranTargetBranch + ' -m "Temporary merge for CI"', '\$', 5) + logging.debug(mySSH.getBefore()) # print what git said when merging/checking out mySSH.command('source oaienv', '\$', 5) mySSH.command('cd cmake_targets', '\$', 5) mySSH.command('mkdir -p log', '\$', 5) @@ -212,6 +214,7 @@ class RANManagement(): mySSH.command('echo "./build_oai ' + self.Build_eNB_args + '" > ./my-lte-softmodem-build.sh', '\$', 5) mySSH.command('chmod 775 ./my-lte-softmodem-build.sh', '\$', 5) mySSH.command('echo ' + lPassWord + ' | sudo -S ls', '\$', 5) + logging.debug(mySSH.getBefore()) # print current directory contents for verification mySSH.command('echo $USER; nohup sudo -E ./my-lte-softmodem-build.sh' + ' > ' + lSourcePath + '/cmake_targets/compile_oai_enb.log ' + ' 2>&1 &', lUserName, 5) mySSH.close() HTML.CreateHtmlTestRow(self.Build_eNB_args, 'OK', CONST.ALL_PROCESSES_OK) From 76411447abc0c9469f195df8c73b4d48c79c6b01 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 10 Jan 2022 15:46:12 +0100 Subject: [PATCH 25/39] CI: Continuously collect RAN logging file output --- ci-scripts/stats_monitor.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/ci-scripts/stats_monitor.py b/ci-scripts/stats_monitor.py index 933bf13203..e732325fa1 100755 --- a/ci-scripts/stats_monitor.py +++ b/ci-scripts/stats_monitor.py @@ -61,9 +61,16 @@ class StatMonitor(): def collect(self,node_type): if node_type=='enb': - cmd='cat L1_stats.log MAC_stats.log PDCP_stats.log RRC_stats.log' + files = ["L1_stats.log", "MAC_stats.log", "PDCP_stats.log", "RRC_stats.log"] else: #'gnb' - cmd='cat nrL1_stats.log nrMAC_stats.log nrPDCP_stats.log nrRRC_stats.log' + files = ["nrL1_stats.log", "nrMAC_stats.log", "nrPDCP_stats.log", "nrRRC_stats.log"] + # append each file's contents to another file (prepended with CI-) for + # post-mortem/debugging analysis + for f in files: + cmd = rf'cat {f} >> CI-{f}' + subprocess.Popen(shlex.split(cmd)) + # join the files for further processing + cmd = rf'cat {shlex.join(files)}' process=subprocess.Popen(shlex.split(cmd), stdout=subprocess.PIPE) output = process.stdout.readlines() if node_type=='enb': From 4e0548328dcef531afcf1f8b06f3a54e64ed8638 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 10 Jan 2022 15:46:45 +0100 Subject: [PATCH 26/39] CI: delete old stats_monitor files --- ci-scripts/stats_monitor.py.old | 94 ----------------------------- ci-scripts/stats_monitor_dev.py | 101 -------------------------------- 2 files changed, 195 deletions(-) delete mode 100755 ci-scripts/stats_monitor.py.old delete mode 100755 ci-scripts/stats_monitor_dev.py diff --git a/ci-scripts/stats_monitor.py.old b/ci-scripts/stats_monitor.py.old deleted file mode 100755 index ae9b39bfa6..0000000000 --- a/ci-scripts/stats_monitor.py.old +++ /dev/null @@ -1,94 +0,0 @@ -import subprocess -import time -import shlex -import re -import sys -import matplotlib.pyplot as plt -import pickle -import numpy as np -import os - -def collect(d, node_type): - if node_type=='enb': - cmd='cat L1_stats.log MAC_stats.log PDCP_stats.log RRC_stats.log' - else: #'gnb' - cmd='cat nrL1_stats.log nrMAC_stats.log nrPDCP_stats.log nrRRC_stats.log' - process=subprocess.Popen(shlex.split(cmd), stdout=subprocess.PIPE) - output = process.stdout.readlines() - for l in output: - tmp=l.decode("utf-8") - result=re.match(rf'^.*\bPHR\b ([0-9]+).+\bbler\b ([0-9]+\.[0-9]+).+\bmcsoff\b ([0-9]+).+\bmcs\b ([0-9]+)',tmp) - if result is not None: - d['PHR'].append(int(result.group(1))) - d['bler'].append(float(result.group(2))) - d['mcsoff'].append(int(result.group(3))) - d['mcs'].append(int(result.group(4))) - - -def graph(d, node_type): - - - figure, axis = plt.subplots(4, 1,figsize=(10, 10)) - - major_ticks = np.arange(0, len(d['PHR'])+1, 1) - axis[0].set_xticks(major_ticks) - axis[0].set_xticklabels([]) - axis[0].plot(d['PHR'],marker='o') - axis[0].set_xlabel('time') - axis[0].set_ylabel('PHR') - axis[0].set_title("PHR") - - major_ticks = np.arange(0, len(d['bler'])+1, 1) - axis[1].set_xticks(major_ticks) - axis[1].set_xticklabels([]) - axis[1].plot(d['bler'],marker='o') - axis[1].set_xlabel('time') - axis[1].set_ylabel('bler') - axis[1].set_title("bler") - - major_ticks = np.arange(0, len(d['mcsoff'])+1, 1) - axis[2].set_xticks(major_ticks) - axis[2].set_xticklabels([]) - axis[2].plot(d['mcsoff'],marker='o') - axis[2].set_xlabel('time') - axis[2].set_ylabel('mcsoff') - axis[2].set_title("mcsoff") - - major_ticks = np.arange(0, len(d['mcs'])+1, 1) - axis[3].set_xticks(major_ticks) - axis[3].set_xticklabels([]) - axis[3].plot(d['mcs'],marker='o') - axis[3].set_xlabel('time') - axis[3].set_ylabel('mcs') - axis[3].set_title("mcs") - - plt.tight_layout() - # Combine all the operations and display - plt.savefig(node_type+'_stats_monitor.png') - plt.show() - -if __name__ == "__main__": - - node_type = sys.argv[1]#enb or gnb - - d={} - d['PHR']=[] - d['bler']=[] - d['mcsoff']=[] - d['mcs']=[] - - - cmd='ps aux | grep modem | grep -v grep' - process=subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE) - output = process.stdout.readlines() - while len(output)!=0 : - collect(d, node_type) - process=subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE) - output = process.stdout.readlines() - time.sleep(1) - print('process stopped') - with open(node_type+'_stats_monitor.pickle', 'wb') as handle: - pickle.dump(d, handle, protocol=pickle.HIGHEST_PROTOCOL) - graph(d, node_type) - - diff --git a/ci-scripts/stats_monitor_dev.py b/ci-scripts/stats_monitor_dev.py deleted file mode 100755 index 83de20f5d2..0000000000 --- a/ci-scripts/stats_monitor_dev.py +++ /dev/null @@ -1,101 +0,0 @@ -""" -To create graphs and pickle from runtime statistics in L1,MAC,RRC,PDCP files -""" - -import subprocess -import time -import shlex -import re -import sys -import pickle -import matplotlib.pyplot as plt -import numpy as np -import yaml - - -class StatMonitor(): - def __init__(self,): - with open('stats_monitor_conf.yaml','r') as file: - self.d = yaml.load(file) - for node in self.d: - for metric in self.d[node]: - self.d[node][metric]=[] - - - def process_gnb (self,node_type,output): - for line in output: - tmp=line.decode("utf-8") - result=re.match(r'^.*\bdlsch_rounds\b ([0-9]+)\/([0-9]+).*\bdlsch_errors\b ([0-9]+)',tmp) - if result is not None: - self.d[node_type]['dlsch_err'].append(int(result.group(3))) - percentage=float(result.group(2))/float(result.group(1)) - self.d[node_type]['dlsch_err_perc_round_1'].append(percentage) - result=re.match(r'^.*\bulsch_rounds\b ([0-9]+)\/([0-9]+).*\bulsch_errors\b ([0-9]+)',tmp) - if result is not None: - self.d[node_type]['ulsch_err'].append(int(result.group(3))) - percentage=float(result.group(2))/float(result.group(1)) - self.d[node_type]['ulsch_err_perc_round_1'].append(percentage) - - - def process_enb (self,node_type,output): - for line in output: - tmp=line.decode("utf-8") - result=re.match(r'^.*\bPHR\b ([0-9]+).+\bbler\b ([0-9]+\.[0-9]+).+\bmcsoff\b ([0-9]+).+\bmcs\b ([0-9]+)',tmp) - if result is not None: - self.d[node_type]['PHR'].append(int(result.group(1))) - self.d[node_type]['bler'].append(float(result.group(2))) - self.d[node_type]['mcsoff'].append(int(result.group(3))) - self.d[node_type]['mcs'].append(int(result.group(4))) - - - def collect(self,node_type): - if node_type=='enb': - cmd='cat L1_stats.log MAC_stats.log PDCP_stats.log RRC_stats.log' - else: #'gnb' - cmd='cat nrL1_stats.log nrMAC_stats.log nrPDCP_stats.log nrRRC_stats.log' - process=subprocess.Popen(shlex.split(cmd), stdout=subprocess.PIPE) - output = process.stdout.readlines() - if node_type=='enb': - self.process_enb(node_type,output) - else: #'gnb' - self.process_gnb(node_type,output) - - - def graph(self,node_type): - col = 1 - figure, axis = plt.subplots(len(self.d[node_type]), col ,figsize=(10, 10)) - i=0 - for metric in self.d[node_type]: - major_ticks = np.arange(0, len(self.d[node_type][metric])+1, 1) - axis[i].set_xticks(major_ticks) - axis[i].set_xticklabels([]) - axis[i].plot(self.d[node_type][metric],marker='o') - axis[i].set_xlabel('time') - axis[i].set_ylabel(metric) - axis[i].set_title(metric) - i+=1 - - plt.tight_layout() - # Combine all the operations and display - plt.savefig(node_type+'_stats_monitor.png') - plt.show() - - -if __name__ == "__main__": - - node = sys.argv[1]#enb or gnb - mon=StatMonitor() - - #collecting stats when modem process is stopped - CMD='ps aux | grep mode | grep -v grep' - process=subprocess.Popen(CMD, shell=True, stdout=subprocess.PIPE) - output = process.stdout.readlines() - while len(output)!=0 : - mon.collect(node) - process=subprocess.Popen(CMD, shell=True, stdout=subprocess.PIPE) - output = process.stdout.readlines() - time.sleep(1) - print('Process stopped') - with open(node+'_stats_monitor.pickle', 'wb') as handle: - pickle.dump(mon.d, handle, protocol=pickle.HIGHEST_PROTOCOL) - mon.graph(node) From 396fcd435ef00c967dfbb08ad9ce15b3fd50ede8 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Wed, 12 Jan 2022 14:43:04 +0100 Subject: [PATCH 27/39] CI: force rebuild of ran_base if build_oai/build_helper/Dockerfile change --- ci-scripts/cls_containerize.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci-scripts/cls_containerize.py b/ci-scripts/cls_containerize.py index 9248eba4b8..be42bc2fc5 100644 --- a/ci-scripts/cls_containerize.py +++ b/ci-scripts/cls_containerize.py @@ -221,7 +221,7 @@ class Containerize(): if (self.ranAllowMerge): imageTag = 'ci-temp' if self.ranTargetBranch == 'develop': - mySSH.command('git diff HEAD..origin/develop -- docker/Dockerfile.base' + self.dockerfileprefix + ' | grep --colour=never -i INDEX', '\$', 5) + mySSH.command('git diff HEAD..origin/develop -- cmake_targets/build_oai cmake_targets/tools/build_helper docker/Dockerfile.base' + self.dockerfileprefix + ' | grep --colour=never -i INDEX', '\$', 5) result = re.search('index', mySSH.getBefore()) if result is not None: forceBaseImageBuild = True From 63a5a097325342a703c63009ca535022b5500e9b Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 13 Jan 2022 18:34:53 +0100 Subject: [PATCH 28/39] Complete build_oai -t options --- cmake_targets/build_oai | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake_targets/build_oai b/cmake_targets/build_oai index e5a806c0ad..2a032079d3 100755 --- a/cmake_targets/build_oai +++ b/cmake_targets/build_oai @@ -115,7 +115,7 @@ Options EXMIMO, USRP, BLADERF, LMSSDR, IRIS, ADRV9371_ZC706, SIMU, AW2SORI, None (Default) Adds this RF board support (in external packages installation and in compilation) -t | --transport - Selects the transport protocol type, options: None, ETHERNET + Selects the transport protocol type, options: None, Ethernet, benetel4g, benetel5g -P | --phy_simulators Makes the unitary tests Layer 1 simulators -S | --core_simulators From a8041b6794a84ce9915f390b26a156d70228a0ec Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 13 Jan 2022 18:44:40 +0100 Subject: [PATCH 29/39] CI: Correct file path of logging results --- ci-scripts/cls_containerize.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci-scripts/cls_containerize.py b/ci-scripts/cls_containerize.py index be42bc2fc5..f2f5d39153 100644 --- a/ci-scripts/cls_containerize.py +++ b/ci-scripts/cls_containerize.py @@ -736,7 +736,7 @@ class Containerize(): deployStatus = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=10) # Analyzing log file! - filename = self.yamlPath[0] + '/rfsim?g_oai_?nb.log' + filename = self.yamlPath[0] + '/rfsim?g-oai-?nb.log' logging.debug('\u001B[1m Analyzing xNB logfile \u001B[0m ' + filename) cmd = 'ls ' + filename logfileLs = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=5) From 5dae0096f00ce118163d722dcc9991ff13e7eb46 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Fri, 14 Jan 2022 18:29:17 +0100 Subject: [PATCH 30/39] CI: Rename SA OAIUE x300 test cases to not overwrite N300 results --- ci-scripts/xml_files/fr1_sa_oaiue_x300.xml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/ci-scripts/xml_files/fr1_sa_oaiue_x300.xml b/ci-scripts/xml_files/fr1_sa_oaiue_x300.xml index 509fef9e8a..c43bdd2a7c 100644 --- a/ci-scripts/xml_files/fr1_sa_oaiue_x300.xml +++ b/ci-scripts/xml_files/fr1_sa_oaiue_x300.xml @@ -26,19 +26,19 @@ tasks 1 - 040000 + 041000 000002 - 010000 + 011000 000002 - 050000 - 050001 + 051000 + 051001 000001 010002 080000 - + Initialize_OAI_UE Initialize OAI UE (X300) nr @@ -51,7 +51,7 @@ - + Initialize_eNB Initialize gNB -O ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf --sa --usrp-tx-thread-config 1 --log_config.global_log_options level,nocolor,time @@ -76,14 +76,14 @@ - + Ping Ping from CN to UE: 20pings in 20sec -c 20 5 - + Ping Ping from CN to UE: 100pings in 20sec -c 100 -i 0.2 From 55d1f1bd11ff793fb22dfd5991c3cdb85e253745 Mon Sep 17 00:00:00 2001 From: Laurent THOMAS Date: Fri, 14 Jan 2022 19:27:05 +0100 Subject: [PATCH 31/39] fix issue created from fix int8 overflow (int8 overflox is small) --- openair1/PHY/NR_REFSIG/ptrs_nr.c | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/openair1/PHY/NR_REFSIG/ptrs_nr.c b/openair1/PHY/NR_REFSIG/ptrs_nr.c index d3d4bf0faf..40a6a56611 100644 --- a/openair1/PHY/NR_REFSIG/ptrs_nr.c +++ b/openair1/PHY/NR_REFSIG/ptrs_nr.c @@ -105,10 +105,9 @@ void set_ptrs_symb_idx(uint16_t *ptrs_symbols, uint8_t L_ptrs, uint16_t ul_dmrs_symb_pos) { - uint i = 0, last_symbol, l_ref; - int l_counter; - l_ref = start_symbol; - last_symbol = start_symbol + duration_in_symbols - 1; + int i = 0; + int l_ref = start_symbol; + const int last_symbol = start_symbol + duration_in_symbols - 1; if (L_ptrs==0) { LOG_E(PHY,"bug: impossible L_ptrs\n"); *ptrs_symbols = 0; @@ -117,7 +116,7 @@ void set_ptrs_symb_idx(uint16_t *ptrs_symbols, while ( (l_ref + i*L_ptrs) <= last_symbol) { - int is_dmrs_symbol = 0; + int is_dmrs_symbol = 0, l_counter; for(l_counter = l_ref + i*L_ptrs; l_counter >= max(l_ref + (i-1)*L_ptrs + 1, l_ref); l_counter--) { @@ -269,8 +268,8 @@ void nr_ptrs_cpe_estimation(uint8_t K_ptrs, return; } uint16_t sc_per_symbol = (nb_rb + K_ptrs - 1)/K_ptrs; - int16_t *ptrs_p = (int16_t *)malloc(sizeof(int32_t)*((1 + sc_per_symbol/4)*4)); - int16_t *dmrs_comp_p = (int16_t *)malloc(sizeof(int32_t)*((1 + sc_per_symbol/4)*4)); + struct complex16 ptrs_p[(1 + sc_per_symbol/4)*4]; + struct complex16 dmrs_comp_p[(1 + sc_per_symbol/4)*4]; double abs = 0.0; double real = 0.0; double imag = 0.0; @@ -278,7 +277,7 @@ void nr_ptrs_cpe_estimation(uint8_t K_ptrs, double alpha = 0; #endif /* generate PTRS RE for the symbol */ - nr_gen_ref_conj_symbols(gold_seq,sc_per_symbol*2,ptrs_p, NR_MOD_TABLE_QPSK_OFFSET,2);// 2 for QPSK + nr_gen_ref_conj_symbols(gold_seq,sc_per_symbol*2,(int16_t*)ptrs_p, NR_MOD_TABLE_QPSK_OFFSET,2);// 2 for QPSK /* loop over all sub carriers to get compensated RE on ptrs symbols*/ for (int re = 0; re < nb_re_pdsch; re++) { @@ -292,8 +291,8 @@ void nr_ptrs_cpe_estimation(uint8_t K_ptrs, 0,// start_re is 0 here ofdm_symbol_size); if(is_ptrs_re) { - dmrs_comp_p[re_cnt*2] = rxF_comp[re *2]; - dmrs_comp_p[(re_cnt*2)+1] = rxF_comp[(re *2)+1]; + dmrs_comp_p[re_cnt].r = rxF_comp[re *2]; + dmrs_comp_p[re_cnt].i = rxF_comp[(re *2)+1]; re_cnt++; } else { @@ -307,7 +306,7 @@ void nr_ptrs_cpe_estimation(uint8_t K_ptrs, *ptrs_sc = re_cnt; /*Multiple compensated data with conj of PTRS */ - mult_cpx_vector(dmrs_comp_p, ptrs_p, ptrs_ch_p,(1 + sc_per_symbol/4)*4,15); // 2^15 shifted + mult_cpx_vector((int16_t*)dmrs_comp_p, (int16_t*)ptrs_p, ptrs_ch_p,(1 + sc_per_symbol/4)*4,15); // 2^15 shifted /* loop over all ptrs sub carriers in a symbol */ /* sum the error vector */ @@ -331,9 +330,6 @@ void nr_ptrs_cpe_estimation(uint8_t K_ptrs, #ifdef DEBUG_PTRS printf("[PHY][PTRS]: Estimated Symbol %d -> %d + j* %d \n",symbol, error_est[0], error_est[1] ); #endif - /* free vectors */ - free(ptrs_p); - free(dmrs_comp_p); } @@ -426,9 +422,10 @@ void get_slope_from_estimates(uint8_t start, uint8_t end, int16_t *est_p, double /* estimate from slope */ void ptrs_estimate_from_slope(int16_t *error_est, double *slope_p, uint8_t start, uint8_t end) { + struct complex16 *error=(struct complex16 *) error_est; for(uint8_t i = 1; i< (end -start);i++) { - error_est[(start+i)*2] = (error_est[start*2] + (int16_t)(i * slope_p[0]));// real - error_est[((start +i)*2)+1] = (error_est[(start*2)+1] + (int16_t)( i * slope_p[1])); //imag + error[start+i].r = error[start].r + (int16_t)(i * slope_p[0]);// real + error[start+i].i = error[start].i + (int16_t)(i * slope_p[1]); //imag #ifdef DEBUG_PTRS printf("[PHY][PTRS]: Estimated Symbol %2d -> %4d %4d from Slope (%4f %4f)\n", start+i,error_est[(start+i)*2],error_est[((start +i)*2)+1], slope_p[0],slope_p[1]); From 6ab196d03b19f6dbcd27eb7db4bf6c04d3c7be00 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Mon, 17 Jan 2022 13:26:15 +0100 Subject: [PATCH 32/39] fix(ci): no history also for single ssh commands Signed-off-by: Raphael Defosseux --- ci-scripts/sshconnection.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ci-scripts/sshconnection.py b/ci-scripts/sshconnection.py index 67e0b832e6..d5b4a4c83e 100644 --- a/ci-scripts/sshconnection.py +++ b/ci-scripts/sshconnection.py @@ -157,22 +157,24 @@ class SSHConnection(): if not silent: logging.debug(commandline) self.cmd2Results = '' + noHistoryCmd = 'unset HISTFILE; ' + commandline myHost = self.username + '@' + self.ipaddress # CAUTION: THIS METHOD IMPLIES THAT THERE ARE VALID SSH KEYS # BETWEEN THE PYTHON EXECUTOR NODE AND THE REMOTE HOST # OTHERWISE IT WON'T WORK - lSsh = subprocess.Popen(["ssh", "%s" % myHost, commandline],shell=False,stdout=subprocess.PIPE,stderr=subprocess.PIPE) + lSsh = subprocess.Popen(["ssh", "%s" % myHost, noHistoryCmd],shell=False,stdout=subprocess.PIPE,stderr=subprocess.PIPE) self.cmd2Results = str(lSsh.stdout.readlines()) def command3(self, commandline, timeout, silent=False): if not silent: logging.debug(commandline) self.cmd2Results = '' + noHistoryCmd = 'unset HISTFILE; ' + commandline myHost = self.username + '@' + self.ipaddress # CAUTION: THIS METHOD IMPLIES THAT THERE ARE VALID SSH KEYS # BETWEEN THE PYTHON EXECUTOR NODE AND THE REMOTE HOST # OTHERWISE IT WON'T WORK - lSsh = subprocess.Popen(["ssh", "%s" % myHost, commandline],shell=False,stdout=subprocess.PIPE,stderr=subprocess.PIPE) + lSsh = subprocess.Popen(["ssh", "%s" % myHost, noHistoryCmd],shell=False,stdout=subprocess.PIPE,stderr=subprocess.PIPE) return lSsh.stdout.readlines() From b0e3867a5f6de4523711e49d56a6bae993e8d6d5 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 17 Jan 2022 15:01:53 +0100 Subject: [PATCH 33/39] Fix: Right RFsim CU/DU filename --- ci-scripts/cls_containerize.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci-scripts/cls_containerize.py b/ci-scripts/cls_containerize.py index f2f5d39153..cd1320b33f 100644 --- a/ci-scripts/cls_containerize.py +++ b/ci-scripts/cls_containerize.py @@ -736,7 +736,7 @@ class Containerize(): deployStatus = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=10) # Analyzing log file! - filename = self.yamlPath[0] + '/rfsim?g-oai-?nb.log' + filename = self.yamlPath[0] + '/rfsim?g-oai-*.log' # 4g/enb, 5g/gnb, 5g/-du/-cu logging.debug('\u001B[1m Analyzing xNB logfile \u001B[0m ' + filename) cmd = 'ls ' + filename logfileLs = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=5) From 64058d84b3f74de55109206449ff6df3cd2e2fb8 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 17 Jan 2022 16:02:26 +0100 Subject: [PATCH 34/39] Don't execute ls on files to analyze (is useless) --- ci-scripts/cls_containerize.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/ci-scripts/cls_containerize.py b/ci-scripts/cls_containerize.py index cd1320b33f..894067a03f 100644 --- a/ci-scripts/cls_containerize.py +++ b/ci-scripts/cls_containerize.py @@ -738,9 +738,6 @@ class Containerize(): # Analyzing log file! filename = self.yamlPath[0] + '/rfsim?g-oai-*.log' # 4g/enb, 5g/gnb, 5g/-du/-cu logging.debug('\u001B[1m Analyzing xNB logfile \u001B[0m ' + filename) - cmd = 'ls ' + filename - logfileLs = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=5) - logging.debug(logfileLs) # For the moment just assume this exists logStatus = RAN.AnalyzeLogFile_eNB(filename, HTML) if (logStatus < 0): From 2ded9658b8cf51ee2be8e64da5b3cab61bb462c3 Mon Sep 17 00:00:00 2001 From: francescomani Date: Mon, 17 Jan 2022 17:07:53 +0100 Subject: [PATCH 35/39] including uecap option in runmodem.md and some other improvements in that file --- doc/RUNMODEM.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/doc/RUNMODEM.md b/doc/RUNMODEM.md index d063afd5d9..89d2ec8a2d 100644 --- a/doc/RUNMODEM.md +++ b/doc/RUNMODEM.md @@ -89,6 +89,8 @@ At the UE the --phy-test flag will ```bash sudo ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf --phy-test``` +In phy-test mode it is possible to mimic the reception of UE Capabilities at gNB by passing through the command line parameter `--uecap_file` the location and file name of the input UE Capability file, e.g. `--uecap_file ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/uecap.xml` + ### Launch UE in another window ```bash sudo ./nr-uesoftmodem --phy-test [--rrc_config_path ../../../ci-scripts/rrc-files]``` @@ -122,6 +124,8 @@ gNB on machine 1: `sudo ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf --do-ra` +In do-ra mode it is possible to mimic the reception of UE Capabilities at gNB by passing through the command line parameter `--uecap_file` the location and file name of the input UE Capability file, e.g. `--uecap_file ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/uecap.xml` + UE on machine 2: `sudo ./nr-uesoftmodem --do-ra` @@ -161,13 +165,17 @@ gNB on machine 1: UE on machine 2: -`sudo ./nr-uesoftmodem -r 106 --numerology 1 --band 78 -C 3619200000 --sa` +`sudo ./nr-uesoftmodem -r 106 --numerology 1 --band 78 -C 3619200000 -s 516 --sa` With the RF simulator (on the same machine): `sudo ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf --rfsim --sa` -`sudo ./nr-uesoftmodem -r 106 --numerology 1 --band 78 -C 3619200000 --rfsim --sa` +`sudo ./nr-uesoftmodem -r 106 --numerology 1 --band 78 -C 3619200000 -s 516 --rfsim --sa` + +where `-r` sets the transmission bandwidth configuration in terms of RBs, `-C` sets the downlink carrier frequency and `-s` sets the SSB start subcarrier. + +Additionally, at UE side `--uecap_file` option can be used to pass the UE Capabilities input file (path location + filename), e.g. `--uecap_file ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/uecap.xml` ## IF setup with OAI From edb876460f49d1e085847c992f1d3d85ce7bbba4 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Wed, 19 Jan 2022 14:38:57 +0100 Subject: [PATCH 36/39] feat(ci): adding RAN containers analysis Signed-off-by: Raphael Defosseux --- ci-scripts/cls_containerize.py | 39 +++++++++++++++++++++++++--------- 1 file changed, 29 insertions(+), 10 deletions(-) diff --git a/ci-scripts/cls_containerize.py b/ci-scripts/cls_containerize.py index 894067a03f..799c58c6aa 100644 --- a/ci-scripts/cls_containerize.py +++ b/ci-scripts/cls_containerize.py @@ -730,20 +730,34 @@ class Containerize(): cmd = 'cd ' + self.yamlPath[0] + ' && docker logs ' + cName + ' > ' + cName + '.log 2>&1' logging.debug(cmd) deployStatus = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=30) + fullStatus = True if anyLogs: cmd = 'mkdir -p '+ logPath + ' && cp ' + self.yamlPath[0] + '/*.log ' + logPath logging.debug(cmd) deployStatus = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=10) # Analyzing log file! - filename = self.yamlPath[0] + '/rfsim?g-oai-*.log' # 4g/enb, 5g/gnb, 5g/-du/-cu - logging.debug('\u001B[1m Analyzing xNB logfile \u001B[0m ' + filename) - # For the moment just assume this exists - logStatus = RAN.AnalyzeLogFile_eNB(filename, HTML) - if (logStatus < 0): - HTML.CreateHtmlTestRow(RAN.runtime_stats, 'KO', logStatus) - else: - HTML.CreateHtmlTestRow(RAN.runtime_stats, 'OK', CONST.ALL_PROCESSES_OK) + listOfPossibleRanContainers = ['enb', 'gnb', 'cu', 'du'] + for container in listOfPossibleRanContainers: + filename = self.yamlPath[0] + '/rfsim?g-oai-' + container + '.log' + cmd = 'ls ' + filename + containerStatus = True + try: + lsStatus = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=10) + filename = str(lsStatus).strip() + except: + containerStatus = False + if not containerStatus: + continue + + logging.debug('\u001B[1m Analyzing xNB logfile ' + filename + ' \u001B[0m') + # For the moment just assume this exists + logStatus = RAN.AnalyzeLogFile_eNB(filename, HTML) + if (logStatus < 0): + fullStatus = False + HTML.CreateHtmlTestRow(RAN.runtime_stats, 'KO', logStatus) + else: + HTML.CreateHtmlTestRow(RAN.runtime_stats, 'OK', CONST.ALL_PROCESSES_OK) cmd = 'rm ' + self.yamlPath[0] + '/*.log' logging.debug(cmd) @@ -761,6 +775,7 @@ class Containerize(): logging.debug(cmd) copyStatus = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=10) + logging.debug('\u001B[1m Undeploying \u001B[0m') cmd = 'cd ' + self.yamlPath[0] + ' && docker-compose -f docker-compose-ci.yml down' logging.debug(cmd) try: @@ -777,8 +792,12 @@ class Containerize(): logging.debug(cmd) deployStatus = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=100) - HTML.CreateHtmlTestRow('n/a', 'OK', CONST.ALL_PROCESSES_OK) - logging.info('\u001B[1m Undeploying OAI Object(s) PASS\u001B[0m') + if fullStatus: + HTML.CreateHtmlTestRow('n/a', 'OK', CONST.ALL_PROCESSES_OK) + logging.info('\u001B[1m Undeploying OAI Object(s) PASS\u001B[0m') + else: + HTML.CreateHtmlTestRow('n/a', 'KO', CONST.ALL_PROCESSES_OK) + logging.info('\u001B[1m Undeploying OAI Object(s) FAIL\u001B[0m') def PingFromContainer(self, HTML): self.exitStatus = 0 From 425bb1490093a392bbc644e1b5827d33b4eaf7c1 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Wed, 19 Jan 2022 14:42:51 +0100 Subject: [PATCH 37/39] fix(ci): better shutdown of container when using USRP Signed-off-by: Raphael Defosseux --- ci-scripts/cls_containerize.py | 23 +++++++++++++++++++---- ci-scripts/epc.py | 2 ++ 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/ci-scripts/cls_containerize.py b/ci-scripts/cls_containerize.py index 799c58c6aa..ba5ce49e8d 100644 --- a/ci-scripts/cls_containerize.py +++ b/ci-scripts/cls_containerize.py @@ -586,11 +586,20 @@ class Containerize(): mySSH.command('cd ' + lSourcePath + '/' + self.yamlPath[self.eNB_instance], '\$', 5) # Currently support only one mySSH.command('docker-compose --file ci-docker-compose.yml config', '\$', 5) + containerName = '' + containerToKill = False result = re.search('container_name: (?P[a-zA-Z0-9\-\_]+)', mySSH.getBefore()) if self.eNB_logFile[self.eNB_instance] == '': self.eNB_logFile[self.eNB_instance] = 'enb_' + HTML.testCase_id + '.log' if result is not None: containerName = result.group('container_name') + containerToKill = True + if containerToKill: + mySSH.command('docker inspect ' + containerName, '\$', 30) + result = re.search('Error: No such object: ' + containerName, mySSH.getBefore()) + if result is not None: + containerToKill = False + if containerToKill: mySSH.command('docker kill --signal INT ' + containerName, '\$', 30) time.sleep(5) mySSH.command('docker logs ' + containerName + ' > ' + lSourcePath + '/cmake_targets/' + self.eNB_logFile[self.eNB_instance], '\$', 30) @@ -603,20 +612,26 @@ class Containerize(): mySSH.close() # Analyzing log file! - copyin_res = mySSH.copyin(lIpAddr, lUserName, lPassWord, lSourcePath + '/cmake_targets/' + self.eNB_logFile[self.eNB_instance], '.') + if containerToKill: + copyin_res = mySSH.copyin(lIpAddr, lUserName, lPassWord, lSourcePath + '/cmake_targets/' + self.eNB_logFile[self.eNB_instance], '.') + else: + copyin_res = 0 nodeB_prefix = 'e' if (copyin_res == -1): HTML.htmleNBFailureMsg='Could not copy ' + nodeB_prefix + 'NB logfile to analyze it!' HTML.CreateHtmlTestRow('N/A', 'KO', CONST.ENB_PROCESS_NOLOGFILE_TO_ANALYZE) else: - logging.debug('\u001B[1m Analyzing ' + nodeB_prefix + 'NB logfile \u001B[0m ' + self.eNB_logFile[self.eNB_instance]) - logStatus = RAN.AnalyzeLogFile_eNB(self.eNB_logFile[self.eNB_instance], HTML) + if containerToKill: + logging.debug('\u001B[1m Analyzing ' + nodeB_prefix + 'NB logfile \u001B[0m ' + self.eNB_logFile[self.eNB_instance]) + logStatus = RAN.AnalyzeLogFile_eNB(self.eNB_logFile[self.eNB_instance], HTML) + else: + logStatus = 0 if (logStatus < 0): HTML.CreateHtmlTestRow(RAN.runtime_stats, 'KO', logStatus) else: HTML.CreateHtmlTestRow(RAN.runtime_stats, 'OK', CONST.ALL_PROCESSES_OK) # all the xNB run logs shall be on the server 0 for logCollecting - if self.eNB_serverId[self.eNB_instance] != '0': + if containerToKill and self.eNB_serverId[self.eNB_instance] != '0': mySSH.copyout(self.eNBIPAddress, self.eNBUserName, self.eNBPassword, './' + self.eNB_logFile[self.eNB_instance], self.eNBSourceCodePath + '/cmake_targets/') logging.info('\u001B[1m Undeploying OAI Object Pass\u001B[0m') diff --git a/ci-scripts/epc.py b/ci-scripts/epc.py index a62bb96ed1..9ed9f06d8e 100644 --- a/ci-scripts/epc.py +++ b/ci-scripts/epc.py @@ -532,6 +532,7 @@ class EPCManagement(): logging.debug('Terminating OAI CN5G') mySSH.command('cd /opt/oai-cn5g-fed/docker-compose', '\$', 5) mySSH.command('./core-network.sh stop nrf spgwu', '\$', 60) + mySSH.command('docker volume prune --force || true', '\$', 60) time.sleep(2) mySSH.command('tshark -r /tmp/oai-cn5g.pcap | egrep --colour=never "Tracking area update" ','\$', 30) result = re.search('Tracking area update request', mySSH.getBefore()) @@ -760,6 +761,7 @@ class EPCManagement(): nbContainers += 1 mySSH.command('docker-compose down', '\$', 60) + mySSH.command('docker volume prune --force || true', '\$', 60) mySSH.command('docker inspect --format=\'{{.State.Health.Status}}\' ' + listOfContainers, '\$', 10) noMoreContainerNb = mySSH.getBefore().count('No such object') mySSH.command('docker inspect --format=\'{{.Name}}\' prod-oai-public-net prod-oai-private-net', '\$', 10) From 27599b0b080390ac3e39cc4a48e6690279d60da3 Mon Sep 17 00:00:00 2001 From: francescomani Date: Wed, 19 Jan 2022 11:17:34 +0100 Subject: [PATCH 38/39] fix for phy-simulators compilation --- openair1/SIMULATION/NR_PHY/dlsim.c | 1 + openair1/SIMULATION/NR_PHY/prachsim.c | 1 + openair1/SIMULATION/NR_PHY/ulsim.c | 1 + 3 files changed, 3 insertions(+) diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index 4a0da8eade..47ef32e1f6 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -82,6 +82,7 @@ RAN_CONTEXT_t RC; int32_t uplink_frequency_offset[MAX_NUM_CCs][4]; double cpuf; +char *uecap_file; uint16_t sf_ahead=4 ; uint16_t sl_ahead=0; diff --git a/openair1/SIMULATION/NR_PHY/prachsim.c b/openair1/SIMULATION/NR_PHY/prachsim.c index 6b9512a38b..fb0f37d7ac 100644 --- a/openair1/SIMULATION/NR_PHY/prachsim.c +++ b/openair1/SIMULATION/NR_PHY/prachsim.c @@ -60,6 +60,7 @@ LCHAN_DESC DCCH_LCHAN_DESC,DTCH_DL_LCHAN_DESC,DTCH_UL_LCHAN_DESC; rlc_info_t Rlc_info_um,Rlc_info_am_config; +char *uecap_file; PHY_VARS_gNB *gNB; PHY_VARS_NR_UE *UE; RAN_CONTEXT_t RC; diff --git a/openair1/SIMULATION/NR_PHY/ulsim.c b/openair1/SIMULATION/NR_PHY/ulsim.c index ceeded145a..6c2ea03421 100644 --- a/openair1/SIMULATION/NR_PHY/ulsim.c +++ b/openair1/SIMULATION/NR_PHY/ulsim.c @@ -74,6 +74,7 @@ rlc_info_t Rlc_info_um,Rlc_info_am_config; PHY_VARS_gNB *gNB; PHY_VARS_NR_UE *UE; RAN_CONTEXT_t RC; +char *uecap_file; int32_t uplink_frequency_offset[MAX_NUM_CCs][4]; uint16_t sf_ahead=4 ; From 3d504eb7f831078f7ac90e986c850de05c4238c0 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Wed, 19 Jan 2022 15:47:39 +0100 Subject: [PATCH 39/39] feat(ci): disabling obsolete pipelines; splitting the RF sim test into a 4G and a 5G pipelines Signed-off-by: Raphael Defosseux --- ci-scripts/Jenkinsfile-GitLab-Container | 26 ++++++++-- ci-scripts/Jenkinsfile-gitlab | 68 ------------------------- 2 files changed, 23 insertions(+), 71 deletions(-) diff --git a/ci-scripts/Jenkinsfile-GitLab-Container b/ci-scripts/Jenkinsfile-GitLab-Container index 9ff0371ae5..f5852bace5 100644 --- a/ci-scripts/Jenkinsfile-GitLab-Container +++ b/ci-scripts/Jenkinsfile-GitLab-Container @@ -198,17 +198,37 @@ pipeline { } } } - stage ("RF Simulators") { + stage ("4G RF Simulators") { when { expression {doMandatoryTests} } steps { script { - triggerSlaveJob ('RAN-RF-Sim-Test', 'Test-RF-Sim-Container') + triggerSlaveJob ('RAN-RF-Sim-Test-4G', 'Test-RF-Sim-Container-4G') } } post { always { script { - finalizeSlaveJob('RAN-RF-Sim-Test') + finalizeSlaveJob('RAN-RF-Sim-Test-4G') + } + } + failure { + script { + currentBuild.result = 'FAILURE' + } + } + } + } + stage ("5G RF Simulators") { + when { expression {doMandatoryTests} } + steps { + script { + triggerSlaveJob ('RAN-RF-Sim-Test-5G', 'Test-RF-Sim-Container-4G') + } + } + post { + always { + script { + finalizeSlaveJob('RAN-RF-Sim-Test-5G') } } failure { diff --git a/ci-scripts/Jenkinsfile-gitlab b/ci-scripts/Jenkinsfile-gitlab index df816c12a7..8f1955f265 100644 --- a/ci-scripts/Jenkinsfile-gitlab +++ b/ci-scripts/Jenkinsfile-gitlab @@ -529,52 +529,6 @@ pipeline { } } } - stage ("Test MONOLITHIC - FDD - Band 13 - B210") { - when { - expression {doFullTestsuite} - } - steps { - script { - sh "sleep 60" - triggerSlaveJob ('eNB-CI-MONO-FDD-Band13-B210', 'Test-Mono-FDD-Band13-LTE-M') - } - } - post { - always { - script { - finalizeSlaveJob('eNB-CI-MONO-FDD-Band13-B210') - } - } - failure { - script { - currentBuild.result = 'FAILURE' - } - } - } - } - stage ("Test X2 Handover - FDD - Band 13 - B210") { - when { - expression {doFullTestsuite} - } - steps { - script { - sh "sleep 60" - triggerSlaveJob ('eNB-CI-MONO-FDD-Band13-X2HO-B210', 'Test-Mono-FDD-Band13-X2-HO') - } - } - post { - always { - script { - finalizeSlaveJob('eNB-CI-MONO-FDD-Band13-X2HO-B210') - } - } - failure { - script { - currentBuild.result = 'FAILURE' - } - } - } - } stage ("Test IF4p5 - TDD - Band 38 - B210 - MultiRRU") { when { expression {doFullTestsuite} @@ -643,28 +597,6 @@ pipeline { } } } - stage ("Test OAI OCP-eNB - FDD - Band 7 - B210") { - when { - expression {doFullTestsuite} - } - steps { - script { - triggerSlaveJob ('OCPeNB-FDD-Band7-B210', 'Test-OCP-FDD-Band7') - } - } - post { - always { - script { - finalizeSlaveJob('OCPeNB-FDD-Band7-B210') - } - } - failure { - script { - currentBuild.result = 'FAILURE' - } - } - } - } } post { always {