5G-LENA nr-v3.3-49-g235218b1
The 5G/NR module for the ns-3 simulator
|
Adaptive Modulation and Coding class for the NR module. More...
#include "nr-amc.h"
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. | |
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.
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.
ns3::NrAmc is accessible through the following paths with Config::Set and Config::Connect:
/NodeList/[i]/DeviceList/[i]/$ns3::NrGnbNetDevice/BandwidthPartMap/[i]/MacScheduler/$ns3::NrMacSchedulerNs3/DlAmc
/NodeList/[i]/DeviceList/[i]/$ns3::NrGnbNetDevice/BandwidthPartMap/[i]/MacScheduler/$ns3::NrMacSchedulerNs3/UlAmc
/NodeList/[i]/DeviceList/[i]/$ns3::NrNetDevice/$ns3::NrGnbNetDevice/BandwidthPartMap/[i]/MacScheduler/$ns3::NrMacSchedulerNs3/DlAmc
/NodeList/[i]/DeviceList/[i]/$ns3::NrNetDevice/$ns3::NrGnbNetDevice/BandwidthPartMap/[i]/MacScheduler/$ns3::NrMacSchedulerNs3/UlAmc
No TraceSources are defined for this type.
Size of this type is 72 bytes (on a 64-bit architecture).
enum ns3::NrAmc::AmcModel |
Valid types of the model used to create a cqi feedback.
Enumerator | |
---|---|
ShannonModel | Shannon based model (very conservative) |
ErrorModel | Error Model version (can use different error models, see NrErrorModel) |
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.
mcs | the MCS of the transmission |
rank | the MIMO rank |
nprb | The number of physical resource blocks used in the transmission |
Definition at line 119 of file nr-amc.cc.
References GetMaxMcs(), GetPayloadSize(), and ns3::LenaErrorModel::GetTypeId().
Referenced by 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.
sinr | the sinr values |
mcsWb | The calculated MCS |
Definition at line 166 of file nr-amc.cc.
References CalculateTbSize(), ErrorModel, GetCqiFromSpectralEfficiency(), GetMaxMcs(), GetMcsFromSpectralEfficiency(), and ShannonModel.
NrAmc::AmcModel ns3::NrAmc::GetAmcModel | ( | ) | const |
Get the AMC model type.
Definition at line 321 of file nr-amc.cc.
Referenced by GetTypeId().
uint8_t ns3::NrAmc::GetCqiFromSpectralEfficiency | ( | double | s | ) | const |
Get CQI from a SpectralEfficiency value.
s | spectral efficiency |
Definition at line 278 of file nr-amc.cc.
Referenced by CreateCqiFeedbackWbTdma().
TypeId ns3::NrAmc::GetErrorModelType | ( | ) | const |
Get the error model type.
Definition at line 340 of file nr-amc.cc.
Referenced by GetTypeId().
|
override |
GetInstanceTypeId.
Definition at line 79 of file nr-amc.cc.
References GetTypeId().
uint32_t ns3::NrAmc::GetMaxMcs | ( | ) | const |
Get the maximum MCS (depends on the underlying error model)
Definition at line 307 of file nr-amc.cc.
Referenced by CalculateTbSize(), CreateCqiFeedbackWbTdma(), GetMcsFromCqi(), and GetMcsFromSpectralEfficiency().
NrAmc::McsParams ns3::NrAmc::GetMaxMcsParams | ( | const NrSinrMatrix & | sinrMat, |
size_t | subbandSize | ||
) | const |
Find maximum MCS supported for this channel and obtain related parameters.
sinrMat | the MIMO SINR matrix (rank * nRbs) |
subbandSize | the size of each subband, used to create subband CQI values |
Definition at line 362 of file nr-amc.cc.
References ErrorModel, and ShannonModel.
uint8_t ns3::NrAmc::GetMcsFromCqi | ( | uint8_t | cqi | ) | const |
Get the MCS value from a CQI value.
cqi | the CQI |
Definition at line 85 of file nr-amc.cc.
References GetMaxMcs().
uint8_t ns3::NrAmc::GetMcsFromSpectralEfficiency | ( | double | s | ) | const |
Get MCS from a SpectralEfficiency value.
s | spectral efficiency |
Definition at line 292 of file nr-amc.cc.
References GetMaxMcs().
Referenced by CreateCqiFeedbackWbTdma().
uint8_t ns3::NrAmc::GetNumRefScPerRb | ( | ) | const |
Definition at line 105 of file nr-amc.cc.
Referenced by GetPayloadSize(), and GetTypeId().
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.
mcs | MCS of the transmission |
rank | the MIMO rank |
nprb | Number of Physical Resource Blocks (not RBG) |
Definition at line 155 of file nr-amc.cc.
References GetNumRefScPerRb(), and ns3::NrSpectrumValueHelper::SUBCARRIERS_PER_RB.
Referenced by CalculateTbSize().
|
static |
GetTypeId.
Definition at line 49 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().
void ns3::NrAmc::SetAmcModel | ( | NrAmc::AmcModel | m | ) |
Set the AMC model type.
m | the AMC model |
Definition at line 314 of file nr-amc.cc.
Referenced by GetTypeId().
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 35 of file nr-amc.cc.
References ns3::NrErrorModel::DL.
void ns3::NrAmc::SetErrorModelType | ( | const TypeId & | type | ) |
Set Error model type.
type | the Error model type |
Definition at line 328 of file nr-amc.cc.
Referenced by GetTypeId().
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.
nref | the number of reference subcarriers |
Definition at line 112 of file nr-amc.cc.
Referenced by GetTypeId().
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 42 of file nr-amc.cc.
References ns3::NrErrorModel::UL.
|
staticconstexpr |