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 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Marco Miozzo <marco.miozzo@cttc.es>
7 * Nicola Baldo <nbaldo@cttc.es>
8 * Modified by:
9 * Danilo Abrignani <danilo.abrignani@unibo.it> (Carrier Aggregation - GSoC 2015)
10 * Biljana Bojovic <biljana.bojovic@cttc.es> (Carrier Aggregation)
11 */
12
13#include "lte-enb-mac.h"
14
15#include "lte-common.h"
17#include "lte-enb-cmac-sap.h"
18#include "lte-mac-sap.h"
20
21#include <ns3/log.h>
22#include <ns3/packet.h>
23#include <ns3/pointer.h>
24#include <ns3/simulator.h>
25
26namespace ns3
27{
28
29NS_LOG_COMPONENT_DEFINE("LteEnbMac");
30
32
33// //////////////////////////////////////
34// member SAP forwarders
35// //////////////////////////////////////
36
37/// EnbMacMemberLteEnbCmacSapProvider class
39{
40 public:
41 /**
42 * Constructor
43 *
44 * \param mac the MAC
45 */
47
48 // inherited from LteEnbCmacSapProvider
49 void ConfigureMac(uint16_t ulBandwidth, uint16_t dlBandwidth) override;
50 void AddUe(uint16_t rnti) override;
51 void RemoveUe(uint16_t rnti) override;
52 void AddLc(LcInfo lcinfo, LteMacSapUser* msu) override;
53 void ReconfigureLc(LcInfo lcinfo) override;
54 void ReleaseLc(uint16_t rnti, uint8_t lcid) override;
55 void UeUpdateConfigurationReq(UeConfig params) override;
56 RachConfig GetRachConfig() override;
58
59 private:
60 LteEnbMac* m_mac; ///< the MAC
61};
62
67
68void
69EnbMacMemberLteEnbCmacSapProvider::ConfigureMac(uint16_t ulBandwidth, uint16_t dlBandwidth)
70{
71 m_mac->DoConfigureMac(ulBandwidth, dlBandwidth);
72}
73
74void
76{
77 m_mac->DoAddUe(rnti);
78}
79
80void
85
86void
91
92void
97
98void
100{
101 m_mac->DoReleaseLc(rnti, lcid);
102}
103
104void
109
115
121
122/// EnbMacMemberFfMacSchedSapUser class
124{
125 public:
126 /**
127 * Constructor
128 *
129 * \param mac the MAC
130 */
132
133 void SchedDlConfigInd(const SchedDlConfigIndParameters& params) override;
134 void SchedUlConfigInd(const SchedUlConfigIndParameters& params) override;
135
136 private:
137 LteEnbMac* m_mac; ///< the MAC
138};
139
144
145void
150
151void
156
157/// EnbMacMemberFfMacCschedSapUser class
159{
160 public:
161 /**
162 * Constructor
163 *
164 * \param mac the MAC
165 */
167
168 void CschedCellConfigCnf(const CschedCellConfigCnfParameters& params) override;
169 void CschedUeConfigCnf(const CschedUeConfigCnfParameters& params) override;
170 void CschedLcConfigCnf(const CschedLcConfigCnfParameters& params) override;
171 void CschedLcReleaseCnf(const CschedLcReleaseCnfParameters& params) override;
172 void CschedUeReleaseCnf(const CschedUeReleaseCnfParameters& params) override;
175
176 private:
177 LteEnbMac* m_mac; ///< the MAC
178};
179
184
185void
190
191void
196
197void
202
203void
208
209void
214
215void
221
222void
228
229/// ---------- PHY-SAP
231{
232 public:
233 /**
234 * Constructor
235 *
236 * \param mac the MAC
237 */
239
240 // inherited from LteEnbPhySapUser
241 void ReceivePhyPdu(Ptr<Packet> p) override;
242 void SubframeIndication(uint32_t frameNo, uint32_t subframeNo) override;
244 void ReceiveRachPreamble(uint32_t prachId) override;
248
249 private:
250 LteEnbMac* m_mac; ///< the MAC
251};
252
257
258void
263
264void
266{
267 m_mac->DoSubframeIndication(frameNo, subframeNo);
268}
269
270void
275
276void
281
282void
287
288void
293
294void
299
300// //////////////////////////////////////
301// generic LteEnbMac methods
302// //////////////////////////////////////
303
304TypeId
306{
307 static TypeId tid =
308 TypeId("ns3::LteEnbMac")
309 .SetParent<Object>()
310 .SetGroupName("Lte")
311 .AddConstructor<LteEnbMac>()
312 .AddAttribute("NumberOfRaPreambles",
313 "how many random access preambles are available for the contention based "
314 "RACH process",
315 UintegerValue(52),
318 .AddAttribute("PreambleTransMax",
319 "Maximum number of random access preamble transmissions",
320 UintegerValue(50),
323 .AddAttribute("RaResponseWindowSize",
324 "length of the window (in TTIs) for the reception of the random access "
325 "response (RAR); the resulting RAR timeout is this value + 3 ms",
326 UintegerValue(3),
329 .AddAttribute("ConnEstFailCount",
330 "how many time T300 timer can expire on the same cell",
331 UintegerValue(1),
334 .AddTraceSource("DlScheduling",
335 "Information regarding DL scheduling.",
337 "ns3::LteEnbMac::DlSchedulingTracedCallback")
338 .AddTraceSource("UlScheduling",
339 "Information regarding UL scheduling.",
341 "ns3::LteEnbMac::UlSchedulingTracedCallback")
342 .AddAttribute("ComponentCarrierId",
343 "ComponentCarrier Id, needed to reply on the appropriate sap.",
344 UintegerValue(0),
347
348 return tid;
349}
350
362
367
368void
370{
371 NS_LOG_FUNCTION(this);
372 m_dlCqiReceived.clear();
373 m_ulCqiReceived.clear();
374 m_ulCeReceived.clear();
375 m_dlInfoListReceived.clear();
376 m_ulInfoListReceived.clear();
378 delete m_macSapProvider;
379 delete m_cmacSapProvider;
380 delete m_schedSapUser;
381 delete m_cschedSapUser;
382 delete m_enbPhySapUser;
383 delete m_ccmMacSapProvider;
384}
385
386void
388{
389 m_componentCarrierId = index;
390}
391
392void
397
403
404void
409
415
416void
421
427
428void
433
439
440void
445
451
452void
457
463
464void
466{
467 NS_LOG_FUNCTION(this << " EnbMac - frame " << frameNo << " subframe " << subframeNo);
468
469 // Store current frame / subframe number
470 m_frameNo = frameNo;
471 m_subframeNo = subframeNo;
472
473 // --- DOWNLINK ---
474 // Send Dl-CQI info to the scheduler
475 if (!m_dlCqiReceived.empty())
476 {
478 dlcqiInfoReq.m_sfnSf = ((0x3FF & frameNo) << 4) | (0xF & subframeNo);
479 dlcqiInfoReq.m_cqiList.insert(dlcqiInfoReq.m_cqiList.begin(),
480 m_dlCqiReceived.begin(),
481 m_dlCqiReceived.end());
482 m_dlCqiReceived.erase(m_dlCqiReceived.begin(), m_dlCqiReceived.end());
484 }
485
486 if (!m_receivedRachPreambleCount.empty())
487 {
488 // process received RACH preambles and notify the scheduler
490 NS_ASSERT(subframeNo > 0 && subframeNo <= 10); // subframe in 1..10
491 for (auto it = m_receivedRachPreambleCount.begin(); it != m_receivedRachPreambleCount.end();
492 ++it)
493 {
494 NS_LOG_INFO(this << " preambleId " << (uint32_t)it->first << ": " << it->second
495 << " received");
496 NS_ASSERT(it->second != 0);
497 if (it->second > 1)
498 {
499 NS_LOG_INFO("preambleId " << (uint32_t)it->first << ": collision");
500 // in case of collision we assume that no preamble is
501 // successfully received, hence no RAR is sent
502 }
503 else
504 {
505 uint16_t rnti;
506 auto jt = m_allocatedNcRaPreambleMap.find(it->first);
507 if (jt != m_allocatedNcRaPreambleMap.end())
508 {
509 rnti = jt->second.rnti;
510 NS_LOG_INFO("preambleId previously allocated for NC based RA, RNTI ="
511 << (uint32_t)rnti << ", sending RAR");
512 }
513 else
514 {
516
517 if (rnti == 0)
518 {
519 // If rnti = 0, UE context was not created (not enough SRS)
520 // Therefore don't send RAR for this preamble
521 NS_LOG_INFO("UE context not created, no RAR to send");
522 continue;
523 }
524 NS_LOG_INFO("preambleId " << (uint32_t)it->first << ": allocated T-C-RNTI "
525 << (uint32_t)rnti << ", sending RAR");
526 }
527
528 RachListElement_s rachLe;
529 rachLe.m_rnti = rnti;
530 rachLe.m_estimatedSize = 144; // to be confirmed
531 rachInfoReqParams.m_rachList.push_back(rachLe);
532 m_rapIdRntiMap.insert(std::pair<uint16_t, uint32_t>(rnti, it->first));
533 }
534 }
535 m_schedSapProvider->SchedDlRachInfoReq(rachInfoReqParams);
537 }
538 // Get downlink transmission opportunities
539 uint32_t dlSchedFrameNo = m_frameNo;
540 uint32_t dlSchedSubframeNo = m_subframeNo;
541 // NS_LOG_DEBUG (this << " sfn " << frameNo << " sbfn " << subframeNo);
542 if (dlSchedSubframeNo + m_macChTtiDelay > 10)
543 {
544 dlSchedFrameNo++;
545 dlSchedSubframeNo = (dlSchedSubframeNo + m_macChTtiDelay) % 10;
546 }
547 else
548 {
549 dlSchedSubframeNo = dlSchedSubframeNo + m_macChTtiDelay;
550 }
552 dlparams.m_sfnSf = ((0x3FF & dlSchedFrameNo) << 4) | (0xF & dlSchedSubframeNo);
553
554 // Forward DL HARQ Feedbacks collected during last TTI
555 if (!m_dlInfoListReceived.empty())
556 {
558 // empty local buffer
559 m_dlInfoListReceived.clear();
560 }
561
563
564 // --- UPLINK ---
565 // Send UL-CQI info to the scheduler
566 for (std::size_t i = 0; i < m_ulCqiReceived.size(); i++)
567 {
568 if (subframeNo > 1)
569 {
570 m_ulCqiReceived.at(i).m_sfnSf = ((0x3FF & frameNo) << 4) | (0xF & (subframeNo - 1));
571 }
572 else
573 {
574 m_ulCqiReceived.at(i).m_sfnSf = ((0x3FF & (frameNo - 1)) << 4) | (0xF & 10);
575 }
577 }
578 m_ulCqiReceived.clear();
579
580 // Send BSR reports to the scheduler
581 if (!m_ulCeReceived.empty())
582 {
584 ulMacReq.m_sfnSf = ((0x3FF & frameNo) << 4) | (0xF & subframeNo);
585 ulMacReq.m_macCeList.insert(ulMacReq.m_macCeList.begin(),
586 m_ulCeReceived.begin(),
587 m_ulCeReceived.end());
588 m_ulCeReceived.erase(m_ulCeReceived.begin(), m_ulCeReceived.end());
590 }
591
592 // Get uplink transmission opportunities
593 uint32_t ulSchedFrameNo = m_frameNo;
594 uint32_t ulSchedSubframeNo = m_subframeNo;
595 // NS_LOG_DEBUG (this << " sfn " << frameNo << " sbfn " << subframeNo);
596 if (ulSchedSubframeNo + (m_macChTtiDelay + UL_PUSCH_TTIS_DELAY) > 10)
597 {
598 ulSchedFrameNo++;
599 ulSchedSubframeNo = (ulSchedSubframeNo + (m_macChTtiDelay + UL_PUSCH_TTIS_DELAY)) % 10;
600 }
601 else
602 {
603 ulSchedSubframeNo = ulSchedSubframeNo + (m_macChTtiDelay + UL_PUSCH_TTIS_DELAY);
604 }
606 ulparams.m_sfnSf = ((0x3FF & ulSchedFrameNo) << 4) | (0xF & ulSchedSubframeNo);
607
608 // Forward DL HARQ Feedbacks collected during last TTI
609 if (!m_ulInfoListReceived.empty())
610 {
612 // empty local buffer
613 m_ulInfoListReceived.clear();
614 }
615
617}
618
619void
621{
622 NS_LOG_FUNCTION(this << msg);
623 if (msg->GetMessageType() == LteControlMessage::DL_CQI)
624 {
627 }
628 else if (msg->GetMessageType() == LteControlMessage::BSR)
629 {
631 ReceiveBsrMessage(bsr->GetBsr());
632 }
633 else if (msg->GetMessageType() == LteControlMessage::DL_HARQ)
634 {
637 DoDlInfoListElementHarqFeedback(dlharq->GetDlHarqFeedback());
638 }
639 else
640 {
641 NS_LOG_LOGIC(this << " LteControlMessage type " << msg->GetMessageType()
642 << " not recognized");
643 }
644}
645
646void
648{
649 NS_LOG_FUNCTION(this << (uint32_t)rapId);
650 // just record that the preamble has been received; it will be processed later
651 ++m_receivedRachPreambleCount[rapId]; // will create entry if not exists
652}
653
654void
656{
657 if (ulcqi.m_ulCqi.m_type == UlCqi_s::PUSCH)
658 {
659 NS_LOG_DEBUG(this << " eNB rxed an PUSCH UL-CQI");
660 }
661 else if (ulcqi.m_ulCqi.m_type == UlCqi_s::SRS)
662 {
663 NS_LOG_DEBUG(this << " eNB rxed an SRS UL-CQI");
664 }
665 m_ulCqiReceived.push_back(ulcqi);
666}
667
668void
670{
671 NS_LOG_FUNCTION(this << msg);
672
673 CqiListElement_s dlcqi = msg->GetDlCqi();
674 NS_LOG_LOGIC(this << "Enb Received DL-CQI rnti" << dlcqi.m_rnti);
675 NS_ASSERT(dlcqi.m_rnti != 0);
676 m_dlCqiReceived.push_back(dlcqi);
677}
678
679void
685
686void
688{
689 NS_LOG_FUNCTION(this);
690 NS_LOG_DEBUG(this << " bsr Size " << (uint16_t)m_ulCeReceived.size());
691 // send to LteCcmMacSapUser
692 m_ulCeReceived.push_back(
693 bsr); // this to called when LteUlCcmSapProvider::ReportMacCeToScheduler is called
694 NS_LOG_DEBUG(this << " bsr Size after push_back " << (uint16_t)m_ulCeReceived.size());
695}
696
697void
699{
700 NS_LOG_FUNCTION(this);
702 p->RemovePacketTag(tag);
703
704 // store info of the packet received
705
706 // u_int rnti = tag.GetRnti ();
707 // u_int lcid = tag.GetLcid ();
708 // auto it = m_ulInfoListElements.find (tag.GetRnti ());
709 // if (it == m_ulInfoListElements.end ())
710 // {
711 // // new RNTI
712 // UlInfoListElement_s ulinfonew;
713 // ulinfonew.m_rnti = tag.GetRnti ();
714 // // always allocate full size of ulReception vector, initializing all elements to 0
715 // ulinfonew.m_ulReception.assign (MAX_LC_LIST+1, 0);
716 // // set the element for the current LCID
717 // ulinfonew.m_ulReception.at (tag.GetLcid ()) = p->GetSize ();
718 // ulinfonew.m_receptionStatus = UlInfoListElement_s::Ok;
719 // ulinfonew.m_tpc = 0; // Tx power control not implemented at this stage
720 // m_ulInfoListElements.insert (std::pair<uint16_t, UlInfoListElement_s > (tag.GetRnti (),
721 // ulinfonew));
722 //
723 // }
724 // else
725 // {
726 // // existing RNTI: we just set the value for the current
727 // // LCID. Note that the corresponding element had already been
728 // // allocated previously.
729 // NS_ASSERT_MSG ((*it).second.m_ulReception.at (tag.GetLcid ()) == 0, "would overwrite
730 // previously written ulReception element");
731 // (*it).second.m_ulReception.at (tag.GetLcid ()) = p->GetSize ();
732 // (*it).second.m_receptionStatus = UlInfoListElement_s::Ok;
733 // }
734
735 // forward the packet to the correspondent RLC
736 uint16_t rnti = tag.GetRnti();
737 uint8_t lcid = tag.GetLcid();
738 auto rntiIt = m_rlcAttached.find(rnti);
739 NS_ASSERT_MSG(rntiIt != m_rlcAttached.end(), "could not find RNTI" << rnti);
740 auto lcidIt = rntiIt->second.find(lcid);
741 // NS_ASSERT_MSG (lcidIt != rntiIt->second.end (), "could not find LCID" << lcid);
742
744 rxPduParams.p = p;
745 rxPduParams.rnti = rnti;
746 rxPduParams.lcid = lcid;
747
748 // Receive PDU only if LCID is found
749 if (lcidIt != rntiIt->second.end())
750 {
751 (*lcidIt).second->ReceivePdu(rxPduParams);
752 }
753}
754
755// ////////////////////////////////////////////
756// CMAC SAP
757// ////////////////////////////////////////////
758
759void
760LteEnbMac::DoConfigureMac(uint16_t ulBandwidth, uint16_t dlBandwidth)
761{
762 NS_LOG_FUNCTION(this << " ulBandwidth=" << ulBandwidth << " dlBandwidth=" << dlBandwidth);
764 // Configure the subset of parameters used by FfMacScheduler
765 params.m_ulBandwidth = ulBandwidth;
766 params.m_dlBandwidth = dlBandwidth;
768 // ...more parameters can be configured
770}
771
772void
773LteEnbMac::DoAddUe(uint16_t rnti)
774{
775 NS_LOG_FUNCTION(this << " rnti=" << rnti);
776 std::map<uint8_t, LteMacSapUser*> empty;
777 auto ret =
778 m_rlcAttached.insert(std::pair<uint16_t, std::map<uint8_t, LteMacSapUser*>>(rnti, empty));
779 NS_ASSERT_MSG(ret.second, "element already present, RNTI already existed");
780
782 params.m_rnti = rnti;
783 params.m_transmissionMode =
784 0; // set to default value (SISO) for avoiding random initialization (valgrind error)
785
787
788 // Create DL transmission HARQ buffers
789 std::vector<Ptr<PacketBurst>> dlHarqLayer0pkt;
790 dlHarqLayer0pkt.resize(8);
791 for (uint8_t i = 0; i < 8; i++)
792 {
794 dlHarqLayer0pkt.at(i) = pb;
795 }
796 std::vector<Ptr<PacketBurst>> dlHarqLayer1pkt;
797 dlHarqLayer1pkt.resize(8);
798 for (uint8_t i = 0; i < 8; i++)
799 {
801 dlHarqLayer1pkt.at(i) = pb;
802 }
804 buf.push_back(dlHarqLayer0pkt);
805 buf.push_back(dlHarqLayer1pkt);
806 m_miDlHarqProcessesPackets.insert(std::pair<uint16_t, DlHarqProcessesBuffer_t>(rnti, buf));
807}
808
809void
811{
812 NS_LOG_FUNCTION(this << " rnti=" << rnti);
814 params.m_rnti = rnti;
816 m_rlcAttached.erase(rnti);
817 m_miDlHarqProcessesPackets.erase(rnti);
818
819 NS_LOG_DEBUG("start checking for unprocessed preamble for rnti: " << rnti);
820 // remove unprocessed preamble received for RACH during handover
821 auto jt = m_allocatedNcRaPreambleMap.begin();
822 while (jt != m_allocatedNcRaPreambleMap.end())
823 {
824 if (jt->second.rnti == rnti)
825 {
826 auto it = m_receivedRachPreambleCount.find(jt->first);
827 if (it != m_receivedRachPreambleCount.end())
828 {
829 m_receivedRachPreambleCount.erase(it->first);
830 }
831 jt = m_allocatedNcRaPreambleMap.erase(jt);
832 }
833 else
834 {
835 ++jt;
836 }
837 }
838
839 auto itCeRxd = m_ulCeReceived.begin();
840 while (itCeRxd != m_ulCeReceived.end())
841 {
842 if (itCeRxd->m_rnti == rnti)
843 {
844 itCeRxd = m_ulCeReceived.erase(itCeRxd);
845 }
846 else
847 {
848 itCeRxd++;
849 }
850 }
851}
852
853void
855{
856 NS_LOG_FUNCTION(this << lcinfo.rnti << (uint16_t)lcinfo.lcId);
857
858 LteFlowId_t flow(lcinfo.rnti, lcinfo.lcId);
859
860 auto rntiIt = m_rlcAttached.find(lcinfo.rnti);
861 NS_ASSERT_MSG(rntiIt != m_rlcAttached.end(), "RNTI not found");
862 auto lcidIt = rntiIt->second.find(lcinfo.lcId);
863 if (lcidIt == rntiIt->second.end())
864 {
865 rntiIt->second.insert(std::pair<uint8_t, LteMacSapUser*>(lcinfo.lcId, msu));
866 }
867 else
868 {
869 NS_LOG_ERROR("LC already exists");
870 }
871
872 // CCCH (LCID 0) is pre-configured
873 // see FF LTE MAC Scheduler
874 // Interface Specification v1.11,
875 // 4.3.4 logicalChannelConfigListElement
876 if (lcinfo.lcId != 0)
877 {
879 params.m_rnti = lcinfo.rnti;
880 params.m_reconfigureFlag = false;
881
883 lccle.m_logicalChannelIdentity = lcinfo.lcId;
884 lccle.m_logicalChannelGroup = lcinfo.lcGroup;
886 lccle.m_qci = lcinfo.qci;
887 lccle.m_eRabMaximulBitrateUl = lcinfo.mbrUl;
888 lccle.m_eRabMaximulBitrateDl = lcinfo.mbrDl;
889 lccle.m_eRabGuaranteedBitrateUl = lcinfo.gbrUl;
890 lccle.m_eRabGuaranteedBitrateDl = lcinfo.gbrDl;
891 lccle.m_qosBearerType =
893
894 params.m_logicalChannelConfigList.push_back(lccle);
895
897 }
898}
899
900void
905
906void
907LteEnbMac::DoReleaseLc(uint16_t rnti, uint8_t lcid)
908{
909 NS_LOG_FUNCTION(this);
910
911 // Find user based on rnti and then erase lcid stored against the same
912 auto rntiIt = m_rlcAttached.find(rnti);
913 rntiIt->second.erase(lcid);
914
916 params.m_rnti = rnti;
917 params.m_logicalChannelIdentity.push_back(lcid);
919}
920
921void
923{
924 NS_LOG_FUNCTION(this);
925
926 // propagates to scheduler
928 req.m_rnti = params.m_rnti;
929 req.m_transmissionMode = params.m_transmissionMode;
930 req.m_reconfigureFlag = true;
932}
933
936{
938 rc.numberOfRaPreambles = m_numberOfRaPreambles;
939 rc.preambleTransMax = m_preambleTransMax;
940 rc.raResponseWindowSize = m_raResponseWindowSize;
941 rc.connEstFailCount = m_connEstFailCount;
942 return rc;
943}
944
947{
948 bool found = false;
949 uint8_t preambleId;
950 for (preambleId = m_numberOfRaPreambles; preambleId < 64; ++preambleId)
951 {
952 auto it = m_allocatedNcRaPreambleMap.find(preambleId);
953 /**
954 * Allocate preamble only if its free. The non-contention preamble
955 * assigned to UE during handover or PDCCH order is valid only until the
956 * time duration of the “expiryTime” of the preamble is reached. This
957 * timer value is only maintained at the eNodeB and the UE has no way of
958 * knowing if this timer has expired. If the UE tries to send the preamble
959 * again after the expiryTime and the preamble is re-assigned to another
960 * UE, it results in errors. This has been solved by re-assigning the
961 * preamble to another UE only if it is not being used (An UE can be using
962 * the preamble even after the expiryTime duration).
963 */
964 if ((it != m_allocatedNcRaPreambleMap.end()) && (it->second.expiryTime < Simulator::Now()))
965 {
966 if (!m_cmacSapUser->IsRandomAccessCompleted(it->second.rnti))
967 {
968 // random access of the UE is not completed,
969 // check other preambles
970 continue;
971 }
972 }
973 if ((it == m_allocatedNcRaPreambleMap.end()) || (it->second.expiryTime < Simulator::Now()))
974 {
975 found = true;
976 NcRaPreambleInfo preambleInfo;
977 uint32_t expiryIntervalMs =
979
980 preambleInfo.expiryTime = Simulator::Now() + MilliSeconds(expiryIntervalMs);
981 preambleInfo.rnti = rnti;
982 NS_LOG_INFO("allocated preamble for NC based RA: preamble "
983 << preambleId << ", RNTI " << preambleInfo.rnti << ", exiryTime "
984 << preambleInfo.expiryTime);
985 m_allocatedNcRaPreambleMap[preambleId] =
986 preambleInfo; // create if not exist, update otherwise
987 break;
988 }
989 }
991 if (found)
992 {
993 ret.valid = true;
994 ret.raPreambleId = preambleId;
995 ret.raPrachMaskIndex = 0;
996 }
997 else
998 {
999 ret.valid = false;
1000 ret.raPreambleId = 0;
1001 ret.raPrachMaskIndex = 0;
1002 }
1003 return ret;
1004}
1005
1006// ////////////////////////////////////////////
1007// MAC SAP
1008// ////////////////////////////////////////////
1009
1010void
1012{
1013 NS_LOG_FUNCTION(this);
1014 LteRadioBearerTag tag(params.rnti, params.lcid, params.layer);
1015 params.pdu->AddPacketTag(tag);
1016 params.componentCarrierId = m_componentCarrierId;
1017 // Store pkt in HARQ buffer
1018 auto it = m_miDlHarqProcessesPackets.find(params.rnti);
1020 NS_LOG_DEBUG(this << " LAYER " << (uint16_t)tag.GetLayer() << " HARQ ID "
1021 << (uint16_t)params.harqProcessId);
1022
1023 //(*it).second.at (params.layer).at (params.harqProcessId) = params.pdu;//->Copy ();
1024 (*it).second.at(params.layer).at(params.harqProcessId)->AddPacket(params.pdu);
1025 m_enbPhySapProvider->SendMacPdu(params.pdu);
1026}
1027
1028void
1030{
1031 NS_LOG_FUNCTION(this);
1033 req.m_rnti = params.rnti;
1034 req.m_logicalChannelIdentity = params.lcid;
1035 req.m_rlcTransmissionQueueSize = params.txQueueSize;
1036 req.m_rlcTransmissionQueueHolDelay = params.txQueueHolDelay;
1037 req.m_rlcRetransmissionQueueSize = params.retxQueueSize;
1038 req.m_rlcRetransmissionHolDelay = params.retxQueueHolDelay;
1039 req.m_rlcStatusPduSize = params.statusPduSize;
1041}
1042
1043// ////////////////////////////////////////////
1044// SCHED SAP
1045// ////////////////////////////////////////////
1046
1047void
1049{
1050 NS_LOG_FUNCTION(this);
1051 // Create DL PHY PDU
1054
1055 for (std::size_t i = 0; i < ind.m_buildDataList.size(); i++)
1056 {
1057 for (std::size_t layer = 0; layer < ind.m_buildDataList.at(i).m_dci.m_ndi.size(); layer++)
1058 {
1059 if (ind.m_buildDataList.at(i).m_dci.m_ndi.at(layer) == 1)
1060 {
1061 // new data -> force emptying correspondent harq pkt buffer
1062 auto it = m_miDlHarqProcessesPackets.find(ind.m_buildDataList.at(i).m_rnti);
1064 for (std::size_t lcId = 0; lcId < (*it).second.size(); lcId++)
1065 {
1067 (*it).second.at(lcId).at(ind.m_buildDataList.at(i).m_dci.m_harqProcess) = pb;
1068 }
1069 }
1070 }
1071 for (std::size_t j = 0; j < ind.m_buildDataList.at(i).m_rlcPduList.size(); j++)
1072 {
1073 for (std::size_t k = 0; k < ind.m_buildDataList.at(i).m_rlcPduList.at(j).size(); k++)
1074 {
1075 if (ind.m_buildDataList.at(i).m_dci.m_ndi.at(k) == 1)
1076 {
1077 // New Data -> retrieve it from RLC
1078 uint16_t rnti = ind.m_buildDataList.at(i).m_rnti;
1079 uint8_t lcid =
1080 ind.m_buildDataList.at(i).m_rlcPduList.at(j).at(k).m_logicalChannelIdentity;
1081 auto rntiIt = m_rlcAttached.find(rnti);
1082 NS_ASSERT_MSG(rntiIt != m_rlcAttached.end(), "could not find RNTI" << rnti);
1083 auto lcidIt = rntiIt->second.find(lcid);
1084 NS_ASSERT_MSG(lcidIt != rntiIt->second.end(),
1085 "could not find LCID" << (uint32_t)lcid << " carrier id:"
1086 << (uint16_t)m_componentCarrierId);
1087 NS_LOG_DEBUG(this << " rnti= " << rnti << " lcid= " << (uint32_t)lcid
1088 << " layer= " << k);
1089 txOpParams.bytes = ind.m_buildDataList.at(i).m_rlcPduList.at(j).at(k).m_size;
1090 txOpParams.layer = k;
1091 txOpParams.harqId = ind.m_buildDataList.at(i).m_dci.m_harqProcess;
1093 txOpParams.rnti = rnti;
1094 txOpParams.lcid = lcid;
1095 (*lcidIt).second->NotifyTxOpportunity(txOpParams);
1096 }
1097 else
1098 {
1099 if (ind.m_buildDataList.at(i).m_dci.m_tbsSize.at(k) > 0)
1100 {
1101 // HARQ retransmission -> retrieve TB from HARQ buffer
1102 auto it = m_miDlHarqProcessesPackets.find(ind.m_buildDataList.at(i).m_rnti);
1104 Ptr<PacketBurst> pb =
1105 (*it).second.at(k).at(ind.m_buildDataList.at(i).m_dci.m_harqProcess);
1106 for (auto j = pb->Begin(); j != pb->End(); ++j)
1107 {
1108 Ptr<Packet> pkt = (*j)->Copy();
1110 }
1111 }
1112 }
1113 }
1114 }
1115 // send the relative DCI
1117 msg->SetDci(ind.m_buildDataList.at(i).m_dci);
1119 }
1120
1121 // Fire the trace with the DL information
1122 for (uint32_t i = 0; i < ind.m_buildDataList.size(); i++)
1123 {
1124 // Only one TB used
1125 if (ind.m_buildDataList.at(i).m_dci.m_tbsSize.size() == 1)
1126 {
1127 DlSchedulingCallbackInfo dlSchedulingCallbackInfo;
1128 dlSchedulingCallbackInfo.frameNo = m_frameNo;
1129 dlSchedulingCallbackInfo.subframeNo = m_subframeNo;
1130 dlSchedulingCallbackInfo.rnti = ind.m_buildDataList.at(i).m_dci.m_rnti;
1131 dlSchedulingCallbackInfo.mcsTb1 = ind.m_buildDataList.at(i).m_dci.m_mcs.at(0);
1132 dlSchedulingCallbackInfo.sizeTb1 = ind.m_buildDataList.at(i).m_dci.m_tbsSize.at(0);
1133 dlSchedulingCallbackInfo.mcsTb2 = 0;
1134 dlSchedulingCallbackInfo.sizeTb2 = 0;
1135 dlSchedulingCallbackInfo.componentCarrierId = m_componentCarrierId;
1136 m_dlScheduling(dlSchedulingCallbackInfo);
1137 }
1138 // Two TBs used
1139 else if (ind.m_buildDataList.at(i).m_dci.m_tbsSize.size() == 2)
1140 {
1141 DlSchedulingCallbackInfo dlSchedulingCallbackInfo;
1142 dlSchedulingCallbackInfo.frameNo = m_frameNo;
1143 dlSchedulingCallbackInfo.subframeNo = m_subframeNo;
1144 dlSchedulingCallbackInfo.rnti = ind.m_buildDataList.at(i).m_dci.m_rnti;
1145 dlSchedulingCallbackInfo.mcsTb1 = ind.m_buildDataList.at(i).m_dci.m_mcs.at(0);
1146 dlSchedulingCallbackInfo.sizeTb1 = ind.m_buildDataList.at(i).m_dci.m_tbsSize.at(0);
1147 dlSchedulingCallbackInfo.mcsTb2 = ind.m_buildDataList.at(i).m_dci.m_mcs.at(1);
1148 dlSchedulingCallbackInfo.sizeTb2 = ind.m_buildDataList.at(i).m_dci.m_tbsSize.at(1);
1149 dlSchedulingCallbackInfo.componentCarrierId = m_componentCarrierId;
1150 m_dlScheduling(dlSchedulingCallbackInfo);
1151 }
1152 else
1153 {
1154 NS_FATAL_ERROR("Found element with more than two transport blocks");
1155 }
1156 }
1157
1158 // Random Access procedure: send RARs
1160 // see TS 36.321 5.1.4; preambles were sent two frames ago
1161 // (plus 3GPP counts subframes from 0, not 1)
1162 uint16_t raRnti;
1163 if (m_subframeNo < 3)
1164 {
1165 raRnti = m_subframeNo + 7; // equivalent to +10-3
1166 }
1167 else
1168 {
1169 raRnti = m_subframeNo - 3;
1170 }
1171 rarMsg->SetRaRnti(raRnti);
1172 for (unsigned int i = 0; i < ind.m_buildRarList.size(); i++)
1173 {
1174 auto itRapId = m_rapIdRntiMap.find(ind.m_buildRarList.at(i).m_rnti);
1175 if (itRapId == m_rapIdRntiMap.end())
1176 {
1177 NS_FATAL_ERROR("Unable to find rapId of RNTI " << ind.m_buildRarList.at(i).m_rnti);
1178 }
1180 rar.rapId = itRapId->second;
1181 rar.rarPayload = ind.m_buildRarList.at(i);
1182 rarMsg->AddRar(rar);
1183 NS_LOG_INFO(this << " Send RAR message to RNTI " << ind.m_buildRarList.at(i).m_rnti
1184 << " rapId " << itRapId->second);
1185 }
1186 if (!ind.m_buildRarList.empty())
1187 {
1189 }
1190 m_rapIdRntiMap.clear();
1191}
1192
1193void
1195{
1196 NS_LOG_FUNCTION(this);
1197
1198 for (unsigned int i = 0; i < ind.m_dciList.size(); i++)
1199 {
1200 // send the correspondent ul dci
1202 msg->SetDci(ind.m_dciList.at(i));
1204 }
1205
1206 // Fire the trace with the UL information
1207 for (uint32_t i = 0; i < ind.m_dciList.size(); i++)
1208 {
1211 ind.m_dciList.at(i).m_rnti,
1212 ind.m_dciList.at(i).m_mcs,
1213 ind.m_dciList.at(i).m_tbSize,
1215 }
1216}
1217
1218// ////////////////////////////////////////////
1219// CSCHED SAP
1220// ////////////////////////////////////////////
1221
1222void
1227
1228void
1233
1234void
1236{
1237 NS_LOG_FUNCTION(this);
1238 // Call the CSCHED primitive
1239 // m_cschedSap->LcConfigCompleted();
1240}
1241
1242void
1247
1248void
1253
1254void
1256{
1257 NS_LOG_FUNCTION(this);
1258 // propagates to RRC
1259 LteEnbCmacSapUser::UeConfig ueConfigUpdate;
1260 ueConfigUpdate.m_rnti = params.m_rnti;
1261 ueConfigUpdate.m_transmissionMode = params.m_transmissionMode;
1263}
1264
1265void
1271
1272void
1278
1279void
1281{
1282 NS_LOG_FUNCTION(this);
1283 // Update HARQ buffer
1284 auto it = m_miDlHarqProcessesPackets.find(params.m_rnti);
1286 for (std::size_t layer = 0; layer < params.m_harqStatus.size(); layer++)
1287 {
1288 if (params.m_harqStatus.at(layer) == DlInfoListElement_s::ACK)
1289 {
1290 // discard buffer
1292 (*it).second.at(layer).at(params.m_harqProcessId) = emptyBuf;
1293 NS_LOG_DEBUG(this << " HARQ-ACK UE " << params.m_rnti << " harqId "
1294 << (uint16_t)params.m_harqProcessId << " layer " << (uint16_t)layer);
1295 }
1296 else if (params.m_harqStatus.at(layer) == DlInfoListElement_s::NACK)
1297 {
1298 NS_LOG_DEBUG(this << " HARQ-NACK UE " << params.m_rnti << " harqId "
1299 << (uint16_t)params.m_harqProcessId << " layer " << (uint16_t)layer);
1300 }
1301 else
1302 {
1303 NS_FATAL_ERROR(" HARQ functionality not implemented");
1304 }
1305 }
1306 m_dlInfoListReceived.push_back(params);
1307}
1308
1309} // namespace ns3
EnbMacMemberFfMacCschedSapUser class.
void CschedLcReleaseCnf(const CschedLcReleaseCnfParameters &params) override
CSCHED_LC_RELEASE_CNF.
void CschedUeConfigCnf(const CschedUeConfigCnfParameters &params) override
CSCHED_UE_CONFIG_CNF.
EnbMacMemberFfMacCschedSapUser(LteEnbMac *mac)
Constructor.
void CschedLcConfigCnf(const CschedLcConfigCnfParameters &params) override
CSCHED_LC_CONFIG_CNF.
void CschedCellConfigUpdateInd(const CschedCellConfigUpdateIndParameters &params) override
CSCHED_UE_CONFIG_IND.
void CschedUeReleaseCnf(const CschedUeReleaseCnfParameters &params) override
CSCHED_UE_RELEASE_CNF.
void CschedCellConfigCnf(const CschedCellConfigCnfParameters &params) override
CSCHED_CELL_CONFIG_CNF.
void CschedUeConfigUpdateInd(const CschedUeConfigUpdateIndParameters &params) override
CSCHED_UE_UPDATE_IND.
EnbMacMemberFfMacSchedSapUser class.
void SchedDlConfigInd(const SchedDlConfigIndParameters &params) override
SCHED_DL_CONFIG_IND.
EnbMacMemberFfMacSchedSapUser(LteEnbMac *mac)
Constructor.
void SchedUlConfigInd(const SchedUlConfigIndParameters &params) override
SCHED_UL_CONFIG_IND.
EnbMacMemberLteEnbCmacSapProvider class.
void AddLc(LcInfo lcinfo, LteMacSapUser *msu) override
Add a new logical channel.
void UeUpdateConfigurationReq(UeConfig params) override
update the configuration of the UE
void RemoveUe(uint16_t rnti) override
remove the UE, e.g., after handover or termination of the RRC connection
void AddUe(uint16_t rnti) override
Add UE function.
void ReconfigureLc(LcInfo lcinfo) override
Reconfigure an existing logical channel.
AllocateNcRaPreambleReturnValue AllocateNcRaPreamble(uint16_t rnti) override
Allocate a random access preamble for non-contention based random access (e.g., for handover).
void ConfigureMac(uint16_t ulBandwidth, uint16_t dlBandwidth) override
EnbMacMemberLteEnbCmacSapProvider(LteEnbMac *mac)
Constructor.
void ReleaseLc(uint16_t rnti, uint8_t lcid) override
release an existing logical channel
void SubframeIndication(uint32_t frameNo, uint32_t subframeNo) override
Trigger the start from a new frame (input from Phy layer)
void ReceivePhyPdu(Ptr< Packet > p) override
Called by the Phy to notify the MAC of the reception of a new PHY-PDU.
void ReceiveLteControlMessage(Ptr< LteControlMessage > msg) override
Receive SendLteControlMessage (PDCCH map, CQI feedbacks) using the ideal control channel.
void ReceiveRachPreamble(uint32_t prachId) override
notify the reception of a RACH preamble on the PRACH
EnbMacMemberLteEnbPhySapUser(LteEnbMac *mac)
Constructor.
void DlInfoListElementHarqFeedback(DlInfoListElement_s params) override
Notify the HARQ on the DL transmission status.
void UlCqiReport(FfMacSchedSapProvider::SchedUlCqiInfoReqParameters ulcqi) override
Returns to MAC level the UL-CQI evaluated.
void UlInfoListElementHarqFeedback(UlInfoListElement_s params) override
Notify the HARQ on the UL transmission status.
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:47
void SetFfMacCschedSapProvider(FfMacCschedSapProvider *s)
Set the control scheduler SAP provider.
~LteEnbMac() override
void DoReceivePhyPdu(Ptr< Packet > p)
legacy public for use the Phy callback
void DoSchedDlConfigInd(FfMacSchedSapUser::SchedDlConfigIndParameters ind)
Sched DL Config Indication function.
FfMacSchedSapUser * m_schedSapUser
the Sched SAP user
void DoCschedCellConfigCnf(FfMacCschedSapUser::CschedCellConfigCnfParameters params)
CSched Cell Config configure function.
FfMacCschedSapProvider * m_cschedSapProvider
the Csched SAP provider
void SetLteEnbPhySapProvider(LteEnbPhySapProvider *s)
Set the PHY SAP Provider.
uint32_t m_frameNo
frame number of current subframe indication
void DoDispose() override
Destructor implementation.
LteEnbPhySapProvider * m_enbPhySapProvider
the ENB Phy SAP provider
void DoReportBufferStatus(LteMacSapProvider::ReportBufferStatusParameters params)
Report Buffer Status function.
FfMacCschedSapUser * GetFfMacCschedSapUser()
Get the control scheduler SAP user.
FfMacCschedSapUser * m_cschedSapUser
the CSched SAP user
static TypeId GetTypeId()
Get the type ID.
friend class EnbMacMemberFfMacCschedSapUser
allow EnbMacMemberFfMacCschedSapUser class friend access
Definition lte-enb-mac.h:55
LteCcmMacSapUser * m_ccmMacSapUser
CCM MAC SAP user.
void DoCschedUeReleaseCnf(FfMacCschedSapUser::CschedUeReleaseCnfParameters params)
CSched UE Release configure function.
void SetLteEnbCmacSapUser(LteEnbCmacSapUser *s)
Set the control MAC SAP user.
LteEnbPhySapUser * GetLteEnbPhySapUser()
Get the eNB-PHY SAP User.
void DoUlInfoListElementHarqFeedback(UlInfoListElement_s params)
UL Info List Elements HARQ Feedback function.
std::vector< CqiListElement_s > m_dlCqiReceived
DL-CQI received.
std::map< uint8_t, uint32_t > m_receivedRachPreambleCount
received RACH preamble count
LteCcmMacSapProvider * m_ccmMacSapProvider
CCM MAC SAP provider.
FfMacSchedSapProvider * m_schedSapProvider
the Sched SAP provider
void DoReceiveRachPreamble(uint8_t prachId)
Receive RACH Preamble function.
void DoCschedLcConfigCnf(FfMacCschedSapUser::CschedLcConfigCnfParameters params)
CSched LC Config configure function.
uint8_t m_componentCarrierId
component carrier Id used to address sap
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,...
void DoReleaseLc(uint16_t rnti, uint8_t lcid)
Release LC function.
void DoReceiveLteControlMessage(Ptr< LteControlMessage > msg)
Receive a DL CQI ideal control message.
friend class EnbMacMemberLteEnbCmacSapProvider
allow EnbMacMemberLteEnbCmacSapProvider class friend access
Definition lte-enb-mac.h:49
void SetLteCcmMacSapUser(LteCcmMacSapUser *s)
Set the ComponentCarrierManager SAP user.
std::map< uint16_t, std::map< uint8_t, LteMacSapUser * > > m_rlcAttached
RNTI, LC ID, SAP of the RLC instance.
LteMacSapUser * m_macSapUser
the MAC SAP user
std::vector< MacCeListElement_s > m_ulCeReceived
CE received (BSR up to now)
LteEnbPhySapUser * m_enbPhySapUser
the ENB Phy SAP user
void DoTransmitPdu(LteMacSapProvider::TransmitPduParameters params)
Transmit PDU function.
std::vector< FfMacSchedSapProvider::SchedUlCqiInfoReqParameters > m_ulCqiReceived
UL-CQI received.
LteEnbCmacSapProvider * m_cmacSapProvider
the CMAC SAP provider
friend class EnbMacMemberFfMacSchedSapUser
allow EnbMacMemberFfMacSchedSapUser class friend access
Definition lte-enb-mac.h:53
TracedCallback< DlSchedulingCallbackInfo > m_dlScheduling
Trace information regarding DL scheduling Frame number, Subframe number, RNTI, MCS of TB1,...
void SetFfMacSchedSapProvider(FfMacSchedSapProvider *s)
Set the scheduler SAP provider.
void ReceiveBsrMessage(MacCeListElement_s bsr)
Receive a CE element containing the buffer status report.
uint8_t m_connEstFailCount
the counter value for T300 timer expiration
LteMacSapProvider * m_macSapProvider
the MAC SAP provider
uint8_t m_raResponseWindowSize
RA response window size.
void DoUeUpdateConfigurationReq(LteEnbCmacSapProvider::UeConfig params)
UE Update configuration request function.
void DoReconfigureLc(LteEnbCmacSapProvider::LcInfo lcinfo)
Reconfigure LC function.
uint8_t m_macChTtiDelay
delay of MAC, PHY and channel in terms of TTIs
FfMacSchedSapUser * GetFfMacSchedSapUser()
Get the scheduler SAP user.
LteCcmMacSapProvider * GetLteCcmMacSapProvider()
Get the eNB-ComponentCarrierManager SAP User.
void DoDlInfoListElementHarqFeedback(DlInfoListElement_s params)
DL Info List Elements HARQ Feedback function.
uint8_t m_preambleTransMax
preamble transmit maximum
void DoConfigureMac(uint16_t ulBandwidth, uint16_t dlBandwidth)
Configure MAC function.
std::map< uint8_t, NcRaPreambleInfo > m_allocatedNcRaPreambleMap
map storing as key the random access preamble IDs allocated for non-contention based access,...
uint8_t m_numberOfRaPreambles
number of RA preambles
LteEnbCmacSapProvider * GetLteEnbCmacSapProvider()
Get the control MAC SAP provider.
std::map< uint16_t, DlHarqProcessesBuffer_t > m_miDlHarqProcessesPackets
Packet under transmission of the DL HARQ process.
void DoCschedCellConfigUpdateInd(FfMacCschedSapUser::CschedCellConfigUpdateIndParameters params)
CSched Cell Config Update Indication function.
void DoAddLc(LteEnbCmacSapProvider::LcInfo lcinfo, LteMacSapUser *msu)
Add LC function.
void DoCschedUeConfigUpdateInd(FfMacCschedSapUser::CschedUeConfigUpdateIndParameters params)
CSched UE Config Update Indication function.
void DoSubframeIndication(uint32_t frameNo, uint32_t subframeNo)
Subrame Indication function.
void SetLteMacSapUser(LteMacSapUser *s)
Set the MAC SAP user.
void ReceiveDlCqiLteControlMessage(Ptr< DlCqiLteControlMessage > msg)
Receive a DL CQI ideal control message.
LteEnbCmacSapProvider::AllocateNcRaPreambleReturnValue DoAllocateNcRaPreamble(uint16_t rnti)
Allocate NC RA preamble function.
void DoRemoveUe(uint16_t rnti)
Remove UE function.
friend class EnbMacMemberLteMacSapProvider< LteEnbMac >
allow EnbMacMemberLteMacSapProvider<LteEnbMac> class friend access
Definition lte-enb-mac.h:51
LteEnbCmacSapProvider::RachConfig DoGetRachConfig() const
Get RACH configuration function.
std::vector< DlInfoListElement_s > m_dlInfoListReceived
DL HARQ feedback received.
void DoSchedUlConfigInd(FfMacSchedSapUser::SchedUlConfigIndParameters params)
Sched UL Config Indication function.
LteMacSapProvider * GetLteMacSapProvider()
Get the MAC SAP provider.
LteEnbCmacSapUser * m_cmacSapUser
the CMAC SAP user
uint32_t m_subframeNo
subframe number of current subframe indication
friend class MemberLteCcmMacSapProvider< LteEnbMac >
allow MemberLteCcmMacSapProvider<LteEnbMac> class friend access
Definition lte-enb-mac.h:59
void DoCschedLcReleaseCnf(FfMacCschedSapUser::CschedLcReleaseCnfParameters params)
CSched LC Release configure function.
void DoAddUe(uint16_t rnti)
Add UE function.
friend class EnbMacMemberLteEnbPhySapUser
allow EnbMacMemberLteEnbPhySapUser class friend access
Definition lte-enb-mac.h:57
void DoReportMacCeToScheduler(MacCeListElement_s bsr)
Report MAC CE to scheduler.
void SetComponentCarrierId(uint8_t index)
Set the component carrier ID.
void DoUlCqiReport(FfMacSchedSapProvider::SchedUlCqiInfoReqParameters ulcqi)
UL CQI report.
std::vector< UlInfoListElement_s > m_ulInfoListReceived
UL HARQ feedback received.
std::map< uint16_t, uint32_t > m_rapIdRntiMap
RAPID RNTI map.
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:25
Service Access Point (SAP) offered by the MAC to the RLC See Femto Forum MAC Scheduler Interface Spec...
Definition lte-mac-sap.h:85
Tag used to define the RNTI and LC id for each MAC packet transmitted.
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:78
Smart pointer class similar to boost::intrusive_ptr.
static Time Now()
Return the current simulation virtual time.
Definition simulator.cc:197
a unique identifier for an interface.
Definition type-id.h:48
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition type-id.cc:1001
Hold an unsigned integer type.
Definition uinteger.h:34
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
Definition assert.h:55
#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:75
Ptr< const AttributeChecker > MakeUintegerChecker()
Definition uinteger.h:85
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Definition uinteger.h:35
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
#define NS_LOG_ERROR(msg)
Use NS_LOG to output a message of level LOG_ERROR.
Definition log.h:243
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition log.h:191
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Definition log.h:257
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
Definition log.h:271
#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:264
Ptr< T > CreateObject(Args &&... args)
Create an object by type, with varying number of constructor parameters.
Definition object.h:619
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition object-base.h:35
Ptr< T > Create(Ts &&... args)
Create class instances by constructors with varying numbers of arguments and return them by Ptr.
Definition ptr.h:436
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition nstime.h:1320
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:17
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:41
Ptr< T1 > DynamicCast(const Ptr< T2 > &p)
Cast a Ptr.
Definition ptr.h:580
See section 4.3.24 cqiListElement.
See section 4.3.23 dlInfoListElement.
DlSchedulingCallbackInfo structure.
Definition lte-common.h:226
uint32_t subframeNo
subframe number
Definition lte-common.h:228
uint8_t componentCarrierId
component carrier ID
Definition lte-common.h:234
uint32_t frameNo
frame number
Definition lte-common.h:227
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.
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
Time expiryTime
value the expiration time of this allocation (so that stale preambles can be reused)
uint16_t rnti
rnti previously allocated for this non-contention based RA procedure
LteFlowId structure.
Definition lte-common.h:32
Parameters for LteMacSapProvider::ReportBufferStatus.
Definition lte-mac-sap.h:58
Parameters for LteMacSapProvider::TransmitPdu.
Definition lte-mac-sap.h:34
Parameters for LteMacSapUser::ReceivePdu.
Ptr< Packet > p
the RLC PDU to be received
uint8_t lcid
the logical channel id
uint16_t rnti
the C-RNTI identifying the UE
Parameters for LteMacSapUser::NotifyTxOpportunity.
Definition lte-mac-sap.h:94
uint16_t rnti
the C-RNTI identifying the UE
uint32_t bytes
the number of bytes to transmit
uint8_t componentCarrierId
the component carrier id
uint8_t layer
the layer of transmission (MIMO)
uint8_t lcid
the logical channel id
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.