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
lte-ue-phy.h
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2010 TELEMATICS LAB, DEE - Politecnico di Bari
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: Giuseppe Piro <g.piro@poliba.it>
19
* Author: Marco Miozzo <mmiozzo@cttc.es>
20
*/
21
22
#ifndef LTE_UE_PHY_H
23
#define LTE_UE_PHY_H
24
25
26
#include <ns3/lte-phy.h>
27
#include <ns3/ff-mac-common.h>
28
29
#include <ns3/lte-control-messages.h>
30
#include <ns3/lte-amc.h>
31
#include <ns3/lte-ue-phy-sap.h>
32
#include <ns3/lte-ue-cphy-sap.h>
33
#include <ns3/ptr.h>
34
#include <ns3/lte-amc.h>
35
36
37
namespace
ns3 {
38
39
class
PacketBurst;
40
class
LteEnbPhy;
41
class
LteHarqPhy;
42
43
49
class
LteUePhy
:
public
LtePhy
50
{
51
52
friend
class
UeMemberLteUePhySapProvider
;
53
friend
class
MemberLteUeCphySapProvider
<
LteUePhy
>;
54
55
public
:
59
LteUePhy
();
60
66
LteUePhy
(
Ptr<LteSpectrumPhy>
dlPhy,
Ptr<LteSpectrumPhy>
ulPhy);
67
68
virtual
~LteUePhy
();
69
70
// inherited from Object
71
static
TypeId
GetTypeId
(
void
);
72
virtual
void
DoInitialize
(
void
);
73
virtual
void
DoDispose
(
void
);
74
79
LteUePhySapProvider
*
GetLteUePhySapProvider
();
80
85
void
SetLteUePhySapUser
(
LteUePhySapUser
*
s
);
86
91
LteUeCphySapProvider
*
GetLteUeCphySapProvider
();
92
97
void
SetLteUeCphySapUser
(
LteUeCphySapUser
*
s
);
98
99
103
void
SetTxPower
(
double
pow);
104
108
double
GetTxPower
()
const
;
112
void
SetNoiseFigure
(
double
pow);
113
117
double
GetNoiseFigure
()
const
;
118
122
uint8_t
GetMacChDelay
(
void
)
const
;
123
127
Ptr<LteSpectrumPhy>
GetDlSpectrumPhy
()
const
;
128
132
Ptr<LteSpectrumPhy>
GetUlSpectrumPhy
()
const
;
133
134
139
virtual
Ptr<SpectrumValue>
CreateTxPowerSpectralDensity
();
140
145
void
SetSubChannelsForTransmission
(std::vector <int> mask);
150
std::vector <int>
GetSubChannelsForTransmission
(
void
);
151
156
void
SetSubChannelsForReception
(std::vector <int> mask);
161
std::vector <int>
GetSubChannelsForReception
(
void
);
162
163
169
Ptr<DlCqiLteControlMessage>
CreateDlCqiFeedbackMessage
(
const
SpectrumValue
& sinr);
170
171
172
173
// inherited from LtePhy
174
virtual
void
GenerateCtrlCqiReport
(
const
SpectrumValue
& sinr);
175
virtual
void
GenerateDataCqiReport
(
const
SpectrumValue
& sinr);
176
virtual
void
ReportInterference
(
const
SpectrumValue
& interf);
177
virtual
void
ReportRsReceivedPower
(
const
SpectrumValue
& power);
178
179
// callbacks for LteSpectrumPhy
180
virtual
void
ReceiveLteControlMessageList
(
std::list
<
Ptr<LteControlMessage>
>);
181
virtual
void
ReceivePss
(uint16_t cellId,
Ptr<SpectrumValue>
p);
182
183
184
185
186
190
void
PhyPduReceived
(
Ptr<Packet>
p);
191
192
199
void
SubframeIndication
(uint32_t frameNo, uint32_t subframeNo);
200
201
205
void
SendSrs
();
206
210
virtual
void
ReceiveLteDlHarqFeedback
(
DlInfoListElement_s
mes);
211
215
void
SetHarqPhyModule
(
Ptr<LteHarqPhy>
harq);
216
217
218
219
220
private
:
221
222
void
SetTxMode1Gain
(
double
gain);
223
void
SetTxMode2Gain
(
double
gain);
224
void
SetTxMode3Gain
(
double
gain);
225
void
SetTxMode4Gain
(
double
gain);
226
void
SetTxMode5Gain
(
double
gain);
227
void
SetTxMode6Gain
(
double
gain);
228
void
SetTxMode7Gain
(
double
gain);
229
void
SetTxModeGain
(uint8_t txMode,
double
gain);
230
231
void
QueueSubChannelsForTransmission
(std::vector <int> rbMap);
232
233
void
ReportUeMeasurements
();
234
235
// UE CPHY SAP methods
236
void
DoReset
();
237
void
DoSyncronizeWithEnb
(uint16_t cellId, uint16_t dlEarfcn);
238
void
DoSetDlBandwidth
(uint8_t ulBandwidth);
239
void
DoConfigureUplink
(uint16_t ulEarfcn, uint8_t ulBandwidth);
240
void
DoSetRnti
(uint16_t rnti);
241
void
DoSetTransmissionMode
(uint8_t txMode);
242
void
DoSetSrsConfigurationIndex
(uint16_t srcCi);
243
244
// UE PHY SAP methods
245
virtual
void
DoSendMacPdu
(
Ptr<Packet>
p);
246
virtual
void
DoSendLteControlMessage
(
Ptr<LteControlMessage>
msg);
247
virtual
void
DoSendRachPreamble
(uint32_t prachId, uint32_t raRnti);
248
249
std::vector <int>
m_subChannelsForTransmission
;
250
std::vector <int>
m_subChannelsForReception
;
251
252
std::vector< std::vector <int> >
m_subChannelsForTransmissionQueue
;
253
254
255
Ptr<LteAmc>
m_amc
;
256
257
Time
m_p10CqiPeriocity
;
258
Time
m_p10CqiLast
;
259
261
// NOTE defines a periodicity for academic studies
262
Time
m_a30CqiPeriocity
;
263
Time
m_a30CqiLast
;
264
265
LteUePhySapProvider
*
m_uePhySapProvider
;
266
LteUePhySapUser
*
m_uePhySapUser
;
267
268
LteUeCphySapProvider
*
m_ueCphySapProvider
;
269
LteUeCphySapUser
*
m_ueCphySapUser
;
270
271
uint16_t
m_rnti
;
272
273
uint8_t
m_transmissionMode
;
274
std::vector <double>
m_txModeGain
;
275
276
uint16_t
m_srsPeriodicity
;
277
uint16_t
m_srsSubframeOffset
;
278
uint16_t
m_srsConfigured
;
279
Time
m_srsStartTime
;
280
281
bool
m_dlConfigured
;
282
bool
m_ulConfigured
;
283
284
uint8_t
m_subframeNo
;
285
286
bool
m_rsReceivedPowerUpdated
;
287
SpectrumValue
m_rsReceivedPower
;
288
289
bool
m_rsInterferencePowerUpdated
;
290
SpectrumValue
m_rsIntereferencePower
;
291
292
bool
m_pssReceived
;
293
struct
PssElement
294
{
295
uint16_t
cellId
;
296
double
pssPsdSum
;
297
uint16_t
nRB
;
298
};
299
std::list <PssElement>
m_pssList
;
300
301
double
m_pssReceptionThreshold
;
// on RSRQ [W]
302
303
struct
UeMeasurementsElement
304
{
305
double
rsrpSum
;
306
uint8_t
rsrpNum
;
307
double
rsrqSum
;
308
uint8_t
rsrqNum
;
309
};
310
311
std::map <uint16_t, UeMeasurementsElement>
m_UeMeasurementsMap
;
312
Time
m_ueMeasurementsFilterPeriod
;
313
Time
m_ueMeasurementsFilterLast
;
314
315
Ptr<LteHarqPhy>
m_harqPhyModule
;
316
317
uint32_t
m_raPreambleId
;
318
uint32_t
m_raRnti
;
319
324
TracedCallback<uint16_t, uint16_t, double, double>
m_reportCurrentCellRsrpSinrTrace
;
325
uint16_t
m_rsrpSinrSamplePeriod
;
326
uint16_t
m_rsrpSinrSampleCounter
;
327
332
TracedCallback<uint16_t, uint16_t, double, double, bool>
m_reportUeMeasurements
;
333
334
EventId
m_sendSrsEvent
;
335
340
TracedCallback<PhyTransmissionStatParameters>
m_ulPhyTransmission
;
341
342
};
343
344
345
}
346
347
#endif
/* LTE_UE_PHY_H */
src
lte
model
lte-ue-phy.h
Generated on Fri Aug 30 2013 01:42:56 for ns-3 by
1.8.1.2