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
tta-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 TTA_FF_MAC_SCHEDULER_H
23
#define TTA_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
45
class
TtaFfMacScheduler
:
public
FfMacScheduler
46
{
47
public
:
53
TtaFfMacScheduler
();
54
58
virtual
~TtaFfMacScheduler
();
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);
67
virtual
FfMacCschedSapProvider
*
GetFfMacCschedSapProvider
();
68
virtual
FfMacSchedSapProvider
*
GetFfMacSchedSapProvider
();
69
70
friend
class
TtaSchedulerMemberCschedSapProvider
;
71
friend
class
TtaSchedulerMemberSchedSapProvider
;
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
81
void
DoCschedCellConfigReq
(
const
struct
FfMacCschedSapProvider::CschedCellConfigReqParameters
& params);
82
83
void
DoCschedUeConfigReq
(
const
struct
FfMacCschedSapProvider::CschedUeConfigReqParameters
& params);
84
85
void
DoCschedLcConfigReq
(
const
struct
FfMacCschedSapProvider::CschedLcConfigReqParameters
& params);
86
87
void
DoCschedLcReleaseReq
(
const
struct
FfMacCschedSapProvider::CschedLcReleaseReqParameters
& params);
88
89
void
DoCschedUeReleaseReq
(
const
struct
FfMacCschedSapProvider::CschedUeReleaseReqParameters
& params);
90
91
//
92
// Implementation of the SCHED API primitives
93
// (See 4.2 for description of the primitives)
94
//
95
96
void
DoSchedDlRlcBufferReq
(
const
struct
FfMacSchedSapProvider::SchedDlRlcBufferReqParameters
& params);
97
98
void
DoSchedDlPagingBufferReq
(
const
struct
FfMacSchedSapProvider::SchedDlPagingBufferReqParameters
& params);
99
100
void
DoSchedDlMacBufferReq
(
const
struct
FfMacSchedSapProvider::SchedDlMacBufferReqParameters
& params);
101
102
void
DoSchedDlTriggerReq
(
const
struct
FfMacSchedSapProvider::SchedDlTriggerReqParameters
& params);
103
104
void
DoSchedDlRachInfoReq
(
const
struct
FfMacSchedSapProvider::SchedDlRachInfoReqParameters
& params);
105
106
void
DoSchedDlCqiInfoReq
(
const
struct
FfMacSchedSapProvider::SchedDlCqiInfoReqParameters
& params);
107
108
void
DoSchedUlTriggerReq
(
const
struct
FfMacSchedSapProvider::SchedUlTriggerReqParameters
& params);
109
110
void
DoSchedUlNoiseInterferenceReq
(
const
struct
FfMacSchedSapProvider::SchedUlNoiseInterferenceReqParameters
& params);
111
112
void
DoSchedUlSrInfoReq
(
const
struct
FfMacSchedSapProvider::SchedUlSrInfoReqParameters
& params);
113
114
void
DoSchedUlMacCtrlInfoReq
(
const
struct
FfMacSchedSapProvider::SchedUlMacCtrlInfoReqParameters
& params);
115
116
void
DoSchedUlCqiInfoReq
(
const
struct
FfMacSchedSapProvider::SchedUlCqiInfoReqParameters
& params);
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);
130
Ptr<LteAmc>
m_amc
;
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
187
FfMacCschedSapUser
*
m_cschedSapUser
;
188
FfMacSchedSapUser
*
m_schedSapUser
;
189
FfMacCschedSapProvider
*
m_cschedSapProvider
;
190
FfMacSchedSapProvider
*
m_schedSapProvider
;
191
192
193
// Internal parameters
194
FfMacCschedSapProvider::CschedCellConfigReqParameters
m_cschedCellConfig
;
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
/* TTA_FF_MAC_SCHEDULER_H */
src
lte
model
tta-ff-mac-scheduler.h
Generated on Fri Dec 21 2012 19:00:40 for ns-3 by
1.8.1.2