A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
rr-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>
19  * Nicola Baldo <nbaldo@cttc.es>
20  */
21 
22 #ifndef RR_FF_MAC_SCHEDULER_H
23 #define RR_FF_MAC_SCHEDULER_H
24 
25 #include <ns3/ff-mac-csched-sap.h>
26 #include <ns3/ff-mac-sched-sap.h>
27 #include <ns3/ff-mac-scheduler.h>
28 #include <vector>
29 #include <map>
30 #include <ns3/lte-common.h>
31 #include <ns3/lte-amc.h>
32 
33 
34 namespace ns3 {
35 
36 
37 
50 {
51 public:
58 
62  virtual ~RrFfMacScheduler ();
63 
64  // inherited from Object
65  virtual void DoDispose (void);
66  static TypeId GetTypeId (void);
67 
68  // inherited from FfMacScheduler
69  virtual void SetFfMacCschedSapUser (FfMacCschedSapUser* s);
70  virtual void SetFfMacSchedSapUser (FfMacSchedSapUser* s);
73 
76 
77  void TransmissionModeConfigurationUpdate (uint16_t rnti, uint8_t txMode);
78 
79 private:
80  //
81  // Implementation of the CSCHED API primitives
82  // (See 4.1 for description of the primitives)
83  //
84 
86 
88 
90 
92 
94 
95  //
96  // Implementation of the SCHED API primitives
97  // (See 4.2 for description of the primitives)
98  //
99 
101 
103 
105 
107 
109 
111 
113 
115 
117 
119 
121 
122 
123  int GetRbgSize (int dlbandwidth);
124 
126 
127  void RefreshDlCqiMaps(void);
128  void RefreshUlCqiMaps(void);
129 
130  void UpdateDlRlcBufferInfo (uint16_t rnti, uint8_t lcid, uint16_t size);
131  void UpdateUlRlcBufferInfo (uint16_t rnti, uint16_t size);
132 
134 
135  /*
136  * Vectors of UE's RLC info
137  */
138  std::list <FfMacSchedSapProvider::SchedDlRlcBufferReqParameters> m_rlcBufferReq;
139 
140  /*
141  * Map of UE's DL CQI P01 received
142  */
143  std::map <uint16_t,uint8_t> m_p10CqiRxed;
144  /*
145  * Map of UE's timers on DL CQI P01 received
146  */
147  std::map <uint16_t,uint32_t> m_p10CqiTimers;
148 
149  /*
150  * Map of previous allocated UE per RBG
151  * (used to retrieve info from UL-CQI)
152  */
153  std::map <uint16_t, std::vector <uint16_t> > m_allocationMaps;
154 
155  /*
156  * Map of UEs' UL-CQI per RBG
157  */
158  std::map <uint16_t, std::vector <double> > m_ueCqi;
159  /*
160  * Map of UEs' timers on UL-CQI per RBG
161  */
162  std::map <uint16_t, uint32_t> m_ueCqiTimers;
163 
164 
165 
166  /*
167  * Map of UE's buffer status reports received
168  */
169  std::map <uint16_t,uint32_t> m_ceBsrRxed;
170 
171  // MAC SAPs
176 
177 
178  // Internal parameters
180 
181  uint16_t m_nextRntiDl; // RNTI of the next user to be served next scheduling in DL
182  uint16_t m_nextRntiUl; // RNTI of the next user to be served next scheduling in UL
183 
184  uint32_t m_cqiTimersThreshold; // # of TTIs for which a CQI canbe considered valid
185 
186  std::map <uint16_t,uint8_t> m_uesTxMode; // txMode of the UEs
187 
188 };
189 
190 } // namespace ns3
191 
192 #endif /* RR_FF_MAC_SCHEDULER_H */