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 
110  int8_t DoGetReferenceSignalPower () const;
111 
115  void SetNoiseFigure (double pow);
116 
120  double GetNoiseFigure () const;
121 
125  void SetMacChDelay (uint8_t delay);
126 
130  uint8_t GetMacChDelay (void) const;
131 
136 
141 
142 
151  void SetDownlinkSubChannels (std::vector<int> mask );
152 
162  void SetDownlinkSubChannelsWithPowerAllocation (std::vector<int> mask);
170  std::vector<int> GetDownlinkSubChannels (void);
171 
172 
180  void GeneratePowerAllocationMap (uint16_t rnti, int rbId);
181 
186 
191 
197  void CalcChannelQualityForUe (std::vector <double> sinr, Ptr<LteSpectrumPhy> ue);
198 
204 
212 
220 
226 
232 
237 
241  std::list<UlDciLteControlMessage> DequeueUlDci (void);
242 
243 
247  void StartFrame (void);
251  void StartSubFrame (void);
255  void EndSubFrame (void);
259  void EndFrame (void);
260 
264  void PhyPduReceived (Ptr<Packet> p);
265 
270 
271  // inherited from LtePhy
272  virtual void GenerateCtrlCqiReport (const SpectrumValue& sinr);
273  virtual void GenerateDataCqiReport (const SpectrumValue& sinr);
274  virtual void ReportInterference (const SpectrumValue& interf);
275  virtual void ReportRsReceivedPower (const SpectrumValue& power);
276 
277 
278 
283 
284  void SetHarqPhyModule (Ptr<LteHarqPhy> harq);
285 
286 
287 private:
288 
289  // LteEnbCphySapProvider forwarded methods
290  void DoSetBandwidth (uint8_t ulBandwidth, uint8_t dlBandwidth);
291  void DoSetEarfcn (uint16_t dlEarfcn, uint16_t ulEarfcn);
292  void DoAddUe (uint16_t rnti);
293  void DoRemoveUe (uint16_t rnti);
294  void DoSetPa (uint16_t rnti, double pa);
295  void DoSetTransmissionMode (uint16_t rnti, uint8_t txMode);
296  void DoSetSrsConfigurationIndex (uint16_t rnti, uint16_t srcCi);
299 
300  // LteEnbPhySapProvider forwarded methods
301  void DoSendMacPdu (Ptr<Packet> p);
303  uint8_t DoGetMacChTtiDelay ();
304 
305  bool AddUePhy (uint16_t rnti);
306 
307  bool DeleteUePhy (uint16_t rnti);
308 
309  void CreateSrsReport (uint16_t rnti, double srs);
310 
311 
312  std::set <uint16_t> m_ueAttached;
313 
314 
315  // P_A per UE RNTI
316  std::map <uint16_t,double> m_paMap;
317 
318  // DL power allocation map
319  std::map <int, double> m_dlPowerAllocationMap;
320 
321  std::vector <int> m_listOfDownlinkSubchannel;
322 
323  std::vector <int> m_dlDataRbMap;
324 
325  std::vector< std::list<UlDciLteControlMessage> > m_ulDciQueue; // for storing info on future receptions
326 
329 
332 
333  uint32_t m_nrFrames;
334  uint32_t m_nrSubFrames;
335 
338  std::map <uint16_t,uint16_t> m_srsCounter;
339  std::vector <uint16_t> m_srsUeOffset;
341 
344 
346 
353  std::map <uint16_t,uint16_t> m_srsSampleCounterMap;
354 
363 
369 
370 };
371 
372 
373 }
374 
375 #endif /* LTE_ENB_PHY_H */
virtual ~LteEnbPhy()
Definition: lte-enb-phy.cc:217
Template for the implementation of the LteEnbCphySapProvider as a member of an owner class of type C ...
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:95
smart pointer class similar to boost::intrusive_ptr
Definition: ptr.h:60
uint16_t m_interferenceSampleCounter
Definition: lte-enb-phy.h:362
uint32_t m_nrSubFrames
Definition: lte-enb-phy.h:334
uint16_t m_srsSamplePeriod
Definition: lte-enb-phy.h:352
void SetDownlinkSubChannels(std::vector< int > mask)
set the resource blocks (a.k.a.
Definition: lte-enb-phy.cc:402
void CalcChannelQualityForUe(std::vector< double > sinr, Ptr< LteSpectrumPhy > ue)
Calculate the channel quality for a given UE.
Definition: lte-enb-phy.cc:463
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:361
std::list< UlDciLteControlMessage > DequeueUlDci(void)
virtual void ReceiveLteControlMessageList(std::list< Ptr< LteControlMessage > >)
PhySpectrum received a new list of LteControlMessage.
Definition: lte-enb-phy.cc:488
void DoSendLteControlMessage(Ptr< LteControlMessage > msg)
Definition: lte-enb-phy.cc:470
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:823
void DoSetSystemInformationBlockType1(LteRrcSap::SystemInformationBlockType1 sib1)
virtual Ptr< SpectrumValue > CreateTxPowerSpectralDensity()
Create the PSD for TX.
Definition: lte-enb-phy.cc:442
std::vector< std::list< UlDciLteControlMessage > > m_ulDciQueue
Definition: lte-enb-phy.h:325
std::map< int, double > m_dlPowerAllocationMap
Definition: lte-enb-phy.h:319
virtual Ptr< SpectrumValue > CreateTxPowerSpectralDensityWithPowerAllocation()
Create the PSD for TX with power allocation for each RB.
Definition: lte-enb-phy.cc:452
std::map< uint16_t, double > m_paMap
Definition: lte-enb-phy.h:316
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:351
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:323
uint32_t m_nrFrames
Definition: lte-enb-phy.h:333
std::map< uint16_t, uint16_t > m_srsCounter
Definition: lte-enb-phy.h:338
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:876
LteEnbPhySapUser * m_enbPhySapUser
Definition: lte-enb-phy.h:328
std::vector< int > m_listOfDownlinkSubchannel
Definition: lte-enb-phy.h:321
double GetNoiseFigure() const
Definition: lte-enb-phy.cc:297
void CreateSrsReport(uint16_t rnti, double srs)
Definition: lte-enb-phy.cc:967
void SetMacChDelay(uint8_t delay)
Definition: lte-enb-phy.cc:304
static TypeId GetTypeId(void)
Definition: lte-enb-phy.cc:152
virtual void GenerateCtrlCqiReport(const SpectrumValue &sinr)
generate a CQI report based on the given SINR of Ctrl frame
Definition: lte-enb-phy.cc:790
LteEnbCphySapProvider * m_enbCphySapProvider
Definition: lte-enb-phy.h:330
void DoSetMasterInformationBlock(LteRrcSap::MasterInformationBlock mib)
virtual void DoInitialize(void)
This method is called only once by Object::Initialize.
Definition: lte-enb-phy.cc:233
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:802
Ptr< LteHarqPhy > m_harqPhyModule
Definition: lte-enb-phy.h:345
Ptr< LteSpectrumPhy > GetDlSpectrumPhy() const
Definition: lte-enb-phy.cc:331
std::map< uint16_t, uint16_t > m_srsSampleCounterMap
Definition: lte-enb-phy.h:353
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:361
virtual void ReceiveLteControlMessage(Ptr< LteControlMessage > msg)
Receive the control message.
Definition: lte-enb-phy.cc:480
void StartSubFrame(void)
Start a LTE sub frame.
Definition: lte-enb-phy.cc:564
bool AddUePhy(uint16_t rnti)
Definition: lte-enb-phy.cc:343
#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:810
void DoSetBandwidth(uint8_t ulBandwidth, uint8_t dlBandwidth)
Definition: lte-enb-phy.cc:853
void SendControlChannels(std::list< Ptr< LteControlMessage > > ctrlMsgList)
Send the PDCCH and PCFICH in the first 3 symbols.
Definition: lte-enb-phy.cc:733
double GetTxPower() const
Definition: lte-enb-phy.cc:276
LteEnbPhySapProvider * GetLteEnbPhySapProvider()
Get the PHY SAP provider.
Definition: lte-enb-phy.cc:249
LteRrcSap::MasterInformationBlock m_mib
Definition: lte-enb-phy.h:342
void DoRemoveUe(uint16_t rnti)
Definition: lte-enb-phy.cc:897
LteEnbPhySapProvider * m_enbPhySapProvider
Definition: lte-enb-phy.h:327
uint16_t m_currentSrsOffset
Definition: lte-enb-phy.h:340
void SetTxPower(double pow)
Definition: lte-enb-phy.cc:269
void DoAddUe(uint16_t rnti)
Definition: lte-enb-phy.cc:885
void SetDownlinkSubChannelsWithPowerAllocation(std::vector< int > mask)
set the resource blocks (a.k.a.
Definition: lte-enb-phy.cc:411
int8_t DoGetReferenceSignalPower() const
Definition: lte-enb-phy.cc:283
LteEnbCphySapProvider * GetLteEnbCphySapProvider()
Get the CPHY SAP provider.
Definition: lte-enb-phy.cc:262
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:831
LteEnbCphySapUser * m_enbCphySapUser
Definition: lte-enb-phy.h:331
uint8_t DoGetMacChTtiDelay()
Definition: lte-enb-phy.cc:388
Parameters of the SCHED_UL_CQI_INFO_REQ primitive.
void DoSetSrsConfigurationIndex(uint16_t rnti, uint16_t srcCi)
void SetNoiseFigure(double pow)
Definition: lte-enb-phy.cc:290
void SetLteEnbPhySapUser(LteEnbPhySapUser *s)
Set the PHY SAP User.
Definition: lte-enb-phy.cc:243
void StartFrame(void)
Start a LTE frame.
Definition: lte-enb-phy.cc:545
std::vector< int > GetDownlinkSubChannels(void)
Definition: lte-enb-phy.cc:420
std::vector< uint16_t > m_srsUeOffset
Definition: lte-enb-phy.h:339
void DoSetTransmissionMode(uint16_t rnti, uint8_t txMode)
Definition: lte-enb-phy.cc:986
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:932
void QueueUlDci(UlDciLteControlMessage m)
Definition: lte-enb-phy.cc:993
void GeneratePowerAllocationMap(uint16_t rnti, int rbId)
Generate power allocation map (i.e.
Definition: lte-enb-phy.cc:427
LteRrcSap::SystemInformationBlockType1 m_sib1
Definition: lte-enb-phy.h:343
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:360
void SendDataChannels(Ptr< PacketBurst > pb)
Send the PDSCH.
Definition: lte-enb-phy.cc:754
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:222
void PhyPduReceived(Ptr< Packet > p)
PhySpectrum received a new PHY-PDU.
Definition: lte-enb-phy.cc:395
std::set< uint16_t > m_ueAttached
Definition: lte-enb-phy.h:312
Ptr< LteSpectrumPhy > GetUlSpectrumPhy() const
Definition: lte-enb-phy.cc:337
a unique identifier for an interface.
Definition: type-id.h:49
uint8_t GetMacChDelay(void) const
Definition: lte-enb-phy.cc:325
void SetLteEnbCphySapUser(LteEnbCphySapUser *s)
Set the CPHY SAP User.
Definition: lte-enb-phy.cc:255
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:368
uint16_t m_srsPeriodicity
Definition: lte-enb-phy.h:336
void EndFrame(void)
End a LTE frame.
Definition: lte-enb-phy.cc:782
void DoSetPa(uint16_t rnti, double pa)
Definition: lte-enb-phy.cc:914
void DoSendMacPdu(Ptr< Packet > p)
Queue the MAC PDU to be sent (according to m_macChTtiDelay)
Definition: lte-enb-phy.cc:381
void EndSubFrame(void)
End a LTE sub frame.
Definition: lte-enb-phy.cc:767