26 #include <ns3/object-factory.h> 31 #include <ns3/simulator.h> 32 #include <ns3/double.h> 43 #include <ns3/lte-common.h> 44 #include <ns3/pointer.h> 45 #include <ns3/boolean.h> 46 #include <ns3/lte-ue-power-control.h> 161 m_state (CELL_SEARCH),
163 m_rsReceivedPowerUpdated (false),
164 m_rsInterferencePowerUpdated (false),
165 m_dataInterferencePowerUpdated (false),
166 m_pssReceived (false),
169 m_rsrpSinrSampleCounter (0),
172 m_amc = CreateObject <LteAmc> ();
179 "Cannot create UE devices after simulation started");
209 .AddAttribute (
"TxPower",
210 "Transmission power in dBm",
214 MakeDoubleChecker<double> ())
215 .AddAttribute (
"NoiseFigure",
216 "Loss (dB) in the Signal-to-Noise-Ratio due to non-idealities in the receiver." 217 " According to Wikipedia (http://en.wikipedia.org/wiki/Noise_figure), this is " 218 "\"the difference in decibels (dB) between" 219 " the noise output of the actual receiver to the noise output of an " 220 " ideal receiver with the same overall gain and bandwidth when the receivers " 221 " are connected to sources at the standard noise temperature T0.\" " 222 "In this model, we consider T0 = 290K.",
226 MakeDoubleChecker<double> ())
227 .AddAttribute (
"TxMode1Gain",
228 "Transmission mode 1 gain in dB",
231 MakeDoubleChecker<double> ())
232 .AddAttribute (
"TxMode2Gain",
233 "Transmission mode 2 gain in dB",
236 MakeDoubleChecker<double> ())
237 .AddAttribute (
"TxMode3Gain",
238 "Transmission mode 3 gain in dB",
241 MakeDoubleChecker<double> ())
242 .AddAttribute (
"TxMode4Gain",
243 "Transmission mode 4 gain in dB",
246 MakeDoubleChecker<double> ())
247 .AddAttribute (
"TxMode5Gain",
248 "Transmission mode 5 gain in dB",
251 MakeDoubleChecker<double> ())
252 .AddAttribute (
"TxMode6Gain",
253 "Transmission mode 6 gain in dB",
256 MakeDoubleChecker<double> ())
257 .AddAttribute (
"TxMode7Gain",
258 "Transmission mode 7 gain in dB",
261 MakeDoubleChecker<double> ())
262 .AddTraceSource (
"ReportCurrentCellRsrpSinr",
263 "RSRP and SINR statistics.",
265 "ns3::LteUePhy::RsrpSinrTracedCallback")
266 .AddAttribute (
"RsrpSinrSamplePeriod",
267 "The sampling period for reporting RSRP-SINR stats (default value 1)",
270 MakeUintegerChecker<uint16_t> ())
271 .AddTraceSource (
"ReportUlPhyResourceBlocks",
272 "UL transmission PHY layer resource blocks.",
274 "ns3::LteUePhy::UlPhyResourceBlocksTracedCallback")
275 .AddTraceSource (
"ReportPowerSpectralDensity",
276 "Power Spectral Density data.",
278 "ns3::LteUePhy::PowerSpectralDensityTracedCallback")
279 .AddTraceSource (
"UlPhyTransmission",
280 "DL transmission PHY layer statistics.",
282 "ns3::PhyTransmissionStatParameters::TracedCallback")
283 .AddAttribute (
"DlSpectrumPhy",
284 "The downlink LteSpectrumPhy associated to this LtePhy",
288 MakePointerChecker <LteSpectrumPhy> ())
289 .AddAttribute (
"UlSpectrumPhy",
290 "The uplink LteSpectrumPhy associated to this LtePhy",
294 MakePointerChecker <LteSpectrumPhy> ())
295 .AddAttribute (
"RsrqUeMeasThreshold",
296 "Receive threshold for PSS on RSRQ [dB]",
299 MakeDoubleChecker<double> ())
300 .AddAttribute (
"UeMeasurementsFilterPeriod",
301 "Time period for reporting UE measurements, i.e., the" 302 "length of layer-1 filtering.",
306 .AddAttribute (
"DownlinkCqiPeriodicity",
307 "Periodicity in milliseconds for reporting the" 308 "wideband and subband downlink CQIs to the eNB",
312 .AddTraceSource (
"ReportUeMeasurements",
313 "Report UE measurements RSRP (dBm) and RSRQ (dB).",
315 "ns3::LteUePhy::RsrpRsrqTracedCallback")
316 .AddTraceSource (
"StateTransition",
317 "Trace fired upon every UE PHY state transition",
319 "ns3::LteUePhy::StateTracedCallback")
320 .AddAttribute (
"EnableUplinkPowerControl",
321 "If true, Uplink Power Control will be enabled.",
325 .AddAttribute (
"Qout",
326 "corresponds to 10% block error rate of a hypothetical PDCCH transmission" 327 "taking into account the PCFICH errors with transmission parameters." 328 "see 3GPP TS 36.213 4.2.1 and TS 36.133 7.6",
331 MakeDoubleChecker<double> ())
332 .AddAttribute (
"Qin",
333 "corresponds to 2% block error rate of a hypothetical PDCCH transmission" 334 "taking into account the PCFICH errors with transmission parameters." 335 "see 3GPP TS 36.213 4.2.1 and TS 36.133 7.6",
338 MakeDoubleChecker<double> ())
339 .AddAttribute (
"NumQoutEvalSf",
340 "This specifies the total number of consecutive subframes" 341 "which corresponds to the Qout evaluation period",
345 MakeUintegerChecker<uint16_t> ())
346 .AddAttribute (
"NumQinEvalSf",
347 "This specifies the total number of consecutive subframes" 348 "which corresponds to the Qin evaluation period",
352 MakeUintegerChecker<uint16_t> ())
353 .AddAttribute (
"EnableRlfDetection",
354 "If true, RLF detection will be enabled.",
369 NS_ABORT_MSG_IF (node ==
nullptr,
"Node is not available in the LteNetDevice of LteUePhy");
370 uint32_t nodeId = node->
GetId ();
467 NS_ABORT_MSG_IF (numSubframes % 10 != 0,
"Number of subframes used for Qout " 468 "evaluation must be multiple of 10");
476 NS_ABORT_MSG_IF (numSubframes % 10 != 0,
"Number of subframes used for Qin " 477 "evaluation must be multiple of 10");
624 Values::const_iterator it;
630 double powerTxW = ((*it) * 180000.0) / 12.0;
634 double rsrp = (rbNum > 0) ? (sum / rbNum) : DBL_MAX;
656 std::list <PssElement>::iterator itPss =
m_pssList.begin ();
660 double rssiSum = 0.0;
670 double interfPlusNoisePowerTxW = ((*itIntN) * 180000.0) / 12.0;
671 double signalPowerTxW = ((*itPj) * 180000.0) / 12.0;
672 rssiSum += (2 * (interfPlusNoisePowerTxW + signalPowerTxW));
676 double rsrq_dB = 10 * log10 ((*itPss).pssPsdSum / rssiSum);
681 <<
" has RSRQ " << rsrq_dB <<
" and RBnum " << rbNum);
683 std::map <uint16_t, UeMeasurementsElement>::iterator itMeasMap;
687 (*itMeasMap).second.rsrqSum += rsrq_dB;
688 (*itMeasMap).second.rsrqNum++;
692 NS_LOG_WARN (
"race condition of bug 2091 occurred");
714 Values::const_iterator it;
722 double avrgSinr = (rbNum > 0) ? (sum / rbNum) : DBL_MAX;
766 NS_LOG_LOGIC (
"data interf measurement available, SINR = " << mixedSinr);
772 mixedSinr /= (*m_noisePsd);
773 NS_LOG_LOGIC (
"no data interf measurement available, SINR = " << mixedSinr);
783 double avgMixedSinr = 0;
784 uint32_t usedRbgNum = 0;
788 avgMixedSinr+=mixedSinr[i];
790 avgMixedSinr = avgMixedSinr/usedRbgNum;
791 for(uint32_t i = 0; i < modulo; i++)
827 Values::const_iterator it;
830 double powerTxW = ((*it) * 180000);
834 double rsrp = 10 * log10 (sum) + 30;
855 std::vector<int> cqi;
861 int nbSubChannels = cqi.size ();
863 int activeSubChannels = 0;
865 for (
int i = 0; i < nbSubChannels; i++)
867 if (cqi.at (i) != -1)
869 cqiSum += cqi.at (i);
872 NS_LOG_DEBUG (
this <<
" subch " << i <<
" cqi " << cqi.at (i));
879 for (
int i = 0; i < nLayer; i++)
881 if (activeSubChannels > 0)
883 dlcqi.m_wbCqi.push_back ((uint16_t) cqiSum / activeSubChannels);
888 dlcqi.m_wbCqi.push_back (1);
899 int nbSubChannels = cqi.size ();
905 for (
int i = 0; i < nbSubChannels; i++)
907 if (cqi.at (i) != -1)
909 cqiSum += cqi.at (i);
913 if (cqiNum == rbgSize)
919 for (
int i = 0; i < nLayer; i++)
921 hlCqi.
m_sbCqi.push_back ((uint16_t) cqiSum / rbgSize);
933 dlcqi.m_sbMeasResult = rbgMeas;
936 msg->SetDlCqi (dlcqi);
949 std::map <uint16_t, UeMeasurementsElement>::iterator it;
952 double avg_rsrp = (*it).second.rsrpSum / (double)(*it).second.rsrpNum;
953 double avg_rsrq = (*it).second.rsrqSum / (
double)(*it).second.rsrqNum;
960 <<
" RSRP " << avg_rsrp
961 <<
" (nSamples " << (uint16_t)(*it).second.rsrpNum <<
")" 962 <<
" RSRQ " << avg_rsrq
963 <<
" (nSamples " << (uint16_t)(*it).second.rsrqNum <<
")" 1007 msg->SetRapId (raPreambleId);
1036 std::list<Ptr<LteControlMessage> >::iterator it;
1037 NS_LOG_DEBUG (
this <<
" I am rnti = " <<
m_rnti <<
" and I received msgs " << (uint16_t) msgList.size ());
1038 for (it = msgList.begin (); it != msgList.end (); it++)
1047 if (dci.m_rnti !=
m_rnti)
1053 if (dci.m_resAlloc != 0)
1058 std::vector <int> dlRb;
1061 uint32_t mask = 0x1;
1062 for (
int i = 0; i < 32; i++)
1064 if (((dci.m_rbBitmap & mask) >> i) == 1)
1081 NS_LOG_DEBUG (
this <<
" UE " <<
m_rnti <<
" DL-DCI " << dci.m_rnti <<
" bitmap " << dci.m_rbBitmap);
1082 for (uint8_t i = 0; i < dci.m_tbsSize.size (); i++)
1084 m_downlinkSpectrumPhy->AddExpectedTb (dci.m_rnti, dci.m_ndi.at (i), dci.m_tbsSize.at (i), dci.m_mcs.at (i), dlRb, i, dci.m_harqProcess, dci.m_rv.at (i),
true );
1096 if (dci.m_rnti !=
m_rnti)
1102 std::vector <int> ulRb;
1103 for (
int i = 0; i < dci.m_rbLen; i++)
1105 ulRb.push_back (i + dci.m_rbStart);
1119 params.
m_mcs = dci.m_mcs;
1120 params.
m_size = dci.m_tbSize;
1121 params.
m_rv = harqInfoList.size ();
1122 params.
m_ndi = dci.m_ndi;
1131 if (rarMsg->GetRaRnti () ==
m_raRnti)
1133 for (std::list<RarLteControlMessage::Rar>::const_iterator it = rarMsg->RarListBegin (); it != rarMsg->RarListEnd (); ++it)
1144 std::vector <int> ulRb;
1145 for (
int i = 0; i < it->rarPayload.m_grant.m_rbLen; i++)
1147 ulRb.push_back (i + it->rarPayload.m_grant.m_rbStart);
1193 Values::const_iterator itPi;
1197 double powerTxW = ((*itPi) * 180000.0) / 12.0;
1203 double rsrp_dBm = 10 * log10 (1000 * (sum / (
double)nRB));
1205 <<
" has RSRP " << rsrp_dBm <<
" and RBnum " << nRB);
1209 std::map <uint16_t, UeMeasurementsElement>::iterator itMeasMap =
m_ueMeasurementsMap.find (cellId);
1222 (*itMeasMap).second.rsrpSum += rsrp_dBm;
1223 (*itMeasMap).second.rsrpNum++;
1252 NS_ASSERT_MSG (frameNo > 0,
"the SRS index check code assumes that frameNo starts at 1");
1275 NS_ASSERT_MSG (subframeNo > 0 && subframeNo <= 10,
"the SRS index check code assumes that subframeNo starts at 1");
1302 if (ctrlMsg.size ()>0)
1304 NS_LOG_LOGIC (
this <<
" UE - start TX PUCCH (NO PUSCH)");
1305 std::vector <int> dlRb;
1327 if (subframeNo > 10)
1344 std::vector <int> dlRb;
1387 std::list<Ptr<LteControlMessage> > l;
1390 std::vector <int> ulRb;
1460 for (
int i = 0; i < 4; i++)
1625 <<
" ms UE PHY sending out of snyc indication to UE RRC layer");
1664 <<
" ms UE PHY sending in snyc indication to UE RRC layer");
1719 double gainLin = std::pow (10.0, (gain / 10.0));
1724 std::vector <double> temp;
1727 for (uint8_t i = 0; i < temp.size (); i++)
1750 msg->SetDlHarqFeedback (m);
1776 <<
" UePhy " <<
ToString (oldState)
1777 <<
" --> " <<
ToString (newState));
See section 4.3.1 dlDciListElement.
void SetTxPower(double value)
Set transmit power function.
static EventId Schedule(Time const &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
uint16_t m_ulBandwidth
The UL bandwidth in number of PRBs.
uint16_t m_srsConfigured
SRS configured.
virtual void DoInitialize(void)
Initialize() implementation.
Simulation virtual time values and global simulation resolution.
uint8_t m_txMode
the transmission Mode
UeMemberLteUePhySapProvider class.
double m_qOut
The 'Qout' attribute.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
virtual void ReceiveLteControlMessage(Ptr< LteControlMessage > msg)=0
Receive SendLteControlMessage (PDCCH map, CQI feedbacks) using the ideal control channel.
double m_noiseFigure
Loss (dB) in the Signal-to-Noise-Ratio due to non-idealities in the receiver.
See section 4.3.25 sbMeasResult.
Ptr< LteSpectrumPhy > GetUlSpectrumPhy() const
Get Uplink spectrum phy.
uint8_t m_componentCarrierId
component carrier ID
double pssPsdSum
PSS PSD sum.
TracedCallback< uint16_t, Ptr< SpectrumValue > > m_reportPowerSpectralDensity
The ReportsPowerSpectralDensity trace source.
AttributeValue implementation for Boolean.
double m_txPower
Transmission power in dBm.
std::vector< struct UeMeasurementsElement > m_ueMeasurementsList
UE measurement list.
virtual void GenerateMixedCqiReport(const SpectrumValue &sinr)
Create the mixed CQI report.
LteUePhySapUser * m_uePhySapUser
UE Phy SAP user.
uint32_t GetId(void) const
void SetTxMode5Gain(double gain)
Set transmit mode 5 gain function.
void SetCellId(uint16_t cellId)
Set the cell ID function.
virtual void SendMacPdu(Ptr< Packet > p)
Send the MAC PDU to the channel.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
uint8_t m_componentCarrierId
component carrier Id used to address sap
virtual void GenerateDataCqiReport(const SpectrumValue &sinr)
generate a CQI report based on the given SINR of Data frame (used for PUSCH CQIs) ...
std::list< PssElement > m_pssList
PSS list.
void SetTxMode2Gain(double gain)
Set transmit mode 2 gain function.
bool m_ulConfigured
UL configured?
std::vector< Ptr< PacketBurst > > m_packetBurstQueue
A queue of packet bursts to be sent.
std::vector< int > GetSubChannelsForTransmission(void)
Get a list of sub channels to use in RX.
virtual void GenerateCtrlCqiReport(const SpectrumValue &sinr)
generate a CQI report based on the given SINR of Ctrl frame
double m_qIn
The 'Qin' attribute.
void DoSetDlBandwidth(uint16_t dlBandwidth)
Set DL bandwidth function.
Ptr< const AttributeAccessor > MakeBooleanAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
TracedCallback< uint16_t, uint16_t, double, double, bool, uint8_t > m_reportUeMeasurements
The ReportUeMeasurements trace source.
Time m_a30CqiLast
last aperiodic CQI
double GetPuschTxPower(std::vector< int > rb)
Get PUSCH transmit power function.
void SetSubChannelsForTransmission(std::vector< int > mask)
Set a list of sub channels to use in TX.
double m_paLinear
PA linear.
LteUePhySapProvider * m_uePhySapProvider
UE Phy SAP provider.
uint8_t rsrqNum
Number of RSRQ samples.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file...
void SetTxMode6Gain(double gain)
Set transmit mode 6 gain function.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
Ptr< LteSpectrumPhy > m_downlinkSpectrumPhy
The downlink LteSpectrumPhy associated to this LtePhy.
See section 4.3.2 ulDciListElement.
Service Access Point (SAP) offered by the UE PHY to the UE RRC for control purposes.
virtual void SendLteControlMessage(Ptr< LteControlMessage > msg)
Send SendLteControlMessage (PDCCH map, CQI feedbacks) using the ideal control channel.
See section 4.3.24 cqiListElement.
std::vector< double > m_txModeGain
the transmit mode gain
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
void DoResetPhyAfterRlf()
Reset Phy after radio link failure function.
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
uint16_t GetNumQoutEvalSf() const
Get number of Qout evaluation subframes.
Summary results of measuring a specific cell. Used for layer-1 filtering.
SpectrumValue m_dataInterferencePower
data interference power
uint16_t GetSrsPeriodicity(uint16_t srcCi) const
uint8_t GetMacChDelay(void) const
Get MAC to Channel delay.
void QueueSubChannelsForTransmission(std::vector< int > rbMap)
Queue subchannels for transmission function.
uint8_t m_rv
the redundancy version (HARQ)
Service Access Point (SAP) offered by the PHY to the MAC.
void SetTxModeGain(uint8_t txMode, double gain)
Set transmit mode gain function.
void SetDownlinkCqiPeriodicity(Time cqiPeriodicity)
Set the periodicty for the downlink periodic wideband and aperiodic subband CQI reporting.
Ptr< LteUePowerControl > m_powerControl
Pointer to UE Uplink Power Control entity.
virtual void DoSendMacPdu(Ptr< Packet > p)
Queue the MAC PDU to be sent (according to m_macChTtiDelay)
std::vector< int > GetSubChannelsForReception(void)
Get a list of sub channels to use in RX.
This class defines all functions to create spectrum model for lte.
Values::const_iterator ConstValuesBegin() const
uint8_t m_transmissionMode
the transmission mode
void DoSetRsrpFilterCoefficient(uint8_t rsrpFilterCoefficient)
Do set RSRP filter coefficient.
EventId m_sendSrsEvent
send SRS event
void SetHarqPhyModule(Ptr< LteHarqPhy > harq)
Set the HARQ PHY module.
bool m_pssReceived
PSS received?
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
Create a TraceSourceAccessor which will control access to the underlying trace source.
void DoSetSrsConfigurationIndex(uint16_t srcCi)
Set SRS configuration index function.
State
The states of the UE PHY entity.
static const int Type0AllocationRbg[4]
Type 0 RGB allocation.
void DoSetTransmissionMode(uint8_t txMode)
Set transmission mode function.
The attribute can be read.
UeMemberLteUePhySapProvider(LteUePhy *phy)
Constructor.
double GetTti(void) const
Template for the implementation of the LteUeCphySapProvider as a member of an owner class of type C t...
double m_pssReceptionThreshold
The RsrqUeMeasThreshold attribute.
void DoStartInSnycDetection()
Start in Snyc detection function.
uint8_t GetRbgSize(void) const
void DoResetRlfParams()
Reset radio link failure parameters.
bool m_enableRlfDetection
Flag to enable/disable RLF detection.
void DoSynchronizeWithEnb(uint16_t cellId)
Synchronize with ENB function.
static Ptr< SpectrumValue > CreateUlTxPowerSpectralDensity(uint16_t earfcn, uint16_t bandwidth, double powerTx, std::vector< int > activeRbs)
create a spectrum value representing the uplink power spectral density of a signal to be transmitted...
uint8_t rsrpNum
Number of RSRP samples.
LteUeCphySapUser * m_ueCphySapUser
UE CPhy SAP user.
Ptr< const AttributeAccessor > MakePointerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
void DoDispose()
Destructor implementation.
uint16_t m_numOfSubframes
count the number of subframes for which the downlink radio link quality is estimated ...
AttributeValue implementation for Time.
uint16_t m_rsrpSinrSamplePeriod
The RsrpSinrSamplePeriod attribute.
Time NanoSeconds(uint64_t value)
Construct a Time in the indicated unit.
uint64_t m_imsi
IMSI of the scheduled UE.
See section 4.3.27 higherLayerSelected.
double GetNoiseFigure() const
Get noise figure.
Service Access Point (SAP) offered by the UE PHY to the UE RRC for control purposes.
void SetLteUePhySapUser(LteUePhySapUser *s)
Set the PHY SAP User.
void RlfDetection(double sinrdB)
Radio link failure detection function.
Hold an unsigned integer type.
void DoConfigureReferenceSignalPower(int8_t referenceSignalPower)
Configure reference signal power function.
void SetTxMode3Gain(double gain)
Set transmit mode 3 gain function.
static uint8_t TxMode2LayerNum(uint8_t txMode)
Transmit mode 2 layer number.
Ptr< DlCqiLteControlMessage > CreateDlCqiFeedbackMessage(const SpectrumValue &sinr)
Create the DL CQI feedback from SINR values perceived at the physical layer with the signal received ...
void SetTxMode4Gain(double gain)
Set transmit mode 4 gain function.
void SwitchToState(State s)
Switch the UE PHY to the given state.
TracedCallback< uint16_t, uint16_t, State, State > m_stateTransitionTrace
The StateTransition trace source.
TracedCallback< uint16_t, uint16_t, double, double, uint8_t > m_reportCurrentCellRsrpSinrTrace
The ReportCurrentCellRsrpSinr trace source.
uint16_t GetSrsSubframeOffset(uint16_t srcCi) const
void SendSrs()
Send the SRS signal in the last symbols of the frame.
bool m_rsInterferencePowerUpdated
RS interference power updated?
virtual void EnqueueDlHarqFeedback(DlInfoListElement_s mes)
Enqueue the downlink HARQ feedback generated by LteSpectrumPhy.
virtual void RecvSystemInformationBlockType1(uint16_t cellId, LteRrcSap::SystemInformationBlockType1 sib1)=0
Relay an SIB1 message from the PHY entity to the RRC layer.
SpectrumValue m_ctrlSinrForRlf
the CTRL SINR used for RLF detection
Ptr< LteSpectrumPhy > GetDlSpectrumPhy() const
Get Downlink spectrum phy.
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
std::vector< uint8_t > m_sbCqi
sb CQI
void SetTxMode7Gain(double gain)
Set transmit mode 7 gain function.
TracedCallback< uint16_t, const std::vector< int > &> m_reportUlPhyResourceBlocks
The ReportUlPhyResourceBlocks trace source.
void DoSetPa(double pa)
Set PA function.
uint16_t m_dlBandwidth
The DL bandwidth in number of PRBs.
double ComputeAvgSinr(const SpectrumValue &sinr)
Compute average SINR among the RBs.
virtual void RecvMasterInformationBlock(uint16_t cellId, LteRrcSap::MasterInformationBlock mib)=0
Relay an MIB message from the PHY entity to the RRC layer.
See section 4.3.23 dlInfoListElement.
void DoReset()
Do Reset function.
double rsrpSum
Sum of RSRP sample values in linear unit.
uint16_t m_numOfQoutEvalSf
the downlink radio link quality is estimated over this period for detecting out-of-syncs ...
static void ScheduleWithContext(uint32_t context, Time const &delay, FUNC f, Ts &&... args)
Schedule an event with the given context.
virtual void DoSendRachPreamble(uint32_t prachId, uint32_t raRnti)
Send RACH preamble function.
void SetNumQoutEvalSf(uint16_t numSubframes)
Set number of Qout evaluation subframes.
uint8_t m_mcs
MCS for transport block.
virtual void ReportDataInterference(const SpectrumValue &interf)
Create the mixed CQI report.
uint32_t m_dlEarfcn
The downlink carrier frequency.
void SetRsrpFilterCoefficient(uint8_t rsrpFilterCoefficient)
Set RSRP function.
bool m_enableUplinkPowerControl
The EnableUplinkPowerControl attribute.
uint8_t m_macChTtiDelay
Delay between MAC and channel layer in terms of TTIs.
double GetTxPower() const
Get transmit power.
static const Time UL_DATA_DURATION
Duration of the data portion of a UL subframe.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Ptr< LteHarqPhy > m_harqPhyModule
HARQ phy module.
uint16_t GetNumQinEvalSf() const
Get number of Qin evaluation subframes.
Hold objects of type Ptr<T>.
void SetControlMessages(Ptr< LteControlMessage > m)
uint64_t m_imsi
the IMSI of the UE
virtual void DoNotifyConnectionSuccessful()
Notify PHY about the successful RRC connection establishment.
uint16_t m_rsrpSinrSampleCounter
The RsrpSinrSampleCounter attribute.
virtual void NotifyOutOfSync()=0
Send an out of sync indication to UE RRC.
uint16_t m_numOfFrames
count the number of frames for which the downlink radio link quality is estimated ...
bool m_isConnected
set when UE RRC is in CONNECTED_NORMALLY state
SpectrumValue m_rsReceivedPower
RS receive power.
void DoSetImsi(uint64_t imsi)
Set IMSI.
double rsrqSum
Sum of RSRQ sample values in linear unit.
uint16_t m_srsSubframeOffset
SRS subframe offset.
Values::const_iterator ConstValuesEnd() const
static Ptr< SpectrumValue > CreateNoisePowerSpectralDensity(uint32_t earfcn, uint16_t bandwidth, double noiseFigure)
create a SpectrumValue that models the power spectral density of AWGN
Time m_srsStartTime
SRS start time.
Ptr< const AttributeAccessor > MakeTimeAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
uint16_t m_size
Size of transport block.
static Time Now(void)
Return the current simulation virtual time.
Ptr< LteNetDevice > GetDevice() const
Get the device where the phy layer is attached.
uint16_t m_cellId
Cell identifier.
uint8_t m_ndi
new data indicator flag
void SubframeIndication(uint32_t frameNo, uint32_t subframeNo)
trigger from eNB the start from a new frame
virtual void DoInitialize(void)
Initialize() implementation.
void SetRnti(uint16_t rnti)
Set the RNTI function.
Time m_a30CqiPeriodicity
SubBand Aperiodic CQI.
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
Ptr< const AttributeAccessor > MakeDoubleAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
void SetTxMode1Gain(double gain)
Set transmit mode 1 gain function.
std::vector< int > m_subChannelsForTransmission
A list of sub channels to use in TX.
void DoStartCellSearch(uint32_t dlEarfcn)
Start the cell search function.
uint32_t m_raRnti
RA RNTI.
virtual void ResetSyncIndicationCounter()=0
Reset the sync indication counter.
bool m_dlConfigured
DL configured?
virtual void ReceiveLteControlMessageList(std::list< Ptr< LteControlMessage > > msgList)
Receive LTE control message list function.
Ptr< LteNetDevice > m_netDevice
Pointer to the NetDevice where this PHY layer is attached.
std::vector< std::vector< int > > m_subChannelsForTransmissionQueue
subchannels for transmission queue
std::list< Ptr< LteControlMessage > > GetControlMessages(void)
static const std::string & ToString(EpcUeNas::State s)
#define NS_ABORT_MSG_IF(cond, msg)
Abnormal program termination if a condition is true, with a message.
LteUeCphySapProvider * m_ueCphySapProvider
UE CPhy SAP provider.
std::map< uint16_t, UeMeasurementsElement > m_ueMeasurementsMap
Store measurement results during the last layer-1 filtering period.
Ptr< PacketBurst > GetPacketBurst(void)
uint16_t m_cellId
Cell ID of the attached Enb.
static const std::string g_uePhyStateName[LteUePhy::NUM_STATES]
Map each of UE PHY states to its string representation.
State GetState() const
Get state of the UE physical layer.
#define NS_LOG_WARN(msg)
Use NS_LOG to output a message of level LOG_WARN.
virtual void NotifyInSync()=0
Send an in sync indication to UE RRC.
int64_t GetMilliSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
std::vector< int > m_subChannelsForReception
A list of sub channels to use in RX.
Service Access Point (SAP) offered by the UE-PHY to the UE-MAC.
static const Time UL_SRS_DELAY_FROM_SUBFRAME_START
Delay from subframe start to transmission of SRS.
#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
Time Seconds(double value)
Construct a Time in the indicated unit.
Ptr< const AttributeChecker > MakeBooleanChecker(void)
void SetTxPower(double pow)
Set transmit power.
virtual void ReceivePss(uint16_t cellId, Ptr< SpectrumValue > p)
Receive PSS function.
double GetPucchTxPower(std::vector< int > rb)
Get PUCCH transmit power function.
UeMeasurementsParameters structure.
uint16_t m_srsPeriodicity
SRS periodicity.
bool m_downlinkInSync
when set, DL SINR evaluation for out-of-sync indications is conducted.
LteUePhySapProvider * GetLteUePhySapProvider()
Get the PHY SAP provider.
void Cancel(void)
This method is syntactic sugar for the ns3::Simulator::Cancel method.
virtual void SendRachPreamble(uint32_t prachId, uint32_t raRnti)
Send a preamble on the PRACH.
uint32_t m_raPreambleId
RA preamble ID.
uint8_t m_rbgSize
The RB group size according to the bandwidth.
void SetLteUeCphySapUser(LteUeCphySapUser *s)
Set the CPHY SAP User.
void SetNumQinEvalSf(uint16_t numSubframes)
Set number of Qin evaluation subframes.
SpectrumValue m_rsInterferencePower
RS interference power.
Ptr< const AttributeChecker > MakeTimeChecker(const Time min, const Time max)
Helper to make a Time checker with bounded range.
friend class UeMemberLteUePhySapProvider
allow UeMemberLteUePhySapProvider class friend access
void InitializeRlfParams()
Initialize radio link failure parameters.
double GetSrsTxPower(std::vector< int > rb)
Get SRS transmit power function.
virtual void NotifyConnectionSuccessful()
Notify PHY about the successful RRC connection establishment.
void PhyPduReceived(Ptr< Packet > p)
PhySpectrum received a new PHY-PDU.
uint8_t m_ccId
component carrier id
void SetRsrp(double value)
Set RSRP function.
virtual void DoSendLteControlMessage(Ptr< LteControlMessage > msg)
Send LTE control message function.
std::vector< std::list< Ptr< LteControlMessage > > > m_controlMessagesQueue
A queue of control messages to be sent.
bool m_rsReceivedPowerUpdated
RS receive power updated?
Ptr< LteUePowerControl > GetUplinkPowerControl() const
Get Uplink power control.
void ConfigureReferenceSignalPower(int8_t referenceSignalPower)
Configure reference signal power (dBm) function.
void GenerateCqiRsrpRsrq(const SpectrumValue &sinr)
Get CQI, RSRP, and RSRQ.
The LteSpectrumPhy models the physical layer of LTE.
uint32_t m_ulEarfcn
The uplink carrier frequency.
Ptr< LteSpectrumPhy > m_uplinkSpectrumPhy
The uplink LteSpectrumPhy associated to this LtePhy.
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 ...
PhyTransmissionStatParameters structure.
Time m_p10CqiLast
last periodic CQI
Parameters of the ReportUeMeasurements primitive: RSRP [dBm] and RSRQ [dB] See section 5...
LteUeCphySapProvider * GetLteUeCphySapProvider()
Get the CPHY SAP provider.
This class can be used to hold variables of floating point type such as 'double' or 'float'...
State m_state
The current UE PHY state.
int64_t m_timestamp
in millisecond
Set of values corresponding to a given SpectrumModel.
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
void SetMacPdu(Ptr< Packet > p)
std::vector< struct HigherLayerSelected_s > m_higherLayerSelected
higher layer selected
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
double m_sinrDbFrame
the average SINR per radio frame
bool m_dataInterferencePowerUpdated
data interference power updated?
void DoConfigureUplink(uint32_t ulEarfcn, uint16_t ulBandwidth)
Configure UL uplink function.
void SetNoiseFigure(double nf)
Set noise figure.
uint16_t m_numOfQinEvalSf
the downlink radio link quality is estimated over this period for detecting in-syncs ...
TracedCallback< PhyTransmissionStatParameters > m_ulPhyTransmission
The UlPhyTransmission trace source.
uint16_t m_rnti
C-RNTI scheduled.
static TypeId GetTypeId(void)
Get the type ID.
Time m_p10CqiPeriodicity
Wideband Periodic CQI. 2, 5, 10, 16, 20, 32, 40, 64, 80 or 160 ms.
The LtePhy models the physical layer of LTE.
void ReportUeMeasurements()
Layer-1 filtering of RSRP and RSRQ measurements and reporting to the RRC entity.
virtual void ReportInterference(const SpectrumValue &interf)
generate a report based on the linear interference and noise power perceived during DATA frame NOTE: ...
virtual void ReceivePhyPdu(Ptr< Packet > p)=0
Receive Phy Pdu funtion.
virtual Ptr< SpectrumValue > CreateTxPowerSpectralDensity()
Create the PSD for the TX.
void ReportTpc(uint8_t tpc)
Set RSRP function.
#define UL_PUSCH_TTIS_DELAY
Ptr< SpectrumValue > m_noisePsd
Noise power spectral density for the configured bandwidth.
void DoSetRnti(uint16_t rnti)
Set RNTI function.
virtual void SubframeIndication(uint32_t frameNo, uint32_t subframeNo)=0
Trigger the start from a new frame (input from Phy layer)
virtual void ReportUeMeasurements(UeMeasurementsParameters params)=0
Send a report of RSRP and RSRQ values perceived from PSS by the PHY entity (after applying layer-1 fi...
std::vector< HarqProcessInfoElement_t > HarqProcessInfoList_t
HarqProcessInfoList_t typedef.
void SetSubChannelsForReception(std::vector< int > mask)
Get a list of sub channels to use in RX.
The LteUeNetDevice class implements the UE net device.
virtual void DoDispose(void)
Destructor implementation.
Time m_ueMeasurementsFilterPeriod
The UeMeasurementsFilterPeriod attribute.