A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 NS_LOG_COMPONENT_DEFINE ("LteEnbMac");
42 
43 namespace ns3 {
44 
45 
46 NS_OBJECT_ENSURE_REGISTERED (LteEnbMac);
47 
48 
49 
50 // //////////////////////////////////////
51 // member SAP forwarders
52 // //////////////////////////////////////
53 
54 
56 {
57 public:
59 
60  // inherited from LteEnbCmacSapProvider
61  virtual void ConfigureMac (uint8_t ulBandwidth, uint8_t dlBandwidth);
62  virtual void AddUe (uint16_t rnti);
63  virtual void RemoveUe (uint16_t rnti);
64  virtual void AddLc (LcInfo lcinfo, LteMacSapUser* msu);
65  virtual void ReconfigureLc (LcInfo lcinfo);
66  virtual void ReleaseLc (uint16_t rnti, uint8_t lcid);
67  virtual void UeUpdateConfigurationReq (UeConfig params);
68  virtual RachConfig GetRachConfig ();
70 
71 
72 private:
74 };
75 
76 
78  : m_mac (mac)
79 {
80 }
81 
82 void
83 EnbMacMemberLteEnbCmacSapProvider::ConfigureMac (uint8_t ulBandwidth, uint8_t dlBandwidth)
84 {
85  m_mac->DoConfigureMac (ulBandwidth, dlBandwidth);
86 }
87 
88 void
90 {
91  m_mac->DoAddUe (rnti);
92 }
93 
94 void
96 {
97  m_mac->DoRemoveUe (rnti);
98 }
99 
100 void
102 {
103  m_mac->DoAddLc (lcinfo, msu);
104 }
105 
106 void
108 {
109  m_mac->DoReconfigureLc (lcinfo);
110 }
111 
112 void
113 EnbMacMemberLteEnbCmacSapProvider::ReleaseLc (uint16_t rnti, uint8_t lcid)
114 {
115  m_mac->DoReleaseLc (rnti, lcid);
116 }
117 
118 void
120 {
122 }
123 
126 {
127  return m_mac->DoGetRachConfig ();
128 }
129 
132 {
133  return m_mac->DoAllocateNcRaPreamble (rnti);
134 }
135 
136 
138 {
139 public:
141 
142 
143  virtual void SchedDlConfigInd (const struct SchedDlConfigIndParameters& params);
144  virtual void SchedUlConfigInd (const struct SchedUlConfigIndParameters& params);
145 private:
147 };
148 
149 
151  : m_mac (mac)
152 {
153 }
154 
155 
156 void
158 {
159  m_mac->DoSchedDlConfigInd (params);
160 }
161 
162 
163 
164 void
166 {
167  m_mac->DoSchedUlConfigInd (params);
168 }
169 
170 
171 
173 {
174 public:
176 
177  virtual void CschedCellConfigCnf (const struct CschedCellConfigCnfParameters& params);
178  virtual void CschedUeConfigCnf (const struct CschedUeConfigCnfParameters& params);
179  virtual void CschedLcConfigCnf (const struct CschedLcConfigCnfParameters& params);
180  virtual void CschedLcReleaseCnf (const struct CschedLcReleaseCnfParameters& params);
181  virtual void CschedUeReleaseCnf (const struct CschedUeReleaseCnfParameters& params);
182  virtual void CschedUeConfigUpdateInd (const struct CschedUeConfigUpdateIndParameters& params);
183  virtual void CschedCellConfigUpdateInd (const struct CschedCellConfigUpdateIndParameters& params);
184 
185 private:
187 };
188 
189 
191  : m_mac (mac)
192 {
193 }
194 
195 void
197 {
198  m_mac->DoCschedCellConfigCnf (params);
199 }
200 
201 void
203 {
204  m_mac->DoCschedUeConfigCnf (params);
205 }
206 
207 void
209 {
210  m_mac->DoCschedLcConfigCnf (params);
211 }
212 
213 void
215 {
216  m_mac->DoCschedLcReleaseCnf (params);
217 }
218 
219 void
221 {
222  m_mac->DoCschedUeReleaseCnf (params);
223 }
224 
225 void
227 {
229 }
230 
231 void
233 {
235 }
236 
237 
238 
239 // ---------- PHY-SAP
240 
241 
243 {
244 public:
246 
247  // inherited from LteEnbPhySapUser
248  virtual void ReceivePhyPdu (Ptr<Packet> p);
249  virtual void SubframeIndication (uint32_t frameNo, uint32_t subframeNo);
251  virtual void ReceiveRachPreamble (uint32_t prachId);
255 
256 private:
258 };
259 
261 {
262 }
263 
264 
265 void
267 {
268  m_mac->DoReceivePhyPdu (p);
269 }
270 
271 void
272 EnbMacMemberLteEnbPhySapUser::SubframeIndication (uint32_t frameNo, uint32_t subframeNo)
273 {
274  m_mac->DoSubframeIndication (frameNo, subframeNo);
275 }
276 
277 void
279 {
281 }
282 
283 void
285 {
286  m_mac->DoReceiveRachPreamble (prachId);
287 }
288 
289 void
291 {
292  m_mac->DoUlCqiReport (ulcqi);
293 }
294 
295 void
297 {
299 }
300 
301 void
303 {
305 }
306 
307 
308 // //////////////////////////////////////
309 // generic LteEnbMac methods
310 // //////////////////////////////////////
311 
312 
313 TypeId
315 {
316  static TypeId tid = TypeId ("ns3::LteEnbMac")
317  .SetParent<Object> ()
318  .AddConstructor<LteEnbMac> ()
319  .AddAttribute ("NumberOfRaPreambles",
320  "how many random access preambles are available for the contention based RACH process",
321  UintegerValue (50),
322  MakeUintegerAccessor (&LteEnbMac::m_numberOfRaPreambles),
323  MakeUintegerChecker<uint8_t> (4, 64))
324  .AddAttribute ("PreambleTransMax",
325  "Maximum number of random access preamble transmissions",
326  UintegerValue (50),
327  MakeUintegerAccessor (&LteEnbMac::m_preambleTransMax),
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),
332  MakeUintegerAccessor (&LteEnbMac::m_raResponseWindowSize),
333  MakeUintegerChecker<uint8_t> (2, 10))
334  .AddTraceSource ("DlScheduling",
335  "Information regarding DL scheduling.",
337  .AddTraceSource ("UlScheduling",
338  "Information regarding UL scheduling.",
340  ;
341 
342  return tid;
343 }
344 
345 
347 {
348  NS_LOG_FUNCTION (this);
354 }
355 
356 
358 {
359  NS_LOG_FUNCTION (this);
360 }
361 
362 void
364 {
365  NS_LOG_FUNCTION (this);
366  m_dlCqiReceived.clear ();
367  m_ulCqiReceived.clear ();
368  m_ulCeReceived.clear ();
369  m_dlInfoListReceived.clear ();
370  m_ulInfoListReceived.clear ();
372  delete m_macSapProvider;
373  delete m_cmacSapProvider;
374  delete m_schedSapUser;
375  delete m_cschedSapUser;
376  delete m_enbPhySapUser;
377 }
378 
379 
380 void
382 {
384 }
385 
388 {
389  return m_schedSapUser;
390 }
391 
392 void
394 {
396 }
397 
400 {
401  return m_cschedSapUser;
402 }
403 
404 
405 
406 void
408 {
409  m_macSapUser = s;
410 }
411 
414 {
415  return m_macSapProvider;
416 }
417 
418 void
420 {
421  m_cmacSapUser = s;
422 }
423 
426 {
427  return m_cmacSapProvider;
428 }
429 
430 void
432 {
434 }
435 
436 
439 {
440  return m_enbPhySapUser;
441 }
442 
443 
444 
445 void
446 LteEnbMac::DoSubframeIndication (uint32_t frameNo, uint32_t subframeNo)
447 {
448  NS_LOG_FUNCTION (this << " EnbMac - frame " << frameNo << " subframe " << subframeNo);
449 
450  // Store current frame / subframe number
451  m_frameNo = frameNo;
452  m_subframeNo = subframeNo;
453 
454 
455  // --- DOWNLINK ---
456  // Send Dl-CQI info to the scheduler
457  if (m_dlCqiReceived.size () > 0)
458  {
460  dlcqiInfoReq.m_sfnSf = ((0x3FF & frameNo) << 4) | (0xF & subframeNo);
461 
462  int cqiNum = m_dlCqiReceived.size ();
463  if (cqiNum > MAX_CQI_LIST)
464  {
465  cqiNum = MAX_CQI_LIST;
466  }
467  dlcqiInfoReq.m_cqiList.insert (dlcqiInfoReq.m_cqiList.begin (), m_dlCqiReceived.begin (), m_dlCqiReceived.end ());
468  m_dlCqiReceived.erase (m_dlCqiReceived.begin (), m_dlCqiReceived.end ());
469  m_schedSapProvider->SchedDlCqiInfoReq (dlcqiInfoReq);
470  }
471 
472  if (!m_receivedRachPreambleCount.empty ())
473  {
474  // process received RACH preambles and notify the scheduler
476  NS_ASSERT (subframeNo > 0 && subframeNo <= 10); // subframe in 1..10
477  for (std::map<uint8_t, uint32_t>::const_iterator it = m_receivedRachPreambleCount.begin ();
478  it != m_receivedRachPreambleCount.end ();
479  ++it)
480  {
481  NS_LOG_INFO (this << " preambleId " << (uint32_t) it->first << ": " << it->second << " received");
482  NS_ASSERT (it->second != 0);
483  if (it->second > 1)
484  {
485  NS_LOG_INFO ("preambleId " << (uint32_t) it->first << ": collision");
486  // in case of collision we assume that no preamble is
487  // successfully received, hence no RAR is sent
488  }
489  else
490  {
491  uint16_t rnti;
492  std::map<uint8_t, NcRaPreambleInfo>::iterator jt = m_allocatedNcRaPreambleMap.find (it->first);
493  if (jt != m_allocatedNcRaPreambleMap.end ())
494  {
495  rnti = jt->second.rnti;
496  NS_LOG_INFO ("preambleId previously allocated for NC based RA, RNTI =" << (uint32_t) rnti << ", sending RAR");
497 
498  }
499  else
500  {
502  NS_LOG_INFO ("preambleId " << (uint32_t) it->first << ": allocated T-C-RNTI " << (uint32_t) rnti << ", sending RAR");
503  }
504 
505  RachListElement_s rachLe;
506  rachLe.m_rnti = rnti;
507  rachLe.m_estimatedSize = 144; // to be confirmed
508  rachInfoReqParams.m_rachList.push_back (rachLe);
509  m_rapIdRntiMap.insert (std::pair <uint16_t, uint32_t> (rnti, it->first));
510  }
511  }
512  m_schedSapProvider->SchedDlRachInfoReq (rachInfoReqParams);
514  }
515  // Get downlink transmission opportunities
516  uint32_t dlSchedFrameNo = m_frameNo;
517  uint32_t dlSchedSubframeNo = m_subframeNo;
518  // NS_LOG_DEBUG (this << " sfn " << frameNo << " sbfn " << subframeNo);
519  if (dlSchedSubframeNo + m_macChTtiDelay > 10)
520  {
521  dlSchedFrameNo++;
522  dlSchedSubframeNo = (dlSchedSubframeNo + m_macChTtiDelay) % 10;
523  }
524  else
525  {
526  dlSchedSubframeNo = dlSchedSubframeNo + m_macChTtiDelay;
527  }
529  dlparams.m_sfnSf = ((0x3FF & dlSchedFrameNo) << 4) | (0xF & dlSchedSubframeNo);
530 
531  // Forward DL HARQ feebacks collected during last TTI
532  if (m_dlInfoListReceived.size () > 0)
533  {
535  // empty local buffer
536  m_dlInfoListReceived.clear ();
537  }
538 
540 
541 
542  // --- UPLINK ---
543  // Send UL-CQI info to the scheduler
544  std::vector <FfMacSchedSapProvider::SchedUlCqiInfoReqParameters>::iterator itCqi;
545  for (uint16_t i = 0; i < m_ulCqiReceived.size (); i++)
546  {
547  if (subframeNo>1)
548  {
549  m_ulCqiReceived.at (i).m_sfnSf = ((0x3FF & frameNo) << 4) | (0xF & (subframeNo - 1));
550  }
551  else
552  {
553  m_ulCqiReceived.at (i).m_sfnSf = ((0x3FF & (frameNo-1)) << 4) | (0xF & 10);
554  }
556  }
557  m_ulCqiReceived.clear ();
558 
559  // Send BSR reports to the scheduler
560  if (m_ulCeReceived.size () > 0)
561  {
563  ulMacReq.m_sfnSf = ((0x3FF & frameNo) << 4) | (0xF & subframeNo);
564  ulMacReq.m_macCeList.insert (ulMacReq.m_macCeList.begin (), m_ulCeReceived.begin (), m_ulCeReceived.end ());
565  m_ulCeReceived.erase (m_ulCeReceived.begin (), m_ulCeReceived.end ());
567  }
568 
569 
570  // Get uplink transmission opportunities
571  uint32_t ulSchedFrameNo = m_frameNo;
572  uint32_t ulSchedSubframeNo = m_subframeNo;
573  // NS_LOG_DEBUG (this << " sfn " << frameNo << " sbfn " << subframeNo);
574  if (ulSchedSubframeNo + (m_macChTtiDelay+UL_PUSCH_TTIS_DELAY) > 10)
575  {
576  ulSchedFrameNo++;
577  ulSchedSubframeNo = (ulSchedSubframeNo + (m_macChTtiDelay+UL_PUSCH_TTIS_DELAY)) % 10;
578  }
579  else
580  {
581  ulSchedSubframeNo = ulSchedSubframeNo + (m_macChTtiDelay+UL_PUSCH_TTIS_DELAY);
582  }
584  ulparams.m_sfnSf = ((0x3FF & ulSchedFrameNo) << 4) | (0xF & ulSchedSubframeNo);
585 
586  // Forward DL HARQ feebacks collected during last TTI
587  if (m_ulInfoListReceived.size () > 0)
588  {
590  // empty local buffer
591  m_ulInfoListReceived.clear ();
592  }
593 
595 
596 }
597 
598 
599 void
601 {
602  NS_LOG_FUNCTION (this << msg);
603  if (msg->GetMessageType () == LteControlMessage::DL_CQI)
604  {
605  Ptr<DlCqiLteControlMessage> dlcqi = DynamicCast<DlCqiLteControlMessage> (msg);
607  }
608  else if (msg->GetMessageType () == LteControlMessage::BSR)
609  {
610  Ptr<BsrLteControlMessage> bsr = DynamicCast<BsrLteControlMessage> (msg);
611  ReceiveBsrMessage (bsr->GetBsr ());
612  }
613  else if (msg->GetMessageType () == LteControlMessage::DL_HARQ)
614  {
615  Ptr<DlHarqFeedbackLteControlMessage> dlharq = DynamicCast<DlHarqFeedbackLteControlMessage> (msg);
616  DoDlInfoListElementHarqFeeback (dlharq->GetDlHarqFeedback ());
617  }
618  else
619  {
620  NS_LOG_LOGIC (this << " LteControlMessage type " << msg->GetMessageType () << " not recognized");
621  }
622 }
623 
624 void
626 {
627  NS_LOG_FUNCTION (this << (uint32_t) rapId);
628  // just record that the preamble has been received; it will be processed later
629  ++m_receivedRachPreambleCount[rapId]; // will create entry if not exists
630 }
631 
632 void
634 {
635  if (ulcqi.m_ulCqi.m_type == UlCqi_s::PUSCH)
636  {
637  NS_LOG_DEBUG (this << " eNB rxed an PUSCH UL-CQI");
638  }
639  else if (ulcqi.m_ulCqi.m_type == UlCqi_s::SRS)
640  {
641  NS_LOG_DEBUG (this << " eNB rxed an SRS UL-CQI");
642  }
643  m_ulCqiReceived.push_back (ulcqi);
644 }
645 
646 
647 void
649 {
650  NS_LOG_FUNCTION (this << msg);
651 
652  CqiListElement_s dlcqi = msg->GetDlCqi ();
653  NS_LOG_LOGIC (this << "Enb Received DL-CQI rnti" << dlcqi.m_rnti);
654  NS_ASSERT (dlcqi.m_rnti != 0);
655  m_dlCqiReceived.push_back (dlcqi);
656 
657 }
658 
659 
660 void
662 {
663  NS_LOG_FUNCTION (this);
664 
665  m_ulCeReceived.push_back (bsr);
666 }
667 
668 
669 void
671 {
672  NS_LOG_FUNCTION (this);
673  LteRadioBearerTag tag;
674  p->RemovePacketTag (tag);
675 
676  // store info of the packet received
677 
678 // std::map <uint16_t,UlInfoListElement_s>::iterator it;
679 // u_int rnti = tag.GetRnti ();
680 // u_int lcid = tag.GetLcid ();
681 // it = m_ulInfoListElements.find (tag.GetRnti ());
682 // if (it == m_ulInfoListElements.end ())
683 // {
684 // // new RNTI
685 // UlInfoListElement_s ulinfonew;
686 // ulinfonew.m_rnti = tag.GetRnti ();
687 // // always allocate full size of ulReception vector, initializing all elements to 0
688 // ulinfonew.m_ulReception.assign (MAX_LC_LIST+1, 0);
689 // // set the element for the current LCID
690 // ulinfonew.m_ulReception.at (tag.GetLcid ()) = p->GetSize ();
691 // ulinfonew.m_receptionStatus = UlInfoListElement_s::Ok;
692 // ulinfonew.m_tpc = 0; // Tx power control not implemented at this stage
693 // m_ulInfoListElements.insert (std::pair<uint16_t, UlInfoListElement_s > (tag.GetRnti (), ulinfonew));
694 //
695 // }
696 // else
697 // {
698 // // existing RNTI: we just set the value for the current
699 // // LCID. Note that the corresponding element had already been
700 // // allocated previously.
701 // NS_ASSERT_MSG ((*it).second.m_ulReception.at (tag.GetLcid ()) == 0, "would overwrite previously written ulReception element");
702 // (*it).second.m_ulReception.at (tag.GetLcid ()) = p->GetSize ();
703 // (*it).second.m_receptionStatus = UlInfoListElement_s::Ok;
704 // }
705 
706 
707 
708  // forward the packet to the correspondent RLC
709  uint16_t rnti = tag.GetRnti ();
710  uint8_t lcid = tag.GetLcid ();
711  std::map <uint16_t, std::map<uint8_t, LteMacSapUser*> >::iterator rntiIt = m_rlcAttached.find (rnti);
712  NS_ASSERT_MSG (rntiIt != m_rlcAttached.end (), "could not find RNTI" << rnti);
713  std::map<uint8_t, LteMacSapUser*>::iterator lcidIt = rntiIt->second.find (lcid);
714  NS_ASSERT_MSG (lcidIt != rntiIt->second.end (), "could not find LCID" << lcid);
715  (*lcidIt).second->ReceivePdu (p);
716 
717 }
718 
719 
720 
721 // ////////////////////////////////////////////
722 // CMAC SAP
723 // ////////////////////////////////////////////
724 
725 void
726 LteEnbMac::DoConfigureMac (uint8_t ulBandwidth, uint8_t dlBandwidth)
727 {
728  NS_LOG_FUNCTION (this << " ulBandwidth=" << (uint16_t) ulBandwidth << " dlBandwidth=" << (uint16_t) dlBandwidth);
730  // Configure the subset of parameters used by FfMacScheduler
731  params.m_ulBandwidth = ulBandwidth;
732  params.m_dlBandwidth = dlBandwidth;
734  // ...more parameters can be configured
736 }
737 
738 
739 void
740 LteEnbMac::DoAddUe (uint16_t rnti)
741 {
742  NS_LOG_FUNCTION (this << " rnti=" << rnti);
743  std::map<uint8_t, LteMacSapUser*> empty;
744  std::pair <std::map <uint16_t, std::map<uint8_t, LteMacSapUser*> >::iterator, bool>
745  ret = m_rlcAttached.insert (std::pair <uint16_t, std::map<uint8_t, LteMacSapUser*> >
746  (rnti, empty));
747  NS_ASSERT_MSG (ret.second, "element already present, RNTI already existed");
748 
750  params.m_rnti = rnti;
751  params.m_transmissionMode = 0; // set to default value (SISO) for avoiding random initialization (valgrind error)
752 
754 
755  // Create DL trasmission HARQ buffers
756  std::vector < Ptr<PacketBurst> > dlHarqLayer0pkt;
757  dlHarqLayer0pkt.resize (8);
758  for (uint8_t i = 0; i < 8; i++)
759  {
760  Ptr<PacketBurst> pb = CreateObject <PacketBurst> ();
761  dlHarqLayer0pkt.at (i) = pb;
762  }
763  std::vector < Ptr<PacketBurst> > dlHarqLayer1pkt;
764  dlHarqLayer1pkt.resize (8);
765  for (uint8_t i = 0; i < 8; i++)
766  {
767  Ptr<PacketBurst> pb = CreateObject <PacketBurst> ();
768  dlHarqLayer1pkt.at (i) = pb;
769  }
771  buf.push_back (dlHarqLayer0pkt);
772  buf.push_back (dlHarqLayer1pkt);
773  m_miDlHarqProcessesPackets.insert (std::pair <uint16_t, DlHarqProcessesBuffer_t> (rnti, buf));
774 }
775 
776 void
777 LteEnbMac::DoRemoveUe (uint16_t rnti)
778 {
779  NS_LOG_FUNCTION (this << " rnti=" << rnti);
781  params.m_rnti = rnti;
783  m_rlcAttached.erase (rnti);
784  m_miDlHarqProcessesPackets.erase (rnti);
785 }
786 
787 void
789 {
790  NS_LOG_FUNCTION (this);
791 
792  std::map <LteFlowId_t, LteMacSapUser* >::iterator it;
793 
794  LteFlowId_t flow (lcinfo.rnti, lcinfo.lcId);
795 
796  std::map <uint16_t, std::map<uint8_t, LteMacSapUser*> >::iterator rntiIt = m_rlcAttached.find (lcinfo.rnti);
797  NS_ASSERT_MSG (rntiIt != m_rlcAttached.end (), "RNTI not found");
798  std::map<uint8_t, LteMacSapUser*>::iterator lcidIt = rntiIt->second.find (lcinfo.lcId);
799  if (lcidIt == rntiIt->second.end ())
800  {
801  rntiIt->second.insert (std::pair<uint8_t, LteMacSapUser*> (lcinfo.lcId, msu));
802  }
803  else
804  {
805  NS_LOG_ERROR ("LC already exists");
806  }
807 
808  // CCCH (LCID 0) is pre-configured
809  // see FF LTE MAC Scheduler
810  // Interface Specification v1.11,
811  // 4.3.4 logicalChannelConfigListElement
812  if (lcinfo.lcId != 0)
813  {
815  params.m_rnti = lcinfo.rnti;
816  params.m_reconfigureFlag = false;
817 
819  lccle.m_logicalChannelIdentity = lcinfo.lcId;
820  lccle.m_logicalChannelGroup = lcinfo.lcGroup;
823  lccle.m_qci = lcinfo.qci;
824  lccle.m_eRabMaximulBitrateUl = lcinfo.mbrUl;
825  lccle.m_eRabMaximulBitrateDl = lcinfo.mbrDl;
826  lccle.m_eRabGuaranteedBitrateUl = lcinfo.gbrUl;
827  lccle.m_eRabGuaranteedBitrateDl = lcinfo.gbrDl;
828  params.m_logicalChannelConfigList.push_back (lccle);
829 
831  }
832 }
833 
834 void
836 {
837  NS_FATAL_ERROR ("not implemented");
838 }
839 
840 void
841 LteEnbMac::DoReleaseLc (uint16_t rnti, uint8_t lcid)
842 {
843  NS_FATAL_ERROR ("not implemented");
844 }
845 
846 void
848 {
849  NS_LOG_FUNCTION (this);
850 
851  // propagates to scheduler
853  req.m_rnti = params.m_rnti;
855  req.m_reconfigureFlag = true;
857 }
858 
861 {
866  return rc;
867 }
868 
871 {
872  bool found = false;
873  uint8_t preambleId;
874  for (preambleId = m_numberOfRaPreambles; preambleId < 64; ++preambleId)
875  {
876  std::map<uint8_t, NcRaPreambleInfo>::iterator it = m_allocatedNcRaPreambleMap.find (preambleId);
877  if ((it == m_allocatedNcRaPreambleMap.end ())
878  || (it->second.expiryTime < Simulator::Now ()))
879  {
880  found = true;
881  NcRaPreambleInfo preambleInfo;
882  uint32_t expiryIntervalMs = (uint32_t) m_preambleTransMax * ((uint32_t) m_raResponseWindowSize + 5);
883 
884  preambleInfo.expiryTime = Simulator::Now () + MilliSeconds (expiryIntervalMs);
885  preambleInfo.rnti = rnti;
886  NS_LOG_INFO ("allocated preamble for NC based RA: preamble " << preambleId << ", RNTI " << preambleInfo.rnti << ", exiryTime " << preambleInfo.expiryTime);
887  m_allocatedNcRaPreambleMap[preambleId] = preambleInfo; // create if not exist, update otherwise
888  break;
889  }
890  }
892  if (found)
893  {
894  ret.valid = true;
895  ret.raPreambleId = preambleId;
896  ret.raPrachMaskIndex = 0;
897  }
898  else
899  {
900  ret.valid = false;
901  ret.raPreambleId = 0;
902  ret.raPrachMaskIndex = 0;
903  }
904  return ret;
905 }
906 
907 
908 
909 // ////////////////////////////////////////////
910 // MAC SAP
911 // ////////////////////////////////////////////
912 
913 
914 void
916 {
917  NS_LOG_FUNCTION (this);
918  LteRadioBearerTag tag (params.rnti, params.lcid, params.layer);
919  params.pdu->AddPacketTag (tag);
920  // Store pkt in HARQ buffer
921  std::map <uint16_t, DlHarqProcessesBuffer_t>::iterator it = m_miDlHarqProcessesPackets.find (params.rnti);
923  NS_LOG_DEBUG (this << " LAYER " <<(uint16_t)tag.GetLayer () << " HARQ ID " << (uint16_t)params.harqProcessId);
924 
925  //(*it).second.at (params.layer).at (params.harqProcessId) = params.pdu;//->Copy ();
926  (*it).second.at (params.layer).at (params.harqProcessId)->AddPacket (params.pdu);
928 }
929 
930 void
932 {
933  NS_LOG_FUNCTION (this);
935  req.m_rnti = params.rnti;
936  req.m_logicalChannelIdentity = params.lcid;
941  req.m_rlcStatusPduSize = params.statusPduSize;
943 }
944 
945 
946 
947 // ////////////////////////////////////////////
948 // SCHED SAP
949 // ////////////////////////////////////////////
950 
951 
952 
953 void
955 {
956  NS_LOG_FUNCTION (this);
957  // Create DL PHY PDU
958  Ptr<PacketBurst> pb = CreateObject<PacketBurst> ();
959  std::map <LteFlowId_t, LteMacSapUser* >::iterator it;
960 
961  for (unsigned int i = 0; i < ind.m_buildDataList.size (); i++)
962  {
963  for (uint16_t layer = 0; layer < ind.m_buildDataList.at (i).m_dci.m_ndi.size (); layer++)
964  {
965  if (ind.m_buildDataList.at (i).m_dci.m_ndi.at (layer) == 1)
966  {
967  // new data -> force emptying correspondent harq pkt buffer
968  std::map <uint16_t, DlHarqProcessesBuffer_t>::iterator it = m_miDlHarqProcessesPackets.find (ind.m_buildDataList.at (i).m_rnti);
970  for (uint16_t lcId = 0; lcId < (*it).second.size (); lcId ++)
971  {
972  Ptr<PacketBurst> pb = CreateObject <PacketBurst> ();
973  (*it).second.at (lcId).at (ind.m_buildDataList.at (i).m_dci.m_harqProcess) = pb;
974  }
975  }
976  }
977  for (unsigned int j = 0; j < ind.m_buildDataList.at (i).m_rlcPduList.size (); j++)
978  {
979  for (uint16_t k = 0; k < ind.m_buildDataList.at (i).m_rlcPduList.at (j).size (); k++)
980  {
981  if (ind.m_buildDataList.at (i).m_dci.m_ndi.at (k) == 1)
982  {
983  // New Data -> retrieve it from RLC
984  uint16_t rnti = ind.m_buildDataList.at (i).m_rnti;
985  uint8_t lcid = ind.m_buildDataList.at (i).m_rlcPduList.at (j).at (k).m_logicalChannelIdentity;
986  std::map <uint16_t, std::map<uint8_t, LteMacSapUser*> >::iterator rntiIt = m_rlcAttached.find (rnti);
987  NS_ASSERT_MSG (rntiIt != m_rlcAttached.end (), "could not find RNTI" << rnti);
988  std::map<uint8_t, LteMacSapUser*>::iterator lcidIt = rntiIt->second.find (lcid);
989  NS_ASSERT_MSG (lcidIt != rntiIt->second.end (), "could not find LCID" << lcid);
990  NS_LOG_DEBUG (this << " rnti= " << rnti << " lcid= " << (uint32_t) lcid << " layer= " << k);
991  (*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);
992  }
993  else
994  {
995  if (ind.m_buildDataList.at (i).m_dci.m_tbsSize.at (k)>0)
996  {
997  // HARQ retransmission -> retrieve TB from HARQ buffer
998  std::map <uint16_t, DlHarqProcessesBuffer_t>::iterator it = m_miDlHarqProcessesPackets.find (ind.m_buildDataList.at (i).m_rnti);
1000  Ptr<PacketBurst> pb = (*it).second.at (k).at ( ind.m_buildDataList.at (i).m_dci.m_harqProcess);
1001  for (std::list<Ptr<Packet> >::const_iterator j = pb->Begin (); j != pb->End (); ++j)
1002  {
1003  Ptr<Packet> pkt = (*j)->Copy ();
1005  }
1006  }
1007  }
1008  }
1009  }
1010  // send the relative DCI
1011  Ptr<DlDciLteControlMessage> msg = Create<DlDciLteControlMessage> ();
1012  msg->SetDci (ind.m_buildDataList.at (i).m_dci);
1014  }
1015 
1016  // Fire the trace with the DL information
1017  for ( uint32_t i = 0; i < ind.m_buildDataList.size (); i++ )
1018  {
1019  // Only one TB used
1020  if (ind.m_buildDataList.at (i).m_dci.m_tbsSize.size () == 1)
1021  {
1022  m_dlScheduling (m_frameNo, m_subframeNo, ind.m_buildDataList.at (i).m_dci.m_rnti,
1023  ind.m_buildDataList.at (i).m_dci.m_mcs.at (0),
1024  ind.m_buildDataList.at (i).m_dci.m_tbsSize.at (0),
1025  0, 0
1026  );
1027 
1028  }
1029  // Two TBs used
1030  else if (ind.m_buildDataList.at (i).m_dci.m_tbsSize.size () == 2)
1031  {
1032  m_dlScheduling (m_frameNo, m_subframeNo, ind.m_buildDataList.at (i).m_dci.m_rnti,
1033  ind.m_buildDataList.at (i).m_dci.m_mcs.at (0),
1034  ind.m_buildDataList.at (i).m_dci.m_tbsSize.at (0),
1035  ind.m_buildDataList.at (i).m_dci.m_mcs.at (1),
1036  ind.m_buildDataList.at (i).m_dci.m_tbsSize.at (1)
1037  );
1038  }
1039  else
1040  {
1041  NS_FATAL_ERROR ("Found element with more than two transport blocks");
1042  }
1043  }
1044 
1045  // Random Access procedure: send RARs
1046  Ptr<RarLteControlMessage> rarMsg = Create<RarLteControlMessage> ();
1047  // see TS 36.321 5.1.4; preambles were sent two frames ago
1048  // (plus 3GPP counts subframes from 0, not 1)
1049  uint16_t raRnti;
1050  if (m_subframeNo < 3)
1051  {
1052  raRnti = m_subframeNo + 7; // equivalent to +10-3
1053  }
1054  else
1055  {
1056  raRnti = m_subframeNo - 3;
1057  }
1058  rarMsg->SetRaRnti (raRnti);
1059  for (unsigned int i = 0; i < ind.m_buildRarList.size (); i++)
1060  {
1061  std::map <uint8_t, uint32_t>::iterator itRapId = m_rapIdRntiMap.find (ind.m_buildRarList.at (i).m_rnti);
1062  if (itRapId == m_rapIdRntiMap.end ())
1063  {
1064  NS_FATAL_ERROR ("Unable to find rapId of RNTI " << ind.m_buildRarList.at (i).m_rnti);
1065  }
1067  rar.rapId = itRapId->second;
1068  rar.rarPayload = ind.m_buildRarList.at (i);
1069  rarMsg->AddRar (rar);
1070  NS_LOG_INFO (this << " Send RAR message to RNTI " << ind.m_buildRarList.at (i).m_rnti << " rapId " << itRapId->second);
1071  }
1072  if (ind.m_buildRarList.size () > 0)
1073  {
1075  }
1076  m_rapIdRntiMap.clear ();
1077 }
1078 
1079 
1080 void
1082 {
1083  NS_LOG_FUNCTION (this);
1084 
1085  for (unsigned int i = 0; i < ind.m_dciList.size (); i++)
1086  {
1087  // send the correspondent ul dci
1088  Ptr<UlDciLteControlMessage> msg = Create<UlDciLteControlMessage> ();
1089  msg->SetDci (ind.m_dciList.at (i));
1091  }
1092 
1093  // Fire the trace with the UL information
1094  for ( uint32_t i = 0; i < ind.m_dciList.size (); i++ )
1095  {
1096  m_ulScheduling (m_frameNo, m_subframeNo, ind.m_dciList.at (i).m_rnti,
1097  ind.m_dciList.at (i).m_mcs, ind.m_dciList.at (i).m_tbSize);
1098  }
1099 
1100 
1101 
1102 }
1103 
1104 
1105 
1106 
1107 // ////////////////////////////////////////////
1108 // CSCHED SAP
1109 // ////////////////////////////////////////////
1110 
1111 
1112 void
1114 {
1115  NS_LOG_FUNCTION (this);
1116 }
1117 
1118 void
1120 {
1121  NS_LOG_FUNCTION (this);
1122 }
1123 
1124 void
1126 {
1127  NS_LOG_FUNCTION (this);
1128  // Call the CSCHED primitive
1129  // m_cschedSap->LcConfigCompleted();
1130 }
1131 
1132 void
1134 {
1135  NS_LOG_FUNCTION (this);
1136 }
1137 
1138 void
1140 {
1141  NS_LOG_FUNCTION (this);
1142 }
1143 
1144 void
1146 {
1147  NS_LOG_FUNCTION (this);
1148  // propagates to RRC
1149  LteEnbCmacSapUser::UeConfig ueConfigUpdate;
1150  ueConfigUpdate.m_rnti = params.m_rnti;
1151  ueConfigUpdate.m_transmissionMode = params.m_transmissionMode;
1152  m_cmacSapUser->RrcConfigurationUpdateInd (ueConfigUpdate);
1153 }
1154 
1155 void
1157 {
1158  NS_LOG_FUNCTION (this);
1159 }
1160 
1161 void
1163 {
1164  NS_LOG_FUNCTION (this);
1165  m_ulInfoListReceived.push_back (params);
1166 }
1167 
1168 void
1170 {
1171  NS_LOG_FUNCTION (this);
1172  // Update HARQ buffer
1173  std::map <uint16_t, DlHarqProcessesBuffer_t>::iterator it = m_miDlHarqProcessesPackets.find (params.m_rnti);
1175  for (uint8_t layer = 0; layer < params.m_harqStatus.size (); layer++)
1176  {
1177  if (params.m_harqStatus.at (layer)==DlInfoListElement_s::ACK)
1178  {
1179  // discard buffer
1180  Ptr<PacketBurst> emptyBuf = CreateObject <PacketBurst> ();
1181  (*it).second.at (layer).at (params.m_harqProcessId) = emptyBuf;
1182  NS_LOG_DEBUG (this << " HARQ-ACK UE " << params.m_rnti << " harqId " << (uint16_t)params.m_harqProcessId << " layer " << (uint16_t)layer);
1183  }
1184  else if (params.m_harqStatus.at (layer)==DlInfoListElement_s::NACK)
1185  {
1186  NS_LOG_DEBUG (this << " HARQ-NACK UE " << params.m_rnti << " harqId " << (uint16_t)params.m_harqProcessId << " layer " << (uint16_t)layer);
1187  }
1188  else
1189  {
1190  NS_FATAL_ERROR (" HARQ functionality not implemented");
1191  }
1192  }
1193  m_dlInfoListReceived.push_back (params);
1194 }
1195 
1196 
1197 } // namespace ns3
std::vector< struct UlInfoListElement_s > m_ulInfoList
void DoConfigureMac(uint8_t ulBandwidth, uint8_t dlBandwidth)
Definition: lte-enb-mac.cc:726
void DoReconfigureLc(LteEnbCmacSapProvider::LcInfo lcinfo)
Definition: lte-enb-mac.cc:835
FfMacSchedSapUser * m_schedSapUser
Definition: lte-enb-mac.h:213
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:290
uint8_t GetLcid(void) const
EnbMacMemberFfMacCschedSapUser(LteEnbMac *mac)
Definition: lte-enb-mac.cc:190
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:190
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register the class in the ns-3 factory.
Definition: object-base.h:38
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:670
virtual void ReconfigureLc(LcInfo lcinfo)
Reconfigure an existing logical channel.
Definition: lte-enb-mac.cc:107
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:206
std::map< uint16_t, std::map< uint8_t, LteMacSapUser * > > m_rlcAttached
Definition: lte-enb-mac.h:187
enum ns3::UlCqi_s::Type_e m_type
void DoAddLc(LteEnbCmacSapProvider::LcInfo lcinfo, LteMacSapUser *msu)
Definition: lte-enb-mac.cc:788
LteEnbCmacSapProvider::RachConfig DoGetRachConfig()
Definition: lte-enb-mac.cc:860
virtual void SchedDlConfigInd(const struct SchedDlConfigIndParameters &params)
Definition: lte-enb-mac.cc:157
void DoCschedCellConfigUpdateInd(FfMacCschedSapUser::CschedCellConfigUpdateIndParameters params)
void DoReleaseLc(uint16_t rnti, uint8_t lcid)
Definition: lte-enb-mac.cc:841
void SetLteEnbCmacSapUser(LteEnbCmacSapUser *s)
Set the control MAC SAP user.
Definition: lte-enb-mac.cc:419
void AddPacketTag(const Tag &tag) const
Add a packet tag.
Definition: packet.cc:841
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:61
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:170
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:284
uint8_t m_preambleTransMax
Definition: lte-enb-mac.h:240
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:223
#define NS_FATAL_ERROR(msg)
fatal error handling
Definition: fatal-error.h:95
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:232
#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:101
uint64_t mbrDl
maximum bitrate in downlink
void DoTransmitPdu(LteMacSapProvider::TransmitPduParameters)
Definition: lte-enb-mac.cc:915
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:740
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:83
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:399
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:131
LteMacSapProvider * GetLteMacSapProvider(void)
Get the MAC SAP provider.
Definition: lte-enb-mac.cc:413
Parameters for LteMacSapProvider::ReportBufferStatus.
Definition: lte-mac-sap.h:66
std::map< uint8_t, uint32_t > m_receivedRachPreambleCount
Definition: lte-enb-mac.h:260
FfMacCschedSapUser * m_cschedSapUser
Definition: lte-enb-mac.h:214
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:393
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:217
enum ns3::LogicalChannelConfigListElement_s::Direction_e m_direction
virtual void CschedLcConfigCnf(const struct CschedLcConfigCnfParameters &params)
Definition: lte-enb-mac.cc:208
LteEnbPhySapUser * m_enbPhySapUser
Definition: lte-enb-mac.h:218
FfMacSchedSapUser * GetFfMacSchedSapUser(void)
Get the scheduler SAP user.
Definition: lte-enb-mac.cc:387
make Callback use a separate empty type
Definition: empty.h:8
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:214
void DoUeUpdateConfigurationReq(LteEnbCmacSapProvider::UeConfig params)
Definition: lte-enb-mac.cc:847
Parameters of the SCHED_UL_TRIGGER_REQ primitive.
Hold an unsigned integer type.
Definition: uinteger.h:46
EnbMacMemberLteEnbCmacSapProvider(LteEnbMac *mac)
Definition: lte-enb-mac.cc:77
Logical Channel information to be passed to CmacSapProvider::ConfigureLc.
std::map< uint8_t, uint32_t > m_rapIdRntiMap
Definition: lte-enb-mac.h:262
Ptr< SampleEmitter > s
uint16_t rnti
rnti previously allocated for this non-contention based RA procedure
Definition: lte-enb-mac.h:249
uint8_t m_macChTtiDelay
Definition: lte-enb-mac.h:234
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:314
void DoUlCqiReport(FfMacSchedSapProvider::SchedUlCqiInfoReqParameters ulcqi)
Definition: lte-enb-mac.cc:633
virtual void UlInfoListElementHarqFeeback(UlInfoListElement_s params)
Notify the HARQ on the UL tranmission status.
Definition: lte-enb-mac.cc:296
virtual void SchedDlRachInfoReq(const struct SchedDlRachInfoReqParameters &params)=0
virtual void AddUe(uint16_t rnti)
Definition: lte-enb-mac.cc:89
Provides the SCHED SAP.
friend class EnbMacMemberLteEnbCmacSapProvider
Definition: lte-enb-mac.h:52
virtual void DoDispose(void)
This method is called by Object::Dispose or by the object's destructor, whichever comes first...
Definition: lte-enb-mac.cc:363
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:661
virtual void SchedUlConfigInd(const struct SchedUlConfigIndParameters &params)
Definition: lte-enb-mac.cc:165
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
Definition: log.h:233
std::vector< struct CqiListElement_s > m_cqiList
uint8_t m_raResponseWindowSize
Definition: lte-enb-mac.h:241
#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:625
void DoRemoveUe(uint16_t rnti)
Definition: lte-enb-mac.cc:777
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:113
uint32_t m_subframeNo
Definition: lte-enb-mac.h:221
LteEnbCmacSapProvider::AllocateNcRaPreambleReturnValue DoAllocateNcRaPreamble(uint16_t rnti)
Definition: lte-enb-mac.cc:870
uint8_t m_numberOfRaPreambles
Definition: lte-enb-mac.h:239
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:202
virtual void CschedUeReleaseReq(const struct CschedUeReleaseReqParameters &params)=0
uint8_t lcGroup
logical channel group
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
void DoReportBufferStatus(LteMacSapProvider::ReportBufferStatusParameters)
Definition: lte-enb-mac.cc:931
virtual void CschedUeReleaseCnf(const struct CschedUeReleaseCnfParameters &params)
Definition: lte-enb-mac.cc:220
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:232
LteEnbCmacSapProvider * GetLteEnbCmacSapProvider(void)
Get the control MAC SAP provider.
Definition: lte-enb-mac.cc:425
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:195
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 time".
Definition: simulator.cc:180
EnbMacMemberLteEnbPhySapUser(LteEnbMac *mac)
Definition: lte-enb-mac.cc:260
See section 4.3.6 rachListElement.
LteMacSapProvider * m_macSapProvider
Definition: lte-enb-mac.h:205
std::vector< CqiListElement_s > m_dlCqiReceived
Definition: lte-enb-mac.h:189
virtual void CschedCellConfigCnf(const struct CschedCellConfigCnfParameters &params)
Definition: lte-enb-mac.cc:196
virtual void UeUpdateConfigurationReq(UeConfig params)
update the configuration of the UE
Definition: lte-enb-mac.cc:119
#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:84
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:191
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:193
void SetLteEnbPhySapProvider(LteEnbPhySapProvider *s)
Set the PHY SAP Provider.
Definition: lte-enb-mac.cc:431
LteEnbCmacSapUser * m_cmacSapUser
Definition: lte-enb-mac.h:208
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:272
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:438
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:211
bool RemovePacketTag(Tag &tag)
Remove a packet tag.
Definition: packet.cc:848
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:213
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:266
void DoCschedUeConfigUpdateInd(FfMacCschedSapUser::CschedUeConfigUpdateIndParameters params)
LteMacSapUser * m_macSapUser
Definition: lte-enb-mac.h:207
void DoSchedDlConfigInd(FfMacSchedSapUser::SchedDlConfigIndParameters ind)
Definition: lte-enb-mac.cc:954
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:407
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:278
uint32_t m_frameNo
Definition: lte-enb-mac.h:220
#define NS_LOG_ERROR(msg)
Use NS_LOG to output a message of level LOG_ERROR.
Definition: log.h:193
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:600
a base class which provides memory management and object aggregation
Definition: object.h:64
virtual void CschedUeConfigUpdateInd(const struct CschedUeConfigUpdateIndParameters &params)
Definition: lte-enb-mac.cc:226
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:258
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:357
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:227
virtual void DlInfoListElementHarqFeeback(DlInfoListElement_s params)
Notify the HARQ on the DL tranmission status.
Definition: lte-enb-mac.cc:302
std::vector< struct BuildRarListElement_s > m_buildRarList
std::map< uint16_t, DlHarqProcessesBuffer_t > m_miDlHarqProcessesPackets
Definition: lte-enb-mac.h:237
info associated with a preamble allocated for non-contention based RA
Definition: lte-enb-mac.h:247
a unique identifier for an interface.
Definition: type-id.h:49
void DoSubframeIndication(uint32_t frameNo, uint32_t subframeNo)
Definition: lte-enb-mac.cc:446
EnbMacMemberFfMacSchedSapUser(LteEnbMac *mac)
Definition: lte-enb-mac.cc:150
uint8_t GetLayer(void) const
TypeId SetParent(TypeId tid)
Definition: type-id.cc:610
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:381
virtual void RemoveUe(uint16_t rnti)
remove the UE, e.g., after handover or termination of the RRC connection
Definition: lte-enb-mac.cc:95
FfMacCschedSapProvider * m_cschedSapProvider
Definition: lte-enb-mac.h:212
bool isGbr
true if the bearer is GBR, false if the bearer is NON-GBR
std::vector< struct BuildDataListElement_s > m_buildDataList
#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:250
void ReceiveDlCqiLteControlMessage(Ptr< DlCqiLteControlMessage > msg)
Receive a DL CQI ideal control message.
Definition: lte-enb-mac.cc:648
void DoCschedCellConfigCnf(FfMacCschedSapUser::CschedCellConfigCnfParameters params)
Parameters for LteMacSapProvider::TransmitPdu.
Definition: lte-mac-sap.h:45