A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
lte-enb-component-carrier-manager.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_ENB_COMPONENT_CARRIER_MANAGER_H
22#define LTE_ENB_COMPONENT_CARRIER_MANAGER_H
23
24#include "lte-ccm-mac-sap.h"
25#include "lte-ccm-rrc-sap.h"
26#include "lte-enb-cmac-sap.h"
27#include "lte-enb-rrc.h"
28#include "lte-mac-sap.h"
29#include "lte-rrc-sap.h"
30
31#include <ns3/object.h>
32
33#include <map>
34#include <vector>
35
36namespace ns3
37{
38
39class LteCcmRrcSapUser;
40class LteCcmRrcSapProvider;
41class LteMacSapUser;
42class LteMacSapProvider;
43class LteEnbCmacSapProvider;
44class LteCcmMacSapProvider;
45
46/**
47 * \brief The class implements Component Carrier Manager (CCM) that operates
48 * using the Component Carrier Manager SAP interfaces.
49 *
50 * CCM receives measurement reports from an eNode RRC instance and is forwarding
51 * calls from RLC to MAC layer, and from MAC to RLC.
52 *
53 * This class is an abstract class intended to be inherited by subclasses that
54 * will implement its virtual methods. The subclasses are compatible with the
55 * LteEnbNetDevice class, and are accessible using namespace-based access
56 * through ns-3 Config subsystem, and can be installed and configured by
57 * LteHelper class.
58 *
59 * The communication with the eNodeB RRC instance is done through the *Component
60 * Carrier Manager SAP* interface. The LteEnbComponentCarrierManager instance
61 * corresponds to the "provider" part of this interface, while the eNodeB RRC
62 * instance takes the role of the "user" part. The following code skeleton
63 * establishes the connection between both instances:
64 *
65 * Ptr<LteEnbRrc> rrc = ...;
66 * Ptr<LteComponentCarrierManager> ccmEnb = ...;
67 * rrc->SetLteCcmRrcSapProvider (ccmEnb->GetLteCcmRrcSapProvider ());
68 * ccmEnb->SetLteCcmRrcSapUser (rrc->GetLteCcmRrcSapUser ())
69 *
70 * Similarly, LteEnbComponentCarrierManager instance communicates with MAC, and
71 * it takes the role of the "user".
72 *
73 * However, user rarely needs to use the above code, since it has already been
74 * taken care by LteHelper::InstallEnbDevice.
75 *
76 * \sa LteCcmRrcSapUser, LteCcmRrcSapProvider, LteCcmMacSapUser, LteCcmMacSapProvider
77 */
78
80{
81 public:
84 /**
85 * \brief Get the type ID.
86 * \return the object TypeId
87 */
88 static TypeId GetTypeId();
89
90 /**
91 * \brief Set the "user" part of the ComponentCarrier Management SAP interface that
92 * this ComponentCarrier algorithm instance will interact with.
93 * \param s a reference to the "user" part of the interface, typically a
94 * member of an LteEnbRrc instance
95 */
97
98 /**
99 * \brief Export the "provider" part of the ComponentCarrier Management SAP interface.
100 * \return the reference to the "provider" part of the interface, typically to
101 * be kept by an LteEnbRlc instance
102 */
104
105 /**
106 * \brief This function returns a pointer to the LteCcmMacSapUser interface, which
107 * is used by MAC to communicate to CCM when e.g. UL buffer status report is
108 * received, or to notify CCM about PRB occupancy, and similar. Functions that are
109 * specific for the communication between MAC and CCM.
110 *
111 * \returns LteCcmMacSapUser*
112 */
114
115 /**
116 * \brief Returns the pointer to the LteMacSapProvider interface, the
117 * provider of MAC, which is this new architecture served by
118 * LteEnbComponentCarrierManager object which will behave as a
119 * proxy, and will forward calls between to MAC objects of
120 * component carriers based on the logic implemented in the
121 * specific component carrier manager.
122 *
123 * \returns LteMacSapProvider*
124 */
126
127 /**
128 * \brief Set LteMacSapProvider interface for the MAC object of
129 * the specified component carrier.
130 *
131 * \param componentCarrierId component carrier ID
132 * \param sap the MAC SAP provider
133 * \returns true if successful
134 */
135 virtual bool SetMacSapProvider(uint8_t componentCarrierId, LteMacSapProvider* sap);
136
137 /**
138 * \brief Set LteCcmMacSapProvider interface for the MAC object of
139 * the specified component carrier. Through this interface CCM communicates with
140 * MAC, e.g. it notifies MAC of the specific carrier when to scheduler UL BSR.
141 *
142 * \param componentCarrierId component carrier ID
143 * \param sap the MAC SAP provider
144 * \returns true if successful
145 */
146 virtual bool SetCcmMacSapProviders(uint8_t componentCarrierId, LteCcmMacSapProvider* sap);
147
148 /**
149 * \brief Sets the total number of component carriers.
150 * \param noOfComponentCarriers number of component carriers
151 */
152 virtual void SetNumberOfComponentCarriers(uint16_t noOfComponentCarriers);
153
154 protected:
155 // inherited from Object
156 void DoDispose() override;
157
158 /**
159 * \brief Implementation of ReportUeMeas.
160 * \param rnti Radio Network Temporary Identity, an integer identifying the UE
161 * where the report originates from
162 * \param measResults a single report of one measurement identity
163 */
164 virtual void DoReportUeMeas(uint16_t rnti, LteRrcSap::MeasResults measResults) = 0;
165
166 /**
167 * \brief Structure to represent UE info
168 */
169 struct UeInfo
170 {
171 std::map<uint8_t, LteMacSapUser*>
172 m_ueAttached; //!< Map from LCID to SAP of the RLC instance.
173 std::map<uint8_t, LteEnbCmacSapProvider::LcInfo>
174 m_rlcLcInstantiated; //!< Logical channel configuration per flow Id (rnti, lcid).
175 uint8_t m_enabledComponentCarrier; //!< The number of enabled component carriers.
176 uint8_t m_ueState; //!< RRC states of UE, e.g. CONNECTED_NORMALLY
177 };
178
179 std::map<uint16_t, UeInfo> m_ueInfo; //!< The map from RNTI to UE information.
180 uint16_t m_noOfComponentCarriers; //!< The number component of carriers that are supported by
181 //!< this eNb.
182 // pointer to RRC object for direct function calls, e.g. when CCM needs to obtain
183 // a pointer to RLC object of a specific flow
184 Ptr<LteEnbRrc> m_rrc; //!< A pointer to the RRC instance of this eNb.
185
186 /*
187 * This interface is used to receive API calls from the RLC instance that through
188 * LteMacSapProvider interface. The component carrier manager acts a proxy. This means that all
189 * RLC instances will see as in previous architecture the LteMacSapProvider interface, but the
190 * actual provider in new architecture will be some of child classes of
191 * LteEnbComponentCarrierManager. So, LteEnbComponentCarrierManager class will receive function
192 * calls that are meant for MAC, and will forward them to the MAC of the component carriers
193 * based on the logic implemented in LteComponentCarrierManager. This attribute will be
194 * initialized by using class that implements LteMacSapProvider interface and class that
195 * implements LteEnbComponentCarrierManager base class e.g.:EnbMacMemberLteMacSapProvider
196 * <LteEnbComponentCarrierManagerImpl>
197 */
198 LteMacSapProvider* m_macSapProvider; //!< A pointer to main SAP interface of the MAC instance,
199 //!< which is in this case handled by CCM.
200 // This map is initialized in LteHelper when the Component Carrier Manager is initialized,
201 // contains component carrier id and a pointer to the corresponding LteMacSapProvider interface
202 // of the MAC instance
203 std::map<uint8_t, LteMacSapProvider*>
204 m_macSapProvidersMap; //!< A map of pointers to real SAP interfaces of MAC instances.
205 // This map contains pointers to LteCcmMacSapProvider interfaces of the
206 // MAC instances. LteCcmMacSapProvider is new interface added for the
207 // communication between component carrier manager and MAC instance,
208 // to allow CCM to control UL buffer status reporting, and forwarding to
209 // schedulers. Before adding carrier aggregation to LTE module, MAC was
210 // directly forwarding UL buffer status report to scheduler. Now is this
211 // done through CCM, which decides to which MAC scheduler to forward UL BSR.
212 std::map<uint8_t, LteCcmMacSapProvider*>
213 m_ccmMacSapProviderMap; //!< A map of pointers to the SAP interfaces of CCM instance that
214 //!< provides the CCM specific functionalities to MAC, i.e.
215 //!< ReportMacCeToScheduler.
217 m_ccmMacSapUser; //!< LteCcmMacSapUser is extended version of LteMacSapUser interface.
218 //!< Contains functions that allow reporting of UL BSR from MAC to CCM.
219 LteCcmRrcSapUser* m_ccmRrcSapUser; //!< A pointer to SAP interface of RRC instance, i.e. to
220 //!< configure measurements reporting for CCM.
222 m_ccmRrcSapProvider; //!< A pointer to the SAP interface of the CCM instance to receive API
223 //!< calls from the eNodeB RRC instance.
224
225}; // end of class LteEnbComponentCarrierManager
226
227} // end of namespace ns3
228
229#endif /* LTE_ENB_COMPONENT_CARRIER_MANAGER_H */
Service Access Point (SAP) offered by the component carrier manager (CCM) by MAC to CCM.
Service Access Point (SAP) offered by MAC to the component carrier manager (CCM).
Service Access Point (SAP) offered by the Component Carrier Manager (CCM) instance to the eNodeB RRC ...
Service Access Point (SAP) offered by the eNodeB RRC instance to the component carrier manager (CCM) ...
The class implements Component Carrier Manager (CCM) that operates using the Component Carrier Manage...
virtual LteCcmMacSapUser * GetLteCcmMacSapUser()
This function returns a pointer to the LteCcmMacSapUser interface, which is used by MAC to communicat...
virtual void DoReportUeMeas(uint16_t rnti, LteRrcSap::MeasResults measResults)=0
Implementation of ReportUeMeas.
std::map< uint16_t, UeInfo > m_ueInfo
The map from RNTI to UE information.
LteCcmRrcSapProvider * m_ccmRrcSapProvider
A pointer to the SAP interface of the CCM instance to receive API calls from the eNodeB RRC instance.
virtual LteMacSapProvider * GetLteMacSapProvider()
Returns the pointer to the LteMacSapProvider interface, the provider of MAC, which is this new archit...
LteMacSapProvider * m_macSapProvider
A pointer to main SAP interface of the MAC instance, which is in this case handled by CCM.
std::map< uint8_t, LteMacSapProvider * > m_macSapProvidersMap
A map of pointers to real SAP interfaces of MAC instances.
Ptr< LteEnbRrc > m_rrc
A pointer to the RRC instance of this eNb.
virtual LteCcmRrcSapProvider * GetLteCcmRrcSapProvider()
Export the "provider" part of the ComponentCarrier Management SAP interface.
virtual bool SetMacSapProvider(uint8_t componentCarrierId, LteMacSapProvider *sap)
Set LteMacSapProvider interface for the MAC object of the specified component carrier.
virtual void SetNumberOfComponentCarriers(uint16_t noOfComponentCarriers)
Sets the total number of component carriers.
void DoDispose() override
Destructor implementation.
uint16_t m_noOfComponentCarriers
The number component of carriers that are supported by this eNb.
std::map< uint8_t, LteCcmMacSapProvider * > m_ccmMacSapProviderMap
A map of pointers to the SAP interfaces of CCM instance that provides the CCM specific functionalitie...
virtual bool SetCcmMacSapProviders(uint8_t componentCarrierId, LteCcmMacSapProvider *sap)
Set LteCcmMacSapProvider interface for the MAC object of the specified component carrier.
virtual void SetLteCcmRrcSapUser(LteCcmRrcSapUser *s)
Set the "user" part of the ComponentCarrier Management SAP interface that this ComponentCarrier algor...
LteCcmMacSapUser * m_ccmMacSapUser
LteCcmMacSapUser is extended version of LteMacSapUser interface.
LteCcmRrcSapUser * m_ccmRrcSapUser
A pointer to SAP interface of RRC instance, i.e.
Service Access Point (SAP) offered by the MAC to the RLC See Femto Forum MAC Scheduler Interface Spec...
Definition: lte-mac-sap.h:36
A base class which provides memory management and object aggregation.
Definition: object.h:89
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:77
a unique identifier for an interface.
Definition: type-id.h:59
Every class exported by the ns3 library is enclosed in the ns3 namespace.
std::map< uint8_t, LteEnbCmacSapProvider::LcInfo > m_rlcLcInstantiated
Logical channel configuration per flow Id (rnti, lcid).
uint8_t m_enabledComponentCarrier
The number of enabled component carriers.
std::map< uint8_t, LteMacSapUser * > m_ueAttached
Map from LCID to SAP of the RLC instance.
MeasResults structure.
Definition: lte-rrc-sap.h:717