A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
lte-ffr-sap.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_SAP_H
22#define LTE_FFR_SAP_H
23
24#include "ff-mac-sched-sap.h"
25
26#include <map>
27
28namespace ns3
29{
30
31/**
32 * \brief Service Access Point (SAP) offered by the Frequency Reuse algorithm
33 * instance to the MAC Scheduler instance.
34 *
35 * This is the *LteFfrSapProvider*, i.e., the part of the SAP
36 * that contains the Frequency Reuse algorithm methods called by the MAC Scheduler
37 * instance.
38 */
40{
41 public:
42 virtual ~LteFfrSapProvider();
43
44 /**
45 * \brief Get vector of available RBG in DL for this Cell
46 * \return vector of size (m_dlBandwidth/RbgSize); false indicates
47 * that RBG is free to use, true otherwise
48 *
49 * This function is called by MAC Scheduler in the beginning of DL
50 * scheduling process. Frequency Reuse Algorithm based on its policy
51 * generates vector of RBG which can be used and which can not be used
52 * by Scheduler to schedule transmission.
53 */
54 virtual std::vector<bool> GetAvailableDlRbg() = 0;
55
56 /**
57 * \brief Check if UE can be served on i-th RB in DL
58 * \param i RBG ID
59 * \param rnti Radio Network Temporary Identity, an integer identifying the UE
60 * where the report originates from
61 * \return true if UE can be served on i-th RB, false otherwise
62 *
63 * This function is called by MAC Scheduler during DL scheduling process
64 * to check if UE is allowed to be served with i-th RBG. Frequency Reuse
65 * Algorithm based on its policy decides if RBG is allowed to UE.
66 * If yes, Scheduler will try to allocate this RBG for UE, if not this UE
67 * will not be served with this RBG.
68 */
69 virtual bool IsDlRbgAvailableForUe(int i, uint16_t rnti) = 0;
70
71 /**
72 * \brief Get vector of available RB in UL for this Cell
73 * \return vector of size m_ulBandwidth; false indicates
74 * that RB is free to use, true otherwise
75 *
76 * This function is called by MAC Scheduler in the beginning of UL
77 * scheduling process. Frequency Reuse Algorithm based on its policy
78 * generates vector of RB which can be used and which can not be used
79 * by Scheduler to schedule transmission.
80 */
81 virtual std::vector<bool> GetAvailableUlRbg() = 0;
82
83 /**
84 * \brief Check if UE can be served on i-th RB in UL
85 * \param i RB ID
86 * \param rnti Radio Network Temporary Identity, an integer identifying the UE
87 * where the report originates from
88 * \return true if UE can be served on i-th RB, false otherwise
89 *
90 * This function is called by MAC Scheduler during UL scheduling process
91 * to check if UE is allowed to be served with i-th RB. Frequency Reuse
92 * Algorithm based on its policy decides if RB is allowed to UE.
93 * If yes, Scheduler will try to allocate this RB for UE, if not this UE
94 * will not be served with this RB.
95 */
96 virtual bool IsUlRbgAvailableForUe(int i, uint16_t rnti) = 0;
97
98 /**
99 * \brief ReportDlCqiInfo
100 * \param params the struct FfMacSchedSapProvider::SchedDlCqiInfoReqParameters
101 */
102 virtual void ReportDlCqiInfo(
104
105 /**
106 * \brief ReportUlCqiInfo
107 * \param params the struct FfMacSchedSapProvider::SchedUlCqiInfoReqParameters
108 */
109 virtual void ReportUlCqiInfo(
111
112 /**
113 * \brief ReportUlCqiInfo
114 * \param ulCqiMap the UL CQI map
115 */
116 virtual void ReportUlCqiInfo(std::map<uint16_t, std::vector<double>> ulCqiMap) = 0;
117
118 /**
119 * \brief GetTpc
120 * \param rnti the RNTI
121 * \returns the TCP
122 */
123 virtual uint8_t GetTpc(uint16_t rnti) = 0;
124
125 /**
126 * \brief Get the minimum continuous Ul bandwidth
127 * \returns the minimum continuous UL bandwidth
128 */
129 virtual uint16_t GetMinContinuousUlBandwidth() = 0;
130}; // end of class LteFfrSapProvider
131
132/**
133 * \brief Service Access Point (SAP) offered by the eNodeB RRC instance to the
134 * Frequency Reuse algorithm instance.
135 *
136 * This is the *LteFfrSapUser*, i.e., the part of the SAP that
137 * contains the MAC Scheduler methods called by the Frequency Reuse algorithm instance.
138 */
140{
141 public:
142 virtual ~LteFfrSapUser();
143
144}; // end of class LteFfrSapUser
145
146/**
147 * \brief Template for the implementation of the LteFfrSapProvider
148 * as a member of an owner class of type C to which all methods are
149 * forwarded.
150 */
151template <class C>
153{
154 public:
155 /**
156 * Constructor
157 *
158 * \param owner the owner class
159 */
160 MemberLteFfrSapProvider(C* owner);
161
162 // Delete default constructor to avoid misuse
164
165 // inherited from LteFfrSapProvider
166 std::vector<bool> GetAvailableDlRbg() override;
167 bool IsDlRbgAvailableForUe(int i, uint16_t rnti) override;
168 std::vector<bool> GetAvailableUlRbg() override;
169 bool IsUlRbgAvailableForUe(int i, uint16_t rnti) override;
172 void ReportUlCqiInfo(std::map<uint16_t, std::vector<double>> ulCqiMap) override;
173 uint8_t GetTpc(uint16_t rnti) override;
174 uint16_t GetMinContinuousUlBandwidth() override;
175
176 private:
177 C* m_owner; ///< the owner class
178
179}; // end of class MemberLteFfrSapProvider
180
181template <class C>
183 : m_owner(owner)
184{
185}
186
187template <class C>
188std::vector<bool>
190{
191 return m_owner->DoGetAvailableDlRbg();
192}
193
194template <class C>
195bool
197{
198 return m_owner->DoIsDlRbgAvailableForUe(i, rnti);
199}
200
201template <class C>
202std::vector<bool>
204{
205 return m_owner->DoGetAvailableUlRbg();
206}
207
208template <class C>
209bool
211{
212 return m_owner->DoIsUlRbgAvailableForUe(i, rnti);
213}
214
215template <class C>
216void
219{
220 m_owner->DoReportDlCqiInfo(params);
221}
222
223template <class C>
224void
227{
228 m_owner->DoReportUlCqiInfo(params);
229}
230
231template <class C>
232void
233MemberLteFfrSapProvider<C>::ReportUlCqiInfo(std::map<uint16_t, std::vector<double>> ulCqiMap)
234{
235 m_owner->DoReportUlCqiInfo(ulCqiMap);
236}
237
238template <class C>
239uint8_t
241{
242 return m_owner->DoGetTpc(rnti);
243}
244
245template <class C>
246uint16_t
248{
249 return m_owner->DoGetMinContinuousUlBandwidth();
250}
251
252/**
253 * \brief Template for the implementation of the LteFfrSapUser
254 * as a member of an owner class of type C to which all methods are
255 * forwarded.
256 */
257template <class C>
259{
260 public:
261 /**
262 * Constructor
263 *
264 * \param owner the owner class
265 */
266 MemberLteFfrSapUser(C* owner);
267
268 // Delete default constructor to avoid misuse
270
271 private:
272 C* m_owner; ///< the owner class
273
274}; // end of class LteFfrSapUser
275
276template <class C>
278 : m_owner(owner)
279{
280}
281
282} // end of namespace ns3
283
284#endif /* LTE_FFR_SAP_H */
Service Access Point (SAP) offered by the Frequency Reuse algorithm instance to the MAC Scheduler ins...
Definition: lte-ffr-sap.h:40
virtual uint8_t GetTpc(uint16_t rnti)=0
GetTpc.
virtual std::vector< bool > GetAvailableUlRbg()=0
Get vector of available RB in UL for this Cell.
virtual void ReportUlCqiInfo(const FfMacSchedSapProvider::SchedUlCqiInfoReqParameters &params)=0
ReportUlCqiInfo.
virtual bool IsUlRbgAvailableForUe(int i, uint16_t rnti)=0
Check if UE can be served on i-th RB in UL.
virtual void ReportDlCqiInfo(const FfMacSchedSapProvider::SchedDlCqiInfoReqParameters &params)=0
ReportDlCqiInfo.
virtual std::vector< bool > GetAvailableDlRbg()=0
Get vector of available RBG in DL for this Cell.
virtual uint16_t GetMinContinuousUlBandwidth()=0
Get the minimum continuous Ul bandwidth.
virtual bool IsDlRbgAvailableForUe(int i, uint16_t rnti)=0
Check if UE can be served on i-th RB in DL.
virtual ~LteFfrSapProvider()
Definition: lte-ffr-sap.cc:26
virtual void ReportUlCqiInfo(std::map< uint16_t, std::vector< double > > ulCqiMap)=0
ReportUlCqiInfo.
Service Access Point (SAP) offered by the eNodeB RRC instance to the Frequency Reuse algorithm instan...
Definition: lte-ffr-sap.h:140
virtual ~LteFfrSapUser()
Definition: lte-ffr-sap.cc:30
Template for the implementation of the LteFfrSapProvider as a member of an owner class of type C to w...
Definition: lte-ffr-sap.h:153
void ReportUlCqiInfo(const FfMacSchedSapProvider::SchedUlCqiInfoReqParameters &params) override
ReportUlCqiInfo.
Definition: lte-ffr-sap.h:225
std::vector< bool > GetAvailableDlRbg() override
Get vector of available RBG in DL for this Cell.
Definition: lte-ffr-sap.h:189
bool IsDlRbgAvailableForUe(int i, uint16_t rnti) override
Check if UE can be served on i-th RB in DL.
Definition: lte-ffr-sap.h:196
uint8_t GetTpc(uint16_t rnti) override
GetTpc.
Definition: lte-ffr-sap.h:240
void ReportDlCqiInfo(const FfMacSchedSapProvider::SchedDlCqiInfoReqParameters &params) override
ReportDlCqiInfo.
Definition: lte-ffr-sap.h:217
uint16_t GetMinContinuousUlBandwidth() override
Get the minimum continuous Ul bandwidth.
Definition: lte-ffr-sap.h:247
C * m_owner
the owner class
Definition: lte-ffr-sap.h:177
bool IsUlRbgAvailableForUe(int i, uint16_t rnti) override
Check if UE can be served on i-th RB in UL.
Definition: lte-ffr-sap.h:210
std::vector< bool > GetAvailableUlRbg() override
Get vector of available RB in UL for this Cell.
Definition: lte-ffr-sap.h:203
Template for the implementation of the LteFfrSapUser as a member of an owner class of type C to which...
Definition: lte-ffr-sap.h:259
C * m_owner
the owner class
Definition: lte-ffr-sap.h:272
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Parameters of the SCHED_DL_CQI_INFO_REQ primitive.
Parameters of the SCHED_UL_CQI_INFO_REQ primitive.