Rework handover ack callback

Inside of passing the RRCReconfiguration buffer, call RRCReconfiguration
message generation inside the F1 callback. This will simplify the code in the
rrc_CU_process_ue_context_setup_response() function once the N2 handover case
is introduced. In rrc_CU_process_ue_context_setup_response(), with presence
of the HO context, the HO ACK callback is called only once and depending
on the type of HO it will do either RRCReconfiguration for F1 and
HandoverCommand for N2.
This commit is contained in:
Guido Casati
2025-06-09 20:43:42 +02:00
parent 7fba453329
commit dca7e6c95d
4 changed files with 21 additions and 30 deletions
+4
View File
@@ -118,6 +118,10 @@ void rrc_gNB_generate_UeContextModificationRequest(const gNB_RRC_INST *rrc,
void free_RRCReconfiguration_params(nr_rrc_reconfig_param_t params);
byte_array_t rrc_gNB_encode_RRCReconfiguration(gNB_RRC_INST *rrc, gNB_RRC_UE_t *UE, nr_rrc_reconfig_param_t params);
nr_rrc_reconfig_param_t get_RRCReconfiguration_params(gNB_RRC_INST *rrc, gNB_RRC_UE_t *UE, uint8_t srb_reest_bitmap, bool drb_reestablish);
pdusession_level_qos_parameter_t *get_qos_characteristics(const int qfi, rrc_pdu_session_param_t *pduSession);
f1ap_qos_characteristics_t get_qos_char_from_qos_flow_param(const pdusession_level_qos_parameter_t *qos_param);
void openair_rrc_gNB_configuration(gNB_RRC_INST *rrc, gNB_RrcConfigurationReq *configuration);
+3 -25
View File
@@ -563,10 +563,7 @@ void free_RRCReconfiguration_params(nr_rrc_reconfig_param_t params)
}
/** @brief Prepare the instance of RRCReconfigurationParams to be pass to RRC encoding */
static nr_rrc_reconfig_param_t get_RRCReconfiguration_params(gNB_RRC_INST *rrc,
gNB_RRC_UE_t *UE,
uint8_t srb_reest_bitmap,
bool drb_reestablish)
nr_rrc_reconfig_param_t get_RRCReconfiguration_params(gNB_RRC_INST *rrc, gNB_RRC_UE_t *UE, uint8_t srb_reest_bitmap, bool drb_reestablish)
{
uint8_t xid = rrc_gNB_get_next_transaction_identifier(rrc->module_id);
nr_rrc_du_container_t *du = get_du_for_ue(rrc, UE->rrc_ue_id);
@@ -656,7 +653,7 @@ static nr_rrc_reconfig_param_t get_RRCReconfiguration_params(gNB_RRC_INST *rrc,
return params;
}
static byte_array_t rrc_gNB_encode_RRCReconfiguration(gNB_RRC_INST *rrc, gNB_RRC_UE_t *UE, nr_rrc_reconfig_param_t params)
byte_array_t rrc_gNB_encode_RRCReconfiguration(gNB_RRC_INST *rrc, gNB_RRC_UE_t *UE, nr_rrc_reconfig_param_t params)
{
byte_array_t msg = do_RRCReconfiguration(&params);
if (msg.len <= 0) {
@@ -2144,26 +2141,7 @@ static void rrc_CU_process_ue_context_setup_response(MessageDef *msg_p, instance
DevAssert(resp->crnti != NULL);
UE->ho_context->target->du_ue_id = resp->gNB_DU_ue_id;
UE->ho_context->target->new_rnti = *resp->crnti;
uint8_t xid = rrc_gNB_get_next_transaction_identifier(rrc->module_id);
UE->xids[xid] = RRC_DEDICATED_RECONF;
/* 3GPP TS 38.331 specifies that PDCP shall be re-established whenever the security key
* used for the radio bearer changes, with some expections for SRB1 (i.e. when resuming
* an RRC connection, or at the first reconfiguration after RRC connection reestablishment
* in NR, do not re-establish PDCP */
nr_rrc_reconfig_param_t params = get_RRCReconfiguration_params(rrc, UE, (1 << SRB2), true);
params.transaction_id = xid;
byte_array_t msg = rrc_gNB_encode_RRCReconfiguration(rrc, UE, params);
if (msg.len <= 0) {
LOG_E(NR_RRC, "UE %d: Failed to generate RRCReconfiguration\n", UE->rrc_ue_id);
return;
}
// TODO N2 38.413 sec 9.3.1.21: admitted PDU sessions (in UE), Target to
// Source Transparent Container (9.3.1.21) which encodes the RRC
// reconfiguration above
UE->ho_context->target->ho_req_ack(rrc, UE, msg);
UE->ho_context->target->ho_req_ack(rrc, UE);
}
}
+13 -4
View File
@@ -258,11 +258,20 @@ static void rrc_gNB_trigger_reconfiguration_for_handover(gNB_RRC_INST *rrc, gNB_
#endif
}
static void nr_rrc_f1_ho_acknowledge(gNB_RRC_INST *rrc, gNB_RRC_UE_t *UE, byte_array_t buffer)
static void nr_rrc_f1_ho_acknowledge(gNB_RRC_INST *rrc, gNB_RRC_UE_t *UE)
{
// N2/Xn HO: fill with UE caps, as-context, rrc reconf, send to source CU
// also, fill the UE->rnti from the new one (in F1 case, happens after
// confirmation of ue ctxt modif
/* 3GPP TS 38.331 specifies that PDCP shall be re-established whenever the security key
* used for the radio bearer changes, with some expections for SRB1 (i.e. when resuming
* an RRC connection, or at the first reconfiguration after RRC connection reestablishment
* in NR, do not re-establish PDCP */
nr_rrc_reconfig_param_t params = get_RRCReconfiguration_params(rrc, UE, (1 << SRB2), true);
UE->xids[params.transaction_id] = RRC_DEDICATED_RECONF;
byte_array_t buffer = rrc_gNB_encode_RRCReconfiguration(rrc, UE, params);
free_RRCReconfiguration_params(params);
if (!buffer.len) {
LOG_E(NR_RRC, "UE %d: Failed to generate RRCReconfiguration\n", UE->rrc_ue_id);
return;
}
// F1 HO: handling of "source CU" information
DevAssert(UE->ho_context->source != NULL);
+1 -1
View File
@@ -50,7 +50,7 @@ typedef struct nr_ho_source_cu {
} nr_ho_source_cu_t;
/* acknowledgement of handover request. buf+len is the RRC Reconfiguration */
typedef void (*ho_req_ack_t)(gNB_RRC_INST *rrc, gNB_RRC_UE_t *ue, byte_array_t msg);
typedef void (*ho_req_ack_t)(gNB_RRC_INST *rrc, gNB_RRC_UE_t *ue);
typedef void (*ho_success_t)(gNB_RRC_INST *rrc, gNB_RRC_UE_t *ue);
typedef struct nr_ho_target_cu {
/// pointer to the (target) DU structure