A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
tdmt-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 * Modification: Dizhi Zhou <dizhi.zhou@gmail.com> // modify codes related to downlink scheduler
19 */
20
21#ifndef TDMT_FF_MAC_SCHEDULER_H
22#define TDMT_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-common.h"
29#include "lte-ffr-sap.h"
30
31#include <ns3/nstime.h>
32
33#include <map>
34#include <set>
35#include <vector>
36
37namespace ns3
38{
39
48{
49 public:
56
60 ~TdMtFfMacScheduler() override;
61
62 // inherited from Object
63 void DoDispose() override;
68 static TypeId GetTypeId();
69
70 // inherited from FfMacScheduler
75
76 // FFR SAPs
79
84
90 void TransmissionModeConfigurationUpdate(uint16_t rnti, uint8_t txMode);
91
92 private:
93 //
94 // Implementation of the CSCHED API primitives
95 // (See 4.1 for description of the primitives)
96 //
97
103
109
115
121
127
128 //
129 // Implementation of the SCHED API primitives
130 // (See 4.2 for description of the primitives)
131 //
132
138
145
151
157
163
169
175
182
188
195
201
207 int GetRbgSize(int dlbandwidth);
208
214 unsigned int LcActivePerFlow(uint16_t rnti);
215
222 double EstimateUlSinr(uint16_t rnti, uint16_t rb);
223
225 void RefreshDlCqiMaps();
227 void RefreshUlCqiMaps();
228
235 void UpdateDlRlcBufferInfo(uint16_t rnti, uint8_t lcid, uint16_t size);
241 void UpdateUlRlcBufferInfo(uint16_t rnti, uint16_t size);
242
249 uint8_t UpdateHarqProcessId(uint16_t rnti);
250
257 bool HarqProcessAvailability(uint16_t rnti);
258
264
266
270 std::map<LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters> m_rlcBufferReq;
271
275 std::set<uint16_t> m_flowStatsDl;
276
280 std::set<uint16_t> m_flowStatsUl;
281
285 std::map<uint16_t, uint8_t> m_p10CqiRxed;
289 std::map<uint16_t, uint32_t> m_p10CqiTimers;
290
294 std::map<uint16_t, SbMeasResult_s> m_a30CqiRxed;
298 std::map<uint16_t, uint32_t> m_a30CqiTimers;
299
304 std::map<uint16_t, std::vector<uint16_t>> m_allocationMaps;
305
309 std::map<uint16_t, std::vector<double>> m_ueCqi;
313 std::map<uint16_t, uint32_t> m_ueCqiTimers;
314
318 std::map<uint16_t, uint32_t> m_ceBsrRxed;
319
320 // MAC SAPs
325
326 // FFR SAPs
329
330 // Internal parameters
333
334 uint16_t m_nextRntiUl;
335
337
338 std::map<uint16_t, uint8_t> m_uesTxMode;
339
340 // HARQ attributes
345 std::map<uint16_t, uint8_t> m_dlHarqCurrentProcessId;
346 // HARQ status
347 // 0: process Id available
348 // x>0: process Id equal to `x` transmission count
349 std::map<uint16_t, DlHarqProcessesStatus_t> m_dlHarqProcessesStatus;
350 std::map<uint16_t, DlHarqProcessesTimer_t> m_dlHarqProcessesTimer;
351 std::map<uint16_t, DlHarqProcessesDciBuffer_t>
353 std::map<uint16_t, DlHarqRlcPduListBuffer_t>
355 std::vector<DlInfoListElement_s> m_dlInfoListBuffered;
356
357 std::map<uint16_t, uint8_t> m_ulHarqCurrentProcessId;
358 // HARQ status
359 // 0: process Id available
360 // x>0: process Id equal to `x` transmission count
361 std::map<uint16_t, UlHarqProcessesStatus_t> m_ulHarqProcessesStatus;
362 std::map<uint16_t, UlHarqProcessesDciBuffer_t>
364
365 // RACH attributes
366 std::vector<RachListElement_s> m_rachList;
367 std::vector<uint16_t> m_rachAllocationMap;
368 uint8_t m_ulGrantMcs;
369};
370
371} // namespace ns3
372
373#endif /* TDMT_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 Time Domain Maximize Throughput scheduler.
FfMacCschedSapProvider * m_cschedSapProvider
CSched SAP provider.
std::vector< DlInfoListElement_s > m_dlInfoListBuffered
HARQ retx buffered.
std::map< uint16_t, UlHarqProcessesDciBuffer_t > m_ulHarqProcessesDciBuffer
UL HARQ process DCI buffer.
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.
void DoSchedUlCqiInfoReq(const FfMacSchedSapProvider::SchedUlCqiInfoReqParameters &params)
Sched UL CQI info request.
FfMacCschedSapUser * m_cschedSapUser
CSched SAP user.
uint8_t m_ulGrantMcs
MCS for UL grant (default 0)
void DoSchedUlTriggerReq(const FfMacSchedSapProvider::SchedUlTriggerReqParameters &params)
Sched UL trigger request.
void DoCschedCellConfigReq(const FfMacCschedSapProvider::CschedCellConfigReqParameters &params)
CSched cell config request.
void DoCschedLcConfigReq(const FfMacCschedSapProvider::CschedLcConfigReqParameters &params)
CSched LC config request.
void DoCschedUeReleaseReq(const FfMacCschedSapProvider::CschedUeReleaseReqParameters &params)
CSched UE release request.
LteFfrSapUser * GetLteFfrSapUser() override
void DoSchedDlRlcBufferReq(const FfMacSchedSapProvider::SchedDlRlcBufferReqParameters &params)
Sched DL RLC buffer request.
void DoSchedUlSrInfoReq(const FfMacSchedSapProvider::SchedUlSrInfoReqParameters &params)
Sched UL SR info request.
void TransmissionModeConfigurationUpdate(uint16_t rnti, uint8_t txMode)
Transmission mode configuration update function.
FfMacCschedSapProvider * GetFfMacCschedSapProvider() override
FfMacSchedSapProvider * m_schedSapProvider
Sched SAP provider.
std::set< uint16_t > m_flowStatsDl
Set of UE statistics (per RNTI basis) in downlink.
FfMacCschedSapProvider::CschedCellConfigReqParameters m_cschedCellConfig
CSched cell config.
int GetRbgSize(int dlbandwidth)
Get RBG size function.
std::map< uint16_t, UlHarqProcessesStatus_t > m_ulHarqProcessesStatus
UL HARQ process status.
void SetFfMacCschedSapUser(FfMacCschedSapUser *s) override
set the user part of the FfMacCschedSap that this Scheduler will interact with.
FfMacSchedSapUser * m_schedSapUser
Sched SAP user.
bool HarqProcessAvailability(uint16_t rnti)
Return the availability of free process for the RNTI specified.
void DoSchedDlPagingBufferReq(const FfMacSchedSapProvider::SchedDlPagingBufferReqParameters &params)
Sched DL paging buffer request.
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 UpdateUlRlcBufferInfo(uint16_t rnti, uint16_t size)
Update UL RLC buffer info function.
void DoSchedUlNoiseInterferenceReq(const FfMacSchedSapProvider::SchedUlNoiseInterferenceReqParameters &params)
Sched UL noise interference request.
std::map< uint16_t, DlHarqRlcPduListBuffer_t > m_dlHarqProcessesRlcPduListBuffer
DL HARQ process RLC PDU list buffer.
std::map< uint16_t, std::vector< double > > m_ueCqi
Map of UEs' UL-CQI per RBG.
void DoSchedDlMacBufferReq(const FfMacSchedSapProvider::SchedDlMacBufferReqParameters &params)
Sched DL MAC buffer request.
std::map< uint16_t, DlHarqProcessesStatus_t > m_dlHarqProcessesStatus
DL HARQ process status.
std::set< uint16_t > m_flowStatsUl
Set of UE statistics (per RNTI basis)
void UpdateDlRlcBufferInfo(uint16_t rnti, uint8_t lcid, uint16_t size)
Update DL RLC buffer info function.
FfMacSchedSapProvider * GetFfMacSchedSapProvider() override
unsigned int LcActivePerFlow(uint16_t rnti)
LC active flow function.
void DoSchedDlCqiInfoReq(const FfMacSchedSapProvider::SchedDlCqiInfoReqParameters &params)
Sched DL CQI info request.
std::map< uint16_t, uint32_t > m_ceBsrRxed
Map of UE's buffer status reports received.
std::map< uint16_t, uint32_t > m_ueCqiTimers
Map of UEs' timers on UL-CQI per RBG.
void SetFfMacSchedSapUser(FfMacSchedSapUser *s) override
set the user part of the FfMacSchedSap that this Scheduler will interact with.
void DoSchedDlRachInfoReq(const FfMacSchedSapProvider::SchedDlRachInfoReqParameters &params)
Sched DL RACH info request.
std::map< uint16_t, DlHarqProcessesDciBuffer_t > m_dlHarqProcessesDciBuffer
DL HARQ process DCI buffer.
std::map< uint16_t, uint8_t > m_uesTxMode
txMode of the UEs
void DoSchedUlMacCtrlInfoReq(const FfMacSchedSapProvider::SchedUlMacCtrlInfoReqParameters &params)
Sched UL MAC control info request.
LteFfrSapProvider * m_ffrSapProvider
FFR SAP provider.
std::map< uint16_t, SbMeasResult_s > m_a30CqiRxed
Map of UE's DL CQI A30 received.
void RefreshHarqProcesses()
Refresh HARQ processes according to the timers.
void DoCschedLcReleaseReq(const FfMacCschedSapProvider::CschedLcReleaseReqParameters &params)
CSched LC release request.
uint8_t UpdateHarqProcessId(uint16_t rnti)
Update and return a new process Id for the RNTI specified.
std::map< uint16_t, uint32_t > m_a30CqiTimers
Map of UE's timers on DL CQI A30 received.
std::map< uint16_t, uint8_t > m_dlHarqCurrentProcessId
DL HARQ current process ID.
static TypeId GetTypeId()
Get the type ID.
void SetLteFfrSapProvider(LteFfrSapProvider *s) override
Set the Provider part of the LteFfrSap that this Scheduler will interact with.
LteFfrSapUser * m_ffrSapUser
FFR SAP user.
std::map< uint16_t, uint8_t > m_ulHarqCurrentProcessId
UL HARQ current process ID.
void DoDispose() override
Destructor implementation.
void DoCschedUeConfigReq(const FfMacCschedSapProvider::CschedUeConfigReqParameters &params)
CSched UE config request.
bool m_harqOn
m_harqOn when false inhibit the HARQ mechanisms (by default active)
void RefreshDlCqiMaps()
Refresh DL CQI maps function.
~TdMtFfMacScheduler() override
Destructor.
double EstimateUlSinr(uint16_t rnti, uint16_t rb)
Estimate UL SINR function.
void DoSchedDlTriggerReq(const FfMacSchedSapProvider::SchedDlTriggerReqParameters &params)
Sched DL trigger request.
std::map< uint16_t, uint8_t > m_p10CqiRxed
Map of UE's DL CQI P01 received.
uint16_t m_nextRntiUl
RNTI of the next user to be served next scheduling in UL.
void RefreshUlCqiMaps()
Refresh UL CQI maps function.
std::vector< RachListElement_s > m_rachList
RACH list.
std::map< uint16_t, DlHarqProcessesTimer_t > m_dlHarqProcessesTimer
DL HARQ process timer.
std::map< LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters > m_rlcBufferReq
Vectors of UE's LC info.
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.