A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
lte-enb-phy.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2010 TELEMATICS LAB, DEE - Politecnico di Bari
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: Giuseppe Piro <g.piro@poliba.it>
19  * Author: Marco Miozzo <marco.miozzo@cttc.es>
20  */
21 
22 #ifndef ENB_LTE_PHY_H
23 #define ENB_LTE_PHY_H
24 
25 
26 #include <ns3/lte-control-messages.h>
27 #include <ns3/lte-enb-phy-sap.h>
28 #include <ns3/lte-enb-cphy-sap.h>
29 #include <ns3/lte-phy.h>
30 #include <ns3/lte-harq-phy.h>
31 
32 #include <map>
33 #include <set>
34 
35 
36 
37 namespace ns3 {
38 
39 class PacketBurst;
40 class LteNetDevice;
41 class LteUePhy;
42 
47 class LteEnbPhy : public LtePhy
48 {
51 
52 public:
56  LteEnbPhy ();
57 
64 
65  virtual ~LteEnbPhy ();
66 
67  // inherited from Object
68  static TypeId GetTypeId (void);
69  virtual void DoInitialize (void);
70  virtual void DoDispose (void);
71 
72 
78 
84 
90 
96 
100  void SetTxPower (double pow);
101 
105  double GetTxPower () const;
106 
107 
111  void SetNoiseFigure (double pow);
112 
116  double GetNoiseFigure () const;
117 
121  void SetMacChDelay (uint8_t delay);
122 
126  uint8_t GetMacChDelay (void) const;
127 
132 
137 
138 
147  void SetDownlinkSubChannels (std::vector<int> mask );
148 
149 
157  std::vector<int> GetDownlinkSubChannels (void);
158 
163 
169  void CalcChannelQualityForUe (std::vector <double> sinr, Ptr<LteSpectrumPhy> ue);
170 
176 
183 
190 
196 
202 
207 
211  std::list<UlDciLteControlMessage> DequeueUlDci (void);
212 
213 
217  void StartFrame (void);
221  void StartSubFrame (void);
225  void EndSubFrame (void);
229  void EndFrame (void);
230 
234  void PhyPduReceived (Ptr<Packet> p);
235 
240 
241  // inherited from LtePhy
242  virtual void GenerateCtrlCqiReport (const SpectrumValue& sinr);
243  virtual void GenerateDataCqiReport (const SpectrumValue& sinr);
244  virtual void ReportInterference (const SpectrumValue& interf);
245  virtual void ReportRsReceivedPower (const SpectrumValue& interf);
246 
247 
248 
253 
254  void SetHarqPhyModule (Ptr<LteHarqPhy> harq);
255 
256 
257 private:
258 
259  // LteEnbCphySapProvider forwarded methods
260  void DoSetBandwidth (uint8_t ulBandwidth, uint8_t dlBandwidth);
261  void DoSetEarfcn (uint16_t dlEarfcn, uint16_t ulEarfcn);
262  void DoAddUe (uint16_t rnti);
263  void DoRemoveUe (uint16_t rnti);
264  void DoSetTransmissionMode (uint16_t rnti, uint8_t txMode);
265  void DoSetSrsConfigurationIndex (uint16_t rnti, uint16_t srcCi);
267 
268  // LteEnbPhySapProvider forwarded methods
269  void DoSendMacPdu (Ptr<Packet> p);
271  uint8_t DoGetMacChTtiDelay ();
272 
273  bool AddUePhy (uint16_t rnti);
274 
275  bool DeleteUePhy (uint16_t rnti);
276 
277  void CreateSrsReport(uint16_t rnti, double srs);
278 
279 
280  std::set <uint16_t> m_ueAttached;
281 
282  std::vector <int> m_listOfDownlinkSubchannel;
283 
284  std::vector <int> m_dlDataRbMap;
285 
286  std::vector< std::list<UlDciLteControlMessage> > m_ulDciQueue; // for storing info on future receptions
287 
290 
293 
294  uint32_t m_nrFrames;
295  uint32_t m_nrSubFrames;
296 
299  std::map <uint16_t,uint16_t> m_srsCounter;
300  std::vector <uint16_t> m_srsUeOffset;
302 
304 
306 
313  std::map <uint16_t,uint16_t> m_srsSampleCounterMap;
314 
323 
329 
330 };
331 
332 
333 }
334 
335 #endif /* LTE_ENB_PHY_H */