24 #include <ns3/double.h>
25 #include <ns3/lte-common.h>
37 : m_handoverManagementSapUser (0)
53 static TypeId tid =
TypeId (
"ns3::A3RsrpHandoverAlgorithm")
57 .AddAttribute (
"Hysteresis",
58 "Handover margin (hysteresis) in dB "
59 "(rounded to the nearest multiple of 0.5 dB)",
62 MakeDoubleChecker<uint8_t> (0.0, 15.0))
63 .AddAttribute (
"TimeToTrigger",
64 "Time during which neighbour cell's RSRP "
65 "must continuously higher than serving cell's RSRP "
66 "in order to trigger a handover",
97 NS_LOG_LOGIC (
this <<
" requesting Event A3 measurements"
98 <<
" (hysteresis=" << (uint16_t) hysteresisIeValue <<
")"
138 uint16_t bestNeighbourCellId = 0;
139 uint8_t bestNeighbourRsrp = 0;
141 for (std::list <LteRrcSap::MeasResultEutra>::iterator it = measResults.
measResultListEutra.begin ();
145 if (it->haveRsrpResult)
147 if ((bestNeighbourRsrp < it->rsrpResult)
150 bestNeighbourCellId = it->physCellId;
151 bestNeighbourRsrp = it->rsrpResult;
156 NS_LOG_WARN (
"RSRP measurement is missing from cell ID " << it->physCellId);
160 if (bestNeighbourCellId > 0)
162 NS_LOG_LOGIC (
"Trigger Handover to cellId " << bestNeighbourCellId);
163 NS_LOG_LOGIC (
"target cell RSRP " << (uint16_t) bestNeighbourRsrp);
168 bestNeighbourCellId);
173 NS_LOG_WARN (
this <<
" Event A3 received without measurement results from neighbouring cells");
Implementation of the strongest cell handover algorithm, based on RSRP measurements and Event A3.
virtual void DoInitialize()
Initialize() implementation.
bool IsValidNeighbour(uint16_t cellId)
Determines if a neighbour cell is a valid destination for handover.
double m_hysteresisDb
The Hysteresis attribute.
LteHandoverManagementSapUser * m_handoverManagementSapUser
Interface to the eNodeB RRC instance.
static TypeId GetTypeId()
Get the type ID.
LteHandoverManagementSapProvider * m_handoverManagementSapProvider
Receive API calls from the eNodeB RRC instance.
Time m_timeToTrigger
The TimeToTrigger attribute.
friend class MemberLteHandoverManagementSapProvider< A3RsrpHandoverAlgorithm >
let the forwarder class access the protected and private members
A3RsrpHandoverAlgorithm()
Creates a strongest cell handover algorithm instance.
virtual void DoDispose()
Destructor implementation.
std::vector< uint8_t > m_measIds
The expected measurement identity for A3 measurements.
void DoReportUeMeas(uint16_t rnti, LteRrcSap::MeasResults measResults)
Implementation of LteHandoverManagementSapProvider::ReportUeMeas.
virtual LteHandoverManagementSapProvider * GetLteHandoverManagementSapProvider()
Export the "provider" part of the Handover Management SAP interface.
virtual ~A3RsrpHandoverAlgorithm()
virtual void SetLteHandoverManagementSapUser(LteHandoverManagementSapUser *s)
Set the "user" part of the Handover Management SAP interface that this handover algorithm instance wi...
This class can be used to hold variables of floating point type such as 'double' or 'float'.
static uint8_t ActualHysteresis2IeValue(double hysteresisDb)
Returns the IE value of hysteresis.
The abstract base class of a handover algorithm that operates using the Handover Management SAP inter...
Service Access Point (SAP) offered by the handover algorithm instance to the eNodeB RRC instance.
Service Access Point (SAP) offered by the eNodeB RRC instance to the handover algorithm instance.
virtual std::vector< uint8_t > AddUeMeasReportConfigForHandover(LteRrcSap::ReportConfigEutra reportConfig)=0
Request a certain reporting configuration to be fulfilled by the UEs attached to the eNodeB entity.
virtual void TriggerHandover(uint16_t rnti, uint16_t targetCellId)=0
Instruct the eNodeB RRC entity to prepare a handover.
virtual void DoInitialize(void)
Initialize() implementation.
int64_t GetMilliSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
TimeWithUnit As(const enum Unit unit=Time::AUTO) const
Attach a unit to a Time, to facilitate output in a specific unit.
AttributeValue implementation for Time.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Ptr< const AttributeAccessor > MakeDoubleAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Ptr< const AttributeAccessor > MakeTimeAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_LOG_WARN(msg)
Use NS_LOG to output a message of level LOG_WARN.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Ptr< const AttributeChecker > MakeTimeChecker(const Time min, const Time max)
Helper to make a Time checker with bounded range.
uint8_t rsrpResult
the RSRP result
bool haveMeasResultNeighCells
have measure result neighbor cells
std::list< MeasResultEutra > measResultListEutra
measure result list eutra
MeasResultPCell measResultPCell
measurement result primary cell
Specifies criteria for triggering of an E-UTRA measurement reporting event.
bool reportOnLeave
Indicates whether or not the UE shall initiate the measurement reporting procedure when the leaving c...
@ EVENT_A3
Event A3: Neighbour becomes amount of offset better than PCell.
uint8_t hysteresis
Parameter used within the entry and leave condition of an event triggered reporting condition....
@ RSRP
Reference Signal Received Power.
enum ns3::LteRrcSap::ReportConfigEutra::@67 triggerQuantity
Trigger type enumeration.
enum ns3::LteRrcSap::ReportConfigEutra::@66 eventId
Event enumeration.
enum ns3::LteRrcSap::ReportConfigEutra::@69 reportInterval
Report interval enumeration.
int8_t a3Offset
Offset value for Event A3. An integer between -30 and 30. The actual value is (value * 0....
uint16_t timeToTrigger
Time during which specific criteria for the event needs to be met in order to trigger a measurement r...