22 #include <ns3/pointer.h>
28 #include <ns3/lte-amc.h>
29 #include <ns3/rr-ff-mac-scheduler.h>
30 #include <ns3/simulator.h>
31 #include <ns3/lte-common.h>
32 #include <ns3/lte-vendor-specific-parameters.h>
33 #include <ns3/boolean.h>
144 : m_scheduler (scheduler)
219 : m_cschedSapUser (0),
224 m_amc = CreateObject <LteAmc> ();
254 .AddConstructor<RrFfMacScheduler> ()
255 .AddAttribute (
"CqiTimerThreshold",
256 "The number of TTIs a CQI is valid (default 1000 - 1 sec.)",
259 MakeUintegerChecker<uint32_t> ())
260 .AddAttribute (
"HarqEnabled",
261 "Activate/Deactivate the HARQ [by default is active].",
264 MakeBooleanChecker ())
265 .AddAttribute (
"UlGrantMcs",
266 "The MCS of the UL grant, must be [0..15] (default 0)",
269 MakeUintegerChecker<uint8_t> ())
336 dlHarqPrcStatus.resize (8,0);
339 dlHarqProcessesTimer.resize (8,0);
342 dlHarqdci.resize (8);
345 dlHarqRlcPdu.resize (2);
346 dlHarqRlcPdu.at (0).resize (8);
347 dlHarqRlcPdu.at (1).resize (8);
351 ulHarqPrcStatus.resize (8,0);
354 ulHarqdci.resize (8);
378 std::list<FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator it =
m_rlcBufferReq.begin ();
409 std::list<FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator it =
m_rlcBufferReq.begin ();
412 if ((*it).m_rnti == params.
m_rnti)
414 NS_LOG_INFO (
this <<
" Erase RNTI " << (*it).m_rnti <<
" LC " << (uint16_t)(*it).m_logicalChannelIdentity);
441 std::list<FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator it =
m_rlcBufferReq.begin ();
489 for (
int i = 0; i < 4; i++)
520 NS_FATAL_ERROR (
"No Process Id Statusfound for this RNTI " << rnti);
522 uint8_t i = (*it).second;
527 while ( ((*itStat).second.at (i) != 0)&&(i != (*it).second));
528 if ((*itStat).second.at (i) == 0)
559 NS_FATAL_ERROR (
"No Process Id Statusfound for this RNTI " << rnti);
561 uint8_t i = (*it).second;
566 while ( ((*itStat).second.at (i) != 0)&&(i != (*it).second));
567 if ((*itStat).second.at (i) == 0)
570 (*itStat).second.at (i) = 1;
577 return ((*it).second);
586 std::map <uint16_t, DlHarqProcessesTimer_t>::iterator itTimers;
595 NS_LOG_INFO (
this <<
" Reset HARQ proc " << i <<
" for RNTI " << (*itTimers).first);
596 std::map <uint16_t, DlHarqProcessesStatus_t>::iterator itStat =
m_dlHarqProcessesStatus.find ((*itTimers).first);
599 NS_FATAL_ERROR (
"No Process Id Status found for this RNTI " << (*itTimers).first);
601 (*itStat).second.at (i) = 0;
602 (*itTimers).second.at (i) = 0;
606 (*itTimers).second.at (i)++;
627 std::vector <bool> rbgMap;
628 uint16_t rbgAllocatedNum = 0;
629 std::set <uint16_t> rntiAllocated;
633 std::map <uint16_t, uint8_t>::iterator itProcId;
636 (*itProcId).second = ((*itProcId).second + 1) %
HARQ_PROC_NUM;
641 uint16_t rbStart = 0;
642 std::vector <struct RachListElement_s>::iterator itRach;
647 newRar.
m_rnti = (*itRach).m_rnti;
651 newRar.m_grant.m_rnti = newRar.m_rnti;
654 uint16_t tbSizeBits = 0;
661 if (tbSizeBits < (*itRach).m_estimatedSize)
666 newRar.m_grant.m_rbStart = rbStart;
667 newRar.m_grant.m_rbLen = rbLen;
668 newRar.m_grant.m_tbSize = tbSizeBits / 8;
669 newRar.m_grant.m_hopping =
false;
670 newRar.m_grant.m_tpc = 0;
671 newRar.m_grant.m_cqiRequest =
false;
672 newRar.m_grant.m_ulDelay =
false;
673 NS_LOG_INFO (
this <<
" UL grant allocated to RNTI " << (*itRach).m_rnti <<
" rbStart " << rbStart <<
" rbLen " << rbLen <<
" MCS " << (uint16_t)
m_ulGrantMcs <<
" tbSize " << newRar.m_grant.m_tbSize);
674 for (uint16_t i = rbStart; i < rbStart + rbLen; i++)
683 uldci.
m_rnti = newRar.m_rnti;
702 std::map <uint16_t, uint8_t>::iterator itProcId;
708 harqId = (*itProcId).second;
714 (*itDci).second.at (harqId) = uldci;
717 rbStart = rbStart + rbLen;
729 NS_LOG_INFO (
this <<
" Received DL-HARQ feedback");
745 std::vector <struct DlInfoListElement_s> dlInfoListUntxed;
749 if (itRnti != rntiAllocated.end ())
755 std::vector <bool> retx;
756 NS_LOG_INFO (
this <<
" Processing DLHARQ feedback");
760 retx.push_back (
false);
767 if (retx.at (0) || retx.at (1))
772 NS_LOG_INFO (
this <<
" HARQ retx RNTI " << rnti <<
" harqId " << (uint16_t)harqId);
781 if (dci.
m_rv.size () == 1)
783 rv = dci.
m_rv.at (0);
787 rv = (dci.
m_rv.at (0) > dci.
m_rv.at (1) ? dci.
m_rv.at (0) : dci.
m_rv.at (1));
793 NS_LOG_INFO (
"Max number of retransmissions reached -> drop process");
799 (*it).second.at (harqId) = 0;
805 for (uint16_t k = 0; k < (*itRlcPdu).second.size (); k++)
807 (*itRlcPdu).second.at (k).at (harqId).clear ();
813 std::vector <int> dciRbg;
816 for (
int j = 0; j < 32; j++)
820 dciRbg.push_back (j);
826 for (uint8_t j = 0; j < dciRbg.size (); j++)
828 if (rbgMap.at (dciRbg.at (j)) ==
true)
838 for (uint8_t j = 0; j < dciRbg.size (); j++)
840 rbgMap.at (dciRbg.at (j)) =
true;
841 NS_LOG_INFO (
"RBG " << dciRbg.at (j) <<
" assigned");
845 NS_LOG_INFO (
this <<
" Send retx in the same RBGs");
851 uint8_t rbgId = (dciRbg.at (dciRbg.size () - 1) + 1) % rbgNum;
852 uint8_t startRbg = dciRbg.at (dciRbg.size () - 1);
853 std::vector <bool> rbgMapCopy = rbgMap;
854 while ((j < dciRbg.size ())&&(startRbg != rbgId))
856 if (rbgMapCopy.at (rbgId) ==
false)
858 rbgMapCopy.at (rbgId) =
true;
859 dciRbg.at (j) = rbgId;
862 rbgId = (rbgId + 1) % rbgNum;
864 if (j == dciRbg.size ())
867 uint32_t rbgMask = 0;
868 for (uint16_t k = 0; k < dciRbg.size (); k++)
870 rbgMask = rbgMask + (0x1 << dciRbg.at (k));
871 NS_LOG_INFO (
this <<
" New allocated RBG " << dciRbg.at (k));
881 NS_LOG_INFO (
this <<
" No resource for this retx -> buffer it");
889 NS_FATAL_ERROR (
"Unable to find RlcPdcList in HARQ buffer for RNTI " << rnti);
891 for (uint8_t j = 0; j < nLayers; j++)
895 if (j >= dci.
m_ndi.size ())
898 dci.
m_ndi.push_back (0);
899 dci.
m_rv.push_back (0);
900 dci.
m_mcs.push_back (0);
902 NS_LOG_INFO (
this <<
" layer " << (uint16_t)j <<
" no txed (MIMO transition)");
907 dci.
m_ndi.at (j) = 0;
909 (*itHarq).second.at (harqId).m_rv.at (j)++;
910 NS_LOG_INFO (
this <<
" layer " << (uint16_t)j <<
" RV " << (uint16_t)dci.
m_rv.at (j));
916 dci.
m_ndi.at (j) = 0;
918 dci.
m_mcs.at (j) = 0;
920 NS_LOG_INFO (
this <<
" layer " << (uint16_t)j <<
" no retx");
924 for (uint16_t k = 0; k < (*itRlcPdu).second.at (0).at (dci.
m_harqProcess).size (); k++)
926 std::vector <struct RlcPduListElement_s> rlcPduListPerLc;
927 for (uint8_t j = 0; j < nLayers; j++)
931 if (j < dci.
m_ndi.size ())
933 rlcPduListPerLc.push_back ((*itRlcPdu).second.at (j).at (dci.
m_harqProcess).at (k));
938 if (rlcPduListPerLc.size () > 0)
945 (*itHarq).second.at (harqId).
m_rv = dci.
m_rv;
950 NS_FATAL_ERROR (
"Unable to find HARQ timer for RNTI " << (uint16_t)rnti);
952 (*itHarqTimer).second.at (harqId) = 0;
954 rntiAllocated.insert (rnti);
971 for (uint16_t k = 0; k < (*itRlcPdu).second.size (); k++)
980 if (rbgAllocatedNum == rbgNum)
991 std::list<FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator it;
995 std::map <uint16_t,uint8_t> lcActivesPerRnti;
996 std::map <uint16_t,uint8_t>::iterator itLcRnti;
1000 std::set <uint16_t>::iterator itRnti = rntiAllocated.find ((*it).m_rnti);
1001 if ( (((*it).m_rlcTransmissionQueueSize > 0)
1002 || ((*it).m_rlcRetransmissionQueueSize > 0)
1003 || ((*it).m_rlcStatusPduSize > 0))
1004 && (itRnti == rntiAllocated.end ())
1008 NS_LOG_LOGIC (
this <<
" User " << (*it).m_rnti <<
" LC " << (uint16_t)(*it).m_logicalChannelIdentity <<
" is active, status " << (*it).m_rlcStatusPduSize <<
" retx " << (*it).m_rlcRetransmissionQueueSize <<
" tx " << (*it).m_rlcTransmissionQueueSize);
1009 std::map <uint16_t,uint8_t>::iterator itCqi =
m_p10CqiRxed.find ((*it).m_rnti);
1013 cqi = (*itCqi).second;
1023 itLcRnti = lcActivesPerRnti.find ((*it).m_rnti);
1024 if (itLcRnti != lcActivesPerRnti.end ())
1026 (*itLcRnti).second++;
1030 lcActivesPerRnti.insert (std::pair<uint16_t, uint8_t > ((*it).m_rnti, 1));
1049 int rbgPerTb = (nTbs > 0) ? ((rbgNum - rbgAllocatedNum) / nTbs) : INT_MAX;
1050 NS_LOG_INFO (
this <<
" Flows to be transmitted " << nflows <<
" rbgPerTb " << rbgPerTb);
1055 int rbgAllocated = 0;
1079 std::map <uint16_t,uint8_t>::iterator itTxMode;
1082 itLcRnti = lcActivesPerRnti.find ((*it).m_rnti);
1083 std::set <uint16_t>::iterator itRnti = rntiAllocated.find ((*it).m_rnti);
1084 if ((itLcRnti == lcActivesPerRnti.end ())||(itRnti != rntiAllocated.end ()))
1087 uint16_t rntiDiscared = (*it).m_rnti;
1090 if ((*it).m_rnti != rntiDiscared)
1106 NS_FATAL_ERROR (
"No Transmission Mode info on user " << (*it).m_rnti);
1109 int lcNum = (*itLcRnti).second;
1112 newEl.
m_rnti = (*it).m_rnti;
1115 newDci.
m_rnti = (*it).m_rnti;
1120 for (uint8_t i = 0; i < nLayer; i++)
1124 newDci.
m_mcs.push_back (0);
1128 newDci.
m_mcs.push_back (
m_amc->GetMcsFromCqi ((*itCqi).second) );
1131 int tbSize = (
m_amc->GetTbSizeFromMcs (newDci.
m_mcs.at (0), rbgPerTb * rbgSize) / 8);
1132 uint16_t rlcPduSize = tbSize / lcNum;
1133 while ((*it).m_rnti == newEl.
m_rnti)
1135 if ( ((*it).m_rlcTransmissionQueueSize > 0)
1136 || ((*it).m_rlcRetransmissionQueueSize > 0)
1137 || ((*it).m_rlcStatusPduSize > 0) )
1139 std::vector <struct RlcPduListElement_s> newRlcPduLe;
1140 for (uint8_t j = 0; j < nLayer; j++)
1145 newRlcEl.
m_size = rlcPduSize;
1147 newRlcPduLe.push_back (newRlcEl);
1155 NS_FATAL_ERROR (
"Unable to find RlcPdcList in HARQ buffer for RNTI " << (*it).m_rnti);
1157 (*itRlcPdu).second.at (j).at (newDci.
m_harqProcess).push_back (newRlcEl);
1172 uint32_t rbgMask = 0;
1174 NS_LOG_INFO (
this <<
" DL - Allocate user " << newEl.
m_rnti <<
" LCs " << (uint16_t)(*itLcRnti).second <<
" bytes " << tbSize <<
" mcs " << (uint16_t) newDci.
m_mcs.at (0) <<
" harqId " << (uint16_t)newDci.
m_harqProcess <<
" layers " << nLayer);
1176 while (i < rbgPerTb)
1178 if (rbgMap.at (rbgAllocated) ==
false)
1180 rbgMask = rbgMask + (0x1 << rbgAllocated);
1183 rbgMap.at (rbgAllocated) =
true;
1190 for (
int i = 0; i < nLayer; i++)
1193 newDci.
m_ndi.push_back (1);
1194 newDci.
m_rv.push_back (0);
1199 newEl.
m_dci = newDci;
1220 if (rbgAllocatedNum == rbgNum)
1249 std::map <uint16_t,uint8_t>::iterator it;
1250 for (
unsigned int i = 0; i < params.
m_cqiList.size (); i++)
1255 std::map <uint16_t,uint8_t>::iterator it;
1256 uint16_t rnti = params.
m_cqiList.at (i).m_rnti;
1261 m_p10CqiRxed.insert ( std::pair<uint16_t, uint8_t > (rnti, params.
m_cqiList.at (i).m_wbCqi.at (0)) );
1268 (*it).second = params.
m_cqiList.at (i).m_wbCqi.at (0);
1270 std::map <uint16_t,uint32_t>::iterator itTimers;
1298 std::vector <bool> rbMap;
1299 uint16_t rbAllocatedNum = 0;
1300 std::set <uint16_t> rntiAllocated;
1301 std::vector <uint16_t> rbgAllocationMap;
1312 if (rbgAllocationMap.at (i) != 0)
1314 rbMap.at (i) =
true;
1322 for (uint16_t i = 0; i < params.
m_ulInfoList.size (); i++)
1331 NS_LOG_ERROR (
"No info find in HARQ buffer for UE (might change eNB) " << rnti);
1334 NS_LOG_INFO (
this <<
" UL-HARQ retx RNTI " << rnti <<
" harqId " << (uint16_t)harqId);
1338 NS_LOG_ERROR (
"No info find in UL-HARQ buffer for UE (might change eNB) " << rnti);
1344 NS_LOG_ERROR (
"No info find in HARQ buffer for UE (might change eNB) " << rnti);
1346 if ((*itStat).second.at (harqId) > 3)
1348 NS_LOG_INFO (
"Max number of retransmissions reached (UL)-> drop process");
1354 if (rbMap.at (j) ==
true)
1365 rbMap.at (j) =
true;
1366 rbgAllocationMap.at (j) = dci.
m_rnti;
1374 NS_LOG_INFO (
"Cannot allocate retx due to RACH allocations for UE " << rnti);
1379 (*itStat).second.at ((*itProcId).second) = (*itStat).second.at (harqId) + 1;
1380 (*itStat).second.at (harqId) = 0;
1381 (*itHarq).second.at ((*itProcId).second) = dci;
1383 rntiAllocated.insert (dci.
m_rnti);
1388 std::map <uint16_t,uint32_t>::iterator it;
1393 std::set <uint16_t>::iterator itRnti = rntiAllocated.find ((*it).first);
1395 NS_LOG_INFO (
this <<
" UE " << (*it).first <<
" queue " << (*it).second);
1396 if (((*it).second > 0)&&(itRnti == rntiAllocated.end ()))
1419 uint16_t rbAllocated = 0;
1440 NS_LOG_INFO (
this <<
" NFlows " << nflows <<
" RB per Flow " << rbPerFlow);
1443 std::set <uint16_t>::iterator itRnti = rntiAllocated.find ((*it).first);
1444 if ((itRnti != rntiAllocated.end ())||((*it).second == 0))
1466 NS_LOG_INFO (
this <<
" try to allocate " << (*it).first);
1468 uldci.
m_rnti = (*it).first;
1470 bool allocated =
false;
1471 NS_LOG_INFO (
this <<
" RB Allocated " << rbAllocated <<
" rbPerFlow " << rbPerFlow <<
" flows " << nflows);
1476 for (uint16_t j = rbAllocated; j < rbAllocated + rbPerFlow; j++)
1478 if (rbMap.at (j) ==
true)
1488 for (uint16_t j = rbAllocated; j < rbAllocated + rbPerFlow; j++)
1490 rbMap.at (j) =
true;
1492 rbgAllocationMap.at (j) = (*it).first;
1495 rbAllocated += rbPerFlow;
1523 std::map <uint16_t, std::vector <double> >::iterator itCqi =
m_ueCqi.find ((*it).first);
1529 NS_LOG_INFO (
this <<
" UE does not have ULCQI " << (*it).first );
1534 double minSinr = (*itCqi).second.at (uldci.
m_rbStart);
1537 if ((*itCqi).second.at (i) < minSinr)
1539 minSinr = (*itCqi).second.at (i);
1543 double s = log2 ( 1 + (
1544 std::pow (10, minSinr / 10 ) /
1545 ( (-std::log (5.0 * 0.00005 )) / 1.5) ));
1548 cqi =
m_amc->GetCqiFromSpectralEfficiency (s);
1561 rbgAllocationMap.at (i) = 0;
1587 std::map <uint16_t, uint8_t>::iterator itProcId;
1593 harqId = (*itProcId).second;
1599 (*itDci).second.at (harqId) = uldci;
1604 NS_LOG_ERROR (
"No info find in HARQ buffer for UE (might change eNB) " << uldci.
m_rnti);
1606 (*itStat).second.at (harqId) = 0;
1609 NS_LOG_INFO (
this <<
" UL Allocation - UE " << (*it).first <<
" startPRB " << (uint32_t)uldci.
m_rbStart <<
" nPRB " << (uint32_t)uldci.
m_rbLen <<
" CQI " << cqi <<
" MCS " << (uint32_t)uldci.
m_mcs <<
" TBsize " << uldci.
m_tbSize <<
" harqId " << (uint16_t)harqId);
1651 std::map <uint16_t,uint32_t>::iterator it;
1653 for (
unsigned int i = 0; i < params.
m_macCeList.size (); i++)
1664 uint32_t buffer = 0;
1665 for (uint8_t lcg = 0; lcg < 4; ++lcg)
1667 uint8_t bsrId = params.
m_macCeList.at (i).m_macCeValue.m_bufferStatus.at (lcg);
1676 m_ceBsrRxed.insert ( std::pair<uint16_t, uint32_t > (rnti, buffer));
1677 NS_LOG_INFO (
this <<
" Insert RNTI " << rnti <<
" queue " << buffer);
1682 (*it).second = buffer;
1683 NS_LOG_INFO (
this <<
" Update RNTI " << rnti <<
" queue " << buffer);
1725 std::map <uint16_t, std::vector <uint16_t> >::iterator itMap;
1726 std::map <uint16_t, std::vector <double> >::iterator itCqi;
1733 for (uint32_t i = 0; i < (*itMap).second.size (); i++)
1737 itCqi =
m_ueCqi.find ((*itMap).second.at (i));
1741 std::vector <double> newCqi;
1746 newCqi.push_back (sinr);
1751 newCqi.push_back (30.0);
1755 m_ueCqi.insert (std::pair <uint16_t, std::vector <double> > ((*itMap).second.at (i), newCqi));
1762 (*itCqi).second.at (i) = sinr;
1764 std::map <uint16_t, uint32_t>::iterator itTimers;
1785 rnti = vsp->GetRnti ();
1788 std::map <uint16_t, std::vector <double> >::iterator itCqi;
1793 std::vector <double> newCqi;
1797 newCqi.push_back (sinr);
1798 NS_LOG_INFO (
this <<
" RNTI " << rnti <<
" new SRS-CQI for RB " << j <<
" value " << sinr);
1801 m_ueCqi.insert (std::pair <uint16_t, std::vector <double> > (rnti, newCqi));
1811 (*itCqi).second.at (j) = sinr;
1812 NS_LOG_INFO (
this <<
" RNTI " << rnti <<
" update SRS-CQI for RB " << j <<
" value " << sinr);
1815 std::map <uint16_t, uint32_t>::iterator itTimers;
1828 NS_FATAL_ERROR (
"PfFfMacScheduler supports only PUSCH and SRS UL-CQIs");
1843 std::map <uint16_t,uint32_t>::iterator itP10 =
m_p10CqiTimers.begin ();
1847 if ((*itP10).second == 0)
1850 std::map <uint16_t,uint8_t>::iterator itMap =
m_p10CqiRxed.find ((*itP10).first);
1852 NS_LOG_INFO (
this <<
" P10-CQI exired for user " << (*itP10).first);
1854 std::map <uint16_t,uint32_t>::iterator temp = itP10;
1873 std::map <uint16_t,uint32_t>::iterator itUl =
m_ueCqiTimers.begin ();
1877 if ((*itUl).second == 0)
1880 std::map <uint16_t, std::vector <double> >::iterator itMap =
m_ueCqi.find ((*itUl).first);
1881 NS_ASSERT_MSG (itMap !=
m_ueCqi.end (),
" Does not find CQI report for user " << (*itUl).first);
1882 NS_LOG_INFO (
this <<
" UL-CQI exired for user " << (*itUl).first);
1883 (*itMap).second.clear ();
1885 std::map <uint16_t,uint32_t>::iterator temp = itUl;
1903 std::list<FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator it;
1906 if (((*it).m_rnti == rnti) && ((*it).m_logicalChannelIdentity == lcid))
1908 NS_LOG_INFO (
this <<
" UE " << rnti <<
" LC " << (uint16_t)lcid <<
" txqueue " << (*it).m_rlcTransmissionQueueSize <<
" retxqueue " << (*it).m_rlcRetransmissionQueueSize <<
" status " << (*it).m_rlcStatusPduSize <<
" decrease " << size);
1911 if (((*it).m_rlcStatusPduSize > 0) && (size >= (*it).m_rlcStatusPduSize))
1913 (*it).m_rlcStatusPduSize = 0;
1915 else if (((*it).m_rlcRetransmissionQueueSize > 0) && (size >= (*it).m_rlcRetransmissionQueueSize))
1917 (*it).m_rlcRetransmissionQueueSize = 0;
1919 else if ((*it).m_rlcTransmissionQueueSize > 0)
1921 uint32_t rlcOverhead;
1936 if ((*it).m_rlcTransmissionQueueSize <= size - rlcOverhead)
1938 (*it).m_rlcTransmissionQueueSize = 0;
1942 (*it).m_rlcTransmissionQueueSize -= size - rlcOverhead;
1955 std::map <uint16_t,uint32_t>::iterator it =
m_ceBsrRxed.find (rnti);
1958 NS_LOG_INFO (
this <<
" Update RLC BSR UE " << rnti <<
" size " << size <<
" BSR " << (*it).second);
1959 if ((*it).second >= size)
1961 (*it).second -= size;
1970 NS_LOG_ERROR (
this <<
" Does not find BSR report info of UE " << rnti);
1979 NS_LOG_FUNCTION (
this <<
" RNTI " << rnti <<
" txMode " << (uint16_t)txMode);
std::vector< struct UlInfoListElement_s > m_ulInfoList
See section 4.3.1 dlDciListElement.
void RefreshUlCqiMaps(void)
virtual void SchedUlMacCtrlInfoReq(const struct SchedUlMacCtrlInfoReqParameters ¶ms)
friend class RrSchedulerMemberCschedSapProvider
smart pointer class similar to boost::intrusive_ptr
Service Access Point (SAP) offered by the eNodeB RRC instance to the Frequency Reuse algorithm instan...
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
virtual FfMacSchedSapProvider * GetFfMacSchedSapProvider()
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register the class in the ns-3 factory.
std::map< uint16_t, uint32_t > m_ueCqiTimers
Parameters of the CSCHED_UE_CONFIG_CNF primitive.
Parameters of the CSCHED_UE_RELEASE_REQ primitive.
virtual void SchedDlPagingBufferReq(const struct SchedDlPagingBufferReqParameters ¶ms)
static TypeId GetTypeId(void)
enum ns3::UlCqi_s::Type_e m_type
std::vector< UlDciListElement_s > UlHarqProcessesDciBuffer_t
std::vector< uint16_t > m_sinr
void RefreshDlCqiMaps(void)
std::vector< uint8_t > DlHarqProcessesTimer_t
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file...
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
void DoCschedCellConfigReq(const struct FfMacCschedSapProvider::CschedCellConfigReqParameters ¶ms)
std::vector< uint8_t > m_mcs
virtual void SchedDlCqiInfoReq(const struct SchedDlCqiInfoReqParameters ¶ms)
See section 4.3.2 ulDciListElement.
static bool SortRlcBufferReq(FfMacSchedSapProvider::SchedDlRlcBufferReqParameters i, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters j)
virtual void SetFfMacSchedSapUser(FfMacSchedSapUser *s)
set the user part of the FfMacSchedSap that this Scheduler will interact with.
std::vector< struct UlDciListElement_s > m_dciList
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
#define NS_FATAL_ERROR(msg)
fatal error handling
See section 4.3.10 buildRARListElement.
virtual void SchedUlCqiInfoReq(const struct SchedUlCqiInfoReqParameters ¶ms)
Parameters of the CSCHED_UE_CONFIG_UPDATE_IND primitive.
FfMacCschedSapProvider * m_cschedSapProvider
Parameters of the CSCHED_LC_RELEASE_REQ primitive.
void DoCschedLcConfigReq(const struct FfMacCschedSapProvider::CschedLcConfigReqParameters ¶ms)
void DoCschedUeConfigReq(const struct FfMacCschedSapProvider::CschedUeConfigReqParameters ¶ms)
uint32_t m_rlcRetransmissionQueueSize
void DoSchedDlRachInfoReq(const struct FfMacSchedSapProvider::SchedDlRachInfoReqParameters ¶ms)
std::vector< std::vector< struct RlcPduListElement_s > > m_rlcPduList
uint8_t m_transmissionMode
FfMacSchedSapUser * m_schedSapUser
Parameters of the SCHED_DL_TRIGGER_REQ primitive.
uint8_t m_logicalChannelIdentity
virtual ~RrFfMacScheduler()
Destructor.
friend class RrSchedulerMemberSchedSapProvider
uint8_t UpdateHarqProcessId(uint16_t rnti)
Update and return a new process Id for the RNTI specified.
void DoSchedDlPagingBufferReq(const struct FfMacSchedSapProvider::SchedDlPagingBufferReqParameters ¶ms)
static const int Type0AllocationRbg[4]
RrFfMacScheduler * m_scheduler
std::map< uint16_t, uint8_t > m_ulHarqCurrentProcessId
std::map< uint16_t, DlHarqRlcPduListBuffer_t > m_dlHarqProcessesRlcPduListBuffer
std::vector< RlcPduList_t > DlHarqRlcPduListBuffer_t
Parameters of the SCHED_DL_MAC_BUFFER_REQ primitive.
virtual void CschedUeReleaseReq(const struct CschedUeReleaseReqParameters ¶ms)
Parameters of the SCHED_DL_PAGING_BUFFER_REQ primitive.
std::map< uint16_t, uint8_t > m_p10CqiRxed
virtual void CschedUeConfigUpdateInd(const struct CschedUeConfigUpdateIndParameters ¶ms)=0
std::vector< struct VendorSpecificListElement_s > m_vendorSpecificList
virtual LteFfrSapUser * GetLteFfrSapUser()
FfMacCschedSapProvider::CschedCellConfigReqParameters m_cschedCellConfig
RrSchedulerMemberSchedSapProvider()
Service Access Point (SAP) offered by the Frequency Reuse algorithm instance to the MAC Scheduler ins...
Parameters of the SCHED_UL_TRIGGER_REQ primitive.
Hold an unsigned integer type.
std::map< uint16_t, DlHarqProcessesStatus_t > m_dlHarqProcessesStatus
static uint8_t TxMode2LayerNum(uint8_t txMode)
LteFfrSapUser * m_ffrSapUser
std::vector< uint8_t > m_ndi
virtual void SetFfMacCschedSapUser(FfMacCschedSapUser *s)
set the user part of the FfMacCschedSap that this Scheduler will interact with.
std::map< uint16_t, std::vector< uint16_t > > m_allocationMaps
FfMacCschedSapUser * m_cschedSapUser
void DoSchedDlRlcBufferReq(const struct FfMacSchedSapProvider::SchedDlRlcBufferReqParameters ¶ms)
std::map< uint16_t, UlHarqProcessesDciBuffer_t > m_ulHarqProcessesDciBuffer
std::map< uint16_t, uint32_t > m_p10CqiTimers
uint8_t HarqProcessAvailability(uint16_t rnti)
Return the availability of free process for the RNTI specified.
void DoSchedUlCqiInfoReq(const struct FfMacSchedSapProvider::SchedUlCqiInfoReqParameters ¶ms)
virtual void CschedUeConfigCnf(const struct CschedUeConfigCnfParameters ¶ms)=0
std::vector< uint8_t > m_logicalChannelIdentity
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
Parameters of the SCHED_UL_NOISE_INTERFERENCE_REQ primitive.
uint8_t m_logicalChannelIdentity
std::vector< struct CqiListElement_s > m_cqiList
std::vector< struct DlInfoListElement_s > m_dlInfoList
virtual void SetLteFfrSapProvider(LteFfrSapProvider *s)
Set the Provider part of the LteFfrSap that this Scheduler will interact with.
void RefreshHarqProcesses()
Refresh HARQ processes according to the timers.
void DoSchedUlSrInfoReq(const struct FfMacSchedSapProvider::SchedUlSrInfoReqParameters ¶ms)
virtual void SchedDlConfigInd(const struct SchedDlConfigIndParameters ¶ms)=0
void UpdateUlRlcBufferInfo(uint16_t rnti, uint16_t size)
Parameters of the API primitives.
int8_t m_pdcchPowerOffset
void DoSchedUlMacCtrlInfoReq(const struct FfMacSchedSapProvider::SchedUlMacCtrlInfoReqParameters ¶ms)
std::vector< uint16_t > m_tbsSize
See section 4.3.9 rlcPDU_ListElement.
RrFfMacScheduler * m_scheduler
bool m_harqOn
m_harqOn when false inhibit te HARQ mechanisms (by default active)
int GetRbgSize(int dlbandwidth)
std::list< FfMacSchedSapProvider::SchedDlRlcBufferReqParameters > m_rlcBufferReq
virtual void SchedUlNoiseInterferenceReq(const struct SchedUlNoiseInterferenceReqParameters ¶ms)
virtual void CschedUeConfigReq(const struct CschedUeConfigReqParameters ¶ms)
std::map< uint16_t, std::vector< double > > m_ueCqi
std::vector< DlDciListElement_s > DlHarqProcessesDciBuffer_t
Parameters of the CSCHED_LC_CONFIG_REQ primitive.
virtual void SchedDlRlcBufferReq(const struct SchedDlRlcBufferReqParameters ¶ms)
void DoSchedUlNoiseInterferenceReq(const struct FfMacSchedSapProvider::SchedUlNoiseInterferenceReqParameters ¶ms)
std::vector< uint8_t > m_rv
virtual void SchedUlConfigInd(const struct SchedUlConfigIndParameters ¶ms)=0
std::map< uint16_t, UlHarqProcessesStatus_t > m_ulHarqProcessesStatus
virtual void SchedDlTriggerReq(const struct SchedDlTriggerReqParameters ¶ms)
UlCqiFilter_t m_ulCqiFilter
LteFfrSapProvider * m_ffrSapProvider
void DoCschedLcReleaseReq(const struct FfMacCschedSapProvider::CschedLcReleaseReqParameters ¶ms)
virtual FfMacCschedSapProvider * GetFfMacCschedSapProvider()
This abstract base class identifies the interface by means of which the helper object can plug on the...
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
uint8_t m_nrOfPdcchOfdmSymbols
Parameters of the SCHED_DL_CQI_INFO_REQ primitive.
std::vector< struct MacCeListElement_s > m_macCeList
Parameters of the API primitives.
std::vector< struct RachListElement_s > m_rachList
static double fpS11dot3toDouble(uint16_t val)
virtual void SchedUlSrInfoReq(const struct SchedUlSrInfoReqParameters ¶ms)
FfMacSchedSapProvider * m_schedSapProvider
Implements the SCHED SAP and CSCHED SAP for a Round Robin scheduler.
std::vector< uint8_t > UlHarqProcessesStatus_t
RrFfMacScheduler()
Constructor.
std::vector< uint8_t > DlHarqProcessesStatus_t
Parameters of the SCHED_UL_CQI_INFO_REQ primitive.
virtual void SchedDlMacBufferReq(const struct SchedDlMacBufferReqParameters ¶ms)
static uint32_t BsrId2BufferSize(uint8_t val)
virtual void CschedLcReleaseReq(const struct CschedLcReleaseReqParameters ¶ms)
std::map< uint16_t, DlHarqProcessesDciBuffer_t > m_dlHarqProcessesDciBuffer
uint8_t m_transmissionMode
std::vector< struct RachListElement_s > m_rachList
void UpdateDlRlcBufferInfo(uint16_t rnti, uint8_t lcid, uint16_t size)
std::map< uint16_t, DlHarqProcessesTimer_t > m_dlHarqProcessesTimer
std::map< uint16_t, uint8_t > m_dlHarqCurrentProcessId
Parameters of the API primitives.
RrSchedulerMemberCschedSapProvider()
Parameters of the SCHED_UL_MAC_CTRL_INFO_REQ primitive.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
void DoSchedDlTriggerReq(const struct FfMacSchedSapProvider::SchedDlTriggerReqParameters ¶ms)
void DoCschedUeReleaseReq(const struct FfMacCschedSapProvider::CschedUeReleaseReqParameters ¶ms)
uint32_t m_cqiTimersThreshold
virtual void SchedUlTriggerReq(const struct SchedUlTriggerReqParameters ¶ms)
Parameters of the SCHED_UL_SR_INFO_REQ primitive.
uint16_t m_rlcStatusPduSize
void DoSchedDlCqiInfoReq(const struct FfMacSchedSapProvider::SchedDlCqiInfoReqParameters ¶ms)
#define NS_LOG_ERROR(msg)
Use NS_LOG to output a message of level LOG_ERROR.
void TransmissionModeConfigurationUpdate(uint16_t rnti, uint8_t txMode)
Parameters of the SCHED_DL_RACH_INFO_REQ primitive.
Parameters of the SCHED_UL_CONFIG_IND primitive.
void DoSchedDlMacBufferReq(const struct FfMacSchedSapProvider::SchedDlMacBufferReqParameters ¶ms)
uint16_t m_rlcTransmissionQueueHolDelay
Parameters of the CSCHED_UE_CONFIG_REQ primitive.
virtual void DoDispose(void)
This method is called by Object::Dispose or by the object's destructor, whichever comes first...
std::vector< DlInfoListElement_s > m_dlInfoListBuffered
std::map< uint16_t, uint32_t > m_ceBsrRxed
struct DlDciListElement_s m_dci
std::vector< struct BuildRarListElement_s > m_buildRarList
std::vector< uint16_t > m_rachAllocationMap
virtual void SchedDlRachInfoReq(const struct SchedDlRachInfoReqParameters ¶ms)
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
virtual void CschedLcConfigReq(const struct CschedLcConfigReqParameters ¶ms)
std::map< uint16_t, uint8_t > m_uesTxMode
virtual void CschedCellConfigReq(const struct CschedCellConfigReqParameters ¶ms)
CSCHED_CELL_CONFIG_REQ.
std::vector< struct BuildDataListElement_s > m_buildDataList
void DoSchedUlTriggerReq(const struct FfMacSchedSapProvider::SchedUlTriggerReqParameters ¶ms)
uint8_t m_ueTxAntennaSelection
See section 4.3.8 builDataListElement.