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-rrc.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: Nicola Baldo <nbaldo@cttc.es>
19
*/
20
21
#ifndef LTE_UE_RRC_H
22
#define LTE_UE_RRC_H
23
24
#include <ns3/object.h>
25
#include <ns3/packet.h>
26
#include <ns3/lte-ue-cmac-sap.h>
27
#include <ns3/lte-pdcp-sap.h>
28
#include <ns3/lte-as-sap.h>
29
#include <ns3/lte-ue-cphy-sap.h>
30
#include <ns3/lte-rrc-sap.h>
31
#include <ns3/traced-callback.h>
32
33
#include <map>
34
#include <set>
35
36
namespace
ns3 {
37
38
class
LteRlc;
39
class
LteMacSapProvider;
40
class
LteUeCmacSapUser;
41
class
LteUeCmacSapProvider;
42
class
LteDataRadioBearerInfo;
43
class
LteSignalingRadioBearerInfo;
44
class
LteEnbRrc;
45
50
class
LteUeRrc
:
public
Object
51
{
52
53
friend
class
UeMemberLteUeCmacSapUser
;
54
friend
class
UeRrcMemberLteEnbCmacSapUser
;
55
friend
class
LtePdcpSpecificLtePdcpSapUser
<
LteUeRrc
>;
56
friend
class
MemberLteAsSapProvider
<
LteUeRrc
>;
57
friend
class
MemberLteUeCphySapUser
<
LteUeRrc
>;
58
friend
class
MemberLteUeRrcSapProvider
<
LteUeRrc
>;
59
60
public
:
61
66
enum
State
67
{
68
IDLE_CELL_SELECTION
= 0,
69
IDLE_WAIT_SYSTEM_INFO
,
70
IDLE_CAMPED_NORMALLY
,
71
IDLE_RANDOM_ACCESS
,
72
IDLE_CONNECTING
,
73
CONNECTED_NORMALLY
,
74
CONNECTED_REESTABLISHING
,
75
CONNECTED_HANDOVER
,
76
NUM_STATES
77
};
78
79
84
LteUeRrc
();
85
86
90
virtual
~LteUeRrc
();
91
92
93
// inherited from Object
94
private
:
95
virtual
void
DoInitialize
(
void
);
96
virtual
void
DoDispose
(
void
);
97
public
:
98
static
TypeId
GetTypeId
(
void
);
99
100
106
void
SetLteUeCphySapProvider
(
LteUeCphySapProvider
*
s
);
107
113
LteUeCphySapUser
*
GetLteUeCphySapUser
();
114
120
void
SetLteUeCmacSapProvider
(
LteUeCmacSapProvider
*
s
);
121
127
LteUeCmacSapUser
*
GetLteUeCmacSapUser
();
128
129
135
void
SetLteUeRrcSapUser
(
LteUeRrcSapUser
*
s
);
136
142
LteUeRrcSapProvider
*
GetLteUeRrcSapProvider
();
143
151
void
SetLteMacSapProvider
(
LteMacSapProvider
*
s
);
152
158
void
SetAsSapUser
(
LteAsSapUser
*
s
);
159
165
LteAsSapProvider
*
GetAsSapProvider
();
166
171
void
SetImsi
(uint64_t imsi);
172
177
uint64_t
GetImsi
(
void
);
178
179
184
uint16_t
GetRnti
()
const
;
185
186
191
uint16_t
GetCellId
()
const
;
192
193
197
uint8_t
GetUlBandwidth
()
const
;
198
202
uint8_t
GetDlBandwidth
()
const
;
203
207
uint16_t
GetDlEarfcn
()
const
;
208
212
uint16_t
GetUlEarfcn
()
const
;
213
218
State
GetState
();
219
225
void
SetUseRlcSm
(
bool
val);
226
227
228
private
:
229
230
231
// PDCP SAP methods
232
void
DoReceivePdcpSdu
(
LtePdcpSapUser::ReceivePdcpSduParameters
params);
233
234
// CMAC SAP methods
235
void
DoSetTemporaryCellRnti
(uint16_t rnti);
236
void
DoNotifyRandomAccessSuccessful
();
237
void
DoNotifyRandomAccessFailed
();
238
239
// LTE AS SAP methods
240
void
DoForceCampedOnEnb
(uint16_t cellId, uint16_t earfcn);
241
void
DoConnect
();
242
void
DoSendData
(
Ptr<Packet>
packet, uint8_t bid);
243
void
DoDisconnect
();
244
245
// CPHY SAP methods
246
void
DoRecvMasterInformationBlock
(
LteRrcSap::MasterInformationBlock
msg);
247
void
DoReportUeMeasurements
(
LteUeCphySapUser::UeMeasurementsParameters
params);
248
249
// RRC SAP methods
250
void
DoCompleteSetup
(
LteUeRrcSapProvider::CompleteSetupParameters
params);
251
void
DoRecvSystemInformationBlockType1
(
LteRrcSap::SystemInformationBlockType1
msg);
252
void
DoRecvSystemInformation
(
LteRrcSap::SystemInformation
msg);
253
void
DoRecvRrcConnectionSetup
(
LteRrcSap::RrcConnectionSetup
msg);
254
void
DoRecvRrcConnectionReconfiguration
(
LteRrcSap::RrcConnectionReconfiguration
msg);
255
void
DoRecvRrcConnectionReestablishment
(
LteRrcSap::RrcConnectionReestablishment
msg);
256
void
DoRecvRrcConnectionReestablishmentReject
(
LteRrcSap::RrcConnectionReestablishmentReject
msg);
257
void
DoRecvRrcConnectionRelease
(
LteRrcSap::RrcConnectionRelease
msg);
258
void
DoRecvRrcConnectionReject
(
LteRrcSap::RrcConnectionReject
msg);
259
260
261
// internal methods
262
void
ApplyRadioResourceConfigDedicated
(
LteRrcSap::RadioResourceConfigDedicated
rrcd);
263
void
ApplyMeasConfig
(
LteRrcSap::MeasConfig
mc);
264
void
SendMeasurementReport
(uint8_t measId);
265
void
StartConnection
();
266
void
LeaveConnectedMode
();
267
void
DisposeOldSrb1
();
268
uint8_t
Bid2Drbid
(uint8_t bid);
269
void
SwitchToState
(
State
s
);
270
271
std::map<uint8_t, uint8_t>
m_bid2DrbidMap
;
272
273
LteUeCphySapUser
*
m_cphySapUser
;
274
LteUeCphySapProvider
*
m_cphySapProvider
;
275
276
LteUeCmacSapUser
*
m_cmacSapUser
;
277
LteUeCmacSapProvider
*
m_cmacSapProvider
;
278
279
LteUeRrcSapUser
*
m_rrcSapUser
;
280
LteUeRrcSapProvider
*
m_rrcSapProvider
;
281
282
LteMacSapProvider
*
m_macSapProvider
;
283
LtePdcpSapUser
*
m_drbPdcpSapUser
;
284
285
LteAsSapProvider
*
m_asSapProvider
;
286
LteAsSapUser
*
m_asSapUser
;
287
288
State
m_state
;
289
290
uint64_t
m_imsi
;
291
uint16_t
m_rnti
;
292
uint16_t
m_cellId
;
293
294
Ptr<LteSignalingRadioBearerInfo>
m_srb0
;
295
Ptr<LteSignalingRadioBearerInfo>
m_srb1
;
296
Ptr<LteSignalingRadioBearerInfo>
m_srb1Old
;
297
std::map <uint8_t, Ptr<LteDataRadioBearerInfo> >
m_drbMap
;
298
299
bool
m_useRlcSm
;
300
301
uint8_t
m_lastRrcTransactionIdentifier
;
302
303
uint8_t
m_dlBandwidth
;
304
uint8_t
m_ulBandwidth
;
306
uint16_t
m_dlEarfcn
;
307
uint16_t
m_ulEarfcn
;
309
// imsi cellid rnti
310
TracedCallback<uint64_t, uint16_t, uint16_t, State, State>
m_stateTransitionTrace
;
311
// imsi cellid rnti
312
TracedCallback<uint64_t, uint16_t, uint16_t>
m_randomAccessSuccessfulTrace
;
313
// imsi cellid rnti
314
TracedCallback<uint64_t, uint16_t, uint16_t>
m_connectionEstablishedTrace
;
315
// imsi cellid rnti
316
TracedCallback<uint64_t, uint16_t, uint16_t>
m_connectionReconfigurationTrace
;
317
// imsi cellid rnti targetCellId
318
TracedCallback<uint64_t, uint16_t, uint16_t, uint16_t>
m_handoverStartTrace
;
319
// imsi cellid rnti
320
TracedCallback<uint64_t, uint16_t, uint16_t>
m_handoverEndOkTrace
;
321
322
bool
m_connectionPending
;
323
bool
m_receivedMib
;
324
bool
m_receivedSib2
;
333
struct
VarMeasConfig
334
{
335
std::map<uint8_t, LteRrcSap::MeasIdToAddMod>
measIdList
;
336
std::map<uint8_t, LteRrcSap::MeasObjectToAddMod>
measObjectList
;
337
std::map<uint8_t, LteRrcSap::ReportConfigToAddMod>
reportConfigList
;
338
LteRrcSap::QuantityConfig
quantityConfig
;
339
double
aRsrp
;
340
double
aRsrq
;
341
};
342
343
struct
VarMeasReport
344
{
345
uint8_t
measId
;
346
std::set<uint16_t>
cellsTriggeredList
;
// note: only EUTRA is
347
// supported
348
uint32_t
numberOfReportsSent
;
349
EventId
periodicReportTimer
;
350
};
351
352
VarMeasConfig
m_varMeasConfig
;
353
// measId
354
std::map<uint8_t, VarMeasReport>
m_varMeasReportList
;
355
356
struct
MeasValues
357
{
358
double
rsrp
;
359
double
rsrq
;
360
Time
timestamp
;
361
};
362
364
std::map<uint16_t, MeasValues>
m_storedMeasValues
;
365
366
367
};
368
369
370
}
// namespace ns3
371
372
#endif // LTE_UE_RRC_H
src
lte
model
lte-ue-rrc.h
Generated on Fri Aug 30 2013 01:42:56 for ns-3 by
1.8.1.2