5G-LENA nr-v3.0-32-g83aee33
The 5G/NR module for the ns-3 simulator
Loading...
Searching...
No Matches
ns3::NrAmc Class Reference

Adaptive Modulation and Coding class for the NR module. More...

#include "nr-amc.h"

+ Inheritance diagram for ns3::NrAmc:
+ Collaboration diagram for ns3::NrAmc:

Classes

struct  McsParams
 Parameters related to MCS selection. More...
 

Public Types

enum  AmcModel { ShannonModel , ErrorModel }
 Valid types of the model used to create a cqi feedback. More...
 

Public Member Functions

 NrAmc ()
 NrAmc constructor.
 
 ~NrAmc () override
 ~NrAmc deconstructor
 
uint32_t CalculateTbSize (uint8_t mcs, uint8_t rank, uint32_t nprb) const
 Calculate the TransportBlock size (in bytes) giving the MCS and the number of RB assigned.
 
uint8_t CreateCqiFeedbackWbTdma (const SpectrumValue &sinr, uint8_t &mcsWb) const
 Create a CQI/MCS wideband feedback from a SINR values.
 
AmcModel GetAmcModel () const
 Get the AMC model type.
 
uint8_t GetCqiFromSpectralEfficiency (double s) const
 Get CQI from a SpectralEfficiency value.
 
TypeId GetErrorModelType () const
 Get the error model type.
 
TypeId GetInstanceTypeId () const override
 GetInstanceTypeId.
 
uint32_t GetMaxMcs () const
 Get the maximum MCS (depends on the underlying error model)
 
McsParams GetMaxMcsParams (const NrSinrMatrix &sinrMat, size_t subbandSize) const
 Find maximum MCS supported for this channel and obtain related parameters.
 
uint8_t GetMcsFromCqi (uint8_t cqi) const
 Get the MCS value from a CQI value.
 
uint8_t GetMcsFromSpectralEfficiency (double s) const
 Get MCS from a SpectralEfficiency value.
 
uint8_t GetNumRefScPerRb () const
 
uint32_t GetPayloadSize (uint8_t mcs, uint8_t rank, uint32_t nprb) const
 Calculate the Payload Size (in bytes) from MCS and the number of RB.
 
void SetAmcModel (AmcModel m)
 Set the AMC model type.
 
void SetDlMode ()
 Set the object to be in "DL" mode.
 
void SetErrorModelType (const TypeId &type)
 Set Error model type.
 
void SetNumRefScPerRb (uint8_t nref)
 Set the the number of subcarriers carrying reference signals per resource block.
 
void SetUlMode ()
 Set the object to be in "UL" mode.
 

Static Public Member Functions

static TypeId GetTypeId ()
 GetTypeId.
 

Static Public Attributes

static constexpr size_t NR_AMC_NUM_SYMBOLS_DEFAULT = 12
 Num OFDM syms for TB size.
 

Detailed Description

Adaptive Modulation and Coding class for the NR module.

The class has two option to calculate the CQI feedback (which is the MCS to use in the future transmissions): the "ShannonModel" or the "ErrorModel" model, which uses the output of an error model to find the optimal MCS.

Please note that it is necessary, even when using the ShannonModel, to correctly configure the ErrorModel type, which must be the same as the one set in the NrSpectrumPhy class.

Configuration

The attributes of this class can be configured through the helper methods NrHelper::SetGnbDlAmcAttribute() and NrHelper::SetGnbUlAmcAttribute() for what regards the GNB side (DL or UL). It is important to note that the UE gets a pointer to the GNB AMC to which is connected to.

Todo:
Pass NrAmc parameters through RRC, and don't pass pointers to AMC between GNB and UE

Introspection did not find any typical Config paths.

Attributes

  • NumRefScPerRb: Number of Subcarriers carrying Reference Signals per RB
    • Set with class: ns3::UintegerValue
    • Underlying type: uint8_t 0:12
    • Initial value: 1
    • Flags: construct write read
  • AmcModel: AMC model used to assign CQI
    • Set with class: ns3::EnumValue
    • Underlying type:
    • Initial value: ErrorModel
    • Flags: construct write read
  • ErrorModelType: Type of the Error Model to use when AmcModel is set to ErrorModel. This parameter has to match the ErrorModelType in nr-spectrum-model,because they need to refer to same MCS tables and indexes
    • Set with class: TypeIdValue
    • Underlying type: TypeId
    • Initial value: ns3::NrLteMiErrorModel
    • Flags: construct write read

No TraceSources are defined for this type.
Size of this type is 48 bytes (on a 64-bit architecture).

Definition at line 38 of file nr-amc.h.

Member Enumeration Documentation

◆ AmcModel

Valid types of the model used to create a cqi feedback.

See also
CreateCqiFeedbackWbTdma
Enumerator
ShannonModel 

Shannon based model (very conservative)

ErrorModel 

Error Model version (can use different error models, see NrErrorModel)

Definition at line 86 of file nr-amc.h.

Constructor & Destructor Documentation

◆ NrAmc()

ns3::NrAmc::NrAmc ( )

NrAmc constructor.

Definition at line 27 of file nr-amc.cc.

◆ ~NrAmc()

ns3::NrAmc::~NrAmc ( )
override

~NrAmc deconstructor

Definition at line 32 of file nr-amc.cc.

Member Function Documentation

◆ CalculateTbSize()

uint32_t ns3::NrAmc::CalculateTbSize ( uint8_t  mcs,
uint8_t  rank,
uint32_t  nprb 
) const

Calculate the TransportBlock size (in bytes) giving the MCS and the number of RB assigned.

It depends on the error model and the "mode" configured with SetMode(). Please note that this function expects in input the RB, not the RBG of the transmission.

Parameters
mcsthe MCS of the transmission
rankthe MIMO rank
nprbThe number of physical resource blocks used in the transmission
Returns
the TBS in bytes

Definition at line 121 of file nr-amc.cc.

References GetMaxMcs(), GetPayloadSize(), and ns3::LenaErrorModel::GetTypeId().

Referenced by CreateCqiFeedbackWbTdma().

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

◆ CreateCqiFeedbackWbTdma()

uint8_t ns3::NrAmc::CreateCqiFeedbackWbTdma ( const SpectrumValue &  sinr,
uint8_t &  mcsWb 
) const

Create a CQI/MCS wideband feedback from a SINR values.

For CQI creation, a CSI reference resource equal to all RBs in which the gNB/UE has transmitted power, and from which the SINR can be measured, during 1 OFDM symbol, is assumed.

Parameters
sinrthe sinr values
mcsWbThe calculated MCS
Returns
The calculated CQI

Definition at line 168 of file nr-amc.cc.

References CalculateTbSize(), ErrorModel, GetCqiFromSpectralEfficiency(), GetMaxMcs(), GetMcsFromSpectralEfficiency(), and ShannonModel.

+ Here is the call graph for this function:

◆ GetAmcModel()

NrAmc::AmcModel ns3::NrAmc::GetAmcModel ( ) const

Get the AMC model type.

Returns
the AMC model type

Definition at line 323 of file nr-amc.cc.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

◆ GetCqiFromSpectralEfficiency()

uint8_t ns3::NrAmc::GetCqiFromSpectralEfficiency ( double  s) const

Get CQI from a SpectralEfficiency value.

Parameters
sspectral efficiency
Returns
the CQI (depends on the Error Model)

Definition at line 280 of file nr-amc.cc.

Referenced by CreateCqiFeedbackWbTdma().

+ Here is the caller graph for this function:

◆ GetErrorModelType()

TypeId ns3::NrAmc::GetErrorModelType ( ) const

Get the error model type.

Returns
the error model type

Definition at line 342 of file nr-amc.cc.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

◆ GetInstanceTypeId()

TypeId ns3::NrAmc::GetInstanceTypeId ( ) const
override

GetInstanceTypeId.

Returns
the instance typeid

Definition at line 81 of file nr-amc.cc.

References GetTypeId().

+ Here is the call graph for this function:

◆ GetMaxMcs()

uint32_t ns3::NrAmc::GetMaxMcs ( ) const

Get the maximum MCS (depends on the underlying error model)

Returns
the maximum MCS

Definition at line 309 of file nr-amc.cc.

Referenced by CalculateTbSize(), CreateCqiFeedbackWbTdma(), GetMcsFromCqi(), and GetMcsFromSpectralEfficiency().

+ Here is the caller graph for this function:

◆ GetMaxMcsParams()

NrAmc::McsParams ns3::NrAmc::GetMaxMcsParams ( const NrSinrMatrix sinrMat,
size_t  subbandSize 
) const

Find maximum MCS supported for this channel and obtain related parameters.

Parameters
sinrMatthe MIMO SINR matrix (rank * nRbs)
subbandSizethe size of each subband, used to create subband CQI values
Returns
a struct with the optimal MCS and corresponding CQI and TB size

Definition at line 364 of file nr-amc.cc.

References ErrorModel, and ShannonModel.

◆ GetMcsFromCqi()

uint8_t ns3::NrAmc::GetMcsFromCqi ( uint8_t  cqi) const

Get the MCS value from a CQI value.

Parameters
cqithe CQI
Returns
the MCS that corresponds to that CQI (it depends on the error model)

Definition at line 87 of file nr-amc.cc.

References GetMaxMcs().

+ Here is the call graph for this function:

◆ GetMcsFromSpectralEfficiency()

uint8_t ns3::NrAmc::GetMcsFromSpectralEfficiency ( double  s) const

Get MCS from a SpectralEfficiency value.

Parameters
sspectral efficiency
Returns
the MCS (depends on the Error Model)

Definition at line 294 of file nr-amc.cc.

References GetMaxMcs().

Referenced by CreateCqiFeedbackWbTdma().

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

◆ GetNumRefScPerRb()

uint8_t ns3::NrAmc::GetNumRefScPerRb ( ) const
Returns
The number of reference subcarriers per resource block

Definition at line 107 of file nr-amc.cc.

Referenced by GetPayloadSize(), and GetTypeId().

+ Here is the caller graph for this function:

◆ GetPayloadSize()

uint32_t ns3::NrAmc::GetPayloadSize ( uint8_t  mcs,
uint8_t  rank,
uint32_t  nprb 
) const

Calculate the Payload Size (in bytes) from MCS and the number of RB.

Parameters
mcsMCS of the transmission
rankthe MIMO rank
nprbNumber of Physical Resource Blocks (not RBG)
Returns
the payload size in bytes

Definition at line 157 of file nr-amc.cc.

References GetNumRefScPerRb(), and ns3::NrSpectrumValueHelper::SUBCARRIERS_PER_RB.

Referenced by CalculateTbSize().

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

◆ GetTypeId()

TypeId ns3::NrAmc::GetTypeId ( )
static

GetTypeId.

Returns
the TypeId of the Object

Definition at line 51 of file nr-amc.cc.

References ErrorModel, GetAmcModel(), GetErrorModelType(), GetNumRefScPerRb(), ns3::NrLteMiErrorModel::GetTypeId(), SetAmcModel(), SetErrorModelType(), SetNumRefScPerRb(), and ShannonModel.

Referenced by ns3::NrHelper::NrHelper(), and GetInstanceTypeId().

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

◆ SetAmcModel()

void ns3::NrAmc::SetAmcModel ( NrAmc::AmcModel  m)

Set the AMC model type.

Parameters
mthe AMC model

Definition at line 316 of file nr-amc.cc.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

◆ SetDlMode()

void ns3::NrAmc::SetDlMode ( )

Set the object to be in "DL" mode.

In this mode, all the requests made to the underlying error model will be done keeping in consideration that the requests refers to DL transmissions.

Definition at line 37 of file nr-amc.cc.

References ns3::NrErrorModel::DL.

◆ SetErrorModelType()

void ns3::NrAmc::SetErrorModelType ( const TypeId &  type)

Set Error model type.

Parameters
typethe Error model type

Definition at line 330 of file nr-amc.cc.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

◆ SetNumRefScPerRb()

void ns3::NrAmc::SetNumRefScPerRb ( uint8_t  nref)

Set the the number of subcarriers carrying reference signals per resource block.

By default it is fixed at 1. For LTE, it should be 4.

Parameters
nrefthe number of reference subcarriers

Definition at line 114 of file nr-amc.cc.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

◆ SetUlMode()

void ns3::NrAmc::SetUlMode ( )

Set the object to be in "UL" mode.

In this mode, all the requests made to the underlying error model will be done keeping in consideration that the requests refers to UL transmissions.

Definition at line 44 of file nr-amc.cc.

References ns3::NrErrorModel::UL.

Member Data Documentation

◆ NR_AMC_NUM_SYMBOLS_DEFAULT

constexpr size_t ns3::NrAmc::NR_AMC_NUM_SYMBOLS_DEFAULT = 12
staticconstexpr

Num OFDM syms for TB size.

Definition at line 192 of file nr-amc.h.


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