A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
lte-phy.h
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  * Marco Miozzo <mmiozzo@cttc.es>
20  * Nicola Baldo <nbaldo@cttc.es>
21  */
22 
23 #ifndef LTE_PHY_H
24 #define LTE_PHY_H
25 
26 
27 #include <ns3/spectrum-value.h>
28 #include <ns3/mobility-model.h>
29 #include <ns3/packet.h>
30 #include <ns3/nstime.h>
31 #include <ns3/spectrum-phy.h>
32 #include <ns3/spectrum-channel.h>
33 #include <ns3/spectrum-signal-parameters.h>
34 #include <ns3/spectrum-interference.h>
35 #include <ns3/generic-phy.h>
36 #include <ns3/lte-spectrum-phy.h>
37 
38 namespace ns3 {
39 
40 class PacketBurst;
41 class LteNetDevice;
42 class LteControlMessage;
43 
44 
45 
52 class LtePhy : public Object
53 {
54 
55 public:
59  LtePhy ();
60 
67 
68  virtual ~LtePhy ();
69 
70  static TypeId GetTypeId (void);
71 
82 
88 
89 
95 
100  virtual void DoSendMacPdu (Ptr<Packet> p) = 0;
101 
107 
113 
114 
120 
121  void DoDispose ();
122 
127 // virtual void ReceiveLteControlMessage (Ptr<LteControlMessage> msg) = 0;
128 
129 
133  void SetTti (double tti);
137  double GetTti (void) const;
138 
143  void DoSetCellId (uint16_t cellId);
144 
145 
149  uint8_t GetRbgSize (void) const;
150 
151 
156  uint16_t GetSrsPeriodicity (uint16_t srcCi) const;
157 
162  uint16_t GetSrsSubframeOffset (uint16_t srcCi) const;
163 
164 
168  void SetMacPdu (Ptr<Packet> p);
169 
174 
179 
183  std::list<Ptr<LteControlMessage> > GetControlMessages (void);
184 
185 
191  virtual void GenerateCtrlCqiReport (const SpectrumValue& sinr) = 0;
192 
199  virtual void GenerateDataCqiReport (const SpectrumValue& sinr) = 0;
200 
208  virtual void ReportInterference (const SpectrumValue& power) = 0;
209 
217  virtual void ReportRsReceivedPower (const SpectrumValue& interf) = 0;
218 
219 
220 
221 protected:
222  Ptr<LteNetDevice> m_netDevice;
223 
224  Ptr<LteSpectrumPhy> m_downlinkSpectrumPhy;
225  Ptr<LteSpectrumPhy> m_uplinkSpectrumPhy;
226 
227  double m_txPower;
228  double m_noiseFigure;
229 
230  double m_tti;
231  uint8_t m_ulBandwidth;
232  uint8_t m_dlBandwidth;
233  uint8_t m_rbgSize;
234 
235  uint16_t m_dlEarfcn;
236  uint16_t m_ulEarfcn;
237 
238  std::vector< Ptr<PacketBurst> > m_packetBurstQueue;
239  std::vector< std::list<Ptr<LteControlMessage> > > m_controlMessagesQueue;
240  uint8_t m_macChTtiDelay; // delay between MAC and channel layer in terms of TTIs
241 
242  uint16_t m_cellId;
243 
244 };
245 
246 
247 }
248 
249 #endif /* LTE_PHY_H */
void SetDevice(Ptr< LteNetDevice > d)
Set the device where the phy layer is attached.
Definition: lte-phy.cc:89
smart pointer class similar to boost::intrusive_ptr
Definition: ptr.h:59
void DoSetCellId(uint16_t cellId)
Definition: lte-phy.cc:245
uint16_t GetSrsPeriodicity(uint16_t srcCi) const
Definition: lte-phy.cc:147
double GetTti(void) const
Definition: lte-phy.cc:139
virtual void GenerateDataCqiReport(const SpectrumValue &sinr)=0
void SetUplinkChannel(Ptr< SpectrumChannel > c)
Definition: lte-phy.cc:124
Ptr< LteSpectrumPhy > GetUplinkSpectrumPhy()
Definition: lte-phy.cc:110
Ptr< LteNetDevice > GetDevice()
Get the device where the phy layer is attached.
Definition: lte-phy.cc:97
uint16_t GetSrsSubframeOffset(uint16_t srcCi) const
Definition: lte-phy.cc:165
void DoDispose()
Definition: lte-phy.cc:75
uint8_t GetRbgSize(void) const
Definition: lte-phy.cc:183
virtual void DoSendMacPdu(Ptr< Packet > p)=0
Queue the MAC PDU to be sent (according to m_macChTtiDelay)
virtual void GenerateCtrlCqiReport(const SpectrumValue &sinr)=0
void SetDownlinkChannel(Ptr< SpectrumChannel > c)
Definition: lte-phy.cc:117
virtual Ptr< SpectrumValue > CreateTxPowerSpectralDensity()=0
Compute the TX Power Spectral Density.
Ptr< LteSpectrumPhy > GetDownlinkSpectrumPhy()
Definition: lte-phy.cc:104
virtual void ReportRsReceivedPower(const SpectrumValue &interf)=0
void SetControlMessages(Ptr< LteControlMessage > m)
Definition: lte-phy.cc:214
virtual void ReportInterference(const SpectrumValue &power)=0
std::list< Ptr< LteControlMessage > > GetControlMessages(void)
Definition: lte-phy.cc:222
Ptr< PacketBurst > GetPacketBurst(void)
Definition: lte-phy.cc:195
a base class which provides memory management and object aggregation
Definition: object.h:63
Set of values corresponding to a given SpectrumModel.
void SetMacPdu(Ptr< Packet > p)
Definition: lte-phy.cc:189
a unique identifier for an interface.
Definition: type-id.h:44
void SetTti(double tti)
Receive SendLteControlMessage (PDCCH map, CQI feedbacks) using the ideal control channel.
Definition: lte-phy.cc:131