A Discrete-Event Network Simulator
API
lte-enb-mac.h
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 #ifndef LTE_ENB_MAC_H
25 #define LTE_ENB_MAC_H
26 
27 #include "ns3/trace-source-accessor.h"
28 #include "ns3/traced-value.h"
29 #include <ns3/ff-mac-csched-sap.h>
30 #include <ns3/ff-mac-sched-sap.h>
31 #include <ns3/lte-ccm-mac-sap.h>
32 #include <ns3/lte-common.h>
33 #include <ns3/lte-enb-cmac-sap.h>
34 #include <ns3/lte-enb-phy-sap.h>
35 #include <ns3/lte-mac-sap.h>
36 #include <ns3/packet-burst.h>
37 #include <ns3/packet.h>
38 
39 #include <map>
40 #include <vector>
41 
42 namespace ns3
43 {
44 
45 class DlCqiLteControlMessage;
46 class UlCqiLteControlMessage;
47 class PdcchMapLteControlMessage;
48 
50 typedef std::vector<std::vector<Ptr<PacketBurst>>> DlHarqProcessesBuffer_t;
51 
55 class LteEnbMac : public Object
56 {
69 
70  public:
75  static TypeId GetTypeId();
76 
77  LteEnbMac();
78  ~LteEnbMac() override;
79  void DoDispose() override;
80 
85  void SetComponentCarrierId(uint8_t index);
106 
127 
133 
139 
145 
151 
164  typedef void (*DlSchedulingTracedCallback)(const uint32_t frame,
165  const uint32_t subframe,
166  const uint16_t rnti,
167  const uint8_t mcs0,
168  const uint16_t tbs0Size,
169  const uint8_t mcs1,
170  const uint16_t tbs1Size,
171  const uint8_t ccId);
172 
182  typedef void (*UlSchedulingTracedCallback)(const uint32_t frame,
183  const uint32_t subframe,
184  const uint16_t rnti,
185  const uint8_t mcs,
186  const uint16_t tbsSize);
187 
188  private:
194 
200 
206 
212 
213  // forwarded from LteEnbCmacSapProvider
219  void DoConfigureMac(uint16_t ulBandwidth, uint16_t dlBandwidth);
224  void DoAddUe(uint16_t rnti);
229  void DoRemoveUe(uint16_t rnti);
246  void DoReleaseLc(uint16_t rnti, uint8_t lcid);
263 
264  // forwarded from LteMacSapProvider
275 
276  // forwarded from FfMacCchedSapUser
313 
314  // forwarded from FfMacSchedSapUser
325 
326  // forwarded from LteEnbPhySapUser
332  void DoSubframeIndication(uint32_t frameNo, uint32_t subframeNo);
337  void DoReceiveRachPreamble(uint8_t prachId);
338 
339  // forwarded by LteCcmMacSapProvider
345 
352  void DoReportSrToScheduler(uint16_t rnti [[maybe_unused]])
353  {
354  }
355 
356  public:
362 
363  private:
374 
376  std::map<uint16_t, std::map<uint8_t, LteMacSapUser*>> m_rlcAttached;
377 
378  std::vector<CqiListElement_s> m_dlCqiReceived;
379  std::vector<FfMacSchedSapProvider::SchedUlCqiInfoReqParameters>
381  std::vector<MacCeListElement_s> m_ulCeReceived;
382 
383  std::vector<DlInfoListElement_s> m_dlInfoListReceived;
384 
385  std::vector<UlInfoListElement_s> m_ulInfoListReceived;
386 
387  /*
388  * Map of UE's info element (see 4.3.12 of FF MAC Scheduler API)
389  */
390  // std::map <uint16_t,UlInfoListElement_s> m_ulInfoListElements;
391 
396 
401 
402  // PHY-SAP
405 
406  // Sap For ComponentCarrierManager 'Uplink case'
412  uint32_t m_frameNo;
416  uint32_t m_subframeNo;
423 
429 
430  uint8_t m_macChTtiDelay;
431 
432  std::map<uint16_t, DlHarqProcessesBuffer_t>
434 
439 
445  {
446  uint16_t rnti;
449  };
450 
456  std::map<uint8_t, NcRaPreambleInfo> m_allocatedNcRaPreambleMap;
457 
458  std::map<uint8_t, uint32_t> m_receivedRachPreambleCount;
459 
460  std::map<uint16_t, uint32_t> m_rapIdRntiMap;
461 
464 };
465 
466 } // end namespace ns3
467 
468 #endif /* LTE_ENB_MAC_ENTITY_H */
EnbMacMemberFfMacCschedSapUser class.
Definition: lte-enb-mac.cc:173
EnbMacMemberFfMacSchedSapUser class.
Definition: lte-enb-mac.cc:138
EnbMacMemberLteEnbCmacSapProvider class.
Definition: lte-enb-mac.cc:53
EnbMacMemberLteMacSapProvider class.
Definition: lte-mac-sap.h:203
Provides the CSCHED SAP.
FfMacCschedSapUser class.
Provides the SCHED SAP.
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).
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...
This class implements the MAC layer of the eNodeB device.
Definition: lte-enb-mac.h:56
void SetFfMacCschedSapProvider(FfMacCschedSapProvider *s)
Set the control scheduler SAP provider.
Definition: lte-enb-mac.cc:423
~LteEnbMac() override
Definition: lte-enb-mac.cc:381
void DoReceivePhyPdu(Ptr< Packet > p)
legacy public for use the Phy callback
Definition: lte-enb-mac.cc:710
void DoSchedDlConfigInd(FfMacSchedSapUser::SchedDlConfigIndParameters ind)
Sched DL Config Indication function.
FfMacSchedSapUser * m_schedSapUser
the Sched SAP user
Definition: lte-enb-mac.h:399
void DoCschedCellConfigCnf(FfMacCschedSapUser::CschedCellConfigCnfParameters params)
CSched Cell Config configure function.
FfMacCschedSapProvider * m_cschedSapProvider
the Csched SAP provider
Definition: lte-enb-mac.h:398
void SetLteEnbPhySapProvider(LteEnbPhySapProvider *s)
Set the PHY SAP Provider.
Definition: lte-enb-mac.cc:459
uint32_t m_frameNo
frame number of current subframe indication
Definition: lte-enb-mac.h:412
void DoDispose() override
Destructor implementation.
Definition: lte-enb-mac.cc:387
LteEnbPhySapProvider * m_enbPhySapProvider
the ENB Phy SAP provider
Definition: lte-enb-mac.h:403
void DoReportBufferStatus(LteMacSapProvider::ReportBufferStatusParameters params)
Report Buffer Status function.
FfMacCschedSapUser * GetFfMacCschedSapUser()
Get the control scheduler SAP user.
Definition: lte-enb-mac.cc:429
void(* DlSchedulingTracedCallback)(const uint32_t frame, const uint32_t subframe, const uint16_t rnti, const uint8_t mcs0, const uint16_t tbs0Size, const uint8_t mcs1, const uint16_t tbs1Size, const uint8_t ccId)
TracedCallback signature for DL scheduling events.
Definition: lte-enb-mac.h:164
FfMacCschedSapUser * m_cschedSapUser
the CSched SAP user
Definition: lte-enb-mac.h:400
static TypeId GetTypeId()
Get the type ID.
Definition: lte-enb-mac.cc:323
LteCcmMacSapUser * m_ccmMacSapUser
CCM MAC SAP user.
Definition: lte-enb-mac.h:408
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:447
LteEnbPhySapUser * GetLteEnbPhySapUser()
Get the eNB-PHY SAP User.
Definition: lte-enb-mac.cc:465
std::vector< CqiListElement_s > m_dlCqiReceived
DL-CQI received.
Definition: lte-enb-mac.h:378
std::map< uint8_t, uint32_t > m_receivedRachPreambleCount
received RACH preamble count
Definition: lte-enb-mac.h:458
LteCcmMacSapProvider * m_ccmMacSapProvider
CCM MAC SAP provider.
Definition: lte-enb-mac.h:407
FfMacSchedSapProvider * m_schedSapProvider
the Sched SAP provider
Definition: lte-enb-mac.h:397
void DoReceiveRachPreamble(uint8_t prachId)
Receive RACH Preamble function.
Definition: lte-enb-mac.cc:659
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:463
void DoCschedUeConfigCnf(FfMacCschedSapUser::CschedUeConfigCnfParameters params)
CSched UE Config configure function.
void DoUlInfoListElementHarqFeeback(UlInfoListElement_s params)
UL Info List ELements HARQ Feedback 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:428
void DoReleaseLc(uint16_t rnti, uint8_t lcid)
Release LC function.
Definition: lte-enb-mac.cc:924
void DoReceiveLteControlMessage(Ptr< LteControlMessage > msg)
Receive a DL CQI ideal control message.
Definition: lte-enb-mac.cc:632
void SetLteCcmMacSapUser(LteCcmMacSapUser *s)
Set the ComponentCarrierManager SAP user.
Definition: lte-enb-mac.cc:471
std::map< uint16_t, std::map< uint8_t, LteMacSapUser * > > m_rlcAttached
RNTI, LC ID, SAP of the RLC instance.
Definition: lte-enb-mac.h:376
LteMacSapUser * m_macSapUser
the MAC SAP user
Definition: lte-enb-mac.h:394
std::vector< MacCeListElement_s > m_ulCeReceived
CE received (BSR up to now)
Definition: lte-enb-mac.h:381
LteEnbPhySapUser * m_enbPhySapUser
the ENB Phy SAP user
Definition: lte-enb-mac.h:404
void DoTransmitPdu(LteMacSapProvider::TransmitPduParameters params)
Transmit PDU function.
std::vector< FfMacSchedSapProvider::SchedUlCqiInfoReqParameters > m_ulCqiReceived
UL-CQI received.
Definition: lte-enb-mac.h:380
LteEnbCmacSapProvider * m_cmacSapProvider
the CMAC SAP provider
Definition: lte-enb-mac.h:393
TracedCallback< DlSchedulingCallbackInfo > m_dlScheduling
Trace information regarding DL scheduling Frame number, Subframe number, RNTI, MCS of TB1,...
Definition: lte-enb-mac.h:422
void SetFfMacSchedSapProvider(FfMacSchedSapProvider *s)
Set the scheduler SAP provider.
Definition: lte-enb-mac.cc:411
void ReceiveBsrMessage(MacCeListElement_s bsr)
Receive a CE element containing the buffer status report.
Definition: lte-enb-mac.cc:692
uint8_t m_connEstFailCount
the counter value for T300 timer expiration
Definition: lte-enb-mac.h:438
LteMacSapProvider * m_macSapProvider
the MAC SAP provider
Definition: lte-enb-mac.h:392
uint8_t m_raResponseWindowSize
RA response window size.
Definition: lte-enb-mac.h:437
void DoUeUpdateConfigurationReq(LteEnbCmacSapProvider::UeConfig params)
UE Update configuration request function.
Definition: lte-enb-mac.cc:940
void DoReconfigureLc(LteEnbCmacSapProvider::LcInfo lcinfo)
Reconfigure LC function.
Definition: lte-enb-mac.cc:918
uint8_t m_macChTtiDelay
delay of MAC, PHY and channel in terms of TTIs
Definition: lte-enb-mac.h:430
FfMacSchedSapUser * GetFfMacSchedSapUser()
Get the scheduler SAP user.
Definition: lte-enb-mac.cc:417
void DoReportSrToScheduler(uint16_t rnti[[maybe_unused]])
Report SR to scheduler.
Definition: lte-enb-mac.h:352
void DoDlInfoListElementHarqFeeback(DlInfoListElement_s params)
DL Info List ELements HARQ Feedback function.
LteCcmMacSapProvider * GetLteCcmMacSapProvider()
Get the eNB-ComponentCarrierManager SAP User.
Definition: lte-enb-mac.cc:477
void(* UlSchedulingTracedCallback)(const uint32_t frame, const uint32_t subframe, const uint16_t rnti, const uint8_t mcs, const uint16_t tbsSize)
TracedCallback signature for UL scheduling events.
Definition: lte-enb-mac.h:182
uint8_t m_preambleTransMax
preamble transmit maximum
Definition: lte-enb-mac.h:436
void DoConfigureMac(uint16_t ulBandwidth, uint16_t dlBandwidth)
Configure MAC function.
Definition: lte-enb-mac.cc:774
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:456
uint8_t m_numberOfRaPreambles
number of RA preambles
Definition: lte-enb-mac.h:435
LteEnbCmacSapProvider * GetLteEnbCmacSapProvider()
Get the control MAC SAP provider.
Definition: lte-enb-mac.cc:453
std::map< uint16_t, DlHarqProcessesBuffer_t > m_miDlHarqProcessesPackets
Packet under transmission of the DL HARQ process.
Definition: lte-enb-mac.h:433
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:869
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:483
void SetLteMacSapUser(LteMacSapUser *s)
Set the MAC SAP user.
Definition: lte-enb-mac.cc:435
void ReceiveDlCqiLteControlMessage(Ptr< DlCqiLteControlMessage > msg)
Receive a DL CQI ideal control message.
Definition: lte-enb-mac.cc:681
LteEnbCmacSapProvider::AllocateNcRaPreambleReturnValue DoAllocateNcRaPreamble(uint16_t rnti)
Allocate NC RA preamble function.
Definition: lte-enb-mac.cc:964
void DoRemoveUe(uint16_t rnti)
Remove UE function.
Definition: lte-enb-mac.cc:824
LteEnbCmacSapProvider::RachConfig DoGetRachConfig() const
Get RACH configuration function.
Definition: lte-enb-mac.cc:953
std::vector< DlInfoListElement_s > m_dlInfoListReceived
DL HARQ feedback received.
Definition: lte-enb-mac.h:383
void DoSchedUlConfigInd(FfMacSchedSapUser::SchedUlConfigIndParameters params)
Sched UL Config Indication function.
LteMacSapProvider * GetLteMacSapProvider()
Get the MAC SAP provider.
Definition: lte-enb-mac.cc:441
LteEnbCmacSapUser * m_cmacSapUser
the CMAC SAP user
Definition: lte-enb-mac.h:395
uint32_t m_subframeNo
subframe number of current subframe indication
Definition: lte-enb-mac.h:416
void DoCschedLcReleaseCnf(FfMacCschedSapUser::CschedLcReleaseCnfParameters params)
CSched LC Release configure function.
void DoAddUe(uint16_t rnti)
Add UE function.
Definition: lte-enb-mac.cc:787
void DoReportMacCeToScheduler(MacCeListElement_s bsr)
Report MAC CE to scheduler.
Definition: lte-enb-mac.cc:699
void SetComponentCarrierId(uint8_t index)
Set the component carrier ID.
Definition: lte-enb-mac.cc:405
void DoUlCqiReport(FfMacSchedSapProvider::SchedUlCqiInfoReqParameters ulcqi)
UL CQI report.
Definition: lte-enb-mac.cc:667
std::vector< UlInfoListElement_s > m_ulInfoListReceived
UL HARQ feedback received.
Definition: lte-enb-mac.h:385
std::map< uint16_t, uint32_t > m_rapIdRntiMap
RAPID RNTI map.
Definition: lte-enb-mac.h:460
Service Access Point (SAP) offered by the eNB-PHY to the eNB-MAC.
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
MemberLteCcmMacSapProvider class.
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
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:105
Forward calls to a chain of Callback.
a unique identifier for an interface.
Definition: type-id.h:60
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:47
params
Fit Fluctuating Two Ray model to the 3GPP TR 38.901 using the Anderson-Darling goodness-of-fit ##.
See section 4.3.23 dlInfoListElement.
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_UL_CQI_INFO_REQ primitive.
Parameters of the SCHED_UL_CONFIG_IND primitive.
AllocateNcRaPreambleReturnValue structure.
Logical Channel information to be passed to CmacSapProvider::ConfigureLc.
struct defining the RACH configuration of the MAC
Parameters for [re]configuring the UE.
info associated with a preamble allocated for non-contention based RA
Definition: lte-enb-mac.h:445
Time expiryTime
value the expiration time of this allocation (so that stale preambles can be reused)
Definition: lte-enb-mac.h:447
uint16_t rnti
rnti previously allocated for this non-contention based RA procedure
Definition: lte-enb-mac.h:446
Parameters for LteMacSapProvider::ReportBufferStatus.
Definition: lte-mac-sap.h:69
Parameters for LteMacSapProvider::TransmitPdu.
Definition: lte-mac-sap.h:45
See section 4.3.14 macCEListElement.
See section 4.3.12 ulInfoListElement.