From 9596dd4d5c656c95ce2e99a100b1fd1890e35e85 Mon Sep 17 00:00:00 2001 From: Marco Miozzo Date: Thu, 9 Jun 2011 12:44:39 +0200 Subject: [PATCH] LENA-109 Uplink CQI support: introduced estimation of unkwnown CQI (average) --- src/lte/model/pf-ff-mac-scheduler.cc | 45 ++++++++++++++++++++++++++-- src/lte/model/pf-ff-mac-scheduler.h | 6 ++++ 2 files changed, 49 insertions(+), 2 deletions(-) diff --git a/src/lte/model/pf-ff-mac-scheduler.cc b/src/lte/model/pf-ff-mac-scheduler.cc index 95bc42816..40b78abd3 100644 --- a/src/lte/model/pf-ff-mac-scheduler.cc +++ b/src/lte/model/pf-ff-mac-scheduler.cc @@ -674,6 +674,38 @@ PfFfMacScheduler::DoSchedDlCqiInfoReq (const struct FfMacSchedSapProvider::Sched return; } + +double +PfFfMacScheduler::EstimateUlSinr(uint16_t rnti, uint16_t rb) +{ + std::map >::iterator itCqi = m_ueCqi.find (rnti); + if (itCqi == m_ueCqi.end ()) + { + // no cqi info about this UE + return (NO_SINR); + + } + else + { + // take the average SINR value among the available + double sinrSum = 0; + int sinrNum = 0; + for (uint32_t i = 0; i < m_cschedCellConfig.m_ulBandwidth; i++) + { + double sinr = (*itCqi).second.at(i); + if (sinr != NO_SINR) + { + sinrSum += sinr; + sinrNum++; + } + } + double estimatedSinr = sinrSum / (double)sinrNum; + // store the value + (*itCqi).second.at(rb) = estimatedSinr; + return (estimatedSinr); + } +} + void PfFfMacScheduler::DoSchedUlTriggerReq (const struct FfMacSchedSapProvider::SchedUlTriggerReqParameters& params) { @@ -757,9 +789,18 @@ PfFfMacScheduler::DoSchedUlTriggerReq (const struct FfMacSchedSapProvider::Sched { // take the lowest CQI value (worst RB) double minSinr = (*itCqi).second.at(uldci.m_rbStart); + if (minSinr == NO_SINR) + { + minSinr = EstimateUlSinr ((*it).first, uldci.m_rbStart); + } for (uint16_t i = uldci.m_rbStart; i < uldci.m_rbStart + uldci.m_rbLen; i++) { //NS_LOG_DEBUG (this << " UE " << (*it).first << " has CQI " << (*itCqi).second.at(i)); + double sinr = (*itCqi).second.at(i); + if (sinr == NO_SINR) + { + sinr = EstimateUlSinr ((*it).first, i); + } if ((*itCqi).second.at(i) < minSinr) { minSinr = (*itCqi).second.at(i); @@ -937,8 +978,8 @@ PfFfMacScheduler::DoSchedUlCqiInfoReq (const struct FfMacSchedSapProvider::Sched } else { - // initialize with minumum values according to the fixed point notation - newCqi.push_back (LteFfConverter::getMinFpS11dot3Value ()); + // initialize with NO_SINR value. + newCqi.push_back (NO_SINR); } } diff --git a/src/lte/model/pf-ff-mac-scheduler.h b/src/lte/model/pf-ff-mac-scheduler.h index 91ac295ad..3114cd073 100644 --- a/src/lte/model/pf-ff-mac-scheduler.h +++ b/src/lte/model/pf-ff-mac-scheduler.h @@ -30,6 +30,10 @@ #include +// value for SINR outside the range defined by FF-API, used to indicate that there +// is no CQI for this element +#define NO_SINR -5000 + namespace ns3 { @@ -129,6 +133,8 @@ private: int GetRbgSize (int dlbandwidth); int LcActivePerFlow(uint16_t rnti); + + double EstimateUlSinr(uint16_t rnti, uint16_t rb); /* * Vectors of UE's LC info