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