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
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
49
class
RrFfMacScheduler
:
public
FfMacScheduler
50
{
51
public
:
57
RrFfMacScheduler
();
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);
71
virtual
FfMacCschedSapProvider
*
GetFfMacCschedSapProvider
();
72
virtual
FfMacSchedSapProvider
*
GetFfMacSchedSapProvider
();
73
74
friend
class
RrSchedulerMemberCschedSapProvider
;
75
friend
class
RrSchedulerMemberSchedSapProvider
;
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
85
void
DoCschedCellConfigReq
(
const
struct
FfMacCschedSapProvider::CschedCellConfigReqParameters
& params);
86
87
void
DoCschedUeConfigReq
(
const
struct
FfMacCschedSapProvider::CschedUeConfigReqParameters
& params);
88
89
void
DoCschedLcConfigReq
(
const
struct
FfMacCschedSapProvider::CschedLcConfigReqParameters
& params);
90
91
void
DoCschedLcReleaseReq
(
const
struct
FfMacCschedSapProvider::CschedLcReleaseReqParameters
& params);
92
93
void
DoCschedUeReleaseReq
(
const
struct
FfMacCschedSapProvider::CschedUeReleaseReqParameters
& params);
94
95
//
96
// Implementation of the SCHED API primitives
97
// (See 4.2 for description of the primitives)
98
//
99
100
void
DoSchedDlRlcBufferReq
(
const
struct
FfMacSchedSapProvider::SchedDlRlcBufferReqParameters
& params);
101
102
void
DoSchedDlPagingBufferReq
(
const
struct
FfMacSchedSapProvider::SchedDlPagingBufferReqParameters
& params);
103
104
void
DoSchedDlMacBufferReq
(
const
struct
FfMacSchedSapProvider::SchedDlMacBufferReqParameters
& params);
105
106
void
DoSchedDlTriggerReq
(
const
struct
FfMacSchedSapProvider::SchedDlTriggerReqParameters
& params);
107
108
void
DoSchedDlRachInfoReq
(
const
struct
FfMacSchedSapProvider::SchedDlRachInfoReqParameters
& params);
109
110
void
DoSchedDlCqiInfoReq
(
const
struct
FfMacSchedSapProvider::SchedDlCqiInfoReqParameters
& params);
111
112
void
DoSchedUlTriggerReq
(
const
struct
FfMacSchedSapProvider::SchedUlTriggerReqParameters
& params);
113
114
void
DoSchedUlNoiseInterferenceReq
(
const
struct
FfMacSchedSapProvider::SchedUlNoiseInterferenceReqParameters
& params);
115
116
void
DoSchedUlSrInfoReq
(
const
struct
FfMacSchedSapProvider::SchedUlSrInfoReqParameters
& params);
117
118
void
DoSchedUlMacCtrlInfoReq
(
const
struct
FfMacSchedSapProvider::SchedUlMacCtrlInfoReqParameters
& params);
119
120
void
DoSchedUlCqiInfoReq
(
const
struct
FfMacSchedSapProvider::SchedUlCqiInfoReqParameters
& params);
121
122
123
int
GetRbgSize
(
int
dlbandwidth);
124
125
static
bool
SortRlcBufferReq
(
FfMacSchedSapProvider::SchedDlRlcBufferReqParameters
i,
FfMacSchedSapProvider::SchedDlRlcBufferReqParameters
j);
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
133
Ptr<LteAmc>
m_amc
;
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
172
FfMacCschedSapUser
*
m_cschedSapUser
;
173
FfMacSchedSapUser
*
m_schedSapUser
;
174
FfMacCschedSapProvider
*
m_cschedSapProvider
;
175
FfMacSchedSapProvider
*
m_schedSapProvider
;
176
177
178
// Internal parameters
179
FfMacCschedSapProvider::CschedCellConfigReqParameters
m_cschedCellConfig
;
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 */
src
lte
model
rr-ff-mac-scheduler.h
Generated on Fri Dec 21 2012 19:00:40 for ns-3 by
1.8.1.2