Automatic Neighbour Relation function. More...
#include "lte-anr.h"
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 LteAnrSapProvider * | GetLteAnrSapProvider () |
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< Object > | GetObject () 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< Object > | GetObject (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. | |
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. | |
SimpleRefCount & | operator= (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) 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. | |
virtual TypeId | GetInstanceTypeId () const =0 |
Get the most derived TypeId for this Object. | |
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 | DoDispose () |
Destructor implementation. | |
virtual void | DoInitialize () |
Initialize() implementation. | |
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_t > | NeighbourRelationTable_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_t * | Find (uint16_t cellId) const |
Private Attributes | |
LteAnrSapProvider * | m_anrSapProvider |
Reference to the "provider" part of the ANR SAP interface, which is automatically created when this class instantiates. | |
LteAnrSapUser * | m_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 | |
Related Functions inherited from ns3::ObjectBase | |
static TypeId | GetObjectIid () |
Ensure the TypeId for ObjectBase gets fully configured to anchor the inheritance tree properly. | |
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.
ns3::LteAnr is accessible through the following paths with Config::Set and Config::Connect:
No TraceSources are defined for this type.
Size of this type is 112 bytes (on a 64-bit architecture).
|
private |
ns3::LteAnr::LteAnr | ( | uint16_t | servingCellId | ) |
Creates an ANR instance.
servingCellId | the 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.
|
override |
Definition at line 49 of file lte-anr.cc.
References m_servingCellId, and NS_LOG_FUNCTION.
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.
cellId | the 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().
|
private |
Implementation of LteAnrSapProvider::AddNeighbourRelation.
cellId | the Physical Cell ID of the new neighbouring cell |
Definition at line 216 of file lte-anr.cc.
References AddNeighbourRelation(), and NS_LOG_FUNCTION.
|
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.
|
private |
Implementation of LteAnrSapProvider::GetNoHo.
cellId | the Physical Cell ID of the neighbouring cell of interest |
Definition at line 230 of file lte-anr.cc.
References Find(), m_servingCellId, ns3::LteAnr::NeighbourRelation_t::noHo, and NS_LOG_FUNCTION.
|
private |
Implementation of LteAnrSapProvider::GetNoRemove.
cellId | the Physical Cell ID of the neighbouring cell of interest |
Definition at line 223 of file lte-anr.cc.
References Find(), m_servingCellId, ns3::LteAnr::NeighbourRelation_t::noRemove, and NS_LOG_FUNCTION.
|
private |
Implementation of LteAnrSapProvider::GetNoX2.
cellId | the Physical Cell ID of the neighbouring cell of interest |
Definition at line 237 of file lte-anr.cc.
References Find(), m_servingCellId, ns3::LteAnr::NeighbourRelation_t::noX2, and NS_LOG_FUNCTION.
|
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.
|
private |
Implementation of LteAnrSapProvider::ReportUeMeas.
measResults | a single report of one measurement identity |
Definition at line 147 of file lte-anr.cc.
References ns3::LteAnr::NeighbourRelation_t::detectedAsNeighbour, ns3::LteRrcSap::MeasResults::haveMeasResultNeighCells, m_measId, m_neighbourRelationTable, m_servingCellId, ns3::LteRrcSap::MeasResults::measId, ns3::LteRrcSap::MeasResults::measResultListEutra, ns3::LteAnr::NeighbourRelation_t::noHo, ns3::LteAnr::NeighbourRelation_t::noRemove, ns3::LteAnr::NeighbourRelation_t::noX2, NS_ASSERT_MSG, NS_LOG_FUNCTION, NS_LOG_LOGIC, and NS_LOG_WARN.
|
private |
cellId |
Definition at line 244 of file lte-anr.cc.
References m_neighbourRelationTable, and NS_FATAL_ERROR.
Referenced by DoGetNoHo(), DoGetNoRemove(), and DoGetNoX2().
|
virtual |
Export the "provider" part of the ANR SAP interface.
Definition at line 117 of file lte-anr.cc.
References m_anrSapProvider, and NS_LOG_FUNCTION.
|
static |
Get the type ID.
Definition at line 55 of file lte-anr.cc.
References m_threshold, ns3::MakeUintegerAccessor(), and ns3::TypeId::SetParent().
void ns3::LteAnr::RemoveNeighbourRelation | ( | uint16_t | cellId | ) |
Remove an existing Neighbour Relation entry.
cellId | the 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.
|
virtual |
Set the "user" part of the ANR SAP interface that this ANR instance will interact with.
s | a 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.
|
friend |
|
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().
|
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().
|
private |
The expected measurement identity.
Definition at line 231 of file lte-anr.h.
Referenced by DoInitialize(), and DoReportUeMeas().
|
private |
neighbor relation table
Definition at line 221 of file lte-anr.h.
Referenced by AddNeighbourRelation(), DoDispose(), DoReportUeMeas(), Find(), and RemoveNeighbourRelation().
|
private |
Serving cell ID.
Definition at line 234 of file lte-anr.h.
Referenced by ~LteAnr(), AddNeighbourRelation(), DoGetNoHo(), DoGetNoRemove(), DoGetNoX2(), DoReportUeMeas(), and RemoveNeighbourRelation().
|
private |
The attribute Threshold.
Definition at line 203 of file lte-anr.h.
Referenced by DoInitialize(), and GetTypeId().