Skip to content

Commit

Permalink
lte: Add attribute to configure the periodicity of DL CQI reports
Browse files Browse the repository at this point in the history
  • Loading branch information
ZorazeAli committed Oct 2, 2018
1 parent 1e986d4 commit 0b3a603
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 41 deletions.
20 changes: 18 additions & 2 deletions src/lte/model/lte-ue-phy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,6 @@ LteUePhy::LteUePhy ()

LteUePhy::LteUePhy (Ptr<LteSpectrumPhy> dlPhy, Ptr<LteSpectrumPhy> 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),
Expand Down Expand Up @@ -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),
Expand Down Expand Up @@ -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<LteUeNetDevice> thisDevice = GetDevice ()->GetObject<LteUeNetDevice> ();
Ptr<DlCqiLteControlMessage> msg = CreateDlCqiFeedbackMessage (sinr);
if (msg)
Expand All @@ -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<LteUeNetDevice> thisDevice = GetDevice ()->GetObject<LteUeNetDevice> ();
Ptr<DlCqiLteControlMessage> msg = CreateDlCqiFeedbackMessage (sinr);
if (msg)
Expand Down Expand Up @@ -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<LteControlMessage> msg)
{
Expand Down
79 changes: 40 additions & 39 deletions src/lte/model/lte-ue-phy.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,9 @@ class LteUePhy : public LtePhy
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);

/**
Expand All @@ -109,9 +109,9 @@ class LteUePhy : public LtePhy
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);


Expand Down Expand Up @@ -184,11 +184,11 @@ class LteUePhy : public LtePhy
std::vector <int> 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<DlCqiLteControlMessage> CreateDlCqiFeedbackMessage (const SpectrumValue& sinr);


Expand All @@ -197,33 +197,33 @@ class LteUePhy : public LtePhy
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<Ptr<LteControlMessage> > 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<SpectrumValue> p);


Expand All @@ -235,11 +235,11 @@ class LteUePhy : public LtePhy


/**
* \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);


Expand Down Expand Up @@ -354,24 +354,19 @@ class LteUePhy : public LtePhy
* \param [in] gain
*/
void SetTxModeGain (uint8_t txMode, double gain);

/**
* queue subchannels for transmission function
*
* \param [in] rbMap
*/
void QueueSubChannelsForTransmission (std::vector <int> rbMap);


/**
* internal method that takes care of generating CQI reports,
* calculating the RSRP and RSRQ metrics, and generating RSRP+SINR traces
*
* \param sinr
*/
void GenerateCqiRsrpRsrq (const SpectrumValue& sinr);


/**
* \brief Layer-1 filtering of RSRP and RSRQ measurements and reporting to
* the RRC entity.
Expand All @@ -380,7 +375,13 @@ class LteUePhy : public LtePhy
* 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
Expand Down

0 comments on commit 0b3a603

Please sign in to comment.