A Discrete-Event Network Simulator
API
lte-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  * 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 
74  static TypeId GetTypeId (void);
75 
86 
92 
93 
99 
104  virtual void DoSendMacPdu (Ptr<Packet> p) = 0;
105 
111 
117 
118 
124 
125  void DoDispose ();
126 
130  void SetTti (double tti);
134  double GetTti (void) const;
135 
140  void DoSetCellId (uint16_t cellId);
141 
142 
146  uint8_t GetRbgSize (void) const;
147 
148 
153  uint16_t GetSrsPeriodicity (uint16_t srcCi) const;
154 
159  uint16_t GetSrsSubframeOffset (uint16_t srcCi) const;
160 
161 
165  void SetMacPdu (Ptr<Packet> p);
166 
171 
176 
180  std::list<Ptr<LteControlMessage> > GetControlMessages (void);
181 
182 
188  virtual void GenerateCtrlCqiReport (const SpectrumValue& sinr) = 0;
189 
196  virtual void GenerateDataCqiReport (const SpectrumValue& sinr) = 0;
197 
205  virtual void ReportInterference (const SpectrumValue& interf) = 0;
206 
214  virtual void ReportRsReceivedPower (const SpectrumValue& power) = 0;
215 
221  void SetComponentCarrierId (uint8_t index);
222 
228  uint8_t GetComponentCarrierId ();
229 
230 protected:
233 
244 
249  double m_txPower;
262 
264  double m_tti;
269  uint8_t m_ulBandwidth;
274  uint8_t m_dlBandwidth;
276  uint8_t m_rbgSize;
281  uint32_t m_dlEarfcn;
286  uint32_t m_ulEarfcn;
287 
289  std::vector< Ptr<PacketBurst> > m_packetBurstQueue;
291  std::vector< std::list<Ptr<LteControlMessage> > > m_controlMessagesQueue;
302 
308  uint16_t m_cellId;
309 
312 
313 }; // end of `class LtePhy`
314 
315 
316 }
317 
318 #endif /* LTE_PHY_H */
void SetDevice(Ptr< LteNetDevice > d)
Set the device where the phy layer is attached.
Definition: lte-phy.cc:90
static TypeId GetTypeId(void)
Get the type ID.
Definition: lte-phy.cc:60
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:73
void DoSetCellId(uint16_t cellId)
Definition: lte-phy.cc:246
double m_noiseFigure
Loss (dB) in the Signal-to-Noise-Ratio due to non-idealities in the receiver.
Definition: lte-phy.h:261
double m_txPower
Transmission power in dBm.
Definition: lte-phy.h:249
uint8_t m_componentCarrierId
component carrier Id used to address sap
Definition: lte-phy.h:311
std::vector< Ptr< PacketBurst > > m_packetBurstQueue
A queue of packet bursts to be sent.
Definition: lte-phy.h:289
void SetComponentCarrierId(uint8_t index)
Set the component carrier ID.
Definition: lte-phy.cc:254
virtual void ReportInterference(const SpectrumValue &interf)=0
generate a report based on the linear interference and noise power perceived during DATA frame NOTE: ...
virtual void GenerateDataCqiReport(const SpectrumValue &sinr)=0
generate a CQI report based on the given SINR of Data frame (used for PUSCH CQIs) ...
double m_tti
Transmission time interval.
Definition: lte-phy.h:264
Ptr< LteSpectrumPhy > m_downlinkSpectrumPhy
The downlink LteSpectrumPhy associated to this LtePhy.
Definition: lte-phy.h:238
void SetUplinkChannel(Ptr< SpectrumChannel > c)
Set the uplink channel.
Definition: lte-phy.cc:125
Ptr< LteSpectrumPhy > GetUplinkSpectrumPhy()
Definition: lte-phy.cc:111
uint16_t GetSrsPeriodicity(uint16_t srcCi) const
Definition: lte-phy.cc:148
uint8_t m_ulBandwidth
The UL bandwidth in number of PRBs.
Definition: lte-phy.h:269
double GetTti(void) const
Definition: lte-phy.cc:140
uint8_t GetRbgSize(void) const
Definition: lte-phy.cc:184
void DoDispose()
Destructor implementation.
Definition: lte-phy.cc:76
virtual void DoSendMacPdu(Ptr< Packet > p)=0
Queue the MAC PDU to be sent (according to m_macChTtiDelay)
virtual ~LtePhy()
Definition: lte-phy.cc:70
virtual void GenerateCtrlCqiReport(const SpectrumValue &sinr)=0
generate a CQI report based on the given SINR of Ctrl frame
void SetDownlinkChannel(Ptr< SpectrumChannel > c)
Set the downlink channel.
Definition: lte-phy.cc:118
uint16_t GetSrsSubframeOffset(uint16_t srcCi) const
Definition: lte-phy.cc:166
virtual Ptr< SpectrumValue > CreateTxPowerSpectralDensity()=0
Compute the TX Power Spectral Density.
Ptr< LteSpectrumPhy > GetDownlinkSpectrumPhy()
Definition: lte-phy.cc:105
uint32_t m_dlEarfcn
The downlink carrier frequency.
Definition: lte-phy.h:281
uint8_t m_macChTtiDelay
Delay between MAC and channel layer in terms of TTIs.
Definition: lte-phy.h:301
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void SetControlMessages(Ptr< LteControlMessage > m)
Definition: lte-phy.cc:215
uint8_t m_dlBandwidth
The DL bandwidth in number of PRBs.
Definition: lte-phy.h:274
Ptr< LteNetDevice > GetDevice() const
Get the device where the phy layer is attached.
Definition: lte-phy.cc:98
uint16_t m_cellId
Cell identifier.
Definition: lte-phy.h:308
uint8_t GetComponentCarrierId()
Get the component carrier ID.
Definition: lte-phy.cc:262
Ptr< LteNetDevice > m_netDevice
Pointer to the NetDevice where this PHY layer is attached.
Definition: lte-phy.h:232
std::list< Ptr< LteControlMessage > > GetControlMessages(void)
Definition: lte-phy.cc:223
Ptr< PacketBurst > GetPacketBurst(void)
Definition: lte-phy.cc:196
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_rbgSize
The RB group size according to the bandwidth.
Definition: lte-phy.h:276
std::vector< std::list< Ptr< LteControlMessage > > > m_controlMessagesQueue
A queue of control messages to be sent.
Definition: lte-phy.h:291
A base class which provides memory management and object aggregation.
Definition: object.h:87
uint32_t m_ulEarfcn
The uplink carrier frequency.
Definition: lte-phy.h:286
Ptr< LteSpectrumPhy > m_uplinkSpectrumPhy
The uplink LteSpectrumPhy associated to this LtePhy.
Definition: lte-phy.h:243
Set of values corresponding to a given SpectrumModel.
void SetMacPdu(Ptr< Packet > p)
Definition: lte-phy.cc:190
a unique identifier for an interface.
Definition: type-id.h:58
void SetTti(double tti)
Definition: lte-phy.cc:132
The LtePhy models the physical layer of LTE.
Definition: lte-phy.h:52