A Discrete-Event Network Simulator
API
tta-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/tta-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 namespace ns3 {
35 
36 NS_LOG_COMPONENT_DEFINE ("TtaFfMacScheduler");
37 
38 static const int TtaType0AllocationRbg[4] = {
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 (TtaFfMacScheduler);
47 
48 
49 
51 {
52 public:
54 
55  // inherited from FfMacCschedSapProvider
56  virtual void CschedCellConfigReq (const struct CschedCellConfigReqParameters& params);
57  virtual void CschedUeConfigReq (const struct CschedUeConfigReqParameters& params);
58  virtual void CschedLcConfigReq (const struct CschedLcConfigReqParameters& params);
59  virtual void CschedLcReleaseReq (const struct CschedLcReleaseReqParameters& params);
60  virtual void CschedUeReleaseReq (const struct CschedUeReleaseReqParameters& params);
61 
62 private:
65 };
66 
68 {
69 }
70 
72 {
73 }
74 
75 
76 void
78 {
80 }
81 
82 void
84 {
86 }
87 
88 
89 void
91 {
93 }
94 
95 void
97 {
99 }
100 
101 void
103 {
105 }
106 
107 
108 
109 
111 {
112 public:
114 
115  // inherited from FfMacSchedSapProvider
116  virtual void SchedDlRlcBufferReq (const struct SchedDlRlcBufferReqParameters& params);
117  virtual void SchedDlPagingBufferReq (const struct SchedDlPagingBufferReqParameters& params);
118  virtual void SchedDlMacBufferReq (const struct SchedDlMacBufferReqParameters& params);
119  virtual void SchedDlTriggerReq (const struct SchedDlTriggerReqParameters& params);
120  virtual void SchedDlRachInfoReq (const struct SchedDlRachInfoReqParameters& params);
121  virtual void SchedDlCqiInfoReq (const struct SchedDlCqiInfoReqParameters& params);
122  virtual void SchedUlTriggerReq (const struct SchedUlTriggerReqParameters& params);
123  virtual void SchedUlNoiseInterferenceReq (const struct SchedUlNoiseInterferenceReqParameters& params);
124  virtual void SchedUlSrInfoReq (const struct SchedUlSrInfoReqParameters& params);
125  virtual void SchedUlMacCtrlInfoReq (const struct SchedUlMacCtrlInfoReqParameters& params);
126  virtual void SchedUlCqiInfoReq (const struct SchedUlCqiInfoReqParameters& params);
127 
128 
129 private:
132 };
133 
134 
135 
137 {
138 }
139 
140 
142  : m_scheduler (scheduler)
143 {
144 }
145 
146 void
148 {
150 }
151 
152 void
154 {
156 }
157 
158 void
160 {
162 }
163 
164 void
166 {
168 }
169 
170 void
172 {
174 }
175 
176 void
178 {
180 }
181 
182 void
184 {
186 }
187 
188 void
190 {
192 }
193 
194 void
196 {
198 }
199 
200 void
202 {
204 }
205 
206 void
208 {
210 }
211 
212 
213 
214 
215 
217  : m_cschedSapUser (0),
218  m_schedSapUser (0),
219  m_nextRntiUl (0)
220 {
221  m_amc = CreateObject <LteAmc> ();
224 }
225 
227 {
228  NS_LOG_FUNCTION (this);
229 }
230 
231 void
233 {
234  NS_LOG_FUNCTION (this);
236  m_dlHarqProcessesTimer.clear ();
238  m_dlInfoListBuffered.clear ();
239  m_ulHarqCurrentProcessId.clear ();
240  m_ulHarqProcessesStatus.clear ();
242  delete m_cschedSapProvider;
243  delete m_schedSapProvider;
244 }
245 
246 TypeId
248 {
249  static TypeId tid = TypeId ("ns3::TtaFfMacScheduler")
251  .SetGroupName("Lte")
252  .AddConstructor<TtaFfMacScheduler> ()
253  .AddAttribute ("CqiTimerThreshold",
254  "The number of TTIs a CQI is valid (default 1000 - 1 sec.)",
255  UintegerValue (1000),
257  MakeUintegerChecker<uint32_t> ())
258  .AddAttribute ("HarqEnabled",
259  "Activate/Deactivate the HARQ [by default is active].",
260  BooleanValue (true),
263  .AddAttribute ("UlGrantMcs",
264  "The MCS of the UL grant, must be [0..15] (default 0)",
265  UintegerValue (0),
267  MakeUintegerChecker<uint8_t> ())
268  ;
269  return tid;
270 }
271 
272 
273 
274 void
276 {
277  m_cschedSapUser = s;
278 }
279 
280 void
282 {
283  m_schedSapUser = s;
284 }
285 
288 {
289  return m_cschedSapProvider;
290 }
291 
294 {
295  return m_schedSapProvider;
296 }
297 
298 void
300 {
301  m_ffrSapProvider = s;
302 }
303 
306 {
307  return m_ffrSapUser;
308 }
309 
310 void
312 {
313  NS_LOG_FUNCTION (this);
314  // Read the subset of parameters used
315  m_cschedCellConfig = params;
318  cnf.m_result = SUCCESS;
320  return;
321 }
322 
323 void
325 {
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 ())
329  {
330  m_uesTxMode.insert (std::pair <uint16_t, double> (params.m_rnti, params.m_transmissionMode));
331  // generate HARQ buffers
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));
354  }
355  else
356  {
357  (*it).second = params.m_transmissionMode;
358  }
359  return;
360 }
361 
362 void
364 {
365  NS_LOG_FUNCTION (this << " New LC, rnti: " << params.m_rnti);
366 
367  std::set <uint16_t>::iterator it;
368  for (uint16_t i = 0; i < params.m_logicalChannelConfigList.size (); i++)
369  {
370  it = m_flowStatsDl.find (params.m_rnti);
371 
372  if (it == m_flowStatsDl.end ())
373  {
374  m_flowStatsDl.insert (params.m_rnti);
375  m_flowStatsUl.insert (params.m_rnti);
376  }
377  }
378 
379  return;
380 }
381 
382 void
384 {
385  NS_LOG_FUNCTION (this);
386  for (uint16_t i = 0; i < params.m_logicalChannelIdentity.size (); i++)
387  {
388  std::map<LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator it = m_rlcBufferReq.begin ();
389  std::map<LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator temp;
390  while (it!=m_rlcBufferReq.end ())
391  {
392  if (((*it).first.m_rnti == params.m_rnti) && ((*it).first.m_lcId == params.m_logicalChannelIdentity.at (i)))
393  {
394  temp = it;
395  it++;
396  m_rlcBufferReq.erase (temp);
397  }
398  else
399  {
400  it++;
401  }
402  }
403  }
404  return;
405 }
406 
407 void
409 {
410  NS_LOG_FUNCTION (this);
411 
412  m_uesTxMode.erase (params.m_rnti);
413  m_dlHarqCurrentProcessId.erase (params.m_rnti);
414  m_dlHarqProcessesStatus.erase (params.m_rnti);
415  m_dlHarqProcessesTimer.erase (params.m_rnti);
416  m_dlHarqProcessesDciBuffer.erase (params.m_rnti);
418  m_ulHarqCurrentProcessId.erase (params.m_rnti);
419  m_ulHarqProcessesStatus.erase (params.m_rnti);
420  m_ulHarqProcessesDciBuffer.erase (params.m_rnti);
421  m_flowStatsDl.erase (params.m_rnti);
422  m_flowStatsUl.erase (params.m_rnti);
423  m_ceBsrRxed.erase (params.m_rnti);
424  std::map<LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator it = m_rlcBufferReq.begin ();
425  std::map<LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator temp;
426  while (it!=m_rlcBufferReq.end ())
427  {
428  if ((*it).first.m_rnti == params.m_rnti)
429  {
430  temp = it;
431  it++;
432  m_rlcBufferReq.erase (temp);
433  }
434  else
435  {
436  it++;
437  }
438  }
439  if (m_nextRntiUl == params.m_rnti)
440  {
441  m_nextRntiUl = 0;
442  }
443 
444  return;
445 }
446 
447 
448 void
450 {
451  NS_LOG_FUNCTION (this << params.m_rnti << (uint32_t) params.m_logicalChannelIdentity);
452  // API generated by RLC for updating RLC parameters on a LC (tx and retx queues)
453 
454  std::map <LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator it;
455 
456  LteFlowId_t flow (params.m_rnti, params.m_logicalChannelIdentity);
457 
458  it = m_rlcBufferReq.find (flow);
459 
460  if (it == m_rlcBufferReq.end ())
461  {
462  m_rlcBufferReq.insert (std::pair <LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters> (flow, params));
463  }
464  else
465  {
466  (*it).second = params;
467  }
468 
469  return;
470 }
471 
472 void
474 {
475  NS_LOG_FUNCTION (this);
476  NS_FATAL_ERROR ("method not implemented");
477  return;
478 }
479 
480 void
482 {
483  NS_LOG_FUNCTION (this);
484  NS_FATAL_ERROR ("method not implemented");
485  return;
486 }
487 
488 int
490 {
491  for (int i = 0; i < 4; i++)
492  {
493  if (dlbandwidth < TtaType0AllocationRbg[i])
494  {
495  return (i + 1);
496  }
497  }
498 
499  return (-1);
500 }
501 
502 
503 int
505 {
506  std::map <LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator it;
507  int lcActive = 0;
508  for (it = m_rlcBufferReq.begin (); it != m_rlcBufferReq.end (); it++)
509  {
510  if (((*it).first.m_rnti == rnti) && (((*it).second.m_rlcTransmissionQueueSize > 0)
511  || ((*it).second.m_rlcRetransmissionQueueSize > 0)
512  || ((*it).second.m_rlcStatusPduSize > 0) ))
513  {
514  lcActive++;
515  }
516  if ((*it).first.m_rnti > rnti)
517  {
518  break;
519  }
520  }
521  return (lcActive);
522 
523 }
524 
525 
526 uint8_t
528 {
529  NS_LOG_FUNCTION (this << rnti);
530 
531  std::map <uint16_t, uint8_t>::iterator it = m_dlHarqCurrentProcessId.find (rnti);
532  if (it == m_dlHarqCurrentProcessId.end ())
533  {
534  NS_FATAL_ERROR ("No Process Id found for this RNTI " << rnti);
535  }
536  std::map <uint16_t, DlHarqProcessesStatus_t>::iterator itStat = m_dlHarqProcessesStatus.find (rnti);
537  if (itStat == m_dlHarqProcessesStatus.end ())
538  {
539  NS_FATAL_ERROR ("No Process Id Statusfound for this RNTI " << rnti);
540  }
541  uint8_t i = (*it).second;
542  do
543  {
544  i = (i + 1) % HARQ_PROC_NUM;
545  }
546  while ( ((*itStat).second.at (i) != 0)&&(i != (*it).second));
547  if ((*itStat).second.at (i) == 0)
548  {
549  return (true);
550  }
551  else
552  {
553  return (false); // return a not valid harq proc id
554  }
555 }
556 
557 
558 
559 uint8_t
561 {
562  NS_LOG_FUNCTION (this << rnti);
563 
564  if (m_harqOn == false)
565  {
566  return (0);
567  }
568 
569 
570  std::map <uint16_t, uint8_t>::iterator it = m_dlHarqCurrentProcessId.find (rnti);
571  if (it == m_dlHarqCurrentProcessId.end ())
572  {
573  NS_FATAL_ERROR ("No Process Id found for this RNTI " << rnti);
574  }
575  std::map <uint16_t, DlHarqProcessesStatus_t>::iterator itStat = m_dlHarqProcessesStatus.find (rnti);
576  if (itStat == m_dlHarqProcessesStatus.end ())
577  {
578  NS_FATAL_ERROR ("No Process Id Statusfound for this RNTI " << rnti);
579  }
580  uint8_t i = (*it).second;
581  do
582  {
583  i = (i + 1) % HARQ_PROC_NUM;
584  }
585  while ( ((*itStat).second.at (i) != 0)&&(i != (*it).second));
586  if ((*itStat).second.at (i) == 0)
587  {
588  (*it).second = i;
589  (*itStat).second.at (i) = 1;
590  }
591  else
592  {
593  NS_FATAL_ERROR ("No HARQ process available for RNTI " << rnti << " check before update with HarqProcessAvailability");
594  }
595 
596  return ((*it).second);
597 }
598 
599 
600 void
602 {
603  NS_LOG_FUNCTION (this);
604 
605  std::map <uint16_t, DlHarqProcessesTimer_t>::iterator itTimers;
606  for (itTimers = m_dlHarqProcessesTimer.begin (); itTimers != m_dlHarqProcessesTimer.end (); itTimers ++)
607  {
608  for (uint16_t i = 0; i < HARQ_PROC_NUM; i++)
609  {
610  if ((*itTimers).second.at (i) == HARQ_DL_TIMEOUT)
611  {
612  // reset HARQ process
613 
614  NS_LOG_DEBUG (this << " Reset HARQ proc " << i << " for RNTI " << (*itTimers).first);
615  std::map <uint16_t, DlHarqProcessesStatus_t>::iterator itStat = m_dlHarqProcessesStatus.find ((*itTimers).first);
616  if (itStat == m_dlHarqProcessesStatus.end ())
617  {
618  NS_FATAL_ERROR ("No Process Id Status found for this RNTI " << (*itTimers).first);
619  }
620  (*itStat).second.at (i) = 0;
621  (*itTimers).second.at (i) = 0;
622  }
623  else
624  {
625  (*itTimers).second.at (i)++;
626  }
627  }
628  }
629 
630 }
631 
632 
633 void
635 {
636  NS_LOG_FUNCTION (this << " Frame no. " << (params.m_sfnSf >> 4) << " subframe no. " << (0xF & params.m_sfnSf));
637  // API generated by RLC for triggering the scheduling of a DL subframe
638 
639 
640  // evaluate the relative channel quality indicator for each UE per each RBG
641  // (since we are using allocation type 0 the small unit of allocation is RBG)
642  // Resource allocation type 0 (see sec 7.1.6.1 of 36.213)
643 
644  RefreshDlCqiMaps ();
645 
647  int rbgNum = m_cschedCellConfig.m_dlBandwidth / rbgSize;
648  std::map <uint16_t, std::vector <uint16_t> > allocationMap; // RBs map per RNTI
649  std::vector <bool> rbgMap; // global RBGs map
650  uint16_t rbgAllocatedNum = 0;
651  std::set <uint16_t> rntiAllocated;
652  rbgMap.resize (m_cschedCellConfig.m_dlBandwidth / rbgSize, false);
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 
702  if (m_harqOn == true)
703  {
704  // generate UL-DCI for HARQ retransmissions
705  UlDciListElement_s uldci;
706  uldci.m_rnti = newRar.m_rnti;
707  uldci.m_rbLen = rbLen;
708  uldci.m_rbStart = rbStart;
709  uldci.m_mcs = m_ulGrantMcs;
710  uldci.m_tbSize = tbSizeBits / 8;
711  uldci.m_ndi = 1;
712  uldci.m_cceIndex = 0;
713  uldci.m_aggrLevel = 1;
714  uldci.m_ueTxAntennaSelection = 3; // antenna selection OFF
715  uldci.m_hopping = false;
716  uldci.m_n2Dmrs = 0;
717  uldci.m_tpc = 0; // no power control
718  uldci.m_cqiRequest = false; // only period CQI at this stage
719  uldci.m_ulIndex = 0; // TDD parameter
720  uldci.m_dai = 1; // TDD parameter
721  uldci.m_freqHopping = 0;
722  uldci.m_pdcchPowerOffset = 0; // not used
723 
724  uint8_t harqId = 0;
725  std::map <uint16_t, uint8_t>::iterator itProcId;
726  itProcId = m_ulHarqCurrentProcessId.find (uldci.m_rnti);
727  if (itProcId == m_ulHarqCurrentProcessId.end ())
728  {
729  NS_FATAL_ERROR ("No info find in HARQ buffer for UE " << uldci.m_rnti);
730  }
731  harqId = (*itProcId).second;
732  std::map <uint16_t, UlHarqProcessesDciBuffer_t>::iterator itDci = m_ulHarqProcessesDciBuffer.find (uldci.m_rnti);
733  if (itDci == m_ulHarqProcessesDciBuffer.end ())
734  {
735  NS_FATAL_ERROR ("Unable to find RNTI entry in UL DCI HARQ buffer for RNTI " << uldci.m_rnti);
736  }
737  (*itDci).second.at (harqId) = uldci;
738  }
739 
740  rbStart = rbStart + rbLen;
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 = (rbgId + 1) % rbgNum;
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 (m_dlInfoListBuffered.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 
1013 
1014  for (int i = 0; i < rbgNum; i++)
1015  {
1016  NS_LOG_INFO (this << " ALLOCATION for RBG " << i << " of " << rbgNum);
1017  if (rbgMap.at (i) == false)
1018  {
1019  std::set <uint16_t>::iterator it;
1020  std::set <uint16_t>::iterator itMax = m_flowStatsDl.end ();
1021  double rcqiMax = 0.0;
1022  for (it = m_flowStatsDl.begin (); it != m_flowStatsDl.end (); it++)
1023  {
1024  std::set <uint16_t>::iterator itRnti = rntiAllocated.find ((*it));
1025  if ((itRnti != rntiAllocated.end ())||(!HarqProcessAvailability ((*it))))
1026  {
1027  // UE already allocated for HARQ or without HARQ process available -> drop it
1028  if (itRnti != rntiAllocated.end ())
1029  {
1030  NS_LOG_DEBUG (this << " RNTI discared for HARQ tx" << (uint16_t)(*it));
1031  }
1032  if (!HarqProcessAvailability ((*it)))
1033  {
1034  NS_LOG_DEBUG (this << " RNTI discared for HARQ id" << (uint16_t)(*it));
1035  }
1036  continue;
1037  }
1038 
1039  std::map <uint16_t,SbMeasResult_s>::iterator itSbCqi;
1040  itSbCqi = m_a30CqiRxed.find ((*it));
1041  std::map <uint16_t,uint8_t>::iterator itWbCqi;
1042  itWbCqi = m_p10CqiRxed.find ((*it));
1043 
1044  std::map <uint16_t,uint8_t>::iterator itTxMode;
1045  itTxMode = m_uesTxMode.find ((*it));
1046  if (itTxMode == m_uesTxMode.end ())
1047  {
1048  NS_FATAL_ERROR ("No Transmission Mode info on user " << (*it));
1049  }
1050  int nLayer = TransmissionModesLayers::TxMode2LayerNum ((*itTxMode).second);
1051 
1052  std::vector <uint8_t> sbCqi;
1053  if (itSbCqi == m_a30CqiRxed.end ())
1054  {
1055  for (uint8_t k = 0; k < nLayer; k++)
1056  {
1057  sbCqi.push_back (1); // start with lowest value
1058  }
1059  }
1060  else
1061  {
1062  sbCqi = (*itSbCqi).second.m_higherLayerSelected.at (i).m_sbCqi;
1063  }
1064 
1065  uint8_t wbCqi = 0;
1066  if (itWbCqi != m_p10CqiRxed.end ())
1067  {
1068  wbCqi = (*itWbCqi).second;
1069  }
1070  else
1071  {
1072  wbCqi = 1; // lowest value fro trying a transmission
1073  }
1074 
1075  uint8_t cqi1 = sbCqi.at (0);
1076  uint8_t cqi2 = 1;
1077  if (sbCqi.size () > 1)
1078  {
1079  cqi2 = sbCqi.at (1);
1080  }
1081  if ((cqi1 > 0)||(cqi2 > 0)) // CQI == 0 means "out of range" (see table 7.2.3-1 of 36.213)
1082  {
1083  if (LcActivePerFlow ((*it)) > 0)
1084  {
1085  // this UE has data to transmit
1086  double achievableSbRate = 0.0;
1087  double achievableWbRate = 0.0;
1088  uint8_t sbMcs = 0;
1089  uint8_t wbMcs = 0;
1090  for (uint8_t k = 0; k < nLayer; k++)
1091  {
1092  if (sbCqi.size () > k)
1093  {
1094  sbMcs = m_amc->GetMcsFromCqi (sbCqi.at (k));
1095  }
1096  else
1097  {
1098  // no info on this subband -> worst MCS
1099  sbMcs = 0;
1100  }
1101  achievableSbRate += ((m_amc->GetTbSizeFromMcs (sbMcs, rbgSize) / 8) / 0.001); // = TB size / TTI
1102  wbMcs = m_amc->GetMcsFromCqi (wbCqi);
1103  achievableWbRate += ((m_amc->GetTbSizeFromMcs (wbMcs, rbgSize) / 8) / 0.001); // = TB size / TTI
1104  }
1105 
1106  double metric = achievableSbRate / achievableWbRate;
1107 
1108  if (metric > rcqiMax)
1109  {
1110  rcqiMax = metric;
1111  itMax = it;
1112  }
1113  }
1114  } // end if cqi
1115 
1116  } // end for m_rlcBufferReq
1117 
1118  if (itMax == m_flowStatsDl.end ())
1119  {
1120  // no UE available for this RB
1121  NS_LOG_INFO (this << " any UE found");
1122  }
1123  else
1124  {
1125  rbgMap.at (i) = true;
1126  std::map <uint16_t, std::vector <uint16_t> >::iterator itMap;
1127  itMap = allocationMap.find ((*itMax));
1128  if (itMap == allocationMap.end ())
1129  {
1130  // insert new element
1131  std::vector <uint16_t> tempMap;
1132  tempMap.push_back (i);
1133  allocationMap.insert (std::pair <uint16_t, std::vector <uint16_t> > ((*itMax), tempMap));
1134  }
1135  else
1136  {
1137  (*itMap).second.push_back (i);
1138  }
1139  NS_LOG_INFO (this << " UE assigned " << (*itMax));
1140  }
1141  } // end for RBG free
1142  } // end for RBGs
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,SbMeasResult_s>::iterator itCqi;
1166  itCqi = m_a30CqiRxed.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  std::vector <uint8_t> worstCqi (2, 15);
1175  if (itCqi != m_a30CqiRxed.end ())
1176  {
1177  for (uint16_t k = 0; k < (*itMap).second.size (); k++)
1178  {
1179  if ((*itCqi).second.m_higherLayerSelected.size () > (*itMap).second.at (k))
1180  {
1181  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)) );
1182  for (uint8_t j = 0; j < nLayer; j++)
1183  {
1184  if ((*itCqi).second.m_higherLayerSelected.at ((*itMap).second.at (k)).m_sbCqi.size () > j)
1185  {
1186  if (((*itCqi).second.m_higherLayerSelected.at ((*itMap).second.at (k)).m_sbCqi.at (j)) < worstCqi.at (j))
1187  {
1188  worstCqi.at (j) = ((*itCqi).second.m_higherLayerSelected.at ((*itMap).second.at (k)).m_sbCqi.at (j));
1189  }
1190  }
1191  else
1192  {
1193  // no CQI for this layer of this suband -> worst one
1194  worstCqi.at (j) = 1;
1195  }
1196  }
1197  }
1198  else
1199  {
1200  for (uint8_t j = 0; j < nLayer; j++)
1201  {
1202  worstCqi.at (j) = 1; // try with lowest MCS in RBG with no info on channel
1203  }
1204  }
1205  }
1206  }
1207  else
1208  {
1209  for (uint8_t j = 0; j < nLayer; j++)
1210  {
1211  worstCqi.at (j) = 1; // try with lowest MCS in RBG with no info on channel
1212  }
1213  }
1214  for (uint8_t j = 0; j < nLayer; j++)
1215  {
1216  NS_LOG_INFO (this << " Layer " << (uint16_t)j << " CQI selected " << (uint16_t)worstCqi.at (j));
1217  }
1218  uint32_t bytesTxed = 0;
1219  for (uint8_t j = 0; j < nLayer; j++)
1220  {
1221  newDci.m_mcs.push_back (m_amc->GetMcsFromCqi (worstCqi.at (j)));
1222  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)
1223  newDci.m_tbsSize.push_back (tbSize);
1224  NS_LOG_INFO (this << " Layer " << (uint16_t)j << " MCS selected" << m_amc->GetMcsFromCqi (worstCqi.at (j)));
1225 
1226  bytesTxed += tbSize;
1227  }
1228 
1229  newDci.m_resAlloc = 0; // only allocation type 0 at this stage
1230  newDci.m_rbBitmap = 0; // TBD (32 bit bitmap see 7.1.6 of 36.213)
1231  uint32_t rbgMask = 0;
1232  for (uint16_t k = 0; k < (*itMap).second.size (); k++)
1233  {
1234  rbgMask = rbgMask + (0x1 << (*itMap).second.at (k));
1235  NS_LOG_INFO (this << " Allocated RBG " << (*itMap).second.at (k));
1236  }
1237  newDci.m_rbBitmap = rbgMask; // (32 bit bitmap see 7.1.6 of 36.213)
1238 
1239  // create the rlc PDUs -> equally divide resources among actives LCs
1240  std::map <LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator itBufReq;
1241  for (itBufReq = m_rlcBufferReq.begin (); itBufReq != m_rlcBufferReq.end (); itBufReq++)
1242  {
1243  if (((*itBufReq).first.m_rnti == (*itMap).first)
1244  && (((*itBufReq).second.m_rlcTransmissionQueueSize > 0)
1245  || ((*itBufReq).second.m_rlcRetransmissionQueueSize > 0)
1246  || ((*itBufReq).second.m_rlcStatusPduSize > 0) ))
1247  {
1248  std::vector <struct RlcPduListElement_s> newRlcPduLe;
1249  for (uint8_t j = 0; j < nLayer; j++)
1250  {
1251  RlcPduListElement_s newRlcEl;
1252  newRlcEl.m_logicalChannelIdentity = (*itBufReq).first.m_lcId;
1253  newRlcEl.m_size = newDci.m_tbsSize.at (j) / lcActives;
1254  NS_LOG_INFO (this << " LCID " << (uint32_t) newRlcEl.m_logicalChannelIdentity << " size " << newRlcEl.m_size << " layer " << (uint16_t)j);
1255  newRlcPduLe.push_back (newRlcEl);
1256  UpdateDlRlcBufferInfo (newDci.m_rnti, newRlcEl.m_logicalChannelIdentity, newRlcEl.m_size);
1257  if (m_harqOn == true)
1258  {
1259  // store RLC PDU list for HARQ
1260  std::map <uint16_t, DlHarqRlcPduListBuffer_t>::iterator itRlcPdu = m_dlHarqProcessesRlcPduListBuffer.find ((*itMap).first);
1261  if (itRlcPdu == m_dlHarqProcessesRlcPduListBuffer.end ())
1262  {
1263  NS_FATAL_ERROR ("Unable to find RlcPdcList in HARQ buffer for RNTI " << (*itMap).first);
1264  }
1265  (*itRlcPdu).second.at (j).at (newDci.m_harqProcess).push_back (newRlcEl);
1266  }
1267  }
1268  newEl.m_rlcPduList.push_back (newRlcPduLe);
1269  }
1270  if ((*itBufReq).first.m_rnti > (*itMap).first)
1271  {
1272  break;
1273  }
1274  }
1275  for (uint8_t j = 0; j < nLayer; j++)
1276  {
1277  newDci.m_ndi.push_back (1);
1278  newDci.m_rv.push_back (0);
1279  }
1280 
1281  newDci.m_tpc = 1; //1 is mapped to 0 in Accumulated Mode and to -1 in Absolute Mode
1282 
1283  newEl.m_dci = newDci;
1284 
1285  if (m_harqOn == true)
1286  {
1287  // store DCI for HARQ
1288  std::map <uint16_t, DlHarqProcessesDciBuffer_t>::iterator itDci = m_dlHarqProcessesDciBuffer.find (newEl.m_rnti);
1289  if (itDci == m_dlHarqProcessesDciBuffer.end ())
1290  {
1291  NS_FATAL_ERROR ("Unable to find RNTI entry in DCI HARQ buffer for RNTI " << newEl.m_rnti);
1292  }
1293  (*itDci).second.at (newDci.m_harqProcess) = newDci;
1294  // refresh timer
1295  std::map <uint16_t, DlHarqProcessesTimer_t>::iterator itHarqTimer = m_dlHarqProcessesTimer.find (newEl.m_rnti);
1296  if (itHarqTimer== m_dlHarqProcessesTimer.end ())
1297  {
1298  NS_FATAL_ERROR ("Unable to find HARQ timer for RNTI " << (uint16_t)newEl.m_rnti);
1299  }
1300  (*itHarqTimer).second.at (newDci.m_harqProcess) = 0;
1301  }
1302 
1303  // ...more parameters -> ingored in this version
1304 
1305  ret.m_buildDataList.push_back (newEl);
1306 
1307  itMap++;
1308  } // end while allocation
1309  ret.m_nrOfPdcchOfdmSymbols = 1;
1310 
1312 
1313 
1314  return;
1315 }
1316 
1317 void
1319 {
1320  NS_LOG_FUNCTION (this);
1321 
1322  m_rachList = params.m_rachList;
1323 
1324  return;
1325 }
1326 
1327 void
1329 {
1330  NS_LOG_FUNCTION (this);
1331 
1332  for (unsigned int i = 0; i < params.m_cqiList.size (); i++)
1333  {
1334  if ( params.m_cqiList.at (i).m_cqiType == CqiListElement_s::P10 )
1335  {
1336  NS_LOG_LOGIC ("wideband CQI " << (uint32_t) params.m_cqiList.at (i).m_wbCqi.at (0) << " reported");
1337  std::map <uint16_t,uint8_t>::iterator it;
1338  uint16_t rnti = params.m_cqiList.at (i).m_rnti;
1339  it = m_p10CqiRxed.find (rnti);
1340  if (it == m_p10CqiRxed.end ())
1341  {
1342  // create the new entry
1343  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)
1344  // generate correspondent timer
1345  m_p10CqiTimers.insert ( std::pair<uint16_t, uint32_t > (rnti, m_cqiTimersThreshold));
1346  }
1347  else
1348  {
1349  // update the CQI value and refresh correspondent timer
1350  (*it).second = params.m_cqiList.at (i).m_wbCqi.at (0);
1351  // update correspondent timer
1352  std::map <uint16_t,uint32_t>::iterator itTimers;
1353  itTimers = m_p10CqiTimers.find (rnti);
1354  (*itTimers).second = m_cqiTimersThreshold;
1355  }
1356  }
1357  else if ( params.m_cqiList.at (i).m_cqiType == CqiListElement_s::A30 )
1358  {
1359  // subband CQI reporting high layer configured
1360  std::map <uint16_t,SbMeasResult_s>::iterator it;
1361  uint16_t rnti = params.m_cqiList.at (i).m_rnti;
1362  it = m_a30CqiRxed.find (rnti);
1363  if (it == m_a30CqiRxed.end ())
1364  {
1365  // create the new entry
1366  m_a30CqiRxed.insert ( std::pair<uint16_t, SbMeasResult_s > (rnti, params.m_cqiList.at (i).m_sbMeasResult) );
1367  m_a30CqiTimers.insert ( std::pair<uint16_t, uint32_t > (rnti, m_cqiTimersThreshold));
1368  }
1369  else
1370  {
1371  // update the CQI value and refresh correspondent timer
1372  (*it).second = params.m_cqiList.at (i).m_sbMeasResult;
1373  std::map <uint16_t,uint32_t>::iterator itTimers;
1374  itTimers = m_a30CqiTimers.find (rnti);
1375  (*itTimers).second = m_cqiTimersThreshold;
1376  }
1377  }
1378  else
1379  {
1380  NS_LOG_ERROR (this << " CQI type unknown");
1381  }
1382  }
1383 
1384  return;
1385 }
1386 
1387 
1388 double
1389 TtaFfMacScheduler::EstimateUlSinr (uint16_t rnti, uint16_t rb)
1390 {
1391  std::map <uint16_t, std::vector <double> >::iterator itCqi = m_ueCqi.find (rnti);
1392  if (itCqi == m_ueCqi.end ())
1393  {
1394  // no cqi info about this UE
1395  return (NO_SINR);
1396 
1397  }
1398  else
1399  {
1400  // take the average SINR value among the available
1401  double sinrSum = 0;
1402  unsigned int sinrNum = 0;
1403  for (uint32_t i = 0; i < m_cschedCellConfig.m_ulBandwidth; i++)
1404  {
1405  double sinr = (*itCqi).second.at (i);
1406  if (sinr != NO_SINR)
1407  {
1408  sinrSum += sinr;
1409  sinrNum++;
1410  }
1411  }
1412  double estimatedSinr = (sinrNum > 0) ? (sinrSum / sinrNum) : DBL_MAX;
1413  // store the value
1414  (*itCqi).second.at (rb) = estimatedSinr;
1415  return (estimatedSinr);
1416  }
1417 }
1418 
1419 void
1421 {
1422  NS_LOG_FUNCTION (this << " UL - Frame no. " << (params.m_sfnSf >> 4) << " subframe no. " << (0xF & params.m_sfnSf) << " size " << params.m_ulInfoList.size ());
1423 
1424  RefreshUlCqiMaps ();
1425 
1426  // Generate RBs map
1428  std::vector <bool> rbMap;
1429  uint16_t rbAllocatedNum = 0;
1430  std::set <uint16_t> rntiAllocated;
1431  std::vector <uint16_t> rbgAllocationMap;
1432  // update with RACH allocation map
1433  rbgAllocationMap = m_rachAllocationMap;
1434  //rbgAllocationMap.resize (m_cschedCellConfig.m_ulBandwidth, 0);
1435  m_rachAllocationMap.clear ();
1437 
1438  rbMap.resize (m_cschedCellConfig.m_ulBandwidth, false);
1439  // remove RACH allocation
1440  for (uint16_t i = 0; i < m_cschedCellConfig.m_ulBandwidth; i++)
1441  {
1442  if (rbgAllocationMap.at (i) != 0)
1443  {
1444  rbMap.at (i) = true;
1445  NS_LOG_DEBUG (this << " Allocated for RACH " << i);
1446  }
1447  }
1448 
1449 
1450  if (m_harqOn == true)
1451  {
1452  // Process UL HARQ feedback
1453  for (uint16_t i = 0; i < params.m_ulInfoList.size (); i++)
1454  {
1455  if (params.m_ulInfoList.at (i).m_receptionStatus == UlInfoListElement_s::NotOk)
1456  {
1457  // retx correspondent block: retrieve the UL-DCI
1458  uint16_t rnti = params.m_ulInfoList.at (i).m_rnti;
1459  std::map <uint16_t, uint8_t>::iterator itProcId = m_ulHarqCurrentProcessId.find (rnti);
1460  if (itProcId == m_ulHarqCurrentProcessId.end ())
1461  {
1462  NS_LOG_ERROR ("No info find in HARQ buffer for UE (might change eNB) " << rnti);
1463  }
1464  uint8_t harqId = (uint8_t)((*itProcId).second - HARQ_PERIOD) % HARQ_PROC_NUM;
1465  NS_LOG_INFO (this << " UL-HARQ retx RNTI " << rnti << " harqId " << (uint16_t)harqId << " i " << i << " size " << params.m_ulInfoList.size ());
1466  std::map <uint16_t, UlHarqProcessesDciBuffer_t>::iterator itHarq = m_ulHarqProcessesDciBuffer.find (rnti);
1467  if (itHarq == m_ulHarqProcessesDciBuffer.end ())
1468  {
1469  NS_LOG_ERROR ("No info find in HARQ buffer for UE (might change eNB) " << rnti);
1470  continue;
1471  }
1472  UlDciListElement_s dci = (*itHarq).second.at (harqId);
1473  std::map <uint16_t, UlHarqProcessesStatus_t>::iterator itStat = m_ulHarqProcessesStatus.find (rnti);
1474  if (itStat == m_ulHarqProcessesStatus.end ())
1475  {
1476  NS_LOG_ERROR ("No info find in HARQ buffer for UE (might change eNB) " << rnti);
1477  }
1478  if ((*itStat).second.at (harqId) >= 3)
1479  {
1480  NS_LOG_INFO ("Max number of retransmissions reached (UL)-> drop process");
1481  continue;
1482  }
1483  bool free = true;
1484  for (int j = dci.m_rbStart; j < dci.m_rbStart + dci.m_rbLen; j++)
1485  {
1486  if (rbMap.at (j) == true)
1487  {
1488  free = false;
1489  NS_LOG_INFO (this << " BUSY " << j);
1490  }
1491  }
1492  if (free)
1493  {
1494  // retx on the same RBs
1495  for (int j = dci.m_rbStart; j < dci.m_rbStart + dci.m_rbLen; j++)
1496  {
1497  rbMap.at (j) = true;
1498  rbgAllocationMap.at (j) = dci.m_rnti;
1499  NS_LOG_INFO ("\tRB " << j);
1500  rbAllocatedNum++;
1501  }
1502  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);
1503  }
1504  else
1505  {
1506  NS_LOG_INFO ("Cannot allocate retx due to RACH allocations for UE " << rnti);
1507  continue;
1508  }
1509  dci.m_ndi = 0;
1510  // Update HARQ buffers with new HarqId
1511  (*itStat).second.at ((*itProcId).second) = (*itStat).second.at (harqId) + 1;
1512  (*itStat).second.at (harqId) = 0;
1513  (*itHarq).second.at ((*itProcId).second) = dci;
1514  ret.m_dciList.push_back (dci);
1515  rntiAllocated.insert (dci.m_rnti);
1516  }
1517  else
1518  {
1519  NS_LOG_INFO (this << " HARQ-ACK feedback from RNTI " << params.m_ulInfoList.at (i).m_rnti);
1520  }
1521  }
1522  }
1523 
1524  std::map <uint16_t,uint32_t>::iterator it;
1525  int nflows = 0;
1526 
1527  for (it = m_ceBsrRxed.begin (); it != m_ceBsrRxed.end (); it++)
1528  {
1529  std::set <uint16_t>::iterator itRnti = rntiAllocated.find ((*it).first);
1530  // select UEs with queues not empty and not yet allocated for HARQ
1531  if (((*it).second > 0)&&(itRnti == rntiAllocated.end ()))
1532  {
1533  nflows++;
1534  }
1535  }
1536 
1537  if (nflows == 0)
1538  {
1539  if (ret.m_dciList.size () > 0)
1540  {
1541  m_allocationMaps.insert (std::pair <uint16_t, std::vector <uint16_t> > (params.m_sfnSf, rbgAllocationMap));
1543  }
1544 
1545  return; // no flows to be scheduled
1546  }
1547 
1548 
1549  // Divide the remaining resources equally among the active users starting from the subsequent one served last scheduling trigger
1550  uint16_t rbPerFlow = (m_cschedCellConfig.m_ulBandwidth) / (nflows + rntiAllocated.size ());
1551  if (rbPerFlow < 3)
1552  {
1553  rbPerFlow = 3; // at least 3 rbg per flow (till available resource) to ensure TxOpportunity >= 7 bytes
1554  }
1555  int rbAllocated = 0;
1556 
1557  if (m_nextRntiUl != 0)
1558  {
1559  for (it = m_ceBsrRxed.begin (); it != m_ceBsrRxed.end (); it++)
1560  {
1561  if ((*it).first == m_nextRntiUl)
1562  {
1563  break;
1564  }
1565  }
1566  if (it == m_ceBsrRxed.end ())
1567  {
1568  NS_LOG_ERROR (this << " no user found");
1569  }
1570  }
1571  else
1572  {
1573  it = m_ceBsrRxed.begin ();
1574  m_nextRntiUl = (*it).first;
1575  }
1576  do
1577  {
1578  std::set <uint16_t>::iterator itRnti = rntiAllocated.find ((*it).first);
1579  if ((itRnti != rntiAllocated.end ())||((*it).second == 0))
1580  {
1581  // UE already allocated for UL-HARQ -> skip it
1582  NS_LOG_DEBUG (this << " UE already allocated in HARQ -> discared, RNTI " << (*it).first);
1583  it++;
1584  if (it == m_ceBsrRxed.end ())
1585  {
1586  // restart from the first
1587  it = m_ceBsrRxed.begin ();
1588  }
1589  continue;
1590  }
1591  if (rbAllocated + rbPerFlow - 1 > m_cschedCellConfig.m_ulBandwidth)
1592  {
1593  // limit to physical resources last resource assignment
1594  rbPerFlow = m_cschedCellConfig.m_ulBandwidth - rbAllocated;
1595  // at least 3 rbg per flow to ensure TxOpportunity >= 7 bytes
1596  if (rbPerFlow < 3)
1597  {
1598  // terminate allocation
1599  rbPerFlow = 0;
1600  }
1601  }
1602 
1603  UlDciListElement_s uldci;
1604  uldci.m_rnti = (*it).first;
1605  uldci.m_rbLen = rbPerFlow;
1606  bool allocated = false;
1607  NS_LOG_INFO (this << " RB Allocated " << rbAllocated << " rbPerFlow " << rbPerFlow << " flows " << nflows);
1608  while ((!allocated)&&((rbAllocated + rbPerFlow - m_cschedCellConfig.m_ulBandwidth) < 1) && (rbPerFlow != 0))
1609  {
1610  // check availability
1611  bool free = true;
1612  for (uint16_t j = rbAllocated; j < rbAllocated + rbPerFlow; j++)
1613  {
1614  if (rbMap.at (j) == true)
1615  {
1616  free = false;
1617  break;
1618  }
1619  }
1620  if (free)
1621  {
1622  uldci.m_rbStart = rbAllocated;
1623 
1624  for (uint16_t j = rbAllocated; j < rbAllocated + rbPerFlow; j++)
1625  {
1626  rbMap.at (j) = true;
1627  // store info on allocation for managing ul-cqi interpretation
1628  rbgAllocationMap.at (j) = (*it).first;
1629  }
1630  rbAllocated += rbPerFlow;
1631  allocated = true;
1632  break;
1633  }
1634  rbAllocated++;
1635  if (rbAllocated + rbPerFlow - 1 > m_cschedCellConfig.m_ulBandwidth)
1636  {
1637  // limit to physical resources last resource assignment
1638  rbPerFlow = m_cschedCellConfig.m_ulBandwidth - rbAllocated;
1639  // at least 3 rbg per flow to ensure TxOpportunity >= 7 bytes
1640  if (rbPerFlow < 3)
1641  {
1642  // terminate allocation
1643  rbPerFlow = 0;
1644  }
1645  }
1646  }
1647  if (!allocated)
1648  {
1649  // unable to allocate new resource: finish scheduling
1650  m_nextRntiUl = (*it).first;
1651  if (ret.m_dciList.size () > 0)
1652  {
1654  }
1655  m_allocationMaps.insert (std::pair <uint16_t, std::vector <uint16_t> > (params.m_sfnSf, rbgAllocationMap));
1656  return;
1657  }
1658 
1659 
1660 
1661  std::map <uint16_t, std::vector <double> >::iterator itCqi = m_ueCqi.find ((*it).first);
1662  int cqi = 0;
1663  if (itCqi == m_ueCqi.end ())
1664  {
1665  // no cqi info about this UE
1666  uldci.m_mcs = 0; // MCS 0 -> UL-AMC TBD
1667  }
1668  else
1669  {
1670  // take the lowest CQI value (worst RB)
1671  double minSinr = (*itCqi).second.at (uldci.m_rbStart);
1672  if (minSinr == NO_SINR)
1673  {
1674  minSinr = EstimateUlSinr ((*it).first, uldci.m_rbStart);
1675  }
1676  for (uint16_t i = uldci.m_rbStart; i < uldci.m_rbStart + uldci.m_rbLen; i++)
1677  {
1678  double sinr = (*itCqi).second.at (i);
1679  if (sinr == NO_SINR)
1680  {
1681  sinr = EstimateUlSinr ((*it).first, i);
1682  }
1683  if ((*itCqi).second.at (i) < minSinr)
1684  {
1685  minSinr = (*itCqi).second.at (i);
1686  }
1687  }
1688 
1689  // translate SINR -> cqi: WILD ACK: same as DL
1690  double s = log2 ( 1 + (
1691  std::pow (10, minSinr / 10 ) /
1692  ( (-std::log (5.0 * 0.00005 )) / 1.5) ));
1693  cqi = m_amc->GetCqiFromSpectralEfficiency (s);
1694  if (cqi == 0)
1695  {
1696  it++;
1697  if (it == m_ceBsrRxed.end ())
1698  {
1699  // restart from the first
1700  it = m_ceBsrRxed.begin ();
1701  }
1702  NS_LOG_DEBUG (this << " UE discared for CQI=0, RNTI " << uldci.m_rnti);
1703  // remove UE from allocation map
1704  for (uint16_t i = uldci.m_rbStart; i < uldci.m_rbStart + uldci.m_rbLen; i++)
1705  {
1706  rbgAllocationMap.at (i) = 0;
1707  }
1708  continue; // CQI == 0 means "out of range" (see table 7.2.3-1 of 36.213)
1709  }
1710  uldci.m_mcs = m_amc->GetMcsFromCqi (cqi);
1711  }
1712 
1713  uldci.m_tbSize = (m_amc->GetTbSizeFromMcs (uldci.m_mcs, rbPerFlow) / 8);
1714  UpdateUlRlcBufferInfo (uldci.m_rnti, uldci.m_tbSize);
1715  uldci.m_ndi = 1;
1716  uldci.m_cceIndex = 0;
1717  uldci.m_aggrLevel = 1;
1718  uldci.m_ueTxAntennaSelection = 3; // antenna selection OFF
1719  uldci.m_hopping = false;
1720  uldci.m_n2Dmrs = 0;
1721  uldci.m_tpc = 0; // no power control
1722  uldci.m_cqiRequest = false; // only period CQI at this stage
1723  uldci.m_ulIndex = 0; // TDD parameter
1724  uldci.m_dai = 1; // TDD parameter
1725  uldci.m_freqHopping = 0;
1726  uldci.m_pdcchPowerOffset = 0; // not used
1727  ret.m_dciList.push_back (uldci);
1728  // store DCI for HARQ_PERIOD
1729  uint8_t harqId = 0;
1730  if (m_harqOn == true)
1731  {
1732  std::map <uint16_t, uint8_t>::iterator itProcId;
1733  itProcId = m_ulHarqCurrentProcessId.find (uldci.m_rnti);
1734  if (itProcId == m_ulHarqCurrentProcessId.end ())
1735  {
1736  NS_FATAL_ERROR ("No info find in HARQ buffer for UE " << uldci.m_rnti);
1737  }
1738  harqId = (*itProcId).second;
1739  std::map <uint16_t, UlHarqProcessesDciBuffer_t>::iterator itDci = m_ulHarqProcessesDciBuffer.find (uldci.m_rnti);
1740  if (itDci == m_ulHarqProcessesDciBuffer.end ())
1741  {
1742  NS_FATAL_ERROR ("Unable to find RNTI entry in UL DCI HARQ buffer for RNTI " << uldci.m_rnti);
1743  }
1744  (*itDci).second.at (harqId) = uldci;
1745  // Update HARQ process status (RV 0)
1746  std::map <uint16_t, UlHarqProcessesStatus_t>::iterator itStat = m_ulHarqProcessesStatus.find (uldci.m_rnti);
1747  if (itStat == m_ulHarqProcessesStatus.end ())
1748  {
1749  NS_LOG_ERROR ("No info find in HARQ buffer for UE (might change eNB) " << uldci.m_rnti);
1750  }
1751  (*itStat).second.at (harqId) = 0;
1752  }
1753 
1754  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);
1755 
1756 
1757  it++;
1758  if (it == m_ceBsrRxed.end ())
1759  {
1760  // restart from the first
1761  it = m_ceBsrRxed.begin ();
1762  }
1763  if ((rbAllocated == m_cschedCellConfig.m_ulBandwidth) || (rbPerFlow == 0))
1764  {
1765  // Stop allocation: no more PRBs
1766  m_nextRntiUl = (*it).first;
1767  break;
1768  }
1769  }
1770  while (((*it).first != m_nextRntiUl)&&(rbPerFlow!=0));
1771 
1772 
1773  m_allocationMaps.insert (std::pair <uint16_t, std::vector <uint16_t> > (params.m_sfnSf, rbgAllocationMap));
1775 
1776  return;
1777 }
1778 
1779 void
1781 {
1782  NS_LOG_FUNCTION (this);
1783  return;
1784 }
1785 
1786 void
1788 {
1789  NS_LOG_FUNCTION (this);
1790  return;
1791 }
1792 
1793 void
1795 {
1796  NS_LOG_FUNCTION (this);
1797 
1798  std::map <uint16_t,uint32_t>::iterator it;
1799 
1800  for (unsigned int i = 0; i < params.m_macCeList.size (); i++)
1801  {
1802  if ( params.m_macCeList.at (i).m_macCeType == MacCeListElement_s::BSR )
1803  {
1804  // buffer status report
1805  // note that this scheduler does not differentiate the
1806  // allocation according to which LCGs have more/less bytes
1807  // to send.
1808  // Hence the BSR of different LCGs are just summed up to get
1809  // a total queue size that is used for allocation purposes.
1810 
1811  uint32_t buffer = 0;
1812  for (uint8_t lcg = 0; lcg < 4; ++lcg)
1813  {
1814  uint8_t bsrId = params.m_macCeList.at (i).m_macCeValue.m_bufferStatus.at (lcg);
1815  buffer += BufferSizeLevelBsr::BsrId2BufferSize (bsrId);
1816  }
1817 
1818  uint16_t rnti = params.m_macCeList.at (i).m_rnti;
1819  NS_LOG_LOGIC (this << "RNTI=" << rnti << " buffer=" << buffer);
1820  it = m_ceBsrRxed.find (rnti);
1821  if (it == m_ceBsrRxed.end ())
1822  {
1823  // create the new entry
1824  m_ceBsrRxed.insert ( std::pair<uint16_t, uint32_t > (rnti, buffer));
1825  }
1826  else
1827  {
1828  // update the buffer size value
1829  (*it).second = buffer;
1830  }
1831  }
1832  }
1833 
1834  return;
1835 }
1836 
1837 void
1839 {
1840  NS_LOG_FUNCTION (this);
1841 // retrieve the allocation for this subframe
1842  switch (m_ulCqiFilter)
1843  {
1845  {
1846  // filter all the CQIs that are not SRS based
1847  if (params.m_ulCqi.m_type != UlCqi_s::SRS)
1848  {
1849  return;
1850  }
1851  }
1852  break;
1854  {
1855  // filter all the CQIs that are not SRS based
1856  if (params.m_ulCqi.m_type != UlCqi_s::PUSCH)
1857  {
1858  return;
1859  }
1860  }
1862  break;
1863 
1864  default:
1865  NS_FATAL_ERROR ("Unknown UL CQI type");
1866  }
1867 
1868  switch (params.m_ulCqi.m_type)
1869  {
1870  case UlCqi_s::PUSCH:
1871  {
1872  std::map <uint16_t, std::vector <uint16_t> >::iterator itMap;
1873  std::map <uint16_t, std::vector <double> >::iterator itCqi;
1874  NS_LOG_DEBUG (this << " Collect PUSCH CQIs of Frame no. " << (params.m_sfnSf >> 4) << " subframe no. " << (0xF & params.m_sfnSf));
1875  itMap = m_allocationMaps.find (params.m_sfnSf);
1876  if (itMap == m_allocationMaps.end ())
1877  {
1878  return;
1879  }
1880  for (uint32_t i = 0; i < (*itMap).second.size (); i++)
1881  {
1882  // convert from fixed point notation Sxxxxxxxxxxx.xxx to double
1883  double sinr = LteFfConverter::fpS11dot3toDouble (params.m_ulCqi.m_sinr.at (i));
1884  itCqi = m_ueCqi.find ((*itMap).second.at (i));
1885  if (itCqi == m_ueCqi.end ())
1886  {
1887  // create a new entry
1888  std::vector <double> newCqi;
1889  for (uint32_t j = 0; j < m_cschedCellConfig.m_ulBandwidth; j++)
1890  {
1891  if (i == j)
1892  {
1893  newCqi.push_back (sinr);
1894  }
1895  else
1896  {
1897  // initialize with NO_SINR value.
1898  newCqi.push_back (NO_SINR);
1899  }
1900 
1901  }
1902  m_ueCqi.insert (std::pair <uint16_t, std::vector <double> > ((*itMap).second.at (i), newCqi));
1903  // generate correspondent timer
1904  m_ueCqiTimers.insert (std::pair <uint16_t, uint32_t > ((*itMap).second.at (i), m_cqiTimersThreshold));
1905  }
1906  else
1907  {
1908  // update the value
1909  (*itCqi).second.at (i) = sinr;
1910  //NS_LOG_DEBUG (this << " RNTI " << (*itMap).second.at (i) << " RB " << i << " SINR " << sinr);
1911  // update correspondent timer
1912  std::map <uint16_t, uint32_t>::iterator itTimers;
1913  itTimers = m_ueCqiTimers.find ((*itMap).second.at (i));
1914  (*itTimers).second = m_cqiTimersThreshold;
1915 
1916  }
1917 
1918  }
1919  // remove obsolete info on allocation
1920  m_allocationMaps.erase (itMap);
1921  }
1922  break;
1923  case UlCqi_s::SRS:
1924  {
1925  // get the RNTI from vendor specific parameters
1926  uint16_t rnti = 0;
1927  NS_ASSERT (params.m_vendorSpecificList.size () > 0);
1928  for (uint16_t i = 0; i < params.m_vendorSpecificList.size (); i++)
1929  {
1930  if (params.m_vendorSpecificList.at (i).m_type == SRS_CQI_RNTI_VSP)
1931  {
1932  Ptr<SrsCqiRntiVsp> vsp = DynamicCast<SrsCqiRntiVsp> (params.m_vendorSpecificList.at (i).m_value);
1933  rnti = vsp->GetRnti ();
1934  }
1935  }
1936  std::map <uint16_t, std::vector <double> >::iterator itCqi;
1937  itCqi = m_ueCqi.find (rnti);
1938  if (itCqi == m_ueCqi.end ())
1939  {
1940  // create a new entry
1941  std::vector <double> newCqi;
1942  for (uint32_t j = 0; j < m_cschedCellConfig.m_ulBandwidth; j++)
1943  {
1944  double sinr = LteFfConverter::fpS11dot3toDouble (params.m_ulCqi.m_sinr.at (j));
1945  newCqi.push_back (sinr);
1946  NS_LOG_INFO (this << " RNTI " << rnti << " new SRS-CQI for RB " << j << " value " << sinr);
1947 
1948  }
1949  m_ueCqi.insert (std::pair <uint16_t, std::vector <double> > (rnti, newCqi));
1950  // generate correspondent timer
1951  m_ueCqiTimers.insert (std::pair <uint16_t, uint32_t > (rnti, m_cqiTimersThreshold));
1952  }
1953  else
1954  {
1955  // update the values
1956  for (uint32_t j = 0; j < m_cschedCellConfig.m_ulBandwidth; j++)
1957  {
1958  double sinr = LteFfConverter::fpS11dot3toDouble (params.m_ulCqi.m_sinr.at (j));
1959  (*itCqi).second.at (j) = sinr;
1960  NS_LOG_INFO (this << " RNTI " << rnti << " update SRS-CQI for RB " << j << " value " << sinr);
1961  }
1962  // update correspondent timer
1963  std::map <uint16_t, uint32_t>::iterator itTimers;
1964  itTimers = m_ueCqiTimers.find (rnti);
1965  (*itTimers).second = m_cqiTimersThreshold;
1966 
1967  }
1968 
1969 
1970  }
1971  break;
1972  case UlCqi_s::PUCCH_1:
1973  case UlCqi_s::PUCCH_2:
1974  case UlCqi_s::PRACH:
1975  {
1976  NS_FATAL_ERROR ("TtaFfMacScheduler supports only PUSCH and SRS UL-CQIs");
1977  }
1978  break;
1979  default:
1980  NS_FATAL_ERROR ("Unknown type of UL-CQI");
1981  }
1982  return;
1983 }
1984 
1985 void
1987 {
1988  // refresh DL CQI P01 Map
1989  std::map <uint16_t,uint32_t>::iterator itP10 = m_p10CqiTimers.begin ();
1990  while (itP10 != m_p10CqiTimers.end ())
1991  {
1992  NS_LOG_INFO (this << " P10-CQI for user " << (*itP10).first << " is " << (uint32_t)(*itP10).second << " thr " << (uint32_t)m_cqiTimersThreshold);
1993  if ((*itP10).second == 0)
1994  {
1995  // delete correspondent entries
1996  std::map <uint16_t,uint8_t>::iterator itMap = m_p10CqiRxed.find ((*itP10).first);
1997  NS_ASSERT_MSG (itMap != m_p10CqiRxed.end (), " Does not find CQI report for user " << (*itP10).first);
1998  NS_LOG_INFO (this << " P10-CQI expired for user " << (*itP10).first);
1999  m_p10CqiRxed.erase (itMap);
2000  std::map <uint16_t,uint32_t>::iterator temp = itP10;
2001  itP10++;
2002  m_p10CqiTimers.erase (temp);
2003  }
2004  else
2005  {
2006  (*itP10).second--;
2007  itP10++;
2008  }
2009  }
2010 
2011  // refresh DL CQI A30 Map
2012  std::map <uint16_t,uint32_t>::iterator itA30 = m_a30CqiTimers.begin ();
2013  while (itA30 != m_a30CqiTimers.end ())
2014  {
2015  NS_LOG_INFO (this << " A30-CQI for user " << (*itA30).first << " is " << (uint32_t)(*itA30).second << " thr " << (uint32_t)m_cqiTimersThreshold);
2016  if ((*itA30).second == 0)
2017  {
2018  // delete correspondent entries
2019  std::map <uint16_t,SbMeasResult_s>::iterator itMap = m_a30CqiRxed.find ((*itA30).first);
2020  NS_ASSERT_MSG (itMap != m_a30CqiRxed.end (), " Does not find CQI report for user " << (*itA30).first);
2021  NS_LOG_INFO (this << " A30-CQI expired for user " << (*itA30).first);
2022  m_a30CqiRxed.erase (itMap);
2023  std::map <uint16_t,uint32_t>::iterator temp = itA30;
2024  itA30++;
2025  m_a30CqiTimers.erase (temp);
2026  }
2027  else
2028  {
2029  (*itA30).second--;
2030  itA30++;
2031  }
2032  }
2033 
2034  return;
2035 }
2036 
2037 
2038 void
2040 {
2041  // refresh UL CQI Map
2042  std::map <uint16_t,uint32_t>::iterator itUl = m_ueCqiTimers.begin ();
2043  while (itUl != m_ueCqiTimers.end ())
2044  {
2045  NS_LOG_INFO (this << " UL-CQI for user " << (*itUl).first << " is " << (uint32_t)(*itUl).second << " thr " << (uint32_t)m_cqiTimersThreshold);
2046  if ((*itUl).second == 0)
2047  {
2048  // delete correspondent entries
2049  std::map <uint16_t, std::vector <double> >::iterator itMap = m_ueCqi.find ((*itUl).first);
2050  NS_ASSERT_MSG (itMap != m_ueCqi.end (), " Does not find CQI report for user " << (*itUl).first);
2051  NS_LOG_INFO (this << " UL-CQI exired for user " << (*itUl).first);
2052  (*itMap).second.clear ();
2053  m_ueCqi.erase (itMap);
2054  std::map <uint16_t,uint32_t>::iterator temp = itUl;
2055  itUl++;
2056  m_ueCqiTimers.erase (temp);
2057  }
2058  else
2059  {
2060  (*itUl).second--;
2061  itUl++;
2062  }
2063  }
2064 
2065  return;
2066 }
2067 
2068 void
2069 TtaFfMacScheduler::UpdateDlRlcBufferInfo (uint16_t rnti, uint8_t lcid, uint16_t size)
2070 {
2071  std::map<LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator it;
2072  LteFlowId_t flow (rnti, lcid);
2073  it = m_rlcBufferReq.find (flow);
2074  if (it != m_rlcBufferReq.end ())
2075  {
2076  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);
2077  // Update queues: RLC tx order Status, ReTx, Tx
2078  // Update status queue
2079  if (((*it).second.m_rlcStatusPduSize > 0) && (size >= (*it).second.m_rlcStatusPduSize))
2080  {
2081  (*it).second.m_rlcStatusPduSize = 0;
2082  }
2083  else if (((*it).second.m_rlcRetransmissionQueueSize > 0) && (size >= (*it).second.m_rlcRetransmissionQueueSize))
2084  {
2085  (*it).second.m_rlcRetransmissionQueueSize = 0;
2086  }
2087  else if ((*it).second.m_rlcTransmissionQueueSize > 0)
2088  {
2089  uint32_t rlcOverhead;
2090  if (lcid == 1)
2091  {
2092  // for SRB1 (using RLC AM) it's better to
2093  // overestimate RLC overhead rather than
2094  // underestimate it and risk unneeded
2095  // segmentation which increases delay
2096  rlcOverhead = 4;
2097  }
2098  else
2099  {
2100  // minimum RLC overhead due to header
2101  rlcOverhead = 2;
2102  }
2103  // update transmission queue
2104  if ((*it).second.m_rlcTransmissionQueueSize <= size - rlcOverhead)
2105  {
2106  (*it).second.m_rlcTransmissionQueueSize = 0;
2107  }
2108  else
2109  {
2110  (*it).second.m_rlcTransmissionQueueSize -= size - rlcOverhead;
2111  }
2112  }
2113  }
2114  else
2115  {
2116  NS_LOG_ERROR (this << " Does not find DL RLC Buffer Report of UE " << rnti);
2117  }
2118 }
2119 
2120 void
2121 TtaFfMacScheduler::UpdateUlRlcBufferInfo (uint16_t rnti, uint16_t size)
2122 {
2123 
2124  size = size - 2; // remove the minimum RLC overhead
2125  std::map <uint16_t,uint32_t>::iterator it = m_ceBsrRxed.find (rnti);
2126  if (it != m_ceBsrRxed.end ())
2127  {
2128  NS_LOG_INFO (this << " UE " << rnti << " size " << size << " BSR " << (*it).second);
2129  if ((*it).second >= size)
2130  {
2131  (*it).second -= size;
2132  }
2133  else
2134  {
2135  (*it).second = 0;
2136  }
2137  }
2138  else
2139  {
2140  NS_LOG_ERROR (this << " Does not find BSR report info of UE " << rnti);
2141  }
2142 
2143 }
2144 
2145 void
2147 {
2148  NS_LOG_FUNCTION (this << " RNTI " << rnti << " txMode " << (uint16_t)txMode);
2150  params.m_rnti = rnti;
2151  params.m_transmissionMode = txMode;
2153 }
2154 
2155 
2156 }
std::vector< DlInfoListElement_s > m_dlInfoListBuffered
FfMacCschedSapUser * m_cschedSapUser
int GetRbgSize(int dlbandwidth)
std::vector< struct UlInfoListElement_s > m_ulInfoList
See section 4.3.1 dlDciListElement.
Definition: ff-mac-common.h:88
void DoSchedUlCqiInfoReq(const struct FfMacSchedSapProvider::SchedUlCqiInfoReqParameters &params)
std::vector< struct RachListElement_s > m_rachList
std::map< uint16_t, DlHarqProcessesDciBuffer_t > m_dlHarqProcessesDciBuffer
double EstimateUlSinr(uint16_t rnti, uint16_t rb)
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:73
Service Access Point (SAP) offered by the eNodeB RRC instance to the Frequency Reuse algorithm instan...
Definition: lte-ffr-sap.h:132
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
virtual void SchedUlSrInfoReq(const struct SchedUlSrInfoReqParameters &params)
#define HARQ_PERIOD
Definition: lte-common.h:30
AttributeValue implementation for Boolean.
Definition: boolean.h:34
void DoCschedLcReleaseReq(const struct FfMacCschedSapProvider::CschedLcReleaseReqParameters &params)
std::map< uint16_t, uint32_t > m_ceBsrRxed
std::map< uint16_t, UlHarqProcessesDciBuffer_t > m_ulHarqProcessesDciBuffer
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition: object-base.h:44
virtual void CschedCellConfigReq(const struct CschedCellConfigReqParameters &params)
CSCHED_CELL_CONFIG_REQ.
virtual void SchedDlPagingBufferReq(const struct SchedDlPagingBufferReqParameters &params)
virtual void SchedDlMacBufferReq(const struct SchedDlMacBufferReqParameters &params)
Parameters of the CSCHED_UE_CONFIG_CNF primitive.
virtual void SchedDlCqiInfoReq(const struct SchedDlCqiInfoReqParameters &params)
Parameters of the CSCHED_UE_RELEASE_REQ primitive.
std::map< LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters > m_rlcBufferReq
enum ns3::UlCqi_s::Type_e m_type
Ptr< const AttributeAccessor > MakeBooleanAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
Definition: boolean.h:81
void DoSchedDlRachInfoReq(const struct FfMacSchedSapProvider::SchedDlRachInfoReqParameters &params)
std::vector< UlDciListElement_s > UlHarqProcessesDciBuffer_t
std::vector< struct LogicalChannelConfigListElement_s > m_logicalChannelConfigList
std::vector< uint16_t > m_sinr
virtual FfMacSchedSapProvider * GetFfMacSchedSapProvider()
std::vector< uint8_t > DlHarqProcessesTimer_t
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file...
Definition: assert.h:67
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:201
virtual void SchedDlTriggerReq(const struct SchedDlTriggerReqParameters &params)
std::vector< uint8_t > m_mcs
Definition: ff-mac-common.h:95
See section 4.3.2 ulDciListElement.
Provides the CSCHED SAP.
void DoSchedDlCqiInfoReq(const struct FfMacSchedSapProvider::SchedDlCqiInfoReqParameters &params)
std::vector< struct UlDciListElement_s > m_dciList
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
Definition: log.h:244
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
Definition: fatal-error.h:162
See section 4.3.10 buildRARListElement.
FfMacSchedSapUser * m_schedSapUser
Parameters of the CSCHED_UE_CONFIG_UPDATE_IND primitive.
std::map< uint16_t, uint32_t > m_a30CqiTimers
Parameters of the CSCHED_LC_RELEASE_REQ primitive.
std::vector< std::vector< struct RlcPduListElement_s > > m_rlcPduList
Parameters of the SCHED_DL_TRIGGER_REQ primitive.
virtual void DoDispose(void)
Destructor implementation.
std::map< uint16_t, uint32_t > m_p10CqiTimers
void UpdateDlRlcBufferInfo(uint16_t rnti, uint8_t lcid, uint16_t size)
void RefreshHarqProcesses()
Refresh HARQ processes according to the timers.
LteFfrSapProvider * m_ffrSapProvider
void DoCschedUeConfigReq(const struct FfMacCschedSapProvider::CschedUeConfigReqParameters &params)
std::map< uint16_t, SbMeasResult_s > m_a30CqiRxed
void DoSchedDlRlcBufferReq(const struct FfMacSchedSapProvider::SchedDlRlcBufferReqParameters &params)
std::map< uint16_t, DlHarqRlcPduListBuffer_t > m_dlHarqProcessesRlcPduListBuffer
std::vector< RlcPduList_t > DlHarqRlcPduListBuffer_t
Parameters of the SCHED_DL_MAC_BUFFER_REQ primitive.
FfMacCschedSapProvider::CschedCellConfigReqParameters m_cschedCellConfig
Parameters of the SCHED_DL_PAGING_BUFFER_REQ primitive.
virtual void CschedLcReleaseReq(const struct CschedLcReleaseReqParameters &params)
std::map< uint16_t, uint8_t > m_p10CqiRxed
virtual void CschedUeConfigUpdateInd(const struct CschedUeConfigUpdateIndParameters &params)=0
virtual void CschedUeConfigReq(const struct CschedUeConfigReqParameters &params)
std::vector< struct VendorSpecificListElement_s > m_vendorSpecificList
void DoSchedUlMacCtrlInfoReq(const struct FfMacSchedSapProvider::SchedUlMacCtrlInfoReqParameters &params)
Service Access Point (SAP) offered by the Frequency Reuse algorithm instance to the MAC Scheduler ins...
Definition: lte-ffr-sap.h:39
Parameters of the SCHED_UL_TRIGGER_REQ primitive.
Hold an unsigned integer type.
Definition: uinteger.h:44
uint8_t UpdateHarqProcessId(uint16_t rnti)
Update and return a new process Id for the RNTI specified.
static uint8_t TxMode2LayerNum(uint8_t txMode)
Definition: lte-common.cc:169
virtual void SchedDlRachInfoReq(const struct SchedDlRachInfoReqParameters &params)
virtual void CschedLcConfigReq(const struct CschedLcConfigReqParameters &params)
std::map< uint16_t, uint8_t > m_uesTxMode
std::vector< uint8_t > m_ndi
Definition: ff-mac-common.h:96
std::map< uint16_t, uint32_t > m_ueCqiTimers
int LcActivePerFlow(uint16_t rnti)
Provides the SCHED SAP.
friend class TtaSchedulerMemberCschedSapProvider
virtual void SchedUlNoiseInterferenceReq(const struct SchedUlNoiseInterferenceReqParameters &params)
virtual void CschedUeConfigCnf(const struct CschedUeConfigCnfParameters &params)=0
std::map< uint16_t, uint8_t > m_ulHarqCurrentProcessId
virtual void SetLteFfrSapProvider(LteFfrSapProvider *s)
Set the Provider part of the LteFfrSap that this Scheduler will interact with.
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
Definition: log.h:252
Parameters of the SCHED_UL_NOISE_INTERFERENCE_REQ primitive.
std::vector< struct CqiListElement_s > m_cqiList
std::vector< struct DlInfoListElement_s > m_dlInfoList
friend class TtaSchedulerMemberSchedSapProvider
virtual void SchedUlCqiInfoReq(const struct SchedUlCqiInfoReqParameters &params)
virtual void SchedDlConfigInd(const struct SchedDlConfigIndParameters &params)=0
void DoCschedLcConfigReq(const struct FfMacCschedSapProvider::CschedLcConfigReqParameters &params)
virtual void SchedUlTriggerReq(const struct SchedUlTriggerReqParameters &params)
uint8_t HarqProcessAvailability(uint16_t rnti)
Return the availability of free process for the RNTI specified.
void DoSchedUlNoiseInterferenceReq(const struct FfMacSchedSapProvider::SchedUlNoiseInterferenceReqParameters &params)
static TypeId GetTypeId(void)
std::vector< uint16_t > m_tbsSize
Definition: ff-mac-common.h:94
See section 4.3.9 rlcPDU_ListElement.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Ptr< const AttributeChecker > MakeBooleanChecker(void)
Definition: boolean.cc:121
virtual FfMacCschedSapProvider * GetFfMacCschedSapProvider()
std::vector< DlDciListElement_s > DlHarqProcessesDciBuffer_t
Parameters of the CSCHED_LC_CONFIG_REQ primitive.
std::vector< uint8_t > m_rv
Definition: ff-mac-common.h:97
FfMacSchedSapProvider * m_schedSapProvider
void UpdateUlRlcBufferInfo(uint16_t rnti, uint16_t size)
std::set< uint16_t > m_flowStatsDl
virtual void SchedUlConfigInd(const struct SchedUlConfigIndParameters &params)=0
UlCqiFilter_t m_ulCqiFilter
#define SRS_CQI_RNTI_VSP
std::set< uint16_t > m_flowStatsUl
This abstract base class identifies the interface by means of which the helper object can plug on the...
void TransmissionModeConfigurationUpdate(uint16_t rnti, uint8_t txMode)
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
Definition: assert.h:90
void DoCschedCellConfigReq(const struct FfMacCschedSapProvider::CschedCellConfigReqParameters &params)
bool m_harqOn
m_harqOn when false inhibit te HARQ mechanisms (by default active)
std::map< uint16_t, std::vector< double > > m_ueCqi
Parameters of the SCHED_DL_CQI_INFO_REQ primitive.
std::vector< struct MacCeListElement_s > m_macCeList
std::vector< struct RachListElement_s > m_rachList
static double fpS11dot3toDouble(uint16_t val)
Definition: lte-common.cc:113
void DoCschedUeReleaseReq(const struct FfMacCschedSapProvider::CschedUeReleaseReqParameters &params)
virtual ~TtaFfMacScheduler()
Destructor.
std::vector< uint8_t > UlHarqProcessesStatus_t
void DoSchedDlPagingBufferReq(const struct FfMacSchedSapProvider::SchedDlPagingBufferReqParameters &params)
void DoSchedDlTriggerReq(const struct FfMacSchedSapProvider::SchedDlTriggerReqParameters &params)
std::vector< uint8_t > DlHarqProcessesStatus_t
Parameters of the SCHED_UL_CQI_INFO_REQ primitive.
void DoSchedDlMacBufferReq(const struct FfMacSchedSapProvider::SchedDlMacBufferReqParameters &params)
static uint32_t BsrId2BufferSize(uint8_t val)
Definition: lte-common.cc:141
virtual void SchedDlRlcBufferReq(const struct SchedDlRlcBufferReqParameters &params)
virtual void CschedUeReleaseReq(const struct CschedUeReleaseReqParameters &params)
std::map< uint16_t, UlHarqProcessesStatus_t > m_ulHarqProcessesStatus
static const int TtaType0AllocationRbg[4]
Parameters of the SCHED_UL_MAC_CTRL_INFO_REQ primitive.
std::map< uint16_t, DlHarqProcessesStatus_t > m_dlHarqProcessesStatus
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Definition: log.h:236
std::map< uint16_t, DlHarqProcessesTimer_t > m_dlHarqProcessesTimer
Parameters of the SCHED_UL_SR_INFO_REQ primitive.
virtual void SchedUlMacCtrlInfoReq(const struct SchedUlMacCtrlInfoReqParameters &params)
std::map< uint16_t, uint8_t > m_dlHarqCurrentProcessId
void DoSchedUlTriggerReq(const struct FfMacSchedSapProvider::SchedUlTriggerReqParameters &params)
virtual void SetFfMacSchedSapUser(FfMacSchedSapUser *s)
set the user part of the FfMacSchedSap that this Scheduler will interact with.
#define NS_LOG_ERROR(msg)
Use NS_LOG to output a message of level LOG_ERROR.
Definition: log.h:220
Parameters of the SCHED_DL_RACH_INFO_REQ primitive.
Parameters of the SCHED_UL_CONFIG_IND primitive.
virtual void SetFfMacCschedSapUser(FfMacCschedSapUser *s)
set the user part of the FfMacCschedSap that this Scheduler will interact with.
Parameters of the CSCHED_UE_CONFIG_REQ primitive.
std::vector< uint16_t > m_rachAllocationMap
FfMacCschedSapProvider * m_cschedSapProvider
#define HARQ_DL_TIMEOUT
#define NO_SINR
std::map< uint16_t, std::vector< uint16_t > > m_allocationMaps
struct DlDciListElement_s m_dci
std::vector< struct BuildRarListElement_s > m_buildRarList
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
Definition: uinteger.h:45
a unique identifier for an interface.
Definition: type-id.h:58
Implements the SCHED SAP and CSCHED SAP for a Throughput to Average scheduler.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition: type-id.cc:904
#define HARQ_PROC_NUM
std::vector< struct BuildDataListElement_s > m_buildDataList
void DoSchedUlSrInfoReq(const struct FfMacSchedSapProvider::SchedUlSrInfoReqParameters &params)
virtual LteFfrSapUser * GetLteFfrSapUser()
See section 4.3.8 builDataListElement.