22 #include <ns3/object-factory.h> 
   26 #include <ns3/simulator.h> 
   27 #include <ns3/attribute-accessor-helper.h> 
   28 #include <ns3/double.h> 
   39 #include <ns3/lte-common.h> 
   40 #include <ns3/lte-vendor-specific-parameters.h> 
   43 #include <ns3/node-list.h> 
   45 #include <ns3/lte-ue-net-device.h> 
   46 #include <ns3/pointer.h> 
   74   virtual void SetBandwidth (uint8_t ulBandwidth, uint8_t dlBandwidth);
 
  135     m_enbCphySapUser (0),
 
  138     m_srsPeriodicity (0),
 
  139     m_srsStartTime (Seconds (0)),
 
  140     m_currentSrsOffset (0),
 
  141     m_interferenceSampleCounter (0)
 
  156     .AddConstructor<LteEnbPhy> ()
 
  157     .AddAttribute (
"TxPower",
 
  158                    "Transmission power in dBm",
 
  162                    MakeDoubleChecker<double> ())
 
  163     .AddAttribute (
"NoiseFigure",
 
  164                    "Loss (dB) in the Signal-to-Noise-Ratio due to non-idealities in the receiver." 
  165                    " According to Wikipedia (http://en.wikipedia.org/wiki/Noise_figure), this is " 
  166                    "\"the difference in decibels (dB) between" 
  167                    " the noise output of the actual receiver to the noise output of an " 
  168                    " ideal receiver with the same overall gain and bandwidth when the receivers " 
  169                    " are connected to sources at the standard noise temperature T0.\" " 
  170                    "In this model, we consider T0 = 290K.",
 
  174                    MakeDoubleChecker<double> ())
 
  175     .AddAttribute (
"MacToChannelDelay",
 
  176                    "The delay in TTI units that occurs between a scheduling decision in the MAC and the actual start of the transmission by the PHY. This is intended to be used to model the latency of real PHY and MAC implementations.",
 
  180                    MakeUintegerChecker<uint8_t> ())
 
  181     .AddTraceSource (
"ReportUeSinr",
 
  182                      "Report UEs' averaged linear SINR",
 
  184     .AddAttribute (
"UeSinrSamplePeriod",
 
  185                    "The sampling period for reporting UEs' SINR stats (default value 1)",
 
  188                    MakeUintegerChecker<uint16_t> ())
 
  189     .AddTraceSource (
"ReportInterference",
 
  190                      "Report linear interference power per PHY RB",
 
  192     .AddAttribute (
"InterferenceSamplePeriod",
 
  193                    "The sampling period for reporting interference stats (default value 1)",
 
  196                    MakeUintegerChecker<uint16_t> ())
 
  197     .AddTraceSource (
"DlPhyTransmission",
 
  198                      "DL transmission PHY layer statistics.",
 
  200     .AddAttribute (
"DlSpectrumPhy",
 
  201                    "The downlink LteSpectrumPhy associated to this LtePhy",
 
  205                    MakePointerChecker <LteSpectrumPhy> ())
 
  206     .AddAttribute (
"UlSpectrumPhy",
 
  207                    "The uplink LteSpectrumPhy associated to this LtePhy",
 
  211                    MakePointerChecker <LteSpectrumPhy> ())
 
  305       std::list<Ptr<LteControlMessage> > l;
 
  307       std::list<UlDciLteControlMessage> l1;
 
  312       std::list<UlDciLteControlMessage> l1;
 
  339   std::set <uint16_t>::iterator it;
 
  357   std::set <uint16_t>::iterator it;
 
  450   std::list<Ptr<LteControlMessage> >::iterator it;
 
  451   for (it = msgList.begin (); it != msgList.end(); it++)
 
  453       switch ((*it)->GetMessageType ())
 
  515   mibMsg->SetMib (
m_mib);
 
  554   std::list<UlDciLteControlMessage> uldcilist = 
DequeueUlDci ();
 
  555   std::list<UlDciLteControlMessage>::iterator dciIt = uldcilist.begin ();
 
  556   NS_LOG_DEBUG (
this << 
" eNB Expected TBs " << uldcilist.size ());
 
  557   for (dciIt = uldcilist.begin (); dciIt!=uldcilist.end (); dciIt++)
 
  559       std::set <uint16_t>::iterator it2;
 
  570           std::vector <int> rbMap;
 
  571           for (
int i = (*dciIt).GetDci ().m_rbStart; i < (*dciIt).GetDci ().m_rbStart + (*dciIt).GetDci ().m_rbLen; i++)
 
  575           m_uplinkSpectrumPhy->AddExpectedTb ((*dciIt).GetDci ().m_rnti, (*dciIt).GetDci ().m_ndi, (*dciIt).GetDci ().m_tbSize, (*dciIt).GetDci ().m_mcs, rbMap, 0 , 0 , 0 , 
false );
 
  576           if ((*dciIt).GetDci ().m_ndi==1)
 
  578               NS_LOG_DEBUG (
this << 
" RNTI " << (*dciIt).GetDci ().m_rnti << 
" NEW TB");
 
  582               NS_LOG_DEBUG (
this << 
" RNTI " << (*dciIt).GetDci ().m_rnti << 
" HARQ RETX");
 
  590   if (ctrlMsg.size () > 0)
 
  592       std::list<Ptr<LteControlMessage> >::iterator it;
 
  593       it = ctrlMsg.begin ();
 
  594       while (it != ctrlMsg.end ())
 
  603               for (
int i = 0; i < 32; i++)
 
  605                   if (((dci->GetDci ().m_rbBitmap & mask) >> i) == 1)
 
  616               for (uint8_t i = 0; i < dci->GetDci ().m_mcs.size (); i++)
 
  622                   params.
m_rnti = dci->GetDci ().m_rnti;
 
  625                   params.
m_mcs = dci->GetDci ().m_mcs.at (i);
 
  626                   params.
m_size = dci->GetDci ().m_tbsSize.at (i);
 
  627                   params.
m_rv = dci->GetDci ().m_rv.at (i);
 
  628                   params.
m_ndi = dci->GetDci ().m_ndi.at (i);
 
  641               for (std::list<RarLteControlMessage::Rar>::const_iterator it = rarMsg->RarListBegin (); it != rarMsg->RarListEnd (); ++it)
 
  643                   if (it->rarPayload.m_grant.m_ulDelay == 
true)
 
  647                   UlGrant_s ulGrant = it->rarPayload.m_grant;
 
  694   std::vector <int> dlRb;
 
  717   std::list<Ptr<LteControlMessage> > ctrlMsgList;
 
  718   ctrlMsgList.clear ();
 
  775       m_interferenceSampleCounter = 0;
 
  791   Values::const_iterator it;
 
  797       double sinrdb = 10 * std::log10 ((*it));
 
  812   NS_LOG_FUNCTION (
this << (uint32_t) ulBandwidth << (uint32_t) dlBandwidth);
 
  822   for (
int i = 0; i < 4; i++)
 
  824       if (dlBandwidth < Type0AllocationRbg[i])
 
  864   Values::const_iterator it;
 
  871     double sinrdb = 10 * log10 ((*it));
 
  889                    (i > 0) ? (srsSum / i) : DBL_MAX);
 
  928 std::list<UlDciLteControlMessage>
 
  934       std::list<UlDciLteControlMessage> ret = 
m_ulDciQueue.at (0);
 
  936       std::list<UlDciLteControlMessage> l;
 
  943       std::list<UlDciLteControlMessage> l;
 
  945       std::list<UlDciLteControlMessage> emptylist;
 
  969   std::map <uint16_t,uint16_t>::iterator it = 
m_srsCounter.find (rnti);
 
Values::const_iterator ConstValuesEnd() const 
 
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. 
 
uint8_t m_txMode
the transmission Mode 
 
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
 
uint16_t m_interferenceSampleCounter
 
void DoSetCellId(uint16_t cellId)
 
static uint16_t double2fpS11dot3(double val)
 
virtual void SendMacPdu(Ptr< Packet > p)
Send the MAC PDU to the channel. 
 
uint16_t m_srsSamplePeriod
 
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register the class in the ns-3 factory. 
 
void SetDownlinkSubChannels(std::vector< int > mask)
set the resource blocks (a.k.a. 
 
void CalcChannelQualityForUe(std::vector< double > sinr, Ptr< LteSpectrumPhy > ue)
Calculate the channel quality for a given UE. 
 
The Uplink Data Control Indicator messages defines the RB allocation for the users in the uplink...
 
bool DeleteUePhy(uint16_t rnti)
 
std::list< UlDciLteControlMessage > DequeueUlDci(void)
 
std::vector< Ptr< PacketBurst > > m_packetBurstQueue
 
virtual uint8_t GetMacChTtiDelay()
Get the delay from MAC to Channel expressed in TTIs. 
 
virtual void ReceiveLteControlMessageList(std::list< Ptr< LteControlMessage > >)
PhySpectrum received a new list of LteControlMessage. 
 
enum ns3::UlCqi_s::Type_e m_type
 
void DoSendLteControlMessage(Ptr< LteControlMessage > msg)
 
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 ...
 
void DoSetSystemInformationBlockType1(LteRrcSap::SystemInformationBlockType1 sib1)
 
uint16_t GetSrsPeriodicity(uint16_t srcCi) const 
 
double GetTti(void) const 
 
std::vector< uint16_t > m_sinr
 
virtual Ptr< SpectrumValue > CreateTxPowerSpectralDensity()
Create the PSD for TX. 
 
std::vector< std::list< UlDciLteControlMessage > > m_ulDciQueue
 
virtual void SendLteControlMessage(Ptr< LteControlMessage > msg)
Send SendLteControlMessage (PDCCH map, CQI feedbacks) using the ideal control channel. 
 
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name. 
 
Ptr< LteSpectrumPhy > m_downlinkSpectrumPhy
 
See section 4.3.2 ulDciListElement. 
 
TracedCallback< uint16_t, uint16_t, double > m_reportUeSinr
Trace reporting the linear average of SRS SINRs uint16_t cellId, uint16_t rnti, double sinrLinear...
 
See section 4.3.24 cqiListElement. 
 
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO. 
 
#define NS_FATAL_ERROR(msg)
fatal error handling 
 
Service Access Point (SAP) offered by the UE PHY to the UE RRC for control purposes. 
 
EnbMemberLteEnbPhySapProvider(LteEnbPhy *phy)
 
static EventId Schedule(Time const &time, MEM mem_ptr, OBJ obj)
Schedule an event to expire at the relative time "time" is reached. 
 
Service Access Point (SAP) offered by the eNB-PHY to the eNB-MAC. 
 
See section 4.3.12 ulInfoListElement. 
 
uint8_t m_rv
the redundancy version (HARQ) 
 
std::vector< int > m_dlDataRbMap
 
std::map< uint16_t, uint16_t > m_srsCounter
 
Service Access Point (SAP) offered by the eNB-PHY to the eNB-MAC. 
 
void DoSetEarfcn(uint16_t dlEarfcn, uint16_t ulEarfcn)
 
LteEnbPhySapUser * m_enbPhySapUser
 
virtual void ReceiveRachPreamble(uint32_t prachId)=0
notify the reception of a RACH preamble on the PRACH 
 
std::vector< int > m_listOfDownlinkSubchannel
 
double GetNoiseFigure() const 
 
void CreateSrsReport(uint16_t rnti, double srs)
 
static const int Type0AllocationRbg[4]
 
void SetMacChDelay(uint8_t delay)
 
The attribute can be read. 
 
static TypeId GetTypeId(void)
 
virtual void GenerateCtrlCqiReport(const SpectrumValue &sinr)
generate a CQI report based on the given SINR of Ctrl frame 
 
LteEnbCphySapProvider * m_enbCphySapProvider
 
uint16_t GetSrsSubframeOffset(uint16_t srcCi) const 
 
std::vector< struct VendorSpecificListElement_s > m_vendorSpecificList
 
void DoDispose()
This method is called by Object::Dispose or by the object's destructor, whichever comes first...
 
void DoSetMasterInformationBlock(LteRrcSap::MasterInformationBlock mib)
 
virtual void DoInitialize(void)
This method is called only once by Object::Initialize. 
 
virtual void GenerateDataCqiReport(const SpectrumValue &sinr)
generate a CQI report based on the given SINR of Data frame (used for PUSCH CQIs) ...
 
uint8_t GetRbgSize(void) const 
 
Ptr< LteHarqPhy > m_harqPhyModule
 
Ptr< LteSpectrumPhy > GetDlSpectrumPhy() const 
 
uint64_t m_imsi
IMSI of the scheduled UE. 
 
std::map< uint16_t, uint16_t > m_srsSampleCounterMap
 
virtual void ReceiveLteUlHarqFeedback(UlInfoListElement_s mes)
PhySpectrum generated a new UL HARQ feedback. 
 
Hold an unsigned integer type. 
 
virtual void SetBandwidth(uint8_t ulBandwidth, uint8_t dlBandwidth)
 
void SetHarqPhyModule(Ptr< LteHarqPhy > harq)
 
Define the RNTI that has generated the. 
 
uint16_t m_interferenceSamplePeriod
 
virtual void ReceiveLteControlMessage(Ptr< LteControlMessage > msg)
Receive the control message. 
 
void StartSubFrame(void)
Start a LTE sub frame. 
 
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC. 
 
See section 4.3.3 vendorSpecifiListElement. 
 
bool AddUePhy(uint16_t rnti)
 
virtual void ReportInterference(const SpectrumValue &interf)
generate a report based on the linear interference and noise power perceived during DATA frame NOTE: ...
 
See section 4.3.23 dlInfoListElement. 
 
See section 4.3.14 macCEListElement. 
 
void DoSetBandwidth(uint8_t ulBandwidth, uint8_t dlBandwidth)
 
uint8_t m_mcs
MCS for transport block. 
 
Substitutive structure for specifying BuildRarListElement_s::m_grant field. 
 
void SendControlChannels(std::list< Ptr< LteControlMessage > > ctrlMsgList)
Send the PDCCH and PCFICH in the first 3 symbols. 
 
double GetTxPower() const 
 
virtual void UlInfoListElementHarqFeeback(UlInfoListElement_s params)=0
Notify the HARQ on the UL tranmission status. 
 
LteEnbPhySapProvider * GetLteEnbPhySapProvider()
Get the PHY SAP provider. 
 
LteRrcSap::MasterInformationBlock m_mib
 
void DoRemoveUe(uint16_t rnti)
 
void SetControlMessages(Ptr< LteControlMessage > m)
 
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
 
LteEnbPhySapProvider * m_enbPhySapProvider
 
uint16_t m_currentSrsOffset
 
void SetTxPower(double pow)
 
void SetDci(UlDciListElement_s dci)
add a DCI into the message 
 
void DoAddUe(uint16_t rnti)
 
static EventId ScheduleNow(MEM mem_ptr, OBJ obj)
Schedule an event to expire Now. 
 
uint16_t m_size
Size of transport block. 
 
static Time Now(void)
Return the "current simulation time". 
 
virtual void SetCellId(uint16_t cellId)
 
LteEnbCphySapProvider * GetLteEnbCphySapProvider()
Get the CPHY SAP provider. 
 
uint8_t m_ndi
new data indicator flag 
 
FfMacSchedSapProvider::SchedUlCqiInfoReqParameters CreatePuschCqiReport(const SpectrumValue &sinr)
Create the UL CQI feedback from SINR values perceived at the physical layer with the PUSCH signal rec...
 
LteEnbCphySapUser * m_enbCphySapUser
 
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
 
static Ptr< SpectrumValue > CreateTxPowerSpectralDensity(uint16_t earfcn, uint8_t bandwidth, double powerTx, std::vector< int > activeRbs)
create a spectrum value representing the power spectral density of a signal to be transmitted...
 
uint8_t DoGetMacChTtiDelay()
 
friend class EnbMemberLteEnbPhySapProvider
 
std::list< Ptr< LteControlMessage > > GetControlMessages(void)
 
Parameters of the SCHED_UL_CQI_INFO_REQ primitive. 
 
Ptr< PacketBurst > GetPacketBurst(void)
 
void DoSetSrsConfigurationIndex(uint16_t rnti, uint16_t srcCi)
 
uint16_t m_cellId
Cell ID of the attached Enb. 
 
void SetNoiseFigure(double pow)
 
void SetLteEnbPhySapUser(LteEnbPhySapUser *s)
Set the PHY SAP User. 
 
static const Time DL_DATA_DURATION
 
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG. 
 
uint8_t m_layer
the layer (cw) of the transmission 
 
void StartFrame(void)
Start a LTE frame. 
 
std::vector< int > GetDownlinkSubChannels(void)
 
std::vector< uint16_t > m_srsUeOffset
 
void DoSetTransmissionMode(uint16_t rnti, uint8_t txMode)
 
virtual void UlCqiReport(FfMacSchedSapProvider::SchedUlCqiInfoReqParameters ulcqi)=0
Returns to MAC level the UL-CQI evaluated. 
 
FfMacSchedSapProvider::SchedUlCqiInfoReqParameters CreateSrsCqiReport(const SpectrumValue &sinr)
Create the UL CQI feedback from SINR values perceived at the physical layer with the SRS signal recei...
 
void QueueUlDci(UlDciLteControlMessage m)
 
#define NS_LOG_ERROR(msg)
Use NS_LOG to output a message of level LOG_ERROR. 
 
Values::const_iterator ConstValuesBegin() const 
 
LteRrcSap::SystemInformationBlockType1 m_sib1
 
std::vector< std::list< Ptr< LteControlMessage > > > m_controlMessagesQueue
 
LteEnbPhy models the physical layer for the eNodeB. 
 
Ptr< LteSpectrumPhy > m_uplinkSpectrumPhy
 
virtual void SubframeIndication(uint32_t frameNo, uint32_t subframeNo)=0
Trigger the start from a new frame (input from Phy layer) 
 
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...
 
void SendDataChannels(Ptr< PacketBurst > pb)
Send the PDSCH. 
 
virtual void ReceivePhyPdu(Ptr< Packet > p)=0
Called by the Phy to notify the MAC of the reception of a new PHY-PDU. 
 
Hold a floating point type. 
 
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...
 
void PhyPduReceived(Ptr< Packet > p)
PhySpectrum received a new PHY-PDU. 
 
std::set< uint16_t > m_ueAttached
 
Ptr< LteSpectrumPhy > GetUlSpectrumPhy() const 
 
void SetMacPdu(Ptr< Packet > p)
 
a unique identifier for an interface. 
 
uint8_t GetMacChDelay(void) const 
 
int64_t GetMilliSeconds(void) const 
 
TypeId SetParent(TypeId tid)
 
void SetLteEnbCphySapUser(LteEnbCphySapUser *s)
Set the CPHY SAP User. 
 
virtual void DoInitialize(void)
This method is called only once by Object::Initialize. 
 
uint16_t m_rnti
C-RNTI scheduled. 
 
The LtePhy models the physical layer of LTE. 
 
TracedCallback< PhyTransmissionStatParameters > m_dlPhyTransmission
Trace information regarding PHY stats from UL Tx perspective PhyTrasmissionStatParameters see lte-com...
 
static Ptr< SpectrumValue > CreateNoisePowerSpectralDensity(uint16_t earfcn, uint8_t bandwidth, double noiseFigure)
create a SpectrumValue that models the power spectral density of AWGN 
 
#define UL_PUSCH_TTIS_DELAY
 
uint16_t m_srsPeriodicity
 
void EndFrame(void)
End a LTE frame. 
 
void DoSendMacPdu(Ptr< Packet > p)
Queue the MAC PDU to be sent (according to m_macChTtiDelay) 
 
void EndSubFrame(void)
End a LTE sub frame. 
 
virtual void ReceiveLteControlMessage(Ptr< LteControlMessage > msg)=0
Receive SendLteControlMessage (PDCCH map, CQI feedbacks) using the ideal control channel. 
 
static const Time DL_CTRL_DELAY_FROM_SUBFRAME_START