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

Schedule the HARQ retransmission. More...

#include "nr-mac-scheduler-harq-rr.h"

Public Types

using Ns3Sched = NrMacSchedulerNs3
 

Public Member Functions

 NrMacSchedulerHarqRr ()
 NrMacSchedulerHarqRr constructor.
 
virtual ~NrMacSchedulerHarqRr ()=default
 Default deconstructor.
 
void InstallDoesFhAllocationFitFn (const std::function< bool(uint16_t bwpId, uint32_t mcs, uint32_t nRegs, uint8_t dlRank)> &fn)
 Install a function to retrieve whether the allocation fits when FH Control is enabled.
 
void InstallGetBwInRBG (const std::function< uint16_t()> &fn)
 Install a function to retrieve the bandwidth in RBG.
 
void InstallGetBwpIdFn (const std::function< uint16_t()> &fn)
 Install a function to retrieve the bwp id.
 
void InstallGetCellIdFn (const std::function< uint16_t()> &fn)
 Install a function to retrieve the cell id.
 
void InstallGetFhControlMethodFn (const std::function< uint8_t()> &fn)
 Install a function to retrieve the FH Control Method (when enabled)
 
virtual uint8_t ScheduleDlHarq (NrMacSchedulerNs3::PointInFTPlane *startingPoint, uint8_t symAvail, const NrMacSchedulerNs3::ActiveHarqMap &activeDlHarq, const std::unordered_map< uint16_t, std::shared_ptr< NrMacSchedulerUeInfo > > &ueMap, std::vector< DlHarqInfo > *dlHarqToRetransmit, const std::vector< DlHarqInfo > &dlHarqFeedback, SlotAllocInfo *slotAlloc) const
 Schedule DL HARQ in RR fashion.
 
virtual uint8_t ScheduleUlHarq (NrMacSchedulerNs3::PointInFTPlane *startingPoint, uint8_t symAvail, const std::unordered_map< uint16_t, std::shared_ptr< NrMacSchedulerUeInfo > > &ueMap, std::vector< UlHarqInfo > *ulHarqToRetransmit, const std::vector< UlHarqInfo > &ulHarqFeedback, SlotAllocInfo *slotAlloc) const
 Schedule the UL HARQ.
 
virtual void SortDlHarq (NrMacSchedulerNs3::ActiveHarqMap *activeDlHarq) const
 Sort Dl Harq retx based on their symbol requirement.
 
virtual void SortUlHarq (NrMacSchedulerNs3::ActiveHarqMap *activeUlHarq) const
 (In theory) sort UL HARQ retx
 

Protected Member Functions

void BufferHARQFeedback (const std::vector< DlHarqInfo > &dlHarqFeedback, std::vector< DlHarqInfo > *dlHarqToRetransmit, uint16_t rnti, uint8_t harqProcess) const
 Find the specified HARQ process and buffer it into a vector.
 
uint16_t GetBandwidthInRbg () const
 Get the bandwidth in RBG.
 
uint16_t GetBwpId () const
 Get the bwp id of this MAC.
 
uint16_t GetCellId () const
 Get the cell id of this MAC.
 
bool GetDoesFhAllocationFit (uint16_t bwpId, uint32_t mcs, uint32_t nRegs, uint8_t dlRank) const
 Get from sched if the allocation fits when FH Control is enabled.
 
uint8_t GetFromSchedFhControlMethod () const
 Get the FH Control method.
 

Detailed Description

Schedule the HARQ retransmission.

The class manages, in a round-robin fashion, the retransmission to be performed. It implements ScheduleDlHarq and ScheduleUlHarq that has the same signature of the methods in NrMacSchedulerNs3. For the details about the HARQ scheduling, please refer to the method documentation.

Definition at line 23 of file nr-mac-scheduler-harq-rr.h.

Member Typedef Documentation

◆ Ns3Sched

Constructor & Destructor Documentation

◆ NrMacSchedulerHarqRr()

ns3::NrMacSchedulerHarqRr::NrMacSchedulerHarqRr ( )

NrMacSchedulerHarqRr constructor.

Definition at line 23 of file nr-mac-scheduler-harq-rr.cc.

Member Function Documentation

◆ BufferHARQFeedback()

void ns3::NrMacSchedulerHarqRr::BufferHARQFeedback ( const std::vector< DlHarqInfo > &  dlHarqFeedback,
std::vector< DlHarqInfo > *  dlHarqToRetransmit,
uint16_t  rnti,
uint8_t  harqProcess 
) const
protected

Find the specified HARQ process and buffer it into a vector.

Parameters
dlHarqFeedbackHARQ not retransmitted list
dlHarqToRetransmitHARQ buffer list (to retransmit)
rntiRNTI to find
harqProcessprocess ID to find

Definition at line 399 of file nr-mac-scheduler-harq-rr.cc.

Referenced by ScheduleDlHarq().

+ Here is the caller graph for this function:

◆ GetBandwidthInRbg()

uint16_t ns3::NrMacSchedulerHarqRr::GetBandwidthInRbg ( ) const
protected

Get the bandwidth in RBG.

Returns
the BW in RBG

Definition at line 432 of file nr-mac-scheduler-harq-rr.cc.

Referenced by ScheduleDlHarq(), and ScheduleUlHarq().

+ Here is the caller graph for this function:

◆ GetBwpId()

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

Get the bwp id of this MAC.

Returns
the bwp id

Definition at line 420 of file nr-mac-scheduler-harq-rr.cc.

Referenced by ScheduleDlHarq().

+ Here is the caller graph for this function:

◆ GetCellId()

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

Get the cell id of this MAC.

Returns
the cell id

Definition at line 426 of file nr-mac-scheduler-harq-rr.cc.

◆ GetDoesFhAllocationFit()

bool ns3::NrMacSchedulerHarqRr::GetDoesFhAllocationFit ( uint16_t  bwpId,
uint32_t  mcs,
uint32_t  nRegs,
uint8_t  dlRank 
) const
protected

Get from sched if the allocation fits when FH Control is enabled.

Returns
whether the allocation fits

Definition at line 444 of file nr-mac-scheduler-harq-rr.cc.

Referenced by ScheduleDlHarq().

+ Here is the caller graph for this function:

◆ GetFromSchedFhControlMethod()

uint8_t ns3::NrMacSchedulerHarqRr::GetFromSchedFhControlMethod ( ) const
protected

Get the FH Control method.

Returns
the FH Control Method (uint8_t)

Definition at line 438 of file nr-mac-scheduler-harq-rr.cc.

Referenced by ScheduleDlHarq().

+ Here is the caller graph for this function:

◆ InstallDoesFhAllocationFitFn()

void ns3::NrMacSchedulerHarqRr::InstallDoesFhAllocationFitFn ( const std::function< bool(uint16_t bwpId, uint32_t mcs, uint32_t nRegs, uint8_t dlRank)> &  fn)

Install a function to retrieve whether the allocation fits when FH Control is enabled.

Parameters
fnthe function

Definition at line 52 of file nr-mac-scheduler-harq-rr.cc.

◆ InstallGetBwInRBG()

void ns3::NrMacSchedulerHarqRr::InstallGetBwInRBG ( const std::function< uint16_t()> &  fn)

Install a function to retrieve the bandwidth in RBG.

Parameters
fn

Definition at line 40 of file nr-mac-scheduler-harq-rr.cc.

◆ InstallGetBwpIdFn()

void ns3::NrMacSchedulerHarqRr::InstallGetBwpIdFn ( const std::function< uint16_t()> &  fn)

Install a function to retrieve the bwp id.

Parameters
fnthe function

Definition at line 28 of file nr-mac-scheduler-harq-rr.cc.

◆ InstallGetCellIdFn()

void ns3::NrMacSchedulerHarqRr::InstallGetCellIdFn ( const std::function< uint16_t()> &  fn)

Install a function to retrieve the cell id.

Parameters
fnthe function

Definition at line 34 of file nr-mac-scheduler-harq-rr.cc.

◆ InstallGetFhControlMethodFn()

void ns3::NrMacSchedulerHarqRr::InstallGetFhControlMethodFn ( const std::function< uint8_t()> &  fn)

Install a function to retrieve the FH Control Method (when enabled)

Parameters
fn

Definition at line 46 of file nr-mac-scheduler-harq-rr.cc.

◆ ScheduleDlHarq()

uint8_t ns3::NrMacSchedulerHarqRr::ScheduleDlHarq ( NrMacSchedulerNs3::PointInFTPlane startingPoint,
uint8_t  symAvail,
const NrMacSchedulerNs3::ActiveHarqMap activeDlHarq,
const std::unordered_map< uint16_t, std::shared_ptr< NrMacSchedulerUeInfo > > &  ueMap,
std::vector< DlHarqInfo > *  dlHarqToRetransmit,
const std::vector< DlHarqInfo > &  dlHarqFeedback,
SlotAllocInfo slotAlloc 
) const
virtual

Schedule DL HARQ in RR fashion.

Parameters
startingPointstarting point of the first retransmission.
symAvailAvailable symbols
activeDlHarqMap of the active HARQ processes
ueMapMap of the UEs
dlHarqToRetransmitHARQ feedbacks that could not be transmitted (to fill)
dlHarqFeedbackall the HARQ feedbacks
slotAllocSlot allocation info
Returns
the VarTtiSlotAlloc ID to use next

The algorithm is a bit complex, but nothing special. The HARQ should be placed in 2D space as they were before. Probably there is an error in the algorithm.

Definition at line 73 of file nr-mac-scheduler-harq-rr.cc.

References BufferHARQFeedback(), ns3::DciInfoElementTdma::DATA, ns3::DciInfoElementTdma::DL, GetBandwidthInRbg(), GetBwpId(), GetDoesFhAllocationFit(), GetFromSchedFhControlMethod(), ns3::HarqProcess::m_dciElement, ns3::SlotAllocInfo::m_numSymAlloc, ns3::NrMacSchedulerNs3::PointInFTPlane::m_rbg, ns3::HarqProcess::m_rlcPduInfo, ns3::HarqProcess::m_status, ns3::NrMacSchedulerNs3::PointInFTPlane::m_sym, ns3::HarqProcess::m_timer, ns3::SlotAllocInfo::m_varTtiAllocInfo, ns3::NrFhControl::OptimizeMcs, ns3::NrFhControl::OptimizeRBs, ns3::NrFhControl::Postponing, ns3::HarqProcess::RECEIVED_FEEDBACK, and ns3::HarqProcess::WAITING_FEEDBACK.

+ Here is the call graph for this function:

◆ ScheduleUlHarq()

uint8_t ns3::NrMacSchedulerHarqRr::ScheduleUlHarq ( NrMacSchedulerNs3::PointInFTPlane startingPoint,
uint8_t  symAvail,
const std::unordered_map< uint16_t, std::shared_ptr< NrMacSchedulerUeInfo > > &  ueMap,
std::vector< UlHarqInfo > *  ulHarqToRetransmit,
const std::vector< UlHarqInfo > &  ulHarqFeedback,
SlotAllocInfo slotAlloc 
) const
virtual

Schedule the UL HARQ.

Parameters
startingPointstarting point of the first retransmission. It should be set to the next available starting point
symAvailAvailable symbols
ueMapMap of the UEs
ulHarqToRetransmitHARQ feedbacks that could not be transmitted (to fill)
ulHarqFeedbackall the HARQ feedbacks
slotAllocSlot allocation info
Returns
the VarTtiSlotAlloc ID to use next

The algorithm for scheduling the UL HARQ is straightforward. Since the UL transmission are all TDMA, for each NACKed process a DCI is built, with the exact same specification as the first transmission. If there aren't available symbols to retransmit the data, the feedback is buffered for the next slot.

Definition at line 262 of file nr-mac-scheduler-harq-rr.cc.

References ns3::DciInfoElementTdma::DATA, GetBandwidthInRbg(), ns3::UlHarqInfo::IsReceivedOk(), ns3::HarqProcess::m_dciElement, ns3::HarqInfo::m_harqProcessId, ns3::SlotAllocInfo::m_numSymAlloc, ns3::NrMacSchedulerNs3::PointInFTPlane::m_rbg, ns3::HarqInfo::m_rnti, ns3::HarqProcess::m_status, ns3::NrMacSchedulerNs3::PointInFTPlane::m_sym, ns3::HarqProcess::m_timer, ns3::SlotAllocInfo::m_varTtiAllocInfo, ns3::HarqProcess::RECEIVED_FEEDBACK, ns3::DciInfoElementTdma::UL, and ns3::HarqProcess::WAITING_FEEDBACK.

+ Here is the call graph for this function:

◆ SortDlHarq()

void ns3::NrMacSchedulerHarqRr::SortDlHarq ( NrMacSchedulerNs3::ActiveHarqMap activeDlHarq) const
virtual

Sort Dl Harq retx based on their symbol requirement.

Parameters
activeDlHarqmap of the active retx

Definition at line 355 of file nr-mac-scheduler-harq-rr.cc.

◆ SortUlHarq()

void ns3::NrMacSchedulerHarqRr::SortUlHarq ( NrMacSchedulerNs3::ActiveHarqMap activeUlHarq) const
virtual

(In theory) sort UL HARQ retx

Parameters
activeUlHarqmap of the active retx

Since in the uplink we are still TDMA, there is no need of sorting the HARQ. The HARQ will be picked one by one until there are no available symbol to transmit, and what is not transmitted will be queued for the next slot.

Definition at line 385 of file nr-mac-scheduler-harq-rr.cc.


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