Add the enb_cc_idx value to S1 events.

master
faluco 4 years ago committed by faluco
parent b750647cd8
commit a940e169a3

@ -40,9 +40,12 @@ public:
uint16_t dl_hfn, ul_hfn;
};
virtual void
initial_ue(uint16_t rnti, asn1::s1ap::rrc_establishment_cause_e cause, srslte::unique_byte_buffer_t pdu) = 0;
virtual void initial_ue(uint16_t rnti,
uint32_t enb_cc_idx,
asn1::s1ap::rrc_establishment_cause_e cause,
srslte::unique_byte_buffer_t pdu) = 0;
virtual void initial_ue(uint16_t rnti,
uint32_t enb_cc_idx,
asn1::s1ap::rrc_establishment_cause_e cause,
srslte::unique_byte_buffer_t pdu,
uint32_t m_tmsi,
@ -87,6 +90,7 @@ public:
* This message signals the completion of the HandoverPreparation from the TeNB point of view. */
virtual bool send_ho_req_ack(const asn1::s1ap::ho_request_s& msg,
uint16_t rnti,
uint32_t enb_cc_idx,
srslte::unique_byte_buffer_t ho_cmd,
srslte::span<asn1::s1ap::erab_admitted_item_s> admitted_bearers) = 0;

@ -146,7 +146,6 @@ public:
ctx.write<metric_type_tag>("event");
ctx.write<metric_timestamp_tag>(get_time_stamp());
//:TODO: not available
ctx.write<metric_sector_id>(enb_cc_idx);
ctx.write<metric_event_name>("s1_context_create");
ctx.get<mset_s1apctx_event>().write<metric_ue_mme_id>(mme_id);
@ -161,7 +160,6 @@ public:
ctx.write<metric_type_tag>("event");
ctx.write<metric_timestamp_tag>(get_time_stamp());
//:TODO: not available
ctx.write<metric_sector_id>(enb_cc_idx);
ctx.write<metric_event_name>("s1_context_delete");
ctx.get<mset_s1apctx_event>().write<metric_ue_mme_id>(mme_id);

@ -44,6 +44,9 @@ public:
rrc_state_t get_state();
void get_metrics(rrc_ue_metrics_t& ue_metrics) const;
///< Helper to access a cell cfg based on ue_cc_idx
enb_cell_common* get_ue_cc_cfg(uint32_t ue_cc_idx);
void send_connection_setup();
void send_connection_reest(uint8_t ncc);
void send_connection_reject();
@ -152,9 +155,6 @@ private:
// controllers
mac_controller mac_ctrl;
///< Helper to access a cell cfg based on ue_cc_idx
enb_cell_common* get_ue_cc_cfg(uint32_t ue_cc_idx);
/// Helper to fill cell_ded_list with SCells provided in the eNB config
void update_scells();

@ -43,6 +43,7 @@ struct ue_ctxt_t {
uint16_t rnti = SRSLTE_INVALID_RNTI;
uint32_t enb_ue_s1ap_id = invalid_enb_id;
uint32_t mme_ue_s1ap_id = 0;
uint32_t enb_cc_idx = 0;
struct timeval init_timestamp = {};
};
@ -58,9 +59,12 @@ public:
void get_metrics(s1ap_metrics_t& m);
// RRC interface
void
initial_ue(uint16_t rnti, asn1::s1ap::rrc_establishment_cause_e cause, srslte::unique_byte_buffer_t pdu) override;
void initial_ue(uint16_t rnti,
uint32_t enb_cc_idx,
asn1::s1ap::rrc_establishment_cause_e cause,
srslte::unique_byte_buffer_t pdu) override;
void initial_ue(uint16_t rnti,
uint32_t enb_cc_idx,
asn1::s1ap::rrc_establishment_cause_e cause,
srslte::unique_byte_buffer_t pdu,
uint32_t m_tmsi,
@ -81,6 +85,7 @@ public:
bool send_ho_failure(uint32_t mme_ue_s1ap_id);
bool send_ho_req_ack(const asn1::s1ap::ho_request_s& msg,
uint16_t rnti,
uint32_t enb_cc_idx,
srslte::unique_byte_buffer_t ho_cmd,
srslte::span<asn1::s1ap::erab_admitted_item_s> admitted_bearers) override;
void send_ho_notify(uint16_t rnti, uint64_t target_eci) override;

@ -176,7 +176,6 @@ uint16_t rrc::start_ho_ue_resource_alloc(const asn1::s1ap::ho_request_s&
// }
// TODO: KeNB derivations
if (not ue_ptr->mobility_handler->start_s1_tenb_ho(msg, container)) {
rem_user_thread(rnti);
return SRSLTE_INVALID_RNTI;
@ -778,7 +777,11 @@ void rrc::ue::rrc_mobility::handle_ho_requested(idle_st& s, const ho_req_rx_ev&
}
// send S1AP HandoverRequestAcknowledge
if (not rrc_enb->s1ap->send_ho_req_ack(*ho_req.ho_req_msg, rrc_ue->rnti, std::move(ho_cmd_pdu), admitted_erabs)) {
if (not rrc_enb->s1ap->send_ho_req_ack(*ho_req.ho_req_msg,
rrc_ue->rnti,
rrc_ue->ue_cell_list.get_ue_cc_idx(UE_PCELL_CC_IDX)->cell_common->enb_cc_idx,
std::move(ho_cmd_pdu),
admitted_erabs)) {
trigger(srslte::failure_ev{});
return;
}

@ -324,15 +324,17 @@ void rrc::ue::handle_rrc_con_setup_complete(rrc_conn_setup_complete_s* msg, srsl
asn1::s1ap::rrc_establishment_cause_e s1ap_cause;
s1ap_cause.value = (asn1::s1ap::rrc_establishment_cause_opts::options)establishment_cause.value;
uint32_t enb_cc_idx = ue_cell_list.get_ue_cc_idx(UE_PCELL_CC_IDX)->cell_common->enb_cc_idx;
if (has_tmsi) {
parent->s1ap->initial_ue(rnti, s1ap_cause, std::move(pdu), m_tmsi, mmec);
parent->s1ap->initial_ue(rnti, enb_cc_idx, s1ap_cause, std::move(pdu), m_tmsi, mmec);
} else {
parent->s1ap->initial_ue(rnti, s1ap_cause, std::move(pdu));
parent->s1ap->initial_ue(rnti, enb_cc_idx, s1ap_cause, std::move(pdu));
}
state = RRC_STATE_WAIT_FOR_CON_RECONF_COMPLETE;
// Log event.
event_logger::get().log_rrc_connected(ue_cell_list.get_ue_cc_idx(UE_PCELL_CC_IDX)->cell_common->enb_cc_idx,
event_logger::get().log_rrc_connected(enb_cc_idx,
asn1::octstring_to_string(last_ul_msg->msg, last_ul_msg->N_bytes),
static_cast<unsigned>(conn_request_result_t::success),
rnti);

@ -298,10 +298,14 @@ void s1ap::build_tai_cgi()
/*******************************************************************************
/* RRC interface
********************************************************************************/
void s1ap::initial_ue(uint16_t rnti, asn1::s1ap::rrc_establishment_cause_e cause, srslte::unique_byte_buffer_t pdu)
void s1ap::initial_ue(uint16_t rnti,
uint32_t enb_cc_idx,
asn1::s1ap::rrc_establishment_cause_e cause,
srslte::unique_byte_buffer_t pdu)
{
std::unique_ptr<ue> ue_ptr{new ue{this}};
ue_ptr->ctxt.rnti = rnti;
ue_ptr->ctxt.enb_cc_idx = enb_cc_idx;
ue* u = users.add_user(std::move(ue_ptr));
if (u == nullptr) {
logger.error("Failed to add rnti=0x%x", rnti);
@ -311,6 +315,7 @@ void s1ap::initial_ue(uint16_t rnti, asn1::s1ap::rrc_establishment_cause_e cause
}
void s1ap::initial_ue(uint16_t rnti,
uint32_t enb_cc_idx,
asn1::s1ap::rrc_establishment_cause_e cause,
srslte::unique_byte_buffer_t pdu,
uint32_t m_tmsi,
@ -318,6 +323,7 @@ void s1ap::initial_ue(uint16_t rnti,
{
std::unique_ptr<ue> ue_ptr{new ue{this}};
ue_ptr->ctxt.rnti = rnti;
ue_ptr->ctxt.enb_cc_idx = enb_cc_idx;
ue* u = users.add_user(std::move(ue_ptr));
if (u == nullptr) {
logger.error("Failed to add rnti=0x%x", rnti);
@ -926,6 +932,7 @@ bool s1ap::send_ho_failure(uint32_t mme_ue_s1ap_id)
bool s1ap::send_ho_req_ack(const asn1::s1ap::ho_request_s& msg,
uint16_t rnti,
uint32_t enb_cc_idx,
srslte::unique_byte_buffer_t ho_cmd,
srslte::span<asn1::s1ap::erab_admitted_item_s> admitted_bearers)
{
@ -935,6 +942,7 @@ bool s1ap::send_ho_req_ack(const asn1::s1ap::ho_request_s& msg,
ue* ue_ptr = users.find_ue_mmeid(msg.protocol_ies.mme_ue_s1ap_id.value.value);
ue_ptr->ctxt.rnti = rnti;
ue_ptr->ctxt.enb_cc_idx = enb_cc_idx;
container.mme_ue_s1ap_id.value = msg.protocol_ies.mme_ue_s1ap_id.value.value;
container.enb_ue_s1ap_id.value = ue_ptr->ctxt.enb_ue_s1ap_id;
@ -1185,8 +1193,7 @@ bool s1ap::ue::send_uectxtreleasecomplete()
container.mme_ue_s1ap_id.value = ctxt.mme_ue_s1ap_id;
// Log event.
//:TODO: cc_idx not available
event_logger::get().log_s1_ctx_delete(0, ctxt.mme_ue_s1ap_id, ctxt.enb_ue_s1ap_id, ctxt.rnti);
event_logger::get().log_s1_ctx_delete(ctxt.enb_cc_idx, ctxt.mme_ue_s1ap_id, ctxt.enb_ue_s1ap_id, ctxt.rnti);
return s1ap_ptr->sctp_send_s1ap_pdu(tx_pdu, ctxt.rnti, "UEContextReleaseComplete");
}
@ -1220,8 +1227,7 @@ bool s1ap::ue::send_initial_ctxt_setup_response(const asn1::s1ap::init_context_s
}
// Log event.
//:TODO: cc_idx not available
event_logger::get().log_s1_ctx_create(0, ctxt.mme_ue_s1ap_id, ctxt.enb_ue_s1ap_id, ctxt.rnti);
event_logger::get().log_s1_ctx_create(ctxt.enb_cc_idx, ctxt.mme_ue_s1ap_id, ctxt.enb_ue_s1ap_id, ctxt.rnti);
return s1ap_ptr->sctp_send_s1ap_pdu(tx_pdu, ctxt.rnti, "InitialContextSetupResponse");
}

@ -86,9 +86,13 @@ public:
class s1ap_dummy : public s1ap_interface_rrc
{
public:
void initial_ue(uint16_t rnti, asn1::s1ap::rrc_establishment_cause_e cause, srslte::unique_byte_buffer_t pdu) override
void initial_ue(uint16_t rnti,
uint32_t enb_cc_idx,
asn1::s1ap::rrc_establishment_cause_e cause,
srslte::unique_byte_buffer_t pdu) override
{}
void initial_ue(uint16_t rnti,
uint32_t enb_cc_idx,
asn1::s1ap::rrc_establishment_cause_e cause,
srslte::unique_byte_buffer_t pdu,
uint32_t m_tmsi,
@ -115,6 +119,7 @@ public:
}
bool send_ho_req_ack(const asn1::s1ap::ho_request_s& msg,
uint16_t rnti,
uint32_t enb_cc_idx,
srslte::unique_byte_buffer_t ho_cmd,
srslte::span<asn1::s1ap::erab_admitted_item_s> admitted_bearers) override
{

@ -96,6 +96,7 @@ public:
}
bool send_ho_req_ack(const asn1::s1ap::ho_request_s& msg,
uint16_t rnti,
uint32_t enb_cc_idx,
srslte::unique_byte_buffer_t ho_cmd,
srslte::span<asn1::s1ap::erab_admitted_item_s> admitted_bearers) override
{

Loading…
Cancel
Save