enb,stack: add NR components for NSA mode

adds the main NR components for RLC, PDCP, MAC and RRC
for NSA operation.
master
Andre Puschmann 3 years ago
parent c9e87b2cf3
commit 8dd7075d12

@ -19,7 +19,9 @@
#define SRSRAN_ENB_STACK_LTE_H #define SRSRAN_ENB_STACK_LTE_H
#include "mac/mac.h" #include "mac/mac.h"
#include "mac/mac_nr.h"
#include "rrc/rrc.h" #include "rrc/rrc.h"
#include "rrc/rrc_nr.h"
#include "s1ap/s1ap.h" #include "s1ap/s1ap.h"
#include "srsran/common/task_scheduler.h" #include "srsran/common/task_scheduler.h"
#include "upper/gtpu.h" #include "upper/gtpu.h"
@ -119,6 +121,10 @@ private:
srslog::basic_logger& s1ap_logger; srslog::basic_logger& s1ap_logger;
srslog::basic_logger& gtpu_logger; srslog::basic_logger& gtpu_logger;
srslog::basic_logger& stack_logger; srslog::basic_logger& stack_logger;
srslog::basic_logger& rrc_nr_logger;
srslog::basic_logger& mac_nr_logger;
srslog::basic_logger& rlc_nr_logger;
srslog::basic_logger& pdcp_nr_logger;
// PCAP and trace option // PCAP and trace option
srsran::mac_pcap mac_pcap; srsran::mac_pcap mac_pcap;
@ -136,6 +142,12 @@ private:
srsenb::gtpu gtpu; srsenb::gtpu gtpu;
srsenb::s1ap s1ap; srsenb::s1ap s1ap;
// NR components for NSA mode
srsenb::mac_nr mac_nr;
srsenb::rlc rlc_nr;
srsenb::pdcp pdcp_nr;
srsenb::rrc_nr rrc_nr;
// RAT-specific interfaces // RAT-specific interfaces
phy_interface_stack_lte* phy = nullptr; phy_interface_stack_lte* phy = nullptr;

@ -18,6 +18,7 @@
#include "srsran/mac/mac_sch_pdu_nr.h" #include "srsran/mac/mac_sch_pdu_nr.h"
#include "srsenb/hdr/stack/enb_stack_base.h" #include "srsenb/hdr/stack/enb_stack_base.h"
#include "srsran/common/task_scheduler.h"
#include "srsran/interfaces/enb_metrics_interface.h" #include "srsran/interfaces/enb_metrics_interface.h"
#include "srsran/interfaces/gnb_interfaces.h" #include "srsran/interfaces/gnb_interfaces.h"
@ -40,7 +41,7 @@ struct mac_nr_args_t {
class mac_nr final : public mac_interface_phy_nr, public mac_interface_rrc_nr, public mac_interface_rlc_nr class mac_nr final : public mac_interface_phy_nr, public mac_interface_rrc_nr, public mac_interface_rlc_nr
{ {
public: public:
mac_nr(); mac_nr(srsran::task_sched_handle task_sched_);
~mac_nr(); ~mac_nr();
int init(const mac_nr_args_t& args_, int init(const mac_nr_args_t& args_,
@ -85,6 +86,9 @@ private:
rlc_interface_mac_nr* rlc_h = nullptr; rlc_interface_mac_nr* rlc_h = nullptr;
rrc_interface_mac_nr* rrc_h = nullptr; rrc_interface_mac_nr* rrc_h = nullptr;
// args
srsran::task_sched_handle task_sched;
std::unique_ptr<srsran::mac_pcap> pcap = nullptr; std::unique_ptr<srsran::mac_pcap> pcap = nullptr;
mac_nr_args_t args = {}; mac_nr_args_t args = {};
srslog::basic_logger& logger; srslog::basic_logger& logger;

@ -63,7 +63,7 @@ class rrc_nr final : public rrc_interface_pdcp_nr,
public rrc_interface_ngap_nr public rrc_interface_ngap_nr
{ {
public: public:
explicit rrc_nr(srsran::timer_handler* timers_); explicit rrc_nr(srsran::task_sched_handle task_sched_);
int32_t init(const rrc_nr_cfg_t& cfg, int32_t init(const rrc_nr_cfg_t& cfg,
phy_interface_stack_nr* phy, phy_interface_stack_nr* phy,
@ -132,7 +132,7 @@ private:
ngap_interface_rrc_nr* ngap = nullptr; ngap_interface_rrc_nr* ngap = nullptr;
// args // args
srsran::timer_handler* timers = nullptr; srsran::task_sched_handle task_sched;
// derived // derived
uint32_t slot_dur_ms = 0; uint32_t slot_dur_ms = 0;

@ -24,19 +24,27 @@ namespace srsenb {
enb_stack_lte::enb_stack_lte(srslog::sink& log_sink) : enb_stack_lte::enb_stack_lte(srslog::sink& log_sink) :
thread("STACK"), thread("STACK"),
mac_logger(srslog::fetch_basic_logger("MAC", log_sink)), mac_logger(srslog::fetch_basic_logger("MAC", log_sink)),
mac_nr_logger(srslog::fetch_basic_logger("MAC-NR", log_sink)),
rlc_logger(srslog::fetch_basic_logger("RLC", log_sink, false)), rlc_logger(srslog::fetch_basic_logger("RLC", log_sink, false)),
rlc_nr_logger(srslog::fetch_basic_logger("RLC-NR", log_sink, false)),
pdcp_logger(srslog::fetch_basic_logger("PDCP", log_sink, false)), pdcp_logger(srslog::fetch_basic_logger("PDCP", log_sink, false)),
pdcp_nr_logger(srslog::fetch_basic_logger("PDCP-NR", log_sink, false)),
rrc_logger(srslog::fetch_basic_logger("RRC", log_sink, false)), rrc_logger(srslog::fetch_basic_logger("RRC", log_sink, false)),
rrc_nr_logger(srslog::fetch_basic_logger("RRC-NR", log_sink, false)),
s1ap_logger(srslog::fetch_basic_logger("S1AP", log_sink, false)), s1ap_logger(srslog::fetch_basic_logger("S1AP", log_sink, false)),
gtpu_logger(srslog::fetch_basic_logger("GTPU", log_sink, false)), gtpu_logger(srslog::fetch_basic_logger("GTPU", log_sink, false)),
stack_logger(srslog::fetch_basic_logger("STCK", log_sink, false)), stack_logger(srslog::fetch_basic_logger("STCK", log_sink, false)),
task_sched(512, 128), task_sched(512, 128),
pdcp(&task_sched, pdcp_logger), pdcp(&task_sched, pdcp_logger),
pdcp_nr(&task_sched, pdcp_nr_logger),
mac(&task_sched, mac_logger), mac(&task_sched, mac_logger),
mac_nr(&task_sched),
rlc(rlc_logger), rlc(rlc_logger),
rlc_nr(rlc_nr_logger),
gtpu(&task_sched, gtpu_logger, &rx_sockets), gtpu(&task_sched, gtpu_logger, &rx_sockets),
s1ap(&task_sched, s1ap_logger, &rx_sockets), s1ap(&task_sched, s1ap_logger, &rx_sockets),
rrc(&task_sched), rrc(&task_sched),
rrc_nr(&task_sched),
mac_pcap(), mac_pcap(),
pending_stack_metrics(64) pending_stack_metrics(64)
{ {
@ -78,19 +86,25 @@ int enb_stack_lte::init(const stack_args_t& args_, const rrc_cfg_t& rrc_cfg_)
// setup logging for each layer // setup logging for each layer
mac_logger.set_level(srslog::str_to_basic_level(args.log.mac_level)); mac_logger.set_level(srslog::str_to_basic_level(args.log.mac_level));
mac_logger.set_hex_dump_max_size(args.log.mac_hex_limit); mac_nr_logger.set_level(srslog::str_to_basic_level(args.log.mac_level));
// Init logs
rlc_logger.set_level(srslog::str_to_basic_level(args.log.rlc_level)); rlc_logger.set_level(srslog::str_to_basic_level(args.log.rlc_level));
rlc_nr_logger.set_level(srslog::str_to_basic_level(args.log.rlc_level));
pdcp_logger.set_level(srslog::str_to_basic_level(args.log.pdcp_level)); pdcp_logger.set_level(srslog::str_to_basic_level(args.log.pdcp_level));
pdcp_nr_logger.set_level(srslog::str_to_basic_level(args.log.pdcp_level));
rrc_logger.set_level(srslog::str_to_basic_level(args.log.rrc_level)); rrc_logger.set_level(srslog::str_to_basic_level(args.log.rrc_level));
rrc_nr_logger.set_level(srslog::str_to_basic_level(args.log.rrc_level));
gtpu_logger.set_level(srslog::str_to_basic_level(args.log.gtpu_level)); gtpu_logger.set_level(srslog::str_to_basic_level(args.log.gtpu_level));
s1ap_logger.set_level(srslog::str_to_basic_level(args.log.s1ap_level)); s1ap_logger.set_level(srslog::str_to_basic_level(args.log.s1ap_level));
stack_logger.set_level(srslog::str_to_basic_level(args.log.stack_level)); stack_logger.set_level(srslog::str_to_basic_level(args.log.stack_level));
mac_logger.set_hex_dump_max_size(args.log.mac_hex_limit);
mac_nr_logger.set_hex_dump_max_size(args.log.mac_hex_limit);
rlc_logger.set_hex_dump_max_size(args.log.rlc_hex_limit); rlc_logger.set_hex_dump_max_size(args.log.rlc_hex_limit);
rlc_nr_logger.set_hex_dump_max_size(args.log.rlc_hex_limit);
pdcp_logger.set_hex_dump_max_size(args.log.pdcp_hex_limit); pdcp_logger.set_hex_dump_max_size(args.log.pdcp_hex_limit);
pdcp_nr_logger.set_hex_dump_max_size(args.log.pdcp_hex_limit);
rrc_logger.set_hex_dump_max_size(args.log.rrc_hex_limit); rrc_logger.set_hex_dump_max_size(args.log.rrc_hex_limit);
rrc_nr_logger.set_hex_dump_max_size(args.log.rrc_hex_limit);
gtpu_logger.set_hex_dump_max_size(args.log.gtpu_hex_limit); gtpu_logger.set_hex_dump_max_size(args.log.gtpu_hex_limit);
s1ap_logger.set_hex_dump_max_size(args.log.s1ap_hex_limit); s1ap_logger.set_hex_dump_max_size(args.log.s1ap_hex_limit);
stack_logger.set_hex_dump_max_size(args.log.stack_hex_limit); stack_logger.set_hex_dump_max_size(args.log.stack_hex_limit);

@ -18,10 +18,10 @@ namespace srsenb {
gnb_stack_nr::gnb_stack_nr() : task_sched{512, 128}, thread("gNB"), rlc_logger(srslog::fetch_basic_logger("RLC-NR")) gnb_stack_nr::gnb_stack_nr() : task_sched{512, 128}, thread("gNB"), rlc_logger(srslog::fetch_basic_logger("RLC-NR"))
{ {
m_mac.reset(new mac_nr()); m_mac.reset(new mac_nr(&task_sched));
m_rlc.reset(new rlc_nr("RLC-NR")); m_rlc.reset(new rlc_nr("RLC-NR"));
m_pdcp.reset(new pdcp_nr(&task_sched, "PDCP-NR")); m_pdcp.reset(new pdcp_nr(&task_sched, "PDCP-NR"));
m_rrc.reset(new rrc_nr(task_sched.get_timer_handler())); m_rrc.reset(new rrc_nr(&task_sched));
m_sdap.reset(new sdap()); m_sdap.reset(new sdap());
m_gw.reset(new srsue::gw()); m_gw.reset(new srsue::gw());
// m_gtpu.reset(new srsenb::gtpu()); // m_gtpu.reset(new srsenb::gtpu());

@ -20,7 +20,9 @@
namespace srsenb { namespace srsenb {
mac_nr::mac_nr() : logger(srslog::fetch_basic_logger("MAC-NR")) {} mac_nr::mac_nr(srsran::task_sched_handle task_sched_) :
logger(srslog::fetch_basic_logger("MAC-NR")), task_sched(task_sched_)
{}
mac_nr::~mac_nr() mac_nr::~mac_nr()
{ {

@ -19,7 +19,9 @@ using namespace asn1::rrc_nr;
namespace srsenb { namespace srsenb {
rrc_nr::rrc_nr(srsran::timer_handler* timers_) : logger(srslog::fetch_basic_logger("RRC-NR")), timers(timers_) {} rrc_nr::rrc_nr(srsran::task_sched_handle task_sched_) :
logger(srslog::fetch_basic_logger("RRC-NR")), task_sched(task_sched_)
{}
int rrc_nr::init(const rrc_nr_cfg_t& cfg_, int rrc_nr::init(const rrc_nr_cfg_t& cfg_,
phy_interface_stack_nr* phy_, phy_interface_stack_nr* phy_,
@ -357,7 +359,7 @@ void rrc_nr::notify_pdcp_integrity_error(uint16_t rnti, uint32_t lcid) {}
rrc_nr::ue::ue(rrc_nr* parent_, uint16_t rnti_) : parent(parent_), rnti(rnti_) rrc_nr::ue::ue(rrc_nr* parent_, uint16_t rnti_) : parent(parent_), rnti(rnti_)
{ {
// setup periodic RRCSetup send // setup periodic RRCSetup send
rrc_setup_periodic_timer = parent->timers->get_unique_timer(); rrc_setup_periodic_timer = parent->task_sched.get_unique_timer();
rrc_setup_periodic_timer.set(5000, [this](uint32_t tid) { rrc_setup_periodic_timer.set(5000, [this](uint32_t tid) {
send_connection_setup(); send_connection_setup();
rrc_setup_periodic_timer.run(); rrc_setup_periodic_timer.run();

@ -35,12 +35,12 @@ int test_cell_cfg(const srsenb::sched_interface::cell_cfg_t& cellcfg)
*/ */
int test_sib_generation() int test_sib_generation()
{ {
srsran::timer_handler timers_db(128); srsran::task_scheduler task_sched;
mac_dummy mac_obj; mac_dummy mac_obj;
rlc_dummy rlc_obj; rlc_dummy rlc_obj;
pdcp_dummy pdcp_obj; pdcp_dummy pdcp_obj;
rrc_nr rrc_obj(&timers_db); rrc_nr rrc_obj(&task_sched);
// set cfg // set cfg
rrc_nr_cfg_t default_cfg = {}; rrc_nr_cfg_t default_cfg = {};
@ -63,12 +63,12 @@ int test_sib_generation()
int test_rrc_setup() int test_rrc_setup()
{ {
srsran::timer_handler timers_db(128); srsran::task_scheduler task_sched;
mac_dummy mac_obj; mac_dummy mac_obj;
rlc_dummy rlc_obj; rlc_dummy rlc_obj;
pdcp_dummy pdcp_obj; pdcp_dummy pdcp_obj;
rrc_nr rrc_obj(&timers_db); rrc_nr rrc_obj(&task_sched);
// set cfg // set cfg
rrc_nr_cfg_t default_cfg = {}; rrc_nr_cfg_t default_cfg = {};
@ -78,7 +78,7 @@ int test_rrc_setup()
for (uint32_t n = 0; n < 2; ++n) { for (uint32_t n = 0; n < 2; ++n) {
uint32_t timeout = 5500; uint32_t timeout = 5500;
for (uint32_t i = 0; i < timeout and rlc_obj.last_sdu == nullptr; ++i) { for (uint32_t i = 0; i < timeout and rlc_obj.last_sdu == nullptr; ++i) {
timers_db.step_all(); task_sched.tic();
} }
TESTASSERT(rlc_obj.last_sdu != nullptr); TESTASSERT(rlc_obj.last_sdu != nullptr);
} }

Loading…
Cancel
Save