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
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 {
726 // we have a measurement of interf + noise for the denominator
727 // of SINR = S/(I+N)
728 mixedSinr /= m_dataInterferencePower;
730 NS_LOG_LOGIC("data interf measurement available, SINR = " << mixedSinr);
731 }
732 else
733 {
734 // we did not see any interference on data, so interference is
735 // there and we have only noise at the denominator of SINR
736 mixedSinr /= (*m_noisePsd);
737 NS_LOG_LOGIC("no data interf measurement available, SINR = " << mixedSinr);
738 }
739
740 /*
741 * some RBs are not used in PDSCH and their SINR is very high
742 * for example with bandwidth 25, last RB is not used
743 * it can make avgSinr value very high, what is incorrect
744 */
745 uint32_t rbgSize = GetRbgSize();
746 uint32_t modulo = m_dlBandwidth % rbgSize;
747 double avgMixedSinr = 0;
748 uint32_t usedRbgNum = 0;
749 for (uint32_t i = 0; i < (m_dlBandwidth - 1 - modulo); i++)
750 {
751 usedRbgNum++;
752 avgMixedSinr += mixedSinr[i];
753 }
754 avgMixedSinr = avgMixedSinr / usedRbgNum;
755 for (uint32_t i = 0; i < modulo; i++)
756 {
757 mixedSinr[m_dlBandwidth - 1 - i] = avgMixedSinr;
758 }
759
760 GenerateCqiRsrpRsrq(mixedSinr);
761}
762
763void
765{
766 NS_LOG_FUNCTION(this << interf);
768 m_rsInterferencePower = interf;
769}
770
771void
773{
774 NS_LOG_FUNCTION(this << interf);
775
778}
779
780void
782{
783 NS_LOG_FUNCTION(this << power);
785 m_rsReceivedPower = power;
786
788 {
789 double sum = std::reduce(m_rsReceivedPower.ConstValuesBegin(),
791 0.0);
792 double rsrp = 10 * log10(sum * 180000) + 30;
793
794 NS_LOG_INFO("RSRP: " << rsrp);
795 m_powerControl->SetRsrp(rsrp);
796 }
797}
798
801{
802 NS_LOG_FUNCTION(this);
803
804 // apply transmission mode gain
806 SpectrumValue newSinr = sinr;
807 newSinr *= m_txModeGain.at(m_transmissionMode);
808
809 // CREATE DlCqiLteControlMessage
811 CqiListElement_s dlcqi;
812 std::vector<int> cqi;
814 {
815 cqi = m_amc->CreateCqiFeedbacks(newSinr, m_dlBandwidth);
816
818 auto nbSubChannels = cqi.size();
819 double cqiSum = 0.0;
820 int activeSubChannels = 0;
821 // average the CQIs of the different RBs
822 for (std::size_t i = 0; i < nbSubChannels; i++)
823 {
824 if (cqi.at(i) != -1)
825 {
826 cqiSum += cqi.at(i);
827 activeSubChannels++;
828 }
829 NS_LOG_DEBUG(this << " subch " << i << " cqi " << cqi.at(i));
830 }
831 dlcqi.m_rnti = m_rnti;
832 dlcqi.m_ri = 1; // not yet used
833 dlcqi.m_cqiType = CqiListElement_s::P10; // Periodic CQI using PUCCH wideband
834 NS_ASSERT_MSG(nLayer > 0, " nLayer negative");
835 NS_ASSERT_MSG(nLayer < 3, " nLayer limit is 2s");
836 for (uint8_t i = 0; i < nLayer; i++)
837 {
838 if (activeSubChannels > 0)
839 {
840 dlcqi.m_wbCqi.push_back((uint16_t)cqiSum / activeSubChannels);
841 }
842 else
843 {
844 // approximate with the worst case -> CQI = 1
845 dlcqi.m_wbCqi.push_back(1);
846 }
847 }
848 // NS_LOG_DEBUG (this << " Generate P10 CQI feedback " << (uint16_t) cqiSum /
849 // activeSubChannels);
850 dlcqi.m_wbPmi = 0; // not yet used
851 // dl.cqi.m_sbMeasResult others CQI report modes: not yet implemented
852 }
854 {
855 cqi = m_amc->CreateCqiFeedbacks(newSinr, GetRbgSize());
857 auto nbSubChannels = cqi.size();
858 int rbgSize = GetRbgSize();
859 double cqiSum = 0.0;
860 int cqiNum = 0;
861 SbMeasResult_s rbgMeas;
862 // NS_LOG_DEBUG (this << " Create A30 CQI feedback, RBG " << rbgSize << " cqiNum " <<
863 // nbSubChannels << " band " << (uint16_t)m_dlBandwidth);
864 for (std::size_t i = 0; i < nbSubChannels; i++)
865 {
866 if (cqi.at(i) != -1)
867 {
868 cqiSum += cqi.at(i);
869 }
870 // else "nothing" no CQI is treated as CQI = 0 (worst case scenario)
871 cqiNum++;
872 if (cqiNum == rbgSize)
873 {
874 // average the CQIs of the different RBGs
875 // NS_LOG_DEBUG (this << " RBG CQI " << (uint16_t) cqiSum / rbgSize);
877 hlCqi.m_sbPmi = 0; // not yet used
878 for (uint8_t i = 0; i < nLayer; i++)
879 {
880 hlCqi.m_sbCqi.push_back((uint16_t)cqiSum / rbgSize);
881 }
882 rbgMeas.m_higherLayerSelected.push_back(hlCqi);
883 cqiSum = 0.0;
884 cqiNum = 0;
885 }
886 }
887 dlcqi.m_rnti = m_rnti;
888 dlcqi.m_ri = 1; // not yet used
889 dlcqi.m_cqiType = CqiListElement_s::A30; // Aperidic CQI using PUSCH
890 // dlcqi.m_wbCqi.push_back ((uint16_t) cqiSum / nbSubChannels);
891 dlcqi.m_wbPmi = 0; // not yet used
892 dlcqi.m_sbMeasResult = rbgMeas;
893 }
894
895 msg->SetDlCqi(dlcqi);
896 return msg;
897}
898
899void
901{
903 NS_LOG_DEBUG(this << " Report UE Measurements ");
904
906
907 for (auto it = m_ueMeasurementsMap.begin(); it != m_ueMeasurementsMap.end(); it++)
908 {
909 double avg_rsrp = (*it).second.rsrpSum / (double)(*it).second.rsrpNum;
910 double avg_rsrq = (*it).second.rsrqSum / (double)(*it).second.rsrqNum;
911 /*
912 * In CELL_SEARCH state, this may result in avg_rsrq = 0/0 = -nan.
913 * UE RRC must take this into account when receiving measurement reports.
914 * TODO remove this shortcoming by calculating RSRQ during CELL_SEARCH
915 */
916 NS_LOG_DEBUG(this << " CellId " << (*it).first << " RSRP " << avg_rsrp << " (nSamples "
917 << (uint16_t)(*it).second.rsrpNum << ")"
918 << " RSRQ " << avg_rsrq << " (nSamples " << (uint16_t)(*it).second.rsrqNum
919 << ")"
920 << " ComponentCarrierID " << (uint16_t)m_componentCarrierId);
921
923 newEl.m_cellId = (*it).first;
924 newEl.m_rsrp = avg_rsrp;
925 newEl.m_rsrq = avg_rsrq;
926 ret.m_ueMeasurementsList.push_back(newEl);
927 ret.m_componentCarrierId = m_componentCarrierId;
928
929 // report to UE measurements trace
931 (*it).first,
932 avg_rsrp,
933 avg_rsrq,
934 (*it).first == m_cellId,
936 }
937
938 // report to RRC
940
941 m_ueMeasurementsMap.clear();
943}
944
945void
947{
948 NS_LOG_FUNCTION(this << cqiPeriodicity);
949 m_a30CqiPeriodicity = cqiPeriodicity;
950 m_p10CqiPeriodicity = cqiPeriodicity;
951}
952
953void
960
961void
963{
964 NS_LOG_FUNCTION(this << raPreambleId);
965
966 // unlike other control messages, RACH preamble is sent ASAP
968 msg->SetRapId(raPreambleId);
969 m_raPreambleId = raPreambleId;
970 m_raRnti = raRnti;
971 m_controlMessagesQueue.at(0).emplace_back(msg);
972}
973
974void
976{
977 /**
978 * Radio link failure detection should take place only on the
979 * primary carrier to avoid errors due to multiple calls to the
980 * same methods at the RRC layer
981 */
982 if (m_componentCarrierId == 0)
983 {
984 m_isConnected = true;
985 // Initialize the parameters for radio link failure detection
987 }
988}
989
990void
992{
993 NS_LOG_FUNCTION(this);
994
995 NS_LOG_DEBUG(this << " I am rnti = " << m_rnti << " and I received msgs "
996 << (uint16_t)msgList.size());
997 for (auto it = msgList.begin(); it != msgList.end(); it++)
998 {
999 Ptr<LteControlMessage> msg = (*it);
1000
1001 if (msg->GetMessageType() == LteControlMessage::DL_DCI)
1002 {
1004
1005 DlDciListElement_s dci = msg2->GetDci();
1006 if (dci.m_rnti != m_rnti)
1007 {
1008 // DCI not for me
1009 continue;
1010 }
1011
1012 if (dci.m_resAlloc != 0)
1013 {
1014 NS_FATAL_ERROR("Resource Allocation type not implemented");
1015 }
1016
1017 std::vector<int> dlRb;
1018
1019 // translate the DCI to Spectrum framework
1020 uint32_t mask = 0x1;
1021 for (int i = 0; i < 32; i++)
1022 {
1023 if (((dci.m_rbBitmap & mask) >> i) == 1)
1024 {
1025 for (int k = 0; k < GetRbgSize(); k++)
1026 {
1027 dlRb.push_back((i * GetRbgSize()) + k);
1028 // NS_LOG_DEBUG(this << " RNTI " << m_rnti << " RBG " << i << "
1029 // DL-DCI allocated PRB " << (i*GetRbgSize()) + k);
1030 }
1031 }
1032 mask = (mask << 1);
1033 }
1035 {
1036 m_powerControl->ReportTpc(dci.m_tpc);
1037 }
1038
1039 // send TB info to LteSpectrumPhy
1040 NS_LOG_DEBUG(this << " UE " << m_rnti << " DL-DCI " << dci.m_rnti << " bitmap "
1041 << dci.m_rbBitmap);
1042 for (std::size_t i = 0; i < dci.m_tbsSize.size(); i++)
1043 {
1044 m_downlinkSpectrumPhy->AddExpectedTb(dci.m_rnti,
1045 dci.m_ndi.at(i),
1046 dci.m_tbsSize.at(i),
1047 dci.m_mcs.at(i),
1048 dlRb,
1049 i,
1050 dci.m_harqProcess,
1051 dci.m_rv.at(i),
1052 true /* DL */);
1053 }
1054
1056 }
1057 else if (msg->GetMessageType() == LteControlMessage::UL_DCI)
1058 {
1059 // set the uplink bandwidth according to the UL-CQI
1061 UlDciListElement_s dci = msg2->GetDci();
1062 if (dci.m_rnti != m_rnti)
1063 {
1064 // DCI not for me
1065 continue;
1066 }
1067 NS_LOG_INFO(this << " UL DCI");
1068 std::vector<int> ulRb;
1069 ulRb.reserve(dci.m_rbLen);
1070 for (int i = 0; i < dci.m_rbLen; i++)
1071 {
1072 ulRb.push_back(i + dci.m_rbStart);
1073 // NS_LOG_DEBUG (this << " UE RB " << i + dci.m_rbStart);
1074 }
1077 // fire trace of UL Tx PHY stats
1078 HarqProcessInfoList_t harqInfoList = m_harqPhyModule->GetHarqProcessInfoUl(m_rnti, 0);
1080 params.m_cellId = m_cellId;
1081 params.m_imsi = 0; // it will be set by DlPhyTransmissionCallback in LteHelper
1082 params.m_timestamp = Simulator::Now().GetMilliSeconds() + UL_PUSCH_TTIS_DELAY;
1083 params.m_rnti = m_rnti;
1084 params.m_txMode = 0; // always SISO for UE
1085 params.m_layer = 0;
1086 params.m_mcs = dci.m_mcs;
1087 params.m_size = dci.m_tbSize;
1088 params.m_rv = harqInfoList.size();
1089 params.m_ndi = dci.m_ndi;
1090 params.m_ccId = m_componentCarrierId;
1091 m_ulPhyTransmission(params);
1092 // pass the info to the MAC
1094 }
1095 else if (msg->GetMessageType() == LteControlMessage::RAR)
1096 {
1098 if (rarMsg->GetRaRnti() == m_raRnti)
1099 {
1100 for (auto it = rarMsg->RarListBegin(); it != rarMsg->RarListEnd(); ++it)
1101 {
1102 if (it->rapId != m_raPreambleId)
1103 {
1104 // UL grant not for me
1105 continue;
1106 }
1107 else
1108 {
1109 NS_LOG_INFO("received RAR RNTI " << m_raRnti);
1110 // set the uplink bandwidth according to the UL grant
1111 std::vector<int> ulRb;
1112 ulRb.reserve(it->rarPayload.m_grant.m_rbLen);
1113 for (int i = 0; i < it->rarPayload.m_grant.m_rbLen; i++)
1114 {
1115 ulRb.push_back(i + it->rarPayload.m_grant.m_rbStart);
1116 }
1117
1119 // pass the info to the MAC
1121 // reset RACH variables with out of range values
1122 m_raPreambleId = 255;
1123 m_raRnti = 11;
1124 }
1125 }
1126 }
1127 }
1128 else if (msg->GetMessageType() == LteControlMessage::MIB)
1129 {
1130 NS_LOG_INFO("received MIB");
1131 NS_ASSERT(m_cellId > 0);
1134 }
1135 else if (msg->GetMessageType() == LteControlMessage::SIB1)
1136 {
1137 NS_LOG_INFO("received SIB1");
1138 NS_ASSERT(m_cellId > 0);
1141 }
1142 else
1143 {
1144 // pass the message to UE-MAC
1146 }
1147 }
1148}
1149
1150void
1152{
1153 NS_LOG_FUNCTION(this << cellId << (*p));
1154
1155 uint16_t nRB = p->GetValuesN();
1156 // sum PSD [W/Hz] of all bands
1157 double sum = std::reduce(p->ConstValuesBegin(), p->ConstValuesEnd(), 0.0);
1158
1159 // convert PSD [W/Hz] to linear power [W]
1160 sum *= (180000.0 / 12.0);
1161
1162 // measure instantaneous RSRP now
1163 double rsrp_dBm = 10 * log10(1000 * (sum / (double)nRB));
1164 NS_LOG_INFO(this << " PSS RNTI " << m_rnti << " cellId " << m_cellId << " has RSRP " << rsrp_dBm
1165 << " and RBnum " << nRB);
1166 // note that m_pssReceptionThreshold does not apply here
1167
1168 // store measurements
1169 auto itMeasMap = m_ueMeasurementsMap.find(cellId);
1170 if (itMeasMap == m_ueMeasurementsMap.end())
1171 {
1172 // insert new entry
1174 newEl.rsrpSum = rsrp_dBm;
1175 newEl.rsrpNum = 1;
1176 newEl.rsrqSum = 0;
1177 newEl.rsrqNum = 0;
1178 m_ueMeasurementsMap.insert(std::pair<uint16_t, UeMeasurementsElement>(cellId, newEl));
1179 }
1180 else
1181 {
1182 (*itMeasMap).second.rsrpSum += rsrp_dBm;
1183 (*itMeasMap).second.rsrpNum++;
1184 }
1185
1186 /*
1187 * Collect the PSS for later processing in GenerateCtrlCqiReport()
1188 * (to be called from ChunkProcessor after RX is finished).
1189 */
1190 m_pssReceived = true;
1191 PssElement el;
1192 el.cellId = cellId;
1193 el.pssPsdSum = sum;
1194 el.nRB = nRB;
1195 m_pssList.push_back(el);
1196}
1197
1198void
1203
1204void
1206{
1207 NS_LOG_FUNCTION(this << frameNo << subframeNo);
1208
1209 NS_ASSERT_MSG(frameNo > 0, "the SRS index check code assumes that frameNo starts at 1");
1210
1211 // refresh internal variables
1214 m_pssReceived = false;
1215
1216 if (m_ulConfigured)
1217 {
1218 // update uplink transmission mask according to previous UL-CQIs
1219 std::vector<int> rbMask = m_subChannelsForTransmissionQueue.at(0);
1221
1222 // shift the queue
1223 for (uint8_t i = 1; i < m_macChTtiDelay; i++)
1224 {
1226 }
1228
1230 {
1231 NS_ASSERT_MSG(subframeNo > 0 && subframeNo <= 10,
1232 "the SRS index check code assumes that subframeNo starts at 1");
1233 if ((((frameNo - 1) * 10 + (subframeNo - 1)) % m_srsPeriodicity) == m_srsSubframeOffset)
1234 {
1235 NS_LOG_INFO("frame " << frameNo << " subframe " << subframeNo
1236 << " sending SRS (offset=" << m_srsSubframeOffset
1237 << ", period=" << m_srsPeriodicity << ")");
1240 }
1241 }
1242
1243 std::list<Ptr<LteControlMessage>> ctrlMsg = GetControlMessages();
1244 // send packets in queue
1245 NS_LOG_LOGIC(this << " UE - start slot for PUSCH + PUCCH - RNTI " << m_rnti << " CELLID "
1246 << m_cellId);
1247 // send the current burts of packets
1249 if (pb)
1250 {
1252 {
1253 m_txPower = m_powerControl->GetPuschTxPower(rbMask);
1255 }
1256 m_uplinkSpectrumPhy->StartTxDataFrame(pb, ctrlMsg, UL_DATA_DURATION);
1257 }
1258 else
1259 {
1260 // send only PUCCH (ideal: fake null bandwidth signal)
1261 if (!ctrlMsg.empty())
1262 {
1263 NS_LOG_LOGIC(this << " UE - start TX PUCCH (NO PUSCH)");
1264 std::vector<int> dlRb;
1265
1267 {
1268 m_txPower = m_powerControl->GetPucchTxPower(dlRb);
1269 }
1270
1272 m_uplinkSpectrumPhy->StartTxDataFrame(pb, ctrlMsg, UL_DATA_DURATION);
1273 }
1274 else
1275 {
1276 NS_LOG_LOGIC(this << " UE - UL NOTHING TO SEND");
1277 }
1278 }
1279 }
1280
1281 // trigger the MAC
1282 m_uePhySapUser->SubframeIndication(frameNo, subframeNo);
1283
1284 m_subframeNo = subframeNo;
1285 ++subframeNo;
1286 if (subframeNo > 10)
1287 {
1288 ++frameNo;
1289 subframeNo = 1;
1290 }
1291
1292 // schedule next subframe indication
1295 this,
1296 frameNo,
1297 subframeNo);
1298}
1299
1300void
1302{
1303 NS_LOG_FUNCTION(this << " UE " << m_rnti << " start tx SRS, cell Id " << (uint32_t)m_cellId);
1304 NS_ASSERT(m_cellId > 0);
1305 // set the current tx power spectral density (full bandwidth)
1306 std::vector<int> dlRb;
1307 dlRb.reserve(m_ulBandwidth);
1308 for (uint16_t i = 0; i < m_ulBandwidth; i++)
1309 {
1310 dlRb.push_back(i);
1311 }
1312
1314 {
1315 m_txPower = m_powerControl->GetSrsTxPower(dlRb);
1316 }
1317
1319 m_uplinkSpectrumPhy->StartTxUlSrsFrame();
1320}
1321
1322void
1324{
1325 NS_LOG_FUNCTION(this);
1326
1327 m_rnti = 0;
1328 m_cellId = 0;
1329 m_isConnected = false;
1331 m_srsPeriodicity = 0;
1332 m_srsConfigured = false;
1333 m_dlConfigured = false;
1334 m_ulConfigured = false;
1335 m_raPreambleId = 255; // value out of range
1336 m_raRnti = 11; // value out of range
1340 m_paLinear = 1;
1341
1345
1346 m_packetBurstQueue.clear();
1347 m_controlMessagesQueue.clear();
1349 for (int i = 0; i < m_macChTtiDelay; i++)
1350 {
1352 m_packetBurstQueue.push_back(pb);
1353 std::list<Ptr<LteControlMessage>> l;
1354 m_controlMessagesQueue.push_back(l);
1355 }
1356 std::vector<int> ulRb;
1358
1360 m_downlinkSpectrumPhy->Reset();
1361 m_uplinkSpectrumPhy->Reset();
1362 m_pssList.clear();
1363 /**
1364 * Call the EndRx() method of the interference model for DL control and data
1365 * to cancel any ongoing downlink reception of control and data info.
1366 */
1367 m_downlinkSpectrumPhy->m_interferenceCtrl->EndRx();
1368 m_downlinkSpectrumPhy->m_interferenceData->EndRx();
1369}
1370
1371void
1373{
1374 NS_LOG_FUNCTION(this << dlEarfcn);
1375 m_dlEarfcn = dlEarfcn;
1376 DoSetDlBandwidth(6); // configure DL for receiving PSS
1378}
1379
1380void
1382{
1383 NS_LOG_FUNCTION(this << cellId << dlEarfcn);
1384 m_dlEarfcn = dlEarfcn;
1385 DoSynchronizeWithEnb(cellId);
1386}
1387
1388void
1390{
1391 NS_LOG_FUNCTION(this << cellId);
1392
1393 if (cellId == 0)
1394 {
1395 NS_FATAL_ERROR("Cell ID shall not be zero");
1396 }
1397
1398 m_cellId = cellId;
1399 m_downlinkSpectrumPhy->SetCellId(cellId);
1400 m_uplinkSpectrumPhy->SetCellId(cellId);
1401
1402 // configure DL for receiving the BCH with the minimum bandwidth
1404
1405 m_dlConfigured = false;
1406 m_ulConfigured = false;
1407
1409}
1410
1411uint16_t
1413{
1414 return m_cellId;
1415}
1416
1419{
1420 return m_dlEarfcn;
1421}
1422
1423void
1424LteUePhy::DoSetDlBandwidth(uint16_t dlBandwidth)
1425{
1426 NS_LOG_FUNCTION(this << (uint32_t)dlBandwidth);
1427 if (m_dlBandwidth != dlBandwidth or !m_dlConfigured)
1428 {
1429 m_dlBandwidth = dlBandwidth;
1430
1431 // See table 7.1.6.1-1 of 36.213
1432 static const int Type0AllocationRbg[4] = {
1433 10, // RBG size 1
1434 26, // RBG size 2
1435 63, // RBG size 3
1436 110, // RBG size 4
1437 };
1438 for (int i = 0; i < 4; i++)
1439 {
1440 if (dlBandwidth < Type0AllocationRbg[i])
1441 {
1442 m_rbgSize = i + 1;
1443 break;
1444 }
1445 }
1446
1450 m_downlinkSpectrumPhy->SetNoisePowerSpectralDensity(m_noisePsd);
1451 m_downlinkSpectrumPhy->GetChannel()->AddRx(m_downlinkSpectrumPhy);
1452 }
1453 m_dlConfigured = true;
1454}
1455
1456void
1457LteUePhy::DoConfigureUplink(uint32_t ulEarfcn, uint16_t ulBandwidth)
1458{
1459 m_ulEarfcn = ulEarfcn;
1460 m_ulBandwidth = ulBandwidth;
1461 m_ulConfigured = true;
1462}
1463
1464void
1466{
1467 NS_LOG_FUNCTION(this);
1468 m_powerControl->ConfigureReferenceSignalPower(referenceSignalPower);
1469}
1470
1471void
1473{
1474 NS_LOG_FUNCTION(this << rnti);
1475 m_rnti = rnti;
1476
1477 m_powerControl->SetCellId(m_cellId);
1478 m_powerControl->SetRnti(m_rnti);
1479}
1480
1481void
1483{
1484 NS_LOG_FUNCTION(this << (uint16_t)txMode);
1485 m_transmissionMode = txMode;
1486 m_downlinkSpectrumPhy->SetTransmissionMode(txMode);
1487}
1488
1489void
1491{
1492 NS_LOG_FUNCTION(this << srcCi);
1495 m_srsConfigured = true;
1496
1497 // a guard time is needed for the case where the SRS periodicity is changed dynamically at run
1498 // time if we use a static one, we can have a 0ms guard time
1500 NS_LOG_DEBUG(this << " UE SRS P " << m_srsPeriodicity << " RNTI " << m_rnti << " offset "
1501 << m_srsSubframeOffset << " cellId " << m_cellId << " CI " << srcCi);
1502}
1503
1504void
1506{
1507 NS_LOG_FUNCTION(this << pa);
1508 m_paLinear = pow(10, (pa / 10));
1509}
1510
1511void
1512LteUePhy::DoSetRsrpFilterCoefficient(uint8_t rsrpFilterCoefficient)
1513{
1514 NS_LOG_FUNCTION(this << (uint16_t)(rsrpFilterCoefficient));
1515 m_powerControl->SetRsrpFilterCoefficient(rsrpFilterCoefficient);
1516}
1517
1518void
1520{
1521 NS_LOG_FUNCTION(this);
1522 m_downlinkSpectrumPhy->m_harqPhyModule->ClearDlHarqBuffer(m_rnti); // flush HARQ buffers
1525 m_pssReceived = false;
1526 DoReset();
1527}
1528
1529void
1536
1537void
1539{
1540 NS_LOG_FUNCTION(this);
1541 // indicates that the downlink radio link quality has to be monitored for in-sync indications
1542 m_downlinkInSync = false;
1543}
1544
1545void
1547{
1548 NS_LOG_FUNCTION(this);
1549 m_imsi = imsi;
1550}
1551
1552void
1554{
1555 NS_LOG_FUNCTION(this);
1556 m_numOfSubframes = 0;
1557 m_sinrDbFrame = 0;
1558 m_numOfFrames = 0;
1559 m_downlinkInSync = true;
1560}
1561
1562void
1564{
1565 NS_LOG_FUNCTION(this << sinrDb);
1566 m_sinrDbFrame += sinrDb;
1568 NS_LOG_LOGIC("No of Subframes: " << m_numOfSubframes
1569 << " UE synchronized: " << m_downlinkInSync);
1570 // check for out_of_sync indications first when UE is both DL and UL synchronized
1571 // m_downlinkInSync=true indicates that the evaluation is for out-of-sync indications
1573 {
1574 /**
1575 * For every frame, if the downlink radio link quality(avg SINR)
1576 * is less than the threshold Qout, then the frame cannot be decoded
1577 */
1579 {
1580 m_numOfFrames++; // increment the counter if a frame cannot be decoded
1581 NS_LOG_LOGIC("No of Frames which cannot be decoded: " << m_numOfFrames);
1582 }
1583 else
1584 {
1585 /**
1586 * If the downlink radio link quality(avg SINR) is greater
1587 * than the threshold Qout, then the frame counter is reset
1588 * since only consecutive frames should be considered.
1589 */
1590 NS_LOG_INFO("Resetting frame counter at phy. Current value = " << m_numOfFrames);
1591 m_numOfFrames = 0;
1592 // Also reset the sync indicator counter at RRC
1594 }
1595 m_numOfSubframes = 0;
1596 m_sinrDbFrame = 0;
1597 }
1598 /**
1599 * Once the number of consecutive frames which cannot be decoded equals
1600 * the Qout evaluation period (i.e 200ms), then an out-of-sync indication
1601 * is sent to the RRC layer
1602 */
1604 {
1605 NS_LOG_LOGIC("At " << Simulator::Now().As(Time::MS)
1606 << " ms UE PHY sending out of sync indication to UE RRC layer");
1608 m_numOfFrames = 0;
1609 }
1610 // check for in_sync indications when T310 timer is started
1611 // m_downlinkInSync=false indicates that the evaluation is for in-sync indications
1612 if (!m_downlinkInSync && m_numOfSubframes == 10)
1613 {
1614 /**
1615 * For every frame, if the downlink radio link quality(avg SINR)
1616 * is greater than the threshold Qin, then the frame can be
1617 * successfully decoded.
1618 */
1620 {
1621 m_numOfFrames++; // increment the counter if a frame can be decoded
1622 NS_LOG_LOGIC("No of Frames successfully decoded: " << m_numOfFrames);
1623 }
1624 else
1625 {
1626 /**
1627 * If the downlink radio link quality(avg SINR) is less
1628 * than the threshold Qin, then the frame counter is reset
1629 * since only consecutive frames should be considered
1630 */
1631 m_numOfFrames = 0;
1632 // Also reset the sync indicator counter at RRC
1634 }
1635 m_numOfSubframes = 0;
1636 m_sinrDbFrame = 0;
1637 }
1638 /**
1639 * Once the number of consecutive frames which can be decoded equals the Qin evaluation period
1640 * (i.e 100ms), then an in-sync indication is sent to the RRC layer
1641 */
1643 {
1644 NS_LOG_LOGIC("At " << Simulator::Now().As(Time::MS)
1645 << " ms UE PHY sending in sync indication to UE RRC layer");
1647 m_numOfFrames = 0;
1648 }
1649}
1650
1651void
1653{
1654 SetTxModeGain(1, gain);
1655}
1656
1657void
1659{
1660 SetTxModeGain(2, gain);
1661}
1662
1663void
1665{
1666 SetTxModeGain(3, gain);
1667}
1668
1669void
1671{
1672 SetTxModeGain(4, gain);
1673}
1674
1675void
1677{
1678 SetTxModeGain(5, gain);
1679}
1680
1681void
1683{
1684 SetTxModeGain(6, gain);
1685}
1686
1687void
1689{
1690 SetTxModeGain(7, gain);
1691}
1692
1693void
1694LteUePhy::SetTxModeGain(uint8_t txMode, double gain)
1695{
1696 NS_LOG_FUNCTION(this << gain);
1697 if (txMode > 0)
1698 {
1699 // convert to linear
1700 double gainLin = std::pow(10.0, (gain / 10.0));
1701 if (m_txModeGain.size() < txMode)
1702 {
1703 m_txModeGain.resize(txMode);
1704 }
1705 m_txModeGain.at(txMode - 1) = gainLin;
1706 }
1707 // forward the info to DL LteSpectrumPhy
1708 m_downlinkSpectrumPhy->SetTxModeGain(txMode, gain);
1709}
1710
1711void
1713{
1714 NS_LOG_FUNCTION(this);
1715 // get the feedback from LteSpectrumPhy and send it through ideal PUCCH to eNB
1717 msg->SetDlHarqFeedback(m);
1718 SetControlMessages(msg);
1719}
1720
1721void
1726
1729{
1730 NS_LOG_FUNCTION(this);
1731 return m_state;
1732}
1733
1734void
1736{
1737 NS_LOG_FUNCTION(this << newState);
1738 State oldState = m_state;
1739 m_state = newState;
1740 NS_LOG_INFO(this << " cellId=" << m_cellId << " rnti=" << m_rnti << " UePhy " << oldState
1741 << " --> " << newState);
1742 m_stateTransitionTrace(m_cellId, m_rnti, oldState, newState);
1743}
1744
1745std::ostream&
1746operator<<(std::ostream& os, LteUePhy::State state)
1747{
1748 switch (state)
1749 {
1751 return os << "CELL_SEARCH";
1753 return os << "SYNCHRONIZED";
1755 return os << "NUM_STATES";
1756 };
1757 return os << "UNKNOWN(" << static_cast<uint32_t>(state) << ")";
1758}
1759
1760} // 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:561
static void ScheduleWithContext(uint32_t context, const Time &delay, FUNC f, Ts &&... args)
Schedule an event with the given context.
Definition simulator.h:578
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:403
@ MS
millisecond
Definition nstime.h:106
AttributeValue implementation for Time.
Definition nstime.h:1432
static uint8_t TxMode2LayerNum(uint8_t txMode)
Transmit mode 2 layer number.
a unique identifier for an interface.
Definition type-id.h:49
@ ATTR_GET
The attribute can be read.
Definition type-id.h:54
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:1433
Ptr< const AttributeChecker > MakeTimeChecker()
Helper to make an unbounded Time checker.
Definition nstime.h:1453
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:1381
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition nstime.h:1345
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition nstime.h:1357
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 table 7.1.6.1-1 of 3GPP TS 36.213)
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.