From 0b3a603f7de1f850d28fd5f2b85c876ccefe617b Mon Sep 17 00:00:00 2001 From: Zoraze Ali Date: Tue, 2 Oct 2018 12:29:39 +0200 Subject: [PATCH] lte: Add attribute to configure the periodicity of DL CQI reports --- src/lte/model/lte-ue-phy.cc | 20 +++++++++- src/lte/model/lte-ue-phy.h | 79 +++++++++++++++++++------------------ 2 files changed, 58 insertions(+), 41 deletions(-) diff --git a/src/lte/model/lte-ue-phy.cc b/src/lte/model/lte-ue-phy.cc index dec1b8ad6..858c58240 100644 --- a/src/lte/model/lte-ue-phy.cc +++ b/src/lte/model/lte-ue-phy.cc @@ -146,8 +146,6 @@ LteUePhy::LteUePhy () LteUePhy::LteUePhy (Ptr dlPhy, Ptr ulPhy) : LtePhy (dlPhy, ulPhy), - m_p10CqiPeriodicity (MilliSeconds (1)), // ideal behavior - m_a30CqiPeriodicity (MilliSeconds (1)), // ideal behavior m_uePhySapUser (0), m_ueCphySapUser (0), m_state (CELL_SEARCH), @@ -286,6 +284,12 @@ LteUePhy::GetTypeId (void) TimeValue (MilliSeconds (200)), MakeTimeAccessor (&LteUePhy::m_ueMeasurementsFilterPeriod), MakeTimeChecker ()) + .AddAttribute ("DownlinkCqiPeriodicity", + "Periodicity in milliseconds for reporting the" + "wideband and subband downlink CQIs to the eNB", + TimeValue (MilliSeconds (1)), + MakeTimeAccessor (&LteUePhy::SetDownlinkCqiPeriodicity), + MakeTimeChecker ()) .AddTraceSource ("ReportUeMeasurements", "Report UE measurements RSRP (dBm) and RSRQ (dB).", MakeTraceSourceAccessor (&LteUePhy::m_reportUeMeasurements), @@ -494,6 +498,8 @@ LteUePhy::GenerateCqiRsrpRsrq (const SpectrumValue& sinr) // check periodic wideband CQI if (Simulator::Now () > m_p10CqiLast + m_p10CqiPeriodicity) { + NS_LOG_DEBUG("Reporting P10 CQI at : " << Simulator::Now().GetMilliSeconds() + << " ms. Last reported at : " << m_p10CqiLast.GetMilliSeconds() << " ms"); Ptr thisDevice = GetDevice ()->GetObject (); Ptr msg = CreateDlCqiFeedbackMessage (sinr); if (msg) @@ -505,6 +511,8 @@ LteUePhy::GenerateCqiRsrpRsrq (const SpectrumValue& sinr) // check aperiodic high-layer configured subband CQI if (Simulator::Now () > m_a30CqiLast + m_a30CqiPeriodicity) { + NS_LOG_DEBUG("Reporting A30 CQI at : " << Simulator::Now().GetMilliSeconds() + << " ms. Last reported at : " << m_a30CqiLast.GetMilliSeconds() << " ms"); Ptr thisDevice = GetDevice ()->GetObject (); Ptr msg = CreateDlCqiFeedbackMessage (sinr); if (msg) @@ -843,6 +851,14 @@ LteUePhy::ReportUeMeasurements () Simulator::Schedule (m_ueMeasurementsFilterPeriod, &LteUePhy::ReportUeMeasurements, this); } +void +LteUePhy::SetDownlinkCqiPeriodicity (Time cqiPeriodicity) +{ + NS_LOG_FUNCTION (this << cqiPeriodicity); + m_a30CqiPeriodicity = cqiPeriodicity; + m_p10CqiPeriodicity = cqiPeriodicity; +} + void LteUePhy::DoSendLteControlMessage (Ptr msg) { diff --git a/src/lte/model/lte-ue-phy.h b/src/lte/model/lte-ue-phy.h index 53957d901..11b184ac8 100644 --- a/src/lte/model/lte-ue-phy.h +++ b/src/lte/model/lte-ue-phy.h @@ -97,9 +97,9 @@ public: LteUePhySapProvider* GetLteUePhySapProvider (); /** - * \brief Set the PHY SAP User - * \param s a pointer to the SAP user - */ + * \brief Set the PHY SAP User + * \param s a pointer to the SAP user + */ void SetLteUePhySapUser (LteUePhySapUser* s); /** @@ -109,9 +109,9 @@ public: LteUeCphySapProvider* GetLteUeCphySapProvider (); /** - * \brief Set the CPHY SAP User - * \param s a pointer to the SAP user - */ + * \brief Set the CPHY SAP User + * \param s a pointer to the SAP user + */ void SetLteUeCphySapUser (LteUeCphySapUser* s); @@ -184,11 +184,11 @@ public: std::vector GetSubChannelsForReception (void); /** - * \brief Create the DL CQI feedback from SINR values perceived at - * the physical layer with the signal received from eNB - * \param sinr SINR values vector - * \return a DL CQI control message containing the CQI feedback - */ + * \brief Create the DL CQI feedback from SINR values perceived at + * the physical layer with the signal received from eNB + * \param sinr SINR values vector + * \return a DL CQI control message containing the CQI feedback + */ Ptr CreateDlCqiFeedbackMessage (const SpectrumValue& sinr); @@ -197,33 +197,33 @@ public: virtual void GenerateCtrlCqiReport (const SpectrumValue& sinr); virtual void GenerateDataCqiReport (const SpectrumValue& sinr); /** - * \brief Create the mixed CQI report - * - * \param sinr SINR values vector - */ + * \brief Create the mixed CQI report + * + * \param sinr SINR values vector + */ virtual void GenerateMixedCqiReport (const SpectrumValue& sinr); virtual void ReportInterference (const SpectrumValue& interf); /** - * \brief Create the mixed CQI report - * - * \param interf interference values vector - */ + * \brief Create the mixed CQI report + * + * \param interf interference values vector + */ virtual void ReportDataInterference (const SpectrumValue& interf); virtual void ReportRsReceivedPower (const SpectrumValue& power); // callbacks for LteSpectrumPhy /** - * \brief Receive LTE control message list function - * - * \param msgList LTE control message list - */ + * \brief Receive LTE control message list function + * + * \param msgList LTE control message list + */ virtual void ReceiveLteControlMessageList (std::list > msgList); /** - * \brief Receive PSS function - * - * \param cellId the cell ID - * \param p PSS list - */ + * \brief Receive PSS function + * + * \param cellId the cell ID + * \param p PSS list + */ virtual void ReceivePss (uint16_t cellId, Ptr p); @@ -235,11 +235,11 @@ public: /** - * \brief trigger from eNB the start from a new frame - * - * \param frameNo frame number - * \param subframeNo subframe number - */ + * \brief trigger from eNB the start from a new frame + * + * \param frameNo frame number + * \param subframeNo subframe number + */ void SubframeIndication (uint32_t frameNo, uint32_t subframeNo); @@ -354,15 +354,12 @@ private: * \param [in] gain */ void SetTxModeGain (uint8_t txMode, double gain); - /** * queue subchannels for transmission function * * \param [in] rbMap */ void QueueSubChannelsForTransmission (std::vector rbMap); - - /** * internal method that takes care of generating CQI reports, * calculating the RSRP and RSRQ metrics, and generating RSRP+SINR traces @@ -370,8 +367,6 @@ private: * \param sinr */ void GenerateCqiRsrpRsrq (const SpectrumValue& sinr); - - /** * \brief Layer-1 filtering of RSRP and RSRQ measurements and reporting to * the RRC entity. @@ -380,7 +375,13 @@ private: * periodicity as indicated by the *UeMeasurementsFilterPeriod* attribute. */ void ReportUeMeasurements (); - + /** + * \brief Set the periodicty for the downlink periodic + * wideband and aperiodic subband CQI reporting. + * + * \param cqiPeriodicity The downlink CQI reporting periodicity in milliseconds + */ + void SetDownlinkCqiPeriodicity (Time cqiPeriodicity); /** * Switch the UE PHY to the given state. * \param s the destination state