A Discrete-Event Network Simulator
API
tta-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 TTA_FF_MAC_SCHEDULER_H
22 #define TTA_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 
37 namespace ns3
38 {
39 
48 {
49  public:
56 
60  ~TtaFfMacScheduler() override;
61 
62  // inherited from Object
63  void DoDispose() override;
68  static TypeId GetTypeId();
69 
70  // inherited from FfMacScheduler
71  void SetFfMacCschedSapUser(FfMacCschedSapUser* s) override;
72  void SetFfMacSchedSapUser(FfMacSchedSapUser* s) override;
75 
76  // FFR SAPs
77  void SetLteFfrSapProvider(LteFfrSapProvider* s) override;
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 
263  void RefreshHarqProcesses();
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
344  bool m_harqOn;
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 /* TTA_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 Throughput to Average scheduler.
std::map< uint16_t, uint8_t > m_p10CqiRxed
Map of UE's DL CQI P01 received.
std::map< uint16_t, uint32_t > m_a30CqiTimers
Map of UE's timers on DL CQI A30 received.
FfMacSchedSapUser * m_schedSapUser
Sched SAP user.
void DoSchedDlCqiInfoReq(const FfMacSchedSapProvider::SchedDlCqiInfoReqParameters &params)
Sched DL CQI info request function.
bool m_harqOn
m_harqOn when false inhibit the HARQ mechanisms (by default active)
void RefreshHarqProcesses()
Refresh HARQ processes according to the timers.
void DoSchedUlCqiInfoReq(const FfMacSchedSapProvider::SchedUlCqiInfoReqParameters &params)
Sched UL CQI info request function.
void SetLteFfrSapProvider(LteFfrSapProvider *s) override
Set the Provider part of the LteFfrSap that this Scheduler will interact with.
std::map< uint16_t, std::vector< double > > m_ueCqi
Map of UEs' UL-CQI per RBG.
std::set< uint16_t > m_flowStatsDl
Set of UE statistics (per RNTI basis) in downlink.
void DoSchedDlRachInfoReq(const FfMacSchedSapProvider::SchedDlRachInfoReqParameters &params)
Sched DL RACH info request function.
void DoDispose() override
Destructor implementation.
uint16_t m_nextRntiUl
RNTI of the next user to be served next scheduling in UL.
void DoSchedDlPagingBufferReq(const FfMacSchedSapProvider::SchedDlPagingBufferReqParameters &params)
Sched DL paging buffer request function.
int GetRbgSize(int dlbandwidth)
Get RBG size function.
void SetFfMacCschedSapUser(FfMacCschedSapUser *s) override
set the user part of the FfMacCschedSap that this Scheduler will interact with.
LteFfrSapUser * m_ffrSapUser
FFR SAP user.
void UpdateDlRlcBufferInfo(uint16_t rnti, uint8_t lcid, uint16_t size)
Update DL RLC buffer info function.
std::vector< DlInfoListElement_s > m_dlInfoListBuffered
HARQ retx buffered.
void RefreshDlCqiMaps()
Refresh DL CQI maps.
std::map< uint16_t, SbMeasResult_s > m_a30CqiRxed
Map of UE's DL CQI A30 received.
double EstimateUlSinr(uint16_t rnti, uint16_t rb)
Estimate UL SINR function.
LteFfrSapProvider * m_ffrSapProvider
FFR SAP provider.
FfMacSchedSapProvider * GetFfMacSchedSapProvider() override
void RefreshUlCqiMaps()
Refresh UL CQI maps.
static TypeId GetTypeId()
Get the type ID.
~TtaFfMacScheduler() override
Destructor.
std::map< uint16_t, uint8_t > m_uesTxMode
txMode of the UEs
void DoCschedLcReleaseReq(const FfMacCschedSapProvider::CschedLcReleaseReqParameters &params)
CSched LC release request function.
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 SetFfMacSchedSapUser(FfMacSchedSapUser *s) override
set the user part of the FfMacSchedSap that this Scheduler will interact with.
FfMacCschedSapProvider * m_cschedSapProvider
CSched SAP provider.
std::map< uint16_t, uint8_t > m_ulHarqCurrentProcessId
UL HARQ current process ID.
std::map< uint16_t, uint8_t > m_dlHarqCurrentProcessId
DL HARQ current process ID.
void DoSchedUlMacCtrlInfoReq(const FfMacSchedSapProvider::SchedUlMacCtrlInfoReqParameters &params)
Sched UL MAC control info request function.
std::map< uint16_t, UlHarqProcessesStatus_t > m_ulHarqProcessesStatus
UL HARQ process status.
void DoSchedUlTriggerReq(const FfMacSchedSapProvider::SchedUlTriggerReqParameters &params)
Sched UL trigger request function.
std::vector< uint16_t > m_rachAllocationMap
RACH allocation map.
LteFfrSapUser * GetLteFfrSapUser() override
std::map< uint16_t, DlHarqProcessesStatus_t > m_dlHarqProcessesStatus
DL HARQ process status.
void DoSchedDlTriggerReq(const FfMacSchedSapProvider::SchedDlTriggerReqParameters &params)
Sched DL trigger request function.
uint8_t UpdateHarqProcessId(uint16_t rnti)
Update and return a new process Id for the RNTI specified.
void DoSchedUlSrInfoReq(const FfMacSchedSapProvider::SchedUlSrInfoReqParameters &params)
Sched UL SR info request function.
void DoCschedLcConfigReq(const FfMacCschedSapProvider::CschedLcConfigReqParameters &params)
CSched LC config request function.
FfMacCschedSapUser * m_cschedSapUser
CSched SAP user.
FfMacCschedSapProvider * GetFfMacCschedSapProvider() override
std::map< uint16_t, UlHarqProcessesDciBuffer_t > m_ulHarqProcessesDciBuffer
UL HARQ process DCI buffer.
std::map< uint16_t, uint32_t > m_p10CqiTimers
Map of UE's timers on DL CQI P01 received.
void TransmissionModeConfigurationUpdate(uint16_t rnti, uint8_t txMode)
Transmission mode configuration update.
void DoSchedDlMacBufferReq(const FfMacSchedSapProvider::SchedDlMacBufferReqParameters &params)
Sched DL MAC buffer request function.
void UpdateUlRlcBufferInfo(uint16_t rnti, uint16_t size)
Update DL RLC buffer info function.
void DoSchedUlNoiseInterferenceReq(const FfMacSchedSapProvider::SchedUlNoiseInterferenceReqParameters &params)
Sched UL noise interference request function.
void DoCschedCellConfigReq(const FfMacCschedSapProvider::CschedCellConfigReqParameters &params)
CSched cell config request function.
bool HarqProcessAvailability(uint16_t rnti)
Return the availability of free process for the RNTI specified.
unsigned int LcActivePerFlow(uint16_t rnti)
LC active per flow function.
std::map< uint16_t, uint32_t > m_ueCqiTimers
Map of UEs' timers on UL-CQI per RBG.
void DoSchedDlRlcBufferReq(const FfMacSchedSapProvider::SchedDlRlcBufferReqParameters &params)
Sched DL RLC buffer request function.
std::map< uint16_t, DlHarqProcessesTimer_t > m_dlHarqProcessesTimer
DL HARQ process timer.
std::map< uint16_t, uint32_t > m_ceBsrRxed
Map of UE's buffer status reports received.
std::map< uint16_t, DlHarqRlcPduListBuffer_t > m_dlHarqProcessesRlcPduListBuffer
DL HARQ process RLC PDU list buffer.
void DoCschedUeReleaseReq(const FfMacCschedSapProvider::CschedUeReleaseReqParameters &params)
CSched UE release request function.
FfMacSchedSapProvider * m_schedSapProvider
Sched SAP provider.
std::map< LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters > m_rlcBufferReq
Vectors of UE's LC info.
std::set< uint16_t > m_flowStatsUl
Set of UE statistics (per RNTI basis)
std::vector< RachListElement_s > m_rachList
RACH list.
FfMacCschedSapProvider::CschedCellConfigReqParameters m_cschedCellConfig
CSched cell config.
void DoCschedUeConfigReq(const FfMacCschedSapProvider::CschedUeConfigReqParameters &params)
CSched UE config request function.
uint8_t m_ulGrantMcs
MCS for UL grant (default 0)
std::map< uint16_t, DlHarqProcessesDciBuffer_t > m_dlHarqProcessesDciBuffer
DL HARQ process DCI buffer.
a unique identifier for an interface.
Definition: type-id.h:59
Every class exported by the ns3 library is enclosed in the ns3 namespace.
params
Fit Fluctuating Two Ray model to the 3GPP TR 38.901 using the Anderson-Darling goodness-of-fit ##.
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.