5G-LENA  nr-v3.0-29-g83cc959
The 5G/NR module for the ns-3 simulator
ns3::NrGnbMac Class Reference

The MAC class for the gnb. More...

#include "nr-gnb-mac.h"

+ Inheritance diagram for ns3::NrGnbMac:
+ Collaboration diagram for ns3::NrGnbMac:

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 ()
 
NrMacCschedSapUserGetNrMacCschedSapUser ()
 
NrMacSchedSapUserGetNrMacSchedSapUser ()
 
uint8_t GetNumHarqProcess () const
 
uint32_t GetNumRbPerRbg () const
 
NrGnbPhySapUserGetPhySapUser ()
 
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< DciInfoElementTdmaGetDlCtrlDci () const
 Get a DCI for the DL CTRL symbol. More...
 
std::shared_ptr< DciInfoElementTdmaGetUlCtrlDci () const
 Get a DCI for the UL CTRL symbol. More...
 

Friends

class EnbMacMemberLteMacSapProvider< NrGnbMac >
 
class MemberLteCcmMacSapProvider< NrGnbMac >
 
class NrGnbMacMemberEnbCmacSapProvider
 
class NrMacEnbMemberPhySapUser
 
class NrMacMemberMacCschedSapUser
 
class NrMacMemberMacSchedSapUser
 

Detailed Description

The MAC class for the gnb.

General information

Todo:
fill gnb-mac general information doxygen part

Configuration

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.

CTRL Traces for CTRL messages

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.

Config Paths

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

Attributes

  • NumRbPerRbg: Number of resource blocks per resource block group.
    • Set with class: ns3::UintegerValue
    • Underlying type: uint32_t 0:4294967295
    • Initial value: 1
    • Flags: construct write read
  • NumHarqProcess: Number of concurrent stop-and-wait Hybrid ARQ processes per user
    • Set with class: ns3::UintegerValue
    • Underlying type: uint8_t 0:255
    • Initial value: 20
    • Flags: construct write read

TraceSources

  • DlScheduling: Information regarding DL scheduling.
    Callback signature: ns3::LteGnbMac::DlSchedulingTracedCallback
  • SrReq: Information regarding received scheduling request.
    Callback signature: ns3::NrGnbMac::SrTracedCallback
  • GnbMacRxedCtrlMsgsTrace: Enb MAC Rxed Control Messages Traces.
    Callback signature: ns3::NrMacRxTrace::RxedGnbMacCtrlMsgsTracedCallback
  • GnbMacTxedCtrlMsgsTrace: Enb MAC Txed Control Messages Traces.
    Callback signature: ns3::NrMacRxTrace::TxedGnbMacCtrlMsgsTracedCallback
  • DlHarqFeedback: Harq feedback.
    Callback signature: ns3::NrGnbMac::DlHarqFeedbackTracedCallback

Size of this type is 656 bytes (on a 64-bit architecture).

Definition at line 49 of file nr-gnb-mac.h.

Member Typedef Documentation

◆ RxedGnbMacCtrlMsgsTracedCallback

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.

Parameters
[in]frameFrame number.
[in]subframeSubframe number.
[in]slotnumber.
[in]VarTti
[in]nodeId
[in]rnti
[in]bwpId
[in]pointerto msg to get the msg type

Definition at line 222 of file nr-gnb-mac.h.

◆ SchedulingTracedCallback

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.

Parameters
[in]frameFrame number
[in]subframeSubframe number
[in]slotNumSlot number
[in]symStartSymbol start
[in]numSymNumber of symbols
[in]tbSizeThe TB size
[in]mcsMCS
[in]rntiRNTI
[in]bwpIdBandWidth Part id ...

Definition at line 192 of file nr-gnb-mac.h.

◆ SrTracedCallback

typedef void(* ns3::NrGnbMac::SrTracedCallback) (const uint8_t bwpId, const uint16_t rnti)

TracedCallback signature for SR scheduling events.

Parameters
[in]rntiThe C-RNTI identifying the UE.
[in]bwpIdThe component carrier ID of this MAC.

Definition at line 208 of file nr-gnb-mac.h.

◆ TxedGnbMacCtrlMsgsTracedCallback

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.

Parameters
[in]frameFrame number.
[in]subframeSubframe number.
[in]slotnumber.
[in]VarTti
[in]nodeId
[in]rnti
[in]bwpId
[in]pointerto msg to get the msg type

Definition at line 240 of file nr-gnb-mac.h.

Member Function Documentation

◆ BeamChangeReport()

void ns3::NrGnbMac::BeamChangeReport ( BeamId  beamId,
uint8_t  rnti 
)

A Beam for a user has changed.

Parameters
beamIdnew beam ID
rntiRNTI of the user

Definition at line 1255 of file nr-gnb-mac.cc.

References ns3::NrMacCschedSapProvider::CschedUeConfigReqParameters::m_beamId.

◆ DoSlotDlIndication()

void ns3::NrGnbMac::DoSlotDlIndication ( const SfnSf sfnSf,
LteNrTddSlotType  type 
)
virtual

Perform DL scheduling decision for the indicated slot.

Parameters
sfnSfthe slot to fill with scheduling decisions
typeTDD 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().

+ Here is the call graph for this function:

◆ DoSlotUlIndication()

void ns3::NrGnbMac::DoSlotUlIndication ( const SfnSf sfnSf,
LteNrTddSlotType  type 
)
virtual

Perform UL scheduling decision for the indicated slot.

Parameters
sfnSfthe slot to fill with scheduling decisions
typeTDD 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().

+ Here is the call graph for this function:

◆ GetBwpId()

uint16_t ns3::NrGnbMac::GetBwpId ( ) const
protected

Get the bwp id of this MAC.

Returns
the bwp id

Definition at line 1266 of file nr-gnb-mac.cc.

References ns3::NrPhySapProvider::GetBwpId().

Referenced by DoSlotDlIndication(), and DoSlotUlIndication().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetCellId()

uint16_t ns3::NrGnbMac::GetCellId ( ) const
protected

Get the cell id of this MAC.

Returns
the cell id

Definition at line 1279 of file nr-gnb-mac.cc.

References ns3::NrPhySapProvider::GetCellId().

Referenced by DoSlotDlIndication(), and DoSlotUlIndication().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetDlCtrlDci()

std::shared_ptr< DciInfoElementTdma > ns3::NrGnbMac::GetDlCtrlDci ( ) const
protected

Get a DCI for the DL CTRL symbol.

Returns
a DL CTRL allocation

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().

+ Here is the call graph for this function:

◆ GetDlCtrlSyms()

uint8_t ns3::NrGnbMac::GetDlCtrlSyms ( ) const
virtual

Retrieve the number of DL ctrl symbols configured in the scheduler.

Returns
the number of DL ctrl symbols

Definition at line 498 of file nr-gnb-mac.cc.

References ns3::NrMacSchedSapProvider::GetDlCtrlSyms().

+ Here is the call graph for this function:

◆ GetLteCcmMacSapProvider()

LteCcmMacSapProvider * ns3::NrGnbMac::GetLteCcmMacSapProvider ( )

Get the gNB-ComponentCarrierManager SAP User.

Returns
a pointer to the SAP User of the ComponentCarrierManager

Definition at line 544 of file nr-gnb-mac.cc.

◆ GetNumHarqProcess()

uint8_t ns3::NrGnbMac::GetNumHarqProcess ( ) const
Returns
number of HARQ processes

Definition at line 492 of file nr-gnb-mac.cc.

◆ GetNumRbPerRbg()

uint32_t ns3::NrGnbMac::GetNumRbPerRbg ( ) const
Returns
The number of resource blocks per resource block group. This function will be called through SAP interfaces by PHY and scheduler, to obtain this information from MAC. Note that this functions can be named without "Do" prefix, since it does not change the state of the object and can be exposed to everyone, not only through SAP.

Definition at line 477 of file nr-gnb-mac.cc.

Referenced by GetDlCtrlDci().

+ Here is the caller graph for this function:

◆ GetTypeId()

TypeId ns3::NrGnbMac::GetTypeId ( )
static

Get the TypeId.

Returns
the TypeId

Definition at line 391 of file nr-gnb-mac.cc.

Referenced by ns3::NrHelper::NrHelper().

+ Here is the caller graph for this function:

◆ GetUlCtrlDci()

std::shared_ptr< DciInfoElementTdma > ns3::NrGnbMac::GetUlCtrlDci ( ) const
protected

Get a DCI for the UL CTRL symbol.

Returns
a UL CTRL allocation

Definition at line 1308 of file nr-gnb-mac.cc.

References ns3::DciInfoElementTdma::CTRL, ns3::NrMacSchedSapProvider::GetUlCtrlSyms(), and ns3::DciInfoElementTdma::UL.

+ Here is the call graph for this function:

◆ GetUlCtrlSyms()

uint8_t ns3::NrGnbMac::GetUlCtrlSyms ( ) const
virtual

Retrieve the number of UL ctrl symbols configured in the scheduler.

Returns
the number of UL ctrl symbols

Definition at line 504 of file nr-gnb-mac.cc.

References ns3::NrMacSchedSapProvider::GetUlCtrlSyms().

+ Here is the call graph for this function:

◆ SetCurrentSfn()

void ns3::NrGnbMac::SetCurrentSfn ( const SfnSf sfn)
virtual

Set the current sfn.

Parameters
sfnCurrent sfn

Definition at line 551 of file nr-gnb-mac.cc.

◆ SetLteCcmMacSapUser()

void ns3::NrGnbMac::SetLteCcmMacSapUser ( LteCcmMacSapUser *  s)

Set the ComponentCarrierManager SAP user.

Parameters
sa pointer to the ComponentCarrierManager provider

Definition at line 538 of file nr-gnb-mac.cc.

◆ SetNumHarqProcess()

void ns3::NrGnbMac::SetNumHarqProcess ( uint8_t  numHarqProcess)

Sets the number of HARQ processes.

Parameters
numHarqProcessthe maximum number of harq processes

Definition at line 483 of file nr-gnb-mac.cc.

◆ SetNumRbPerRbg()

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.

Parameters
rbgSizeNumber of RBs per RBG

Definition at line 470 of file nr-gnb-mac.cc.


The documentation for this class was generated from the following files: