enb,rrc: delay UE release after RLC maxRetx

this fixes the eNB behaviour when RLC signals maxRetx reached.
By directly releasing the UE, we ignore the fact that the UE
could still have the reestablishment counters running, so
could attempt a reestablishment, which would result in a reject
because we would have destroyed the UE context too early.

this patch delays the removal of the UE to wait at least
until the reestablishment timers are expired.
This commit is contained in:
Andre Puschmann 2021-02-25 13:07:22 +01:00
parent 6e64933335
commit 46d8ed8742
2 changed files with 13 additions and 15 deletions

View File

@ -32,8 +32,9 @@ public:
bool is_idle();
typedef enum {
MSG3_RX_TIMEOUT = 0, ///< Msg3 has its own timeout to quickly remove fake UEs from random PRACHs
UE_INACTIVITY_TIMEOUT, ///< UE inactivity timeout
MSG3_RX_TIMEOUT = 0, ///< Msg3 has its own timeout to quickly remove fake UEs from random PRACHs
UE_INACTIVITY_TIMEOUT, ///< UE inactivity timeout (usually bigger than reestablishment timeout)
UE_REESTABLISH_TIMEOUT, ///< Maximum timeout in which UE reestablishment is expected
nulltype
} activity_timeout_type_t;
std::string to_string(const activity_timeout_type_t& type);

View File

@ -130,19 +130,9 @@ void rrc::ue::max_retx_reached()
if (parent) {
parent->logger.info("Max retx reached for rnti=0x%x", rnti);
if (parent->s1ap->user_exists(rnti)) {
parent->s1ap->user_release(rnti, asn1::s1ap::cause_radio_network_opts::radio_conn_with_ue_lost);
event_logger::get().log_rrc_disconnect(ue_cell_list.get_ue_cc_idx(UE_PCELL_CC_IDX)->cell_common->enb_cc_idx,
static_cast<unsigned>(rrc_idle_transition_cause::release),
rnti);
} else {
if (rnti != SRSLTE_MRNTI) {
parent->rem_user_thread(rnti);
}
}
// Give UE time to start re-establishment
set_activity_timeout(UE_REESTABLISH_TIMEOUT);
}
state = RRC_STATE_RELEASE_REQUEST;
}
void rrc::ue::set_activity_timeout(const activity_timeout_type_t type)
@ -160,6 +150,13 @@ void rrc::ue::set_activity_timeout(const activity_timeout_type_t type)
deadline_s = parent->cfg.inactivity_timeout_ms / 1000;
deadline_ms = parent->cfg.inactivity_timeout_ms % 1000;
break;
case UE_REESTABLISH_TIMEOUT:
deadline_ms = static_cast<uint32_t>((get_ue_cc_cfg(UE_PCELL_CC_IDX)->sib2.ue_timers_and_consts.t310.to_number()) +
(get_ue_cc_cfg(UE_PCELL_CC_IDX)->sib2.ue_timers_and_consts.t311.to_number()) +
(get_ue_cc_cfg(UE_PCELL_CC_IDX)->sib2.ue_timers_and_consts.n310.to_number()));
deadline_s = deadline_ms / 1000;
deadline_ms = deadline_ms % 1000;
break;
default:
parent->logger.error("Unknown timeout type %d", type);
}
@ -267,7 +264,7 @@ void rrc::ue::parse_ul_dcch(uint32_t lcid, srslte::unique_byte_buffer_t pdu)
std::string rrc::ue::to_string(const activity_timeout_type_t& type)
{
constexpr static const char* options[] = {"Msg3 reception", "UE response reception", "UE inactivity"};
constexpr static const char* options[] = {"Msg3 reception", "UE inactivity", "UE reestablishment"};
return srslte::enum_to_text(options, (uint32_t)activity_timeout_type_t::nulltype, (uint32_t)type);
}