5G-LENA nr-v3.1-69-g2dd513a7
The 5G/NR module for the ns-3 simulator
Loading...
Searching...
No Matches
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.
 
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.
 
NrGnbCmacSapProviderGetGnbCmacSapProvider ()
 
NrMacSapProviderGetMacSapProvider ()
 
NrCcmMacSapProviderGetNrCcmMacSapProvider ()
 Get the gNB-ComponentCarrierManager SAP User.
 
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.
 
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< DciInfoElementTdmaGetDlCtrlDci () const
 Get a DCI for the DL CTRL symbol.
 
std::shared_ptr< DciInfoElementTdmaGetUlCtrlDci () const
 Get a DCI for the UL CTRL symbol.
 

Friends

class GnbMacMemberNrMacSapProvider< NrGnbMac >
 
class MemberNrCcmMacSapProvider< NrGnbMac >
 
class NrGnbMacMemberGnbCmacSapProvider
 
class NrMacGnbMemberPhySapUser
 
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:

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: 16
    • Flags: construct write read
  • NumberOfRaPreambles: How many random access preambles are available for the contention based RACH process
    • Set with class: ns3::UintegerValue
    • Underlying type: uint8_t 4:64
    • Initial value: 52
    • Flags: construct write
  • PreambleTransMax: Maximum number of random access preamble transmissions
    • Set with class: ns3::UintegerValue
    • Underlying type: uint8_t 3:200
    • Initial value: 50
    • Flags: construct write
  • RaResponseWindowSize: Length of the window for the reception of the random access response (RAR); the resulting RAR timeout is this value + 5 ms
    • Set with class: ns3::UintegerValue
    • Underlying type: uint8_t 2:10
    • Initial value: 3
    • Flags: construct write
  • ConnEstFailCount: How many time T300 timer can expire on the same cell
    • Set with class: ns3::UintegerValue
    • Underlying type: uint8_t 1:4
    • Initial value: 1
    • Flags: construct write

TraceSources

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

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

Definition at line 47 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 Gnb 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 220 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 190 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 206 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 Gnb 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 238 of file nr-gnb-mac.h.

Constructor & Destructor Documentation

◆ NrGnbMac()

ns3::NrGnbMac::NrGnbMac ( )

NrGnbMac constructor.

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

◆ ~NrGnbMac()

ns3::NrGnbMac::~NrGnbMac ( )
override

~NrGnbMac

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

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 1365 of file nr-gnb-mac.cc.

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

◆ DoDispose()

void ns3::NrGnbMac::DoDispose ( )
overrideprotected

DoDispose method inherited from Object.

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

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

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

+ 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 1376 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 1389 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 1402 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 548 of file nr-gnb-mac.cc.

References ns3::NrMacSchedSapProvider::GetDlCtrlSyms().

+ Here is the call graph for this function:

◆ GetGnbCmacSapProvider()

NrGnbCmacSapProvider * ns3::NrGnbMac::GetGnbCmacSapProvider ( )

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

◆ GetMacSapProvider()

NrMacSapProvider * ns3::NrGnbMac::GetMacSapProvider ( )

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

◆ GetNrCcmMacSapProvider()

NrCcmMacSapProvider * ns3::NrGnbMac::GetNrCcmMacSapProvider ( )

Get the gNB-ComponentCarrierManager SAP User.

Returns
a pointer to the SAP User of the ComponentCarrierManager

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

◆ GetNrMacCschedSapUser()

NrMacCschedSapUser * ns3::NrGnbMac::GetNrMacCschedSapUser ( )

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

◆ GetNrMacSchedSapUser()

NrMacSchedSapUser * ns3::NrGnbMac::GetNrMacSchedSapUser ( )

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

◆ GetNumHarqProcess()

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

Definition at line 542 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 527 of file nr-gnb-mac.cc.

Referenced by GetDlCtrlDci().

+ Here is the caller graph for this function:

◆ GetPhySapUser()

NrGnbPhySapUser * ns3::NrGnbMac::GetPhySapUser ( )

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

◆ GetTypeId()

TypeId ns3::NrGnbMac::GetTypeId ( )
static

Get the TypeId.

Returns
the TypeId

Definition at line 396 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 1418 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 554 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 601 of file nr-gnb-mac.cc.

◆ SetForwardUpCallback()

void ns3::NrGnbMac::SetForwardUpCallback ( Callback< void, Ptr< Packet > >  cb)

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

◆ SetGnbCmacSapUser()

void ns3::NrGnbMac::SetGnbCmacSapUser ( NrGnbCmacSapUser s)

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

◆ SetNrCcmMacSapUser()

void ns3::NrGnbMac::SetNrCcmMacSapUser ( NrCcmMacSapUser s)

Set the ComponentCarrierManager SAP user.

Parameters
sa pointer to the ComponentCarrierManager provider

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

◆ SetNrMacCschedSapProvider()

void ns3::NrGnbMac::SetNrMacCschedSapProvider ( NrMacCschedSapProvider ptr)

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

◆ SetNrMacSchedSapProvider()

void ns3::NrGnbMac::SetNrMacSchedSapProvider ( NrMacSchedSapProvider ptr)

Definition at line 964 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 533 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 520 of file nr-gnb-mac.cc.

◆ SetPhySapProvider()

void ns3::NrGnbMac::SetPhySapProvider ( NrPhySapProvider ptr)

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

Friends And Related Symbol Documentation

◆ GnbMacMemberNrMacSapProvider< NrGnbMac >

friend class GnbMacMemberNrMacSapProvider< NrGnbMac >
friend

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

◆ MemberNrCcmMacSapProvider< NrGnbMac >

friend class MemberNrCcmMacSapProvider< NrGnbMac >
friend

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

◆ NrGnbMacMemberGnbCmacSapProvider

friend class NrGnbMacMemberGnbCmacSapProvider
friend

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

◆ NrMacGnbMemberPhySapUser

friend class NrMacGnbMemberPhySapUser
friend

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

◆ NrMacMemberMacCschedSapUser

friend class NrMacMemberMacCschedSapUser
friend

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

◆ NrMacMemberMacSchedSapUser

friend class NrMacMemberMacSchedSapUser
friend

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


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