![]() |
5G-LENA nr-v3.3-81-g75c7590d
The 5G/NR module for the ns-3 simulator
|
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. | |
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.
Definition at line 26 of file nr-mac-scheduler-harq-rr.h.
ns3::NrMacSchedulerHarqRr::NrMacSchedulerHarqRr | ( | ) |
NrMacSchedulerHarqRr constructor.
Definition at line 23 of file nr-mac-scheduler-harq-rr.cc.
|
protected |
Find the specified HARQ process and buffer it into a vector.
dlHarqFeedback | HARQ not retransmitted list |
dlHarqToRetransmit | HARQ buffer list (to retransmit) |
rnti | RNTI to find |
harqProcess | process ID to find |
Definition at line 399 of file nr-mac-scheduler-harq-rr.cc.
Referenced by ScheduleDlHarq().
|
protected |
Get the bandwidth in RBG.
Definition at line 432 of file nr-mac-scheduler-harq-rr.cc.
Referenced by ScheduleDlHarq(), and ScheduleUlHarq().
|
protected |
Get the bwp id of this MAC.
Definition at line 420 of file nr-mac-scheduler-harq-rr.cc.
Referenced by ScheduleDlHarq().
|
protected |
Get the cell id of this MAC.
Definition at line 426 of file nr-mac-scheduler-harq-rr.cc.
|
protected |
Get from sched if the allocation fits when FH Control is enabled.
Definition at line 444 of file nr-mac-scheduler-harq-rr.cc.
Referenced by ScheduleDlHarq().
|
protected |
Get the FH Control method.
Definition at line 438 of file nr-mac-scheduler-harq-rr.cc.
Referenced by ScheduleDlHarq().
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.
fn | the function |
Definition at line 52 of file nr-mac-scheduler-harq-rr.cc.
void ns3::NrMacSchedulerHarqRr::InstallGetBwInRBG | ( | const std::function< uint16_t()> & | fn | ) |
Install a function to retrieve the bandwidth in RBG.
fn |
Definition at line 40 of file nr-mac-scheduler-harq-rr.cc.
void ns3::NrMacSchedulerHarqRr::InstallGetBwpIdFn | ( | const std::function< uint16_t()> & | fn | ) |
Install a function to retrieve the bwp id.
fn | the function |
Definition at line 28 of file nr-mac-scheduler-harq-rr.cc.
void ns3::NrMacSchedulerHarqRr::InstallGetCellIdFn | ( | const std::function< uint16_t()> & | fn | ) |
Install a function to retrieve the cell id.
fn | the function |
Definition at line 34 of file nr-mac-scheduler-harq-rr.cc.
void ns3::NrMacSchedulerHarqRr::InstallGetFhControlMethodFn | ( | const std::function< uint8_t()> & | fn | ) |
Install a function to retrieve the FH Control Method (when enabled)
fn |
Definition at line 46 of file nr-mac-scheduler-harq-rr.cc.
|
virtual |
Schedule DL HARQ in RR fashion.
startingPoint | starting point of the first retransmission. |
symAvail | Available symbols |
activeDlHarq | Map of the active HARQ processes |
ueMap | Map of the UEs |
dlHarqToRetransmit | HARQ feedbacks that could not be transmitted (to fill) |
dlHarqFeedback | all the HARQ feedbacks |
slotAlloc | Slot allocation info |
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.
|
virtual |
Schedule the UL HARQ.
startingPoint | starting point of the first retransmission. It should be set to the next available starting point |
symAvail | Available symbols |
ueMap | Map of the UEs |
ulHarqToRetransmit | HARQ feedbacks that could not be transmitted (to fill) |
ulHarqFeedback | all the HARQ feedbacks |
slotAlloc | Slot allocation info |
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.
|
virtual |
Sort Dl Harq retx based on their symbol requirement.
activeDlHarq | map of the active retx |
Definition at line 355 of file nr-mac-scheduler-harq-rr.cc.
|
virtual |
(In theory) sort UL HARQ retx
activeUlHarq | map 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.