A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
lte-ccm-rrc-sap.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2015 Danilo Abrignani
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation;
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 *
17 * Author: Danilo Abrignani <danilo.abrignani@unibo.it>
18 *
19 */
20
21#ifndef LTE_CCM_RRC_SAP_H
22#define LTE_CCM_RRC_SAP_H
23
24#include "eps-bearer.h"
25#include "lte-enb-cmac-sap.h"
26#include "lte-mac-sap.h"
27#include "lte-rrc-sap.h"
28
29#include <map>
30
31namespace ns3
32{
33class LteUeCmacSapProvider;
34class UeManager;
35class LteEnbCmacSapProvider;
36class LteMacSapUser;
37class LteRrcSap;
38
39/**
40 * \brief Service Access Point (SAP) offered by the Component Carrier Manager (CCM)
41 * instance to the eNodeB RRC instance.
42 *
43 * This is the *Component Carrier Manager SAP Provider*, i.e., the part of the SAP
44 * that contains the CCM methods called by the eNodeB RRC instance.
45 */
47{
48 /// allow UeManager class friend access
49 friend class UeManager;
50 /// allow LteMacSapUser class friend access
51 friend class LteMacSapUser;
52
53 public:
54 virtual ~LteCcmRrcSapProvider();
55
56 /// LcsConfig structure
57 struct LcsConfig
58 {
59 uint16_t componentCarrierId; ///< component carrier ID
61 LteMacSapUser* msu; ///< MSU
62 };
63
64 /**
65 * \brief Reports UE measurements to the component carrier manager.
66 * \param rnti Radio Network Temporary Identity, an integer identifying
67 * the UE where the measurement report originates from.
68 * \param measResults a single report of one measurement identity
69 *
70 * The received measurement report is a result of the UE measurements configuration
71 * previously configured by calling
72 * LteCcmRrcSapProvider::AddUeMeasReportConfigForComponentCarrier. The report may be stored and
73 * utilized for the purpose of making decision if and when to use the secondary carriers.
74 */
75 virtual void ReportUeMeas(uint16_t rnti, LteRrcSap::MeasResults measResults) = 0;
76
77 /**
78 * \brief Add a new UE in the LteEnbComponentCarrierManager.
79 * \param rnti Radio Network Temporary Identity, an integer identifying the UE.
80 * \param state The current rrc state of the UE.
81 */
82 virtual void AddUe(uint16_t rnti, uint8_t state) = 0;
83
84 /**
85 * \brief Add a new logical channel.
86 * \param lcInfo - information about newly created logical channel
87 * \param msu - pointer to corresponding rlc interface
88 *
89 */
90 virtual void AddLc(LteEnbCmacSapProvider::LcInfo lcInfo, LteMacSapUser* msu) = 0;
91
92 /**
93 * \brief Remove an existing UE.
94 * \param rnti Radio Network Temporary Identity, an integer identifying the UE
95 * where the report originates from
96 */
97 virtual void RemoveUe(uint16_t rnti) = 0;
98
99 /**
100 * \brief Add a new Bearer for the Ue in the LteEnbComponentCarrierManager.
101 * \param bearer a pointer to the EpsBearer object
102 * \param bearerId a unique identifier for the bearer
103 * \param rnti Radio Network Temporary Identity, an integer identifying the UE
104 * where the report originates from
105 * \param lcid the Logical Channel id
106 * \param lcGroup the Logical Channel group
107 * \param msu a pointer to the LteMacSapUser, the LteEnbComponentCarrierManager
108 * has to store a LteMacSapUser for each Rlc instance, in order to
109 * properly redirect the packet
110 * \return vector of LcsConfig contains the lc configuration for each Mac
111 * the size of the vector is equal to the number of component
112 * carrier enabled.
113 *
114 * The Logical Channel configurations for each component carrier depend on the
115 * algorithm used to split the traffic between the component carriers themself.
116 */
117 virtual std::vector<LteCcmRrcSapProvider::LcsConfig> SetupDataRadioBearer(
118 EpsBearer bearer,
119 uint8_t bearerId,
120 uint16_t rnti,
121 uint8_t lcid,
122 uint8_t lcGroup,
123 LteMacSapUser* msu) = 0;
124
125 /**
126 * \brief Release an existing Data Radio Bearer for a Ue in the LteEnbComponentCarrierManager
127 * \param rnti Radio Network Temporary Identity, an integer identifying the UE
128 * where the report originates from
129 * \param lcid the Logical Channel Id
130 * \return vector of integer the componentCarrierId of the componentCarrier
131 * where the bearer is enabled
132 */
133
134 virtual std::vector<uint8_t> ReleaseDataRadioBearer(uint16_t rnti, uint8_t lcid) = 0;
135
136 /**
137 * \brief Add the Signal Bearer for a specific Ue in LteEnbComponenCarrierManager
138 * \param lcInfo this structure it is hard-coded in the LteEnbRrc
139 * \param rlcMacSapUser it is the MacSapUser of the Rlc instance
140 * \return the LteMacSapUser of the ComponentCarrierManager
141 *
142 */
144 LteMacSapUser* rlcMacSapUser) = 0;
145
146}; // end of class LteCcmRrcSapProvider
147
148/**
149 * \brief Service Access Point (SAP) offered by the eNodeB RRC instance to the
150 * component carrier manager (CCM) instance.
151 *
152 * This is the *Component Carrier Management SAP User*, i.e., the part of the SAP that
153 * contains the eNodeB RRC methods called by the CCM.
154 */
156{
157 /// allow LteEnbRrc class friend access
158 friend class LteEnbRrc;
159
160 public:
161 virtual ~LteCcmRrcSapUser();
162
163 /**
164 * \brief Request a certain reporting configuration to be fulfilled by the UEs
165 * attached to the eNodeB entity.
166 * \param reportConfig the UE measurement reporting configuration
167 * \return the measurement identity associated with this newly added
168 * reporting configuration
169 *
170 * The eNodeB RRC entity is expected to configure the same reporting
171 * configuration in each of the attached UEs. When later in the simulation a
172 * UE measurement report is received from a UE as a result of this
173 * configuration, the eNodeB RRC entity shall forward this report to the
174 * ComponentCarrier algorithm through the LteCcmRrcSapProvider::ReportUeMeas
175 * SAP function.
176 *
177 * \note This function is only valid before the simulation begins.
178 */
180 LteRrcSap::ReportConfigEutra reportConfig) = 0;
181
182 /**
183 * \brief Instruct the eNodeB RRC entity to prepare a component carrier.
184 * \param rnti Radio Network Temporary Identity, an integer identifying the
185 * UE which shall perform the ComponentCarrier
186 * \param targetCellId the cell ID of the target eNodeB
187 *
188 * This function is used by the ComponentCarrier manager when a decision on
189 * component carriers configurations.
190 *
191 * The process to produce the decision is up to the implementation of ComponentCarrier
192 * algorithm. It is typically based on the reported UE measurements, which are
193 * received through the LteCcmRrcSapProvider::ReportUeMeas function.
194 */
195 virtual void TriggerComponentCarrier(uint16_t rnti, uint16_t targetCellId) = 0;
196
197 /**
198 * add a new Logical Channel (LC)
199 *
200 * \param lcConfig is a single structure contains logical Channel Id, Logical Channel config and
201 * Component Carrier Id
202 */
203 virtual void AddLcs(std::vector<LteEnbRrcSapProvider::LogicalChannelConfig> lcConfig) = 0;
204
205 /**
206 * remove an existing LC
207 *
208 * \param rnti
209 * \param lcid
210 */
211 virtual void ReleaseLcs(uint16_t rnti, uint8_t lcid) = 0;
212
213 /**
214 * Get UE manager by RNTI
215 *
216 * \param rnti RNTI
217 * \return UE manager
218 */
219 virtual Ptr<UeManager> GetUeManager(uint16_t rnti) = 0;
220
221 /**
222 * \brief Set the number of component carriers
223 *
224 * \param noOfComponentCarriers The number of component carriers
225 */
226 virtual void SetNumberOfComponentCarriers(uint16_t noOfComponentCarriers) = 0;
227
228}; // end of class LteCcmRrcSapUser
229
230/// MemberLteCcmRrcSapProvider class
231template <class C>
233{
234 public:
235 /**
236 * Constructor
237 *
238 * \param owner the owner class
239 */
241
242 // inherited from LteCcmRrcSapProvider
243 void ReportUeMeas(uint16_t rnti, LteRrcSap::MeasResults measResults) override;
244 void AddUe(uint16_t rnti, uint8_t state) override;
245 void AddLc(LteEnbCmacSapProvider::LcInfo lcInfo, LteMacSapUser* msu) override;
246 void RemoveUe(uint16_t rnti) override;
247 std::vector<LteCcmRrcSapProvider::LcsConfig> SetupDataRadioBearer(EpsBearer bearer,
248 uint8_t bearerId,
249 uint16_t rnti,
250 uint8_t lcid,
251 uint8_t lcGroup,
252 LteMacSapUser* msu) override;
253 std::vector<uint8_t> ReleaseDataRadioBearer(uint16_t rnti, uint8_t lcid) override;
255 LteMacSapUser* rlcMacSapUser) override;
256
257 private:
258 C* m_owner; ///< the owner class
259};
260
261template <class C>
263 : m_owner(owner)
264{
265}
266
267template <class C>
268void
270{
271 m_owner->DoReportUeMeas(rnti, measResults);
272}
273
274template <class C>
275void
276MemberLteCcmRrcSapProvider<C>::AddUe(uint16_t rnti, uint8_t state)
277{
278 m_owner->DoAddUe(rnti, state);
279}
280
281template <class C>
282void
284{
285 m_owner->DoAddLc(lcInfo, msu);
286}
287
288template <class C>
289void
291{
292 m_owner->DoRemoveUe(rnti);
293}
294
295template <class C>
296std::vector<LteCcmRrcSapProvider::LcsConfig>
298 uint8_t bearerId,
299 uint16_t rnti,
300 uint8_t lcid,
301 uint8_t lcGroup,
302 LteMacSapUser* msu)
303{
304 return m_owner->DoSetupDataRadioBearer(bearer, bearerId, rnti, lcid, lcGroup, msu);
305}
306
307template <class C>
308std::vector<uint8_t>
310{
311 return m_owner->DoReleaseDataRadioBearer(rnti, lcid);
312}
313
314template <class C>
317 LteMacSapUser* rlcMacSapUser)
318{
319 return m_owner->DoConfigureSignalBearer(lcInfo, rlcMacSapUser);
320}
321
322/// MemberLteCcmRrcSapUser class
323template <class C>
325{
326 public:
327 /**
328 * Constructor
329 *
330 * \param owner the owner class
331 */
332 MemberLteCcmRrcSapUser(C* owner);
333
334 // inherited from LteCcmRrcSapUser
335 void AddLcs(std::vector<LteEnbRrcSapProvider::LogicalChannelConfig> lcConfig) override;
336 void ReleaseLcs(uint16_t rnti, uint8_t lcid) override;
338 LteRrcSap::ReportConfigEutra reportConfig) override;
339 void TriggerComponentCarrier(uint16_t rnti, uint16_t targetCellId) override;
340 Ptr<UeManager> GetUeManager(uint16_t rnti) override;
341 void SetNumberOfComponentCarriers(uint16_t noOfComponentCarriers) override;
342
343 private:
344 C* m_owner; ///< the owner class
345};
346
347template <class C>
349 : m_owner(owner)
350{
351}
352
353template <class C>
354void
355MemberLteCcmRrcSapUser<C>::AddLcs(std::vector<LteEnbRrcSapProvider::LogicalChannelConfig> lcConfig)
356{
357 NS_FATAL_ERROR("Function should not be called because it is not implemented.");
358 // m_owner->DoAddLcs (lcConfig);
359}
360
361template <class C>
362void
363MemberLteCcmRrcSapUser<C>::ReleaseLcs(uint16_t rnti, uint8_t lcid)
364{
365 NS_FATAL_ERROR("Function should not be called because it is not implemented.");
366 // m_owner->DoReleaseLcs (rnti, lcid);
367}
368
369template <class C>
370uint8_t
372 LteRrcSap::ReportConfigEutra reportConfig)
373{
374 return m_owner->DoAddUeMeasReportConfigForComponentCarrier(reportConfig);
375}
376
377template <class C>
378void
379MemberLteCcmRrcSapUser<C>::TriggerComponentCarrier(uint16_t rnti, uint16_t targetCellId)
380{
381 NS_FATAL_ERROR("Function should not be called because it is not implemented.");
382}
383
384template <class C>
387{
388 return m_owner->GetUeManager(rnti);
389}
390
391template <class C>
392void
394{
395 return m_owner->DoSetNumberOfComponentCarriers(noOfComponentCarriers);
396}
397
398} // end of namespace ns3
399
400#endif /* LTE_CCM_RRC_SAP_H */
This class contains the specification of EPS Bearers.
Definition: eps-bearer.h:91
Service Access Point (SAP) offered by the Component Carrier Manager (CCM) instance to the eNodeB RRC ...
virtual void ReportUeMeas(uint16_t rnti, LteRrcSap::MeasResults measResults)=0
Reports UE measurements to the component carrier manager.
virtual std::vector< LteCcmRrcSapProvider::LcsConfig > SetupDataRadioBearer(EpsBearer bearer, uint8_t bearerId, uint16_t rnti, uint8_t lcid, uint8_t lcGroup, LteMacSapUser *msu)=0
Add a new Bearer for the Ue in the LteEnbComponentCarrierManager.
virtual void AddUe(uint16_t rnti, uint8_t state)=0
Add a new UE in the LteEnbComponentCarrierManager.
virtual LteMacSapUser * ConfigureSignalBearer(LteEnbCmacSapProvider::LcInfo lcInfo, LteMacSapUser *rlcMacSapUser)=0
Add the Signal Bearer for a specific Ue in LteEnbComponenCarrierManager.
virtual void AddLc(LteEnbCmacSapProvider::LcInfo lcInfo, LteMacSapUser *msu)=0
Add a new logical channel.
virtual void RemoveUe(uint16_t rnti)=0
Remove an existing UE.
virtual std::vector< uint8_t > ReleaseDataRadioBearer(uint16_t rnti, uint8_t lcid)=0
Release an existing Data Radio Bearer for a Ue in the LteEnbComponentCarrierManager.
Service Access Point (SAP) offered by the eNodeB RRC instance to the component carrier manager (CCM) ...
virtual uint8_t AddUeMeasReportConfigForComponentCarrier(LteRrcSap::ReportConfigEutra reportConfig)=0
Request a certain reporting configuration to be fulfilled by the UEs attached to the eNodeB entity.
virtual Ptr< UeManager > GetUeManager(uint16_t rnti)=0
Get UE manager by RNTI.
virtual void ReleaseLcs(uint16_t rnti, uint8_t lcid)=0
remove an existing LC
virtual void SetNumberOfComponentCarriers(uint16_t noOfComponentCarriers)=0
Set the number of component carriers.
virtual void AddLcs(std::vector< LteEnbRrcSapProvider::LogicalChannelConfig > lcConfig)=0
add a new Logical Channel (LC)
virtual void TriggerComponentCarrier(uint16_t rnti, uint16_t targetCellId)=0
Instruct the eNodeB RRC entity to prepare a component carrier.
The LTE Radio Resource Control entity at the eNB.
Definition: lte-enb-rrc.h:656
Service Access Point (SAP) offered by the MAC to the RLC See Femto Forum MAC Scheduler Interface Spec...
Definition: lte-mac-sap.h:96
MemberLteCcmRrcSapProvider class.
std::vector< LteCcmRrcSapProvider::LcsConfig > SetupDataRadioBearer(EpsBearer bearer, uint8_t bearerId, uint16_t rnti, uint8_t lcid, uint8_t lcGroup, LteMacSapUser *msu) override
Add a new Bearer for the Ue in the LteEnbComponentCarrierManager.
MemberLteCcmRrcSapProvider(C *owner)
Constructor.
void ReportUeMeas(uint16_t rnti, LteRrcSap::MeasResults measResults) override
Reports UE measurements to the component carrier manager.
std::vector< uint8_t > ReleaseDataRadioBearer(uint16_t rnti, uint8_t lcid) override
Release an existing Data Radio Bearer for a Ue in the LteEnbComponentCarrierManager.
LteMacSapUser * ConfigureSignalBearer(LteEnbCmacSapProvider::LcInfo lcInfo, LteMacSapUser *rlcMacSapUser) override
Add the Signal Bearer for a specific Ue in LteEnbComponenCarrierManager.
void AddUe(uint16_t rnti, uint8_t state) override
Add a new UE in the LteEnbComponentCarrierManager.
void AddLc(LteEnbCmacSapProvider::LcInfo lcInfo, LteMacSapUser *msu) override
Add a new logical channel.
void RemoveUe(uint16_t rnti) override
Remove an existing UE.
MemberLteCcmRrcSapUser class.
Ptr< UeManager > GetUeManager(uint16_t rnti) override
Get UE manager by RNTI.
C * m_owner
the owner class
void TriggerComponentCarrier(uint16_t rnti, uint16_t targetCellId) override
Instruct the eNodeB RRC entity to prepare a component carrier.
void AddLcs(std::vector< LteEnbRrcSapProvider::LogicalChannelConfig > lcConfig) override
add a new Logical Channel (LC)
void SetNumberOfComponentCarriers(uint16_t noOfComponentCarriers) override
Set the number of component carriers.
uint8_t AddUeMeasReportConfigForComponentCarrier(LteRrcSap::ReportConfigEutra reportConfig) override
Request a certain reporting configuration to be fulfilled by the UEs attached to the eNodeB entity.
MemberLteCcmRrcSapUser(C *owner)
Constructor.
void ReleaseLcs(uint16_t rnti, uint8_t lcid) override
remove an existing LC
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:77
Manages all the radio bearer information possessed by the ENB RRC for a single UE.
Definition: lte-enb-rrc.h:68
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
Definition: fatal-error.h:179
Every class exported by the ns3 library is enclosed in the ns3 namespace.
uint16_t componentCarrierId
component carrier ID
LteEnbCmacSapProvider::LcInfo lc
LC info.
Logical Channel information to be passed to CmacSapProvider::ConfigureLc.
MeasResults structure.
Definition: lte-rrc-sap.h:717
Specifies criteria for triggering of an E-UTRA measurement reporting event.
Definition: lte-rrc-sap.h:373