14#include "ns3/double.h"
44 TypeId(
"ns3::A3RsrpHandoverAlgorithm")
50 "Handover margin (hysteresis) in dB "
51 "(rounded to the nearest multiple of 0.5 dB)",
56 .AddAttribute(
"TimeToTrigger",
57 "Time during which neighbour cell's RSRP "
58 "must continuously higher than serving cell's RSRP "
59 "in order to trigger a handover",
88 <<
" (hysteresis=" << (uint16_t)hysteresisIeValue <<
")"
125 this <<
" Event A3 received without measurement results from neighbouring cells");
129 uint16_t bestNeighbourCellId = 0;
130 uint8_t bestNeighbourRsrp = 0;
136 if (it->haveRsrpResult)
138 if ((bestNeighbourRsrp < it->rsrpResult) &&
IsValidNeighbour(it->physCellId))
140 bestNeighbourCellId = it->physCellId;
141 bestNeighbourRsrp = it->rsrpResult;
146 NS_LOG_WARN(
"RSRP measurement is missing from cell ID " << it->physCellId);
150 if (bestNeighbourCellId > 0)
152 NS_LOG_LOGIC(
"Trigger Handover to cellId " << bestNeighbourCellId);
153 NS_LOG_LOGIC(
"target cell RSRP " << (uint16_t)bestNeighbourRsrp);
Implementation of the strongest cell handover algorithm, based on RSRP measurements and Event A3.
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.
void DoDispose() override
Destructor implementation.
friend class MemberLteHandoverManagementSapProvider< A3RsrpHandoverAlgorithm >
let the forwarder class access the protected and private members
A3RsrpHandoverAlgorithm()
Creates a strongest cell handover algorithm instance.
~A3RsrpHandoverAlgorithm() override
void DoInitialize() override
Initialize() implementation.
LteHandoverManagementSapProvider * GetLteHandoverManagementSapProvider() override
Export the "provider" part of the Handover Management SAP interface.
std::vector< uint8_t > m_measIds
The expected measurement identity for A3 measurements.
void SetLteHandoverManagementSapUser(LteHandoverManagementSapUser *s) override
Set the "user" part of the Handover Management SAP interface that this handover algorithm instance wi...
void DoReportUeMeas(uint16_t rnti, LteRrcSap::MeasResults measResults) override
Implementation of LteHandoverManagementSapProvider::ReportUeMeas.
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.
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 void DoInitialize()
Initialize() implementation.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
#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 AttributeAccessor > MakeTimeAccessor(T1 a1)
Ptr< const AttributeChecker > MakeDoubleChecker()
Ptr< const AttributeAccessor > MakeDoubleAccessor(T1 a1)
Ptr< const AttributeChecker > MakeTimeChecker()
Helper to make an unbounded Time checker.
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...
uint8_t hysteresis
Parameter used within the entry and leave condition of an event triggered reporting condition.
enum ns3::LteRrcSap::ReportConfigEutra::@174152020357172127004302246116267001242110156064 eventId
Event enumeration.
enum ns3::LteRrcSap::ReportConfigEutra::@374136270164373156154156077265266160331034212212 triggerQuantity
Trigger type enumeration.
@ EVENT_A3
Event A3: Neighbour becomes amount of offset better than PCell.
enum ns3::LteRrcSap::ReportConfigEutra::@052114161037202132004365346027213360353343030201 reportInterval
Report interval enumeration.
@ RSRP
Reference Signal Received Power.
int8_t a3Offset
Offset value for Event A3.
uint16_t timeToTrigger
Time during which specific criteria for the event needs to be met in order to trigger a measurement r...