23 #include <ns3/pointer.h>
26 #include <ns3/simulator.h>
27 #include <ns3/lte-amc.h>
28 #include <ns3/pss-ff-mac-scheduler.h>
29 #include <ns3/lte-vendor-specific-parameters.h>
30 #include <ns3/boolean.h>
32 #include <ns3/string.h>
40 int PssType0AllocationRbg[4] = {
48 NS_OBJECT_ENSURE_REGISTERED (PssFfMacScheduler);
69 PssSchedulerMemberCschedSapProvider::PssSchedulerMemberCschedSapProvider ()
73 PssSchedulerMemberCschedSapProvider::PssSchedulerMemberCschedSapProvider (PssFfMacScheduler* scheduler) : m_scheduler (scheduler)
81 m_scheduler->DoCschedCellConfigReq (params);
85 PssSchedulerMemberCschedSapProvider::CschedUeConfigReq (
const struct CschedUeConfigReqParameters& params)
87 m_scheduler->DoCschedUeConfigReq (params);
92 PssSchedulerMemberCschedSapProvider::CschedLcConfigReq (
const struct CschedLcConfigReqParameters& params)
94 m_scheduler->DoCschedLcConfigReq (params);
98 PssSchedulerMemberCschedSapProvider::CschedLcReleaseReq (
const struct CschedLcReleaseReqParameters& params)
100 m_scheduler->DoCschedLcReleaseReq (params);
104 PssSchedulerMemberCschedSapProvider::CschedUeReleaseReq (
const struct CschedUeReleaseReqParameters& params)
106 m_scheduler->DoCschedUeReleaseReq (params);
138 PssSchedulerMemberSchedSapProvider::PssSchedulerMemberSchedSapProvider ()
143 PssSchedulerMemberSchedSapProvider::PssSchedulerMemberSchedSapProvider (PssFfMacScheduler* scheduler)
144 : m_scheduler (scheduler)
149 PssSchedulerMemberSchedSapProvider::SchedDlRlcBufferReq (
const struct SchedDlRlcBufferReqParameters& params)
151 m_scheduler->DoSchedDlRlcBufferReq (params);
155 PssSchedulerMemberSchedSapProvider::SchedDlPagingBufferReq (
const struct SchedDlPagingBufferReqParameters& params)
157 m_scheduler->DoSchedDlPagingBufferReq (params);
161 PssSchedulerMemberSchedSapProvider::SchedDlMacBufferReq (
const struct SchedDlMacBufferReqParameters& params)
163 m_scheduler->DoSchedDlMacBufferReq (params);
167 PssSchedulerMemberSchedSapProvider::SchedDlTriggerReq (
const struct SchedDlTriggerReqParameters& params)
169 m_scheduler->DoSchedDlTriggerReq (params);
173 PssSchedulerMemberSchedSapProvider::SchedDlRachInfoReq (
const struct SchedDlRachInfoReqParameters& params)
175 m_scheduler->DoSchedDlRachInfoReq (params);
179 PssSchedulerMemberSchedSapProvider::SchedDlCqiInfoReq (
const struct SchedDlCqiInfoReqParameters& params)
181 m_scheduler->DoSchedDlCqiInfoReq (params);
185 PssSchedulerMemberSchedSapProvider::SchedUlTriggerReq (
const struct SchedUlTriggerReqParameters& params)
187 m_scheduler->DoSchedUlTriggerReq (params);
191 PssSchedulerMemberSchedSapProvider::SchedUlNoiseInterferenceReq (
const struct SchedUlNoiseInterferenceReqParameters& params)
193 m_scheduler->DoSchedUlNoiseInterferenceReq (params);
197 PssSchedulerMemberSchedSapProvider::SchedUlSrInfoReq (
const struct SchedUlSrInfoReqParameters& params)
199 m_scheduler->DoSchedUlSrInfoReq (params);
203 PssSchedulerMemberSchedSapProvider::SchedUlMacCtrlInfoReq (
const struct SchedUlMacCtrlInfoReqParameters& params)
205 m_scheduler->DoSchedUlMacCtrlInfoReq (params);
209 PssSchedulerMemberSchedSapProvider::SchedUlCqiInfoReq (
const struct SchedUlCqiInfoReqParameters& params)
211 m_scheduler->DoSchedUlCqiInfoReq (params);
219 : m_cschedSapUser (0),
224 m_amc = CreateObject <LteAmc> ();
238 m_dlHarqProcessesDciBuffer.clear ();
239 m_dlHarqProcessesTimer.clear ();
240 m_dlHarqProcessesRlcPduListBuffer.clear ();
241 m_dlInfoListBuffered.clear ();
242 m_ulHarqCurrentProcessId.clear ();
243 m_ulHarqProcessesStatus.clear ();
244 m_ulHarqProcessesDciBuffer.clear ();
245 delete m_cschedSapProvider;
246 delete m_schedSapProvider;
250 PssFfMacScheduler::GetTypeId (
void)
254 .AddConstructor<PssFfMacScheduler> ()
255 .AddAttribute (
"CqiTimerThreshold",
256 "The number of TTIs a CQI is valid (default 1000 - 1 sec.)",
258 MakeUintegerAccessor (&PssFfMacScheduler::m_cqiTimersThreshold),
259 MakeUintegerChecker<uint32_t> ())
260 .AddAttribute (
"PssFdSchedulerType",
261 "FD scheduler in PSS (default value is PFsch)",
263 MakeStringAccessor (&PssFfMacScheduler::m_fdSchedulerType),
264 MakeStringChecker ())
265 .AddAttribute (
"nMux",
266 "The number of UE selected by TD scheduler (default value is 0)",
268 MakeUintegerAccessor (&PssFfMacScheduler::m_nMux),
269 MakeUintegerChecker<uint32_t> ())
270 .AddAttribute (
"HarqEnabled",
271 "Activate/Deactivate the HARQ [by default is active].",
274 MakeBooleanChecker ())
275 .AddAttribute (
"UlGrantMcs",
276 "The MCS of the UL grant, must be [0..15] (default 0)",
278 MakeUintegerAccessor (&PssFfMacScheduler::m_ulGrantMcs),
279 MakeUintegerChecker<uint8_t> ())
301 return m_cschedSapProvider;
307 return m_schedSapProvider;
315 m_cschedCellConfig = params;
316 m_rachAllocationMap.resize (m_cschedCellConfig.m_ulBandwidth, 0);
318 cnf.m_result = SUCCESS;
319 m_cschedSapUser->CschedUeConfigCnf (cnf);
324 PssFfMacScheduler::DoCschedUeConfigReq (
const struct FfMacCschedSapProvider::CschedUeConfigReqParameters& params)
326 NS_LOG_FUNCTION (
this <<
" RNTI " << params.m_rnti <<
" txMode " << (uint16_t)params.m_transmissionMode);
327 std::map <uint16_t,uint8_t>::iterator it = m_uesTxMode.find (params.m_rnti);
328 if (it == m_uesTxMode.end ())
330 m_uesTxMode.insert (std::pair <uint16_t, double> (params.m_rnti, params.m_transmissionMode));
332 m_dlHarqCurrentProcessId.insert (std::pair <uint16_t,uint8_t > (params.m_rnti, 0));
333 DlHarqProcessesStatus_t dlHarqPrcStatus;
334 dlHarqPrcStatus.resize (8,0);
335 m_dlHarqProcessesStatus.insert (std::pair <uint16_t, DlHarqProcessesStatus_t> (params.m_rnti, dlHarqPrcStatus));
336 DlHarqProcessesTimer_t dlHarqProcessesTimer;
337 dlHarqProcessesTimer.resize (8,0);
338 m_dlHarqProcessesTimer.insert (std::pair <uint16_t, DlHarqProcessesTimer_t> (params.m_rnti, dlHarqProcessesTimer));
339 DlHarqProcessesDciBuffer_t dlHarqdci;
340 dlHarqdci.resize (8);
341 m_dlHarqProcessesDciBuffer.insert (std::pair <uint16_t, DlHarqProcessesDciBuffer_t> (params.m_rnti, dlHarqdci));
342 DlHarqRlcPduListBuffer_t dlHarqRlcPdu;
343 dlHarqRlcPdu.resize (2);
344 dlHarqRlcPdu.at (0).resize (8);
345 dlHarqRlcPdu.at (1).resize (8);
346 m_dlHarqProcessesRlcPduListBuffer.insert (std::pair <uint16_t, DlHarqRlcPduListBuffer_t> (params.m_rnti, dlHarqRlcPdu));
347 m_ulHarqCurrentProcessId.insert (std::pair <uint16_t,uint8_t > (params.m_rnti, 0));
348 UlHarqProcessesStatus_t ulHarqPrcStatus;
349 ulHarqPrcStatus.resize (8,0);
350 m_ulHarqProcessesStatus.insert (std::pair <uint16_t, UlHarqProcessesStatus_t> (params.m_rnti, ulHarqPrcStatus));
351 UlHarqProcessesDciBuffer_t ulHarqdci;
352 ulHarqdci.resize (8);
353 m_ulHarqProcessesDciBuffer.insert (std::pair <uint16_t, UlHarqProcessesDciBuffer_t> (params.m_rnti, ulHarqdci));
357 (*it).second = params.m_transmissionMode;
363 PssFfMacScheduler::DoCschedLcConfigReq (
const struct FfMacCschedSapProvider::CschedLcConfigReqParameters& params)
367 std::map <uint16_t, pssFlowPerf_t>::iterator it;
368 for (uint16_t i = 0; i < params.m_logicalChannelConfigList.size (); i++)
370 it = m_flowStatsDl.find (params.m_rnti);
372 if (it == m_flowStatsDl.end ())
374 double tbrDlInBytes = params.m_logicalChannelConfigList.at (i).m_eRabGuaranteedBitrateDl / 8;
375 double tbrUlInBytes = params.m_logicalChannelConfigList.at (i).m_eRabGuaranteedBitrateUl / 8;
377 pssFlowPerf_t flowStatsDl;
379 flowStatsDl.totalBytesTransmitted = 0;
380 flowStatsDl.lastTtiBytesTransmitted = 0;
381 flowStatsDl.lastAveragedThroughput = 1;
382 flowStatsDl.secondLastAveragedThroughput = 1;
383 flowStatsDl.targetThroughput = tbrDlInBytes;
384 m_flowStatsDl.insert (std::pair<uint16_t, pssFlowPerf_t> (params.m_rnti, flowStatsDl));
385 pssFlowPerf_t flowStatsUl;
387 flowStatsUl.totalBytesTransmitted = 0;
388 flowStatsUl.lastTtiBytesTransmitted = 0;
389 flowStatsUl.lastAveragedThroughput = 1;
390 flowStatsUl.secondLastAveragedThroughput = 1;
391 flowStatsUl.targetThroughput = tbrUlInBytes;
392 m_flowStatsUl.insert (std::pair<uint16_t, pssFlowPerf_t> (params.m_rnti, flowStatsUl));
399 double tbrDlInBytes = params.m_logicalChannelConfigList.at (i).m_eRabGuaranteedBitrateDl / 8;
400 double tbrUlInBytes = params.m_logicalChannelConfigList.at (i).m_eRabGuaranteedBitrateUl / 8;
401 m_flowStatsDl[(*it).first].targetThroughput = tbrDlInBytes;
402 m_flowStatsUl[(*it).first].targetThroughput = tbrUlInBytes;
410 PssFfMacScheduler::DoCschedLcReleaseReq (
const struct FfMacCschedSapProvider::CschedLcReleaseReqParameters& params)
413 for (uint16_t i = 0; i < params.m_logicalChannelIdentity.size (); i++)
415 std::map<LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator it = m_rlcBufferReq.begin ();
416 std::map<LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator temp;
417 while (it!=m_rlcBufferReq.end ())
419 if (((*it).first.m_rnti == params.m_rnti) && ((*it).first.m_lcId == params.m_logicalChannelIdentity.at (i)))
423 m_rlcBufferReq.erase (temp);
435 PssFfMacScheduler::DoCschedUeReleaseReq (
const struct FfMacCschedSapProvider::CschedUeReleaseReqParameters& params)
439 m_uesTxMode.erase (params.m_rnti);
440 m_dlHarqCurrentProcessId.erase (params.m_rnti);
441 m_dlHarqProcessesStatus.erase (params.m_rnti);
442 m_dlHarqProcessesTimer.erase (params.m_rnti);
443 m_dlHarqProcessesDciBuffer.erase (params.m_rnti);
444 m_dlHarqProcessesRlcPduListBuffer.erase (params.m_rnti);
445 m_ulHarqCurrentProcessId.erase (params.m_rnti);
446 m_ulHarqProcessesStatus.erase (params.m_rnti);
447 m_ulHarqProcessesDciBuffer.erase (params.m_rnti);
448 m_flowStatsDl.erase (params.m_rnti);
449 m_flowStatsUl.erase (params.m_rnti);
450 m_ceBsrRxed.erase (params.m_rnti);
451 std::map<LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator it = m_rlcBufferReq.begin ();
452 std::map<LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator temp;
453 while (it!=m_rlcBufferReq.end ())
455 if ((*it).first.m_rnti == params.m_rnti)
459 m_rlcBufferReq.erase (temp);
466 if (m_nextRntiUl == params.m_rnti)
476 PssFfMacScheduler::DoSchedDlRlcBufferReq (
const struct FfMacSchedSapProvider::SchedDlRlcBufferReqParameters& params)
478 NS_LOG_FUNCTION (
this << params.m_rnti << (uint32_t) params.m_logicalChannelIdentity);
481 std::map <LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator it;
483 LteFlowId_t flow (params.m_rnti, params.m_logicalChannelIdentity);
485 it = m_rlcBufferReq.find (flow);
487 if (it == m_rlcBufferReq.end ())
489 m_rlcBufferReq.insert (std::pair <LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters> (flow, params));
493 (*it).second = params;
500 PssFfMacScheduler::DoSchedDlPagingBufferReq (
const struct FfMacSchedSapProvider::SchedDlPagingBufferReqParameters& params)
508 PssFfMacScheduler::DoSchedDlMacBufferReq (
const struct FfMacSchedSapProvider::SchedDlMacBufferReqParameters& params)
516 PssFfMacScheduler::GetRbgSize (
int dlbandwidth)
518 for (
int i = 0; i < 4; i++)
520 if (dlbandwidth < PssType0AllocationRbg[i])
531 PssFfMacScheduler::LcActivePerFlow (uint16_t rnti)
533 std::map <LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator it;
535 for (it = m_rlcBufferReq.begin (); it != m_rlcBufferReq.end (); it++)
537 if (((*it).first.m_rnti == rnti) && (((*it).second.m_rlcTransmissionQueueSize > 0)
538 || ((*it).second.m_rlcRetransmissionQueueSize > 0)
539 || ((*it).second.m_rlcStatusPduSize > 0) ))
543 if ((*it).first.m_rnti > rnti)
558 std::map <uint16_t, uint8_t>::iterator it = m_dlHarqCurrentProcessId.find (rnti);
559 if (it == m_dlHarqCurrentProcessId.end ())
563 std::map <uint16_t, DlHarqProcessesStatus_t>::iterator itStat = m_dlHarqProcessesStatus.find (rnti);
564 if (itStat == m_dlHarqProcessesStatus.end ())
566 NS_FATAL_ERROR (
"No Process Id Statusfound for this RNTI " << rnti);
568 uint8_t i = (*it).second;
571 i = (i + 1) % HARQ_PROC_NUM;
573 while ( ((*itStat).second.at (i) != 0)&&(i != (*it).second));
574 if ((*itStat).second.at (i) == 0)
597 std::map <uint16_t, uint8_t>::iterator it = m_dlHarqCurrentProcessId.find (rnti);
598 if (it == m_dlHarqCurrentProcessId.end ())
602 std::map <uint16_t, DlHarqProcessesStatus_t>::iterator itStat = m_dlHarqProcessesStatus.find (rnti);
603 if (itStat == m_dlHarqProcessesStatus.end ())
605 NS_FATAL_ERROR (
"No Process Id Statusfound for this RNTI " << rnti);
607 uint8_t i = (*it).second;
610 i = (i + 1) % HARQ_PROC_NUM;
612 while ( ((*itStat).second.at (i) != 0)&&(i != (*it).second));
613 if ((*itStat).second.at (i) == 0)
616 (*itStat).second.at (i) = 1;
620 NS_FATAL_ERROR (
"No HARQ process available for RNTI " << rnti <<
" check before update with HarqProcessAvailability");
623 return ((*it).second);
632 std::map <uint16_t, DlHarqProcessesTimer_t>::iterator itTimers;
633 for (itTimers = m_dlHarqProcessesTimer.begin (); itTimers != m_dlHarqProcessesTimer.end (); itTimers ++)
635 for (uint16_t i = 0; i < HARQ_PROC_NUM; i++)
637 if ((*itTimers).second.at (i) == HARQ_DL_TIMEOUT)
641 NS_LOG_DEBUG (
this <<
" Reset HARQ proc " << i <<
" for RNTI " << (*itTimers).first);
642 std::map <uint16_t, DlHarqProcessesStatus_t>::iterator itStat = m_dlHarqProcessesStatus.find ((*itTimers).first);
643 if (itStat == m_dlHarqProcessesStatus.end ())
645 NS_FATAL_ERROR (
"No Process Id Status found for this RNTI " << (*itTimers).first);
647 (*itStat).second.at (i) = 0;
648 (*itTimers).second.at (i) = 0;
652 (*itTimers).second.at (i)++;
663 NS_LOG_FUNCTION (
this <<
" Frame no. " << (params.m_sfnSf >> 4) <<
" subframe no. " << (0xF & params.m_sfnSf));
673 int rbgSize = GetRbgSize (m_cschedCellConfig.m_dlBandwidth);
674 int rbgNum = m_cschedCellConfig.m_dlBandwidth / rbgSize;
675 std::map <uint16_t, std::vector <uint16_t> > allocationMap;
676 std::vector <bool> rbgMap;
677 uint16_t rbgAllocatedNum = 0;
678 std::set <uint16_t> rntiAllocated;
679 rbgMap.resize (m_cschedCellConfig.m_dlBandwidth / rbgSize,
false);
683 m_rachAllocationMap.resize (m_cschedCellConfig.m_ulBandwidth, 0);
684 uint16_t rbStart = 0;
685 std::vector <struct RachListElement_s>::iterator itRach;
686 for (itRach = m_rachList.begin (); itRach != m_rachList.end (); itRach++)
688 NS_ASSERT_MSG (m_amc->GetTbSizeFromMcs (m_ulGrantMcs, m_cschedCellConfig.m_ulBandwidth) > (*itRach).m_estimatedSize,
" Default UL Grant MCS does not allow to send RACH messages");
690 newRar.m_rnti = (*itRach).m_rnti;
694 newRar.m_grant.m_rnti = newRar.m_rnti;
695 newRar.m_grant.m_mcs = m_ulGrantMcs;
697 uint16_t tbSizeBits = 0;
699 while ((tbSizeBits < (*itRach).m_estimatedSize) && (rbStart + rbLen < m_cschedCellConfig.m_ulBandwidth))
702 tbSizeBits = m_amc->GetTbSizeFromMcs (m_ulGrantMcs, rbLen);
704 if (tbSizeBits < (*itRach).m_estimatedSize)
709 newRar.m_grant.m_rbStart = rbStart;
710 newRar.m_grant.m_rbLen = rbLen;
711 newRar.m_grant.m_tbSize = tbSizeBits / 8;
712 newRar.m_grant.m_hopping =
false;
713 newRar.m_grant.m_tpc = 0;
714 newRar.m_grant.m_cqiRequest =
false;
715 newRar.m_grant.m_ulDelay =
false;
716 NS_LOG_INFO (
this <<
" UL grant allocated to RNTI " << (*itRach).m_rnti <<
" rbStart " << rbStart <<
" rbLen " << rbLen <<
" MCS " << m_ulGrantMcs <<
" tbSize " << newRar.m_grant.m_tbSize);
717 for (uint16_t i = rbStart; i < rbStart + rbLen; i++)
719 m_rachAllocationMap.at (i) = (*itRach).m_rnti;
721 rbStart = rbStart + rbLen;
723 ret.m_buildRarList.push_back (newRar);
731 if (m_dlInfoListBuffered.size () > 0)
733 if (params.m_dlInfoList.size () > 0)
735 NS_LOG_INFO (
this <<
" Received DL-HARQ feedback");
736 m_dlInfoListBuffered.insert (m_dlInfoListBuffered.end (), params.m_dlInfoList.begin (), params.m_dlInfoList.end ());
741 if (params.m_dlInfoList.size () > 0)
743 m_dlInfoListBuffered = params.m_dlInfoList;
749 m_dlInfoListBuffered.clear ();
751 std::vector <struct DlInfoListElement_s> dlInfoListUntxed;
752 for (uint16_t i = 0; i < m_dlInfoListBuffered.size (); i++)
754 std::set <uint16_t>::iterator itRnti = rntiAllocated.find (m_dlInfoListBuffered.at (i).m_rnti);
755 if (itRnti != rntiAllocated.end ())
760 uint8_t nLayers = m_dlInfoListBuffered.at (i).m_harqStatus.size ();
761 std::vector <bool> retx;
762 NS_LOG_INFO (
this <<
" Processing DLHARQ feedback");
765 retx.push_back (m_dlInfoListBuffered.at (i).m_harqStatus.at (0) == DlInfoListElement_s::NACK);
766 retx.push_back (
false);
770 retx.push_back (m_dlInfoListBuffered.at (i).m_harqStatus.at (0) == DlInfoListElement_s::NACK);
771 retx.push_back (m_dlInfoListBuffered.at (i).m_harqStatus.at (1) == DlInfoListElement_s::NACK);
773 if (retx.at (0) || retx.at (1))
776 uint16_t rnti = m_dlInfoListBuffered.at (i).m_rnti;
777 uint8_t harqId = m_dlInfoListBuffered.at (i).m_harqProcessId;
778 NS_LOG_INFO (
this <<
" HARQ retx RNTI " << rnti <<
" harqId " << (uint16_t)harqId);
779 std::map <uint16_t, DlHarqProcessesDciBuffer_t>::iterator itHarq = m_dlHarqProcessesDciBuffer.find (rnti);
780 if (itHarq == m_dlHarqProcessesDciBuffer.end ())
785 DlDciListElement_s dci = (*itHarq).second.at (harqId);
787 if (dci.m_rv.size () == 1)
789 rv = dci.m_rv.at (0);
793 rv = (dci.m_rv.at (0) > dci.m_rv.at (1) ? dci.m_rv.at (0) : dci.m_rv.at (1));
799 NS_LOG_INFO (
"Maximum number of retransmissions reached -> drop process");
800 std::map <uint16_t, DlHarqProcessesStatus_t>::iterator it = m_dlHarqProcessesStatus.find (rnti);
801 if (it == m_dlHarqProcessesStatus.end ())
803 NS_LOG_ERROR (
"No info find in HARQ buffer for UE (might change eNB) " << m_dlInfoListBuffered.at (i).m_rnti);
805 (*it).second.at (harqId) = 0;
806 std::map <uint16_t, DlHarqRlcPduListBuffer_t>::iterator itRlcPdu = m_dlHarqProcessesRlcPduListBuffer.find (rnti);
807 if (itRlcPdu == m_dlHarqProcessesRlcPduListBuffer.end ())
809 NS_FATAL_ERROR (
"Unable to find RlcPdcList in HARQ buffer for RNTI " << m_dlInfoListBuffered.at (i).m_rnti);
811 for (uint16_t k = 0; k < (*itRlcPdu).second.size (); k++)
813 (*itRlcPdu).second.at (k).at (harqId).clear ();
819 std::vector <int> dciRbg;
821 NS_LOG_INFO (
"Original RBGs " << dci.m_rbBitmap <<
" rnti " << dci.m_rnti);
822 for (
int j = 0; j < 32; j++)
824 if (((dci.m_rbBitmap & mask) >> j) == 1)
826 dciRbg.push_back (j);
832 for (uint8_t j = 0; j < dciRbg.size (); j++)
834 if (rbgMap.at (dciRbg.at (j)) ==
true)
844 for (uint8_t j = 0; j < dciRbg.size (); j++)
846 rbgMap.at (dciRbg.at (j)) =
true;
847 NS_LOG_INFO (
"RBG " << dciRbg.at (j) <<
" assigned");
851 NS_LOG_INFO (
this <<
" Send retx in the same RBGs");
857 uint8_t rbgId = (dciRbg.at (dciRbg.size () - 1) + 1) % rbgNum;
858 uint8_t startRbg = dciRbg.at (dciRbg.size () - 1);
859 std::vector <bool> rbgMapCopy = rbgMap;
860 while ((j < dciRbg.size ())&&(startRbg != rbgId))
862 if (rbgMapCopy.at (rbgId) ==
false)
864 rbgMapCopy.at (rbgId) =
true;
865 dciRbg.at (j) = rbgId;
870 if (j == dciRbg.size ())
873 uint32_t rbgMask = 0;
874 for (uint16_t k = 0; k < dciRbg.size (); k++)
876 rbgMask = rbgMask + (0x1 << dciRbg.at (k));
879 dci.m_rbBitmap = rbgMask;
881 NS_LOG_INFO (
this <<
" Move retx in RBGs " << dciRbg.size ());
886 dlInfoListUntxed.push_back (params.m_dlInfoList.at (i));
887 NS_LOG_INFO (
this <<
" No resource for this retx -> buffer it");
891 BuildDataListElement_s newEl;
892 std::map <uint16_t, DlHarqRlcPduListBuffer_t>::iterator itRlcPdu = m_dlHarqProcessesRlcPduListBuffer.find (rnti);
893 if (itRlcPdu == m_dlHarqProcessesRlcPduListBuffer.end ())
895 NS_FATAL_ERROR (
"Unable to find RlcPdcList in HARQ buffer for RNTI " << rnti);
897 for (uint8_t j = 0; j < nLayers; j++)
901 if (j >= dci.m_ndi.size ())
904 dci.m_ndi.push_back (0);
905 dci.m_rv.push_back (0);
906 dci.m_mcs.push_back (0);
907 dci.m_tbsSize.push_back (0);
908 NS_LOG_INFO (
this <<
" layer " << (uint16_t)j <<
" no txed (MIMO transition)");
912 dci.m_ndi.at (j) = 0;
914 (*itHarq).second.at (harqId).m_rv.at (j)++;
915 NS_LOG_INFO (
this <<
" layer " << (uint16_t)j <<
" RV " << (uint16_t)dci.m_rv.at (j));
921 dci.m_ndi.at (j) = 0;
923 dci.m_mcs.at (j) = 0;
924 dci.m_tbsSize.at (j) = 0;
925 NS_LOG_INFO (
this <<
" layer " << (uint16_t)j <<
" no retx");
928 for (uint16_t k = 0; k < (*itRlcPdu).second.at (0).at (dci.m_harqProcess).size (); k++)
930 std::vector <struct RlcPduListElement_s> rlcPduListPerLc;
931 for (uint8_t j = 0; j < nLayers; j++)
935 if (j < dci.m_ndi.size ())
937 rlcPduListPerLc.push_back ((*itRlcPdu).second.at (j).at (dci.m_harqProcess).at (k));
942 if (rlcPduListPerLc.size () > 0)
944 newEl.m_rlcPduList.push_back (rlcPduListPerLc);
949 (*itHarq).second.at (harqId).m_rv = dci.m_rv;
951 std::map <uint16_t, DlHarqProcessesTimer_t>::iterator itHarqTimer = m_dlHarqProcessesTimer.find (rnti);
952 if (itHarqTimer== m_dlHarqProcessesTimer.end ())
954 NS_FATAL_ERROR (
"Unable to find HARQ timer for RNTI " << (uint16_t)rnti);
956 (*itHarqTimer).second.at (harqId) = 0;
957 ret.m_buildDataList.push_back (newEl);
958 rntiAllocated.insert (rnti);
963 NS_LOG_INFO (
this <<
" HARQ received ACK for UE " << m_dlInfoListBuffered.at (i).m_rnti);
964 std::map <uint16_t, DlHarqProcessesStatus_t>::iterator it = m_dlHarqProcessesStatus.find (m_dlInfoListBuffered.at (i).m_rnti);
965 if (it == m_dlHarqProcessesStatus.end ())
967 NS_FATAL_ERROR (
"No info find in HARQ buffer for UE " << m_dlInfoListBuffered.at (i).m_rnti);
969 (*it).second.at (m_dlInfoListBuffered.at (i).m_harqProcessId) = 0;
970 std::map <uint16_t, DlHarqRlcPduListBuffer_t>::iterator itRlcPdu = m_dlHarqProcessesRlcPduListBuffer.find (m_dlInfoListBuffered.at (i).m_rnti);
971 if (itRlcPdu == m_dlHarqProcessesRlcPduListBuffer.end ())
973 NS_FATAL_ERROR (
"Unable to find RlcPdcList in HARQ buffer for RNTI " << m_dlInfoListBuffered.at (i).m_rnti);
975 for (uint16_t k = 0; k < (*itRlcPdu).second.size (); k++)
977 (*itRlcPdu).second.at (k).at (m_dlInfoListBuffered.at (i).m_harqProcessId).clear ();
981 m_dlInfoListBuffered.clear ();
982 m_dlInfoListBuffered = dlInfoListUntxed;
985 std::map <uint16_t, pssFlowPerf_t>::iterator it;
986 std::map <uint16_t, pssFlowPerf_t> tdUeSet;
989 std::map <uint16_t, pssFlowPerf_t> ueSet;
990 for (it = m_flowStatsDl.begin (); it != m_flowStatsDl.end (); it++)
992 if( LcActivePerFlow ((*it).first) > 0 )
994 ueSet.insert(std::pair <uint16_t, pssFlowPerf_t> ((*it).first, (*it).second));
998 if (ueSet.size() != 0)
1002 std::vector <std::pair<double, uint16_t> > ueSet1;
1003 std::vector <std::pair<double,uint16_t> > ueSet2;
1004 for (it = ueSet.begin (); it != ueSet.end (); it++)
1006 std::set <uint16_t>::iterator itRnti = rntiAllocated.find ((*it).first);
1010 if (itRnti != rntiAllocated.end ())
1012 NS_LOG_DEBUG (
this <<
" RNTI discared for HARQ tx" << (uint16_t)(*it).first);
1016 NS_LOG_DEBUG (
this <<
" RNTI discared for HARQ id" << (uint16_t)(*it).first);
1021 double metric = 0.0;
1022 if ((*it).second.lastAveragedThroughput < (*it).second.targetThroughput )
1025 metric = 1 / (*it).second.lastAveragedThroughput;
1026 ueSet1.push_back(std::pair<double, uint16_t> (metric, (*it).first));
1031 std::map <uint16_t,uint8_t>::iterator itCqi;
1032 itCqi = m_p10CqiRxed.find ((*it).first);
1033 std::map <uint16_t,uint8_t>::iterator itTxMode;
1034 itTxMode = m_uesTxMode.find ((*it).first);
1035 if (itTxMode == m_uesTxMode.end())
1037 NS_FATAL_ERROR (
"No Transmission Mode info on user " << (*it).first);
1039 int nLayer = TransmissionModesLayers::TxMode2LayerNum ((*itTxMode).second);
1041 if (itCqi == m_p10CqiRxed.end())
1047 wbCqi = (*itCqi).second;
1052 if (LcActivePerFlow ((*it).first) > 0)
1055 double achievableRate = 0.0;
1056 for (uint8_t k = 0; k < nLayer; k++)
1059 mcs = m_amc->GetMcsFromCqi (wbCqi);
1060 achievableRate += ((m_amc->GetTbSizeFromMcs (mcs, rbgSize) / 8) / 0.001);
1063 metric = achievableRate / (*it).second.lastAveragedThroughput;
1067 ueSet2.push_back(std::pair<double, uint16_t> (metric, (*it).first));
1072 if (ueSet1.size () != 0 || ueSet2.size () != 0)
1075 std::sort (ueSet1.rbegin (), ueSet1.rend ());
1076 std::sort (ueSet2.rbegin (), ueSet2.rend ());
1085 if (ueSet1.size() + ueSet2.size() <=2 )
1088 nMux = (int)((ueSet1.size() + ueSet2.size()) / 2) ;
1090 for (it = m_flowStatsDl.begin (); it != m_flowStatsDl.end (); it--)
1092 std::vector <std::pair<double, uint16_t> >::iterator itSet;
1093 for (itSet = ueSet1.begin (); itSet != ueSet1.end () && nMux != 0; itSet++)
1095 std::map <uint16_t, pssFlowPerf_t>::iterator itUe;
1096 itUe = m_flowStatsDl.find((*itSet).second);
1097 tdUeSet.insert(std::pair<uint16_t, pssFlowPerf_t> ( (*itUe).first, (*itUe).second ) );
1104 for (itSet = ueSet2.begin (); itSet != ueSet2.end () && nMux != 0; itSet++)
1106 std::map <uint16_t, pssFlowPerf_t>::iterator itUe;
1107 itUe = m_flowStatsDl.find((*itSet).second);
1108 tdUeSet.insert(std::pair<uint16_t, pssFlowPerf_t> ( (*itUe).first, (*itUe).second ) );
1118 if ( m_fdSchedulerType.compare(
"CoItA") == 0)
1121 std::map < uint16_t, uint8_t > sbCqiSum;
1122 for (it = tdUeSet.begin (); it != tdUeSet.end (); it++)
1125 for (
int i = 0; i < rbgNum; i++)
1127 std::map <uint16_t,SbMeasResult_s>::iterator itCqi;
1128 itCqi = m_a30CqiRxed.find ((*it).first);
1129 std::map <uint16_t,uint8_t>::iterator itTxMode;
1130 itTxMode = m_uesTxMode.find ((*it).first);
1131 if (itTxMode == m_uesTxMode.end ())
1133 NS_FATAL_ERROR (
"No Transmission Mode info on user " << (*it).first);
1135 int nLayer = TransmissionModesLayers::TxMode2LayerNum ((*itTxMode).second);
1136 std::vector <uint8_t> sbCqis;
1137 if (itCqi == m_a30CqiRxed.end ())
1139 for (uint8_t k = 0; k < nLayer; k++)
1141 sbCqis.push_back (1);
1146 sbCqis = (*itCqi).second.m_higherLayerSelected.at (i).m_sbCqi;
1149 uint8_t cqi1 = sbCqis.at (0);
1151 if (sbCqis.size () > 1)
1153 cqi2 = sbCqis.at (1);
1157 if ((cqi1 > 0)||(cqi2 > 0))
1159 for (uint8_t k = 0; k < nLayer; k++)
1161 if (sbCqis.size () > k)
1163 sbCqi = sbCqis.at(k);
1175 sbCqiSum.insert (std::pair<uint16_t, uint8_t> ((*it).first, sum));
1178 for (
int i = 0; i < rbgNum; i++)
1180 if (rbgMap.at (i) ==
true)
1183 std::map <uint16_t, pssFlowPerf_t>::iterator itMax = tdUeSet.end ();
1184 double metricMax = 0.0;
1185 for (it = tdUeSet.begin (); it != tdUeSet.end (); it++)
1188 double weight = (*it).second.targetThroughput / (*it).second.lastAveragedThroughput;
1192 std::map < uint16_t, uint8_t>::iterator itSbCqiSum;
1193 itSbCqiSum = sbCqiSum.find((*it).first);
1195 std::map <uint16_t,SbMeasResult_s>::iterator itCqi;
1196 itCqi = m_a30CqiRxed.find ((*it).first);
1197 std::map <uint16_t,uint8_t>::iterator itTxMode;
1198 itTxMode = m_uesTxMode.find ((*it).first);
1199 if (itTxMode == m_uesTxMode.end())
1201 NS_FATAL_ERROR (
"No Transmission Mode info on user " << (*it).first);
1203 int nLayer = TransmissionModesLayers::TxMode2LayerNum ((*itTxMode).second);
1204 std::vector <uint8_t> sbCqis;
1205 if (itCqi == m_a30CqiRxed.end ())
1207 for (uint8_t k = 0; k < nLayer; k++)
1209 sbCqis.push_back (1);
1214 sbCqis = (*itCqi).second.m_higherLayerSelected.at (i).m_sbCqi;
1217 uint8_t cqi1 = sbCqis.at( 0);
1219 if (sbCqis.size () > 1)
1221 cqi2 = sbCqis.at(1);
1225 double colMetric = 0.0;
1226 if ((cqi1 > 0)||(cqi2 > 0))
1228 for (uint8_t k = 0; k < nLayer; k++)
1230 if (sbCqis.size () > k)
1232 sbCqi = sbCqis.at(k);
1239 colMetric += (double)sbCqi / (
double)(*itSbCqiSum).second;
1243 double metric = 0.0;
1245 metric= weight * colMetric;
1249 if (metric > metricMax )
1256 if (itMax == m_flowStatsDl.end ())
1263 allocationMap[(*itMax).first].push_back (i);
1264 rbgMap.at (i) =
true;
1271 if ( m_fdSchedulerType.compare(
"PFsch") == 0)
1274 for (
int i = 0; i < rbgNum; i++)
1276 if (rbgMap.at (i) ==
true)
1279 std::map <uint16_t, pssFlowPerf_t>::iterator itMax = tdUeSet.end ();
1280 double metricMax = 0.0;
1281 for (it = tdUeSet.begin (); it != tdUeSet.end (); it++)
1284 double weight = (*it).second.targetThroughput / (*it).second.lastAveragedThroughput;
1288 std::map <uint16_t,SbMeasResult_s>::iterator itCqi;
1289 itCqi = m_a30CqiRxed.find ((*it).first);
1290 std::map <uint16_t,uint8_t>::iterator itTxMode;
1291 itTxMode = m_uesTxMode.find ((*it).first);
1292 if (itTxMode == m_uesTxMode.end())
1294 NS_FATAL_ERROR (
"No Transmission Mode info on user " << (*it).first);
1296 int nLayer = TransmissionModesLayers::TxMode2LayerNum ((*itTxMode).second);
1297 std::vector <uint8_t> sbCqis;
1298 if (itCqi == m_a30CqiRxed.end ())
1300 for (uint8_t k = 0; k < nLayer; k++)
1302 sbCqis.push_back (1);
1307 sbCqis = (*itCqi).second.m_higherLayerSelected.at (i).m_sbCqi;
1310 uint8_t cqi1 = sbCqis.at(0);
1312 if (sbCqis.size () > 1)
1314 cqi2 = sbCqis.at(1);
1317 double schMetric = 0.0;
1318 if ((cqi1 > 0)||(cqi2 > 0))
1320 double achievableRate = 0.0;
1321 for (uint8_t k = 0; k < nLayer; k++)
1324 if (sbCqis.size () > k)
1326 mcs = m_amc->GetMcsFromCqi (sbCqis.at (k));
1333 achievableRate += ((m_amc->GetTbSizeFromMcs (mcs, rbgSize) / 8) / 0.001);
1335 schMetric = achievableRate / (*it).second.secondLastAveragedThroughput;
1338 double metric = 0.0;
1339 metric= weight * schMetric;
1341 if (metric > metricMax )
1348 if (itMax == m_flowStatsDl.end ())
1355 allocationMap[(*itMax).first].push_back (i);
1356 rbgMap.at (i) =
true;
1370 std::map <uint16_t, pssFlowPerf_t>::iterator itStats;
1371 for (itStats = m_flowStatsDl.begin (); itStats != m_flowStatsDl.end (); itStats++)
1373 (*itStats).second.lastTtiBytesTransmitted = 0;
1378 std::map <uint16_t, std::vector <uint16_t> >::iterator itMap = allocationMap.begin ();
1379 while (itMap != allocationMap.end ())
1382 BuildDataListElement_s newEl;
1383 newEl.m_rnti = (*itMap).first;
1385 DlDciListElement_s newDci;
1386 newDci.m_rnti = (*itMap).first;
1389 uint16_t lcActives = LcActivePerFlow ((*itMap).first);
1390 NS_LOG_INFO (
this <<
"Allocate user " << newEl.m_rnti <<
" rbg " << lcActives);
1391 uint16_t RgbPerRnti = (*itMap).second.size ();
1392 std::map <uint16_t,SbMeasResult_s>::iterator itCqi;
1393 itCqi = m_a30CqiRxed.find ((*itMap).first);
1394 std::map <uint16_t,uint8_t>::iterator itTxMode;
1395 itTxMode = m_uesTxMode.find ((*itMap).first);
1396 if (itTxMode == m_uesTxMode.end ())
1398 NS_FATAL_ERROR (
"No Transmission Mode info on user " << (*itMap).first);
1400 int nLayer = TransmissionModesLayers::TxMode2LayerNum ((*itTxMode).second);
1401 std::vector <uint8_t> worstCqi (2, 15);
1402 if (itCqi != m_a30CqiRxed.end ())
1404 for (uint16_t k = 0; k < (*itMap).second.size (); k++)
1406 if ((*itCqi).second.m_higherLayerSelected.size () > (*itMap).second.at (k))
1408 NS_LOG_INFO (
this <<
" RBG " << (*itMap).second.at (k) <<
" CQI " << (uint16_t)((*itCqi).second.m_higherLayerSelected.at ((*itMap).second.at (k)).m_sbCqi.at (0)) );
1409 for (uint8_t j = 0; j < nLayer; j++)
1411 if ((*itCqi).second.m_higherLayerSelected.at ((*itMap).second.at (k)).m_sbCqi.size () > j)
1413 if (((*itCqi).second.m_higherLayerSelected.at ((*itMap).second.at (k)).m_sbCqi.at (j)) < worstCqi.at (j))
1415 worstCqi.at (j) = ((*itCqi).second.m_higherLayerSelected.at ((*itMap).second.at (k)).m_sbCqi.at (j));
1421 worstCqi.at (j) = 1;
1427 for (uint8_t j = 0; j < nLayer; j++)
1429 worstCqi.at (j) = 1;
1436 for (uint8_t j = 0; j < nLayer; j++)
1438 worstCqi.at (j) = 1;
1441 for (uint8_t j = 0; j < nLayer; j++)
1443 NS_LOG_INFO (
this <<
" Layer " << (uint16_t)j <<
" CQI selected " << (uint16_t)worstCqi.at (j));
1445 uint32_t bytesTxed = 0;
1446 for (uint8_t j = 0; j < nLayer; j++)
1448 newDci.m_mcs.push_back (m_amc->GetMcsFromCqi (worstCqi.at (j)));
1449 int tbSize = (m_amc->GetTbSizeFromMcs (newDci.m_mcs.at (j), RgbPerRnti * rbgSize) / 8);
1450 newDci.m_tbsSize.push_back (tbSize);
1451 NS_LOG_INFO (
this <<
" Layer " << (uint16_t)j <<
" MCS selected" << m_amc->GetMcsFromCqi (worstCqi.at (j)));
1452 bytesTxed += tbSize;
1455 newDci.m_resAlloc = 0;
1456 newDci.m_rbBitmap = 0;
1457 uint32_t rbgMask = 0;
1458 for (uint16_t k = 0; k < (*itMap).second.size (); k++)
1460 rbgMask = rbgMask + (0x1 << (*itMap).second.at (k));
1461 NS_LOG_INFO (
this <<
" Allocated RBG " << (*itMap).second.at (k));
1463 newDci.m_rbBitmap = rbgMask;
1466 std::map <LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator itBufReq;
1467 for (itBufReq = m_rlcBufferReq.begin (); itBufReq != m_rlcBufferReq.end (); itBufReq++)
1469 if (((*itBufReq).first.m_rnti == (*itMap).first)
1470 && (((*itBufReq).second.m_rlcTransmissionQueueSize > 0)
1471 || ((*itBufReq).second.m_rlcRetransmissionQueueSize > 0)
1472 || ((*itBufReq).second.m_rlcStatusPduSize > 0) ))
1474 std::vector <struct RlcPduListElement_s> newRlcPduLe;
1475 for (uint8_t j = 0; j < nLayer; j++)
1477 RlcPduListElement_s newRlcEl;
1478 newRlcEl.m_logicalChannelIdentity = (*itBufReq).first.m_lcId;
1479 newRlcEl.m_size = newDci.m_tbsSize.at (j) / lcActives;
1480 NS_LOG_INFO (
this <<
" LCID " << (uint32_t) newRlcEl.m_logicalChannelIdentity <<
" size " << newRlcEl.m_size <<
" layer " << (uint16_t)j);
1481 newRlcPduLe.push_back (newRlcEl);
1482 UpdateDlRlcBufferInfo (newDci.m_rnti, newRlcEl.m_logicalChannelIdentity, newRlcEl.m_size);
1486 std::map <uint16_t, DlHarqRlcPduListBuffer_t>::iterator itRlcPdu = m_dlHarqProcessesRlcPduListBuffer.find ((*itMap).first);
1487 if (itRlcPdu == m_dlHarqProcessesRlcPduListBuffer.end ())
1489 NS_FATAL_ERROR (
"Unable to find RlcPdcList in HARQ buffer for RNTI " << (*itMap).first);
1491 (*itRlcPdu).second.at (j).at (newDci.m_harqProcess).push_back (newRlcEl);
1494 newEl.m_rlcPduList.push_back (newRlcPduLe);
1496 if ((*itBufReq).first.m_rnti > (*itMap).first)
1501 for (uint8_t j = 0; j < nLayer; j++)
1503 newDci.m_ndi.push_back (1);
1504 newDci.m_rv.push_back (0);
1507 newEl.m_dci = newDci;
1512 std::map <uint16_t, DlHarqProcessesDciBuffer_t>::iterator itDci = m_dlHarqProcessesDciBuffer.find (newEl.m_rnti);
1513 if (itDci == m_dlHarqProcessesDciBuffer.end ())
1515 NS_FATAL_ERROR (
"Unable to find RNTI entry in DCI HARQ buffer for RNTI " << newEl.m_rnti);
1517 (*itDci).second.at (newDci.m_harqProcess) = newDci;
1519 std::map <uint16_t, DlHarqProcessesTimer_t>::iterator itHarqTimer = m_dlHarqProcessesTimer.find (newEl.m_rnti);
1520 if (itHarqTimer== m_dlHarqProcessesTimer.end ())
1522 NS_FATAL_ERROR (
"Unable to find HARQ timer for RNTI " << (uint16_t)newEl.m_rnti);
1524 (*itHarqTimer).second.at (newDci.m_harqProcess) = 0;
1529 ret.m_buildDataList.push_back (newEl);
1531 std::map <uint16_t, pssFlowPerf_t>::iterator it;
1532 it = m_flowStatsDl.find ((*itMap).first);
1533 if (it != m_flowStatsDl.end ())
1535 (*it).second.lastTtiBytesTransmitted = bytesTxed;
1536 NS_LOG_INFO (
this <<
" UE total bytes txed " << (*it).second.lastTtiBytesTransmitted);
1547 ret.m_nrOfPdcchOfdmSymbols = 1;
1552 for (itStats = m_flowStatsDl.begin (); itStats != m_flowStatsDl.end (); itStats++)
1554 std::map <uint16_t, pssFlowPerf_t>::iterator itUeScheduleted = tdUeSet.end();
1555 itUeScheduleted = tdUeSet.find((*itStats).first);
1556 if (itUeScheduleted != tdUeSet.end())
1558 (*itStats).second.secondLastAveragedThroughput = ((1.0 - (1 / m_timeWindow)) * (*itStats).second.secondLastAveragedThroughput) + ((1 / m_timeWindow) * (double)((*itStats).second.lastTtiBytesTransmitted / 0.001));
1561 (*itStats).second.totalBytesTransmitted += (*itStats).second.lastTtiBytesTransmitted;
1563 (*itStats).second.lastAveragedThroughput = ((1.0 - (1.0 / m_timeWindow)) * (*itStats).second.lastAveragedThroughput) + ((1.0 / m_timeWindow) * (double)((*itStats).second.lastTtiBytesTransmitted / 0.001));
1564 (*itStats).second.lastTtiBytesTransmitted = 0;
1568 m_schedSapUser->SchedDlConfigInd (ret);
1575 PssFfMacScheduler::DoSchedDlRachInfoReq (
const struct FfMacSchedSapProvider::SchedDlRachInfoReqParameters& params)
1579 m_rachList = params.m_rachList;
1585 PssFfMacScheduler::DoSchedDlCqiInfoReq (
const struct FfMacSchedSapProvider::SchedDlCqiInfoReqParameters& params)
1589 for (
unsigned int i = 0; i < params.m_cqiList.size (); i++)
1591 if ( params.m_cqiList.at (i).m_cqiType == CqiListElement_s::P10 )
1594 std::map <uint16_t,uint8_t>::iterator it;
1595 uint16_t rnti = params.m_cqiList.at (i).m_rnti;
1596 it = m_p10CqiRxed.find (rnti);
1597 if (it == m_p10CqiRxed.end ())
1600 m_p10CqiRxed.insert ( std::pair<uint16_t, uint8_t > (rnti, params.m_cqiList.at (i).m_wbCqi.at (0)) );
1602 m_p10CqiTimers.insert ( std::pair<uint16_t, uint32_t > (rnti, m_cqiTimersThreshold));
1607 (*it).second = params.m_cqiList.at (i).m_wbCqi.at (0);
1609 std::map <uint16_t,uint32_t>::iterator itTimers;
1610 itTimers = m_p10CqiTimers.find (rnti);
1611 (*itTimers).second = m_cqiTimersThreshold;
1614 else if ( params.m_cqiList.at (i).m_cqiType == CqiListElement_s::A30 )
1617 std::map <uint16_t,SbMeasResult_s>::iterator it;
1618 uint16_t rnti = params.m_cqiList.at (i).m_rnti;
1619 it = m_a30CqiRxed.find (rnti);
1620 if (it == m_a30CqiRxed.end ())
1623 m_a30CqiRxed.insert ( std::pair<uint16_t, SbMeasResult_s > (rnti, params.m_cqiList.at (i).m_sbMeasResult) );
1624 m_a30CqiTimers.insert ( std::pair<uint16_t, uint32_t > (rnti, m_cqiTimersThreshold));
1629 (*it).second = params.m_cqiList.at (i).m_sbMeasResult;
1630 std::map <uint16_t,uint32_t>::iterator itTimers;
1631 itTimers = m_a30CqiTimers.find (rnti);
1632 (*itTimers).second = m_cqiTimersThreshold;
1646 PssFfMacScheduler::EstimateUlSinr (uint16_t rnti, uint16_t rb)
1648 std::map <uint16_t, std::vector <double> >::iterator itCqi = m_ueCqi.find (rnti);
1649 if (itCqi == m_ueCqi.end ())
1660 for (uint32_t i = 0; i < m_cschedCellConfig.m_ulBandwidth; i++)
1662 double sinr = (*itCqi).second.at (i);
1663 if (sinr != NO_SINR)
1669 double estimatedSinr = sinrSum / (double)sinrNum;
1671 (*itCqi).second.at (rb) = estimatedSinr;
1672 return (estimatedSinr);
1677 PssFfMacScheduler::DoSchedUlTriggerReq (
const struct FfMacSchedSapProvider::SchedUlTriggerReqParameters& params)
1679 NS_LOG_FUNCTION (
this <<
" UL - Frame no. " << (params.m_sfnSf >> 4) <<
" subframe no. " << (0xF & params.m_sfnSf) <<
" size " << params.m_ulInfoList.size ());
1681 RefreshUlCqiMaps ();
1684 FfMacSchedSapUser::SchedUlConfigIndParameters ret;
1685 std::vector <bool> rbMap;
1686 uint16_t rbAllocatedNum = 0;
1687 std::set <uint16_t> rntiAllocated;
1688 std::vector <uint16_t> rbgAllocationMap;
1690 rbgAllocationMap = m_rachAllocationMap;
1692 m_rachAllocationMap.clear ();
1693 m_rachAllocationMap.resize (m_cschedCellConfig.m_ulBandwidth, 0);
1695 rbMap.resize (m_cschedCellConfig.m_ulBandwidth,
false);
1697 for (uint16_t i = 0; i < m_cschedCellConfig.m_ulBandwidth; i++)
1699 if (rbgAllocationMap.at (i) != 0)
1701 rbMap.at (i) =
true;
1711 std::map <uint16_t, uint8_t>::iterator itProcId;
1712 for (itProcId = m_ulHarqCurrentProcessId.begin (); itProcId != m_ulHarqCurrentProcessId.end (); itProcId++)
1714 (*itProcId).second = ((*itProcId).second + 1) % HARQ_PROC_NUM;
1717 for (uint16_t i = 0; i < params.m_ulInfoList.size (); i++)
1719 if (params.m_ulInfoList.at (i).m_receptionStatus == UlInfoListElement_s::NotOk)
1722 uint16_t rnti = params.m_ulInfoList.at (i).m_rnti;
1723 itProcId = m_ulHarqCurrentProcessId.find (rnti);
1724 if (itProcId == m_ulHarqCurrentProcessId.end ())
1726 NS_LOG_ERROR (
"No info find in HARQ buffer for UE (might change eNB) " << rnti);
1728 uint8_t harqId = (uint8_t)((*itProcId).second - HARQ_PERIOD) % HARQ_PROC_NUM;
1729 NS_LOG_INFO (
this <<
" UL-HARQ retx RNTI " << rnti <<
" harqId " << (uint16_t)harqId <<
" i " << i <<
" size " << params.m_ulInfoList.size ());
1730 std::map <uint16_t, UlHarqProcessesDciBuffer_t>::iterator itHarq = m_ulHarqProcessesDciBuffer.find (rnti);
1731 if (itHarq == m_ulHarqProcessesDciBuffer.end ())
1733 NS_LOG_ERROR (
"No info find in HARQ buffer for UE (might change eNB) " << rnti);
1736 UlDciListElement_s dci = (*itHarq).second.at (harqId);
1737 std::map <uint16_t, UlHarqProcessesStatus_t>::iterator itStat = m_ulHarqProcessesStatus.find (rnti);
1738 if (itStat == m_ulHarqProcessesStatus.end ())
1740 NS_LOG_ERROR (
"No info find in HARQ buffer for UE (might change eNB) " << rnti);
1742 if ((*itStat).second.at (harqId) >= 3)
1744 NS_LOG_INFO (
"Max number of retransmissions reached (UL)-> drop process");
1748 for (
int j = dci.m_rbStart; j < dci.m_rbStart + dci.m_rbLen; j++)
1750 if (rbMap.at (j) ==
true)
1759 for (
int j = dci.m_rbStart; j < dci.m_rbStart + dci.m_rbLen; j++)
1761 rbMap.at (j) =
true;
1762 rbgAllocationMap.at (j) = dci.m_rnti;
1766 NS_LOG_INFO (
this <<
" Send retx in the same RBs " << (uint16_t)dci.m_rbStart <<
" to " << dci.m_rbStart + dci.m_rbLen <<
" RV " << (*itStat).second.at (harqId) + 1);
1770 NS_LOG_INFO (
"Cannot allocate retx due to RACH allocations for UE " << rnti);
1775 (*itStat).second.at ((*itProcId).second) = (*itStat).second.at (harqId) + 1;
1776 (*itStat).second.at (harqId) = 0;
1777 (*itHarq).second.at ((*itProcId).second) = dci;
1778 ret.m_dciList.push_back (dci);
1779 rntiAllocated.insert (dci.m_rnti);
1783 NS_LOG_INFO (
this <<
" HARQ-ACK feedback from RNTI " << params.m_ulInfoList.at (i).m_rnti);
1788 std::map <uint16_t,uint32_t>::iterator it;
1791 for (it = m_ceBsrRxed.begin (); it != m_ceBsrRxed.end (); it++)
1793 std::set <uint16_t>::iterator itRnti = rntiAllocated.find ((*it).first);
1795 if (((*it).second > 0)&&(itRnti == rntiAllocated.end ()))
1803 if (ret.m_dciList.size () > 0)
1805 m_schedSapUser->SchedUlConfigInd (ret);
1813 uint16_t rbPerFlow = (m_cschedCellConfig.m_ulBandwidth) / (nflows + rntiAllocated.size ());
1818 int rbAllocated = 0;
1820 std::map <uint16_t, pssFlowPerf_t>::iterator itStats;
1821 if (m_nextRntiUl != 0)
1823 for (it = m_ceBsrRxed.begin (); it != m_ceBsrRxed.end (); it++)
1825 if ((*it).first == m_nextRntiUl)
1830 if (it == m_ceBsrRxed.end ())
1837 it = m_ceBsrRxed.begin ();
1838 m_nextRntiUl = (*it).first;
1842 std::set <uint16_t>::iterator itRnti = rntiAllocated.find ((*it).first);
1843 if ((itRnti != rntiAllocated.end ())||((*it).second == 0))
1847 if (it == m_ceBsrRxed.end ())
1850 it = m_ceBsrRxed.begin ();
1854 if (rbAllocated + rbPerFlow - 1 > m_cschedCellConfig.m_ulBandwidth)
1857 rbPerFlow = m_cschedCellConfig.m_ulBandwidth - rbAllocated;
1866 UlDciListElement_s uldci;
1867 uldci.m_rnti = (*it).first;
1868 uldci.m_rbLen = rbPerFlow;
1869 bool allocated =
false;
1870 NS_LOG_INFO (
this <<
" RB Allocated " << rbAllocated <<
" rbPerFlow " << rbPerFlow);
1871 while ((!allocated)&&((rbAllocated + rbPerFlow - 1) < m_cschedCellConfig.m_ulBandwidth) && (rbPerFlow != 0))
1875 for (uint16_t j = rbAllocated; j < rbAllocated + rbPerFlow; j++)
1877 if (rbMap.at (j) ==
true)
1885 uldci.m_rbStart = rbAllocated;
1887 for (uint16_t j = rbAllocated; j < rbAllocated + rbPerFlow; j++)
1889 rbMap.at (j) =
true;
1891 rbgAllocationMap.at (j) = (*it).first;
1893 rbAllocated += rbPerFlow;
1898 if (rbAllocated + rbPerFlow - 1 > m_cschedCellConfig.m_ulBandwidth)
1901 rbPerFlow = m_cschedCellConfig.m_ulBandwidth - rbAllocated;
1913 m_nextRntiUl = (*it).first;
1914 if (ret.m_dciList.size () > 0)
1916 m_schedSapUser->SchedUlConfigInd (ret);
1918 m_allocationMaps.insert (std::pair <uint16_t, std::vector <uint16_t> > (params.m_sfnSf, rbgAllocationMap));
1924 std::map <uint16_t, std::vector <double> >::iterator itCqi = m_ueCqi.find ((*it).first);
1926 if (itCqi == m_ueCqi.end ())
1934 double minSinr = (*itCqi).second.at (uldci.m_rbStart);
1935 if (minSinr == NO_SINR)
1937 minSinr = EstimateUlSinr ((*it).first, uldci.m_rbStart);
1939 for (uint16_t i = uldci.m_rbStart; i < uldci.m_rbStart + uldci.m_rbLen; i++)
1941 double sinr = (*itCqi).second.at (i);
1942 if (sinr == NO_SINR)
1944 sinr = EstimateUlSinr ((*it).first, i);
1946 if ((*itCqi).second.at (i) < minSinr)
1948 minSinr = (*itCqi).second.at (i);
1953 double s = log2 ( 1 + (
1954 pow (10, minSinr / 10 ) /
1955 ( (-log (5.0 * 0.00005 )) / 1.5) ));
1956 cqi = m_amc->GetCqiFromSpectralEfficiency (s);
1960 if (it == m_ceBsrRxed.end ())
1963 it = m_ceBsrRxed.begin ();
1967 uldci.m_mcs = m_amc->GetMcsFromCqi (cqi);
1970 uldci.m_tbSize = (m_amc->GetTbSizeFromMcs (uldci.m_mcs, rbPerFlow) / 8);
1971 UpdateUlRlcBufferInfo (uldci.m_rnti, uldci.m_tbSize);
1973 uldci.m_cceIndex = 0;
1974 uldci.m_aggrLevel = 1;
1975 uldci.m_ueTxAntennaSelection = 3;
1976 uldci.m_hopping =
false;
1979 uldci.m_cqiRequest =
false;
1980 uldci.m_ulIndex = 0;
1982 uldci.m_freqHopping = 0;
1983 uldci.m_pdcchPowerOffset = 0;
1984 ret.m_dciList.push_back (uldci);
1989 std::map <uint16_t, uint8_t>::iterator itProcId;
1990 itProcId = m_ulHarqCurrentProcessId.find (uldci.m_rnti);
1991 if (itProcId == m_ulHarqCurrentProcessId.end ())
1993 NS_FATAL_ERROR (
"No info find in HARQ buffer for UE " << uldci.m_rnti);
1995 harqId = (*itProcId).second;
1996 std::map <uint16_t, UlHarqProcessesDciBuffer_t>::iterator itDci = m_ulHarqProcessesDciBuffer.find (uldci.m_rnti);
1997 if (itDci == m_ulHarqProcessesDciBuffer.end ())
1999 NS_FATAL_ERROR (
"Unable to find RNTI entry in UL DCI HARQ buffer for RNTI " << uldci.m_rnti);
2001 (*itDci).second.at (harqId) = uldci;
2004 NS_LOG_INFO (
this <<
" UE Allocation RNTI " << (*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 <<
" RbAlloc " << rbAllocated <<
" harqId " << (uint16_t)harqId);
2007 if (it == m_ceBsrRxed.end ())
2010 it = m_ceBsrRxed.begin ();
2012 if ((rbAllocated == m_cschedCellConfig.m_ulBandwidth) || (rbPerFlow == 0))
2015 m_nextRntiUl = (*it).first;
2019 while (((*it).first != m_nextRntiUl)&&(rbPerFlow!=0));
2021 m_allocationMaps.insert (std::pair <uint16_t, std::vector <uint16_t> > (params.m_sfnSf, rbgAllocationMap));
2022 m_schedSapUser->SchedUlConfigInd (ret);
2028 PssFfMacScheduler::DoSchedUlNoiseInterferenceReq (
const struct FfMacSchedSapProvider::SchedUlNoiseInterferenceReqParameters& params)
2035 PssFfMacScheduler::DoSchedUlSrInfoReq (
const struct FfMacSchedSapProvider::SchedUlSrInfoReqParameters& params)
2042 PssFfMacScheduler::DoSchedUlMacCtrlInfoReq (
const struct FfMacSchedSapProvider::SchedUlMacCtrlInfoReqParameters& params)
2046 std::map <uint16_t,uint32_t>::iterator it;
2048 for (
unsigned int i = 0; i < params.m_macCeList.size (); i++)
2050 if ( params.m_macCeList.at (i).m_macCeType == MacCeListElement_s::BSR )
2059 uint32_t buffer = 0;
2060 for (uint8_t lcg = 0; lcg < 4; ++lcg)
2062 uint8_t bsrId = params.m_macCeList.at (i).m_macCeValue.m_bufferStatus.at (lcg);
2063 buffer += BufferSizeLevelBsr::BsrId2BufferSize (bsrId);
2066 uint16_t rnti = params.m_macCeList.at (i).m_rnti;
2067 NS_LOG_LOGIC (
this <<
"RNTI=" << rnti <<
" buffer=" << buffer);
2068 it = m_ceBsrRxed.find (rnti);
2069 if (it == m_ceBsrRxed.end ())
2072 m_ceBsrRxed.insert ( std::pair<uint16_t, uint32_t > (rnti, buffer));
2077 (*it).second = buffer;
2086 PssFfMacScheduler::DoSchedUlCqiInfoReq (
const struct FfMacSchedSapProvider::SchedUlCqiInfoReqParameters& params)
2090 switch (m_ulCqiFilter)
2092 case FfMacScheduler::SRS_UL_CQI:
2095 if (params.m_ulCqi.m_type != UlCqi_s::SRS)
2101 case FfMacScheduler::PUSCH_UL_CQI:
2104 if (params.m_ulCqi.m_type != UlCqi_s::PUSCH)
2109 case FfMacScheduler::ALL_UL_CQI:
2116 switch (params.m_ulCqi.m_type)
2118 case UlCqi_s::PUSCH:
2120 std::map <uint16_t, std::vector <uint16_t> >::iterator itMap;
2121 std::map <uint16_t, std::vector <double> >::iterator itCqi;
2122 NS_LOG_DEBUG (
this <<
" Collect PUSCH CQIs of Frame no. " << (params.m_sfnSf >> 4) <<
" subframe no. " << (0xF & params.m_sfnSf));
2123 itMap = m_allocationMaps.find (params.m_sfnSf);
2124 if (itMap == m_allocationMaps.end ())
2128 for (uint32_t i = 0; i < (*itMap).second.size (); i++)
2131 double sinr = LteFfConverter::fpS11dot3toDouble (params.m_ulCqi.m_sinr.at (i));
2132 itCqi = m_ueCqi.find ((*itMap).second.at (i));
2133 if (itCqi == m_ueCqi.end ())
2136 std::vector <double> newCqi;
2137 for (uint32_t j = 0; j < m_cschedCellConfig.m_ulBandwidth; j++)
2141 newCqi.push_back (sinr);
2146 newCqi.push_back (NO_SINR);
2150 m_ueCqi.insert (std::pair <uint16_t, std::vector <double> > ((*itMap).second.at (i), newCqi));
2152 m_ueCqiTimers.insert (std::pair <uint16_t, uint32_t > ((*itMap).second.at (i), m_cqiTimersThreshold));
2157 (*itCqi).second.at (i) = sinr;
2158 NS_LOG_DEBUG (
this <<
" RNTI " << (*itMap).second.at (i) <<
" RB " << i <<
" SINR " << sinr);
2160 std::map <uint16_t, uint32_t>::iterator itTimers;
2161 itTimers = m_ueCqiTimers.find ((*itMap).second.at (i));
2162 (*itTimers).second = m_cqiTimersThreshold;
2168 m_allocationMaps.erase (itMap);
2175 NS_ASSERT (params.m_vendorSpecificList.size () > 0);
2176 for (uint16_t i = 0; i < params.m_vendorSpecificList.size (); i++)
2178 if (params.m_vendorSpecificList.at (i).m_type == SRS_CQI_RNTI_VSP)
2180 Ptr<SrsCqiRntiVsp> vsp = DynamicCast<SrsCqiRntiVsp> (params.m_vendorSpecificList.at (i).m_value);
2181 rnti = vsp->GetRnti ();
2184 std::map <uint16_t, std::vector <double> >::iterator itCqi;
2185 itCqi = m_ueCqi.find (rnti);
2186 if (itCqi == m_ueCqi.end ())
2189 std::vector <double> newCqi;
2190 for (uint32_t j = 0; j < m_cschedCellConfig.m_ulBandwidth; j++)
2192 double sinr = LteFfConverter::fpS11dot3toDouble (params.m_ulCqi.m_sinr.at (j));
2193 newCqi.push_back (sinr);
2194 NS_LOG_INFO (
this <<
" RNTI " << rnti <<
" new SRS-CQI for RB " << j <<
" value " << sinr);
2197 m_ueCqi.insert (std::pair <uint16_t, std::vector <double> > (rnti, newCqi));
2199 m_ueCqiTimers.insert (std::pair <uint16_t, uint32_t > (rnti, m_cqiTimersThreshold));
2204 for (uint32_t j = 0; j < m_cschedCellConfig.m_ulBandwidth; j++)
2206 double sinr = LteFfConverter::fpS11dot3toDouble (params.m_ulCqi.m_sinr.at (j));
2207 (*itCqi).second.at (j) = sinr;
2208 NS_LOG_INFO (
this <<
" RNTI " << rnti <<
" update SRS-CQI for RB " << j <<
" value " << sinr);
2211 std::map <uint16_t, uint32_t>::iterator itTimers;
2212 itTimers = m_ueCqiTimers.find (rnti);
2213 (*itTimers).second = m_cqiTimersThreshold;
2220 case UlCqi_s::PUCCH_1:
2221 case UlCqi_s::PUCCH_2:
2222 case UlCqi_s::PRACH:
2224 NS_FATAL_ERROR (
"PssFfMacScheduler supports only PUSCH and SRS UL-CQIs");
2234 PssFfMacScheduler::RefreshDlCqiMaps (
void)
2237 std::map <uint16_t,uint32_t>::iterator itP10 = m_p10CqiTimers.begin ();
2238 while (itP10 != m_p10CqiTimers.end ())
2240 NS_LOG_INFO (
this <<
" P10-CQI for user " << (*itP10).first <<
" is " << (uint32_t)(*itP10).second <<
" thr " << (uint32_t)m_cqiTimersThreshold);
2241 if ((*itP10).second == 0)
2244 std::map <uint16_t,uint8_t>::iterator itMap = m_p10CqiRxed.find ((*itP10).first);
2245 NS_ASSERT_MSG (itMap != m_p10CqiRxed.end (),
" Does not find CQI report for user " << (*itP10).first);
2246 NS_LOG_INFO (
this <<
" P10-CQI expired for user " << (*itP10).first);
2247 m_p10CqiRxed.erase (itMap);
2248 std::map <uint16_t,uint32_t>::iterator temp = itP10;
2250 m_p10CqiTimers.erase (temp);
2260 std::map <uint16_t,uint32_t>::iterator itA30 = m_a30CqiTimers.begin ();
2261 while (itA30 != m_a30CqiTimers.end ())
2263 NS_LOG_INFO (
this <<
" A30-CQI for user " << (*itA30).first <<
" is " << (uint32_t)(*itA30).second <<
" thr " << (uint32_t)m_cqiTimersThreshold);
2264 if ((*itA30).second == 0)
2267 std::map <uint16_t,SbMeasResult_s>::iterator itMap = m_a30CqiRxed.find ((*itA30).first);
2268 NS_ASSERT_MSG (itMap != m_a30CqiRxed.end (),
" Does not find CQI report for user " << (*itA30).first);
2269 NS_LOG_INFO (
this <<
" A30-CQI expired for user " << (*itA30).first);
2270 m_a30CqiRxed.erase (itMap);
2271 std::map <uint16_t,uint32_t>::iterator temp = itA30;
2273 m_a30CqiTimers.erase (temp);
2287 PssFfMacScheduler::RefreshUlCqiMaps (
void)
2290 std::map <uint16_t,uint32_t>::iterator itUl = m_ueCqiTimers.begin ();
2291 while (itUl != m_ueCqiTimers.end ())
2293 NS_LOG_INFO (
this <<
" UL-CQI for user " << (*itUl).first <<
" is " << (uint32_t)(*itUl).second <<
" thr " << (uint32_t)m_cqiTimersThreshold);
2294 if ((*itUl).second == 0)
2297 std::map <uint16_t, std::vector <double> >::iterator itMap = m_ueCqi.find ((*itUl).first);
2298 NS_ASSERT_MSG (itMap != m_ueCqi.end (),
" Does not find CQI report for user " << (*itUl).first);
2299 NS_LOG_INFO (
this <<
" UL-CQI exired for user " << (*itUl).first);
2300 (*itMap).second.clear ();
2301 m_ueCqi.erase (itMap);
2302 std::map <uint16_t,uint32_t>::iterator temp = itUl;
2304 m_ueCqiTimers.erase (temp);
2317 PssFfMacScheduler::UpdateDlRlcBufferInfo (uint16_t rnti, uint8_t lcid, uint16_t size)
2319 std::map<LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator it;
2320 LteFlowId_t flow (rnti, lcid);
2321 it = m_rlcBufferReq.find (flow);
2322 if (it != m_rlcBufferReq.end ())
2324 NS_LOG_INFO (
this <<
" UE " << rnti <<
" LC " << (uint16_t)lcid <<
" txqueue " << (*it).second.m_rlcTransmissionQueueSize <<
" retxqueue " << (*it).second.m_rlcRetransmissionQueueSize <<
" status " << (*it).second.m_rlcStatusPduSize <<
" decrease " << size);
2327 if (((*it).second.m_rlcStatusPduSize > 0) && (size >= (*it).second.m_rlcStatusPduSize))
2329 (*it).second.m_rlcStatusPduSize = 0;
2331 else if (((*it).second.m_rlcRetransmissionQueueSize > 0) && (size >= (*it).second.m_rlcRetransmissionQueueSize))
2333 (*it).second.m_rlcRetransmissionQueueSize = 0;
2335 else if ((*it).second.m_rlcTransmissionQueueSize > 0)
2338 if ((*it).second.m_rlcTransmissionQueueSize <= size)
2340 (*it).second.m_rlcTransmissionQueueSize = 0;
2345 (*it).second.m_rlcTransmissionQueueSize -= size;
2351 NS_LOG_ERROR (
this <<
" Does not find DL RLC Buffer Report of UE " << rnti);
2356 PssFfMacScheduler::UpdateUlRlcBufferInfo (uint16_t rnti, uint16_t size)
2360 std::map <uint16_t,uint32_t>::iterator it = m_ceBsrRxed.find (rnti);
2361 if (it != m_ceBsrRxed.end ())
2363 NS_LOG_INFO (
this <<
" UE " << rnti <<
" size " << size <<
" BSR " << (*it).second);
2364 if ((*it).second >= size)
2366 (*it).second -= size;
2375 NS_LOG_ERROR (
this <<
" Does not find BSR report info of UE " << rnti);
2381 PssFfMacScheduler::TransmissionModeConfigurationUpdate (uint16_t rnti, uint8_t txMode)
2383 NS_LOG_FUNCTION (
this <<
" RNTI " << rnti <<
" txMode " << (uint16_t)txMode);
2384 FfMacCschedSapUser::CschedUeConfigUpdateIndParameters params;
2385 params.m_rnti = rnti;
2386 params.m_transmissionMode = txMode;
2387 m_cschedSapUser->CschedUeConfigUpdateInd (params);
#define NS_LOG_FUNCTION(parameters)
hold variables of type string
#define NS_ASSERT(condition)
#define NS_LOG_COMPONENT_DEFINE(name)
See section 4.3.10 buildRARListElement.
#define NS_FATAL_ERROR(msg)
fatal error handling
virtual FfMacSchedSapProvider * GetFfMacSchedSapProvider()
Hold an unsigned integer type.
#define NS_LOG_LOGIC(msg)
PssFfMacScheduler()
Constructor.
virtual void SetFfMacSchedSapUser(FfMacSchedSapUser *s)
uint8_t HarqProcessAvailability(uint16_t rnti)
Return the availability of free process for the RNTI specified.
void RefreshHarqProcesses()
Refresh HARQ processes according to the timers.
uint8_t UpdateHarqProcessId(uint16_t rnti)
Update and return a new process Id for the RNTI specified.
#define NS_ASSERT_MSG(condition, message)
virtual ~PssFfMacScheduler()
virtual void DoDispose(void)
virtual void SetFfMacCschedSapUser(FfMacCschedSapUser *s)
#define NS_LOG_DEBUG(msg)
#define NS_LOG_ERROR(msg)
virtual FfMacCschedSapProvider * GetFfMacCschedSapProvider()
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
virtual void CschedCellConfigReq(const struct CschedCellConfigReqParameters ¶ms)
CSCHED_CELL_CONFIG_REQ.
Implements the SCHED SAP and CSCHED SAP for a Priority Set scheduler.