A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
lte-ue-phy.h
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 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation;
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 *
18 * Author: Giuseppe Piro <g.piro@poliba.it>
19 * Author: Marco Miozzo <mmiozzo@cttc.es>
20 * Modified by:
21 * Vignesh Babu <ns3-dev@esk.fraunhofer.de> (RLF extensions)
22 */
23
24#ifndef LTE_UE_PHY_H
25#define LTE_UE_PHY_H
26
27#include "ff-mac-common.h"
28#include "lte-amc.h"
30#include "lte-phy.h"
31#include "lte-ue-cphy-sap.h"
32#include "lte-ue-phy-sap.h"
34
35#include <ns3/ptr.h>
36
37#include <set>
38
39namespace ns3
40{
41
42class PacketBurst;
43class LteEnbPhy;
44class LteHarqPhy;
45
46/**
47 * \ingroup lte
48 *
49 * The LteSpectrumPhy models the physical layer of LTE
50 */
51class LteUePhy : public LtePhy
52{
53 /// allow UeMemberLteUePhySapProvider class friend access
55 /// allow MemberLteUeCphySapProvider<LteUePhy> class friend access
57
58 public:
59 /**
60 * \brief The states of the UE PHY entity
61 */
62 enum State
63 {
67 };
68
69 /**
70 * @warning the default constructor should not be used
71 */
72 LteUePhy();
73
74 /**
75 *
76 * \param dlPhy the downlink LteSpectrumPhy instance
77 * \param ulPhy the uplink LteSpectrumPhy instance
78 */
80
81 ~LteUePhy() override;
82
83 /**
84 * \brief Get the type ID.
85 * \return the object TypeId
86 */
87 static TypeId GetTypeId();
88 // inherited from Object
89 void DoInitialize() override;
90 void DoDispose() override;
91
92 /**
93 * \brief Get the PHY SAP provider
94 *
95 * \return a pointer to the SAP Provider
96 */
98
99 /**
100 * \brief Set the PHY SAP User
101 *
102 * \param s a pointer to the SAP user
103 */
105
106 /**
107 * \brief Get the CPHY SAP provider
108 *
109 * \return a pointer to the SAP Provider
110 */
112
113 /**
114 * \brief Set the CPHY SAP User
115 *
116 * \param s a pointer to the SAP user
117 */
119
120 /**
121 * \brief Set transmit power
122 *
123 * \param pow the transmission power in dBm
124 */
125 void SetTxPower(double pow);
126
127 /**
128 * \brief Get transmit power
129 *
130 * \return the transmission power in dBm
131 */
132 double GetTxPower() const;
133
134 /**
135 * \brief Get Uplink power control
136 *
137 * \return ptr to UE Uplink Power Control entity
138 */
140
141 /**
142 * \brief Set noise figure
143 *
144 * \param nf the noise figure in dB
145 */
146 void SetNoiseFigure(double nf);
147
148 /**
149 * \brief Get noise figure
150 *
151 * \return the noise figure in dB
152 */
153 double GetNoiseFigure() const;
154
155 /**
156 * \brief Get MAC to Channel delay
157 *
158 * \returns the TTI delay between MAC and channel
159 */
160 uint8_t GetMacChDelay() const;
161
162 /**
163 * \brief Get Downlink spectrum phy
164 *
165 * \return a pointer to the LteSpectrumPhy instance relative to the downlink
166 */
168
169 /**
170 * \brief Get Uplink spectrum phy
171 *
172 * \return a pointer to the LteSpectrumPhy instance relative to the uplink
173 */
175
176 /**
177 * \brief Create the PSD for the TX
178 *
179 * \return the pointer to the PSD
180 */
182
183 /**
184 * \brief Set a list of sub channels to use in TX
185 *
186 * \param mask a list of sub channels
187 */
188 void SetSubChannelsForTransmission(std::vector<int> mask);
189 /**
190 * \brief Get a list of sub channels to use in RX
191 *
192 * \return a list of sub channels
193 */
194 std::vector<int> GetSubChannelsForTransmission();
195
196 /**
197 * \brief Get a list of sub channels to use in RX
198 *
199 * \param mask list of sub channels
200 */
201 void SetSubChannelsForReception(std::vector<int> mask);
202 /**
203 * \brief Get a list of sub channels to use in RX
204 *
205 * \return a list of sub channels
206 */
207 std::vector<int> GetSubChannelsForReception();
208
209 /**
210 * \brief Create the DL CQI feedback from SINR values perceived at
211 * the physical layer with the signal received from eNB
212 *
213 * \param sinr SINR values vector
214 * \return a DL CQI control message containing the CQI feedback
215 */
217
218 // inherited from LtePhy
219 void GenerateCtrlCqiReport(const SpectrumValue& sinr) override;
220 void GenerateDataCqiReport(const SpectrumValue& sinr) override;
221 /**
222 * \brief Create the mixed CQI report
223 *
224 * \param sinr SINR values vector
225 */
226 virtual void GenerateMixedCqiReport(const SpectrumValue& sinr);
227 void ReportInterference(const SpectrumValue& interf) override;
228 /**
229 * \brief Create the mixed CQI report
230 *
231 * \param interf interference values vector
232 */
233 virtual void ReportDataInterference(const SpectrumValue& interf);
234 void ReportRsReceivedPower(const SpectrumValue& power) override;
235
236 // callbacks for LteSpectrumPhy
237 /**
238 * \brief Receive LTE control message list function
239 *
240 * \param msgList LTE control message list
241 */
242 virtual void ReceiveLteControlMessageList(std::list<Ptr<LteControlMessage>> msgList);
243 /**
244 * \brief Receive PSS function
245 *
246 * \param cellId the cell ID
247 * \param p PSS list
248 */
249 virtual void ReceivePss(uint16_t cellId, Ptr<SpectrumValue> p);
250
251 /**
252 * \brief PhySpectrum received a new PHY-PDU
253 *
254 * \param p the packet received
255 */
257
258 /**
259 * \brief trigger from eNB the start from a new frame
260 *
261 * \param frameNo frame number
262 * \param subframeNo subframe number
263 */
264 void SubframeIndication(uint32_t frameNo, uint32_t subframeNo);
265
266 /**
267 * \brief Send the SRS signal in the last symbols of the frame
268 */
269 void SendSrs();
270
271 /**
272 * \brief Enqueue the downlink HARQ feedback generated by LteSpectrumPhy
273 *
274 * \param mes the DlInfoListElement_s
275 */
277
278 /**
279 * \brief Set the HARQ PHY module
280 *
281 * \param harq the HARQ PHY module
282 */
284
285 /**
286 * \brief Get state of the UE physical layer
287 *
288 * \return The current state
289 */
290 State GetState() const;
291
292 /**
293 * TracedCallback signature for state transition events.
294 *
295 * \param [in] cellId
296 * \param [in] rnti
297 * \param [in] oldState
298 * \param [in] newState
299 */
300 typedef void (*StateTracedCallback)(uint16_t cellId,
301 uint16_t rnti,
302 State oldState,
303 State newState);
304
305 /**
306 * TracedCallback signature for cell RSRP and SINR report.
307 *
308 * \param [in] cellId
309 * \param [in] rnti
310 * \param [in] rsrp
311 * \param [in] sinr
312 * \param [in] componentCarrierId
313 */
314 typedef void (*RsrpSinrTracedCallback)(uint16_t cellId,
315 uint16_t rnti,
316 double rsrp,
317 double sinr,
318 uint8_t componentCarrierId);
319
320 /**
321 * TracedCallback signature for cell RSRP and RSRQ.
322 *
323 * \param [in] rnti
324 * \param [in] cellId
325 * \param [in] rsrp
326 * \param [in] rsrq
327 * \param [in] isServingCell
328 * \param [in] componentCarrierId
329 */
330 typedef void (*RsrpRsrqTracedCallback)(uint16_t rnti,
331 uint16_t cellId,
332 double rsrp,
333 double rsrq,
334 bool isServingCell,
335 uint8_t componentCarrierId);
336
337 /**
338 * TracedCallback signature for UL Phy resource blocks.
339 *
340 * \param [in] rnti
341 * \param [in] rbs Vector of resource blocks allocated for UL.
342 */
343 typedef void (*UlPhyResourceBlocksTracedCallback)(uint16_t rnti, const std::vector<int>& rbs);
344
345 /**
346 * TracedCallback signature for spectral value.
347 *
348 * \param [in] rnti
349 * \param [in] psd The spectral power density.
350 */
351 typedef void (*PowerSpectralDensityTracedCallback)(uint16_t rnti, Ptr<SpectrumValue> psd);
352
353 private:
354 /**
355 * \brief Set transmit mode 1 gain function
356 *
357 * \param [in] gain
358 */
359 void SetTxMode1Gain(double gain);
360 /**
361 * Set transmit mode 2 gain function
362 *
363 * \param [in] gain
364 */
365 void SetTxMode2Gain(double gain);
366 /**
367 * \brief Set transmit mode 3 gain function
368 *
369 * \param [in] gain
370 */
371 void SetTxMode3Gain(double gain);
372 /**
373 * \brief Set transmit mode 4 gain function
374 *
375 * \param [in] gain
376 */
377 void SetTxMode4Gain(double gain);
378 /**
379 * \brief Set transmit mode 5 gain function
380 *
381 * \param [in] gain
382 */
383 void SetTxMode5Gain(double gain);
384 /**
385 * \brief Set transmit mode 6 gain function
386 *
387 * \param [in] gain
388 */
389 void SetTxMode6Gain(double gain);
390 /**
391 * \brief Set transmit mode 7 gain function
392 *
393 * \param [in] gain
394 */
395 void SetTxMode7Gain(double gain);
396 /**
397 * \brief Set transmit mode gain function
398 *
399 * \param [in] txMode
400 * \param [in] gain
401 */
402 void SetTxModeGain(uint8_t txMode, double gain);
403 /**
404 * \brief Queue subchannels for transmission function
405 *
406 * \param [in] rbMap
407 */
408 void QueueSubChannelsForTransmission(std::vector<int> rbMap);
409 /**
410 * \brief Get CQI, RSRP, and RSRQ
411 *
412 * internal method that takes care of generating CQI reports,
413 * calculating the RSRP and RSRQ metrics, and generating RSRP+SINR traces
414 *
415 * \param sinr
416 */
417 void GenerateCqiRsrpRsrq(const SpectrumValue& sinr);
418 /**
419 * \brief Layer-1 filtering of RSRP and RSRQ measurements and reporting to
420 * the RRC entity.
421 *
422 * Initially executed at +0.200s, and then repeatedly executed with
423 * periodicity as indicated by the *UeMeasurementsFilterPeriod* attribute.
424 */
426 /**
427 * \brief Set the periodicty for the downlink periodic
428 * wideband and aperiodic subband CQI reporting.
429 *
430 * \param cqiPeriodicity The downlink CQI reporting periodicity in milliseconds
431 */
432 void SetDownlinkCqiPeriodicity(Time cqiPeriodicity);
433 /**
434 * \brief Switch the UE PHY to the given state.
435 * \param s the destination state
436 */
437 void SwitchToState(State s);
438 /**
439 * \brief Set number of Qout evaluation subframes
440 *
441 * The number passed to this method should be multiple
442 * of 10. This number specifies the total number of consecutive
443 * subframes, which corresponds to the Qout evaluation period.
444 *
445 * \param numSubframes the number of subframes
446 */
447 void SetNumQoutEvalSf(uint16_t numSubframes);
448 /**
449 * \brief Set number of Qin evaluation subframes
450 *
451 * The number passed to this method should be multiple
452 * of 10. This number specifies the total number of consecutive
453 * subframes, which corresponds to the Qin evaluation period.
454 *
455 * \param numSubframes the number of subframes
456 */
457 void SetNumQinEvalSf(uint16_t numSubframes);
458 /**
459 * \brief Get number of Qout evaluation subframes
460 *
461 * The number returned by this method specifies the
462 * total number of consecutive subframes, which corresponds
463 * to the Qout evaluation period.
464 *
465 * \return the number of consecutive subframes used for Qout evaluation
466 */
467 uint16_t GetNumQoutEvalSf() const;
468 /**
469 * \brief Get number of Qin evaluation subframes
470 *
471 * The number returned by this method specifies the
472 * total number of consecutive subframes, which corresponds
473 * to the Qin evaluation period.
474 *
475 * \return the number of consecutive subframes used for Qin evaluation
476 */
477 uint16_t GetNumQinEvalSf() const;
478
479 // UE CPHY SAP methods
480 /**
481 * \brief Do Reset function
482 */
483 void DoReset();
484 /**
485 * \brief Start the cell search function
486 *
487 * \param dlEarfcn the DL EARFCN
488 */
489 void DoStartCellSearch(uint32_t dlEarfcn);
490 /**
491 * \brief Synchronize with ENB function
492 *
493 * \param cellId the cell ID
494 */
495 void DoSynchronizeWithEnb(uint16_t cellId);
496 /**
497 * \brief Synchronize with ENB function
498 *
499 * \param cellId the cell ID
500 * \param dlEarfcn the DL EARFCN
501 */
502 void DoSynchronizeWithEnb(uint16_t cellId, uint32_t dlEarfcn);
503 /**
504 *
505 * Get cell ID
506 * \returns cell ID
507 */
508 uint16_t DoGetCellId();
509 /**
510 * Get DL EARFCN
511 * \returns DL EARFCN
512 */
514 /**
515 * Set DL bandwidth function
516 *
517 * \param dlBandwidth the DL bandwidth
518 */
519 void DoSetDlBandwidth(uint16_t dlBandwidth);
520 /**
521 * \brief Configure UL uplink function
522 *
523 * \param ulEarfcn UL EARFCN
524 * \param ulBandwidth the UL bandwidth
525 */
526 void DoConfigureUplink(uint32_t ulEarfcn, uint16_t ulBandwidth);
527 /**
528 * \brief Configure reference signal power function
529 *
530 * \param referenceSignalPower reference signal power in dBm
531 */
532 void DoConfigureReferenceSignalPower(int8_t referenceSignalPower);
533 /**
534 * \brief Set RNTI function
535 *
536 * \param rnti the RNTI
537 */
538 void DoSetRnti(uint16_t rnti);
539 /**
540 * \brief Set transmission mode function
541 *
542 * \param txMode the transmission mode
543 */
544 void DoSetTransmissionMode(uint8_t txMode);
545 /**
546 * \brief Set SRS configuration index function
547 *
548 * \param srcCi the SRS configuration index
549 */
550 void DoSetSrsConfigurationIndex(uint16_t srcCi);
551 /**
552 * \brief Set PA function
553 *
554 * \param pa the PA value
555 */
556 void DoSetPa(double pa);
557 /**
558 * \brief Reset Phy after radio link failure function
559 *
560 * It resets the physical layer parameters of the
561 * UE after RLF.
562 *
563 */
564 void DoResetPhyAfterRlf();
565 /**
566 * \brief Reset radio link failure parameters
567 *
568 * Upon receiving N311 in Sync indications from the UE
569 * PHY, the UE RRC instructs the UE PHY to reset the
570 * RLF parameters so, it can start RLF detection again.
571 *
572 */
573 void DoResetRlfParams();
574
575 /**
576 * \brief Start in Sync detection function
577 *
578 * When T310 timer is started, it indicates that physical layer
579 * problems are detected at the UE and the recovery process is
580 * started by checking if the radio frames are in-sync for N311
581 * consecutive times.
582 *
583 */
585
586 /**
587 * \brief Radio link failure detection function
588 *
589 * Radio link monitoring is started to detect downlink radio link
590 * quality when the UE is both uplink and downlink synchronized
591 * (UE in CONNECTED_NORMALLY state).
592 * Upon detection of radio link failure, RRC connection is released
593 * and the UE starts the cell selection again. The procedure is implemented
594 * as per 3GPP TS 36.213 4.2.1 and TS 36.133 7.6. When the downlink
595 * radio link quality estimated over the last 200 ms period becomes worse than
596 * the threshold Qout, an out-of-sync indication is sent to RRC. When the
597 * downlink radio link quality estimated over the last 100 ms period becomes
598 * better than the threshold Qin, an in-sync indication is sent to RRC.
599 *
600 * \param sinrdB the average SINR value in dB measured across
601 * all resource blocks
602 *
603 */
604 void RlfDetection(double sinrdB);
605 /**
606 * \brief Initialize radio link failure parameters
607 *
608 * Upon receiving the notification about the successful RRC connection
609 * establishment, the UE phy initialize the RLF parameters to be
610 * ready for RLF detection.
611 *
612 */
613 void InitializeRlfParams();
614 /**
615 * Set IMSI
616 *
617 * \param imsi the IMSI of the UE
618 */
619 void DoSetImsi(uint64_t imsi);
620 /**
621 * \brief Do set RSRP filter coefficient
622 *
623 * \param rsrpFilterCoefficient value. Determines the strength of
624 * smoothing effect induced by layer 3 filtering of RSRP
625 * used for uplink power control in all attached UE.
626 * If equals to 0, no layer 3 filtering is applicable.
627 */
628 void DoSetRsrpFilterCoefficient(uint8_t rsrpFilterCoefficient);
629 /**
630 * \brief Compute average SINR among the RBs
631 *
632 * \param sinr
633 * \return the average SINR value
634 */
635 double ComputeAvgSinr(const SpectrumValue& sinr);
636
637 // UE PHY SAP methods
638 void DoSendMacPdu(Ptr<Packet> p) override;
639 /**
640 * \brief Send LTE control message function
641 *
642 * \param msg the LTE control message
643 */
645 /**
646 * \brief Send RACH preamble function
647 *
648 * \param prachId the RACH preamble ID
649 * \param raRnti the rnti
650 */
651 virtual void DoSendRachPreamble(uint32_t prachId, uint32_t raRnti);
652 /**
653 * \brief Notify PHY about the successful RRC connection
654 * establishment.
655 */
656 virtual void DoNotifyConnectionSuccessful();
657
658 /// A list of sub channels to use in TX.
660 /// A list of sub channels to use in RX.
662
663 std::vector<std::vector<int>>
664 m_subChannelsForTransmissionQueue; ///< subchannels for transmission queue
665
667
668 /**
669 * The `EnableUplinkPowerControl` attribute. If true, Uplink Power Control
670 * will be enabled.
671 */
673 /// Pointer to UE Uplink Power Control entity.
675
676 /// Wideband Periodic CQI. 2, 5, 10, 16, 20, 32, 40, 64, 80 or 160 ms.
678 Time m_p10CqiLast; ///< last periodic CQI
679
680 /**
681 * SubBand Aperiodic CQI. Activated by DCI format 0 or Random Access Response
682 * Grant.
683 * \note Defines a periodicity for academic studies.
684 */
686 Time m_a30CqiLast; ///< last aperiodic CQI
687
688 LteUePhySapProvider* m_uePhySapProvider; ///< UE Phy SAP provider
689 LteUePhySapUser* m_uePhySapUser; ///< UE Phy SAP user
690
691 LteUeCphySapProvider* m_ueCphySapProvider; ///< UE CPhy SAP provider
692 LteUeCphySapUser* m_ueCphySapUser; ///< UE CPhy SAP user
693
694 uint16_t m_rnti; ///< the RNTI
695
696 uint8_t m_transmissionMode; ///< the transmission mode
697 std::vector<double> m_txModeGain; ///< the transmit mode gain
698
699 uint16_t m_srsPeriodicity; ///< SRS periodicity
700 uint16_t m_srsSubframeOffset; ///< SRS subframe offset
701 bool m_srsConfigured; ///< SRS configured
702 Time m_srsStartTime; ///< SRS start time
703
704 double m_paLinear; ///< PA linear
705
706 bool m_dlConfigured; ///< DL configured?
707 bool m_ulConfigured; ///< UL configured?
708
709 /// The current UE PHY state.
711 /**
712 * The `StateTransition` trace source. Fired upon every UE PHY state
713 * transition. Exporting the serving cell ID, RNTI, old state, and new state.
714 */
716
717 /// \todo Can be removed.
719
720 bool m_rsReceivedPowerUpdated; ///< RS receive power updated?
721 SpectrumValue m_rsReceivedPower; ///< RS receive power
722
723 bool m_rsInterferencePowerUpdated; ///< RS interference power updated?
724 SpectrumValue m_rsInterferencePower; ///< RS interference power
725
726 bool m_dataInterferencePowerUpdated; ///< data interference power updated?
727 SpectrumValue m_dataInterferencePower; ///< data interference power
728
729 bool m_pssReceived; ///< PSS received?
730
731 /// PssElement structure
733 {
734 uint16_t cellId; ///< cell ID
735 double pssPsdSum; ///< PSS PSD sum
736 uint16_t nRB; ///< number of RB
737 };
738
739 std::list<PssElement> m_pssList; ///< PSS list
740
741 /**
742 * The `RsrqUeMeasThreshold` attribute. Receive threshold for PSS on RSRQ
743 * in dB.
744 */
746
747 /// Summary results of measuring a specific cell. Used for layer-1 filtering.
749 {
750 double rsrpSum; ///< Sum of RSRP sample values in linear unit.
751 uint8_t rsrpNum; ///< Number of RSRP samples.
752 double rsrqSum; ///< Sum of RSRQ sample values in linear unit.
753 uint8_t rsrqNum; ///< Number of RSRQ samples.
754 };
755
756 /**
757 * Store measurement results during the last layer-1 filtering period.
758 * Indexed by the cell ID where the measurements come from.
759 */
760 std::map<uint16_t, UeMeasurementsElement> m_ueMeasurementsMap;
761 /**
762 * The `UeMeasurementsFilterPeriod` attribute. Time period for reporting UE
763 * measurements, i.e., the length of layer-1 filtering (default 200 ms).
764 */
766 /// \todo Can be removed.
768
769 Ptr<LteHarqPhy> m_harqPhyModule; ///< HARQ phy module
770
771 uint32_t m_raPreambleId; ///< RA preamble ID
772 uint32_t m_raRnti; ///< RA RNTI
773
774 /**
775 * The `ReportCurrentCellRsrpSinr` trace source. Trace information regarding
776 * RSRP and average SINR (see TS 36.214). Exporting cell ID, RNTI, RSRP, and
777 * SINR. Moreover it reports the m_componentCarrierId.
778 */
780 /**
781 * The `RsrpSinrSamplePeriod` attribute. The sampling period for reporting
782 * RSRP-SINR stats.
783 */
785 /**
786 * The `RsrpSinrSampleCounter` attribute. The sampling counter for reporting
787 * RSRP-SINR stats.
788 */
790
791 /**
792 * The `ReportUeMeasurements` trace source. Contains trace information
793 * regarding RSRP and RSRQ measured from a specific cell (see TS 36.214).
794 * Exporting RNTI, the ID of the measured cell, RSRP (in dBm), RSRQ (in dB),
795 * and whether the cell is the serving cell. Moreover it report the m_componentCarrierId.
796 */
798
799 EventId m_sendSrsEvent; ///< send SRS event
800
801 /**
802 * The `UlPhyTransmission` trace source. Contains trace information regarding
803 * PHY stats from UL Tx perspective. Exporting a structure with type
804 * PhyTransmissionStatParameters.
805 */
807
808 /**
809 * The `ReportUlPhyResourceBlocks` trace source. Contains trace information
810 * regarding PHY stats from UL Resource Blocks (RBs). Exporting an RNTI of a
811 * UE and a vector containing the indices of the RBs used for UL.
812 */
814
815 /**
816 * The `ReportsPowerSpectralDensity` trace source. Contains trace information
817 * regarding Power Spectral Density. Exporting an RNTI of a UE and a pointer
818 * to Spectrum Values.
819 */
821
822 Ptr<SpectrumValue> m_noisePsd; ///< Noise power spectral density for
823 /// the configured bandwidth
824
825 bool m_isConnected; ///< set when UE RRC is in CONNECTED_NORMALLY state
826 /**
827 * The 'Qin' attribute.
828 * corresponds to 2% block error rate of a hypothetical PDCCH transmission
829 * taking into account the PCFICH errors.
830 */
831 double m_qIn;
832
833 /**
834 * The 'Qout' attribute.
835 * corresponds to 2% block error rate of a hypothetical PDCCH transmission
836 * taking into account the PCFICH errors.
837 */
838 double m_qOut;
839
840 uint16_t m_numOfQoutEvalSf; ///< the downlink radio link quality is estimated over this period
841 ///< for detecting out-of-syncs
842 uint16_t m_numOfQinEvalSf; ///< the downlink radio link quality is estimated over this period
843 ///< for detecting in-syncs
844
845 bool m_downlinkInSync; ///< when set, DL SINR evaluation for out-of-sync indications is
846 ///< conducted.
847 uint16_t m_numOfSubframes; ///< count the number of subframes for which the downlink radio link
848 ///< quality is estimated
849 uint16_t m_numOfFrames; ///< count the number of frames for which the downlink radio link
850 ///< quality is estimated
851 double m_sinrDbFrame; ///< the average SINR per radio frame
852 SpectrumValue m_ctrlSinrForRlf; ///< the CTRL SINR used for RLF detection
853 uint64_t m_imsi; ///< the IMSI of the UE
854 bool m_enableRlfDetection; ///< Flag to enable/disable RLF detection
855
856}; // end of `class LteUePhy`
857
858} // namespace ns3
859
860#endif /* LTE_UE_PHY_H */
An identifier for simulation events.
Definition: event-id.h:55
The LtePhy models the physical layer of LTE.
Definition: lte-phy.h:51
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 LteSpectrumPhy models the physical layer of LTE.
Definition: lte-ue-phy.h:52
void SetTxMode1Gain(double gain)
Set transmit mode 1 gain function.
Definition: lte-ue-phy.cc:1689
SpectrumValue m_dataInterferencePower
data interference power
Definition: lte-ue-phy.h:727
Time m_ueMeasurementsFilterLast
Definition: lte-ue-phy.h:767
void SetSubChannelsForTransmission(std::vector< int > mask)
Set a list of sub channels to use in TX.
Definition: lte-ue-phy.cc:498
void DoInitialize() override
Initialize() implementation.
Definition: lte-ue-phy.cc:350
void SetHarqPhyModule(Ptr< LteHarqPhy > harq)
Set the HARQ PHY module.
Definition: lte-ue-phy.cc:1759
void DoSetDlBandwidth(uint16_t dlBandwidth)
Set DL bandwidth function.
Definition: lte-ue-phy.cc:1462
uint16_t GetNumQinEvalSf() const
Get number of Qin evaluation subframes.
Definition: lte-ue-phy.cc:477
void SetTxMode3Gain(double gain)
Set transmit mode 3 gain function.
Definition: lte-ue-phy.cc:1701
uint16_t m_numOfQinEvalSf
the downlink radio link quality is estimated over this period for detecting in-syncs
Definition: lte-ue-phy.h:842
LteUePhySapUser * m_uePhySapUser
UE Phy SAP user.
Definition: lte-ue-phy.h:689
uint16_t DoGetCellId()
Get cell ID.
Definition: lte-ue-phy.cc:1450
uint16_t m_rsrpSinrSampleCounter
The RsrpSinrSampleCounter attribute.
Definition: lte-ue-phy.h:789
void(* StateTracedCallback)(uint16_t cellId, uint16_t rnti, State oldState, State newState)
TracedCallback signature for state transition events.
Definition: lte-ue-phy.h:300
virtual void ReportDataInterference(const SpectrumValue &interf)
Create the mixed CQI report.
Definition: lte-ue-phy.cc:801
void QueueSubChannelsForTransmission(std::vector< int > rbMap)
Queue subchannels for transmission function.
Definition: lte-ue-phy.cc:1237
void DoConfigureUplink(uint32_t ulEarfcn, uint16_t ulBandwidth)
Configure UL uplink function.
Definition: lte-ue-phy.cc:1494
virtual void ReceivePss(uint16_t cellId, Ptr< SpectrumValue > p)
Receive PSS function.
Definition: lte-ue-phy.cc:1185
uint16_t m_srsPeriodicity
SRS periodicity.
Definition: lte-ue-phy.h:699
void DoResetPhyAfterRlf()
Reset Phy after radio link failure function.
Definition: lte-ue-phy.cc:1556
virtual void DoNotifyConnectionSuccessful()
Notify PHY about the successful RRC connection establishment.
Definition: lte-ue-phy.cc:1009
bool m_dlConfigured
DL configured?
Definition: lte-ue-phy.h:706
LteUePhySapProvider * GetLteUePhySapProvider()
Get the PHY SAP provider.
Definition: lte-ue-phy.cc:375
Time m_srsStartTime
SRS start time.
Definition: lte-ue-phy.h:702
double GetNoiseFigure() const
Get noise figure.
Definition: lte-ue-phy.cc:403
Time m_p10CqiLast
last periodic CQI
Definition: lte-ue-phy.h:678
std::map< uint16_t, UeMeasurementsElement > m_ueMeasurementsMap
Store measurement results during the last layer-1 filtering period.
Definition: lte-ue-phy.h:760
TracedCallback< uint16_t, Ptr< SpectrumValue > > m_reportPowerSpectralDensity
The ReportsPowerSpectralDensity trace source.
Definition: lte-ue-phy.h:820
LteUePhySapProvider * m_uePhySapProvider
UE Phy SAP provider.
Definition: lte-ue-phy.h:688
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 ...
Definition: lte-ue-phy.cc:810
uint16_t GetNumQoutEvalSf() const
Get number of Qout evaluation subframes.
Definition: lte-ue-phy.cc:470
bool m_rsInterferencePowerUpdated
RS interference power updated?
Definition: lte-ue-phy.h:723
void(* RsrpRsrqTracedCallback)(uint16_t rnti, uint16_t cellId, double rsrp, double rsrq, bool isServingCell, uint8_t componentCarrierId)
TracedCallback signature for cell RSRP and RSRQ.
Definition: lte-ue-phy.h:330
virtual void ReceiveLteControlMessageList(std::list< Ptr< LteControlMessage > > msgList)
Receive LTE control message list function.
Definition: lte-ue-phy.cc:1025
void DoSendMacPdu(Ptr< Packet > p) override
Queue the MAC PDU to be sent (according to m_macChTtiDelay)
Definition: lte-ue-phy.cc:484
Ptr< SpectrumValue > m_noisePsd
Noise power spectral density for the configured bandwidth.
Definition: lte-ue-phy.h:822
void GenerateCtrlCqiReport(const SpectrumValue &sinr) override
generate a CQI report based on the given SINR of Ctrl frame
Definition: lte-ue-phy.cc:544
uint32_t DoGetDlEarfcn()
Get DL EARFCN.
Definition: lte-ue-phy.cc:1456
double ComputeAvgSinr(const SpectrumValue &sinr)
Compute average SINR among the RBs.
Definition: lte-ue-phy.cc:701
void SetLteUePhySapUser(LteUePhySapUser *s)
Set the PHY SAP User.
Definition: lte-ue-phy.cc:368
virtual void DoSendRachPreamble(uint32_t prachId, uint32_t raRnti)
Send RACH preamble function.
Definition: lte-ue-phy.cc:996
void DoStartCellSearch(uint32_t dlEarfcn)
Start the cell search function.
Definition: lte-ue-phy.cc:1410
void SetTxMode6Gain(double gain)
Set transmit mode 6 gain function.
Definition: lte-ue-phy.cc:1719
LteUeCphySapProvider * m_ueCphySapProvider
UE CPhy SAP provider.
Definition: lte-ue-phy.h:691
Ptr< SpectrumValue > CreateTxPowerSpectralDensity() override
Create the PSD for the TX.
Definition: lte-ue-phy.cc:530
std::vector< std::vector< int > > m_subChannelsForTransmissionQueue
subchannels for transmission queue
Definition: lte-ue-phy.h:664
void DoReset()
Do Reset function.
Definition: lte-ue-phy.cc:1360
void SetNumQoutEvalSf(uint16_t numSubframes)
Set number of Qout evaluation subframes.
Definition: lte-ue-phy.cc:450
State m_state
The current UE PHY state.
Definition: lte-ue-phy.h:710
bool m_pssReceived
PSS received?
Definition: lte-ue-phy.h:729
TracedCallback< uint16_t, uint16_t, double, double, uint8_t > m_reportCurrentCellRsrpSinrTrace
The ReportCurrentCellRsrpSinr trace source.
Definition: lte-ue-phy.h:779
void DoSetImsi(uint64_t imsi)
Set IMSI.
Definition: lte-ue-phy.cc:1583
void SetTxMode2Gain(double gain)
Set transmit mode 2 gain function.
Definition: lte-ue-phy.cc:1695
void DoSetRsrpFilterCoefficient(uint8_t rsrpFilterCoefficient)
Do set RSRP filter coefficient.
Definition: lte-ue-phy.cc:1549
~LteUePhy() override
Definition: lte-ue-phy.cc:176
uint8_t GetMacChDelay() const
Get MAC to Channel delay.
Definition: lte-ue-phy.cc:432
Ptr< LteUePowerControl > m_powerControl
Pointer to UE Uplink Power Control entity.
Definition: lte-ue-phy.h:674
void DoConfigureReferenceSignalPower(int8_t referenceSignalPower)
Configure reference signal power function.
Definition: lte-ue-phy.cc:1502
std::list< PssElement > m_pssList
PSS list.
Definition: lte-ue-phy.h:739
void SubframeIndication(uint32_t frameNo, uint32_t subframeNo)
trigger from eNB the start from a new frame
Definition: lte-ue-phy.cc:1243
Ptr< LteUePowerControl > GetUplinkPowerControl() const
Get Uplink power control.
Definition: lte-ue-phy.cc:425
void RlfDetection(double sinrdB)
Radio link failure detection function.
Definition: lte-ue-phy.cc:1600
std::vector< double > m_txModeGain
the transmit mode gain
Definition: lte-ue-phy.h:697
State GetState() const
Get state of the UE physical layer.
Definition: lte-ue-phy.cc:1765
SpectrumValue m_rsReceivedPower
RS receive power.
Definition: lte-ue-phy.h:721
void DoSynchronizeWithEnb(uint16_t cellId)
Synchronize with ENB function.
Definition: lte-ue-phy.cc:1427
void DoSetSrsConfigurationIndex(uint16_t srcCi)
Set SRS configuration index function.
Definition: lte-ue-phy.cc:1527
uint16_t m_srsSubframeOffset
SRS subframe offset.
Definition: lte-ue-phy.h:700
uint8_t m_subframeNo
Definition: lte-ue-phy.h:718
uint16_t m_rsrpSinrSamplePeriod
The RsrpSinrSamplePeriod attribute.
Definition: lte-ue-phy.h:784
uint64_t m_imsi
the IMSI of the UE
Definition: lte-ue-phy.h:853
uint16_t m_rnti
the RNTI
Definition: lte-ue-phy.h:694
bool m_enableUplinkPowerControl
The EnableUplinkPowerControl attribute.
Definition: lte-ue-phy.h:672
Ptr< LteSpectrumPhy > GetDlSpectrumPhy() const
Get Downlink spectrum phy.
Definition: lte-ue-phy.cc:438
void SetTxMode5Gain(double gain)
Set transmit mode 5 gain function.
Definition: lte-ue-phy.cc:1713
void DoSetTransmissionMode(uint8_t txMode)
Set transmission mode function.
Definition: lte-ue-phy.cc:1519
bool m_enableRlfDetection
Flag to enable/disable RLF detection.
Definition: lte-ue-phy.h:854
Time m_a30CqiLast
last aperiodic CQI
Definition: lte-ue-phy.h:686
void GenerateCqiRsrpRsrq(const SpectrumValue &sinr)
Get CQI, RSRP, and RSRQ.
Definition: lte-ue-phy.cc:565
SpectrumValue m_rsInterferencePower
RS interference power.
Definition: lte-ue-phy.h:724
void DoResetRlfParams()
Reset radio link failure parameters.
Definition: lte-ue-phy.cc:1567
void SetDownlinkCqiPeriodicity(Time cqiPeriodicity)
Set the periodicty for the downlink periodic wideband and aperiodic subband CQI reporting.
Definition: lte-ue-phy.cc:980
Ptr< LteHarqPhy > m_harqPhyModule
HARQ phy module.
Definition: lte-ue-phy.h:769
void(* PowerSpectralDensityTracedCallback)(uint16_t rnti, Ptr< SpectrumValue > psd)
TracedCallback signature for spectral value.
Definition: lte-ue-phy.h:351
EventId m_sendSrsEvent
send SRS event
Definition: lte-ue-phy.h:799
double m_qIn
The 'Qin' attribute.
Definition: lte-ue-phy.h:831
void SetNoiseFigure(double nf)
Set noise figure.
Definition: lte-ue-phy.cc:396
void DoSetPa(double pa)
Set PA function.
Definition: lte-ue-phy.cc:1542
Ptr< DlCqiLteControlMessage > CreateDlCqiFeedbackMessage(const SpectrumValue &sinr)
Create the DL CQI feedback from SINR values perceived at the physical layer with the signal received ...
Definition: lte-ue-phy.cc:834
LteUeCphySapUser * m_ueCphySapUser
UE CPhy SAP user.
Definition: lte-ue-phy.h:692
void SetNumQinEvalSf(uint16_t numSubframes)
Set number of Qin evaluation subframes.
Definition: lte-ue-phy.cc:460
void SetLteUeCphySapUser(LteUeCphySapUser *s)
Set the CPHY SAP User.
Definition: lte-ue-phy.cc:382
double m_sinrDbFrame
the average SINR per radio frame
Definition: lte-ue-phy.h:851
void(* UlPhyResourceBlocksTracedCallback)(uint16_t rnti, const std::vector< int > &rbs)
TracedCallback signature for UL Phy resource blocks.
Definition: lte-ue-phy.h:343
TracedCallback< uint16_t, uint16_t, State, State > m_stateTransitionTrace
The StateTransition trace source.
Definition: lte-ue-phy.h:715
void DoDispose() override
Destructor implementation.
Definition: lte-ue-phy.cc:182
void SetSubChannelsForReception(std::vector< int > mask)
Get a list of sub channels to use in RX.
Definition: lte-ue-phy.cc:509
bool m_rsReceivedPowerUpdated
RS receive power updated?
Definition: lte-ue-phy.h:720
void SwitchToState(State s)
Switch the UE PHY to the given state.
Definition: lte-ue-phy.cc:1772
TracedCallback< uint16_t, uint16_t, double, double, bool, uint8_t > m_reportUeMeasurements
The ReportUeMeasurements trace source.
Definition: lte-ue-phy.h:797
double m_paLinear
PA linear.
Definition: lte-ue-phy.h:704
TracedCallback< PhyTransmissionStatParameters > m_ulPhyTransmission
The UlPhyTransmission trace source.
Definition: lte-ue-phy.h:806
bool m_isConnected
set when UE RRC is in CONNECTED_NORMALLY state
Definition: lte-ue-phy.h:825
Ptr< LteAmc > m_amc
AMC.
Definition: lte-ue-phy.h:666
std::vector< int > m_subChannelsForReception
A list of sub channels to use in RX.
Definition: lte-ue-phy.h:661
void InitializeRlfParams()
Initialize radio link failure parameters.
Definition: lte-ue-phy.cc:1590
std::vector< int > GetSubChannelsForTransmission()
Get a list of sub channels to use in RX.
Definition: lte-ue-phy.cc:516
void PhyPduReceived(Ptr< Packet > p)
PhySpectrum received a new PHY-PDU.
Definition: lte-ue-phy.cc:492
LteUeCphySapProvider * GetLteUeCphySapProvider()
Get the CPHY SAP provider.
Definition: lte-ue-phy.cc:389
bool m_ulConfigured
UL configured?
Definition: lte-ue-phy.h:707
SpectrumValue m_ctrlSinrForRlf
the CTRL SINR used for RLF detection
Definition: lte-ue-phy.h:852
Time m_ueMeasurementsFilterPeriod
The UeMeasurementsFilterPeriod attribute.
Definition: lte-ue-phy.h:765
bool m_srsConfigured
SRS configured.
Definition: lte-ue-phy.h:701
void GenerateDataCqiReport(const SpectrumValue &sinr) override
generate a CQI report based on the given SINR of Data frame (used for PUSCH CQIs)
Definition: lte-ue-phy.cc:721
uint16_t m_numOfFrames
count the number of frames for which the downlink radio link quality is estimated
Definition: lte-ue-phy.h:849
bool m_downlinkInSync
when set, DL SINR evaluation for out-of-sync indications is conducted.
Definition: lte-ue-phy.h:845
uint16_t m_numOfQoutEvalSf
the downlink radio link quality is estimated over this period for detecting out-of-syncs
Definition: lte-ue-phy.h:840
void SetTxMode7Gain(double gain)
Set transmit mode 7 gain function.
Definition: lte-ue-phy.cc:1725
void DoSetRnti(uint16_t rnti)
Set RNTI function.
Definition: lte-ue-phy.cc:1509
static TypeId GetTypeId()
Get the type ID.
Definition: lte-ue-phy.cc:191
double GetTxPower() const
Get transmit power.
Definition: lte-ue-phy.cc:418
virtual void EnqueueDlHarqFeedback(DlInfoListElement_s mes)
Enqueue the downlink HARQ feedback generated by LteSpectrumPhy.
Definition: lte-ue-phy.cc:1749
std::vector< int > m_subChannelsForTransmission
A list of sub channels to use in TX.
Definition: lte-ue-phy.h:659
Time m_p10CqiPeriodicity
Wideband Periodic CQI. 2, 5, 10, 16, 20, 32, 40, 64, 80 or 160 ms.
Definition: lte-ue-phy.h:677
bool m_dataInterferencePowerUpdated
data interference power updated?
Definition: lte-ue-phy.h:726
void SetTxPower(double pow)
Set transmit power.
Definition: lte-ue-phy.cc:410
State
The states of the UE PHY entity.
Definition: lte-ue-phy.h:63
uint16_t m_numOfSubframes
count the number of subframes for which the downlink radio link quality is estimated
Definition: lte-ue-phy.h:847
void SetTxMode4Gain(double gain)
Set transmit mode 4 gain function.
Definition: lte-ue-phy.cc:1707
virtual void DoSendLteControlMessage(Ptr< LteControlMessage > msg)
Send LTE control message function.
Definition: lte-ue-phy.cc:988
Time m_a30CqiPeriodicity
SubBand Aperiodic CQI.
Definition: lte-ue-phy.h:685
TracedCallback< uint16_t, const std::vector< int > & > m_reportUlPhyResourceBlocks
The ReportUlPhyResourceBlocks trace source.
Definition: lte-ue-phy.h:813
void ReportInterference(const SpectrumValue &interf) override
generate a report based on the linear interference and noise power perceived during DATA frame NOTE: ...
Definition: lte-ue-phy.cc:793
std::vector< int > GetSubChannelsForReception()
Get a list of sub channels to use in RX.
Definition: lte-ue-phy.cc:523
Ptr< LteSpectrumPhy > GetUlSpectrumPhy() const
Get Uplink spectrum phy.
Definition: lte-ue-phy.cc:444
void ReportUeMeasurements()
Layer-1 filtering of RSRP and RSRQ measurements and reporting to the RRC entity.
Definition: lte-ue-phy.cc:934
double m_pssReceptionThreshold
The RsrqUeMeasThreshold attribute.
Definition: lte-ue-phy.h:745
uint32_t m_raPreambleId
RA preamble ID.
Definition: lte-ue-phy.h:771
double m_qOut
The 'Qout' attribute.
Definition: lte-ue-phy.h:838
void DoStartInSyncDetection()
Start in Sync detection function.
Definition: lte-ue-phy.cc:1575
void SendSrs()
Send the SRS signal in the last symbols of the frame.
Definition: lte-ue-phy.cc:1339
void(* RsrpSinrTracedCallback)(uint16_t cellId, uint16_t rnti, double rsrp, double sinr, uint8_t componentCarrierId)
TracedCallback signature for cell RSRP and SINR report.
Definition: lte-ue-phy.h:314
virtual void GenerateMixedCqiReport(const SpectrumValue &sinr)
Create the mixed CQI report.
Definition: lte-ue-phy.cc:727
uint8_t m_transmissionMode
the transmission mode
Definition: lte-ue-phy.h:696
void SetTxModeGain(uint8_t txMode, double gain)
Set transmit mode gain function.
Definition: lte-ue-phy.cc:1731
uint32_t m_raRnti
RA RNTI.
Definition: lte-ue-phy.h:772
Service Access Point (SAP) offered by the UE-PHY to the UE-MAC.
Service Access Point (SAP) offered by the PHY to the MAC.
Template for the implementation of the LteUeCphySapProvider as a member of an owner class of type C t...
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:77
Set of values corresponding to a given SpectrumModel.
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:105
Forward calls to a chain of Callback.
a unique identifier for an interface.
Definition: type-id.h:59
UeMemberLteUePhySapProvider class.
Definition: lte-ue-phy.cc:72
Every class exported by the ns3 library is enclosed in the ns3 namespace.
See section 4.3.23 dlInfoListElement.
PssElement structure.
Definition: lte-ue-phy.h:733
uint16_t cellId
cell ID
Definition: lte-ue-phy.h:734
double pssPsdSum
PSS PSD sum.
Definition: lte-ue-phy.h:735
uint16_t nRB
number of RB
Definition: lte-ue-phy.h:736
Summary results of measuring a specific cell. Used for layer-1 filtering.
Definition: lte-ue-phy.h:749
double rsrqSum
Sum of RSRQ sample values in linear unit.
Definition: lte-ue-phy.h:752
uint8_t rsrpNum
Number of RSRP samples.
Definition: lte-ue-phy.h:751
double rsrpSum
Sum of RSRP sample values in linear unit.
Definition: lte-ue-phy.h:750
uint8_t rsrqNum
Number of RSRQ samples.
Definition: lte-ue-phy.h:753