A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
lte-anr.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2011, 2012 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
3 * Copyright (c) 2013 Budiarto Herman
4 *
5 * SPDX-License-Identifier: GPL-2.0-only
6 *
7 * Original work authors (from lte-enb-rrc.cc):
8 * Nicola Baldo <nbaldo@cttc.es>
9 * Marco Miozzo <mmiozzo@cttc.es>
10 * Manuel Requena <manuel.requena@cttc.es>
11 *
12 * Converted to ANR interface by:
13 * Budiarto Herman <budiarto.herman@magister.fi>
14 */
15
16#ifndef LTE_ANR_H
17#define LTE_ANR_H
18
19#include "lte-anr-sap.h"
20#include "lte-rrc-sap.h"
21
22#include <ns3/object.h>
23
24#include <map>
25
26namespace ns3
27{
28
29class LteAnrSapProvider;
30class LteAnrSapUser;
31class LteNeighbourRelation;
32
33/**
34 * \brief Automatic Neighbour Relation function.
35 *
36 * ANR is a conceptually a list of neighbouring cells called the Neighbour
37 * Relation Table (NRT). ANR has the capability of automatically inserting new
38 * entries into NRT based on measurement reports obtained from the eNodeB RRC
39 * instance. Besides this, ANR also supports manual insertion and accepts
40 * queries for the NRT content.
41 *
42 * The LteHelper class automatically installs one ANR instance for each eNodeB
43 * RRC instance. When installed, ANR will assist the eNodeB RRC's handover
44 * function, e.g., by preventing an X2-based handover execution if there is no
45 * X2 interface to the target neighbour cell. If this is not desired, it can be
46 * disabled by the following code sample:
47 *
48 * Config::SetDefault ("ns3::LteHelper::AnrEnabled", BooleanValue (false));
49 * Ptr<LteHelper> lteHelper = CreateObject<LteHelper> ();
50 *
51 * The communication between an ANR instance and the eNodeB RRC instance is done
52 * through the *ANR SAP* interface. The ANR instance corresponds to the
53 * "provider" part of this interface, while the eNodeB RRC instance takes the
54 * role of the "user" part. The following code skeleton establishes the
55 * connection between both instances:
56 *
57 * Ptr<LteEnbRrc> u = ...;
58 * Ptr<LteAnr> p = ...;
59 * u->SetLteAnrSapProvider (p->GetLteAnrSapProvider ());
60 * p->SetLteAnrSapUser (u->GetLteAnrSapUser ());
61 *
62 * However, user rarely needs to use the above code, since it has already been
63 * taken care by LteHelper::InstallEnbDevice.
64 *
65 * The current ANR model is inspired from Section 22.3.2a and 22.3.3 of 3GPP
66 * TS 36.300.
67 *
68 * \sa SetLteAnrSapProvider, SetLteAnrSapUser
69 */
70class LteAnr : public Object
71{
72 public:
73 /**
74 * \brief Creates an ANR instance.
75 * \param servingCellId the cell ID of the eNodeB instance whom this ANR
76 * instance is to be associated with
77 */
78 LteAnr(uint16_t servingCellId);
79 ~LteAnr() override;
80
81 /**
82 * \brief Get the type ID.
83 * \return the object TypeId
84 */
85 static TypeId GetTypeId();
86
87 /**
88 * \brief Provide an advance information about a related neighbouring cell
89 * and add it as a new Neighbour Relation entry.
90 * \param cellId the cell ID of the new neighbour
91 *
92 * This function simulates the Neighbour Relation addition operation by
93 * network operations and maintenance, as depicted in Section 22.3.2a of
94 * 3GPP TS 36.300.
95 *
96 * An entry added by this function will have the NoRemove flag set to TRUE and
97 * the NoHo flag set to TRUE. Hence, the cell may not act as the target cell
98 * of a handover, unless a measurement report of the cell is received, which
99 * will update the NoHo flag to FALSE.
100 */
101 void AddNeighbourRelation(uint16_t cellId);
102
103 /**
104 * \brief Remove an existing Neighbour Relation entry.
105 * \param cellId the cell ID to be removed from the NRT
106 *
107 * This function simulates the Neighbour Relation removal operation by
108 * network operations and maintenance, as depicted in Section 22.3.2a of
109 * 3GPP TS 36.300.
110 */
111 void RemoveNeighbourRelation(uint16_t cellId);
112
113 /**
114 * \brief Set the "user" part of the ANR SAP interface that this ANR instance
115 * will interact with.
116 * \param s a reference to the "user" part of the interface, typically a
117 * member of an LteEnbRrc instance
118 */
119 virtual void SetLteAnrSapUser(LteAnrSapUser* s);
120
121 /**
122 * \brief Export the "provider" part of the ANR SAP interface.
123 * \return the reference to the "provider" part of the interface, typically to
124 * be kept by an LteEnbRrc instance
125 */
127
128 /// let the forwarder class access the protected and private members
129 friend class MemberLteAnrSapProvider<LteAnr>;
130
131 protected:
132 // inherited from Object
133 void DoInitialize() override;
134 void DoDispose() override;
135
136 private:
137 // ANR SAP PROVIDER IMPLEMENTATION
138
139 /**
140 * \brief Implementation of LteAnrSapProvider::ReportUeMeas.
141 * \param measResults a single report of one measurement identity
142 */
143 void DoReportUeMeas(LteRrcSap::MeasResults measResults);
144
145 /**
146 * \brief Implementation of LteAnrSapProvider::AddNeighbourRelation.
147 * \param cellId the Physical Cell ID of the new neighbouring cell
148 */
149 void DoAddNeighbourRelation(uint16_t cellId);
150
151 /**
152 * \brief Implementation of LteAnrSapProvider::GetNoRemove.
153 * \param cellId the Physical Cell ID of the neighbouring cell of interest
154 * \return if true, the Neighbour Relation shall *not* be removed from the NRT
155 */
156 bool DoGetNoRemove(uint16_t cellId) const;
157
158 /**
159 * \brief Implementation of LteAnrSapProvider::GetNoHo.
160 * \param cellId the Physical Cell ID of the neighbouring cell of interest
161 * \return if true, the Neighbour Relation shall *not* be used by the eNodeB
162 * for handover reasons
163 */
164 bool DoGetNoHo(uint16_t cellId) const;
165
166 /**
167 * \brief Implementation of LteAnrSapProvider::GetNoX2.
168 * \param cellId the Physical Cell ID of the neighbouring cell of interest
169 * \return if true, the Neighbour Relation shall *not* use an X2 interface in
170 * order to initiate procedures towards the eNodeB parenting the
171 * target cell
172 */
173 bool DoGetNoX2(uint16_t cellId) const;
174
175 // ANR SAP
176
177 /**
178 * \brief Reference to the "provider" part of the ANR SAP interface, which is
179 * automatically created when this class instantiates.
180 */
182
183 /**
184 * \brief Reference to the "user" part of the ANR SAP interface, which is
185 * provided by the eNodeB RRC instance.
186 */
188
189 // ATTRIBUTE
190
191 /// The attribute Threshold.
192 uint8_t m_threshold;
193
194 /**
195 * \brief Neighbour Relation between two eNodeBs (serving eNodeB and neighbour
196 * eNodeB).
197 */
199 {
200 bool noRemove; ///< no remove
201 bool noHo; ///< no HO
202 bool noX2; ///< no X2
203 bool detectedAsNeighbour; ///< detected as neighbor
204 };
205
206 /// cellId
207 typedef std::map<uint16_t, NeighbourRelation_t> NeighbourRelationTable_t;
208
209 /// neighbor relation table
211
212 /**
213 * \internal methods
214 * \param cellId
215 * \returns the neighbor relation
216 */
217 const NeighbourRelation_t* Find(uint16_t cellId) const;
218
219 /// The expected measurement identity
220 uint8_t m_measId;
221
222 /// Serving cell ID
224
225}; // end of class LteAnr
226
227} // end of namespace ns3
228
229#endif /* LTE_ANR_H */
Automatic Neighbour Relation function.
Definition lte-anr.h:71
~LteAnr() override
Definition lte-anr.cc:38
void DoInitialize() override
Initialize() implementation.
Definition lte-anr.cc:113
virtual LteAnrSapProvider * GetLteAnrSapProvider()
Export the "provider" part of the ANR SAP interface.
Definition lte-anr.cc:106
void DoReportUeMeas(LteRrcSap::MeasResults measResults)
Implementation of LteAnrSapProvider::ReportUeMeas.
Definition lte-anr.cc:136
bool DoGetNoHo(uint16_t cellId) const
Implementation of LteAnrSapProvider::GetNoHo.
Definition lte-anr.cc:217
LteAnrSapProvider * m_anrSapProvider
Reference to the "provider" part of the ANR SAP interface, which is automatically created when this c...
Definition lte-anr.h:181
uint8_t m_measId
The expected measurement identity.
Definition lte-anr.h:220
LteAnrSapUser * m_anrSapUser
Reference to the "user" part of the ANR SAP interface, which is provided by the eNodeB RRC instance.
Definition lte-anr.h:187
static TypeId GetTypeId()
Get the type ID.
Definition lte-anr.cc:44
void RemoveNeighbourRelation(uint16_t cellId)
Remove an existing Neighbour Relation entry.
Definition lte-anr.cc:85
bool DoGetNoRemove(uint16_t cellId) const
Implementation of LteAnrSapProvider::GetNoRemove.
Definition lte-anr.cc:210
const NeighbourRelation_t * Find(uint16_t cellId) const
Definition lte-anr.cc:231
uint8_t m_threshold
The attribute Threshold.
Definition lte-anr.h:192
LteAnr(uint16_t servingCellId)
Creates an ANR instance.
Definition lte-anr.cc:28
NeighbourRelationTable_t m_neighbourRelationTable
neighbor relation table
Definition lte-anr.h:210
void DoAddNeighbourRelation(uint16_t cellId)
Implementation of LteAnrSapProvider::AddNeighbourRelation.
Definition lte-anr.cc:203
void AddNeighbourRelation(uint16_t cellId)
Provide an advance information about a related neighbouring cell and add it as a new Neighbour Relati...
Definition lte-anr.cc:62
uint16_t m_servingCellId
Serving cell ID.
Definition lte-anr.h:223
std::map< uint16_t, NeighbourRelation_t > NeighbourRelationTable_t
cellId
Definition lte-anr.h:207
bool DoGetNoX2(uint16_t cellId) const
Implementation of LteAnrSapProvider::GetNoX2.
Definition lte-anr.cc:224
virtual void SetLteAnrSapUser(LteAnrSapUser *s)
Set the "user" part of the ANR SAP interface that this ANR instance will interact with.
Definition lte-anr.cc:99
void DoDispose() override
Destructor implementation.
Definition lte-anr.cc:128
Service Access Point (SAP) offered by the ANR instance to the eNodeB RRC instance.
Definition lte-anr-sap.h:26
Service Access Point (SAP) offered by the eNodeB RRC instance to the ANR instance.
Definition lte-anr-sap.h:84
Template for the implementation of the LteAnrSapProvider as a member of an owner class of type C to w...
A base class which provides memory management and object aggregation.
Definition object.h:78
a unique identifier for an interface.
Definition type-id.h:48
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Neighbour Relation between two eNodeBs (serving eNodeB and neighbour eNodeB).
Definition lte-anr.h:199
bool detectedAsNeighbour
detected as neighbor
Definition lte-anr.h:203
MeasResults structure.