24 #include <ns3/double.h> 25 #include <ns3/lte-common.h> 36 : m_handoverManagementSapUser (0)
52 static TypeId tid =
TypeId (
"ns3::A3RsrpHandoverAlgorithm")
56 .AddAttribute (
"Hysteresis",
57 "Handover margin (hysteresis) in dB " 58 "(rounded to the nearest multiple of 0.5 dB)",
61 MakeDoubleChecker<uint8_t> (0.0, 15.0))
62 .AddAttribute (
"TimeToTrigger",
63 "Time during which neighbour cell's RSRP " 64 "must continuously higher than serving cell's RSRP " 65 "in order to trigger a handover",
96 NS_LOG_LOGIC (
this <<
" requesting Event A3 measurements" 97 <<
" (hysteresis=" << (uint16_t) hysteresisIeValue <<
")" 102 reportConfig.a3Offset = 0;
103 reportConfig.hysteresis = hysteresisIeValue;
105 reportConfig.reportOnLeave =
false;
137 uint16_t bestNeighbourCellId = 0;
138 uint8_t bestNeighbourRsrp = 0;
140 for (std::list <LteRrcSap::MeasResultEutra>::iterator it = measResults.
measResultListEutra.begin ();
144 if (it->haveRsrpResult)
146 if ((bestNeighbourRsrp < it->rsrpResult)
149 bestNeighbourCellId = it->physCellId;
150 bestNeighbourRsrp = it->rsrpResult;
155 NS_LOG_WARN (
"RSRP measurement is missing from cell ID " << it->physCellId);
159 if (bestNeighbourCellId > 0)
161 NS_LOG_LOGIC (
"Trigger Handover to cellId " << bestNeighbourCellId);
162 NS_LOG_LOGIC (
"target cell RSRP " << (uint16_t) bestNeighbourRsrp);
167 bestNeighbourCellId);
172 NS_LOG_WARN (
this <<
" Event A3 received without measurement results from neighbouring cells");
virtual void DoInitialize(void)
Initialize() implementation.
#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...
double m_hysteresisDb
The Hysteresis attribute.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Event A3: Neighbour becomes amount of offset better than PCell.
std::list< MeasResultEutra > measResultListEutra
measure result list eutra
Specifies criteria for triggering of an E-UTRA measurement reporting event.
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.
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
LteHandoverManagementSapProvider * m_handoverManagementSapProvider
Receive API calls from the eNodeB RRC instance.
void DoReportUeMeas(uint16_t rnti, LteRrcSap::MeasResults measResults)
Implementation of LteHandoverManagementSapProvider::ReportUeMeas.
static TypeId GetTypeId()
Get the type ID.
virtual void DoInitialize()
Initialize() implementation.
Ptr< const AttributeChecker > MakeTimeChecker(const Time min, const Time max)
Helper to make a Time checker with bounded range.
uint8_t rsrpResult
RSRP result.
virtual ~A3RsrpHandoverAlgorithm()
AttributeValue implementation for Time.
bool IsValidNeighbour(uint16_t cellId)
Determines if a neighbour cell is a valid destination for handover.
Time m_timeToTrigger
The TimeToTrigger attribute.
Template for the implementation of the LteHandoverManagementSapProvider as a member of an owner class...
Implementation of the strongest cell handover algorithm, based on RSRP measurements and Event A3...
enum ns3::LteRrcSap::ReportConfigEutra::@65 eventId
Event enumeration.
uint8_t m_measId
The expected measurement identity for A3 measurements.
LteHandoverManagementSapUser * m_handoverManagementSapUser
Interface to the eNodeB RRC instance.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Reference Signal Received Power.
bool haveMeasResultNeighCells
have measure result neighbor cells
virtual LteHandoverManagementSapProvider * GetLteHandoverManagementSapProvider()
Export the "provider" part of the Handover Management SAP interface.
Ptr< const AttributeAccessor > MakeTimeAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
NS_LOG_LOGIC("Net device "<< nd<< " is not bridged")
Ptr< const AttributeAccessor > MakeDoubleAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
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...
int64_t GetMilliSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
virtual uint8_t AddUeMeasReportConfigForHandover(LteRrcSap::ReportConfigEutra reportConfig)=0
Request a certain reporting configuration to be fulfilled by the UEs attached to the eNodeB entity...
A3RsrpHandoverAlgorithm()
Creates a strongest cell handover algorithm instance.
This class can be used to hold variables of floating point type such as 'double' or 'float'...
virtual void DoDispose()
Destructor implementation.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
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...