A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
lte-enb-mac.h
Go to the documentation of this file.
1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Author: Marco Miozzo <marco.miozzo@cttc.es>
19  * Nicola Baldo <nbaldo@cttc.es>
20  */
21 
22 #ifndef LTE_ENB_MAC_H
23 #define LTE_ENB_MAC_H
24 
25 
26 #include <map>
27 #include <vector>
28 #include <ns3/lte-common.h>
29 #include <ns3/lte-mac-sap.h>
30 #include <ns3/lte-enb-cmac-sap.h>
31 #include <ns3/ff-mac-csched-sap.h>
32 #include <ns3/ff-mac-sched-sap.h>
33 #include <ns3/lte-enb-phy-sap.h>
34 #include "ns3/traced-value.h"
35 #include "ns3/trace-source-accessor.h"
36 #include <ns3/packet.h>
37 #include <ns3/packet-burst.h>
38 
39 namespace ns3 {
40 
41 class DlCqiLteControlMessage;
42 class UlCqiLteControlMessage;
43 class PdcchMapLteControlMessage;
44 
45 typedef std::vector <std::vector < Ptr<PacketBurst> > > DlHarqProcessesBuffer_t;
46 
50 class LteEnbMac : public Object
51 {
57 
58 public:
59  static TypeId GetTypeId (void);
60 
61  LteEnbMac (void);
62  virtual ~LteEnbMac (void);
63  virtual void DoDispose (void);
64 
65 
86 
87 
88 
109 
110 
116 
122 
123 
124 private:
125 
131 
133 
139 
140 
142 
143 
144 
145  // forwarded from LteEnbCmacSapProvider
146  void DoConfigureMac (uint8_t ulBandwidth, uint8_t dlBandwidth);
147  void DoAddUe (uint16_t rnti);
148  void DoRemoveUe (uint16_t rnti);
151  void DoReleaseLc (uint16_t rnti, uint8_t lcid);
155 
156  // forwarded from LteMacSapProvider
159 
160 
161  // forwarded from FfMacCchedSapUser
169 
170  // forwarded from FfMacSchedSapUser
173 
174  // forwarded from LteEnbPhySapUser
175  void DoSubframeIndication (uint32_t frameNo, uint32_t subframeNo);
176  void DoReceiveRachPreamble (uint8_t prachId);
177 
178 public:
179  // legacy public for use the Phy callback
180  void DoReceivePhyPdu (Ptr<Packet> p);
181 
182 private:
185 
186  // rnti, lcid, SAP of the RLC instance
187  std::map <uint16_t, std::map<uint8_t, LteMacSapUser*> > m_rlcAttached;
188 
189  std::vector <CqiListElement_s> m_dlCqiReceived; // DL-CQI received
190  std::vector <FfMacSchedSapProvider::SchedUlCqiInfoReqParameters> m_ulCqiReceived; // UL-CQI received
191  std::vector <MacCeListElement_s> m_ulCeReceived; // CE received (BSR up to now)
192 
193  std::vector <DlInfoListElement_s> m_dlInfoListReceived; // DL HARQ feedback received
194 
195  std::vector <UlInfoListElement_s> m_ulInfoListReceived; // UL HARQ feedback received
196 
197 
198  /*
199  * Map of UE's info element (see 4.3.12 of FF MAC Scheduler API)
200  */
201 // std::map <uint16_t,UlInfoListElement_s> m_ulInfoListElements;
202 
203 
204 
209 
210 
215 
216  // PHY-SAP
219 
220  uint32_t m_frameNo;
221  uint32_t m_subframeNo;
233 
234  uint8_t m_macChTtiDelay; // delay of MAC, PHY and channel in terms of TTIs
235 
236 
237  std::map <uint16_t, DlHarqProcessesBuffer_t> m_miDlHarqProcessesPackets; // Packet under trasmission of the DL HARQ process
238 
242 
248  {
249  uint16_t rnti;
251  };
252 
258  std::map<uint8_t, NcRaPreambleInfo> m_allocatedNcRaPreambleMap;
259 
260  std::map<uint8_t, uint32_t> m_receivedRachPreambleCount;
261 
262  std::map<uint8_t, uint32_t> m_rapIdRntiMap;
263 };
264 
265 } // end namespace ns3
266 
267 #endif /* LTE_ENB_MAC_ENTITY_H */
void DoConfigureMac(uint8_t ulBandwidth, uint8_t dlBandwidth)
Definition: lte-enb-mac.cc:726
void DoReconfigureLc(LteEnbCmacSapProvider::LcInfo lcinfo)
Definition: lte-enb-mac.cc:835
FfMacSchedSapUser * m_schedSapUser
Definition: lte-enb-mac.h:213
Parameters of the CSCHED_LC_CONFIG_CNF primitive.
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:79
void DoDlInfoListElementHarqFeeback(DlInfoListElement_s params)
smart pointer class similar to boost::intrusive_ptr
Definition: ptr.h:60
std::vector< FfMacSchedSapProvider::SchedUlCqiInfoReqParameters > m_ulCqiReceived
Definition: lte-enb-mac.h:190
Parameters of the CSCHED_UE_CONFIG_CNF primitive.
void DoReceivePhyPdu(Ptr< Packet > p)
Definition: lte-enb-mac.cc:670
Parameters of the CSCHED_CELL_CONFIG_UPDATE_IND primitive.
void DoUlInfoListElementHarqFeeback(UlInfoListElement_s params)
LteEnbCmacSapProvider * m_cmacSapProvider
Definition: lte-enb-mac.h:206
std::map< uint16_t, std::map< uint8_t, LteMacSapUser * > > m_rlcAttached
Definition: lte-enb-mac.h:187
void DoAddLc(LteEnbCmacSapProvider::LcInfo lcinfo, LteMacSapUser *msu)
Definition: lte-enb-mac.cc:788
LteEnbCmacSapProvider::RachConfig DoGetRachConfig()
Definition: lte-enb-mac.cc:860
void DoCschedCellConfigUpdateInd(FfMacCschedSapUser::CschedCellConfigUpdateIndParameters params)
void DoReleaseLc(uint16_t rnti, uint8_t lcid)
Definition: lte-enb-mac.cc:841
void SetLteEnbCmacSapUser(LteEnbCmacSapUser *s)
Set the control MAC SAP user.
Definition: lte-enb-mac.cc:419
void DoSchedUlConfigInd(FfMacSchedSapUser::SchedUlConfigIndParameters params)
uint8_t m_preambleTransMax
Definition: lte-enb-mac.h:240
Provides the CSCHED SAP.
TracedCallback< uint32_t, uint32_t, uint16_t, uint8_t, uint16_t > m_ulScheduling
Trace information regarding UL scheduling Frame number, Subframe number, RNTI, MCS of TB...
Definition: lte-enb-mac.h:232
Parameters of the CSCHED_UE_CONFIG_UPDATE_IND primitive.
void DoTransmitPdu(LteMacSapProvider::TransmitPduParameters)
Definition: lte-enb-mac.cc:915
Service Access Point (SAP) offered by the eNB-PHY to the eNB-MAC.
See section 4.3.12 ulInfoListElement.
void DoAddUe(uint16_t rnti)
Definition: lte-enb-mac.cc:740
Service Access Point (SAP) offered by the eNB-PHY to the eNB-MAC.
FfMacCschedSapUser * GetFfMacCschedSapUser(void)
Get the control scheduler SAP user.
Definition: lte-enb-mac.cc:399
LteMacSapProvider * GetLteMacSapProvider(void)
Get the MAC SAP provider.
Definition: lte-enb-mac.cc:413
Parameters for LteMacSapProvider::ReportBufferStatus.
Definition: lte-mac-sap.h:66
std::map< uint8_t, uint32_t > m_receivedRachPreambleCount
Definition: lte-enb-mac.h:260
FfMacCschedSapUser * m_cschedSapUser
Definition: lte-enb-mac.h:214
Service Access Point (SAP) offered by the MAC to the RRC See Femto Forum MAC Scheduler Interface Spec...
void SetFfMacCschedSapProvider(FfMacCschedSapProvider *s)
Set the control scheduler SAP provider.
Definition: lte-enb-mac.cc:393
Parameters of the CSCHED_LC_RELEASE_CNF primitive.
LteEnbPhySapProvider * m_enbPhySapProvider
Definition: lte-enb-mac.h:217
LteEnbPhySapUser * m_enbPhySapUser
Definition: lte-enb-mac.h:218
FfMacSchedSapUser * GetFfMacSchedSapUser(void)
Get the scheduler SAP user.
Definition: lte-enb-mac.cc:387
void DoCschedUeConfigCnf(FfMacCschedSapUser::CschedUeConfigCnfParameters params)
void DoUeUpdateConfigurationReq(LteEnbCmacSapProvider::UeConfig params)
Definition: lte-enb-mac.cc:847
Logical Channel information to be passed to CmacSapProvider::ConfigureLc.
std::map< uint8_t, uint32_t > m_rapIdRntiMap
Definition: lte-enb-mac.h:262
Ptr< SampleEmitter > s
uint16_t rnti
rnti previously allocated for this non-contention based RA procedure
Definition: lte-enb-mac.h:249
uint8_t m_macChTtiDelay
Definition: lte-enb-mac.h:234
void DoCschedLcReleaseCnf(FfMacCschedSapUser::CschedLcReleaseCnfParameters params)
static TypeId GetTypeId(void)
Definition: lte-enb-mac.cc:314
void DoUlCqiReport(FfMacSchedSapProvider::SchedUlCqiInfoReqParameters ulcqi)
Definition: lte-enb-mac.cc:633
Provides the SCHED SAP.
virtual void DoDispose(void)
This method is called by Object::Dispose or by the object's destructor, whichever comes first...
Definition: lte-enb-mac.cc:363
void ReceiveBsrMessage(MacCeListElement_s bsr)
Receive a CE element containing the buffer status report.
Definition: lte-enb-mac.cc:661
uint8_t m_raResponseWindowSize
Definition: lte-enb-mac.h:241
See section 4.3.23 dlInfoListElement.
void DoReceiveRachPreamble(uint8_t prachId)
Definition: lte-enb-mac.cc:625
void DoRemoveUe(uint16_t rnti)
Definition: lte-enb-mac.cc:777
See section 4.3.14 macCEListElement.
Parameters for [re]configuring the UE.
uint32_t m_subframeNo
Definition: lte-enb-mac.h:221
LteEnbCmacSapProvider::AllocateNcRaPreambleReturnValue DoAllocateNcRaPreamble(uint16_t rnti)
Definition: lte-enb-mac.cc:870
uint8_t m_numberOfRaPreambles
Definition: lte-enb-mac.h:239
void DoReportBufferStatus(LteMacSapProvider::ReportBufferStatusParameters)
Definition: lte-enb-mac.cc:931
LteEnbCmacSapProvider * GetLteEnbCmacSapProvider(void)
Get the control MAC SAP provider.
Definition: lte-enb-mac.cc:425
std::vector< UlInfoListElement_s > m_ulInfoListReceived
Definition: lte-enb-mac.h:195
LteMacSapProvider * m_macSapProvider
Definition: lte-enb-mac.h:205
std::vector< CqiListElement_s > m_dlCqiReceived
Definition: lte-enb-mac.h:189
std::vector< MacCeListElement_s > m_ulCeReceived
Definition: lte-enb-mac.h:191
std::vector< std::vector< Ptr< PacketBurst > > > DlHarqProcessesBuffer_t
Definition: lte-enb-mac.h:43
void DoCschedUeReleaseCnf(FfMacCschedSapUser::CschedUeReleaseCnfParameters params)
std::vector< DlInfoListElement_s > m_dlInfoListReceived
Definition: lte-enb-mac.h:193
void SetLteEnbPhySapProvider(LteEnbPhySapProvider *s)
Set the PHY SAP Provider.
Definition: lte-enb-mac.cc:431
LteEnbCmacSapUser * m_cmacSapUser
Definition: lte-enb-mac.h:208
Parameters of the SCHED_UL_CQI_INFO_REQ primitive.
LteEnbPhySapUser * GetLteEnbPhySapUser()
Get the eNB-PHY SAP User.
Definition: lte-enb-mac.cc:438
Service Access Point (SAP) offered by the MAC to the RLC See Femto Forum MAC Scheduler Interface Spec...
Definition: lte-mac-sap.h:94
struct defining the RACH configuration of the MAC
FfMacSchedSapProvider * m_schedSapProvider
Definition: lte-enb-mac.h:211
void DoCschedUeConfigUpdateInd(FfMacCschedSapUser::CschedUeConfigUpdateIndParameters params)
LteMacSapUser * m_macSapUser
Definition: lte-enb-mac.h:207
void DoSchedDlConfigInd(FfMacSchedSapUser::SchedDlConfigIndParameters ind)
Definition: lte-enb-mac.cc:954
Service Access Point (SAP) offered by the MAC to the RLC See Femto Forum MAC Scheduler Interface Spec...
Definition: lte-mac-sap.h:36
void SetLteMacSapUser(LteMacSapUser *s)
Set the MAC SAP user.
Definition: lte-enb-mac.cc:407
uint32_t m_frameNo
Definition: lte-enb-mac.h:220
void DoCschedLcConfigCnf(FfMacCschedSapUser::CschedLcConfigCnfParameters params)
Parameters of the SCHED_UL_CONFIG_IND primitive.
void DoReceiveLteControlMessage(Ptr< LteControlMessage > msg)
Definition: lte-enb-mac.cc:600
a base class which provides memory management and object aggregation
Definition: object.h:64
std::map< uint8_t, NcRaPreambleInfo > m_allocatedNcRaPreambleMap
map storing as key the random acccess preamble IDs allocated for non-contention based access...
Definition: lte-enb-mac.h:258
Service Access Point (SAP) offered by the eNB MAC to the eNB RRC See Femto Forum MAC Scheduler Interf...
virtual ~LteEnbMac(void)
Definition: lte-enb-mac.cc:357
TracedCallback< uint32_t, uint32_t, uint16_t, uint8_t, uint16_t, uint8_t, uint16_t > m_dlScheduling
Trace information regarding DL scheduling Frame number, Subframe number, RNTI, MCS of TB1...
Definition: lte-enb-mac.h:227
std::map< uint16_t, DlHarqProcessesBuffer_t > m_miDlHarqProcessesPackets
Definition: lte-enb-mac.h:237
info associated with a preamble allocated for non-contention based RA
Definition: lte-enb-mac.h:247
a unique identifier for an interface.
Definition: type-id.h:49
void DoSubframeIndication(uint32_t frameNo, uint32_t subframeNo)
Definition: lte-enb-mac.cc:446
This class implements the MAC layer of the eNodeB device.
Definition: lte-enb-mac.h:50
Parameters of the CSCHED_UE_RELEASE_CNF primitive.
void SetFfMacSchedSapProvider(FfMacSchedSapProvider *s)
Set the scheduler SAP provider.
Definition: lte-enb-mac.cc:381
FfMacCschedSapProvider * m_cschedSapProvider
Definition: lte-enb-mac.h:212
Time expiryTime
value the expiration time of this allocation (so that stale preambles can be reused) ...
Definition: lte-enb-mac.h:250
void ReceiveDlCqiLteControlMessage(Ptr< DlCqiLteControlMessage > msg)
Receive a DL CQI ideal control message.
Definition: lte-enb-mac.cc:648
void DoCschedCellConfigCnf(FfMacCschedSapUser::CschedCellConfigCnfParameters params)
Parameters for LteMacSapProvider::TransmitPdu.
Definition: lte-mac-sap.h:45