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-control-messages.h>
27 #include <ns3/lte-enb-phy-sap.h>
28 #include <ns3/lte-enb-cphy-sap.h>
29 #include <ns3/lte-phy.h>
30 #include <ns3/lte-harq-phy.h>
31 
32 #include <map>
33 #include <set>
34 
35 
36 
37 namespace ns3 {
38 
39 class PacketBurst;
40 class LteNetDevice;
41 class LteUePhy;
42 
47 class LteEnbPhy : public LtePhy
48 {
51 
52 public:
56  LteEnbPhy ();
57 
64 
65  virtual ~LteEnbPhy ();
66 
67  // inherited from Object
68  static TypeId GetTypeId (void);
69  virtual void DoInitialize (void);
70  virtual void DoDispose (void);
71 
72 
78 
84 
90 
96 
100  void SetTxPower (double pow);
101 
105  double GetTxPower () const;
106 
107 
111  void SetNoiseFigure (double pow);
112 
116  double GetNoiseFigure () const;
117 
121  void SetMacChDelay (uint8_t delay);
122 
126  uint8_t GetMacChDelay (void) const;
127 
132 
137 
138 
147  void SetDownlinkSubChannels (std::vector<int> mask );
148 
149 
157  std::vector<int> GetDownlinkSubChannels (void);
158 
163 
169  void CalcChannelQualityForUe (std::vector <double> sinr, Ptr<LteSpectrumPhy> ue);
170 
176 
184 
192 
198 
204 
209 
213  std::list<UlDciLteControlMessage> DequeueUlDci (void);
214 
215 
219  void StartFrame (void);
223  void StartSubFrame (void);
227  void EndSubFrame (void);
231  void EndFrame (void);
232 
236  void PhyPduReceived (Ptr<Packet> p);
237 
242 
243  // inherited from LtePhy
244  virtual void GenerateCtrlCqiReport (const SpectrumValue& sinr);
245  virtual void GenerateDataCqiReport (const SpectrumValue& sinr);
246  virtual void ReportInterference (const SpectrumValue& interf);
247  virtual void ReportRsReceivedPower (const SpectrumValue& power);
248 
249 
250 
255 
256  void SetHarqPhyModule (Ptr<LteHarqPhy> harq);
257 
258 
259 private:
260 
261  // LteEnbCphySapProvider forwarded methods
262  void DoSetBandwidth (uint8_t ulBandwidth, uint8_t dlBandwidth);
263  void DoSetEarfcn (uint16_t dlEarfcn, uint16_t ulEarfcn);
264  void DoAddUe (uint16_t rnti);
265  void DoRemoveUe (uint16_t rnti);
266  void DoSetTransmissionMode (uint16_t rnti, uint8_t txMode);
267  void DoSetSrsConfigurationIndex (uint16_t rnti, uint16_t srcCi);
270 
271  // LteEnbPhySapProvider forwarded methods
272  void DoSendMacPdu (Ptr<Packet> p);
274  uint8_t DoGetMacChTtiDelay ();
275 
276  bool AddUePhy (uint16_t rnti);
277 
278  bool DeleteUePhy (uint16_t rnti);
279 
280  void CreateSrsReport(uint16_t rnti, double srs);
281 
282 
283  std::set <uint16_t> m_ueAttached;
284 
285  std::vector <int> m_listOfDownlinkSubchannel;
286 
287  std::vector <int> m_dlDataRbMap;
288 
289  std::vector< std::list<UlDciLteControlMessage> > m_ulDciQueue; // for storing info on future receptions
290 
293 
296 
297  uint32_t m_nrFrames;
298  uint32_t m_nrSubFrames;
299 
302  std::map <uint16_t,uint16_t> m_srsCounter;
303  std::vector <uint16_t> m_srsUeOffset;
305 
308 
310 
317  std::map <uint16_t,uint16_t> m_srsSampleCounterMap;
318 
327 
333 
334 };
335 
336 
337 }
338 
339 #endif /* LTE_ENB_PHY_H */
virtual ~LteEnbPhy()
Definition: lte-enb-phy.cc:218
Template for the implementation of the LteEnbCphySapProvider as a member of an owner class of type C ...
keep track of time values and allow control of global simulation resolution
Definition: nstime.h:81
smart pointer class similar to boost::intrusive_ptr
Definition: ptr.h:59
uint16_t m_interferenceSampleCounter
Definition: lte-enb-phy.h:326
uint32_t m_nrSubFrames
Definition: lte-enb-phy.h:298
uint16_t m_srsSamplePeriod
Definition: lte-enb-phy.h:316
void SetDownlinkSubChannels(std::vector< int > mask)
set the resource blocks (a.k.a.
Definition: lte-enb-phy.cc:396
void CalcChannelQualityForUe(std::vector< double > sinr, Ptr< LteSpectrumPhy > ue)
Calculate the channel quality for a given UE.
Definition: lte-enb-phy.cc:423
The Uplink Data Control Indicator messages defines the RB allocation for the users in the uplink...
bool DeleteUePhy(uint16_t rnti)
Definition: lte-enb-phy.cc:355
std::list< UlDciLteControlMessage > DequeueUlDci(void)
Definition: lte-enb-phy.cc:930
virtual void ReceiveLteControlMessageList(std::list< Ptr< LteControlMessage > >)
PhySpectrum received a new list of LteControlMessage.
Definition: lte-enb-phy.cc:448
void DoSendLteControlMessage(Ptr< LteControlMessage > msg)
Definition: lte-enb-phy.cc:430
virtual void ReportRsReceivedPower(const SpectrumValue &power)
generate a report based on the linear RS power perceived during CTRL frame NOTE: used only by UE for ...
Definition: lte-enb-phy.cc:781
void DoSetSystemInformationBlockType1(LteRrcSap::SystemInformationBlockType1 sib1)
Definition: lte-enb-phy.cc:993
virtual Ptr< SpectrumValue > CreateTxPowerSpectralDensity()
Create the PSD for TX.
Definition: lte-enb-phy.cc:412
std::vector< std::list< UlDciLteControlMessage > > m_ulDciQueue
Definition: lte-enb-phy.h:289
TracedCallback< uint16_t, uint16_t, double > m_reportUeSinr
Trace reporting the linear average of SRS SINRs uint16_t cellId, uint16_t rnti, double sinrLinear...
Definition: lte-enb-phy.h:315
Service Access Point (SAP) offered by the UE PHY to the UE RRC for control purposes.
Service Access Point (SAP) offered by the eNB-PHY to the eNB-MAC.
See section 4.3.12 ulInfoListElement.
std::vector< int > m_dlDataRbMap
Definition: lte-enb-phy.h:287
uint32_t m_nrFrames
Definition: lte-enb-phy.h:297
std::map< uint16_t, uint16_t > m_srsCounter
Definition: lte-enb-phy.h:302
Service Access Point (SAP) offered by the eNB-PHY to the eNB-MAC.
void DoSetEarfcn(uint16_t dlEarfcn, uint16_t ulEarfcn)
Definition: lte-enb-phy.cc:834
LteEnbPhySapUser * m_enbPhySapUser
Definition: lte-enb-phy.h:292
std::vector< int > m_listOfDownlinkSubchannel
Definition: lte-enb-phy.h:285
double GetNoiseFigure() const
Definition: lte-enb-phy.cc:291
void CreateSrsReport(uint16_t rnti, double srs)
Definition: lte-enb-phy.cc:897
void SetMacChDelay(uint8_t delay)
Definition: lte-enb-phy.cc:298
static TypeId GetTypeId(void)
Definition: lte-enb-phy.cc:153
virtual void GenerateCtrlCqiReport(const SpectrumValue &sinr)
generate a CQI report based on the given SINR of Ctrl frame
Definition: lte-enb-phy.cc:748
LteEnbCphySapProvider * m_enbCphySapProvider
Definition: lte-enb-phy.h:294
void DoSetMasterInformationBlock(LteRrcSap::MasterInformationBlock mib)
Definition: lte-enb-phy.cc:985
virtual void DoInitialize(void)
This method is called only once by Object::Initialize.
Definition: lte-enb-phy.cc:234
virtual void GenerateDataCqiReport(const SpectrumValue &sinr)
generate a CQI report based on the given SINR of Data frame (used for PUSCH CQIs) ...
Definition: lte-enb-phy.cc:760
Ptr< LteHarqPhy > m_harqPhyModule
Definition: lte-enb-phy.h:309
Ptr< LteSpectrumPhy > GetDlSpectrumPhy() const
Definition: lte-enb-phy.cc:325
std::map< uint16_t, uint16_t > m_srsSampleCounterMap
Definition: lte-enb-phy.h:317
virtual void ReceiveLteUlHarqFeedback(UlInfoListElement_s mes)
PhySpectrum generated a new UL HARQ feedback.
Ptr< SampleEmitter > s
void SetHarqPhyModule(Ptr< LteHarqPhy > harq)
uint16_t m_interferenceSamplePeriod
Definition: lte-enb-phy.h:325
virtual void ReceiveLteControlMessage(Ptr< LteControlMessage > msg)
Receive the control message.
Definition: lte-enb-phy.cc:440
void StartSubFrame(void)
Start a LTE sub frame.
Definition: lte-enb-phy.cc:524
bool AddUePhy(uint16_t rnti)
Definition: lte-enb-phy.cc:337
#define list
virtual void ReportInterference(const SpectrumValue &interf)
generate a report based on the linear interference and noise power perceived during DATA frame NOTE: ...
Definition: lte-enb-phy.cc:768
void DoSetBandwidth(uint8_t ulBandwidth, uint8_t dlBandwidth)
Definition: lte-enb-phy.cc:811
void SendControlChannels(std::list< Ptr< LteControlMessage > > ctrlMsgList)
Send the PDCCH and PCFICH in the first 3 symbols.
Definition: lte-enb-phy.cc:691
double GetTxPower() const
Definition: lte-enb-phy.cc:277
LteEnbPhySapProvider * GetLteEnbPhySapProvider()
Get the PHY SAP provider.
Definition: lte-enb-phy.cc:250
LteRrcSap::MasterInformationBlock m_mib
Definition: lte-enb-phy.h:306
void DoRemoveUe(uint16_t rnti)
Definition: lte-enb-phy.cc:852
LteEnbPhySapProvider * m_enbPhySapProvider
Definition: lte-enb-phy.h:291
uint16_t m_currentSrsOffset
Definition: lte-enb-phy.h:304
void SetTxPower(double pow)
Definition: lte-enb-phy.cc:270
void DoAddUe(uint16_t rnti)
Definition: lte-enb-phy.cc:843
LteEnbCphySapProvider * GetLteEnbCphySapProvider()
Get the CPHY SAP provider.
Definition: lte-enb-phy.cc:263
FfMacSchedSapProvider::SchedUlCqiInfoReqParameters CreatePuschCqiReport(const SpectrumValue &sinr)
Create the UL CQI feedback from SINR values perceived at the physical layer with the PUSCH signal rec...
Definition: lte-enb-phy.cc:789
LteEnbCphySapUser * m_enbCphySapUser
Definition: lte-enb-phy.h:295
uint8_t DoGetMacChTtiDelay()
Definition: lte-enb-phy.cc:382
Parameters of the SCHED_UL_CQI_INFO_REQ primitive.
void DoSetSrsConfigurationIndex(uint16_t rnti, uint16_t srcCi)
Definition: lte-enb-phy.cc:952
void SetNoiseFigure(double pow)
Definition: lte-enb-phy.cc:284
void SetLteEnbPhySapUser(LteEnbPhySapUser *s)
Set the PHY SAP User.
Definition: lte-enb-phy.cc:244
void StartFrame(void)
Start a LTE frame.
Definition: lte-enb-phy.cc:505
std::vector< int > GetDownlinkSubChannels(void)
Definition: lte-enb-phy.cc:405
std::vector< uint16_t > m_srsUeOffset
Definition: lte-enb-phy.h:303
void DoSetTransmissionMode(uint16_t rnti, uint8_t txMode)
Definition: lte-enb-phy.cc:916
FfMacSchedSapProvider::SchedUlCqiInfoReqParameters CreateSrsCqiReport(const SpectrumValue &sinr)
Create the UL CQI feedback from SINR values perceived at the physical layer with the SRS signal recei...
Definition: lte-enb-phy.cc:862
void QueueUlDci(UlDciLteControlMessage m)
Definition: lte-enb-phy.cc:923
LteRrcSap::SystemInformationBlockType1 m_sib1
Definition: lte-enb-phy.h:307
LteEnbPhy models the physical layer for the eNodeB.
Definition: lte-enb-phy.h:47
Service Access Point (SAP) offered by the UE PHY to the UE RRC for control purposes.
TracedCallback< uint16_t, Ptr< SpectrumValue > > m_reportInterferenceTrace
Trace reporting the interference per PHY RB (TS 36.214 section 5.2.2, measured on DATA) uint16_t cell...
Definition: lte-enb-phy.h:324
void SendDataChannels(Ptr< PacketBurst > pb)
Send the PDSCH.
Definition: lte-enb-phy.cc:712
Set of values corresponding to a given SpectrumModel.
virtual void DoDispose(void)
This method is called by Object::Dispose or by the object's destructor, whichever comes first...
Definition: lte-enb-phy.cc:223
void PhyPduReceived(Ptr< Packet > p)
PhySpectrum received a new PHY-PDU.
Definition: lte-enb-phy.cc:389
std::set< uint16_t > m_ueAttached
Definition: lte-enb-phy.h:283
Ptr< LteSpectrumPhy > GetUlSpectrumPhy() const
Definition: lte-enb-phy.cc:331
a unique identifier for an interface.
Definition: type-id.h:49
uint8_t GetMacChDelay(void) const
Definition: lte-enb-phy.cc:319
void SetLteEnbCphySapUser(LteEnbCphySapUser *s)
Set the CPHY SAP User.
Definition: lte-enb-phy.cc:256
The LtePhy models the physical layer of LTE.
Definition: lte-phy.h:52
TracedCallback< PhyTransmissionStatParameters > m_dlPhyTransmission
Trace information regarding PHY stats from UL Tx perspective PhyTrasmissionStatParameters see lte-com...
Definition: lte-enb-phy.h:332
uint16_t m_srsPeriodicity
Definition: lte-enb-phy.h:300
void EndFrame(void)
End a LTE frame.
Definition: lte-enb-phy.cc:740
void DoSendMacPdu(Ptr< Packet > p)
Queue the MAC PDU to be sent (according to m_macChTtiDelay)
Definition: lte-enb-phy.cc:375
void EndSubFrame(void)
End a LTE sub frame.
Definition: lte-enb-phy.cc:725