A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
rr-ff-mac-scheduler.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
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: Marco Miozzo <marco.miozzo@cttc.es>
18 * Nicola Baldo <nbaldo@cttc.es>
19 */
20
21#ifndef RR_FF_MAC_SCHEDULER_H
22#define RR_FF_MAC_SCHEDULER_H
23
24#include "ff-mac-csched-sap.h"
25#include "ff-mac-sched-sap.h"
26#include "ff-mac-scheduler.h"
27#include "lte-amc.h"
28#include "lte-ffr-sap.h"
29
30#include <map>
31#include <vector>
32
33namespace ns3
34{
35
36/**
37 * \ingroup ff-api
38 * \brief Implements the SCHED SAP and CSCHED SAP for a Round Robin scheduler
39 *
40 * This class implements the interface defined by the FfMacScheduler abstract class
41 */
42
44{
45 public:
46 /**
47 * \brief Constructor
48 *
49 * Creates the MAC Scheduler interface implementation
50 */
52
53 /**
54 * Destructor
55 */
56 ~RrFfMacScheduler() override;
57
58 // inherited from Object
59 void DoDispose() override;
60 /**
61 * \brief Get the type ID.
62 * \return the object TypeId
63 */
64 static TypeId GetTypeId();
65
66 // inherited from FfMacScheduler
71
72 // FFR SAPs
75
76 /// allow MemberCschedSapProvider<RrFfMacScheduler> class friend access
78 /// allow MemberSchedSapProvider<RrFfMacScheduler> class friend access
80
81 /**
82 * \brief Transmission mode configuration update function
83 * \param rnti the RNTI
84 * \param txMode the transmission mode
85 */
86 void TransmissionModeConfigurationUpdate(uint16_t rnti, uint8_t txMode);
87
88 private:
89 //
90 // Implementation of the CSCHED API primitives
91 // (See 4.1 for description of the primitives)
92 //
93
94 /**
95 * \brief CSched cell config request
96 * \param params FfMacCschedSapProvider::CschedCellConfigReqParameters
97 */
99
100 /**
101 * \brief CSched UE config request
102 * \param params FfMacCschedSapProvider::CschedUeConfigReqParameters
103 */
105
106 /**
107 * \brief CSched LC config request
108 * \param params FfMacCschedSapProvider::CschedLcConfigReqParameters
109 */
111
112 /**
113 * \brief CSched LC release request
114 * \param params FfMacCschedSapProvider::CschedLcReleaseReqParameters
115 */
117
118 /**
119 * \brief CSched UE release request
120 * \param params FfMacCschedSapProvider::CschedUeReleaseReqParameters
121 */
123
124 //
125 // Implementation of the SCHED API primitives
126 // (See 4.2 for description of the primitives)
127 //
128
129 /**
130 * \brief Sched DL RLC buffer request
131 * \param params FfMacSchedSapProvider::SchedDlRlcBufferReqParameters
132 */
134
135 /**
136 * \brief Sched DL paging buffer request
137 * \param params FfMacSchedSapProvider::SchedDlPagingBufferReqParameters
138 */
141
142 /**
143 * \brief Sched DL MAC buffer request
144 * \param params FfMacSchedSapProvider::SchedDlMacBufferReqParameters
145 */
147
148 /**
149 * \brief Sched DL trigger request
150 * \param params FfMacSchedSapProvider::SchedDlTriggerReqParameters
151 */
153
154 /**
155 * \brief Sched DL RACH info request
156 * \param params FfMacSchedSapProvider::SchedDlRachInfoReqParameters
157 */
159
160 /**
161 * \brief Sched DL CQI info request
162 * \param params FfMacSchedSapProvider::SchedDlCqiInfoReqParameters
163 */
165
166 /**
167 * \brief Sched UL trigger request
168 * \param params FfMacSchedSapProvider::SchedUlTriggerReqParameters
169 */
171
172 /**
173 * \brief Sched UL noise interference request
174 * \param params FfMacSchedSapProvider::SchedUlNoiseInterferenceReqParameters
175 */
178
179 /**
180 * \brief Sched UL SRS info request
181 * \param params FfMacSchedSapProvider::SchedUlSrInfoReqParameters
182 */
184
185 /**
186 * \brief Sched UL MAC control info request
187 * \param params FfMacSchedSapProvider::SchedUlMacCtrlInfoReqParameters
188 */
191
192 /**
193 * \brief Sched UL CQI info request
194 * \param params FfMacSchedSapProvider::SchedUlCqiInfoReqParameters
195 */
197
198 /**
199 * \brief Get RBG size function
200 * \param dlbandwidth the DL bandwidth
201 * \returns RBG size
202 */
203 int GetRbgSize(int dlbandwidth);
204
205 /**
206 * \brief Sort RLC buffer request function
207 * \param i FfMacSchedSapProvider::SchedDlRlcBufferReqParameters
208 * \param j FfMacSchedSapProvider::SchedDlRlcBufferReqParameters
209 * \returns true if
210 */
213
214 /// Refresh DL CQI maps function
215 void RefreshDlCqiMaps();
216 /// Refresh UL CQI maps function
217 void RefreshUlCqiMaps();
218
219 /**
220 * \brief Update DL RLC buffer info function
221 * \param rnti the RNTI
222 * \param lcid the LCID
223 * \param size the size
224 */
225 void UpdateDlRlcBufferInfo(uint16_t rnti, uint8_t lcid, uint16_t size);
226 /**
227 * \brief Update UL RLC buffer info function
228 * \param rnti the RNTI
229 * \param size the size
230 */
231 void UpdateUlRlcBufferInfo(uint16_t rnti, uint16_t size);
232
233 /**
234 * \brief Update and return a new process Id for the RNTI specified
235 *
236 * \param rnti the RNTI of the UE to be updated
237 * \return the process id value
238 */
239 uint8_t UpdateHarqProcessId(uint16_t rnti);
240
241 /**
242 * \brief Return the availability of free process for the RNTI specified
243 *
244 * \param rnti the RNTI of the UE to be updated
245 * \return the availability
246 */
247 bool HarqProcessAvailability(uint16_t rnti);
248
249 /**
250 * \brief Refresh HARQ processes according to the timers
251 *
252 */
254
256
257 /**
258 * Vectors of UE's RLC info
259 */
260 std::list<FfMacSchedSapProvider::SchedDlRlcBufferReqParameters> m_rlcBufferReq;
261
262 /**
263 * Map of UE's DL CQI P01 received
264 */
265 std::map<uint16_t, uint8_t> m_p10CqiRxed;
266 /**
267 * Map of UE's timers on DL CQI P01 received
268 */
269 std::map<uint16_t, uint32_t> m_p10CqiTimers;
270
271 /**
272 * Map of previous allocated UE per RBG
273 * (used to retrieve info from UL-CQI)
274 */
275 std::map<uint16_t, std::vector<uint16_t>> m_allocationMaps;
276
277 /**
278 * Map of UEs' UL-CQI per RBG
279 */
280 std::map<uint16_t, std::vector<double>> m_ueCqi;
281 /**
282 * Map of UEs' timers on UL-CQI per RBG
283 */
284 std::map<uint16_t, uint32_t> m_ueCqiTimers;
285
286 /**
287 * Map of UE's buffer status reports received
288 */
289 std::map<uint16_t, uint32_t> m_ceBsrRxed;
290
291 // MAC SAPs
292 FfMacCschedSapUser* m_cschedSapUser; ///< CSched SAP user
293 FfMacSchedSapUser* m_schedSapUser; ///< Sched SAP user
296
297 // FFR SAPs
298 LteFfrSapUser* m_ffrSapUser; ///< FFR SAP user
299 LteFfrSapProvider* m_ffrSapProvider; ///< FFR SAP provider
300
301 // Internal parameters
303 m_cschedCellConfig; ///< CSched cell config
304
305 uint16_t m_nextRntiDl; ///< RNTI of the next user to be served next scheduling in DL
306 uint16_t m_nextRntiUl; ///< RNTI of the next user to be served next scheduling in UL
307
308 uint32_t m_cqiTimersThreshold; ///< # of TTIs for which a CQI can be considered valid
309
310 std::map<uint16_t, uint8_t> m_uesTxMode; ///< txMode of the UEs
311
312 // HARQ attributes
313 /**
314 * m_harqOn when false inhibit the HARQ mechanisms (by default active)
315 */
317 std::map<uint16_t, uint8_t> m_dlHarqCurrentProcessId; ///< DL HARQ current process ID
318 // HARQ status
319 // 0: process Id available
320 // x>0: process Id equal to `x` transmission count
321 std::map<uint16_t, DlHarqProcessesStatus_t> m_dlHarqProcessesStatus; ///< DL HARQ process status
322 std::map<uint16_t, DlHarqProcessesTimer_t> m_dlHarqProcessesTimer; ///< DL HARQ process timer
323 std::map<uint16_t, DlHarqProcessesDciBuffer_t>
324 m_dlHarqProcessesDciBuffer; ///< DL HARQ process DCI buffer
325 std::map<uint16_t, DlHarqRlcPduListBuffer_t>
326 m_dlHarqProcessesRlcPduListBuffer; ///< DL HARQ process RLC PDU list buffer
327 std::vector<DlInfoListElement_s> m_dlInfoListBuffered; ///< HARQ retx buffered
328
329 std::map<uint16_t, uint8_t> m_ulHarqCurrentProcessId; ///< UL HARQ current process ID
330 // HARQ status
331 // 0: process Id available
332 // x>0: process Id equal to `x` transmission count
333 std::map<uint16_t, UlHarqProcessesStatus_t> m_ulHarqProcessesStatus; ///< UL HARQ process status
334 std::map<uint16_t, UlHarqProcessesDciBuffer_t>
335 m_ulHarqProcessesDciBuffer; ///< UL HARQ process DCI buffer
336
337 // RACH attributes
338 std::vector<RachListElement_s> m_rachList; ///< RACH list
339 std::vector<uint16_t> m_rachAllocationMap; ///< RACH allocation map
340 uint8_t m_ulGrantMcs; ///< MCS for UL grant (default 0)
341};
342
343} // namespace ns3
344
345#endif /* RR_FF_MAC_SCHEDULER_H */
Provides the CSCHED SAP.
FfMacCschedSapUser class.
Provides the SCHED SAP.
FfMacSchedSapUser class.
This abstract base class identifies the interface by means of which the helper object can plug on the...
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
MemberCschedSapProvider class.
MemberSchedSapProvider class.
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:77
Implements the SCHED SAP and CSCHED SAP for a Round Robin scheduler.
std::map< uint16_t, std::vector< uint16_t > > m_allocationMaps
Map of previous allocated UE per RBG (used to retrieve info from UL-CQI)
void DoSchedDlRlcBufferReq(const FfMacSchedSapProvider::SchedDlRlcBufferReqParameters &params)
Sched DL RLC buffer request.
void DoSchedUlCqiInfoReq(const FfMacSchedSapProvider::SchedUlCqiInfoReqParameters &params)
Sched UL CQI info request.
std::map< uint16_t, uint8_t > m_uesTxMode
txMode of the UEs
bool HarqProcessAvailability(uint16_t rnti)
Return the availability of free process for the RNTI specified.
void DoSchedDlTriggerReq(const FfMacSchedSapProvider::SchedDlTriggerReqParameters &params)
Sched DL trigger request.
void DoCschedLcReleaseReq(const FfMacCschedSapProvider::CschedLcReleaseReqParameters &params)
CSched LC release request.
std::map< uint16_t, DlHarqProcessesStatus_t > m_dlHarqProcessesStatus
DL HARQ process status.
void DoCschedLcConfigReq(const FfMacCschedSapProvider::CschedLcConfigReqParameters &params)
CSched LC config request.
void DoSchedUlSrInfoReq(const FfMacSchedSapProvider::SchedUlSrInfoReqParameters &params)
Sched UL SRS info request.
~RrFfMacScheduler() override
Destructor.
std::map< uint16_t, uint8_t > m_p10CqiRxed
Map of UE's DL CQI P01 received.
FfMacSchedSapUser * m_schedSapUser
Sched SAP user.
FfMacSchedSapProvider * m_schedSapProvider
Sched SAP provider.
void SetFfMacCschedSapUser(FfMacCschedSapUser *s) override
set the user part of the FfMacCschedSap that this Scheduler will interact with.
void DoCschedUeConfigReq(const FfMacCschedSapProvider::CschedUeConfigReqParameters &params)
CSched UE config request.
std::map< uint16_t, uint32_t > m_ceBsrRxed
Map of UE's buffer status reports received.
uint8_t UpdateHarqProcessId(uint16_t rnti)
Update and return a new process Id for the RNTI specified.
LteFfrSapUser * m_ffrSapUser
FFR SAP user.
LteFfrSapUser * GetLteFfrSapUser() override
std::map< uint16_t, DlHarqProcessesTimer_t > m_dlHarqProcessesTimer
DL HARQ process timer.
void DoSchedUlMacCtrlInfoReq(const FfMacSchedSapProvider::SchedUlMacCtrlInfoReqParameters &params)
Sched UL MAC control info request.
void UpdateDlRlcBufferInfo(uint16_t rnti, uint8_t lcid, uint16_t size)
Update DL RLC buffer info function.
void DoSchedUlTriggerReq(const FfMacSchedSapProvider::SchedUlTriggerReqParameters &params)
Sched UL trigger request.
void DoSchedUlNoiseInterferenceReq(const FfMacSchedSapProvider::SchedUlNoiseInterferenceReqParameters &params)
Sched UL noise interference request.
std::vector< uint16_t > m_rachAllocationMap
RACH allocation map.
std::map< uint16_t, uint32_t > m_p10CqiTimers
Map of UE's timers on DL CQI P01 received.
LteFfrSapProvider * m_ffrSapProvider
FFR SAP provider.
FfMacCschedSapProvider * m_cschedSapProvider
CSched SAP provider.
int GetRbgSize(int dlbandwidth)
Get RBG size function.
void DoSchedDlMacBufferReq(const FfMacSchedSapProvider::SchedDlMacBufferReqParameters &params)
Sched DL MAC buffer request.
std::map< uint16_t, DlHarqProcessesDciBuffer_t > m_dlHarqProcessesDciBuffer
DL HARQ process DCI buffer.
FfMacCschedSapUser * m_cschedSapUser
CSched SAP user.
std::map< uint16_t, uint8_t > m_dlHarqCurrentProcessId
DL HARQ current process ID.
std::map< uint16_t, std::vector< double > > m_ueCqi
Map of UEs' UL-CQI per RBG.
void DoCschedUeReleaseReq(const FfMacCschedSapProvider::CschedUeReleaseReqParameters &params)
CSched UE release request.
std::list< FfMacSchedSapProvider::SchedDlRlcBufferReqParameters > m_rlcBufferReq
Vectors of UE's RLC info.
std::map< uint16_t, UlHarqProcessesStatus_t > m_ulHarqProcessesStatus
UL HARQ process status.
uint16_t m_nextRntiDl
RNTI of the next user to be served next scheduling in DL.
FfMacCschedSapProvider::CschedCellConfigReqParameters m_cschedCellConfig
CSched cell config.
std::vector< RachListElement_s > m_rachList
RACH list.
static bool SortRlcBufferReq(FfMacSchedSapProvider::SchedDlRlcBufferReqParameters i, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters j)
Sort RLC buffer request function.
void RefreshHarqProcesses()
Refresh HARQ processes according to the timers.
void RefreshDlCqiMaps()
Refresh DL CQI maps function.
std::map< uint16_t, DlHarqRlcPduListBuffer_t > m_dlHarqProcessesRlcPduListBuffer
DL HARQ process RLC PDU list buffer.
FfMacCschedSapProvider * GetFfMacCschedSapProvider() override
void SetLteFfrSapProvider(LteFfrSapProvider *s) override
Set the Provider part of the LteFfrSap that this Scheduler will interact with.
bool m_harqOn
m_harqOn when false inhibit the HARQ mechanisms (by default active)
void DoSchedDlCqiInfoReq(const FfMacSchedSapProvider::SchedDlCqiInfoReqParameters &params)
Sched DL CQI info request.
void DoCschedCellConfigReq(const FfMacCschedSapProvider::CschedCellConfigReqParameters &params)
CSched cell config request.
void TransmissionModeConfigurationUpdate(uint16_t rnti, uint8_t txMode)
Transmission mode configuration update function.
uint8_t m_ulGrantMcs
MCS for UL grant (default 0)
static TypeId GetTypeId()
Get the type ID.
std::map< uint16_t, uint32_t > m_ueCqiTimers
Map of UEs' timers on UL-CQI per RBG.
std::map< uint16_t, uint8_t > m_ulHarqCurrentProcessId
UL HARQ current process ID.
void DoSchedDlPagingBufferReq(const FfMacSchedSapProvider::SchedDlPagingBufferReqParameters &params)
Sched DL paging buffer request.
std::vector< DlInfoListElement_s > m_dlInfoListBuffered
HARQ retx buffered.
std::map< uint16_t, UlHarqProcessesDciBuffer_t > m_ulHarqProcessesDciBuffer
UL HARQ process DCI buffer.
void SetFfMacSchedSapUser(FfMacSchedSapUser *s) override
set the user part of the FfMacSchedSap that this Scheduler will interact with.
FfMacSchedSapProvider * GetFfMacSchedSapProvider() override
void RefreshUlCqiMaps()
Refresh UL CQI maps function.
void DoSchedDlRachInfoReq(const FfMacSchedSapProvider::SchedDlRachInfoReqParameters &params)
Sched DL RACH info request.
void DoDispose() override
Destructor implementation.
void UpdateUlRlcBufferInfo(uint16_t rnti, uint16_t size)
Update UL RLC buffer info function.
uint16_t m_nextRntiUl
RNTI of the next user to be served next scheduling in UL.
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 CSCHED_LC_CONFIG_REQ primitive.
Parameters of the CSCHED_LC_RELEASE_REQ primitive.
Parameters of the CSCHED_UE_CONFIG_REQ primitive.
Parameters of the CSCHED_UE_RELEASE_REQ primitive.
Parameters of the SCHED_DL_CQI_INFO_REQ primitive.
Parameters of the SCHED_DL_MAC_BUFFER_REQ primitive.
Parameters of the SCHED_DL_PAGING_BUFFER_REQ primitive.
Parameters of the SCHED_DL_RACH_INFO_REQ primitive.
Parameters of the SCHED_DL_TRIGGER_REQ primitive.
Parameters of the SCHED_UL_CQI_INFO_REQ primitive.
Parameters of the SCHED_UL_MAC_CTRL_INFO_REQ primitive.
Parameters of the SCHED_UL_NOISE_INTERFERENCE_REQ primitive.
Parameters of the SCHED_UL_SR_INFO_REQ primitive.
Parameters of the SCHED_UL_TRIGGER_REQ primitive.