A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
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.
 
 ~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.
 
virtual LteAnrSapProviderGetLteAnrSapProvider ()
 Export the "provider" part of the ANR SAP interface.
 
void RemoveNeighbourRelation (uint16_t cellId)
 Remove an existing Neighbour Relation entry.
 
virtual void SetLteAnrSapUser (LteAnrSapUser *s)
 Set the "user" part of the ANR SAP interface that this ANR instance will interact with.
 
- Public Member Functions inherited from ns3::Object
 Object ()
 Constructor.
 
 ~Object () override
 Destructor.
 
void AggregateObject (Ptr< Object > other)
 Aggregate two Objects together.
 
void Dispose ()
 Dispose of this Object.
 
AggregateIterator GetAggregateIterator () const
 Get an iterator to the Objects aggregated to this one.
 
TypeId GetInstanceTypeId () const override
 Get the most derived TypeId for this Object.
 
template<typename T >
Ptr< T > GetObject () const
 Get a pointer to the requested aggregated Object.
 
template<>
Ptr< ObjectGetObject () const
 Specialization of () for objects of type ns3::Object.
 
template<typename T >
Ptr< T > GetObject (TypeId tid) const
 Get a pointer to the requested aggregated Object by TypeId.
 
template<>
Ptr< ObjectGetObject (TypeId tid) const
 Specialization of (TypeId tid) for objects of type ns3::Object.
 
void Initialize ()
 Invoke DoInitialize on all Objects aggregated to this one.
 
bool IsInitialized () const
 Check if the object has been initialized.
 
void UnidirectionalAggregateObject (Ptr< Object > other)
 Aggregate an Object to another Object.
 
- Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
 SimpleRefCount ()
 Default constructor.
 
 SimpleRefCount (const SimpleRefCount &o)
 Copy constructor.
 
uint32_t GetReferenceCount () const
 Get the reference count of the object.
 
SimpleRefCountoperator= (const SimpleRefCount &o)
 Assignment operator.
 
void Ref () const
 Increment the reference count.
 
void Unref () const
 Decrement the reference count.
 
- Public Member Functions inherited from ns3::ObjectBase
virtual ~ObjectBase ()
 Virtual destructor.
 
void GetAttribute (std::string name, AttributeValue &value, bool permissive=false) const
 Get the value of an attribute, raising fatal errors if unsuccessful.
 
bool GetAttributeFailSafe (std::string name, AttributeValue &value) const
 Get the value of an attribute without raising errors.
 
void SetAttribute (std::string name, const AttributeValue &value)
 Set a single attribute, raising fatal errors if unsuccessful.
 
bool SetAttributeFailSafe (std::string name, const AttributeValue &value)
 Set a single attribute without raising errors.
 
bool TraceConnect (std::string name, std::string context, const CallbackBase &cb)
 Connect a TraceSource to a Callback with a context.
 
bool TraceConnectWithoutContext (std::string name, const CallbackBase &cb)
 Connect a TraceSource to a Callback without a context.
 
bool TraceDisconnect (std::string name, std::string context, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected with a context.
 
bool TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected without a context.
 

Static Public Member Functions

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

Protected Member Functions

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

Private Types

typedef std::map< uint16_t, NeighbourRelation_tNeighbourRelationTable_t
 cellId
 

Private Member Functions

void DoAddNeighbourRelation (uint16_t cellId)
 Implementation of LteAnrSapProvider::AddNeighbourRelation.
 
bool DoGetNoHo (uint16_t cellId) const
 Implementation of LteAnrSapProvider::GetNoHo.
 
bool DoGetNoRemove (uint16_t cellId) const
 Implementation of LteAnrSapProvider::GetNoRemove.
 
bool DoGetNoX2 (uint16_t cellId) const
 Implementation of LteAnrSapProvider::GetNoX2.
 
void DoReportUeMeas (LteRrcSap::MeasResults measResults)
 Implementation of LteAnrSapProvider::ReportUeMeas.
 
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.
 
LteAnrSapUserm_anrSapUser
 Reference to the "user" part of the ANR SAP interface, which is provided by the eNodeB RRC instance.
 
uint8_t m_measId
 The expected measurement identity.
 
NeighbourRelationTable_t m_neighbourRelationTable
 neighbor relation table
 
uint16_t m_servingCellId
 Serving cell ID.
 
uint8_t m_threshold
 The attribute Threshold.
 

Friends

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

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:

  • "/NodeList/[i]/DeviceList/[i]/$ns3::LteEnbNetDevice/LteAnr"
  • "/NodeList/[i]/DeviceList/[i]/$ns3::LteNetDevice/$ns3::LteEnbNetDevice/LteAnr"

Attributes

  • Threshold: Minimum RSRQ range value required for detecting a neighbour cell
    • Set with class: ns3::UintegerValue
    • Underlying type: uint8_t 0:34
    • Initial value: 0
    • Flags: constructwriteread
    • Support level: SUPPORTED

No TraceSources are defined for this type.
Group: Lte

Size of this type is 136 bytes (on a 64-bit architecture).

Definition at line 70 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 207 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 28 of file lte-anr.cc.

References m_anrSapProvider, MemberLteAnrSapProvider< LteAnr >, and NS_LOG_FUNCTION.

◆ ~LteAnr()

ns3::LteAnr::~LteAnr ( )
override

Definition at line 38 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 62 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 203 of file lte-anr.cc.

References AddNeighbourRelation(), and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ DoDispose()

void ns3::LteAnr::DoDispose ( )
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 128 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 217 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 210 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 224 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 ( )
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 113 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 231 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 106 of file lte-anr.cc.

References m_anrSapProvider, and NS_LOG_FUNCTION.

◆ GetTypeId()

TypeId ns3::LteAnr::GetTypeId ( )
static

Get the type ID.

Returns
the object TypeId

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

References m_threshold, ns3::MakeUintegerAccessor(), ns3::MakeUintegerChecker(), 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 85 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 99 of file lte-anr.cc.

References m_anrSapUser, and NS_LOG_FUNCTION.

Friends And Related Symbol Documentation

◆ MemberLteAnrSapProvider< LteAnr >

friend class MemberLteAnrSapProvider< LteAnr >
friend

let the forwarder class access the protected and private members

Definition at line 126 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 181 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 187 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 220 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 210 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 192 of file lte-anr.h.

Referenced by DoInitialize(), and GetTypeId().


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