diff --git a/src/lte/model/lte-ue-rrc.cc b/src/lte/model/lte-ue-rrc.cc index 04d0ca634..7ac98b4f0 100644 --- a/src/lte/model/lte-ue-rrc.cc +++ b/src/lte/model/lte-ue-rrc.cc @@ -45,7 +45,6 @@ NS_LOG_COMPONENT_DEFINE ("LteUeRrc"); namespace ns3 { - ///////////////////////////// // CMAC SAP forwarder ///////////////////////////// @@ -1885,7 +1884,10 @@ LteUeRrc::VarMeasReportListAdd (uint8_t measId, ConcernedCells_t enteringCells) NS_ASSERT (!measReportIt->second.cellsTriggeredList.empty ()); measReportIt->second.numberOfReportsSent = 0; - SendMeasurementReport (measId); + measReportIt->second.periodicReportTimer + = Simulator::Schedule (UE_MEASUREMENTS_DELAY, + &LteUeRrc::SendMeasurementReport, + this, measId); std::map >::iterator enteringTriggerIt = m_enteringTriggerQueue.find (measId); @@ -1943,6 +1945,8 @@ LteUeRrc::VarMeasReportListErase (uint8_t measId, ConcernedCells_t leavingCells, if (reportOnLeave) { + // TODO: this might fail because the VarMeasReportList entry might have been deleted already + // TODO: this might produce unexpectedly repeating measurement report SendMeasurementReport (measId); } diff --git a/src/lte/model/lte-ue-rrc.h b/src/lte/model/lte-ue-rrc.h index e510f07ff..552d26271 100644 --- a/src/lte/model/lte-ue-rrc.h +++ b/src/lte/model/lte-ue-rrc.h @@ -35,6 +35,26 @@ namespace ns3 { + +/** + * \brief Artificial delay of UE measurements procedure + * + * i.e. the period between the time layer-1-filtered measurements from PHY + * layer is received and the earliest time the actual measurement report + * submission to the serving cell is invoked. + * + * This delay exists because of racing condition between several UE measurements + * functions which happen to be scheduled at the same time. The delay ensures + * that: + * - measurements (e.g. layer-3-filtering) is always performed before + * reporting, thus the latter always uses the newest layer-1-filtered + * measurements from PHY; and + * - time-to-trigger is always performed just before the reporting, so there + * would still be chance to cancel the reporting if necessary. + */ +static const Time UE_MEASUREMENTS_DELAY = MicroSeconds (1); + + class LteRlc; class LteMacSapProvider; class LteUeCmacSapUser; @@ -287,7 +307,7 @@ private: LteMacSapProvider* m_macSapProvider; LtePdcpSapUser* m_drbPdcpSapUser; - + LteAsSapProvider* m_asSapProvider; LteAsSapUser* m_asSapUser;