From a7cbe98fa77755da35af7c5f75fd5f2481720b0c Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Mon, 10 May 2021 17:01:12 -0700 Subject: [PATCH] mbms_create_tasks was calling SCTP task again. This caused the SCTP descriptor to be reset. This made issues in the X2 interface between gNB and eNB. Lots of logs added here. Need to fill NR_UE_Capability_Info properly. --- cmake_targets/CMakeLists.txt | 2 +- openair2/RRC/LTE/rrc_UE.c | 101 +++++++++++++++++-------- openair2/RRC/LTE/rrc_eNB.c | 7 +- openair2/RRC/LTE/rrc_eNB_endc.c | 4 +- openair2/RRC/NR/rrc_gNB_internode.c | 3 +- openair2/RRC/NR/rrc_gNB_nsa.c | 4 +- openair2/SIMULATION/NR_RRC/itti_sim.c | 3 +- openair3/TEST/EPC_TEST/play_scenario.c | 1 + openair3/TEST/oaisim_mme_test_s1c.c | 1 + targets/COMMON/create_tasks_mbms.c | 1 + targets/RT/USER/lte-softmodem.c | 2 - 11 files changed, 88 insertions(+), 41 deletions(-) diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index 7a4da6ce14..a7d2bb61ab 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -395,7 +395,7 @@ set (FIRMWARE_VERSION "No svn information") add_definitions("-DFIRMWARE_VERSION=\"${FIRMWARE_VERSION}\"") add_definitions("-DPACKAGE_VERSION=\"Branch: ${GIT_BRANCH} Abrev. Hash: ${GIT_COMMIT_HASH} Date: ${GIT_COMMIT_DATE}\"") add_definitions("-DPACKAGE_BUGREPORT=\"openair4g-devel@lists.eurecom.fr\"") -add_definitions("-DEMIT_ASN_DEBUG=1") +#add_definitions("-DEMIT_ASN_DEBUG=1") # Debug related options diff --git a/openair2/RRC/LTE/rrc_UE.c b/openair2/RRC/LTE/rrc_UE.c index 4044d10e07..84f6528955 100644 --- a/openair2/RRC/LTE/rrc_UE.c +++ b/openair2/RRC/LTE/rrc_UE.c @@ -1762,7 +1762,20 @@ rrc_ue_process_ueCapabilityEnquiry( } } - +static LTE_RRCConnectionReconfiguration_v1510_IEs_t* does_nce_exist(LTE_RRCConnectionReconfiguration_r8_IEs_t *c) +{ +#define NCE nonCriticalExtension + return c != NULL + && c->NCE != NULL + && c->NCE->NCE != NULL + && c->NCE->NCE->NCE != NULL + && c->NCE->NCE->NCE->NCE != NULL + && c->NCE->NCE->NCE->NCE->NCE != NULL + && c->NCE->NCE->NCE->NCE->NCE->NCE != NULL + && c->NCE->NCE->NCE->NCE->NCE->NCE->NCE != NULL + && c->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE != NULL; +#undef NCE +} //----------------------------------------------------------------------------- void rrc_ue_process_rrcConnectionReconfiguration( @@ -1775,56 +1788,69 @@ rrc_ue_process_rrcConnectionReconfiguration( LOG_I(RRC,"[UE %d] Frame %d: Receiving from SRB1 (DL-DCCH), Processing RRCConnectionReconfiguration (eNB %d)\n", ctxt_pP->module_id,ctxt_pP->frame,eNB_index); - if (rrcConnectionReconfiguration->criticalExtensions.present == LTE_RRCConnectionReconfiguration__criticalExtensions_PR_c1) { + if (rrcConnectionReconfiguration->criticalExtensions.present == + LTE_RRCConnectionReconfiguration__criticalExtensions_PR_c1) { if (rrcConnectionReconfiguration->criticalExtensions.choice.c1.present == LTE_RRCConnectionReconfiguration__criticalExtensions__c1_PR_rrcConnectionReconfiguration_r8) { - LTE_RRCConnectionReconfiguration_r8_IEs_t *rrcConnectionReconfiguration_r8 = - &rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8; + LTE_RRCConnectionReconfiguration_r8_IEs_t *r_r8 = &rrcConnectionReconfiguration-> + criticalExtensions.choice.c1. + choice.rrcConnectionReconfiguration_r8; - if (rrcConnectionReconfiguration_r8->mobilityControlInfo) { + /* Melissa: Here we need to open up container to get r_15 non-criticalExtensions. Look in + eNB as to how this message is put into the container. Need scg_group_config and scg_RB_config. + These two need to be sent over to the NR UE. */ + LOG_E(RRC, "Checking if we have NR RRCConnectionReconfig\n"); + LTE_RRCConnectionReconfiguration_v1510_IEs_t *nce_nr = does_nce_exist(&r_r8); + LOG_E(RRC, "This is nce_nr %p\n", nce_nr); + if (nce_nr) { + if (nce_nr->nr_Config_r15->present == LTE_RRCConnectionReconfiguration_v1510_IEs__nr_Config_r15_PR_setup) { + LOG_E(RRC, "We successfully have NR RRCConnectionReconfig\n"); + //extract_nr_elements(); + //nsa_sendmsg_to_nrue(buf, len, RRC_CONFIG_COMPLETE_REQ); + return; + } + } + + if (r_r8->mobilityControlInfo) { LOG_I(RRC,"Mobility Control Information is present\n"); rrc_ue_process_mobilityControlInfo( ctxt_pP, eNB_index, - rrcConnectionReconfiguration_r8->mobilityControlInfo); + r_r8->mobilityControlInfo); } - if (rrcConnectionReconfiguration_r8->measConfig != NULL) { + if (r_r8->measConfig != NULL) { LOG_I(RRC,"Measurement Configuration is present\n"); rrc_ue_process_measConfig(ctxt_pP, eNB_index, - rrcConnectionReconfiguration_r8->measConfig); + r_r8->measConfig); } - if (rrcConnectionReconfiguration_r8->radioResourceConfigDedicated) { + if (r_r8->radioResourceConfigDedicated) { LOG_I(RRC,"Radio Resource Configuration is present\n"); - rrc_ue_process_radioResourceConfigDedicated(ctxt_pP,eNB_index, rrcConnectionReconfiguration_r8->radioResourceConfigDedicated); + rrc_ue_process_radioResourceConfigDedicated(ctxt_pP, + eNB_index, + r_r8->radioResourceConfigDedicated); } - /* Melissa: Here we need to open up container to get r_15 non-criticalExtensions. Look in - eNB as to how this message is put into the container. Need scg_group_config and scg_RB_config. - These two need to be sent over to the NR UE. */ //TTN for D2D //if RRCConnectionReconfiguration message includes the sl-CommConfig - if ((rrcConnectionReconfiguration_r8->nonCriticalExtension != NULL) - && (rrcConnectionReconfiguration_r8->nonCriticalExtension->nonCriticalExtension + if ((r_r8->nonCriticalExtension != NULL) + && (r_r8->nonCriticalExtension->nonCriticalExtension != NULL) + && (r_r8->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension != NULL) + && (r_r8->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension != NULL) + && (r_r8->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension != NULL) - && (rrcConnectionReconfiguration_r8->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension - != NULL) - && (rrcConnectionReconfiguration_r8->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension - != NULL) - && (rrcConnectionReconfiguration_r8->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension - != NULL) - && (rrcConnectionReconfiguration_r8->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->sl_CommConfig_r12 + && (r_r8->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->sl_CommConfig_r12 != NULL)) { - if (rrcConnectionReconfiguration_r8->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->sl_CommConfig_r12->commTxResources_r12->present != + if (r_r8->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->sl_CommConfig_r12->commTxResources_r12->present != LTE_SL_CommConfig_r12__commTxResources_r12_PR_NOTHING) { LOG_I(RRC,"sl-CommConfig is present\n"); //process sl-CommConfig rrc_ue_process_sidelink_radioResourceConfig(ctxt_pP->module_id,eNB_index, (LTE_SystemInformationBlockType18_r12_t *)NULL, (LTE_SystemInformationBlockType19_r12_t *)NULL, - rrcConnectionReconfiguration_r8->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->sl_CommConfig_r12, + r_r8->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->sl_CommConfig_r12, (LTE_SL_DiscConfig_r12_t *)NULL ); } @@ -1832,28 +1858,28 @@ rrc_ue_process_rrcConnectionReconfiguration( /* //if RRCConnectionReconfiguration message includes the sl-DiscConfig - if (rrcConnectionReconfiguration_r8->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->sl_DiscConfig_r12->discTxResources_r12->present != SL_DiscConfig_r12__discTxResources_r12_PR_NOTHING ){ + if (r_r8->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->sl_DiscConfig_r12->discTxResources_r12->present != SL_DiscConfig_r12__discTxResources_r12_PR_NOTHING ){ LOG_I(RRC,"sl-DiscConfig is present\n"); //process sl-DiscConfig rrc_ue_process_sidelink_radioResourceConfig(ctxt_pP->module_id,eNB_index, (SystemInformationBlockType18_r12_t *)NULL, (SystemInformationBlockType19_r12_t *)NULL, (SL_CommConfig_r12_t* )NULL, - rrcConnectionReconfiguration_r8->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->sl_DiscConfig_r12 + r_r8->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->sl_DiscConfig_r12 ); } */ /* Check if there is dedicated NAS information to forward to NAS */ - if (rrcConnectionReconfiguration_r8->dedicatedInfoNASList != NULL) { + if (r_r8->dedicatedInfoNASList != NULL) { int list_count; uint32_t pdu_length; uint8_t *pdu_buffer; MessageDef *msg_p; - for (list_count = 0; list_count < rrcConnectionReconfiguration_r8->dedicatedInfoNASList->list.count; list_count++) { - pdu_length = rrcConnectionReconfiguration_r8->dedicatedInfoNASList->list.array[list_count]->size; - pdu_buffer = rrcConnectionReconfiguration_r8->dedicatedInfoNASList->list.array[list_count]->buf; + for (list_count = 0; list_count < r_r8->dedicatedInfoNASList->list.count; list_count++) { + pdu_length = r_r8->dedicatedInfoNASList->list.array[list_count]->size; + pdu_buffer = r_r8->dedicatedInfoNASList->list.array[list_count]->buf; msg_p = itti_alloc_new_message(TASK_RRC_UE, 0, NAS_CONN_ESTABLI_CNF); NAS_CONN_ESTABLI_CNF(msg_p).errCode = AS_SUCCESS; NAS_CONN_ESTABLI_CNF(msg_p).nasMsg.length = pdu_length; @@ -1861,7 +1887,7 @@ rrc_ue_process_rrcConnectionReconfiguration( itti_send_msg_to_task(TASK_NAS_UE, ctxt_pP->instance, msg_p); } - free (rrcConnectionReconfiguration_r8->dedicatedInfoNASList); + free (r_r8->dedicatedInfoNASList); } #if ENABLE_RAL @@ -6329,6 +6355,19 @@ void process_nr_nsa_msg(nsa_msg_t *msg, int msg_len) { case UE_CAPABILITY_INFO: { + NR_UE_NR_Capability_t *UE_Capability_nr = NULL; + asn_dec_rval_t dec_rval = uper_decode_complete(NULL, + &asn_DEF_NR_UE_NR_Capability, + (void **)&UE_Capability_nr, + msg_buffer, + msg_len); + if ((dec_rval.code != RC_OK) && (dec_rval.consumed == 0)) + { + SEQUENCE_free(&asn_DEF_NR_UE_NR_Capability, UE_Capability_nr, ASFM_FREE_EVERYTHING); + LOG_E(RRC, "Failed to decode UE_Capability_nr (%zu bits) %d\n", dec_rval.consumed, dec_rval.code); + break; + } + LOG_I(RRC, "Create itti msg to send received UE_CAPABILITY_INFO to eNB\n"); MessageDef *message_p; rrc_dcch_data_copy_t *dl_dcch_buffer = itti_malloc (TASK_RRC_NSA_UE, diff --git a/openair2/RRC/LTE/rrc_eNB.c b/openair2/RRC/LTE/rrc_eNB.c index be625a8df6..52a74491a8 100644 --- a/openair2/RRC/LTE/rrc_eNB.c +++ b/openair2/RRC/LTE/rrc_eNB.c @@ -4424,7 +4424,6 @@ static int encode_CG_ConfigInfo( struct NR_CG_ConfigInfo *cg_configinfo = NULL; struct NR_RadioBearerConfig *rb_config = NULL; asn_enc_rval_t enc_rval; - int RRC_OK = 1; char temp_buff[ASN_MAX_ENCODE_SIZE]; NR_UE_CapabilityRAT_ContainerList_t *ue_cap_rat_container_list = NULL; NR_UE_CapabilityRAT_Container_t *ue_cap_rat_container_MRDC = NULL; @@ -4444,7 +4443,11 @@ static int encode_CG_ConfigInfo( = calloc(1,sizeof(struct NR_CG_ConfigInfo_IEs)); AssertFatal(cg_configinfo->criticalExtensions.choice.c1->choice.cg_ConfigInfo != NULL, "failed to allocate memory for cg_configinfo_IEs"); - + /* Melissa Elkadi: None of the three following if statments are true. In this case, + we never fill the container and in the gNB we are never parsing the UE_capability_info. + I believe this is happening because we are not properly sending the UE_Capability_Info + over from the LTE UE. We received the info from the NR UE but dont fill the container + properly. */ if(ue_context_pP->ue_context.UE_Capability_MRDC) { RAT_Container_count++; enc_rval = uper_encode_to_buffer(&asn_DEF_NR_UE_MRDC_Capability,NULL, diff --git a/openair2/RRC/LTE/rrc_eNB_endc.c b/openair2/RRC/LTE/rrc_eNB_endc.c index f7113eb6da..bb94004d6b 100644 --- a/openair2/RRC/LTE/rrc_eNB_endc.c +++ b/openair2/RRC/LTE/rrc_eNB_endc.c @@ -173,7 +173,7 @@ int rrc_eNB_generate_RRCConnectionReconfiguration_endc(protocol_ctxt_t *ctxt, unsigned char scg_conf_buf[4] = { 0, 0, 0, 0 }; if (scg_group_config!=NULL) { nr.choice.setup.nr_SecondaryCellGroupConfig_r15 = scg_group_config; //&scg_conf; - LOG_E(RRC, "Melissa, setting scg_group_config\n"); + LOG_E(RRC, "Melissa Elkadi. setting scg_group_config\n"); } else{ nr.choice.setup.nr_SecondaryCellGroupConfig_r15 = &dummy_scg_conf; @@ -201,7 +201,7 @@ int rrc_eNB_generate_RRCConnectionReconfiguration_endc(protocol_ctxt_t *ctxt, if(scg_RB_config!=NULL) { cr_1510.nr_RadioBearerConfig1_r15 = scg_RB_config; - LOG_E(RRC, "Melissa, setting scg_RB_config\n"); + LOG_E(RRC, "Melissa Elkadi. setting scg_RB_config\n"); } else{ cr_1510.nr_RadioBearerConfig1_r15 = &dummy_nr1_conf; diff --git a/openair2/RRC/NR/rrc_gNB_internode.c b/openair2/RRC/NR/rrc_gNB_internode.c index c4cd41c5b4..e4286e1f97 100644 --- a/openair2/RRC/NR/rrc_gNB_internode.c +++ b/openair2/RRC/NR/rrc_gNB_internode.c @@ -46,6 +46,7 @@ int parse_CG_ConfigInfo(gNB_RRC_INST *rrc, NR_CG_ConfigInfo_t *CG_ConfigInfo, x2 NR_CG_ConfigInfo_IEs_t *cg_ConfigInfo = CG_ConfigInfo->criticalExtensions.choice.c1->choice.cg_ConfigInfo; if (cg_ConfigInfo->ue_CapabilityInfo) { + LOG_I(RRC, "Melissa Elkadi. We got here %s():%d\n", __FUNCTION__, __LINE__); // Decode UE-CapabilityRAT-ContainerList NR_UE_CapabilityRAT_ContainerList_t *UE_CapabilityRAT_ContainerList=NULL; UE_CapabilityRAT_ContainerList = calloc(1,sizeof(NR_UE_CapabilityRAT_ContainerList_t)); @@ -59,7 +60,7 @@ int parse_CG_ConfigInfo(gNB_RRC_INST *rrc, NR_CG_ConfigInfo_t *CG_ConfigInfo, x2 AssertFatal(1==0,"[InterNode] Failed to decode NR_UE_CapabilityRAT_ContainerList (%zu bits), size of OCTET_STRING %lu\n", dec_rval.consumed, cg_ConfigInfo->ue_CapabilityInfo->size); } - + LOG_I(RRC, "Melissa Elkadi. We got here %s():%d\n", __FUNCTION__, __LINE__); rrc_parse_ue_capabilities(rrc,UE_CapabilityRAT_ContainerList, m,cg_ConfigInfo); } diff --git a/openair2/RRC/NR/rrc_gNB_nsa.c b/openair2/RRC/NR/rrc_gNB_nsa.c index 5ea02c7832..f7064e6a87 100644 --- a/openair2/RRC/NR/rrc_gNB_nsa.c +++ b/openair2/RRC/NR/rrc_gNB_nsa.c @@ -65,6 +65,7 @@ extern rlc_op_status_t nr_rrc_rlc_config_asn1_req (const protocol_ctxt_t * con struct NR_CellGroupConfig__rlc_BearerToAddModList *rlc_bearer2add_list); void rrc_parse_ue_capabilities(gNB_RRC_INST *rrc, NR_UE_CapabilityRAT_ContainerList_t *UE_CapabilityRAT_ContainerList, x2ap_ENDC_sgnb_addition_req_t *m, NR_CG_ConfigInfo_IEs_t *cg_config_info) { + LOG_I(RRC, "Melissa Elkadi. We got here %s():%d\n", __FUNCTION__, __LINE__); struct rrc_gNB_ue_context_s *ue_context_p = NULL; OCTET_STRING_t *ueCapabilityRAT_Container_nr=NULL; @@ -133,6 +134,7 @@ RB_PROTOTYPE(rrc_nr_ue_tree_s, rrc_gNB_ue_context_s, entries, rrc_gNB_compare_ue_rnti_id); void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_p, x2ap_ENDC_sgnb_addition_req_t *m) { + LOG_I(RRC, "Melissa Elkadi. We got here %s():%d\n", __FUNCTION__, __LINE__); // generate nr-Config-r15 containers for LTE RRC : inside message for X2 EN-DC (CG-Config Message from 38.331) rrc_gNB_carrier_data_t *carrier=&rrc->carrier; MessageDef *msg; @@ -373,7 +375,7 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_ (LTE_PMCH_InfoList_r9_t *) NULL, ue_context_p->ue_context.secondaryCellGroup->rlc_BearerToAddModList); - LOG_D(RRC, "%s:%d: done RRC PDCP/RLC ASN1 request for UE rnti %x\n", __FUNCTION__, __LINE__, ctxt.rnti); + LOG_I(RRC, "Melissa Elkadi. %s:%d: done RRC PDCP/RLC ASN1 request for UE rnti %x\n", __FUNCTION__, __LINE__, ctxt.rnti); } diff --git a/openair2/SIMULATION/NR_RRC/itti_sim.c b/openair2/SIMULATION/NR_RRC/itti_sim.c index 5de69daa21..1cf01c6ee4 100644 --- a/openair2/SIMULATION/NR_RRC/itti_sim.c +++ b/openair2/SIMULATION/NR_RRC/itti_sim.c @@ -265,7 +265,8 @@ int restart_L1L2(module_id_t gnb_id) { } int create_gNB_tasks(uint32_t gnb_nb) { - LOG_D(GNB_APP, "%s(gnb_nb:%d)\n", __FUNCTION__, gnb_nb); + AssertFatal(!get_softmodem_params()->nsa, "In NSA mode\n"); + LOG_I(GNB_APP, "%s(gnb_nb:%d)\n", __FUNCTION__, gnb_nb); itti_wait_ready(1); diff --git a/openair3/TEST/EPC_TEST/play_scenario.c b/openair3/TEST/EPC_TEST/play_scenario.c index ebaffdb39e..dfb331d6fe 100644 --- a/openair3/TEST/EPC_TEST/play_scenario.c +++ b/openair3/TEST/EPC_TEST/play_scenario.c @@ -809,6 +809,7 @@ void *et_eNB_app_task(void *args_p) //------------------------------------------------------------------------------ int et_play_scenario(et_scenario_t* const scenario, const struct shift_packet_s *shifts) { + AssertFatal(!get_softmodem_params()->nsa, "In NSA mode\n"); et_event_t event; struct shift_packet_s *shift = shifts; et_packet_t *packet = NULL; diff --git a/openair3/TEST/oaisim_mme_test_s1c.c b/openair3/TEST/oaisim_mme_test_s1c.c index 94a554ab5f..13396135c8 100644 --- a/openair3/TEST/oaisim_mme_test_s1c.c +++ b/openair3/TEST/oaisim_mme_test_s1c.c @@ -299,6 +299,7 @@ void mme_test_s1_notify_sctp_data_ind(uint32_t assoc_id, int32_t stream, const u int main( int argc, char **argv ) //------------------------------------------------------------------------------ { + AssertFatal(!get_softmodem_params()->nsa, "In NSA mode\n"); // initialize the log (see log.h for details) logInit(); diff --git a/targets/COMMON/create_tasks_mbms.c b/targets/COMMON/create_tasks_mbms.c index 5f81592b96..8e5c548c66 100644 --- a/targets/COMMON/create_tasks_mbms.c +++ b/targets/COMMON/create_tasks_mbms.c @@ -52,6 +52,7 @@ int create_tasks_mbms(uint32_t enb_nb) { // LOG_D(ENB_APP, "%s(enb_nb:%d\n", __FUNCTION__, enb_nb); // ngran_node_t type = RC.rrc[0]->node_type; + AssertFatal(!get_softmodem_params()->nsa, "In NSA mode\n"); int rc; if (enb_nb == 0) return 0; diff --git a/targets/RT/USER/lte-softmodem.c b/targets/RT/USER/lte-softmodem.c index 31dfa1842b..cfacf8bad1 100644 --- a/targets/RT/USER/lte-softmodem.c +++ b/targets/RT/USER/lte-softmodem.c @@ -735,8 +735,6 @@ int main ( int argc, char **argv ) create_tasks_mbms(1); config_check_unknown_cmdlineopt(CONFIG_CHECKALLSECTIONS); } - else - create_tasks_mbms(1); //create_tasks_mbms(1); // wait for end of program