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 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Marco Miozzo <marco.miozzo@cttc.es>
7 * Nicola Baldo <nbaldo@cttc.es>
8 */
9
10#ifndef RR_FF_MAC_SCHEDULER_H
11#define RR_FF_MAC_SCHEDULER_H
12
13#include "ff-mac-csched-sap.h"
14#include "ff-mac-sched-sap.h"
15#include "ff-mac-scheduler.h"
16#include "lte-amc.h"
17#include "lte-ffr-sap.h"
18
19#include <map>
20#include <vector>
21
22namespace ns3
23{
24
25/**
26 * \ingroup ff-api
27 * \brief Implements the SCHED SAP and CSCHED SAP for a Round Robin scheduler
28 *
29 * This class implements the interface defined by the FfMacScheduler abstract class
30 */
31
33{
34 public:
35 /**
36 * \brief Constructor
37 *
38 * Creates the MAC Scheduler interface implementation
39 */
41
42 /**
43 * Destructor
44 */
45 ~RrFfMacScheduler() override;
46
47 // inherited from Object
48 void DoDispose() override;
49 /**
50 * \brief Get the type ID.
51 * \return the object TypeId
52 */
53 static TypeId GetTypeId();
54
55 // inherited from FfMacScheduler
60
61 // FFR SAPs
64
65 /// allow MemberCschedSapProvider<RrFfMacScheduler> class friend access
67 /// allow MemberSchedSapProvider<RrFfMacScheduler> class friend access
69
70 /**
71 * \brief Transmission mode configuration update function
72 * \param rnti the RNTI
73 * \param txMode the transmission mode
74 */
75 void TransmissionModeConfigurationUpdate(uint16_t rnti, uint8_t txMode);
76
77 private:
78 //
79 // Implementation of the CSCHED API primitives
80 // (See 4.1 for description of the primitives)
81 //
82
83 /**
84 * \brief CSched cell config request
85 * \param params FfMacCschedSapProvider::CschedCellConfigReqParameters
86 */
88
89 /**
90 * \brief CSched UE config request
91 * \param params FfMacCschedSapProvider::CschedUeConfigReqParameters
92 */
94
95 /**
96 * \brief CSched LC config request
97 * \param params FfMacCschedSapProvider::CschedLcConfigReqParameters
98 */
100
101 /**
102 * \brief CSched LC release request
103 * \param params FfMacCschedSapProvider::CschedLcReleaseReqParameters
104 */
106
107 /**
108 * \brief CSched UE release request
109 * \param params FfMacCschedSapProvider::CschedUeReleaseReqParameters
110 */
112
113 //
114 // Implementation of the SCHED API primitives
115 // (See 4.2 for description of the primitives)
116 //
117
118 /**
119 * \brief Sched DL RLC buffer request
120 * \param params FfMacSchedSapProvider::SchedDlRlcBufferReqParameters
121 */
123
124 /**
125 * \brief Sched DL paging buffer request
126 * \param params FfMacSchedSapProvider::SchedDlPagingBufferReqParameters
127 */
130
131 /**
132 * \brief Sched DL MAC buffer request
133 * \param params FfMacSchedSapProvider::SchedDlMacBufferReqParameters
134 */
136
137 /**
138 * \brief Sched DL trigger request
139 * \param params FfMacSchedSapProvider::SchedDlTriggerReqParameters
140 */
142
143 /**
144 * \brief Sched DL RACH info request
145 * \param params FfMacSchedSapProvider::SchedDlRachInfoReqParameters
146 */
148
149 /**
150 * \brief Sched DL CQI info request
151 * \param params FfMacSchedSapProvider::SchedDlCqiInfoReqParameters
152 */
154
155 /**
156 * \brief Sched UL trigger request
157 * \param params FfMacSchedSapProvider::SchedUlTriggerReqParameters
158 */
160
161 /**
162 * \brief Sched UL noise interference request
163 * \param params FfMacSchedSapProvider::SchedUlNoiseInterferenceReqParameters
164 */
167
168 /**
169 * \brief Sched UL SRS info request
170 * \param params FfMacSchedSapProvider::SchedUlSrInfoReqParameters
171 */
173
174 /**
175 * \brief Sched UL MAC control info request
176 * \param params FfMacSchedSapProvider::SchedUlMacCtrlInfoReqParameters
177 */
180
181 /**
182 * \brief Sched UL CQI info request
183 * \param params FfMacSchedSapProvider::SchedUlCqiInfoReqParameters
184 */
186
187 /**
188 * \brief Get RBG size function
189 * \param dlbandwidth the DL bandwidth
190 * \returns RBG size
191 */
192 int GetRbgSize(int dlbandwidth);
193
194 /**
195 * \brief Sort RLC buffer request function
196 * \param i FfMacSchedSapProvider::SchedDlRlcBufferReqParameters
197 * \param j FfMacSchedSapProvider::SchedDlRlcBufferReqParameters
198 * \returns true if
199 */
202
203 /// Refresh DL CQI maps function
204 void RefreshDlCqiMaps();
205 /// Refresh UL CQI maps function
206 void RefreshUlCqiMaps();
207
208 /**
209 * \brief Update DL RLC buffer info function
210 * \param rnti the RNTI
211 * \param lcid the LCID
212 * \param size the size
213 */
214 void UpdateDlRlcBufferInfo(uint16_t rnti, uint8_t lcid, uint16_t size);
215 /**
216 * \brief Update UL RLC buffer info function
217 * \param rnti the RNTI
218 * \param size the size
219 */
220 void UpdateUlRlcBufferInfo(uint16_t rnti, uint16_t size);
221
222 /**
223 * \brief Update and return a new process Id for the RNTI specified
224 *
225 * \param rnti the RNTI of the UE to be updated
226 * \return the process id value
227 */
228 uint8_t UpdateHarqProcessId(uint16_t rnti);
229
230 /**
231 * \brief Return the availability of free process for the RNTI specified
232 *
233 * \param rnti the RNTI of the UE to be updated
234 * \return the availability
235 */
236 bool HarqProcessAvailability(uint16_t rnti);
237
238 /**
239 * \brief Refresh HARQ processes according to the timers
240 *
241 */
243
245
246 /**
247 * Vectors of UE's RLC info
248 */
249 std::list<FfMacSchedSapProvider::SchedDlRlcBufferReqParameters> m_rlcBufferReq;
250
251 /**
252 * Map of UE's DL CQI P01 received
253 */
254 std::map<uint16_t, uint8_t> m_p10CqiRxed;
255 /**
256 * Map of UE's timers on DL CQI P01 received
257 */
258 std::map<uint16_t, uint32_t> m_p10CqiTimers;
259
260 /**
261 * Map of previous allocated UE per RBG
262 * (used to retrieve info from UL-CQI)
263 */
264 std::map<uint16_t, std::vector<uint16_t>> m_allocationMaps;
265
266 /**
267 * Map of UEs' UL-CQI per RBG
268 */
269 std::map<uint16_t, std::vector<double>> m_ueCqi;
270 /**
271 * Map of UEs' timers on UL-CQI per RBG
272 */
273 std::map<uint16_t, uint32_t> m_ueCqiTimers;
274
275 /**
276 * Map of UE's buffer status reports received
277 */
278 std::map<uint16_t, uint32_t> m_ceBsrRxed;
279
280 // MAC SAPs
281 FfMacCschedSapUser* m_cschedSapUser; ///< CSched SAP user
282 FfMacSchedSapUser* m_schedSapUser; ///< Sched SAP user
285
286 // FFR SAPs
287 LteFfrSapUser* m_ffrSapUser; ///< FFR SAP user
288 LteFfrSapProvider* m_ffrSapProvider; ///< FFR SAP provider
289
290 // Internal parameters
292 m_cschedCellConfig; ///< CSched cell config
293
294 uint16_t m_nextRntiDl; ///< RNTI of the next user to be served next scheduling in DL
295 uint16_t m_nextRntiUl; ///< RNTI of the next user to be served next scheduling in UL
296
297 uint32_t m_cqiTimersThreshold; ///< # of TTIs for which a CQI can be considered valid
298
299 std::map<uint16_t, uint8_t> m_uesTxMode; ///< txMode of the UEs
300
301 // HARQ attributes
302 /**
303 * m_harqOn when false inhibit the HARQ mechanisms (by default active)
304 */
306 std::map<uint16_t, uint8_t> m_dlHarqCurrentProcessId; ///< DL HARQ current process ID
307 // HARQ status
308 // 0: process Id available
309 // x>0: process Id equal to `x` transmission count
310 std::map<uint16_t, DlHarqProcessesStatus_t> m_dlHarqProcessesStatus; ///< DL HARQ process status
311 std::map<uint16_t, DlHarqProcessesTimer_t> m_dlHarqProcessesTimer; ///< DL HARQ process timer
312 std::map<uint16_t, DlHarqProcessesDciBuffer_t>
313 m_dlHarqProcessesDciBuffer; ///< DL HARQ process DCI buffer
314 std::map<uint16_t, DlHarqRlcPduListBuffer_t>
315 m_dlHarqProcessesRlcPduListBuffer; ///< DL HARQ process RLC PDU list buffer
316 std::vector<DlInfoListElement_s> m_dlInfoListBuffered; ///< HARQ retx buffered
317
318 std::map<uint16_t, uint8_t> m_ulHarqCurrentProcessId; ///< UL HARQ current process ID
319 // HARQ status
320 // 0: process Id available
321 // x>0: process Id equal to `x` transmission count
322 std::map<uint16_t, UlHarqProcessesStatus_t> m_ulHarqProcessesStatus; ///< UL HARQ process status
323 std::map<uint16_t, UlHarqProcessesDciBuffer_t>
324 m_ulHarqProcessesDciBuffer; ///< UL HARQ process DCI buffer
325
326 // RACH attributes
327 std::vector<RachListElement_s> m_rachList; ///< RACH list
328 std::vector<uint16_t> m_rachAllocationMap; ///< RACH allocation map
329 uint8_t m_ulGrantMcs; ///< MCS for UL grant (default 0)
330};
331
332} // namespace ns3
333
334#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:29
Service Access Point (SAP) offered by the eNodeB RRC instance to the Frequency Reuse algorithm instan...
MemberCschedSapProvider class.
MemberSchedSapProvider class.
Smart pointer class similar to boost::intrusive_ptr.
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:48
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.