24 #include <ns3/double.h>
25 #include <ns3/lte-common.h>
36 : m_handoverManagementSapUser (0)
52 static TypeId tid =
TypeId (
"ns3::A3RsrpHandoverAlgorithm")
54 .AddConstructor<A3RsrpHandoverAlgorithm> ()
55 .AddAttribute (
"Hysteresis",
56 "Handover margin (hysteresis) in dB "
57 "(rounded to the nearest multiple of 0.5 dB)",
60 MakeDoubleChecker<uint8_t> (0.0, 15.0))
61 .AddAttribute (
"TimeToTrigger",
62 "Time during which neighbour cell's RSRP "
63 "must continuously higher than serving cell's RSRP "
64 "in order to trigger a handover",
95 NS_LOG_LOGIC (
this <<
" requesting Event A3 measurements"
96 <<
" (hysteresis=" << (uint16_t) hysteresisIeValue <<
")"
101 reportConfig.a3Offset = 0;
102 reportConfig.hysteresis = hysteresisIeValue;
104 reportConfig.reportOnLeave =
false;
136 uint16_t bestNeighbourCellId = 0;
137 uint8_t bestNeighbourRsrp = -std::numeric_limits<double>::infinity ();
139 for (std::list <LteRrcSap::MeasResultEutra>::iterator it = measResults.
measResultListEutra.begin ();
143 if (it->haveRsrpResult)
145 if ((bestNeighbourRsrp < it->rsrpResult)
148 bestNeighbourCellId = it->physCellId;
149 bestNeighbourRsrp = it->rsrpResult;
154 NS_LOG_WARN (
"RSRP measurement is missing from cell ID " << it->physCellId);
158 if (bestNeighbourCellId > 0)
160 NS_LOG_LOGIC (
"Trigger Handover to cellId " << bestNeighbourCellId);
161 NS_LOG_LOGIC (
"target cell RSRP " << (uint16_t) bestNeighbourRsrp);
166 bestNeighbourCellId);
171 NS_LOG_WARN (
this <<
" Event A3 received without measurement results from neighbouring cells");
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
The abstract base class of a handover algorithm that operates using the Handover Management SAP inter...
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register the class in the ns-3 factory.
std::list< MeasResultEutra > measResultListEutra
Specifies criteria for triggering of an E-UTRA measurement reporting event.
enum ns3::LteRrcSap::ReportConfigEutra::@72 eventId
Choice of E-UTRA event triggered reporting criteria.
virtual void TriggerHandover(uint16_t rnti, uint16_t targetCellId)=0
Instruct the eNodeB RRC entity to prepare a handover.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
LteHandoverManagementSapProvider * m_handoverManagementSapProvider
void DoReportUeMeas(uint16_t rnti, LteRrcSap::MeasResults measResults)
Implementation of LteHandoverManagementSapProvider::ReportUeMeas.
static TypeId GetTypeId()
virtual void DoInitialize()
This method is called only once by Object::Initialize.
Event A3: Neighbour becomes amount of offset better than PCell.
virtual ~A3RsrpHandoverAlgorithm()
hold objects of type ns3::Time
bool IsValidNeighbour(uint16_t cellId)
Template for the implementation of the LteHandoverManagementSapProvider as a member of an owner class...
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
LteHandoverManagementSapUser * m_handoverManagementSapUser
bool haveMeasResultNeighCells
virtual LteHandoverManagementSapProvider * GetLteHandoverManagementSapProvider()
Export the "provider" part of the Handover Management SAP interface.
Reference Signal Received Power.
static uint8_t ActualHysteresis2IeValue(double hysteresisDb)
Returns the IE value of hysteresis.
#define NS_LOG_WARN(msg)
Use NS_LOG to output a message of level LOG_WARN.
Service Access Point (SAP) offered by the handover algorithm instance to the eNodeB RRC instance...
virtual uint8_t AddUeMeasReportConfigForHandover(LteRrcSap::ReportConfigEutra reportConfig)=0
Request a certain reporting configuration to be fulfilled by the UEs attached to the eNodeB entity...
Ptr< const AttributeChecker > MakeTimeChecker(const Time min, const Time max)
Helper to make a Time checker with bounded range.
A3RsrpHandoverAlgorithm()
Creates a strongest cell handover algorithm instance.
Hold a floating point type.
virtual void DoDispose()
This method is called by Object::Dispose or by the object's destructor, whichever comes first...
a unique identifier for an interface.
int64_t GetMilliSeconds(void) const
TypeId SetParent(TypeId tid)
virtual void SetLteHandoverManagementSapUser(LteHandoverManagementSapUser *s)
Set the "user" part of the Handover Management SAP interface that this handover algorithm instance wi...
Service Access Point (SAP) offered by the eNodeB RRC instance to the handover algorithm instance...
virtual void DoInitialize(void)
This method is called only once by Object::Initialize.