A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
lte-ue-phy.cc
Go to the documentation of this file.
1/*
2 * Copyright (c) 2010 TELEMATICS LAB, DEE - Politecnico di Bari
3 * Copyright (c) 2018 Fraunhofer ESK : RLF extensions
4 *
5 * SPDX-License-Identifier: GPL-2.0-only
6 *
7 * Author: Giuseppe Piro <g.piro@poliba.it>
8 * Marco Miozzo <marco.miozzo@cttc.es>
9 * Nicola Baldo <nbaldo@cttc.es>
10 * Modified by:
11 * Vignesh Babu <ns3-dev@esk.fraunhofer.de> (RLF extensions)
12 */
13
14#include "lte-ue-phy.h"
15
16#include "ff-mac-common.h"
17#include "lte-amc.h"
18#include "lte-common.h"
19#include "lte-net-device.h"
21#include "lte-ue-net-device.h"
23
24#include <ns3/boolean.h>
25#include <ns3/double.h>
26#include <ns3/log.h>
27#include <ns3/node.h>
28#include <ns3/object-factory.h>
29#include <ns3/pointer.h>
30#include <ns3/simulator.h>
31
32#include <cfloat>
33#include <cmath>
34#include <numeric>
35
36namespace ns3
37{
38
39NS_LOG_COMPONENT_DEFINE("LteUePhy");
40
41/**
42 * Duration of the data portion of a UL subframe.
43 * Equals to "TTI length - 1 symbol length for SRS - margin".
44 * The margin is 1 nanosecond and is intended to avoid overlapping simulator
45 * events. The duration of one symbol is TTI/14 (rounded). In other words,
46 * duration of data portion of UL subframe = 1 ms * (13/14) - 1 ns.
47 */
48static const Time UL_DATA_DURATION = NanoSeconds(1e6 - 71429 - 1);
49
50/**
51 * Delay from subframe start to transmission of SRS.
52 * Equals to "TTI length - 1 symbol for SRS".
53 */
55
56////////////////////////////////////////
57// member SAP forwarders
58////////////////////////////////////////
59
60/// UeMemberLteUePhySapProvider class
62{
63 public:
64 /**
65 * Constructor
66 *
67 * @param phy the LTE UE Phy
68 */
70
71 // inherited from LtePhySapProvider
72 void SendMacPdu(Ptr<Packet> p) override;
74 void SendRachPreamble(uint32_t prachId, uint32_t raRnti) override;
75 void NotifyConnectionSuccessful() override;
76
77 private:
78 LteUePhy* m_phy; ///< the Phy
79};
80
85
86void
91
92void
97
98void
103
104void
109
110////////////////////////////////////////
111// LteUePhy methods
112////////////////////////////////////////
113
115
117{
118 NS_LOG_FUNCTION(this);
119 NS_FATAL_ERROR("This constructor should not be called");
120}
121
123 : LtePhy(dlPhy, ulPhy),
124 m_uePhySapUser(nullptr),
125 m_ueCphySapUser(nullptr),
126 m_state(CELL_SEARCH),
127 m_subframeNo(0),
128 m_rsReceivedPowerUpdated(false),
129 m_rsInterferencePowerUpdated(false),
130 m_dataInterferencePowerUpdated(false),
131 m_pssReceived(false),
132 m_ueMeasurementsFilterPeriod(MilliSeconds(200)),
133 m_ueMeasurementsFilterLast(),
134 m_rsrpSinrSampleCounter(0),
135 m_imsi(0)
136{
142
143 NS_ASSERT_MSG(Simulator::Now().GetNanoSeconds() == 0,
144 "Cannot create UE devices after simulation started");
146
147 DoReset();
148}
149
151{
152 m_txModeGain.clear();
153}
154
155void
163
164TypeId
166{
167 static TypeId tid =
168 TypeId("ns3::LteUePhy")
169 .SetParent<LtePhy>()
170 .SetGroupName("Lte")
171 .AddConstructor<LteUePhy>()
172 .AddAttribute("TxPower",
173 "Transmission power in dBm",
174 DoubleValue(10.0),
177 .AddAttribute(
178 "NoiseFigure",
179 "Loss (dB) in the Signal-to-Noise-Ratio due to non-idealities in the receiver."
180 " According to Wikipedia (http://en.wikipedia.org/wiki/Noise_figure), this is "
181 "\"the difference in decibels (dB) between"
182 " the noise output of the actual receiver to the noise output of an "
183 " ideal receiver with the same overall gain and bandwidth when the receivers "
184 " are connected to sources at the standard noise temperature T0.\" "
185 "In this model, we consider T0 = 290K.",
186 DoubleValue(9.0),
189 .AddAttribute("TxMode1Gain",
190 "Transmission mode 1 gain in dB",
191 DoubleValue(0.0),
194 .AddAttribute("TxMode2Gain",
195 "Transmission mode 2 gain in dB",
196 DoubleValue(4.2),
199 .AddAttribute("TxMode3Gain",
200 "Transmission mode 3 gain in dB",
201 DoubleValue(-2.8),
204 .AddAttribute("TxMode4Gain",
205 "Transmission mode 4 gain in dB",
206 DoubleValue(0.0),
209 .AddAttribute("TxMode5Gain",
210 "Transmission mode 5 gain in dB",
211 DoubleValue(0.0),
214 .AddAttribute("TxMode6Gain",
215 "Transmission mode 6 gain in dB",
216 DoubleValue(0.0),
219 .AddAttribute("TxMode7Gain",
220 "Transmission mode 7 gain in dB",
221 DoubleValue(0.0),
224 .AddTraceSource("ReportCurrentCellRsrpSinr",
225 "RSRP and SINR statistics.",
227 "ns3::LteUePhy::RsrpSinrTracedCallback")
228 .AddAttribute("RsrpSinrSamplePeriod",
229 "The sampling period for reporting RSRP-SINR stats (default value 1)",
230 UintegerValue(1),
233 .AddTraceSource("ReportUlPhyResourceBlocks",
234 "UL transmission PHY layer resource blocks.",
236 "ns3::LteUePhy::UlPhyResourceBlocksTracedCallback")
237 .AddTraceSource("ReportPowerSpectralDensity",
238 "Power Spectral Density data.",
240 "ns3::LteUePhy::PowerSpectralDensityTracedCallback")
241 .AddTraceSource("UlPhyTransmission",
242 "DL transmission PHY layer statistics.",
244 "ns3::PhyTransmissionStatParameters::TracedCallback")
245 .AddAttribute("DlSpectrumPhy",
246 "The downlink LteSpectrumPhy associated to this LtePhy",
248 PointerValue(),
251 .AddAttribute("UlSpectrumPhy",
252 "The uplink LteSpectrumPhy associated to this LtePhy",
254 PointerValue(),
257 .AddAttribute("RsrqUeMeasThreshold",
258 "Receive threshold for PSS on RSRQ [dB]",
259 DoubleValue(-1000.0),
262 .AddAttribute("UeMeasurementsFilterPeriod",
263 "Time period for reporting UE measurements, i.e., the"
264 "length of layer-1 filtering.",
268 .AddAttribute("DownlinkCqiPeriodicity",
269 "Periodicity in milliseconds for reporting the"
270 "wideband and subband downlink CQIs to the eNB",
274 .AddTraceSource("ReportUeMeasurements",
275 "Report UE measurements RSRP (dBm) and RSRQ (dB).",
277 "ns3::LteUePhy::RsrpRsrqTracedCallback")
278 .AddTraceSource("StateTransition",
279 "Trace fired upon every UE PHY state transition",
281 "ns3::LteUePhy::StateTracedCallback")
282 .AddAttribute("EnableUplinkPowerControl",
283 "If true, Uplink Power Control will be enabled.",
284 BooleanValue(true),
287 .AddAttribute("Qout",
288 "corresponds to 10% block error rate of a hypothetical PDCCH transmission"
289 "taking into account the PCFICH errors with transmission parameters."
290 "see 3GPP TS 36.213 4.2.1 and TS 36.133 7.6",
291 DoubleValue(-5),
294 .AddAttribute("Qin",
295 "corresponds to 2% block error rate of a hypothetical PDCCH transmission"
296 "taking into account the PCFICH errors with transmission parameters."
297 "see 3GPP TS 36.213 4.2.1 and TS 36.133 7.6",
298 DoubleValue(-3.9),
301 .AddAttribute(
302 "NumQoutEvalSf",
303 "This specifies the total number of consecutive subframes"
304 "which corresponds to the Qout evaluation period",
305 UintegerValue(200), // see 3GPP 3GPP TS 36.133 7.6.2.1
308 .AddAttribute(
309 "NumQinEvalSf",
310 "This specifies the total number of consecutive subframes"
311 "which corresponds to the Qin evaluation period",
312 UintegerValue(100), // see 3GPP 3GPP TS 36.133 7.6.2.1
315 .AddAttribute("EnableRlfDetection",
316 "If true, RLF detection will be enabled.",
317 BooleanValue(true),
320 return tid;
321}
322
323void
325{
326 NS_LOG_FUNCTION(this);
327
328 NS_ABORT_MSG_IF(!m_netDevice, "LteNetDevice is not available in LteUePhy");
329 Ptr<Node> node = m_netDevice->GetNode();
330 NS_ABORT_MSG_IF(!node, "Node is not available in the LteNetDevice of LteUePhy");
331 uint32_t nodeId = node->GetId();
332
333 // ScheduleWithContext() is needed here to set context for logs,
334 // because Initialize() is called outside of Node::AddDevice().
335
337
339}
340
341void
347
354
355void
361
368
369void
371{
372 NS_LOG_FUNCTION(this << nf);
373 m_noiseFigure = nf;
374}
375
376double
378{
379 NS_LOG_FUNCTION(this);
380 return m_noiseFigure;
381}
382
383void
385{
386 NS_LOG_FUNCTION(this << pow);
387 m_txPower = pow;
388 m_powerControl->SetTxPower(pow);
389}
390
391double
393{
394 NS_LOG_FUNCTION(this);
395 return m_txPower;
396}
397
400{
401 NS_LOG_FUNCTION(this);
402 return m_powerControl;
403}
404
405uint8_t
407{
408 return m_macChTtiDelay;
409}
410
416
422
423void
424LteUePhy::SetNumQoutEvalSf(uint16_t numSubframes)
425{
426 NS_LOG_FUNCTION(this << numSubframes);
427 NS_ABORT_MSG_IF(numSubframes % 10 != 0,
428 "Number of subframes used for Qout "
429 "evaluation must be multiple of 10");
430 m_numOfQoutEvalSf = numSubframes;
431}
432
433void
434LteUePhy::SetNumQinEvalSf(uint16_t numSubframes)
435{
436 NS_LOG_FUNCTION(this << numSubframes);
437 NS_ABORT_MSG_IF(numSubframes % 10 != 0,
438 "Number of subframes used for Qin "
439 "evaluation must be multiple of 10");
440 m_numOfQinEvalSf = numSubframes;
441}
442
443uint16_t
445{
446 NS_LOG_FUNCTION(this);
447 return m_numOfQoutEvalSf;
448}
449
450uint16_t
452{
453 NS_LOG_FUNCTION(this);
454 return m_numOfQinEvalSf;
455}
456
457void
464
465void
470
471void
473{
474 NS_LOG_FUNCTION(this);
475
477
479 m_uplinkSpectrumPhy->SetTxPowerSpectralDensity(txPsd);
480}
481
482void
484{
485 NS_LOG_FUNCTION(this);
487}
488
489std::vector<int>
495
496std::vector<int>
502
516
517void
519{
520 NS_LOG_FUNCTION(this);
521 /**
522 * We do not generate the CQI report
523 * when the UE is not synchronized to any cell.
524 *
525 * Also, the RLF is detected after the DL CTRL
526 * is received by the UE,therefore, we do not need
527 * to generate the CQI reports and the UE measurements
528 * for a CTRL for which the RLF has been detected.
529 */
530 if (m_cellId == 0)
531 {
532 return;
533 }
534 m_ctrlSinrForRlf = sinr;
536}
537
538void
540{
541 NS_LOG_FUNCTION(this << sinr);
542
544 NS_ASSERT(m_cellId > 0);
545
546 if (m_dlConfigured && m_ulConfigured && (m_rnti > 0))
547 {
548 // check periodic wideband CQI
550 {
551 NS_LOG_DEBUG("Reporting P10 CQI at : " << Simulator::Now().As(Time::MS)
552 << ". Last reported at : "
554 Ptr<LteUeNetDevice> thisDevice = GetDevice()->GetObject<LteUeNetDevice>();
556 if (msg)
557 {
559 }
561 }
562 // check aperiodic high-layer configured subband CQI
564 {
565 NS_LOG_DEBUG("Reporting A30 CQI at : " << Simulator::Now().As(Time::MS)
566 << ". Last reported at : "
568 Ptr<LteUeNetDevice> thisDevice = GetDevice()->GetObject<LteUeNetDevice>();
570 if (msg)
571 {
573 }
575 }
576 }
577
578 // Generate PHY trace
581 {
582 NS_ASSERT_MSG(m_rsReceivedPowerUpdated, " RS received power info obsolete");
583 // RSRP evaluated as averaged received power among RBs
584 uint16_t rbNum = m_rsReceivedPower.GetValuesN();
585
586 // sum PSD [W/Hz] of all bands
587 double sum = std::reduce(m_rsReceivedPower.ConstValuesBegin(),
589 0.0);
590
591 // convert PSD [W/Hz] to linear power [W]
592 sum *= (180000.0 / 12.0);
593
594 double rsrp = (rbNum > 0) ? (sum / rbNum) : DBL_MAX;
595 // averaged SINR among RBs
596 double avSinr = ComputeAvgSinr(sinr);
597
598 NS_LOG_INFO(this << " cellId " << m_cellId << " rnti " << m_rnti << " RSRP " << rsrp
599 << " SINR " << avSinr << " ComponentCarrierId "
600 << (uint16_t)m_componentCarrierId);
601 // trigger RLF detection only when UE has an active RRC connection
602 // and RLF detection attribute is set to true
604 {
605 double avrgSinrForRlf = ComputeAvgSinr(m_ctrlSinrForRlf);
606 RlfDetection(10 * log10(avrgSinrForRlf));
607 }
608
610 m_rnti,
611 rsrp,
612 avSinr,
613 (uint16_t)m_componentCarrierId);
615 }
616
617 if (!m_pssReceived)
618 {
619 return;
620 }
621
622 // measure instantaneous RSRQ now
623 NS_ASSERT_MSG(m_rsInterferencePowerUpdated, " RS interference power info obsolete");
624
625 auto itPss = m_pssList.begin();
626 while (itPss != m_pssList.end())
627 {
628 uint16_t rbNum = 0;
629 double rssiSum = 0.0;
630
635 itIntN++, itPj++)
636 {
637 rbNum++;
638 // convert PSD [W/Hz] to linear power [W] for the single RE
639 double interfPlusNoisePowerTxW = (*itIntN);
640 double signalPowerTxW = (*itPj);
641 rssiSum += (2 * (interfPlusNoisePowerTxW + signalPowerTxW));
642 }
643 rssiSum *= (180000.0 / 12.0);
644
645 NS_ASSERT(rbNum == (*itPss).nRB);
646 double rsrq_dB = 10 * log10((*itPss).pssPsdSum / rssiSum);
647
648 if (rsrq_dB > m_pssReceptionThreshold)
649 {
650 NS_LOG_INFO(this << " PSS RNTI " << m_rnti << " cellId " << m_cellId << " has RSRQ "
651 << rsrq_dB << " and RBnum " << rbNum);
652 // store measurements
653 auto itMeasMap = m_ueMeasurementsMap.find((*itPss).cellId);
654 if (itMeasMap != m_ueMeasurementsMap.end())
655 {
656 (*itMeasMap).second.rsrqSum += rsrq_dB;
657 (*itMeasMap).second.rsrqNum++;
658 }
659 else
660 {
661 NS_LOG_WARN("race condition of bug 2091 occurred");
662 }
663 }
664
665 itPss++;
666
667 } // end of while (itPss != m_pssList.end ())
668
669 m_pssList.clear();
670
671} // end of void LteUePhy::GenerateCtrlCqiReport (const SpectrumValue& sinr)
672
673double
675{
676 NS_LOG_FUNCTION(this);
677
678 // averaged SINR among RBs
679 double sum = 0.0;
680 uint8_t rbNum = 0;
681
682 for (auto it = sinr.ConstValuesBegin(); it != sinr.ConstValuesEnd(); it++)
683 {
684 sum += (*it);
685 rbNum++;
686 }
687
688 double avrgSinr = (rbNum > 0) ? (sum / rbNum) : DBL_MAX;
689
690 return avrgSinr;
691}
692
693void
695{
696 // Not used by UE, CQI are based only on RS
697}
698
699void
701{
702 NS_LOG_FUNCTION(this);
703
704 /**
705 * We do not generate the CQI report
706 * when the UE is not synchronized to any cell.
707 *
708 * Also, the RLF is detected after the DL CTRL
709 * is received by the UE,therefore, we do not need
710 * to generate the CQI reports and the UE measurements
711 * for a CTRL for which the RLF has been detected.
712 */
713 if (m_cellId == 0)
714 {
715 return;
716 }
717
719 // NOTE: The SINR received by this method is
720 // based on CTRL, which is not used to compute
721 // PDSCH (i.e., data) based SINR. It is used
722 // for RLF detection.
723 m_ctrlSinrForRlf = sinr;
724
727 {
728 // we have a measurement of interf + noise for the denominator
729 // of SINR = S/(I+N)
730 mixedSinr /= m_dataInterferencePower;
732 NS_LOG_LOGIC("data interf measurement available, SINR = " << mixedSinr);
733 }
734 else
735 {
736 // we did not see any interference on data, so interference is
737 // there and we have only noise at the denominator of SINR
738 mixedSinr /= (*m_noisePsd);
739 NS_LOG_LOGIC("no data interf measurement available, SINR = " << mixedSinr);
740 }
741
742 /*
743 * some RBs are not used in PDSCH and their SINR is very high
744 * for example with bandwidth 25, last RB is not used
745 * it can make avgSinr value very high, what is incorrect
746 */
747 uint32_t rbgSize = GetRbgSize();
748 uint32_t modulo = m_dlBandwidth % rbgSize;
749 double avgMixedSinr = 0;
750 uint32_t usedRbgNum = 0;
751 for (uint32_t i = 0; i < (m_dlBandwidth - 1 - modulo); i++)
752 {
753 usedRbgNum++;
754 avgMixedSinr += mixedSinr[i];
755 }
756 avgMixedSinr = avgMixedSinr / usedRbgNum;
757 for (uint32_t i = 0; i < modulo; i++)
758 {
759 mixedSinr[m_dlBandwidth - 1 - i] = avgMixedSinr;
760 }
761
762 GenerateCqiRsrpRsrq(mixedSinr);
763}
764
765void
767{
768 NS_LOG_FUNCTION(this << interf);
770 m_rsInterferencePower = interf;
771}
772
773void
775{
776 NS_LOG_FUNCTION(this << interf);
777
780}
781
782void
784{
785 NS_LOG_FUNCTION(this << power);
787 m_rsReceivedPower = power;
788
790 {
791 double sum = std::reduce(m_rsReceivedPower.ConstValuesBegin(),
793 0.0);
794 double rsrp = 10 * log10(sum * 180000) + 30;
795
796 NS_LOG_INFO("RSRP: " << rsrp);
797 m_powerControl->SetRsrp(rsrp);
798 }
799}
800
803{
804 NS_LOG_FUNCTION(this);
805
806 // apply transmission mode gain
808 SpectrumValue newSinr = sinr;
809 newSinr *= m_txModeGain.at(m_transmissionMode);
810
811 // CREATE DlCqiLteControlMessage
813 CqiListElement_s dlcqi;
814 std::vector<int> cqi;
816 {
817 cqi = m_amc->CreateCqiFeedbacks(newSinr, m_dlBandwidth);
818
820 auto nbSubChannels = cqi.size();
821 double cqiSum = 0.0;
822 int activeSubChannels = 0;
823 // average the CQIs of the different RBs
824 for (std::size_t i = 0; i < nbSubChannels; i++)
825 {
826 if (cqi.at(i) != -1)
827 {
828 cqiSum += cqi.at(i);
829 activeSubChannels++;
830 }
831 NS_LOG_DEBUG(this << " subch " << i << " cqi " << cqi.at(i));
832 }
833 dlcqi.m_rnti = m_rnti;
834 dlcqi.m_ri = 1; // not yet used
835 dlcqi.m_cqiType = CqiListElement_s::P10; // Periodic CQI using PUCCH wideband
836 NS_ASSERT_MSG(nLayer > 0, " nLayer negative");
837 NS_ASSERT_MSG(nLayer < 3, " nLayer limit is 2s");
838 for (uint8_t i = 0; i < nLayer; i++)
839 {
840 if (activeSubChannels > 0)
841 {
842 dlcqi.m_wbCqi.push_back((uint16_t)cqiSum / activeSubChannels);
843 }
844 else
845 {
846 // approximate with the worst case -> CQI = 1
847 dlcqi.m_wbCqi.push_back(1);
848 }
849 }
850 // NS_LOG_DEBUG (this << " Generate P10 CQI feedback " << (uint16_t) cqiSum /
851 // activeSubChannels);
852 dlcqi.m_wbPmi = 0; // not yet used
853 // dl.cqi.m_sbMeasResult others CQI report modes: not yet implemented
854 }
856 {
857 cqi = m_amc->CreateCqiFeedbacks(newSinr, GetRbgSize());
859 auto nbSubChannels = cqi.size();
860 int rbgSize = GetRbgSize();
861 double cqiSum = 0.0;
862 int cqiNum = 0;
863 SbMeasResult_s rbgMeas;
864 // NS_LOG_DEBUG (this << " Create A30 CQI feedback, RBG " << rbgSize << " cqiNum " <<
865 // nbSubChannels << " band " << (uint16_t)m_dlBandwidth);
866 for (std::size_t i = 0; i < nbSubChannels; i++)
867 {
868 if (cqi.at(i) != -1)
869 {
870 cqiSum += cqi.at(i);
871 }
872 // else "nothing" no CQI is treated as CQI = 0 (worst case scenario)
873 cqiNum++;
874 if (cqiNum == rbgSize)
875 {
876 // average the CQIs of the different RBGs
877 // NS_LOG_DEBUG (this << " RBG CQI " << (uint16_t) cqiSum / rbgSize);
879 hlCqi.m_sbPmi = 0; // not yet used
880 for (uint8_t i = 0; i < nLayer; i++)
881 {
882 hlCqi.m_sbCqi.push_back((uint16_t)cqiSum / rbgSize);
883 }
884 rbgMeas.m_higherLayerSelected.push_back(hlCqi);
885 cqiSum = 0.0;
886 cqiNum = 0;
887 }
888 }
889 dlcqi.m_rnti = m_rnti;
890 dlcqi.m_ri = 1; // not yet used
891 dlcqi.m_cqiType = CqiListElement_s::A30; // Aperidic CQI using PUSCH
892 // dlcqi.m_wbCqi.push_back ((uint16_t) cqiSum / nbSubChannels);
893 dlcqi.m_wbPmi = 0; // not yet used
894 dlcqi.m_sbMeasResult = rbgMeas;
895 }
896
897 msg->SetDlCqi(dlcqi);
898 return msg;
899}
900
901void
903{
905 NS_LOG_DEBUG(this << " Report UE Measurements ");
906
908
909 for (auto it = m_ueMeasurementsMap.begin(); it != m_ueMeasurementsMap.end(); it++)
910 {
911 double avg_rsrp = (*it).second.rsrpSum / (double)(*it).second.rsrpNum;
912 double avg_rsrq = (*it).second.rsrqSum / (double)(*it).second.rsrqNum;
913 /*
914 * In CELL_SEARCH state, this may result in avg_rsrq = 0/0 = -nan.
915 * UE RRC must take this into account when receiving measurement reports.
916 * TODO remove this shortcoming by calculating RSRQ during CELL_SEARCH
917 */
918 NS_LOG_DEBUG(this << " CellId " << (*it).first << " RSRP " << avg_rsrp << " (nSamples "
919 << (uint16_t)(*it).second.rsrpNum << ")"
920 << " RSRQ " << avg_rsrq << " (nSamples " << (uint16_t)(*it).second.rsrqNum
921 << ")"
922 << " ComponentCarrierID " << (uint16_t)m_componentCarrierId);
923
925 newEl.m_cellId = (*it).first;
926 newEl.m_rsrp = avg_rsrp;
927 newEl.m_rsrq = avg_rsrq;
928 ret.m_ueMeasurementsList.push_back(newEl);
929 ret.m_componentCarrierId = m_componentCarrierId;
930
931 // report to UE measurements trace
933 (*it).first,
934 avg_rsrp,
935 avg_rsrq,
936 (*it).first == m_cellId,
938 }
939
940 // report to RRC
942
943 m_ueMeasurementsMap.clear();
945}
946
947void
949{
950 NS_LOG_FUNCTION(this << cqiPeriodicity);
951 m_a30CqiPeriodicity = cqiPeriodicity;
952 m_p10CqiPeriodicity = cqiPeriodicity;
953}
954
955void
962
963void
965{
966 NS_LOG_FUNCTION(this << raPreambleId);
967
968 // unlike other control messages, RACH preamble is sent ASAP
970 msg->SetRapId(raPreambleId);
971 m_raPreambleId = raPreambleId;
972 m_raRnti = raRnti;
973 m_controlMessagesQueue.at(0).emplace_back(msg);
974}
975
976void
978{
979 /**
980 * Radio link failure detection should take place only on the
981 * primary carrier to avoid errors due to multiple calls to the
982 * same methods at the RRC layer
983 */
984 if (m_componentCarrierId == 0)
985 {
986 m_isConnected = true;
987 // Initialize the parameters for radio link failure detection
989 }
990}
991
992void
994{
995 NS_LOG_FUNCTION(this);
996
997 NS_LOG_DEBUG(this << " I am rnti = " << m_rnti << " and I received msgs "
998 << (uint16_t)msgList.size());
999 for (auto it = msgList.begin(); it != msgList.end(); it++)
1000 {
1001 Ptr<LteControlMessage> msg = (*it);
1002
1003 if (msg->GetMessageType() == LteControlMessage::DL_DCI)
1004 {
1006
1007 DlDciListElement_s dci = msg2->GetDci();
1008 if (dci.m_rnti != m_rnti)
1009 {
1010 // DCI not for me
1011 continue;
1012 }
1013
1014 if (dci.m_resAlloc != 0)
1015 {
1016 NS_FATAL_ERROR("Resource Allocation type not implemented");
1017 }
1018
1019 std::vector<int> dlRb;
1020
1021 // translate the DCI to Spectrum framework
1022 uint32_t mask = 0x1;
1023 for (int i = 0; i < 32; i++)
1024 {
1025 if (((dci.m_rbBitmap & mask) >> i) == 1)
1026 {
1027 for (int k = 0; k < GetRbgSize(); k++)
1028 {
1029 dlRb.push_back((i * GetRbgSize()) + k);
1030 // NS_LOG_DEBUG(this << " RNTI " << m_rnti << " RBG " << i << "
1031 // DL-DCI allocated PRB " << (i*GetRbgSize()) + k);
1032 }
1033 }
1034 mask = (mask << 1);
1035 }
1037 {
1038 m_powerControl->ReportTpc(dci.m_tpc);
1039 }
1040
1041 // send TB info to LteSpectrumPhy
1042 NS_LOG_DEBUG(this << " UE " << m_rnti << " DL-DCI " << dci.m_rnti << " bitmap "
1043 << dci.m_rbBitmap);
1044 for (std::size_t i = 0; i < dci.m_tbsSize.size(); i++)
1045 {
1046 m_downlinkSpectrumPhy->AddExpectedTb(dci.m_rnti,
1047 dci.m_ndi.at(i),
1048 dci.m_tbsSize.at(i),
1049 dci.m_mcs.at(i),
1050 dlRb,
1051 i,
1052 dci.m_harqProcess,
1053 dci.m_rv.at(i),
1054 true /* DL */);
1055 }
1056
1058 }
1059 else if (msg->GetMessageType() == LteControlMessage::UL_DCI)
1060 {
1061 // set the uplink bandwidth according to the UL-CQI
1063 UlDciListElement_s dci = msg2->GetDci();
1064 if (dci.m_rnti != m_rnti)
1065 {
1066 // DCI not for me
1067 continue;
1068 }
1069 NS_LOG_INFO(this << " UL DCI");
1070 std::vector<int> ulRb;
1071 ulRb.reserve(dci.m_rbLen);
1072 for (int i = 0; i < dci.m_rbLen; i++)
1073 {
1074 ulRb.push_back(i + dci.m_rbStart);
1075 // NS_LOG_DEBUG (this << " UE RB " << i + dci.m_rbStart);
1076 }
1079 // fire trace of UL Tx PHY stats
1080 HarqProcessInfoList_t harqInfoList = m_harqPhyModule->GetHarqProcessInfoUl(m_rnti, 0);
1082 params.m_cellId = m_cellId;
1083 params.m_imsi = 0; // it will be set by DlPhyTransmissionCallback in LteHelper
1084 params.m_timestamp = Simulator::Now().GetMilliSeconds() + UL_PUSCH_TTIS_DELAY;
1085 params.m_rnti = m_rnti;
1086 params.m_txMode = 0; // always SISO for UE
1087 params.m_layer = 0;
1088 params.m_mcs = dci.m_mcs;
1089 params.m_size = dci.m_tbSize;
1090 params.m_rv = harqInfoList.size();
1091 params.m_ndi = dci.m_ndi;
1092 params.m_ccId = m_componentCarrierId;
1093 m_ulPhyTransmission(params);
1094 // pass the info to the MAC
1096 }
1097 else if (msg->GetMessageType() == LteControlMessage::RAR)
1098 {
1100 if (rarMsg->GetRaRnti() == m_raRnti)
1101 {
1102 for (auto it = rarMsg->RarListBegin(); it != rarMsg->RarListEnd(); ++it)
1103 {
1104 if (it->rapId != m_raPreambleId)
1105 {
1106 // UL grant not for me
1107 continue;
1108 }
1109 else
1110 {
1111 NS_LOG_INFO("received RAR RNTI " << m_raRnti);
1112 // set the uplink bandwidth according to the UL grant
1113 std::vector<int> ulRb;
1114 ulRb.reserve(it->rarPayload.m_grant.m_rbLen);
1115 for (int i = 0; i < it->rarPayload.m_grant.m_rbLen; i++)
1116 {
1117 ulRb.push_back(i + it->rarPayload.m_grant.m_rbStart);
1118 }
1119
1121 // pass the info to the MAC
1123 // reset RACH variables with out of range values
1124 m_raPreambleId = 255;
1125 m_raRnti = 11;
1126 }
1127 }
1128 }
1129 }
1130 else if (msg->GetMessageType() == LteControlMessage::MIB)
1131 {
1132 NS_LOG_INFO("received MIB");
1133 NS_ASSERT(m_cellId > 0);
1136 }
1137 else if (msg->GetMessageType() == LteControlMessage::SIB1)
1138 {
1139 NS_LOG_INFO("received SIB1");
1140 NS_ASSERT(m_cellId > 0);
1143 }
1144 else
1145 {
1146 // pass the message to UE-MAC
1148 }
1149 }
1150}
1151
1152void
1154{
1155 NS_LOG_FUNCTION(this << cellId << (*p));
1156
1157 uint16_t nRB = p->GetValuesN();
1158 // sum PSD [W/Hz] of all bands
1159 double sum = std::reduce(p->ConstValuesBegin(), p->ConstValuesEnd(), 0.0);
1160
1161 // convert PSD [W/Hz] to linear power [W]
1162 sum *= (180000.0 / 12.0);
1163
1164 // measure instantaneous RSRP now
1165 double rsrp_dBm = 10 * log10(1000 * (sum / (double)nRB));
1166 NS_LOG_INFO(this << " PSS RNTI " << m_rnti << " cellId " << m_cellId << " has RSRP " << rsrp_dBm
1167 << " and RBnum " << nRB);
1168 // note that m_pssReceptionThreshold does not apply here
1169
1170 // store measurements
1171 auto itMeasMap = m_ueMeasurementsMap.find(cellId);
1172 if (itMeasMap == m_ueMeasurementsMap.end())
1173 {
1174 // insert new entry
1176 newEl.rsrpSum = rsrp_dBm;
1177 newEl.rsrpNum = 1;
1178 newEl.rsrqSum = 0;
1179 newEl.rsrqNum = 0;
1180 m_ueMeasurementsMap.insert(std::pair<uint16_t, UeMeasurementsElement>(cellId, newEl));
1181 }
1182 else
1183 {
1184 (*itMeasMap).second.rsrpSum += rsrp_dBm;
1185 (*itMeasMap).second.rsrpNum++;
1186 }
1187
1188 /*
1189 * Collect the PSS for later processing in GenerateCtrlCqiReport()
1190 * (to be called from ChunkProcessor after RX is finished).
1191 */
1192 m_pssReceived = true;
1193 PssElement el;
1194 el.cellId = cellId;
1195 el.pssPsdSum = sum;
1196 el.nRB = nRB;
1197 m_pssList.push_back(el);
1198
1199} // end of void LteUePhy::ReceivePss (uint16_t cellId, Ptr<SpectrumValue> p)
1200
1201void
1206
1207void
1209{
1210 NS_LOG_FUNCTION(this << frameNo << subframeNo);
1211
1212 NS_ASSERT_MSG(frameNo > 0, "the SRS index check code assumes that frameNo starts at 1");
1213
1214 // refresh internal variables
1217 m_pssReceived = false;
1218
1219 if (m_ulConfigured)
1220 {
1221 // update uplink transmission mask according to previous UL-CQIs
1222 std::vector<int> rbMask = m_subChannelsForTransmissionQueue.at(0);
1224
1225 // shift the queue
1226 for (uint8_t i = 1; i < m_macChTtiDelay; i++)
1227 {
1229 }
1231
1233 {
1234 NS_ASSERT_MSG(subframeNo > 0 && subframeNo <= 10,
1235 "the SRS index check code assumes that subframeNo starts at 1");
1236 if ((((frameNo - 1) * 10 + (subframeNo - 1)) % m_srsPeriodicity) == m_srsSubframeOffset)
1237 {
1238 NS_LOG_INFO("frame " << frameNo << " subframe " << subframeNo
1239 << " sending SRS (offset=" << m_srsSubframeOffset
1240 << ", period=" << m_srsPeriodicity << ")");
1243 }
1244 }
1245
1246 std::list<Ptr<LteControlMessage>> ctrlMsg = GetControlMessages();
1247 // send packets in queue
1248 NS_LOG_LOGIC(this << " UE - start slot for PUSCH + PUCCH - RNTI " << m_rnti << " CELLID "
1249 << m_cellId);
1250 // send the current burts of packets
1252 if (pb)
1253 {
1255 {
1256 m_txPower = m_powerControl->GetPuschTxPower(rbMask);
1258 }
1259 m_uplinkSpectrumPhy->StartTxDataFrame(pb, ctrlMsg, UL_DATA_DURATION);
1260 }
1261 else
1262 {
1263 // send only PUCCH (ideal: fake null bandwidth signal)
1264 if (!ctrlMsg.empty())
1265 {
1266 NS_LOG_LOGIC(this << " UE - start TX PUCCH (NO PUSCH)");
1267 std::vector<int> dlRb;
1268
1270 {
1271 m_txPower = m_powerControl->GetPucchTxPower(dlRb);
1272 }
1273
1275 m_uplinkSpectrumPhy->StartTxDataFrame(pb, ctrlMsg, UL_DATA_DURATION);
1276 }
1277 else
1278 {
1279 NS_LOG_LOGIC(this << " UE - UL NOTHING TO SEND");
1280 }
1281 }
1282 } // m_configured
1283
1284 // trigger the MAC
1285 m_uePhySapUser->SubframeIndication(frameNo, subframeNo);
1286
1287 m_subframeNo = subframeNo;
1288 ++subframeNo;
1289 if (subframeNo > 10)
1290 {
1291 ++frameNo;
1292 subframeNo = 1;
1293 }
1294
1295 // schedule next subframe indication
1298 this,
1299 frameNo,
1300 subframeNo);
1301}
1302
1303void
1305{
1306 NS_LOG_FUNCTION(this << " UE " << m_rnti << " start tx SRS, cell Id " << (uint32_t)m_cellId);
1307 NS_ASSERT(m_cellId > 0);
1308 // set the current tx power spectral density (full bandwidth)
1309 std::vector<int> dlRb;
1310 for (uint16_t i = 0; i < m_ulBandwidth; i++)
1311 {
1312 dlRb.push_back(i);
1313 }
1314
1316 {
1317 m_txPower = m_powerControl->GetSrsTxPower(dlRb);
1318 }
1319
1321 m_uplinkSpectrumPhy->StartTxUlSrsFrame();
1322}
1323
1324void
1326{
1327 NS_LOG_FUNCTION(this);
1328
1329 m_rnti = 0;
1330 m_cellId = 0;
1331 m_isConnected = false;
1333 m_srsPeriodicity = 0;
1334 m_srsConfigured = false;
1335 m_dlConfigured = false;
1336 m_ulConfigured = false;
1337 m_raPreambleId = 255; // value out of range
1338 m_raRnti = 11; // value out of range
1342 m_paLinear = 1;
1343
1347
1348 m_packetBurstQueue.clear();
1349 m_controlMessagesQueue.clear();
1351 for (int i = 0; i < m_macChTtiDelay; i++)
1352 {
1354 m_packetBurstQueue.push_back(pb);
1355 std::list<Ptr<LteControlMessage>> l;
1356 m_controlMessagesQueue.push_back(l);
1357 }
1358 std::vector<int> ulRb;
1360
1362 m_downlinkSpectrumPhy->Reset();
1363 m_uplinkSpectrumPhy->Reset();
1364 m_pssList.clear();
1365 /**
1366 * Call the EndRx() method of the interference model for DL control and data
1367 * to cancel any ongoing downlink reception of control and data info.
1368 */
1369 m_downlinkSpectrumPhy->m_interferenceCtrl->EndRx();
1370 m_downlinkSpectrumPhy->m_interferenceData->EndRx();
1371
1372} // end of void LteUePhy::DoReset ()
1373
1374void
1376{
1377 NS_LOG_FUNCTION(this << dlEarfcn);
1378 m_dlEarfcn = dlEarfcn;
1379 DoSetDlBandwidth(6); // configure DL for receiving PSS
1381}
1382
1383void
1385{
1386 NS_LOG_FUNCTION(this << cellId << dlEarfcn);
1387 m_dlEarfcn = dlEarfcn;
1388 DoSynchronizeWithEnb(cellId);
1389}
1390
1391void
1393{
1394 NS_LOG_FUNCTION(this << cellId);
1395
1396 if (cellId == 0)
1397 {
1398 NS_FATAL_ERROR("Cell ID shall not be zero");
1399 }
1400
1401 m_cellId = cellId;
1402 m_downlinkSpectrumPhy->SetCellId(cellId);
1403 m_uplinkSpectrumPhy->SetCellId(cellId);
1404
1405 // configure DL for receiving the BCH with the minimum bandwidth
1407
1408 m_dlConfigured = false;
1409 m_ulConfigured = false;
1410
1412}
1413
1414uint16_t
1416{
1417 return m_cellId;
1418}
1419
1422{
1423 return m_dlEarfcn;
1424}
1425
1426void
1427LteUePhy::DoSetDlBandwidth(uint16_t dlBandwidth)
1428{
1429 NS_LOG_FUNCTION(this << (uint32_t)dlBandwidth);
1430 if (m_dlBandwidth != dlBandwidth or !m_dlConfigured)
1431 {
1432 m_dlBandwidth = dlBandwidth;
1433
1434 static const int Type0AllocationRbg[4] = {
1435 10, // RBG size 1
1436 26, // RBG size 2
1437 63, // RBG size 3
1438 110, // RBG size 4
1439 }; // see table 7.1.6.1-1 of 36.213
1440 for (int i = 0; i < 4; i++)
1441 {
1442 if (dlBandwidth < Type0AllocationRbg[i])
1443 {
1444 m_rbgSize = i + 1;
1445 break;
1446 }
1447 }
1448
1452 m_downlinkSpectrumPhy->SetNoisePowerSpectralDensity(m_noisePsd);
1453 m_downlinkSpectrumPhy->GetChannel()->AddRx(m_downlinkSpectrumPhy);
1454 }
1455 m_dlConfigured = true;
1456}
1457
1458void
1459LteUePhy::DoConfigureUplink(uint32_t ulEarfcn, uint16_t ulBandwidth)
1460{
1461 m_ulEarfcn = ulEarfcn;
1462 m_ulBandwidth = ulBandwidth;
1463 m_ulConfigured = true;
1464}
1465
1466void
1468{
1469 NS_LOG_FUNCTION(this);
1470 m_powerControl->ConfigureReferenceSignalPower(referenceSignalPower);
1471}
1472
1473void
1475{
1476 NS_LOG_FUNCTION(this << rnti);
1477 m_rnti = rnti;
1478
1479 m_powerControl->SetCellId(m_cellId);
1480 m_powerControl->SetRnti(m_rnti);
1481}
1482
1483void
1485{
1486 NS_LOG_FUNCTION(this << (uint16_t)txMode);
1487 m_transmissionMode = txMode;
1488 m_downlinkSpectrumPhy->SetTransmissionMode(txMode);
1489}
1490
1491void
1493{
1494 NS_LOG_FUNCTION(this << srcCi);
1497 m_srsConfigured = true;
1498
1499 // a guard time is needed for the case where the SRS periodicity is changed dynamically at run
1500 // time if we use a static one, we can have a 0ms guard time
1502 NS_LOG_DEBUG(this << " UE SRS P " << m_srsPeriodicity << " RNTI " << m_rnti << " offset "
1503 << m_srsSubframeOffset << " cellId " << m_cellId << " CI " << srcCi);
1504}
1505
1506void
1508{
1509 NS_LOG_FUNCTION(this << pa);
1510 m_paLinear = pow(10, (pa / 10));
1511}
1512
1513void
1514LteUePhy::DoSetRsrpFilterCoefficient(uint8_t rsrpFilterCoefficient)
1515{
1516 NS_LOG_FUNCTION(this << (uint16_t)(rsrpFilterCoefficient));
1517 m_powerControl->SetRsrpFilterCoefficient(rsrpFilterCoefficient);
1518}
1519
1520void
1522{
1523 NS_LOG_FUNCTION(this);
1524 m_downlinkSpectrumPhy->m_harqPhyModule->ClearDlHarqBuffer(m_rnti); // flush HARQ buffers
1527 m_pssReceived = false;
1528 DoReset();
1529}
1530
1531void
1538
1539void
1541{
1542 NS_LOG_FUNCTION(this);
1543 // indicates that the downlink radio link quality has to be monitored for in-sync indications
1544 m_downlinkInSync = false;
1545}
1546
1547void
1549{
1550 NS_LOG_FUNCTION(this);
1551 m_imsi = imsi;
1552}
1553
1554void
1556{
1557 NS_LOG_FUNCTION(this);
1558 m_numOfSubframes = 0;
1559 m_sinrDbFrame = 0;
1560 m_numOfFrames = 0;
1561 m_downlinkInSync = true;
1562}
1563
1564void
1566{
1567 NS_LOG_FUNCTION(this << sinrDb);
1568 m_sinrDbFrame += sinrDb;
1570 NS_LOG_LOGIC("No of Subframes: " << m_numOfSubframes
1571 << " UE synchronized: " << m_downlinkInSync);
1572 // check for out_of_sync indications first when UE is both DL and UL synchronized
1573 // m_downlinkInSync=true indicates that the evaluation is for out-of-sync indications
1575 {
1576 /**
1577 * For every frame, if the downlink radio link quality(avg SINR)
1578 * is less than the threshold Qout, then the frame cannot be decoded
1579 */
1581 {
1582 m_numOfFrames++; // increment the counter if a frame cannot be decoded
1583 NS_LOG_LOGIC("No of Frames which cannot be decoded: " << m_numOfFrames);
1584 }
1585 else
1586 {
1587 /**
1588 * If the downlink radio link quality(avg SINR) is greater
1589 * than the threshold Qout, then the frame counter is reset
1590 * since only consecutive frames should be considered.
1591 */
1592 NS_LOG_INFO("Resetting frame counter at phy. Current value = " << m_numOfFrames);
1593 m_numOfFrames = 0;
1594 // Also reset the sync indicator counter at RRC
1596 }
1597 m_numOfSubframes = 0;
1598 m_sinrDbFrame = 0;
1599 }
1600 /**
1601 * Once the number of consecutive frames which cannot be decoded equals
1602 * the Qout evaluation period (i.e 200ms), then an out-of-sync indication
1603 * is sent to the RRC layer
1604 */
1606 {
1607 NS_LOG_LOGIC("At " << Simulator::Now().As(Time::MS)
1608 << " ms UE PHY sending out of sync indication to UE RRC layer");
1610 m_numOfFrames = 0;
1611 }
1612 // check for in_sync indications when T310 timer is started
1613 // m_downlinkInSync=false indicates that the evaluation is for in-sync indications
1614 if (!m_downlinkInSync && m_numOfSubframes == 10)
1615 {
1616 /**
1617 * For every frame, if the downlink radio link quality(avg SINR)
1618 * is greater than the threshold Qin, then the frame can be
1619 * successfully decoded.
1620 */
1622 {
1623 m_numOfFrames++; // increment the counter if a frame can be decoded
1624 NS_LOG_LOGIC("No of Frames successfully decoded: " << m_numOfFrames);
1625 }
1626 else
1627 {
1628 /**
1629 * If the downlink radio link quality(avg SINR) is less
1630 * than the threshold Qin, then the frame counter is reset
1631 * since only consecutive frames should be considered
1632 */
1633 m_numOfFrames = 0;
1634 // Also reset the sync indicator counter at RRC
1636 }
1637 m_numOfSubframes = 0;
1638 m_sinrDbFrame = 0;
1639 }
1640 /**
1641 * Once the number of consecutive frames which can be decoded equals the Qin evaluation period
1642 * (i.e 100ms), then an in-sync indication is sent to the RRC layer
1643 */
1645 {
1646 NS_LOG_LOGIC("At " << Simulator::Now().As(Time::MS)
1647 << " ms UE PHY sending in sync indication to UE RRC layer");
1649 m_numOfFrames = 0;
1650 }
1651}
1652
1653void
1655{
1656 SetTxModeGain(1, gain);
1657}
1658
1659void
1661{
1662 SetTxModeGain(2, gain);
1663}
1664
1665void
1667{
1668 SetTxModeGain(3, gain);
1669}
1670
1671void
1673{
1674 SetTxModeGain(4, gain);
1675}
1676
1677void
1679{
1680 SetTxModeGain(5, gain);
1681}
1682
1683void
1685{
1686 SetTxModeGain(6, gain);
1687}
1688
1689void
1691{
1692 SetTxModeGain(7, gain);
1693}
1694
1695void
1696LteUePhy::SetTxModeGain(uint8_t txMode, double gain)
1697{
1698 NS_LOG_FUNCTION(this << gain);
1699 if (txMode > 0)
1700 {
1701 // convert to linear
1702 double gainLin = std::pow(10.0, (gain / 10.0));
1703 if (m_txModeGain.size() < txMode)
1704 {
1705 m_txModeGain.resize(txMode);
1706 }
1707 m_txModeGain.at(txMode - 1) = gainLin;
1708 }
1709 // forward the info to DL LteSpectrumPhy
1710 m_downlinkSpectrumPhy->SetTxModeGain(txMode, gain);
1711}
1712
1713void
1715{
1716 NS_LOG_FUNCTION(this);
1717 // get the feedback from LteSpectrumPhy and send it through ideal PUCCH to eNB
1719 msg->SetDlHarqFeedback(m);
1720 SetControlMessages(msg);
1721}
1722
1723void
1728
1731{
1732 NS_LOG_FUNCTION(this);
1733 return m_state;
1734}
1735
1736void
1738{
1739 NS_LOG_FUNCTION(this << newState);
1740 State oldState = m_state;
1741 m_state = newState;
1742 NS_LOG_INFO(this << " cellId=" << m_cellId << " rnti=" << m_rnti << " UePhy " << oldState
1743 << " --> " << newState);
1744 m_stateTransitionTrace(m_cellId, m_rnti, oldState, newState);
1745}
1746
1747std::ostream&
1748operator<<(std::ostream& os, LteUePhy::State state)
1749{
1750 switch (state)
1751 {
1753 return os << "CELL_SEARCH";
1755 return os << "SYNCHRONIZED";
1757 return os << "NUM_STATES";
1758 };
1759 return os << "UNKNOWN(" << static_cast<uint32_t>(state) << ")";
1760}
1761
1762} // namespace ns3
AttributeValue implementation for Boolean.
Definition boolean.h:26
This class can be used to hold variables of floating point type such as 'double' or 'float'.
Definition double.h:31
void Cancel()
This method is syntactic sugar for the ns3::Simulator::Cancel method.
Definition event-id.cc:44
The LtePhy models the physical layer of LTE.
Definition lte-phy.h:40
double m_txPower
Transmission power in dBm.
Definition lte-phy.h:230
uint8_t GetRbgSize() const
Definition lte-phy.cc:169
void DoDispose() override
Destructor implementation.
Definition lte-phy.cc:65
uint16_t GetSrsPeriodicity(uint16_t srcCi) const
Definition lte-phy.cc:133
std::vector< Ptr< PacketBurst > > m_packetBurstQueue
A queue of packet bursts to be sent.
Definition lte-phy.h:270
uint16_t m_ulBandwidth
The UL bandwidth in number of PRBs.
Definition lte-phy.h:250
Ptr< PacketBurst > GetPacketBurst()
Definition lte-phy.cc:181
Ptr< LteNetDevice > GetDevice() const
Get the device where the phy layer is attached.
Definition lte-phy.cc:86
uint8_t m_componentCarrierId
component carrier Id used to address sap
Definition lte-phy.h:292
double m_noiseFigure
Loss (dB) in the Signal-to-Noise-Ratio due to non-idealities in the receiver.
Definition lte-phy.h:242
uint32_t m_ulEarfcn
The uplink carrier frequency.
Definition lte-phy.h:267
uint16_t m_dlBandwidth
The DL bandwidth in number of PRBs.
Definition lte-phy.h:255
Ptr< LteSpectrumPhy > m_downlinkSpectrumPhy
The downlink LteSpectrumPhy associated to this LtePhy.
Definition lte-phy.h:219
void SetMacPdu(Ptr< Packet > p)
Definition lte-phy.cc:175
std::list< Ptr< LteControlMessage > > GetControlMessages()
Definition lte-phy.cc:207
uint16_t GetSrsSubframeOffset(uint16_t srcCi) const
Definition lte-phy.cc:151
Ptr< LteNetDevice > m_netDevice
Pointer to the NetDevice where this PHY layer is attached.
Definition lte-phy.h:213
uint16_t m_cellId
Cell identifier.
Definition lte-phy.h:289
void SetControlMessages(Ptr< LteControlMessage > m)
Definition lte-phy.cc:199
uint32_t m_dlEarfcn
The downlink carrier frequency.
Definition lte-phy.h:262
Ptr< LteSpectrumPhy > m_uplinkSpectrumPhy
The uplink LteSpectrumPhy associated to this LtePhy.
Definition lte-phy.h:224
double GetTti() const
Definition lte-phy.cc:126
std::vector< std::list< Ptr< LteControlMessage > > > m_controlMessagesQueue
A queue of control messages to be sent.
Definition lte-phy.h:272
uint8_t m_rbgSize
The RB group size according to the bandwidth.
Definition lte-phy.h:257
uint8_t m_macChTtiDelay
Delay between MAC and channel layer in terms of TTIs.
Definition lte-phy.h:282
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.
static Ptr< SpectrumValue > CreateNoisePowerSpectralDensity(uint32_t earfcn, uint16_t bandwidth, double noiseFigure)
create a SpectrumValue that models the power spectral density of AWGN
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.
virtual void NotifyInSync()=0
Send an in sync indication to UE RRC.
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...
virtual void RecvMasterInformationBlock(uint16_t cellId, LteRrcSap::MasterInformationBlock mib)=0
Relay an MIB message from the PHY entity to the RRC layer.
virtual void RecvSystemInformationBlockType1(uint16_t cellId, LteRrcSap::SystemInformationBlockType1 sib1)=0
Relay an SIB1 message from the PHY entity to the RRC layer.
virtual void NotifyOutOfSync()=0
Send an out of sync indication to UE RRC.
virtual void ResetSyncIndicationCounter()=0
Reset the sync indication counter.
The LteUeNetDevice class implements the UE net device.
The LteSpectrumPhy models the physical layer of LTE.
Definition lte-ue-phy.h:41
void SetTxMode1Gain(double gain)
Set transmit mode 1 gain function.
SpectrumValue m_dataInterferencePower
data interference power
Definition lte-ue-phy.h:716
void SetSubChannelsForTransmission(std::vector< int > mask)
Set a list of sub channels to use in TX.
void DoInitialize() override
Initialize() implementation.
friend class MemberLteUeCphySapProvider< LteUePhy >
allow MemberLteUeCphySapProvider<LteUePhy> class friend access
Definition lte-ue-phy.h:45
void SetHarqPhyModule(Ptr< LteHarqPhy > harq)
Set the HARQ PHY module.
void DoSetDlBandwidth(uint16_t dlBandwidth)
Set DL bandwidth function.
uint16_t GetNumQinEvalSf() const
Get number of Qin evaluation subframes.
void SetTxMode3Gain(double gain)
Set transmit mode 3 gain function.
uint16_t m_numOfQinEvalSf
the downlink radio link quality is estimated over this period for detecting in-syncs
Definition lte-ue-phy.h:831
LteUePhySapUser * m_uePhySapUser
UE Phy SAP user.
Definition lte-ue-phy.h:678
uint16_t DoGetCellId()
Get cell ID.
uint16_t m_rsrpSinrSampleCounter
The RsrpSinrSampleCounter attribute.
Definition lte-ue-phy.h:778
virtual void ReportDataInterference(const SpectrumValue &interf)
Create the mixed CQI report.
void QueueSubChannelsForTransmission(std::vector< int > rbMap)
Queue subchannels for transmission function.
void DoConfigureUplink(uint32_t ulEarfcn, uint16_t ulBandwidth)
Configure UL uplink function.
virtual void ReceivePss(uint16_t cellId, Ptr< SpectrumValue > p)
Receive PSS function.
uint16_t m_srsPeriodicity
SRS periodicity.
Definition lte-ue-phy.h:688
void DoResetPhyAfterRlf()
Reset Phy after radio link failure function.
virtual void DoNotifyConnectionSuccessful()
Notify PHY about the successful RRC connection establishment.
bool m_dlConfigured
DL configured?
Definition lte-ue-phy.h:695
LteUePhySapProvider * GetLteUePhySapProvider()
Get the PHY SAP provider.
Time m_srsStartTime
SRS start time.
Definition lte-ue-phy.h:691
double GetNoiseFigure() const
Get noise figure.
Time m_p10CqiLast
last periodic CQI
Definition lte-ue-phy.h:667
std::map< uint16_t, UeMeasurementsElement > m_ueMeasurementsMap
Store measurement results during the last layer-1 filtering period.
Definition lte-ue-phy.h:749
TracedCallback< uint16_t, Ptr< SpectrumValue > > m_reportPowerSpectralDensity
The ReportsPowerSpectralDensity trace source.
Definition lte-ue-phy.h:809
LteUePhySapProvider * m_uePhySapProvider
UE Phy SAP provider.
Definition lte-ue-phy.h:677
void ReportRsReceivedPower(const SpectrumValue &power) override
generate a report based on the linear RS power perceived during CTRL frame NOTE: used only by UE for ...
uint16_t GetNumQoutEvalSf() const
Get number of Qout evaluation subframes.
bool m_rsInterferencePowerUpdated
RS interference power updated?
Definition lte-ue-phy.h:712
virtual void ReceiveLteControlMessageList(std::list< Ptr< LteControlMessage > > msgList)
Receive LTE control message list function.
void DoSendMacPdu(Ptr< Packet > p) override
Queue the MAC PDU to be sent (according to m_macChTtiDelay)
Ptr< SpectrumValue > m_noisePsd
Noise power spectral density for the configured bandwidth.
Definition lte-ue-phy.h:811
void GenerateCtrlCqiReport(const SpectrumValue &sinr) override
generate a CQI report based on the given SINR of Ctrl frame
uint32_t DoGetDlEarfcn()
Get DL EARFCN.
double ComputeAvgSinr(const SpectrumValue &sinr)
Compute average SINR among the RBs.
void SetLteUePhySapUser(LteUePhySapUser *s)
Set the PHY SAP User.
virtual void DoSendRachPreamble(uint32_t prachId, uint32_t raRnti)
Send RACH preamble function.
void DoStartCellSearch(uint32_t dlEarfcn)
Start the cell search function.
void SetTxMode6Gain(double gain)
Set transmit mode 6 gain function.
LteUeCphySapProvider * m_ueCphySapProvider
UE CPhy SAP provider.
Definition lte-ue-phy.h:680
Ptr< SpectrumValue > CreateTxPowerSpectralDensity() override
Create the PSD for the TX.
std::vector< std::vector< int > > m_subChannelsForTransmissionQueue
subchannels for transmission queue
Definition lte-ue-phy.h:653
void DoReset()
Do Reset function.
void SetNumQoutEvalSf(uint16_t numSubframes)
Set number of Qout evaluation subframes.
State m_state
The current UE PHY state.
Definition lte-ue-phy.h:699
bool m_pssReceived
PSS received?
Definition lte-ue-phy.h:718
TracedCallback< uint16_t, uint16_t, double, double, uint8_t > m_reportCurrentCellRsrpSinrTrace
The ReportCurrentCellRsrpSinr trace source.
Definition lte-ue-phy.h:768
void DoSetImsi(uint64_t imsi)
Set IMSI.
void SetTxMode2Gain(double gain)
Set transmit mode 2 gain function.
void DoSetRsrpFilterCoefficient(uint8_t rsrpFilterCoefficient)
Do set RSRP filter coefficient.
~LteUePhy() override
uint8_t GetMacChDelay() const
Get MAC to Channel delay.
Ptr< LteUePowerControl > m_powerControl
Pointer to UE Uplink Power Control entity.
Definition lte-ue-phy.h:663
void DoConfigureReferenceSignalPower(int8_t referenceSignalPower)
Configure reference signal power function.
std::list< PssElement > m_pssList
PSS list.
Definition lte-ue-phy.h:728
void SubframeIndication(uint32_t frameNo, uint32_t subframeNo)
trigger from eNB the start from a new frame
Ptr< LteUePowerControl > GetUplinkPowerControl() const
Get Uplink power control.
void RlfDetection(double sinrdB)
Radio link failure detection function.
std::vector< double > m_txModeGain
the transmit mode gain
Definition lte-ue-phy.h:686
State GetState() const
Get state of the UE physical layer.
SpectrumValue m_rsReceivedPower
RS receive power.
Definition lte-ue-phy.h:710
void DoSynchronizeWithEnb(uint16_t cellId)
Synchronize with ENB function.
void DoSetSrsConfigurationIndex(uint16_t srcCi)
Set SRS configuration index function.
uint16_t m_srsSubframeOffset
SRS subframe offset.
Definition lte-ue-phy.h:689
uint8_t m_subframeNo
Definition lte-ue-phy.h:707
uint16_t m_rsrpSinrSamplePeriod
The RsrpSinrSamplePeriod attribute.
Definition lte-ue-phy.h:773
uint64_t m_imsi
the IMSI of the UE
Definition lte-ue-phy.h:842
uint16_t m_rnti
the RNTI
Definition lte-ue-phy.h:683
bool m_enableUplinkPowerControl
The EnableUplinkPowerControl attribute.
Definition lte-ue-phy.h:661
Ptr< LteSpectrumPhy > GetDlSpectrumPhy() const
Get Downlink spectrum phy.
void SetTxMode5Gain(double gain)
Set transmit mode 5 gain function.
void DoSetTransmissionMode(uint8_t txMode)
Set transmission mode function.
bool m_enableRlfDetection
Flag to enable/disable RLF detection.
Definition lte-ue-phy.h:843
Time m_a30CqiLast
last aperiodic CQI
Definition lte-ue-phy.h:675
void GenerateCqiRsrpRsrq(const SpectrumValue &sinr)
Get CQI, RSRP, and RSRQ.
SpectrumValue m_rsInterferencePower
RS interference power.
Definition lte-ue-phy.h:713
void DoResetRlfParams()
Reset radio link failure parameters.
void SetDownlinkCqiPeriodicity(Time cqiPeriodicity)
Set the periodicty for the downlink periodic wideband and aperiodic subband CQI reporting.
Ptr< LteHarqPhy > m_harqPhyModule
HARQ phy module.
Definition lte-ue-phy.h:758
EventId m_sendSrsEvent
send SRS event
Definition lte-ue-phy.h:788
double m_qIn
The 'Qin' attribute.
Definition lte-ue-phy.h:820
void SetNoiseFigure(double nf)
Set noise figure.
friend class UeMemberLteUePhySapProvider
allow UeMemberLteUePhySapProvider class friend access
Definition lte-ue-phy.h:43
void DoSetPa(double pa)
Set PA function.
Ptr< DlCqiLteControlMessage > CreateDlCqiFeedbackMessage(const SpectrumValue &sinr)
Create the DL CQI feedback from SINR values perceived at the physical layer with the signal received ...
LteUeCphySapUser * m_ueCphySapUser
UE CPhy SAP user.
Definition lte-ue-phy.h:681
void SetNumQinEvalSf(uint16_t numSubframes)
Set number of Qin evaluation subframes.
void SetLteUeCphySapUser(LteUeCphySapUser *s)
Set the CPHY SAP User.
double m_sinrDbFrame
the average SINR per radio frame
Definition lte-ue-phy.h:840
TracedCallback< uint16_t, uint16_t, State, State > m_stateTransitionTrace
The StateTransition trace source.
Definition lte-ue-phy.h:704
void DoDispose() override
Destructor implementation.
void SetSubChannelsForReception(std::vector< int > mask)
Get a list of sub channels to use in RX.
bool m_rsReceivedPowerUpdated
RS receive power updated?
Definition lte-ue-phy.h:709
void SwitchToState(State s)
Switch the UE PHY to the given state.
TracedCallback< uint16_t, uint16_t, double, double, bool, uint8_t > m_reportUeMeasurements
The ReportUeMeasurements trace source.
Definition lte-ue-phy.h:786
double m_paLinear
PA linear.
Definition lte-ue-phy.h:693
TracedCallback< PhyTransmissionStatParameters > m_ulPhyTransmission
The UlPhyTransmission trace source.
Definition lte-ue-phy.h:795
bool m_isConnected
set when UE RRC is in CONNECTED_NORMALLY state
Definition lte-ue-phy.h:814
Ptr< LteAmc > m_amc
AMC.
Definition lte-ue-phy.h:655
std::vector< int > m_subChannelsForReception
A list of sub channels to use in RX.
Definition lte-ue-phy.h:650
void InitializeRlfParams()
Initialize radio link failure parameters.
std::vector< int > GetSubChannelsForTransmission()
Get a list of sub channels to use in RX.
void PhyPduReceived(Ptr< Packet > p)
PhySpectrum received a new PHY-PDU.
LteUeCphySapProvider * GetLteUeCphySapProvider()
Get the CPHY SAP provider.
bool m_ulConfigured
UL configured?
Definition lte-ue-phy.h:696
SpectrumValue m_ctrlSinrForRlf
the CTRL SINR used for RLF detection
Definition lte-ue-phy.h:841
Time m_ueMeasurementsFilterPeriod
The UeMeasurementsFilterPeriod attribute.
Definition lte-ue-phy.h:754
bool m_srsConfigured
SRS configured.
Definition lte-ue-phy.h:690
void GenerateDataCqiReport(const SpectrumValue &sinr) override
generate a CQI report based on the given SINR of Data frame (used for PUSCH CQIs)
uint16_t m_numOfFrames
count the number of frames for which the downlink radio link quality is estimated
Definition lte-ue-phy.h:838
bool m_downlinkInSync
when set, DL SINR evaluation for out-of-sync indications is conducted.
Definition lte-ue-phy.h:834
uint16_t m_numOfQoutEvalSf
the downlink radio link quality is estimated over this period for detecting out-of-syncs
Definition lte-ue-phy.h:829
void SetTxMode7Gain(double gain)
Set transmit mode 7 gain function.
void DoSetRnti(uint16_t rnti)
Set RNTI function.
static TypeId GetTypeId()
Get the type ID.
double GetTxPower() const
Get transmit power.
virtual void EnqueueDlHarqFeedback(DlInfoListElement_s mes)
Enqueue the downlink HARQ feedback generated by LteSpectrumPhy.
std::vector< int > m_subChannelsForTransmission
A list of sub channels to use in TX.
Definition lte-ue-phy.h:648
Time m_p10CqiPeriodicity
Wideband Periodic CQI. 2, 5, 10, 16, 20, 32, 40, 64, 80 or 160 ms.
Definition lte-ue-phy.h:666
bool m_dataInterferencePowerUpdated
data interference power updated?
Definition lte-ue-phy.h:715
void SetTxPower(double pow)
Set transmit power.
State
The states of the UE PHY entity.
Definition lte-ue-phy.h:52
uint16_t m_numOfSubframes
count the number of subframes for which the downlink radio link quality is estimated
Definition lte-ue-phy.h:836
void SetTxMode4Gain(double gain)
Set transmit mode 4 gain function.
virtual void DoSendLteControlMessage(Ptr< LteControlMessage > msg)
Send LTE control message function.
Time m_a30CqiPeriodicity
SubBand Aperiodic CQI.
Definition lte-ue-phy.h:674
TracedCallback< uint16_t, const std::vector< int > & > m_reportUlPhyResourceBlocks
The ReportUlPhyResourceBlocks trace source.
Definition lte-ue-phy.h:802
void ReportInterference(const SpectrumValue &interf) override
generate a report based on the linear interference and noise power perceived during DATA frame NOTE: ...
std::vector< int > GetSubChannelsForReception()
Get a list of sub channels to use in RX.
Ptr< LteSpectrumPhy > GetUlSpectrumPhy() const
Get Uplink spectrum phy.
void ReportUeMeasurements()
Layer-1 filtering of RSRP and RSRQ measurements and reporting to the RRC entity.
double m_pssReceptionThreshold
The RsrqUeMeasThreshold attribute.
Definition lte-ue-phy.h:734
uint32_t m_raPreambleId
RA preamble ID.
Definition lte-ue-phy.h:760
double m_qOut
The 'Qout' attribute.
Definition lte-ue-phy.h:827
void DoStartInSyncDetection()
Start in Sync detection function.
void SendSrs()
Send the SRS signal in the last symbols of the frame.
virtual void GenerateMixedCqiReport(const SpectrumValue &sinr)
Create the mixed CQI report.
uint8_t m_transmissionMode
the transmission mode
Definition lte-ue-phy.h:685
void SetTxModeGain(uint8_t txMode, double gain)
Set transmit mode gain function.
uint32_t m_raRnti
RA RNTI.
Definition lte-ue-phy.h:761
Service Access Point (SAP) offered by the UE-PHY to the UE-MAC.
Service Access Point (SAP) offered by the PHY to the MAC.
virtual void ReceivePhyPdu(Ptr< Packet > p)=0
Receive Phy Pdu function.
virtual void SubframeIndication(uint32_t frameNo, uint32_t subframeNo)=0
Trigger the start from a new frame (input from Phy layer)
virtual void ReceiveLteControlMessage(Ptr< LteControlMessage > msg)=0
Receive SendLteControlMessage (PDCCH map, CQI feedbacks) using the ideal control channel.
virtual void DoInitialize()
Initialize() implementation.
Definition object.cc:440
AttributeValue implementation for Pointer.
Smart pointer class similar to boost::intrusive_ptr.
static EventId Schedule(const Time &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
Definition simulator.h:560
static void ScheduleWithContext(uint32_t context, const Time &delay, FUNC f, Ts &&... args)
Schedule an event with the given context.
Definition simulator.h:577
static Time Now()
Return the current simulation virtual time.
Definition simulator.cc:197
Set of values corresponding to a given SpectrumModel.
Values::const_iterator ConstValuesBegin() const
uint32_t GetValuesN() const
Get the number of values stored in the array.
Values::const_iterator ConstValuesEnd() const
Simulation virtual time values and global simulation resolution.
Definition nstime.h:94
int64_t GetMilliSeconds() const
Get an approximation of the time stored in this instance in the indicated unit.
Definition nstime.h:397
TimeWithUnit As(const Unit unit=Time::AUTO) const
Attach a unit to a Time, to facilitate output in a specific unit.
Definition time.cc:404
@ MS
millisecond
Definition nstime.h:106
AttributeValue implementation for Time.
Definition nstime.h:1431
static uint8_t TxMode2LayerNum(uint8_t txMode)
Transmit mode 2 layer number.
a unique identifier for an interface.
Definition type-id.h:48
@ ATTR_GET
The attribute can be read.
Definition type-id.h:53
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition type-id.cc:1001
UeMemberLteUePhySapProvider class.
Definition lte-ue-phy.cc:62
void SendRachPreamble(uint32_t prachId, uint32_t raRnti) override
Send a preamble on the PRACH.
Definition lte-ue-phy.cc:99
void NotifyConnectionSuccessful() override
Notify PHY about the successful RRC connection establishment.
void SendLteControlMessage(Ptr< LteControlMessage > msg) override
Send SendLteControlMessage (PDCCH map, CQI feedbacks) using the ideal control channel.
Definition lte-ue-phy.cc:93
void SendMacPdu(Ptr< Packet > p) override
Send the MAC PDU to the channel.
Definition lte-ue-phy.cc:87
UeMemberLteUePhySapProvider(LteUePhy *phy)
Constructor.
Definition lte-ue-phy.cc:81
Hold an unsigned integer type.
Definition uinteger.h:34
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
Definition assert.h:55
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
Definition assert.h:75
Ptr< const AttributeChecker > MakeBooleanChecker()
Definition boolean.cc:113
Ptr< const AttributeAccessor > MakeBooleanAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Definition boolean.h:70
Ptr< const AttributeChecker > MakeDoubleChecker()
Definition double.h:82
Ptr< const AttributeAccessor > MakeDoubleAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Definition double.h:32
Ptr< const AttributeAccessor > MakePointerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Definition pointer.h:248
Ptr< AttributeChecker > MakePointerChecker()
Create a PointerChecker for a type.
Definition pointer.h:269
Ptr< const AttributeAccessor > MakeTimeAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Definition nstime.h:1432
Ptr< const AttributeChecker > MakeTimeChecker()
Helper to make an unbounded Time checker.
Definition nstime.h:1452
Ptr< const AttributeChecker > MakeUintegerChecker()
Definition uinteger.h:85
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Definition uinteger.h:35
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
#define NS_ABORT_MSG_IF(cond, msg)
Abnormal program termination if a condition is true, with a message.
Definition abort.h:97
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition log.h:191
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Definition log.h:257
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
Definition log.h:271
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_LOG_WARN(msg)
Use NS_LOG to output a message of level LOG_WARN.
Definition log.h:250
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
Definition log.h:264
Ptr< T > CreateObject(Args &&... args)
Create an object by type, with varying number of constructor parameters.
Definition object.h:619
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition object-base.h:35
Ptr< T > Create(Ts &&... args)
Create class instances by constructors with varying numbers of arguments and return them by Ptr.
Definition ptr.h:436
Time NanoSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition nstime.h:1380
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition nstime.h:1344
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition nstime.h:1356
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
Create a TraceSourceAccessor which will control access to the underlying trace source.
#define UL_PUSCH_TTIS_DELAY
Definition lte-common.h:17
Every class exported by the ns3 library is enclosed in the ns3 namespace.
std::ostream & operator<<(std::ostream &os, const Angles &a)
Definition angles.cc:148
static const Time UL_DATA_DURATION
Duration of the data portion of a UL subframe.
Definition lte-ue-phy.cc:48
Ptr< T1 > DynamicCast(const Ptr< T2 > &p)
Cast a Ptr.
Definition ptr.h:580
static const Time UL_SRS_DELAY_FROM_SUBFRAME_START
Delay from subframe start to transmission of SRS.
Definition lte-ue-phy.cc:54
std::vector< HarqProcessInfoElement_t > HarqProcessInfoList_t
HarqProcessInfoList_t typedef.
static const int Type0AllocationRbg[4]
Type 0 RBG allocation.
See section 4.3.24 cqiListElement.
std::vector< uint8_t > m_wbCqi
wb CQI
struct SbMeasResult_s m_sbMeasResult
sb measure result
See section 4.3.1 dlDciListElement.
std::vector< uint8_t > m_ndi
New data indicator.
uint8_t m_harqProcess
HARQ process.
uint32_t m_rbBitmap
RB bitmap.
std::vector< uint8_t > m_mcs
MCS.
uint8_t m_resAlloc
The type of resource allocation.
std::vector< uint16_t > m_tbsSize
The TBs size.
std::vector< uint8_t > m_rv
Redundancy version.
uint8_t m_tpc
Tx power control command.
See section 4.3.23 dlInfoListElement.
See section 4.3.27 higherLayerSelected.
std::vector< uint8_t > m_sbCqi
sb CQI
Parameters of the ReportUeMeasurements primitive: RSRP [dBm] and RSRQ [dB] See section 5....
UeMeasurementsParameters structure.
PssElement structure.
Definition lte-ue-phy.h:722
uint16_t cellId
cell ID
Definition lte-ue-phy.h:723
double pssPsdSum
PSS PSD sum.
Definition lte-ue-phy.h:724
uint16_t nRB
number of RB
Definition lte-ue-phy.h:725
Summary results of measuring a specific cell. Used for layer-1 filtering.
Definition lte-ue-phy.h:738
double rsrqSum
Sum of RSRQ sample values in linear unit.
Definition lte-ue-phy.h:741
uint8_t rsrpNum
Number of RSRP samples.
Definition lte-ue-phy.h:740
double rsrpSum
Sum of RSRP sample values in linear unit.
Definition lte-ue-phy.h:739
uint8_t rsrqNum
Number of RSRQ samples.
Definition lte-ue-phy.h:742
PhyTransmissionStatParameters structure.
Definition lte-common.h:177
See section 4.3.25 sbMeasResult.
std::vector< struct HigherLayerSelected_s > m_higherLayerSelected
higher layer selected
See section 4.3.2 ulDciListElement.