mirror of https://github.com/pvnis/srsRAN_4G.git
enb: refactor L2/L3 and (re)move all NR components to gNB stack
* decouple EUTRA and NR stack classes * implement dummy X2 interface with control and data plane methods * implement eNB time source interface that PHY callsmaster
parent
1e9a4e3fba
commit
3fd47d2af4
@ -0,0 +1,31 @@
|
|||||||
|
/**
|
||||||
|
*
|
||||||
|
* \section COPYRIGHT
|
||||||
|
*
|
||||||
|
* Copyright 2013-2021 Software Radio Systems Limited
|
||||||
|
*
|
||||||
|
* By using this file, you agree to the terms and conditions set
|
||||||
|
* forth in the LICENSE file which can be found at the top level of
|
||||||
|
* the distribution.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef SRSRAN_ENB_TIME_INTERFACE_H
|
||||||
|
#define SRSRAN_ENB_TIME_INTERFACE_H
|
||||||
|
|
||||||
|
namespace srsenb {
|
||||||
|
|
||||||
|
// RAT-agnostic interface to provide timing information to upper layers
|
||||||
|
class enb_time_interface
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
/**
|
||||||
|
* @brief Called for every tick (currently every ms)
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
virtual void tti_clock() = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace srsenb
|
||||||
|
|
||||||
|
#endif // SRSRAN_ENB_TIME_INTERFACE_H
|
@ -0,0 +1,101 @@
|
|||||||
|
/**
|
||||||
|
*
|
||||||
|
* \section COPYRIGHT
|
||||||
|
*
|
||||||
|
* Copyright 2013-2021 Software Radio Systems Limited
|
||||||
|
*
|
||||||
|
* By using this file, you agree to the terms and conditions set
|
||||||
|
* forth in the LICENSE file which can be found at the top level of
|
||||||
|
* the distribution.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "srsran/interfaces/enb_pdcp_interfaces.h"
|
||||||
|
#include "srsran/interfaces/enb_rrc_interface_types.h"
|
||||||
|
|
||||||
|
#ifndef SRSRAN_ENB_X2_INTERFACES_H
|
||||||
|
#define SRSRAN_ENB_X2_INTERFACES_H
|
||||||
|
|
||||||
|
namespace srsenb {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Set of X2AP inspired interfaces to support 5G NSA
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
/// X2AP inspired interface to allow EUTRA RRC to call NR RRC
|
||||||
|
class rrc_nr_interface_rrc
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
struct sgnb_addition_req_params_t {
|
||||||
|
uint32_t eps_bearer_id;
|
||||||
|
// add configuration check
|
||||||
|
// E-RAB Parameters, Tunnel address (IP address, TEID)
|
||||||
|
// QCI, security, etc
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Request addition of NR carrier for UE
|
||||||
|
virtual int sgnb_addition_request(uint16_t eutra_rnti, const sgnb_addition_req_params_t& params) = 0;
|
||||||
|
|
||||||
|
/// Provide information whether the requested configuration was applied successfully by the UE
|
||||||
|
virtual int sgnb_reconfiguration_complete(uint16_t eutra_rnti, asn1::dyn_octstring reconfig_response) = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
/// X2AP inspired interface for response from NR RRC to EUTRA RRC
|
||||||
|
class rrc_eutra_interface_rrc_nr
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
/**
|
||||||
|
* @brief List of parameters included in the SgNB addition Ack message
|
||||||
|
* @param nr_secondary_cell_group_cfg_r15 Encoded part of the RRC Reconfiguration
|
||||||
|
* @param nr_radio_bearer_cfg1_r15 Encoded part of the RRC Reconfiguration
|
||||||
|
* @param eps_bearer_id ID of the transfered bearer
|
||||||
|
*/
|
||||||
|
struct sgnb_addition_ack_params_t {
|
||||||
|
uint16_t nr_rnti = SRSRAN_INVALID_RNTI; // RNTI that was assigned to the UE
|
||||||
|
asn1::dyn_octstring nr_secondary_cell_group_cfg_r15;
|
||||||
|
asn1::dyn_octstring nr_radio_bearer_cfg1_r15;
|
||||||
|
uint32_t eps_bearer_id = 0; // (list of) successfully transfered EPS bearers
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Signal successful addition of UE
|
||||||
|
*
|
||||||
|
* @param eutra_rnti The RNTI that the EUTRA RRC used to request the SgNB addition
|
||||||
|
* @param params Parameter list
|
||||||
|
*/
|
||||||
|
virtual void sgnb_addition_ack(uint16_t eutra_rnti, sgnb_addition_ack_params_t params) = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Signal unsuccessful SgNB addition
|
||||||
|
*
|
||||||
|
* @param eutra_rnti The RNTI that the EUTRA RRC used to request the SgNB addition
|
||||||
|
*/
|
||||||
|
virtual void sgnb_addition_reject(uint16_t eutra_rnti) = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Signal completion of SgNB addition after UE (with new NR identity) has attached
|
||||||
|
*
|
||||||
|
* @param eutra_rnti The RNTI that the EUTRA RRC used to request the SgNB addition
|
||||||
|
* @param nr_rnti The RNTI that has been assigned to the UE on the SgNB
|
||||||
|
*/
|
||||||
|
virtual void sgnb_addition_complete(uint16_t eutra_rnti, uint16_t nr_rnti) = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
class stack_nr_interface_stack_eutra
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
/// Helper method to provide time signal to NR-RRC (PHY only sends TTI ticks to EUTRA stack)
|
||||||
|
virtual void tti_clock() = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
// combined interface used by X2 adapter
|
||||||
|
class x2_interface : public rrc_nr_interface_rrc,
|
||||||
|
public rrc_eutra_interface_rrc_nr,
|
||||||
|
public stack_nr_interface_stack_eutra,
|
||||||
|
public pdcp_interface_gtpu
|
||||||
|
{};
|
||||||
|
|
||||||
|
} // namespace srsenb
|
||||||
|
|
||||||
|
#endif // SRSRAN_ENB_X2_INTERFACES_H
|
@ -0,0 +1,120 @@
|
|||||||
|
/**
|
||||||
|
*
|
||||||
|
* \section COPYRIGHT
|
||||||
|
*
|
||||||
|
* Copyright 2013-2021 Software Radio Systems Limited
|
||||||
|
*
|
||||||
|
* By using this file, you agree to the terms and conditions set
|
||||||
|
* forth in the LICENSE file which can be found at the top level of
|
||||||
|
* the distribution.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Dummy X2AP implementation
|
||||||
|
*
|
||||||
|
* Dummy X2 adapter to facilitate communication between EUTRA RRC and NR RRC
|
||||||
|
* for EN-DC procedures.
|
||||||
|
*
|
||||||
|
* The class uses direct function calls instead of real X2AP ASN1 encoded
|
||||||
|
* messages. It mainly focuses on Sec 9.1.4 of TS 36.423 Rel. 15.11
|
||||||
|
* for E-UTRAN-NR Dual Connectivity Procedures, i.e. SgNB-*
|
||||||
|
*
|
||||||
|
* It furthermore provide an interface for the GTPU adapter to
|
||||||
|
* write DL PDUs, which it then forwards to the NR PDCP.
|
||||||
|
*
|
||||||
|
* It also provides a method to allow the eNB to foward timing
|
||||||
|
* signal, i.e. TTI tics, to the NR stack.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef SRSENB_X2_ADAPTER_H
|
||||||
|
#define SRSENB_X2_ADAPTER_H
|
||||||
|
|
||||||
|
#include "srsran/interfaces/enb_x2_interfaces.h"
|
||||||
|
#include "stack/enb_stack_lte.h"
|
||||||
|
#include "stack/gnb_stack_nr.h"
|
||||||
|
|
||||||
|
namespace srsenb {
|
||||||
|
|
||||||
|
class x2_adapter final : public x2_interface
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
x2_adapter() = default;
|
||||||
|
|
||||||
|
// init functions to set handle to stacks
|
||||||
|
void set_eutra_stack(enb_stack_lte* eutra_stack_) { eutra_stack = eutra_stack_; }
|
||||||
|
|
||||||
|
void set_nr_stack(gnb_stack_nr* nr_stack_) { nr_stack = nr_stack_; }
|
||||||
|
|
||||||
|
/// rrc_nr_interface_rrc
|
||||||
|
int sgnb_addition_request(uint16_t eutra_rnti, const sgnb_addition_req_params_t& params)
|
||||||
|
{
|
||||||
|
if (nr_stack == nullptr) {
|
||||||
|
return SRSRAN_ERROR;
|
||||||
|
}
|
||||||
|
return nr_stack->sgnb_addition_request(eutra_rnti, params);
|
||||||
|
}
|
||||||
|
int sgnb_reconfiguration_complete(uint16_t eutra_rnti, asn1::dyn_octstring reconfig_response)
|
||||||
|
{
|
||||||
|
if (nr_stack == nullptr) {
|
||||||
|
return SRSRAN_ERROR;
|
||||||
|
}
|
||||||
|
return nr_stack->sgnb_reconfiguration_complete(eutra_rnti, reconfig_response);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// rrc_eutra_interface_rrc_nr
|
||||||
|
void sgnb_addition_ack(uint16_t eutra_rnti, sgnb_addition_ack_params_t params)
|
||||||
|
{
|
||||||
|
if (eutra_stack == nullptr) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
eutra_stack->sgnb_addition_ack(eutra_rnti, params);
|
||||||
|
}
|
||||||
|
void sgnb_addition_reject(uint16_t eutra_rnti)
|
||||||
|
{
|
||||||
|
if (eutra_stack == nullptr) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
eutra_stack->sgnb_addition_reject(eutra_rnti);
|
||||||
|
}
|
||||||
|
void sgnb_addition_complete(uint16_t eutra_rnti, uint16_t nr_rnti)
|
||||||
|
{
|
||||||
|
if (eutra_stack == nullptr) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
eutra_stack->sgnb_addition_complete(eutra_rnti, nr_rnti);
|
||||||
|
}
|
||||||
|
|
||||||
|
// stack_nr_interface_stack_eutra
|
||||||
|
void tti_clock()
|
||||||
|
{
|
||||||
|
if (nr_stack == nullptr) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
nr_stack->tti_clock();
|
||||||
|
}
|
||||||
|
|
||||||
|
// pdcp_interface_gtpu
|
||||||
|
void write_sdu(uint16_t rnti, uint32_t lcid, srsran::unique_byte_buffer_t sdu, int pdcp_sn = -1)
|
||||||
|
{
|
||||||
|
if (nr_stack == nullptr) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
nr_stack->write_sdu(rnti, lcid, std::move(sdu), pdcp_sn);
|
||||||
|
}
|
||||||
|
std::map<uint32_t, srsran::unique_byte_buffer_t> get_buffered_pdus(uint16_t rnti, uint32_t lcid)
|
||||||
|
{
|
||||||
|
if (nr_stack == nullptr) {
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
return nr_stack->get_buffered_pdus(rnti, lcid);
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
enb_stack_lte* eutra_stack = nullptr;
|
||||||
|
gnb_stack_nr* nr_stack = nullptr;
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace srsenb
|
||||||
|
|
||||||
|
#endif // SRSENB_X2_ADAPTER_H
|
Loading…
Reference in New Issue