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