20#include "ns3/boolean.h"
21#include "ns3/integer.h"
24#include "ns3/pointer.h"
25#include "ns3/simulator.h"
26#include "ns3/string.h"
121 : m_cschedSapUser(nullptr),
122 m_schedSapUser(nullptr),
158 TypeId(
"ns3::CqaFfMacScheduler")
162 .AddAttribute(
"CqiTimerThreshold",
163 "The number of TTIs a CQI is valid (default 1000 - 1 sec.)",
167 .AddAttribute(
"CqaMetric",
168 "CqaFfMacScheduler metric type that can be: CqaFf, CqaPf",
172 .AddAttribute(
"HarqEnabled",
173 "Activate/Deactivate the HARQ [by default is active].",
177 .AddAttribute(
"UlGrantMcs",
178 "The MCS of the UL grant, must be [0..15] (default 0)",
239 << (uint16_t)params.m_transmissionMode);
243 m_uesTxMode.insert(std::pair<uint16_t, uint8_t>(params.m_rnti, params.m_transmissionMode));
270 (*it).second = params.m_transmissionMode;
280 NS_LOG_FUNCTION(
"LC configuration. Number of LCs:" << params.m_logicalChannelConfigList.size());
284 if (params.m_reconfigureFlag)
286 for (
auto lcit = params.m_logicalChannelConfigList.begin();
287 lcit != params.m_logicalChannelConfigList.end();
294 NS_LOG_ERROR(
"UE logical channels can not be reconfigured because it was not "
295 "configured before.");
306 for (
auto lcit = params.m_logicalChannelConfigList.begin();
307 lcit != params.m_logicalChannelConfigList.end();
312 std::pair<LteFlowId_t, LogicalChannelConfigListElement_s>(flowId, *
lcit));
316 for (std::size_t
i = 0;
i < params.m_logicalChannelConfigList.size();
i++)
323 params.m_logicalChannelConfigList.at(
i).m_eRabGuaranteedBitrateDl / 8;
325 params.m_logicalChannelConfigList.at(
i).m_eRabGuaranteedBitrateUl / 8;
348 params.m_logicalChannelConfigList.at(
i).m_eRabGuaranteedBitrateDl / 8;
350 params.m_logicalChannelConfigList.at(
i).m_eRabGuaranteedBitrateUl / 8;
363 for (
auto it = params.m_logicalChannelIdentity.begin();
364 it != params.m_logicalChannelIdentity.end();
377 NS_FATAL_ERROR(
"Logical channels cannot be released because it can not be found in the "
378 "list of active LCs");
382 for (std::size_t
i = 0;
i < params.m_logicalChannelIdentity.size();
i++)
387 if (((*it).first.m_rnti == params.m_rnti) &&
388 ((*it).first.m_lcId == params.m_logicalChannelIdentity.at(
i)))
434 if ((*it).first.m_rnti == params.m_rnti)
468 (*it).second = params;
491 for (
int i = 0;
i < 4;
i++)
508 if (((*it).first.m_rnti == rnti) && (((*it).second.m_rlcTransmissionQueueSize > 0) ||
509 ((*it).second.m_rlcRetransmissionQueueSize > 0) ||
510 ((*it).second.m_rlcStatusPduSize > 0)))
514 if ((*it).first.m_rnti > rnti)
535 NS_FATAL_ERROR(
"No Process Id Statusfound for this RNTI " << rnti);
537 uint8_t
i = (*it).second;
541 }
while (((*itStat).second.at(
i) != 0) && (
i != (*it).second));
543 return (*itStat).second.at(
i) == 0;
564 NS_FATAL_ERROR(
"No Process Id Statusfound for this RNTI " << rnti);
566 uint8_t
i = (*it).second;
570 }
while (((*itStat).second.at(
i) != 0) && (
i != (*it).second));
571 if ((*itStat).second.at(
i) == 0)
574 (*itStat).second.at(
i) = 1;
579 << rnti <<
" check before update with HarqProcessAvailability");
599 NS_LOG_DEBUG(
this <<
" Reset HARQ proc " <<
i <<
" for RNTI " << (*itTimers).first);
604 << (*itTimers).first);
606 (*itStat).second.at(
i) = 0;
607 (*itTimers).second.at(
i) = 0;
611 (*itTimers).second.at(
i)++;
621 NS_LOG_FUNCTION(
this <<
" Frame no. " << (params.m_sfnSf >> 4) <<
" subframe no. "
622 << (0xF & params.m_sfnSf));
632 std::map<uint16_t, std::multimap<uint8_t, qos_rb_and_CQI_assigned_to_lc>>
640 std::map<LteFlowId_t, int>
UEtoHOL;
662 (*itProcId).second = ((*itProcId).second + 1) %
HARQ_PROC_NUM;
709 (*itRach).m_estimatedSize,
710 " Default UL Grant MCS does not allow to send RACH messages");
721 while ((
tbSizeBits < (*itRach).m_estimatedSize) &&
735 newRar.m_grant.m_hopping =
false;
737 newRar.m_grant.m_cqiRequest =
false;
738 newRar.m_grant.m_ulDelay =
false;
739 NS_LOG_INFO(
this <<
" UL grant allocated to RNTI " << (*itRach).m_rnti <<
" rbStart "
741 <<
newRar.m_grant.m_tbSize);
757 uldci.m_cceIndex = 0;
758 uldci.m_aggrLevel = 1;
759 uldci.m_ueTxAntennaSelection = 3;
760 uldci.m_hopping =
false;
763 uldci.m_cqiRequest =
false;
766 uldci.m_freqHopping = 0;
767 uldci.m_pdcchPowerOffset = 0;
775 harqId = (*itProcId).second;
779 NS_FATAL_ERROR(
"Unable to find RNTI entry in UL DCI HARQ buffer for RNTI "
782 (*itDci).second.at(harqId) =
uldci;
795 if (!params.m_dlInfoList.empty())
799 params.m_dlInfoList.begin(),
800 params.m_dlInfoList.end());
805 if (!params.m_dlInfoList.empty())
825 std::vector<bool> retx;
826 NS_LOG_INFO(
this <<
" Processing DLHARQ feedback");
831 retx.push_back(
false);
840 if (retx.at(0) || retx.at(1))
845 NS_LOG_INFO(
this <<
" HARQ retx RNTI " << rnti <<
" harqId " << (uint16_t)harqId);
854 if (
dci.m_rv.size() == 1)
860 rv = (
dci.m_rv.at(0) >
dci.m_rv.at(1) ?
dci.m_rv.at(0) :
dci.m_rv.at(1));
866 NS_LOG_INFO(
"Maximum number of retransmissions reached -> drop process");
870 NS_LOG_ERROR(
"No info find in HARQ buffer for UE (might change eNB) "
873 (*it).second.at(harqId) = 0;
877 NS_FATAL_ERROR(
"Unable to find RlcPdcList in HARQ buffer for RNTI "
880 for (std::size_t k = 0; k < (*itRlcPdu).second.size(); k++)
882 (*itRlcPdu).second.at(k).at(harqId).clear();
891 for (
int j = 0;
j < 32;
j++)
893 if (((
dci.m_rbBitmap & mask) >>
j) == 1)
901 for (std::size_t
j = 0;
j <
dciRbg.size();
j++)
913 for (std::size_t
j = 0;
j <
dciRbg.size();
j++)
920 NS_LOG_INFO(
this <<
" Send retx in the same RBGs");
943 for (std::size_t k = 0; k <
dciRbg.size(); k++)
956 NS_LOG_INFO(
this <<
" No resource for this retx -> buffer it");
964 NS_FATAL_ERROR(
"Unable to find RlcPdcList in HARQ buffer for RNTI " << rnti);
970 if (
j >=
dci.m_ndi.size())
973 dci.m_ndi.push_back(0);
974 dci.m_rv.push_back(0);
975 dci.m_mcs.push_back(0);
976 dci.m_tbsSize.push_back(0);
978 <<
" no txed (MIMO transition)");
984 (*itHarq).second.at(harqId).m_rv.at(
j)++;
986 << (uint16_t)
dci.m_rv.at(
j));
995 dci.m_tbsSize.at(
j) = 0;
996 NS_LOG_INFO(
this <<
" layer " << (uint16_t)
j <<
" no retx");
999 for (std::size_t k = 0; k < (*itRlcPdu).second.at(0).at(
dci.m_harqProcess).size(); k++)
1006 if (
j <
dci.m_ndi.size())
1009 <<
dci.m_tbsSize.at(
j));
1011 (*itRlcPdu).second.at(
j).at(
dci.m_harqProcess).at(k));
1017 NS_LOG_INFO(
" layer " << (uint16_t)
j <<
" tb size " <<
dci.m_tbsSize.at(
j));
1021 .at(
dci.m_harqProcess)
1023 .m_logicalChannelIdentity;
1034 newEl.m_rnti = rnti;
1036 (*itHarq).second.at(harqId).m_rv =
dci.m_rv;
1041 NS_FATAL_ERROR(
"Unable to find HARQ timer for RNTI " << (uint16_t)rnti);
1043 (*itHarqTimer).second.at(harqId) = 0;
1044 ret.m_buildDataList.push_back(
newEl);
1062 NS_FATAL_ERROR(
"Unable to find RlcPdcList in HARQ buffer for RNTI "
1065 for (std::size_t k = 0; k < (*itRlcPdu).second.size(); k++)
1077 if (!
ret.m_buildDataList.empty() || !
ret.m_buildRarList.empty())
1137 std::set<LteFlowId_t> v;
1153 std::set<LteFlowId_t> v;
1171 std::map<uint16_t, uint8_t>
sbCqiSum;
1181 NS_FATAL_ERROR(
"No Transmission Mode info on user " << (*itrbr).first.m_rnti);
1196 cqiSum += (*itCqi).second.m_higherLayerSelected.at(k).m_sbCqi.at(
j);
1203 NS_LOG_INFO(
"Skip this flow, CQI==0, rnti:" << (*itrbr).first.m_rnti);
1209 8 * ((int)
m_rlcBufferReq.find(flowId)->second.m_rlcRetransmissionQueueSize +
1210 (int)
m_rlcBufferReq.find(flowId)->second.m_rlcTransmissionQueueSize);
1223 NS_FATAL_ERROR(
"No Transmission Mode info on user " << (*itrbr).first.m_rnti);
1226 std::vector<uint8_t>
sbCqis;
1233 sbCqis = (*itCqi).second.m_higherLayerSelected.at(
i).m_sbCqi;
1247 for (uint8_t k = 0; k <
nLayer; k++)
1263 sbCqiSum.insert(std::pair<uint16_t, uint8_t>((*itrbr).first.m_rnti,
sum));
1285 NS_LOG_INFO(
"No UEs to be scheduled (no data or CQI==0),");
1288 std::set<LteFlowId_t>
vUEs;
1350 (*itStats).second.targetThroughput / (*itStats).second.lastAveragedThroughput;
1363 (
itRntiCQIsMap->second.m_higherLayerSelected.at(*it).m_sbCqi.at(0));
1374 catch (std::out_of_range&)
1378 <<
" rnti:" << flowId.
m_rnti
1506 std::multimap<uint8_t, qos_rb_and_CQI_assigned_to_lc>
tempMap;
1511 std::pair<uint16_t, std::multimap<uint8_t, qos_rb_and_CQI_assigned_to_lc>>(
1517 itMap->second.insert(
1538 (*itStats).second.lastTtiBytesTransmitted = 0;
1564 uint16_t
RbgPerRnti = (*itMap).second.size();
1572 for (
auto it = (*itMap).second.begin();
it != (*itMap).second.end();
it++)
1597 if (((*itBufReq).first.m_rnti == (*itMap).first) &&
1598 (((*itBufReq).second.m_rlcTransmissionQueueSize > 0) ||
1599 ((*itBufReq).second.m_rlcRetransmissionQueueSize > 0) ||
1600 ((*itBufReq).second.m_rlcStatusPduSize > 0)))
1621 NS_FATAL_ERROR(
"Unable to find RlcPdcList in HARQ buffer for RNTI "
1625 (*itRlcPdu).second.at(
j).at(
newDci.m_harqProcess).push_back(
newRlcEl);
1630 if ((*itBufReq).first.m_rnti > (*itMap).first)
1637 newDci.m_ndi.push_back(1);
1638 newDci.m_rv.push_back(0);
1651 NS_FATAL_ERROR(
"Unable to find RNTI entry in DCI HARQ buffer for RNTI "
1661 (*itHarqTimer).second.at(
newDci.m_harqProcess) = 0;
1666 ret.m_buildDataList.push_back(
newEl);
1671 (*it).second.lastTtiBytesTransmitted =
tbSize;
1680 ret.m_nrOfPdcchOfdmSymbols = 1;
1688 (*itStats).second.secondLastAveragedThroughput =
1689 ((1.0 - (1 /
m_timeWindow)) * (*itStats).second.secondLastAveragedThroughput) +
1693 (*itStats).second.totalBytesTransmitted += (*itStats).second.lastTtiBytesTransmitted;
1696 (*itStats).second.lastAveragedThroughput =
1697 ((1.0 - (1.0 /
m_timeWindow)) * (*itStats).second.lastAveragedThroughput) +
1698 ((1.0 /
m_timeWindow) * (
double)((*itStats).second.lastTtiBytesTransmitted / 0.001));
1699 NS_LOG_INFO(
this <<
" UE total bytes " << (*itStats).second.totalBytesTransmitted);
1700 NS_LOG_INFO(
this <<
" UE average throughput " << (*itStats).second.lastAveragedThroughput);
1701 (*itStats).second.lastTtiBytesTransmitted = 0;
1732 for (
unsigned int i = 0;
i < params.m_cqiList.size();
i++)
1738 uint16_t rnti = params.m_cqiList.at(
i).m_rnti;
1744 params.m_cqiList.at(
i).m_wbCqi.at(0);
1751 (*it).second = params.m_cqiList.at(
i).m_wbCqi.at(0);
1760 uint16_t rnti = params.m_cqiList.at(
i).m_rnti;
1771 (*it).second = params.m_cqiList.at(
i).m_sbMeasResult;
1799 double sinr = (*itCqi).second.at(
i);
1817 NS_LOG_FUNCTION(
this <<
" UL - Frame no. " << (params.m_sfnSf >> 4) <<
" subframe no. "
1818 << (0xF & params.m_sfnSf) <<
" size " << params.m_ulInfoList.size());
1825 std::vector<bool>
rbMap;
1863 for (std::size_t
i = 0;
i < params.m_ulInfoList.size();
i++)
1868 uint16_t rnti = params.m_ulInfoList.at(
i).m_rnti;
1872 NS_LOG_ERROR(
"No info find in HARQ buffer for UE (might change eNB) " << rnti);
1875 NS_LOG_INFO(
this <<
" UL-HARQ retx RNTI " << rnti <<
" harqId " << (uint16_t)harqId
1876 <<
" i " <<
i <<
" size " << params.m_ulInfoList.size());
1880 NS_LOG_ERROR(
"No info find in HARQ buffer for UE (might change eNB) " << rnti);
1887 NS_LOG_ERROR(
"No info find in HARQ buffer for UE (might change eNB) " << rnti);
1889 if ((*itStat).second.at(harqId) >= 3)
1891 NS_LOG_INFO(
"Max number of retransmissions reached (UL)-> drop process");
1896 for (
int j =
dci.m_rbStart;
j <
dci.m_rbStart +
dci.m_rbLen;
j++)
1907 for (
int j =
dci.m_rbStart;
j <
dci.m_rbStart +
dci.m_rbLen;
j++)
1914 NS_LOG_INFO(
this <<
" Send retx in the same RBs " << (uint16_t)
dci.m_rbStart
1915 <<
" to " <<
dci.m_rbStart +
dci.m_rbLen <<
" RV "
1916 << (*itStat).second.at(harqId) + 1);
1920 NS_LOG_INFO(
"Cannot allocate retx due to RACH allocations for UE " << rnti);
1925 (*itStat).second.at((*itProcId).second) = (*itStat).second.at(harqId) + 1;
1926 (*itStat).second.at(harqId) = 0;
1927 (*itHarq).second.at((*itProcId).second) =
dci;
1928 ret.m_dciList.push_back(
dci);
1933 NS_LOG_INFO(
this <<
" HARQ-ACK feedback from RNTI "
1934 << params.m_ulInfoList.at(
i).m_rnti);
1939 std::map<uint16_t, uint32_t>::iterator
it;
1954 if (!
ret.m_dciList.empty())
2001 NS_LOG_DEBUG(
this <<
" UE already allocated in HARQ -> discarded, RNTI "
2100 "CQI of RNTI = " << (*it).first <<
" has expired");
2108 double sinr = (*itCqi).second.at(
i);
2120 double s =
log2(1 + (std::pow(10,
minSinr / 10) / ((-std::log(5.0 * 0.00005)) / 1.5)));
2121 cqi =
m_amc->GetCqiFromSpectralEfficiency(s);
2144 uldci.m_cceIndex = 0;
2145 uldci.m_aggrLevel = 1;
2146 uldci.m_ueTxAntennaSelection = 3;
2147 uldci.m_hopping =
false;
2150 uldci.m_cqiRequest =
false;
2151 uldci.m_ulIndex = 0;
2153 uldci.m_freqHopping = 0;
2154 uldci.m_pdcchPowerOffset = 0;
2165 harqId = (*itProcId).second;
2169 NS_FATAL_ERROR(
"Unable to find RNTI entry in UL DCI HARQ buffer for RNTI "
2172 (*itDci).second.at(harqId) =
uldci;
2177 NS_LOG_ERROR(
"No info find in HARQ buffer for UE (might change eNB) "
2180 (*itStat).second.at(harqId) = 0;
2183 NS_LOG_INFO(
this <<
" UE Allocation RNTI " << (*it).first <<
" startPRB "
2187 << (uint16_t)harqId);
2193 (*itStats).second.lastTtiBytesTransmitted =
uldci.m_tbSize;
2197 NS_LOG_DEBUG(
this <<
" No Stats for this allocated UE");
2218 (*itStats).second.totalBytesTransmitted += (*itStats).second.lastTtiBytesTransmitted;
2221 (*itStats).second.lastAveragedThroughput =
2222 ((1.0 - (1.0 /
m_timeWindow)) * (*itStats).second.lastAveragedThroughput) +
2223 ((1.0 /
m_timeWindow) * (
double)((*itStats).second.lastTtiBytesTransmitted / 0.001));
2224 NS_LOG_INFO(
this <<
" UE total bytes " << (*itStats).second.totalBytesTransmitted);
2225 NS_LOG_INFO(
this <<
" UE average throughput " << (*itStats).second.lastAveragedThroughput);
2226 (*itStats).second.lastTtiBytesTransmitted = 0;
2252 for (
unsigned int i = 0;
i < params.m_macCeList.size();
i++)
2266 uint8_t
bsrId = params.m_macCeList.at(
i).m_macCeValue.m_bufferStatus.at(
lcg);
2270 uint16_t rnti = params.m_macCeList.at(
i).m_rnti;
2271 NS_LOG_LOGIC(
this <<
"RNTI=" << rnti <<
" buffer=" << buffer);
2276 m_ceBsrRxed.insert(std::pair<uint16_t, uint32_t>(rnti, buffer));
2281 (*it).second = buffer;
2315 switch (params.m_ulCqi.m_type)
2318 NS_LOG_DEBUG(
this <<
" Collect PUSCH CQIs of Frame no. " << (params.m_sfnSf >> 4)
2319 <<
" subframe no. " << (0xF & params.m_sfnSf));
2325 for (
uint32_t i = 0;
i < (*itMap).second.size();
i++)
2333 std::vector<double>
newCqi;
2353 (*itCqi).second.at(
i) =
sinr;
2354 NS_LOG_DEBUG(
this <<
" RNTI " << (*itMap).second.at(
i) <<
" RB " <<
i <<
" SINR "
2366 NS_LOG_DEBUG(
this <<
" Collect SRS CQIs of Frame no. " << (params.m_sfnSf >> 4)
2367 <<
" subframe no. " << (0xF & params.m_sfnSf));
2370 NS_ASSERT(!params.m_vendorSpecificList.empty());
2371 for (std::size_t
i = 0;
i < params.m_vendorSpecificList.size();
i++)
2377 rnti =
vsp->GetRnti();
2384 std::vector<double>
newCqi;
2389 NS_LOG_INFO(
this <<
" RNTI " << rnti <<
" new SRS-CQI for RB " <<
j <<
" value "
2392 m_ueCqi.insert(std::pair<uint16_t, std::vector<double>>(rnti,
newCqi));
2402 (*itCqi).second.at(
j) =
sinr;
2403 NS_LOG_INFO(
this <<
" RNTI " << rnti <<
" update SRS-CQI for RB " <<
j <<
" value "
2415 NS_FATAL_ERROR(
"PfFfMacScheduler supports only PUSCH and SRS UL-CQIs");
2430 NS_LOG_INFO(
this <<
" P10-CQI for user " << (*itP10).first <<
" is "
2432 if ((*itP10).second == 0)
2437 " Does not find CQI report for user " << (*itP10).first);
2438 NS_LOG_INFO(
this <<
" P10-CQI expired for user " << (*itP10).first);
2455 NS_LOG_INFO(
this <<
" A30-CQI for user " << (*itA30).first <<
" is "
2457 if ((*itA30).second == 0)
2462 " Does not find CQI report for user " << (*itA30).first);
2463 NS_LOG_INFO(
this <<
" A30-CQI expired for user " << (*itA30).first);
2484 NS_LOG_INFO(
this <<
" UL-CQI for user " << (*itUl).first <<
" is "
2486 if ((*itUl).second == 0)
2491 " Does not find CQI report for user " << (*itUl).first);
2492 NS_LOG_INFO(
this <<
" UL-CQI exired for user " << (*itUl).first);
2493 (*itMap).second.clear();
2514 NS_LOG_INFO(
this <<
" UE " << rnti <<
" LC " << (uint16_t)lcid <<
" txqueue "
2515 << (*it).second.m_rlcTransmissionQueueSize <<
" retxqueue "
2516 << (*it).second.m_rlcRetransmissionQueueSize <<
" status "
2517 << (*it).second.m_rlcStatusPduSize <<
" decrease " << size);
2520 if (((*it).second.m_rlcStatusPduSize > 0) && (size >= (*it).second.m_rlcStatusPduSize))
2522 (*it).second.m_rlcStatusPduSize = 0;
2524 else if (((*it).second.m_rlcRetransmissionQueueSize > 0) &&
2525 (size >= (*it).second.m_rlcRetransmissionQueueSize))
2527 (*it).second.m_rlcRetransmissionQueueSize = 0;
2529 else if ((*it).second.m_rlcTransmissionQueueSize > 0)
2546 if ((*it).second.m_rlcTransmissionQueueSize <= size -
rlcOverhead)
2548 (*it).second.m_rlcTransmissionQueueSize = 0;
2552 (*it).second.m_rlcTransmissionQueueSize -= size -
rlcOverhead;
2558 NS_LOG_ERROR(
this <<
" Does not find DL RLC Buffer Report of UE " << rnti);
2569 NS_LOG_INFO(
this <<
" UE " << rnti <<
" size " << size <<
" BSR " << (*it).second);
2570 if ((*it).second >= size)
2572 (*it).second -= size;
2581 NS_LOG_ERROR(
this <<
" Does not find BSR report info of UE " << rnti);
2588 NS_LOG_FUNCTION(
this <<
" RNTI " << rnti <<
" txMode " << (uint16_t)txMode);
2590 params.m_rnti = rnti;
2591 params.m_transmissionMode = txMode;
AttributeValue implementation for Boolean.
static uint32_t BsrId2BufferSize(uint8_t val)
Convert BSR ID to buffer size.
Implements the SCHED SAP and CSCHED SAP for the Channel and QoS Aware Scheduler.
std::map< uint16_t, DlHarqRlcPduListBuffer_t > m_dlHarqProcessesRlcPduListBuffer
DL HARQ process RLC PDU list buffer.
FfMacCschedSapProvider * m_cschedSapProvider
Csched SAP provider.
void RefreshHarqProcesses()
Refresh HARQ processes according to the timers.
int GetRbgSize(int dlbandwidth)
Get RBG Size.
void DoSchedUlTriggerReq(const FfMacSchedSapProvider::SchedUlTriggerReqParameters ¶ms)
Sched UL Trigger Request.
std::map< uint16_t, CqasFlowPerf_t > m_flowStatsDl
Map of UE statistics (per RNTI basis) in downlink.
std::map< uint16_t, uint32_t > m_p10CqiTimers
Map of UE's timers on DL CQI P01 received.
std::map< uint16_t, uint8_t > m_dlHarqCurrentProcessId
DL HARQ process ID.
static TypeId GetTypeId()
Get the type ID.
std::map< uint16_t, DlHarqProcessesTimer_t > m_dlHarqProcessesTimer
DL HARQ process timers.
double m_timeWindow
time window
std::map< uint16_t, uint32_t > m_a30CqiTimers
Map of UE's timers on DL CQI A30 received.
std::map< uint16_t, std::vector< double > > m_ueCqi
Map of UEs' UL-CQI per RBG.
std::map< uint16_t, uint32_t > m_ueCqiTimers
Map of UEs' timers on UL-CQI per RBG.
void DoSchedDlPagingBufferReq(const FfMacSchedSapProvider::SchedDlPagingBufferReqParameters ¶ms)
Sched DL Paging Buffer Request.
~CqaFfMacScheduler() override
Destructor.
unsigned int LcActivePerFlow(uint16_t rnti)
LC Active per flow.
void SetLteFfrSapProvider(LteFfrSapProvider *s) override
Set the Provider part of the LteFfrSap that this Scheduler will interact with.
FfMacSchedSapUser * m_schedSapUser
MAC Sched SAP user.
void DoSchedDlTriggerReq(const FfMacSchedSapProvider::SchedDlTriggerReqParameters ¶ms)
Sched DL RLC Buffer Request.
void UpdateDlRlcBufferInfo(uint16_t rnti, uint8_t lcid, uint16_t size)
Update DL RLC buffer info.
LteFfrSapProvider * m_ffrSapProvider
FFR SAP provider.
uint8_t UpdateHarqProcessId(uint16_t rnti)
Update and return a new process Id for the RNTI specified.
std::map< uint16_t, DlHarqProcessesDciBuffer_t > m_dlHarqProcessesDciBuffer
DL HARQ process DCI buffer.
void DoSchedDlRlcBufferReq(const FfMacSchedSapProvider::SchedDlRlcBufferReqParameters ¶ms)
Sched DL RLC Buffer Request.
std::map< uint16_t, uint8_t > m_ulHarqCurrentProcessId
UL HARQ current process ID.
friend class MemberSchedSapProvider< CqaFfMacScheduler >
allow MemberSchedSapProvider<CqaFfMacScheduler> class friend access
std::map< uint16_t, SbMeasResult_s > m_a30CqiRxed
Map of UE's DL CQI A30 received.
std::vector< RachListElement_s > m_rachList
RACH list.
void DoSchedDlMacBufferReq(const FfMacSchedSapProvider::SchedDlMacBufferReqParameters ¶ms)
Sched DL MAC Buffer Request.
void DoCschedLcReleaseReq(const FfMacCschedSapProvider::CschedLcReleaseReqParameters ¶ms)
Csched LC Release Request.
void DoSchedUlMacCtrlInfoReq(const FfMacSchedSapProvider::SchedUlMacCtrlInfoReqParameters ¶ms)
Sched UL MAC Control Info Request.
void DoCschedLcConfigReq(const FfMacCschedSapProvider::CschedLcConfigReqParameters ¶ms)
Csched LC Config Request.
FfMacCschedSapUser * m_cschedSapUser
MAC Csched SAP user.
bool HarqProcessAvailability(uint16_t rnti)
Return the availability of free process for the RNTI specified.
LteFfrSapUser * m_ffrSapUser
FFR SAP user.
void UpdateUlRlcBufferInfo(uint16_t rnti, uint16_t size)
Update UL RLC buffer info.
std::map< uint16_t, UlHarqProcessesStatus_t > m_ulHarqProcessesStatus
UL HARQ process status.
uint8_t m_ulGrantMcs
MCS for UL grant (default 0)
void DoSchedUlNoiseInterferenceReq(const FfMacSchedSapProvider::SchedUlNoiseInterferenceReqParameters ¶ms)
Sched UL Noise InterferenceRequest.
void DoSchedUlCqiInfoReq(const FfMacSchedSapProvider::SchedUlCqiInfoReqParameters ¶ms)
Sched UL CGI Info Request.
std::map< LteFlowId_t, LogicalChannelConfigListElement_s > m_ueLogicalChannelsConfigList
Map of UE logical channel config list.
std::map< uint16_t, uint8_t > m_uesTxMode
txMode of the UEs
std::vector< uint16_t > m_rachAllocationMap
RACH allocation map.
void SetFfMacSchedSapUser(FfMacSchedSapUser *s) override
set the user part of the FfMacSchedSap that this Scheduler will interact with.
std::map< uint16_t, uint8_t > m_p10CqiRxed
Map of UE's DL CQI P01 received.
void DoDispose() override
Destructor implementation.
std::map< uint16_t, std::vector< uint16_t > > m_allocationMaps
Map of previous allocated UE per RBG (used to retrieve info from UL-CQI)
void DoSchedDlRachInfoReq(const FfMacSchedSapProvider::SchedDlRachInfoReqParameters ¶ms)
Sched DL RACH Info Request.
std::map< uint16_t, UlHarqProcessesDciBuffer_t > m_ulHarqProcessesDciBuffer
UL HARQ process DCI buffer.
void RefreshUlCqiMaps()
Refresh UL CGI maps.
Ptr< LteAmc > m_amc
LTE AMC object.
void DoSchedDlCqiInfoReq(const FfMacSchedSapProvider::SchedDlCqiInfoReqParameters ¶ms)
Sched DL CGI Info Request.
std::vector< DlInfoListElement_s > m_dlInfoListBuffered
DL HARQ retx buffered.
void DoCschedUeReleaseReq(const FfMacCschedSapProvider::CschedUeReleaseReqParameters ¶ms)
Csched UE Release Request.
FfMacSchedSapProvider * GetFfMacSchedSapProvider() override
void SetFfMacCschedSapUser(FfMacCschedSapUser *s) override
set the user part of the FfMacCschedSap that this Scheduler will interact with.
uint32_t m_cqiTimersThreshold
std::map< uint16_t, CqasFlowPerf_t > m_flowStatsUl
Map of UE statistics (per RNTI basis)
FfMacSchedSapProvider * m_schedSapProvider
Sched SAP provider.
FfMacCschedSapProvider * GetFfMacCschedSapProvider() override
void DoCschedCellConfigReq(const FfMacCschedSapProvider::CschedCellConfigReqParameters ¶ms)
Csched Cell Config Request.
friend class MemberCschedSapProvider< CqaFfMacScheduler >
allow MemberCschedSapProvider<CqaFfMacScheduler> class friend access
double EstimateUlSinr(uint16_t rnti, uint16_t rb)
Estimate UL Sinr.
void RefreshDlCqiMaps()
Refresh DL CGI maps.
void DoCschedUeConfigReq(const FfMacCschedSapProvider::CschedUeConfigReqParameters ¶ms)
Csched UE Config Request.
FfMacCschedSapProvider::CschedCellConfigReqParameters m_cschedCellConfig
Internal parameters.
std::map< uint16_t, DlHarqProcessesStatus_t > m_dlHarqProcessesStatus
DL HARQ process statuses.
CqaFfMacScheduler()
Constructor.
LteFfrSapUser * GetLteFfrSapUser() override
uint16_t m_nextRntiUl
RNTI of the next user to be served next scheduling in UL.
std::map< LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters > m_rlcBufferReq
Vectors of UE's LC info.
std::string m_CqaMetric
CQA metric name.
std::map< uint16_t, uint32_t > m_ceBsrRxed
Map of UE's buffer status reports received.
bool m_harqOn
m_harqOn when false inhibit the HARQ mechanisms (by default active)
void DoSchedUlSrInfoReq(const FfMacSchedSapProvider::SchedUlSrInfoReqParameters ¶ms)
Sched UL Sr Info Request.
void TransmissionModeConfigurationUpdate(uint16_t rnti, uint8_t txMode)
Trans mode config update.
FfMacCschedSapUser class.
virtual void CschedUeConfigCnf(const CschedUeConfigCnfParameters ¶ms)=0
CSCHED_UE_CONFIG_CNF.
virtual void CschedUeConfigUpdateInd(const CschedUeConfigUpdateIndParameters ¶ms)=0
CSCHED_UE_UPDATE_IND.
virtual void SchedUlConfigInd(const SchedUlConfigIndParameters ¶ms)=0
SCHED_UL_CONFIG_IND.
virtual void SchedDlConfigInd(const SchedDlConfigIndParameters ¶ms)=0
SCHED_DL_CONFIG_IND.
This abstract base class identifies the interface by means of which the helper object can plug on the...
UlCqiFilter_t m_ulCqiFilter
UL CQI filter.
static double fpS11dot3toDouble(uint16_t val)
Convert from fixed point S11.3 notation to double.
Service Access Point (SAP) offered by the Frequency Reuse algorithm instance to the MAC Scheduler ins...
virtual uint8_t GetTpc(uint16_t rnti)=0
GetTpc.
virtual std::vector< bool > GetAvailableUlRbg()=0
Get vector of available RB in UL for this Cell.
virtual void ReportUlCqiInfo(const FfMacSchedSapProvider::SchedUlCqiInfoReqParameters ¶ms)=0
ReportUlCqiInfo.
virtual bool IsUlRbgAvailableForUe(int i, uint16_t rnti)=0
Check if UE can be served on i-th RB in UL.
virtual void ReportDlCqiInfo(const FfMacSchedSapProvider::SchedDlCqiInfoReqParameters ¶ms)=0
ReportDlCqiInfo.
virtual std::vector< bool > GetAvailableDlRbg()=0
Get vector of available RBG in DL for this Cell.
virtual uint16_t GetMinContinuousUlBandwidth()=0
Get the minimum continuous Ul bandwidth.
virtual bool IsDlRbgAvailableForUe(int i, uint16_t rnti)=0
Check if UE can be served on i-th RB in DL.
Service Access Point (SAP) offered by the eNodeB RRC instance to the Frequency Reuse algorithm instan...
Smart pointer class similar to boost::intrusive_ptr.
static Time Now()
Return the current simulation virtual time.
Hold variables of type string.
static uint8_t TxMode2LayerNum(uint8_t txMode)
Transmit mode 2 layer number.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Hold an unsigned integer type.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
#define NS_ABORT_MSG_IF(cond, msg)
Abnormal program termination if a condition is true, with a message.
#define NS_LOG_ERROR(msg)
Use NS_LOG to output a message of level LOG_ERROR.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Ptr< T > Create(Ts &&... args)
Create class instances by constructors with varying numbers of arguments and return them by Ptr.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
int RBG_index
RBG index typedef.
Ptr< const AttributeChecker > MakeBooleanChecker()
bool CqaKeyDescComparator(uint16_t key1, uint16_t key2)
CQA key comparator.
constexpr double NO_SINR
Value for SINR outside the range defined by FF-API, used to indicate that there is no CQI for this el...
std::map< CQI_value, LteFlowId_t, bool(*)(uint8_t, uint8_t)>::iterator t_it_CQIToUE
CQI value map iterator typedef.
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
std::multimap< HOL_group, std::set< LteFlowId_t >, bool(*)(int, int)> t_map_HOLgroupToUEs
HOL group map typedef.
int HOL_group
HOL group typedef.
std::vector< UlDciListElement_s > UlHarqProcessesDciBuffer_t
UL HARQ process DCI buffer vector.
std::map< CQI_value, LteFlowId_t, bool(*)(uint8_t, uint8_t)> t_map_CQIToUE
CQI value map typedef.
bool CQIValueDescComparator(uint8_t key1, uint8_t key2)
CQI value comparator function.
std::vector< RlcPduList_t > DlHarqRlcPduListBuffer_t
Vector of the 8 HARQ processes per UE.
std::map< HOL_group, t_map_RBGToCQIsSorted >::iterator t_it_HOLGroupToRBGs
HOL group map iterator typedef.
constexpr uint32_t HARQ_DL_TIMEOUT
HARQ DL timeout.
std::map< RBG_index, t_map_CQIToUE >::iterator t_it_RBGToCQIsSorted
RBG index map iterator typedef.
std::map< HOL_group, t_map_RBGToCQIsSorted > t_map_HOLGroupToRBGs
HOL group map typedef.
constexpr uint32_t HARQ_PROC_NUM
Number of HARQ processes.
std::vector< DlDciListElement_s > DlHarqProcessesDciBuffer_t
DL HARQ process DCI buffer vector.
Ptr< const AttributeChecker > MakeStringChecker()
Ptr< const AttributeAccessor > MakeStringAccessor(T1 a1)
Ptr< const AttributeAccessor > MakeBooleanAccessor(T1 a1)
std::map< HOL_group, std::set< LteFlowId_t > >::iterator t_it_HOLgroupToUEs
HOL group multi map iterator typedef.
static const int CqaType0AllocationRbg[4]
CGA Type 0 Allocation.
std::vector< uint8_t > UlHarqProcessesStatus_t
UL HARQ process status vector.
std::vector< uint8_t > DlHarqProcessesTimer_t
DL HARQ process timer vector.
std::map< RBG_index, t_map_CQIToUE > t_map_RBGToCQIsSorted
RBG index map typedef.
uint8_t CQI_value
CQI value typedef.
std::vector< uint8_t > DlHarqProcessesStatus_t
DL HARQ process status vector.
bool CqaGroupDescComparator(int key1, int key2)
CGA group comparator function.
See section 4.3.8 buildDataListElement.
See section 4.3.10 buildRARListElement.
CGA Flow Performance structure.
Time flowStart
flow start time
See section 4.3.1 dlDciListElement.
std::vector< uint8_t > m_rv
Redundancy version.
Parameters of the API primitives.
uint16_t m_dlBandwidth
DL bandwidth.
uint16_t m_ulBandwidth
UL bandwidth.
Parameters of the CSCHED_LC_CONFIG_REQ primitive.
Parameters of the CSCHED_LC_RELEASE_REQ primitive.
Parameters of the CSCHED_UE_CONFIG_REQ primitive.
Parameters of the CSCHED_UE_RELEASE_REQ primitive.
Parameters of the CSCHED_UE_CONFIG_CNF primitive.
Parameters of the CSCHED_UE_CONFIG_UPDATE_IND primitive.
Parameters of the SCHED_DL_CQI_INFO_REQ primitive.
Parameters of the SCHED_DL_MAC_BUFFER_REQ primitive.
Parameters of the SCHED_DL_PAGING_BUFFER_REQ primitive.
Parameters of the SCHED_DL_RACH_INFO_REQ primitive.
Parameters of the API primitives.
Parameters of the SCHED_DL_TRIGGER_REQ primitive.
Parameters of the SCHED_UL_CQI_INFO_REQ primitive.
Parameters of the SCHED_UL_MAC_CTRL_INFO_REQ primitive.
Parameters of the SCHED_UL_NOISE_INTERFERENCE_REQ primitive.
Parameters of the SCHED_UL_SR_INFO_REQ primitive.
Parameters of the SCHED_UL_TRIGGER_REQ primitive.
Parameters of the API primitives.
Parameters of the SCHED_UL_CONFIG_IND primitive.
See section 4.3.4 logicalChannelConfigListElement.
uint64_t m_eRabGuaranteedBitrateDl
ERAB guaranteed bit rate DL.
See section 4.3.9 rlcPDU_ListElement.
uint8_t m_logicalChannelIdentity
logical channel identity
See section 4.3.2 ulDciListElement.
qos_rb_and_CQI_assigned_to_lc
uint8_t cqi_value_for_lc
CQI indicator value.
uint16_t resource_block_index
Resource block indexHOL_GROUP_index.