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