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