5G-LENA nr-v3.3-159-ga6832aa7
The 5G/NR module for the ns-3 simulator
Loading...
Searching...
No Matches
ns3::NrMacSchedulerUeInfoQos Class Reference

UE representation for a QoS-based scheduler. More...

#include "nr-mac-scheduler-ue-info-qos.h"

+ Inheritance diagram for ns3::NrMacSchedulerUeInfoQos:
+ Collaboration diagram for ns3::NrMacSchedulerUeInfoQos:

Public Member Functions

 NrMacSchedulerUeInfoQos (float alpha, uint16_t rnti, BeamId beamId, const GetRbPerRbgFn &fn)
 NrMacSchedulerUeInfoQos constructor.
 
void CalculatePotentialTPutDl (const NrMacSchedulerNs3::FTResources &assignableInIteration)
 Calculate the Potential throughput for downlink.
 
void CalculatePotentialTPutUl (const NrMacSchedulerNs3::FTResources &assignableInIteration)
 Calculate the Potential throughput for uplink.
 
void ResetDlMetric () override
 Reset the DL avg Th to the last value.
 
void ResetDlSchedInfo () override
 Reset DL QoS scheduler info.
 
void ResetUlMetric () override
 Reset the UL avg Th to the last value.
 
void ResetUlSchedInfo () override
 Reset UL QoS scheduler info.
 
void UpdateDlQosMetric (const NrMacSchedulerNs3::FTResources &totAssigned, double timeWindow)
 Update the QoS metric for downlink.
 
void UpdateUlQosMetric (const NrMacSchedulerNs3::FTResources &totAssigned, double timeWindow)
 Update the QoS metric for uplink.
 
- Public Member Functions inherited from ns3::NrMacSchedulerUeInfo
 NrMacSchedulerUeInfo ()=delete
 Default Constructor (deleted)
 
 NrMacSchedulerUeInfo (uint16_t rnti, BeamId beamId, const GetRbPerRbgFn &fn)
 Create a new UE representation.
 
virtual ~NrMacSchedulerUeInfo ()
 ~NrMacSchedulerUeInfo deconstructor
 
uint8_t GetDlMcs () const
 Get the downlink MCS, given by the wideband CQI, or the sub-band CQIs of the currently allocated RBGs, if available.
 
uint32_t GetTotalDlBuffer () const
 
void ReleaseLC (uint8_t lcid)
 
virtual void UpdateDlMetric ()
 Update DL metrics after resources have been assigned.
 
virtual void UpdateUlMetric ()
 Update UL metrics after resources have been assigned.
 

Static Public Member Functions

static double CalculateDelayBudgetFactor (uint64_t pdb, uint16_t hol)
 This function calculates the Delay Budget Factor for the case of DC-GBR LC. This value will then be used for the calculation of the QoS metric (weight). Notice that in order to avoid the case that a packet has not been dropped when HOL >= PDB, even though it is in this state (currently our code does not implement packet drop by default), we give very high priority to this packet. We do this by considering a very small value for the denominator (i.e. (PDB - HOL) = 0.1).
 
static uint8_t CalculateDlMinPriority (const NrMacSchedulerNs3::UePtrAndBufferReq &ue)
 This function calculates the min Priority for the DL.
 
static double CalculateDlWeight (const NrMacSchedulerNs3::UePtrAndBufferReq &ue)
 comparison function object (i.e. an object that satisfies the requirements of Compare) which returns true if the first argument is less than (i.e. is ordered before) the second.
 
static uint8_t CalculateUlMinPriority (const NrMacSchedulerNs3::UePtrAndBufferReq &ue)
 This function calculates the min Priority for the UL.
 
static bool CompareUeWeightsDl (const NrMacSchedulerNs3::UePtrAndBufferReq &lue, const NrMacSchedulerNs3::UePtrAndBufferReq &rue)
 comparison function object (i.e. an object that satisfies the requirements of Compare) which returns true if the first argument is less than (i.e. is ordered before) the second.
 
static bool CompareUeWeightsUl (const NrMacSchedulerNs3::UePtrAndBufferReq &lue, const NrMacSchedulerNs3::UePtrAndBufferReq &rue)
 comparison function object (i.e. an object that satisfies the requirements of Compare) which returns true if the first argument is less than (i.e. is ordered before) the second.
 
- Static Public Member Functions inherited from ns3::NrMacSchedulerUeInfo
static NrMacHarqVectorGetDlHarqVector (const UePtr &ue)
 GetDlHarqVector.
 
static std::unordered_map< uint8_t, LCGPtr > & GetDlLCG (const UePtr &ue)
 GetDlLCG.
 
static uint8_t & GetDlMcs (const UePtr &ue)
 GetDlMcs.
 
static std::vector< uint16_t > & GetDlRBG (const UePtr &ue)
 GetDlRBG.
 
static std::vector< uint8_t > & GetDlSym (const UePtr &ue)
 GetDlSym.
 
static uint32_t & GetDlTBS (const UePtr &ue)
 GetDlTBS.
 
static NrMacHarqVectorGetUlHarqVector (const UePtr &ue)
 GetUlHarqVector.
 
static std::unordered_map< uint8_t, LCGPtr > & GetUlLCG (const UePtr &ue)
 GetUlLCG.
 
static uint8_t & GetUlMcs (const UePtr &ue)
 GetUlMcs.
 
static std::vector< uint16_t > & GetUlRBG (const UePtr &ue)
 GetUlRBG.
 
static std::vector< uint8_t > & GetUlSym (const UePtr &ue)
 GetUlSym.
 
static uint32_t & GetUlTBS (const UePtr &ue)
 GetUlTBS.
 
static void PrintLcInfo (uint16_t ue, uint8_t lcgId, uint8_t lcId, uint8_t cqi, uint8_t P, uint8_t minP)
 Prints information related to the QCI of a UEs LC.
 

Public Attributes

float m_alpha {0.0}
 PF fairness metric.
 
double m_avgTputDl {0.0}
 Average throughput in downlink during all the slots.
 
double m_avgTputUl {0.0}
 Average throughput in uplink during all the slots.
 
double m_currTputDl {0.0}
 Current slot throughput in downlink.
 
double m_currTputUl {0.0}
 Current slot throughput in uplink.
 
double m_lastAvgTputDl {0.0}
 Last average throughput in downlink.
 
double m_lastAvgTputUl {0.0}
 Last average throughput in uplink.
 
double m_potentialTputDl {0.0}
 
double m_potentialTputUl {0.0}
 
- Public Attributes inherited from ns3::NrMacSchedulerUeInfo
BeamId m_beamId
 Beam ID of the UE (kept updated as much as possible by MAC)
 
Ptr< NrAmcm_dlAmc
 AMC instance of scheduler associated with DL.
 
CqiInfo m_dlCqi
 DL CQI information.
 
NrMacHarqVector m_dlHarq
 HARQ process vector for DL.
 
std::unordered_map< uint8_t, LCGPtrm_dlLCG
 DL LCG.
 
uint8_t m_dlMcs {0}
 DL MCS.
 
uint32_t m_dlMRBRetx {0}
 
Ptr< const ComplexMatrixArray > m_dlPrecMats {nullptr}
 DL Precoding matrices.
 
uint8_t m_dlRank {1}
 DL rank (number of MIMO layers)
 
std::vector< uint16_t > m_dlRBG
 DL Resource Block Group assigned in this slot.
 
std::vector< SbMcsInfom_dlSbMcsInfo
 
std::vector< uint8_t > m_dlSym
 Corresponding symbol of m_dlRBG in this slot.
 
uint32_t m_dlTbSize {0}
 
std::optional< uint8_t > m_fhMaxMcsAssignable
 Maximum DL MCS assignable due to FH limitations.
 
McsCsiSource m_mcsCsiSource
 Source of MCS computation based on CSI feedback.
 
std::vector< uint8_t > m_rbgToSb
 Precomputed RBG to SB mapping.
 
uint16_t m_rnti {0}
 RNTI of the UE.
 
uint32_t m_srsOffset {0}
 SRS offset.
 
uint32_t m_srsPeriodicity {0}
 SRS periodicity.
 
uint8_t m_startMcsDlUe {0}
 Starting DL MCS to be used.
 
Ptr< NrAmcm_ulAmc
 AMC instance of scheduler associated with UL.
 
CqiInfo m_ulCqi
 UL CQI information.
 
NrMacHarqVector m_ulHarq
 HARQ process vector for UL.
 
std::unordered_map< uint8_t, LCGPtrm_ulLCG
 UL LCG.
 
uint8_t m_ulMcs {0}
 UL MCS.
 
uint32_t m_ulMRBRetx {0}
 
Ptr< const ComplexMatrixArray > m_ulPrecMats {nullptr}
 UL Precoding matrices.
 
uint8_t m_ulRank {1}
 UL rank (number of MIMO layers)
 
std::vector< uint16_t > m_ulRBG
 UL Resource Block Group assigned in this slot.
 
std::vector< uint8_t > m_ulSym
 Corresponding symbol of m_ulRBG in this slot.
 
uint32_t m_ulTbSize {0}
 

Additional Inherited Members

- Public Types inherited from ns3::NrMacSchedulerUeInfo
typedef std::function< NrMacHarqVector &(const UePtr &ue)> GetHarqVectorFn
 
typedef std::function< std::unordered_map< uint8_t, LCGPtr > &(const UePtr &ue)> GetLCGFn
 
typedef std::function< uint32_t()> GetRbPerRbgFn
 
enum class  McsCsiSource { AVG_MCS , AVG_SPEC_EFF , AVG_SINR , WIDEBAND_MCS }
 
- Protected Member Functions inherited from ns3::NrMacSchedulerUeInfo
uint32_t GetNumRbPerRbg () const
 Retrieve the number of RB per RBG.
 

Detailed Description

UE representation for a QoS-based scheduler.

The representation stores the current throughput, the average throughput, and the last average throughput, as well as providing comparison functions to sort the UEs in case of a QoS scheduler, according to its QCI and priority.

See also
CompareUeWeightsDl
CompareUeWeightsUl

Definition at line 22 of file nr-mac-scheduler-ue-info-qos.h.

Constructor & Destructor Documentation

◆ NrMacSchedulerUeInfoQos()

ns3::NrMacSchedulerUeInfoQos::NrMacSchedulerUeInfoQos ( float  alpha,
uint16_t  rnti,
BeamId  beamId,
const GetRbPerRbgFn &  fn 
)
inline

NrMacSchedulerUeInfoQos constructor.

Parameters
rntiRNTI of the UE
beamIdBeamId of the UE
fnA function that tells how many RB per RBG

Definition at line 31 of file nr-mac-scheduler-ue-info-qos.h.

Member Function Documentation

◆ CalculateDelayBudgetFactor()

static double ns3::NrMacSchedulerUeInfoQos::CalculateDelayBudgetFactor ( uint64_t  pdb,
uint16_t  hol 
)
inlinestatic

This function calculates the Delay Budget Factor for the case of DC-GBR LC. This value will then be used for the calculation of the QoS metric (weight). Notice that in order to avoid the case that a packet has not been dropped when HOL >= PDB, even though it is in this state (currently our code does not implement packet drop by default), we give very high priority to this packet. We do this by considering a very small value for the denominator (i.e. (PDB - HOL) = 0.1).

Parameters
pdbThe Packet Delay Budget associated to the QCI
holThe HeadOfLine Delay of the transmission queue
Returns
the delayBudgetFactor

Definition at line 198 of file nr-mac-scheduler-ue-info-qos.h.

Referenced by CalculateDlWeight().

+ Here is the caller graph for this function:

◆ CalculateDlMinPriority()

static uint8_t ns3::NrMacSchedulerUeInfoQos::CalculateDlMinPriority ( const NrMacSchedulerNs3::UePtrAndBufferReq ue)
inlinestatic

This function calculates the min Priority for the DL.

Parameters
lueLeft UE
rueRight UE
Returns
true if the Priority of lue is less than the Priority of rue

The ordering is made by considering the minimum Priority among all the Priorities of all the LCs set for this UE. A UE that has a Priority = 5 will always be the first (i.e., has a higher priority) in a QoS scheduler.

Definition at line 252 of file nr-mac-scheduler-ue-info-qos.h.

◆ CalculateDlWeight()

static double ns3::NrMacSchedulerUeInfoQos::CalculateDlWeight ( const NrMacSchedulerNs3::UePtrAndBufferReq ue)
inlinestatic

comparison function object (i.e. an object that satisfies the requirements of Compare) which returns true if the first argument is less than (i.e. is ordered before) the second.

Parameters
lueLeft UE $ qosMetric_{i} = P * std::pow(potentialTPut_{i}, alpha) / std::max (1E-9, m_avgTput_{i})
$

Alpha is a fairness metric. P is the priority associated to the QCI. Please note that the throughput is calculated in bit/symbol.

Definition at line 156 of file nr-mac-scheduler-ue-info-qos.h.

References CalculateDelayBudgetFactor().

Referenced by CompareUeWeightsDl().

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

◆ CalculatePotentialTPutDl()

void ns3::NrMacSchedulerUeInfoQos::CalculatePotentialTPutDl ( const NrMacSchedulerNs3::FTResources assignableInIteration)

◆ CalculatePotentialTPutUl()

void ns3::NrMacSchedulerUeInfoQos::CalculatePotentialTPutUl ( const NrMacSchedulerNs3::FTResources assignableInIteration)

◆ CalculateUlMinPriority()

static uint8_t ns3::NrMacSchedulerUeInfoQos::CalculateUlMinPriority ( const NrMacSchedulerNs3::UePtrAndBufferReq ue)
inlinestatic

This function calculates the min Priority for the UL.

Parameters
lueLeft UE
rueRight UE
Returns
true if the Priority of lue is less than the Priority of rue

The ordering is made by considering the minimum Priority among all the Priorities of all the LCs set for this UE. A UE that has a Priority = 5 will always be the first (i.e., has a higher priority) in a QoS scheduler.

Definition at line 291 of file nr-mac-scheduler-ue-info-qos.h.

Referenced by CompareUeWeightsUl().

+ Here is the caller graph for this function:

◆ CompareUeWeightsDl()

static bool ns3::NrMacSchedulerUeInfoQos::CompareUeWeightsDl ( const NrMacSchedulerNs3::UePtrAndBufferReq lue,
const NrMacSchedulerNs3::UePtrAndBufferReq rue 
)
inlinestatic

comparison function object (i.e. an object that satisfies the requirements of Compare) which returns true if the first argument is less than (i.e. is ordered before) the second.

Parameters
lueLeft UE
rueRight UE
Returns
true if the QoS metric of the left UE is higher than the right UE

The QoS metric is calculated in CalculateDlWeight()

Definition at line 133 of file nr-mac-scheduler-ue-info-qos.h.

References CalculateDlWeight().

Referenced by ns3::NrMacSchedulerOfdmaAi::GetUeCompareDlFn(), ns3::NrMacSchedulerOfdmaQos::GetUeCompareDlFn(), ns3::NrMacSchedulerTdmaAi::GetUeCompareDlFn(), and ns3::NrMacSchedulerTdmaQos::GetUeCompareDlFn().

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

◆ CompareUeWeightsUl()

static bool ns3::NrMacSchedulerUeInfoQos::CompareUeWeightsUl ( const NrMacSchedulerNs3::UePtrAndBufferReq lue,
const NrMacSchedulerNs3::UePtrAndBufferReq rue 
)
inlinestatic

comparison function object (i.e. an object that satisfies the requirements of Compare) which returns true if the first argument is less than (i.e. is ordered before) the second.

Parameters
lueLeft UE
rueRight UE
Returns
true if the QoS metric of the left UE is higher than the right UE

The QoS metric is calculated as following:

$ qosMetric_{i} = P * std::pow(potentialTPut_{i}, alpha) / std::max (1E-9, m_avgTput_{i})
$

Alpha is a fairness metric. P is the priority associated to the QCI. Please note that the throughput is calculated in bit/symbol.

Definition at line 222 of file nr-mac-scheduler-ue-info-qos.h.

References CalculateUlMinPriority().

Referenced by ns3::NrMacSchedulerOfdmaAi::GetUeCompareUlFn(), ns3::NrMacSchedulerOfdmaQos::GetUeCompareUlFn(), ns3::NrMacSchedulerTdmaAi::GetUeCompareUlFn(), and ns3::NrMacSchedulerTdmaQos::GetUeCompareUlFn().

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

◆ ResetDlMetric()

void ns3::NrMacSchedulerUeInfoQos::ResetDlMetric ( )
inlineoverridevirtual

Reset the DL avg Th to the last value.

Reimplemented from ns3::NrMacSchedulerUeInfo.

Definition at line 74 of file nr-mac-scheduler-ue-info-qos.h.

References m_avgTputDl, m_lastAvgTputDl, and ns3::NrMacSchedulerUeInfo::ResetDlMetric().

+ Here is the call graph for this function:

◆ ResetDlSchedInfo()

void ns3::NrMacSchedulerUeInfoQos::ResetDlSchedInfo ( )
inlineoverridevirtual

Reset DL QoS scheduler info.

Set the last average throughput to the current average throughput, and zeroes the average throughput as well as the current throughput.

It calls also NrMacSchedulerUeInfoQos::ResetDlSchedInfo.

Reimplemented from ns3::NrMacSchedulerUeInfo.

Definition at line 45 of file nr-mac-scheduler-ue-info-qos.h.

References m_avgTputDl, m_currTputDl, m_lastAvgTputDl, m_potentialTputDl, and ns3::NrMacSchedulerUeInfo::ResetDlSchedInfo().

Referenced by ns3::NrMacSchedulerUeInfoAi::ResetDlSchedInfo().

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

◆ ResetUlMetric()

void ns3::NrMacSchedulerUeInfoQos::ResetUlMetric ( )
inlineoverridevirtual

Reset the UL avg Th to the last value.

Reimplemented from ns3::NrMacSchedulerUeInfo.

Definition at line 83 of file nr-mac-scheduler-ue-info-qos.h.

References m_avgTputUl, m_lastAvgTputUl, and ns3::NrMacSchedulerUeInfo::ResetUlMetric().

+ Here is the call graph for this function:

◆ ResetUlSchedInfo()

void ns3::NrMacSchedulerUeInfoQos::ResetUlSchedInfo ( )
inlineoverridevirtual

Reset UL QoS scheduler info.

Set the last average throughput to the current average throughput, and zeroes the average throughput as well as the current throughput.

It also calls NrMacSchedulerUeInfoQos::ResetUlSchedInfo.

Reimplemented from ns3::NrMacSchedulerUeInfo.

Definition at line 62 of file nr-mac-scheduler-ue-info-qos.h.

References m_avgTputUl, m_currTputUl, m_lastAvgTputUl, m_potentialTputUl, and ns3::NrMacSchedulerUeInfo::ResetUlSchedInfo().

Referenced by ns3::NrMacSchedulerUeInfoAi::ResetUlSchedInfo().

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

◆ UpdateDlQosMetric()

void ns3::NrMacSchedulerUeInfoQos::UpdateDlQosMetric ( const NrMacSchedulerNs3::FTResources totAssigned,
double  timeWindow 
)

Update the QoS metric for downlink.

Parameters
totAssignedthe resources assigned
timeWindowthe time window

Updates m_currTputDl and m_avgTputDl by keeping in consideration the assigned resources (in form of TBS) and the time window. It gets the tbSize by calling NrMacSchedulerUeInfo::UpdateDlMetric.

Definition at line 15 of file nr-mac-scheduler-ue-info-qos.cc.

References m_avgTputDl, m_currTputDl, ns3::NrMacSchedulerUeInfo::m_dlTbSize, m_lastAvgTputDl, m_potentialTputDl, ns3::NrMacSchedulerUeInfo::m_rnti, ns3::NrMacSchedulerNs3::PointInFTPlane::m_sym, and ns3::NrMacSchedulerUeInfo::UpdateDlMetric().

+ Here is the call graph for this function:

◆ UpdateUlQosMetric()

void ns3::NrMacSchedulerUeInfoQos::UpdateUlQosMetric ( const NrMacSchedulerNs3::FTResources totAssigned,
double  timeWindow 
)

Update the QoS metric for uplink.

Parameters
totAssignedthe resources assigned
timeWindowthe time window

Updates m_currTputUl and m_avgTputUl by keeping in consideration the assigned resources (in form of TBS) and the time window. It gets the tbSize by calling NrMacSchedulerUeInfo::UpdateUlMetric.

Definition at line 34 of file nr-mac-scheduler-ue-info-qos.cc.

References m_avgTputUl, m_currTputUl, m_lastAvgTputUl, m_potentialTputUl, ns3::NrMacSchedulerUeInfo::m_rnti, ns3::NrMacSchedulerNs3::PointInFTPlane::m_sym, ns3::NrMacSchedulerUeInfo::m_ulTbSize, and ns3::NrMacSchedulerUeInfo::UpdateUlMetric().

+ Here is the call graph for this function:

Member Data Documentation

◆ m_alpha

float ns3::NrMacSchedulerUeInfoQos::m_alpha {0.0}

◆ m_avgTputDl

double ns3::NrMacSchedulerUeInfoQos::m_avgTputDl {0.0}

Average throughput in downlink during all the slots.

Definition at line 320 of file nr-mac-scheduler-ue-info-qos.h.

Referenced by CalculatePotentialTPutDl(), ns3::NrMacSchedulerUeInfoAi::GetDlReward(), ResetDlMetric(), ResetDlSchedInfo(), and UpdateDlQosMetric().

◆ m_avgTputUl

double ns3::NrMacSchedulerUeInfoQos::m_avgTputUl {0.0}

Average throughput in uplink during all the slots.

Definition at line 327 of file nr-mac-scheduler-ue-info-qos.h.

Referenced by CalculatePotentialTPutUl(), ns3::NrMacSchedulerUeInfoAi::GetUlReward(), ResetUlMetric(), ResetUlSchedInfo(), and UpdateUlQosMetric().

◆ m_currTputDl

double ns3::NrMacSchedulerUeInfoQos::m_currTputDl {0.0}

Current slot throughput in downlink.

Definition at line 319 of file nr-mac-scheduler-ue-info-qos.h.

Referenced by ResetDlSchedInfo(), and UpdateDlQosMetric().

◆ m_currTputUl

double ns3::NrMacSchedulerUeInfoQos::m_currTputUl {0.0}

Current slot throughput in uplink.

Definition at line 326 of file nr-mac-scheduler-ue-info-qos.h.

Referenced by ResetUlSchedInfo(), and UpdateUlQosMetric().

◆ m_lastAvgTputDl

double ns3::NrMacSchedulerUeInfoQos::m_lastAvgTputDl {0.0}

Last average throughput in downlink.

Definition at line 321 of file nr-mac-scheduler-ue-info-qos.h.

Referenced by CalculatePotentialTPutDl(), ResetDlMetric(), ResetDlSchedInfo(), and UpdateDlQosMetric().

◆ m_lastAvgTputUl

double ns3::NrMacSchedulerUeInfoQos::m_lastAvgTputUl {0.0}

Last average throughput in uplink.

Definition at line 328 of file nr-mac-scheduler-ue-info-qos.h.

Referenced by CalculatePotentialTPutUl(), ResetUlMetric(), ResetUlSchedInfo(), and UpdateUlQosMetric().

◆ m_potentialTputDl

double ns3::NrMacSchedulerUeInfoQos::m_potentialTputDl {0.0}

Potential throughput in downlink in one assignable resource (can be a symbol or a RBG)

Definition at line 322 of file nr-mac-scheduler-ue-info-qos.h.

Referenced by CalculatePotentialTPutDl(), ns3::NrMacSchedulerUeInfoAi::GetDlReward(), ResetDlSchedInfo(), and UpdateDlQosMetric().

◆ m_potentialTputUl

double ns3::NrMacSchedulerUeInfoQos::m_potentialTputUl {0.0}

Potential throughput in uplink in one assignable resource (can be a symbol or a RBG)

Definition at line 329 of file nr-mac-scheduler-ue-info-qos.h.

Referenced by CalculatePotentialTPutUl(), ns3::NrMacSchedulerUeInfoAi::GetUlReward(), ResetUlSchedInfo(), and UpdateUlQosMetric().


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