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