Changed counting of KOs to RRC

master
Pedro Alvarez 4 years ago
parent 8194b5ec73
commit 47135cb75b

@ -93,6 +93,7 @@ struct general_args_t {
std::string tracing_filename;
std::string eia_pref_list;
std::string eea_pref_list;
uint32_t max_mac_dl_kos;
};
struct all_args_t {

@ -181,11 +181,12 @@ private:
srsran::unique_byte_buffer_t pdu;
} rrc_pdu;
const static uint32_t LCID_EXIT = 0xffff0000;
const static uint32_t LCID_REM_USER = 0xffff0001;
const static uint32_t LCID_REL_USER = 0xffff0002;
const static uint32_t LCID_ACT_USER = 0xffff0004;
const static uint32_t LCID_RTX_USER = 0xffff0005;
const static uint32_t LCID_EXIT = 0xffff0000;
const static uint32_t LCID_REM_USER = 0xffff0001;
const static uint32_t LCID_REL_USER = 0xffff0002;
const static uint32_t LCID_ACT_USER = 0xffff0004;
const static uint32_t LCID_RTX_USER = 0xffff0005;
const static uint32_t LCID_MAC_KO_USER = 0xffff0006;
bool running = false;
srsran::dyn_blocking_queue<rrc_pdu> rx_pdu_queue;

@ -59,6 +59,7 @@ struct rrc_cfg_t {
srsran_cell_t cell;
cell_list_t cell_list;
cell_list_t cell_list_nr;
uint32_t max_mac_dl_kos;
};
constexpr uint32_t UE_PCELL_CC_IDX = 0;

@ -41,6 +41,7 @@ public:
std::string to_string(const activity_timeout_type_t& type);
void set_activity_timeout(const activity_timeout_type_t type);
void set_activity();
void mac_ko_activity();
void activity_timer_expired(const activity_timeout_type_t type);
void max_retx_reached();
@ -182,6 +183,9 @@ private:
const static uint32_t UE_PCELL_CC_IDX = 0;
uint32_t consecutive_kos = 0;
uint32_t max_mac_dl_retx;
ue_cell_ded_list ue_cell_list;
bearer_cfg_handler bearer_list;
security_cfg_handler ue_security_cfg;

@ -1135,6 +1135,9 @@ int set_derived_args(all_args_t* args_, rrc_cfg_t* rrc_cfg_, phy_cfg_t* phy_cfg_
// RRC needs eNB id for SIB1 packing
rrc_cfg_->enb_id = args_->stack.s1ap.enb_id;
// Set max number of KOs
rrc_cfg_->max_mac_dl_kos = args_->general.max_mac_dl_kos;
// Set sync queue capacity to 1 for ZMQ
if (args_->rf.device_name == "zmq") {
srslog::fetch_basic_logger("ENB").info("Using sync queue size of one for ZMQ based radio.");

@ -214,7 +214,7 @@ void parse_args(all_args_t* args, int argc, char* argv[])
("expert.eea_pref_list", bpo::value<string>(&args->general.eea_pref_list)->default_value("EEA0, EEA2, EEA1"), "Ordered preference list for the selection of encryption algorithm (EEA) (default: EEA0, EEA2, EEA1).")
("expert.eia_pref_list", bpo::value<string>(&args->general.eia_pref_list)->default_value("EIA2, EIA1, EIA0"), "Ordered preference list for the selection of integrity algorithm (EIA) (default: EIA2, EIA1, EIA0).")
("expert.max_nof_ues", bpo::value<uint32_t>(&args->stack.mac.max_nof_ues)->default_value(64), "Maximum number of connected UEs")
("expert.max_nof_kos", bpo::value<uint32_t>(&args->stack.mac.max_nof_kos)->default_value(254), "Maximum number of consecutive KOs before triggering the UE's release")
("expert.max_mac_dl_kos", bpo::value<uint32_t>(&args->general.max_mac_dl_kos)->default_value(30), "Maximum number of consecutive KOs before triggering the UE's release")
// eMBMS section
("embms.enable", bpo::value<bool>(&args->stack.embms.enable)->default_value(false), "Enables MBMS in the eNB")

@ -292,17 +292,13 @@ int mac::ack_info(uint32_t tti_rx, uint16_t rnti, uint32_t enb_cc_idx, uint32_t
ue_db[rnti]->metrics_tx(ack, nof_bytes);
if (ack) {
ue_db[rnti]->ko_counter = 0;
if (nof_bytes > 64) { // do not count RLC status messages only
rrc_h->set_activity_user(rnti, true);
logger.info("DL activity rnti=0x%x, n_bytes=%d", rnti, nof_bytes);
}
} else {
ue_db[rnti]->ko_counter++;
if (ue_db[rnti]->ko_counter > args.max_nof_kos) {
rrc_h->set_activity_user(rnti, false);
logger.info("DL max KOs reached rnti=0x%x, n_bytes=%d", rnti, nof_bytes);
}
rrc_h->set_activity_user(rnti, false);
logger.info("DL KO activity rnti=0x%x, n_bytes=%d", rnti, nof_bytes);
}
return SRSRAN_SUCCESS;
}

@ -85,6 +85,7 @@ int32_t rrc::init(const rrc_cfg_t& cfg_,
"re-establishment procedure.");
}
logger.info("Inactivity timeout: %d ms", cfg.inactivity_timeout_ms);
logger.info("Max consecutive MAC KOs: %d", cfg.max_mac_dl_kos);
running = true;
@ -137,7 +138,7 @@ void rrc::set_activity_user(uint16_t rnti, bool ack_info)
if (ack_info) {
p = {rnti, LCID_ACT_USER, nullptr};
} else {
p = {rnti, LCID_RTX_USER, nullptr};
p = {rnti, LCID_MAC_KO_USER, nullptr};
}
if (not rx_pdu_queue.try_push(std::move(p))) {
@ -1025,6 +1026,9 @@ void rrc::tti_clock()
case LCID_ACT_USER:
user_it->second->set_activity();
break;
case LCID_MAC_KO_USER:
user_it->second->mac_ko_activity();
break;
case LCID_RTX_USER:
user_it->second->max_retx_reached();
break;

@ -103,12 +103,29 @@ void rrc::ue::set_activity()
{
// re-start activity timer with current timeout value
activity_timer.run();
consecutive_kos = 0;
if (parent) {
parent->logger.debug("Activity registered for rnti=0x%x (timeout_value=%dms)", rnti, activity_timer.duration());
}
}
void rrc::ue::activity_timer_expired(activity_timeout_type_t type)
void rrc::ue::mac_ko_activity()
{
// Count KOs in MAC and trigger release if it goes above a certain value.
// This is done to detect out-of-coverage UEs
consecutive_kos++;
parent->logger.debug("KO activity registered for rnti=0x%x (consecutive_kos=%d, max_mac_dl_kos=%d)",
rnti,
consecutive_kos,
parent->cfg.max_mac_dl_kos);
if (consecutive_kos > parent->cfg.max_mac_dl_kos) {
parent->logger.debug("Max KOs reached, triggering release rnti=0x%x", rnti);
max_retx_reached();
}
}
void rrc::ue::activity_timer_expired(const activity_timeout_type_t type)
{
if (parent) {
parent->logger.info("Activity timer for rnti=0x%x expired after %d ms", rnti, activity_timer.time_elapsed());

Loading…
Cancel
Save