From 5610ce073820aa703ff038a102f7bdfab5f00ac3 Mon Sep 17 00:00:00 2001 From: Guido Casati Date: Fri, 12 Apr 2024 16:37:49 +0200 Subject: [PATCH 1/8] Fix PDCP re-establishment of SRB1 and SRB2 - SRB1 shall be re-established at the time of RRCReestablishmentRequest according to 5.3.7.4 of 3GPP TS 38.331 - SRB2 shall be re-established when creating srb-ToAddModList according to 5.3.5.6.3 of 3GPP TS 38.331 --- openair2/RRC/NR/rrc_gNB.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/openair2/RRC/NR/rrc_gNB.c b/openair2/RRC/NR/rrc_gNB.c index edd3f1d7cb..6628be1073 100644 --- a/openair2/RRC/NR/rrc_gNB.c +++ b/openair2/RRC/NR/rrc_gNB.c @@ -370,6 +370,9 @@ unsigned int rrc_gNB_get_next_transaction_identifier(module_id_t gnb_mod_idP) return tmp; } +/** + * @brief Create srb-ToAddModList for RRCSetup and RRCReconfiguration messages +*/ static NR_SRB_ToAddModList_t *createSRBlist(gNB_RRC_UE_t *ue, bool reestablish) { if (!ue->Srb[1].Active) { @@ -381,6 +384,7 @@ static NR_SRB_ToAddModList_t *createSRBlist(gNB_RRC_UE_t *ue, bool reestablish) if (ue->Srb[i].Active) { asn1cSequenceAdd(list->list, NR_SRB_ToAddMod_t, srb); srb->srb_Identity = i; + /* Set reestablishPDCP only for SRB2 */ if (reestablish && i == 2) { asn1cCallocOne(srb->reestablishPDCP, NR_SRB_ToAddMod__reestablishPDCP_true); } @@ -1021,11 +1025,11 @@ static void rrc_gNB_generate_RRCReestablishment(rrc_gNB_ue_context_t *ue_context /* SRBs */ for (int srb_id = 1; srb_id < NR_NUM_SRB; srb_id++) { - if (ue_p->Srb[srb_id].Active) { + if (ue_p->Srb[srb_id].Active) nr_pdcp_config_set_security(ue_p->rrc_ue_id, srb_id, security_mode, kRRCenc, kRRCint, kUPenc); - nr_pdcp_reestablishment(ue_p->rrc_ue_id, srb_id, true); - } } + /* Re-establish PDCP for SRB1, according to 5.3.7.4 of 3GPP TS 38.331 */ + nr_pdcp_reestablishment(ue_p->rrc_ue_id, 1, true); /* PDCP Reestablishment over E1 */ cuup_notify_reestablishment(rrc, ue_p); /* F1AP DL RRC Message Transfer */ @@ -1083,7 +1087,17 @@ static void rrc_gNB_process_RRCReestablishmentComplete(const protocol_ctxt_t *co NR_RLC_BearerConfig__reestablishRLC_true); } + /* Re-establish SRB2 according to clause 5.3.5.6.3 of 3GPP TS 38.331 + * (SRB1 is re-established with RRCReestablishment message) + */ + int srb_id = 2; + if (ue_p->Srb[srb_id].Active) { + nr_pdcp_reestablishment(ue_p->rrc_ue_id, srb_id, true); + } + + /* Create srb-ToAddModList */ NR_SRB_ToAddModList_t *SRBs = createSRBlist(ue_p, true); + /* Create drb-ToAddModList */ NR_DRB_ToAddModList_t *DRBs = createDRBlist(ue_p, true); uint8_t new_xid = rrc_gNB_get_next_transaction_identifier(ctxt_pP->module_id); From ab65bc3b08812cdebc9503323889c7206641b149 Mon Sep 17 00:00:00 2001 From: Guido Casati Date: Fri, 12 Apr 2024 16:40:30 +0200 Subject: [PATCH 2/8] Refactor PDCP Reestablishment of DRBs according to 5.3.5.6.5 of 3GPP TS 38.331 - remove PDCP reestablishment for DRBs from RRCReestablishment message generation - do PDCP reestablishment and CUUP notification calls after reception or RRCReestablishmentComplete - this is necessary to make it consistent with the RRCReconfiguration message that contains RadioBearerConfig with the list of bearers to add/release which is followed by PDCP re-establishment at UE --- openair2/RRC/NR/rrc_gNB.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openair2/RRC/NR/rrc_gNB.c b/openair2/RRC/NR/rrc_gNB.c index 6628be1073..2df6228c6a 100644 --- a/openair2/RRC/NR/rrc_gNB.c +++ b/openair2/RRC/NR/rrc_gNB.c @@ -1030,8 +1030,6 @@ static void rrc_gNB_generate_RRCReestablishment(rrc_gNB_ue_context_t *ue_context } /* Re-establish PDCP for SRB1, according to 5.3.7.4 of 3GPP TS 38.331 */ nr_pdcp_reestablishment(ue_p->rrc_ue_id, 1, true); - /* PDCP Reestablishment over E1 */ - cuup_notify_reestablishment(rrc, ue_p); /* F1AP DL RRC Message Transfer */ f1_ue_data_t ue_data = cu_get_f1_ue_data(ue_p->rrc_ue_id); RETURN_IF_INVALID_ASSOC_ID(ue_data); @@ -1094,6 +1092,8 @@ static void rrc_gNB_process_RRCReestablishmentComplete(const protocol_ctxt_t *co if (ue_p->Srb[srb_id].Active) { nr_pdcp_reestablishment(ue_p->rrc_ue_id, srb_id, true); } + /* PDCP Reestablishment of DRBs according to 5.3.5.6.5 of 3GPP TS 38.331 (over E1) */ + cuup_notify_reestablishment(rrc, ue_p); /* Create srb-ToAddModList */ NR_SRB_ToAddModList_t *SRBs = createSRBlist(ue_p, true); From 1d10a73b95f2503bd987bd05f67a1d17a097e850 Mon Sep 17 00:00:00 2001 From: Guido Casati Date: Wed, 17 Apr 2024 15:20:37 +0200 Subject: [PATCH 3/8] Apply default configuration for SRB1 when receiving RRCReestablishmentRequest - according to 5.3.7.4 of TS 38.331 --- openair2/LAYER2/NR_MAC_gNB/mac_rrc_dl_handler.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_rrc_dl_handler.c b/openair2/LAYER2/NR_MAC_gNB/mac_rrc_dl_handler.c index f0d5b7ce18..cb26703566 100644 --- a/openair2/LAYER2/NR_MAC_gNB/mac_rrc_dl_handler.c +++ b/openair2/LAYER2/NR_MAC_gNB/mac_rrc_dl_handler.c @@ -716,6 +716,8 @@ void dl_rrc_message_transfer(const f1ap_dl_rrc_message_t *dl_rrc) pthread_mutex_unlock(&mac->sched_lock); nr_rlc_remove_ue(dl_rrc->gNB_DU_ue_id); nr_rlc_update_id(*dl_rrc->old_gNB_DU_ue_id, dl_rrc->gNB_DU_ue_id); + /* 38.331 clause 5.3.7.4: apply the specified configuration defined in 9.2.1 for SRB1 */ + nr_rlc_reconfigure_entity(dl_rrc->gNB_DU_ue_id, 1, NULL); instance_t f1inst = get_f1_gtp_instance(); if (f1inst >= 0) // we actually use F1-U gtpv1u_update_ue_id(f1inst, *dl_rrc->old_gNB_DU_ue_id, dl_rrc->gNB_DU_ue_id); From 2c2b7416c1fc63711d1d0c54aef5035080f4b7b1 Mon Sep 17 00:00:00 2001 From: Guido Casati Date: Thu, 18 Apr 2024 14:52:09 +0200 Subject: [PATCH 4/8] Check numDlUpParam size when processing DlUpParamList --- openair2/LAYER2/nr_pdcp/cucp_cuup_handler.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/openair2/LAYER2/nr_pdcp/cucp_cuup_handler.c b/openair2/LAYER2/nr_pdcp/cucp_cuup_handler.c index e18c8eddfb..a34d8649d7 100644 --- a/openair2/LAYER2/nr_pdcp/cucp_cuup_handler.c +++ b/openair2/LAYER2/nr_pdcp/cucp_cuup_handler.c @@ -261,10 +261,12 @@ void e1_bearer_context_modif(const e1ap_bearer_mod_req_t *req) if (f1inst < 0) // no F1-U? continue; // nothing to do - in_addr_t addr = {0}; - memcpy(&addr, &to_modif->DlUpParamList[0].tlAddress, sizeof(in_addr_t)); - - GtpuUpdateTunnelOutgoingAddressAndTeid(f1inst, req->gNB_cu_cp_ue_id, to_modif->id, addr, to_modif->DlUpParamList[0].teId); + /* Loop through DL UP Transport Layer params list + * and update GTP tunnel outgoing addr and TEID */ + for (int k = 0; k < to_modif->numDlUpParam; k++) { + in_addr_t addr = to_modif->DlUpParamList[k].tlAddress; + GtpuUpdateTunnelOutgoingAddressAndTeid(f1inst, req->gNB_cu_cp_ue_id, to_modif->id, addr, to_modif->DlUpParamList[k].teId); + } } } From 105e9b5f58392326f9ae06ef9784fb7760e2c7d8 Mon Sep 17 00:00:00 2001 From: Guido Casati Date: Sun, 21 Apr 2024 10:20:18 +0200 Subject: [PATCH 5/8] Handling Bearer Context Status Change IE in Bearer Context Modification Request - E1 encoding /decoding - new enum for E1 Bearer Status Change see 9.2.2.4 BEARER CONTEXT MODIFICATION REQUEST of 3GPP TS 38.463 --- openair2/COMMON/e1ap_messages_types.h | 7 +++++++ openair2/E1AP/e1ap.c | 18 +++++++++++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/openair2/COMMON/e1ap_messages_types.h b/openair2/COMMON/e1ap_messages_types.h index 5b727a3818..cc48a6f9e9 100644 --- a/openair2/COMMON/e1ap_messages_types.h +++ b/openair2/COMMON/e1ap_messages_types.h @@ -55,6 +55,12 @@ typedef net_ip_address_t e1ap_net_ip_address_t; +typedef enum BEARER_CONTEXT_STATUS_e { + BEARER_ACTIVE = 0, + BEARER_SUSPEND, + BEARER_RESUME, +} BEARER_CONTEXT_STATUS_t; + typedef struct PLMN_ID_s { int mcc; int mnc; @@ -240,6 +246,7 @@ typedef struct e1ap_bearer_setup_req_s { char integrityProtectionKey[128]; long ueDlAggMaxBitRate; PLMN_ID_t servingPLMNid; + BEARER_CONTEXT_STATUS_t bearerContextStatus; long activityNotificationLevel; int numPDUSessions; pdu_session_to_setup_t pduSession[E1AP_MAX_NUM_PDU_SESSIONS]; diff --git a/openair2/E1AP/e1ap.c b/openair2/E1AP/e1ap.c index 1c9ff19bff..c47e618e8e 100644 --- a/openair2/E1AP/e1ap.c +++ b/openair2/E1AP/e1ap.c @@ -1192,7 +1192,7 @@ static int fill_BEARER_CONTEXT_MODIFICATION_REQUEST(e1ap_bearer_setup_req_t *con ieC2->value.present = E1AP_BearerContextModificationRequestIEs__value_PR_GNB_CU_UP_UE_E1AP_ID; ieC2->value.choice.GNB_CU_UP_UE_E1AP_ID = bearerCxt->gNB_cu_up_ue_id; /* optional */ - /* */ + /* c3. E1AP_ProtocolIE_ID_id_System_BearerContextModificationRequest */ asn1cSequenceAdd(out->protocolIEs.list, E1AP_BearerContextModificationRequestIEs_t, ieC3); ieC3->id = E1AP_ProtocolIE_ID_id_System_BearerContextModificationRequest; ieC3->criticality = E1AP_Criticality_reject; @@ -1230,6 +1230,15 @@ static int fill_BEARER_CONTEXT_MODIFICATION_REQUEST(e1ap_bearer_setup_req_t *con } } } + /* c4. E1AP_ProtocolIE_ID_id_BearerContextStatusChange */ + if (bearerCxt->bearerContextStatus == BEARER_SUSPEND) { + asn1cSequenceAdd(out->protocolIEs.list, E1AP_BearerContextModificationRequestIEs_t, ieC4); + ieC4->id = E1AP_ProtocolIE_ID_id_BearerContextStatusChange; + ieC4->criticality = E1AP_Criticality_reject; + ieC4->value.present = E1AP_BearerContextModificationRequestIEs__value_PR_BearerContextStatusChange; + /* Bearer Context Status Change */ + ieC4->value.choice.BearerContextStatusChange = E1AP_BearerContextStatusChange_suspend; + } return 0; } @@ -1390,6 +1399,13 @@ static void extract_BEARER_CONTEXT_MODIFICATION_REQUEST(const E1AP_E1AP_PDU_t *p } break; + case E1AP_ProtocolIE_ID_id_BearerContextStatusChange: + /* Bearer Context Status Change */ + DevAssert(ie->criticality == E1AP_Criticality_reject); + DevAssert(ie->value.present == E1AP_BearerContextModificationRequestIEs__value_PR_BearerContextStatusChange); + bearerCxt->bearerContextStatus = (ie->value.choice.BearerContextStatusChange == E1AP_BearerContextStatusChange_suspend) ? BEARER_SUSPEND : BEARER_ACTIVE; + break; + default: LOG_E(E1AP, "Handle for this IE is not implemented (or) invalid IE detected\n"); break; From 99c4e5477c5beefa3834b6895a17114f9bac1200 Mon Sep 17 00:00:00 2001 From: Guido Casati Date: Tue, 23 Apr 2024 18:43:27 +0200 Subject: [PATCH 6/8] Minor comments and logging --- openair2/LAYER2/nr_pdcp/nr_pdcp_entity.c | 39 ++++++++++++++++++++++-- openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c | 2 +- 2 files changed, 38 insertions(+), 3 deletions(-) diff --git a/openair2/LAYER2/nr_pdcp/nr_pdcp_entity.c b/openair2/LAYER2/nr_pdcp/nr_pdcp_entity.c index 98162d003c..712bbf6b0c 100644 --- a/openair2/LAYER2/nr_pdcp/nr_pdcp_entity.c +++ b/openair2/LAYER2/nr_pdcp/nr_pdcp_entity.c @@ -57,7 +57,10 @@ static void nr_pdcp_entity_recv_pdu(nr_pdcp_entity_t *entity, uint32_t rx_deliv_hfn; if (entity->entity_suspended) { - LOG_W(PDCP, "PDCP entity %d is suspended. Quit RX procedure.\n", entity->rb_id); + LOG_W(PDCP, + "PDCP entity (%s) %d is suspended. Quit RX procedure.\n", + entity->type > NR_PDCP_DRB_UM ? "SRB" : "DRB", + entity->rb_id); return; } @@ -190,6 +193,13 @@ static void nr_pdcp_entity_recv_pdu(nr_pdcp_entity_t *entity, count++; } entity->rx_deliv = count; + LOG_D(PDCP, + "%s: entity (%s) %d - rx_deliv = %d, rcvd_sn = %d \n", + __func__, + entity->type == NR_PDCP_DRB_AM ? "DRB" : "SRB", + entity->rb_id, + entity->rx_deliv, + rcvd_sn); } if (entity->t_reordering_start != 0 && entity->rx_deliv >= entity->rx_reord) { @@ -220,7 +230,10 @@ static int nr_pdcp_entity_process_sdu(nr_pdcp_entity_t *entity, int dc_bit; if (entity->entity_suspended) { - LOG_W(PDCP, "PDCP entity %d is suspended. Quit SDU processing.\n", entity->rb_id); + LOG_W(PDCP, + "PDCP entity (%s) %d is suspended. Quit SDU processing.\n", + entity->type > NR_PDCP_DRB_UM ? "SRB" : "DRB", + entity->rb_id); return -1; } @@ -387,6 +400,14 @@ static void check_t_reordering(nr_pdcp_entity_t *entity) if (entity->t_reordering_start == 0 || entity->t_current <= entity->t_reordering_start + entity->t_reordering) return; + LOG_D(PDCP, + "%s: entity (%s) %d: t_reordering_start = %ld, t_current = %ld, t_reordering = %d \n", + __func__, + entity->type > NR_PDCP_DRB_UM ? "SRB" : "DRB", + entity->rb_id, + entity->t_reordering_start, + entity->t_current, + entity->t_reordering); /* stop timer */ entity->t_reordering_start = 0; @@ -450,15 +471,29 @@ static void deliver_all_sdus(nr_pdcp_entity_t *entity) } } +/** + * @brief PDCP Entity Suspend according to 5.1.4 of 3GPP TS 38.323 + * Transmitting PDCP entity shall: + * - set TX_NEXT to the initial value; + * - discard all stored PDCP PDUs (NOTE: PDUs are stored in RLC) + * Receiving PDCP entity shall: + * - if t-Reordering is running: + * a) stop and reset t-Reordering; + * b) deliver all stored PDCP SDUs + * - set RX_NEXT and RX_DELIV to the initial value. + */ static void nr_pdcp_entity_suspend(nr_pdcp_entity_t *entity) { + /* Transmitting PDCP entity */ entity->tx_next = 0; + /* Receiving PDCP entity */ if (entity->t_reordering_start != 0) { entity->t_reordering_start = 0; deliver_all_sdus(entity); } entity->rx_next = 0; entity->rx_deliv = 0; + /* Flag to keep track of PDCP entity status */ entity->entity_suspended = true; } diff --git a/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c b/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c index b12142a881..61adacab69 100644 --- a/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c +++ b/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c @@ -650,7 +650,7 @@ void nr_rlc_reestablish_entity(int ue_id, int lc_id) nr_rlc_entity_t *rb = get_rlc_entity_from_lcid(ue, lc_id); if (rb != NULL) { - LOG_D(RLC, "RB found! (channel ID %d) \n", lc_id); + LOG_D(RLC, "%s: RB found! (channel ID %d), re-establish RLC\n", __func__, lc_id); rb->reestablishment(rb); } else { LOG_E(RLC, "no RLC entity found (channel ID %d) for reestablishment\n", lc_id); From f010058e4560e14188bfca2e5a7b6a1b105f15f2 Mon Sep 17 00:00:00 2001 From: Guido Casati Date: Thu, 25 Apr 2024 17:32:38 +0200 Subject: [PATCH 7/8] Re-establish RLC for SRB1 only when receiving RRCReestablishmentRequest - according to 5.3.7.4 of TS 38.331: 1> re-establish RLC for SRB1; - gNB: 1) re-establish RLC for SRB1 in nr_rlc_update_id 2) re-establish RLC for remaining RBs concurrently with RRCReconfiguration issue: gNB) in nr_rlc_update_id the gNB is re-establishing RLC for all RBs at the same time when receiving RRCReestablishmentRequest from UE UE) according to the specs, the UE is re-establishing RLC for SRB1 with RRCReestablishmentRequest the other RBs are re-established during RRCReconfiguration (in our case in nr_rrc_ue_process_RadioBearerConfig) when receiving reestablishRLC IE in rlc_BearerToAddModList RLC TX) this leads to RLC counters mismatch after re-establishment: control PDUs discarded until max nb of retx is reached and then UL failure occurs --- openair2/LAYER2/NR_MAC_gNB/mac_rrc_dl_handler.c | 9 +++++++++ openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h | 2 ++ openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c | 13 ++++++------- openair2/RRC/NR/rrc_gNB.c | 4 ++++ 4 files changed, 21 insertions(+), 7 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_rrc_dl_handler.c b/openair2/LAYER2/NR_MAC_gNB/mac_rrc_dl_handler.c index cb26703566..2a2760e7a7 100644 --- a/openair2/LAYER2/NR_MAC_gNB/mac_rrc_dl_handler.c +++ b/openair2/LAYER2/NR_MAC_gNB/mac_rrc_dl_handler.c @@ -687,6 +687,12 @@ void dl_rrc_message_transfer(const f1ap_dl_rrc_message_t *dl_rrc) nr_mac_enable_ue_rrc_processing_timer(mac, UE, /* apply_cellGroup = */ true); NR_SCHED_UNLOCK(&mac->sched_lock); UE->expect_reconfiguration = false; + /* Re-establish RLC for all remaining bearers */ + if (UE->reestablish_rlc) { + for (int i = 1; i < UE->UE_sched_ctrl.dl_lc_num; ++i) + nr_rlc_reestablish_entity(dl_rrc->gNB_DU_ue_id, UE->UE_sched_ctrl.dl_lc_ids[i]); + UE->reestablish_rlc = false; + } } if (dl_rrc->old_gNB_DU_ue_id != NULL) { @@ -716,6 +722,9 @@ void dl_rrc_message_transfer(const f1ap_dl_rrc_message_t *dl_rrc) pthread_mutex_unlock(&mac->sched_lock); nr_rlc_remove_ue(dl_rrc->gNB_DU_ue_id); nr_rlc_update_id(*dl_rrc->old_gNB_DU_ue_id, dl_rrc->gNB_DU_ue_id); + /* Set flag to trigger RLC re-establishment + * for remaining RBs in next RRCReconfiguration */ + UE->reestablish_rlc = true; /* 38.331 clause 5.3.7.4: apply the specified configuration defined in 9.2.1 for SRB1 */ nr_rlc_reconfigure_entity(dl_rrc->gNB_DU_ue_id, 1, NULL); instance_t f1inst = get_f1_gtp_instance(); diff --git a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h index e162ecbff5..a35911d3ce 100644 --- a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h +++ b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h @@ -683,6 +683,8 @@ typedef struct { NR_CellGroupConfig_t *CellGroup; /// CellGroupConfig that is to be activated after the next reconfiguration bool expect_reconfiguration; + /// reestablishRLC has to be signaled in RRCreconfiguration + bool reestablish_rlc; NR_CellGroupConfig_t *reconfigCellGroup; bool apply_cellgroup; NR_UE_NR_Capability_t *capability; diff --git a/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c b/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c index 61adacab69..f08964dabc 100644 --- a/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c +++ b/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c @@ -650,7 +650,7 @@ void nr_rlc_reestablish_entity(int ue_id, int lc_id) nr_rlc_entity_t *rb = get_rlc_entity_from_lcid(ue, lc_id); if (rb != NULL) { - LOG_D(RLC, "%s: RB found! (channel ID %d), re-establish RLC\n", __func__, lc_id); + LOG_D(RLC, "RB found! (channel ID %d), re-establish RLC\n", lc_id); rb->reestablishment(rb); } else { LOG_E(RLC, "no RLC entity found (channel ID %d) for reestablishment\n", lc_id); @@ -1065,12 +1065,11 @@ bool nr_rlc_update_id(int from_id, int to_id) } ue->ue_id = to_id; LOG_I(RLC, "Update old UE ID %d context to ID %d\n", from_id, to_id); - for (int i = 0; i < sizeof(ue->srb) / sizeof(ue->srb[0]); ++i) - if (ue->srb[i]) - ue->srb[i]->reestablishment(ue->srb[i]); - for (int i = 0; i < sizeof(ue->drb) / sizeof(ue->drb[0]); ++i) - if (ue->drb[i]) - ue->drb[i]->reestablishment(ue->drb[i]); + /* re-establish RLC for SRB1: according to 5.3.7.4 of TS 38.331 */ + if (ue->srb[0]) { + LOG_I(RLC, "Re-establish RLC for SRB 1\n"); + ue->srb[0]->reestablishment(ue->srb[0]); + } nr_rlc_manager_unlock(nr_rlc_ue_manager); return true; } diff --git a/openair2/RRC/NR/rrc_gNB.c b/openair2/RRC/NR/rrc_gNB.c index 2df6228c6a..abaf8d05a8 100644 --- a/openair2/RRC/NR/rrc_gNB.c +++ b/openair2/RRC/NR/rrc_gNB.c @@ -1080,6 +1080,10 @@ static void rrc_gNB_process_RRCReestablishmentComplete(const protocol_ctxt_t *co for (i = 1; i < ue_p->masterCellGroup->rlc_BearerToAddModList->list.count; ++i) asn1cSeqAdd(&cellGroupConfig->rlc_BearerToAddModList->list, ue_p->masterCellGroup->rlc_BearerToAddModList->list.array[i]); + /* + * At this stage, PDCP entity are re-established and reestablishRLC is flagged + * with RRCReconfiguration to complete RLC re-establishment of remaining bearers + */ for (i = 0; i < cellGroupConfig->rlc_BearerToAddModList->list.count; i++) { asn1cCallocOne(cellGroupConfig->rlc_BearerToAddModList->list.array[i]->reestablishRLC, NR_RLC_BearerConfig__reestablishRLC_true); From 2b859cd7e2c4c98fda637b05c6a09ec9a8a28778 Mon Sep 17 00:00:00 2001 From: Guido Casati Date: Mon, 29 Apr 2024 14:03:19 +0200 Subject: [PATCH 8/8] Remove PDCP Suspend from nrUE - according to clause 5.3.7.2 of 3GPP TS 38.331 PDCP Suspend is not required during RRCReestablishment --- openair2/RRC/NR_UE/rrc_UE.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/openair2/RRC/NR_UE/rrc_UE.c b/openair2/RRC/NR_UE/rrc_UE.c index 9e09db1a72..15e4ce47c3 100644 --- a/openair2/RRC/NR_UE/rrc_UE.c +++ b/openair2/RRC/NR_UE/rrc_UE.c @@ -1924,13 +1924,11 @@ void nr_rrc_initiate_rrcReestablishment(NR_UE_RRC_INST_t *rrc, for (int i = 1; i < 4; i++) { if (rrc->Srb[i] == RB_ESTABLISHED) { rrc->Srb[i] = RB_SUSPENDED; - nr_pdcp_suspend_srb(rrc->ue_id, i); } } for (int i = 1; i <= MAX_DRBS_PER_UE; i++) { if (get_DRB_status(rrc, i) == RB_ESTABLISHED) { set_DRB_status(rrc, i, RB_SUSPENDED); - nr_pdcp_suspend_drb(rrc->ue_id, i); } } // release the MCG SCell(s), if configured