5G-LENA nr-v3.1-69-g2dd513a7
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. | |
virtual void | DoSlotDlIndication (const SfnSf &sfnSf, LteNrTddSlotType type) |
Perform DL scheduling decision for the indicated slot. | |
virtual void | DoSlotUlIndication (const SfnSf &sfnSf, LteNrTddSlotType type) |
Perform UL scheduling decision for the indicated slot. | |
virtual uint8_t | GetDlCtrlSyms () const |
Retrieve the number of DL ctrl symbols configured in the scheduler. | |
NrGnbCmacSapProvider * | GetGnbCmacSapProvider () |
NrMacSapProvider * | GetMacSapProvider () |
NrCcmMacSapProvider * | GetNrCcmMacSapProvider () |
Get the gNB-ComponentCarrierManager SAP User. | |
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. | |
virtual void | SetCurrentSfn (const SfnSf &sfn) |
Set the current sfn. | |
void | SetForwardUpCallback (Callback< void, Ptr< Packet > > cb) |
void | SetGnbCmacSapUser (NrGnbCmacSapUser *s) |
void | SetNrCcmMacSapUser (NrCcmMacSapUser *s) |
Set the ComponentCarrierManager SAP user. | |
void | SetNrMacCschedSapProvider (NrMacCschedSapProvider *ptr) |
void | SetNrMacSchedSapProvider (NrMacSchedSapProvider *ptr) |
void | SetNumHarqProcess (uint8_t numHarqProcess) |
Sets the number of HARQ processes. | |
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. | |
void | SetPhySapProvider (NrPhySapProvider *ptr) |
Static Public Member Functions | |
static TypeId | GetTypeId () |
Get the TypeId. | |
Protected Member Functions | |
void | DoDispose () override |
DoDispose method inherited from Object. | |
uint16_t | GetBwpId () const |
Get the bwp id of this MAC. | |
uint16_t | GetCellId () const |
Get the cell id of this MAC. | |
std::shared_ptr< DciInfoElementTdma > | GetDlCtrlDci () const |
Get a DCI for the DL CTRL symbol. | |
std::shared_ptr< DciInfoElementTdma > | GetUlCtrlDci () const |
Get a DCI for the UL CTRL symbol. | |
Friends | |
class | GnbMacMemberNrMacSapProvider< NrGnbMac > |
class | MemberNrCcmMacSapProvider< NrGnbMac > |
class | NrGnbMacMemberGnbCmacSapProvider |
class | NrMacGnbMemberPhySapUser |
class | NrMacMemberMacCschedSapUser |
class | NrMacMemberMacSchedSapUser |
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::NrGnbNetDevice/BandwidthPartMap/[i]/NrGnbMac
/NodeList/[i]/DeviceList/[i]/$ns3::NrNetDevice/$ns3::NrGnbNetDevice/BandwidthPartMap/[i]/NrGnbMac
Size of this type is 792 bytes (on a 64-bit architecture).
Definition at line 47 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 Gnb 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 220 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 190 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 206 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 Gnb 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 238 of file nr-gnb-mac.h.
ns3::NrGnbMac::NrGnbMac | ( | ) |
NrGnbMac constructor.
Definition at line 464 of file nr-gnb-mac.cc.
|
override |
~NrGnbMac
Definition at line 476 of file nr-gnb-mac.cc.
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 1365 of file nr-gnb-mac.cc.
References ns3::NrMacCschedSapProvider::CschedUeConfigReqParameters::m_beamId.
|
overrideprotected |
DoDispose method inherited from Object.
Definition at line 481 of file nr-gnb-mac.cc.
|
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 608 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::SchedDlCqiInfoReqParameters::m_sfnsf, ns3::NrMacSchedSapProvider::SchedDlTriggerReqParameters::m_slotType, ns3::NrMacSchedSapProvider::SchedDlTriggerReqParameters::m_snfSf, 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 726 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 1376 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 1389 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 1402 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 548 of file nr-gnb-mac.cc.
References ns3::NrMacSchedSapProvider::GetDlCtrlSyms().
NrGnbCmacSapProvider * ns3::NrGnbMac::GetGnbCmacSapProvider | ( | ) |
Definition at line 576 of file nr-gnb-mac.cc.
NrMacSapProvider * ns3::NrGnbMac::GetMacSapProvider | ( | ) |
Definition at line 570 of file nr-gnb-mac.cc.
NrCcmMacSapProvider * ns3::NrGnbMac::GetNrCcmMacSapProvider | ( | ) |
Get the gNB-ComponentCarrierManager SAP User.
Definition at line 594 of file nr-gnb-mac.cc.
NrMacCschedSapUser * ns3::NrGnbMac::GetNrMacCschedSapUser | ( | ) |
Definition at line 970 of file nr-gnb-mac.cc.
NrMacSchedSapUser * ns3::NrGnbMac::GetNrMacSchedSapUser | ( | ) |
Definition at line 958 of file nr-gnb-mac.cc.
uint8_t ns3::NrGnbMac::GetNumHarqProcess | ( | ) | const |
Definition at line 542 of file nr-gnb-mac.cc.
uint32_t ns3::NrGnbMac::GetNumRbPerRbg | ( | ) | const |
Definition at line 527 of file nr-gnb-mac.cc.
Referenced by GetDlCtrlDci().
NrGnbPhySapUser * ns3::NrGnbMac::GetPhySapUser | ( | ) |
Definition at line 946 of file nr-gnb-mac.cc.
|
static |
Get the TypeId.
Definition at line 396 of file nr-gnb-mac.cc.
Referenced by ns3::NrHelper::NrHelper().
|
protected |
Get a DCI for the UL CTRL symbol.
Definition at line 1418 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 554 of file nr-gnb-mac.cc.
References ns3::NrMacSchedSapProvider::GetUlCtrlSyms().
|
virtual |
void ns3::NrGnbMac::SetForwardUpCallback | ( | Callback< void, Ptr< Packet > > | cb | ) |
Definition at line 799 of file nr-gnb-mac.cc.
void ns3::NrGnbMac::SetGnbCmacSapUser | ( | NrGnbCmacSapUser * | s | ) |
Definition at line 582 of file nr-gnb-mac.cc.
void ns3::NrGnbMac::SetNrCcmMacSapUser | ( | NrCcmMacSapUser * | s | ) |
Set the ComponentCarrierManager SAP user.
s | a pointer to the ComponentCarrierManager provider |
Definition at line 588 of file nr-gnb-mac.cc.
void ns3::NrGnbMac::SetNrMacCschedSapProvider | ( | NrMacCschedSapProvider * | ptr | ) |
Definition at line 976 of file nr-gnb-mac.cc.
void ns3::NrGnbMac::SetNrMacSchedSapProvider | ( | NrMacSchedSapProvider * | ptr | ) |
Definition at line 964 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 533 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 520 of file nr-gnb-mac.cc.
void ns3::NrGnbMac::SetPhySapProvider | ( | NrPhySapProvider * | ptr | ) |
Definition at line 952 of file nr-gnb-mac.cc.
|
friend |
Definition at line 52 of file nr-gnb-mac.h.
|
friend |
Definition at line 52 of file nr-gnb-mac.h.
|
friend |
Definition at line 49 of file nr-gnb-mac.h.
|
friend |
Definition at line 50 of file nr-gnb-mac.h.
|
friend |
Definition at line 51 of file nr-gnb-mac.h.
|
friend |
Definition at line 52 of file nr-gnb-mac.h.