Skip to content

Commit a82f14e

Browse files
FabianEckermannFabian Eckermann
authored andcommitted
cu_cp: prepare rrc reconfig complete reception in target du before rrc reconfig is send to source du
1 parent e48e270 commit a82f14e

File tree

3 files changed

+31
-30
lines changed

3 files changed

+31
-30
lines changed

lib/cu_cp/routines/mobility/handover_reconfiguration_routine.cpp

Lines changed: 30 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,27 @@ handover_reconfiguration_routine::handover_reconfiguration_routine(
3535
{
3636
srsran_assert(
3737
source_ue.get_ue_index() != ue_index_t::invalid, "Invalid source UE index {}", source_ue.get_ue_index());
38+
39+
// Unpack MasterCellGroup to extract T304.
40+
asn1::rrc_nr::cell_group_cfg_s cell_group_cfg;
41+
asn1::cbit_ref bref(request.non_crit_ext->master_cell_group);
42+
if (cell_group_cfg.unpack(bref) != asn1::SRSASN_SUCCESS) {
43+
report_fatal_error("Failed to unpack MasterCellGroupCfg");
44+
}
45+
unsigned t304_ms = cell_group_cfg.sp_cell_cfg.recfg_with_sync.t304.to_number();
46+
target_ue_release_timeout =
47+
std::chrono::milliseconds{t304_ms + /*We add 1s of extra time for the UE to reestablish*/ 1000};
48+
49+
// Unpack SIB1 to extract T311.
50+
asn1::rrc_nr::sib1_s sib1_msg;
51+
asn1::cbit_ref bref2(request.non_crit_ext->ded_sib1_delivery);
52+
if (sib1_msg.unpack(bref2) != asn1::SRSASN_SUCCESS) {
53+
report_fatal_error("Failed to unpack SIB1");
54+
}
55+
unsigned t301_ms = sib1_msg.ue_timers_and_consts.t301.to_number();
56+
unsigned t311_ms = sib1_msg.ue_timers_and_consts.t311.to_number();
57+
58+
handover_ue_release_timeout = std::chrono::milliseconds{t301_ms + t304_ms + t311_ms};
3859
}
3960

4061
void handover_reconfiguration_routine::operator()(coro_context<async_task<bool>>& ctx)
@@ -48,6 +69,13 @@ void handover_reconfiguration_routine::operator()(coro_context<async_task<bool>>
4869

4970
generate_ue_context_modification_request();
5071

72+
// Notify CU-CP to prepare for RRC Reconfig Complete on target DU.
73+
cu_cp_handler.handle_handover_reconfiguration_sent({target_ue_index,
74+
source_ue.get_ue_index(),
75+
(uint8_t)ho_reconf_ctxt.transaction_id,
76+
target_ue_release_timeout,
77+
target_bearer_context_modification_request});
78+
5179
// Call F1AP procedure to send RRC reconfiguration to source UE via UE context modification request.
5280
CORO_AWAIT_VALUE(ue_context_mod_response,
5381
source_f1ap_ue_ctxt_mng.handle_ue_context_modification_request(ue_context_mod_request));
@@ -62,13 +90,6 @@ void handover_reconfiguration_routine::operator()(coro_context<async_task<bool>>
6290
// Initialize UE release timer for source UE.
6391
initialize_handover_ue_release_timer(source_ue.get_ue_index());
6492

65-
// Notify CU-CP that RRC reconfiguration was sent.
66-
cu_cp_handler.handle_handover_reconfiguration_sent({target_ue_index,
67-
source_ue.get_ue_index(),
68-
(uint8_t)ho_reconf_ctxt.transaction_id,
69-
target_ue_release_timeout,
70-
target_bearer_context_modification_request});
71-
7293
// Store handover context in case of for possible re-establishment.
7394
logger.debug("ue={}: Storing handover context", source_ue.get_ue_index());
7495
cu_cp_ue_handover_context ue_ho_ctxt;
@@ -94,29 +115,10 @@ void handover_reconfiguration_routine::generate_ue_context_modification_request(
94115

95116
void handover_reconfiguration_routine::initialize_handover_ue_release_timer(ue_index_t ue_index)
96117
{
97-
// Unpack MasterCellGroup to extract T304.
98-
asn1::rrc_nr::cell_group_cfg_s cell_group_cfg;
99-
asn1::cbit_ref bref(request.non_crit_ext->master_cell_group);
100-
if (cell_group_cfg.unpack(bref) != asn1::SRSASN_SUCCESS) {
101-
report_fatal_error("Failed to unpack MasterCellGroupCfg");
102-
}
103-
unsigned t304_ms = cell_group_cfg.sp_cell_cfg.recfg_with_sync.t304.to_number();
104-
target_ue_release_timeout =
105-
std::chrono::milliseconds{t304_ms + /*We add 1s of extra time for the UE to reestablish*/ 1000};
106-
107-
// Unpack SIB1 to extract T311.
108-
asn1::rrc_nr::sib1_s sib1_msg;
109-
asn1::cbit_ref bref2(request.non_crit_ext->ded_sib1_delivery);
110-
if (sib1_msg.unpack(bref2) != asn1::SRSASN_SUCCESS) {
111-
report_fatal_error("Failed to unpack SIB1");
112-
}
113-
unsigned t301_ms = sib1_msg.ue_timers_and_consts.t301.to_number();
114-
unsigned t311_ms = sib1_msg.ue_timers_and_consts.t311.to_number();
115-
116118
cu_cp_handler.initialize_handover_ue_release_timer(
117119
ue_index,
118-
std::chrono::milliseconds{t301_ms + t304_ms + t311_ms +
119-
/*We add 1s of extra time for the UE to reestablish*/ 1000},
120+
handover_ue_release_timeout +
121+
std::chrono::milliseconds{1000} /*We add 1s of extra time for the UE to reestablish*/,
120122
cu_cp_ue_context_release_request{ue_index,
121123
source_ue.get_up_resource_manager().get_pdu_sessions(),
122124
ngap_cause_radio_network_t::ho_fail_in_target_5_gc_ngran_node_or_target_sys});

lib/cu_cp/routines/mobility/handover_reconfiguration_routine.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ class handover_reconfiguration_routine
5353

5454
// (sub-)routine results
5555
std::chrono::milliseconds target_ue_release_timeout;
56+
std::chrono::milliseconds handover_ue_release_timeout;
5657
rrc_ue_handover_reconfiguration_context ho_reconf_ctxt;
5758
f1ap_ue_context_modification_response ue_context_mod_response;
5859
};

tests/unittests/cu_cp/mobility/handover_reconfiguration_routine_test.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,4 @@ TEST_F(handover_reconfiguration_routine_test, when_ue_context_mod_unsuccessful_t
342342

343343
// Reconfiguration complete was received.
344344
ASSERT_FALSE(get_result());
345-
346-
ASSERT_FALSE(check_transaction_id(test_transaction_id));
347345
}

0 commit comments

Comments
 (0)