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
pss-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 PSS_FF_MAC_SCHEDULER_H
23
#define PSS_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 <algorithm>
32
#include <ns3/nstime.h>
33
#include <ns3/lte-amc.h>
34
35
namespace
ns3 {
36
40
struct
pssFlowPerf_t
41
{
42
Time
flowStart
;
43
unsigned
long
totalBytesTransmitted
;
44
unsigned
int
lastTtiBytesTransmitted
;
45
double
lastAveragedThroughput
;
46
double
secondLastAveragedThroughput
;
47
double
targetThroughput
;
48
};
49
50
58
class
PssFfMacScheduler
:
public
FfMacScheduler
59
{
60
public
:
66
PssFfMacScheduler
();
67
71
virtual
~PssFfMacScheduler
();
72
73
// inherited from Object
74
virtual
void
DoDispose
(
void
);
75
static
TypeId
GetTypeId
(
void
);
76
77
// inherited from FfMacScheduler
78
virtual
void
SetFfMacCschedSapUser
(
FfMacCschedSapUser
* s);
79
virtual
void
SetFfMacSchedSapUser
(
FfMacSchedSapUser
* s);
80
virtual
FfMacCschedSapProvider
*
GetFfMacCschedSapProvider
();
81
virtual
FfMacSchedSapProvider
*
GetFfMacSchedSapProvider
();
82
83
friend
class
PssSchedulerMemberCschedSapProvider
;
84
friend
class
PssSchedulerMemberSchedSapProvider
;
85
86
void
TransmissionModeConfigurationUpdate
(uint16_t rnti, uint8_t txMode);
87
88
private
:
89
//
90
// Implementation of the CSCHED API primitives
91
// (See 4.1 for description of the primitives)
92
//
93
94
void
DoCschedCellConfigReq
(
const
struct
FfMacCschedSapProvider::CschedCellConfigReqParameters
& params);
95
96
void
DoCschedUeConfigReq
(
const
struct
FfMacCschedSapProvider::CschedUeConfigReqParameters
& params);
97
98
void
DoCschedLcConfigReq
(
const
struct
FfMacCschedSapProvider::CschedLcConfigReqParameters
& params);
99
100
void
DoCschedLcReleaseReq
(
const
struct
FfMacCschedSapProvider::CschedLcReleaseReqParameters
& params);
101
102
void
DoCschedUeReleaseReq
(
const
struct
FfMacCschedSapProvider::CschedUeReleaseReqParameters
& params);
103
104
//
105
// Implementation of the SCHED API primitives
106
// (See 4.2 for description of the primitives)
107
//
108
109
void
DoSchedDlRlcBufferReq
(
const
struct
FfMacSchedSapProvider::SchedDlRlcBufferReqParameters
& params);
110
111
void
DoSchedDlPagingBufferReq
(
const
struct
FfMacSchedSapProvider::SchedDlPagingBufferReqParameters
& params);
112
113
void
DoSchedDlMacBufferReq
(
const
struct
FfMacSchedSapProvider::SchedDlMacBufferReqParameters
& params);
114
115
void
DoSchedDlTriggerReq
(
const
struct
FfMacSchedSapProvider::SchedDlTriggerReqParameters
& params);
116
117
void
DoSchedDlRachInfoReq
(
const
struct
FfMacSchedSapProvider::SchedDlRachInfoReqParameters
& params);
118
119
void
DoSchedDlCqiInfoReq
(
const
struct
FfMacSchedSapProvider::SchedDlCqiInfoReqParameters
& params);
120
121
void
DoSchedUlTriggerReq
(
const
struct
FfMacSchedSapProvider::SchedUlTriggerReqParameters
& params);
122
123
void
DoSchedUlNoiseInterferenceReq
(
const
struct
FfMacSchedSapProvider::SchedUlNoiseInterferenceReqParameters
& params);
124
125
void
DoSchedUlSrInfoReq
(
const
struct
FfMacSchedSapProvider::SchedUlSrInfoReqParameters
& params);
126
127
void
DoSchedUlMacCtrlInfoReq
(
const
struct
FfMacSchedSapProvider::SchedUlMacCtrlInfoReqParameters
& params);
128
129
void
DoSchedUlCqiInfoReq
(
const
struct
FfMacSchedSapProvider::SchedUlCqiInfoReqParameters
& params);
130
131
132
int
GetRbgSize
(
int
dlbandwidth);
133
134
int
LcActivePerFlow
(uint16_t rnti);
135
136
double
EstimateUlSinr
(uint16_t rnti, uint16_t rb);
137
138
void
RefreshDlCqiMaps
(
void
);
139
void
RefreshUlCqiMaps
(
void
);
140
141
void
UpdateDlRlcBufferInfo
(uint16_t rnti, uint8_t lcid, uint16_t size);
142
void
UpdateUlRlcBufferInfo
(uint16_t rnti, uint16_t size);
143
Ptr<LteAmc>
m_amc
;
144
145
/*
146
* Vectors of UE's LC info
147
*/
148
std::map <LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>
m_rlcBufferReq
;
149
150
151
/*
152
* Map of UE statistics (per RNTI basis) in downlink
153
*/
154
std::map <uint16_t, pssFlowPerf_t>
m_flowStatsDl
;
155
156
/*
157
* Map of UE statistics (per RNTI basis)
158
*/
159
std::map <uint16_t, pssFlowPerf_t>
m_flowStatsUl
;
160
161
/*
162
* Map of UE's DL CQI P01 received
163
*/
164
std::map <uint16_t,uint8_t>
m_p10CqiRxed
;
165
/*
166
* Map of UE's timers on DL CQI P01 received
167
*/
168
std::map <uint16_t,uint32_t>
m_p10CqiTimers
;
169
170
/*
171
* Map of UE's DL CQI A30 received
172
*/
173
std::map <uint16_t,SbMeasResult_s>
m_a30CqiRxed
;
174
/*
175
* Map of UE's timers on DL CQI A30 received
176
*/
177
std::map <uint16_t,uint32_t>
m_a30CqiTimers
;
178
179
/*
180
* Map of previous allocated UE per RBG
181
* (used to retrieve info from UL-CQI)
182
*/
183
std::map <uint16_t, std::vector <uint16_t> >
m_allocationMaps
;
184
185
/*
186
* Map of UEs' UL-CQI per RBG
187
*/
188
std::map <uint16_t, std::vector <double> >
m_ueCqi
;
189
/*
190
* Map of UEs' timers on UL-CQI per RBG
191
*/
192
std::map <uint16_t, uint32_t>
m_ueCqiTimers
;
193
194
/*
195
* Map of UE's buffer status reports received
196
*/
197
std::map <uint16_t,uint32_t>
m_ceBsrRxed
;
198
199
// MAC SAPs
200
FfMacCschedSapUser
*
m_cschedSapUser
;
201
FfMacSchedSapUser
*
m_schedSapUser
;
202
FfMacCschedSapProvider
*
m_cschedSapProvider
;
203
FfMacSchedSapProvider
*
m_schedSapProvider
;
204
205
206
// Internal parameters
207
FfMacCschedSapProvider::CschedCellConfigReqParameters
m_cschedCellConfig
;
208
209
double
m_timeWindow
;
210
211
uint16_t
m_nextRntiUl
;
// RNTI of the next user to be served next scheduling in UL
212
213
uint32_t
m_cqiTimersThreshold
;
// # of TTIs for which a CQI canbe considered valid
214
215
std::map <uint16_t,uint8_t>
m_uesTxMode
;
// txMode of the UEs
216
217
std::string
m_fdSchedulerType
;
218
219
uint32_t
m_nMux
;
// TD scheduler selects nMux UEs and transfer them to FD scheduler
220
221
};
222
223
}
// namespace ns3
224
225
#endif
/* PSS_FF_MAC_SCHEDULER_H */
src
lte
model
pss-ff-mac-scheduler.h
Generated on Fri Dec 21 2012 19:00:40 for ns-3 by
1.8.1.2