Left: | ||
Right: |
OLD | NEW |
---|---|
(Empty) | |
1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ | |
2 /* | |
3 * Copyright (c) 2014 Piotr Gawlowicz | |
4 * | |
5 * This program is free software; you can redistribute it and/or modify | |
6 * it under the terms of the GNU General Public License version 2 as | |
7 * published by the Free Software Foundation; | |
8 * | |
9 * This program is distributed in the hope that it will be useful, | |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 * GNU General Public License for more details. | |
13 * | |
14 * You should have received a copy of the GNU General Public License | |
15 * along with this program; if not, write to the Free Software | |
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
17 * | |
18 * Author: Piotr Gawlowicz <gawlowicz.p@gmail.com> | |
19 * | |
20 */ | |
21 | |
22 #ifndef LTE_FFR_ALGORITHM_H | |
23 #define LTE_FFR_ALGORITHM_H | |
24 | |
25 #include <ns3/object.h> | |
26 #include <ns3/lte-rrc-sap.h> | |
27 #include <ns3/epc-x2-sap.h> | |
28 #include <ns3/ff-mac-sched-sap.h> | |
29 #include "ns3/uinteger.h" | |
buherman
2014/08/21 23:43:37
Not necessary.
gawlowicz.p
2014/09/01 22:48:45
Done.
| |
30 #include <map> | |
31 | |
32 namespace ns3 { | |
33 | |
34 class LteFfrSapUser; | |
35 class LteFfrSapProvider; | |
36 | |
37 class LteFfrRrcSapUser; | |
38 class LteFfrRrcSapProvider; | |
39 | |
40 /** | |
41 * \brief The abstract base class of a Frequency Reuse algorithm | |
42 * | |
43 * Generally Frequency reuse algorithm tells the Scheduler which RB can be alloc ated | |
44 * and which can not. FR policy depend on its implementation. | |
45 * | |
46 * The communication with the eNodeB MAC Scheduler instance is done through | |
47 * the *LteFfrSap* interface. The frequency reuse algorithm instance corresponds to the | |
48 * "provider" part of this interface, while the eNodeB MAC Scheduler instance ta kes the | |
49 * role of the "user" part. | |
50 * | |
51 * The communication with the eNodeB RRC instance is done through the *LteFfrRrc Sap* | |
52 * interface. The frequency reuse algorithm instance corresponds to the | |
53 * "provider" part of this interface, while the eNodeB RRC instance takes the | |
54 * role of the "user" part. | |
55 * | |
56 */ | |
57 | |
58 class LteFfrAlgorithm : public Object | |
59 { | |
60 public: | |
61 LteFfrAlgorithm (); | |
62 virtual ~LteFfrAlgorithm (); | |
63 | |
64 // inherited from Object | |
65 static TypeId GetTypeId (); | |
66 | |
67 /** | |
68 * \brief Set the "user" part of the LteFfrSap interface that | |
69 * this frequency reuse algorithm instance will interact with. | |
70 * \param s a reference to the "user" part of the interface, typically a | |
71 * member of an Scheduler instance | |
72 */ | |
73 virtual void SetLteFfrSapUser (LteFfrSapUser* s) = 0; | |
74 | |
75 /** | |
76 * \brief Set the "user" part of the LteFfrRrcSap interface that | |
77 * this frequency reuse algorithm instance will interact with. | |
78 * \param s a reference to the "user" part of the interface, typically a | |
79 * member of an LteEnbRrc instance | |
80 */ | |
81 virtual void SetLteFfrRrcSapUser (LteFfrRrcSapUser* s) = 0; | |
82 | |
83 /** | |
84 * \brief Export the "provider" part of the LteFfrSap interface. | |
85 * \return the reference to the "provider" part of the interface, typically to | |
86 * be kept by an Scheduler instance | |
87 */ | |
88 virtual LteFfrSapProvider* GetLteFfrSapProvider () = 0; | |
89 | |
90 /** | |
91 * \brief Export the "provider" part of the LteFfrRrcSap interface. | |
92 * \return the reference to the "provider" part of the interface, typically to | |
93 * be kept by an LteEnbRrc instance | |
94 */ | |
95 virtual LteFfrRrcSapProvider* GetLteFfrRrcSapProvider () = 0; | |
96 | |
97 /** | |
98 * \return the uplink bandwidth in RBs | |
99 */ | |
100 uint8_t GetUlBandwidth () const; | |
101 | |
102 /** | |
103 * \param bw the uplink bandwidth in RBs | |
104 */ | |
105 void SetUlBandwidth (uint8_t bw); | |
106 | |
107 /** | |
108 * \return the downlink bandwidth in RBs | |
109 */ | |
110 uint8_t GetDlBandwidth () const; | |
111 | |
112 /** | |
113 * \param bw the downlink bandwidth in RBs | |
114 */ | |
115 void SetDlBandwidth (uint8_t bw); | |
116 | |
117 /** | |
118 * \param FrCellTypeId for automatic FR configuration | |
buherman
2014/08/21 23:43:36
FrCellTypeId -> cellTypeId. Also check the rest of
gawlowicz.p
2014/09/01 22:48:45
Done.
| |
119 */ | |
120 void SetFrCellTypeId (uint8_t cellTypeId); | |
121 | |
122 /** | |
123 * \return FrCellTypeId which is used for automatic FR configuration | |
124 */ | |
125 uint8_t GetFrCellTypeId () const; | |
126 | |
127 protected: | |
128 | |
129 // inherited from Object | |
130 virtual void DoDispose (); | |
131 | |
132 /** | |
133 * \brief Automatic FR reconfiguration | |
134 */ | |
135 virtual void Reconfigure () = 0; | |
136 | |
137 // FFR SAP PROVIDER IMPLEMENTATION | |
138 | |
139 /** | |
140 * \brief Implementation of LteFfrSapProvider::GetAvailableDlRbg | |
141 * \return vector of size (m_dlBandwidth/RbgSize); false indicates | |
142 * that RBG is free to use, true otherwise | |
143 */ | |
144 virtual std::vector <bool> DoGetAvailableDlRbg () = 0; | |
145 | |
146 /** | |
147 * \brief Implementation of LteFfrSapProvider::IsDlRbgAvailableForUe | |
148 * \param i RBG ID | |
149 * \param rnti Radio Network Temporary Identity, an integer identifying the UE | |
150 * where the report originates from | |
151 * \return true if UE can be served on i-th RB, false otherwise | |
152 */ | |
153 virtual bool DoIsDlRbgAvailableForUe (int i, uint16_t rnti) = 0; | |
154 | |
155 /** | |
156 * \brief Implementation of LteFfrSapProvider::GetAvailableUlRbg. | |
157 * \return vector of size m_ulBandwidth; false indicates | |
158 * that RB is free to use, true otherwise | |
159 */ | |
160 virtual std::vector <bool> DoGetAvailableUlRbg () = 0; | |
161 | |
162 /** | |
163 * \brief Implementation of LteFfrSapProvider::IsUlRbgAvailableForUe. | |
164 * \param i RB ID | |
165 * \param rnti Radio Network Temporary Identity, an integer identifying the UE | |
166 * where the report originates from | |
167 * \return true if UE can be served on i-th RB, false otherwise | |
168 */ | |
169 virtual bool DoIsUlRbgAvailableForUe (int i, uint16_t rnti) = 0; | |
170 | |
171 /** | |
172 * \brief DoReportDlCqiInfo | |
173 * \param FfMacSchedSapProvider::SchedDlCqiInfoReqParameter | |
174 * | |
175 */ | |
176 virtual void DoReportDlCqiInfo (const struct FfMacSchedSapProvider::SchedDlCqi InfoReqParameters& params) = 0; | |
177 | |
178 /** | |
179 * \brief DoReportUlCqiInfo | |
180 * \param FfMacSchedSapProvider::SchedUlCqiInfoReqParameters | |
181 * | |
182 */ | |
183 virtual void DoReportUlCqiInfo (const struct FfMacSchedSapProvider::SchedUlCqi InfoReqParameters& params) = 0; | |
184 | |
185 /** | |
186 * \brief DoReportUlCqiInfo | |
187 * \param std::map <uint16_t, std::vector <double> > ulCqiMap | |
188 * | |
189 */ | |
190 virtual void DoReportUlCqiInfo ( std::map <uint16_t, std::vector <double> > ul CqiMap ) = 0; | |
191 | |
192 /** | |
193 * \brief DoGetTpc for UE | |
194 * \param uint16_t rnti | |
195 * \return TPC value | |
196 */ | |
197 virtual uint8_t DoGetTpc (uint16_t rnti) = 0; | |
198 | |
199 /** | |
200 * \brief DoGetMinContinuousUlBandwidth in number of RB | |
201 * \return number of RB in min continous UL Bandwidth | |
202 */ | |
203 virtual uint8_t DoGetMinContinuousUlBandwidth () = 0; | |
204 | |
205 // FFR SAP RRC PROVIDER IMPLEMENTATION | |
206 | |
207 /** | |
208 * \brief SetCellId | |
209 * \param cellId the Cell Identifier | |
210 */ | |
211 virtual void DoSetCellId (uint16_t cellId ); | |
212 | |
213 /** | |
214 * \brief Implementation of LteFfrRrcSapProvider::SetBandwidth. | |
215 * \param ulBandwidth UL bandwidth in number of RB | |
216 * \param dlBandwidth DL bandwidth in number of RB | |
217 */ | |
218 virtual void DoSetBandwidth (uint8_t ulBandwidth, uint8_t dlBandwidth); | |
219 | |
220 /** | |
221 * \brief Implementation of LteFfrRrcSapProvider::AddUe. | |
222 * \param rnti Radio Network Temporary Identity, an integer identifying the UE | |
223 * where the report originates from | |
224 */ | |
225 virtual void DoAddUe (uint16_t rnti) = 0; | |
226 | |
227 /** | |
228 * \brief Implementation of LteFfrRrcSapProvider::RemoveUe. | |
229 * \param rnti Radio Network Temporary Identity, an integer identifying the UE | |
230 * where the report originates from | |
231 */ | |
232 virtual void DoRemoveUe (uint16_t rnti) = 0; | |
233 | |
234 /** | |
235 * \brief Implementation of LteFfrRrcSapProvider::ReportUeMeas. | |
236 * \param rnti Radio Network Temporary Identity, an integer identifying the UE | |
237 * where the report originates from | |
238 * \param measResults a single report of one measurement identity | |
239 */ | |
240 virtual void DoReportUeMeas (uint16_t rnti, LteRrcSap::MeasResults measResults ) = 0; | |
241 | |
242 /** | |
243 * \brief DoRecvLoadInformation | |
244 * \param EpcX2Sap::LoadInformationParams | |
245 * | |
246 */ | |
247 virtual void DoRecvLoadInformation (EpcX2Sap::LoadInformationParams params) = 0; | |
248 | |
249 /** | |
250 * \brief Get RBG size for DL Bandwidth according to table 7.1.6.1-1 of 36.213 | |
251 * \param DL Bandwidth | |
252 * \return size of RBG in number of RB | |
253 */ | |
254 int GetRbgSize (int dlbandwidth); | |
255 | |
256 | |
257 uint16_t m_cellId; | |
258 | |
259 uint8_t m_dlBandwidth; /**< downlink bandwidth in RBs */ | |
260 uint8_t m_ulBandwidth; /**< uplink bandwidth in RBs */ | |
261 | |
262 uint8_t m_frCellTypeId; /**< FFR cell type ID for automatic configuration */ | |
263 | |
264 bool m_enabledInUplink; /**< If true FR algorithm will also work in Uplink*/ | |
265 | |
266 bool m_needReconfiguration; /**< If true FR algorithm will be reconfigured*/ | |
267 | |
268 }; // end of class LteFfrAlgorithm | |
269 | |
270 | |
271 } // end of namespace ns3 | |
272 | |
273 | |
274 #endif /* LTE_FFR_ALGORITHM_H */ | |
OLD | NEW |