Added check for consequetive KOs in MAC. Change set_activity_user to pass activity and max KOs to RRC and trigger RLF timeout.

master
Pedro Alvarez 4 years ago
parent 968c261bec
commit 8194b5ec73

@ -18,9 +18,10 @@
*******************************************************************************/
#include <chrono>
#include <cstring>
#include <memory>
#include <stdint.h>
#include <string.h>
#include <string>
#include <sys/time.h>
/*******************************************************************************

@ -23,6 +23,7 @@ struct mac_args_t {
sched_interface::sched_args_t sched;
int nr_tb_size = -1;
uint32_t max_nof_ues;
uint32_t max_nof_kos;
};
/* Interface PHY -> MAC */

@ -73,7 +73,7 @@ public:
/* Radio Link failure */
virtual int add_user(uint16_t rnti, const sched_interface::ue_cfg_t& init_ue_cfg) = 0;
virtual void upd_user(uint16_t new_rnti, uint16_t old_rnti) = 0;
virtual void set_activity_user(uint16_t rnti) = 0;
virtual void set_activity_user(uint16_t rnti, bool ack_info) = 0;
virtual bool is_paging_opportunity(uint32_t tti, uint32_t* payload_len) = 0;
///< Provide packed SIB to MAC (buffer is managed by RRC)

@ -324,6 +324,7 @@ enable = false
#pregenerate_signals = false
#tx_amplitude = 0.6
#rrc_inactivity_timer = 30000
#max_nof_kos = 256
#max_prach_offset_us = 30
#eea_pref_list = EEA0, EEA2, EEA1
#eia_pref_list = EIA2, EIA1, EIA0

@ -139,7 +139,7 @@ public:
generate_mch_pdu(uint32_t harq_pid, sched_interface::dl_pdu_mch_t sched, uint32_t nof_pdu_elems, uint32_t grant_size);
srsran_softbuffer_tx_t*
get_tx_softbuffer(const uint32_t ue_cc_idx, const uint32_t harq_process, const uint32_t tb_idx);
get_tx_softbuffer(const uint32_t ue_cc_idx, const uint32_t harq_process, const uint32_t tb_idx);
srsran_softbuffer_rx_t* get_rx_softbuffer(const uint32_t ue_cc_idx, const uint32_t tti);
bool process_pdus();
@ -160,6 +160,8 @@ public:
int read_pdu(uint32_t lcid, uint8_t* payload, uint32_t requested_bytes) final;
uint32_t ko_counter = 0;
private:
void allocate_sdu(srsran::sch_pdu* pdu, uint32_t lcid, uint32_t sdu_len);
bool process_ce(srsran::sch_subh* subh);

@ -67,7 +67,7 @@ public:
// rrc_interface_mac
int add_user(uint16_t rnti, const sched_interface::ue_cfg_t& init_ue_cfg) override;
void upd_user(uint16_t new_rnti, uint16_t old_rnti) override;
void set_activity_user(uint16_t rnti) override;
void set_activity_user(uint16_t rnti, bool ack_info) override;
bool is_paging_opportunity(uint32_t tti, uint32_t* payload_len) override;
uint8_t* read_pdu_bcch_dlsch(const uint8_t cc_idx, const uint32_t sib_index) override;

@ -214,6 +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")
// eMBMS section
("embms.enable", bpo::value<bool>(&args->stack.embms.enable)->default_value(false), "Enables MBMS in the eNB")

@ -292,10 +292,17 @@ 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);
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);
}
}
return SRSRAN_SUCCESS;
}
@ -830,9 +837,9 @@ int mac::get_mch_sched(uint32_t tti, bool is_mcch, dl_sched_list_t& dl_sched_res
int requested_bytes = (mcs_data.tbs / 8 > (int)mch.mtch_sched[mtch_index].lcid_buffer_size)
? (mch.mtch_sched[mtch_index].lcid_buffer_size)
: ((mcs_data.tbs / 8) - 2);
int bytes_received = ue_db[SRSRAN_MRNTI]->read_pdu(current_lcid, mtch_payload_buffer, requested_bytes);
mch.pdu[0].lcid = current_lcid;
mch.pdu[0].nbytes = bytes_received;
int bytes_received = ue_db[SRSRAN_MRNTI]->read_pdu(current_lcid, mtch_payload_buffer, requested_bytes);
mch.pdu[0].lcid = current_lcid;
mch.pdu[0].nbytes = bytes_received;
mch.mtch_sched[0].mtch_payload = mtch_payload_buffer;
dl_sched_res->pdsch[0].dci.rnti = SRSRAN_MRNTI;
if (bytes_received) {

@ -373,7 +373,7 @@ void ue::process_pdu(uint8_t* pdu, uint32_t nof_bytes, srsran::pdu_queue::channe
// Indicate RRC about successful activity if valid RLC message is received
if (mac_msg_ul.get()->get_payload_size() > 64) { // do not count RLC status messages only
rrc->set_activity_user(rnti);
rrc->set_activity_user(rnti, true);
logger.debug("UL activity rnti=0x%x, n_bytes=%d", rnti, nof_bytes);
}
@ -423,10 +423,8 @@ void ue::deallocate_pdu(uint32_t tti, uint32_t ue_cc_idx)
{
std::unique_lock<std::mutex> lock(rx_buffers_mutex);
if (not cc_buffers[ue_cc_idx].get_rx_used_buffers().try_deallocate_pdu(tti_point(tti))) {
logger.warning("UE buffers: Null RX PDU pointer in deallocate_pdu for rnti=0x%x tti=%d cc_idx=%d",
rnti,
tti,
ue_cc_idx);
logger.warning(
"UE buffers: Null RX PDU pointer in deallocate_pdu for rnti=0x%x tti=%d cc_idx=%d", rnti, tti, ue_cc_idx);
}
}
@ -434,8 +432,7 @@ void ue::push_pdu(uint32_t tti, uint32_t ue_cc_idx, uint32_t len)
{
std::unique_lock<std::mutex> lock(rx_buffers_mutex);
if (not cc_buffers[ue_cc_idx].get_rx_used_buffers().push_pdu(tti_point(tti), len)) {
logger.warning(
"UE buffers: Failed to push RX PDU for rnti=0x%x tti=%d cc_idx=%d", rnti, tti, ue_cc_idx);
logger.warning("UE buffers: Failed to push RX PDU for rnti=0x%x tti=%d cc_idx=%d", rnti, tti, ue_cc_idx);
}
}

@ -131,9 +131,15 @@ uint8_t* rrc::read_pdu_bcch_dlsch(const uint8_t cc_idx, const uint32_t sib_index
return nullptr;
}
void rrc::set_activity_user(uint16_t rnti)
void rrc::set_activity_user(uint16_t rnti, bool ack_info)
{
rrc_pdu p = {rnti, LCID_ACT_USER, nullptr};
rrc_pdu p;
if (ack_info) {
p = {rnti, LCID_ACT_USER, nullptr};
} else {
p = {rnti, LCID_RTX_USER, nullptr};
}
if (not rx_pdu_queue.try_push(std::move(p))) {
logger.error("Failed to push UE activity command to RRC queue");
}

@ -103,7 +103,6 @@ void rrc::ue::set_activity()
{
// re-start activity timer with current timeout value
activity_timer.run();
if (parent) {
parent->logger.debug("Activity registered for rnti=0x%x (timeout_value=%dms)", rnti, activity_timer.duration());
}

@ -34,7 +34,7 @@ struct rrc_dummy : public rrc_interface_mac {
public:
int add_user(uint16_t rnti, const sched_interface::ue_cfg_t& init_ue_cfg) { return SRSRAN_SUCCESS; }
void upd_user(uint16_t new_rnti, uint16_t old_rnti) {}
void set_activity_user(uint16_t rnti) {}
void set_activity_user(uint16_t rnti, bool ack_info) {}
bool is_paging_opportunity(uint32_t tti, uint32_t* payload_len) { return false; }
uint8_t* read_pdu_bcch_dlsch(const uint8_t enb_cc_idx, const uint32_t sib_index) { return nullptr; }
};

Loading…
Cancel
Save