A Discrete-Event Network Simulator
API
fdtbfq-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/fdtbfq-ff-mac-scheduler.h>
29 #include <ns3/lte-vendor-specific-parameters.h>
30 #include <ns3/boolean.h>
31 #include <ns3/integer.h>
32 #include <set>
33 #include <cfloat>
34 
35 namespace ns3 {
36 
37 NS_LOG_COMPONENT_DEFINE ("FdTbfqFfMacScheduler");
38 
40 static const int FdTbfqType0AllocationRbg[4] = {
41  10, // RGB size 1
42  26, // RGB size 2
43  63, // RGB size 3
44  110 // RGB size 4
45 }; // see table 7.1.6.1-1 of 36.213
46 
47 
48 NS_OBJECT_ENSURE_REGISTERED (FdTbfqFfMacScheduler);
49 
50 
51 
53  : m_cschedSapUser (0),
54  m_schedSapUser (0),
55  m_nextRntiUl (0),
56  bankSize (0)
57 {
58  m_amc = CreateObject <LteAmc> ();
61  m_ffrSapProvider = 0;
63 }
64 
66 {
67  NS_LOG_FUNCTION (this);
68 }
69 
70 void
72 {
73  NS_LOG_FUNCTION (this);
75  m_dlHarqProcessesTimer.clear ();
77  m_dlInfoListBuffered.clear ();
78  m_ulHarqCurrentProcessId.clear ();
79  m_ulHarqProcessesStatus.clear ();
81  delete m_cschedSapProvider;
82  delete m_schedSapProvider;
83  delete m_ffrSapUser;
84 }
85 
86 TypeId
88 {
89  static TypeId tid = TypeId ("ns3::FdTbfqFfMacScheduler")
91  .SetGroupName ("Lte")
92  .AddConstructor<FdTbfqFfMacScheduler> ()
93  .AddAttribute ("CqiTimerThreshold",
94  "The number of TTIs a CQI is valid (default 1000 - 1 sec.)",
95  UintegerValue (1000),
97  MakeUintegerChecker<uint32_t> ())
98  .AddAttribute ("DebtLimit",
99  "Flow debt limit (default -625000 bytes)",
100  IntegerValue (-625000),
102  MakeIntegerChecker<int> ())
103  .AddAttribute ("CreditLimit",
104  "Flow credit limit (default 625000 bytes)",
105  UintegerValue (625000),
107  MakeUintegerChecker<uint32_t> ())
108  .AddAttribute ("TokenPoolSize",
109  "The maximum value of flow token pool (default 1 bytes)",
110  UintegerValue (1),
112  MakeUintegerChecker<uint32_t> ())
113  .AddAttribute ("CreditableThreshold",
114  "Threshold of flow credit (default 0 bytes)",
115  UintegerValue (0),
117  MakeUintegerChecker<uint32_t> ())
118 
119  .AddAttribute ("HarqEnabled",
120  "Activate/Deactivate the HARQ [by default is active].",
121  BooleanValue (true),
124  .AddAttribute ("UlGrantMcs",
125  "The MCS of the UL grant, must be [0..15] (default 0)",
126  UintegerValue (0),
128  MakeUintegerChecker<uint8_t> ())
129  ;
130  return tid;
131 }
132 
133 
134 
135 void
137 {
138  m_cschedSapUser = s;
139 }
140 
141 void
143 {
144  m_schedSapUser = s;
145 }
146 
149 {
150  return m_cschedSapProvider;
151 }
152 
155 {
156  return m_schedSapProvider;
157 }
158 
159 void
161 {
162  m_ffrSapProvider = s;
163 }
164 
167 {
168  return m_ffrSapUser;
169 }
170 
171 void
173 {
174  NS_LOG_FUNCTION (this);
175  // Read the subset of parameters used
176  m_cschedCellConfig = params;
179  cnf.m_result = SUCCESS;
181  return;
182 }
183 
184 void
186 {
187  NS_LOG_FUNCTION (this << " RNTI " << params.m_rnti << " txMode " << (uint16_t)params.m_transmissionMode);
188  std::map <uint16_t,uint8_t>::iterator it = m_uesTxMode.find (params.m_rnti);
189  if (it == m_uesTxMode.end ())
190  {
191  m_uesTxMode.insert (std::pair <uint16_t, double> (params.m_rnti, params.m_transmissionMode));
192  // generate HARQ buffers
193  m_dlHarqCurrentProcessId.insert (std::pair <uint16_t,uint8_t > (params.m_rnti, 0));
194  DlHarqProcessesStatus_t dlHarqPrcStatus;
195  dlHarqPrcStatus.resize (8,0);
196  m_dlHarqProcessesStatus.insert (std::pair <uint16_t, DlHarqProcessesStatus_t> (params.m_rnti, dlHarqPrcStatus));
197  DlHarqProcessesTimer_t dlHarqProcessesTimer;
198  dlHarqProcessesTimer.resize (8,0);
199  m_dlHarqProcessesTimer.insert (std::pair <uint16_t, DlHarqProcessesTimer_t> (params.m_rnti, dlHarqProcessesTimer));
200  DlHarqProcessesDciBuffer_t dlHarqdci;
201  dlHarqdci.resize (8);
202  m_dlHarqProcessesDciBuffer.insert (std::pair <uint16_t, DlHarqProcessesDciBuffer_t> (params.m_rnti, dlHarqdci));
203  DlHarqRlcPduListBuffer_t dlHarqRlcPdu;
204  dlHarqRlcPdu.resize (2);
205  dlHarqRlcPdu.at (0).resize (8);
206  dlHarqRlcPdu.at (1).resize (8);
207  m_dlHarqProcessesRlcPduListBuffer.insert (std::pair <uint16_t, DlHarqRlcPduListBuffer_t> (params.m_rnti, dlHarqRlcPdu));
208  m_ulHarqCurrentProcessId.insert (std::pair <uint16_t,uint8_t > (params.m_rnti, 0));
209  UlHarqProcessesStatus_t ulHarqPrcStatus;
210  ulHarqPrcStatus.resize (8,0);
211  m_ulHarqProcessesStatus.insert (std::pair <uint16_t, UlHarqProcessesStatus_t> (params.m_rnti, ulHarqPrcStatus));
212  UlHarqProcessesDciBuffer_t ulHarqdci;
213  ulHarqdci.resize (8);
214  m_ulHarqProcessesDciBuffer.insert (std::pair <uint16_t, UlHarqProcessesDciBuffer_t> (params.m_rnti, ulHarqdci));
215  }
216  else
217  {
218  (*it).second = params.m_transmissionMode;
219  }
220  return;
221 }
222 
223 void
225 {
226  NS_LOG_FUNCTION (this << " New LC, rnti: " << params.m_rnti);
227 
228  std::map <uint16_t, fdtbfqsFlowPerf_t>::iterator it;
229  for (uint16_t i = 0; i < params.m_logicalChannelConfigList.size (); i++)
230  {
231  it = m_flowStatsDl.find (params.m_rnti);
232 
233  if (it == m_flowStatsDl.end ())
234  {
235  uint64_t mbrDlInBytes = params.m_logicalChannelConfigList.at (i).m_eRabMaximulBitrateDl / 8; // byte/s
236  uint64_t mbrUlInBytes = params.m_logicalChannelConfigList.at (i).m_eRabMaximulBitrateUl / 8; // byte/s
237  NS_LOG_DEBUG ("mbrDlInBytes: " << mbrDlInBytes << " mbrUlInBytes: " << mbrUlInBytes);
238 
239  fdtbfqsFlowPerf_t flowStatsDl;
240  flowStatsDl.flowStart = Simulator::Now ();
241  flowStatsDl.packetArrivalRate = 0;
242  flowStatsDl.tokenGenerationRate = mbrDlInBytes;
243  flowStatsDl.tokenPoolSize = 0;
244  flowStatsDl.maxTokenPoolSize = m_tokenPoolSize;
245  flowStatsDl.counter = 0;
246  flowStatsDl.burstCredit = m_creditLimit; // bytes
247  flowStatsDl.debtLimit = m_debtLimit; // bytes
249  m_flowStatsDl.insert (std::pair<uint16_t, fdtbfqsFlowPerf_t> (params.m_rnti, flowStatsDl));
250  fdtbfqsFlowPerf_t flowStatsUl;
251  flowStatsUl.flowStart = Simulator::Now ();
252  flowStatsUl.packetArrivalRate = 0;
253  flowStatsUl.tokenGenerationRate = mbrUlInBytes;
254  flowStatsUl.tokenPoolSize = 0;
255  flowStatsUl.maxTokenPoolSize = m_tokenPoolSize;
256  flowStatsUl.counter = 0;
257  flowStatsUl.burstCredit = m_creditLimit; // bytes
258  flowStatsUl.debtLimit = m_debtLimit; // bytes
260  m_flowStatsUl.insert (std::pair<uint16_t, fdtbfqsFlowPerf_t> (params.m_rnti, flowStatsUl));
261  }
262  else
263  {
264  // update MBR and GBR from UeManager::SetupDataRadioBearer ()
265  uint64_t mbrDlInBytes = params.m_logicalChannelConfigList.at (i).m_eRabMaximulBitrateDl / 8; // byte/s
266  uint64_t mbrUlInBytes = params.m_logicalChannelConfigList.at (i).m_eRabMaximulBitrateUl / 8; // byte/s
267  NS_LOG_DEBUG ("mbrDlInBytes: " << mbrDlInBytes << " mbrUlInBytes: " << mbrUlInBytes);
268  m_flowStatsDl[(*it).first].tokenGenerationRate = mbrDlInBytes;
269  m_flowStatsUl[(*it).first].tokenGenerationRate = mbrUlInBytes;
270 
271  }
272  }
273 
274  return;
275 }
276 
277 void
279 {
280  NS_LOG_FUNCTION (this);
281  for (uint16_t i = 0; i < params.m_logicalChannelIdentity.size (); i++)
282  {
283  std::map<LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator it = m_rlcBufferReq.begin ();
284  std::map<LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator temp;
285  while (it != m_rlcBufferReq.end ())
286  {
287  if (((*it).first.m_rnti == params.m_rnti) && ((*it).first.m_lcId == params.m_logicalChannelIdentity.at (i)))
288  {
289  temp = it;
290  it++;
291  m_rlcBufferReq.erase (temp);
292  }
293  else
294  {
295  it++;
296  }
297  }
298  }
299  return;
300 }
301 
302 void
304 {
305  NS_LOG_FUNCTION (this);
306 
307  m_uesTxMode.erase (params.m_rnti);
308  m_dlHarqCurrentProcessId.erase (params.m_rnti);
309  m_dlHarqProcessesStatus.erase (params.m_rnti);
310  m_dlHarqProcessesTimer.erase (params.m_rnti);
311  m_dlHarqProcessesDciBuffer.erase (params.m_rnti);
313  m_ulHarqCurrentProcessId.erase (params.m_rnti);
314  m_ulHarqProcessesStatus.erase (params.m_rnti);
315  m_ulHarqProcessesDciBuffer.erase (params.m_rnti);
316  m_flowStatsDl.erase (params.m_rnti);
317  m_flowStatsUl.erase (params.m_rnti);
318  m_ceBsrRxed.erase (params.m_rnti);
319  std::map<LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator it = m_rlcBufferReq.begin ();
320  std::map<LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator temp;
321  while (it != m_rlcBufferReq.end ())
322  {
323  if ((*it).first.m_rnti == params.m_rnti)
324  {
325  temp = it;
326  it++;
327  m_rlcBufferReq.erase (temp);
328  }
329  else
330  {
331  it++;
332  }
333  }
334  if (m_nextRntiUl == params.m_rnti)
335  {
336  m_nextRntiUl = 0;
337  }
338 
339  return;
340 }
341 
342 
343 void
345 {
346  NS_LOG_FUNCTION (this << params.m_rnti << (uint32_t) params.m_logicalChannelIdentity);
347  // API generated by RLC for updating RLC parameters on a LC (tx and retx queues)
348 
349  std::map <LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator it;
350 
351  LteFlowId_t flow (params.m_rnti, params.m_logicalChannelIdentity);
352 
353  it = m_rlcBufferReq.find (flow);
354 
355  if (it == m_rlcBufferReq.end ())
356  {
357  m_rlcBufferReq.insert (std::pair <LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters> (flow, params));
358  }
359  else
360  {
361  (*it).second = params;
362  }
363 
364  return;
365 }
366 
367 void
369 {
370  NS_LOG_FUNCTION (this);
371  NS_FATAL_ERROR ("method not implemented");
372  return;
373 }
374 
375 void
377 {
378  NS_LOG_FUNCTION (this);
379  NS_FATAL_ERROR ("method not implemented");
380  return;
381 }
382 
383 int
385 {
386  for (int i = 0; i < 4; i++)
387  {
388  if (dlbandwidth < FdTbfqType0AllocationRbg[i])
389  {
390  return (i + 1);
391  }
392  }
393 
394  return (-1);
395 }
396 
397 
398 unsigned int
400 {
401  std::map <LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator it;
402  unsigned int lcActive = 0;
403  for (it = m_rlcBufferReq.begin (); it != m_rlcBufferReq.end (); it++)
404  {
405  if (((*it).first.m_rnti == rnti) && (((*it).second.m_rlcTransmissionQueueSize > 0)
406  || ((*it).second.m_rlcRetransmissionQueueSize > 0)
407  || ((*it).second.m_rlcStatusPduSize > 0) ))
408  {
409  lcActive++;
410  }
411  if ((*it).first.m_rnti > rnti)
412  {
413  break;
414  }
415  }
416  return (lcActive);
417 
418 }
419 
420 
421 uint8_t
423 {
424  NS_LOG_FUNCTION (this << rnti);
425 
426  std::map <uint16_t, uint8_t>::iterator it = m_dlHarqCurrentProcessId.find (rnti);
427  if (it == m_dlHarqCurrentProcessId.end ())
428  {
429  NS_FATAL_ERROR ("No Process Id found for this RNTI " << rnti);
430  }
431  std::map <uint16_t, DlHarqProcessesStatus_t>::iterator itStat = m_dlHarqProcessesStatus.find (rnti);
432  if (itStat == m_dlHarqProcessesStatus.end ())
433  {
434  NS_FATAL_ERROR ("No Process Id Statusfound for this RNTI " << rnti);
435  }
436  uint8_t i = (*it).second;
437  do
438  {
439  i = (i + 1) % HARQ_PROC_NUM;
440  }
441  while ( ((*itStat).second.at (i) != 0)&&(i != (*it).second));
442  if ((*itStat).second.at (i) == 0)
443  {
444  return (true);
445  }
446  else
447  {
448  return (false); // return a not valid harq proc id
449  }
450 }
451 
452 
453 
454 uint8_t
456 {
457  NS_LOG_FUNCTION (this << rnti);
458 
459  if (m_harqOn == false)
460  {
461  return (0);
462  }
463 
464 
465  std::map <uint16_t, uint8_t>::iterator it = m_dlHarqCurrentProcessId.find (rnti);
466  if (it == m_dlHarqCurrentProcessId.end ())
467  {
468  NS_FATAL_ERROR ("No Process Id found for this RNTI " << rnti);
469  }
470  std::map <uint16_t, DlHarqProcessesStatus_t>::iterator itStat = m_dlHarqProcessesStatus.find (rnti);
471  if (itStat == m_dlHarqProcessesStatus.end ())
472  {
473  NS_FATAL_ERROR ("No Process Id Statusfound for this RNTI " << rnti);
474  }
475  uint8_t i = (*it).second;
476  do
477  {
478  i = (i + 1) % HARQ_PROC_NUM;
479  }
480  while ( ((*itStat).second.at (i) != 0)&&(i != (*it).second));
481  if ((*itStat).second.at (i) == 0)
482  {
483  (*it).second = i;
484  (*itStat).second.at (i) = 1;
485  }
486  else
487  {
488  NS_FATAL_ERROR ("No HARQ process available for RNTI " << rnti << " check before update with HarqProcessAvailability");
489  }
490 
491  return ((*it).second);
492 }
493 
494 
495 void
497 {
498  NS_LOG_FUNCTION (this);
499 
500  std::map <uint16_t, DlHarqProcessesTimer_t>::iterator itTimers;
501  for (itTimers = m_dlHarqProcessesTimer.begin (); itTimers != m_dlHarqProcessesTimer.end (); itTimers++)
502  {
503  for (uint16_t i = 0; i < HARQ_PROC_NUM; i++)
504  {
505  if ((*itTimers).second.at (i) == HARQ_DL_TIMEOUT)
506  {
507  // reset HARQ process
508 
509  NS_LOG_DEBUG (this << " Reset HARQ proc " << i << " for RNTI " << (*itTimers).first);
510  std::map <uint16_t, DlHarqProcessesStatus_t>::iterator itStat = m_dlHarqProcessesStatus.find ((*itTimers).first);
511  if (itStat == m_dlHarqProcessesStatus.end ())
512  {
513  NS_FATAL_ERROR ("No Process Id Status found for this RNTI " << (*itTimers).first);
514  }
515  (*itStat).second.at (i) = 0;
516  (*itTimers).second.at (i) = 0;
517  }
518  else
519  {
520  (*itTimers).second.at (i)++;
521  }
522  }
523  }
524 
525 }
526 
527 
528 void
530 {
531  NS_LOG_FUNCTION (this << " Frame no. " << (params.m_sfnSf >> 4) << " subframe no. " << (0xF & params.m_sfnSf));
532  // API generated by RLC for triggering the scheduling of a DL subframe
533 
534 
535  // evaluate the relative channel quality indicator for each UE per each RBG
536  // (since we are using allocation type 0 the small unit of allocation is RBG)
537  // Resource allocation type 0 (see sec 7.1.6.1 of 36.213)
538 
539  RefreshDlCqiMaps ();
540 
542  int rbgNum = m_cschedCellConfig.m_dlBandwidth / rbgSize;
543  std::map <uint16_t, std::vector <uint16_t> > allocationMap; // RBs map per RNTI
544  std::vector <bool> rbgMap; // global RBGs map
545  uint16_t rbgAllocatedNum = 0;
546  std::set <uint16_t> rntiAllocated;
547  rbgMap.resize (m_cschedCellConfig.m_dlBandwidth / rbgSize, false);
548 
549  rbgMap = m_ffrSapProvider->GetAvailableDlRbg ();
550  for (std::vector<bool>::iterator it = rbgMap.begin (); it != rbgMap.end (); it++)
551  {
552  if ((*it) == true )
553  {
554  rbgAllocatedNum++;
555  }
556  }
557 
559 
560  // update UL HARQ proc id
561  std::map <uint16_t, uint8_t>::iterator itProcId;
562  for (itProcId = m_ulHarqCurrentProcessId.begin (); itProcId != m_ulHarqCurrentProcessId.end (); itProcId++)
563  {
564  (*itProcId).second = ((*itProcId).second + 1) % HARQ_PROC_NUM;
565  }
566 
567  // RACH Allocation
568  uint16_t rbAllocatedNum = 0;
569  std::vector <bool> ulRbMap;
570  ulRbMap.resize (m_cschedCellConfig.m_ulBandwidth, false);
571  ulRbMap = m_ffrSapProvider->GetAvailableUlRbg ();
572  uint8_t maxContinuousUlBandwidth = 0;
573  uint8_t tmpMinBandwidth = 0;
574  uint16_t ffrRbStartOffset = 0;
575  uint16_t tmpFfrRbStartOffset = 0;
576  uint16_t index = 0;
577 
578  for (std::vector<bool>::iterator it = ulRbMap.begin (); it != ulRbMap.end (); it++)
579  {
580  if ((*it) == true )
581  {
582  rbAllocatedNum++;
583  if (tmpMinBandwidth > maxContinuousUlBandwidth)
584  {
585  maxContinuousUlBandwidth = tmpMinBandwidth;
586  ffrRbStartOffset = tmpFfrRbStartOffset;
587  }
588  tmpMinBandwidth = 0;
589  }
590  else
591  {
592  if (tmpMinBandwidth == 0)
593  {
594  tmpFfrRbStartOffset = index;
595  }
596  tmpMinBandwidth++;
597  }
598  index++;
599  }
600 
601  if (tmpMinBandwidth > maxContinuousUlBandwidth)
602  {
603  maxContinuousUlBandwidth = tmpMinBandwidth;
604  ffrRbStartOffset = tmpFfrRbStartOffset;
605  }
606 
608  uint16_t rbStart = 0;
609  rbStart = ffrRbStartOffset;
610  std::vector <struct RachListElement_s>::iterator itRach;
611  for (itRach = m_rachList.begin (); itRach != m_rachList.end (); itRach++)
612  {
613  NS_ASSERT_MSG (m_amc->GetUlTbSizeFromMcs (m_ulGrantMcs, m_cschedCellConfig.m_ulBandwidth) > (*itRach).m_estimatedSize, " Default UL Grant MCS does not allow to send RACH messages");
614  BuildRarListElement_s newRar;
615  newRar.m_rnti = (*itRach).m_rnti;
616  // DL-RACH Allocation
617  // Ideal: no needs of configuring m_dci
618  // UL-RACH Allocation
619  newRar.m_grant.m_rnti = newRar.m_rnti;
620  newRar.m_grant.m_mcs = m_ulGrantMcs;
621  uint16_t rbLen = 1;
622  uint16_t tbSizeBits = 0;
623  // find lowest TB size that fits UL grant estimated size
624  while ((tbSizeBits < (*itRach).m_estimatedSize) && (rbStart + rbLen < (ffrRbStartOffset + maxContinuousUlBandwidth)))
625  {
626  rbLen++;
627  tbSizeBits = m_amc->GetUlTbSizeFromMcs (m_ulGrantMcs, rbLen);
628  }
629  if (tbSizeBits < (*itRach).m_estimatedSize)
630  {
631  // no more allocation space: finish allocation
632  break;
633  }
634  newRar.m_grant.m_rbStart = rbStart;
635  newRar.m_grant.m_rbLen = rbLen;
636  newRar.m_grant.m_tbSize = tbSizeBits / 8;
637  newRar.m_grant.m_hopping = false;
638  newRar.m_grant.m_tpc = 0;
639  newRar.m_grant.m_cqiRequest = false;
640  newRar.m_grant.m_ulDelay = false;
641  NS_LOG_INFO (this << " UL grant allocated to RNTI " << (*itRach).m_rnti << " rbStart " << rbStart << " rbLen " << rbLen << " MCS " << (uint16_t) m_ulGrantMcs << " tbSize " << newRar.m_grant.m_tbSize);
642  for (uint16_t i = rbStart; i < rbStart + rbLen; i++)
643  {
644  m_rachAllocationMap.at (i) = (*itRach).m_rnti;
645  }
646 
647  if (m_harqOn == true)
648  {
649  // generate UL-DCI for HARQ retransmissions
650  UlDciListElement_s uldci;
651  uldci.m_rnti = newRar.m_rnti;
652  uldci.m_rbLen = rbLen;
653  uldci.m_rbStart = rbStart;
654  uldci.m_mcs = m_ulGrantMcs;
655  uldci.m_tbSize = tbSizeBits / 8;
656  uldci.m_ndi = 1;
657  uldci.m_cceIndex = 0;
658  uldci.m_aggrLevel = 1;
659  uldci.m_ueTxAntennaSelection = 3; // antenna selection OFF
660  uldci.m_hopping = false;
661  uldci.m_n2Dmrs = 0;
662  uldci.m_tpc = 0; // no power control
663  uldci.m_cqiRequest = false; // only period CQI at this stage
664  uldci.m_ulIndex = 0; // TDD parameter
665  uldci.m_dai = 1; // TDD parameter
666  uldci.m_freqHopping = 0;
667  uldci.m_pdcchPowerOffset = 0; // not used
668 
669  uint8_t harqId = 0;
670  std::map <uint16_t, uint8_t>::iterator itProcId;
671  itProcId = m_ulHarqCurrentProcessId.find (uldci.m_rnti);
672  if (itProcId == m_ulHarqCurrentProcessId.end ())
673  {
674  NS_FATAL_ERROR ("No info find in HARQ buffer for UE " << uldci.m_rnti);
675  }
676  harqId = (*itProcId).second;
677  std::map <uint16_t, UlHarqProcessesDciBuffer_t>::iterator itDci = m_ulHarqProcessesDciBuffer.find (uldci.m_rnti);
678  if (itDci == m_ulHarqProcessesDciBuffer.end ())
679  {
680  NS_FATAL_ERROR ("Unable to find RNTI entry in UL DCI HARQ buffer for RNTI " << uldci.m_rnti);
681  }
682  (*itDci).second.at (harqId) = uldci;
683  }
684 
685  rbStart = rbStart + rbLen;
686  ret.m_buildRarList.push_back (newRar);
687  }
688  m_rachList.clear ();
689 
690 
691  // Process DL HARQ feedback
693  // retrieve past HARQ retx buffered
694  if (m_dlInfoListBuffered.size () > 0)
695  {
696  if (params.m_dlInfoList.size () > 0)
697  {
698  NS_LOG_INFO (this << " Received DL-HARQ feedback");
699  m_dlInfoListBuffered.insert (m_dlInfoListBuffered.end (), params.m_dlInfoList.begin (), params.m_dlInfoList.end ());
700  }
701  }
702  else
703  {
704  if (params.m_dlInfoList.size () > 0)
705  {
707  }
708  }
709  if (m_harqOn == false)
710  {
711  // Ignore HARQ feedback
712  m_dlInfoListBuffered.clear ();
713  }
714  std::vector <struct DlInfoListElement_s> dlInfoListUntxed;
715  for (uint16_t i = 0; i < m_dlInfoListBuffered.size (); i++)
716  {
717  std::set <uint16_t>::iterator itRnti = rntiAllocated.find (m_dlInfoListBuffered.at (i).m_rnti);
718  if (itRnti != rntiAllocated.end ())
719  {
720  // RNTI already allocated for retx
721  continue;
722  }
723  uint8_t nLayers = m_dlInfoListBuffered.at (i).m_harqStatus.size ();
724  std::vector <bool> retx;
725  NS_LOG_INFO (this << " Processing DLHARQ feedback");
726  if (nLayers == 1)
727  {
728  retx.push_back (m_dlInfoListBuffered.at (i).m_harqStatus.at (0) == DlInfoListElement_s::NACK);
729  retx.push_back (false);
730  }
731  else
732  {
733  retx.push_back (m_dlInfoListBuffered.at (i).m_harqStatus.at (0) == DlInfoListElement_s::NACK);
734  retx.push_back (m_dlInfoListBuffered.at (i).m_harqStatus.at (1) == DlInfoListElement_s::NACK);
735  }
736  if (retx.at (0) || retx.at (1))
737  {
738  // retrieve HARQ process information
739  uint16_t rnti = m_dlInfoListBuffered.at (i).m_rnti;
740  uint8_t harqId = m_dlInfoListBuffered.at (i).m_harqProcessId;
741  NS_LOG_INFO (this << " HARQ retx RNTI " << rnti << " harqId " << (uint16_t)harqId);
742  std::map <uint16_t, DlHarqProcessesDciBuffer_t>::iterator itHarq = m_dlHarqProcessesDciBuffer.find (rnti);
743  if (itHarq == m_dlHarqProcessesDciBuffer.end ())
744  {
745  NS_FATAL_ERROR ("No info find in HARQ buffer for UE " << rnti);
746  }
747 
748  DlDciListElement_s dci = (*itHarq).second.at (harqId);
749  int rv = 0;
750  if (dci.m_rv.size () == 1)
751  {
752  rv = dci.m_rv.at (0);
753  }
754  else
755  {
756  rv = (dci.m_rv.at (0) > dci.m_rv.at (1) ? dci.m_rv.at (0) : dci.m_rv.at (1));
757  }
758 
759  if (rv == 3)
760  {
761  // maximum number of retx reached -> drop process
762  NS_LOG_INFO ("Maximum number of retransmissions reached -> drop process");
763  std::map <uint16_t, DlHarqProcessesStatus_t>::iterator it = m_dlHarqProcessesStatus.find (rnti);
764  if (it == m_dlHarqProcessesStatus.end ())
765  {
766  NS_LOG_ERROR ("No info find in HARQ buffer for UE (might change eNB) " << m_dlInfoListBuffered.at (i).m_rnti);
767  }
768  (*it).second.at (harqId) = 0;
769  std::map <uint16_t, DlHarqRlcPduListBuffer_t>::iterator itRlcPdu = m_dlHarqProcessesRlcPduListBuffer.find (rnti);
770  if (itRlcPdu == m_dlHarqProcessesRlcPduListBuffer.end ())
771  {
772  NS_FATAL_ERROR ("Unable to find RlcPdcList in HARQ buffer for RNTI " << m_dlInfoListBuffered.at (i).m_rnti);
773  }
774  for (uint16_t k = 0; k < (*itRlcPdu).second.size (); k++)
775  {
776  (*itRlcPdu).second.at (k).at (harqId).clear ();
777  }
778  continue;
779  }
780  // check the feasibility of retransmitting on the same RBGs
781  // translate the DCI to Spectrum framework
782  std::vector <int> dciRbg;
783  uint32_t mask = 0x1;
784  NS_LOG_INFO ("Original RBGs " << dci.m_rbBitmap << " rnti " << dci.m_rnti);
785  for (int j = 0; j < 32; j++)
786  {
787  if (((dci.m_rbBitmap & mask) >> j) == 1)
788  {
789  dciRbg.push_back (j);
790  NS_LOG_INFO ("\t" << j);
791  }
792  mask = (mask << 1);
793  }
794  bool free = true;
795  for (uint8_t j = 0; j < dciRbg.size (); j++)
796  {
797  if (rbgMap.at (dciRbg.at (j)) == true)
798  {
799  free = false;
800  break;
801  }
802  }
803  if (free)
804  {
805  // use the same RBGs for the retx
806  // reserve RBGs
807  for (uint8_t j = 0; j < dciRbg.size (); j++)
808  {
809  rbgMap.at (dciRbg.at (j)) = true;
810  NS_LOG_INFO ("RBG " << dciRbg.at (j) << " assigned");
811  rbgAllocatedNum++;
812  }
813 
814  NS_LOG_INFO (this << " Send retx in the same RBGs");
815  }
816  else
817  {
818  // find RBGs for sending HARQ retx
819  uint8_t j = 0;
820  uint8_t rbgId = (dciRbg.at (dciRbg.size () - 1) + 1) % rbgNum;
821  uint8_t startRbg = dciRbg.at (dciRbg.size () - 1);
822  std::vector <bool> rbgMapCopy = rbgMap;
823  while ((j < dciRbg.size ())&&(startRbg != rbgId))
824  {
825  if (rbgMapCopy.at (rbgId) == false)
826  {
827  rbgMapCopy.at (rbgId) = true;
828  dciRbg.at (j) = rbgId;
829  j++;
830  }
831  rbgId = (rbgId + 1) % rbgNum;
832  }
833  if (j == dciRbg.size ())
834  {
835  // find new RBGs -> update DCI map
836  uint32_t rbgMask = 0;
837  for (uint16_t k = 0; k < dciRbg.size (); k++)
838  {
839  rbgMask = rbgMask + (0x1 << dciRbg.at (k));
840  rbgAllocatedNum++;
841  }
842  dci.m_rbBitmap = rbgMask;
843  rbgMap = rbgMapCopy;
844  NS_LOG_INFO (this << " Move retx in RBGs " << dciRbg.size ());
845  }
846  else
847  {
848  // HARQ retx cannot be performed on this TTI -> store it
849  dlInfoListUntxed.push_back (m_dlInfoListBuffered.at (i));
850  NS_LOG_INFO (this << " No resource for this retx -> buffer it");
851  }
852  }
853  // retrieve RLC PDU list for retx TBsize and update DCI
855  std::map <uint16_t, DlHarqRlcPduListBuffer_t>::iterator itRlcPdu = m_dlHarqProcessesRlcPduListBuffer.find (rnti);
856  if (itRlcPdu == m_dlHarqProcessesRlcPduListBuffer.end ())
857  {
858  NS_FATAL_ERROR ("Unable to find RlcPdcList in HARQ buffer for RNTI " << rnti);
859  }
860  for (uint8_t j = 0; j < nLayers; j++)
861  {
862  if (retx.at (j))
863  {
864  if (j >= dci.m_ndi.size ())
865  {
866  // for avoiding errors in MIMO transient phases
867  dci.m_ndi.push_back (0);
868  dci.m_rv.push_back (0);
869  dci.m_mcs.push_back (0);
870  dci.m_tbsSize.push_back (0);
871  NS_LOG_INFO (this << " layer " << (uint16_t)j << " no txed (MIMO transition)");
872  }
873  else
874  {
875  dci.m_ndi.at (j) = 0;
876  dci.m_rv.at (j)++;
877  (*itHarq).second.at (harqId).m_rv.at (j)++;
878  NS_LOG_INFO (this << " layer " << (uint16_t)j << " RV " << (uint16_t)dci.m_rv.at (j));
879  }
880  }
881  else
882  {
883  // empty TB of layer j
884  dci.m_ndi.at (j) = 0;
885  dci.m_rv.at (j) = 0;
886  dci.m_mcs.at (j) = 0;
887  dci.m_tbsSize.at (j) = 0;
888  NS_LOG_INFO (this << " layer " << (uint16_t)j << " no retx");
889  }
890  }
891  for (uint16_t k = 0; k < (*itRlcPdu).second.at (0).at (dci.m_harqProcess).size (); k++)
892  {
893  std::vector <struct RlcPduListElement_s> rlcPduListPerLc;
894  for (uint8_t j = 0; j < nLayers; j++)
895  {
896  if (retx.at (j))
897  {
898  if (j < dci.m_ndi.size ())
899  {
900  NS_LOG_INFO (" layer " << (uint16_t)j << " tb size " << dci.m_tbsSize.at (j));
901  rlcPduListPerLc.push_back ((*itRlcPdu).second.at (j).at (dci.m_harqProcess).at (k));
902  }
903  }
904  else
905  { // if no retx needed on layer j, push an RlcPduListElement_s object with m_size=0 to keep the size of rlcPduListPerLc vector = 2 in case of MIMO
906  NS_LOG_INFO (" layer " << (uint16_t)j << " tb size " << dci.m_tbsSize.at (j));
907  RlcPduListElement_s emptyElement;
908  emptyElement.m_logicalChannelIdentity = (*itRlcPdu).second.at (j).at (dci.m_harqProcess).at (k).m_logicalChannelIdentity;
909  emptyElement.m_size = 0;
910  rlcPduListPerLc.push_back (emptyElement);
911  }
912  }
913 
914  if (rlcPduListPerLc.size () > 0)
915  {
916  newEl.m_rlcPduList.push_back (rlcPduListPerLc);
917  }
918  }
919  newEl.m_rnti = rnti;
920  newEl.m_dci = dci;
921  (*itHarq).second.at (harqId).m_rv = dci.m_rv;
922  // refresh timer
923  std::map <uint16_t, DlHarqProcessesTimer_t>::iterator itHarqTimer = m_dlHarqProcessesTimer.find (rnti);
924  if (itHarqTimer == m_dlHarqProcessesTimer.end ())
925  {
926  NS_FATAL_ERROR ("Unable to find HARQ timer for RNTI " << (uint16_t)rnti);
927  }
928  (*itHarqTimer).second.at (harqId) = 0;
929  ret.m_buildDataList.push_back (newEl);
930  rntiAllocated.insert (rnti);
931  }
932  else
933  {
934  // update HARQ process status
935  NS_LOG_INFO (this << " HARQ received ACK for UE " << m_dlInfoListBuffered.at (i).m_rnti);
936  std::map <uint16_t, DlHarqProcessesStatus_t>::iterator it = m_dlHarqProcessesStatus.find (m_dlInfoListBuffered.at (i).m_rnti);
937  if (it == m_dlHarqProcessesStatus.end ())
938  {
939  NS_FATAL_ERROR ("No info find in HARQ buffer for UE " << m_dlInfoListBuffered.at (i).m_rnti);
940  }
941  (*it).second.at (m_dlInfoListBuffered.at (i).m_harqProcessId) = 0;
942  std::map <uint16_t, DlHarqRlcPduListBuffer_t>::iterator itRlcPdu = m_dlHarqProcessesRlcPduListBuffer.find (m_dlInfoListBuffered.at (i).m_rnti);
943  if (itRlcPdu == m_dlHarqProcessesRlcPduListBuffer.end ())
944  {
945  NS_FATAL_ERROR ("Unable to find RlcPdcList in HARQ buffer for RNTI " << m_dlInfoListBuffered.at (i).m_rnti);
946  }
947  for (uint16_t k = 0; k < (*itRlcPdu).second.size (); k++)
948  {
949  (*itRlcPdu).second.at (k).at (m_dlInfoListBuffered.at (i).m_harqProcessId).clear ();
950  }
951  }
952  }
953  m_dlInfoListBuffered.clear ();
954  m_dlInfoListBuffered = dlInfoListUntxed;
955 
956  if (rbgAllocatedNum == rbgNum)
957  {
958  // all the RBGs are already allocated -> exit
959  if ((ret.m_buildDataList.size () > 0) || (ret.m_buildRarList.size () > 0))
960  {
962  }
963  return;
964  }
965 
966  // update token pool, counter and bank size
967  std::map <uint16_t, fdtbfqsFlowPerf_t>::iterator itStats;
968  for (itStats = m_flowStatsDl.begin (); itStats != m_flowStatsDl.end (); itStats++)
969  {
970  if ( (*itStats).second.tokenGenerationRate / 1000 + (*itStats).second.tokenPoolSize > (*itStats).second.maxTokenPoolSize )
971  {
972  (*itStats).second.counter += (*itStats).second.tokenGenerationRate / 1000 - ( (*itStats).second.maxTokenPoolSize - (*itStats).second.tokenPoolSize );
973  (*itStats).second.tokenPoolSize = (*itStats).second.maxTokenPoolSize;
974  bankSize += (*itStats).second.tokenGenerationRate / 1000 - ( (*itStats).second.maxTokenPoolSize - (*itStats).second.tokenPoolSize );
975  }
976  else
977  {
978  (*itStats).second.tokenPoolSize += (*itStats).second.tokenGenerationRate / 1000;
979  }
980  }
981 
982  std::set <uint16_t> allocatedRnti; // store UEs which are already assigned RBGs
983  std::set <uint8_t> allocatedRbg; // store RBGs which are already allocated to UE
984 
985  int totalRbg = 0;
986  while (totalRbg < rbgNum)
987  {
988  // select UE with largest metric
989  std::map <uint16_t, fdtbfqsFlowPerf_t>::iterator it;
990  std::map <uint16_t, fdtbfqsFlowPerf_t>::iterator itMax = m_flowStatsDl.end ();
991  double metricMax = 0.0;
992  bool firstRnti = true;
993  for (it = m_flowStatsDl.begin (); it != m_flowStatsDl.end (); it++)
994  {
995  std::set <uint16_t>::iterator itRnti = rntiAllocated.find ((*it).first);
996  if ((itRnti != rntiAllocated.end ())||(!HarqProcessAvailability ((*it).first)))
997  {
998  // UE already allocated for HARQ or without HARQ process available -> drop it
999  if (itRnti != rntiAllocated.end ())
1000  {
1001  NS_LOG_DEBUG (this << " RNTI discared for HARQ tx" << (uint16_t)(*it).first);
1002  }
1003  if (!HarqProcessAvailability ((*it).first))
1004  {
1005  NS_LOG_DEBUG (this << " RNTI discared for HARQ id" << (uint16_t)(*it).first);
1006  }
1007  continue;
1008  }
1009  // check first the channel conditions for this UE, if CQI!=0
1010  std::map <uint16_t,SbMeasResult_s>::iterator itCqi;
1011  itCqi = m_a30CqiRxed.find ((*it).first);
1012  std::map <uint16_t,uint8_t>::iterator itTxMode;
1013  itTxMode = m_uesTxMode.find ((*it).first);
1014  if (itTxMode == m_uesTxMode.end ())
1015  {
1016  NS_FATAL_ERROR ("No Transmission Mode info on user " << (*it).first);
1017  }
1018  int nLayer = TransmissionModesLayers::TxMode2LayerNum ((*itTxMode).second);
1019 
1020  uint8_t cqiSum = 0;
1021  for (int k = 0; k < rbgNum; k++)
1022  {
1023  for (uint8_t j = 0; j < nLayer; j++)
1024  {
1025  if (itCqi == m_a30CqiRxed.end ())
1026  {
1027  cqiSum += 1; // no info on this user -> lowest MCS
1028  }
1029  else
1030  {
1031  cqiSum += (*itCqi).second.m_higherLayerSelected.at (k).m_sbCqi.at (j);
1032  }
1033  }
1034  }
1035 
1036  if (cqiSum == 0)
1037  {
1038  NS_LOG_INFO ("Skip this flow, CQI==0, rnti:" << (*it).first);
1039  continue;
1040  }
1041 
1042  if (LcActivePerFlow ((*it).first) == 0)
1043  {
1044  continue;
1045  }
1046 
1047  std::set <uint16_t>::iterator rnti;
1048  rnti = allocatedRnti.find ((*it).first);
1049  if (rnti != allocatedRnti.end ()) // already allocated RBGs to this UE
1050  {
1051  continue;
1052  }
1053 
1054  double metric = ( ( (double)(*it).second.counter ) / ( (double)(*it).second.tokenGenerationRate ) );
1055 
1056  if (firstRnti == true)
1057  {
1058  metricMax = metric;
1059  itMax = it;
1060  firstRnti = false;
1061  continue;
1062  }
1063  if (metric > metricMax)
1064  {
1065  metricMax = metric;
1066  itMax = it;
1067  }
1068  } // end for m_flowStatsDl
1069 
1070  if (itMax == m_flowStatsDl.end ())
1071  {
1072  // all UEs are allocated RBG or all UEs already allocated for HARQ or without HARQ process available
1073  break;
1074  }
1075 
1076  // mark this UE as "allocated"
1077  allocatedRnti.insert ((*itMax).first);
1078 
1079  // calculate the maximum number of byte that the scheduler can assigned to this UE
1080  uint32_t budget = 0;
1081  if ( bankSize > 0 )
1082  {
1083  budget = (*itMax).second.counter - (*itMax).second.debtLimit;
1084  if ( budget > (*itMax).second.burstCredit )
1085  {
1086  budget = (*itMax).second.burstCredit;
1087  }
1088  if ( budget > bankSize )
1089  {
1090  budget = bankSize;
1091  }
1092  }
1093  budget = budget + (*itMax).second.tokenPoolSize;
1094 
1095  // calculate how much bytes this UE actally need
1096  if (budget == 0)
1097  {
1098  // there are no tokens for this UE
1099  continue;
1100  }
1101  else
1102  {
1103  // calculate rlc buffer size
1104  uint32_t rlcBufSize = 0;
1105  uint8_t lcid = 0;
1106  std::map<LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator itRlcBuf;
1107  for (itRlcBuf = m_rlcBufferReq.begin (); itRlcBuf != m_rlcBufferReq.end (); itRlcBuf++)
1108  {
1109  if ( (*itRlcBuf).first.m_rnti == (*itMax).first )
1110  {
1111  lcid = (*itRlcBuf).first.m_lcId;
1112  }
1113  }
1114  LteFlowId_t flow ((*itMax).first, lcid);
1115  itRlcBuf = m_rlcBufferReq.find (flow);
1116  if (itRlcBuf != m_rlcBufferReq.end ())
1117  {
1118  rlcBufSize = (*itRlcBuf).second.m_rlcTransmissionQueueSize + (*itRlcBuf).second.m_rlcRetransmissionQueueSize + (*itRlcBuf).second.m_rlcStatusPduSize;
1119  }
1120  if (budget > rlcBufSize)
1121  {
1122  budget = rlcBufSize;
1123  NS_LOG_DEBUG ("budget > rlcBufSize. budget: " << budget << " RLC buffer size: " << rlcBufSize);
1124  }
1125  }
1126 
1127  // assign RBGs to this UE
1128  uint32_t bytesTxed = 0;
1129  uint32_t bytesTxedTmp = 0;
1130  int rbgIndex = 0;
1131  while ( bytesTxed <= budget )
1132  {
1133  totalRbg++;
1134 
1135  std::map <uint16_t,SbMeasResult_s>::iterator itCqi;
1136  itCqi = m_a30CqiRxed.find ((*itMax).first);
1137  std::map <uint16_t,uint8_t>::iterator itTxMode;
1138  itTxMode = m_uesTxMode.find ((*itMax).first);
1139  if (itTxMode == m_uesTxMode.end ())
1140  {
1141  NS_FATAL_ERROR ("No Transmission Mode info on user " << (*it).first);
1142  }
1143  int nLayer = TransmissionModesLayers::TxMode2LayerNum ((*itTxMode).second);
1144 
1145  // find RBG with largest achievableRate
1146  double achievableRateMax = 0.0;
1147  rbgIndex = rbgNum;
1148  for (int k = 0; k < rbgNum; k++)
1149  {
1150  std::set <uint8_t>::iterator rbg;
1151  rbg = allocatedRbg.find (k);
1152  if (rbg != allocatedRbg.end ()) // RBGs are already allocated to this UE
1153  {
1154  continue;
1155  }
1156 
1157  if ( rbgMap.at (k) == true) // this RBG is allocated in RACH procedure
1158  {
1159  continue;
1160  }
1161 
1162  if ((m_ffrSapProvider->IsDlRbgAvailableForUe (k, (*itMax).first)) == false)
1163  {
1164  continue;
1165  }
1166 
1167  std::vector <uint8_t> sbCqi;
1168  if (itCqi == m_a30CqiRxed.end ())
1169  {
1170  for (uint8_t k = 0; k < nLayer; k++)
1171  {
1172  sbCqi.push_back (1); // start with lowest value
1173  }
1174  }
1175  else
1176  {
1177  sbCqi = (*itCqi).second.m_higherLayerSelected.at (k).m_sbCqi;
1178  }
1179  uint8_t cqi1 = sbCqi.at (0);
1180  uint8_t cqi2 = 0;
1181  if (sbCqi.size () > 1)
1182  {
1183  cqi2 = sbCqi.at (1);
1184  }
1185 
1186  if ((cqi1 > 0)||(cqi2 > 0)) // CQI == 0 means "out of range" (see table 7.2.3-1 of 36.213)
1187  {
1188  if (LcActivePerFlow ((*itMax).first) > 0)
1189  {
1190  // this UE has data to transmit
1191  double achievableRate = 0.0;
1192  for (uint8_t j = 0; j < nLayer; j++)
1193  {
1194  uint8_t mcs = 0;
1195  if (sbCqi.size () > j)
1196  {
1197  mcs = m_amc->GetMcsFromCqi (sbCqi.at (j));
1198  }
1199  else
1200  {
1201  // no info on this subband -> worst MCS
1202  mcs = 0;
1203  }
1204  achievableRate += ((m_amc->GetDlTbSizeFromMcs (mcs, rbgSize) / 8) / 0.001); // = TB size / TTI
1205  }
1206 
1207  if ( achievableRate > achievableRateMax )
1208  {
1209  achievableRateMax = achievableRate;
1210  rbgIndex = k;
1211  }
1212  } // end of LcActivePerFlow
1213  } // end of cqi
1214  } // end of for rbgNum
1215 
1216  if ( rbgIndex == rbgNum) // impossible
1217  {
1218  // all RBGs are already assigned
1219  totalRbg = rbgNum;
1220  break;
1221  }
1222  else
1223  {
1224  // mark this UE as "allocated"
1225  allocatedRbg.insert (rbgIndex);
1226  }
1227 
1228  // assign this RBG to UE
1229  std::map <uint16_t, std::vector <uint16_t> >::iterator itMap;
1230  itMap = allocationMap.find ((*itMax).first);
1231  uint16_t RbgPerRnti;
1232  if (itMap == allocationMap.end ())
1233  {
1234  // insert new element
1235  std::vector <uint16_t> tempMap;
1236  tempMap.push_back (rbgIndex);
1237  allocationMap.insert (std::pair <uint16_t, std::vector <uint16_t> > ((*itMax).first, tempMap));
1238  itMap = allocationMap.find ((*itMax).first); // point itMap to the first RBGs assigned to this UE
1239  }
1240  else
1241  {
1242  (*itMap).second.push_back (rbgIndex);
1243  }
1244  rbgMap.at (rbgIndex) = true; // Mark this RBG as allocated
1245 
1246  RbgPerRnti = (*itMap).second.size ();
1247 
1248  // calculate tb size
1249  std::vector <uint8_t> worstCqi (2, 15);
1250  if (itCqi != m_a30CqiRxed.end ())
1251  {
1252  for (uint16_t k = 0; k < (*itMap).second.size (); k++)
1253  {
1254  if ((*itCqi).second.m_higherLayerSelected.size () > (*itMap).second.at (k))
1255  {
1256  for (uint8_t j = 0; j < nLayer; j++)
1257  {
1258  if ((*itCqi).second.m_higherLayerSelected.at ((*itMap).second.at (k)).m_sbCqi.size () > j)
1259  {
1260  if (((*itCqi).second.m_higherLayerSelected.at ((*itMap).second.at (k)).m_sbCqi.at (j)) < worstCqi.at (j))
1261  {
1262  worstCqi.at (j) = ((*itCqi).second.m_higherLayerSelected.at ((*itMap).second.at (k)).m_sbCqi.at (j));
1263  }
1264  }
1265  else
1266  {
1267  // no CQI for this layer of this suband -> worst one
1268  worstCqi.at (j) = 1;
1269  }
1270  }
1271  }
1272  else
1273  {
1274  for (uint8_t j = 0; j < nLayer; j++)
1275  {
1276  worstCqi.at (j) = 1; // try with lowest MCS in RBG with no info on channel
1277  }
1278  }
1279  }
1280  }
1281  else
1282  {
1283  for (uint8_t j = 0; j < nLayer; j++)
1284  {
1285  worstCqi.at (j) = 1; // try with lowest MCS in RBG with no info on channel
1286  }
1287  }
1288 
1289  bytesTxedTmp = bytesTxed;
1290  bytesTxed = 0;
1291  for (uint8_t j = 0; j < nLayer; j++)
1292  {
1293  int tbSize = (m_amc->GetDlTbSizeFromMcs (m_amc->GetMcsFromCqi (worstCqi.at (j)), RbgPerRnti * rbgSize) / 8); // (size of TB in bytes according to table 7.1.7.2.1-1 of 36.213)
1294  bytesTxed += tbSize;
1295  }
1296 
1297  } // end of while()
1298 
1299  // remove and unmark last RBG assigned to UE
1300  if ( bytesTxed > budget )
1301  {
1302  NS_LOG_DEBUG ("budget: " << budget << " bytesTxed: " << bytesTxed << " at " << Simulator::Now ().As (Time::MS));
1303  std::map <uint16_t, std::vector <uint16_t> >::iterator itMap;
1304  itMap = allocationMap.find ((*itMax).first);
1305  (*itMap).second.pop_back ();
1306  allocatedRbg.erase (rbgIndex);
1307  bytesTxed = bytesTxedTmp; // recovery bytesTxed
1308  totalRbg--;
1309  rbgMap.at (rbgIndex) = false; // unmark this RBG
1310  //If all the RBGs are removed from the allocation
1311  //of this RNTI, we remove the UE from the allocation map
1312  if ((*itMap).second.size () == 0)
1313  {
1314  itMap = allocationMap.erase (itMap);
1315  }
1316  }
1317 
1318  //only update the UE stats if it exists in the allocation map
1319  if (allocationMap.find ((*itMax).first) != allocationMap.end ())
1320  {
1321  // update UE stats
1322  if ( bytesTxed <= (*itMax).second.tokenPoolSize )
1323  {
1324  (*itMax).second.tokenPoolSize -= bytesTxed;
1325  }
1326  else
1327  {
1328  (*itMax).second.counter = (*itMax).second.counter - ( bytesTxed - (*itMax).second.tokenPoolSize );
1329  (*itMax).second.tokenPoolSize = 0;
1330  if (bankSize <= ( bytesTxed - (*itMax).second.tokenPoolSize ))
1331  {
1332  bankSize = 0;
1333  }
1334  else
1335  {
1336  bankSize = bankSize - ( bytesTxed - (*itMax).second.tokenPoolSize );
1337  }
1338  }
1339  }
1340  } // end of RBGs
1341 
1342  // generate the transmission opportunities by grouping the RBGs of the same RNTI and
1343  // creating the correspondent DCIs
1344  std::map <uint16_t, std::vector <uint16_t> >::iterator itMap = allocationMap.begin ();
1345  while (itMap != allocationMap.end ())
1346  {
1347  NS_LOG_DEBUG ("Preparing DCI for RNTI " << (*itMap).first);
1348  // create new BuildDataListElement_s for this LC
1349  BuildDataListElement_s newEl;
1350  newEl.m_rnti = (*itMap).first;
1351  // create the DlDciListElement_s
1352  DlDciListElement_s newDci;
1353  newDci.m_rnti = (*itMap).first;
1354  newDci.m_harqProcess = UpdateHarqProcessId ((*itMap).first);
1355 
1356  uint16_t lcActives = LcActivePerFlow ((*itMap).first);
1357  NS_LOG_INFO (this << "Allocate user " << newEl.m_rnti << " rbg " << lcActives);
1358  if (lcActives == 0)
1359  {
1360  // Set to max value, to avoid divide by 0 below
1361  lcActives = (uint16_t)65535; // UINT16_MAX;
1362  }
1363  uint16_t RgbPerRnti = (*itMap).second.size ();
1364  std::map <uint16_t,SbMeasResult_s>::iterator itCqi;
1365  itCqi = m_a30CqiRxed.find ((*itMap).first);
1366  std::map <uint16_t,uint8_t>::iterator itTxMode;
1367  itTxMode = m_uesTxMode.find ((*itMap).first);
1368  if (itTxMode == m_uesTxMode.end ())
1369  {
1370  NS_FATAL_ERROR ("No Transmission Mode info on user " << (*itMap).first);
1371  }
1372  int nLayer = TransmissionModesLayers::TxMode2LayerNum ((*itTxMode).second);
1373  std::vector <uint8_t> worstCqi (2, 15);
1374  if (itCqi != m_a30CqiRxed.end ())
1375  {
1376  for (uint16_t k = 0; k < (*itMap).second.size (); k++)
1377  {
1378  if ((*itCqi).second.m_higherLayerSelected.size () > (*itMap).second.at (k))
1379  {
1380  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)) );
1381  for (uint8_t j = 0; j < nLayer; j++)
1382  {
1383  if ((*itCqi).second.m_higherLayerSelected.at ((*itMap).second.at (k)).m_sbCqi.size () > j)
1384  {
1385  if (((*itCqi).second.m_higherLayerSelected.at ((*itMap).second.at (k)).m_sbCqi.at (j)) < worstCqi.at (j))
1386  {
1387  worstCqi.at (j) = ((*itCqi).second.m_higherLayerSelected.at ((*itMap).second.at (k)).m_sbCqi.at (j));
1388  }
1389  }
1390  else
1391  {
1392  // no CQI for this layer of this suband -> worst one
1393  worstCqi.at (j) = 1;
1394  }
1395  }
1396  }
1397  else
1398  {
1399  for (uint8_t j = 0; j < nLayer; j++)
1400  {
1401  worstCqi.at (j) = 1; // try with lowest MCS in RBG with no info on channel
1402  }
1403  }
1404  }
1405  }
1406  else
1407  {
1408  for (uint8_t j = 0; j < nLayer; j++)
1409  {
1410  worstCqi.at (j) = 1; // try with lowest MCS in RBG with no info on channel
1411  }
1412  }
1413  for (uint8_t j = 0; j < nLayer; j++)
1414  {
1415  NS_LOG_INFO (this << " Layer " << (uint16_t)j << " CQI selected " << (uint16_t)worstCqi.at (j));
1416  }
1417  for (uint8_t j = 0; j < nLayer; j++)
1418  {
1419  newDci.m_mcs.push_back (m_amc->GetMcsFromCqi (worstCqi.at (j)));
1420  int tbSize = (m_amc->GetDlTbSizeFromMcs (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)
1421  newDci.m_tbsSize.push_back (tbSize);
1422  NS_LOG_INFO (this << " Layer " << (uint16_t)j << " MCS selected" << (uint16_t) m_amc->GetMcsFromCqi (worstCqi.at (j)));
1423  }
1424 
1425  newDci.m_resAlloc = 0; // only allocation type 0 at this stage
1426  newDci.m_rbBitmap = 0; // TBD (32 bit bitmap see 7.1.6 of 36.213)
1427  uint32_t rbgMask = 0;
1428  for (uint16_t k = 0; k < (*itMap).second.size (); k++)
1429  {
1430  rbgMask = rbgMask + (0x1 << (*itMap).second.at (k));
1431  NS_LOG_INFO (this << " Allocated RBG " << (*itMap).second.at (k));
1432  }
1433  newDci.m_rbBitmap = rbgMask; // (32 bit bitmap see 7.1.6 of 36.213)
1434 
1435  // create the rlc PDUs -> equally divide resources among actives LCs
1436  std::map <LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator itBufReq;
1437  for (itBufReq = m_rlcBufferReq.begin (); itBufReq != m_rlcBufferReq.end (); itBufReq++)
1438  {
1439  if (((*itBufReq).first.m_rnti == (*itMap).first)
1440  && (((*itBufReq).second.m_rlcTransmissionQueueSize > 0)
1441  || ((*itBufReq).second.m_rlcRetransmissionQueueSize > 0)
1442  || ((*itBufReq).second.m_rlcStatusPduSize > 0) ))
1443  {
1444  std::vector <struct RlcPduListElement_s> newRlcPduLe;
1445  for (uint8_t j = 0; j < nLayer; j++)
1446  {
1447  RlcPduListElement_s newRlcEl;
1448  newRlcEl.m_logicalChannelIdentity = (*itBufReq).first.m_lcId;
1449  newRlcEl.m_size = newDci.m_tbsSize.at (j) / lcActives;
1450  NS_LOG_INFO (this << " LCID " << (uint32_t) newRlcEl.m_logicalChannelIdentity << " size " << newRlcEl.m_size << " layer " << (uint16_t)j);
1451  newRlcPduLe.push_back (newRlcEl);
1452  UpdateDlRlcBufferInfo (newDci.m_rnti, newRlcEl.m_logicalChannelIdentity, newRlcEl.m_size);
1453  if (m_harqOn == true)
1454  {
1455  // store RLC PDU list for HARQ
1456  std::map <uint16_t, DlHarqRlcPduListBuffer_t>::iterator itRlcPdu = m_dlHarqProcessesRlcPduListBuffer.find ((*itMap).first);
1457  if (itRlcPdu == m_dlHarqProcessesRlcPduListBuffer.end ())
1458  {
1459  NS_FATAL_ERROR ("Unable to find RlcPdcList in HARQ buffer for RNTI " << (*itMap).first);
1460  }
1461  (*itRlcPdu).second.at (j).at (newDci.m_harqProcess).push_back (newRlcEl);
1462  }
1463  }
1464  newEl.m_rlcPduList.push_back (newRlcPduLe);
1465  }
1466  if ((*itBufReq).first.m_rnti > (*itMap).first)
1467  {
1468  break;
1469  }
1470  }
1471  for (uint8_t j = 0; j < nLayer; j++)
1472  {
1473  newDci.m_ndi.push_back (1);
1474  newDci.m_rv.push_back (0);
1475  }
1476 
1477  newDci.m_tpc = m_ffrSapProvider->GetTpc ((*itMap).first);
1478 
1479  newEl.m_dci = newDci;
1480 
1481  if (m_harqOn == true)
1482  {
1483  // store DCI for HARQ
1484  std::map <uint16_t, DlHarqProcessesDciBuffer_t>::iterator itDci = m_dlHarqProcessesDciBuffer.find (newEl.m_rnti);
1485  if (itDci == m_dlHarqProcessesDciBuffer.end ())
1486  {
1487  NS_FATAL_ERROR ("Unable to find RNTI entry in DCI HARQ buffer for RNTI " << newEl.m_rnti);
1488  }
1489  (*itDci).second.at (newDci.m_harqProcess) = newDci;
1490  // refresh timer
1491  std::map <uint16_t, DlHarqProcessesTimer_t>::iterator itHarqTimer = m_dlHarqProcessesTimer.find (newEl.m_rnti);
1492  if (itHarqTimer == m_dlHarqProcessesTimer.end ())
1493  {
1494  NS_FATAL_ERROR ("Unable to find HARQ timer for RNTI " << (uint16_t)newEl.m_rnti);
1495  }
1496  (*itHarqTimer).second.at (newDci.m_harqProcess) = 0;
1497  }
1498 
1499  // ...more parameters -> ignored in this version
1500 
1501  ret.m_buildDataList.push_back (newEl);
1502 
1503  itMap++;
1504  } // end while allocation
1505  ret.m_nrOfPdcchOfdmSymbols = 1;
1506 
1508 
1509 
1510  return;
1511 }
1512 
1513 void
1515 {
1516  NS_LOG_FUNCTION (this);
1517 
1518  m_rachList = params.m_rachList;
1519 
1520  return;
1521 }
1522 
1523 void
1525 {
1526  NS_LOG_FUNCTION (this);
1528 
1529  for (unsigned int i = 0; i < params.m_cqiList.size (); i++)
1530  {
1531  if ( params.m_cqiList.at (i).m_cqiType == CqiListElement_s::P10 )
1532  {
1533  NS_LOG_LOGIC ("wideband CQI " << (uint32_t) params.m_cqiList.at (i).m_wbCqi.at (0) << " reported");
1534  std::map <uint16_t,uint8_t>::iterator it;
1535  uint16_t rnti = params.m_cqiList.at (i).m_rnti;
1536  it = m_p10CqiRxed.find (rnti);
1537  if (it == m_p10CqiRxed.end ())
1538  {
1539  // create the new entry
1540  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)
1541  // generate correspondent timer
1542  m_p10CqiTimers.insert ( std::pair<uint16_t, uint32_t > (rnti, m_cqiTimersThreshold));
1543  }
1544  else
1545  {
1546  // update the CQI value and refresh correspondent timer
1547  (*it).second = params.m_cqiList.at (i).m_wbCqi.at (0);
1548  // update correspondent timer
1549  std::map <uint16_t,uint32_t>::iterator itTimers;
1550  itTimers = m_p10CqiTimers.find (rnti);
1551  (*itTimers).second = m_cqiTimersThreshold;
1552  }
1553  }
1554  else if ( params.m_cqiList.at (i).m_cqiType == CqiListElement_s::A30 )
1555  {
1556  // subband CQI reporting high layer configured
1557  std::map <uint16_t,SbMeasResult_s>::iterator it;
1558  uint16_t rnti = params.m_cqiList.at (i).m_rnti;
1559  it = m_a30CqiRxed.find (rnti);
1560  if (it == m_a30CqiRxed.end ())
1561  {
1562  // create the new entry
1563  m_a30CqiRxed.insert ( std::pair<uint16_t, SbMeasResult_s > (rnti, params.m_cqiList.at (i).m_sbMeasResult) );
1564  m_a30CqiTimers.insert ( std::pair<uint16_t, uint32_t > (rnti, m_cqiTimersThreshold));
1565  }
1566  else
1567  {
1568  // update the CQI value and refresh correspondent timer
1569  (*it).second = params.m_cqiList.at (i).m_sbMeasResult;
1570  std::map <uint16_t,uint32_t>::iterator itTimers;
1571  itTimers = m_a30CqiTimers.find (rnti);
1572  (*itTimers).second = m_cqiTimersThreshold;
1573  }
1574  }
1575  else
1576  {
1577  NS_LOG_ERROR (this << " CQI type unknown");
1578  }
1579  }
1580 
1581  return;
1582 }
1583 
1584 
1585 double
1586 FdTbfqFfMacScheduler::EstimateUlSinr (uint16_t rnti, uint16_t rb)
1587 {
1588  std::map <uint16_t, std::vector <double> >::iterator itCqi = m_ueCqi.find (rnti);
1589  if (itCqi == m_ueCqi.end ())
1590  {
1591  // no cqi info about this UE
1592  return (NO_SINR);
1593 
1594  }
1595  else
1596  {
1597  // take the average SINR value among the available
1598  double sinrSum = 0;
1599  unsigned int sinrNum = 0;
1600  for (uint32_t i = 0; i < m_cschedCellConfig.m_ulBandwidth; i++)
1601  {
1602  double sinr = (*itCqi).second.at (i);
1603  if (sinr != NO_SINR)
1604  {
1605  sinrSum += sinr;
1606  sinrNum++;
1607  }
1608  }
1609  double estimatedSinr = (sinrNum > 0) ? (sinrSum / sinrNum) : DBL_MAX;
1610  // store the value
1611  (*itCqi).second.at (rb) = estimatedSinr;
1612  return (estimatedSinr);
1613  }
1614 }
1615 
1616 void
1618 {
1619  NS_LOG_FUNCTION (this << " UL - Frame no. " << (params.m_sfnSf >> 4) << " subframe no. " << (0xF & params.m_sfnSf) << " size " << params.m_ulInfoList.size ());
1620 
1621  RefreshUlCqiMaps ();
1623 
1624  // Generate RBs map
1626  std::vector <bool> rbMap;
1627  uint16_t rbAllocatedNum = 0;
1628  std::set <uint16_t> rntiAllocated;
1629  std::vector <uint16_t> rbgAllocationMap;
1630  // update with RACH allocation map
1631  rbgAllocationMap = m_rachAllocationMap;
1632  //rbgAllocationMap.resize (m_cschedCellConfig.m_ulBandwidth, 0);
1633  m_rachAllocationMap.clear ();
1635 
1636  rbMap.resize (m_cschedCellConfig.m_ulBandwidth, false);
1637 
1638  rbMap = m_ffrSapProvider->GetAvailableUlRbg ();
1639 
1640  for (std::vector<bool>::iterator it = rbMap.begin (); it != rbMap.end (); it++)
1641  {
1642  if ((*it) == true )
1643  {
1644  rbAllocatedNum++;
1645  }
1646  }
1647 
1648  uint8_t minContinuousUlBandwidth = m_ffrSapProvider->GetMinContinuousUlBandwidth ();
1649  uint8_t ffrUlBandwidth = m_cschedCellConfig.m_ulBandwidth - rbAllocatedNum;
1650 
1651  // remove RACH allocation
1652  for (uint16_t i = 0; i < m_cschedCellConfig.m_ulBandwidth; i++)
1653  {
1654  if (rbgAllocationMap.at (i) != 0)
1655  {
1656  rbMap.at (i) = true;
1657  NS_LOG_DEBUG (this << " Allocated for RACH " << i);
1658  }
1659  }
1660 
1661 
1662  if (m_harqOn == true)
1663  {
1664  // Process UL HARQ feedback
1665  for (uint16_t i = 0; i < params.m_ulInfoList.size (); i++)
1666  {
1667  if (params.m_ulInfoList.at (i).m_receptionStatus == UlInfoListElement_s::NotOk)
1668  {
1669  // retx correspondent block: retrieve the UL-DCI
1670  uint16_t rnti = params.m_ulInfoList.at (i).m_rnti;
1671  std::map <uint16_t, uint8_t>::iterator itProcId = m_ulHarqCurrentProcessId.find (rnti);
1672  if (itProcId == m_ulHarqCurrentProcessId.end ())
1673  {
1674  NS_LOG_ERROR ("No info find in HARQ buffer for UE (might change eNB) " << rnti);
1675  }
1676  uint8_t harqId = (uint8_t)((*itProcId).second - HARQ_PERIOD) % HARQ_PROC_NUM;
1677  NS_LOG_INFO (this << " UL-HARQ retx RNTI " << rnti << " harqId " << (uint16_t)harqId << " i " << i << " size " << params.m_ulInfoList.size ());
1678  std::map <uint16_t, UlHarqProcessesDciBuffer_t>::iterator itHarq = m_ulHarqProcessesDciBuffer.find (rnti);
1679  if (itHarq == m_ulHarqProcessesDciBuffer.end ())
1680  {
1681  NS_LOG_ERROR ("No info find in HARQ buffer for UE (might change eNB) " << rnti);
1682  continue;
1683  }
1684  UlDciListElement_s dci = (*itHarq).second.at (harqId);
1685  std::map <uint16_t, UlHarqProcessesStatus_t>::iterator itStat = m_ulHarqProcessesStatus.find (rnti);
1686  if (itStat == m_ulHarqProcessesStatus.end ())
1687  {
1688  NS_LOG_ERROR ("No info find in HARQ buffer for UE (might change eNB) " << rnti);
1689  }
1690  if ((*itStat).second.at (harqId) >= 3)
1691  {
1692  NS_LOG_INFO ("Max number of retransmissions reached (UL)-> drop process");
1693  continue;
1694  }
1695  bool free = true;
1696  for (int j = dci.m_rbStart; j < dci.m_rbStart + dci.m_rbLen; j++)
1697  {
1698  if (rbMap.at (j) == true)
1699  {
1700  free = false;
1701  NS_LOG_INFO (this << " BUSY " << j);
1702  }
1703  }
1704  if (free)
1705  {
1706  // retx on the same RBs
1707  for (int j = dci.m_rbStart; j < dci.m_rbStart + dci.m_rbLen; j++)
1708  {
1709  rbMap.at (j) = true;
1710  rbgAllocationMap.at (j) = dci.m_rnti;
1711  NS_LOG_INFO ("\tRB " << j);
1712  rbAllocatedNum++;
1713  }
1714  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);
1715  }
1716  else
1717  {
1718  NS_LOG_INFO ("Cannot allocate retx due to RACH allocations for UE " << rnti);
1719  continue;
1720  }
1721  dci.m_ndi = 0;
1722  // Update HARQ buffers with new HarqId
1723  (*itStat).second.at ((*itProcId).second) = (*itStat).second.at (harqId) + 1;
1724  (*itStat).second.at (harqId) = 0;
1725  (*itHarq).second.at ((*itProcId).second) = dci;
1726  ret.m_dciList.push_back (dci);
1727  rntiAllocated.insert (dci.m_rnti);
1728  }
1729  else
1730  {
1731  NS_LOG_INFO (this << " HARQ-ACK feedback from RNTI " << params.m_ulInfoList.at (i).m_rnti);
1732  }
1733  }
1734  }
1735 
1736  std::map <uint16_t,uint32_t>::iterator it;
1737  int nflows = 0;
1738 
1739  for (it = m_ceBsrRxed.begin (); it != m_ceBsrRxed.end (); it++)
1740  {
1741  std::set <uint16_t>::iterator itRnti = rntiAllocated.find ((*it).first);
1742  // select UEs with queues not empty and not yet allocated for HARQ
1743  if (((*it).second > 0)&&(itRnti == rntiAllocated.end ()))
1744  {
1745  nflows++;
1746  }
1747  }
1748 
1749  if (nflows == 0)
1750  {
1751  if (ret.m_dciList.size () > 0)
1752  {
1753  m_allocationMaps.insert (std::pair <uint16_t, std::vector <uint16_t> > (params.m_sfnSf, rbgAllocationMap));
1755  }
1756 
1757  return; // no flows to be scheduled
1758  }
1759 
1760 
1761  // Divide the remaining resources equally among the active users starting from the subsequent one served last scheduling trigger
1762  uint16_t tempRbPerFlow = (ffrUlBandwidth) / (nflows + rntiAllocated.size ());
1763  uint16_t rbPerFlow = (minContinuousUlBandwidth < tempRbPerFlow) ? minContinuousUlBandwidth : tempRbPerFlow;
1764 
1765  if (rbPerFlow < 3)
1766  {
1767  rbPerFlow = 3; // at least 3 rbg per flow (till available resource) to ensure TxOpportunity >= 7 bytes
1768  }
1769  int rbAllocated = 0;
1770 
1771  std::map <uint16_t, fdtbfqsFlowPerf_t>::iterator itStats;
1772  if (m_nextRntiUl != 0)
1773  {
1774  for (it = m_ceBsrRxed.begin (); it != m_ceBsrRxed.end (); it++)
1775  {
1776  if ((*it).first == m_nextRntiUl)
1777  {
1778  break;
1779  }
1780  }
1781  if (it == m_ceBsrRxed.end ())
1782  {
1783  NS_LOG_ERROR (this << " no user found");
1784  }
1785  }
1786  else
1787  {
1788  it = m_ceBsrRxed.begin ();
1789  m_nextRntiUl = (*it).first;
1790  }
1791  do
1792  {
1793  std::set <uint16_t>::iterator itRnti = rntiAllocated.find ((*it).first);
1794  if ((itRnti != rntiAllocated.end ())||((*it).second == 0))
1795  {
1796  // UE already allocated for UL-HARQ -> skip it
1797  NS_LOG_DEBUG (this << " UE already allocated in HARQ -> discared, RNTI " << (*it).first);
1798  it++;
1799  if (it == m_ceBsrRxed.end ())
1800  {
1801  // restart from the first
1802  it = m_ceBsrRxed.begin ();
1803  }
1804  continue;
1805  }
1806  if (rbAllocated + rbPerFlow - 1 > m_cschedCellConfig.m_ulBandwidth)
1807  {
1808  // limit to physical resources last resource assignment
1809  rbPerFlow = m_cschedCellConfig.m_ulBandwidth - rbAllocated;
1810  // at least 3 rbg per flow to ensure TxOpportunity >= 7 bytes
1811  if (rbPerFlow < 3)
1812  {
1813  // terminate allocation
1814  rbPerFlow = 0;
1815  }
1816  }
1817 
1818  rbAllocated = 0;
1819  UlDciListElement_s uldci;
1820  uldci.m_rnti = (*it).first;
1821  uldci.m_rbLen = rbPerFlow;
1822  bool allocated = false;
1823  NS_LOG_INFO (this << " RB Allocated " << rbAllocated << " rbPerFlow " << rbPerFlow << " flows " << nflows);
1824  while ((!allocated)&&((rbAllocated + rbPerFlow - m_cschedCellConfig.m_ulBandwidth) < 1) && (rbPerFlow != 0))
1825  {
1826  // check availability
1827  bool free = true;
1828  for (uint16_t j = rbAllocated; j < rbAllocated + rbPerFlow; j++)
1829  {
1830  if (rbMap.at (j) == true)
1831  {
1832  free = false;
1833  break;
1834  }
1835  if ((m_ffrSapProvider->IsUlRbgAvailableForUe (j, (*it).first)) == false)
1836  {
1837  free = false;
1838  break;
1839  }
1840  }
1841  if (free)
1842  {
1843  NS_LOG_INFO (this << "RNTI: " << (*it).first << " RB Allocated " << rbAllocated << " rbPerFlow " << rbPerFlow << " flows " << nflows);
1844  uldci.m_rbStart = rbAllocated;
1845 
1846  for (uint16_t j = rbAllocated; j < rbAllocated + rbPerFlow; j++)
1847  {
1848  rbMap.at (j) = true;
1849  // store info on allocation for managing ul-cqi interpretation
1850  rbgAllocationMap.at (j) = (*it).first;
1851  }
1852  rbAllocated += rbPerFlow;
1853  allocated = true;
1854  break;
1855  }
1856  rbAllocated++;
1857  if (rbAllocated + rbPerFlow - 1 > m_cschedCellConfig.m_ulBandwidth)
1858  {
1859  // limit to physical resources last resource assignment
1860  rbPerFlow = m_cschedCellConfig.m_ulBandwidth - rbAllocated;
1861  // at least 3 rbg per flow to ensure TxOpportunity >= 7 bytes
1862  if (rbPerFlow < 3)
1863  {
1864  // terminate allocation
1865  rbPerFlow = 0;
1866  }
1867  }
1868  }
1869  if (!allocated)
1870  {
1871  // unable to allocate new resource: finish scheduling
1872 // m_nextRntiUl = (*it).first;
1873 // if (ret.m_dciList.size () > 0)
1874 // {
1875 // m_schedSapUser->SchedUlConfigInd (ret);
1876 // }
1877 // m_allocationMaps.insert (std::pair <uint16_t, std::vector <uint16_t> > (params.m_sfnSf, rbgAllocationMap));
1878 // return;
1879  break;
1880  }
1881 
1882 
1883 
1884  std::map <uint16_t, std::vector <double> >::iterator itCqi = m_ueCqi.find ((*it).first);
1885  int cqi = 0;
1886  if (itCqi == m_ueCqi.end ())
1887  {
1888  // no cqi info about this UE
1889  uldci.m_mcs = 0; // MCS 0 -> UL-AMC TBD
1890  }
1891  else
1892  {
1893  // take the lowest CQI value (worst RB)
1894  NS_ABORT_MSG_IF ((*itCqi).second.size () == 0, "CQI of RNTI = " << (*it).first << " has expired");
1895  double minSinr = (*itCqi).second.at (uldci.m_rbStart);
1896  if (minSinr == NO_SINR)
1897  {
1898  minSinr = EstimateUlSinr ((*it).first, uldci.m_rbStart);
1899  }
1900  for (uint16_t i = uldci.m_rbStart; i < uldci.m_rbStart + uldci.m_rbLen; i++)
1901  {
1902  double sinr = (*itCqi).second.at (i);
1903  if (sinr == NO_SINR)
1904  {
1905  sinr = EstimateUlSinr ((*it).first, i);
1906  }
1907  if (sinr < minSinr)
1908  {
1909  minSinr = sinr;
1910  }
1911  }
1912 
1913  // translate SINR -> cqi: WILD ACK: same as DL
1914  double s = log2 ( 1 + (
1915  std::pow (10, minSinr / 10 ) /
1916  ( (-std::log (5.0 * 0.00005 )) / 1.5) ));
1917  cqi = m_amc->GetCqiFromSpectralEfficiency (s);
1918  if (cqi == 0)
1919  {
1920  it++;
1921  if (it == m_ceBsrRxed.end ())
1922  {
1923  // restart from the first
1924  it = m_ceBsrRxed.begin ();
1925  }
1926  NS_LOG_DEBUG (this << " UE discarded for CQI = 0, RNTI " << uldci.m_rnti);
1927  // remove UE from allocation map
1928  for (uint16_t i = uldci.m_rbStart; i < uldci.m_rbStart + uldci.m_rbLen; i++)
1929  {
1930  rbgAllocationMap.at (i) = 0;
1931  }
1932  continue; // CQI == 0 means "out of range" (see table 7.2.3-1 of 36.213)
1933  }
1934  uldci.m_mcs = m_amc->GetMcsFromCqi (cqi);
1935  }
1936 
1937  uldci.m_tbSize = (m_amc->GetUlTbSizeFromMcs (uldci.m_mcs, rbPerFlow) / 8);
1938  UpdateUlRlcBufferInfo (uldci.m_rnti, uldci.m_tbSize);
1939  uldci.m_ndi = 1;
1940  uldci.m_cceIndex = 0;
1941  uldci.m_aggrLevel = 1;
1942  uldci.m_ueTxAntennaSelection = 3; // antenna selection OFF
1943  uldci.m_hopping = false;
1944  uldci.m_n2Dmrs = 0;
1945  uldci.m_tpc = 0; // no power control
1946  uldci.m_cqiRequest = false; // only period CQI at this stage
1947  uldci.m_ulIndex = 0; // TDD parameter
1948  uldci.m_dai = 1; // TDD parameter
1949  uldci.m_freqHopping = 0;
1950  uldci.m_pdcchPowerOffset = 0; // not used
1951  ret.m_dciList.push_back (uldci);
1952  // store DCI for HARQ_PERIOD
1953  uint8_t harqId = 0;
1954  if (m_harqOn == true)
1955  {
1956  std::map <uint16_t, uint8_t>::iterator itProcId;
1957  itProcId = m_ulHarqCurrentProcessId.find (uldci.m_rnti);
1958  if (itProcId == m_ulHarqCurrentProcessId.end ())
1959  {
1960  NS_FATAL_ERROR ("No info find in HARQ buffer for UE " << uldci.m_rnti);
1961  }
1962  harqId = (*itProcId).second;
1963  std::map <uint16_t, UlHarqProcessesDciBuffer_t>::iterator itDci = m_ulHarqProcessesDciBuffer.find (uldci.m_rnti);
1964  if (itDci == m_ulHarqProcessesDciBuffer.end ())
1965  {
1966  NS_FATAL_ERROR ("Unable to find RNTI entry in UL DCI HARQ buffer for RNTI " << uldci.m_rnti);
1967  }
1968  (*itDci).second.at (harqId) = uldci;
1969  // Update HARQ process status (RV 0)
1970  std::map <uint16_t, UlHarqProcessesStatus_t>::iterator itStat = m_ulHarqProcessesStatus.find (uldci.m_rnti);
1971  if (itStat == m_ulHarqProcessesStatus.end ())
1972  {
1973  NS_LOG_ERROR ("No info find in HARQ buffer for UE (might change eNB) " << uldci.m_rnti);
1974  }
1975  (*itStat).second.at (harqId) = 0;
1976  }
1977 
1978  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);
1979 
1980  it++;
1981  if (it == m_ceBsrRxed.end ())
1982  {
1983  // restart from the first
1984  it = m_ceBsrRxed.begin ();
1985  }
1986  if ((rbAllocated == m_cschedCellConfig.m_ulBandwidth) || (rbPerFlow == 0))
1987  {
1988  // Stop allocation: no more PRBs
1989  m_nextRntiUl = (*it).first;
1990  break;
1991  }
1992  }
1993  while (((*it).first != m_nextRntiUl)&&(rbPerFlow != 0));
1994 
1995 
1996  m_allocationMaps.insert (std::pair <uint16_t, std::vector <uint16_t> > (params.m_sfnSf, rbgAllocationMap));
1998 
1999  return;
2000 }
2001 
2002 void
2004 {
2005  NS_LOG_FUNCTION (this);
2006  return;
2007 }
2008 
2009 void
2011 {
2012  NS_LOG_FUNCTION (this);
2013  return;
2014 }
2015 
2016 void
2018 {
2019  NS_LOG_FUNCTION (this);
2020 
2021  std::map <uint16_t,uint32_t>::iterator it;
2022 
2023  for (unsigned int i = 0; i < params.m_macCeList.size (); i++)
2024  {
2025  if ( params.m_macCeList.at (i).m_macCeType == MacCeListElement_s::BSR )
2026  {
2027  // buffer status report
2028  // note that this scheduler does not differentiate the
2029  // allocation according to which LCGs have more/less bytes
2030  // to send.
2031  // Hence the BSR of different LCGs are just summed up to get
2032  // a total queue size that is used for allocation purposes.
2033 
2034  uint32_t buffer = 0;
2035  for (uint8_t lcg = 0; lcg < 4; ++lcg)
2036  {
2037  uint8_t bsrId = params.m_macCeList.at (i).m_macCeValue.m_bufferStatus.at (lcg);
2038  buffer += BufferSizeLevelBsr::BsrId2BufferSize (bsrId);
2039  }
2040 
2041  uint16_t rnti = params.m_macCeList.at (i).m_rnti;
2042  NS_LOG_LOGIC (this << "RNTI=" << rnti << " buffer=" << buffer);
2043  it = m_ceBsrRxed.find (rnti);
2044  if (it == m_ceBsrRxed.end ())
2045  {
2046  // create the new entry
2047  m_ceBsrRxed.insert ( std::pair<uint16_t, uint32_t > (rnti, buffer));
2048  }
2049  else
2050  {
2051  // update the buffer size value
2052  (*it).second = buffer;
2053  }
2054  }
2055  }
2056 
2057  return;
2058 }
2059 
2060 void
2062 {
2063  NS_LOG_FUNCTION (this);
2064 // retrieve the allocation for this subframe
2065  switch (m_ulCqiFilter)
2066  {
2068  {
2069  // filter all the CQIs that are not SRS based
2070  if (params.m_ulCqi.m_type != UlCqi_s::SRS)
2071  {
2072  return;
2073  }
2074  }
2075  break;
2077  {
2078  // filter all the CQIs that are not SRS based
2079  if (params.m_ulCqi.m_type != UlCqi_s::PUSCH)
2080  {
2081  return;
2082  }
2083  }
2084  break;
2085  default:
2086  NS_FATAL_ERROR ("Unknown UL CQI type");
2087  }
2088 
2089  switch (params.m_ulCqi.m_type)
2090  {
2091  case UlCqi_s::PUSCH:
2092  {
2093  std::map <uint16_t, std::vector <uint16_t> >::iterator itMap;
2094  std::map <uint16_t, std::vector <double> >::iterator itCqi;
2095  NS_LOG_DEBUG (this << " Collect PUSCH CQIs of Frame no. " << (params.m_sfnSf >> 4) << " subframe no. " << (0xF & params.m_sfnSf));
2096  itMap = m_allocationMaps.find (params.m_sfnSf);
2097  if (itMap == m_allocationMaps.end ())
2098  {
2099  return;
2100  }
2101  for (uint32_t i = 0; i < (*itMap).second.size (); i++)
2102  {
2103  // convert from fixed point notation Sxxxxxxxxxxx.xxx to double
2104  double sinr = LteFfConverter::fpS11dot3toDouble (params.m_ulCqi.m_sinr.at (i));
2105  itCqi = m_ueCqi.find ((*itMap).second.at (i));
2106  if (itCqi == m_ueCqi.end ())
2107  {
2108  // create a new entry
2109  std::vector <double> newCqi;
2110  for (uint32_t j = 0; j < m_cschedCellConfig.m_ulBandwidth; j++)
2111  {
2112  if (i == j)
2113  {
2114  newCqi.push_back (sinr);
2115  }
2116  else
2117  {
2118  // initialize with NO_SINR value.
2119  newCqi.push_back (NO_SINR);
2120  }
2121 
2122  }
2123  m_ueCqi.insert (std::pair <uint16_t, std::vector <double> > ((*itMap).second.at (i), newCqi));
2124  // generate correspondent timer
2125  m_ueCqiTimers.insert (std::pair <uint16_t, uint32_t > ((*itMap).second.at (i), m_cqiTimersThreshold));
2126  }
2127  else
2128  {
2129  // update the value
2130  (*itCqi).second.at (i) = sinr;
2131  NS_LOG_DEBUG (this << " RNTI " << (*itMap).second.at (i) << " RB " << i << " SINR " << sinr);
2132  // update correspondent timer
2133  std::map <uint16_t, uint32_t>::iterator itTimers;
2134  itTimers = m_ueCqiTimers.find ((*itMap).second.at (i));
2135  (*itTimers).second = m_cqiTimersThreshold;
2136 
2137  }
2138 
2139  }
2140  // remove obsolete info on allocation
2141  m_allocationMaps.erase (itMap);
2142  }
2143  break;
2144  case UlCqi_s::SRS:
2145  {
2146  // get the RNTI from vendor specific parameters
2147  uint16_t rnti = 0;
2148  NS_ASSERT (params.m_vendorSpecificList.size () > 0);
2149  for (uint16_t i = 0; i < params.m_vendorSpecificList.size (); i++)
2150  {
2151  if (params.m_vendorSpecificList.at (i).m_type == SRS_CQI_RNTI_VSP)
2152  {
2153  Ptr<SrsCqiRntiVsp> vsp = DynamicCast<SrsCqiRntiVsp> (params.m_vendorSpecificList.at (i).m_value);
2154  rnti = vsp->GetRnti ();
2155  }
2156  }
2157  std::map <uint16_t, std::vector <double> >::iterator itCqi;
2158  itCqi = m_ueCqi.find (rnti);
2159  if (itCqi == m_ueCqi.end ())
2160  {
2161  // create a new entry
2162  std::vector <double> newCqi;
2163  for (uint32_t j = 0; j < m_cschedCellConfig.m_ulBandwidth; j++)
2164  {
2165  double sinr = LteFfConverter::fpS11dot3toDouble (params.m_ulCqi.m_sinr.at (j));
2166  newCqi.push_back (sinr);
2167  NS_LOG_INFO (this << " RNTI " << rnti << " new SRS-CQI for RB " << j << " value " << sinr);
2168 
2169  }
2170  m_ueCqi.insert (std::pair <uint16_t, std::vector <double> > (rnti, newCqi));
2171  // generate correspondent timer
2172  m_ueCqiTimers.insert (std::pair <uint16_t, uint32_t > (rnti, m_cqiTimersThreshold));
2173  }
2174  else
2175  {
2176  // update the values
2177  for (uint32_t j = 0; j < m_cschedCellConfig.m_ulBandwidth; j++)
2178  {
2179  double sinr = LteFfConverter::fpS11dot3toDouble (params.m_ulCqi.m_sinr.at (j));
2180  (*itCqi).second.at (j) = sinr;
2181  NS_LOG_INFO (this << " RNTI " << rnti << " update SRS-CQI for RB " << j << " value " << sinr);
2182  }
2183  // update correspondent timer
2184  std::map <uint16_t, uint32_t>::iterator itTimers;
2185  itTimers = m_ueCqiTimers.find (rnti);
2186  (*itTimers).second = m_cqiTimersThreshold;
2187 
2188  }
2189 
2190 
2191  }
2192  break;
2193  case UlCqi_s::PUCCH_1:
2194  case UlCqi_s::PUCCH_2:
2195  case UlCqi_s::PRACH:
2196  {
2197  NS_FATAL_ERROR ("FdTbfqFfMacScheduler supports only PUSCH and SRS UL-CQIs");
2198  }
2199  break;
2200  default:
2201  NS_FATAL_ERROR ("Unknown type of UL-CQI");
2202  }
2203  return;
2204 }
2205 
2206 void
2208 {
2209  // refresh DL CQI P01 Map
2210  std::map <uint16_t,uint32_t>::iterator itP10 = m_p10CqiTimers.begin ();
2211  while (itP10 != m_p10CqiTimers.end ())
2212  {
2213  NS_LOG_INFO (this << " P10-CQI for user " << (*itP10).first << " is " << (uint32_t)(*itP10).second << " thr " << (uint32_t)m_cqiTimersThreshold);
2214  if ((*itP10).second == 0)
2215  {
2216  // delete correspondent entries
2217  std::map <uint16_t,uint8_t>::iterator itMap = m_p10CqiRxed.find ((*itP10).first);
2218  NS_ASSERT_MSG (itMap != m_p10CqiRxed.end (), " Does not find CQI report for user " << (*itP10).first);
2219  NS_LOG_INFO (this << " P10-CQI expired for user " << (*itP10).first);
2220  m_p10CqiRxed.erase (itMap);
2221  std::map <uint16_t,uint32_t>::iterator temp = itP10;
2222  itP10++;
2223  m_p10CqiTimers.erase (temp);
2224  }
2225  else
2226  {
2227  (*itP10).second--;
2228  itP10++;
2229  }
2230  }
2231 
2232  // refresh DL CQI A30 Map
2233  std::map <uint16_t,uint32_t>::iterator itA30 = m_a30CqiTimers.begin ();
2234  while (itA30 != m_a30CqiTimers.end ())
2235  {
2236  NS_LOG_INFO (this << " A30-CQI for user " << (*itA30).first << " is " << (uint32_t)(*itA30).second << " thr " << (uint32_t)m_cqiTimersThreshold);
2237  if ((*itA30).second == 0)
2238  {
2239  // delete correspondent entries
2240  std::map <uint16_t,SbMeasResult_s>::iterator itMap = m_a30CqiRxed.find ((*itA30).first);
2241  NS_ASSERT_MSG (itMap != m_a30CqiRxed.end (), " Does not find CQI report for user " << (*itA30).first);
2242  NS_LOG_INFO (this << " A30-CQI expired for user " << (*itA30).first);
2243  m_a30CqiRxed.erase (itMap);
2244  std::map <uint16_t,uint32_t>::iterator temp = itA30;
2245  itA30++;
2246  m_a30CqiTimers.erase (temp);
2247  }
2248  else
2249  {
2250  (*itA30).second--;
2251  itA30++;
2252  }
2253  }
2254 
2255  return;
2256 }
2257 
2258 
2259 void
2261 {
2262  // refresh UL CQI Map
2263  std::map <uint16_t,uint32_t>::iterator itUl = m_ueCqiTimers.begin ();
2264  while (itUl != m_ueCqiTimers.end ())
2265  {
2266  NS_LOG_INFO (this << " UL-CQI for user " << (*itUl).first << " is " << (uint32_t)(*itUl).second << " thr " << (uint32_t)m_cqiTimersThreshold);
2267  if ((*itUl).second == 0)
2268  {
2269  // delete correspondent entries
2270  std::map <uint16_t, std::vector <double> >::iterator itMap = m_ueCqi.find ((*itUl).first);
2271  NS_ASSERT_MSG (itMap != m_ueCqi.end (), " Does not find CQI report for user " << (*itUl).first);
2272  NS_LOG_INFO (this << " UL-CQI exired for user " << (*itUl).first);
2273  (*itMap).second.clear ();
2274  m_ueCqi.erase (itMap);
2275  std::map <uint16_t,uint32_t>::iterator temp = itUl;
2276  itUl++;
2277  m_ueCqiTimers.erase (temp);
2278  }
2279  else
2280  {
2281  (*itUl).second--;
2282  itUl++;
2283  }
2284  }
2285 
2286  return;
2287 }
2288 
2289 void
2290 FdTbfqFfMacScheduler::UpdateDlRlcBufferInfo (uint16_t rnti, uint8_t lcid, uint16_t size)
2291 {
2292  std::map<LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator it;
2293  LteFlowId_t flow (rnti, lcid);
2294  it = m_rlcBufferReq.find (flow);
2295  if (it != m_rlcBufferReq.end ())
2296  {
2297  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);
2298  // Update queues: RLC tx order Status, ReTx, Tx
2299  // Update status queue
2300  if (((*it).second.m_rlcStatusPduSize > 0) && (size >= (*it).second.m_rlcStatusPduSize))
2301  {
2302  (*it).second.m_rlcStatusPduSize = 0;
2303  }
2304  else if (((*it).second.m_rlcRetransmissionQueueSize > 0) && (size >= (*it).second.m_rlcRetransmissionQueueSize))
2305  {
2306  (*it).second.m_rlcRetransmissionQueueSize = 0;
2307  }
2308  else if ((*it).second.m_rlcTransmissionQueueSize > 0)
2309  {
2310  uint32_t rlcOverhead;
2311  if (lcid == 1)
2312  {
2313  // for SRB1 (using RLC AM) it's better to
2314  // overestimate RLC overhead rather than
2315  // underestimate it and risk unneeded
2316  // segmentation which increases delay
2317  rlcOverhead = 4;
2318  }
2319  else
2320  {
2321  // minimum RLC overhead due to header
2322  rlcOverhead = 2;
2323  }
2324  // update transmission queue
2325  if ((*it).second.m_rlcTransmissionQueueSize <= size - rlcOverhead)
2326  {
2327  (*it).second.m_rlcTransmissionQueueSize = 0;
2328  }
2329  else
2330  {
2331  (*it).second.m_rlcTransmissionQueueSize -= size - rlcOverhead;
2332  }
2333  }
2334  }
2335  else
2336  {
2337  NS_LOG_ERROR (this << " Does not find DL RLC Buffer Report of UE " << rnti);
2338  }
2339 }
2340 
2341 void
2342 FdTbfqFfMacScheduler::UpdateUlRlcBufferInfo (uint16_t rnti, uint16_t size)
2343 {
2344 
2345  size = size - 2; // remove the minimum RLC overhead
2346  std::map <uint16_t,uint32_t>::iterator it = m_ceBsrRxed.find (rnti);
2347  if (it != m_ceBsrRxed.end ())
2348  {
2349  NS_LOG_INFO (this << " UE " << rnti << " size " << size << " BSR " << (*it).second);
2350  if ((*it).second >= size)
2351  {
2352  (*it).second -= size;
2353  }
2354  else
2355  {
2356  (*it).second = 0;
2357  }
2358  }
2359  else
2360  {
2361  NS_LOG_ERROR (this << " Does not find BSR report info of UE " << rnti);
2362  }
2363 
2364 }
2365 
2366 void
2368 {
2369  NS_LOG_FUNCTION (this << " RNTI " << rnti << " txMode " << (uint16_t)txMode);
2371  params.m_rnti = rnti;
2372  params.m_transmissionMode = txMode;
2374 }
2375 
2376 
2377 }
ns3::FfMacSchedSapUser::SchedDlConfigIndParameters::m_buildRarList
std::vector< struct BuildRarListElement_s > m_buildRarList
build rar list
Definition: ff-mac-sched-sap.h:296
ns3::FdTbfqFfMacScheduler::GetFfMacCschedSapProvider
virtual FfMacCschedSapProvider * GetFfMacCschedSapProvider()
Get FF MAC CSched SAP provider function.
Definition: fdtbfq-ff-mac-scheduler.cc:148
ns3::FfMacCschedSapProvider::CschedUeReleaseReqParameters
Parameters of the CSCHED_UE_RELEASE_REQ primitive.
Definition: ff-mac-csched-sap.h:230
ns3::FfMacScheduler::m_ulCqiFilter
UlCqiFilter_t m_ulCqiFilter
UL CQI filter.
Definition: ff-mac-scheduler.h:132
ns3::TypeId
a unique identifier for an interface.
Definition: type-id.h:59
NS_LOG_COMPONENT_DEFINE
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:205
ns3::FfMacCschedSapProvider::CschedLcConfigReqParameters::m_logicalChannelConfigList
std::vector< struct LogicalChannelConfigListElement_s > m_logicalChannelConfigList
logicalChannelConfigList
Definition: ff-mac-csched-sap.h:207
ns3::FfMacSchedSapUser::SchedUlConfigIndParameters::m_dciList
std::vector< struct UlDciListElement_s > m_dciList
DCI list.
Definition: ff-mac-sched-sap.h:310
ns3::FdTbfqFfMacScheduler::UpdateDlRlcBufferInfo
void UpdateDlRlcBufferInfo(uint16_t rnti, uint8_t lcid, uint16_t size)
Update DL RLC buffer info function.
Definition: fdtbfq-ff-mac-scheduler.cc:2290
ns3::FfMacCschedSapProvider::CschedLcConfigReqParameters
Parameters of the CSCHED_LC_CONFIG_REQ primitive.
Definition: ff-mac-csched-sap.h:203
ns3::FdTbfqFfMacScheduler::m_ulHarqCurrentProcessId
std::map< uint16_t, uint8_t > m_ulHarqCurrentProcessId
UL HARQ current process ID.
Definition: fdtbfq-ff-mac-scheduler.h:425
ns3::FfMacSchedSapProvider::SchedDlRlcBufferReqParameters::m_logicalChannelIdentity
uint8_t m_logicalChannelIdentity
logical channel identity
Definition: ff-mac-sched-sap.h:62
ns3::FdTbfqFfMacScheduler::m_dlHarqProcessesRlcPduListBuffer
std::map< uint16_t, DlHarqRlcPduListBuffer_t > m_dlHarqProcessesRlcPduListBuffer
DL HARQ process RLC PDU list buffer.
Definition: fdtbfq-ff-mac-scheduler.h:422
ns3::UlDciListElement_s::m_aggrLevel
uint8_t m_aggrLevel
The aggregation level.
Definition: ff-mac-common.h:149
ns3::FfMacCschedSapProvider::CschedLcReleaseReqParameters::m_rnti
uint16_t m_rnti
RNTI.
Definition: ff-mac-csched-sap.h:218
ns3::LteFfrSapProvider::GetAvailableUlRbg
virtual std::vector< bool > GetAvailableUlRbg()=0
Get vector of available RB in UL for this Cell.
ns3::FdTbfqFfMacScheduler::m_ueCqiTimers
std::map< uint16_t, uint32_t > m_ueCqiTimers
Map of UEs' timers on UL-CQI per RBG.
Definition: fdtbfq-ff-mac-scheduler.h:376
NS_OBJECT_ENSURE_REGISTERED
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition: object-base.h:45
NS_ASSERT
#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
ns3::FfMacSchedSapProvider::SchedUlTriggerReqParameters::m_ulInfoList
std::vector< struct UlInfoListElement_s > m_ulInfoList
UL info list.
Definition: ff-mac-sched-sap.h:139
ns3::BooleanValue
AttributeValue implementation for Boolean.
Definition: boolean.h:37
ns3::LteFfrSapUser
Service Access Point (SAP) offered by the eNodeB RRC instance to the Frequency Reuse algorithm instan...
Definition: lte-ffr-sap.h:139
ns3::FfMacSchedSapUser::SchedDlConfigInd
virtual void SchedDlConfigInd(const struct SchedDlConfigIndParameters &params)=0
SCHED_DL_CONFIG_IND.
ns3::FdTbfqFfMacScheduler::DoSchedDlRachInfoReq
void DoSchedDlRachInfoReq(const struct FfMacSchedSapProvider::SchedDlRachInfoReqParameters &params)
Sched DL RACH info request function.
Definition: fdtbfq-ff-mac-scheduler.cc:1514
ns3::FdTbfqType0AllocationRbg
static const int FdTbfqType0AllocationRbg[4]
FdTbfqType0AllocationRbg value array.
Definition: fdtbfq-ff-mac-scheduler.cc:40
ns3::fdtbfqsFlowPerf_t
Flow information.
Definition: fdtbfq-ff-mac-scheduler.h:64
ns3::FfMacSchedSapUser::SchedDlConfigIndParameters::m_nrOfPdcchOfdmSymbols
uint8_t m_nrOfPdcchOfdmSymbols
number of PDCCH OFDM symbols
Definition: ff-mac-sched-sap.h:299
ns3::MakeIntegerAccessor
Ptr< const AttributeAccessor > MakeIntegerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Definition: integer.h:45
ns3::FfMacCschedSapProvider::CschedUeConfigReqParameters::m_rnti
uint16_t m_rnti
RNTI.
Definition: ff-mac-csched-sap.h:138
ns3::FdTbfqFfMacScheduler::DoDispose
virtual void DoDispose(void)
Destructor implementation.
Definition: fdtbfq-ff-mac-scheduler.cc:71
ns3::FdTbfqFfMacScheduler::DoSchedDlTriggerReq
void DoSchedDlTriggerReq(const struct FfMacSchedSapProvider::SchedDlTriggerReqParameters &params)
Sched DL trigger request function.
Definition: fdtbfq-ff-mac-scheduler.cc:529
ns3::UlCqi_s::SRS
@ SRS
Definition: ff-mac-common.h:507
ns3::FdTbfqFfMacScheduler::DoCschedLcReleaseReq
void DoCschedLcReleaseReq(const struct FfMacCschedSapProvider::CschedLcReleaseReqParameters &params)
CSched LC release request function.
Definition: fdtbfq-ff-mac-scheduler.cc:278
ns3::FdTbfqFfMacScheduler::GetLteFfrSapUser
virtual LteFfrSapUser * GetLteFfrSapUser()
Get FFR SAP user function.
Definition: fdtbfq-ff-mac-scheduler.cc:166
ns3::FfMacScheduler
This abstract base class identifies the interface by means of which the helper object can plug on the...
Definition: ff-mac-scheduler.h:54
ns3::FfMacSchedSapProvider::SchedDlCqiInfoReqParameters
Parameters of the SCHED_DL_CQI_INFO_REQ primitive.
Definition: ff-mac-sched-sap.h:125
ns3::fdtbfqsFlowPerf_t::tokenGenerationRate
uint64_t tokenGenerationRate
token generation rate ( byte/s )
Definition: fdtbfq-ff-mac-scheduler.h:67
ns3::Simulator::Now
static Time Now(void)
Return the current simulation virtual time.
Definition: simulator.cc:195
ns3::FfMacSchedSapProvider::SchedDlRachInfoReqParameters
Parameters of the SCHED_DL_RACH_INFO_REQ primitive.
Definition: ff-mac-sched-sap.h:113
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::DlHarqRlcPduListBuffer_t
std::vector< RlcPduList_t > DlHarqRlcPduListBuffer_t
vector of the 8 HARQ processes per UE
Definition: cqa-ff-mac-scheduler.h:56
ns3::FdTbfqFfMacScheduler::m_ceBsrRxed
std::map< uint16_t, uint32_t > m_ceBsrRxed
Map of UE's buffer status reports received.
Definition: fdtbfq-ff-mac-scheduler.h:381
ns3::FdTbfqFfMacScheduler::m_dlHarqProcessesDciBuffer
std::map< uint16_t, DlHarqProcessesDciBuffer_t > m_dlHarqProcessesDciBuffer
DL HARQ process DCI buffer.
Definition: fdtbfq-ff-mac-scheduler.h:421
ns3::FdTbfqFfMacScheduler::m_p10CqiRxed
std::map< uint16_t, uint8_t > m_p10CqiRxed
Map of UE's DL CQI P01 received.
Definition: fdtbfq-ff-mac-scheduler.h:345
ns3::IntegerValue
Hold a signed integer type.
Definition: integer.h:44
ns3::FdTbfqFfMacScheduler::RefreshUlCqiMaps
void RefreshUlCqiMaps(void)
Refresh UL CQI maps function.
Definition: fdtbfq-ff-mac-scheduler.cc:2260
ns3::FdTbfqFfMacScheduler::m_creditableThreshold
uint32_t m_creditableThreshold
threshold of flow credit
Definition: fdtbfq-ff-mac-scheduler.h:411
ns3::UlCqi_s::PUCCH_2
@ PUCCH_2
Definition: ff-mac-common.h:510
ns3::DlHarqProcessesStatus_t
std::vector< uint8_t > DlHarqProcessesStatus_t
DL HARQ process status vector typedef.
Definition: cqa-ff-mac-scheduler.h:48
ns3::FfMacSchedSapProvider::SchedUlCqiInfoReqParameters
Parameters of the SCHED_UL_CQI_INFO_REQ primitive.
Definition: ff-mac-sched-sap.h:186
ns3::UlDciListElement_s::m_tpc
int8_t m_tpc
Tx power control command.
Definition: ff-mac-common.h:153
ns3::FdTbfqFfMacScheduler
Implements the SCHED SAP and CSCHED SAP for a Frequency Domain Token Bank Fair Queue scheduler.
Definition: fdtbfq-ff-mac-scheduler.h:84
ns3::FfMacSchedSapUser::SchedUlConfigIndParameters
Parameters of the SCHED_UL_CONFIG_IND primitive.
Definition: ff-mac-sched-sap.h:309
ns3::fdtbfqsFlowPerf_t::counter
int counter
the number of token borrow or given to token bank
Definition: fdtbfq-ff-mac-scheduler.h:70
ns3::FdTbfqFfMacScheduler::m_debtLimit
int m_debtLimit
flow debt limit (byte)
Definition: fdtbfq-ff-mac-scheduler.h:405
ns3::UlGrant_s::m_hopping
bool m_hopping
hopping?
Definition: ff-mac-common.h:269
ns3::FfMacCschedSapProvider::CschedUeConfigReqParameters::m_transmissionMode
uint8_t m_transmissionMode
transmission mode
Definition: ff-mac-csched-sap.h:159
ns3::FdTbfqFfMacScheduler::m_ulGrantMcs
uint8_t m_ulGrantMcs
MCS for UL grant (default 0)
Definition: fdtbfq-ff-mac-scheduler.h:436
ns3::FdTbfqFfMacScheduler::DoSchedDlPagingBufferReq
void DoSchedDlPagingBufferReq(const struct FfMacSchedSapProvider::SchedDlPagingBufferReqParameters &params)
Sched DL paging buffer request function.
Definition: fdtbfq-ff-mac-scheduler.cc:368
ns3::BuildRarListElement_s
See section 4.3.10 buildRARListElement.
Definition: ff-mac-common.h:279
ns3::FfMacSchedSapProvider::SchedUlCqiInfoReqParameters::m_vendorSpecificList
std::vector< struct VendorSpecificListElement_s > m_vendorSpecificList
vendor specific list
Definition: ff-mac-sched-sap.h:190
ns3::FfMacSchedSapProvider::SchedDlMacBufferReqParameters
Parameters of the SCHED_DL_MAC_BUFFER_REQ primitive.
Definition: ff-mac-sched-sap.h:89
ns3::FfMacSchedSapProvider::SchedDlRlcBufferReqParameters::m_rnti
uint16_t m_rnti
RNTI.
Definition: ff-mac-sched-sap.h:61
ns3::FdTbfqFfMacScheduler::SetFfMacCschedSapUser
virtual void SetFfMacCschedSapUser(FfMacCschedSapUser *s)
Set FF MAC Csched SAP user function.
Definition: fdtbfq-ff-mac-scheduler.cc:136
ns3::FdTbfqFfMacScheduler::~FdTbfqFfMacScheduler
virtual ~FdTbfqFfMacScheduler()
Destructor.
Definition: fdtbfq-ff-mac-scheduler.cc:65
ns3::SUCCESS
@ SUCCESS
Definition: ff-mac-common.h:62
ns3::FfMacCschedSapUser::CschedUeConfigCnfParameters
Parameters of the CSCHED_UE_CONFIG_CNF primitive.
Definition: ff-mac-csched-sap.h:308
ns3::DlDciListElement_s::m_resAlloc
uint8_t m_resAlloc
The type of resource allocation.
Definition: ff-mac-common.h:98
HARQ_DL_TIMEOUT
#define HARQ_DL_TIMEOUT
Definition: cqa-ff-mac-scheduler.h:43
ns3::FdTbfqFfMacScheduler::m_ffrSapUser
LteFfrSapUser * m_ffrSapUser
FFR SAP user.
Definition: fdtbfq-ff-mac-scheduler.h:390
ns3::DlDciListElement_s
See section 4.3.1 dlDciListElement.
Definition: ff-mac-common.h:94
ns3::fdtbfqsFlowPerf_t::burstCredit
uint32_t burstCredit
the maximum number of tokens connection i can borrow from the bank each time
Definition: fdtbfq-ff-mac-scheduler.h:71
ns3::UlCqi_s::m_sinr
std::vector< uint16_t > m_sinr
SINR.
Definition: ff-mac-common.h:503
ns3::MakeBooleanAccessor
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:85
ns3::FfMacSchedSapProvider::SchedUlSrInfoReqParameters
Parameters of the SCHED_UL_SR_INFO_REQ primitive.
Definition: ff-mac-sched-sap.h:162
ns3::DlDciListElement_s::m_rnti
uint16_t m_rnti
RNTI.
Definition: ff-mac-common.h:95
ns3::FfMacSchedSapUser
FfMacSchedSapUser class.
Definition: ff-mac-sched-sap.h:281
ns3::DlHarqProcessesTimer_t
std::vector< uint8_t > DlHarqProcessesTimer_t
DL HARQ process timer vector typedef.
Definition: cqa-ff-mac-scheduler.h:50
ns3::FdTbfqFfMacScheduler::m_allocationMaps
std::map< uint16_t, std::vector< uint16_t > > m_allocationMaps
Map of previous allocated UE per RBG (used to retrieve info from UL-CQI)
Definition: fdtbfq-ff-mac-scheduler.h:366
ns3::FdTbfqFfMacScheduler::GetFfMacSchedSapProvider
virtual FfMacSchedSapProvider * GetFfMacSchedSapProvider()
Get FF MAC sched SAP provider function.
Definition: fdtbfq-ff-mac-scheduler.cc:154
ns3::FdTbfqFfMacScheduler::m_ulHarqProcessesDciBuffer
std::map< uint16_t, UlHarqProcessesDciBuffer_t > m_ulHarqProcessesDciBuffer
UL HARQ process DCI buffer.
Definition: fdtbfq-ff-mac-scheduler.h:430
ns3::TypeId::SetParent
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition: type-id.cc:923
ns3::LteFfrSapProvider::GetTpc
virtual uint8_t GetTpc(uint16_t rnti)=0
GetTpc.
ns3::UlDciListElement_s::m_rnti
uint16_t m_rnti
RNTI.
Definition: ff-mac-common.h:142
ns3::FdTbfqFfMacScheduler::SetFfMacSchedSapUser
virtual void SetFfMacSchedSapUser(FfMacSchedSapUser *s)
Set FF MAC sched SAP user function.
Definition: fdtbfq-ff-mac-scheduler.cc:142
ns3::FfMacSchedSapProvider::SchedUlCqiInfoReqParameters::m_ulCqi
struct UlCqi_s m_ulCqi
UL CQI.
Definition: ff-mac-sched-sap.h:188
ns3::FdTbfqFfMacScheduler::m_p10CqiTimers
std::map< uint16_t, uint32_t > m_p10CqiTimers
Map of UE's timers on DL CQI P01 received.
Definition: fdtbfq-ff-mac-scheduler.h:350
ns3::FfMacSchedSapProvider::SchedDlRlcBufferReqParameters
Parameters of the API primitives.
Definition: ff-mac-sched-sap.h:60
ns3::FdTbfqFfMacScheduler::m_tokenPoolSize
uint32_t m_tokenPoolSize
maximum size of token pool (byte)
Definition: fdtbfq-ff-mac-scheduler.h:409
ns3::RlcPduListElement_s::m_size
uint16_t m_size
size
Definition: ff-mac-common.h:244
ns3::FdTbfqFfMacScheduler::m_dlHarqProcessesTimer
std::map< uint16_t, DlHarqProcessesTimer_t > m_dlHarqProcessesTimer
DL HARQ process timer.
Definition: fdtbfq-ff-mac-scheduler.h:420
ns3::FfMacSchedSapProvider::SchedUlTriggerReqParameters::m_sfnSf
uint16_t m_sfnSf
sfn SF
Definition: ff-mac-sched-sap.h:138
ns3::FfMacCschedSapUser::CschedUeConfigUpdateIndParameters
Parameters of the CSCHED_UE_CONFIG_UPDATE_IND primitive.
Definition: ff-mac-csched-sap.h:360
ns3::FfMacSchedSapProvider::SchedDlTriggerReqParameters::m_sfnSf
uint16_t m_sfnSf
sfn SF
Definition: ff-mac-sched-sap.h:102
ns3::CqiListElement_s::P10
@ P10
Definition: ff-mac-common.h:490
ns3::UlInfoListElement_s::NotOk
@ NotOk
Definition: ff-mac-common.h:310
ns3::UlDciListElement_s::m_cqiRequest
bool m_cqiRequest
CQI request.
Definition: ff-mac-common.h:154
ns3::FfMacSchedSapProvider::SchedDlCqiInfoReqParameters::m_cqiList
std::vector< struct CqiListElement_s > m_cqiList
CQI list.
Definition: ff-mac-sched-sap.h:127
ns3::FdTbfqFfMacScheduler::bankSize
uint64_t bankSize
the number of bytes in token bank
Definition: fdtbfq-ff-mac-scheduler.h:403
ns3::FdTbfqFfMacScheduler::RefreshDlCqiMaps
void RefreshDlCqiMaps(void)
Refresh DL CQI maps function.
Definition: fdtbfq-ff-mac-scheduler.cc:2207
ns3::FfMacScheduler::PUSCH_UL_CQI
@ PUSCH_UL_CQI
Definition: ff-mac-scheduler.h:64
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:74
ns3::UlCqi_s::PUSCH
@ PUSCH
Definition: ff-mac-common.h:508
ns3::RlcPduListElement_s
See section 4.3.9 rlcPDU_ListElement.
Definition: ff-mac-common.h:242
ns3::FdTbfqFfMacScheduler::DoSchedDlCqiInfoReq
void DoSchedDlCqiInfoReq(const struct FfMacSchedSapProvider::SchedDlCqiInfoReqParameters &params)
Sched DL CQI info request function.
Definition: fdtbfq-ff-mac-scheduler.cc:1524
NS_FATAL_ERROR
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
Definition: fatal-error.h:165
ns3::FdTbfqFfMacScheduler::m_cschedCellConfig
FfMacCschedSapProvider::CschedCellConfigReqParameters m_cschedCellConfig
Csched cell config.
Definition: fdtbfq-ff-mac-scheduler.h:394
ns3::FdTbfqFfMacScheduler::GetRbgSize
int GetRbgSize(int dlbandwidth)
Get RBG size function.
Definition: fdtbfq-ff-mac-scheduler.cc:384
ns3::UlDciListElement_s::m_cceIndex
uint8_t m_cceIndex
Control Channel Element index.
Definition: ff-mac-common.h:148
ns3::FdTbfqFfMacScheduler::RefreshHarqProcesses
void RefreshHarqProcesses()
Refresh HARQ processes according to the timers.
Definition: fdtbfq-ff-mac-scheduler.cc:496
ns3::FdTbfqFfMacScheduler::MemberSchedSapProvider< FdTbfqFfMacScheduler >
friend class MemberSchedSapProvider< FdTbfqFfMacScheduler >
allow MemberSchedSapProvider<FdTbfqFfMacScheduler> claass friend access
Definition: fdtbfq-ff-mac-scheduler.h:143
ns3::BuildDataListElement_s::m_rlcPduList
std::vector< std::vector< struct RlcPduListElement_s > > m_rlcPduList
RLC PDU list.
Definition: ff-mac-common.h:256
ns3::LteFlowId_t
LteFlowId structure.
Definition: lte-common.h:37
bianchi11ax.k
int k
Definition: bianchi11ax.py:129
ns3::DlDciListElement_s::m_tbsSize
std::vector< uint16_t > m_tbsSize
The TBs size.
Definition: ff-mac-common.h:99
ns3::FfMacCschedSapUser::CschedUeConfigUpdateIndParameters::m_rnti
uint16_t m_rnti
RNTI.
Definition: ff-mac-csched-sap.h:361
ns3::FdTbfqFfMacScheduler::DoSchedUlNoiseInterferenceReq
void DoSchedUlNoiseInterferenceReq(const struct FfMacSchedSapProvider::SchedUlNoiseInterferenceReqParameters &params)
Sched UL noise interference request function.
Definition: fdtbfq-ff-mac-scheduler.cc:2003
ns3::fdtbfqsFlowPerf_t::maxTokenPoolSize
uint32_t maxTokenPoolSize
maximum size of token pool (byte)
Definition: fdtbfq-ff-mac-scheduler.h:69
ns3::UlDciListElement_s
See section 4.3.2 ulDciListElement.
Definition: ff-mac-common.h:141
ns3::FfMacSchedSapProvider::SchedUlMacCtrlInfoReqParameters::m_macCeList
std::vector< struct MacCeListElement_s > m_macCeList
MAC CE list.
Definition: ff-mac-sched-sap.h:176
ns3::MacCeListElement_s::BSR
@ BSR
Definition: ff-mac-common.h:342
ns3::CqiListElement_s::A30
@ A30
Definition: ff-mac-common.h:490
ns3::FdTbfqFfMacScheduler::m_rachList
std::vector< struct RachListElement_s > m_rachList
RACH list.
Definition: fdtbfq-ff-mac-scheduler.h:434
ns3::FfMacSchedSapProvider::SchedDlTriggerReqParameters::m_dlInfoList
std::vector< struct DlInfoListElement_s > m_dlInfoList
DL info list.
Definition: ff-mac-sched-sap.h:103
ns3::FfMacSchedSapProvider::SchedUlNoiseInterferenceReqParameters
Parameters of the SCHED_UL_NOISE_INTERFERENCE_REQ primitive.
Definition: ff-mac-sched-sap.h:149
ns3::FdTbfqFfMacScheduler::m_nextRntiUl
uint16_t m_nextRntiUl
RNTI of the next user to be served next scheduling in UL.
Definition: fdtbfq-ff-mac-scheduler.h:397
ns3::FdTbfqFfMacScheduler::m_schedSapProvider
FfMacSchedSapProvider * m_schedSapProvider
sched SAP provider
Definition: fdtbfq-ff-mac-scheduler.h:387
ns3::RlcPduListElement_s::m_logicalChannelIdentity
uint8_t m_logicalChannelIdentity
logical channel identity
Definition: ff-mac-common.h:243
ns3::FfMacSchedSapProvider::SchedDlPagingBufferReqParameters
Parameters of the SCHED_DL_PAGING_BUFFER_REQ primitive.
Definition: ff-mac-sched-sap.h:77
NS_LOG_INFO
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
Definition: log.h:281
ns3::LteFfrSapProvider
Service Access Point (SAP) offered by the Frequency Reuse algorithm instance to the MAC Scheduler ins...
Definition: lte-ffr-sap.h:40
ns3::FdTbfqFfMacScheduler::MemberCschedSapProvider< FdTbfqFfMacScheduler >
friend class MemberCschedSapProvider< FdTbfqFfMacScheduler >
allow MemberCschedSapProvider<FdTbfqFfMacScheduler> class friend access
Definition: fdtbfq-ff-mac-scheduler.h:141
ns3::FdTbfqFfMacScheduler::DoSchedUlMacCtrlInfoReq
void DoSchedUlMacCtrlInfoReq(const struct FfMacSchedSapProvider::SchedUlMacCtrlInfoReqParameters &params)
Sched UL MAC control info request function.
Definition: fdtbfq-ff-mac-scheduler.cc:2017
ns3::FdTbfqFfMacScheduler::m_harqOn
bool m_harqOn
m_harqOn when false inhibit the HARQ mechanisms (by default active)
Definition: fdtbfq-ff-mac-scheduler.h:414
ns3::UlDciListElement_s::m_rbStart
uint8_t m_rbStart
start
Definition: ff-mac-common.h:143
ns3::UlGrant_s::m_tpc
int8_t m_tpc
Tx power control command.
Definition: ff-mac-common.h:270
ns3::FfMacCschedSapProvider
Provides the CSCHED SAP.
Definition: ff-mac-csched-sap.h:46
ns3::fdtbfqsFlowPerf_t::flowStart
Time flowStart
flow start time
Definition: fdtbfq-ff-mac-scheduler.h:65
ns3::BuildRarListElement_s::m_rnti
uint16_t m_rnti
RNTI.
Definition: ff-mac-common.h:280
ns3::FfMacSchedSapUser::SchedUlConfigInd
virtual void SchedUlConfigInd(const struct SchedUlConfigIndParameters &params)=0
SCHED_UL_CONFIG_IND.
ns3::MakeBooleanChecker
Ptr< const AttributeChecker > MakeBooleanChecker(void)
Definition: boolean.cc:121
ns3::UlDciListElement_s::m_freqHopping
uint8_t m_freqHopping
freq hopping
Definition: ff-mac-common.h:157
ns3::FdTbfqFfMacScheduler::DoSchedUlSrInfoReq
void DoSchedUlSrInfoReq(const struct FfMacSchedSapProvider::SchedUlSrInfoReqParameters &params)
Sched UL SR info request function.
Definition: fdtbfq-ff-mac-scheduler.cc:2010
ns3::UlDciListElement_s::m_ulIndex
uint8_t m_ulIndex
UL index.
Definition: ff-mac-common.h:155
ns3::FdTbfqFfMacScheduler::m_dlHarqProcessesStatus
std::map< uint16_t, DlHarqProcessesStatus_t > m_dlHarqProcessesStatus
DL HARQ process status.
Definition: fdtbfq-ff-mac-scheduler.h:419
ns3::FfMacCschedSapProvider::CschedUeReleaseReqParameters::m_rnti
uint16_t m_rnti
RNTI.
Definition: ff-mac-csched-sap.h:231
ns3::UlDciListElement_s::m_ndi
uint8_t m_ndi
NDI.
Definition: ff-mac-common.h:147
ns3::FdTbfqFfMacScheduler::m_a30CqiRxed
std::map< uint16_t, SbMeasResult_s > m_a30CqiRxed
Map of UE's DL CQI A30 received.
Definition: fdtbfq-ff-mac-scheduler.h:355
ns3::FdTbfqFfMacScheduler::m_rlcBufferReq
std::map< LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters > m_rlcBufferReq
Vectors of UE's LC info.
Definition: fdtbfq-ff-mac-scheduler.h:329
NS_ABORT_MSG_IF
#define NS_ABORT_MSG_IF(cond, msg)
Abnormal program termination if a condition is true, with a message.
Definition: abort.h:108
ns3::FdTbfqFfMacScheduler::m_flowStatsDl
std::map< uint16_t, fdtbfqsFlowPerf_t > m_flowStatsDl
Map of UE statistics (per RNTI basis) in downlink.
Definition: fdtbfq-ff-mac-scheduler.h:335
ns3::LteFfConverter::fpS11dot3toDouble
static double fpS11dot3toDouble(uint16_t val)
Convert from fixed point S11.3 notation to double.
Definition: lte-common.cc:155
NS_ASSERT_MSG
#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:88
ns3::FdTbfqFfMacScheduler::m_flowStatsUl
std::map< uint16_t, fdtbfqsFlowPerf_t > m_flowStatsUl
Map of UE statistics (per RNTI basis)
Definition: fdtbfq-ff-mac-scheduler.h:340
ns3::FfMacCschedSapProvider::CschedLcReleaseReqParameters::m_logicalChannelIdentity
std::vector< uint8_t > m_logicalChannelIdentity
logical channel identity
Definition: ff-mac-csched-sap.h:220
ns3::FdTbfqFfMacScheduler::FdTbfqFfMacScheduler
FdTbfqFfMacScheduler()
Constructor.
Definition: fdtbfq-ff-mac-scheduler.cc:52
ns3::UlCqi_s::PUCCH_1
@ PUCCH_1
Definition: ff-mac-common.h:509
ns3::FdTbfqFfMacScheduler::DoSchedDlMacBufferReq
void DoSchedDlMacBufferReq(const struct FfMacSchedSapProvider::SchedDlMacBufferReqParameters &params)
Sched DL MAC buffer request function.
Definition: fdtbfq-ff-mac-scheduler.cc:376
ns3::FdTbfqFfMacScheduler::LcActivePerFlow
unsigned int LcActivePerFlow(uint16_t rnti)
LC Active per flow function.
Definition: fdtbfq-ff-mac-scheduler.cc:399
ns3::UlGrant_s::m_rbLen
uint8_t m_rbLen
length
Definition: ff-mac-common.h:266
ns3::FdTbfqFfMacScheduler::m_schedSapUser
FfMacSchedSapUser * m_schedSapUser
sched SAP user
Definition: fdtbfq-ff-mac-scheduler.h:385
ns3::BuildRarListElement_s::m_grant
UlGrant_s m_grant
grant
Definition: ff-mac-common.h:282
ns3::fdtbfqsFlowPerf_t::creditableThreshold
uint32_t creditableThreshold
the flow cannot borrow token from bank until the number of token it has deposited to bank reaches thi...
Definition: fdtbfq-ff-mac-scheduler.h:73
ns3::FfMacSchedSapProvider::SchedDlTriggerReqParameters
Parameters of the SCHED_DL_TRIGGER_REQ primitive.
Definition: ff-mac-sched-sap.h:101
ns3::UlGrant_s::m_cqiRequest
bool m_cqiRequest
CQI request?
Definition: ff-mac-common.h:271
ns3::fdtbfqsFlowPerf_t::debtLimit
int debtLimit
counter threshold that the flow cannot further borrow tokens from bank
Definition: fdtbfq-ff-mac-scheduler.h:72
ns3::FfMacCschedSapProvider::CschedCellConfigReqParameters::m_dlBandwidth
uint16_t m_dlBandwidth
DL badnwidth.
Definition: ff-mac-csched-sap.h:88
NS_LOG_LOGIC
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
Definition: log.h:289
ns3::MemberLteFfrSapUser
Template for the implementation of the LteFfrSapUser as a member of an owner class of type C to which...
Definition: lte-ffr-sap.h:256
NS_LOG_ERROR
#define NS_LOG_ERROR(msg)
Use NS_LOG to output a message of level LOG_ERROR.
Definition: log.h:257
ns3::FfMacCschedSapProvider::CschedUeConfigReqParameters
Parameters of the CSCHED_UE_CONFIG_REQ primitive.
Definition: ff-mac-csched-sap.h:137
ns3::FfMacSchedSapProvider::SchedUlCqiInfoReqParameters::m_sfnSf
uint16_t m_sfnSf
sfn SF
Definition: ff-mac-sched-sap.h:187
ns3::BuildDataListElement_s::m_rnti
uint16_t m_rnti
RNTI.
Definition: ff-mac-common.h:253
ns3::FdTbfqFfMacScheduler::m_ffrSapProvider
LteFfrSapProvider * m_ffrSapProvider
FFR SAP provider.
Definition: fdtbfq-ff-mac-scheduler.h:391
ns3::fdtbfqsFlowPerf_t::tokenPoolSize
uint32_t tokenPoolSize
current size of token pool (byte)
Definition: fdtbfq-ff-mac-scheduler.h:68
ns3::FfMacCschedSapUser::CschedUeConfigCnfParameters::m_result
enum Result_e m_result
result
Definition: ff-mac-csched-sap.h:310
ns3::FfMacCschedSapProvider::CschedLcConfigReqParameters::m_rnti
uint16_t m_rnti
RNTI.
Definition: ff-mac-csched-sap.h:204
ns3::UlDciListElement_s::m_ueTxAntennaSelection
uint8_t m_ueTxAntennaSelection
UE antenna selection.
Definition: ff-mac-common.h:150
ns3::FfMacSchedSapProvider::SchedUlMacCtrlInfoReqParameters
Parameters of the SCHED_UL_MAC_CTRL_INFO_REQ primitive.
Definition: ff-mac-sched-sap.h:174
ns3::FdTbfqFfMacScheduler::m_uesTxMode
std::map< uint16_t, uint8_t > m_uesTxMode
txMode of the UEs
Definition: fdtbfq-ff-mac-scheduler.h:401
ns3::UlCqi_s::PRACH
@ PRACH
Definition: ff-mac-common.h:511
ns3::UlGrant_s::m_ulDelay
bool m_ulDelay
UL delay?
Definition: ff-mac-common.h:272
ns3::FfMacSchedSapUser::SchedDlConfigIndParameters::m_buildDataList
std::vector< struct BuildDataListElement_s > m_buildDataList
build data list
Definition: ff-mac-sched-sap.h:295
ns3::BufferSizeLevelBsr::BsrId2BufferSize
static uint32_t BsrId2BufferSize(uint8_t val)
Convert BSR ID to buffer size.
Definition: lte-common.cc:184
NS_LOG_DEBUG
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Definition: log.h:273
ns3::FfMacCschedSapUser::CschedUeConfigUpdateIndParameters::m_transmissionMode
uint8_t m_transmissionMode
transmission mode
Definition: ff-mac-csched-sap.h:362
ns3::DlDciListElement_s::m_mcs
std::vector< uint8_t > m_mcs
MCS.
Definition: ff-mac-common.h:100
ns3::FdTbfqFfMacScheduler::m_cqiTimersThreshold
uint32_t m_cqiTimersThreshold
Definition: fdtbfq-ff-mac-scheduler.h:399
ns3::FdTbfqFfMacScheduler::UpdateHarqProcessId
uint8_t UpdateHarqProcessId(uint16_t rnti)
Update and return a new process Id for the RNTI specified.
Definition: fdtbfq-ff-mac-scheduler.cc:455
ns3::FfMacCschedSapUser::CschedUeConfigCnf
virtual void CschedUeConfigCnf(const struct CschedUeConfigCnfParameters &params)=0
CSCHED_UE_CONFIG_CNF.
ns3::UlGrant_s::m_tbSize
uint16_t m_tbSize
size
Definition: ff-mac-common.h:267
ns3::DlHarqProcessesDciBuffer_t
std::vector< DlDciListElement_s > DlHarqProcessesDciBuffer_t
DL HARQ process DCI buffer vector typedef.
Definition: cqa-ff-mac-scheduler.h:52
ns3::LteFfrSapProvider::ReportUlCqiInfo
virtual void ReportUlCqiInfo(const struct FfMacSchedSapProvider::SchedUlCqiInfoReqParameters &params)=0
ReportUlCqiInfo.
NO_SINR
#define NO_SINR
Definition: cqa-ff-mac-scheduler.h:41
ns3::UlHarqProcessesDciBuffer_t
std::vector< UlDciListElement_s > UlHarqProcessesDciBuffer_t
UL HARQ process DCI buffer vector.
Definition: cqa-ff-mac-scheduler.h:58
ns3::UlDciListElement_s::m_hopping
bool m_hopping
hopping?
Definition: ff-mac-common.h:151
ns3::FdTbfqFfMacScheduler::m_amc
Ptr< LteAmc > m_amc
amc
Definition: fdtbfq-ff-mac-scheduler.h:324
ns3::FfMacSchedSapProvider::SchedUlTriggerReqParameters
Parameters of the SCHED_UL_TRIGGER_REQ primitive.
Definition: ff-mac-sched-sap.h:137
ns3::FfMacCschedSapUser::CschedUeConfigUpdateInd
virtual void CschedUeConfigUpdateInd(const struct CschedUeConfigUpdateIndParameters &params)=0
CSCHED_UE_UPDATE_IND.
ns3::FdTbfqFfMacScheduler::DoCschedLcConfigReq
void DoCschedLcConfigReq(const struct FfMacCschedSapProvider::CschedLcConfigReqParameters &params)
CSched LC config request function.
Definition: fdtbfq-ff-mac-scheduler.cc:224
ns3::FdTbfqFfMacScheduler::UpdateUlRlcBufferInfo
void UpdateUlRlcBufferInfo(uint16_t rnti, uint16_t size)
Update UL RLC buffer info function.
Definition: fdtbfq-ff-mac-scheduler.cc:2342
ns3::UlDciListElement_s::m_mcs
uint8_t m_mcs
MCS.
Definition: ff-mac-common.h:146
ns3::UlDciListElement_s::m_rbLen
uint8_t m_rbLen
length
Definition: ff-mac-common.h:144
ns3::FdTbfqFfMacScheduler::DoCschedUeConfigReq
void DoCschedUeConfigReq(const struct FfMacCschedSapProvider::CschedUeConfigReqParameters &params)
CSched UE config request function.
Definition: fdtbfq-ff-mac-scheduler.cc:185
ns3::FfMacCschedSapProvider::CschedLcReleaseReqParameters
Parameters of the CSCHED_LC_RELEASE_REQ primitive.
Definition: ff-mac-csched-sap.h:217
NS_LOG_FUNCTION
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
Definition: log-macros-enabled.h:244
HARQ_PROC_NUM
#define HARQ_PROC_NUM
Definition: cqa-ff-mac-scheduler.h:42
ns3::FfMacCschedSapUser
FfMacCschedSapUser class.
Definition: ff-mac-csched-sap.h:284
ns3::UlGrant_s::m_rbStart
uint8_t m_rbStart
start
Definition: ff-mac-common.h:265
HARQ_PERIOD
#define HARQ_PERIOD
Definition: lte-common.h:30
ns3::FdTbfqFfMacScheduler::EstimateUlSinr
double EstimateUlSinr(uint16_t rnti, uint16_t rb)
Estimate UL SNR function.
Definition: fdtbfq-ff-mac-scheduler.cc:1586
ns3::UintegerValue
Hold an unsigned integer type.
Definition: uinteger.h:44
ns3::FfMacCschedSapProvider::CschedCellConfigReqParameters
Parameters of the API primitives.
Definition: ff-mac-csched-sap.h:59
ns3::DlDciListElement_s::m_tpc
uint8_t m_tpc
Tx power control command.
Definition: ff-mac-common.h:111
ns3::UlDciListElement_s::m_n2Dmrs
uint8_t m_n2Dmrs
n2 DMRS
Definition: ff-mac-common.h:152
ns3::FdTbfqFfMacScheduler::DoSchedUlCqiInfoReq
void DoSchedUlCqiInfoReq(const struct FfMacSchedSapProvider::SchedUlCqiInfoReqParameters &params)
Sched UL CQI info request function.
Definition: fdtbfq-ff-mac-scheduler.cc:2061
ns3::LteFfrSapProvider::IsUlRbgAvailableForUe
virtual bool IsUlRbgAvailableForUe(int i, uint16_t rnti)=0
Check if UE can be served on i-th RB in UL.
ns3::FdTbfqFfMacScheduler::GetTypeId
static TypeId GetTypeId(void)
Get the type ID.
Definition: fdtbfq-ff-mac-scheduler.cc:87
ns3::UlDciListElement_s::m_pdcchPowerOffset
int8_t m_pdcchPowerOffset
CCH power offset.
Definition: ff-mac-common.h:158
ns3::FdTbfqFfMacScheduler::m_ueCqi
std::map< uint16_t, std::vector< double > > m_ueCqi
Map of UEs' UL-CQI per RBG.
Definition: fdtbfq-ff-mac-scheduler.h:371
ns3::FdTbfqFfMacScheduler::DoSchedDlRlcBufferReq
void DoSchedDlRlcBufferReq(const struct FfMacSchedSapProvider::SchedDlRlcBufferReqParameters &params)
Sched DL RLC buffer request function.
Definition: fdtbfq-ff-mac-scheduler.cc:344
ns3::FdTbfqFfMacScheduler::TransmissionModeConfigurationUpdate
void TransmissionModeConfigurationUpdate(uint16_t rnti, uint8_t txMode)
Transmisson mode config update function.
Definition: fdtbfq-ff-mac-scheduler.cc:2367
ns3::UlGrant_s::m_mcs
uint8_t m_mcs
MCS.
Definition: ff-mac-common.h:268
ns3::MakeUintegerAccessor
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
ns3::FdTbfqFfMacScheduler::m_a30CqiTimers
std::map< uint16_t, uint32_t > m_a30CqiTimers
Map of UE's timers on DL CQI A30 received.
Definition: fdtbfq-ff-mac-scheduler.h:360
ns3::FfMacSchedSapProvider::SchedDlRachInfoReqParameters::m_rachList
std::vector< struct RachListElement_s > m_rachList
RACH list.
Definition: ff-mac-sched-sap.h:115
ns3::TransmissionModesLayers::TxMode2LayerNum
static uint8_t TxMode2LayerNum(uint8_t txMode)
Transmit mode 2 layer number.
Definition: lte-common.cc:212
ns3::DlDciListElement_s::m_rbBitmap
uint32_t m_rbBitmap
RB bitmap.
Definition: ff-mac-common.h:96
ns3::FdTbfqFfMacScheduler::DoCschedCellConfigReq
void DoCschedCellConfigReq(const struct FfMacCschedSapProvider::CschedCellConfigReqParameters &params)
Csched cell config request function.
Definition: fdtbfq-ff-mac-scheduler.cc:172
SRS_CQI_RNTI_VSP
#define SRS_CQI_RNTI_VSP
Definition: lte-vendor-specific-parameters.h:27
ns3::UlGrant_s::m_rnti
uint16_t m_rnti
RNTI.
Definition: ff-mac-common.h:264
ns3::DlDciListElement_s::m_ndi
std::vector< uint8_t > m_ndi
New data indicator.
Definition: ff-mac-common.h:101
ns3::FfMacCschedSapProvider::CschedCellConfigReqParameters::m_ulBandwidth
uint16_t m_ulBandwidth
UL bandwidth.
Definition: ff-mac-csched-sap.h:87
ns3::BuildDataListElement_s
See section 4.3.8 builDataListElement.
Definition: ff-mac-common.h:252
ns3::DlInfoListElement_s::NACK
@ NACK
Definition: ff-mac-common.h:436
ns3::BuildDataListElement_s::m_dci
struct DlDciListElement_s m_dci
DCI.
Definition: ff-mac-common.h:254
ns3::FfMacScheduler::SRS_UL_CQI
@ SRS_UL_CQI
Definition: ff-mac-scheduler.h:63
ns3::fdtbfqsFlowPerf_t::packetArrivalRate
uint64_t packetArrivalRate
packet arrival rate( byte/s)
Definition: fdtbfq-ff-mac-scheduler.h:66
ns3::FdTbfqFfMacScheduler::m_ulHarqProcessesStatus
std::map< uint16_t, UlHarqProcessesStatus_t > m_ulHarqProcessesStatus
UL HARQ process status.
Definition: fdtbfq-ff-mac-scheduler.h:429
ns3::FdTbfqFfMacScheduler::DoCschedUeReleaseReq
void DoCschedUeReleaseReq(const struct FfMacCschedSapProvider::CschedUeReleaseReqParameters &params)
CSched UE release request function.
Definition: fdtbfq-ff-mac-scheduler.cc:303
ns3::DlDciListElement_s::m_rv
std::vector< uint8_t > m_rv
Redundancy version.
Definition: ff-mac-common.h:102
ns3::UlDciListElement_s::m_dai
uint8_t m_dai
DL assignment index.
Definition: ff-mac-common.h:156
ns3::FfMacSchedSapProvider
Provides the SCHED SAP.
Definition: ff-mac-sched-sap.h:47
ns3::Time::MS
@ MS
millisecond
Definition: nstime.h:116
ns3::LteFfrSapProvider::GetAvailableDlRbg
virtual std::vector< bool > GetAvailableDlRbg()=0
Get vector of available RBG in DL for this Cell.
ns3::FdTbfqFfMacScheduler::m_dlHarqCurrentProcessId
std::map< uint16_t, uint8_t > m_dlHarqCurrentProcessId
DL HARQ current process ID.
Definition: fdtbfq-ff-mac-scheduler.h:415
ns3::UlHarqProcessesStatus_t
std::vector< uint8_t > UlHarqProcessesStatus_t
UL HARQ process status vector.
Definition: cqa-ff-mac-scheduler.h:60
ns3::FdTbfqFfMacScheduler::SetLteFfrSapProvider
virtual void SetLteFfrSapProvider(LteFfrSapProvider *s)
Set FFR SAP provider function.
Definition: fdtbfq-ff-mac-scheduler.cc:160
ns3::UlDciListElement_s::m_tbSize
uint16_t m_tbSize
size
Definition: ff-mac-common.h:145
ns3::FdTbfqFfMacScheduler::HarqProcessAvailability
uint8_t HarqProcessAvailability(uint16_t rnti)
Return the availability of free process for the RNTI specified.
Definition: fdtbfq-ff-mac-scheduler.cc:422
ns3::LteFfrSapProvider::ReportDlCqiInfo
virtual void ReportDlCqiInfo(const struct FfMacSchedSapProvider::SchedDlCqiInfoReqParameters &params)=0
ReportDlCqiInfo.
ns3::FdTbfqFfMacScheduler::m_dlInfoListBuffered
std::vector< DlInfoListElement_s > m_dlInfoListBuffered
HARQ retx buffered.
Definition: fdtbfq-ff-mac-scheduler.h:423
ns3::FdTbfqFfMacScheduler::m_creditLimit
uint32_t m_creditLimit
flow credit limit (byte)
Definition: fdtbfq-ff-mac-scheduler.h:407
ns3::FdTbfqFfMacScheduler::m_cschedSapProvider
FfMacCschedSapProvider * m_cschedSapProvider
CSched SAP provider.
Definition: fdtbfq-ff-mac-scheduler.h:386
ns3::FdTbfqFfMacScheduler::m_rachAllocationMap
std::vector< uint16_t > m_rachAllocationMap
RACH allocation map.
Definition: fdtbfq-ff-mac-scheduler.h:435
ns3::LteFfrSapProvider::IsDlRbgAvailableForUe
virtual bool IsDlRbgAvailableForUe(int i, uint16_t rnti)=0
Check if UE can be served on i-th RB in DL.
ns3::LteFfrSapProvider::GetMinContinuousUlBandwidth
virtual uint16_t GetMinContinuousUlBandwidth()=0
Get the minimum continuous Ul bandwidth.
ns3::FfMacSchedSapUser::SchedDlConfigIndParameters
Parameters of the API primitives.
Definition: ff-mac-sched-sap.h:294
ns3::FdTbfqFfMacScheduler::m_cschedSapUser
FfMacCschedSapUser * m_cschedSapUser
Csched SAP user.
Definition: fdtbfq-ff-mac-scheduler.h:384
ns3::DlDciListElement_s::m_harqProcess
uint8_t m_harqProcess
HARQ process.
Definition: ff-mac-common.h:112
ns3::FdTbfqFfMacScheduler::DoSchedUlTriggerReq
void DoSchedUlTriggerReq(const struct FfMacSchedSapProvider::SchedUlTriggerReqParameters &params)
Sched UL trigger request function.
Definition: fdtbfq-ff-mac-scheduler.cc:1617