A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Portuguese
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
pf-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
*/
20
21
#ifndef PF_FF_MAC_SCHEDULER_H
22
#define PF_FF_MAC_SCHEDULER_H
23
24
#include <ns3/lte-common.h>
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/nstime.h>
31
#include <ns3/lte-amc.h>
32
33
34
// value for SINR outside the range defined by FF-API, used to indicate that there
35
// is no CQI for this element
36
#define NO_SINR -5000
37
38
namespace
ns3 {
39
40
41
struct
pfsFlowPerf_t
42
{
43
Time
flowStart
;
44
unsigned
long
totalBytesTransmitted
;
45
unsigned
int
lastTtiBytesTrasmitted
;
46
double
lastAveragedThroughput
;
47
};
48
49
61
class
PfFfMacScheduler
:
public
FfMacScheduler
62
{
63
public
:
69
PfFfMacScheduler
();
70
74
virtual
~PfFfMacScheduler
();
75
76
// inherited from Object
77
virtual
void
DoDispose
(
void
);
78
static
TypeId
GetTypeId
(
void
);
79
80
// inherited from FfMacScheduler
81
virtual
void
SetFfMacCschedSapUser
(
FfMacCschedSapUser
* s);
82
virtual
void
SetFfMacSchedSapUser
(
FfMacSchedSapUser
* s);
83
virtual
FfMacCschedSapProvider
*
GetFfMacCschedSapProvider
();
84
virtual
FfMacSchedSapProvider
*
GetFfMacSchedSapProvider
();
85
86
friend
class
PfSchedulerMemberCschedSapProvider
;
87
friend
class
PfSchedulerMemberSchedSapProvider
;
88
89
void
TransmissionModeConfigurationUpdate
(uint16_t rnti, uint8_t txMode);
90
91
private
:
92
//
93
// Implementation of the CSCHED API primitives
94
// (See 4.1 for description of the primitives)
95
//
96
97
void
DoCschedCellConfigReq
(
const
struct
FfMacCschedSapProvider::CschedCellConfigReqParameters
& params);
98
99
void
DoCschedUeConfigReq
(
const
struct
FfMacCschedSapProvider::CschedUeConfigReqParameters
& params);
100
101
void
DoCschedLcConfigReq
(
const
struct
FfMacCschedSapProvider::CschedLcConfigReqParameters
& params);
102
103
void
DoCschedLcReleaseReq
(
const
struct
FfMacCschedSapProvider::CschedLcReleaseReqParameters
& params);
104
105
void
DoCschedUeReleaseReq
(
const
struct
FfMacCschedSapProvider::CschedUeReleaseReqParameters
& params);
106
107
//
108
// Implementation of the SCHED API primitives
109
// (See 4.2 for description of the primitives)
110
//
111
112
void
DoSchedDlRlcBufferReq
(
const
struct
FfMacSchedSapProvider::SchedDlRlcBufferReqParameters
& params);
113
114
void
DoSchedDlPagingBufferReq
(
const
struct
FfMacSchedSapProvider::SchedDlPagingBufferReqParameters
& params);
115
116
void
DoSchedDlMacBufferReq
(
const
struct
FfMacSchedSapProvider::SchedDlMacBufferReqParameters
& params);
117
118
void
DoSchedDlTriggerReq
(
const
struct
FfMacSchedSapProvider::SchedDlTriggerReqParameters
& params);
119
120
void
DoSchedDlRachInfoReq
(
const
struct
FfMacSchedSapProvider::SchedDlRachInfoReqParameters
& params);
121
122
void
DoSchedDlCqiInfoReq
(
const
struct
FfMacSchedSapProvider::SchedDlCqiInfoReqParameters
& params);
123
124
void
DoSchedUlTriggerReq
(
const
struct
FfMacSchedSapProvider::SchedUlTriggerReqParameters
& params);
125
126
void
DoSchedUlNoiseInterferenceReq
(
const
struct
FfMacSchedSapProvider::SchedUlNoiseInterferenceReqParameters
& params);
127
128
void
DoSchedUlSrInfoReq
(
const
struct
FfMacSchedSapProvider::SchedUlSrInfoReqParameters
& params);
129
130
void
DoSchedUlMacCtrlInfoReq
(
const
struct
FfMacSchedSapProvider::SchedUlMacCtrlInfoReqParameters
& params);
131
132
void
DoSchedUlCqiInfoReq
(
const
struct
FfMacSchedSapProvider::SchedUlCqiInfoReqParameters
& params);
133
134
135
int
GetRbgSize
(
int
dlbandwidth);
136
137
int
LcActivePerFlow
(uint16_t rnti);
138
139
double
EstimateUlSinr
(uint16_t rnti, uint16_t rb);
140
141
void
RefreshDlCqiMaps
(
void
);
142
void
RefreshUlCqiMaps
(
void
);
143
144
void
UpdateDlRlcBufferInfo
(uint16_t rnti, uint8_t lcid, uint16_t size);
145
void
UpdateUlRlcBufferInfo
(uint16_t rnti, uint16_t size);
146
Ptr<LteAmc>
m_amc
;
147
148
/*
149
* Vectors of UE's LC info
150
*/
151
std::map <LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>
m_rlcBufferReq
;
152
153
154
/*
155
* Map of UE statistics (per RNTI basis) in downlink
156
*/
157
std::map <uint16_t, pfsFlowPerf_t>
m_flowStatsDl
;
158
159
/*
160
* Map of UE statistics (per RNTI basis)
161
*/
162
std::map <uint16_t, pfsFlowPerf_t>
m_flowStatsUl
;
163
164
165
/*
166
* Map of UE's DL CQI P01 received
167
*/
168
std::map <uint16_t,uint8_t>
m_p10CqiRxed
;
169
/*
170
* Map of UE's timers on DL CQI P01 received
171
*/
172
std::map <uint16_t,uint32_t>
m_p10CqiTimers
;
173
174
/*
175
* Map of UE's DL CQI A30 received
176
*/
177
std::map <uint16_t,SbMeasResult_s>
m_a30CqiRxed
;
178
/*
179
* Map of UE's timers on DL CQI A30 received
180
*/
181
std::map <uint16_t,uint32_t>
m_a30CqiTimers
;
182
183
/*
184
* Map of previous allocated UE per RBG
185
* (used to retrieve info from UL-CQI)
186
*/
187
std::map <uint16_t, std::vector <uint16_t> >
m_allocationMaps
;
188
189
/*
190
* Map of UEs' UL-CQI per RBG
191
*/
192
std::map <uint16_t, std::vector <double> >
m_ueCqi
;
193
/*
194
* Map of UEs' timers on UL-CQI per RBG
195
*/
196
std::map <uint16_t, uint32_t>
m_ueCqiTimers
;
197
198
/*
199
* Map of UE's buffer status reports received
200
*/
201
std::map <uint16_t,uint32_t>
m_ceBsrRxed
;
202
203
// MAC SAPs
204
FfMacCschedSapUser
*
m_cschedSapUser
;
205
FfMacSchedSapUser
*
m_schedSapUser
;
206
FfMacCschedSapProvider
*
m_cschedSapProvider
;
207
FfMacSchedSapProvider
*
m_schedSapProvider
;
208
209
210
// Internal parameters
211
FfMacCschedSapProvider::CschedCellConfigReqParameters
m_cschedCellConfig
;
212
213
214
double
m_timeWindow
;
215
216
uint16_t
m_nextRntiUl
;
// RNTI of the next user to be served next scheduling in UL
217
218
uint32_t
m_cqiTimersThreshold
;
// # of TTIs for which a CQI canbe considered valid
219
220
std::map <uint16_t,uint8_t>
m_uesTxMode
;
// txMode of the UEs
221
};
222
223
}
// namespace ns3
224
225
#endif
/* PF_FF_MAC_SCHEDULER_H */
src
lte
model
pf-ff-mac-scheduler.h
Generated on Tue Nov 13 2012 10:32:17 for ns-3 by
1.8.1.2