A Discrete-Event Network Simulator
API
Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | Friends | List of all members
ns3::LteAnr Class Reference

Automatic Neighbour Relation function. More...

#include "lte-anr.h"

+ Inheritance 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...
 
virtual ~LteAnr ()
 
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...
 
virtual ~Object ()
 Destructor. More...
 
void AggregateObject (Ptr< Object > other)
 Aggregate two Objects together. More...
 
void Dispose (void)
 Dispose of this Object. More...
 
AggregateIterator GetAggregateIterator (void) const
 Get an iterator to the Objects aggregated to this one. More...
 
virtual TypeId GetInstanceTypeId (void) const
 Get the most derived TypeId for this Object. More...
 
template<typename T >
Ptr< T > GetObject (void) const
 Get a pointer to the requested aggregated Object. More...
 
template<typename T >
Ptr< T > GetObject (TypeId tid) const
 Get a pointer to the requested aggregated Object by TypeId. More...
 
void Initialize (void)
 Invoke DoInitialize on all Objects aggregated to this one. More...
 
bool IsInitialized (void) 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)
 Copy constructor. More...
 
uint32_t GetReferenceCount (void) const
 Get the reference count of the object. More...
 
SimpleRefCountoperator= (const SimpleRefCount &o)
 Assignment operator. More...
 
void Ref (void) const
 Increment the reference count. More...
 
void Unref (void) 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 erros. 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 (void)
 Register this type. More...
 
- Static Public Member Functions inherited from ns3::ObjectBase
static TypeId GetTypeId (void)
 Get the type ID. More...
 

Protected Member Functions

virtual void DoDispose ()
 Destructor implementation. More...
 
virtual void DoInitialize ()
 Initialize() implementation. More...
 
- Protected Member Functions inherited from ns3::Object
 Object (const Object &o)
 Copy an Object. More...
 
virtual void NotifyNewAggregate (void)
 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 (void)
 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

Config Paths

ns3::LteAnr is accessible through the following paths with Config::Set and Config::Connect:

Attributes

No TraceSources are defined for this type.
Size of this type is 88 bytes (on a 64-bit architecture).

Definition at line 80 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, and NS_LOG_FUNCTION.

◆ ~LteAnr()

ns3::LteAnr::~LteAnr ( )
virtual

Definition at line 50 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().

◆ 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 220 of file lte-anr.cc.

References AddNeighbourRelation(), and NS_LOG_FUNCTION.

◆ DoDispose()

void ns3::LteAnr::DoDispose ( void  )
protectedvirtual

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 144 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 236 of file lte-anr.cc.

References Find(), m_servingCellId, ns3::LteAnr::NeighbourRelation_t::noHo, and NS_LOG_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 228 of file lte-anr.cc.

References Find(), m_servingCellId, ns3::LteAnr::NeighbourRelation_t::noRemove, and NS_LOG_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 244 of file lte-anr.cc.

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

◆ DoInitialize()

void ns3::LteAnr::DoInitialize ( void  )
protectedvirtual

◆ DoReportUeMeas()

void ns3::LteAnr::DoReportUeMeas ( LteRrcSap::MeasResults  measResults)
private

◆ Find()

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

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

References m_neighbourRelationTable, and NS_FATAL_ERROR.

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

◆ 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 120 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 57 of file lte-anr.cc.

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

◆ 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 97 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 112 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 139 of file lte-anr.h.

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 DoDispose(), GetLteAnrSapProvider(), and LteAnr().

◆ 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: