A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
lte-enb-mac.cc
Go to the documentation of this file.
1/*
2 * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation;
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 *
17 * Author: Marco Miozzo <marco.miozzo@cttc.es>
18 * Nicola Baldo <nbaldo@cttc.es>
19 * Modified by:
20 * Danilo Abrignani <danilo.abrignani@unibo.it> (Carrier Aggregation - GSoC 2015)
21 * Biljana Bojovic <biljana.bojovic@cttc.es> (Carrier Aggregation)
22 */
23
24#include "lte-enb-mac.h"
25
26#include "lte-common.h"
28#include "lte-enb-cmac-sap.h"
29#include "lte-mac-sap.h"
31
32#include <ns3/log.h>
33#include <ns3/packet.h>
34#include <ns3/pointer.h>
35#include <ns3/simulator.h>
36
37namespace ns3
38{
39
40NS_LOG_COMPONENT_DEFINE("LteEnbMac");
41
43
44// //////////////////////////////////////
45// member SAP forwarders
46// //////////////////////////////////////
47
50{
51 public:
58
59 // inherited from LteEnbCmacSapProvider
60 void ConfigureMac(uint16_t ulBandwidth, uint16_t dlBandwidth) override;
61 void AddUe(uint16_t rnti) override;
62 void RemoveUe(uint16_t rnti) override;
63 void AddLc(LcInfo lcinfo, LteMacSapUser* msu) override;
64 void ReconfigureLc(LcInfo lcinfo) override;
65 void ReleaseLc(uint16_t rnti, uint8_t lcid) override;
66 void UeUpdateConfigurationReq(UeConfig params) override;
67 RachConfig GetRachConfig() override;
69
70 private:
72};
73
75 : m_mac(mac)
76{
77}
78
79void
80EnbMacMemberLteEnbCmacSapProvider::ConfigureMac(uint16_t ulBandwidth, uint16_t dlBandwidth)
81{
82 m_mac->DoConfigureMac(ulBandwidth, dlBandwidth);
83}
84
85void
87{
88 m_mac->DoAddUe(rnti);
89}
90
91void
93{
94 m_mac->DoRemoveUe(rnti);
95}
96
97void
99{
100 m_mac->DoAddLc(lcinfo, msu);
101}
102
103void
105{
106 m_mac->DoReconfigureLc(lcinfo);
107}
108
109void
111{
112 m_mac->DoReleaseLc(rnti, lcid);
113}
114
115void
117{
119}
120
123{
124 return m_mac->DoGetRachConfig();
125}
126
129{
130 return m_mac->DoAllocateNcRaPreamble(rnti);
131}
132
135{
136 public:
143
144 void SchedDlConfigInd(const SchedDlConfigIndParameters& params) override;
145 void SchedUlConfigInd(const SchedUlConfigIndParameters& params) override;
146
147 private:
149};
150
152 : m_mac(mac)
153{
154}
155
156void
158{
159 m_mac->DoSchedDlConfigInd(params);
160}
161
162void
164{
165 m_mac->DoSchedUlConfigInd(params);
166}
167
170{
171 public:
178
179 void CschedCellConfigCnf(const CschedCellConfigCnfParameters& params) override;
180 void CschedUeConfigCnf(const CschedUeConfigCnfParameters& params) override;
181 void CschedLcConfigCnf(const CschedLcConfigCnfParameters& params) override;
182 void CschedLcReleaseCnf(const CschedLcReleaseCnfParameters& params) override;
183 void CschedUeReleaseCnf(const CschedUeReleaseCnfParameters& params) override;
186
187 private:
189};
190
192 : m_mac(mac)
193{
194}
195
196void
198{
200}
201
202void
204{
205 m_mac->DoCschedUeConfigCnf(params);
206}
207
208void
210{
211 m_mac->DoCschedLcConfigCnf(params);
212}
213
214void
216{
218}
219
220void
222{
224}
225
226void
229{
231}
232
233void
236{
238}
239
242{
243 public:
250
251 // inherited from LteEnbPhySapUser
252 void ReceivePhyPdu(Ptr<Packet> p) override;
253 void SubframeIndication(uint32_t frameNo, uint32_t subframeNo) override;
255 void ReceiveRachPreamble(uint32_t prachId) override;
259
260 private:
262};
263
265 : m_mac(mac)
266{
267}
268
269void
271{
273}
274
275void
277{
278 m_mac->DoSubframeIndication(frameNo, subframeNo);
279}
280
281void
283{
285}
286
287void
289{
291}
292
293void
295{
296 m_mac->DoUlCqiReport(ulcqi);
297}
298
299void
301{
303}
304
305void
307{
309}
310
311// //////////////////////////////////////
312// generic LteEnbMac methods
313// //////////////////////////////////////
314
315TypeId
317{
318 static TypeId tid =
319 TypeId("ns3::LteEnbMac")
320 .SetParent<Object>()
321 .SetGroupName("Lte")
322 .AddConstructor<LteEnbMac>()
323 .AddAttribute("NumberOfRaPreambles",
324 "how many random access preambles are available for the contention based "
325 "RACH process",
326 UintegerValue(52),
328 MakeUintegerChecker<uint8_t>(4, 64))
329 .AddAttribute("PreambleTransMax",
330 "Maximum number of random access preamble transmissions",
331 UintegerValue(50),
333 MakeUintegerChecker<uint8_t>(3, 200))
334 .AddAttribute("RaResponseWindowSize",
335 "length of the window (in TTIs) for the reception of the random access "
336 "response (RAR); the resulting RAR timeout is this value + 3 ms",
337 UintegerValue(3),
339 MakeUintegerChecker<uint8_t>(2, 10))
340 .AddAttribute("ConnEstFailCount",
341 "how many time T300 timer can expire on the same cell",
342 UintegerValue(1),
344 MakeUintegerChecker<uint8_t>(1, 4))
345 .AddTraceSource("DlScheduling",
346 "Information regarding DL scheduling.",
348 "ns3::LteEnbMac::DlSchedulingTracedCallback")
349 .AddTraceSource("UlScheduling",
350 "Information regarding UL scheduling.",
352 "ns3::LteEnbMac::UlSchedulingTracedCallback")
353 .AddAttribute("ComponentCarrierId",
354 "ComponentCarrier Id, needed to reply on the appropriate sap.",
355 UintegerValue(0),
357 MakeUintegerChecker<uint8_t>(0, 4));
358
359 return tid;
360}
361
363 : m_ccmMacSapUser(nullptr)
364{
365 NS_LOG_FUNCTION(this);
372}
373
375{
376 NS_LOG_FUNCTION(this);
377}
378
379void
381{
382 NS_LOG_FUNCTION(this);
383 m_dlCqiReceived.clear();
384 m_ulCqiReceived.clear();
385 m_ulCeReceived.clear();
386 m_dlInfoListReceived.clear();
387 m_ulInfoListReceived.clear();
389 delete m_macSapProvider;
390 delete m_cmacSapProvider;
391 delete m_schedSapUser;
392 delete m_cschedSapUser;
393 delete m_enbPhySapUser;
394 delete m_ccmMacSapProvider;
395}
396
397void
399{
400 m_componentCarrierId = index;
401}
402
403void
405{
407}
408
411{
412 return m_schedSapUser;
413}
414
415void
417{
419}
420
423{
424 return m_cschedSapUser;
425}
426
427void
429{
430 m_macSapUser = s;
431}
432
435{
436 return m_macSapProvider;
437}
438
439void
441{
442 m_cmacSapUser = s;
443}
444
447{
448 return m_cmacSapProvider;
449}
450
451void
453{
455}
456
459{
460 return m_enbPhySapUser;
461}
462
463void
465{
466 m_ccmMacSapUser = s;
467}
468
471{
472 return m_ccmMacSapProvider;
473}
474
475void
477{
478 NS_LOG_FUNCTION(this << " EnbMac - frame " << frameNo << " subframe " << subframeNo);
479
480 // Store current frame / subframe number
481 m_frameNo = frameNo;
482 m_subframeNo = subframeNo;
483
484 // --- DOWNLINK ---
485 // Send Dl-CQI info to the scheduler
486 if (!m_dlCqiReceived.empty())
487 {
489 dlcqiInfoReq.m_sfnSf = ((0x3FF & frameNo) << 4) | (0xF & subframeNo);
490 dlcqiInfoReq.m_cqiList.insert(dlcqiInfoReq.m_cqiList.begin(),
491 m_dlCqiReceived.begin(),
492 m_dlCqiReceived.end());
493 m_dlCqiReceived.erase(m_dlCqiReceived.begin(), m_dlCqiReceived.end());
495 }
496
497 if (!m_receivedRachPreambleCount.empty())
498 {
499 // process received RACH preambles and notify the scheduler
501 NS_ASSERT(subframeNo > 0 && subframeNo <= 10); // subframe in 1..10
502 for (std::map<uint8_t, uint32_t>::const_iterator it = m_receivedRachPreambleCount.begin();
503 it != m_receivedRachPreambleCount.end();
504 ++it)
505 {
506 NS_LOG_INFO(this << " preambleId " << (uint32_t)it->first << ": " << it->second
507 << " received");
508 NS_ASSERT(it->second != 0);
509 if (it->second > 1)
510 {
511 NS_LOG_INFO("preambleId " << (uint32_t)it->first << ": collision");
512 // in case of collision we assume that no preamble is
513 // successfully received, hence no RAR is sent
514 }
515 else
516 {
517 uint16_t rnti;
518 std::map<uint8_t, NcRaPreambleInfo>::iterator jt =
519 m_allocatedNcRaPreambleMap.find(it->first);
520 if (jt != m_allocatedNcRaPreambleMap.end())
521 {
522 rnti = jt->second.rnti;
523 NS_LOG_INFO("preambleId previously allocated for NC based RA, RNTI ="
524 << (uint32_t)rnti << ", sending RAR");
525 }
526 else
527 {
529
530 if (rnti == 0)
531 {
532 // If rnti = 0, UE context was not created (not enough SRS)
533 // Therefore don't send RAR for this preamble
534 NS_LOG_INFO("UE context not created, no RAR to send");
535 continue;
536 }
537 NS_LOG_INFO("preambleId " << (uint32_t)it->first << ": allocated T-C-RNTI "
538 << (uint32_t)rnti << ", sending RAR");
539 }
540
541 RachListElement_s rachLe;
542 rachLe.m_rnti = rnti;
543 rachLe.m_estimatedSize = 144; // to be confirmed
544 rachInfoReqParams.m_rachList.push_back(rachLe);
545 m_rapIdRntiMap.insert(std::pair<uint16_t, uint32_t>(rnti, it->first));
546 }
547 }
548 m_schedSapProvider->SchedDlRachInfoReq(rachInfoReqParams);
550 }
551 // Get downlink transmission opportunities
552 uint32_t dlSchedFrameNo = m_frameNo;
553 uint32_t dlSchedSubframeNo = m_subframeNo;
554 // NS_LOG_DEBUG (this << " sfn " << frameNo << " sbfn " << subframeNo);
555 if (dlSchedSubframeNo + m_macChTtiDelay > 10)
556 {
557 dlSchedFrameNo++;
558 dlSchedSubframeNo = (dlSchedSubframeNo + m_macChTtiDelay) % 10;
559 }
560 else
561 {
562 dlSchedSubframeNo = dlSchedSubframeNo + m_macChTtiDelay;
563 }
565 dlparams.m_sfnSf = ((0x3FF & dlSchedFrameNo) << 4) | (0xF & dlSchedSubframeNo);
566
567 // Forward DL HARQ Feedbacks collected during last TTI
568 if (!m_dlInfoListReceived.empty())
569 {
571 // empty local buffer
572 m_dlInfoListReceived.clear();
573 }
574
576
577 // --- UPLINK ---
578 // Send UL-CQI info to the scheduler
579 for (std::size_t i = 0; i < m_ulCqiReceived.size(); i++)
580 {
581 if (subframeNo > 1)
582 {
583 m_ulCqiReceived.at(i).m_sfnSf = ((0x3FF & frameNo) << 4) | (0xF & (subframeNo - 1));
584 }
585 else
586 {
587 m_ulCqiReceived.at(i).m_sfnSf = ((0x3FF & (frameNo - 1)) << 4) | (0xF & 10);
588 }
590 }
591 m_ulCqiReceived.clear();
592
593 // Send BSR reports to the scheduler
594 if (!m_ulCeReceived.empty())
595 {
597 ulMacReq.m_sfnSf = ((0x3FF & frameNo) << 4) | (0xF & subframeNo);
598 ulMacReq.m_macCeList.insert(ulMacReq.m_macCeList.begin(),
599 m_ulCeReceived.begin(),
600 m_ulCeReceived.end());
601 m_ulCeReceived.erase(m_ulCeReceived.begin(), m_ulCeReceived.end());
603 }
604
605 // Get uplink transmission opportunities
606 uint32_t ulSchedFrameNo = m_frameNo;
607 uint32_t ulSchedSubframeNo = m_subframeNo;
608 // NS_LOG_DEBUG (this << " sfn " << frameNo << " sbfn " << subframeNo);
609 if (ulSchedSubframeNo + (m_macChTtiDelay + UL_PUSCH_TTIS_DELAY) > 10)
610 {
611 ulSchedFrameNo++;
612 ulSchedSubframeNo = (ulSchedSubframeNo + (m_macChTtiDelay + UL_PUSCH_TTIS_DELAY)) % 10;
613 }
614 else
615 {
616 ulSchedSubframeNo = ulSchedSubframeNo + (m_macChTtiDelay + UL_PUSCH_TTIS_DELAY);
617 }
619 ulparams.m_sfnSf = ((0x3FF & ulSchedFrameNo) << 4) | (0xF & ulSchedSubframeNo);
620
621 // Forward DL HARQ Feedbacks collected during last TTI
622 if (!m_ulInfoListReceived.empty())
623 {
625 // empty local buffer
626 m_ulInfoListReceived.clear();
627 }
628
630}
631
632void
634{
635 NS_LOG_FUNCTION(this << msg);
636 if (msg->GetMessageType() == LteControlMessage::DL_CQI)
637 {
638 Ptr<DlCqiLteControlMessage> dlcqi = DynamicCast<DlCqiLteControlMessage>(msg);
640 }
641 else if (msg->GetMessageType() == LteControlMessage::BSR)
642 {
643 Ptr<BsrLteControlMessage> bsr = DynamicCast<BsrLteControlMessage>(msg);
644 ReceiveBsrMessage(bsr->GetBsr());
645 }
646 else if (msg->GetMessageType() == LteControlMessage::DL_HARQ)
647 {
649 DynamicCast<DlHarqFeedbackLteControlMessage>(msg);
650 DoDlInfoListElementHarqFeedback(dlharq->GetDlHarqFeedback());
651 }
652 else
653 {
654 NS_LOG_LOGIC(this << " LteControlMessage type " << msg->GetMessageType()
655 << " not recognized");
656 }
657}
658
659void
661{
662 NS_LOG_FUNCTION(this << (uint32_t)rapId);
663 // just record that the preamble has been received; it will be processed later
664 ++m_receivedRachPreambleCount[rapId]; // will create entry if not exists
665}
666
667void
669{
670 if (ulcqi.m_ulCqi.m_type == UlCqi_s::PUSCH)
671 {
672 NS_LOG_DEBUG(this << " eNB rxed an PUSCH UL-CQI");
673 }
674 else if (ulcqi.m_ulCqi.m_type == UlCqi_s::SRS)
675 {
676 NS_LOG_DEBUG(this << " eNB rxed an SRS UL-CQI");
677 }
678 m_ulCqiReceived.push_back(ulcqi);
679}
680
681void
683{
684 NS_LOG_FUNCTION(this << msg);
685
686 CqiListElement_s dlcqi = msg->GetDlCqi();
687 NS_LOG_LOGIC(this << "Enb Received DL-CQI rnti" << dlcqi.m_rnti);
688 NS_ASSERT(dlcqi.m_rnti != 0);
689 m_dlCqiReceived.push_back(dlcqi);
690}
691
692void
694{
695 NS_LOG_FUNCTION(this);
697}
698
699void
701{
702 NS_LOG_FUNCTION(this);
703 NS_LOG_DEBUG(this << " bsr Size " << (uint16_t)m_ulCeReceived.size());
704 // send to LteCcmMacSapUser
705 m_ulCeReceived.push_back(
706 bsr); // this to called when LteUlCcmSapProvider::ReportMacCeToScheduler is called
707 NS_LOG_DEBUG(this << " bsr Size after push_back " << (uint16_t)m_ulCeReceived.size());
708}
709
710void
712{
713 NS_LOG_FUNCTION(this);
715 p->RemovePacketTag(tag);
716
717 // store info of the packet received
718
719 // std::map <uint16_t,UlInfoListElement_s>::iterator it;
720 // u_int rnti = tag.GetRnti ();
721 // u_int lcid = tag.GetLcid ();
722 // it = m_ulInfoListElements.find (tag.GetRnti ());
723 // if (it == m_ulInfoListElements.end ())
724 // {
725 // // new RNTI
726 // UlInfoListElement_s ulinfonew;
727 // ulinfonew.m_rnti = tag.GetRnti ();
728 // // always allocate full size of ulReception vector, initializing all elements to 0
729 // ulinfonew.m_ulReception.assign (MAX_LC_LIST+1, 0);
730 // // set the element for the current LCID
731 // ulinfonew.m_ulReception.at (tag.GetLcid ()) = p->GetSize ();
732 // ulinfonew.m_receptionStatus = UlInfoListElement_s::Ok;
733 // ulinfonew.m_tpc = 0; // Tx power control not implemented at this stage
734 // m_ulInfoListElements.insert (std::pair<uint16_t, UlInfoListElement_s > (tag.GetRnti (),
735 // ulinfonew));
736 //
737 // }
738 // else
739 // {
740 // // existing RNTI: we just set the value for the current
741 // // LCID. Note that the corresponding element had already been
742 // // allocated previously.
743 // NS_ASSERT_MSG ((*it).second.m_ulReception.at (tag.GetLcid ()) == 0, "would overwrite
744 // previously written ulReception element");
745 // (*it).second.m_ulReception.at (tag.GetLcid ()) = p->GetSize ();
746 // (*it).second.m_receptionStatus = UlInfoListElement_s::Ok;
747 // }
748
749 // forward the packet to the correspondent RLC
750 uint16_t rnti = tag.GetRnti();
751 uint8_t lcid = tag.GetLcid();
752 std::map<uint16_t, std::map<uint8_t, LteMacSapUser*>>::iterator rntiIt =
753 m_rlcAttached.find(rnti);
754 NS_ASSERT_MSG(rntiIt != m_rlcAttached.end(), "could not find RNTI" << rnti);
755 std::map<uint8_t, LteMacSapUser*>::iterator lcidIt = rntiIt->second.find(lcid);
756 // NS_ASSERT_MSG (lcidIt != rntiIt->second.end (), "could not find LCID" << lcid);
757
759 rxPduParams.p = p;
760 rxPduParams.rnti = rnti;
761 rxPduParams.lcid = lcid;
762
763 // Receive PDU only if LCID is found
764 if (lcidIt != rntiIt->second.end())
765 {
766 (*lcidIt).second->ReceivePdu(rxPduParams);
767 }
768}
769
770// ////////////////////////////////////////////
771// CMAC SAP
772// ////////////////////////////////////////////
773
774void
775LteEnbMac::DoConfigureMac(uint16_t ulBandwidth, uint16_t dlBandwidth)
776{
777 NS_LOG_FUNCTION(this << " ulBandwidth=" << ulBandwidth << " dlBandwidth=" << dlBandwidth);
779 // Configure the subset of parameters used by FfMacScheduler
780 params.m_ulBandwidth = ulBandwidth;
781 params.m_dlBandwidth = dlBandwidth;
783 // ...more parameters can be configured
785}
786
787void
788LteEnbMac::DoAddUe(uint16_t rnti)
789{
790 NS_LOG_FUNCTION(this << " rnti=" << rnti);
791 std::map<uint8_t, LteMacSapUser*> empty;
792 std::pair<std::map<uint16_t, std::map<uint8_t, LteMacSapUser*>>::iterator, bool> ret =
793 m_rlcAttached.insert(std::pair<uint16_t, std::map<uint8_t, LteMacSapUser*>>(rnti, empty));
794 NS_ASSERT_MSG(ret.second, "element already present, RNTI already existed");
795
797 params.m_rnti = rnti;
798 params.m_transmissionMode =
799 0; // set to default value (SISO) for avoiding random initialization (valgrind error)
800
802
803 // Create DL transmission HARQ buffers
804 std::vector<Ptr<PacketBurst>> dlHarqLayer0pkt;
805 dlHarqLayer0pkt.resize(8);
806 for (uint8_t i = 0; i < 8; i++)
807 {
808 Ptr<PacketBurst> pb = CreateObject<PacketBurst>();
809 dlHarqLayer0pkt.at(i) = pb;
810 }
811 std::vector<Ptr<PacketBurst>> dlHarqLayer1pkt;
812 dlHarqLayer1pkt.resize(8);
813 for (uint8_t i = 0; i < 8; i++)
814 {
815 Ptr<PacketBurst> pb = CreateObject<PacketBurst>();
816 dlHarqLayer1pkt.at(i) = pb;
817 }
819 buf.push_back(dlHarqLayer0pkt);
820 buf.push_back(dlHarqLayer1pkt);
821 m_miDlHarqProcessesPackets.insert(std::pair<uint16_t, DlHarqProcessesBuffer_t>(rnti, buf));
822}
823
824void
826{
827 NS_LOG_FUNCTION(this << " rnti=" << rnti);
829 params.m_rnti = rnti;
831 m_rlcAttached.erase(rnti);
832 m_miDlHarqProcessesPackets.erase(rnti);
833
834 NS_LOG_DEBUG("start checking for unprocessed preamble for rnti: " << rnti);
835 // remove unprocessed preamble received for RACH during handover
836 std::map<uint8_t, NcRaPreambleInfo>::iterator jt = m_allocatedNcRaPreambleMap.begin();
837 while (jt != m_allocatedNcRaPreambleMap.end())
838 {
839 if (jt->second.rnti == rnti)
840 {
841 std::map<uint8_t, uint32_t>::const_iterator it =
842 m_receivedRachPreambleCount.find(jt->first);
843 if (it != m_receivedRachPreambleCount.end())
844 {
845 m_receivedRachPreambleCount.erase(it->first);
846 }
847 jt = m_allocatedNcRaPreambleMap.erase(jt);
848 }
849 else
850 {
851 ++jt;
852 }
853 }
854
855 std::vector<MacCeListElement_s>::iterator itCeRxd = m_ulCeReceived.begin();
856 while (itCeRxd != m_ulCeReceived.end())
857 {
858 if (itCeRxd->m_rnti == rnti)
859 {
860 itCeRxd = m_ulCeReceived.erase(itCeRxd);
861 }
862 else
863 {
864 itCeRxd++;
865 }
866 }
867}
868
869void
871{
872 NS_LOG_FUNCTION(this << lcinfo.rnti << (uint16_t)lcinfo.lcId);
873
874 std::map<LteFlowId_t, LteMacSapUser*>::iterator it;
875
876 LteFlowId_t flow(lcinfo.rnti, lcinfo.lcId);
877
878 std::map<uint16_t, std::map<uint8_t, LteMacSapUser*>>::iterator rntiIt =
879 m_rlcAttached.find(lcinfo.rnti);
880 NS_ASSERT_MSG(rntiIt != m_rlcAttached.end(), "RNTI not found");
881 std::map<uint8_t, LteMacSapUser*>::iterator lcidIt = rntiIt->second.find(lcinfo.lcId);
882 if (lcidIt == rntiIt->second.end())
883 {
884 rntiIt->second.insert(std::pair<uint8_t, LteMacSapUser*>(lcinfo.lcId, msu));
885 }
886 else
887 {
888 NS_LOG_ERROR("LC already exists");
889 }
890
891 // CCCH (LCID 0) is pre-configured
892 // see FF LTE MAC Scheduler
893 // Interface Specification v1.11,
894 // 4.3.4 logicalChannelConfigListElement
895 if (lcinfo.lcId != 0)
896 {
898 params.m_rnti = lcinfo.rnti;
899 params.m_reconfigureFlag = false;
900
902 lccle.m_logicalChannelIdentity = lcinfo.lcId;
903 lccle.m_logicalChannelGroup = lcinfo.lcGroup;
905 lccle.m_qci = lcinfo.qci;
906 lccle.m_eRabMaximulBitrateUl = lcinfo.mbrUl;
907 lccle.m_eRabMaximulBitrateDl = lcinfo.mbrDl;
908 lccle.m_eRabGuaranteedBitrateUl = lcinfo.gbrUl;
909 lccle.m_eRabGuaranteedBitrateDl = lcinfo.gbrDl;
910 lccle.m_qosBearerType =
912
913 params.m_logicalChannelConfigList.push_back(lccle);
914
916 }
917}
918
919void
921{
922 NS_FATAL_ERROR("not implemented");
923}
924
925void
926LteEnbMac::DoReleaseLc(uint16_t rnti, uint8_t lcid)
927{
928 NS_LOG_FUNCTION(this);
929
930 // Find user based on rnti and then erase lcid stored against the same
931 std::map<uint16_t, std::map<uint8_t, LteMacSapUser*>>::iterator rntiIt =
932 m_rlcAttached.find(rnti);
933 rntiIt->second.erase(lcid);
934
936 params.m_rnti = rnti;
937 params.m_logicalChannelIdentity.push_back(lcid);
939}
940
941void
943{
944 NS_LOG_FUNCTION(this);
945
946 // propagates to scheduler
948 req.m_rnti = params.m_rnti;
949 req.m_transmissionMode = params.m_transmissionMode;
950 req.m_reconfigureFlag = true;
952}
953
956{
958 rc.numberOfRaPreambles = m_numberOfRaPreambles;
959 rc.preambleTransMax = m_preambleTransMax;
960 rc.raResponseWindowSize = m_raResponseWindowSize;
961 rc.connEstFailCount = m_connEstFailCount;
962 return rc;
963}
964
967{
968 bool found = false;
969 uint8_t preambleId;
970 for (preambleId = m_numberOfRaPreambles; preambleId < 64; ++preambleId)
971 {
972 std::map<uint8_t, NcRaPreambleInfo>::iterator it =
973 m_allocatedNcRaPreambleMap.find(preambleId);
985 if ((it != m_allocatedNcRaPreambleMap.end()) && (it->second.expiryTime < Simulator::Now()))
986 {
987 if (!m_cmacSapUser->IsRandomAccessCompleted(it->second.rnti))
988 {
989 // random access of the UE is not completed,
990 // check other preambles
991 continue;
992 }
993 }
994 if ((it == m_allocatedNcRaPreambleMap.end()) || (it->second.expiryTime < Simulator::Now()))
995 {
996 found = true;
997 NcRaPreambleInfo preambleInfo;
998 uint32_t expiryIntervalMs =
1000
1001 preambleInfo.expiryTime = Simulator::Now() + MilliSeconds(expiryIntervalMs);
1002 preambleInfo.rnti = rnti;
1003 NS_LOG_INFO("allocated preamble for NC based RA: preamble "
1004 << preambleId << ", RNTI " << preambleInfo.rnti << ", exiryTime "
1005 << preambleInfo.expiryTime);
1006 m_allocatedNcRaPreambleMap[preambleId] =
1007 preambleInfo; // create if not exist, update otherwise
1008 break;
1009 }
1010 }
1012 if (found)
1013 {
1014 ret.valid = true;
1015 ret.raPreambleId = preambleId;
1016 ret.raPrachMaskIndex = 0;
1017 }
1018 else
1019 {
1020 ret.valid = false;
1021 ret.raPreambleId = 0;
1022 ret.raPrachMaskIndex = 0;
1023 }
1024 return ret;
1025}
1026
1027// ////////////////////////////////////////////
1028// MAC SAP
1029// ////////////////////////////////////////////
1030
1031void
1033{
1034 NS_LOG_FUNCTION(this);
1035 LteRadioBearerTag tag(params.rnti, params.lcid, params.layer);
1036 params.pdu->AddPacketTag(tag);
1037 params.componentCarrierId = m_componentCarrierId;
1038 // Store pkt in HARQ buffer
1039 std::map<uint16_t, DlHarqProcessesBuffer_t>::iterator it =
1040 m_miDlHarqProcessesPackets.find(params.rnti);
1042 NS_LOG_DEBUG(this << " LAYER " << (uint16_t)tag.GetLayer() << " HARQ ID "
1043 << (uint16_t)params.harqProcessId);
1044
1045 //(*it).second.at (params.layer).at (params.harqProcessId) = params.pdu;//->Copy ();
1046 (*it).second.at(params.layer).at(params.harqProcessId)->AddPacket(params.pdu);
1047 m_enbPhySapProvider->SendMacPdu(params.pdu);
1048}
1049
1050void
1052{
1053 NS_LOG_FUNCTION(this);
1055 req.m_rnti = params.rnti;
1056 req.m_logicalChannelIdentity = params.lcid;
1057 req.m_rlcTransmissionQueueSize = params.txQueueSize;
1058 req.m_rlcTransmissionQueueHolDelay = params.txQueueHolDelay;
1059 req.m_rlcRetransmissionQueueSize = params.retxQueueSize;
1060 req.m_rlcRetransmissionHolDelay = params.retxQueueHolDelay;
1061 req.m_rlcStatusPduSize = params.statusPduSize;
1063}
1064
1065// ////////////////////////////////////////////
1066// SCHED SAP
1067// ////////////////////////////////////////////
1068
1069void
1071{
1072 NS_LOG_FUNCTION(this);
1073 // Create DL PHY PDU
1074 Ptr<PacketBurst> pb = CreateObject<PacketBurst>();
1075 std::map<LteFlowId_t, LteMacSapUser*>::iterator it;
1077
1078 for (std::size_t i = 0; i < ind.m_buildDataList.size(); i++)
1079 {
1080 for (std::size_t layer = 0; layer < ind.m_buildDataList.at(i).m_dci.m_ndi.size(); layer++)
1081 {
1082 if (ind.m_buildDataList.at(i).m_dci.m_ndi.at(layer) == 1)
1083 {
1084 // new data -> force emptying correspondent harq pkt buffer
1085 std::map<uint16_t, DlHarqProcessesBuffer_t>::iterator it =
1086 m_miDlHarqProcessesPackets.find(ind.m_buildDataList.at(i).m_rnti);
1088 for (std::size_t lcId = 0; lcId < (*it).second.size(); lcId++)
1089 {
1090 Ptr<PacketBurst> pb = CreateObject<PacketBurst>();
1091 (*it).second.at(lcId).at(ind.m_buildDataList.at(i).m_dci.m_harqProcess) = pb;
1092 }
1093 }
1094 }
1095 for (std::size_t j = 0; j < ind.m_buildDataList.at(i).m_rlcPduList.size(); j++)
1096 {
1097 for (std::size_t k = 0; k < ind.m_buildDataList.at(i).m_rlcPduList.at(j).size(); k++)
1098 {
1099 if (ind.m_buildDataList.at(i).m_dci.m_ndi.at(k) == 1)
1100 {
1101 // New Data -> retrieve it from RLC
1102 uint16_t rnti = ind.m_buildDataList.at(i).m_rnti;
1103 uint8_t lcid =
1104 ind.m_buildDataList.at(i).m_rlcPduList.at(j).at(k).m_logicalChannelIdentity;
1105 std::map<uint16_t, std::map<uint8_t, LteMacSapUser*>>::iterator rntiIt =
1106 m_rlcAttached.find(rnti);
1107 NS_ASSERT_MSG(rntiIt != m_rlcAttached.end(), "could not find RNTI" << rnti);
1108 std::map<uint8_t, LteMacSapUser*>::iterator lcidIt = rntiIt->second.find(lcid);
1109 NS_ASSERT_MSG(lcidIt != rntiIt->second.end(),
1110 "could not find LCID" << (uint32_t)lcid << " carrier id:"
1111 << (uint16_t)m_componentCarrierId);
1112 NS_LOG_DEBUG(this << " rnti= " << rnti << " lcid= " << (uint32_t)lcid
1113 << " layer= " << k);
1114 txOpParams.bytes = ind.m_buildDataList.at(i).m_rlcPduList.at(j).at(k).m_size;
1115 txOpParams.layer = k;
1116 txOpParams.harqId = ind.m_buildDataList.at(i).m_dci.m_harqProcess;
1118 txOpParams.rnti = rnti;
1119 txOpParams.lcid = lcid;
1120 (*lcidIt).second->NotifyTxOpportunity(txOpParams);
1121 }
1122 else
1123 {
1124 if (ind.m_buildDataList.at(i).m_dci.m_tbsSize.at(k) > 0)
1125 {
1126 // HARQ retransmission -> retrieve TB from HARQ buffer
1127 std::map<uint16_t, DlHarqProcessesBuffer_t>::iterator it =
1128 m_miDlHarqProcessesPackets.find(ind.m_buildDataList.at(i).m_rnti);
1130 Ptr<PacketBurst> pb =
1131 (*it).second.at(k).at(ind.m_buildDataList.at(i).m_dci.m_harqProcess);
1132 for (std::list<Ptr<Packet>>::const_iterator j = pb->Begin(); j != pb->End();
1133 ++j)
1134 {
1135 Ptr<Packet> pkt = (*j)->Copy();
1137 }
1138 }
1139 }
1140 }
1141 }
1142 // send the relative DCI
1143 Ptr<DlDciLteControlMessage> msg = Create<DlDciLteControlMessage>();
1144 msg->SetDci(ind.m_buildDataList.at(i).m_dci);
1146 }
1147
1148 // Fire the trace with the DL information
1149 for (uint32_t i = 0; i < ind.m_buildDataList.size(); i++)
1150 {
1151 // Only one TB used
1152 if (ind.m_buildDataList.at(i).m_dci.m_tbsSize.size() == 1)
1153 {
1154 DlSchedulingCallbackInfo dlSchedulingCallbackInfo;
1155 dlSchedulingCallbackInfo.frameNo = m_frameNo;
1156 dlSchedulingCallbackInfo.subframeNo = m_subframeNo;
1157 dlSchedulingCallbackInfo.rnti = ind.m_buildDataList.at(i).m_dci.m_rnti;
1158 dlSchedulingCallbackInfo.mcsTb1 = ind.m_buildDataList.at(i).m_dci.m_mcs.at(0);
1159 dlSchedulingCallbackInfo.sizeTb1 = ind.m_buildDataList.at(i).m_dci.m_tbsSize.at(0);
1160 dlSchedulingCallbackInfo.mcsTb2 = 0;
1161 dlSchedulingCallbackInfo.sizeTb2 = 0;
1162 dlSchedulingCallbackInfo.componentCarrierId = m_componentCarrierId;
1163 m_dlScheduling(dlSchedulingCallbackInfo);
1164 }
1165 // Two TBs used
1166 else if (ind.m_buildDataList.at(i).m_dci.m_tbsSize.size() == 2)
1167 {
1168 DlSchedulingCallbackInfo dlSchedulingCallbackInfo;
1169 dlSchedulingCallbackInfo.frameNo = m_frameNo;
1170 dlSchedulingCallbackInfo.subframeNo = m_subframeNo;
1171 dlSchedulingCallbackInfo.rnti = ind.m_buildDataList.at(i).m_dci.m_rnti;
1172 dlSchedulingCallbackInfo.mcsTb1 = ind.m_buildDataList.at(i).m_dci.m_mcs.at(0);
1173 dlSchedulingCallbackInfo.sizeTb1 = ind.m_buildDataList.at(i).m_dci.m_tbsSize.at(0);
1174 dlSchedulingCallbackInfo.mcsTb2 = ind.m_buildDataList.at(i).m_dci.m_mcs.at(1);
1175 dlSchedulingCallbackInfo.sizeTb2 = ind.m_buildDataList.at(i).m_dci.m_tbsSize.at(1);
1176 dlSchedulingCallbackInfo.componentCarrierId = m_componentCarrierId;
1177 m_dlScheduling(dlSchedulingCallbackInfo);
1178 }
1179 else
1180 {
1181 NS_FATAL_ERROR("Found element with more than two transport blocks");
1182 }
1183 }
1184
1185 // Random Access procedure: send RARs
1186 Ptr<RarLteControlMessage> rarMsg = Create<RarLteControlMessage>();
1187 // see TS 36.321 5.1.4; preambles were sent two frames ago
1188 // (plus 3GPP counts subframes from 0, not 1)
1189 uint16_t raRnti;
1190 if (m_subframeNo < 3)
1191 {
1192 raRnti = m_subframeNo + 7; // equivalent to +10-3
1193 }
1194 else
1195 {
1196 raRnti = m_subframeNo - 3;
1197 }
1198 rarMsg->SetRaRnti(raRnti);
1199 for (unsigned int i = 0; i < ind.m_buildRarList.size(); i++)
1200 {
1201 std::map<uint16_t, uint32_t>::iterator itRapId =
1202 m_rapIdRntiMap.find(ind.m_buildRarList.at(i).m_rnti);
1203 if (itRapId == m_rapIdRntiMap.end())
1204 {
1205 NS_FATAL_ERROR("Unable to find rapId of RNTI " << ind.m_buildRarList.at(i).m_rnti);
1206 }
1208 rar.rapId = itRapId->second;
1209 rar.rarPayload = ind.m_buildRarList.at(i);
1210 rarMsg->AddRar(rar);
1211 NS_LOG_INFO(this << " Send RAR message to RNTI " << ind.m_buildRarList.at(i).m_rnti
1212 << " rapId " << itRapId->second);
1213 }
1214 if (!ind.m_buildRarList.empty())
1215 {
1217 }
1218 m_rapIdRntiMap.clear();
1219}
1220
1221void
1223{
1224 NS_LOG_FUNCTION(this);
1225
1226 for (unsigned int i = 0; i < ind.m_dciList.size(); i++)
1227 {
1228 // send the correspondent ul dci
1229 Ptr<UlDciLteControlMessage> msg = Create<UlDciLteControlMessage>();
1230 msg->SetDci(ind.m_dciList.at(i));
1232 }
1233
1234 // Fire the trace with the UL information
1235 for (uint32_t i = 0; i < ind.m_dciList.size(); i++)
1236 {
1239 ind.m_dciList.at(i).m_rnti,
1240 ind.m_dciList.at(i).m_mcs,
1241 ind.m_dciList.at(i).m_tbSize,
1243 }
1244}
1245
1246// ////////////////////////////////////////////
1247// CSCHED SAP
1248// ////////////////////////////////////////////
1249
1250void
1252{
1253 NS_LOG_FUNCTION(this);
1254}
1255
1256void
1258{
1259 NS_LOG_FUNCTION(this);
1260}
1261
1262void
1264{
1265 NS_LOG_FUNCTION(this);
1266 // Call the CSCHED primitive
1267 // m_cschedSap->LcConfigCompleted();
1268}
1269
1270void
1272{
1273 NS_LOG_FUNCTION(this);
1274}
1275
1276void
1278{
1279 NS_LOG_FUNCTION(this);
1280}
1281
1282void
1284{
1285 NS_LOG_FUNCTION(this);
1286 // propagates to RRC
1287 LteEnbCmacSapUser::UeConfig ueConfigUpdate;
1288 ueConfigUpdate.m_rnti = params.m_rnti;
1289 ueConfigUpdate.m_transmissionMode = params.m_transmissionMode;
1291}
1292
1293void
1296{
1297 NS_LOG_FUNCTION(this);
1298}
1299
1300void
1302{
1303 NS_LOG_FUNCTION(this);
1304 m_ulInfoListReceived.push_back(params);
1305}
1306
1307void
1309{
1310 NS_LOG_FUNCTION(this);
1311 // Update HARQ buffer
1312 std::map<uint16_t, DlHarqProcessesBuffer_t>::iterator it =
1313 m_miDlHarqProcessesPackets.find(params.m_rnti);
1315 for (std::size_t layer = 0; layer < params.m_harqStatus.size(); layer++)
1316 {
1317 if (params.m_harqStatus.at(layer) == DlInfoListElement_s::ACK)
1318 {
1319 // discard buffer
1320 Ptr<PacketBurst> emptyBuf = CreateObject<PacketBurst>();
1321 (*it).second.at(layer).at(params.m_harqProcessId) = emptyBuf;
1322 NS_LOG_DEBUG(this << " HARQ-ACK UE " << params.m_rnti << " harqId "
1323 << (uint16_t)params.m_harqProcessId << " layer " << (uint16_t)layer);
1324 }
1325 else if (params.m_harqStatus.at(layer) == DlInfoListElement_s::NACK)
1326 {
1327 NS_LOG_DEBUG(this << " HARQ-NACK UE " << params.m_rnti << " harqId "
1328 << (uint16_t)params.m_harqProcessId << " layer " << (uint16_t)layer);
1329 }
1330 else
1331 {
1332 NS_FATAL_ERROR(" HARQ functionality not implemented");
1333 }
1334 }
1335 m_dlInfoListReceived.push_back(params);
1336}
1337
1338} // namespace ns3
EnbMacMemberFfMacCschedSapUser class.
Definition: lte-enb-mac.cc:170
void CschedLcReleaseCnf(const CschedLcReleaseCnfParameters &params) override
CSCHED_LC_RELEASE_CNF.
Definition: lte-enb-mac.cc:215
void CschedUeConfigCnf(const CschedUeConfigCnfParameters &params) override
CSCHED_UE_CONFIG_CNF.
Definition: lte-enb-mac.cc:203
EnbMacMemberFfMacCschedSapUser(LteEnbMac *mac)
Constructor.
Definition: lte-enb-mac.cc:191
void CschedLcConfigCnf(const CschedLcConfigCnfParameters &params) override
CSCHED_LC_CONFIG_CNF.
Definition: lte-enb-mac.cc:209
void CschedCellConfigUpdateInd(const CschedCellConfigUpdateIndParameters &params) override
CSCHED_UE_CONFIG_IND.
Definition: lte-enb-mac.cc:234
void CschedUeReleaseCnf(const CschedUeReleaseCnfParameters &params) override
CSCHED_UE_RELEASE_CNF.
Definition: lte-enb-mac.cc:221
void CschedCellConfigCnf(const CschedCellConfigCnfParameters &params) override
CSCHED_CELL_CONFIG_CNF.
Definition: lte-enb-mac.cc:197
void CschedUeConfigUpdateInd(const CschedUeConfigUpdateIndParameters &params) override
CSCHED_UE_UPDATE_IND.
Definition: lte-enb-mac.cc:227
EnbMacMemberFfMacSchedSapUser class.
Definition: lte-enb-mac.cc:135
void SchedDlConfigInd(const SchedDlConfigIndParameters &params) override
SCHED_DL_CONFIG_IND.
Definition: lte-enb-mac.cc:157
EnbMacMemberFfMacSchedSapUser(LteEnbMac *mac)
Constructor.
Definition: lte-enb-mac.cc:151
void SchedUlConfigInd(const SchedUlConfigIndParameters &params) override
SCHED_UL_CONFIG_IND.
Definition: lte-enb-mac.cc:163
EnbMacMemberLteEnbCmacSapProvider class.
Definition: lte-enb-mac.cc:50
void AddLc(LcInfo lcinfo, LteMacSapUser *msu) override
Add a new logical channel.
Definition: lte-enb-mac.cc:98
void UeUpdateConfigurationReq(UeConfig params) override
update the configuration of the UE
Definition: lte-enb-mac.cc:116
void RemoveUe(uint16_t rnti) override
remove the UE, e.g., after handover or termination of the RRC connection
Definition: lte-enb-mac.cc:92
void AddUe(uint16_t rnti) override
Add UE function.
Definition: lte-enb-mac.cc:86
void ReconfigureLc(LcInfo lcinfo) override
Reconfigure an existing logical channel.
Definition: lte-enb-mac.cc:104
AllocateNcRaPreambleReturnValue AllocateNcRaPreamble(uint16_t rnti) override
Allocate a random access preamble for non-contention based random access (e.g., for handover).
Definition: lte-enb-mac.cc:128
void ConfigureMac(uint16_t ulBandwidth, uint16_t dlBandwidth) override
Definition: lte-enb-mac.cc:80
EnbMacMemberLteEnbCmacSapProvider(LteEnbMac *mac)
Constructor.
Definition: lte-enb-mac.cc:74
void ReleaseLc(uint16_t rnti, uint8_t lcid) override
release an existing logical channel
Definition: lte-enb-mac.cc:110
-------— PHY-SAP
Definition: lte-enb-mac.cc:242
void SubframeIndication(uint32_t frameNo, uint32_t subframeNo) override
Trigger the start from a new frame (input from Phy layer)
Definition: lte-enb-mac.cc:276
void ReceivePhyPdu(Ptr< Packet > p) override
Called by the Phy to notify the MAC of the reception of a new PHY-PDU.
Definition: lte-enb-mac.cc:270
void ReceiveLteControlMessage(Ptr< LteControlMessage > msg) override
Receive SendLteControlMessage (PDCCH map, CQI feedbacks) using the ideal control channel.
Definition: lte-enb-mac.cc:282
void ReceiveRachPreamble(uint32_t prachId) override
notify the reception of a RACH preamble on the PRACH
Definition: lte-enb-mac.cc:288
EnbMacMemberLteEnbPhySapUser(LteEnbMac *mac)
Constructor.
Definition: lte-enb-mac.cc:264
void DlInfoListElementHarqFeedback(DlInfoListElement_s params) override
Notify the HARQ on the DL transmission status.
Definition: lte-enb-mac.cc:306
void UlCqiReport(FfMacSchedSapProvider::SchedUlCqiInfoReqParameters ulcqi) override
Returns to MAC level the UL-CQI evaluated.
Definition: lte-enb-mac.cc:294
void UlInfoListElementHarqFeedback(UlInfoListElement_s params) override
Notify the HARQ on the UL transmission status.
Definition: lte-enb-mac.cc:300
Provides the CSCHED SAP.
virtual void CschedLcConfigReq(const CschedLcConfigReqParameters &params)=0
CSCHED_LC_CONFIG_REQ.
virtual void CschedLcReleaseReq(const CschedLcReleaseReqParameters &params)=0
CSCHED_LC_RELEASE_REQ.
virtual void CschedUeConfigReq(const CschedUeConfigReqParameters &params)=0
CSCHED_UE_CONFIG_REQ.
virtual void CschedUeReleaseReq(const CschedUeReleaseReqParameters &params)=0
CSCHED_UE_RELEASE_REQ.
virtual void CschedCellConfigReq(const CschedCellConfigReqParameters &params)=0
CSCHED_CELL_CONFIG_REQ.
FfMacCschedSapUser class.
Provides the SCHED SAP.
virtual void SchedDlTriggerReq(const SchedDlTriggerReqParameters &params)=0
SCHED_DL_TRIGGER_REQ.
virtual void SchedDlRachInfoReq(const SchedDlRachInfoReqParameters &params)=0
SCHED_DL_RACH_INFO_REQ.
virtual void SchedUlMacCtrlInfoReq(const SchedUlMacCtrlInfoReqParameters &params)=0
SCHED_UL_MAC_CTRL_INFO_REQ.
virtual void SchedUlCqiInfoReq(const SchedUlCqiInfoReqParameters &params)=0
SCHED_UL_CQI_INFO_REQ.
virtual void SchedUlTriggerReq(const SchedUlTriggerReqParameters &params)=0
SCHED_UL_TRIGGER_REQ.
virtual void SchedDlRlcBufferReq(const SchedDlRlcBufferReqParameters &params)=0
SCHED_DL_RLC_BUFFER_REQ.
virtual void SchedDlCqiInfoReq(const SchedDlCqiInfoReqParameters &params)=0
SCHED_DL_CQI_INFO_REQ.
FfMacSchedSapUser class.
Service Access Point (SAP) offered by the component carrier manager (CCM) by MAC to CCM.
Service Access Point (SAP) offered by MAC to the component carrier manager (CCM).
virtual void UlReceiveMacCe(MacCeListElement_s bsr, uint8_t componentCarrierId)=0
When the Primary Component carrier receive a buffer status report it is sent to the CCM.
Service Access Point (SAP) offered by the eNB MAC to the eNB RRC See Femto Forum MAC Scheduler Interf...
Service Access Point (SAP) offered by the MAC to the RRC See Femto Forum MAC Scheduler Interface Spec...
virtual bool IsRandomAccessCompleted(uint16_t rnti)=0
Is random access completed function.
virtual void RrcConfigurationUpdateInd(UeConfig params)=0
Notify the RRC of a UE config updated requested by the MAC (normally, by the scheduler)
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:58
void SetFfMacCschedSapProvider(FfMacCschedSapProvider *s)
Set the control scheduler SAP provider.
Definition: lte-enb-mac.cc:416
~LteEnbMac() override
Definition: lte-enb-mac.cc:374
void DoReceivePhyPdu(Ptr< Packet > p)
legacy public for use the Phy callback
Definition: lte-enb-mac.cc:711
void DoSchedDlConfigInd(FfMacSchedSapUser::SchedDlConfigIndParameters ind)
Sched DL Config Indication function.
FfMacSchedSapUser * m_schedSapUser
the Sched SAP user
Definition: lte-enb-mac.h:401
void DoCschedCellConfigCnf(FfMacCschedSapUser::CschedCellConfigCnfParameters params)
CSched Cell Config configure function.
FfMacCschedSapProvider * m_cschedSapProvider
the Csched SAP provider
Definition: lte-enb-mac.h:400
void SetLteEnbPhySapProvider(LteEnbPhySapProvider *s)
Set the PHY SAP Provider.
Definition: lte-enb-mac.cc:452
uint32_t m_frameNo
frame number of current subframe indication
Definition: lte-enb-mac.h:414
void DoDispose() override
Destructor implementation.
Definition: lte-enb-mac.cc:380
LteEnbPhySapProvider * m_enbPhySapProvider
the ENB Phy SAP provider
Definition: lte-enb-mac.h:405
void DoReportBufferStatus(LteMacSapProvider::ReportBufferStatusParameters params)
Report Buffer Status function.
FfMacCschedSapUser * GetFfMacCschedSapUser()
Get the control scheduler SAP user.
Definition: lte-enb-mac.cc:422
FfMacCschedSapUser * m_cschedSapUser
the CSched SAP user
Definition: lte-enb-mac.h:402
static TypeId GetTypeId()
Get the type ID.
Definition: lte-enb-mac.cc:316
friend class EnbMacMemberFfMacCschedSapUser
allow EnbMacMemberFfMacCschedSapUser class friend access
Definition: lte-enb-mac.h:66
LteCcmMacSapUser * m_ccmMacSapUser
CCM MAC SAP user.
Definition: lte-enb-mac.h:410
void DoCschedUeReleaseCnf(FfMacCschedSapUser::CschedUeReleaseCnfParameters params)
CSched UE Release configure function.
void SetLteEnbCmacSapUser(LteEnbCmacSapUser *s)
Set the control MAC SAP user.
Definition: lte-enb-mac.cc:440
LteEnbPhySapUser * GetLteEnbPhySapUser()
Get the eNB-PHY SAP User.
Definition: lte-enb-mac.cc:458
void DoUlInfoListElementHarqFeedback(UlInfoListElement_s params)
UL Info List ELements HARQ Feedback function.
std::vector< CqiListElement_s > m_dlCqiReceived
DL-CQI received.
Definition: lte-enb-mac.h:380
std::map< uint8_t, uint32_t > m_receivedRachPreambleCount
received RACH preamble count
Definition: lte-enb-mac.h:460
LteCcmMacSapProvider * m_ccmMacSapProvider
CCM MAC SAP provider.
Definition: lte-enb-mac.h:409
FfMacSchedSapProvider * m_schedSapProvider
the Sched SAP provider
Definition: lte-enb-mac.h:399
void DoReceiveRachPreamble(uint8_t prachId)
Receive RACH Preamble function.
Definition: lte-enb-mac.cc:660
void DoCschedLcConfigCnf(FfMacCschedSapUser::CschedLcConfigCnfParameters params)
CSched LC Config configure function.
uint8_t m_componentCarrierId
component carrier Id used to address sap
Definition: lte-enb-mac.h:465
void DoCschedUeConfigCnf(FfMacCschedSapUser::CschedUeConfigCnfParameters params)
CSched UE Config configure function.
TracedCallback< uint32_t, uint32_t, uint16_t, uint8_t, uint16_t, uint8_t > m_ulScheduling
Trace information regarding UL scheduling Frame number, Subframe number, RNTI, MCS of TB,...
Definition: lte-enb-mac.h:430
void DoReleaseLc(uint16_t rnti, uint8_t lcid)
Release LC function.
Definition: lte-enb-mac.cc:926
void DoReceiveLteControlMessage(Ptr< LteControlMessage > msg)
Receive a DL CQI ideal control message.
Definition: lte-enb-mac.cc:633
friend class EnbMacMemberLteEnbCmacSapProvider
allow EnbMacMemberLteEnbCmacSapProvider class friend access
Definition: lte-enb-mac.h:60
void SetLteCcmMacSapUser(LteCcmMacSapUser *s)
Set the ComponentCarrierManager SAP user.
Definition: lte-enb-mac.cc:464
std::map< uint16_t, std::map< uint8_t, LteMacSapUser * > > m_rlcAttached
RNTI, LC ID, SAP of the RLC instance.
Definition: lte-enb-mac.h:378
LteMacSapUser * m_macSapUser
the MAC SAP user
Definition: lte-enb-mac.h:396
std::vector< MacCeListElement_s > m_ulCeReceived
CE received (BSR up to now)
Definition: lte-enb-mac.h:383
LteEnbPhySapUser * m_enbPhySapUser
the ENB Phy SAP user
Definition: lte-enb-mac.h:406
void DoTransmitPdu(LteMacSapProvider::TransmitPduParameters params)
Transmit PDU function.
std::vector< FfMacSchedSapProvider::SchedUlCqiInfoReqParameters > m_ulCqiReceived
UL-CQI received.
Definition: lte-enb-mac.h:382
LteEnbCmacSapProvider * m_cmacSapProvider
the CMAC SAP provider
Definition: lte-enb-mac.h:395
friend class EnbMacMemberFfMacSchedSapUser
allow EnbMacMemberFfMacSchedSapUser class friend access
Definition: lte-enb-mac.h:64
TracedCallback< DlSchedulingCallbackInfo > m_dlScheduling
Trace information regarding DL scheduling Frame number, Subframe number, RNTI, MCS of TB1,...
Definition: lte-enb-mac.h:424
void SetFfMacSchedSapProvider(FfMacSchedSapProvider *s)
Set the scheduler SAP provider.
Definition: lte-enb-mac.cc:404
void ReceiveBsrMessage(MacCeListElement_s bsr)
Receive a CE element containing the buffer status report.
Definition: lte-enb-mac.cc:693
uint8_t m_connEstFailCount
the counter value for T300 timer expiration
Definition: lte-enb-mac.h:440
LteMacSapProvider * m_macSapProvider
the MAC SAP provider
Definition: lte-enb-mac.h:394
uint8_t m_raResponseWindowSize
RA response window size.
Definition: lte-enb-mac.h:439
void DoUeUpdateConfigurationReq(LteEnbCmacSapProvider::UeConfig params)
UE Update configuration request function.
Definition: lte-enb-mac.cc:942
void DoReconfigureLc(LteEnbCmacSapProvider::LcInfo lcinfo)
Reconfigure LC function.
Definition: lte-enb-mac.cc:920
uint8_t m_macChTtiDelay
delay of MAC, PHY and channel in terms of TTIs
Definition: lte-enb-mac.h:432
FfMacSchedSapUser * GetFfMacSchedSapUser()
Get the scheduler SAP user.
Definition: lte-enb-mac.cc:410
LteCcmMacSapProvider * GetLteCcmMacSapProvider()
Get the eNB-ComponentCarrierManager SAP User.
Definition: lte-enb-mac.cc:470
void DoDlInfoListElementHarqFeedback(DlInfoListElement_s params)
DL Info List ELements HARQ Feedback function.
uint8_t m_preambleTransMax
preamble transmit maximum
Definition: lte-enb-mac.h:438
void DoConfigureMac(uint16_t ulBandwidth, uint16_t dlBandwidth)
Configure MAC function.
Definition: lte-enb-mac.cc:775
std::map< uint8_t, NcRaPreambleInfo > m_allocatedNcRaPreambleMap
map storing as key the random access preamble IDs allocated for non-contention based access,...
Definition: lte-enb-mac.h:458
uint8_t m_numberOfRaPreambles
number of RA preambles
Definition: lte-enb-mac.h:437
LteEnbCmacSapProvider * GetLteEnbCmacSapProvider()
Get the control MAC SAP provider.
Definition: lte-enb-mac.cc:446
std::map< uint16_t, DlHarqProcessesBuffer_t > m_miDlHarqProcessesPackets
Packet under transmission of the DL HARQ process.
Definition: lte-enb-mac.h:435
void DoCschedCellConfigUpdateInd(FfMacCschedSapUser::CschedCellConfigUpdateIndParameters params)
CSched Cell Config Update Indication function.
void DoAddLc(LteEnbCmacSapProvider::LcInfo lcinfo, LteMacSapUser *msu)
Add LC function.
Definition: lte-enb-mac.cc:870
void DoCschedUeConfigUpdateInd(FfMacCschedSapUser::CschedUeConfigUpdateIndParameters params)
CSched UE Config Update Indication function.
void DoSubframeIndication(uint32_t frameNo, uint32_t subframeNo)
Subrame Indication function.
Definition: lte-enb-mac.cc:476
void SetLteMacSapUser(LteMacSapUser *s)
Set the MAC SAP user.
Definition: lte-enb-mac.cc:428
void ReceiveDlCqiLteControlMessage(Ptr< DlCqiLteControlMessage > msg)
Receive a DL CQI ideal control message.
Definition: lte-enb-mac.cc:682
LteEnbCmacSapProvider::AllocateNcRaPreambleReturnValue DoAllocateNcRaPreamble(uint16_t rnti)
Allocate NC RA preamble function.
Definition: lte-enb-mac.cc:966
void DoRemoveUe(uint16_t rnti)
Remove UE function.
Definition: lte-enb-mac.cc:825
friend class EnbMacMemberLteMacSapProvider< LteEnbMac >
allow EnbMacMemberLteMacSapProvider<LteEnbMac> class friend access
Definition: lte-enb-mac.h:62
LteEnbCmacSapProvider::RachConfig DoGetRachConfig() const
Get RACH configuration function.
Definition: lte-enb-mac.cc:955
std::vector< DlInfoListElement_s > m_dlInfoListReceived
DL HARQ feedback received.
Definition: lte-enb-mac.h:385
void DoSchedUlConfigInd(FfMacSchedSapUser::SchedUlConfigIndParameters params)
Sched UL Config Indication function.
LteMacSapProvider * GetLteMacSapProvider()
Get the MAC SAP provider.
Definition: lte-enb-mac.cc:434
LteEnbCmacSapUser * m_cmacSapUser
the CMAC SAP user
Definition: lte-enb-mac.h:397
uint32_t m_subframeNo
subframe number of current subframe indication
Definition: lte-enb-mac.h:418
friend class MemberLteCcmMacSapProvider< LteEnbMac >
allow MemberLteCcmMacSapProvider<LteEnbMac> class friend access
Definition: lte-enb-mac.h:70
void DoCschedLcReleaseCnf(FfMacCschedSapUser::CschedLcReleaseCnfParameters params)
CSched LC Release configure function.
void DoAddUe(uint16_t rnti)
Add UE function.
Definition: lte-enb-mac.cc:788
friend class EnbMacMemberLteEnbPhySapUser
allow EnbMacMemberLteEnbPhySapUser class friend access
Definition: lte-enb-mac.h:68
void DoReportMacCeToScheduler(MacCeListElement_s bsr)
Report MAC CE to scheduler.
Definition: lte-enb-mac.cc:700
void SetComponentCarrierId(uint8_t index)
Set the component carrier ID.
Definition: lte-enb-mac.cc:398
void DoUlCqiReport(FfMacSchedSapProvider::SchedUlCqiInfoReqParameters ulcqi)
UL CQI report.
Definition: lte-enb-mac.cc:668
std::vector< UlInfoListElement_s > m_ulInfoListReceived
UL HARQ feedback received.
Definition: lte-enb-mac.h:387
std::map< uint16_t, uint32_t > m_rapIdRntiMap
RAPID RNTI map.
Definition: lte-enb-mac.h:462
Service Access Point (SAP) offered by the eNB-PHY to the eNB-MAC.
virtual void SendLteControlMessage(Ptr< LteControlMessage > msg)=0
Send SendLteControlMessage (PDCCH map, CQI feedbacks) using the ideal control channel.
virtual uint8_t GetMacChTtiDelay()=0
Get the delay from MAC to Channel expressed in TTIs.
virtual void SendMacPdu(Ptr< Packet > p)=0
Send the MAC PDU to the channel.
Service Access Point (SAP) offered by the eNB-PHY to the eNB-MAC.
Service Access Point (SAP) offered by the MAC to the RLC See Femto Forum MAC Scheduler Interface Spec...
Definition: lte-mac-sap.h:36
Service Access Point (SAP) offered by the MAC to the RLC See Femto Forum MAC Scheduler Interface Spec...
Definition: lte-mac-sap.h:96
Tag used to define the RNTI and LC id for each MAC packet trasmitted.
uint16_t GetRnti() const
Get RNTI function.
uint8_t GetLcid() const
Get LCID function.
uint8_t GetLayer() const
Get layer function.
A base class which provides memory management and object aggregation.
Definition: object.h:89
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:78
static Time Now()
Return the current simulation virtual time.
Definition: simulator.cc:199
a unique identifier for an interface.
Definition: type-id.h:59
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition: type-id.cc:936
Hold an unsigned integer type.
Definition: uinteger.h:45
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
Definition: assert.h:66
#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:86
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Definition: uinteger.h:46
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
Definition: fatal-error.h:179
#define NS_LOG_ERROR(msg)
Use NS_LOG to output a message of level LOG_ERROR.
Definition: log.h:254
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:202
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Definition: log.h:268
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
Definition: log.h:282
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
Definition: log.h:275
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition: object-base.h:46
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition: nstime.h:1348
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
Create a TraceSourceAccessor which will control access to the underlying trace source.
#define UL_PUSCH_TTIS_DELAY
Definition: lte-common.h:28
Every class exported by the ns3 library is enclosed in the ns3 namespace.
std::vector< std::vector< Ptr< PacketBurst > > > DlHarqProcessesBuffer_t
DlHarqProcessesBuffer_t typedef.
Definition: lte-enb-mac.h:52
See section 4.3.24 cqiListElement.
uint16_t m_rnti
RNTI.
See section 4.3.23 dlInfoListElement.
DlSchedulingCallbackInfo structure.
Definition: lte-common.h:237
uint32_t subframeNo
subframe number
Definition: lte-common.h:239
uint16_t sizeTb2
size TB2
Definition: lte-common.h:244
uint16_t sizeTb1
size TB1
Definition: lte-common.h:242
uint8_t componentCarrierId
component carrier ID
Definition: lte-common.h:245
uint32_t frameNo
frame number
Definition: lte-common.h:238
Parameters of the CSCHED_LC_CONFIG_REQ primitive.
Parameters of the CSCHED_LC_RELEASE_REQ primitive.
Parameters of the CSCHED_UE_CONFIG_REQ primitive.
Parameters of the CSCHED_UE_RELEASE_REQ primitive.
Parameters of the CSCHED_CELL_CONFIG_UPDATE_IND primitive.
Parameters of the CSCHED_LC_CONFIG_CNF primitive.
Parameters of the CSCHED_LC_RELEASE_CNF primitive.
Parameters of the CSCHED_UE_CONFIG_CNF primitive.
Parameters of the CSCHED_UE_CONFIG_UPDATE_IND primitive.
Parameters of the CSCHED_UE_RELEASE_CNF primitive.
Parameters of the SCHED_DL_CQI_INFO_REQ primitive.
std::vector< CqiListElement_s > m_cqiList
CQI list.
Parameters of the SCHED_DL_RACH_INFO_REQ primitive.
std::vector< RachListElement_s > m_rachList
RACH list.
uint16_t m_rlcRetransmissionHolDelay
RLC retransmission HOL delay.
uint32_t m_rlcRetransmissionQueueSize
RLC retransmission queue size.
uint16_t m_rlcTransmissionQueueHolDelay
RLC transmission queue HOL delay.
uint32_t m_rlcTransmissionQueueSize
RLC transmission queue size.
Parameters of the SCHED_DL_TRIGGER_REQ primitive.
std::vector< DlInfoListElement_s > m_dlInfoList
DL info list.
Parameters of the SCHED_UL_CQI_INFO_REQ primitive.
Parameters of the SCHED_UL_MAC_CTRL_INFO_REQ primitive.
std::vector< MacCeListElement_s > m_macCeList
MAC CE list.
Parameters of the SCHED_UL_TRIGGER_REQ primitive.
std::vector< UlInfoListElement_s > m_ulInfoList
UL info list.
std::vector< BuildDataListElement_s > m_buildDataList
build data list
std::vector< BuildRarListElement_s > m_buildRarList
build rar list
Parameters of the SCHED_UL_CONFIG_IND primitive.
std::vector< UlDciListElement_s > m_dciList
DCI list.
See section 4.3.4 logicalChannelConfigListElement.
uint64_t m_eRabMaximulBitrateUl
ERAB maximum bit rate UL.
uint64_t m_eRabGuaranteedBitrateDl
ERAB guaranteed bit rate DL.
uint8_t m_logicalChannelGroup
logical channel group
uint64_t m_eRabGuaranteedBitrateUl
ERAB guaranteed bit rate UL.
uint8_t m_logicalChannelIdentity
logical channel identity
uint64_t m_eRabMaximulBitrateDl
ERAB maximum bit rate DL.
AllocateNcRaPreambleReturnValue structure.
bool valid
true if a valid RA config was allocated, false otherwise
Logical Channel information to be passed to CmacSapProvider::ConfigureLc.
uint64_t gbrUl
guaranteed bitrate in uplink
uint8_t qci
QoS Class Identifier.
uint64_t mbrDl
maximum bitrate in downlink
uint64_t mbrUl
maximum bitrate in uplink
uint8_t lcGroup
logical channel group
uint8_t resourceType
0 if the bearer is NON-GBR, 1 if the bearer is GBR, 2 if the bearer in DC-GBR
uint64_t gbrDl
guaranteed bitrate in downlink
uint8_t lcId
logical channel identifier
uint16_t rnti
C-RNTI identifying the UE.
struct defining the RACH configuration of the MAC
Parameters for [re]configuring the UE.
Parameters for [re]configuring the UE.
uint16_t m_rnti
UE id within this cell.
uint8_t m_transmissionMode
Transmission mode [1..7] (i.e., SISO, MIMO, etc.)
info associated with a preamble allocated for non-contention based RA
Definition: lte-enb-mac.h:447
Time expiryTime
value the expiration time of this allocation (so that stale preambles can be reused)
Definition: lte-enb-mac.h:449
uint16_t rnti
rnti previously allocated for this non-contention based RA procedure
Definition: lte-enb-mac.h:448
LteFlowId structure.
Definition: lte-common.h:43
Parameters for LteMacSapProvider::ReportBufferStatus.
Definition: lte-mac-sap.h:69
Parameters for LteMacSapProvider::TransmitPdu.
Definition: lte-mac-sap.h:45
Parameters for LteMacSapUser::ReceivePdu.
Definition: lte-mac-sap.h:166
Ptr< Packet > p
the RLC PDU to be received
Definition: lte-mac-sap.h:187
uint8_t lcid
the logical channel id
Definition: lte-mac-sap.h:189
uint16_t rnti
the C-RNTI identifying the UE
Definition: lte-mac-sap.h:188
Parameters for LteMacSapUser::NotifyTxOpportunity.
Definition: lte-mac-sap.h:105
uint16_t rnti
the C-RNTI identifying the UE
Definition: lte-mac-sap.h:141
uint32_t bytes
the number of bytes to transmit
Definition: lte-mac-sap.h:137
uint8_t componentCarrierId
the component carrier id
Definition: lte-mac-sap.h:140
uint8_t layer
the layer of transmission (MIMO)
Definition: lte-mac-sap.h:138
uint8_t lcid
the logical channel id
Definition: lte-mac-sap.h:142
See section 4.3.14 macCEListElement.
See section 4.3.6 rachListElement.
uint16_t m_estimatedSize
estimated size
a MAC RAR and the corresponding RAPID subheader
BuildRarListElement_s rarPayload
RAR payload.
See section 4.3.12 ulInfoListElement.