Added interface to make the PDCP notify the RRC of integrity check

failures.
master
Pedro Alvarez 4 years ago
parent 5c7ea6f6df
commit 299d2ee35d

@ -117,6 +117,7 @@ class rrc_interface_pdcp
{
public:
virtual void write_pdu(uint16_t rnti, uint32_t lcid, srsran::unique_byte_buffer_t pdu) = 0;
virtual void notify_pdcp_integrity_error(uint16_t rnti, uint32_t lcid) = 0;
};
} // namespace srsenb

@ -159,6 +159,7 @@ class rrc_interface_pdcp_nr
{
public:
virtual void write_pdu(uint16_t rnti, uint32_t lcid, srsran::unique_byte_buffer_t pdu) = 0;
virtual void notify_pdcp_integrity_error(uint16_t rnti, uint32_t lcid) = 0;
};
class phy_interface_stack_nr

@ -84,6 +84,7 @@ public:
virtual void write_pdu_bcch_dlsch(srsran::unique_byte_buffer_t pdu) = 0;
virtual void write_pdu_pcch(srsran::unique_byte_buffer_t pdu) = 0;
virtual void write_pdu_mch(uint32_t lcid, srsran::unique_byte_buffer_t pdu) = 0;
virtual void notify_pdcp_integrity_error(uint32_t lcid) = 0;
virtual const char* get_rb_name(uint32_t lcid) = 0;
};

@ -301,8 +301,10 @@ void pdcp_entity_lte::handle_srb_pdu(srsran::unique_byte_buffer_t pdu)
// Perfrom integrity checks
if (integrity_direction == DIRECTION_RX || integrity_direction == DIRECTION_TXRX) {
if (not integrity_verify(pdu->msg, pdu->N_bytes, count, mac)) {
bool pdu_valid = integrity_verify(pdu->msg, pdu->N_bytes, count, mac);
if (not pdu_valid) {
logger.error(pdu->msg, pdu->N_bytes, "%s Dropping PDU", rrc->get_rb_name(lcid));
rrc->notify_pdcp_integrity_error(lcid);
return; // Discard
}
}
@ -763,7 +765,8 @@ void pdcp_entity_lte::notify_failure(const pdcp_sn_vector_t& pdcp_sns)
***************************************************************************/
bool pdcp_entity_lte::check_valid_config()
{
if (cfg.sn_len != PDCP_SN_LEN_5 && cfg.sn_len != PDCP_SN_LEN_7 && cfg.sn_len != PDCP_SN_LEN_12 && cfg.sn_len != PDCP_SN_LEN_18) {
if (cfg.sn_len != PDCP_SN_LEN_5 && cfg.sn_len != PDCP_SN_LEN_7 && cfg.sn_len != PDCP_SN_LEN_12 &&
cfg.sn_len != PDCP_SN_LEN_18) {
logger.error("Trying to configure bearer with invalid SN LEN=%d", cfg.sn_len);
return false;
}

@ -75,6 +75,7 @@ public:
void write_pdu_bcch_dlsch(srsran::unique_byte_buffer_t pdu) {}
void write_pdu_pcch(srsran::unique_byte_buffer_t pdu) {}
void write_pdu_mch(uint32_t lcid, srsran::unique_byte_buffer_t pdu) {}
void notify_pdcp_integrity_error(uint32_t lcid) {}
const char* get_rb_name(uint32_t lcid) { return "None"; }

@ -117,6 +117,7 @@ public:
// rrc_interface_pdcp
void write_pdu(uint16_t rnti, uint32_t lcid, srsran::unique_byte_buffer_t pdu) override;
void notify_pdcp_integrity_error(uint16_t rnti, uint32_t lcid) override;
uint32_t get_nof_users();

@ -90,8 +90,10 @@ public:
void max_retx_attempted(uint16_t rnti) {}
void protocol_failure(uint16_t rnti) {}
const char* get_rb_name(uint32_t lcid) { return "invalid"; }
// PDCP interface
void write_pdu(uint16_t rnti, uint32_t lcid, srsran::unique_byte_buffer_t pdu) final;
void notify_pdcp_integrity_error(uint16_t rnti, uint32_t lcid) final;
class ue
{

@ -99,6 +99,7 @@ private:
void write_pdu_bcch_dlsch(srsran::unique_byte_buffer_t pdu);
void write_pdu_pcch(srsran::unique_byte_buffer_t pdu);
void write_pdu_mch(uint32_t lcid, srsran::unique_byte_buffer_t pdu) {}
void notify_pdcp_integrity_error(uint32_t lcid);
const char* get_rb_name(uint32_t lcid);
};

@ -87,6 +87,7 @@ private:
void write_pdu_bcch_dlsch(srsran::unique_byte_buffer_t pdu) final;
void write_pdu_pcch(srsran::unique_byte_buffer_t pdu) final;
void write_pdu_mch(uint32_t lcid, srsran::unique_byte_buffer_t pdu) final {}
void notify_pdcp_integrity_error(uint32_t lcid) final {}
const char* get_rb_name(uint32_t lcid) final;
};

@ -290,6 +290,11 @@ void rrc::write_pdu(uint16_t rnti, uint32_t lcid, srsran::unique_byte_buffer_t p
}
}
void rrc::notify_pdcp_integrity_error(uint16_t rnti, uint32_t lcid)
{
logger.warning("Received Integrity Protection failured indication, rnti=0x%u, lcid=%u", rnti, lcid);
}
/*******************************************************************************
S1AP interface
*******************************************************************************/

@ -344,6 +344,8 @@ void rrc_nr::write_pdu(uint16_t rnti, uint32_t lcid, srsran::unique_byte_buffer_
handle_pdu(rnti, lcid, std::move(pdu));
}
void rrc_nr::notify_pdcp_integrity_error(uint16_t rnti, uint32_t lcid) {}
/*******************************************************************************
UE class

@ -220,6 +220,11 @@ void pdcp::user_interface_rrc::write_pdu(uint32_t lcid, srsran::unique_byte_buff
rrc->write_pdu(rnti, lcid, std::move(pdu));
}
void pdcp::user_interface_rrc::notify_pdcp_integrity_error(uint32_t lcid)
{
rrc->notify_pdcp_integrity_error(rnti, lcid);
}
void pdcp::user_interface_rrc::write_pdu_bcch_bch(srsran::unique_byte_buffer_t pdu)
{
ERROR("Error: Received BCCH from ue=%d", rnti);

@ -147,6 +147,7 @@ public:
void write_pdu_bcch_dlsch(srsran::unique_byte_buffer_t pdu);
void write_pdu_pcch(srsran::unique_byte_buffer_t pdu);
void write_pdu_mch(uint32_t lcid, srsran::unique_byte_buffer_t pdu);
void notify_pdcp_integrity_error(uint32_t lcid);
bool srbs_flushed(); //< Check if data on SRBs still needs to be sent

@ -16,12 +16,12 @@
#include "srsran/asn1/rrc_nr.h"
#include "srsran/asn1/rrc_nr_utils.h"
#include "srsran/common/block_queue.h"
#include "srsran/common/common_nr.h"
#include "srsran/common/buffer_pool.h"
#include "srsran/common/common_nr.h"
#include "srsran/common/stack_procedure.h"
#include "srsran/common/task_scheduler.h"
#include "srsran/interfaces/ue_rrc_interfaces.h"
#include "srsran/interfaces/ue_nr_interfaces.h"
#include "srsran/interfaces/ue_rrc_interfaces.h"
#include "srsue/hdr/stack/upper/gw.h"
namespace srsue {
@ -115,6 +115,7 @@ public:
void write_pdu_bcch_dlsch(srsran::unique_byte_buffer_t pdu) final;
void write_pdu_pcch(srsran::unique_byte_buffer_t pdu) final;
void write_pdu_mch(uint32_t lcid, srsran::unique_byte_buffer_t pdu) final;
void notify_pdcp_integrity_error(uint32_t lcid) final;
// RRC (LTE) interface
void get_eutra_nr_capabilities(srsran::byte_buffer_t* eutra_nr_caps);

@ -1620,6 +1620,11 @@ void rrc::write_pdu(uint32_t lcid, unique_byte_buffer_t pdu)
process_pdu(lcid, std::move(pdu));
}
void rrc::notify_pdcp_integrity_error(uint32_t lcid)
{
logger.warning("Received Integrity Protection failured indication, rnti=0x%u, lcid=%u", lcid);
}
void rrc::process_pdu(uint32_t lcid, srsran::unique_byte_buffer_t pdu)
{
logger.debug("RX PDU, LCID: %d", lcid);

@ -206,6 +206,7 @@ void rrc_nr::write_pdu_bcch_bch(srsran::unique_byte_buffer_t pdu) {}
void rrc_nr::write_pdu_bcch_dlsch(srsran::unique_byte_buffer_t pdu) {}
void rrc_nr::write_pdu_pcch(srsran::unique_byte_buffer_t pdu) {}
void rrc_nr::write_pdu_mch(uint32_t lcid, srsran::unique_byte_buffer_t pdu) {}
void rrc_nr::notify_pdcp_integrity_error(uint32_t lcid) {}
void rrc_nr::get_eutra_nr_capabilities(srsran::byte_buffer_t* eutra_nr_caps_pdu)
{

@ -150,6 +150,7 @@ public:
// RRC interface for PDCP, PDCP calls RRC to push RRC SDU
void write_pdu(uint32_t lcid, unique_byte_buffer_t pdu);
void notify_pdcp_integrity_error(uint32_t lcid);
// Not supported right now
void write_pdu_bcch_bch(unique_byte_buffer_t pdu);

@ -1139,6 +1139,11 @@ void ttcn3_syssim::protocol_failure()
logger.error("%s not implemented.", __FUNCTION__);
}
void ttcn3_syssim::notify_pdcp_integrity_error(uint32_t lcid)
{
logger.error("%s not implemented.", __FUNCTION__);
}
const char* ttcn3_syssim::get_rb_name(uint32_t lcid)
{
if (lcid < rb_id_vec.size()) {

@ -74,6 +74,7 @@ public:
const char* get_rb_name(uint32_t lcid) { return "lcid"; }
void write_sdu(uint32_t lcid, srsran::unique_byte_buffer_t sdu) {}
bool is_lcid_enabled(uint32_t lcid) { return false; }
void notify_pdcp_integrity_error(uint32_t lcid) {}
};
class rrc_dummy : public rrc_interface_nas

Loading…
Cancel
Save