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 */