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
100{
101 m_phy->DoSendRachPreamble(prachId, raRnti);
102}
103
104void
106{
107 m_phy->DoNotifyConnectionSuccessful();
108}
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
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
467{
468 m_uePhySapUser->ReceivePhyPdu(p);
469}
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 : "
553 << m_p10CqiLast.As(Time::MS));
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 : "
567 << m_a30CqiLast.As(Time::MS));
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(),
588 m_rsReceivedPower.ConstValuesEnd(),
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
631 auto itIntN = m_rsInterferencePower.ConstValuesBegin();
632 auto itPj = m_rsReceivedPower.ConstValuesBegin();
633 for (itPj = m_rsReceivedPower.ConstValuesBegin();
634 itPj != m_rsReceivedPower.ConstValuesEnd();
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
668 m_pssList.clear();
669}
670
671double
673{
674 NS_LOG_FUNCTION(this);
675
676 // averaged SINR among RBs
677 double sum = 0.0;
678 uint8_t rbNum = 0;
679
680 for (auto it = sinr.ConstValuesBegin(); it != sinr.ConstValuesEnd(); it++)
681 {
682 sum += (*it);
683 rbNum++;
684 }
685
686 double avrgSinr = (rbNum > 0) ? (sum / rbNum) : DBL_MAX;
687
688 return avrgSinr;
689}
690
691void
693{
694 // Not used by UE, CQI are based only on RS
695}
696
697void
699{
700 NS_LOG_FUNCTION(this);
701
702 /**
703 * We do not generate the CQI report
704 * when the UE is not synchronized to any cell.
705 *
706 * Also, the RLF is detected after the DL CTRL
707 * is received by the UE,therefore, we do not need
708 * to generate the CQI reports and the UE measurements
709 * for a CTRL for which the RLF has been detected.
710 */
711 if (m_cellId == 0)
712 {
713 return;
714 }
715
717 // NOTE: The SINR received by this method is
718 // based on CTRL, which is not used to compute
719 // PDSCH (i.e., data) based SINR. It is used
720 // for RLF detection.
721 m_ctrlSinrForRlf = sinr;
722
725 mixedSinr.GetSpectrumModel() == m_dataInterferencePower.GetSpectrumModel())
726 {
727 // we have a measurement of interf + noise for the denominator
728 // of SINR = S/(I+N)
729 mixedSinr /= m_dataInterferencePower;
731 NS_LOG_LOGIC("data interf measurement available, SINR = " << mixedSinr);
732 }
733 else if (mixedSinr.GetSpectrumModel() == m_noisePsd->GetSpectrumModel())
734 {
735 // we did not see any interference on data, so interference is
736 // there and we have only noise at the denominator of SINR
737 mixedSinr /= (*m_noisePsd);
738 NS_LOG_LOGIC("no data interf measurement available, SINR = " << mixedSinr);
739 }
740 else
741 {
742 // During a handover the UE PHY is reconfigured to the target cell's
743 // EARFCN/bandwidth, which changes the spectrum model of m_noisePsd
744 // (and m_dataInterferencePower). A control reception that started on
745 // the previous cell can complete after this reconfiguration, leaving
746 // m_rsReceivedPower on a different spectrum model than the denominator.
747 // Dividing mismatched spectrum values would abort (@issueid{447}); the
748 // resulting measurement is meaningless, so skip this CQI report.
750 NS_LOG_LOGIC("spectrum model mismatch (handover reconfiguration), "
751 "skipping mixed CQI report");
752 return;
753 }
754
755 /*
756 * some RBs are not used in PDSCH and their SINR is very high
757 * for example with bandwidth 25, last RB is not used
758 * it can make avgSinr value very high, what is incorrect
759 */
760 uint32_t rbgSize = GetRbgSize();
761 uint32_t modulo = m_dlBandwidth % rbgSize;
762 double avgMixedSinr = 0;
763 uint32_t usedRbgNum = 0;
764 for (uint32_t i = 0; i < (m_dlBandwidth - 1 - modulo); i++)
765 {
766 usedRbgNum++;
767 avgMixedSinr += mixedSinr[i];
768 }
769 avgMixedSinr = avgMixedSinr / usedRbgNum;
770 for (uint32_t i = 0; i < modulo; i++)
771 {
772 mixedSinr[m_dlBandwidth - 1 - i] = avgMixedSinr;
773 }
774
775 GenerateCqiRsrpRsrq(mixedSinr);
776}
777
778void
780{
781 NS_LOG_FUNCTION(this << interf);
783 m_rsInterferencePower = interf;
784}
785
786void
788{
789 NS_LOG_FUNCTION(this << interf);
790
793}
794
795void
797{
798 NS_LOG_FUNCTION(this << power);
800 m_rsReceivedPower = power;
801
803 {
804 double sum = std::reduce(m_rsReceivedPower.ConstValuesBegin(),
805 m_rsReceivedPower.ConstValuesEnd(),
806 0.0);
807 double rsrp = 10 * log10(sum * 180000) + 30;
808
809 NS_LOG_INFO("RSRP: " << rsrp);
810 m_powerControl->SetRsrp(rsrp);
811 }
812}
813
816{
817 NS_LOG_FUNCTION(this);
818
819 // apply transmission mode gain
821 SpectrumValue newSinr = sinr;
822 newSinr *= m_txModeGain.at(m_transmissionMode);
823
824 // CREATE DlCqiLteControlMessage
826 CqiListElement_s dlcqi;
827 std::vector<int> cqi;
829 {
830 cqi = m_amc->CreateCqiFeedbacks(newSinr, m_dlBandwidth);
831
833 auto nbSubChannels = cqi.size();
834 double cqiSum = 0.0;
835 int activeSubChannels = 0;
836 // average the CQIs of the different RBs
837 for (std::size_t i = 0; i < nbSubChannels; i++)
838 {
839 if (cqi.at(i) != -1)
840 {
841 cqiSum += cqi.at(i);
842 activeSubChannels++;
843 }
844 NS_LOG_DEBUG(this << " subch " << i << " cqi " << cqi.at(i));
845 }
846 dlcqi.m_rnti = m_rnti;
847 dlcqi.m_ri = 1; // not yet used
848 dlcqi.m_cqiType = CqiListElement_s::P10; // Periodic CQI using PUCCH wideband
849 NS_ASSERT_MSG(nLayer > 0, " nLayer negative");
850 NS_ASSERT_MSG(nLayer < 3, " nLayer limit is 2s");
851 for (uint8_t i = 0; i < nLayer; i++)
852 {
853 if (activeSubChannels > 0)
854 {
855 dlcqi.m_wbCqi.push_back((uint16_t)cqiSum / activeSubChannels);
856 }
857 else
858 {
859 // approximate with the worst case -> CQI = 1
860 dlcqi.m_wbCqi.push_back(1);
861 }
862 }
863 // NS_LOG_DEBUG (this << " Generate P10 CQI feedback " << (uint16_t) cqiSum /
864 // activeSubChannels);
865 dlcqi.m_wbPmi = 0; // not yet used
866 // dl.cqi.m_sbMeasResult others CQI report modes: not yet implemented
867 }
869 {
870 cqi = m_amc->CreateCqiFeedbacks(newSinr, GetRbgSize());
872 auto nbSubChannels = cqi.size();
873 int rbgSize = GetRbgSize();
874 double cqiSum = 0.0;
875 int cqiNum = 0;
876 SbMeasResult_s rbgMeas;
877 // NS_LOG_DEBUG (this << " Create A30 CQI feedback, RBG " << rbgSize << " cqiNum " <<
878 // nbSubChannels << " band " << (uint16_t)m_dlBandwidth);
879 for (std::size_t i = 0; i < nbSubChannels; i++)
880 {
881 if (cqi.at(i) != -1)
882 {
883 cqiSum += cqi.at(i);
884 }
885 // else "nothing" no CQI is treated as CQI = 0 (worst case scenario)
886 cqiNum++;
887 if (cqiNum == rbgSize)
888 {
889 // average the CQIs of the different RBGs
890 // NS_LOG_DEBUG (this << " RBG CQI " << (uint16_t) cqiSum / rbgSize);
892 hlCqi.m_sbPmi = 0; // not yet used
893 for (uint8_t i = 0; i < nLayer; i++)
894 {
895 hlCqi.m_sbCqi.push_back((uint16_t)cqiSum / rbgSize);
896 }
897 rbgMeas.m_higherLayerSelected.push_back(hlCqi);
898 cqiSum = 0.0;
899 cqiNum = 0;
900 }
901 }
902 dlcqi.m_rnti = m_rnti;
903 dlcqi.m_ri = 1; // not yet used
904 dlcqi.m_cqiType = CqiListElement_s::A30; // Aperidic CQI using PUSCH
905 // dlcqi.m_wbCqi.push_back ((uint16_t) cqiSum / nbSubChannels);
906 dlcqi.m_wbPmi = 0; // not yet used
907 dlcqi.m_sbMeasResult = rbgMeas;
908 }
909
910 msg->SetDlCqi(dlcqi);
911 return msg;
912}
913
914void
916{
918 NS_LOG_DEBUG(this << " Report UE Measurements ");
919
921
922 for (auto it = m_ueMeasurementsMap.begin(); it != m_ueMeasurementsMap.end(); it++)
923 {
924 double avg_rsrp = (*it).second.rsrpSum / (double)(*it).second.rsrpNum;
925 double avg_rsrq = (*it).second.rsrqSum / (double)(*it).second.rsrqNum;
926 /*
927 * In CELL_SEARCH state, this may result in avg_rsrq = 0/0 = -nan.
928 * UE RRC must take this into account when receiving measurement reports.
929 * TODO remove this shortcoming by calculating RSRQ during CELL_SEARCH
930 */
931 NS_LOG_DEBUG(this << " CellId " << (*it).first << " RSRP " << avg_rsrp << " (nSamples "
932 << (uint16_t)(*it).second.rsrpNum << ")"
933 << " RSRQ " << avg_rsrq << " (nSamples " << (uint16_t)(*it).second.rsrqNum
934 << ")"
935 << " ComponentCarrierID " << (uint16_t)m_componentCarrierId);
936
938 newEl.m_cellId = (*it).first;
939 newEl.m_rsrp = avg_rsrp;
940 newEl.m_rsrq = avg_rsrq;
941 ret.m_ueMeasurementsList.push_back(newEl);
943
944 // report to UE measurements trace
946 (*it).first,
947 avg_rsrp,
948 avg_rsrq,
949 (*it).first == m_cellId,
951 }
952
953 // report to RRC
954 m_ueCphySapUser->ReportUeMeasurements(ret);
955
956 m_ueMeasurementsMap.clear();
958}
959
960void
962{
963 NS_LOG_FUNCTION(this << cqiPeriodicity);
964 m_a30CqiPeriodicity = cqiPeriodicity;
965 m_p10CqiPeriodicity = cqiPeriodicity;
966}
967
968void
975
976void
978{
979 NS_LOG_FUNCTION(this << raPreambleId);
980
981 // unlike other control messages, RACH preamble is sent ASAP
983 msg->SetRapId(raPreambleId);
984 m_raPreambleId = raPreambleId;
985 m_raRnti = raRnti;
986 m_controlMessagesQueue.at(0).emplace_back(msg);
987}
988
989void
991{
992 /**
993 * Radio link failure detection should take place only on the
994 * primary carrier to avoid errors due to multiple calls to the
995 * same methods at the RRC layer
996 */
997 if (m_componentCarrierId == 0)
998 {
999 m_isConnected = true;
1000 // Initialize the parameters for radio link failure detection
1002 }
1003}
1004
1005void
1007{
1008 NS_LOG_FUNCTION(this);
1009
1010 NS_LOG_DEBUG(this << " I am rnti = " << m_rnti << " and I received msgs "
1011 << (uint16_t)msgList.size());
1012 for (auto it = msgList.begin(); it != msgList.end(); it++)
1013 {
1014 Ptr<LteControlMessage> msg = (*it);
1015
1016 if (msg->GetMessageType() == LteControlMessage::DL_DCI)
1017 {
1019
1020 DlDciListElement_s dci = msg2->GetDci();
1021 if (dci.m_rnti != m_rnti)
1022 {
1023 // DCI not for me
1024 continue;
1025 }
1026
1027 if (dci.m_resAlloc != 0)
1028 {
1029 NS_FATAL_ERROR("Resource Allocation type not implemented");
1030 }
1031
1032 std::vector<int> dlRb;
1033
1034 // translate the DCI to Spectrum framework
1035 uint32_t mask = 0x1;
1036 for (int i = 0; i < 32; i++)
1037 {
1038 if (((dci.m_rbBitmap & mask) >> i) == 1)
1039 {
1040 for (int k = 0; k < GetRbgSize(); k++)
1041 {
1042 dlRb.push_back((i * GetRbgSize()) + k);
1043 // NS_LOG_DEBUG(this << " RNTI " << m_rnti << " RBG " << i << "
1044 // DL-DCI allocated PRB " << (i*GetRbgSize()) + k);
1045 }
1046 }
1047 mask = (mask << 1);
1048 }
1050 {
1051 m_powerControl->ReportTpc(dci.m_tpc);
1052 }
1053
1054 // send TB info to LteSpectrumPhy
1055 NS_LOG_DEBUG(this << " UE " << m_rnti << " DL-DCI " << dci.m_rnti << " bitmap "
1056 << dci.m_rbBitmap);
1057 for (std::size_t i = 0; i < dci.m_tbsSize.size(); i++)
1058 {
1059 m_downlinkSpectrumPhy->AddExpectedTb(dci.m_rnti,
1060 dci.m_ndi.at(i),
1061 dci.m_tbsSize.at(i),
1062 dci.m_mcs.at(i),
1063 dlRb,
1064 i,
1065 dci.m_harqProcess,
1066 dci.m_rv.at(i),
1067 true /* DL */);
1068 }
1069
1071 }
1072 else if (msg->GetMessageType() == LteControlMessage::UL_DCI)
1073 {
1074 // set the uplink bandwidth according to the UL-CQI
1076 UlDciListElement_s dci = msg2->GetDci();
1077 if (dci.m_rnti != m_rnti)
1078 {
1079 // DCI not for me
1080 continue;
1081 }
1082 NS_LOG_INFO(this << " UL DCI");
1083 std::vector<int> ulRb;
1084 ulRb.reserve(dci.m_rbLen);
1085 for (int i = 0; i < dci.m_rbLen; i++)
1086 {
1087 ulRb.push_back(i + dci.m_rbStart);
1088 // NS_LOG_DEBUG (this << " UE RB " << i + dci.m_rbStart);
1089 }
1092 // fire trace of UL Tx PHY stats
1093 HarqProcessInfoList_t harqInfoList = m_harqPhyModule->GetHarqProcessInfoUl(m_rnti, 0);
1095 params.m_cellId = m_cellId;
1096 params.m_imsi = 0; // it will be set by DlPhyTransmissionCallback in LteHelper
1097 params.m_timestamp = Simulator::Now().GetMilliSeconds() + UL_PUSCH_TTIS_DELAY;
1098 params.m_rnti = m_rnti;
1099 params.m_txMode = 0; // always SISO for UE
1100 params.m_layer = 0;
1101 params.m_mcs = dci.m_mcs;
1102 params.m_size = dci.m_tbSize;
1103 params.m_rv = harqInfoList.size();
1104 params.m_ndi = dci.m_ndi;
1105 params.m_ccId = m_componentCarrierId;
1106 m_ulPhyTransmission(params);
1107 // pass the info to the MAC
1108 m_uePhySapUser->ReceiveLteControlMessage(msg);
1109 }
1110 else if (msg->GetMessageType() == LteControlMessage::RAR)
1111 {
1113 if (rarMsg->GetRaRnti() == m_raRnti)
1114 {
1115 for (auto it = rarMsg->RarListBegin(); it != rarMsg->RarListEnd(); ++it)
1116 {
1117 if (it->rapId != m_raPreambleId)
1118 {
1119 // UL grant not for me
1120 continue;
1121 }
1122 else
1123 {
1124 NS_LOG_INFO("received RAR RNTI " << m_raRnti);
1125 // set the uplink bandwidth according to the UL grant
1126 std::vector<int> ulRb;
1127 ulRb.reserve(it->rarPayload.m_grant.m_rbLen);
1128 for (int i = 0; i < it->rarPayload.m_grant.m_rbLen; i++)
1129 {
1130 ulRb.push_back(i + it->rarPayload.m_grant.m_rbStart);
1131 }
1132
1134 // pass the info to the MAC
1135 m_uePhySapUser->ReceiveLteControlMessage(msg);
1136 // reset RACH variables with out of range values
1137 m_raPreambleId = 255;
1138 m_raRnti = 11;
1139 }
1140 }
1141 }
1142 }
1143 else if (msg->GetMessageType() == LteControlMessage::MIB)
1144 {
1145 NS_LOG_INFO("received MIB");
1146 NS_ASSERT(m_cellId > 0);
1148 m_ueCphySapUser->RecvMasterInformationBlock(m_cellId, msg2->GetMib());
1149 }
1150 else if (msg->GetMessageType() == LteControlMessage::SIB1)
1151 {
1152 NS_LOG_INFO("received SIB1");
1153 NS_ASSERT(m_cellId > 0);
1155 m_ueCphySapUser->RecvSystemInformationBlockType1(m_cellId, msg2->GetSib1());
1156 }
1157 else
1158 {
1159 // pass the message to UE-MAC
1160 m_uePhySapUser->ReceiveLteControlMessage(msg);
1161 }
1162 }
1163}
1164
1165void
1167{
1168 NS_LOG_FUNCTION(this << cellId << (*p));
1169
1170 uint16_t nRB = p->GetValuesN();
1171 // sum PSD [W/Hz] of all bands
1172 double sum = std::reduce(p->ConstValuesBegin(), p->ConstValuesEnd(), 0.0);
1173
1174 // convert PSD [W/Hz] to linear power [W]
1175 sum *= (180000.0 / 12.0);
1176
1177 // measure instantaneous RSRP now
1178 double rsrp_dBm = 10 * log10(1000 * (sum / (double)nRB));
1179 NS_LOG_INFO(this << " PSS RNTI " << m_rnti << " cellId " << m_cellId << " has RSRP " << rsrp_dBm
1180 << " and RBnum " << nRB);
1181 // note that m_pssReceptionThreshold does not apply here
1182
1183 // store measurements
1184 auto itMeasMap = m_ueMeasurementsMap.find(cellId);
1185 if (itMeasMap == m_ueMeasurementsMap.end())
1186 {
1187 // insert new entry
1189 newEl.rsrpSum = rsrp_dBm;
1190 newEl.rsrpNum = 1;
1191 newEl.rsrqSum = 0;
1192 newEl.rsrqNum = 0;
1193 m_ueMeasurementsMap.insert(std::pair<uint16_t, UeMeasurementsElement>(cellId, newEl));
1194 }
1195 else
1196 {
1197 (*itMeasMap).second.rsrpSum += rsrp_dBm;
1198 (*itMeasMap).second.rsrpNum++;
1199 }
1200
1201 /*
1202 * Collect the PSS for later processing in GenerateCtrlCqiReport()
1203 * (to be called from ChunkProcessor after RX is finished).
1204 */
1205 m_pssReceived = true;
1206 PssElement el;
1207 el.cellId = cellId;
1208 el.pssPsdSum = sum;
1209 el.nRB = nRB;
1210 m_pssList.push_back(el);
1211}
1212
1213void
1218
1219void
1221{
1222 NS_LOG_FUNCTION(this << frameNo << subframeNo);
1223
1224 NS_ASSERT_MSG(frameNo > 0, "the SRS index check code assumes that frameNo starts at 1");
1225
1226 // refresh internal variables
1229 m_pssReceived = false;
1230
1231 if (m_ulConfigured)
1232 {
1233 // update uplink transmission mask according to previous UL-CQIs
1234 std::vector<int> rbMask = m_subChannelsForTransmissionQueue.at(0);
1236
1237 // shift the queue
1238 for (uint8_t i = 1; i < m_macChTtiDelay; i++)
1239 {
1241 }
1243
1245 {
1246 NS_ASSERT_MSG(subframeNo > 0 && subframeNo <= 10,
1247 "the SRS index check code assumes that subframeNo starts at 1");
1248 if ((((frameNo - 1) * 10 + (subframeNo - 1)) % m_srsPeriodicity) == m_srsSubframeOffset)
1249 {
1250 NS_LOG_INFO("frame " << frameNo << " subframe " << subframeNo
1251 << " sending SRS (offset=" << m_srsSubframeOffset
1252 << ", period=" << m_srsPeriodicity << ")");
1255 }
1256 }
1257
1258 std::list<Ptr<LteControlMessage>> ctrlMsg = GetControlMessages();
1259 // send packets in queue
1260 NS_LOG_LOGIC(this << " UE - start slot for PUSCH + PUCCH - RNTI " << m_rnti << " CELLID "
1261 << m_cellId);
1262 // send the current burts of packets
1264 if (pb)
1265 {
1267 {
1268 m_txPower = m_powerControl->GetPuschTxPower(rbMask);
1270 }
1271 m_uplinkSpectrumPhy->StartTxDataFrame(pb, ctrlMsg, UL_DATA_DURATION);
1272 }
1273 else
1274 {
1275 // send only PUCCH (ideal: fake null bandwidth signal)
1276 if (!ctrlMsg.empty())
1277 {
1278 NS_LOG_LOGIC(this << " UE - start TX PUCCH (NO PUSCH)");
1279 std::vector<int> dlRb;
1280
1282 {
1283 m_txPower = m_powerControl->GetPucchTxPower(dlRb);
1284 }
1285
1287 m_uplinkSpectrumPhy->StartTxDataFrame(pb, ctrlMsg, UL_DATA_DURATION);
1288 }
1289 else
1290 {
1291 NS_LOG_LOGIC(this << " UE - UL NOTHING TO SEND");
1292 }
1293 }
1294 }
1295
1296 // trigger the MAC
1297 m_uePhySapUser->SubframeIndication(frameNo, subframeNo);
1298
1299 m_subframeNo = subframeNo;
1300 ++subframeNo;
1301 if (subframeNo > 10)
1302 {
1303 ++frameNo;
1304 subframeNo = 1;
1305 }
1306
1307 // schedule next subframe indication
1310 this,
1311 frameNo,
1312 subframeNo);
1313}
1314
1315void
1317{
1318 NS_LOG_FUNCTION(this << " UE " << m_rnti << " start tx SRS, cell Id " << (uint32_t)m_cellId);
1319 NS_ASSERT(m_cellId > 0);
1320 // set the current tx power spectral density (full bandwidth)
1321 std::vector<int> dlRb;
1322 dlRb.reserve(m_ulBandwidth);
1323 for (uint16_t i = 0; i < m_ulBandwidth; i++)
1324 {
1325 dlRb.push_back(i);
1326 }
1327
1329 {
1330 m_txPower = m_powerControl->GetSrsTxPower(dlRb);
1331 }
1332
1334 m_uplinkSpectrumPhy->StartTxUlSrsFrame();
1335}
1336
1337void
1339{
1340 NS_LOG_FUNCTION(this);
1341
1342 m_rnti = 0;
1343 m_cellId = 0;
1344 m_isConnected = false;
1346 m_srsPeriodicity = 0;
1347 m_srsConfigured = false;
1348 m_dlConfigured = false;
1349 m_ulConfigured = false;
1350 m_raPreambleId = 255; // value out of range
1351 m_raRnti = 11; // value out of range
1355 m_paLinear = 1;
1356
1360
1361 m_packetBurstQueue.clear();
1362 m_controlMessagesQueue.clear();
1364 for (int i = 0; i < m_macChTtiDelay; i++)
1365 {
1367 m_packetBurstQueue.push_back(pb);
1368 std::list<Ptr<LteControlMessage>> l;
1369 m_controlMessagesQueue.push_back(l);
1370 }
1371 std::vector<int> ulRb;
1373
1374 m_sendSrsEvent.Cancel();
1375 m_downlinkSpectrumPhy->Reset();
1376 m_uplinkSpectrumPhy->Reset();
1377 m_pssList.clear();
1378 /**
1379 * Call the EndRx() method of the interference model for DL control and data
1380 * to cancel any ongoing downlink reception of control and data info.
1381 */
1382 m_downlinkSpectrumPhy->m_interferenceCtrl->EndRx();
1383 m_downlinkSpectrumPhy->m_interferenceData->EndRx();
1384}
1385
1386void
1388{
1389 NS_LOG_FUNCTION(this << dlEarfcn);
1390 m_dlEarfcn = dlEarfcn;
1391 DoSetDlBandwidth(6); // configure DL for receiving PSS
1393}
1394
1395void
1397{
1398 NS_LOG_FUNCTION(this << cellId << dlEarfcn);
1399 m_dlEarfcn = dlEarfcn;
1400 DoSynchronizeWithEnb(cellId);
1401}
1402
1403void
1405{
1406 NS_LOG_FUNCTION(this << cellId);
1407
1408 if (cellId == 0)
1409 {
1410 NS_FATAL_ERROR("Cell ID shall not be zero");
1411 }
1412
1413 m_cellId = cellId;
1414 m_downlinkSpectrumPhy->SetCellId(cellId);
1415 m_uplinkSpectrumPhy->SetCellId(cellId);
1416
1417 // configure DL for receiving the BCH with the minimum bandwidth
1419
1420 m_dlConfigured = false;
1421 m_ulConfigured = false;
1422
1424}
1425
1426uint16_t
1428{
1429 return m_cellId;
1430}
1431
1434{
1435 return m_dlEarfcn;
1436}
1437
1438void
1439LteUePhy::DoSetDlBandwidth(uint16_t dlBandwidth)
1440{
1441 NS_LOG_FUNCTION(this << (uint32_t)dlBandwidth);
1442 if (m_dlBandwidth != dlBandwidth or !m_dlConfigured)
1443 {
1444 m_dlBandwidth = dlBandwidth;
1445
1446 m_rbgSize = GetLteRbgSize(dlBandwidth);
1447
1451 m_downlinkSpectrumPhy->SetNoisePowerSpectralDensity(m_noisePsd);
1452 m_downlinkSpectrumPhy->GetChannel()->AddRx(m_downlinkSpectrumPhy);
1453 }
1454 m_dlConfigured = true;
1455}
1456
1457void
1458LteUePhy::DoConfigureUplink(uint32_t ulEarfcn, uint16_t ulBandwidth)
1459{
1460 m_ulEarfcn = ulEarfcn;
1461 m_ulBandwidth = ulBandwidth;
1462 m_ulConfigured = true;
1463}
1464
1465void
1467{
1468 NS_LOG_FUNCTION(this);
1469 m_powerControl->ConfigureReferenceSignalPower(referenceSignalPower);
1470}
1471
1472void
1474{
1475 NS_LOG_FUNCTION(this << rnti);
1476 m_rnti = rnti;
1477
1478 m_powerControl->SetCellId(m_cellId);
1479 m_powerControl->SetRnti(m_rnti);
1480}
1481
1482void
1484{
1485 NS_LOG_FUNCTION(this << (uint16_t)txMode);
1486 m_transmissionMode = txMode;
1487 m_downlinkSpectrumPhy->SetTransmissionMode(txMode);
1488}
1489
1490void
1492{
1493 NS_LOG_FUNCTION(this << srcCi);
1496 m_srsConfigured = true;
1497
1498 // a guard time is needed for the case where the SRS periodicity is changed dynamically at run
1499 // time if we use a static one, we can have a 0ms guard time
1501 NS_LOG_DEBUG(this << " UE SRS P " << m_srsPeriodicity << " RNTI " << m_rnti << " offset "
1502 << m_srsSubframeOffset << " cellId " << m_cellId << " CI " << srcCi);
1503}
1504
1505void
1507{
1508 NS_LOG_FUNCTION(this << pa);
1509 m_paLinear = pow(10, (pa / 10));
1510}
1511
1512void
1513LteUePhy::DoSetRsrpFilterCoefficient(uint8_t rsrpFilterCoefficient)
1514{
1515 NS_LOG_FUNCTION(this << (uint16_t)(rsrpFilterCoefficient));
1516 m_powerControl->SetRsrpFilterCoefficient(rsrpFilterCoefficient);
1517}
1518
1519void
1521{
1522 NS_LOG_FUNCTION(this);
1523 m_downlinkSpectrumPhy->m_harqPhyModule->ClearDlHarqBuffer(m_rnti); // flush HARQ buffers
1526 m_pssReceived = false;
1527 DoReset();
1528}
1529
1530void
1537
1538void
1540{
1541 NS_LOG_FUNCTION(this);
1542 // indicates that the downlink radio link quality has to be monitored for in-sync indications
1543 m_downlinkInSync = false;
1544}
1545
1546void
1548{
1549 NS_LOG_FUNCTION(this);
1550 m_imsi = imsi;
1551}
1552
1553void
1555{
1556 NS_LOG_FUNCTION(this);
1557 m_numOfSubframes = 0;
1558 m_sinrDbFrame = 0;
1559 m_numOfFrames = 0;
1560 m_downlinkInSync = true;
1561}
1562
1563void
1565{
1566 NS_LOG_FUNCTION(this << sinrDb);
1567 m_sinrDbFrame += sinrDb;
1569 NS_LOG_LOGIC("No of Subframes: " << m_numOfSubframes
1570 << " UE synchronized: " << m_downlinkInSync);
1571 // check for out_of_sync indications first when UE is both DL and UL synchronized
1572 // m_downlinkInSync=true indicates that the evaluation is for out-of-sync indications
1574 {
1575 /**
1576 * For every frame, if the downlink radio link quality(avg SINR)
1577 * is less than the threshold Qout, then the frame cannot be decoded
1578 */
1580 {
1581 m_numOfFrames++; // increment the counter if a frame cannot be decoded
1582 NS_LOG_LOGIC("No of Frames which cannot be decoded: " << m_numOfFrames);
1583 }
1584 else
1585 {
1586 /**
1587 * If the downlink radio link quality(avg SINR) is greater
1588 * than the threshold Qout, then the frame counter is reset
1589 * since only consecutive frames should be considered.
1590 */
1591 NS_LOG_INFO("Resetting frame counter at phy. Current value = " << m_numOfFrames);
1592 m_numOfFrames = 0;
1593 // Also reset the sync indicator counter at RRC
1594 m_ueCphySapUser->ResetSyncIndicationCounter();
1595 }
1596 m_numOfSubframes = 0;
1597 m_sinrDbFrame = 0;
1598 }
1599 /**
1600 * Once the number of consecutive frames which cannot be decoded equals
1601 * the Qout evaluation period (i.e 200ms), then an out-of-sync indication
1602 * is sent to the RRC layer
1603 */
1605 {
1606 NS_LOG_LOGIC("At " << Simulator::Now().As(Time::MS)
1607 << " ms UE PHY sending out of sync indication to UE RRC layer");
1608 m_ueCphySapUser->NotifyOutOfSync();
1609 m_numOfFrames = 0;
1610 }
1611 // check for in_sync indications when T310 timer is started
1612 // m_downlinkInSync=false indicates that the evaluation is for in-sync indications
1613 if (!m_downlinkInSync && m_numOfSubframes == 10)
1614 {
1615 /**
1616 * For every frame, if the downlink radio link quality(avg SINR)
1617 * is greater than the threshold Qin, then the frame can be
1618 * successfully decoded.
1619 */
1621 {
1622 m_numOfFrames++; // increment the counter if a frame can be decoded
1623 NS_LOG_LOGIC("No of Frames successfully decoded: " << m_numOfFrames);
1624 }
1625 else
1626 {
1627 /**
1628 * If the downlink radio link quality(avg SINR) is less
1629 * than the threshold Qin, then the frame counter is reset
1630 * since only consecutive frames should be considered
1631 */
1632 m_numOfFrames = 0;
1633 // Also reset the sync indicator counter at RRC
1634 m_ueCphySapUser->ResetSyncIndicationCounter();
1635 }
1636 m_numOfSubframes = 0;
1637 m_sinrDbFrame = 0;
1638 }
1639 /**
1640 * Once the number of consecutive frames which can be decoded equals the Qin evaluation period
1641 * (i.e 100ms), then an in-sync indication is sent to the RRC layer
1642 */
1644 {
1645 NS_LOG_LOGIC("At " << Simulator::Now().As(Time::MS)
1646 << " ms UE PHY sending in sync indication to UE RRC layer");
1647 m_ueCphySapUser->NotifyInSync();
1648 m_numOfFrames = 0;
1649 }
1650}
1651
1652void
1654{
1655 SetTxModeGain(1, gain);
1656}
1657
1658void
1660{
1661 SetTxModeGain(2, gain);
1662}
1663
1664void
1666{
1667 SetTxModeGain(3, gain);
1668}
1669
1670void
1672{
1673 SetTxModeGain(4, gain);
1674}
1675
1676void
1678{
1679 SetTxModeGain(5, gain);
1680}
1681
1682void
1684{
1685 SetTxModeGain(6, gain);
1686}
1687
1688void
1690{
1691 SetTxModeGain(7, gain);
1692}
1693
1694void
1695LteUePhy::SetTxModeGain(uint8_t txMode, double gain)
1696{
1697 NS_LOG_FUNCTION(this << gain);
1698 if (txMode > 0)
1699 {
1700 // convert to linear
1701 double gainLin = std::pow(10.0, (gain / 10.0));
1702 if (m_txModeGain.size() < txMode)
1703 {
1704 m_txModeGain.resize(txMode);
1705 }
1706 m_txModeGain.at(txMode - 1) = gainLin;
1707 }
1708 // forward the info to DL LteSpectrumPhy
1709 m_downlinkSpectrumPhy->SetTxModeGain(txMode, gain);
1710}
1711
1712void
1714{
1715 NS_LOG_FUNCTION(this);
1716 // get the feedback from LteSpectrumPhy and send it through ideal PUCCH to eNB
1718 msg->SetDlHarqFeedback(m);
1719 SetControlMessages(msg);
1720}
1721
1722void
1727
1730{
1731 NS_LOG_FUNCTION(this);
1732 return m_state;
1733}
1734
1735void
1737{
1738 NS_LOG_FUNCTION(this << newState);
1739 State oldState = m_state;
1740 m_state = newState;
1741 NS_LOG_INFO(this << " cellId=" << m_cellId << " rnti=" << m_rnti << " UePhy " << oldState
1742 << " --> " << newState);
1743 m_stateTransitionTrace(m_cellId, m_rnti, oldState, newState);
1744}
1745
1746std::ostream&
1747operator<<(std::ostream& os, LteUePhy::State state)
1748{
1749 switch (state)
1750 {
1752 return os << "CELL_SEARCH";
1754 return os << "SYNCHRONIZED";
1756 return os << "NUM_STATES";
1757 };
1758 return os << "UNKNOWN(" << static_cast<uint32_t>(state) << ")";
1759}
1760
1761} // namespace ns3
This class can be used to hold variables of floating point type such as 'double' or 'float'.
Definition double.h:31
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.
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
Time m_ueMeasurementsFilterLast
Definition lte-ue-phy.h:756
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 DoInitialize()
Initialize() implementation.
Definition object.cc:438
AttributeValue implementation for Pointer.
Definition pointer.h:37
Smart pointer class similar to boost::intrusive_ptr.
Definition ptr.h:70
static EventId Schedule(const Time &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
Definition simulator.h:580
static void ScheduleWithContext(uint32_t context, const Time &delay, FUNC f, Ts &&... args)
Schedule an event with the given context.
Definition simulator.h:597
static Time Now()
Return the current simulation virtual time.
Definition simulator.cc:191
Set of values corresponding to a given SpectrumModel.
Values::const_iterator ConstValuesBegin() const
Ptr< const SpectrumModel > GetSpectrumModel() const
Values::const_iterator ConstValuesEnd() const
Simulation virtual time values and global simulation resolution.
Definition nstime.h:95
@ MS
millisecond
Definition nstime.h:107
int64_t GetMilliSeconds() const
Get an approximation of the time stored in this instance in the indicated unit.
Definition nstime.h:403
static uint8_t TxMode2LayerNum(uint8_t txMode)
Transmit mode 2 layer number.
a unique identifier for an interface.
Definition type-id.h:50
@ ATTR_GET
The attribute can be read.
Definition type-id.h:55
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition type-id.cc:1003
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:76
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:250
Ptr< AttributeChecker > MakePointerChecker()
Create a PointerChecker for a type.
Definition pointer.h:273
#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:99
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition log.h:201
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Definition log.h:267
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
Definition log.h:281
#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:260
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
Definition log.h:274
Ptr< T > CreateObject(Args &&... args)
Create an object by type, with varying number of constructor parameters.
Definition object.h:627
#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:492
Time NanoSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition nstime.h:1364
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition nstime.h:1313
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition nstime.h:1330
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:18
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Ptr< const AttributeChecker > MakeBooleanChecker()
Definition boolean.cc:113
Ptr< const AttributeChecker > MakeUintegerChecker()
Definition uinteger.h:85
Ptr< const AttributeAccessor > MakeTimeAccessor(T1 a1)
Definition nstime.h:1416
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Definition uinteger.h:35
Ptr< const AttributeChecker > MakeDoubleChecker()
Definition double.h:82
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:643
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.
Ptr< const AttributeAccessor > MakeBooleanAccessor(T1 a1)
Definition boolean.h:70
Ptr< const AttributeAccessor > MakeDoubleAccessor(T1 a1)
Definition double.h:32
std::size_t GetLteRbgSize(uint16_t dlBandwidth)
Get the Type 0 resource block group (RBG) size for a downlink bandwidth, according to 3GPP TS 36....
Definition lte-common.cc:36
Ptr< const AttributeChecker > MakeTimeChecker()
Helper to make an unbounded Time checker.
Definition nstime.h:1436
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.
std::vector< UeMeasurementsElement > m_ueMeasurementsList
UE measurement list.
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:187
See section 4.3.25 sbMeasResult.
std::vector< struct HigherLayerSelected_s > m_higherLayerSelected
higher layer selected
See section 4.3.2 ulDciListElement.