A Discrete-Event Network Simulator
API
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 {
53 
54 public:
58  LteEnbPhy ();
59 
66 
67  virtual ~LteEnbPhy ();
68 
73  static TypeId GetTypeId (void);
74  // inherited from Object
75  virtual void DoInitialize (void);
76  virtual void DoDispose (void);
77 
78 
84 
90 
96 
102 
106  void SetTxPower (double pow);
107 
111  double GetTxPower () const;
112 
116  int8_t DoGetReferenceSignalPower () const;
117 
121  void SetNoiseFigure (double pow);
122 
126  double GetNoiseFigure () const;
127 
131  void SetMacChDelay (uint8_t delay);
132 
136  uint8_t GetMacChDelay (void) const;
137 
142 
147 
148 
157  void SetDownlinkSubChannels (std::vector<int> mask );
158 
168  void SetDownlinkSubChannelsWithPowerAllocation (std::vector<int> mask);
176  std::vector<int> GetDownlinkSubChannels (void);
177 
178 
186  void GeneratePowerAllocationMap (uint16_t rnti, int rbId);
187 
193 
199 
205  void CalcChannelQualityForUe (std::vector <double> sinr, Ptr<LteSpectrumPhy> ue);
206 
212 
220 
228 
234 
240 
245 
249  std::list<UlDciLteControlMessage> DequeueUlDci (void);
250 
251 
255  void StartFrame (void);
259  void StartSubFrame (void);
263  void EndSubFrame (void);
267  void EndFrame (void);
268 
273  void PhyPduReceived (Ptr<Packet> p);
274 
280 
281  // inherited from LtePhy
282  virtual void GenerateCtrlCqiReport (const SpectrumValue& sinr);
283  virtual void GenerateDataCqiReport (const SpectrumValue& sinr);
284  virtual void ReportInterference (const SpectrumValue& interf);
285  virtual void ReportRsReceivedPower (const SpectrumValue& power);
286 
287 
288 
294  virtual void ReportUlHarqFeedback (UlInfoListElement_s mes);
295 
301  void SetHarqPhyModule (Ptr<LteHarqPhy> harq);
302 
310  typedef void (* ReportUeSinrTracedCallback)
311  (uint16_t cellId, uint16_t rnti, double sinrLinear, uint8_t componentCarrierId);
312 
322  (uint16_t cellId, Ptr<SpectrumValue> spectrumValue);
323 
324 private:
325 
326  // LteEnbCphySapProvider forwarded methods
333  void DoSetBandwidth (uint16_t ulBandwidth, uint16_t dlBandwidth);
340  void DoSetEarfcn (uint32_t dlEarfcn, uint32_t ulEarfcn);
346  void DoAddUe (uint16_t rnti);
352  void DoRemoveUe (uint16_t rnti);
359  void DoSetPa (uint16_t rnti, double pa);
366  void DoSetTransmissionMode (uint16_t rnti, uint8_t txMode);
373  void DoSetSrsConfigurationIndex (uint16_t rnti, uint16_t srcCi);
386 
387  // LteEnbPhySapProvider forwarded methods
388  void DoSendMacPdu (Ptr<Packet> p);
400  uint8_t DoGetMacChTtiDelay ();
401 
407  bool AddUePhy (uint16_t rnti);
413  bool DeleteUePhy (uint16_t rnti);
414 
421  void CreateSrsReport (uint16_t rnti, double srs);
422 
427  std::set <uint16_t> m_ueAttached;
428 
429 
431  std::map <uint16_t,double> m_paMap;
432 
434  std::map <int, double> m_dlPowerAllocationMap;
435 
442  std::vector <int> m_listOfDownlinkSubchannel;
443 
444  std::vector <int> m_dlDataRbMap;
445 
447  std::vector< std::list<UlDciLteControlMessage> > m_ulDciQueue;
448 
451 
454 
459  uint32_t m_nrFrames;
465  uint32_t m_nrSubFrames;
466 
467  uint16_t m_srsPeriodicity;
469  std::map <uint16_t,uint16_t> m_srsCounter;
470  std::vector <uint16_t> m_srsUeOffset;
472 
484 
486 
497  std::map <uint16_t,uint16_t> m_srsSampleCounterMap;
498 
514 
521 
522 }; // end of `class LteEnbPhy`
523 
524 
525 }
526 
527 #endif /* LTE_ENB_PHY_H */
Service Access Point (SAP) offered by the UE PHY to the UE RRC for control purposes.
Service Access Point (SAP) offered by the UE PHY to the UE RRC for control purposes.
LteEnbPhy models the physical layer for the eNodeB.
Definition: lte-enb-phy.h:48
uint16_t m_srsPeriodicity
SRS periodicity.
Definition: lte-enb-phy.h:467
double GetTxPower() const
Definition: lte-enb-phy.cc:315
Time m_srsStartTime
SRS start time.
Definition: lte-enb-phy.h:468
virtual ~LteEnbPhy()
Definition: lte-enb-phy.cc:246
int8_t DoGetReferenceSignalPower() const
Definition: lte-enb-phy.cc:322
void CreateSrsReport(uint16_t rnti, double srs)
Create SRS report function.
uint16_t m_interferenceSamplePeriod
The InterferenceSamplePeriod attribute.
Definition: lte-enb-phy.h:512
virtual void ReportUlHarqFeedback(UlInfoListElement_s mes)
Report the uplink HARQ feedback generated by LteSpectrumPhy to MAC.
virtual void DoDispose(void)
Destructor implementation.
Definition: lte-enb-phy.cc:250
uint16_t m_srsSamplePeriod
The UeSinrSamplePeriod trace source.
Definition: lte-enb-phy.h:496
void SetLteEnbCphySapUser(LteEnbCphySapUser *s)
Set the CPHY SAP User.
Definition: lte-enb-phy.cc:294
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:871
uint32_t m_nrSubFrames
The subframe number currently served.
Definition: lte-enb-phy.h:465
std::set< uint16_t > m_ueAttached
List of RNTI of attached UEs.
Definition: lte-enb-phy.h:427
LteEnbPhySapProvider * GetLteEnbPhySapProvider()
Get the PHY SAP provider.
Definition: lte-enb-phy.cc:288
void SetLteEnbPhySapUser(LteEnbPhySapUser *s)
Set the PHY SAP User.
Definition: lte-enb-phy.cc:282
uint8_t GetMacChDelay(void) const
Definition: lte-enb-phy.cc:364
void DoSetMasterInformationBlock(LteRrcSap::MasterInformationBlock mib)
Set master information block.
bool DeleteUePhy(uint16_t rnti)
Remove the given RNTI from the list of attached UE m_ueAttached.
Definition: lte-enb-phy.cc:400
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:863
double GetNoiseFigure() const
Definition: lte-enb-phy.cc:336
void SetTxPower(double pow)
Definition: lte-enb-phy.cc:308
std::vector< int > m_dlDataRbMap
DL data RB map.
Definition: lte-enb-phy.h:444
virtual void DoInitialize(void)
Initialize() implementation.
Definition: lte-enb-phy.cc:261
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:850
TracedCallback< uint16_t, uint16_t, double, uint8_t > m_reportUeSinr
The ReportUeSinr trace source.
Definition: lte-enb-phy.h:491
Ptr< LteSpectrumPhy > GetDlSpectrumPhy() const
Definition: lte-enb-phy.cc:370
void SendDataChannels(Ptr< PacketBurst > pb)
Send the PDSCH.
Definition: lte-enb-phy.cc:794
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:842
void DoSetSrsConfigurationIndex(uint16_t rnti, uint16_t srcCi)
Set source configuration index.
std::list< UlDciLteControlMessage > DequeueUlDci(void)
std::vector< std::list< UlDciLteControlMessage > > m_ulDciQueue
For storing info on future receptions.
Definition: lte-enb-phy.h:447
void PhyPduReceived(Ptr< Packet > p)
PhySpectrum received a new PHY-PDU.
Definition: lte-enb-phy.cc:434
void(* ReportUeSinrTracedCallback)(uint16_t cellId, uint16_t rnti, double sinrLinear, uint8_t componentCarrierId)
TracedCallback signature for the linear average of SRS SINRs.
Definition: lte-enb-phy.h:311
FfMacSchedSapProvider::SchedUlCqiInfoReqParameters CreateSrsCqiReport(const SpectrumValue &sinr)
Create the UL CQI feedback from SINR values perceived at the physical layer with the SRS signal recei...
LteEnbPhySapUser * m_enbPhySapUser
ENB Phy SAP user.
Definition: lte-enb-phy.h:450
void CalcChannelQualityForUe(std::vector< double > sinr, Ptr< LteSpectrumPhy > ue)
Calculate the channel quality for a given UE.
Definition: lte-enb-phy.cc:502
void DoSetPa(uint16_t rnti, double pa)
Set PA.
uint16_t m_currentSrsOffset
current SRS offset
Definition: lte-enb-phy.h:471
void DoSetEarfcn(uint32_t dlEarfcn, uint32_t ulEarfcn)
Set EARFCN.
Definition: lte-enb-phy.cc:916
void DoSetTransmissionMode(uint16_t rnti, uint8_t txMode)
Set transmission mode.
LteEnbPhySapProvider * m_enbPhySapProvider
ENB Phy SAP provider.
Definition: lte-enb-phy.h:449
uint8_t DoGetMacChTtiDelay()
Get MAC ch TTI delay function.
Definition: lte-enb-phy.cc:427
std::map< int, double > m_dlPowerAllocationMap
DL power allocation map.
Definition: lte-enb-phy.h:434
void StartFrame(void)
Start a LTE frame.
Definition: lte-enb-phy.cc:584
std::vector< int > m_listOfDownlinkSubchannel
A vector of integers, if the i-th value is j it means that the j-th resource block is used for transm...
Definition: lte-enb-phy.h:442
void GeneratePowerAllocationMap(uint16_t rnti, int rbId)
Generate power allocation map (i.e.
Definition: lte-enb-phy.cc:466
void QueueUlDci(UlDciLteControlMessage m)
void SetNoiseFigure(double pow)
Definition: lte-enb-phy.cc:329
void SetMacChDelay(uint8_t delay)
Definition: lte-enb-phy.cc:343
void SetHarqPhyModule(Ptr< LteHarqPhy > harq)
Set the HARQ Phy module.
std::vector< int > GetDownlinkSubChannels(void)
Definition: lte-enb-phy.cc:459
virtual void ReceiveLteControlMessageList(std::list< Ptr< LteControlMessage > > msgList)
PhySpectrum received a new list of LteControlMessage.
Definition: lte-enb-phy.cc:527
void SendControlChannels(std::list< Ptr< LteControlMessage > > ctrlMsgList)
Send the PDCCH and PCFICH in the first 3 symbols.
Definition: lte-enb-phy.cc:773
std::map< uint16_t, double > m_paMap
P_A per UE RNTI.
Definition: lte-enb-phy.h:431
void DoRemoveUe(uint16_t rnti)
Remove UE.
Definition: lte-enb-phy.cc:937
void SetDownlinkSubChannelsWithPowerAllocation(std::vector< int > mask)
set the resource blocks (a.k.a.
Definition: lte-enb-phy.cc:450
LteRrcSap::MasterInformationBlock m_mib
The Master Information Block message to be broadcasted every frame.
Definition: lte-enb-phy.h:477
std::map< uint16_t, uint16_t > m_srsSampleCounterMap
SRS sample counter map.
Definition: lte-enb-phy.h:497
TracedCallback< uint16_t, Ptr< SpectrumValue > > m_reportInterferenceTrace
The ReportInterference trace source.
Definition: lte-enb-phy.h:506
Ptr< LteSpectrumPhy > GetUlSpectrumPhy() const
Definition: lte-enb-phy.cc:376
void DoAddUe(uint16_t rnti)
Add UE.
Definition: lte-enb-phy.cc:925
void StartSubFrame(void)
Start a LTE sub frame.
Definition: lte-enb-phy.cc:603
void DoSetSystemInformationBlockType1(LteRrcSap::SystemInformationBlockType1 sib1)
Set system information block.
virtual Ptr< SpectrumValue > CreateTxPowerSpectralDensity()
Create the PSD for TX.
Definition: lte-enb-phy.cc:481
void DoSendLteControlMessage(Ptr< LteControlMessage > msg)
Send LTE Control Message function.
Definition: lte-enb-phy.cc:509
virtual Ptr< SpectrumValue > CreateTxPowerSpectralDensityWithPowerAllocation()
Create the PSD for TX with power allocation for each RB.
Definition: lte-enb-phy.cc:491
bool AddUePhy(uint16_t rnti)
Add the given RNTI to the list of attached UE m_ueAttached.
Definition: lte-enb-phy.cc:382
virtual void GenerateCtrlCqiReport(const SpectrumValue &sinr)
generate a CQI report based on the given SINR of Ctrl frame
Definition: lte-enb-phy.cc:830
static TypeId GetTypeId(void)
Get the type ID.
Definition: lte-enb-phy.cc:171
void EndSubFrame(void)
End a LTE sub frame.
Definition: lte-enb-phy.cc:807
LteRrcSap::SystemInformationBlockType1 m_sib1
The System Information Block Type 1 message to be broadcasted.
Definition: lte-enb-phy.h:483
void DoSetBandwidth(uint16_t ulBandwidth, uint16_t dlBandwidth)
Set bandwidth function.
Definition: lte-enb-phy.cc:893
void EndFrame(void)
End a LTE frame.
Definition: lte-enb-phy.cc:822
LteEnbCphySapUser * m_enbCphySapUser
ENB CPhy SAP user.
Definition: lte-enb-phy.h:453
uint16_t m_interferenceSampleCounter
interference sample counter
Definition: lte-enb-phy.h:513
void SetDownlinkSubChannels(std::vector< int > mask)
set the resource blocks (a.k.a.
Definition: lte-enb-phy.cc:441
virtual void ReceiveLteControlMessage(Ptr< LteControlMessage > msg)
Receive the control message.
Definition: lte-enb-phy.cc:519
void DoSendMacPdu(Ptr< Packet > p)
Queue the MAC PDU to be sent (according to m_macChTtiDelay)
Definition: lte-enb-phy.cc:420
uint32_t m_nrFrames
The frame number currently served.
Definition: lte-enb-phy.h:459
LteEnbCphySapProvider * m_enbCphySapProvider
ENB CPhy SAP provider.
Definition: lte-enb-phy.h:452
std::vector< uint16_t > m_srsUeOffset
SRS UE offset.
Definition: lte-enb-phy.h:470
LteEnbCphySapProvider * GetLteEnbCphySapProvider()
Get the CPHY SAP provider.
Definition: lte-enb-phy.cc:301
TracedCallback< PhyTransmissionStatParameters > m_dlPhyTransmission
The DlPhyTransmission trace source.
Definition: lte-enb-phy.h:520
Ptr< LteHarqPhy > m_harqPhyModule
HARQ Phy module.
Definition: lte-enb-phy.h:485
std::map< uint16_t, uint16_t > m_srsCounter
SRS counter.
Definition: lte-enb-phy.h:469
void(* ReportInterferenceTracedCallback)(uint16_t cellId, Ptr< SpectrumValue > spectrumValue)
TracedCallback signature for the linear average of SRS SINRs.
Definition: lte-enb-phy.h:322
Service Access Point (SAP) offered by the eNB-PHY to the eNB-MAC.
Service Access Point (SAP) offered by the eNB-PHY to the eNB-MAC.
The LtePhy models the physical layer of LTE.
Definition: lte-phy.h:53
Template for the implementation of the LteEnbCphySapProvider as a member of an owner class of type C ...
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:74
Set of values corresponding to a given SpectrumModel.
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:103
a unique identifier for an interface.
Definition: type-id.h:59
The Uplink Data Control Indicator messages defines the RB allocation for the users in the uplink.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
#define list
Parameters of the SCHED_UL_CQI_INFO_REQ primitive.
MasterInformationBlock structure.
Definition: lte-rrc-sap.h:588
SystemInformationBlockType1 structure.
Definition: lte-rrc-sap.h:595
See section 4.3.12 ulInfoListElement.