A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
lte-ue-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  * Author: Marco Miozzo <mmiozzo@cttc.es>
20  */
21 
22 #ifndef LTE_UE_PHY_H
23 #define LTE_UE_PHY_H
24 
25 
26 #include <ns3/lte-phy.h>
27 #include <ns3/ff-mac-common.h>
28 
29 #include <ns3/lte-control-messages.h>
30 #include <ns3/lte-amc.h>
31 #include <ns3/lte-ue-phy-sap.h>
32 #include <ns3/lte-ue-cphy-sap.h>
33 #include <ns3/ptr.h>
34 #include <ns3/lte-amc.h>
35 
36 
37 namespace ns3 {
38 
39 class PacketBurst;
40 class LteEnbPhy;
41 class LteHarqPhy;
42 
48 class LteUePhy : public LtePhy
49 {
50 
51  friend class UeMemberLteUePhySapProvider;
52  friend class MemberLteUeCphySapProvider<LteUePhy>;
53 
54 public:
58  LteUePhy ();
59 
66 
67  virtual ~LteUePhy ();
68 
69  // inherited from Object
70  static TypeId GetTypeId (void);
71  virtual void DoInitialize (void);
72  virtual void DoDispose (void);
73 
79 
85 
91 
97 
98 
102  void SetTxPower (double pow);
103 
107  double GetTxPower () const;
111  void SetNoiseFigure (double pow);
112 
116  double GetNoiseFigure () const;
117 
121  uint8_t GetMacChDelay (void) const;
122 
127 
132 
133 
139 
144  void SetSubChannelsForTransmission (std::vector <int> mask);
149  std::vector <int> GetSubChannelsForTransmission (void);
150 
155  void SetSubChannelsForReception (std::vector <int> mask);
160  std::vector <int> GetSubChannelsForReception (void);
161 
162 
169 
170 
171 
172  // inherited from LtePhy
173  virtual void GenerateCtrlCqiReport (const SpectrumValue& sinr);
174  virtual void GenerateDataCqiReport (const SpectrumValue& sinr);
175  virtual void ReportInterference (const SpectrumValue& interf);
176  virtual void ReportRsReceivedPower (const SpectrumValue& power);
177 
178  virtual void ReceiveLteControlMessageList (std::list<Ptr<LteControlMessage> >);
179 
180 
181 
182 
186  void PhyPduReceived (Ptr<Packet> p);
187 
188 
195  void SubframeIndication (uint32_t frameNo, uint32_t subframeNo);
196 
197 
201  void SendSrs ();
202 
207 
211  void SetHarqPhyModule (Ptr<LteHarqPhy> harq);
212 
213 
214 
215 
216 private:
217 
218  void SetTxMode1Gain (double gain);
219  void SetTxMode2Gain (double gain);
220  void SetTxMode3Gain (double gain);
221  void SetTxMode4Gain (double gain);
222  void SetTxMode5Gain (double gain);
223  void SetTxMode6Gain (double gain);
224  void SetTxMode7Gain (double gain);
225  void SetTxModeGain (uint8_t txMode, double gain);
226 
227  void QueueSubChannelsForTransmission (std::vector <int> rbMap);
228 
229  // UE CPHY SAP methods
230  void DoReset ();
231  void DoSyncronizeWithEnb (uint16_t cellId, uint16_t dlEarfcn);
232  void DoSetDlBandwidth (uint8_t ulBandwidth);
233  void DoConfigureUplink (uint16_t ulEarfcn, uint8_t ulBandwidth);
234  void DoSetRnti (uint16_t rnti);
235  void DoSetTransmissionMode (uint8_t txMode);
236  void DoSetSrsConfigurationIndex (uint16_t srcCi);
237 
238  // UE PHY SAP methods
239  virtual void DoSendMacPdu (Ptr<Packet> p);
240  virtual void DoSendLteControlMessage (Ptr<LteControlMessage> msg);
241  virtual void DoSendRachPreamble (uint32_t prachId, uint32_t raRnti);
242 
243  std::vector <int> m_subChannelsForTransmission;
244  std::vector <int> m_subChannelsForReception;
245 
246  std::vector< std::vector <int> > m_subChannelsForTransmissionQueue;
247 
248 
249  Ptr<LteAmc> m_amc;
250 
253 
255  // NOTE defines a periodicity for academic studies
256  Time m_a30CqiPeriocity;
257  Time m_a30CqiLast;
258 
259  LteUePhySapProvider* m_uePhySapProvider;
260  LteUePhySapUser* m_uePhySapUser;
261 
262  LteUeCphySapProvider* m_ueCphySapProvider;
263  LteUeCphySapUser* m_ueCphySapUser;
264 
265  uint16_t m_rnti;
266 
267  uint8_t m_transmissionMode;
268  std::vector <double> m_txModeGain;
269 
270  uint16_t m_srsPeriodicity;
271  uint16_t m_srsSubframeOffset;
272  uint16_t m_srsConfigured;
273  Time m_srsStartTime;
274 
275  bool m_dlConfigured;
276  bool m_ulConfigured;
277 
278  bool m_rsReceivedPowerUpdated;
279  SpectrumValue m_rsReceivedPower;
280 
281  Ptr<LteHarqPhy> m_harqPhyModule;
282 
283  uint32_t m_raPreambleId;
284  uint32_t m_raRnti;
285 
291  uint16_t m_rsrpSinrSamplePeriod;
292  uint16_t m_rsrpSinrSampleCounter;
293 
294  EventId m_sendSrsEvent;
295 
301 
302 };
303 
304 
305 }
306 
307 #endif /* LTE_UE_PHY_H */
double GetNoiseFigure() const
Definition: lte-ue-phy.cc:286
Ptr< LteSpectrumPhy > GetUlSpectrumPhy() const
Definition: lte-ue-phy.cc:320
keep track of time unit.
Definition: nstime.h:149
smart pointer class similar to boost::intrusive_ptr
Definition: ptr.h:59
void SetNoiseFigure(double pow)
Definition: lte-ue-phy.cc:279
virtual void GenerateDataCqiReport(const SpectrumValue &sinr)
Definition: lte-ue-phy.cc:421
uint8_t GetMacChDelay(void) const
Definition: lte-ue-phy.cc:308
std::vector< int > GetSubChannelsForTransmission(void)
Get a list of sub channels to use in RX.
Definition: lte-ue-phy.cc:361
virtual void GenerateCtrlCqiReport(const SpectrumValue &sinr)
Definition: lte-ue-phy.cc:387
TracedCallback< uint16_t, uint16_t, double, double > m_reportCurrentCellRsrpSinrTrace
Definition: lte-ue-phy.h:290
void SetSubChannelsForTransmission(std::vector< int > mask)
Set a list of sub channels to use in TX.
Definition: lte-ue-phy.cc:341
virtual void DoSendMacPdu(Ptr< Packet > p)
Queue the MAC PDU to be sent (according to m_macChTtiDelay)
Definition: lte-ue-phy.cc:326
std::vector< int > GetSubChannelsForReception(void)
Get a list of sub channels to use in RX.
Definition: lte-ue-phy.cc:369
void SetHarqPhyModule(Ptr< LteHarqPhy > harq)
Set the HARQ PHY module.
Definition: lte-ue-phy.cc:1051
void SetLteUePhySapUser(LteUePhySapUser *s)
Set the PHY SAP User.
Definition: lte-ue-phy.cc:250
Ptr< DlCqiLteControlMessage > CreateDlCqiFeedbackMessage(const SpectrumValue &sinr)
Create the DL CQI feedback from SINR values perceived at the physical layer with the signal received ...
Definition: lte-ue-phy.cc:443
void SendSrs()
Send the SRS signal in the last symbols of the frame.
Definition: lte-ue-phy.cc:828
See section 4.3.23 dlInfoListElement.
virtual void ReceiveLteDlHarqFeedback(DlInfoListElement_s mes)
PhySpectrum generated a new DL HARQ feedback.
Definition: lte-ue-phy.cc:1041
double GetTxPower() const
Definition: lte-ue-phy.cc:300
void SubframeIndication(uint32_t frameNo, uint32_t subframeNo)
trigger from eNB the start from a new frame
Definition: lte-ue-phy.cc:752
virtual void DoInitialize(void)
Definition: lte-ue-phy.cc:243
Time m_p10CqiPeriocity
Definition: lte-ue-phy.h:251
an identifier for simulation events.
Definition: event-id.h:46
void SetTxPower(double pow)
Definition: lte-ue-phy.cc:293
LteUePhySapProvider * GetLteUePhySapProvider()
Get the PHY SAP provider.
Definition: lte-ue-phy.cc:257
void SetLteUeCphySapUser(LteUeCphySapUser *s)
Set the CPHY SAP User.
Definition: lte-ue-phy.cc:265
void PhyPduReceived(Ptr< Packet > p)
PhySpectrum received a new PHY-PDU.
Definition: lte-ue-phy.cc:335
Ptr< LteSpectrumPhy > GetDlSpectrumPhy() const
Definition: lte-ue-phy.cc:314
virtual void ReportRsReceivedPower(const SpectrumValue &power)
Definition: lte-ue-phy.cc:433
Time m_p10CqiLast
Definition: lte-ue-phy.h:252
LteUeCphySapProvider * GetLteUeCphySapProvider()
Get the CPHY SAP provider.
Definition: lte-ue-phy.cc:272
Set of values corresponding to a given SpectrumModel.
a unique identifier for an interface.
Definition: type-id.h:44
TracedCallback< PhyTransmissionStatParameters > m_ulPhyTransmission
Definition: lte-ue-phy.h:300
virtual void ReportInterference(const SpectrumValue &interf)
Definition: lte-ue-phy.cc:427
virtual Ptr< SpectrumValue > CreateTxPowerSpectralDensity()
Create the PSD for the TX.
Definition: lte-ue-phy.cc:377
void SetSubChannelsForReception(std::vector< int > mask)
Get a list of sub channels to use in RX.
Definition: lte-ue-phy.cc:353
virtual void DoDispose(void)
Definition: lte-ue-phy.cc:146