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