A Discrete-Event Network Simulator
API
ns3::LteAnr Class Reference

Automatic Neighbour Relation function. More...

#include "lte-anr.h"

+ Inheritance diagram for ns3::LteAnr:
+ Collaboration diagram for ns3::LteAnr:

Classes

struct  NeighbourRelation_t
 Neighbour Relation between two eNodeBs (serving eNodeB and neighbour eNodeB). More...
 

Public Member Functions

 LteAnr (uint16_t servingCellId)
 Creates an ANR instance. More...
 
 ~LteAnr () override
 
void AddNeighbourRelation (uint16_t cellId)
 Provide an advance information about a related neighbouring cell and add it as a new Neighbour Relation entry. More...
 
virtual LteAnrSapProviderGetLteAnrSapProvider ()
 Export the "provider" part of the ANR SAP interface. More...
 
void RemoveNeighbourRelation (uint16_t cellId)
 Remove an existing Neighbour Relation entry. More...
 
virtual void SetLteAnrSapUser (LteAnrSapUser *s)
 Set the "user" part of the ANR SAP interface that this ANR instance will interact with. More...
 
- Public Member Functions inherited from ns3::Object
 Object ()
 Constructor. More...
 
 ~Object () override
 Destructor. More...
 
void AggregateObject (Ptr< Object > other)
 Aggregate two Objects together. More...
 
void Dispose ()
 Dispose of this Object. More...
 
AggregateIterator GetAggregateIterator () const
 Get an iterator to the Objects aggregated to this one. More...
 
TypeId GetInstanceTypeId () const override
 Get the most derived TypeId for this Object. More...
 
template<typename T >
Ptr< T > GetObject () const
 Get a pointer to the requested aggregated Object. More...
 
template<>
Ptr< ObjectGetObject () const
 Specialization of () for objects of type ns3::Object. More...
 
template<typename T >
Ptr< T > GetObject (TypeId tid) const
 Get a pointer to the requested aggregated Object by TypeId. More...
 
template<>
Ptr< ObjectGetObject (TypeId tid) const
 Specialization of (TypeId tid) for objects of type ns3::Object. More...
 
void Initialize ()
 Invoke DoInitialize on all Objects aggregated to this one. More...
 
bool IsInitialized () const
 Check if the object has been initialized. More...
 
- Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
 SimpleRefCount ()
 Default constructor. More...
 
 SimpleRefCount (const SimpleRefCount &o[[maybe_unused]])
 Copy constructor. More...
 
uint32_t GetReferenceCount () const
 Get the reference count of the object. More...
 
SimpleRefCountoperator= (const SimpleRefCount &o[[maybe_unused]])
 Assignment operator. More...
 
void Ref () const
 Increment the reference count. More...
 
void Unref () const
 Decrement the reference count. More...
 
- Public Member Functions inherited from ns3::ObjectBase
virtual ~ObjectBase ()
 Virtual destructor. More...
 
void GetAttribute (std::string name, AttributeValue &value) const
 Get the value of an attribute, raising fatal errors if unsuccessful. More...
 
bool GetAttributeFailSafe (std::string name, AttributeValue &value) const
 Get the value of an attribute without raising errors. More...
 
void SetAttribute (std::string name, const AttributeValue &value)
 Set a single attribute, raising fatal errors if unsuccessful. More...
 
bool SetAttributeFailSafe (std::string name, const AttributeValue &value)
 Set a single attribute without raising errors. More...
 
bool TraceConnect (std::string name, std::string context, const CallbackBase &cb)
 Connect a TraceSource to a Callback with a context. More...
 
bool TraceConnectWithoutContext (std::string name, const CallbackBase &cb)
 Connect a TraceSource to a Callback without a context. More...
 
bool TraceDisconnect (std::string name, std::string context, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected with a context. More...
 
bool TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected without a context. More...
 

Static Public Member Functions

static TypeId GetTypeId ()
 Get the type ID. More...
 
- Static Public Member Functions inherited from ns3::Object
static TypeId GetTypeId ()
 Register this type. More...
 
- Static Public Member Functions inherited from ns3::ObjectBase
static TypeId GetTypeId ()
 Get the type ID. More...
 

Protected Member Functions

void DoDispose () override
 Destructor implementation. More...
 
void DoInitialize () override
 Initialize() implementation. More...
 
- Protected Member Functions inherited from ns3::Object
 Object (const Object &o)
 Copy an Object. More...
 
virtual void NotifyNewAggregate ()
 Notify all Objects aggregated to this one of a new Object being aggregated. More...
 
- Protected Member Functions inherited from ns3::ObjectBase
void ConstructSelf (const AttributeConstructionList &attributes)
 Complete construction of ObjectBase; invoked by derived classes. More...
 
virtual void NotifyConstructionCompleted ()
 Notifier called once the ObjectBase is fully constructed. More...
 

Private Types

typedef std::map< uint16_t, NeighbourRelation_tNeighbourRelationTable_t
 cellId More...
 

Private Member Functions

void DoAddNeighbourRelation (uint16_t cellId)
 Implementation of LteAnrSapProvider::AddNeighbourRelation. More...
 
bool DoGetNoHo (uint16_t cellId) const
 Implementation of LteAnrSapProvider::GetNoHo. More...
 
bool DoGetNoRemove (uint16_t cellId) const
 Implementation of LteAnrSapProvider::GetNoRemove. More...
 
bool DoGetNoX2 (uint16_t cellId) const
 Implementation of LteAnrSapProvider::GetNoX2. More...
 
void DoReportUeMeas (LteRrcSap::MeasResults measResults)
 Implementation of LteAnrSapProvider::ReportUeMeas. More...
 
const NeighbourRelation_tFind (uint16_t cellId) const
 

Private Attributes

LteAnrSapProviderm_anrSapProvider
 Reference to the "provider" part of the ANR SAP interface, which is automatically created when this class instantiates. More...
 
LteAnrSapUserm_anrSapUser
 Reference to the "user" part of the ANR SAP interface, which is provided by the eNodeB RRC instance. More...
 
uint8_t m_measId
 The expected measurement identity. More...
 
NeighbourRelationTable_t m_neighbourRelationTable
 neighbor relation table More...
 
uint16_t m_servingCellId
 Serving cell ID. More...
 
uint8_t m_threshold
 The attribute Threshold. More...
 

Friends

class MemberLteAnrSapProvider< LteAnr >
 let the forwarder class access the protected and private members More...
 

Additional Inherited Members

Detailed Description

Automatic Neighbour Relation function.

ANR is a conceptually a list of neighbouring cells called the Neighbour Relation Table (NRT). ANR has the capability of automatically inserting new entries into NRT based on measurement reports obtained from the eNodeB RRC instance. Besides this, ANR also supports manual insertion and accepts queries for the NRT content.

The LteHelper class automatically installs one ANR instance for each eNodeB RRC instance. When installed, ANR will assist the eNodeB RRC's handover function, e.g., by preventing an X2-based handover execution if there is no X2 interface to the target neighbour cell. If this is not desired, it can be disabled by the following code sample:

Config::SetDefault ("ns3::LteHelper::AnrEnabled", BooleanValue (false));
Ptr<LteHelper> lteHelper = CreateObject<LteHelper> ();

The communication between an ANR instance and the eNodeB RRC instance is done through the ANR SAP interface. The ANR instance corresponds to the "provider" part of this interface, while the eNodeB RRC instance takes the role of the "user" part. The following code skeleton establishes the connection between both instances:

Ptr<LteEnbRrc> u = ...;
Ptr<LteAnr> p = ...;
u->SetLteAnrSapProvider (p->GetLteAnrSapProvider ());
p->SetLteAnrSapUser (u->GetLteAnrSapUser ());

However, user rarely needs to use the above code, since it has already been taken care by LteHelper::InstallEnbDevice.

The current ANR model is inspired from Section 22.3.2a and 22.3.3 of 3GPP TS 36.300.

See also
SetLteAnrSapProvider, SetLteAnrSapUser

Definition at line 81 of file lte-anr.h.

Member Typedef Documentation

◆ NeighbourRelationTable_t

typedef std::map<uint16_t, NeighbourRelation_t> ns3::LteAnr::NeighbourRelationTable_t
private

cellId

Definition at line 218 of file lte-anr.h.

Constructor & Destructor Documentation

◆ LteAnr()

ns3::LteAnr::LteAnr ( uint16_t  servingCellId)

Creates an ANR instance.

Parameters
servingCellIdthe cell ID of the eNodeB instance whom this ANR instance is to be associated with

Definition at line 39 of file lte-anr.cc.

References m_anrSapProvider, MemberLteAnrSapProvider< LteAnr >, and NS_LOG_FUNCTION.

◆ ~LteAnr()

ns3::LteAnr::~LteAnr ( )
override

Definition at line 49 of file lte-anr.cc.

References m_servingCellId, and NS_LOG_FUNCTION.

Member Function Documentation

◆ AddNeighbourRelation()

void ns3::LteAnr::AddNeighbourRelation ( uint16_t  cellId)

Provide an advance information about a related neighbouring cell and add it as a new Neighbour Relation entry.

Parameters
cellIdthe cell ID of the new neighbour

This function simulates the Neighbour Relation addition operation by network operations and maintenance, as depicted in Section 22.3.2a of 3GPP TS 36.300.

An entry added by this function will have the NoRemove flag set to TRUE and the NoHo flag set to TRUE. Hence, the cell may not act as the target cell of a handover, unless a measurement report of the cell is received, which will update the NoHo flag to FALSE.

Definition at line 73 of file lte-anr.cc.

References ns3::LteAnr::NeighbourRelation_t::detectedAsNeighbour, m_neighbourRelationTable, m_servingCellId, ns3::LteAnr::NeighbourRelation_t::noHo, ns3::LteAnr::NeighbourRelation_t::noRemove, ns3::LteAnr::NeighbourRelation_t::noX2, NS_FATAL_ERROR, and NS_LOG_FUNCTION.

Referenced by DoAddNeighbourRelation().

+ Here is the caller graph for this function:

◆ DoAddNeighbourRelation()

void ns3::LteAnr::DoAddNeighbourRelation ( uint16_t  cellId)
private

Implementation of LteAnrSapProvider::AddNeighbourRelation.

Parameters
cellIdthe Physical Cell ID of the new neighbouring cell

Definition at line 214 of file lte-anr.cc.

References AddNeighbourRelation(), and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ DoDispose()

void ns3::LteAnr::DoDispose ( void  )
overrideprotectedvirtual

Destructor implementation.

This method is called by Dispose() or by the Object's destructor, whichever comes first.

Subclasses are expected to implement their real destruction code in an overridden version of this method and chain up to their parent's implementation once they are done. i.e, for simplicity, the destructor of every subclass should be empty and its content should be moved to the associated DoDispose() method.

It is safe to call GetObject() from within this method.

Reimplemented from ns3::Object.

Definition at line 139 of file lte-anr.cc.

References m_anrSapProvider, m_neighbourRelationTable, and NS_LOG_FUNCTION.

◆ DoGetNoHo()

bool ns3::LteAnr::DoGetNoHo ( uint16_t  cellId) const
private

Implementation of LteAnrSapProvider::GetNoHo.

Parameters
cellIdthe Physical Cell ID of the neighbouring cell of interest
Returns
if true, the Neighbour Relation shall not be used by the eNodeB for handover reasons

Definition at line 228 of file lte-anr.cc.

References Find(), m_servingCellId, ns3::LteAnr::NeighbourRelation_t::noHo, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ DoGetNoRemove()

bool ns3::LteAnr::DoGetNoRemove ( uint16_t  cellId) const
private

Implementation of LteAnrSapProvider::GetNoRemove.

Parameters
cellIdthe Physical Cell ID of the neighbouring cell of interest
Returns
if true, the Neighbour Relation shall not be removed from the NRT

Definition at line 221 of file lte-anr.cc.

References Find(), m_servingCellId, ns3::LteAnr::NeighbourRelation_t::noRemove, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ DoGetNoX2()

bool ns3::LteAnr::DoGetNoX2 ( uint16_t  cellId) const
private

Implementation of LteAnrSapProvider::GetNoX2.

Parameters
cellIdthe Physical Cell ID of the neighbouring cell of interest
Returns
if true, the Neighbour Relation shall not use an X2 interface in order to initiate procedures towards the eNodeB parenting the target cell

Definition at line 235 of file lte-anr.cc.

References Find(), m_servingCellId, ns3::LteAnr::NeighbourRelation_t::noX2, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ DoInitialize()

void ns3::LteAnr::DoInitialize ( void  )
overrideprotectedvirtual

Initialize() implementation.

This method is called only once by Initialize(). If the user calls Initialize() multiple times, DoInitialize() is called only the first time.

Subclasses are expected to override this method and chain up to their parent's implementation once they are done. It is safe to call GetObject() and AggregateObject() from within this method.

Reimplemented from ns3::Object.

Definition at line 124 of file lte-anr.cc.

References ns3::LteAnrSapUser::AddUeMeasReportConfigForAnr(), ns3::LteRrcSap::ThresholdEutra::choice, ns3::LteRrcSap::ReportConfigEutra::EVENT_A4, ns3::LteRrcSap::ReportConfigEutra::eventId, m_anrSapUser, m_measId, m_threshold, ns3::LteRrcSap::ReportConfigEutra::MS480, NS_LOG_FUNCTION, NS_LOG_LOGIC, ns3::LteRrcSap::ThresholdEutra::range, ns3::LteRrcSap::ReportConfigEutra::reportInterval, ns3::LteRrcSap::ReportConfigEutra::RSRQ, ns3::LteRrcSap::ReportConfigEutra::threshold1, ns3::LteRrcSap::ThresholdEutra::THRESHOLD_RSRQ, and ns3::LteRrcSap::ReportConfigEutra::triggerQuantity.

+ Here is the call graph for this function:

◆ DoReportUeMeas()

◆ Find()

const LteAnr::NeighbourRelation_t * ns3::LteAnr::Find ( uint16_t  cellId) const
private
Internal: methods
Parameters
cellId
Returns
the neighbor relation

Definition at line 242 of file lte-anr.cc.

References m_neighbourRelationTable, and NS_FATAL_ERROR.

Referenced by DoGetNoHo(), DoGetNoRemove(), and DoGetNoX2().

+ Here is the caller graph for this function:

◆ GetLteAnrSapProvider()

LteAnrSapProvider * ns3::LteAnr::GetLteAnrSapProvider ( )
virtual

Export the "provider" part of the ANR SAP interface.

Returns
the reference to the "provider" part of the interface, typically to be kept by an LteEnbRrc instance

Definition at line 117 of file lte-anr.cc.

References m_anrSapProvider, and NS_LOG_FUNCTION.

◆ GetTypeId()

TypeId ns3::LteAnr::GetTypeId ( void  )
static

Get the type ID.

Returns
the object TypeId

Definition at line 55 of file lte-anr.cc.

References m_threshold, ns3::MakeUintegerAccessor(), and ns3::TypeId::SetParent().

+ Here is the call graph for this function:

◆ RemoveNeighbourRelation()

void ns3::LteAnr::RemoveNeighbourRelation ( uint16_t  cellId)

Remove an existing Neighbour Relation entry.

Parameters
cellIdthe cell ID to be removed from the NRT

This function simulates the Neighbour Relation removal operation by network operations and maintenance, as depicted in Section 22.3.2a of 3GPP TS 36.300.

Definition at line 96 of file lte-anr.cc.

References m_neighbourRelationTable, m_servingCellId, NS_FATAL_ERROR, and NS_LOG_FUNCTION.

◆ SetLteAnrSapUser()

void ns3::LteAnr::SetLteAnrSapUser ( LteAnrSapUser s)
virtual

Set the "user" part of the ANR SAP interface that this ANR instance will interact with.

Parameters
sa reference to the "user" part of the interface, typically a member of an LteEnbRrc instance

Definition at line 110 of file lte-anr.cc.

References m_anrSapUser, and NS_LOG_FUNCTION.

Friends And Related Function Documentation

◆ MemberLteAnrSapProvider< LteAnr >

friend class MemberLteAnrSapProvider< LteAnr >
friend

let the forwarder class access the protected and private members

Definition at line 137 of file lte-anr.h.

Referenced by LteAnr().

Member Data Documentation

◆ m_anrSapProvider

LteAnrSapProvider* ns3::LteAnr::m_anrSapProvider
private

Reference to the "provider" part of the ANR SAP interface, which is automatically created when this class instantiates.

Definition at line 192 of file lte-anr.h.

Referenced by LteAnr(), DoDispose(), and GetLteAnrSapProvider().

◆ m_anrSapUser

LteAnrSapUser* ns3::LteAnr::m_anrSapUser
private

Reference to the "user" part of the ANR SAP interface, which is provided by the eNodeB RRC instance.

Definition at line 198 of file lte-anr.h.

Referenced by DoInitialize(), and SetLteAnrSapUser().

◆ m_measId

uint8_t ns3::LteAnr::m_measId
private

The expected measurement identity.

Definition at line 231 of file lte-anr.h.

Referenced by DoInitialize(), and DoReportUeMeas().

◆ m_neighbourRelationTable

NeighbourRelationTable_t ns3::LteAnr::m_neighbourRelationTable
private

neighbor relation table

Definition at line 221 of file lte-anr.h.

Referenced by AddNeighbourRelation(), DoDispose(), DoReportUeMeas(), Find(), and RemoveNeighbourRelation().

◆ m_servingCellId

uint16_t ns3::LteAnr::m_servingCellId
private

◆ m_threshold

uint8_t ns3::LteAnr::m_threshold
private

The attribute Threshold.

Definition at line 203 of file lte-anr.h.

Referenced by DoInitialize(), and GetTypeId().


The documentation for this class was generated from the following files: