A Discrete-Event Network Simulator
API
lte-enb-mac.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  * Nicola Baldo <nbaldo@cttc.es>
20  */
21 
22 
23 #include <ns3/log.h>
24 #include <ns3/pointer.h>
25 #include <ns3/packet.h>
26 #include <ns3/simulator.h>
27 
28 #include "lte-amc.h"
29 #include "lte-control-messages.h"
30 #include "lte-enb-net-device.h"
31 #include "lte-ue-net-device.h"
32 
33 #include <ns3/lte-enb-mac.h>
34 #include <ns3/lte-radio-bearer-tag.h>
35 #include <ns3/lte-ue-phy.h>
36 
37 #include "ns3/lte-mac-sap.h"
38 #include <ns3/lte-common.h>
39 
40 
41 namespace ns3 {
42 
43 NS_LOG_COMPONENT_DEFINE ("LteEnbMac");
44 
45 NS_OBJECT_ENSURE_REGISTERED (LteEnbMac);
46 
47 
48 
49 // //////////////////////////////////////
50 // member SAP forwarders
51 // //////////////////////////////////////
52 
53 
55 {
56 public:
58 
59  // inherited from LteEnbCmacSapProvider
60  virtual void ConfigureMac (uint8_t ulBandwidth, uint8_t dlBandwidth);
61  virtual void AddUe (uint16_t rnti);
62  virtual void RemoveUe (uint16_t rnti);
63  virtual void AddLc (LcInfo lcinfo, LteMacSapUser* msu);
64  virtual void ReconfigureLc (LcInfo lcinfo);
65  virtual void ReleaseLc (uint16_t rnti, uint8_t lcid);
66  virtual void UeUpdateConfigurationReq (UeConfig params);
67  virtual RachConfig GetRachConfig ();
69 
70 
71 private:
73 };
74 
75 
77  : m_mac (mac)
78 {
79 }
80 
81 void
82 EnbMacMemberLteEnbCmacSapProvider::ConfigureMac (uint8_t ulBandwidth, uint8_t dlBandwidth)
83 {
84  m_mac->DoConfigureMac (ulBandwidth, dlBandwidth);
85 }
86 
87 void
89 {
90  m_mac->DoAddUe (rnti);
91 }
92 
93 void
95 {
96  m_mac->DoRemoveUe (rnti);
97 }
98 
99 void
101 {
102  m_mac->DoAddLc (lcinfo, msu);
103 }
104 
105 void
107 {
108  m_mac->DoReconfigureLc (lcinfo);
109 }
110 
111 void
112 EnbMacMemberLteEnbCmacSapProvider::ReleaseLc (uint16_t rnti, uint8_t lcid)
113 {
114  m_mac->DoReleaseLc (rnti, lcid);
115 }
116 
117 void
119 {
121 }
122 
125 {
126  return m_mac->DoGetRachConfig ();
127 }
128 
131 {
132  return m_mac->DoAllocateNcRaPreamble (rnti);
133 }
134 
135 
137 {
138 public:
140 
141 
142  virtual void SchedDlConfigInd (const struct SchedDlConfigIndParameters& params);
143  virtual void SchedUlConfigInd (const struct SchedUlConfigIndParameters& params);
144 private:
146 };
147 
148 
150  : m_mac (mac)
151 {
152 }
153 
154 
155 void
157 {
158  m_mac->DoSchedDlConfigInd (params);
159 }
160 
161 
162 
163 void
165 {
166  m_mac->DoSchedUlConfigInd (params);
167 }
168 
169 
170 
172 {
173 public:
175 
176  virtual void CschedCellConfigCnf (const struct CschedCellConfigCnfParameters& params);
177  virtual void CschedUeConfigCnf (const struct CschedUeConfigCnfParameters& params);
178  virtual void CschedLcConfigCnf (const struct CschedLcConfigCnfParameters& params);
179  virtual void CschedLcReleaseCnf (const struct CschedLcReleaseCnfParameters& params);
180  virtual void CschedUeReleaseCnf (const struct CschedUeReleaseCnfParameters& params);
181  virtual void CschedUeConfigUpdateInd (const struct CschedUeConfigUpdateIndParameters& params);
182  virtual void CschedCellConfigUpdateInd (const struct CschedCellConfigUpdateIndParameters& params);
183 
184 private:
186 };
187 
188 
190  : m_mac (mac)
191 {
192 }
193 
194 void
196 {
197  m_mac->DoCschedCellConfigCnf (params);
198 }
199 
200 void
202 {
203  m_mac->DoCschedUeConfigCnf (params);
204 }
205 
206 void
208 {
209  m_mac->DoCschedLcConfigCnf (params);
210 }
211 
212 void
214 {
215  m_mac->DoCschedLcReleaseCnf (params);
216 }
217 
218 void
220 {
221  m_mac->DoCschedUeReleaseCnf (params);
222 }
223 
224 void
226 {
228 }
229 
230 void
232 {
234 }
235 
236 
237 
238 // ---------- PHY-SAP
239 
240 
242 {
243 public:
245 
246  // inherited from LteEnbPhySapUser
247  virtual void ReceivePhyPdu (Ptr<Packet> p);
248  virtual void SubframeIndication (uint32_t frameNo, uint32_t subframeNo);
250  virtual void ReceiveRachPreamble (uint32_t prachId);
254 
255 private:
257 };
258 
260 {
261 }
262 
263 
264 void
266 {
267  m_mac->DoReceivePhyPdu (p);
268 }
269 
270 void
271 EnbMacMemberLteEnbPhySapUser::SubframeIndication (uint32_t frameNo, uint32_t subframeNo)
272 {
273  m_mac->DoSubframeIndication (frameNo, subframeNo);
274 }
275 
276 void
278 {
280 }
281 
282 void
284 {
285  m_mac->DoReceiveRachPreamble (prachId);
286 }
287 
288 void
290 {
291  m_mac->DoUlCqiReport (ulcqi);
292 }
293 
294 void
296 {
298 }
299 
300 void
302 {
304 }
305 
306 
307 // //////////////////////////////////////
308 // generic LteEnbMac methods
309 // //////////////////////////////////////
310 
311 
312 TypeId
314 {
315  static TypeId tid = TypeId ("ns3::LteEnbMac")
316  .SetParent<Object> ()
317  .SetGroupName("Lte")
318  .AddConstructor<LteEnbMac> ()
319  .AddAttribute ("NumberOfRaPreambles",
320  "how many random access preambles are available for the contention based RACH process",
321  UintegerValue (50),
323  MakeUintegerChecker<uint8_t> (4, 64))
324  .AddAttribute ("PreambleTransMax",
325  "Maximum number of random access preamble transmissions",
326  UintegerValue (50),
328  MakeUintegerChecker<uint8_t> (3, 200))
329  .AddAttribute ("RaResponseWindowSize",
330  "length of the window (in TTIs) for the reception of the random access response (RAR); the resulting RAR timeout is this value + 3 ms",
331  UintegerValue (3),
333  MakeUintegerChecker<uint8_t> (2, 10))
334  .AddTraceSource ("DlScheduling",
335  "Information regarding DL scheduling.",
337  "ns3::LteEnbMac::DlSchedulingTracedCallback")
338  .AddTraceSource ("UlScheduling",
339  "Information regarding UL scheduling.",
341  "ns3::LteEnbMac::UlSchedulingTracedCallback")
342  ;
343 
344  return tid;
345 }
346 
347 
349 {
350  NS_LOG_FUNCTION (this);
356 }
357 
358 
360 {
361  NS_LOG_FUNCTION (this);
362 }
363 
364 void
366 {
367  NS_LOG_FUNCTION (this);
368  m_dlCqiReceived.clear ();
369  m_ulCqiReceived.clear ();
370  m_ulCeReceived.clear ();
371  m_dlInfoListReceived.clear ();
372  m_ulInfoListReceived.clear ();
374  delete m_macSapProvider;
375  delete m_cmacSapProvider;
376  delete m_schedSapUser;
377  delete m_cschedSapUser;
378  delete m_enbPhySapUser;
379 }
380 
381 
382 void
384 {
385  m_schedSapProvider = s;
386 }
387 
390 {
391  return m_schedSapUser;
392 }
393 
394 void
396 {
398 }
399 
402 {
403  return m_cschedSapUser;
404 }
405 
406 
407 
408 void
410 {
411  m_macSapUser = s;
412 }
413 
416 {
417  return m_macSapProvider;
418 }
419 
420 void
422 {
423  m_cmacSapUser = s;
424 }
425 
428 {
429  return m_cmacSapProvider;
430 }
431 
432 void
434 {
436 }
437 
438 
441 {
442  return m_enbPhySapUser;
443 }
444 
445 
446 
447 void
448 LteEnbMac::DoSubframeIndication (uint32_t frameNo, uint32_t subframeNo)
449 {
450  NS_LOG_FUNCTION (this << " EnbMac - frame " << frameNo << " subframe " << subframeNo);
451 
452  // Store current frame / subframe number
453  m_frameNo = frameNo;
454  m_subframeNo = subframeNo;
455 
456 
457  // --- DOWNLINK ---
458  // Send Dl-CQI info to the scheduler
459  if (m_dlCqiReceived.size () > 0)
460  {
462  dlcqiInfoReq.m_sfnSf = ((0x3FF & frameNo) << 4) | (0xF & subframeNo);
463 
464  int cqiNum = m_dlCqiReceived.size ();
465  if (cqiNum > MAX_CQI_LIST)
466  {
467  cqiNum = MAX_CQI_LIST;
468  }
469  dlcqiInfoReq.m_cqiList.insert (dlcqiInfoReq.m_cqiList.begin (), m_dlCqiReceived.begin (), m_dlCqiReceived.end ());
470  m_dlCqiReceived.erase (m_dlCqiReceived.begin (), m_dlCqiReceived.end ());
471  m_schedSapProvider->SchedDlCqiInfoReq (dlcqiInfoReq);
472  }
473 
474  if (!m_receivedRachPreambleCount.empty ())
475  {
476  // process received RACH preambles and notify the scheduler
478  NS_ASSERT (subframeNo > 0 && subframeNo <= 10); // subframe in 1..10
479  for (std::map<uint8_t, uint32_t>::const_iterator it = m_receivedRachPreambleCount.begin ();
480  it != m_receivedRachPreambleCount.end ();
481  ++it)
482  {
483  NS_LOG_INFO (this << " preambleId " << (uint32_t) it->first << ": " << it->second << " received");
484  NS_ASSERT (it->second != 0);
485  if (it->second > 1)
486  {
487  NS_LOG_INFO ("preambleId " << (uint32_t) it->first << ": collision");
488  // in case of collision we assume that no preamble is
489  // successfully received, hence no RAR is sent
490  }
491  else
492  {
493  uint16_t rnti;
494  std::map<uint8_t, NcRaPreambleInfo>::iterator jt = m_allocatedNcRaPreambleMap.find (it->first);
495  if (jt != m_allocatedNcRaPreambleMap.end ())
496  {
497  rnti = jt->second.rnti;
498  NS_LOG_INFO ("preambleId previously allocated for NC based RA, RNTI =" << (uint32_t) rnti << ", sending RAR");
499 
500  }
501  else
502  {
504  NS_LOG_INFO ("preambleId " << (uint32_t) it->first << ": allocated T-C-RNTI " << (uint32_t) rnti << ", sending RAR");
505  }
506 
507  RachListElement_s rachLe;
508  rachLe.m_rnti = rnti;
509  rachLe.m_estimatedSize = 144; // to be confirmed
510  rachInfoReqParams.m_rachList.push_back (rachLe);
511  m_rapIdRntiMap.insert (std::pair <uint16_t, uint32_t> (rnti, it->first));
512  }
513  }
514  m_schedSapProvider->SchedDlRachInfoReq (rachInfoReqParams);
516  }
517  // Get downlink transmission opportunities
518  uint32_t dlSchedFrameNo = m_frameNo;
519  uint32_t dlSchedSubframeNo = m_subframeNo;
520  // NS_LOG_DEBUG (this << " sfn " << frameNo << " sbfn " << subframeNo);
521  if (dlSchedSubframeNo + m_macChTtiDelay > 10)
522  {
523  dlSchedFrameNo++;
524  dlSchedSubframeNo = (dlSchedSubframeNo + m_macChTtiDelay) % 10;
525  }
526  else
527  {
528  dlSchedSubframeNo = dlSchedSubframeNo + m_macChTtiDelay;
529  }
531  dlparams.m_sfnSf = ((0x3FF & dlSchedFrameNo) << 4) | (0xF & dlSchedSubframeNo);
532 
533  // Forward DL HARQ feebacks collected during last TTI
534  if (m_dlInfoListReceived.size () > 0)
535  {
537  // empty local buffer
538  m_dlInfoListReceived.clear ();
539  }
540 
542 
543 
544  // --- UPLINK ---
545  // Send UL-CQI info to the scheduler
546  std::vector <FfMacSchedSapProvider::SchedUlCqiInfoReqParameters>::iterator itCqi;
547  for (uint16_t i = 0; i < m_ulCqiReceived.size (); i++)
548  {
549  if (subframeNo > 1)
550  {
551  m_ulCqiReceived.at (i).m_sfnSf = ((0x3FF & frameNo) << 4) | (0xF & (subframeNo - 1));
552  }
553  else
554  {
555  m_ulCqiReceived.at (i).m_sfnSf = ((0x3FF & (frameNo - 1)) << 4) | (0xF & 10);
556  }
558  }
559  m_ulCqiReceived.clear ();
560 
561  // Send BSR reports to the scheduler
562  if (m_ulCeReceived.size () > 0)
563  {
565  ulMacReq.m_sfnSf = ((0x3FF & frameNo) << 4) | (0xF & subframeNo);
566  ulMacReq.m_macCeList.insert (ulMacReq.m_macCeList.begin (), m_ulCeReceived.begin (), m_ulCeReceived.end ());
567  m_ulCeReceived.erase (m_ulCeReceived.begin (), m_ulCeReceived.end ());
569  }
570 
571 
572  // Get uplink transmission opportunities
573  uint32_t ulSchedFrameNo = m_frameNo;
574  uint32_t ulSchedSubframeNo = m_subframeNo;
575  // NS_LOG_DEBUG (this << " sfn " << frameNo << " sbfn " << subframeNo);
576  if (ulSchedSubframeNo + (m_macChTtiDelay + UL_PUSCH_TTIS_DELAY) > 10)
577  {
578  ulSchedFrameNo++;
579  ulSchedSubframeNo = (ulSchedSubframeNo + (m_macChTtiDelay + UL_PUSCH_TTIS_DELAY)) % 10;
580  }
581  else
582  {
583  ulSchedSubframeNo = ulSchedSubframeNo + (m_macChTtiDelay + UL_PUSCH_TTIS_DELAY);
584  }
586  ulparams.m_sfnSf = ((0x3FF & ulSchedFrameNo) << 4) | (0xF & ulSchedSubframeNo);
587 
588  // Forward DL HARQ feebacks collected during last TTI
589  if (m_ulInfoListReceived.size () > 0)
590  {
592  // empty local buffer
593  m_ulInfoListReceived.clear ();
594  }
595 
597 
598 }
599 
600 
601 void
603 {
604  NS_LOG_FUNCTION (this << msg);
605  if (msg->GetMessageType () == LteControlMessage::DL_CQI)
606  {
607  Ptr<DlCqiLteControlMessage> dlcqi = DynamicCast<DlCqiLteControlMessage> (msg);
609  }
610  else if (msg->GetMessageType () == LteControlMessage::BSR)
611  {
612  Ptr<BsrLteControlMessage> bsr = DynamicCast<BsrLteControlMessage> (msg);
613  ReceiveBsrMessage (bsr->GetBsr ());
614  }
615  else if (msg->GetMessageType () == LteControlMessage::DL_HARQ)
616  {
617  Ptr<DlHarqFeedbackLteControlMessage> dlharq = DynamicCast<DlHarqFeedbackLteControlMessage> (msg);
618  DoDlInfoListElementHarqFeeback (dlharq->GetDlHarqFeedback ());
619  }
620  else
621  {
622  NS_LOG_LOGIC (this << " LteControlMessage type " << msg->GetMessageType () << " not recognized");
623  }
624 }
625 
626 void
628 {
629  NS_LOG_FUNCTION (this << (uint32_t) rapId);
630  // just record that the preamble has been received; it will be processed later
631  ++m_receivedRachPreambleCount[rapId]; // will create entry if not exists
632 }
633 
634 void
636 {
637  if (ulcqi.m_ulCqi.m_type == UlCqi_s::PUSCH)
638  {
639  NS_LOG_DEBUG (this << " eNB rxed an PUSCH UL-CQI");
640  }
641  else if (ulcqi.m_ulCqi.m_type == UlCqi_s::SRS)
642  {
643  NS_LOG_DEBUG (this << " eNB rxed an SRS UL-CQI");
644  }
645  m_ulCqiReceived.push_back (ulcqi);
646 }
647 
648 
649 void
651 {
652  NS_LOG_FUNCTION (this << msg);
653 
654  CqiListElement_s dlcqi = msg->GetDlCqi ();
655  NS_LOG_LOGIC (this << "Enb Received DL-CQI rnti" << dlcqi.m_rnti);
656  NS_ASSERT (dlcqi.m_rnti != 0);
657  m_dlCqiReceived.push_back (dlcqi);
658 
659 }
660 
661 
662 void
664 {
665  NS_LOG_FUNCTION (this);
666 
667  m_ulCeReceived.push_back (bsr);
668 }
669 
670 
671 void
673 {
674  NS_LOG_FUNCTION (this);
675  LteRadioBearerTag tag;
676  p->RemovePacketTag (tag);
677 
678  // store info of the packet received
679 
680 // std::map <uint16_t,UlInfoListElement_s>::iterator it;
681 // u_int rnti = tag.GetRnti ();
682 // u_int lcid = tag.GetLcid ();
683 // it = m_ulInfoListElements.find (tag.GetRnti ());
684 // if (it == m_ulInfoListElements.end ())
685 // {
686 // // new RNTI
687 // UlInfoListElement_s ulinfonew;
688 // ulinfonew.m_rnti = tag.GetRnti ();
689 // // always allocate full size of ulReception vector, initializing all elements to 0
690 // ulinfonew.m_ulReception.assign (MAX_LC_LIST+1, 0);
691 // // set the element for the current LCID
692 // ulinfonew.m_ulReception.at (tag.GetLcid ()) = p->GetSize ();
693 // ulinfonew.m_receptionStatus = UlInfoListElement_s::Ok;
694 // ulinfonew.m_tpc = 0; // Tx power control not implemented at this stage
695 // m_ulInfoListElements.insert (std::pair<uint16_t, UlInfoListElement_s > (tag.GetRnti (), ulinfonew));
696 //
697 // }
698 // else
699 // {
700 // // existing RNTI: we just set the value for the current
701 // // LCID. Note that the corresponding element had already been
702 // // allocated previously.
703 // NS_ASSERT_MSG ((*it).second.m_ulReception.at (tag.GetLcid ()) == 0, "would overwrite previously written ulReception element");
704 // (*it).second.m_ulReception.at (tag.GetLcid ()) = p->GetSize ();
705 // (*it).second.m_receptionStatus = UlInfoListElement_s::Ok;
706 // }
707 
708 
709 
710  // forward the packet to the correspondent RLC
711  uint16_t rnti = tag.GetRnti ();
712  uint8_t lcid = tag.GetLcid ();
713  std::map <uint16_t, std::map<uint8_t, LteMacSapUser*> >::iterator rntiIt = m_rlcAttached.find (rnti);
714  NS_ASSERT_MSG (rntiIt != m_rlcAttached.end (), "could not find RNTI" << rnti);
715  std::map<uint8_t, LteMacSapUser*>::iterator lcidIt = rntiIt->second.find (lcid);
716  //NS_ASSERT_MSG (lcidIt != rntiIt->second.end (), "could not find LCID" << lcid);
717 
718  //Receive PDU only if LCID is found
719  if (lcidIt != rntiIt->second.end ())
720  {
721  (*lcidIt).second->ReceivePdu (p);
722  }
723 }
724 
725 
726 
727 // ////////////////////////////////////////////
728 // CMAC SAP
729 // ////////////////////////////////////////////
730 
731 void
732 LteEnbMac::DoConfigureMac (uint8_t ulBandwidth, uint8_t dlBandwidth)
733 {
734  NS_LOG_FUNCTION (this << " ulBandwidth=" << (uint16_t) ulBandwidth << " dlBandwidth=" << (uint16_t) dlBandwidth);
736  // Configure the subset of parameters used by FfMacScheduler
737  params.m_ulBandwidth = ulBandwidth;
738  params.m_dlBandwidth = dlBandwidth;
740  // ...more parameters can be configured
742 }
743 
744 
745 void
746 LteEnbMac::DoAddUe (uint16_t rnti)
747 {
748  NS_LOG_FUNCTION (this << " rnti=" << rnti);
749  std::map<uint8_t, LteMacSapUser*> empty;
750  std::pair <std::map <uint16_t, std::map<uint8_t, LteMacSapUser*> >::iterator, bool>
751  ret = m_rlcAttached.insert (std::pair <uint16_t, std::map<uint8_t, LteMacSapUser*> >
752  (rnti, empty));
753  NS_ASSERT_MSG (ret.second, "element already present, RNTI already existed");
754 
756  params.m_rnti = rnti;
757  params.m_transmissionMode = 0; // set to default value (SISO) for avoiding random initialization (valgrind error)
758 
760 
761  // Create DL trasmission HARQ buffers
762  std::vector < Ptr<PacketBurst> > dlHarqLayer0pkt;
763  dlHarqLayer0pkt.resize (8);
764  for (uint8_t i = 0; i < 8; i++)
765  {
766  Ptr<PacketBurst> pb = CreateObject <PacketBurst> ();
767  dlHarqLayer0pkt.at (i) = pb;
768  }
769  std::vector < Ptr<PacketBurst> > dlHarqLayer1pkt;
770  dlHarqLayer1pkt.resize (8);
771  for (uint8_t i = 0; i < 8; i++)
772  {
773  Ptr<PacketBurst> pb = CreateObject <PacketBurst> ();
774  dlHarqLayer1pkt.at (i) = pb;
775  }
777  buf.push_back (dlHarqLayer0pkt);
778  buf.push_back (dlHarqLayer1pkt);
779  m_miDlHarqProcessesPackets.insert (std::pair <uint16_t, DlHarqProcessesBuffer_t> (rnti, buf));
780 }
781 
782 void
783 LteEnbMac::DoRemoveUe (uint16_t rnti)
784 {
785  NS_LOG_FUNCTION (this << " rnti=" << rnti);
787  params.m_rnti = rnti;
789  m_rlcAttached.erase (rnti);
790  m_miDlHarqProcessesPackets.erase (rnti);
791 }
792 
793 void
795 {
796  NS_LOG_FUNCTION (this);
797 
798  std::map <LteFlowId_t, LteMacSapUser* >::iterator it;
799 
800  LteFlowId_t flow (lcinfo.rnti, lcinfo.lcId);
801 
802  std::map <uint16_t, std::map<uint8_t, LteMacSapUser*> >::iterator rntiIt = m_rlcAttached.find (lcinfo.rnti);
803  NS_ASSERT_MSG (rntiIt != m_rlcAttached.end (), "RNTI not found");
804  std::map<uint8_t, LteMacSapUser*>::iterator lcidIt = rntiIt->second.find (lcinfo.lcId);
805  if (lcidIt == rntiIt->second.end ())
806  {
807  rntiIt->second.insert (std::pair<uint8_t, LteMacSapUser*> (lcinfo.lcId, msu));
808  }
809  else
810  {
811  NS_LOG_ERROR ("LC already exists");
812  }
813 
814  // CCCH (LCID 0) is pre-configured
815  // see FF LTE MAC Scheduler
816  // Interface Specification v1.11,
817  // 4.3.4 logicalChannelConfigListElement
818  if (lcinfo.lcId != 0)
819  {
821  params.m_rnti = lcinfo.rnti;
822  params.m_reconfigureFlag = false;
823 
825  lccle.m_logicalChannelIdentity = lcinfo.lcId;
826  lccle.m_logicalChannelGroup = lcinfo.lcGroup;
829  lccle.m_qci = lcinfo.qci;
830  lccle.m_eRabMaximulBitrateUl = lcinfo.mbrUl;
831  lccle.m_eRabMaximulBitrateDl = lcinfo.mbrDl;
832  lccle.m_eRabGuaranteedBitrateUl = lcinfo.gbrUl;
833  lccle.m_eRabGuaranteedBitrateDl = lcinfo.gbrDl;
834  params.m_logicalChannelConfigList.push_back (lccle);
835 
837  }
838 }
839 
840 void
842 {
843  NS_FATAL_ERROR ("not implemented");
844 }
845 
846 void
847 LteEnbMac::DoReleaseLc (uint16_t rnti, uint8_t lcid)
848 {
849  NS_LOG_FUNCTION (this);
850 
851  //Find user based on rnti and then erase lcid stored against the same
852  std::map <uint16_t, std::map<uint8_t, LteMacSapUser*> >::iterator rntiIt = m_rlcAttached.find (rnti);
853  rntiIt->second.erase (lcid);
854 
856  params.m_rnti = rnti;
857  params.m_logicalChannelIdentity.push_back (lcid);
859 }
860 
861 void
863 {
864  NS_LOG_FUNCTION (this);
865 
866  // propagates to scheduler
868  req.m_rnti = params.m_rnti;
870  req.m_reconfigureFlag = true;
872 }
873 
876 {
881  return rc;
882 }
883 
886 {
887  bool found = false;
888  uint8_t preambleId;
889  for (preambleId = m_numberOfRaPreambles; preambleId < 64; ++preambleId)
890  {
891  std::map<uint8_t, NcRaPreambleInfo>::iterator it = m_allocatedNcRaPreambleMap.find (preambleId);
892  if ((it == m_allocatedNcRaPreambleMap.end ())
893  || (it->second.expiryTime < Simulator::Now ()))
894  {
895  found = true;
896  NcRaPreambleInfo preambleInfo;
897  uint32_t expiryIntervalMs = (uint32_t) m_preambleTransMax * ((uint32_t) m_raResponseWindowSize + 5);
898 
899  preambleInfo.expiryTime = Simulator::Now () + MilliSeconds (expiryIntervalMs);
900  preambleInfo.rnti = rnti;
901  NS_LOG_INFO ("allocated preamble for NC based RA: preamble " << preambleId << ", RNTI " << preambleInfo.rnti << ", exiryTime " << preambleInfo.expiryTime);
902  m_allocatedNcRaPreambleMap[preambleId] = preambleInfo; // create if not exist, update otherwise
903  break;
904  }
905  }
907  if (found)
908  {
909  ret.valid = true;
910  ret.raPreambleId = preambleId;
911  ret.raPrachMaskIndex = 0;
912  }
913  else
914  {
915  ret.valid = false;
916  ret.raPreambleId = 0;
917  ret.raPrachMaskIndex = 0;
918  }
919  return ret;
920 }
921 
922 
923 
924 // ////////////////////////////////////////////
925 // MAC SAP
926 // ////////////////////////////////////////////
927 
928 
929 void
931 {
932  NS_LOG_FUNCTION (this);
933  LteRadioBearerTag tag (params.rnti, params.lcid, params.layer);
934  params.pdu->AddPacketTag (tag);
935  // Store pkt in HARQ buffer
936  std::map <uint16_t, DlHarqProcessesBuffer_t>::iterator it = m_miDlHarqProcessesPackets.find (params.rnti);
937  NS_ASSERT (it != m_miDlHarqProcessesPackets.end ());
938  NS_LOG_DEBUG (this << " LAYER " << (uint16_t)tag.GetLayer () << " HARQ ID " << (uint16_t)params.harqProcessId);
939 
940  //(*it).second.at (params.layer).at (params.harqProcessId) = params.pdu;//->Copy ();
941  (*it).second.at (params.layer).at (params.harqProcessId)->AddPacket (params.pdu);
943 }
944 
945 void
947 {
948  NS_LOG_FUNCTION (this);
950  req.m_rnti = params.rnti;
951  req.m_logicalChannelIdentity = params.lcid;
956  req.m_rlcStatusPduSize = params.statusPduSize;
958 }
959 
960 
961 
962 // ////////////////////////////////////////////
963 // SCHED SAP
964 // ////////////////////////////////////////////
965 
966 
967 
968 void
970 {
971  NS_LOG_FUNCTION (this);
972  // Create DL PHY PDU
973  Ptr<PacketBurst> pb = CreateObject<PacketBurst> ();
974  std::map <LteFlowId_t, LteMacSapUser* >::iterator it;
975 
976  for (unsigned int i = 0; i < ind.m_buildDataList.size (); i++)
977  {
978  for (uint16_t layer = 0; layer < ind.m_buildDataList.at (i).m_dci.m_ndi.size (); layer++)
979  {
980  if (ind.m_buildDataList.at (i).m_dci.m_ndi.at (layer) == 1)
981  {
982  // new data -> force emptying correspondent harq pkt buffer
983  std::map <uint16_t, DlHarqProcessesBuffer_t>::iterator it = m_miDlHarqProcessesPackets.find (ind.m_buildDataList.at (i).m_rnti);
984  NS_ASSERT (it != m_miDlHarqProcessesPackets.end ());
985  for (uint16_t lcId = 0; lcId < (*it).second.size (); lcId++)
986  {
987  Ptr<PacketBurst> pb = CreateObject <PacketBurst> ();
988  (*it).second.at (lcId).at (ind.m_buildDataList.at (i).m_dci.m_harqProcess) = pb;
989  }
990  }
991  }
992  for (unsigned int j = 0; j < ind.m_buildDataList.at (i).m_rlcPduList.size (); j++)
993  {
994  for (uint16_t k = 0; k < ind.m_buildDataList.at (i).m_rlcPduList.at (j).size (); k++)
995  {
996  if (ind.m_buildDataList.at (i).m_dci.m_ndi.at (k) == 1)
997  {
998  // New Data -> retrieve it from RLC
999  uint16_t rnti = ind.m_buildDataList.at (i).m_rnti;
1000  uint8_t lcid = ind.m_buildDataList.at (i).m_rlcPduList.at (j).at (k).m_logicalChannelIdentity;
1001  std::map <uint16_t, std::map<uint8_t, LteMacSapUser*> >::iterator rntiIt = m_rlcAttached.find (rnti);
1002  NS_ASSERT_MSG (rntiIt != m_rlcAttached.end (), "could not find RNTI" << rnti);
1003  std::map<uint8_t, LteMacSapUser*>::iterator lcidIt = rntiIt->second.find (lcid);
1004  NS_ASSERT_MSG (lcidIt != rntiIt->second.end (), "could not find LCID" << lcid);
1005  NS_LOG_DEBUG (this << " rnti= " << rnti << " lcid= " << (uint32_t) lcid << " layer= " << k);
1006  (*lcidIt).second->NotifyTxOpportunity (ind.m_buildDataList.at (i).m_rlcPduList.at (j).at (k).m_size, k, ind.m_buildDataList.at (i).m_dci.m_harqProcess);
1007  }
1008  else
1009  {
1010  if (ind.m_buildDataList.at (i).m_dci.m_tbsSize.at (k) > 0)
1011  {
1012  // HARQ retransmission -> retrieve TB from HARQ buffer
1013  std::map <uint16_t, DlHarqProcessesBuffer_t>::iterator it = m_miDlHarqProcessesPackets.find (ind.m_buildDataList.at (i).m_rnti);
1014  NS_ASSERT (it != m_miDlHarqProcessesPackets.end ());
1015  Ptr<PacketBurst> pb = (*it).second.at (k).at ( ind.m_buildDataList.at (i).m_dci.m_harqProcess);
1016  for (std::list<Ptr<Packet> >::const_iterator j = pb->Begin (); j != pb->End (); ++j)
1017  {
1018  Ptr<Packet> pkt = (*j)->Copy ();
1020  }
1021  }
1022  }
1023  }
1024  }
1025  // send the relative DCI
1026  Ptr<DlDciLteControlMessage> msg = Create<DlDciLteControlMessage> ();
1027  msg->SetDci (ind.m_buildDataList.at (i).m_dci);
1029  }
1030 
1031  // Fire the trace with the DL information
1032  for ( uint32_t i = 0; i < ind.m_buildDataList.size (); i++ )
1033  {
1034  // Only one TB used
1035  if (ind.m_buildDataList.at (i).m_dci.m_tbsSize.size () == 1)
1036  {
1037  m_dlScheduling (m_frameNo, m_subframeNo, ind.m_buildDataList.at (i).m_dci.m_rnti,
1038  ind.m_buildDataList.at (i).m_dci.m_mcs.at (0),
1039  ind.m_buildDataList.at (i).m_dci.m_tbsSize.at (0),
1040  0, 0
1041  );
1042 
1043  }
1044  // Two TBs used
1045  else if (ind.m_buildDataList.at (i).m_dci.m_tbsSize.size () == 2)
1046  {
1047  m_dlScheduling (m_frameNo, m_subframeNo, ind.m_buildDataList.at (i).m_dci.m_rnti,
1048  ind.m_buildDataList.at (i).m_dci.m_mcs.at (0),
1049  ind.m_buildDataList.at (i).m_dci.m_tbsSize.at (0),
1050  ind.m_buildDataList.at (i).m_dci.m_mcs.at (1),
1051  ind.m_buildDataList.at (i).m_dci.m_tbsSize.at (1)
1052  );
1053  }
1054  else
1055  {
1056  NS_FATAL_ERROR ("Found element with more than two transport blocks");
1057  }
1058  }
1059 
1060  // Random Access procedure: send RARs
1061  Ptr<RarLteControlMessage> rarMsg = Create<RarLteControlMessage> ();
1062  // see TS 36.321 5.1.4; preambles were sent two frames ago
1063  // (plus 3GPP counts subframes from 0, not 1)
1064  uint16_t raRnti;
1065  if (m_subframeNo < 3)
1066  {
1067  raRnti = m_subframeNo + 7; // equivalent to +10-3
1068  }
1069  else
1070  {
1071  raRnti = m_subframeNo - 3;
1072  }
1073  rarMsg->SetRaRnti (raRnti);
1074  for (unsigned int i = 0; i < ind.m_buildRarList.size (); i++)
1075  {
1076  std::map <uint8_t, uint32_t>::iterator itRapId = m_rapIdRntiMap.find (ind.m_buildRarList.at (i).m_rnti);
1077  if (itRapId == m_rapIdRntiMap.end ())
1078  {
1079  NS_FATAL_ERROR ("Unable to find rapId of RNTI " << ind.m_buildRarList.at (i).m_rnti);
1080  }
1082  rar.rapId = itRapId->second;
1083  rar.rarPayload = ind.m_buildRarList.at (i);
1084  rarMsg->AddRar (rar);
1085  NS_LOG_INFO (this << " Send RAR message to RNTI " << ind.m_buildRarList.at (i).m_rnti << " rapId " << itRapId->second);
1086  }
1087  if (ind.m_buildRarList.size () > 0)
1088  {
1090  }
1091  m_rapIdRntiMap.clear ();
1092 }
1093 
1094 
1095 void
1097 {
1098  NS_LOG_FUNCTION (this);
1099 
1100  for (unsigned int i = 0; i < ind.m_dciList.size (); i++)
1101  {
1102  // send the correspondent ul dci
1103  Ptr<UlDciLteControlMessage> msg = Create<UlDciLteControlMessage> ();
1104  msg->SetDci (ind.m_dciList.at (i));
1106  }
1107 
1108  // Fire the trace with the UL information
1109  for ( uint32_t i = 0; i < ind.m_dciList.size (); i++ )
1110  {
1111  m_ulScheduling (m_frameNo, m_subframeNo, ind.m_dciList.at (i).m_rnti,
1112  ind.m_dciList.at (i).m_mcs, ind.m_dciList.at (i).m_tbSize);
1113  }
1114 
1115 
1116 
1117 }
1118 
1119 
1120 
1121 
1122 // ////////////////////////////////////////////
1123 // CSCHED SAP
1124 // ////////////////////////////////////////////
1125 
1126 
1127 void
1129 {
1130  NS_LOG_FUNCTION (this);
1131 }
1132 
1133 void
1135 {
1136  NS_LOG_FUNCTION (this);
1137 }
1138 
1139 void
1141 {
1142  NS_LOG_FUNCTION (this);
1143  // Call the CSCHED primitive
1144  // m_cschedSap->LcConfigCompleted();
1145 }
1146 
1147 void
1149 {
1150  NS_LOG_FUNCTION (this);
1151 }
1152 
1153 void
1155 {
1156  NS_LOG_FUNCTION (this);
1157 }
1158 
1159 void
1161 {
1162  NS_LOG_FUNCTION (this);
1163  // propagates to RRC
1164  LteEnbCmacSapUser::UeConfig ueConfigUpdate;
1165  ueConfigUpdate.m_rnti = params.m_rnti;
1166  ueConfigUpdate.m_transmissionMode = params.m_transmissionMode;
1167  m_cmacSapUser->RrcConfigurationUpdateInd (ueConfigUpdate);
1168 }
1169 
1170 void
1172 {
1173  NS_LOG_FUNCTION (this);
1174 }
1175 
1176 void
1178 {
1179  NS_LOG_FUNCTION (this);
1180  m_ulInfoListReceived.push_back (params);
1181 }
1182 
1183 void
1185 {
1186  NS_LOG_FUNCTION (this);
1187  // Update HARQ buffer
1188  std::map <uint16_t, DlHarqProcessesBuffer_t>::iterator it = m_miDlHarqProcessesPackets.find (params.m_rnti);
1189  NS_ASSERT (it != m_miDlHarqProcessesPackets.end ());
1190  for (uint8_t layer = 0; layer < params.m_harqStatus.size (); layer++)
1191  {
1192  if (params.m_harqStatus.at (layer) == DlInfoListElement_s::ACK)
1193  {
1194  // discard buffer
1195  Ptr<PacketBurst> emptyBuf = CreateObject <PacketBurst> ();
1196  (*it).second.at (layer).at (params.m_harqProcessId) = emptyBuf;
1197  NS_LOG_DEBUG (this << " HARQ-ACK UE " << params.m_rnti << " harqId " << (uint16_t)params.m_harqProcessId << " layer " << (uint16_t)layer);
1198  }
1199  else if (params.m_harqStatus.at (layer) == DlInfoListElement_s::NACK)
1200  {
1201  NS_LOG_DEBUG (this << " HARQ-NACK UE " << params.m_rnti << " harqId " << (uint16_t)params.m_harqProcessId << " layer " << (uint16_t)layer);
1202  }
1203  else
1204  {
1205  NS_FATAL_ERROR (" HARQ functionality not implemented");
1206  }
1207  }
1208  m_dlInfoListReceived.push_back (params);
1209 }
1210 
1211 
1212 } // namespace ns3
std::vector< struct UlInfoListElement_s > m_ulInfoList
void DoConfigureMac(uint8_t ulBandwidth, uint8_t dlBandwidth)
Definition: lte-enb-mac.cc:732
void DoReconfigureLc(LteEnbCmacSapProvider::LcInfo lcinfo)
Definition: lte-enb-mac.cc:841
FfMacSchedSapUser * m_schedSapUser
Definition: lte-enb-mac.h:241
Parameters of the CSCHED_LC_CONFIG_CNF primitive.
virtual void UlCqiReport(FfMacSchedSapProvider::SchedUlCqiInfoReqParameters ulcqi)
Returns to MAC level the UL-CQI evaluated.
Definition: lte-enb-mac.cc:289
uint8_t GetLcid(void) const
EnbMacMemberFfMacCschedSapUser(LteEnbMac *mac)
Definition: lte-enb-mac.cc:189
void DoDlInfoListElementHarqFeeback(DlInfoListElement_s params)
a MAC RAR and the corresponding RAPID subheader
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
std::vector< FfMacSchedSapProvider::SchedUlCqiInfoReqParameters > m_ulCqiReceived
Definition: lte-enb-mac.h:218
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition: object-base.h:44
uint16_t m_rnti
UE id within this cell.
virtual void CschedUeConfigReq(const struct CschedUeConfigReqParameters &params)=0
Parameters of the CSCHED_UE_CONFIG_CNF primitive.
Parameters of the CSCHED_UE_RELEASE_REQ primitive.
uint8_t m_transmissionMode
Transmission mode 1..7
void DoReceivePhyPdu(Ptr< Packet > p)
Definition: lte-enb-mac.cc:672
virtual void ReconfigureLc(LcInfo lcinfo)
Reconfigure an existing logical channel.
Definition: lte-enb-mac.cc:106
uint16_t GetRnti(void) const
Parameters of the CSCHED_CELL_CONFIG_UPDATE_IND primitive.
void DoUlInfoListElementHarqFeeback(UlInfoListElement_s params)
LteEnbCmacSapProvider * m_cmacSapProvider
Definition: lte-enb-mac.h:234
std::map< uint16_t, std::map< uint8_t, LteMacSapUser * > > m_rlcAttached
Definition: lte-enb-mac.h:215
enum ns3::UlCqi_s::Type_e m_type
void DoAddLc(LteEnbCmacSapProvider::LcInfo lcinfo, LteMacSapUser *msu)
Definition: lte-enb-mac.cc:794
LteEnbCmacSapProvider::RachConfig DoGetRachConfig()
Definition: lte-enb-mac.cc:875
virtual void SchedDlConfigInd(const struct SchedDlConfigIndParameters &params)
Definition: lte-enb-mac.cc:156
void DoCschedCellConfigUpdateInd(FfMacCschedSapUser::CschedCellConfigUpdateIndParameters params)
void DoReleaseLc(uint16_t rnti, uint8_t lcid)
Definition: lte-enb-mac.cc:847
void SetLteEnbCmacSapUser(LteEnbCmacSapUser *s)
Set the control MAC SAP user.
Definition: lte-enb-mac.cc:421
void AddPacketTag(const Tag &tag) const
Add a packet tag.
Definition: packet.cc:824
void DoSchedUlConfigInd(FfMacSchedSapUser::SchedUlConfigIndParameters params)
std::vector< struct LogicalChannelConfigListElement_s > m_logicalChannelConfigList
uint8_t qci
QoS Class Identifier.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file...
Definition: assert.h:67
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:201
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition: nstime.h:903
virtual void SchedUlTriggerReq(const struct SchedUlTriggerReqParameters &params)=0
virtual void ReceiveRachPreamble(uint32_t prachId)
notify the reception of a RACH preamble on the PRACH
Definition: lte-enb-mac.cc:283
uint8_t m_preambleTransMax
Definition: lte-enb-mac.h:270
Provides the CSCHED SAP.
uint8_t m_transmissionMode
Transmission mode 1..7
virtual uint8_t GetMacChTtiDelay()=0
Get the delay from MAC to Channel expressed in TTIs.
std::vector< struct UlDciListElement_s > m_dciList
See section 4.3.24 cqiListElement.
uint32_t retxQueueSize
the current size of the RLC retransmission queue in bytes
Definition: lte-mac-sap.h:72
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
Definition: log.h:244
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
Definition: fatal-error.h:162
TracedCallback< uint32_t, uint32_t, uint16_t, uint8_t, uint16_t > m_ulScheduling
Trace information regarding UL scheduling Frame number, Subframe number, RNTI, MCS of TB...
Definition: lte-enb-mac.h:262
#define MAX_CQI_LIST
Definition: ff-mac-common.h:50
Parameters of the CSCHED_UE_CONFIG_UPDATE_IND primitive.
virtual void AddLc(LcInfo lcinfo, LteMacSapUser *msu)
Add a new logical channel.
Definition: lte-enb-mac.cc:100
uint64_t mbrDl
maximum bitrate in downlink
void DoTransmitPdu(LteMacSapProvider::TransmitPduParameters)
Definition: lte-enb-mac.cc:930
Parameters of the CSCHED_LC_RELEASE_REQ primitive.
friend class EnbMacMemberFfMacCschedSapUser
Definition: lte-enb-mac.h:55
Service Access Point (SAP) offered by the eNB-PHY to the eNB-MAC.
virtual void SchedDlTriggerReq(const struct SchedDlTriggerReqParameters &params)=0
See section 4.3.12 ulInfoListElement.
void DoAddUe(uint16_t rnti)
Definition: lte-enb-mac.cc:746
virtual void SchedDlRlcBufferReq(const struct SchedDlRlcBufferReqParameters &params)=0
Parameters of the SCHED_DL_TRIGGER_REQ primitive.
uint8_t lcid
the logical channel id corresponding to the sending RLC instance
Definition: lte-mac-sap.h:49
virtual void ConfigureMac(uint8_t ulBandwidth, uint8_t dlBandwidth)
Definition: lte-enb-mac.cc:82
Service Access Point (SAP) offered by the eNB-PHY to the eNB-MAC.
uint16_t rnti
the C-RNTI identifying the UE
Definition: lte-mac-sap.h:68
FfMacCschedSapUser * GetFfMacCschedSapUser(void)
Get the control scheduler SAP user.
Definition: lte-enb-mac.cc:401
virtual AllocateNcRaPreambleReturnValue AllocateNcRaPreamble(uint16_t rnti)
Allocate a random access preamble for non-contention based random access (e.g., for handover)...
Definition: lte-enb-mac.cc:130
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
Create a TraceSourceAccessor which will control access to the underlying trace source.
LteMacSapProvider * GetLteMacSapProvider(void)
Get the MAC SAP provider.
Definition: lte-enb-mac.cc:415
Parameters for LteMacSapProvider::ReportBufferStatus.
Definition: lte-mac-sap.h:66
std::map< uint8_t, uint32_t > m_receivedRachPreambleCount
Definition: lte-enb-mac.h:290
FfMacCschedSapUser * m_cschedSapUser
Definition: lte-enb-mac.h:242
See section 4.3.4 logicalChannelConfigListElement.
Service Access Point (SAP) offered by the MAC to the RRC See Femto Forum MAC Scheduler Interface Spec...
uint16_t txQueueHolDelay
the Head Of Line delay of the transmission queue
Definition: lte-mac-sap.h:71
void SetFfMacCschedSapProvider(FfMacCschedSapProvider *s)
Set the control scheduler SAP provider.
Definition: lte-enb-mac.cc:395
uint8_t lcId
logical channel identifier
Parameters of the CSCHED_LC_RELEASE_CNF primitive.
uint16_t m_rnti
UE id within this cell.
LteEnbPhySapProvider * m_enbPhySapProvider
Definition: lte-enb-mac.h:245
enum ns3::LogicalChannelConfigListElement_s::Direction_e m_direction
virtual void CschedLcConfigCnf(const struct CschedLcConfigCnfParameters &params)
Definition: lte-enb-mac.cc:207
LteEnbPhySapUser * m_enbPhySapUser
Definition: lte-enb-mac.h:246
FfMacSchedSapUser * GetFfMacSchedSapUser(void)
Get the scheduler SAP user.
Definition: lte-enb-mac.cc:389
make Callback use a separate empty type
Definition: empty.h:33
void DoCschedUeConfigCnf(FfMacCschedSapUser::CschedUeConfigCnfParameters params)
virtual void RrcConfigurationUpdateInd(UeConfig params)=0
Notify the RRC of a UE config updated requested by the MAC (normally, by the scheduler) ...
virtual void SendMacPdu(Ptr< Packet > p)=0
Send the MAC PDU to the channel.
virtual void CschedLcReleaseCnf(const struct CschedLcReleaseCnfParameters &params)
Definition: lte-enb-mac.cc:213
void DoUeUpdateConfigurationReq(LteEnbCmacSapProvider::UeConfig params)
Definition: lte-enb-mac.cc:862
Parameters of the SCHED_UL_TRIGGER_REQ primitive.
Hold an unsigned integer type.
Definition: uinteger.h:44
EnbMacMemberLteEnbCmacSapProvider(LteEnbMac *mac)
Definition: lte-enb-mac.cc:76
Logical Channel information to be passed to CmacSapProvider::ConfigureLc.
std::map< uint8_t, uint32_t > m_rapIdRntiMap
Definition: lte-enb-mac.h:292
uint16_t rnti
rnti previously allocated for this non-contention based RA procedure
Definition: lte-enb-mac.h:279
uint8_t m_macChTtiDelay
Definition: lte-enb-mac.h:264
uint16_t rnti
the C-RNTI identifying the UE
Definition: lte-mac-sap.h:48
void DoCschedLcReleaseCnf(FfMacCschedSapUser::CschedLcReleaseCnfParameters params)
static TypeId GetTypeId(void)
Definition: lte-enb-mac.cc:313
void DoUlCqiReport(FfMacSchedSapProvider::SchedUlCqiInfoReqParameters ulcqi)
Definition: lte-enb-mac.cc:635
virtual void UlInfoListElementHarqFeeback(UlInfoListElement_s params)
Notify the HARQ on the UL tranmission status.
Definition: lte-enb-mac.cc:295
virtual void SchedDlRachInfoReq(const struct SchedDlRachInfoReqParameters &params)=0
virtual void AddUe(uint16_t rnti)
Definition: lte-enb-mac.cc:88
Provides the SCHED SAP.
friend class EnbMacMemberLteEnbCmacSapProvider
Definition: lte-enb-mac.h:52
virtual void DoDispose(void)
Destructor implementation.
Definition: lte-enb-mac.cc:365
enum ns3::LogicalChannelConfigListElement_s::QosBearerType_e m_qosBearerType
void ReceiveBsrMessage(MacCeListElement_s bsr)
Receive a CE element containing the buffer status report.
Definition: lte-enb-mac.cc:663
tuple mac
Definition: third.py:92
virtual void SchedUlConfigInd(const struct SchedUlConfigIndParameters &params)
Definition: lte-enb-mac.cc:164
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
Definition: log.h:252
std::vector< struct CqiListElement_s > m_cqiList
uint8_t m_raResponseWindowSize
Definition: lte-enb-mac.h:271
#define list
std::vector< struct DlInfoListElement_s > m_dlInfoList
See section 4.3.23 dlInfoListElement.
virtual void CschedCellConfigReq(const struct CschedCellConfigReqParameters &params)=0
CSCHED_CELL_CONFIG_REQ.
void DoReceiveRachPreamble(uint8_t prachId)
Definition: lte-enb-mac.cc:627
void DoRemoveUe(uint16_t rnti)
Definition: lte-enb-mac.cc:783
See section 4.3.14 macCEListElement.
Parameters for [re]configuring the UE.
Ptr< Packet > Copy(void) const
performs a COW copy of the packet.
Definition: packet.cc:122
virtual void ReleaseLc(uint16_t rnti, uint8_t lcid)
release an existing logical channel
Definition: lte-enb-mac.cc:112
uint32_t m_subframeNo
Definition: lte-enb-mac.h:249
LteEnbCmacSapProvider::AllocateNcRaPreambleReturnValue DoAllocateNcRaPreamble(uint16_t rnti)
Definition: lte-enb-mac.cc:885
uint8_t m_numberOfRaPreambles
Definition: lte-enb-mac.h:269
uint8_t layer
the layer value that was passed by the MAC in the call to NotifyTxOpportunity that generated this PDU...
Definition: lte-mac-sap.h:50
virtual void CschedUeConfigCnf(const struct CschedUeConfigCnfParameters &params)
Definition: lte-enb-mac.cc:201
virtual void CschedUeReleaseReq(const struct CschedUeReleaseReqParameters &params)=0
Every class exported by the ns3 library is enclosed in the ns3 namespace.
uint8_t lcGroup
logical channel group
void DoReportBufferStatus(LteMacSapProvider::ReportBufferStatusParameters)
Definition: lte-enb-mac.cc:946
virtual void CschedUeReleaseCnf(const struct CschedUeReleaseCnfParameters &params)
Definition: lte-enb-mac.cc:219
Parameters of the CSCHED_LC_CONFIG_REQ primitive.
std::vector< enum HarqStatus_e > m_harqStatus
virtual void CschedCellConfigUpdateInd(const struct CschedCellConfigUpdateIndParameters &params)
Definition: lte-enb-mac.cc:231
LteEnbCmacSapProvider * GetLteEnbCmacSapProvider(void)
Get the control MAC SAP provider.
Definition: lte-enb-mac.cc:427
Parameters for [re]configuring the UE.
uint8_t lcid
the logical channel id corresponding to the sending RLC instance
Definition: lte-mac-sap.h:69
std::vector< UlInfoListElement_s > m_ulInfoListReceived
Definition: lte-enb-mac.h:223
uint32_t txQueueSize
the current size of the RLC transmission queue
Definition: lte-mac-sap.h:70
static Time Now(void)
Return the current simulation virtual time.
Definition: simulator.cc:224
EnbMacMemberLteEnbPhySapUser(LteEnbMac *mac)
Definition: lte-enb-mac.cc:259
See section 4.3.6 rachListElement.
LteMacSapProvider * m_macSapProvider
Definition: lte-enb-mac.h:233
std::vector< CqiListElement_s > m_dlCqiReceived
Definition: lte-enb-mac.h:217
virtual void CschedCellConfigCnf(const struct CschedCellConfigCnfParameters &params)
Definition: lte-enb-mac.cc:195
virtual void UeUpdateConfigurationReq(UeConfig params)
update the configuration of the UE
Definition: lte-enb-mac.cc:118
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
Definition: assert.h:90
virtual void SchedUlCqiInfoReq(const struct SchedUlCqiInfoReqParameters &params)=0
uint16_t rnti
C-RNTI identifying the UE.
std::vector< MacCeListElement_s > m_ulCeReceived
Definition: lte-enb-mac.h:219
Parameters of the SCHED_DL_CQI_INFO_REQ primitive.
std::vector< struct MacCeListElement_s > m_macCeList
virtual void SchedUlMacCtrlInfoReq(const struct SchedUlMacCtrlInfoReqParameters &params)=0
std::vector< std::vector< Ptr< PacketBurst > > > DlHarqProcessesBuffer_t
Definition: lte-enb-mac.h:43
uint64_t mbrUl
maximum bitrate in uplink
void DoCschedUeReleaseCnf(FfMacCschedSapUser::CschedUeReleaseCnfParameters params)
std::vector< struct RachListElement_s > m_rachList
std::vector< DlInfoListElement_s > m_dlInfoListReceived
Definition: lte-enb-mac.h:221
void SetLteEnbPhySapProvider(LteEnbPhySapProvider *s)
Set the PHY SAP Provider.
Definition: lte-enb-mac.cc:433
LteEnbCmacSapUser * m_cmacSapUser
Definition: lte-enb-mac.h:236
uint64_t gbrUl
guaranteed bitrate in uplink
virtual void SubframeIndication(uint32_t frameNo, uint32_t subframeNo)
Trigger the start from a new frame (input from Phy layer)
Definition: lte-enb-mac.cc:271
uint16_t statusPduSize
the current size of the pending STATUS RLC PDU message in bytes
Definition: lte-mac-sap.h:74
Parameters of the SCHED_UL_CQI_INFO_REQ primitive.
LteEnbPhySapUser * GetLteEnbPhySapUser()
Get the eNB-PHY SAP User.
Definition: lte-enb-mac.cc:440
Service Access Point (SAP) offered by the MAC to the RLC See Femto Forum MAC Scheduler Interface Spec...
Definition: lte-mac-sap.h:94
struct defining the RACH configuration of the MAC
FfMacSchedSapProvider * m_schedSapProvider
Definition: lte-enb-mac.h:239
bool RemovePacketTag(Tag &tag)
Remove a packet tag.
Definition: packet.cc:831
Parameters of the SCHED_UL_MAC_CTRL_INFO_REQ primitive.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Definition: log.h:236
virtual void ReceivePhyPdu(Ptr< Packet > p)
Called by the Phy to notify the MAC of the reception of a new PHY-PDU.
Definition: lte-enb-mac.cc:265
void DoCschedUeConfigUpdateInd(FfMacCschedSapUser::CschedUeConfigUpdateIndParameters params)
LteMacSapUser * m_macSapUser
Definition: lte-enb-mac.h:235
void DoSchedDlConfigInd(FfMacSchedSapUser::SchedDlConfigIndParameters ind)
Definition: lte-enb-mac.cc:969
uint16_t retxQueueHolDelay
the Head Of Line delay of the retransmission queue
Definition: lte-mac-sap.h:73
virtual void CschedLcConfigReq(const struct CschedLcConfigReqParameters &params)=0
Service Access Point (SAP) offered by the MAC to the RLC See Femto Forum MAC Scheduler Interface Spec...
Definition: lte-mac-sap.h:36
Tag used to define the RNTI and LC id for each MAC packet trasmitted.
bool valid
true if a valid RA config was allocated, false otherwise
void SetLteMacSapUser(LteMacSapUser *s)
Set the MAC SAP user.
Definition: lte-enb-mac.cc:409
virtual void SendLteControlMessage(Ptr< LteControlMessage > msg)=0
Send SendLteControlMessage (PDCCH map, CQI feedbacks) using the ideal control channel.
virtual void ReceiveLteControlMessage(Ptr< LteControlMessage > msg)
Receive SendLteControlMessage (PDCCH map, CQI feedbacks) using the ideal control channel.
Definition: lte-enb-mac.cc:277
uint32_t m_frameNo
Definition: lte-enb-mac.h:248
#define NS_LOG_ERROR(msg)
Use NS_LOG to output a message of level LOG_ERROR.
Definition: log.h:220
Parameters of the SCHED_DL_RACH_INFO_REQ primitive.
void DoCschedLcConfigCnf(FfMacCschedSapUser::CschedLcConfigCnfParameters params)
Parameters of the SCHED_UL_CONFIG_IND primitive.
virtual void SchedDlCqiInfoReq(const struct SchedDlCqiInfoReqParameters &params)=0
void DoReceiveLteControlMessage(Ptr< LteControlMessage > msg)
Definition: lte-enb-mac.cc:602
A base class which provides memory management and object aggregation.
Definition: object.h:87
virtual void CschedUeConfigUpdateInd(const struct CschedUeConfigUpdateIndParameters &params)
Definition: lte-enb-mac.cc:225
friend class EnbMacMemberLteEnbPhySapUser
Definition: lte-enb-mac.h:56
Parameters of the CSCHED_UE_CONFIG_REQ primitive.
std::map< uint8_t, NcRaPreambleInfo > m_allocatedNcRaPreambleMap
map storing as key the random acccess preamble IDs allocated for non-contention based access...
Definition: lte-enb-mac.h:288
Service Access Point (SAP) offered by the eNB MAC to the eNB RRC See Femto Forum MAC Scheduler Interf...
uint64_t gbrDl
guaranteed bitrate in downlink
virtual ~LteEnbMac(void)
Definition: lte-enb-mac.cc:359
uint8_t harqProcessId
the HARQ process id that was passed by the MAC in the call to NotifyTxOpportunity that generated this...
Definition: lte-mac-sap.h:51
friend class EnbMacMemberFfMacSchedSapUser
Definition: lte-enb-mac.h:54
TracedCallback< uint32_t, uint32_t, uint16_t, uint8_t, uint16_t, uint8_t, uint16_t > m_dlScheduling
Trace information regarding DL scheduling Frame number, Subframe number, RNTI, MCS of TB1...
Definition: lte-enb-mac.h:256
virtual void DlInfoListElementHarqFeeback(DlInfoListElement_s params)
Notify the HARQ on the DL tranmission status.
Definition: lte-enb-mac.cc:301
std::vector< struct BuildRarListElement_s > m_buildRarList
std::map< uint16_t, DlHarqProcessesBuffer_t > m_miDlHarqProcessesPackets
Definition: lte-enb-mac.h:267
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
info associated with a preamble allocated for non-contention based RA
Definition: lte-enb-mac.h:277
a unique identifier for an interface.
Definition: type-id.h:58
void DoSubframeIndication(uint32_t frameNo, uint32_t subframeNo)
Definition: lte-enb-mac.cc:448
EnbMacMemberFfMacSchedSapUser(LteEnbMac *mac)
Definition: lte-enb-mac.cc:149
uint8_t GetLayer(void) const
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition: type-id.cc:904
virtual uint16_t AllocateTemporaryCellRnti()=0
request the allocation of a Temporary C-RNTI
This class implements the MAC layer of the eNodeB device.
Definition: lte-enb-mac.h:50
Parameters of the CSCHED_UE_RELEASE_CNF primitive.
void SetFfMacSchedSapProvider(FfMacSchedSapProvider *s)
Set the scheduler SAP provider.
Definition: lte-enb-mac.cc:383
virtual void RemoveUe(uint16_t rnti)
remove the UE, e.g., after handover or termination of the RRC connection
Definition: lte-enb-mac.cc:94
FfMacCschedSapProvider * m_cschedSapProvider
Definition: lte-enb-mac.h:240
bool isGbr
true if the bearer is GBR, false if the bearer is NON-GBR
std::vector< struct BuildDataListElement_s > m_buildDataList
virtual void CschedLcReleaseReq(const struct CschedLcReleaseReqParameters &params)=0
#define UL_PUSCH_TTIS_DELAY
Definition: lte-common.h:28
Time expiryTime
value the expiration time of this allocation (so that stale preambles can be reused) ...
Definition: lte-enb-mac.h:280
void ReceiveDlCqiLteControlMessage(Ptr< DlCqiLteControlMessage > msg)
Receive a DL CQI ideal control message.
Definition: lte-enb-mac.cc:650
void DoCschedCellConfigCnf(FfMacCschedSapUser::CschedCellConfigCnfParameters params)
Parameters for LteMacSapProvider::TransmitPdu.
Definition: lte-mac-sap.h:45