A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
lte-ffr-algorithm.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2014 Piotr Gawlowicz
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: Piotr Gawlowicz <gawlowicz.p@gmail.com>
18 *
19 */
20
21#ifndef LTE_FFR_ALGORITHM_H
22#define LTE_FFR_ALGORITHM_H
23
24#include "epc-x2-sap.h"
25#include "ff-mac-sched-sap.h"
26#include "lte-rrc-sap.h"
27
28#include <ns3/object.h>
29
30#include <map>
31
32namespace ns3
33{
34
35class LteFfrSapUser;
36class LteFfrSapProvider;
37
38class LteFfrRrcSapUser;
39class LteFfrRrcSapProvider;
40
41/**
42 * \brief The abstract base class of a Frequency Reuse algorithm
43 *
44 * Generally Frequency reuse algorithm tells the Scheduler which RB can be allocated
45 * and which can not. FR policy depend on its implementation.
46 *
47 * The communication with the eNodeB MAC Scheduler instance is done through
48 * the *LteFfrSap* interface. The frequency reuse algorithm instance corresponds to the
49 * "provider" part of this interface, while the eNodeB MAC Scheduler instance takes the
50 * role of the "user" part.
51 *
52 * The communication with the eNodeB RRC instance is done through the *LteFfrRrcSap*
53 * interface. The frequency reuse algorithm instance corresponds to the
54 * "provider" part of this interface, while the eNodeB RRC instance takes the
55 * role of the "user" part.
56 *
57 */
58
59class LteFfrAlgorithm : public Object
60{
61 public:
63 ~LteFfrAlgorithm() override;
64
65 /**
66 * \brief Get the type ID.
67 * \return the object TypeId
68 */
69 static TypeId GetTypeId();
70
71 /**
72 * \brief Set the "user" part of the LteFfrSap interface that
73 * this frequency reuse algorithm instance will interact with.
74 * \param s a reference to the "user" part of the interface, typically a
75 * member of an Scheduler instance
76 */
77 virtual void SetLteFfrSapUser(LteFfrSapUser* s) = 0;
78
79 /**
80 * \brief Set the "user" part of the LteFfrRrcSap interface that
81 * this frequency reuse algorithm instance will interact with.
82 * \param s a reference to the "user" part of the interface, typically a
83 * member of an LteEnbRrc instance
84 */
86
87 /**
88 * \brief Export the "provider" part of the LteFfrSap interface.
89 * \return the reference to the "provider" part of the interface, typically to
90 * be kept by an Scheduler instance
91 */
93
94 /**
95 * \brief Export the "provider" part of the LteFfrRrcSap interface.
96 * \return the reference to the "provider" part of the interface, typically to
97 * be kept by an LteEnbRrc instance
98 */
100
101 /**
102 * \return the uplink bandwidth in RBs
103 */
104 uint16_t GetUlBandwidth() const;
105
106 /**
107 * \param bw the uplink bandwidth in RBs
108 */
109 void SetUlBandwidth(uint16_t bw);
110
111 /**
112 * \return the downlink bandwidth in RBs
113 */
114 uint16_t GetDlBandwidth() const;
115
116 /**
117 * \param bw the downlink bandwidth in RBs
118 */
119 void SetDlBandwidth(uint16_t bw);
120
121 /**
122 * \param cellTypeId for automatic FR configuration
123 */
124 void SetFrCellTypeId(uint8_t cellTypeId);
125
126 /**
127 * \return cellTypeId which is used for automatic FR configuration
128 */
129 uint8_t GetFrCellTypeId() const;
130
131 protected:
132 // inherited from Object
133 void DoDispose() override;
134
135 /**
136 * \brief Automatic FR reconfiguration
137 */
138 virtual void Reconfigure() = 0;
139
140 // FFR SAP PROVIDER IMPLEMENTATION
141
142 /**
143 * \brief Implementation of LteFfrSapProvider::GetAvailableDlRbg
144 * \return vector of size (m_dlBandwidth/RbgSize); false indicates
145 * that RBG is free to use, true otherwise
146 */
147 virtual std::vector<bool> DoGetAvailableDlRbg() = 0;
148
149 /**
150 * \brief Implementation of LteFfrSapProvider::IsDlRbgAvailableForUe
151 * \param rbId
152 * \param rnti Radio Network Temporary Identity, an integer identifying the UE
153 * where the report originates from
154 * \return true if UE can be served on i-th RB, false otherwise
155 */
156 virtual bool DoIsDlRbgAvailableForUe(int rbId, uint16_t rnti) = 0;
157
158 /**
159 * \brief Implementation of LteFfrSapProvider::GetAvailableUlRbg.
160 * \return vector of size m_ulBandwidth; false indicates
161 * that RB is free to use, true otherwise
162 */
163 virtual std::vector<bool> DoGetAvailableUlRbg() = 0;
164
165 /**
166 * \brief Implementation of LteFfrSapProvider::IsUlRbgAvailableForUe.
167 * \param rbId
168 * \param rnti Radio Network Temporary Identity, an integer identifying the UE
169 * where the report originates from
170 * \return true if UE can be served on i-th RB, false otherwise
171 */
172 virtual bool DoIsUlRbgAvailableForUe(int rbId, uint16_t rnti) = 0;
173
174 /**
175 * \brief DoReportDlCqiInfo
176 * \param params
177 *
178 */
179 virtual void DoReportDlCqiInfo(
181
182 /**
183 * \brief DoReportUlCqiInfo
184 * \param params
185 *
186 */
187 virtual void DoReportUlCqiInfo(
189
190 /**
191 * \brief DoReportUlCqiInfo
192 * \param ulCqiMap
193 *
194 */
195 virtual void DoReportUlCqiInfo(std::map<uint16_t, std::vector<double>> ulCqiMap) = 0;
196
197 /**
198 * \brief DoGetTpc for UE
199 * \param rnti
200 * \return TPC value
201 */
202 virtual uint8_t DoGetTpc(uint16_t rnti) = 0;
203
204 /**
205 * \brief DoGetMinContinuousUlBandwidth in number of RB
206 * \return number of RB in min continuous UL Bandwidth
207 */
208 virtual uint16_t DoGetMinContinuousUlBandwidth() = 0;
209
210 // FFR SAP RRC PROVIDER IMPLEMENTATION
211
212 /**
213 * \brief SetCellId
214 * \param cellId the Cell Identifier
215 */
216 virtual void DoSetCellId(uint16_t cellId);
217
218 /**
219 * \brief Implementation of LteFfrRrcSapProvider::SetBandwidth.
220 * \param ulBandwidth UL bandwidth in number of RB
221 * \param dlBandwidth DL bandwidth in number of RB
222 */
223 virtual void DoSetBandwidth(uint16_t ulBandwidth, uint16_t dlBandwidth);
224
225 /**
226 * \brief Implementation of LteFfrRrcSapProvider::ReportUeMeas.
227 * \param rnti Radio Network Temporary Identity, an integer identifying the UE
228 * where the report originates from
229 * \param measResults a single report of one measurement identity
230 */
231 virtual void DoReportUeMeas(uint16_t rnti, LteRrcSap::MeasResults measResults) = 0;
232
233 /**
234 * \brief DoRecvLoadInformation
235 * \param params
236 *
237 */
239
240 /**
241 * \brief Get RBG size for DL Bandwidth according to table 7.1.6.1-1 of 36.213
242 * \param dlbandwidth
243 * \return size of RBG in number of RB
244 */
245 int GetRbgSize(int dlbandwidth);
246
247 uint16_t m_cellId; /**< cell ID */
248
249 uint8_t m_dlBandwidth; /**< downlink bandwidth in RBs */
250 uint8_t m_ulBandwidth; /**< uplink bandwidth in RBs */
251
252 uint8_t m_frCellTypeId; /**< FFR cell type ID for automatic configuration */
253
254 bool m_enabledInUplink; /**< If true FR algorithm will also work in Uplink*/
255
256 bool m_needReconfiguration; /**< If true FR algorithm will be reconfigured*/
257
258}; // end of class LteFfrAlgorithm
259
260} // end of namespace ns3
261
262#endif /* LTE_FFR_ALGORITHM_H */
The abstract base class of a Frequency Reuse algorithm.
virtual bool DoIsUlRbgAvailableForUe(int rbId, uint16_t rnti)=0
Implementation of LteFfrSapProvider::IsUlRbgAvailableForUe.
uint16_t m_cellId
cell ID
static TypeId GetTypeId()
Get the type ID.
virtual void DoRecvLoadInformation(EpcX2Sap::LoadInformationParams params)=0
DoRecvLoadInformation.
virtual void DoReportUlCqiInfo(const FfMacSchedSapProvider::SchedUlCqiInfoReqParameters &params)=0
DoReportUlCqiInfo.
virtual std::vector< bool > DoGetAvailableDlRbg()=0
Implementation of LteFfrSapProvider::GetAvailableDlRbg.
virtual bool DoIsDlRbgAvailableForUe(int rbId, uint16_t rnti)=0
Implementation of LteFfrSapProvider::IsDlRbgAvailableForUe.
virtual uint8_t DoGetTpc(uint16_t rnti)=0
DoGetTpc for UE.
virtual void SetLteFfrSapUser(LteFfrSapUser *s)=0
Set the "user" part of the LteFfrSap interface that this frequency reuse algorithm instance will inte...
bool m_needReconfiguration
If true FR algorithm will be reconfigured.
virtual LteFfrRrcSapProvider * GetLteFfrRrcSapProvider()=0
Export the "provider" part of the LteFfrRrcSap interface.
void SetFrCellTypeId(uint8_t cellTypeId)
uint8_t GetFrCellTypeId() const
virtual void SetLteFfrRrcSapUser(LteFfrRrcSapUser *s)=0
Set the "user" part of the LteFfrRrcSap interface that this frequency reuse algorithm instance will i...
uint8_t m_frCellTypeId
FFR cell type ID for automatic configuration.
void DoDispose() override
Destructor implementation.
virtual std::vector< bool > DoGetAvailableUlRbg()=0
Implementation of LteFfrSapProvider::GetAvailableUlRbg.
int GetRbgSize(int dlbandwidth)
Get RBG size for DL Bandwidth according to table 7.1.6.1-1 of 36.213.
virtual void Reconfigure()=0
Automatic FR reconfiguration.
bool m_enabledInUplink
If true FR algorithm will also work in Uplink.
virtual LteFfrSapProvider * GetLteFfrSapProvider()=0
Export the "provider" part of the LteFfrSap interface.
virtual void DoSetCellId(uint16_t cellId)
SetCellId.
virtual void DoReportDlCqiInfo(const FfMacSchedSapProvider::SchedDlCqiInfoReqParameters &params)=0
DoReportDlCqiInfo.
uint8_t m_dlBandwidth
downlink bandwidth in RBs
virtual void DoReportUlCqiInfo(std::map< uint16_t, std::vector< double > > ulCqiMap)=0
DoReportUlCqiInfo.
uint16_t GetUlBandwidth() const
void SetDlBandwidth(uint16_t bw)
virtual void DoReportUeMeas(uint16_t rnti, LteRrcSap::MeasResults measResults)=0
Implementation of LteFfrRrcSapProvider::ReportUeMeas.
virtual uint16_t DoGetMinContinuousUlBandwidth()=0
DoGetMinContinuousUlBandwidth in number of RB.
uint8_t m_ulBandwidth
uplink bandwidth in RBs
virtual void DoSetBandwidth(uint16_t ulBandwidth, uint16_t dlBandwidth)
Implementation of LteFfrRrcSapProvider::SetBandwidth.
void SetUlBandwidth(uint16_t bw)
uint16_t GetDlBandwidth() const
Service Access Point (SAP) offered by the Frequency Reuse algorithm instance to the eNodeB RRC instan...
Service Access Point (SAP) offered by the eNodeB RRC instance to the Frequency Reuse algorithm instan...
Service Access Point (SAP) offered by the Frequency Reuse algorithm instance to the MAC Scheduler ins...
Definition: lte-ffr-sap.h:40
Service Access Point (SAP) offered by the eNodeB RRC instance to the Frequency Reuse algorithm instan...
Definition: lte-ffr-sap.h:140
A base class which provides memory management and object aggregation.
Definition: object.h:89
a unique identifier for an interface.
Definition: type-id.h:59
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Parameters of the LOAD INFORMATION message.
Definition: epc-x2-sap.h:306
Parameters of the SCHED_DL_CQI_INFO_REQ primitive.
Parameters of the SCHED_UL_CQI_INFO_REQ primitive.
MeasResults structure.
Definition: lte-rrc-sap.h:717