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-enb-phy-sap.h>
27 #include <ns3/lte-phy.h>
28 #include <ns3/lte-ue-phy.h>
29 
30 #include <map>
31 #include <set>
32 
33 
34 
35 namespace ns3 {
36 
37 class PacketBurst;
38 class LteNetDevice;
39 
44 class LteEnbPhy : public LtePhy
45 {
46 
48 
49 public:
53  LteEnbPhy ();
54 
61 
62  virtual ~LteEnbPhy ();
63 
64  // inherited from Object
65  static TypeId GetTypeId (void);
66  virtual void DoStart (void);
67  virtual void DoDispose (void);
68 
69 
75 
81 
85  void SetTxPower (double pow);
86 
90  double GetTxPower () const;
91 
92 
96  void SetNoiseFigure (double pow);
97 
101  double GetNoiseFigure () const;
102 
106  void SetMacChDelay (uint8_t delay);
107 
111  uint8_t GetMacChDelay (void) const;
112 
117  virtual void DoSendMacPdu (Ptr<Packet> p);
118 
119  virtual void DoSetTransmissionMode (uint16_t rnti, uint8_t txMode);
120 
121  virtual void DoSetSrsConfigurationIndex (uint16_t rnti, uint16_t srcCi);
122 
123  virtual uint8_t DoGetMacChTtiDelay ();
124 
133  void SetDownlinkSubChannels (std::vector<int> mask );
134 
135 
143  std::vector<int> GetDownlinkSubChannels (void);
144 
149 
155  void CalcChannelQualityForUe (std::vector <double> sinr, Ptr<LteSpectrumPhy> ue);
156 
162 
169 
176 
177 
179 
180  bool AddUePhy (uint16_t rnti);
181 
182  bool DeleteUePhy (uint16_t rnti);
183 
189 
195 
200 
204  std::list<UlDciLteControlMessage> DequeueUlDci (void);
205 
206 
210  void StartFrame (void);
214  void StartSubFrame (void);
218  void EndSubFrame (void);
222  void EndFrame (void);
223 
227  void PhyPduReceived (Ptr<Packet> p);
228 
233 
234  // inherited from LtePhy
235  virtual void GenerateCtrlCqiReport (const SpectrumValue& sinr);
236  virtual void GenerateDataCqiReport (const SpectrumValue& sinr);
237 
238 
239 private:
240  std::set <uint16_t> m_ueAttached;
241 
242  std::vector <int> m_listOfDownlinkSubchannel;
243 
244  std::vector <int> m_dlDataRbMap;
245 
246  std::vector< std::list<UlDciLteControlMessage> > m_ulDciQueue; // for storing info on future receptions
247 
250 
251  std::vector <uint16_t> m_ulRntiRxed;
252 
253  uint32_t m_nrFrames;
254  uint32_t m_nrSubFrames;
255 
257  std::map <uint16_t,uint16_t> m_srsCounter;
258  std::vector <uint16_t> m_srsUeOffset;
260 
261 };
262 
263 
264 }
265 
266 #endif /* LTE_ENB_PHY_H */