A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
fdbet-ff-mac-scheduler.cc
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Author: Marco Miozzo <marco.miozzo@cttc.es>
19  * Modification: Dizhi Zhou <dizhi.zhou@gmail.com> // modify codes related to downlink scheduler
20  */
21 
22 #include <ns3/log.h>
23 #include <ns3/pointer.h>
24 #include <ns3/math.h>
25 
26 #include <ns3/simulator.h>
27 #include <ns3/lte-amc.h>
28 #include <ns3/fdbet-ff-mac-scheduler.h>
29 #include <ns3/lte-vendor-specific-parameters.h>
30 #include <ns3/boolean.h>
31 #include <set>
32 #include <cfloat>
33 
34 NS_LOG_COMPONENT_DEFINE ("FdBetFfMacScheduler");
35 
36 namespace ns3 {
37 
39  10, // RGB size 1
40  26, // RGB size 2
41  63, // RGB size 3
42  110 // RGB size 4
43 }; // see table 7.1.6.1-1 of 36.213
44 
45 
46 NS_OBJECT_ENSURE_REGISTERED (FdBetFfMacScheduler)
47  ;
48 
49 
50 
52 {
53 public:
55 
56  // inherited from FfMacCschedSapProvider
57  virtual void CschedCellConfigReq (const struct CschedCellConfigReqParameters& params);
58  virtual void CschedUeConfigReq (const struct CschedUeConfigReqParameters& params);
59  virtual void CschedLcConfigReq (const struct CschedLcConfigReqParameters& params);
60  virtual void CschedLcReleaseReq (const struct CschedLcReleaseReqParameters& params);
61  virtual void CschedUeReleaseReq (const struct CschedUeReleaseReqParameters& params);
62 
63 private:
66 };
67 
69 {
70 }
71 
73 {
74 }
75 
76 
77 void
79 {
81 }
82 
83 void
85 {
87 }
88 
89 
90 void
92 {
94 }
95 
96 void
98 {
100 }
101 
102 void
104 {
106 }
107 
108 
109 
110 
112 {
113 public:
115 
116  // inherited from FfMacSchedSapProvider
117  virtual void SchedDlRlcBufferReq (const struct SchedDlRlcBufferReqParameters& params);
118  virtual void SchedDlPagingBufferReq (const struct SchedDlPagingBufferReqParameters& params);
119  virtual void SchedDlMacBufferReq (const struct SchedDlMacBufferReqParameters& params);
120  virtual void SchedDlTriggerReq (const struct SchedDlTriggerReqParameters& params);
121  virtual void SchedDlRachInfoReq (const struct SchedDlRachInfoReqParameters& params);
122  virtual void SchedDlCqiInfoReq (const struct SchedDlCqiInfoReqParameters& params);
123  virtual void SchedUlTriggerReq (const struct SchedUlTriggerReqParameters& params);
124  virtual void SchedUlNoiseInterferenceReq (const struct SchedUlNoiseInterferenceReqParameters& params);
125  virtual void SchedUlSrInfoReq (const struct SchedUlSrInfoReqParameters& params);
126  virtual void SchedUlMacCtrlInfoReq (const struct SchedUlMacCtrlInfoReqParameters& params);
127  virtual void SchedUlCqiInfoReq (const struct SchedUlCqiInfoReqParameters& params);
128 
129 
130 private:
133 };
134 
135 
136 
138 {
139 }
140 
141 
143  : m_scheduler (scheduler)
144 {
145 }
146 
147 void
149 {
151 }
152 
153 void
155 {
157 }
158 
159 void
161 {
163 }
164 
165 void
167 {
169 }
170 
171 void
173 {
175 }
176 
177 void
179 {
181 }
182 
183 void
185 {
187 }
188 
189 void
191 {
193 }
194 
195 void
197 {
199 }
200 
201 void
203 {
205 }
206 
207 void
209 {
211 }
212 
213 
214 
215 
216 
218  : m_cschedSapUser (0),
219  m_schedSapUser (0),
220  m_timeWindow (99.0),
221  m_nextRntiUl (0)
222 {
223  m_amc = CreateObject <LteAmc> ();
226 }
227 
229 {
230  NS_LOG_FUNCTION (this);
231 }
232 
233 void
235 {
236  NS_LOG_FUNCTION (this);
238  m_dlHarqProcessesTimer.clear ();
240  m_dlInfoListBuffered.clear ();
241  m_ulHarqCurrentProcessId.clear ();
242  m_ulHarqProcessesStatus.clear ();
244  delete m_cschedSapProvider;
245  delete m_schedSapProvider;
246 }
247 
248 TypeId
250 {
251  static TypeId tid = TypeId ("ns3::FdBetFfMacScheduler")
253  .AddConstructor<FdBetFfMacScheduler> ()
254  .AddAttribute ("CqiTimerThreshold",
255  "The number of TTIs a CQI is valid (default 1000 - 1 sec.)",
256  UintegerValue (1000),
257  MakeUintegerAccessor (&FdBetFfMacScheduler::m_cqiTimersThreshold),
258  MakeUintegerChecker<uint32_t> ())
259  .AddAttribute ("HarqEnabled",
260  "Activate/Deactivate the HARQ [by default is active].",
261  BooleanValue (true),
262  MakeBooleanAccessor (&FdBetFfMacScheduler::m_harqOn),
263  MakeBooleanChecker ())
264  .AddAttribute ("UlGrantMcs",
265  "The MCS of the UL grant, must be [0..15] (default 0)",
266  UintegerValue (0),
267  MakeUintegerAccessor (&FdBetFfMacScheduler::m_ulGrantMcs),
268  MakeUintegerChecker<uint8_t> ())
269  ;
270  return tid;
271 }
272 
273 
274 
275 void
277 {
278  m_cschedSapUser = s;
279 }
280 
281 void
283 {
284  m_schedSapUser = s;
285 }
286 
289 {
290  return m_cschedSapProvider;
291 }
292 
295 {
296  return m_schedSapProvider;
297 }
298 
299 void
301 {
302  NS_LOG_FUNCTION (this);
303  // Read the subset of parameters used
304  m_cschedCellConfig = params;
307  cnf.m_result = SUCCESS;
309  return;
310 }
311 
312 void
314 {
315  NS_LOG_FUNCTION (this << " RNTI " << params.m_rnti << " txMode " << (uint16_t)params.m_transmissionMode);
316  std::map <uint16_t,uint8_t>::iterator it = m_uesTxMode.find (params.m_rnti);
317  if (it == m_uesTxMode.end ())
318  {
319  m_uesTxMode.insert (std::pair <uint16_t, double> (params.m_rnti, params.m_transmissionMode));
320  // generate HARQ buffers
321  m_dlHarqCurrentProcessId.insert (std::pair <uint16_t,uint8_t > (params.m_rnti, 0));
322  DlHarqProcessesStatus_t dlHarqPrcStatus;
323  dlHarqPrcStatus.resize (8,0);
324  m_dlHarqProcessesStatus.insert (std::pair <uint16_t, DlHarqProcessesStatus_t> (params.m_rnti, dlHarqPrcStatus));
325  DlHarqProcessesTimer_t dlHarqProcessesTimer;
326  dlHarqProcessesTimer.resize (8,0);
327  m_dlHarqProcessesTimer.insert (std::pair <uint16_t, DlHarqProcessesTimer_t> (params.m_rnti, dlHarqProcessesTimer));
328  DlHarqProcessesDciBuffer_t dlHarqdci;
329  dlHarqdci.resize (8);
330  m_dlHarqProcessesDciBuffer.insert (std::pair <uint16_t, DlHarqProcessesDciBuffer_t> (params.m_rnti, dlHarqdci));
331  DlHarqRlcPduListBuffer_t dlHarqRlcPdu;
332  dlHarqRlcPdu.resize (2);
333  dlHarqRlcPdu.at (0).resize (8);
334  dlHarqRlcPdu.at (1).resize (8);
335  m_dlHarqProcessesRlcPduListBuffer.insert (std::pair <uint16_t, DlHarqRlcPduListBuffer_t> (params.m_rnti, dlHarqRlcPdu));
336  m_ulHarqCurrentProcessId.insert (std::pair <uint16_t,uint8_t > (params.m_rnti, 0));
337  UlHarqProcessesStatus_t ulHarqPrcStatus;
338  ulHarqPrcStatus.resize (8,0);
339  m_ulHarqProcessesStatus.insert (std::pair <uint16_t, UlHarqProcessesStatus_t> (params.m_rnti, ulHarqPrcStatus));
340  UlHarqProcessesDciBuffer_t ulHarqdci;
341  ulHarqdci.resize (8);
342  m_ulHarqProcessesDciBuffer.insert (std::pair <uint16_t, UlHarqProcessesDciBuffer_t> (params.m_rnti, ulHarqdci));
343  }
344  else
345  {
346  (*it).second = params.m_transmissionMode;
347  }
348  return;
349 }
350 
351 void
353 {
354  NS_LOG_FUNCTION (this << " New LC, rnti: " << params.m_rnti);
355 
356  std::map <uint16_t, fdbetsFlowPerf_t>::iterator it;
357  for (uint16_t i = 0; i < params.m_logicalChannelConfigList.size (); i++)
358  {
359  it = m_flowStatsDl.find (params.m_rnti);
360 
361  if (it == m_flowStatsDl.end ())
362  {
363  fdbetsFlowPerf_t flowStatsDl;
364  flowStatsDl.flowStart = Simulator::Now ();
365  flowStatsDl.totalBytesTransmitted = 0;
366  flowStatsDl.lastTtiBytesTrasmitted = 0;
367  flowStatsDl.lastAveragedThroughput = 1;
368  m_flowStatsDl.insert (std::pair<uint16_t, fdbetsFlowPerf_t> (params.m_rnti, flowStatsDl));
369  fdbetsFlowPerf_t flowStatsUl;
370  flowStatsUl.flowStart = Simulator::Now ();
371  flowStatsUl.totalBytesTransmitted = 0;
372  flowStatsUl.lastTtiBytesTrasmitted = 0;
373  flowStatsUl.lastAveragedThroughput = 1;
374  m_flowStatsUl.insert (std::pair<uint16_t, fdbetsFlowPerf_t> (params.m_rnti, flowStatsUl));
375  }
376  }
377 
378  return;
379 }
380 
381 void
383 {
384  NS_LOG_FUNCTION (this);
385  for (uint16_t i = 0; i < params.m_logicalChannelIdentity.size (); i++)
386  {
387  std::map<LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator it = m_rlcBufferReq.begin ();
388  std::map<LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator temp;
389  while (it!=m_rlcBufferReq.end ())
390  {
391  if (((*it).first.m_rnti == params.m_rnti) && ((*it).first.m_lcId == params.m_logicalChannelIdentity.at (i)))
392  {
393  temp = it;
394  it++;
395  m_rlcBufferReq.erase (temp);
396  }
397  else
398  {
399  it++;
400  }
401  }
402  }
403  return;
404 }
405 
406 void
408 {
409  NS_LOG_FUNCTION (this);
410 
411  m_uesTxMode.erase (params.m_rnti);
412  m_dlHarqCurrentProcessId.erase (params.m_rnti);
413  m_dlHarqProcessesStatus.erase (params.m_rnti);
414  m_dlHarqProcessesTimer.erase (params.m_rnti);
415  m_dlHarqProcessesDciBuffer.erase (params.m_rnti);
417  m_ulHarqCurrentProcessId.erase (params.m_rnti);
418  m_ulHarqProcessesStatus.erase (params.m_rnti);
419  m_ulHarqProcessesDciBuffer.erase (params.m_rnti);
420  m_flowStatsDl.erase (params.m_rnti);
421  m_flowStatsUl.erase (params.m_rnti);
422  m_ceBsrRxed.erase (params.m_rnti);
423  std::map<LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator it = m_rlcBufferReq.begin ();
424  std::map<LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator temp;
425  while (it!=m_rlcBufferReq.end ())
426  {
427  if ((*it).first.m_rnti == params.m_rnti)
428  {
429  temp = it;
430  it++;
431  m_rlcBufferReq.erase (temp);
432  }
433  else
434  {
435  it++;
436  }
437  }
438  if (m_nextRntiUl == params.m_rnti)
439  {
440  m_nextRntiUl = 0;
441  }
442 
443  return;
444 }
445 
446 
447 void
449 {
450  NS_LOG_FUNCTION (this << params.m_rnti << (uint32_t) params.m_logicalChannelIdentity);
451  // API generated by RLC for updating RLC parameters on a LC (tx and retx queues)
452 
453  std::map <LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator it;
454 
455  LteFlowId_t flow (params.m_rnti, params.m_logicalChannelIdentity);
456 
457  it = m_rlcBufferReq.find (flow);
458 
459  if (it == m_rlcBufferReq.end ())
460  {
461  m_rlcBufferReq.insert (std::pair <LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters> (flow, params));
462  }
463  else
464  {
465  (*it).second = params;
466  }
467 
468  return;
469 }
470 
471 void
473 {
474  NS_LOG_FUNCTION (this);
475  NS_FATAL_ERROR ("method not implemented");
476  return;
477 }
478 
479 void
481 {
482  NS_LOG_FUNCTION (this);
483  NS_FATAL_ERROR ("method not implemented");
484  return;
485 }
486 
487 int
489 {
490  for (int i = 0; i < 4; i++)
491  {
492  if (dlbandwidth < FdBetType0AllocationRbg[i])
493  {
494  return (i + 1);
495  }
496  }
497 
498  return (-1);
499 }
500 
501 
502 int
504 {
505  std::map <LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator it;
506  int lcActive = 0;
507  for (it = m_rlcBufferReq.begin (); it != m_rlcBufferReq.end (); it++)
508  {
509  if (((*it).first.m_rnti == rnti) && (((*it).second.m_rlcTransmissionQueueSize > 0)
510  || ((*it).second.m_rlcRetransmissionQueueSize > 0)
511  || ((*it).second.m_rlcStatusPduSize > 0) ))
512  {
513  lcActive++;
514  }
515  if ((*it).first.m_rnti > rnti)
516  {
517  break;
518  }
519  }
520  return (lcActive);
521 
522 }
523 
524 
525 uint8_t
527 {
528  NS_LOG_FUNCTION (this << rnti);
529 
530  std::map <uint16_t, uint8_t>::iterator it = m_dlHarqCurrentProcessId.find (rnti);
531  if (it == m_dlHarqCurrentProcessId.end ())
532  {
533  NS_FATAL_ERROR ("No Process Id found for this RNTI " << rnti);
534  }
535  std::map <uint16_t, DlHarqProcessesStatus_t>::iterator itStat = m_dlHarqProcessesStatus.find (rnti);
536  if (itStat == m_dlHarqProcessesStatus.end ())
537  {
538  NS_FATAL_ERROR ("No Process Id Statusfound for this RNTI " << rnti);
539  }
540  uint8_t i = (*it).second;
541  do
542  {
543  i = (i + 1) % HARQ_PROC_NUM;
544  }
545  while ( ((*itStat).second.at (i) != 0)&&(i != (*it).second));
546  if ((*itStat).second.at (i) == 0)
547  {
548  return (true);
549  }
550  else
551  {
552  return (false); // return a not valid harq proc id
553  }
554 }
555 
556 
557 
558 uint8_t
560 {
561  NS_LOG_FUNCTION (this << rnti);
562 
563  if (m_harqOn == false)
564  {
565  return (0);
566  }
567 
568 
569  std::map <uint16_t, uint8_t>::iterator it = m_dlHarqCurrentProcessId.find (rnti);
570  if (it == m_dlHarqCurrentProcessId.end ())
571  {
572  NS_FATAL_ERROR ("No Process Id found for this RNTI " << rnti);
573  }
574  std::map <uint16_t, DlHarqProcessesStatus_t>::iterator itStat = m_dlHarqProcessesStatus.find (rnti);
575  if (itStat == m_dlHarqProcessesStatus.end ())
576  {
577  NS_FATAL_ERROR ("No Process Id Statusfound for this RNTI " << rnti);
578  }
579  uint8_t i = (*it).second;
580  do
581  {
582  i = (i + 1) % HARQ_PROC_NUM;
583  }
584  while ( ((*itStat).second.at (i) != 0)&&(i != (*it).second));
585  if ((*itStat).second.at (i) == 0)
586  {
587  (*it).second = i;
588  (*itStat).second.at (i) = 1;
589  }
590  else
591  {
592  NS_FATAL_ERROR ("No HARQ process available for RNTI " << rnti << " check before update with HarqProcessAvailability");
593  }
594 
595  return ((*it).second);
596 }
597 
598 
599 void
601 {
602  NS_LOG_FUNCTION (this);
603 
604  std::map <uint16_t, DlHarqProcessesTimer_t>::iterator itTimers;
605  for (itTimers = m_dlHarqProcessesTimer.begin (); itTimers != m_dlHarqProcessesTimer.end (); itTimers ++)
606  {
607  for (uint16_t i = 0; i < HARQ_PROC_NUM; i++)
608  {
609  if ((*itTimers).second.at (i) == HARQ_DL_TIMEOUT)
610  {
611  // reset HARQ process
612 
613  NS_LOG_DEBUG (this << " Reset HARQ proc " << i << " for RNTI " << (*itTimers).first);
614  std::map <uint16_t, DlHarqProcessesStatus_t>::iterator itStat = m_dlHarqProcessesStatus.find ((*itTimers).first);
615  if (itStat == m_dlHarqProcessesStatus.end ())
616  {
617  NS_FATAL_ERROR ("No Process Id Status found for this RNTI " << (*itTimers).first);
618  }
619  (*itStat).second.at (i) = 0;
620  (*itTimers).second.at (i) = 0;
621  }
622  else
623  {
624  (*itTimers).second.at (i)++;
625  }
626  }
627  }
628 
629 }
630 
631 
632 void
634 {
635  NS_LOG_FUNCTION (this << " Frame no. " << (params.m_sfnSf >> 4) << " subframe no. " << (0xF & params.m_sfnSf));
636  // API generated by RLC for triggering the scheduling of a DL subframe
637 
638 
639  // evaluate the relative channel quality indicator for each UE per each RBG
640  // (since we are using allocation type 0 the small unit of allocation is RBG)
641  // Resource allocation type 0 (see sec 7.1.6.1 of 36.213)
642 
643  RefreshDlCqiMaps ();
644 
646  int rbgNum = m_cschedCellConfig.m_dlBandwidth / rbgSize;
647  std::map <uint16_t, std::vector <uint16_t> > allocationMap; // RBs map per RNTI
648  std::vector <bool> rbgMap; // global RBGs map
649  uint16_t rbgAllocatedNum = 0;
650  std::set <uint16_t> rntiAllocated;
651  rbgMap.resize (m_cschedCellConfig.m_dlBandwidth / rbgSize, false);
653 
654 
655  // update UL HARQ proc id
656  std::map <uint16_t, uint8_t>::iterator itProcId;
657  for (itProcId = m_ulHarqCurrentProcessId.begin (); itProcId != m_ulHarqCurrentProcessId.end (); itProcId++)
658  {
659  (*itProcId).second = ((*itProcId).second + 1) % HARQ_PROC_NUM;
660  }
661 
662  // RACH Allocation
664  uint16_t rbStart = 0;
665  std::vector <struct RachListElement_s>::iterator itRach;
666  for (itRach = m_rachList.begin (); itRach != m_rachList.end (); itRach++)
667  {
668  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");
669  BuildRarListElement_s newRar;
670  newRar.m_rnti = (*itRach).m_rnti;
671  // DL-RACH Allocation
672  // Ideal: no needs of configuring m_dci
673  // UL-RACH Allocation
674  newRar.m_grant.m_rnti = newRar.m_rnti;
675  newRar.m_grant.m_mcs = m_ulGrantMcs;
676  uint16_t rbLen = 1;
677  uint16_t tbSizeBits = 0;
678  // find lowest TB size that fits UL grant estimated size
679  while ((tbSizeBits < (*itRach).m_estimatedSize) && (rbStart + rbLen < m_cschedCellConfig.m_ulBandwidth))
680  {
681  rbLen++;
682  tbSizeBits = m_amc->GetTbSizeFromMcs (m_ulGrantMcs, rbLen);
683  }
684  if (tbSizeBits < (*itRach).m_estimatedSize)
685  {
686  // no more allocation space: finish allocation
687  break;
688  }
689  newRar.m_grant.m_rbStart = rbStart;
690  newRar.m_grant.m_rbLen = rbLen;
691  newRar.m_grant.m_tbSize = tbSizeBits / 8;
692  newRar.m_grant.m_hopping = false;
693  newRar.m_grant.m_tpc = 0;
694  newRar.m_grant.m_cqiRequest = false;
695  newRar.m_grant.m_ulDelay = false;
696  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);
697  for (uint16_t i = rbStart; i < rbStart + rbLen; i++)
698  {
699  m_rachAllocationMap.at (i) = (*itRach).m_rnti;
700  }
701  rbStart = rbStart + rbLen;
702 
703  if (m_harqOn == true)
704  {
705  // generate UL-DCI for HARQ retransmissions
706  UlDciListElement_s uldci;
707  uldci.m_rnti = newRar.m_rnti;
708  uldci.m_rbLen = rbLen;
709  uldci.m_rbStart = rbStart;
710  uldci.m_mcs = m_ulGrantMcs;
711  uldci.m_tbSize = tbSizeBits / 8;
712  uldci.m_ndi = 1;
713  uldci.m_cceIndex = 0;
714  uldci.m_aggrLevel = 1;
715  uldci.m_ueTxAntennaSelection = 3; // antenna selection OFF
716  uldci.m_hopping = false;
717  uldci.m_n2Dmrs = 0;
718  uldci.m_tpc = 0; // no power control
719  uldci.m_cqiRequest = false; // only period CQI at this stage
720  uldci.m_ulIndex = 0; // TDD parameter
721  uldci.m_dai = 1; // TDD parameter
722  uldci.m_freqHopping = 0;
723  uldci.m_pdcchPowerOffset = 0; // not used
724 
725  uint8_t harqId = 0;
726  std::map <uint16_t, uint8_t>::iterator itProcId;
727  itProcId = m_ulHarqCurrentProcessId.find (uldci.m_rnti);
728  if (itProcId == m_ulHarqCurrentProcessId.end ())
729  {
730  NS_FATAL_ERROR ("No info find in HARQ buffer for UE " << uldci.m_rnti);
731  }
732  harqId = (*itProcId).second;
733  std::map <uint16_t, UlHarqProcessesDciBuffer_t>::iterator itDci = m_ulHarqProcessesDciBuffer.find (uldci.m_rnti);
734  if (itDci == m_ulHarqProcessesDciBuffer.end ())
735  {
736  NS_FATAL_ERROR ("Unable to find RNTI entry in UL DCI HARQ buffer for RNTI " << uldci.m_rnti);
737  }
738  (*itDci).second.at (harqId) = uldci;
739  }
740 
741  ret.m_buildRarList.push_back (newRar);
742  }
743  m_rachList.clear ();
744 
745 
746  // Process DL HARQ feedback
748  // retrieve past HARQ retx buffered
749  if (m_dlInfoListBuffered.size () > 0)
750  {
751  if (params.m_dlInfoList.size () > 0)
752  {
753  NS_LOG_INFO (this << " Received DL-HARQ feedback");
754  m_dlInfoListBuffered.insert (m_dlInfoListBuffered.end (), params.m_dlInfoList.begin (), params.m_dlInfoList.end ());
755  }
756  }
757  else
758  {
759  if (params.m_dlInfoList.size () > 0)
760  {
762  }
763  }
764  if (m_harqOn == false)
765  {
766  // Ignore HARQ feedback
767  m_dlInfoListBuffered.clear ();
768  }
769  std::vector <struct DlInfoListElement_s> dlInfoListUntxed;
770  for (uint16_t i = 0; i < m_dlInfoListBuffered.size (); i++)
771  {
772  std::set <uint16_t>::iterator itRnti = rntiAllocated.find (m_dlInfoListBuffered.at (i).m_rnti);
773  if (itRnti != rntiAllocated.end ())
774  {
775  // RNTI already allocated for retx
776  continue;
777  }
778  uint8_t nLayers = m_dlInfoListBuffered.at (i).m_harqStatus.size ();
779  std::vector <bool> retx;
780  NS_LOG_INFO (this << " Processing DLHARQ feedback");
781  if (nLayers == 1)
782  {
783  retx.push_back (m_dlInfoListBuffered.at (i).m_harqStatus.at (0) == DlInfoListElement_s::NACK);
784  retx.push_back (false);
785  }
786  else
787  {
788  retx.push_back (m_dlInfoListBuffered.at (i).m_harqStatus.at (0) == DlInfoListElement_s::NACK);
789  retx.push_back (m_dlInfoListBuffered.at (i).m_harqStatus.at (1) == DlInfoListElement_s::NACK);
790  }
791  if (retx.at (0) || retx.at (1))
792  {
793  // retrieve HARQ process information
794  uint16_t rnti = m_dlInfoListBuffered.at (i).m_rnti;
795  uint8_t harqId = m_dlInfoListBuffered.at (i).m_harqProcessId;
796  NS_LOG_INFO (this << " HARQ retx RNTI " << rnti << " harqId " << (uint16_t)harqId);
797  std::map <uint16_t, DlHarqProcessesDciBuffer_t>::iterator itHarq = m_dlHarqProcessesDciBuffer.find (rnti);
798  if (itHarq == m_dlHarqProcessesDciBuffer.end ())
799  {
800  NS_FATAL_ERROR ("No info find in HARQ buffer for UE " << rnti);
801  }
802 
803  DlDciListElement_s dci = (*itHarq).second.at (harqId);
804  int rv = 0;
805  if (dci.m_rv.size () == 1)
806  {
807  rv = dci.m_rv.at (0);
808  }
809  else
810  {
811  rv = (dci.m_rv.at (0) > dci.m_rv.at (1) ? dci.m_rv.at (0) : dci.m_rv.at (1));
812  }
813 
814  if (rv == 3)
815  {
816  // maximum number of retx reached -> drop process
817  NS_LOG_INFO ("Maximum number of retransmissions reached -> drop process");
818  std::map <uint16_t, DlHarqProcessesStatus_t>::iterator it = m_dlHarqProcessesStatus.find (rnti);
819  if (it == m_dlHarqProcessesStatus.end ())
820  {
821  NS_LOG_ERROR ("No info find in HARQ buffer for UE (might change eNB) " << m_dlInfoListBuffered.at (i).m_rnti);
822  }
823  (*it).second.at (harqId) = 0;
824  std::map <uint16_t, DlHarqRlcPduListBuffer_t>::iterator itRlcPdu = m_dlHarqProcessesRlcPduListBuffer.find (rnti);
825  if (itRlcPdu == m_dlHarqProcessesRlcPduListBuffer.end ())
826  {
827  NS_FATAL_ERROR ("Unable to find RlcPdcList in HARQ buffer for RNTI " << m_dlInfoListBuffered.at (i).m_rnti);
828  }
829  for (uint16_t k = 0; k < (*itRlcPdu).second.size (); k++)
830  {
831  (*itRlcPdu).second.at (k).at (harqId).clear ();
832  }
833  continue;
834  }
835  // check the feasibility of retransmitting on the same RBGs
836  // translate the DCI to Spectrum framework
837  std::vector <int> dciRbg;
838  uint32_t mask = 0x1;
839  NS_LOG_INFO ("Original RBGs " << dci.m_rbBitmap << " rnti " << dci.m_rnti);
840  for (int j = 0; j < 32; j++)
841  {
842  if (((dci.m_rbBitmap & mask) >> j) == 1)
843  {
844  dciRbg.push_back (j);
845  NS_LOG_INFO ("\t" << j);
846  }
847  mask = (mask << 1);
848  }
849  bool free = true;
850  for (uint8_t j = 0; j < dciRbg.size (); j++)
851  {
852  if (rbgMap.at (dciRbg.at (j)) == true)
853  {
854  free = false;
855  break;
856  }
857  }
858  if (free)
859  {
860  // use the same RBGs for the retx
861  // reserve RBGs
862  for (uint8_t j = 0; j < dciRbg.size (); j++)
863  {
864  rbgMap.at (dciRbg.at (j)) = true;
865  NS_LOG_INFO ("RBG " << dciRbg.at (j) << " assigned");
866  rbgAllocatedNum++;
867  }
868 
869  NS_LOG_INFO (this << " Send retx in the same RBGs");
870  }
871  else
872  {
873  // find RBGs for sending HARQ retx
874  uint8_t j = 0;
875  uint8_t rbgId = (dciRbg.at (dciRbg.size () - 1) + 1) % rbgNum;
876  uint8_t startRbg = dciRbg.at (dciRbg.size () - 1);
877  std::vector <bool> rbgMapCopy = rbgMap;
878  while ((j < dciRbg.size ())&&(startRbg != rbgId))
879  {
880  if (rbgMapCopy.at (rbgId) == false)
881  {
882  rbgMapCopy.at (rbgId) = true;
883  dciRbg.at (j) = rbgId;
884  j++;
885  }
886  rbgId++;
887  }
888  if (j == dciRbg.size ())
889  {
890  // find new RBGs -> update DCI map
891  uint32_t rbgMask = 0;
892  for (uint16_t k = 0; k < dciRbg.size (); k++)
893  {
894  rbgMask = rbgMask + (0x1 << dciRbg.at (k));
895  rbgAllocatedNum++;
896  }
897  dci.m_rbBitmap = rbgMask;
898  rbgMap = rbgMapCopy;
899  NS_LOG_INFO (this << " Move retx in RBGs " << dciRbg.size ());
900  }
901  else
902  {
903  // HARQ retx cannot be performed on this TTI -> store it
904  dlInfoListUntxed.push_back (params.m_dlInfoList.at (i));
905  NS_LOG_INFO (this << " No resource for this retx -> buffer it");
906  }
907  }
908  // retrieve RLC PDU list for retx TBsize and update DCI
910  std::map <uint16_t, DlHarqRlcPduListBuffer_t>::iterator itRlcPdu = m_dlHarqProcessesRlcPduListBuffer.find (rnti);
911  if (itRlcPdu == m_dlHarqProcessesRlcPduListBuffer.end ())
912  {
913  NS_FATAL_ERROR ("Unable to find RlcPdcList in HARQ buffer for RNTI " << rnti);
914  }
915  for (uint8_t j = 0; j < nLayers; j++)
916  {
917  if (retx.at (j))
918  {
919  if (j >= dci.m_ndi.size ())
920  {
921  // for avoiding errors in MIMO transient phases
922  dci.m_ndi.push_back (0);
923  dci.m_rv.push_back (0);
924  dci.m_mcs.push_back (0);
925  dci.m_tbsSize.push_back (0);
926  NS_LOG_INFO (this << " layer " << (uint16_t)j << " no txed (MIMO transition)");
927  }
928  else
929  {
930  dci.m_ndi.at (j) = 0;
931  dci.m_rv.at (j)++;
932  (*itHarq).second.at (harqId).m_rv.at (j)++;
933  NS_LOG_INFO (this << " layer " << (uint16_t)j << " RV " << (uint16_t)dci.m_rv.at (j));
934  }
935  }
936  else
937  {
938  // empty TB of layer j
939  dci.m_ndi.at (j) = 0;
940  dci.m_rv.at (j) = 0;
941  dci.m_mcs.at (j) = 0;
942  dci.m_tbsSize.at (j) = 0;
943  NS_LOG_INFO (this << " layer " << (uint16_t)j << " no retx");
944  }
945  }
946  for (uint16_t k = 0; k < (*itRlcPdu).second.at (0).at (dci.m_harqProcess).size (); k++)
947  {
948  std::vector <struct RlcPduListElement_s> rlcPduListPerLc;
949  for (uint8_t j = 0; j < nLayers; j++)
950  {
951  if (retx.at (j))
952  {
953  if (j < dci.m_ndi.size ())
954  {
955  rlcPduListPerLc.push_back ((*itRlcPdu).second.at (j).at (dci.m_harqProcess).at (k));
956  }
957  }
958  }
959 
960  if (rlcPduListPerLc.size () > 0)
961  {
962  newEl.m_rlcPduList.push_back (rlcPduListPerLc);
963  }
964  }
965  newEl.m_rnti = rnti;
966  newEl.m_dci = dci;
967  (*itHarq).second.at (harqId).m_rv = dci.m_rv;
968  // refresh timer
969  std::map <uint16_t, DlHarqProcessesTimer_t>::iterator itHarqTimer = m_dlHarqProcessesTimer.find (rnti);
970  if (itHarqTimer== m_dlHarqProcessesTimer.end ())
971  {
972  NS_FATAL_ERROR ("Unable to find HARQ timer for RNTI " << (uint16_t)rnti);
973  }
974  (*itHarqTimer).second.at (harqId) = 0;
975  ret.m_buildDataList.push_back (newEl);
976  rntiAllocated.insert (rnti);
977  }
978  else
979  {
980  // update HARQ process status
981  NS_LOG_INFO (this << " HARQ received ACK for UE " << m_dlInfoListBuffered.at (i).m_rnti);
982  std::map <uint16_t, DlHarqProcessesStatus_t>::iterator it = m_dlHarqProcessesStatus.find (m_dlInfoListBuffered.at (i).m_rnti);
983  if (it == m_dlHarqProcessesStatus.end ())
984  {
985  NS_FATAL_ERROR ("No info find in HARQ buffer for UE " << m_dlInfoListBuffered.at (i).m_rnti);
986  }
987  (*it).second.at (m_dlInfoListBuffered.at (i).m_harqProcessId) = 0;
988  std::map <uint16_t, DlHarqRlcPduListBuffer_t>::iterator itRlcPdu = m_dlHarqProcessesRlcPduListBuffer.find (m_dlInfoListBuffered.at (i).m_rnti);
989  if (itRlcPdu == m_dlHarqProcessesRlcPduListBuffer.end ())
990  {
991  NS_FATAL_ERROR ("Unable to find RlcPdcList in HARQ buffer for RNTI " << m_dlInfoListBuffered.at (i).m_rnti);
992  }
993  for (uint16_t k = 0; k < (*itRlcPdu).second.size (); k++)
994  {
995  (*itRlcPdu).second.at (k).at (m_dlInfoListBuffered.at (i).m_harqProcessId).clear ();
996  }
997  }
998  }
999  m_dlInfoListBuffered.clear ();
1000  m_dlInfoListBuffered = dlInfoListUntxed;
1001 
1002  if (rbgAllocatedNum == rbgNum)
1003  {
1004  // all the RBGs are already allocated -> exit
1005  if ((ret.m_buildDataList.size () > 0) || (ret.m_buildRarList.size () > 0))
1006  {
1008  }
1009  return;
1010  }
1011 
1012  std::map <uint16_t, fdbetsFlowPerf_t>::iterator itFlow;
1013  std::map <uint16_t, double> estAveThr; // store expected average throughput for UE
1014  std::map <uint16_t, double>::iterator itMax = estAveThr.end ();
1015  std::map <uint16_t, double>::iterator it;
1016  std::map <uint16_t, int> rbgPerRntiLog; // record the number of RBG assigned to UE
1017  double metricMax = 0.0;
1018  for (itFlow = m_flowStatsDl.begin (); itFlow != m_flowStatsDl.end (); itFlow++)
1019  {
1020  std::set <uint16_t>::iterator itRnti = rntiAllocated.find ((*itFlow).first);
1021  if ((itRnti != rntiAllocated.end ())||(!HarqProcessAvailability ((*itFlow).first)))
1022  {
1023  // UE already allocated for HARQ or without HARQ process available -> drop it
1024  if (itRnti != rntiAllocated.end ())
1025  {
1026  NS_LOG_DEBUG (this << " RNTI discared for HARQ tx" << (uint16_t)(*itFlow).first);
1027  }
1028  if (!HarqProcessAvailability ((*itFlow).first))
1029  {
1030  NS_LOG_DEBUG (this << " RNTI discared for HARQ id" << (uint16_t)(*itFlow).first);
1031  }
1032  continue;
1033  }
1034 
1035  estAveThr.insert (std::pair <uint16_t, double> ((*itFlow).first, (*itFlow).second.lastAveragedThroughput));
1036  }
1037 
1038  if (estAveThr.size () != 0)
1039  {
1040  // Find UE with largest priority metric
1041  for (it = estAveThr.begin (); it != estAveThr.end (); it++)
1042  {
1043  double metric = 1 / (*it).second;
1044  if (metric > metricMax)
1045  {
1046  metricMax = metric;
1047  itMax = it;
1048  }
1049  rbgPerRntiLog.insert (std::pair<uint16_t, int> ((*it).first, 1));
1050  }
1051 
1052 
1053  // The scheduler tries the best to achieve the equal throughput among all UEs
1054  int i = 0;
1055  do
1056  {
1057  NS_LOG_INFO (this << " ALLOCATION for RBG " << i << " of " << rbgNum);
1058  if (rbgMap.at (i) == false)
1059  {
1060  // allocate one RBG to current UE
1061  std::map <uint16_t, std::vector <uint16_t> >::iterator itMap;
1062  std::vector <uint16_t> tempMap;
1063  itMap = allocationMap.find ((*itMax).first);
1064  if (itMap == allocationMap.end ())
1065  {
1066  tempMap.push_back (i);
1067  allocationMap.insert (std::pair <uint16_t, std::vector <uint16_t> > ((*itMax).first, tempMap));
1068  }
1069  else
1070  {
1071  (*itMap).second.push_back (i);
1072  }
1073 
1074  // caculate expected throughput for current UE
1075  std::map <uint16_t,uint8_t>::iterator itCqi;
1076  itCqi = m_p10CqiRxed.find ((*itMax).first);
1077  std::map <uint16_t,uint8_t>::iterator itTxMode;
1078  itTxMode = m_uesTxMode.find ((*itMax).first);
1079  if (itTxMode == m_uesTxMode.end ())
1080  {
1081  NS_FATAL_ERROR ("No Transmission Mode info on user " << (*itMax).first);
1082  }
1083  int nLayer = TransmissionModesLayers::TxMode2LayerNum ((*itTxMode).second);
1084  std::vector <uint8_t> mcs;
1085  for (uint8_t j = 0; j < nLayer; j++)
1086  {
1087  if (itCqi == m_p10CqiRxed.end ())
1088  {
1089  mcs.push_back (0); // no info on this user -> lowest MCS
1090  }
1091  else
1092  {
1093  mcs.push_back (m_amc->GetMcsFromCqi ((*itCqi).second));
1094  }
1095  }
1096 
1097  std::map <uint16_t,int>::iterator itRbgPerRntiLog;
1098  itRbgPerRntiLog = rbgPerRntiLog.find ((*itMax).first);
1099  std::map <uint16_t, fdbetsFlowPerf_t>::iterator itPastAveThr;
1100  itPastAveThr = m_flowStatsDl.find ((*itMax).first);
1101  uint32_t bytesTxed = 0;
1102  for (uint8_t j = 0; j < nLayer; j++)
1103  {
1104  int tbSize = (m_amc->GetTbSizeFromMcs (mcs.at (0), (*itRbgPerRntiLog).second * rbgSize) / 8); // (size of TB in bytes according to table 7.1.7.2.1-1 of 36.213)
1105  bytesTxed += tbSize;
1106  }
1107  double expectedAveThr = ((1.0 - (1.0 / m_timeWindow)) * (*itPastAveThr).second.lastAveragedThroughput) + ((1.0 / m_timeWindow) * (double)(bytesTxed / 0.001));
1108 
1109  int rbgPerRnti = (*itRbgPerRntiLog).second;
1110  rbgPerRnti++;
1111  rbgPerRntiLog[(*itMax).first] = rbgPerRnti;
1112  estAveThr[(*itMax).first] = expectedAveThr;
1113 
1114  // find new UE with largest priority metric
1115  metricMax = 0.0;
1116  for (it = estAveThr.begin (); it != estAveThr.end (); it++)
1117  {
1118  double metric = 1 / (*it).second;
1119  if (metric > metricMax)
1120  {
1121  itMax = it;
1122  metricMax = metric;
1123  }
1124  } // end for estAveThr
1125 
1126  rbgMap.at (i) = true;
1127 
1128  } // end for free RBGs
1129 
1130  i++;
1131 
1132  }
1133  while ( i < rbgNum ); // end for RBGs
1134 
1135  } // end if estAveThr
1136 
1137  // reset TTI stats of users
1138  std::map <uint16_t, fdbetsFlowPerf_t>::iterator itStats;
1139  for (itStats = m_flowStatsDl.begin (); itStats != m_flowStatsDl.end (); itStats++)
1140  {
1141  (*itStats).second.lastTtiBytesTrasmitted = 0;
1142  }
1143 
1144  // generate the transmission opportunities by grouping the RBGs of the same RNTI and
1145  // creating the correspondent DCIs
1146  std::map <uint16_t, std::vector <uint16_t> >::iterator itMap = allocationMap.begin ();
1147  while (itMap != allocationMap.end ())
1148  {
1149  // create new BuildDataListElement_s for this LC
1150  BuildDataListElement_s newEl;
1151  newEl.m_rnti = (*itMap).first;
1152  // create the DlDciListElement_s
1153  DlDciListElement_s newDci;
1154  newDci.m_rnti = (*itMap).first;
1155  newDci.m_harqProcess = UpdateHarqProcessId ((*itMap).first);
1156 
1157  uint16_t lcActives = LcActivePerFlow ((*itMap).first);
1158  NS_LOG_INFO (this << "Allocate user " << newEl.m_rnti << " rbg " << lcActives);
1159  if (lcActives == 0)
1160  {
1161  // Set to max value, to avoid divide by 0 below
1162  lcActives = (uint16_t)65535; // UINT16_MAX;
1163  }
1164  uint16_t RgbPerRnti = (*itMap).second.size ();
1165  std::map <uint16_t,uint8_t>::iterator itCqi;
1166  itCqi = m_p10CqiRxed.find ((*itMap).first);
1167  std::map <uint16_t,uint8_t>::iterator itTxMode;
1168  itTxMode = m_uesTxMode.find ((*itMap).first);
1169  if (itTxMode == m_uesTxMode.end ())
1170  {
1171  NS_FATAL_ERROR ("No Transmission Mode info on user " << (*itMap).first);
1172  }
1173  int nLayer = TransmissionModesLayers::TxMode2LayerNum ((*itTxMode).second);
1174 
1175  uint32_t bytesTxed = 0;
1176  for (uint8_t j = 0; j < nLayer; j++)
1177  {
1178  if (itCqi == m_p10CqiRxed.end ())
1179  {
1180  newDci.m_mcs.push_back (0); // no info on this user -> lowest MCS
1181  }
1182  else
1183  {
1184  newDci.m_mcs.push_back ( m_amc->GetMcsFromCqi ((*itCqi).second) );
1185  }
1186 
1187  int tbSize = (m_amc->GetTbSizeFromMcs (newDci.m_mcs.at (j), RgbPerRnti * rbgSize) / 8); // (size of TB in bytes according to table 7.1.7.2.1-1 of 36.213)
1188  newDci.m_tbsSize.push_back (tbSize);
1189  bytesTxed += tbSize;
1190  }
1191 
1192  newDci.m_resAlloc = 0; // only allocation type 0 at this stage
1193  newDci.m_rbBitmap = 0; // TBD (32 bit bitmap see 7.1.6 of 36.213)
1194  uint32_t rbgMask = 0;
1195  for (uint16_t k = 0; k < (*itMap).second.size (); k++)
1196  {
1197  rbgMask = rbgMask + (0x1 << (*itMap).second.at (k));
1198  NS_LOG_INFO (this << " Allocated RBG " << (*itMap).second.at (k));
1199  }
1200  newDci.m_rbBitmap = rbgMask; // (32 bit bitmap see 7.1.6 of 36.213)
1201 
1202  // create the rlc PDUs -> equally divide resources among actives LCs
1203  std::map <LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator itBufReq;
1204  for (itBufReq = m_rlcBufferReq.begin (); itBufReq != m_rlcBufferReq.end (); itBufReq++)
1205  {
1206  if (((*itBufReq).first.m_rnti == (*itMap).first)
1207  && (((*itBufReq).second.m_rlcTransmissionQueueSize > 0)
1208  || ((*itBufReq).second.m_rlcRetransmissionQueueSize > 0)
1209  || ((*itBufReq).second.m_rlcStatusPduSize > 0) ))
1210  {
1211  std::vector <struct RlcPduListElement_s> newRlcPduLe;
1212  for (uint8_t j = 0; j < nLayer; j++)
1213  {
1214  RlcPduListElement_s newRlcEl;
1215  newRlcEl.m_logicalChannelIdentity = (*itBufReq).first.m_lcId;
1216  newRlcEl.m_size = newDci.m_tbsSize.at (j) / lcActives;
1217  NS_LOG_INFO (this << " LCID " << (uint32_t) newRlcEl.m_logicalChannelIdentity << " size " << newRlcEl.m_size << " layer " << (uint16_t)j);
1218  newRlcPduLe.push_back (newRlcEl);
1219  UpdateDlRlcBufferInfo (newDci.m_rnti, newRlcEl.m_logicalChannelIdentity, newRlcEl.m_size);
1220  if (m_harqOn == true)
1221  {
1222  // store RLC PDU list for HARQ
1223  std::map <uint16_t, DlHarqRlcPduListBuffer_t>::iterator itRlcPdu = m_dlHarqProcessesRlcPduListBuffer.find ((*itMap).first);
1224  if (itRlcPdu == m_dlHarqProcessesRlcPduListBuffer.end ())
1225  {
1226  NS_FATAL_ERROR ("Unable to find RlcPdcList in HARQ buffer for RNTI " << (*itMap).first);
1227  }
1228  (*itRlcPdu).second.at (j).at (newDci.m_harqProcess).push_back (newRlcEl);
1229  }
1230  }
1231  newEl.m_rlcPduList.push_back (newRlcPduLe);
1232  }
1233  if ((*itBufReq).first.m_rnti > (*itMap).first)
1234  {
1235  break;
1236  }
1237  }
1238  for (uint8_t j = 0; j < nLayer; j++)
1239  {
1240  newDci.m_ndi.push_back (1);
1241  newDci.m_rv.push_back (0);
1242  }
1243 
1244  newEl.m_dci = newDci;
1245 
1246  if (m_harqOn == true)
1247  {
1248  // store DCI for HARQ
1249  std::map <uint16_t, DlHarqProcessesDciBuffer_t>::iterator itDci = m_dlHarqProcessesDciBuffer.find (newEl.m_rnti);
1250  if (itDci == m_dlHarqProcessesDciBuffer.end ())
1251  {
1252  NS_FATAL_ERROR ("Unable to find RNTI entry in DCI HARQ buffer for RNTI " << newEl.m_rnti);
1253  }
1254  (*itDci).second.at (newDci.m_harqProcess) = newDci;
1255  // refresh timer
1256  std::map <uint16_t, DlHarqProcessesTimer_t>::iterator itHarqTimer = m_dlHarqProcessesTimer.find (newEl.m_rnti);
1257  if (itHarqTimer== m_dlHarqProcessesTimer.end ())
1258  {
1259  NS_FATAL_ERROR ("Unable to find HARQ timer for RNTI " << (uint16_t)newEl.m_rnti);
1260  }
1261  (*itHarqTimer).second.at (newDci.m_harqProcess) = 0;
1262  }
1263 
1264  // ...more parameters -> ingored in this version
1265 
1266  ret.m_buildDataList.push_back (newEl);
1267  // update UE stats
1268  std::map <uint16_t, fdbetsFlowPerf_t>::iterator it;
1269  it = m_flowStatsDl.find ((*itMap).first);
1270  if (it != m_flowStatsDl.end ())
1271  {
1272  (*it).second.lastTtiBytesTrasmitted = bytesTxed;
1273  NS_LOG_INFO (this << " UE total bytes txed " << (*it).second.lastTtiBytesTrasmitted);
1274 
1275 
1276  }
1277  else
1278  {
1279  NS_FATAL_ERROR (this << " No Stats for this allocated UE");
1280  }
1281 
1282  itMap++;
1283  } // end while allocation
1284  ret.m_nrOfPdcchOfdmSymbols = 1;
1285 
1286 
1287  // update UEs stats
1288  NS_LOG_INFO (this << " Update UEs statistics");
1289  for (itStats = m_flowStatsDl.begin (); itStats != m_flowStatsDl.end (); itStats++)
1290  {
1291  (*itStats).second.totalBytesTransmitted += (*itStats).second.lastTtiBytesTrasmitted;
1292  // update average throughput (see eq. 12.3 of Sec 12.3.1.2 of LTE – The UMTS Long Term Evolution, Ed Wiley)
1293  (*itStats).second.lastAveragedThroughput = ((1.0 - (1.0 / m_timeWindow)) * (*itStats).second.lastAveragedThroughput) + ((1.0 / m_timeWindow) * (double)((*itStats).second.lastTtiBytesTrasmitted / 0.001));
1294  NS_LOG_INFO (this << " UE total bytes " << (*itStats).second.totalBytesTransmitted);
1295  NS_LOG_INFO (this << " UE average throughput " << (*itStats).second.lastAveragedThroughput);
1296  (*itStats).second.lastTtiBytesTrasmitted = 0;
1297  }
1298 
1300 
1301 
1302  return;
1303 }
1304 
1305 void
1307 {
1308  NS_LOG_FUNCTION (this);
1309 
1310  m_rachList = params.m_rachList;
1311 
1312  return;
1313 }
1314 
1315 void
1317 {
1318  NS_LOG_FUNCTION (this);
1319 
1320  for (unsigned int i = 0; i < params.m_cqiList.size (); i++)
1321  {
1322  if ( params.m_cqiList.at (i).m_cqiType == CqiListElement_s::P10 )
1323  {
1324  // wideband CQI reporting
1325  std::map <uint16_t,uint8_t>::iterator it;
1326  uint16_t rnti = params.m_cqiList.at (i).m_rnti;
1327  it = m_p10CqiRxed.find (rnti);
1328  if (it == m_p10CqiRxed.end ())
1329  {
1330  // create the new entry
1331  m_p10CqiRxed.insert ( std::pair<uint16_t, uint8_t > (rnti, params.m_cqiList.at (i).m_wbCqi.at (0)) ); // only codeword 0 at this stage (SISO)
1332  // generate correspondent timer
1333  m_p10CqiTimers.insert ( std::pair<uint16_t, uint32_t > (rnti, m_cqiTimersThreshold));
1334  }
1335  else
1336  {
1337  // update the CQI value and refresh correspondent timer
1338  (*it).second = params.m_cqiList.at (i).m_wbCqi.at (0);
1339  // update correspondent timer
1340  std::map <uint16_t,uint32_t>::iterator itTimers;
1341  itTimers = m_p10CqiTimers.find (rnti);
1342  (*itTimers).second = m_cqiTimersThreshold;
1343  }
1344  }
1345  else if ( params.m_cqiList.at (i).m_cqiType == CqiListElement_s::A30 )
1346  {
1347  // subband CQI reporting high layer configured
1348  std::map <uint16_t,SbMeasResult_s>::iterator it;
1349  uint16_t rnti = params.m_cqiList.at (i).m_rnti;
1350  it = m_a30CqiRxed.find (rnti);
1351  if (it == m_a30CqiRxed.end ())
1352  {
1353  // create the new entry
1354  m_a30CqiRxed.insert ( std::pair<uint16_t, SbMeasResult_s > (rnti, params.m_cqiList.at (i).m_sbMeasResult) );
1355  m_a30CqiTimers.insert ( std::pair<uint16_t, uint32_t > (rnti, m_cqiTimersThreshold));
1356  }
1357  else
1358  {
1359  // update the CQI value and refresh correspondent timer
1360  (*it).second = params.m_cqiList.at (i).m_sbMeasResult;
1361  std::map <uint16_t,uint32_t>::iterator itTimers;
1362  itTimers = m_a30CqiTimers.find (rnti);
1363  (*itTimers).second = m_cqiTimersThreshold;
1364  }
1365  }
1366  else
1367  {
1368  NS_LOG_ERROR (this << " CQI type unknown");
1369  }
1370  }
1371 
1372  return;
1373 }
1374 
1375 
1376 double
1377 FdBetFfMacScheduler::EstimateUlSinr (uint16_t rnti, uint16_t rb)
1378 {
1379  std::map <uint16_t, std::vector <double> >::iterator itCqi = m_ueCqi.find (rnti);
1380  if (itCqi == m_ueCqi.end ())
1381  {
1382  // no cqi info about this UE
1383  return (NO_SINR);
1384 
1385  }
1386  else
1387  {
1388  // take the average SINR value among the available
1389  double sinrSum = 0;
1390  int sinrNum = 0;
1391  for (uint32_t i = 0; i < m_cschedCellConfig.m_ulBandwidth; i++)
1392  {
1393  double sinr = (*itCqi).second.at (i);
1394  if (sinr != NO_SINR)
1395  {
1396  sinrSum += sinr;
1397  sinrNum++;
1398  }
1399  }
1400  double estimatedSinr = (sinrNum > 0) ? (sinrSum / sinrNum) : DBL_MAX;
1401  // store the value
1402  (*itCqi).second.at (rb) = estimatedSinr;
1403  return (estimatedSinr);
1404  }
1405 }
1406 
1407 void
1409 {
1410  NS_LOG_FUNCTION (this << " UL - Frame no. " << (params.m_sfnSf >> 4) << " subframe no. " << (0xF & params.m_sfnSf) << " size " << params.m_ulInfoList.size ());
1411 
1412  RefreshUlCqiMaps ();
1413 
1414  // Generate RBs map
1416  std::vector <bool> rbMap;
1417  uint16_t rbAllocatedNum = 0;
1418  std::set <uint16_t> rntiAllocated;
1419  std::vector <uint16_t> rbgAllocationMap;
1420  // update with RACH allocation map
1421  rbgAllocationMap = m_rachAllocationMap;
1422  //rbgAllocationMap.resize (m_cschedCellConfig.m_ulBandwidth, 0);
1423  m_rachAllocationMap.clear ();
1425 
1426  rbMap.resize (m_cschedCellConfig.m_ulBandwidth, false);
1427  // remove RACH allocation
1428  for (uint16_t i = 0; i < m_cschedCellConfig.m_ulBandwidth; i++)
1429  {
1430  if (rbgAllocationMap.at (i) != 0)
1431  {
1432  rbMap.at (i) = true;
1433  NS_LOG_DEBUG (this << " Allocated for RACH " << i);
1434  }
1435  }
1436 
1437 
1438  if (m_harqOn == true)
1439  {
1440  // Process UL HARQ feedback
1441  for (uint16_t i = 0; i < params.m_ulInfoList.size (); i++)
1442  {
1443  if (params.m_ulInfoList.at (i).m_receptionStatus == UlInfoListElement_s::NotOk)
1444  {
1445  // retx correspondent block: retrieve the UL-DCI
1446  uint16_t rnti = params.m_ulInfoList.at (i).m_rnti;
1447  std::map <uint16_t, uint8_t>::iterator itProcId = m_ulHarqCurrentProcessId.find (rnti);
1448  if (itProcId == m_ulHarqCurrentProcessId.end ())
1449  {
1450  NS_LOG_ERROR ("No info find in HARQ buffer for UE (might change eNB) " << rnti);
1451  }
1452  uint8_t harqId = (uint8_t)((*itProcId).second - HARQ_PERIOD) % HARQ_PROC_NUM;
1453  NS_LOG_INFO (this << " UL-HARQ retx RNTI " << rnti << " harqId " << (uint16_t)harqId << " i " << i << " size " << params.m_ulInfoList.size ());
1454  std::map <uint16_t, UlHarqProcessesDciBuffer_t>::iterator itHarq = m_ulHarqProcessesDciBuffer.find (rnti);
1455  if (itHarq == m_ulHarqProcessesDciBuffer.end ())
1456  {
1457  NS_LOG_ERROR ("No info find in HARQ buffer for UE (might change eNB) " << rnti);
1458  continue;
1459  }
1460  UlDciListElement_s dci = (*itHarq).second.at (harqId);
1461  std::map <uint16_t, UlHarqProcessesStatus_t>::iterator itStat = m_ulHarqProcessesStatus.find (rnti);
1462  if (itStat == m_ulHarqProcessesStatus.end ())
1463  {
1464  NS_LOG_ERROR ("No info find in HARQ buffer for UE (might change eNB) " << rnti);
1465  }
1466  if ((*itStat).second.at (harqId) >= 3)
1467  {
1468  NS_LOG_INFO ("Max number of retransmissions reached (UL)-> drop process");
1469  continue;
1470  }
1471  bool free = true;
1472  for (int j = dci.m_rbStart; j < dci.m_rbStart + dci.m_rbLen; j++)
1473  {
1474  if (rbMap.at (j) == true)
1475  {
1476  free = false;
1477  NS_LOG_INFO (this << " BUSY " << j);
1478  }
1479  }
1480  if (free)
1481  {
1482  // retx on the same RBs
1483  for (int j = dci.m_rbStart; j < dci.m_rbStart + dci.m_rbLen; j++)
1484  {
1485  rbMap.at (j) = true;
1486  rbgAllocationMap.at (j) = dci.m_rnti;
1487  NS_LOG_INFO ("\tRB " << j);
1488  rbAllocatedNum++;
1489  }
1490  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);
1491  }
1492  else
1493  {
1494  NS_LOG_INFO ("Cannot allocate retx due to RACH allocations for UE " << rnti);
1495  continue;
1496  }
1497  dci.m_ndi = 0;
1498  // Update HARQ buffers with new HarqId
1499  (*itStat).second.at ((*itProcId).second) = (*itStat).second.at (harqId) + 1;
1500  (*itStat).second.at (harqId) = 0;
1501  (*itHarq).second.at ((*itProcId).second) = dci;
1502  ret.m_dciList.push_back (dci);
1503  rntiAllocated.insert (dci.m_rnti);
1504  }
1505  else
1506  {
1507  NS_LOG_INFO (this << " HARQ-ACK feedback from RNTI " << params.m_ulInfoList.at (i).m_rnti);
1508  }
1509  }
1510  }
1511 
1512  std::map <uint16_t,uint32_t>::iterator it;
1513  int nflows = 0;
1514 
1515  for (it = m_ceBsrRxed.begin (); it != m_ceBsrRxed.end (); it++)
1516  {
1517  std::set <uint16_t>::iterator itRnti = rntiAllocated.find ((*it).first);
1518  // select UEs with queues not empty and not yet allocated for HARQ
1519  if (((*it).second > 0)&&(itRnti == rntiAllocated.end ()))
1520  {
1521  nflows++;
1522  }
1523  }
1524 
1525  if (nflows == 0)
1526  {
1527  if (ret.m_dciList.size () > 0)
1528  {
1530  }
1531 
1532  return; // no flows to be scheduled
1533  }
1534 
1535 
1536  // Divide the remaining resources equally among the active users starting from the subsequent one served last scheduling trigger
1537  uint16_t rbPerFlow = (m_cschedCellConfig.m_ulBandwidth) / (nflows + rntiAllocated.size ());
1538  if (rbPerFlow < 3)
1539  {
1540  rbPerFlow = 3; // at least 3 rbg per flow (till available resource) to ensure TxOpportunity >= 7 bytes
1541  }
1542  int rbAllocated = 0;
1543 
1544  std::map <uint16_t, fdbetsFlowPerf_t>::iterator itStats;
1545  if (m_nextRntiUl != 0)
1546  {
1547  for (it = m_ceBsrRxed.begin (); it != m_ceBsrRxed.end (); it++)
1548  {
1549  if ((*it).first == m_nextRntiUl)
1550  {
1551  break;
1552  }
1553  }
1554  if (it == m_ceBsrRxed.end ())
1555  {
1556  NS_LOG_ERROR (this << " no user found");
1557  }
1558  }
1559  else
1560  {
1561  it = m_ceBsrRxed.begin ();
1562  m_nextRntiUl = (*it).first;
1563  }
1564  do
1565  {
1566  std::set <uint16_t>::iterator itRnti = rntiAllocated.find ((*it).first);
1567  if ((itRnti != rntiAllocated.end ())||((*it).second == 0))
1568  {
1569  // UE already allocated for UL-HARQ -> skip it
1570  NS_LOG_DEBUG (this << " UE already allocated in HARQ -> discared, RNTI " << (*it).first);
1571  it++;
1572  if (it == m_ceBsrRxed.end ())
1573  {
1574  // restart from the first
1575  it = m_ceBsrRxed.begin ();
1576  }
1577  continue;
1578  }
1579  if (rbAllocated + rbPerFlow - 1 > m_cschedCellConfig.m_ulBandwidth)
1580  {
1581  // limit to physical resources last resource assignment
1582  rbPerFlow = m_cschedCellConfig.m_ulBandwidth - rbAllocated;
1583  // at least 3 rbg per flow to ensure TxOpportunity >= 7 bytes
1584  if (rbPerFlow < 3)
1585  {
1586  // terminate allocation
1587  rbPerFlow = 0;
1588  }
1589  }
1590 
1591  UlDciListElement_s uldci;
1592  uldci.m_rnti = (*it).first;
1593  uldci.m_rbLen = rbPerFlow;
1594  bool allocated = false;
1595  NS_LOG_INFO (this << " RB Allocated " << rbAllocated << " rbPerFlow " << rbPerFlow << " flows " << nflows);
1596  while ((!allocated)&&((rbAllocated + rbPerFlow - 1) < m_cschedCellConfig.m_ulBandwidth) && (rbPerFlow != 0))
1597  {
1598  // check availability
1599  bool free = true;
1600  for (uint16_t j = rbAllocated; j < rbAllocated + rbPerFlow; j++)
1601  {
1602  if (rbMap.at (j) == true)
1603  {
1604  free = false;
1605  break;
1606  }
1607  }
1608  if (free)
1609  {
1610  uldci.m_rbStart = rbAllocated;
1611 
1612  for (uint16_t j = rbAllocated; j < rbAllocated + rbPerFlow; j++)
1613  {
1614  rbMap.at (j) = true;
1615  // store info on allocation for managing ul-cqi interpretation
1616  rbgAllocationMap.at (j) = (*it).first;
1617  }
1618  rbAllocated += rbPerFlow;
1619  allocated = true;
1620  break;
1621  }
1622  rbAllocated++;
1623  if (rbAllocated + rbPerFlow - 1 > m_cschedCellConfig.m_ulBandwidth)
1624  {
1625  // limit to physical resources last resource assignment
1626  rbPerFlow = m_cschedCellConfig.m_ulBandwidth - rbAllocated;
1627  // at least 3 rbg per flow to ensure TxOpportunity >= 7 bytes
1628  if (rbPerFlow < 3)
1629  {
1630  // terminate allocation
1631  rbPerFlow = 0;
1632  }
1633  }
1634  }
1635  if (!allocated)
1636  {
1637  // unable to allocate new resource: finish scheduling
1638  m_nextRntiUl = (*it).first;
1639  if (ret.m_dciList.size () > 0)
1640  {
1642  }
1643  m_allocationMaps.insert (std::pair <uint16_t, std::vector <uint16_t> > (params.m_sfnSf, rbgAllocationMap));
1644  return;
1645  }
1646 
1647 
1648 
1649  std::map <uint16_t, std::vector <double> >::iterator itCqi = m_ueCqi.find ((*it).first);
1650  int cqi = 0;
1651  if (itCqi == m_ueCqi.end ())
1652  {
1653  // no cqi info about this UE
1654  uldci.m_mcs = 0; // MCS 0 -> UL-AMC TBD
1655  }
1656  else
1657  {
1658  // take the lowest CQI value (worst RB)
1659  double minSinr = (*itCqi).second.at (uldci.m_rbStart);
1660  if (minSinr == NO_SINR)
1661  {
1662  minSinr = EstimateUlSinr ((*it).first, uldci.m_rbStart);
1663  }
1664  for (uint16_t i = uldci.m_rbStart; i < uldci.m_rbStart + uldci.m_rbLen; i++)
1665  {
1666  double sinr = (*itCqi).second.at (i);
1667  if (sinr == NO_SINR)
1668  {
1669  sinr = EstimateUlSinr ((*it).first, i);
1670  }
1671  if ((*itCqi).second.at (i) < minSinr)
1672  {
1673  minSinr = (*itCqi).second.at (i);
1674  }
1675  }
1676 
1677  // translate SINR -> cqi: WILD ACK: same as DL
1678  double s = log2 ( 1 + (
1679  std::pow (10, minSinr / 10 ) /
1680  ( (-std::log (5.0 * 0.00005 )) / 1.5) ));
1681  cqi = m_amc->GetCqiFromSpectralEfficiency (s);
1682  if (cqi == 0)
1683  {
1684  it++;
1685  if (it == m_ceBsrRxed.end ())
1686  {
1687  // restart from the first
1688  it = m_ceBsrRxed.begin ();
1689  }
1690  NS_LOG_DEBUG (this << " UE discared for CQI=0, RNTI " << uldci.m_rnti);
1691  // remove UE from allocation map
1692  for (uint16_t i = uldci.m_rbStart; i < uldci.m_rbStart + uldci.m_rbLen; i++)
1693  {
1694  rbgAllocationMap.at (i) = 0;
1695  }
1696  continue; // CQI == 0 means "out of range" (see table 7.2.3-1 of 36.213)
1697  }
1698  uldci.m_mcs = m_amc->GetMcsFromCqi (cqi);
1699  }
1700 
1701  uldci.m_tbSize = (m_amc->GetTbSizeFromMcs (uldci.m_mcs, rbPerFlow) / 8);
1702  UpdateUlRlcBufferInfo (uldci.m_rnti, uldci.m_tbSize);
1703  uldci.m_ndi = 1;
1704  uldci.m_cceIndex = 0;
1705  uldci.m_aggrLevel = 1;
1706  uldci.m_ueTxAntennaSelection = 3; // antenna selection OFF
1707  uldci.m_hopping = false;
1708  uldci.m_n2Dmrs = 0;
1709  uldci.m_tpc = 0; // no power control
1710  uldci.m_cqiRequest = false; // only period CQI at this stage
1711  uldci.m_ulIndex = 0; // TDD parameter
1712  uldci.m_dai = 1; // TDD parameter
1713  uldci.m_freqHopping = 0;
1714  uldci.m_pdcchPowerOffset = 0; // not used
1715  ret.m_dciList.push_back (uldci);
1716  // store DCI for HARQ_PERIOD
1717  uint8_t harqId = 0;
1718  if (m_harqOn == true)
1719  {
1720  std::map <uint16_t, uint8_t>::iterator itProcId;
1721  itProcId = m_ulHarqCurrentProcessId.find (uldci.m_rnti);
1722  if (itProcId == m_ulHarqCurrentProcessId.end ())
1723  {
1724  NS_FATAL_ERROR ("No info find in HARQ buffer for UE " << uldci.m_rnti);
1725  }
1726  harqId = (*itProcId).second;
1727  std::map <uint16_t, UlHarqProcessesDciBuffer_t>::iterator itDci = m_ulHarqProcessesDciBuffer.find (uldci.m_rnti);
1728  if (itDci == m_ulHarqProcessesDciBuffer.end ())
1729  {
1730  NS_FATAL_ERROR ("Unable to find RNTI entry in UL DCI HARQ buffer for RNTI " << uldci.m_rnti);
1731  }
1732  (*itDci).second.at (harqId) = uldci;
1733  }
1734 
1735  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);
1736 
1737  // update TTI UE stats
1738  itStats = m_flowStatsUl.find ((*it).first);
1739  if (itStats != m_flowStatsUl.end ())
1740  {
1741  (*itStats).second.lastTtiBytesTrasmitted = uldci.m_tbSize;
1742  }
1743  else
1744  {
1745  NS_LOG_DEBUG (this << " No Stats for this allocated UE");
1746  }
1747 
1748 
1749  it++;
1750  if (it == m_ceBsrRxed.end ())
1751  {
1752  // restart from the first
1753  it = m_ceBsrRxed.begin ();
1754  }
1755  if ((rbAllocated == m_cschedCellConfig.m_ulBandwidth) || (rbPerFlow == 0))
1756  {
1757  // Stop allocation: no more PRBs
1758  m_nextRntiUl = (*it).first;
1759  break;
1760  }
1761  }
1762  while (((*it).first != m_nextRntiUl)&&(rbPerFlow!=0));
1763 
1764 
1765  // Update global UE stats
1766  // update UEs stats
1767  for (itStats = m_flowStatsUl.begin (); itStats != m_flowStatsUl.end (); itStats++)
1768  {
1769  (*itStats).second.totalBytesTransmitted += (*itStats).second.lastTtiBytesTrasmitted;
1770  // update average throughput (see eq. 12.3 of Sec 12.3.1.2 of LTE – The UMTS Long Term Evolution, Ed Wiley)
1771  (*itStats).second.lastAveragedThroughput = ((1.0 - (1.0 / m_timeWindow)) * (*itStats).second.lastAveragedThroughput) + ((1.0 / m_timeWindow) * (double)((*itStats).second.lastTtiBytesTrasmitted / 0.001));
1772  NS_LOG_INFO (this << " UE total bytes " << (*itStats).second.totalBytesTransmitted);
1773  NS_LOG_INFO (this << " UE average throughput " << (*itStats).second.lastAveragedThroughput);
1774  (*itStats).second.lastTtiBytesTrasmitted = 0;
1775  }
1776  m_allocationMaps.insert (std::pair <uint16_t, std::vector <uint16_t> > (params.m_sfnSf, rbgAllocationMap));
1778 
1779  return;
1780 }
1781 
1782 void
1784 {
1785  NS_LOG_FUNCTION (this);
1786  return;
1787 }
1788 
1789 void
1791 {
1792  NS_LOG_FUNCTION (this);
1793  return;
1794 }
1795 
1796 void
1798 {
1799  NS_LOG_FUNCTION (this);
1800 
1801  std::map <uint16_t,uint32_t>::iterator it;
1802 
1803  for (unsigned int i = 0; i < params.m_macCeList.size (); i++)
1804  {
1805  if ( params.m_macCeList.at (i).m_macCeType == MacCeListElement_s::BSR )
1806  {
1807  // buffer status report
1808  // note that this scheduler does not differentiate the
1809  // allocation according to which LCGs have more/less bytes
1810  // to send.
1811  // Hence the BSR of different LCGs are just summed up to get
1812  // a total queue size that is used for allocation purposes.
1813 
1814  uint32_t buffer = 0;
1815  for (uint8_t lcg = 0; lcg < 4; ++lcg)
1816  {
1817  uint8_t bsrId = params.m_macCeList.at (i).m_macCeValue.m_bufferStatus.at (lcg);
1818  buffer += BufferSizeLevelBsr::BsrId2BufferSize (bsrId);
1819  }
1820 
1821  uint16_t rnti = params.m_macCeList.at (i).m_rnti;
1822  NS_LOG_LOGIC (this << "RNTI=" << rnti << " buffer=" << buffer);
1823  it = m_ceBsrRxed.find (rnti);
1824  if (it == m_ceBsrRxed.end ())
1825  {
1826  // create the new entry
1827  m_ceBsrRxed.insert ( std::pair<uint16_t, uint32_t > (rnti, buffer));
1828  }
1829  else
1830  {
1831  // update the buffer size value
1832  (*it).second = buffer;
1833  }
1834  }
1835  }
1836 
1837  return;
1838 }
1839 
1840 void
1842 {
1843  NS_LOG_FUNCTION (this);
1844 // retrieve the allocation for this subframe
1845  switch (m_ulCqiFilter)
1846  {
1848  {
1849  // filter all the CQIs that are not SRS based
1850  if (params.m_ulCqi.m_type != UlCqi_s::SRS)
1851  {
1852  return;
1853  }
1854  }
1855  break;
1857  {
1858  // filter all the CQIs that are not SRS based
1859  if (params.m_ulCqi.m_type != UlCqi_s::PUSCH)
1860  {
1861  return;
1862  }
1863  }
1865  break;
1866 
1867  default:
1868  NS_FATAL_ERROR ("Unknown UL CQI type");
1869  }
1870 
1871  switch (params.m_ulCqi.m_type)
1872  {
1873  case UlCqi_s::PUSCH:
1874  {
1875  std::map <uint16_t, std::vector <uint16_t> >::iterator itMap;
1876  std::map <uint16_t, std::vector <double> >::iterator itCqi;
1877  NS_LOG_DEBUG (this << " Collect PUSCH CQIs of Frame no. " << (params.m_sfnSf >> 4) << " subframe no. " << (0xF & params.m_sfnSf));
1878  itMap = m_allocationMaps.find (params.m_sfnSf);
1879  if (itMap == m_allocationMaps.end ())
1880  {
1881  return;
1882  }
1883  for (uint32_t i = 0; i < (*itMap).second.size (); i++)
1884  {
1885  // convert from fixed point notation Sxxxxxxxxxxx.xxx to double
1886  double sinr = LteFfConverter::fpS11dot3toDouble (params.m_ulCqi.m_sinr.at (i));
1887  itCqi = m_ueCqi.find ((*itMap).second.at (i));
1888  if (itCqi == m_ueCqi.end ())
1889  {
1890  // create a new entry
1891  std::vector <double> newCqi;
1892  for (uint32_t j = 0; j < m_cschedCellConfig.m_ulBandwidth; j++)
1893  {
1894  if (i == j)
1895  {
1896  newCqi.push_back (sinr);
1897  }
1898  else
1899  {
1900  // initialize with NO_SINR value.
1901  newCqi.push_back (NO_SINR);
1902  }
1903 
1904  }
1905  m_ueCqi.insert (std::pair <uint16_t, std::vector <double> > ((*itMap).second.at (i), newCqi));
1906  // generate correspondent timer
1907  m_ueCqiTimers.insert (std::pair <uint16_t, uint32_t > ((*itMap).second.at (i), m_cqiTimersThreshold));
1908  }
1909  else
1910  {
1911  // update the value
1912  (*itCqi).second.at (i) = sinr;
1913  NS_LOG_DEBUG (this << " RNTI " << (*itMap).second.at (i) << " RB " << i << " SINR " << sinr);
1914  // update correspondent timer
1915  std::map <uint16_t, uint32_t>::iterator itTimers;
1916  itTimers = m_ueCqiTimers.find ((*itMap).second.at (i));
1917  (*itTimers).second = m_cqiTimersThreshold;
1918 
1919  }
1920 
1921  }
1922  // remove obsolete info on allocation
1923  m_allocationMaps.erase (itMap);
1924  }
1925  break;
1926  case UlCqi_s::SRS:
1927  {
1928  // get the RNTI from vendor specific parameters
1929  uint16_t rnti = 0;
1930  NS_ASSERT (params.m_vendorSpecificList.size () > 0);
1931  for (uint16_t i = 0; i < params.m_vendorSpecificList.size (); i++)
1932  {
1933  if (params.m_vendorSpecificList.at (i).m_type == SRS_CQI_RNTI_VSP)
1934  {
1935  Ptr<SrsCqiRntiVsp> vsp = DynamicCast<SrsCqiRntiVsp> (params.m_vendorSpecificList.at (i).m_value);
1936  rnti = vsp->GetRnti ();
1937  }
1938  }
1939  std::map <uint16_t, std::vector <double> >::iterator itCqi;
1940  itCqi = m_ueCqi.find (rnti);
1941  if (itCqi == m_ueCqi.end ())
1942  {
1943  // create a new entry
1944  std::vector <double> newCqi;
1945  for (uint32_t j = 0; j < m_cschedCellConfig.m_ulBandwidth; j++)
1946  {
1947  double sinr = LteFfConverter::fpS11dot3toDouble (params.m_ulCqi.m_sinr.at (j));
1948  newCqi.push_back (sinr);
1949  NS_LOG_INFO (this << " RNTI " << rnti << " new SRS-CQI for RB " << j << " value " << sinr);
1950 
1951  }
1952  m_ueCqi.insert (std::pair <uint16_t, std::vector <double> > (rnti, newCqi));
1953  // generate correspondent timer
1954  m_ueCqiTimers.insert (std::pair <uint16_t, uint32_t > (rnti, m_cqiTimersThreshold));
1955  }
1956  else
1957  {
1958  // update the values
1959  for (uint32_t j = 0; j < m_cschedCellConfig.m_ulBandwidth; j++)
1960  {
1961  double sinr = LteFfConverter::fpS11dot3toDouble (params.m_ulCqi.m_sinr.at (j));
1962  (*itCqi).second.at (j) = sinr;
1963  NS_LOG_INFO (this << " RNTI " << rnti << " update SRS-CQI for RB " << j << " value " << sinr);
1964  }
1965  // update correspondent timer
1966  std::map <uint16_t, uint32_t>::iterator itTimers;
1967  itTimers = m_ueCqiTimers.find (rnti);
1968  (*itTimers).second = m_cqiTimersThreshold;
1969 
1970  }
1971 
1972 
1973  }
1974  break;
1975  case UlCqi_s::PUCCH_1:
1976  case UlCqi_s::PUCCH_2:
1977  case UlCqi_s::PRACH:
1978  {
1979  NS_FATAL_ERROR ("FdBetFfMacScheduler supports only PUSCH and SRS UL-CQIs");
1980  }
1981  break;
1982  default:
1983  NS_FATAL_ERROR ("Unknown type of UL-CQI");
1984  }
1985  return;
1986 }
1987 
1988 void
1990 {
1991  // refresh DL CQI P01 Map
1992  std::map <uint16_t,uint32_t>::iterator itP10 = m_p10CqiTimers.begin ();
1993  while (itP10 != m_p10CqiTimers.end ())
1994  {
1995  NS_LOG_INFO (this << " P10-CQI for user " << (*itP10).first << " is " << (uint32_t)(*itP10).second << " thr " << (uint32_t)m_cqiTimersThreshold);
1996  if ((*itP10).second == 0)
1997  {
1998  // delete correspondent entries
1999  std::map <uint16_t,uint8_t>::iterator itMap = m_p10CqiRxed.find ((*itP10).first);
2000  NS_ASSERT_MSG (itMap != m_p10CqiRxed.end (), " Does not find CQI report for user " << (*itP10).first);
2001  NS_LOG_INFO (this << " P10-CQI expired for user " << (*itP10).first);
2002  m_p10CqiRxed.erase (itMap);
2003  std::map <uint16_t,uint32_t>::iterator temp = itP10;
2004  itP10++;
2005  m_p10CqiTimers.erase (temp);
2006  }
2007  else
2008  {
2009  (*itP10).second--;
2010  itP10++;
2011  }
2012  }
2013 
2014  // refresh DL CQI A30 Map
2015  std::map <uint16_t,uint32_t>::iterator itA30 = m_a30CqiTimers.begin ();
2016  while (itA30 != m_a30CqiTimers.end ())
2017  {
2018  NS_LOG_INFO (this << " A30-CQI for user " << (*itA30).first << " is " << (uint32_t)(*itA30).second << " thr " << (uint32_t)m_cqiTimersThreshold);
2019  if ((*itA30).second == 0)
2020  {
2021  // delete correspondent entries
2022  std::map <uint16_t,SbMeasResult_s>::iterator itMap = m_a30CqiRxed.find ((*itA30).first);
2023  NS_ASSERT_MSG (itMap != m_a30CqiRxed.end (), " Does not find CQI report for user " << (*itA30).first);
2024  NS_LOG_INFO (this << " A30-CQI expired for user " << (*itA30).first);
2025  m_a30CqiRxed.erase (itMap);
2026  std::map <uint16_t,uint32_t>::iterator temp = itA30;
2027  itA30++;
2028  m_a30CqiTimers.erase (temp);
2029  }
2030  else
2031  {
2032  (*itA30).second--;
2033  itA30++;
2034  }
2035  }
2036 
2037  return;
2038 }
2039 
2040 
2041 void
2043 {
2044  // refresh UL CQI Map
2045  std::map <uint16_t,uint32_t>::iterator itUl = m_ueCqiTimers.begin ();
2046  while (itUl != m_ueCqiTimers.end ())
2047  {
2048  NS_LOG_INFO (this << " UL-CQI for user " << (*itUl).first << " is " << (uint32_t)(*itUl).second << " thr " << (uint32_t)m_cqiTimersThreshold);
2049  if ((*itUl).second == 0)
2050  {
2051  // delete correspondent entries
2052  std::map <uint16_t, std::vector <double> >::iterator itMap = m_ueCqi.find ((*itUl).first);
2053  NS_ASSERT_MSG (itMap != m_ueCqi.end (), " Does not find CQI report for user " << (*itUl).first);
2054  NS_LOG_INFO (this << " UL-CQI exired for user " << (*itUl).first);
2055  (*itMap).second.clear ();
2056  m_ueCqi.erase (itMap);
2057  std::map <uint16_t,uint32_t>::iterator temp = itUl;
2058  itUl++;
2059  m_ueCqiTimers.erase (temp);
2060  }
2061  else
2062  {
2063  (*itUl).second--;
2064  itUl++;
2065  }
2066  }
2067 
2068  return;
2069 }
2070 
2071 void
2072 FdBetFfMacScheduler::UpdateDlRlcBufferInfo (uint16_t rnti, uint8_t lcid, uint16_t size)
2073 {
2074  std::map<LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator it;
2075  LteFlowId_t flow (rnti, lcid);
2076  it = m_rlcBufferReq.find (flow);
2077  if (it != m_rlcBufferReq.end ())
2078  {
2079  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);
2080  // Update queues: RLC tx order Status, ReTx, Tx
2081  // Update status queue
2082  if (((*it).second.m_rlcStatusPduSize > 0) && (size >= (*it).second.m_rlcStatusPduSize))
2083  {
2084  (*it).second.m_rlcStatusPduSize = 0;
2085  }
2086  else if (((*it).second.m_rlcRetransmissionQueueSize > 0) && (size >= (*it).second.m_rlcRetransmissionQueueSize))
2087  {
2088  (*it).second.m_rlcRetransmissionQueueSize = 0;
2089  }
2090  else if ((*it).second.m_rlcTransmissionQueueSize > 0)
2091  {
2092  uint32_t rlcOverhead;
2093  if (lcid == 1)
2094  {
2095  // for SRB1 (using RLC AM) it's better to
2096  // overestimate RLC overhead rather than
2097  // underestimate it and risk unneeded
2098  // segmentation which increases delay
2099  rlcOverhead = 4;
2100  }
2101  else
2102  {
2103  // minimum RLC overhead due to header
2104  rlcOverhead = 2;
2105  }
2106  // update transmission queue
2107  if ((*it).second.m_rlcTransmissionQueueSize <= size - rlcOverhead)
2108  {
2109  (*it).second.m_rlcTransmissionQueueSize = 0;
2110  }
2111  else
2112  {
2113  (*it).second.m_rlcTransmissionQueueSize -= size - rlcOverhead;
2114  }
2115  }
2116  }
2117  else
2118  {
2119  NS_LOG_ERROR (this << " Does not find DL RLC Buffer Report of UE " << rnti);
2120  }
2121 }
2122 
2123 void
2124 FdBetFfMacScheduler::UpdateUlRlcBufferInfo (uint16_t rnti, uint16_t size)
2125 {
2126 
2127  size = size - 2; // remove the minimum RLC overhead
2128  std::map <uint16_t,uint32_t>::iterator it = m_ceBsrRxed.find (rnti);
2129  if (it != m_ceBsrRxed.end ())
2130  {
2131  NS_LOG_INFO (this << " UE " << rnti << " size " << size << " BSR " << (*it).second);
2132  if ((*it).second >= size)
2133  {
2134  (*it).second -= size;
2135  }
2136  else
2137  {
2138  (*it).second = 0;
2139  }
2140  }
2141  else
2142  {
2143  NS_LOG_ERROR (this << " Does not find BSR report info of UE " << rnti);
2144  }
2145 
2146 }
2147 
2148 void
2150 {
2151  NS_LOG_FUNCTION (this << " RNTI " << rnti << " txMode " << (uint16_t)txMode);
2153  params.m_rnti = rnti;
2154  params.m_transmissionMode = txMode;
2156 }
2157 
2158 
2159 }
virtual void SetFfMacCschedSapUser(FfMacCschedSapUser *s)
set the user part of the FfMacCschedSap that this Scheduler will interact with.
std::vector< struct UlInfoListElement_s > m_ulInfoList
See section 4.3.1 dlDciListElement.
Definition: ff-mac-common.h:88
virtual void SchedDlMacBufferReq(const struct SchedDlMacBufferReqParameters &params)
void RefreshHarqProcesses()
Refresh HARQ processes according to the timers.
int FdBetType0AllocationRbg[4]
smart pointer class similar to boost::intrusive_ptr
Definition: ptr.h:59
#define NS_LOG_FUNCTION(parameters)
Definition: log.h:345
void UpdateDlRlcBufferInfo(uint16_t rnti, uint8_t lcid, uint16_t size)
virtual ~FdBetFfMacScheduler()
Destructor.
#define HARQ_PERIOD
Definition: lte-common.h:30
Hold a bool native type.
Definition: boolean.h:38
Parameters of the CSCHED_UE_CONFIG_CNF primitive.
Parameters of the CSCHED_UE_RELEASE_REQ primitive.
virtual void CschedLcReleaseReq(const struct CschedLcReleaseReqParameters &params)
virtual void CschedUeConfigReq(const struct CschedUeConfigReqParameters &params)
void DoSchedUlMacCtrlInfoReq(const struct FfMacSchedSapProvider::SchedUlMacCtrlInfoReqParameters &params)
enum ns3::UlCqi_s::Type_e m_type
void DoSchedUlNoiseInterferenceReq(const struct FfMacSchedSapProvider::SchedUlNoiseInterferenceReqParameters &params)
std::vector< UlDciListElement_s > UlHarqProcessesDciBuffer_t
virtual void SchedDlPagingBufferReq(const struct SchedDlPagingBufferReqParameters &params)
std::vector< struct LogicalChannelConfigListElement_s > m_logicalChannelConfigList
std::vector< uint16_t > m_sinr
virtual void DoDispose(void)
This method is called by Object::Dispose or by the object's destructor, whichever comes first...
std::vector< uint8_t > DlHarqProcessesTimer_t
#define NO_SINR
#define NS_ASSERT(condition)
Definition: assert.h:64
NS_OBJECT_ENSURE_REGISTERED(NullMessageSimulatorImpl)
std::vector< uint8_t > m_mcs
Definition: ff-mac-common.h:95
virtual void SchedUlTriggerReq(const struct SchedUlTriggerReqParameters &params)
uint8_t UpdateHarqProcessId(uint16_t rnti)
Update and return a new process Id for the RNTI specified.
virtual void SetFfMacSchedSapUser(FfMacSchedSapUser *s)
set the user part of the FfMacSchedSap that this Scheduler will interact with.
See section 4.3.2 ulDciListElement.
Provides the CSCHED SAP.
std::vector< struct UlDciListElement_s > m_dciList
#define NS_LOG_INFO(msg)
Definition: log.h:298
See section 4.3.10 buildRARListElement.
std::map< uint16_t, fdbetsFlowPerf_t > m_flowStatsDl
Parameters of the CSCHED_UE_CONFIG_UPDATE_IND primitive.
virtual void SchedDlTriggerReq(const struct SchedDlTriggerReqParameters &params)
Parameters of the CSCHED_LC_RELEASE_REQ primitive.
virtual FfMacSchedSapProvider * GetFfMacSchedSapProvider()
std::vector< std::vector< struct RlcPduListElement_s > > m_rlcPduList
std::map< uint16_t, uint8_t > m_p10CqiRxed
std::vector< uint16_t > m_rachAllocationMap
Parameters of the SCHED_DL_TRIGGER_REQ primitive.
std::map< uint16_t, DlHarqProcessesDciBuffer_t > m_dlHarqProcessesDciBuffer
#define NS_FATAL_ERROR(msg)
fatal error handling
Definition: fatal-error.h:72
void DoSchedUlTriggerReq(const struct FfMacSchedSapProvider::SchedUlTriggerReqParameters &params)
FfMacSchedSapUser * m_schedSapUser
void DoSchedDlMacBufferReq(const struct FfMacSchedSapProvider::SchedDlMacBufferReqParameters &params)
Implements the SCHED SAP and CSCHED SAP for a Frequency Domain Blind Equal Throughput scheduler...
std::vector< RlcPduList_t > DlHarqRlcPduListBuffer_t
Parameters of the SCHED_DL_MAC_BUFFER_REQ primitive.
std::map< uint16_t, uint32_t > m_ueCqiTimers
Parameters of the SCHED_DL_PAGING_BUFFER_REQ primitive.
void DoSchedUlCqiInfoReq(const struct FfMacSchedSapProvider::SchedUlCqiInfoReqParameters &params)
virtual void CschedUeConfigUpdateInd(const struct CschedUeConfigUpdateIndParameters &params)=0
std::vector< struct VendorSpecificListElement_s > m_vendorSpecificList
std::map< uint16_t, UlHarqProcessesDciBuffer_t > m_ulHarqProcessesDciBuffer
void DoCschedLcReleaseReq(const struct FfMacCschedSapProvider::CschedLcReleaseReqParameters &params)
Parameters of the SCHED_UL_TRIGGER_REQ primitive.
Hold an unsigned integer type.
Definition: uinteger.h:46
void DoCschedCellConfigReq(const struct FfMacCschedSapProvider::CschedCellConfigReqParameters &params)
static uint8_t TxMode2LayerNum(uint8_t txMode)
Definition: lte-common.cc:170
Ptr< SampleEmitter > s
uint8_t HarqProcessAvailability(uint16_t rnti)
Return the availability of free process for the RNTI specified.
std::map< uint16_t, UlHarqProcessesStatus_t > m_ulHarqProcessesStatus
std::vector< uint8_t > m_ndi
Definition: ff-mac-common.h:96
FfMacCschedSapProvider * m_cschedSapProvider
std::map< uint16_t, uint8_t > m_dlHarqCurrentProcessId
std::map< uint16_t, DlHarqProcessesStatus_t > m_dlHarqProcessesStatus
Provides the SCHED SAP.
virtual void CschedUeReleaseReq(const struct CschedUeReleaseReqParameters &params)
std::map< uint16_t, uint32_t > m_p10CqiTimers
double EstimateUlSinr(uint16_t rnti, uint16_t rb)
virtual void SchedDlRlcBufferReq(const struct SchedDlRlcBufferReqParameters &params)
virtual FfMacCschedSapProvider * GetFfMacCschedSapProvider()
void UpdateUlRlcBufferInfo(uint16_t rnti, uint16_t size)
virtual void CschedUeConfigCnf(const struct CschedUeConfigCnfParameters &params)=0
#define NS_LOG_LOGIC(msg)
Definition: log.h:368
Parameters of the SCHED_UL_NOISE_INTERFERENCE_REQ primitive.
std::vector< struct CqiListElement_s > m_cqiList
std::vector< struct DlInfoListElement_s > m_dlInfoList
std::map< uint16_t, DlHarqRlcPduListBuffer_t > m_dlHarqProcessesRlcPduListBuffer
FfMacSchedSapProvider * m_schedSapProvider
friend class FdBetSchedulerMemberCschedSapProvider
virtual void SchedUlCqiInfoReq(const struct SchedUlCqiInfoReqParameters &params)
virtual void SchedDlConfigInd(const struct SchedDlConfigIndParameters &params)=0
std::vector< uint16_t > m_tbsSize
Definition: ff-mac-common.h:94
See section 4.3.9 rlcPDU_ListElement.
void DoSchedDlCqiInfoReq(const struct FfMacSchedSapProvider::SchedDlCqiInfoReqParameters &params)
FfMacCschedSapUser * m_cschedSapUser
std::vector< DlDciListElement_s > DlHarqProcessesDciBuffer_t
virtual void SchedUlNoiseInterferenceReq(const struct SchedUlNoiseInterferenceReqParameters &params)
Parameters of the CSCHED_LC_CONFIG_REQ primitive.
std::map< uint16_t, std::vector< double > > m_ueCqi
std::map< uint16_t, uint8_t > m_uesTxMode
std::vector< uint8_t > m_rv
Definition: ff-mac-common.h:97
virtual void SchedUlConfigInd(const struct SchedUlConfigIndParameters &params)=0
std::map< uint16_t, uint32_t > m_a30CqiTimers
static Time Now(void)
Return the "current simulation time".
Definition: simulator.cc:180
NS_LOG_COMPONENT_DEFINE("FdBetFfMacScheduler")
std::map< uint16_t, DlHarqProcessesTimer_t > m_dlHarqProcessesTimer
UlCqiFilter_t m_ulCqiFilter
std::vector< struct RachListElement_s > m_rachList
#define SRS_CQI_RNTI_VSP
This abstract base class identifies the interface by means of which the helper object can plug on the...
virtual void CschedCellConfigReq(const struct CschedCellConfigReqParameters &params)
CSCHED_CELL_CONFIG_REQ.
#define NS_ASSERT_MSG(condition, message)
Definition: assert.h:86
Parameters of the SCHED_DL_CQI_INFO_REQ primitive.
std::vector< struct MacCeListElement_s > m_macCeList
std::vector< struct RachListElement_s > m_rachList
virtual void CschedLcConfigReq(const struct CschedLcConfigReqParameters &params)
static double fpS11dot3toDouble(uint16_t val)
Definition: lte-common.cc:114
#define HARQ_PROC_NUM
std::vector< DlInfoListElement_s > m_dlInfoListBuffered
std::vector< uint8_t > UlHarqProcessesStatus_t
void DoSchedDlRlcBufferReq(const struct FfMacSchedSapProvider::SchedDlRlcBufferReqParameters &params)
void DoSchedDlRachInfoReq(const struct FfMacSchedSapProvider::SchedDlRachInfoReqParameters &params)
std::vector< uint8_t > DlHarqProcessesStatus_t
Parameters of the SCHED_UL_CQI_INFO_REQ primitive.
static uint32_t BsrId2BufferSize(uint8_t val)
Definition: lte-common.cc:142
std::map< uint16_t, uint8_t > m_ulHarqCurrentProcessId
Parameters of the SCHED_UL_MAC_CTRL_INFO_REQ primitive.
#define NS_LOG_DEBUG(msg)
Definition: log.h:289
void TransmissionModeConfigurationUpdate(uint16_t rnti, uint8_t txMode)
virtual void SchedDlCqiInfoReq(const struct SchedDlCqiInfoReqParameters &params)
void DoCschedLcConfigReq(const struct FfMacCschedSapProvider::CschedLcConfigReqParameters &params)
Parameters of the SCHED_UL_SR_INFO_REQ primitive.
std::map< uint16_t, fdbetsFlowPerf_t > m_flowStatsUl
std::map< uint16_t, std::vector< uint16_t > > m_allocationMaps
bool m_harqOn
m_harqOn when false inhibit te HARQ mechanisms (by default active)
#define NS_LOG_ERROR(msg)
Definition: log.h:271
Parameters of the SCHED_DL_RACH_INFO_REQ primitive.
void DoSchedDlPagingBufferReq(const struct FfMacSchedSapProvider::SchedDlPagingBufferReqParameters &params)
Parameters of the SCHED_UL_CONFIG_IND primitive.
Parameters of the CSCHED_UE_CONFIG_REQ primitive.
void DoCschedUeReleaseReq(const struct FfMacCschedSapProvider::CschedUeReleaseReqParameters &params)
virtual void SchedDlRachInfoReq(const struct SchedDlRachInfoReqParameters &params)
struct DlDciListElement_s m_dci
#define HARQ_DL_TIMEOUT
std::vector< struct BuildRarListElement_s > m_buildRarList
virtual void SchedUlMacCtrlInfoReq(const struct SchedUlMacCtrlInfoReqParameters &params)
a unique identifier for an interface.
Definition: type-id.h:49
TypeId SetParent(TypeId tid)
Definition: type-id.cc:611
std::map< LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters > m_rlcBufferReq
virtual void SchedUlSrInfoReq(const struct SchedUlSrInfoReqParameters &params)
void DoCschedUeConfigReq(const struct FfMacCschedSapProvider::CschedUeConfigReqParameters &params)
FfMacCschedSapProvider::CschedCellConfigReqParameters m_cschedCellConfig
std::map< uint16_t, SbMeasResult_s > m_a30CqiRxed
friend class FdBetSchedulerMemberSchedSapProvider
void DoSchedUlSrInfoReq(const struct FfMacSchedSapProvider::SchedUlSrInfoReqParameters &params)
std::vector< struct BuildDataListElement_s > m_buildDataList
std::map< uint16_t, uint32_t > m_ceBsrRxed
void DoSchedDlTriggerReq(const struct FfMacSchedSapProvider::SchedDlTriggerReqParameters &params)
See section 4.3.8 builDataListElement.