A Discrete-Event Network Simulator
API
lte-phy.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2010 TELEMATICS LAB, DEE - Politecnico di Bari
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License version 2 as
6  * published by the Free Software Foundation;
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program; if not, write to the Free Software
15  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16  *
17  * Author: Giuseppe Piro <g.piro@poliba.it>
18  * Marco Miozzo <mmiozzo@cttc.es>
19  * Nicola Baldo <nbaldo@cttc.es>
20  */
21 
22 #ifndef LTE_PHY_H
23 #define LTE_PHY_H
24 
25 #include <ns3/generic-phy.h>
26 #include <ns3/lte-spectrum-phy.h>
27 #include <ns3/mobility-model.h>
28 #include <ns3/nstime.h>
29 #include <ns3/packet.h>
30 #include <ns3/spectrum-channel.h>
31 #include <ns3/spectrum-interference.h>
32 #include <ns3/spectrum-phy.h>
33 #include <ns3/spectrum-signal-parameters.h>
34 #include <ns3/spectrum-value.h>
35 
36 namespace ns3
37 {
38 
39 class PacketBurst;
40 class LteNetDevice;
41 class LteControlMessage;
42 
49 class LtePhy : public Object
50 {
51  public:
55  LtePhy();
56 
63 
64  ~LtePhy() override;
65 
70  static TypeId GetTypeId();
71 
82 
88 
94 
99  virtual void DoSendMacPdu(Ptr<Packet> p) = 0;
100 
106 
112 
119 
120  void DoDispose() override;
121 
125  void SetTti(double tti);
129  double GetTti() const;
130 
135  void DoSetCellId(uint16_t cellId);
136 
140  uint8_t GetRbgSize() const;
141 
146  uint16_t GetSrsPeriodicity(uint16_t srcCi) const;
147 
152  uint16_t GetSrsSubframeOffset(uint16_t srcCi) const;
153 
157  void SetMacPdu(Ptr<Packet> p);
158 
163 
168 
172  std::list<Ptr<LteControlMessage>> GetControlMessages();
173 
179  virtual void GenerateCtrlCqiReport(const SpectrumValue& sinr) = 0;
180 
187  virtual void GenerateDataCqiReport(const SpectrumValue& sinr) = 0;
188 
196  virtual void ReportInterference(const SpectrumValue& interf) = 0;
197 
205  virtual void ReportRsReceivedPower(const SpectrumValue& power) = 0;
206 
212  void SetComponentCarrierId(uint8_t index);
213 
219  uint8_t GetComponentCarrierId() const;
220 
221  protected:
224 
235 
240  double m_txPower;
253 
255  double m_tti;
260  uint16_t m_ulBandwidth;
265  uint16_t m_dlBandwidth;
267  uint8_t m_rbgSize;
272  uint32_t m_dlEarfcn;
277  uint32_t m_ulEarfcn;
278 
280  std::vector<Ptr<PacketBurst>> m_packetBurstQueue;
282  std::vector<std::list<Ptr<LteControlMessage>>> m_controlMessagesQueue;
293 
299  uint16_t m_cellId;
300 
303 
304 }; // end of `class LtePhy`
305 
306 } // namespace ns3
307 
308 #endif /* LTE_PHY_H */
The LtePhy models the physical layer of LTE.
Definition: lte-phy.h:50
virtual void ReportInterference(const SpectrumValue &interf)=0
generate a report based on the linear interference and noise power perceived during DATA frame NOTE: ...
void DoSetCellId(uint16_t cellId)
Definition: lte-phy.cc:239
double m_txPower
Transmission power in dBm.
Definition: lte-phy.h:240
static TypeId GetTypeId()
Get the type ID.
Definition: lte-phy.cc:63
uint8_t GetRbgSize() const
Definition: lte-phy.cc:179
uint8_t GetComponentCarrierId() const
Get the component carrier ID.
Definition: lte-phy.cc:255
void DoDispose() override
Destructor implementation.
Definition: lte-phy.cc:75
uint16_t GetSrsPeriodicity(uint16_t srcCi) const
Definition: lte-phy.cc:143
std::vector< Ptr< PacketBurst > > m_packetBurstQueue
A queue of packet bursts to be sent.
Definition: lte-phy.h:280
uint16_t m_ulBandwidth
The UL bandwidth in number of PRBs.
Definition: lte-phy.h:260
Ptr< PacketBurst > GetPacketBurst()
Definition: lte-phy.cc:191
Ptr< LteNetDevice > GetDevice() const
Get the device where the phy layer is attached.
Definition: lte-phy.cc:96
void SetDownlinkChannel(Ptr< SpectrumChannel > c)
Set the downlink channel.
Definition: lte-phy.cc:115
void SetUplinkChannel(Ptr< SpectrumChannel > c)
Set the uplink channel.
Definition: lte-phy.cc:122
virtual void ReportRsReceivedPower(const SpectrumValue &power)=0
generate a report based on the linear RS power perceived during CTRL frame NOTE: used only by UE for ...
uint8_t m_componentCarrierId
component carrier Id used to address sap
Definition: lte-phy.h:302
double m_noiseFigure
Loss (dB) in the Signal-to-Noise-Ratio due to non-idealities in the receiver.
Definition: lte-phy.h:252
void SetComponentCarrierId(uint8_t index)
Set the component carrier ID.
Definition: lte-phy.cc:247
Ptr< LteSpectrumPhy > GetDownlinkSpectrumPhy()
Definition: lte-phy.cc:103
uint32_t m_ulEarfcn
The uplink carrier frequency.
Definition: lte-phy.h:277
uint16_t m_dlBandwidth
The DL bandwidth in number of PRBs.
Definition: lte-phy.h:265
Ptr< LteSpectrumPhy > m_downlinkSpectrumPhy
The downlink LteSpectrumPhy associated to this LtePhy.
Definition: lte-phy.h:229
Ptr< LteSpectrumPhy > GetUplinkSpectrumPhy()
Definition: lte-phy.cc:109
virtual Ptr< SpectrumValue > CreateTxPowerSpectralDensity()=0
Compute the TX Power Spectral Density.
void SetMacPdu(Ptr< Packet > p)
Definition: lte-phy.cc:185
std::list< Ptr< LteControlMessage > > GetControlMessages()
Definition: lte-phy.cc:217
uint16_t GetSrsSubframeOffset(uint16_t srcCi) const
Definition: lte-phy.cc:161
void SetDevice(Ptr< LteNetDevice > d)
Set the device where the phy layer is attached.
Definition: lte-phy.cc:89
virtual void GenerateDataCqiReport(const SpectrumValue &sinr)=0
generate a CQI report based on the given SINR of Data frame (used for PUSCH CQIs)
Ptr< LteNetDevice > m_netDevice
Pointer to the NetDevice where this PHY layer is attached.
Definition: lte-phy.h:223
uint16_t m_cellId
Cell identifier.
Definition: lte-phy.h:299
void SetControlMessages(Ptr< LteControlMessage > m)
Definition: lte-phy.cc:209
double m_tti
Transmission time interval.
Definition: lte-phy.h:255
virtual void GenerateCtrlCqiReport(const SpectrumValue &sinr)=0
generate a CQI report based on the given SINR of Ctrl frame
uint32_t m_dlEarfcn
The downlink carrier frequency.
Definition: lte-phy.h:272
virtual void DoSendMacPdu(Ptr< Packet > p)=0
Queue the MAC PDU to be sent (according to m_macChTtiDelay)
Ptr< LteSpectrumPhy > m_uplinkSpectrumPhy
The uplink LteSpectrumPhy associated to this LtePhy.
Definition: lte-phy.h:234
double GetTti() const
Definition: lte-phy.cc:136
std::vector< std::list< Ptr< LteControlMessage > > > m_controlMessagesQueue
A queue of control messages to be sent.
Definition: lte-phy.h:282
uint8_t m_rbgSize
The RB group size according to the bandwidth.
Definition: lte-phy.h:267
~LtePhy() override
Definition: lte-phy.cc:69
void SetTti(double tti)
Definition: lte-phy.cc:129
uint8_t m_macChTtiDelay
Delay between MAC and channel layer in terms of TTIs.
Definition: lte-phy.h:292
A base class which provides memory management and object aggregation.
Definition: object.h:89
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:78
Set of values corresponding to a given SpectrumModel.
a unique identifier for an interface.
Definition: type-id.h:60
Every class exported by the ns3 library is enclosed in the ns3 namespace.