removal of the special case for rrc reconf update

master
Francisco Paisana 4 years ago
parent f26b5ccde7
commit a8e11d7991

@ -53,9 +53,8 @@ public:
void send_connection_reject(); void send_connection_reject();
void send_connection_release(); void send_connection_release();
void send_connection_reest_rej(); void send_connection_reest_rej();
void send_connection_reconf(srslte::unique_byte_buffer_t sdu); void send_connection_reconf(srslte::unique_byte_buffer_t sdu = {});
void send_connection_reconf_new_bearer(); void send_connection_reconf_new_bearer();
void send_connection_reconf_upd(srslte::unique_byte_buffer_t pdu);
void send_security_mode_command(); void send_security_mode_command();
void send_ue_cap_enquiry(); void send_ue_cap_enquiry();
void parse_ul_dcch(uint32_t lcid, srslte::unique_byte_buffer_t pdu); void parse_ul_dcch(uint32_t lcid, srslte::unique_byte_buffer_t pdu);
@ -106,9 +105,8 @@ private:
srslte::byte_buffer_pool* pool = nullptr; srslte::byte_buffer_pool* pool = nullptr;
srslte::timer_handler::unique_timer activity_timer; srslte::timer_handler::unique_timer activity_timer;
// cached for ease of context transfer /// cached for ease of context transfer
asn1::rrc::rrc_conn_recfg_s last_rrc_conn_recfg; asn1::rrc::rr_cfg_ded_s current_rr_cfg;
asn1::rrc::rr_cfg_ded_s current_rr_cfg;
asn1::rrc::establishment_cause_e establishment_cause; asn1::rrc::establishment_cause_e establishment_cause;

@ -38,14 +38,13 @@ void fill_rr_cfg_ded_setup(asn1::rrc::rr_cfg_ded_s& rr_cfg,
const cell_ctxt_dedicated_list& ue_cell_list); const cell_ctxt_dedicated_list& ue_cell_list);
/// Fill RadioResourceConfigDedicated with RRCReconf data /// Fill RadioResourceConfigDedicated with RRCReconf data
enum class reconf_cause { init, reest, crnti_ce, handover, other };
void fill_rr_cfg_ded_reconf(asn1::rrc::rr_cfg_ded_s& rr_cfg, void fill_rr_cfg_ded_reconf(asn1::rrc::rr_cfg_ded_s& rr_cfg,
const asn1::rrc::rr_cfg_ded_s& current_rr_cfg, const asn1::rrc::rr_cfg_ded_s& current_rr_cfg,
const rrc_cfg_t& enb_cfg, const rrc_cfg_t& enb_cfg,
const cell_ctxt_dedicated_list& ue_cell_list, const cell_ctxt_dedicated_list& ue_cell_list,
const bearer_cfg_handler& bearers, const bearer_cfg_handler& bearers,
const srslte::rrc_ue_capabilities_t& ue_caps, const srslte::rrc_ue_capabilities_t& ue_caps,
reconf_cause cause); bool phy_cfg_updated);
void apply_rr_cfg_ded_diff(asn1::rrc::rr_cfg_ded_s& current_rr_cfg_ded, void apply_rr_cfg_ded_diff(asn1::rrc::rr_cfg_ded_s& current_rr_cfg_ded,
const asn1::rrc::rr_cfg_ded_s& pending_rr_cfg_ded); const asn1::rrc::rr_cfg_ded_s& pending_rr_cfg_ded);

@ -83,7 +83,7 @@ void rrc::init(const rrc_cfg_t& cfg_,
rrc_log->info("T310 %d, T311 %d, N310 %d \n", t310, t311, n310); rrc_log->info("T310 %d, T311 %d, N310 %d \n", t310, t311, n310);
if (cfg.inactivity_timeout_ms < t310 + t311 + n310) { if (cfg.inactivity_timeout_ms < t310 + t311 + n310) {
srslte::console("\nWarning: Inactivity timeout is smaller than the sum of t310, t311 and n310.\n" srslte::console("\nWarning: Inactivity timeout is smaller than the sum of t310, t311 and n310.\n"
"This may break the UE's re-establishment procedure.\n"); "This may break the UE's re-establishment procedure.\n");
rrc_log->warning("Inactivity timeout is smaller than the sum of t310, t311 and n310. This may break the UE's " rrc_log->warning("Inactivity timeout is smaller than the sum of t310, t311 and n310. This may break the UE's "
"re-establishment procedure.\n"); "re-establishment procedure.\n");
} }
@ -203,7 +203,7 @@ void rrc::upd_user(uint16_t new_rnti, uint16_t old_rnti)
if (ue_ptr->mobility_handler->is_ho_running()) { if (ue_ptr->mobility_handler->is_ho_running()) {
ue_ptr->mobility_handler->trigger(ue::rrc_mobility::user_crnti_upd_ev{old_rnti, new_rnti}); ue_ptr->mobility_handler->trigger(ue::rrc_mobility::user_crnti_upd_ev{old_rnti, new_rnti});
} else if (ue_ptr->is_connected()) { } else if (ue_ptr->is_connected()) {
old_it->second->send_connection_reconf_upd(srslte::allocate_unique_buffer(*pool)); old_it->second->send_connection_reconf();
} else { } else {
old_it->second->send_connection_reject(); old_it->second->send_connection_reject();
} }

@ -725,7 +725,7 @@ bool rrc::ue::rrc_mobility::start_ho_preparation(uint32_t target_eci,
rrc_ue->cell_ded_list, rrc_ue->cell_ded_list,
rrc_ue->bearer_list, rrc_ue->bearer_list,
rrc_ue->ue_capabilities, rrc_ue->ue_capabilities,
reconf_cause::handover); true);
// Get security cfg // Get security cfg
hoprep_r8.as_cfg.source_security_algorithm_cfg = rrc_ue->ue_security_cfg.get_security_algorithm_cfg(); hoprep_r8.as_cfg.source_security_algorithm_cfg = rrc_ue->ue_security_cfg.get_security_algorithm_cfg();
hoprep_r8.as_cfg.source_ue_id.from_number(rrc_ue->rnti); hoprep_r8.as_cfg.source_ue_id.from_number(rrc_ue->rnti);

@ -468,20 +468,16 @@ void rrc::ue::send_connection_reconf(srslte::unique_byte_buffer_t pdu)
{ {
parent->rrc_log->debug("RRC state %d\n", state); parent->rrc_log->debug("RRC state %d\n", state);
/* Create RRCConnectionReconfiguration ASN1 message */
dl_dcch_msg_s dl_dcch_msg; dl_dcch_msg_s dl_dcch_msg;
rrc_conn_recfg_s& recfg = dl_dcch_msg.msg.set_c1().set_rrc_conn_recfg(); rrc_conn_recfg_s& rrc_conn_recfg = dl_dcch_msg.msg.set_c1().set_rrc_conn_recfg();
recfg.rrc_transaction_id = (uint8_t)((transaction_id++) % 4); rrc_conn_recfg.rrc_transaction_id = (uint8_t)((transaction_id++) % 4);
rrc_conn_recfg_r8_ies_s& recfg_r8 = recfg.crit_exts.set_c1().set_rrc_conn_recfg_r8(); rrc_conn_recfg_r8_ies_s& recfg_r8 = rrc_conn_recfg.crit_exts.set_c1().set_rrc_conn_recfg_r8();
// Fill RR Config Ded // Fill RR Config Ded
fill_rr_cfg_ded_reconf(recfg_r8.rr_cfg_ded,
current_rr_cfg,
parent->cfg,
cell_ded_list,
bearer_list,
ue_capabilities,
reconf_cause::init);
recfg_r8.rr_cfg_ded_present = true; recfg_r8.rr_cfg_ded_present = true;
fill_rr_cfg_ded_reconf(
recfg_r8.rr_cfg_ded, current_rr_cfg, parent->cfg, cell_ded_list, bearer_list, ue_capabilities, true);
// Add SCells // Add SCells
if (fill_scell_to_addmod_list(&recfg_r8) != SRSLTE_SUCCESS) { if (fill_scell_to_addmod_list(&recfg_r8) != SRSLTE_SUCCESS) {
@ -489,106 +485,44 @@ void rrc::ue::send_connection_reconf(srslte::unique_byte_buffer_t pdu)
return; return;
} }
apply_reconf_phy_config(recfg_r8, true);
// setup SRB2/DRBs in PDCP and RLC
apply_pdcp_srb_updates(recfg_r8.rr_cfg_ded);
apply_pdcp_drb_updates(recfg_r8.rr_cfg_ded);
apply_rlc_rb_updates(recfg_r8.rr_cfg_ded);
// Add pending NAS info // Add pending NAS info
bearer_list.fill_pending_nas_info(&recfg_r8); bearer_list.fill_pending_nas_info(&recfg_r8);
// Add measConfig
if (mobility_handler != nullptr) { if (mobility_handler != nullptr) {
mobility_handler->fill_conn_recfg_no_ho_cmd(&recfg_r8); mobility_handler->fill_conn_recfg_no_ho_cmd(&recfg_r8);
} }
last_rrc_conn_recfg = dl_dcch_msg.msg.c1().rrc_conn_recfg();
// Apply Reconf Msg configuration to MAC scheduler // if no updates were detected, skip rrc reconfiguration
mac_ctrl->handle_con_reconf(recfg_r8); if (not(recfg_r8.rr_cfg_ded_present or recfg_r8.meas_cfg_present or recfg_r8.mob_ctrl_info_present or
recfg_r8.ded_info_nas_list_present or recfg_r8.security_cfg_ho_present or recfg_r8.non_crit_ext_present)) {
// If reconf due to reestablishment, recover PDCP state return;
if (state == RRC_STATE_REESTABLISHMENT_COMPLETE) {
for (const auto& erab_pair : bearer_list.get_erabs()) {
uint16_t lcid = erab_pair.second.id - 2;
bool is_am = parent->cfg.qci_cfg[erab_pair.second.qos_params.qci].rlc_cfg.type().value ==
asn1::rrc::rlc_cfg_c::types_opts::am;
if (is_am) {
parent->rrc_log->debug("Set PDCP state: TX HFN %d, NEXT_PDCP_TX_SN %d, RX_HFN %d, NEXT_PDCP_RX_SN %d, "
"LAST_SUBMITTED_PDCP_RX_SN %d\n",
old_reest_pdcp_state[lcid].tx_hfn,
old_reest_pdcp_state[lcid].next_pdcp_tx_sn,
old_reest_pdcp_state[lcid].rx_hfn,
old_reest_pdcp_state[lcid].next_pdcp_rx_sn,
old_reest_pdcp_state[lcid].last_submitted_pdcp_rx_sn);
parent->pdcp->set_bearer_state(rnti, lcid, old_reest_pdcp_state[lcid]);
}
}
} }
// Reuse same PDU /* Apply updates present in RRCConnectionReconfiguration to lower layers */
pdu->clear(); // apply PHY config
apply_reconf_phy_config(recfg_r8, true);
send_dl_dcch(&dl_dcch_msg, std::move(pdu));
state = RRC_STATE_WAIT_FOR_CON_RECONF_COMPLETE; // setup SRB2/DRBs in PDCP and RLC
apply_pdcp_srb_updates(recfg_r8.rr_cfg_ded);
apply_pdcp_drb_updates(recfg_r8.rr_cfg_ded);
apply_rlc_rb_updates(recfg_r8.rr_cfg_ded);
apply_rr_cfg_ded_diff(current_rr_cfg, recfg_r8.rr_cfg_ded); // UE MAC scheduler updates
} mac_ctrl->handle_con_reconf(recfg_r8);
void rrc::ue::send_connection_reconf_upd(srslte::unique_byte_buffer_t pdu) // Reuse same PDU
{ if (pdu != nullptr) {
dl_dcch_msg_s dl_dcch_msg; pdu->clear();
rrc_conn_recfg_s* rrc_conn_recfg = &dl_dcch_msg.msg.set_c1().set_rrc_conn_recfg();
rrc_conn_recfg->rrc_transaction_id = (uint8_t)((transaction_id++) % 4);
rrc_conn_recfg_r8_ies_s& reconfig_r8 = rrc_conn_recfg->crit_exts.set_c1().set_rrc_conn_recfg_r8();
reconfig_r8.rr_cfg_ded_present = true;
rr_cfg_ded_s* rr_cfg = &reconfig_r8.rr_cfg_ded;
rr_cfg->phys_cfg_ded_present = true;
phys_cfg_ded_s* phy_cfg = &rr_cfg->phys_cfg_ded;
phy_cfg->sched_request_cfg_present = true;
phy_cfg->sched_request_cfg.set_setup();
phy_cfg->sched_request_cfg.setup().dsr_trans_max = parent->cfg.sr_cfg.dsr_max;
phy_cfg->cqi_report_cfg_present = true;
if (cell_ded_list.nof_cells() > 0) {
phy_cfg->cqi_report_cfg.cqi_report_periodic_present = true;
phy_cfg->cqi_report_cfg.cqi_report_periodic.set_setup().cqi_format_ind_periodic.set(
cqi_report_periodic_c::setup_s_::cqi_format_ind_periodic_c_::types::wideband_cqi);
get_cqi(&phy_cfg->cqi_report_cfg.cqi_report_periodic.setup().cqi_pmi_cfg_idx,
&phy_cfg->cqi_report_cfg.cqi_report_periodic.setup().cqi_pucch_res_idx,
UE_PCELL_CC_IDX);
phy_cfg->cqi_report_cfg.cqi_report_periodic.setup().simul_ack_nack_and_cqi = parent->cfg.cqi_cfg.simultaneousAckCQI;
if (parent->cfg.antenna_info.tx_mode == ant_info_ded_s::tx_mode_e_::tm3 ||
parent->cfg.antenna_info.tx_mode == ant_info_ded_s::tx_mode_e_::tm4) {
phy_cfg->cqi_report_cfg.cqi_report_periodic.setup().ri_cfg_idx_present = true;
phy_cfg->cqi_report_cfg.cqi_report_periodic.setup().ri_cfg_idx = 483; /* TODO: HARDCODED! Add to UL scheduler */
} else {
phy_cfg->cqi_report_cfg.cqi_report_periodic.setup().ri_cfg_idx_present = false;
}
} else {
phy_cfg->cqi_report_cfg.cqi_report_mode_aperiodic_present = true;
if (phy_cfg->ant_info_present && parent->cfg.antenna_info.tx_mode == ant_info_ded_s::tx_mode_e_::tm4) {
phy_cfg->cqi_report_cfg.cqi_report_mode_aperiodic = cqi_report_mode_aperiodic_e::rm31;
} else {
phy_cfg->cqi_report_cfg.cqi_report_mode_aperiodic = cqi_report_mode_aperiodic_e::rm30;
}
} }
apply_reconf_phy_config(reconfig_r8, true);
phy_cfg->sched_request_cfg.setup().sr_cfg_idx = cell_ded_list.get_sr_res()->sr_I;
phy_cfg->sched_request_cfg.setup().sr_pucch_res_idx = cell_ded_list.get_sr_res()->sr_N_pucch;
// Apply Reconf Msg configuration to MAC scheduler
mac_ctrl->handle_con_reconf(reconfig_r8);
pdu->clear();
// send DL-DCCH message to lower layers
send_dl_dcch(&dl_dcch_msg, std::move(pdu)); send_dl_dcch(&dl_dcch_msg, std::move(pdu));
state = RRC_STATE_WAIT_FOR_CON_RECONF_COMPLETE; state = RRC_STATE_WAIT_FOR_CON_RECONF_COMPLETE;
// Update UE current RadioResourceConfiguration
apply_rr_cfg_ded_diff(current_rr_cfg, recfg_r8.rr_cfg_ded);
} }
void rrc::ue::send_connection_reconf_new_bearer() void rrc::ue::send_connection_reconf_new_bearer()
@ -598,13 +532,8 @@ void rrc::ue::send_connection_reconf_new_bearer()
dl_dcch_msg.msg.c1().rrc_conn_recfg().rrc_transaction_id = (uint8_t)((transaction_id++) % 4); dl_dcch_msg.msg.c1().rrc_conn_recfg().rrc_transaction_id = (uint8_t)((transaction_id++) % 4);
rrc_conn_recfg_r8_ies_s* conn_reconf = &dl_dcch_msg.msg.c1().rrc_conn_recfg().crit_exts.c1().rrc_conn_recfg_r8(); rrc_conn_recfg_r8_ies_s* conn_reconf = &dl_dcch_msg.msg.c1().rrc_conn_recfg().crit_exts.c1().rrc_conn_recfg_r8();
fill_rr_cfg_ded_reconf(conn_reconf->rr_cfg_ded, fill_rr_cfg_ded_reconf(
current_rr_cfg, conn_reconf->rr_cfg_ded, current_rr_cfg, parent->cfg, cell_ded_list, bearer_list, ue_capabilities, false);
parent->cfg,
cell_ded_list,
bearer_list,
ue_capabilities,
reconf_cause::other);
// Setup new bearer // Setup new bearer
apply_pdcp_srb_updates(conn_reconf->rr_cfg_ded); apply_pdcp_srb_updates(conn_reconf->rr_cfg_ded);
@ -625,17 +554,18 @@ void rrc::ue::handle_rrc_reconf_complete(rrc_conn_recfg_complete_s* msg, srslte:
// Inform PHY about the configuration completion // Inform PHY about the configuration completion
parent->phy->complete_config(rnti); parent->phy->complete_config(rnti);
if (last_rrc_conn_recfg.rrc_transaction_id == msg->rrc_transaction_id) { if (transaction_id != msg->rrc_transaction_id) {
// Activate SCells and bearers in the MAC scheduler that were advertised in the RRC Reconf message
mac_ctrl->handle_con_reconf_complete();
// If performing handover, signal its completion
mobility_handler->trigger(*msg);
} else {
parent->rrc_log->error("Expected RRCReconfigurationComplete with transaction ID: %d, got %d\n", parent->rrc_log->error("Expected RRCReconfigurationComplete with transaction ID: %d, got %d\n",
last_rrc_conn_recfg.rrc_transaction_id, transaction_id,
msg->rrc_transaction_id); msg->rrc_transaction_id);
return;
} }
// Activate SCells and bearers in the MAC scheduler that were advertised in the RRC Reconf message
mac_ctrl->handle_con_reconf_complete();
// If performing handover, signal its completion
mobility_handler->trigger(*msg);
} }
/* /*
@ -1327,6 +1257,25 @@ void rrc::ue::apply_pdcp_drb_updates(const rr_cfg_ded_s& pending_rr_cfg)
parent->pdcp->enable_encryption(rnti, drb.lc_ch_id); parent->pdcp->enable_encryption(rnti, drb.lc_ch_id);
} }
} }
// If reconf due to reestablishment, recover PDCP state
if (state == RRC_STATE_REESTABLISHMENT_COMPLETE) {
for (const auto& erab_pair : bearer_list.get_erabs()) {
uint16_t lcid = erab_pair.second.id - 2;
bool is_am = parent->cfg.qci_cfg[erab_pair.second.qos_params.qci].rlc_cfg.type().value ==
asn1::rrc::rlc_cfg_c::types_opts::am;
if (is_am) {
parent->rrc_log->debug("Set PDCP state: TX HFN %d, NEXT_PDCP_TX_SN %d, RX_HFN %d, NEXT_PDCP_RX_SN %d, "
"LAST_SUBMITTED_PDCP_RX_SN %d\n",
old_reest_pdcp_state[lcid].tx_hfn,
old_reest_pdcp_state[lcid].next_pdcp_tx_sn,
old_reest_pdcp_state[lcid].rx_hfn,
old_reest_pdcp_state[lcid].next_pdcp_rx_sn,
old_reest_pdcp_state[lcid].last_submitted_pdcp_rx_sn);
parent->pdcp->set_bearer_state(rnti, lcid, old_reest_pdcp_state[lcid]);
}
}
}
} }
void rrc::ue::apply_rlc_rb_updates(const rr_cfg_ded_s& pending_rr_cfg) void rrc::ue::apply_rlc_rb_updates(const rr_cfg_ded_s& pending_rr_cfg)

@ -327,7 +327,7 @@ void fill_rr_cfg_ded_reconf(asn1::rrc::rr_cfg_ded_s& rr_cfg,
const cell_ctxt_dedicated_list& ue_cell_list, const cell_ctxt_dedicated_list& ue_cell_list,
const bearer_cfg_handler& bearers, const bearer_cfg_handler& bearers,
const srslte::rrc_ue_capabilities_t& ue_caps, const srslte::rrc_ue_capabilities_t& ue_caps,
reconf_cause cause) bool phy_cfg_updated)
{ {
// (Re)establish SRBs // (Re)establish SRBs
fill_srbs_reconf(rr_cfg.srb_to_add_mod_list, current_rr_cfg.srb_to_add_mod_list); fill_srbs_reconf(rr_cfg.srb_to_add_mod_list, current_rr_cfg.srb_to_add_mod_list);
@ -342,7 +342,7 @@ void fill_rr_cfg_ded_reconf(asn1::rrc::rr_cfg_ded_s& rr_cfg,
rr_cfg.drb_to_release_list_present = rr_cfg.drb_to_release_list.size() > 0; rr_cfg.drb_to_release_list_present = rr_cfg.drb_to_release_list.size() > 0;
// PhysCfgDed update needed // PhysCfgDed update needed
if (cause != reconf_cause::other) { if (phy_cfg_updated) {
rr_cfg.phys_cfg_ded_present = true; rr_cfg.phys_cfg_ded_present = true;
fill_phy_cfg_ded_reconf(rr_cfg.phys_cfg_ded, enb_cfg, ue_cell_list, ue_caps); fill_phy_cfg_ded_reconf(rr_cfg.phys_cfg_ded, enb_cfg, ue_cell_list, ue_caps);
} }

Loading…
Cancel
Save