A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
fdmt-ff-mac-scheduler.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Author: Marco Miozzo <marco.miozzo@cttc.es> // original version
19  * Modification: Dizhi Zhou <dizhi.zhou@gmail.com> // modify codes related to downlink scheduler
20  */
21 
22 #ifndef FDMT_FF_MAC_SCHEDULER_H
23 #define FDMT_FF_MAC_SCHEDULER_H
24 
25 #include <ns3/lte-common.h>
26 #include <ns3/ff-mac-csched-sap.h>
27 #include <ns3/ff-mac-sched-sap.h>
28 #include <ns3/ff-mac-scheduler.h>
29 #include <vector>
30 #include <map>
31 #include <set>
32 #include <ns3/nstime.h>
33 #include <ns3/lte-amc.h>
34 
35 
36 namespace ns3 {
37 
46 {
47 public:
54 
58  virtual ~FdMtFfMacScheduler ();
59 
60  // inherited from Object
61  virtual void DoDispose (void);
62  static TypeId GetTypeId (void);
63 
64  // inherited from FfMacScheduler
65  virtual void SetFfMacCschedSapUser (FfMacCschedSapUser* s);
66  virtual void SetFfMacSchedSapUser (FfMacSchedSapUser* s);
69 
72 
73  void TransmissionModeConfigurationUpdate (uint16_t rnti, uint8_t txMode);
74 
75 private:
76  //
77  // Implementation of the CSCHED API primitives
78  // (See 4.1 for description of the primitives)
79  //
80 
82 
84 
86 
88 
90 
91  //
92  // Implementation of the SCHED API primitives
93  // (See 4.2 for description of the primitives)
94  //
95 
97 
99 
101 
103 
105 
107 
109 
111 
113 
115 
117 
118 
119  int GetRbgSize (int dlbandwidth);
120 
121  int LcActivePerFlow (uint16_t rnti);
122 
123  double EstimateUlSinr (uint16_t rnti, uint16_t rb);
124 
125  void RefreshDlCqiMaps (void);
126  void RefreshUlCqiMaps (void);
127 
128  void UpdateDlRlcBufferInfo (uint16_t rnti, uint8_t lcid, uint16_t size);
129  void UpdateUlRlcBufferInfo (uint16_t rnti, uint16_t size);
131 
132  /*
133  * Vectors of UE's LC info
134  */
135  std::map <LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters> m_rlcBufferReq;
136 
137 
138  /*
139  * Set of UE's RNTI in downlink
140  */
141  std::set <uint16_t> m_flowStatsDl;
142 
143  /*
144  * Set of UE's RNTI in uplink
145  */
146  std::set <uint16_t> m_flowStatsUl;
147 
148  /*
149  * Map of UE's DL CQI P01 received
150  */
151  std::map <uint16_t,uint8_t> m_p10CqiRxed;
152  /*
153  * Map of UE's timers on DL CQI P01 received
154  */
155  std::map <uint16_t,uint32_t> m_p10CqiTimers;
156 
157  /*
158  * Map of UE's DL CQI A30 received
159  */
160  std::map <uint16_t,SbMeasResult_s> m_a30CqiRxed;
161  /*
162  * Map of UE's timers on DL CQI A30 received
163  */
164  std::map <uint16_t,uint32_t> m_a30CqiTimers;
165 
166  /*
167  * Map of previous allocated UE per RBG
168  * (used to retrieve info from UL-CQI)
169  */
170  std::map <uint16_t, std::vector <uint16_t> > m_allocationMaps;
171 
172  /*
173  * Map of UEs' UL-CQI per RBG
174  */
175  std::map <uint16_t, std::vector <double> > m_ueCqi;
176  /*
177  * Map of UEs' timers on UL-CQI per RBG
178  */
179  std::map <uint16_t, uint32_t> m_ueCqiTimers;
180 
181  /*
182  * Map of UE's buffer status reports received
183  */
184  std::map <uint16_t,uint32_t> m_ceBsrRxed;
185 
186  // MAC SAPs
191 
192 
193  // Internal parameters
195 
196  uint16_t m_nextRntiUl; // RNTI of the next user to be served next scheduling in UL
197 
198  uint32_t m_cqiTimersThreshold; // # of TTIs for which a CQI canbe considered valid
199 
200  std::map <uint16_t,uint8_t> m_uesTxMode; // txMode of the UEs
201 };
202 
203 } // namespace ns3
204 
205 #endif /* FDMT_FF_MAC_SCHEDULER_H */