5G-LENA
nr-v3.0-29-g83cc959
The 5G/NR module for the ns-3 simulator
|
The MAC class for the gnb. More...
#include "nr-gnb-mac.h"
Public Types | |
typedef void(* | RxedGnbMacCtrlMsgsTracedCallback) (const SfnSf sfn, const uint16_t nodeId, const uint16_t rnti, const uint8_t bwpId, Ptr< NrControlMessage >) |
typedef void(* | SchedulingTracedCallback) (uint32_t frameNum, uint32_t subframeNum, uint32_t slotNum, uint8_t symStart, uint8_t numSym, uint32_t tbSize, uint32_t mcs, uint32_t rnti, uint8_t bwpId) |
typedef void(* | SrTracedCallback) (const uint8_t bwpId, const uint16_t rnti) |
typedef void(* | TxedGnbMacCtrlMsgsTracedCallback) (const SfnSf sfn, const uint16_t nodeId, const uint16_t rnti, const uint8_t bwpId, Ptr< NrControlMessage >) |
Public Member Functions | |
NrGnbMac () | |
NrGnbMac constructor. | |
~NrGnbMac () override | |
~NrGnbMac | |
void | BeamChangeReport (BeamId beamId, uint8_t rnti) |
A Beam for a user has changed. More... | |
virtual void | DoSlotDlIndication (const SfnSf &sfnSf, LteNrTddSlotType type) |
Perform DL scheduling decision for the indicated slot. More... | |
virtual void | DoSlotUlIndication (const SfnSf &sfnSf, LteNrTddSlotType type) |
Perform UL scheduling decision for the indicated slot. More... | |
virtual uint8_t | GetDlCtrlSyms () const |
Retrieve the number of DL ctrl symbols configured in the scheduler. More... | |
LteEnbCmacSapProvider * | GetEnbCmacSapProvider () |
LteCcmMacSapProvider * | GetLteCcmMacSapProvider () |
Get the gNB-ComponentCarrierManager SAP User. More... | |
LteMacSapProvider * | GetMacSapProvider () |
NrMacCschedSapUser * | GetNrMacCschedSapUser () |
NrMacSchedSapUser * | GetNrMacSchedSapUser () |
uint8_t | GetNumHarqProcess () const |
uint32_t | GetNumRbPerRbg () const |
NrGnbPhySapUser * | GetPhySapUser () |
virtual uint8_t | GetUlCtrlSyms () const |
Retrieve the number of UL ctrl symbols configured in the scheduler. More... | |
virtual void | SetCurrentSfn (const SfnSf &sfn) |
Set the current sfn. More... | |
void | SetEnbCmacSapUser (LteEnbCmacSapUser *s) |
void | SetForwardUpCallback (Callback< void, Ptr< Packet >> cb) |
void | SetLteCcmMacSapUser (LteCcmMacSapUser *s) |
Set the ComponentCarrierManager SAP user. More... | |
void | SetNrMacCschedSapProvider (NrMacCschedSapProvider *ptr) |
void | SetNrMacSchedSapProvider (NrMacSchedSapProvider *ptr) |
void | SetNumHarqProcess (uint8_t numHarqProcess) |
Sets the number of HARQ processes. More... | |
void | SetNumRbPerRbg (uint32_t rbgSize) |
Sets the number of RBs per RBG. Currently it can be configured by the user, while in the future it will be configured by the RRC based on the type of configuration and the bandwidth. More... | |
void | SetPhySapProvider (NrPhySapProvider *ptr) |
Static Public Member Functions | |
static TypeId | GetTypeId () |
Get the TypeId. More... | |
Protected Member Functions | |
void | DoDispose () override |
DoDispose method inherited from Object. | |
uint16_t | GetBwpId () const |
Get the bwp id of this MAC. More... | |
uint16_t | GetCellId () const |
Get the cell id of this MAC. More... | |
std::shared_ptr< DciInfoElementTdma > | GetDlCtrlDci () const |
Get a DCI for the DL CTRL symbol. More... | |
std::shared_ptr< DciInfoElementTdma > | GetUlCtrlDci () const |
Get a DCI for the UL CTRL symbol. More... | |
The MAC class for the gnb.
The user can configure the class using the method NrHelper::SetGnbMacAttribute(), or by directly calling SetAttribute
on the MAC pointer. The list of attributes is reported below, in the Attributes section.
The class has two attributes that signals to the eventual listener the transmission or the reception of CTRL messages. One is GnbMacRxedCtrlMsgsTrace, and the other is GnbMacTxedCtrlMsgsTrace. For what regards the UE, you will find more information in the NrUePhy class documentation.
ns3::NrGnbMac is accessible through the following paths with Config::Set and Config::Connect:
/NodeList/[i]/DeviceList/[i]/$ns3::NrNetDevice/$ns3::NrGnbNetDevice/BandwidthPartMap/[i]/NrGnbMac
/NodeList/[i]/DeviceList/[i]/$ns3::NrGnbNetDevice/BandwidthPartMap/[i]/NrGnbMac
Size of this type is 656 bytes (on a 64-bit architecture).
Definition at line 49 of file nr-gnb-mac.h.
typedef void(* ns3::NrGnbMac::RxedGnbMacCtrlMsgsTracedCallback) (const SfnSf sfn, const uint16_t nodeId, const uint16_t rnti, const uint8_t bwpId, Ptr< NrControlMessage >) |
TracedCallback signature for Enb Mac Received Control Messages.
[in] | frame | Frame number. |
[in] | subframe | Subframe number. |
[in] | slot | number. |
[in] | VarTti | |
[in] | nodeId | |
[in] | rnti | |
[in] | bwpId | |
[in] | pointer | to msg to get the msg type |
Definition at line 222 of file nr-gnb-mac.h.
typedef void(* ns3::NrGnbMac::SchedulingTracedCallback) (uint32_t frameNum, uint32_t subframeNum, uint32_t slotNum, uint8_t symStart, uint8_t numSym, uint32_t tbSize, uint32_t mcs, uint32_t rnti, uint8_t bwpId) |
TracedCallback signature for DL and UL data scheduling events.
[in] | frame | Frame number |
[in] | subframe | Subframe number |
[in] | slotNum | Slot number |
[in] | symStart | Symbol start |
[in] | numSym | Number of symbols |
[in] | tbSize | The TB size |
[in] | mcs | MCS |
[in] | rnti | RNTI |
[in] | bwpId | BandWidth Part id ... |
Definition at line 192 of file nr-gnb-mac.h.
typedef void(* ns3::NrGnbMac::SrTracedCallback) (const uint8_t bwpId, const uint16_t rnti) |
TracedCallback signature for SR scheduling events.
[in] | rnti | The C-RNTI identifying the UE. |
[in] | bwpId | The component carrier ID of this MAC. |
Definition at line 208 of file nr-gnb-mac.h.
typedef void(* ns3::NrGnbMac::TxedGnbMacCtrlMsgsTracedCallback) (const SfnSf sfn, const uint16_t nodeId, const uint16_t rnti, const uint8_t bwpId, Ptr< NrControlMessage >) |
TracedCallback signature for Enb Mac Transmitted Control Messages.
[in] | frame | Frame number. |
[in] | subframe | Subframe number. |
[in] | slot | number. |
[in] | VarTti | |
[in] | nodeId | |
[in] | rnti | |
[in] | bwpId | |
[in] | pointer | to msg to get the msg type |
Definition at line 240 of file nr-gnb-mac.h.
void ns3::NrGnbMac::BeamChangeReport | ( | BeamId | beamId, |
uint8_t | rnti | ||
) |
A Beam for a user has changed.
beamId | new beam ID |
rnti | RNTI of the user |
Definition at line 1255 of file nr-gnb-mac.cc.
References ns3::NrMacCschedSapProvider::CschedUeConfigReqParameters::m_beamId.
|
virtual |
Perform DL scheduling decision for the indicated slot.
sfnSf | the slot to fill with scheduling decisions |
type | TDD slot type |
The MAC should perform its operations (including the scheduler) for DL. Please note that what is decided in this slot will reach the air later (depending on the L1L2CTRL latency parameter).
Definition at line 558 of file nr-gnb-mac.cc.
References ns3::NrPhySapProvider::GetBeamId(), GetBwpId(), GetCellId(), ns3::NrMacCschedSapProvider::CschedUeConfigReqParameters::m_beamId, ns3::NrMacSchedSapProvider::SchedDlCqiInfoReqParameters::m_cqiList, ns3::NrMacSchedSapProvider::SchedDlTriggerReqParameters::m_dlHarqInfoList, ns3::NrMacSchedSapProvider::SchedDlRachInfoReqParameters::m_rachList, ns3::NrMacSchedSapProvider::SchedDlCqiInfoReqParameters::m_sfnsf, ns3::NrMacSchedSapProvider::SchedDlTriggerReqParameters::m_slotType, ns3::NrMacSchedSapProvider::SchedDlTriggerReqParameters::m_snfSf, ns3::NrMacSchedSapProvider::SchedDlRachInfoReq(), and ns3::NrMacSchedSapProvider::SchedDlTriggerReq().
|
virtual |
Perform UL scheduling decision for the indicated slot.
sfnSf | the slot to fill with scheduling decisions |
type | TDD slot type |
The MAC should perform its operations (including the scheduler) for UL. Please note that what is decided in this slot will reach the air later (depending on the L1L2CTRL latency and the UL Sched delay (K2) parameters).
Definition at line 644 of file nr-gnb-mac.cc.
References GetBwpId(), GetCellId(), ns3::NrMacSchedSapProvider::SchedUlMacCtrlInfoReqParameters::m_macCeList, ns3::NrMacSchedSapProvider::SchedUlMacCtrlInfoReqParameters::m_sfnSf, ns3::NrMacSchedSapProvider::SchedUlTriggerReqParameters::m_slotType, ns3::NrMacSchedSapProvider::SchedUlTriggerReqParameters::m_snfSf, ns3::NrMacSchedSapProvider::SchedUlSrInfoReqParameters::m_snfSf, ns3::NrMacSchedSapProvider::SchedUlSrInfoReqParameters::m_srList, ns3::NrMacSchedSapProvider::SchedUlTriggerReqParameters::m_ulHarqInfoList, ns3::NrMacSchedSapProvider::SchedUlSrInfoReq(), and ns3::NrMacSchedSapProvider::SchedUlTriggerReq().
|
protected |
Get the bwp id of this MAC.
Definition at line 1266 of file nr-gnb-mac.cc.
References ns3::NrPhySapProvider::GetBwpId().
Referenced by DoSlotDlIndication(), and DoSlotUlIndication().
|
protected |
Get the cell id of this MAC.
Definition at line 1279 of file nr-gnb-mac.cc.
References ns3::NrPhySapProvider::GetCellId().
Referenced by DoSlotDlIndication(), and DoSlotUlIndication().
|
protected |
Get a DCI for the DL CTRL symbol.
Definition at line 1292 of file nr-gnb-mac.cc.
References ns3::DciInfoElementTdma::CTRL, ns3::DciInfoElementTdma::DL, ns3::NrMacSchedSapProvider::GetDlCtrlSyms(), GetNumRbPerRbg(), and ns3::NrPhySapProvider::GetRbNum().
|
virtual |
Retrieve the number of DL ctrl symbols configured in the scheduler.
Definition at line 498 of file nr-gnb-mac.cc.
References ns3::NrMacSchedSapProvider::GetDlCtrlSyms().
LteCcmMacSapProvider * ns3::NrGnbMac::GetLteCcmMacSapProvider | ( | ) |
Get the gNB-ComponentCarrierManager SAP User.
Definition at line 544 of file nr-gnb-mac.cc.
uint8_t ns3::NrGnbMac::GetNumHarqProcess | ( | ) | const |
Definition at line 492 of file nr-gnb-mac.cc.
uint32_t ns3::NrGnbMac::GetNumRbPerRbg | ( | ) | const |
Definition at line 477 of file nr-gnb-mac.cc.
Referenced by GetDlCtrlDci().
|
static |
Get the TypeId.
Definition at line 391 of file nr-gnb-mac.cc.
Referenced by ns3::NrHelper::NrHelper().
|
protected |
Get a DCI for the UL CTRL symbol.
Definition at line 1308 of file nr-gnb-mac.cc.
References ns3::DciInfoElementTdma::CTRL, ns3::NrMacSchedSapProvider::GetUlCtrlSyms(), and ns3::DciInfoElementTdma::UL.
|
virtual |
Retrieve the number of UL ctrl symbols configured in the scheduler.
Definition at line 504 of file nr-gnb-mac.cc.
References ns3::NrMacSchedSapProvider::GetUlCtrlSyms().
|
virtual |
void ns3::NrGnbMac::SetLteCcmMacSapUser | ( | LteCcmMacSapUser * | s | ) |
Set the ComponentCarrierManager SAP user.
s | a pointer to the ComponentCarrierManager provider |
Definition at line 538 of file nr-gnb-mac.cc.
void ns3::NrGnbMac::SetNumHarqProcess | ( | uint8_t | numHarqProcess | ) |
Sets the number of HARQ processes.
numHarqProcess | the maximum number of harq processes |
Definition at line 483 of file nr-gnb-mac.cc.
void ns3::NrGnbMac::SetNumRbPerRbg | ( | uint32_t | rbgSize | ) |
Sets the number of RBs per RBG. Currently it can be configured by the user, while in the future it will be configured by the RRC based on the type of configuration and the bandwidth.
rbgSize | Number of RBs per RBG |
Definition at line 470 of file nr-gnb-mac.cc.