Bug Summary

File:/tmp/asd-nat/home/nat/Work/ns-3-dev-git/build/../src/lte/model/lte-enb-rrc.cc
Location:line 770, column 7
Description:Passed-by-value struct argument contains uninitialized data (e.g., field: 'targetCellId')

Annotated Source Code

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 * Authors: Nicola Baldo <nbaldo@cttc.es>
19 * Marco Miozzo <mmiozzo@cttc.es>
20 * Manuel Requena <manuel.requena@cttc.es>
21 * Modified by: Danilo Abrignani <danilo.abrignani@unibo.it> (Carrier Aggregation - GSoC 2015),
22 * Biljana Bojovic <biljana.bojovic@cttc.es> (Carrier Aggregation)
23 */
24
25#include "lte-enb-rrc.h"
26
27#include <ns3/fatal-error.h>
28#include <ns3/log.h>
29#include <ns3/abort.h>
30
31#include <ns3/pointer.h>
32#include <ns3/object-map.h>
33#include <ns3/object-factory.h>
34#include <ns3/simulator.h>
35
36#include <ns3/lte-radio-bearer-info.h>
37#include <ns3/eps-bearer-tag.h>
38#include <ns3/packet.h>
39
40#include <ns3/lte-rlc.h>
41#include <ns3/lte-rlc-tm.h>
42#include <ns3/lte-rlc-um.h>
43#include <ns3/lte-rlc-am.h>
44#include <ns3/lte-pdcp.h>
45
46
47
48
49namespace ns3 {
50
51NS_LOG_COMPONENT_DEFINE ("LteEnbRrc")static ns3::LogComponent g_log = ns3::LogComponent ("LteEnbRrc"
, "../src/lte/model/lte-enb-rrc.cc")
;
52
53///////////////////////////////////////////
54// CMAC SAP forwarder
55///////////////////////////////////////////
56
57/**
58 * \brief Class for forwarding CMAC SAP User functions.
59 */
60class EnbRrcMemberLteEnbCmacSapUser : public LteEnbCmacSapUser
61{
62public:
63 EnbRrcMemberLteEnbCmacSapUser (LteEnbRrc* rrc);
64
65 virtual uint16_t AllocateTemporaryCellRnti ();
66 virtual void NotifyLcConfigResult (uint16_t rnti, uint8_t lcid, bool success);
67 virtual void RrcConfigurationUpdateInd (UeConfig params);
68
69private:
70 LteEnbRrc* m_rrc;
71};
72
73EnbRrcMemberLteEnbCmacSapUser::EnbRrcMemberLteEnbCmacSapUser (LteEnbRrc* rrc)
74 : m_rrc (rrc)
75{
76}
77
78uint16_t
79EnbRrcMemberLteEnbCmacSapUser::AllocateTemporaryCellRnti ()
80{
81 return m_rrc->DoAllocateTemporaryCellRnti ();
82}
83
84void
85EnbRrcMemberLteEnbCmacSapUser::NotifyLcConfigResult (uint16_t rnti, uint8_t lcid, bool success)
86{
87 m_rrc->DoNotifyLcConfigResult (rnti, lcid, success);
88}
89
90void
91EnbRrcMemberLteEnbCmacSapUser::RrcConfigurationUpdateInd (UeConfig params)
92{
93 m_rrc->DoRrcConfigurationUpdateInd (params);
94}
95
96
97
98///////////////////////////////////////////
99// UeManager
100///////////////////////////////////////////
101
102
103/// Map each of UE Manager states to its string representation.
104static const std::string g_ueManagerStateName[UeManager::NUM_STATES] =
105{
106 "INITIAL_RANDOM_ACCESS",
107 "CONNECTION_SETUP",
108 "CONNECTION_REJECTED",
109 "CONNECTED_NORMALLY",
110 "CONNECTION_RECONFIGURATION",
111 "CONNECTION_REESTABLISHMENT",
112 "HANDOVER_PREPARATION",
113 "HANDOVER_JOINING",
114 "HANDOVER_PATH_SWITCH",
115 "HANDOVER_LEAVING",
116};
117
118/**
119 * \param s The UE manager state.
120 * \return The string representation of the given state.
121 */
122static const std::string & ToString (UeManager::State s)
123{
124 return g_ueManagerStateName[s];
125}
126
127
128NS_OBJECT_ENSURE_REGISTERED (UeManager)static struct ObjectUeManagerRegistrationClass { ObjectUeManagerRegistrationClass
() { ns3::TypeId tid = UeManager::GetTypeId (); tid.SetSize (
sizeof (UeManager)); tid.GetParent (); } } ObjectUeManagerRegistrationVariable
;
129
130
131UeManager::UeManager ()
132{
133 NS_FATAL_ERROR ("this constructor is not espected to be used")do { std::cerr << "msg=\"" << "this constructor is not espected to be used"
<< "\", "; do { std::cerr << "file=" << "../src/lte/model/lte-enb-rrc.cc"
<< ", line=" << 133 << std::endl; ::ns3::FatalImpl
::FlushStreams (); if (true) std::terminate (); } while (false
); } while (false)
;
134}
135
136
137UeManager::UeManager (Ptr<LteEnbRrc> rrc, uint16_t rnti, State s)
138 : m_lastAllocatedDrbid (0),
139 m_rnti (rnti),
140 m_imsi (0),
141 m_lastRrcTransactionIdentifier (0),
142 m_rrc (rrc),
143 m_state (s),
144 m_pendingRrcConnectionReconfiguration (false),
145 m_sourceX2apId (0),
146 m_sourceCellId (0),
147 m_needPhyMacConfiguration (false),
148 m_caSupportConfigured (false),
149 m_pendingStartDataRadioBearers (false)
150{
151 NS_LOG_FUNCTION (this)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this; std::clog << ")" << std::endl; } } while (
false)
;
152}
153
154void
155UeManager::DoInitialize ()
156{
157 NS_LOG_FUNCTION (this)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this; std::clog << ")" << std::endl; } } while (
false)
;
158 m_drbPdcpSapUser = new LtePdcpSpecificLtePdcpSapUser<UeManager> (this);
159
160 m_physicalConfigDedicated.haveAntennaInfoDedicated = true;
161 m_physicalConfigDedicated.antennaInfo.transmissionMode = m_rrc->m_defaultTransmissionMode;
162 m_physicalConfigDedicated.haveSoundingRsUlConfigDedicated = true;
163 m_physicalConfigDedicated.soundingRsUlConfigDedicated.srsConfigIndex = m_rrc->GetNewSrsConfigurationIndex ();
164 m_physicalConfigDedicated.soundingRsUlConfigDedicated.type = LteRrcSap::SoundingRsUlConfigDedicated::SETUP;
165 m_physicalConfigDedicated.soundingRsUlConfigDedicated.srsBandwidth = 0;
166 m_physicalConfigDedicated.havePdschConfigDedicated = true;
167 m_physicalConfigDedicated.pdschConfigDedicated.pa = LteRrcSap::PdschConfigDedicated::dB0;
168
169
170 for (uint8_t i = 0; i < m_rrc->m_numberOfComponentCarriers; i++)
171 {
172 m_rrc->m_cmacSapProvider.at (i)->AddUe (m_rnti);
173 m_rrc->m_cphySapProvider.at (i)->AddUe (m_rnti);
174 }
175
176 // setup the eNB side of SRB0
177 {
178 uint8_t lcid = 0;
179
180 Ptr<LteRlc> rlc = CreateObject<LteRlcTm> ()->GetObject<LteRlc> ();
181 rlc->SetLteMacSapProvider (m_rrc->m_macSapProvider);
182 rlc->SetRnti (m_rnti);
183 rlc->SetLcId (lcid);
184
185 m_srb0 = CreateObject<LteSignalingRadioBearerInfo> ();
186 m_srb0->m_rlc = rlc;
187 m_srb0->m_srbIdentity = 0;
188 // no need to store logicalChannelConfig as SRB0 is pre-configured
189
190 LteEnbCmacSapProvider::LcInfo lcinfo;
191 lcinfo.rnti = m_rnti;
192 lcinfo.lcId = lcid;
193 // leave the rest of lcinfo empty as CCCH (LCID 0) is pre-configured
194 // MacSapUserForRlc in the ComponentCarrierManager MacSapUser
195 LteMacSapUser* lteMacSapUser = m_rrc->m_ccmRrcSapProvider->ConfigureSignalBearer(lcinfo, rlc->GetLteMacSapUser ());
196 // Signal Channel are only on Primary Carrier
197 m_rrc->m_cmacSapProvider.at (0)->AddLc (lcinfo, lteMacSapUser);
198 m_rrc->m_ccmRrcSapProvider->AddLc (lcinfo, lteMacSapUser);
199 }
200
201 // setup the eNB side of SRB1; the UE side will be set up upon RRC connection establishment
202 {
203 uint8_t lcid = 1;
204
205 Ptr<LteRlc> rlc = CreateObject<LteRlcAm> ()->GetObject<LteRlc> ();
206 rlc->SetLteMacSapProvider (m_rrc->m_macSapProvider);
207 rlc->SetRnti (m_rnti);
208 rlc->SetLcId (lcid);
209
210 Ptr<LtePdcp> pdcp = CreateObject<LtePdcp> ();
211 pdcp->SetRnti (m_rnti);
212 pdcp->SetLcId (lcid);
213 pdcp->SetLtePdcpSapUser (m_drbPdcpSapUser);
214 pdcp->SetLteRlcSapProvider (rlc->GetLteRlcSapProvider ());
215 rlc->SetLteRlcSapUser (pdcp->GetLteRlcSapUser ());
216
217 m_srb1 = CreateObject<LteSignalingRadioBearerInfo> ();
218 m_srb1->m_rlc = rlc;
219 m_srb1->m_pdcp = pdcp;
220 m_srb1->m_srbIdentity = 1;
221 m_srb1->m_logicalChannelConfig.priority = 0;
222 m_srb1->m_logicalChannelConfig.prioritizedBitRateKbps = 100;
223 m_srb1->m_logicalChannelConfig.bucketSizeDurationMs = 100;
224 m_srb1->m_logicalChannelConfig.logicalChannelGroup = 0;
225
226 LteEnbCmacSapProvider::LcInfo lcinfo;
227 lcinfo.rnti = m_rnti;
228 lcinfo.lcId = lcid;
229 lcinfo.lcGroup = 0; // all SRBs always mapped to LCG 0
230 lcinfo.qci = EpsBearer::GBR_CONV_VOICE; // not sure why the FF API requires a CQI even for SRBs...
231 lcinfo.isGbr = true;
232 lcinfo.mbrUl = 1e6;
233 lcinfo.mbrDl = 1e6;
234 lcinfo.gbrUl = 1e4;
235 lcinfo.gbrDl = 1e4;
236 // MacSapUserForRlc in the ComponentCarrierManager MacSapUser
237 LteMacSapUser* MacSapUserForRlc = m_rrc->m_ccmRrcSapProvider->ConfigureSignalBearer(lcinfo, rlc->GetLteMacSapUser ());
238 // Signal Channel are only on Primary Carrier
239 m_rrc->m_cmacSapProvider.at (0)->AddLc (lcinfo, MacSapUserForRlc);
240 m_rrc->m_ccmRrcSapProvider->AddLc (lcinfo, MacSapUserForRlc);
241 }
242
243 LteEnbRrcSapUser::SetupUeParameters ueParams;
244 ueParams.srb0SapProvider = m_srb0->m_rlc->GetLteRlcSapProvider ();
245 ueParams.srb1SapProvider = m_srb1->m_pdcp->GetLtePdcpSapProvider ();
246 m_rrc->m_rrcSapUser->SetupUe (m_rnti, ueParams);
247
248 // configure MAC (and scheduler)
249 LteEnbCmacSapProvider::UeConfig req;
250 req.m_rnti = m_rnti;
251 req.m_transmissionMode = m_physicalConfigDedicated.antennaInfo.transmissionMode;
252
253 // configure PHY
254 for (uint16_t i = 0; i < m_rrc->m_numberOfComponentCarriers; i++)
255 {
256 m_rrc->m_cmacSapProvider.at (i)->UeUpdateConfigurationReq (req);
257 m_rrc->m_cphySapProvider.at (i)->SetTransmissionMode (m_rnti, m_physicalConfigDedicated.antennaInfo.transmissionMode);
258 m_rrc->m_cphySapProvider.at (i)->SetSrsConfigurationIndex (m_rnti, m_physicalConfigDedicated.soundingRsUlConfigDedicated.srsConfigIndex);
259 }
260 // schedule this UeManager instance to be deleted if the UE does not give any sign of life within a reasonable time
261 Time maxConnectionDelay;
262 switch (m_state)
263 {
264 case INITIAL_RANDOM_ACCESS:
265 m_connectionRequestTimeout = Simulator::Schedule (m_rrc->m_connectionRequestTimeoutDuration,
266 &LteEnbRrc::ConnectionRequestTimeout,
267 m_rrc, m_rnti);
268 break;
269
270 case HANDOVER_JOINING:
271 m_handoverJoiningTimeout = Simulator::Schedule (m_rrc->m_handoverJoiningTimeoutDuration,
272 &LteEnbRrc::HandoverJoiningTimeout,
273 m_rrc, m_rnti);
274 break;
275
276 default:
277 NS_FATAL_ERROR ("unexpected state " << ToString (m_state))do { std::cerr << "msg=\"" << "unexpected state "
<< ToString (m_state) << "\", "; do { std::cerr <<
"file=" << "../src/lte/model/lte-enb-rrc.cc" << ", line="
<< 277 << std::endl; ::ns3::FatalImpl::FlushStreams
(); if (true) std::terminate (); } while (false); } while (false
)
;
278 break;
279 }
280 m_caSupportConfigured = false;
281}
282
283
284UeManager::~UeManager (void)
285{
286}
287
288void
289UeManager::DoDispose ()
290{
291 delete m_drbPdcpSapUser;
292 // delete eventual X2-U TEIDs
293 for (std::map <uint8_t, Ptr<LteDataRadioBearerInfo> >::iterator it = m_drbMap.begin ();
294 it != m_drbMap.end ();
295 ++it)
296 {
297 m_rrc->m_x2uTeidInfoMap.erase (it->second->m_gtpTeid);
298 }
299
300}
301
302TypeId UeManager::GetTypeId (void)
303{
304 static TypeId tid = TypeId ("ns3::UeManager")
305 .SetParent<Object> ()
306 .AddConstructor<UeManager> ()
307 .AddAttribute ("DataRadioBearerMap", "List of UE DataRadioBearerInfo by DRBID.",
308 ObjectMapValue (),
309 MakeObjectMapAccessor (&UeManager::m_drbMap),
310 MakeObjectMapChecker<LteDataRadioBearerInfo> ())
311 .AddAttribute ("Srb0", "SignalingRadioBearerInfo for SRB0",
312 PointerValue (),
313 MakePointerAccessor (&UeManager::m_srb0),
314 MakePointerChecker<LteSignalingRadioBearerInfo> ())
315 .AddAttribute ("Srb1", "SignalingRadioBearerInfo for SRB1",
316 PointerValue (),
317 MakePointerAccessor (&UeManager::m_srb1),
318 MakePointerChecker<LteSignalingRadioBearerInfo> ())
319 .AddAttribute ("C-RNTI",
320 "Cell Radio Network Temporary Identifier",
321 TypeId::ATTR_GET, // read-only attribute
322 UintegerValue (0), // unused, read-only attribute
323 MakeUintegerAccessor (&UeManager::m_rnti),
324 MakeUintegerChecker<uint16_t> ())
325 .AddTraceSource ("StateTransition",
326 "fired upon every UE state transition seen by the "
327 "UeManager at the eNB RRC",
328 MakeTraceSourceAccessor (&UeManager::m_stateTransitionTrace),
329 "ns3::UeManager::StateTracedCallback")
330 ;
331 return tid;
332}
333
334void
335UeManager::SetSource (uint16_t sourceCellId, uint16_t sourceX2apId)
336{
337 m_sourceX2apId = sourceX2apId;
338 m_sourceCellId = sourceCellId;
339}
340
341void
342UeManager::SetImsi (uint64_t imsi)
343{
344 m_imsi = imsi;
345}
346
347void
348UeManager::SetupDataRadioBearer (EpsBearer bearer, uint8_t bearerId, uint32_t gtpTeid, Ipv4Address transportLayerAddress)
349{
350 NS_LOG_FUNCTION (this << (uint32_t) m_rnti)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this << (uint32_t) m_rnti; std::clog << ")" <<
std::endl; } } while (false)
;
351
352 Ptr<LteDataRadioBearerInfo> drbInfo = CreateObject<LteDataRadioBearerInfo> ();
353 uint8_t drbid = AddDataRadioBearerInfo (drbInfo);
354 uint8_t lcid = Drbid2Lcid (drbid);
355 uint8_t bid = Drbid2Bid (drbid);
356 NS_ASSERT_MSG ( bearerId == 0 || bid == bearerId, "bearer ID mismatch (" << (uint32_t) bid << " != " << (uint32_t) bearerId << ", the assumption that ID are allocated in the same way by MME and RRC is not valid any more")do { if (!(bearerId == 0 || bid == bearerId)) { std::cerr <<
"assert failed. cond=\"" << "bearerId == 0 || bid == bearerId"
<< "\", "; do { std::cerr << "msg=\"" << "bearer ID mismatch ("
<< (uint32_t) bid << " != " << (uint32_t) bearerId
<< ", the assumption that ID are allocated in the same way by MME and RRC is not valid any more"
<< "\", "; do { std::cerr << "file=" << "../src/lte/model/lte-enb-rrc.cc"
<< ", line=" << 356 << std::endl; ::ns3::FatalImpl
::FlushStreams (); if (true) std::terminate (); } while (false
); } while (false); } } while (false)
;
357 drbInfo->m_epsBearerIdentity = bid;
358 drbInfo->m_drbIdentity = drbid;
359 drbInfo->m_logicalChannelIdentity = lcid;
360 drbInfo->m_gtpTeid = gtpTeid;
361 drbInfo->m_transportLayerAddress = transportLayerAddress;
362
363 if (m_state == HANDOVER_JOINING)
364 {
365 // setup TEIDs for receiving data eventually forwarded over X2-U
366 LteEnbRrc::X2uTeidInfo x2uTeidInfo;
367 x2uTeidInfo.rnti = m_rnti;
368 x2uTeidInfo.drbid = drbid;
369 std::pair<std::map<uint32_t, LteEnbRrc::X2uTeidInfo>::iterator, bool>
370 ret = m_rrc->m_x2uTeidInfoMap.insert (std::pair<uint32_t, LteEnbRrc::X2uTeidInfo> (gtpTeid, x2uTeidInfo));
371 NS_ASSERT_MSG (ret.second == true, "overwriting a pre-existing entry in m_x2uTeidInfoMap")do { if (!(ret.second == true)) { std::cerr << "assert failed. cond=\""
<< "ret.second == true" << "\", "; do { std::cerr
<< "msg=\"" << "overwriting a pre-existing entry in m_x2uTeidInfoMap"
<< "\", "; do { std::cerr << "file=" << "../src/lte/model/lte-enb-rrc.cc"
<< ", line=" << 371 << std::endl; ::ns3::FatalImpl
::FlushStreams (); if (true) std::terminate (); } while (false
); } while (false); } } while (false)
;
372 }
373
374 TypeId rlcTypeId = m_rrc->GetRlcType (bearer);
375
376 ObjectFactory rlcObjectFactory;
377 rlcObjectFactory.SetTypeId (rlcTypeId);
378 Ptr<LteRlc> rlc = rlcObjectFactory.Create ()->GetObject<LteRlc> ();
379 rlc->SetLteMacSapProvider (m_rrc->m_macSapProvider);
380 rlc->SetRnti (m_rnti);
381
382 drbInfo->m_rlc = rlc;
383
384 rlc->SetLcId (lcid);
385
386 // we need PDCP only for real RLC, i.e., RLC/UM or RLC/AM
387 // if we are using RLC/SM we don't care of anything above RLC
388 if (rlcTypeId != LteRlcSm::GetTypeId ())
389 {
390 Ptr<LtePdcp> pdcp = CreateObject<LtePdcp> ();
391 pdcp->SetRnti (m_rnti);
392 pdcp->SetLcId (lcid);
393 pdcp->SetLtePdcpSapUser (m_drbPdcpSapUser);
394 pdcp->SetLteRlcSapProvider (rlc->GetLteRlcSapProvider ());
395 rlc->SetLteRlcSapUser (pdcp->GetLteRlcSapUser ());
396 drbInfo->m_pdcp = pdcp;
397 }
398
399 std::vector<LteCcmRrcSapProvider::LcsConfig> lcOnCcMapping = m_rrc->m_ccmRrcSapProvider->SetupDataRadioBearer (bearer, bearerId, m_rnti, lcid, m_rrc->GetLogicalChannelGroup (bearer), rlc->GetLteMacSapUser ());
400 // LteEnbCmacSapProvider::LcInfo lcinfo;
401 // lcinfo.rnti = m_rnti;
402 // lcinfo.lcId = lcid;
403 // lcinfo.lcGroup = m_rrc->GetLogicalChannelGroup (bearer);
404 // lcinfo.qci = bearer.qci;
405 // lcinfo.isGbr = bearer.IsGbr ();
406 // lcinfo.mbrUl = bearer.gbrQosInfo.mbrUl;
407 // lcinfo.mbrDl = bearer.gbrQosInfo.mbrDl;
408 // lcinfo.gbrUl = bearer.gbrQosInfo.gbrUl;
409 // lcinfo.gbrDl = bearer.gbrQosInfo.gbrDl;
410 // use a for cycle to send the AddLc to the appropriate Mac Sap
411 // if the sap is not initialized the appropriated method has to be called
412 std::vector<LteCcmRrcSapProvider::LcsConfig>::iterator itLcOnCcMapping = lcOnCcMapping.begin ();
413 NS_ASSERT_MSG (itLcOnCcMapping != lcOnCcMapping.end (), "Problem")do { if (!(itLcOnCcMapping != lcOnCcMapping.end ())) { std::cerr
<< "assert failed. cond=\"" << "itLcOnCcMapping != lcOnCcMapping.end ()"
<< "\", "; do { std::cerr << "msg=\"" << "Problem"
<< "\", "; do { std::cerr << "file=" << "../src/lte/model/lte-enb-rrc.cc"
<< ", line=" << 413 << std::endl; ::ns3::FatalImpl
::FlushStreams (); if (true) std::terminate (); } while (false
); } while (false); } } while (false)
;
414 for (itLcOnCcMapping = lcOnCcMapping.begin (); itLcOnCcMapping != lcOnCcMapping.end (); ++itLcOnCcMapping)
415 {
416 NS_LOG_DEBUG (this << " RNTI " << itLcOnCcMapping->lc.rnti << "Lcid " << (uint16_t) itLcOnCcMapping->lc.lcId << " lcGroup " << (uint16_t) itLcOnCcMapping->lc.lcGroup << " ComponentCarrierId " << itLcOnCcMapping->componentCarrierId)do { if (g_log.IsEnabled (ns3::LOG_DEBUG)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; if (g_log.IsEnabled (ns3::LOG_PREFIX_FUNC)) { std
::clog << g_log.Name () << ":" << __FUNCTION__
<< "(): "; }; if (g_log.IsEnabled (ns3::LOG_PREFIX_LEVEL
)) { std::clog << "[" << g_log.GetLevelLabel (ns3
::LOG_DEBUG) << "] "; }; std::clog << this <<
" RNTI " << itLcOnCcMapping->lc.rnti << "Lcid "
<< (uint16_t) itLcOnCcMapping->lc.lcId << " lcGroup "
<< (uint16_t) itLcOnCcMapping->lc.lcGroup << " ComponentCarrierId "
<< itLcOnCcMapping->componentCarrierId << std
::endl; } } while (false)
;
417 uint8_t index = itLcOnCcMapping->componentCarrierId;
418 LteEnbCmacSapProvider::LcInfo lcinfo = itLcOnCcMapping->lc;
419 LteMacSapUser *msu = itLcOnCcMapping->msu;
420 m_rrc->m_cmacSapProvider.at (index)->AddLc (lcinfo, msu);
421 m_rrc->m_ccmRrcSapProvider->AddLc (lcinfo, msu);
422 }
423
424 if (rlcTypeId == LteRlcAm::GetTypeId ())
425 {
426 drbInfo->m_rlcConfig.choice = LteRrcSap::RlcConfig::AM;
427 }
428 else
429 {
430 drbInfo->m_rlcConfig.choice = LteRrcSap::RlcConfig::UM_BI_DIRECTIONAL;
431 }
432
433 drbInfo->m_logicalChannelIdentity = lcid;
434 drbInfo->m_logicalChannelConfig.priority = m_rrc->GetLogicalChannelPriority (bearer);
435 drbInfo->m_logicalChannelConfig.logicalChannelGroup = m_rrc->GetLogicalChannelGroup (bearer);
436 if (bearer.IsGbr ())
437 {
438 drbInfo->m_logicalChannelConfig.prioritizedBitRateKbps = bearer.gbrQosInfo.gbrUl;
439 }
440 else
441 {
442 drbInfo->m_logicalChannelConfig.prioritizedBitRateKbps = 0;
443 }
444 drbInfo->m_logicalChannelConfig.bucketSizeDurationMs = 1000;
445
446 ScheduleRrcConnectionReconfiguration ();
447}
448
449void
450UeManager::RecordDataRadioBearersToBeStarted ()
451{
452 NS_LOG_FUNCTION (this << (uint32_t) m_rnti)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this << (uint32_t) m_rnti; std::clog << ")" <<
std::endl; } } while (false)
;
453 for (std::map <uint8_t, Ptr<LteDataRadioBearerInfo> >::iterator it = m_drbMap.begin ();
454 it != m_drbMap.end ();
455 ++it)
456 {
457 m_drbsToBeStarted.push_back (it->first);
458 }
459}
460
461void
462UeManager::StartDataRadioBearers ()
463{
464 NS_LOG_FUNCTION (this << (uint32_t) m_rnti)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this << (uint32_t) m_rnti; std::clog << ")" <<
std::endl; } } while (false)
;
465 for (std::list <uint8_t>::iterator drbIdIt = m_drbsToBeStarted.begin ();
466 drbIdIt != m_drbsToBeStarted.end ();
467 ++drbIdIt)
468 {
469 std::map <uint8_t, Ptr<LteDataRadioBearerInfo> >::iterator drbIt = m_drbMap.find (*drbIdIt);
470 NS_ASSERT (drbIt != m_drbMap.end ())do { if (!(drbIt != m_drbMap.end ())) { std::cerr << "assert failed. cond=\""
<< "drbIt != m_drbMap.end ()" << "\", "; do { std
::cerr << "file=" << "../src/lte/model/lte-enb-rrc.cc"
<< ", line=" << 470 << std::endl; ::ns3::FatalImpl
::FlushStreams (); if (true) std::terminate (); } while (false
); } } while (false)
;
471 drbIt->second->m_rlc->Initialize ();
472 if (drbIt->second->m_pdcp)
473 {
474 drbIt->second->m_pdcp->Initialize ();
475 }
476 }
477 m_drbsToBeStarted.clear ();
478}
479
480
481void
482UeManager::ReleaseDataRadioBearer (uint8_t drbid)
483{
484 NS_LOG_FUNCTION (this << (uint32_t) m_rnti << (uint32_t) drbid)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this << (uint32_t) m_rnti << (uint32_t) drbid; std
::clog << ")" << std::endl; } } while (false)
;
485 uint8_t lcid = Drbid2Lcid (drbid);
486 std::map <uint8_t, Ptr<LteDataRadioBearerInfo> >::iterator it = m_drbMap.find (drbid);
487 NS_ASSERT_MSG (it != m_drbMap.end (), "request to remove radio bearer with unknown drbid " << drbid)do { if (!(it != m_drbMap.end ())) { std::cerr << "assert failed. cond=\""
<< "it != m_drbMap.end ()" << "\", "; do { std::
cerr << "msg=\"" << "request to remove radio bearer with unknown drbid "
<< drbid << "\", "; do { std::cerr << "file="
<< "../src/lte/model/lte-enb-rrc.cc" << ", line="
<< 487 << std::endl; ::ns3::FatalImpl::FlushStreams
(); if (true) std::terminate (); } while (false); } while (false
); } } while (false)
;
488
489 // first delete eventual X2-U TEIDs
490 m_rrc->m_x2uTeidInfoMap.erase (it->second->m_gtpTeid);
491
492 m_drbMap.erase (it);
493 std::vector<uint8_t> ccToRelease = m_rrc->m_ccmRrcSapProvider->ReleaseDataRadioBearer (m_rnti, lcid);
494 std::vector<uint8_t>::iterator itCcToRelease = ccToRelease.begin ();
495 NS_ASSERT_MSG (itCcToRelease != ccToRelease.end (), "request to remove radio bearer with unknown drbid (ComponentCarrierManager)")do { if (!(itCcToRelease != ccToRelease.end ())) { std::cerr <<
"assert failed. cond=\"" << "itCcToRelease != ccToRelease.end ()"
<< "\", "; do { std::cerr << "msg=\"" << "request to remove radio bearer with unknown drbid (ComponentCarrierManager)"
<< "\", "; do { std::cerr << "file=" << "../src/lte/model/lte-enb-rrc.cc"
<< ", line=" << 495 << std::endl; ::ns3::FatalImpl
::FlushStreams (); if (true) std::terminate (); } while (false
); } while (false); } } while (false)
;
496 for (itCcToRelease = ccToRelease.begin (); itCcToRelease != ccToRelease.end (); ++itCcToRelease)
497 {
498 m_rrc->m_cmacSapProvider.at (*itCcToRelease)->ReleaseLc (m_rnti, lcid);
499 }
500 LteRrcSap::RadioResourceConfigDedicated rrcd;
501 rrcd.havePhysicalConfigDedicated = false;
502 rrcd.drbToReleaseList.push_back (drbid);
503 //populating RadioResourceConfigDedicated information element as per 3GPP TS 36.331 version 9.2.0
504 rrcd.havePhysicalConfigDedicated = true;
505 rrcd.physicalConfigDedicated = m_physicalConfigDedicated;
506
507 //populating RRCConnectionReconfiguration message as per 3GPP TS 36.331 version 9.2.0 Release 9
508 LteRrcSap::RrcConnectionReconfiguration msg;
509 msg.haveMeasConfig = false;
510 msg.haveMobilityControlInfo = false;
511 msg.radioResourceConfigDedicated = rrcd;
512 msg.haveRadioResourceConfigDedicated = true;
513 // ToDo: Resend in eny case this configuration
514 // needs to be initialized
515 msg.haveNonCriticalExtension = false;
516 //RRC Connection Reconfiguration towards UE
517 m_rrc->m_rrcSapUser->SendRrcConnectionReconfiguration (m_rnti, msg);
518}
519
520void
521LteEnbRrc::DoSendReleaseDataRadioBearer (uint64_t imsi, uint16_t rnti, uint8_t bearerId)
522{
523 Ptr<UeManager> ueManager = GetUeManager (rnti);
524 // Bearer de-activation towards UE
525 ueManager->ReleaseDataRadioBearer (bearerId);
526 // Bearer de-activation indication towards epc-enb application
527 m_s1SapProvider->DoSendReleaseIndication (imsi,rnti,bearerId);
528}
529
530void
531UeManager::ScheduleRrcConnectionReconfiguration ()
532{
533 NS_LOG_FUNCTION (this)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this; std::clog << ")" << std::endl; } } while (
false)
;
534 switch (m_state)
535 {
536 case INITIAL_RANDOM_ACCESS:
537 case CONNECTION_SETUP:
538 case CONNECTION_RECONFIGURATION:
539 case CONNECTION_REESTABLISHMENT:
540 case HANDOVER_PREPARATION:
541 case HANDOVER_JOINING:
542 case HANDOVER_LEAVING:
543 // a previous reconfiguration still ongoing, we need to wait for it to be finished
544 m_pendingRrcConnectionReconfiguration = true;
545 break;
546
547 case CONNECTED_NORMALLY:
548 {
549 m_pendingRrcConnectionReconfiguration = false;
550 LteRrcSap::RrcConnectionReconfiguration msg = BuildRrcConnectionReconfiguration ();
551 m_rrc->m_rrcSapUser->SendRrcConnectionReconfiguration (m_rnti, msg);
552 RecordDataRadioBearersToBeStarted ();
553 SwitchToState (CONNECTION_RECONFIGURATION);
554 }
555 break;
556
557 default:
558 NS_FATAL_ERROR ("method unexpected in state " << ToString (m_state))do { std::cerr << "msg=\"" << "method unexpected in state "
<< ToString (m_state) << "\", "; do { std::cerr <<
"file=" << "../src/lte/model/lte-enb-rrc.cc" << ", line="
<< 558 << std::endl; ::ns3::FatalImpl::FlushStreams
(); if (true) std::terminate (); } while (false); } while (false
)
;
559 break;
560 }
561}
562
563void
564UeManager::PrepareHandover (uint16_t cellId)
565{
566 NS_LOG_FUNCTION (this << cellId)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this << cellId; std::clog << ")" << std::endl
; } } while (false)
;
567 switch (m_state)
568 {
569 case CONNECTED_NORMALLY:
570 {
571 m_targetCellId = cellId;
572 EpcX2SapProvider::HandoverRequestParams params;
573 params.oldEnbUeX2apId = m_rnti;
574 params.cause = EpcX2SapProvider::HandoverDesirableForRadioReason;
575 params.sourceCellId = m_rrc->m_cellId;
576 params.targetCellId = cellId;
577 params.mmeUeS1apId = m_imsi;
578 params.ueAggregateMaxBitRateDownlink = 200 * 1000;
579 params.ueAggregateMaxBitRateUplink = 100 * 1000;
580 params.bearers = GetErabList ();
581
582 LteRrcSap::HandoverPreparationInfo hpi;
583 hpi.asConfig.sourceUeIdentity = m_rnti;
584 hpi.asConfig.sourceDlCarrierFreq = m_rrc->m_dlEarfcn;
585 hpi.asConfig.sourceMeasConfig = m_rrc->m_ueMeasConfig;
586 hpi.asConfig.sourceRadioResourceConfig = GetRadioResourceConfigForHandoverPreparationInfo ();
587 hpi.asConfig.sourceMasterInformationBlock.dlBandwidth = m_rrc->m_dlBandwidth;
588 hpi.asConfig.sourceMasterInformationBlock.systemFrameNumber = 0;
589 hpi.asConfig.sourceSystemInformationBlockType1.cellAccessRelatedInfo.plmnIdentityInfo.plmnIdentity = m_rrc->m_sib1.cellAccessRelatedInfo.plmnIdentityInfo.plmnIdentity;
590 hpi.asConfig.sourceSystemInformationBlockType1.cellAccessRelatedInfo.cellIdentity = m_rrc->m_cellId;
591 hpi.asConfig.sourceSystemInformationBlockType1.cellAccessRelatedInfo.csgIndication = m_rrc->m_sib1.cellAccessRelatedInfo.csgIndication;
592 hpi.asConfig.sourceSystemInformationBlockType1.cellAccessRelatedInfo.csgIdentity = m_rrc->m_sib1.cellAccessRelatedInfo.csgIdentity;
593 LteEnbCmacSapProvider::RachConfig rc = m_rrc->m_cmacSapProvider.at (0)->GetRachConfig ();
594 hpi.asConfig.sourceSystemInformationBlockType2.radioResourceConfigCommon.rachConfigCommon.preambleInfo.numberOfRaPreambles = rc.numberOfRaPreambles;
595 hpi.asConfig.sourceSystemInformationBlockType2.radioResourceConfigCommon.rachConfigCommon.raSupervisionInfo.preambleTransMax = rc.preambleTransMax;
596 hpi.asConfig.sourceSystemInformationBlockType2.radioResourceConfigCommon.rachConfigCommon.raSupervisionInfo.raResponseWindowSize = rc.raResponseWindowSize;
597 hpi.asConfig.sourceSystemInformationBlockType2.freqInfo.ulCarrierFreq = m_rrc->m_ulEarfcn;
598 hpi.asConfig.sourceSystemInformationBlockType2.freqInfo.ulBandwidth = m_rrc->m_ulBandwidth;
599 params.rrcContext = m_rrc->m_rrcSapUser->EncodeHandoverPreparationInformation (hpi);
600
601 NS_LOG_LOGIC ("oldEnbUeX2apId = " << params.oldEnbUeX2apId)do { if (g_log.IsEnabled (ns3::LOG_LOGIC)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; if (g_log.IsEnabled (ns3::LOG_PREFIX_FUNC)) { std
::clog << g_log.Name () << ":" << __FUNCTION__
<< "(): "; }; if (g_log.IsEnabled (ns3::LOG_PREFIX_LEVEL
)) { std::clog << "[" << g_log.GetLevelLabel (ns3
::LOG_LOGIC) << "] "; }; std::clog << "oldEnbUeX2apId = "
<< params.oldEnbUeX2apId << std::endl; } } while
(false)
;
602 NS_LOG_LOGIC ("sourceCellId = " << params.sourceCellId)do { if (g_log.IsEnabled (ns3::LOG_LOGIC)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; if (g_log.IsEnabled (ns3::LOG_PREFIX_FUNC)) { std
::clog << g_log.Name () << ":" << __FUNCTION__
<< "(): "; }; if (g_log.IsEnabled (ns3::LOG_PREFIX_LEVEL
)) { std::clog << "[" << g_log.GetLevelLabel (ns3
::LOG_LOGIC) << "] "; }; std::clog << "sourceCellId = "
<< params.sourceCellId << std::endl; } } while (
false)
;
603 NS_LOG_LOGIC ("targetCellId = " << params.targetCellId)do { if (g_log.IsEnabled (ns3::LOG_LOGIC)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; if (g_log.IsEnabled (ns3::LOG_PREFIX_FUNC)) { std
::clog << g_log.Name () << ":" << __FUNCTION__
<< "(): "; }; if (g_log.IsEnabled (ns3::LOG_PREFIX_LEVEL
)) { std::clog << "[" << g_log.GetLevelLabel (ns3
::LOG_LOGIC) << "] "; }; std::clog << "targetCellId = "
<< params.targetCellId << std::endl; } } while (
false)
;
604 NS_LOG_LOGIC ("mmeUeS1apId = " << params.mmeUeS1apId)do { if (g_log.IsEnabled (ns3::LOG_LOGIC)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; if (g_log.IsEnabled (ns3::LOG_PREFIX_FUNC)) { std
::clog << g_log.Name () << ":" << __FUNCTION__
<< "(): "; }; if (g_log.IsEnabled (ns3::LOG_PREFIX_LEVEL
)) { std::clog << "[" << g_log.GetLevelLabel (ns3
::LOG_LOGIC) << "] "; }; std::clog << "mmeUeS1apId = "
<< params.mmeUeS1apId << std::endl; } } while (false
)
;
605 NS_LOG_LOGIC ("rrcContext = " << params.rrcContext)do { if (g_log.IsEnabled (ns3::LOG_LOGIC)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; if (g_log.IsEnabled (ns3::LOG_PREFIX_FUNC)) { std
::clog << g_log.Name () << ":" << __FUNCTION__
<< "(): "; }; if (g_log.IsEnabled (ns3::LOG_PREFIX_LEVEL
)) { std::clog << "[" << g_log.GetLevelLabel (ns3
::LOG_LOGIC) << "] "; }; std::clog << "rrcContext = "
<< params.rrcContext << std::endl; } } while (false
)
;
606
607 m_rrc->m_x2SapProvider->SendHandoverRequest (params);
608 SwitchToState (HANDOVER_PREPARATION);
609 }
610 break;
611
612 default:
613 NS_FATAL_ERROR ("method unexpected in state " << ToString (m_state))do { std::cerr << "msg=\"" << "method unexpected in state "
<< ToString (m_state) << "\", "; do { std::cerr <<
"file=" << "../src/lte/model/lte-enb-rrc.cc" << ", line="
<< 613 << std::endl; ::ns3::FatalImpl::FlushStreams
(); if (true) std::terminate (); } while (false); } while (false
)
;
614 break;
615 }
616
617}
618
619void
620UeManager::RecvHandoverRequestAck (EpcX2SapUser::HandoverRequestAckParams params)
621{
622 NS_LOG_FUNCTION (this)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this; std::clog << ")" << std::endl; } } while (
false)
;
623
624 NS_ASSERT_MSG (params.notAdmittedBearers.empty (), "not admission of some bearers upon handover is not supported")do { if (!(params.notAdmittedBearers.empty ())) { std::cerr <<
"assert failed. cond=\"" << "params.notAdmittedBearers.empty ()"
<< "\", "; do { std::cerr << "msg=\"" << "not admission of some bearers upon handover is not supported"
<< "\", "; do { std::cerr << "file=" << "../src/lte/model/lte-enb-rrc.cc"
<< ", line=" << 624 << std::endl; ::ns3::FatalImpl
::FlushStreams (); if (true) std::terminate (); } while (false
); } while (false); } } while (false)
;
625 NS_ASSERT_MSG (params.admittedBearers.size () == m_drbMap.size (), "not enough bearers in admittedBearers")do { if (!(params.admittedBearers.size () == m_drbMap.size ()
)) { std::cerr << "assert failed. cond=\"" << "params.admittedBearers.size () == m_drbMap.size ()"
<< "\", "; do { std::cerr << "msg=\"" << "not enough bearers in admittedBearers"
<< "\", "; do { std::cerr << "file=" << "../src/lte/model/lte-enb-rrc.cc"
<< ", line=" << 625 << std::endl; ::ns3::FatalImpl
::FlushStreams (); if (true) std::terminate (); } while (false
); } while (false); } } while (false)
;
626
627 // note: the Handover command from the target eNB to the source eNB
628 // is expected to be sent transparently to the UE; however, here we
629 // decode the message and eventually reencode it. This way we can
630 // support both a real RRC protocol implementation and an ideal one
631 // without actual RRC protocol encoding.
632
633 Ptr<Packet> encodedHandoverCommand = params.rrcContext;
634 LteRrcSap::RrcConnectionReconfiguration handoverCommand = m_rrc->m_rrcSapUser->DecodeHandoverCommand (encodedHandoverCommand);
635 m_rrc->m_rrcSapUser->SendRrcConnectionReconfiguration (m_rnti, handoverCommand);
636 SwitchToState (HANDOVER_LEAVING);
637 m_handoverLeavingTimeout = Simulator::Schedule (m_rrc->m_handoverLeavingTimeoutDuration,
638 &LteEnbRrc::HandoverLeavingTimeout,
639 m_rrc, m_rnti);
640 NS_ASSERT (handoverCommand.haveMobilityControlInfo)do { if (!(handoverCommand.haveMobilityControlInfo)) { std::cerr
<< "assert failed. cond=\"" << "handoverCommand.haveMobilityControlInfo"
<< "\", "; do { std::cerr << "file=" << "../src/lte/model/lte-enb-rrc.cc"
<< ", line=" << 640 << std::endl; ::ns3::FatalImpl
::FlushStreams (); if (true) std::terminate (); } while (false
); } } while (false)
;
641 m_rrc->m_handoverStartTrace (m_imsi, m_rrc->m_cellId, m_rnti, handoverCommand.mobilityControlInfo.targetPhysCellId);
642
643 EpcX2SapProvider::SnStatusTransferParams sst;
644 sst.oldEnbUeX2apId = params.oldEnbUeX2apId;
645 sst.newEnbUeX2apId = params.newEnbUeX2apId;
646 sst.sourceCellId = params.sourceCellId;
647 sst.targetCellId = params.targetCellId;
648 for ( std::map <uint8_t, Ptr<LteDataRadioBearerInfo> >::iterator drbIt = m_drbMap.begin ();
649 drbIt != m_drbMap.end ();
650 ++drbIt)
651 {
652 // SN status transfer is only for AM RLC
653 if (0 != drbIt->second->m_rlc->GetObject<LteRlcAm> ())
654 {
655 LtePdcp::Status status = drbIt->second->m_pdcp->GetStatus ();
656 EpcX2Sap::ErabsSubjectToStatusTransferItem i;
657 i.dlPdcpSn = status.txSn;
658 i.ulPdcpSn = status.rxSn;
659 sst.erabsSubjectToStatusTransferList.push_back (i);
660 }
661 }
662 m_rrc->m_x2SapProvider->SendSnStatusTransfer (sst);
663}
664
665
666LteRrcSap::RadioResourceConfigDedicated
667UeManager::GetRadioResourceConfigForHandoverPreparationInfo ()
668{
669 NS_LOG_FUNCTION (this)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this; std::clog << ")" << std::endl; } } while (
false)
;
670 return BuildRadioResourceConfigDedicated ();
671}
672
673LteRrcSap::RrcConnectionReconfiguration
674UeManager::GetRrcConnectionReconfigurationForHandover ()
675{
676 NS_LOG_FUNCTION (this)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this; std::clog << ")" << std::endl; } } while (
false)
;
677 return BuildRrcConnectionReconfiguration ();
678}
679
680void
681UeManager::SendData (uint8_t bid, Ptr<Packet> p)
682{
683 NS_LOG_FUNCTION (this << p << (uint16_t) bid)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this << p << (uint16_t) bid; std::clog << ")"
<< std::endl; } } while (false)
;
684 switch (m_state)
685 {
686 case INITIAL_RANDOM_ACCESS:
687 case CONNECTION_SETUP:
688 NS_LOG_WARN ("not connected, discarding packet")do { if (g_log.IsEnabled (ns3::LOG_WARN)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; if (g_log.IsEnabled (ns3::LOG_PREFIX_FUNC)) { std
::clog << g_log.Name () << ":" << __FUNCTION__
<< "(): "; }; if (g_log.IsEnabled (ns3::LOG_PREFIX_LEVEL
)) { std::clog << "[" << g_log.GetLevelLabel (ns3
::LOG_WARN) << "] "; }; std::clog << "not connected, discarding packet"
<< std::endl; } } while (false)
;
689 return;
690 break;
691
692 case CONNECTED_NORMALLY:
693 case CONNECTION_RECONFIGURATION:
694 case CONNECTION_REESTABLISHMENT:
695 case HANDOVER_PREPARATION:
696 case HANDOVER_JOINING:
697 case HANDOVER_PATH_SWITCH:
698 {
699 NS_LOG_LOGIC ("queueing data on PDCP for transmission over the air")do { if (g_log.IsEnabled (ns3::LOG_LOGIC)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; if (g_log.IsEnabled (ns3::LOG_PREFIX_FUNC)) { std
::clog << g_log.Name () << ":" << __FUNCTION__
<< "(): "; }; if (g_log.IsEnabled (ns3::LOG_PREFIX_LEVEL
)) { std::clog << "[" << g_log.GetLevelLabel (ns3
::LOG_LOGIC) << "] "; }; std::clog << "queueing data on PDCP for transmission over the air"
<< std::endl; } } while (false)
;
700 LtePdcpSapProvider::TransmitPdcpSduParameters params;
701 params.pdcpSdu = p;
702 params.rnti = m_rnti;
703 params.lcid = Bid2Lcid (bid);
704 uint8_t drbid = Bid2Drbid (bid);
705 //Transmit PDCP sdu only if DRB ID found in drbMap
706 std::map<uint8_t, Ptr<LteDataRadioBearerInfo> >::iterator it = m_drbMap.find (drbid);
707 if (it != m_drbMap.end ())
708 {
709 Ptr<LteDataRadioBearerInfo> bearerInfo = GetDataRadioBearerInfo (drbid);
710 if (bearerInfo != NULL__null)
711 {
712 LtePdcpSapProvider* pdcpSapProvider = bearerInfo->m_pdcp->GetLtePdcpSapProvider ();
713 pdcpSapProvider->TransmitPdcpSdu (params);
714 }
715 }
716 }
717 break;
718
719 case HANDOVER_LEAVING:
720 {
721 NS_LOG_LOGIC ("forwarding data to target eNB over X2-U")do { if (g_log.IsEnabled (ns3::LOG_LOGIC)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; if (g_log.IsEnabled (ns3::LOG_PREFIX_FUNC)) { std
::clog << g_log.Name () << ":" << __FUNCTION__
<< "(): "; }; if (g_log.IsEnabled (ns3::LOG_PREFIX_LEVEL
)) { std::clog << "[" << g_log.GetLevelLabel (ns3
::LOG_LOGIC) << "] "; }; std::clog << "forwarding data to target eNB over X2-U"
<< std::endl; } } while (false)
;
722 uint8_t drbid = Bid2Drbid (bid);
723 EpcX2Sap::UeDataParams params;
724 params.sourceCellId = m_rrc->m_cellId;
725 params.targetCellId = m_targetCellId;
726 params.gtpTeid = GetDataRadioBearerInfo (drbid)->m_gtpTeid;
727 params.ueData = p;
728 m_rrc->m_x2SapProvider->SendUeData (params);
729 }
730 break;
731
732 default:
733 NS_FATAL_ERROR ("method unexpected in state " << ToString (m_state))do { std::cerr << "msg=\"" << "method unexpected in state "
<< ToString (m_state) << "\", "; do { std::cerr <<
"file=" << "../src/lte/model/lte-enb-rrc.cc" << ", line="
<< 733 << std::endl; ::ns3::FatalImpl::FlushStreams
(); if (true) std::terminate (); } while (false); } while (false
)
;
734 break;
735 }
736}
737
738std::vector<EpcX2Sap::ErabToBeSetupItem>
739UeManager::GetErabList ()
740{
741 NS_LOG_FUNCTION (this)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this; std::clog << ")" << std::endl; } } while (
false)
;
742 std::vector<EpcX2Sap::ErabToBeSetupItem> ret;
743 for (std::map <uint8_t, Ptr<LteDataRadioBearerInfo> >::iterator it = m_drbMap.begin ();
744 it != m_drbMap.end ();
745 ++it)
746 {
747 EpcX2Sap::ErabToBeSetupItem etbsi;
748 etbsi.erabId = it->second->m_epsBearerIdentity;
749 etbsi.erabLevelQosParameters = it->second->m_epsBearer;
750 etbsi.dlForwarding = false;
751 etbsi.transportLayerAddress = it->second->m_transportLayerAddress;
752 etbsi.gtpTeid = it->second->m_gtpTeid;
753 ret.push_back (etbsi);
754 }
755 return ret;
756}
757
758void
759UeManager::SendUeContextRelease ()
760{
761 NS_LOG_FUNCTION (this)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this; std::clog << ")" << std::endl; } } while (
false)
;
762 switch (m_state)
2
Control jumps to 'case HANDOVER_PATH_SWITCH:' at line 764
763 {
764 case HANDOVER_PATH_SWITCH:
765 NS_LOG_INFO ("Send UE CONTEXT RELEASE from target eNB to source eNB")do { if (g_log.IsEnabled (ns3::LOG_INFO)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; if (g_log.IsEnabled (ns3::LOG_PREFIX_FUNC)) { std
::clog << g_log.Name () << ":" << __FUNCTION__
<< "(): "; }; if (g_log.IsEnabled (ns3::LOG_PREFIX_LEVEL
)) { std::clog << "[" << g_log.GetLevelLabel (ns3
::LOG_INFO) << "] "; }; std::clog << "Send UE CONTEXT RELEASE from target eNB to source eNB"
<< std::endl; } } while (false)
;
766 EpcX2SapProvider::UeContextReleaseParams ueCtxReleaseParams;
767 ueCtxReleaseParams.oldEnbUeX2apId = m_sourceX2apId;
768 ueCtxReleaseParams.newEnbUeX2apId = m_rnti;
769 ueCtxReleaseParams.sourceCellId = m_sourceCellId;
770 m_rrc->m_x2SapProvider->SendUeContextRelease (ueCtxReleaseParams);
3
Passed-by-value struct argument contains uninitialized data (e.g., field: 'targetCellId')
771 SwitchToState (CONNECTED_NORMALLY);
772 m_rrc->m_handoverEndOkTrace (m_imsi, m_rrc->m_cellId, m_rnti);
773 break;
774
775 default:
776 NS_FATAL_ERROR ("method unexpected in state " << ToString (m_state))do { std::cerr << "msg=\"" << "method unexpected in state "
<< ToString (m_state) << "\", "; do { std::cerr <<
"file=" << "../src/lte/model/lte-enb-rrc.cc" << ", line="
<< 776 << std::endl; ::ns3::FatalImpl::FlushStreams
(); if (true) std::terminate (); } while (false); } while (false
)
;
777 break;
778 }
779}
780
781void
782UeManager::RecvHandoverPreparationFailure (uint16_t cellId)
783{
784 NS_LOG_FUNCTION (this << cellId)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this << cellId; std::clog << ")" << std::endl
; } } while (false)
;
785 switch (m_state)
786 {
787 case HANDOVER_PREPARATION:
788 NS_ASSERT (cellId == m_targetCellId)do { if (!(cellId == m_targetCellId)) { std::cerr << "assert failed. cond=\""
<< "cellId == m_targetCellId" << "\", "; do { std
::cerr << "file=" << "../src/lte/model/lte-enb-rrc.cc"
<< ", line=" << 788 << std::endl; ::ns3::FatalImpl
::FlushStreams (); if (true) std::terminate (); } while (false
); } } while (false)
;
789 NS_LOG_INFO ("target eNB sent HO preparation failure, aborting HO")do { if (g_log.IsEnabled (ns3::LOG_INFO)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; if (g_log.IsEnabled (ns3::LOG_PREFIX_FUNC)) { std
::clog << g_log.Name () << ":" << __FUNCTION__
<< "(): "; }; if (g_log.IsEnabled (ns3::LOG_PREFIX_LEVEL
)) { std::clog << "[" << g_log.GetLevelLabel (ns3
::LOG_INFO) << "] "; }; std::clog << "target eNB sent HO preparation failure, aborting HO"
<< std::endl; } } while (false)
;
790 SwitchToState (CONNECTED_NORMALLY);
791 break;
792
793 default:
794 NS_FATAL_ERROR ("method unexpected in state " << ToString (m_state))do { std::cerr << "msg=\"" << "method unexpected in state "
<< ToString (m_state) << "\", "; do { std::cerr <<
"file=" << "../src/lte/model/lte-enb-rrc.cc" << ", line="
<< 794 << std::endl; ::ns3::FatalImpl::FlushStreams
(); if (true) std::terminate (); } while (false); } while (false
)
;
795 break;
796 }
797}
798
799void
800UeManager::RecvSnStatusTransfer (EpcX2SapUser::SnStatusTransferParams params)
801{
802 NS_LOG_FUNCTION (this)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this; std::clog << ")" << std::endl; } } while (
false)
;
803 for (std::vector<EpcX2Sap::ErabsSubjectToStatusTransferItem>::iterator erabIt
804 = params.erabsSubjectToStatusTransferList.begin ();
805 erabIt != params.erabsSubjectToStatusTransferList.end ();
806 ++erabIt)
807 {
808 // LtePdcp::Status status;
809 // status.txSn = erabIt->dlPdcpSn;
810 // status.rxSn = erabIt->ulPdcpSn;
811 // uint8_t drbId = Bid2Drbid (erabIt->erabId);
812 // std::map <uint8_t, Ptr<LteDataRadioBearerInfo> >::iterator drbIt = m_drbMap.find (drbId);
813 // NS_ASSERT_MSG (drbIt != m_drbMap.end (), "could not find DRBID " << (uint32_t) drbId);
814 // drbIt->second->m_pdcp->SetStatus (status);
815 }
816}
817
818void
819UeManager::RecvUeContextRelease (EpcX2SapUser::UeContextReleaseParams params)
820{
821 NS_LOG_FUNCTION (this)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this; std::clog << ")" << std::endl; } } while (
false)
;
822 NS_ASSERT_MSG (m_state == HANDOVER_LEAVING, "method unexpected in state " << ToString (m_state))do { if (!(m_state == HANDOVER_LEAVING)) { std::cerr <<
"assert failed. cond=\"" << "m_state == HANDOVER_LEAVING"
<< "\", "; do { std::cerr << "msg=\"" << "method unexpected in state "
<< ToString (m_state) << "\", "; do { std::cerr <<
"file=" << "../src/lte/model/lte-enb-rrc.cc" << ", line="
<< 822 << std::endl; ::ns3::FatalImpl::FlushStreams
(); if (true) std::terminate (); } while (false); } while (false
); } } while (false)
;
823 m_handoverLeavingTimeout.Cancel ();
824}
825
826
827// methods forwarded from RRC SAP
828
829void
830UeManager::CompleteSetupUe (LteEnbRrcSapProvider::CompleteSetupUeParameters params)
831{
832 NS_LOG_FUNCTION (this)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this; std::clog << ")" << std::endl; } } while (
false)
;
833 m_srb0->m_rlc->SetLteRlcSapUser (params.srb0SapUser);
834 m_srb1->m_pdcp->SetLtePdcpSapUser (params.srb1SapUser);
835}
836
837void
838UeManager::RecvRrcConnectionRequest (LteRrcSap::RrcConnectionRequest msg)
839{
840 NS_LOG_FUNCTION (this)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this; std::clog << ")" << std::endl; } } while (
false)
;
841 switch (m_state)
842 {
843 case INITIAL_RANDOM_ACCESS:
844 {
845 m_connectionRequestTimeout.Cancel ();
846
847 if (m_rrc->m_admitRrcConnectionRequest == true)
848 {
849 m_imsi = msg.ueIdentity;
850 if (m_rrc->m_s1SapProvider != 0)
851 {
852 m_rrc->m_s1SapProvider->InitialUeMessage (m_imsi, m_rnti);
853 }
854
855 // send RRC CONNECTION SETUP to UE
856 LteRrcSap::RrcConnectionSetup msg2;
857 msg2.rrcTransactionIdentifier = GetNewRrcTransactionIdentifier ();
858 msg2.radioResourceConfigDedicated = BuildRadioResourceConfigDedicated ();
859 m_rrc->m_rrcSapUser->SendRrcConnectionSetup (m_rnti, msg2);
860
861 RecordDataRadioBearersToBeStarted ();
862 m_connectionSetupTimeout = Simulator::Schedule (
863 m_rrc->m_connectionSetupTimeoutDuration,
864 &LteEnbRrc::ConnectionSetupTimeout, m_rrc, m_rnti);
865 SwitchToState (CONNECTION_SETUP);
866 }
867 else
868 {
869 NS_LOG_INFO ("rejecting connection request for RNTI " << m_rnti)do { if (g_log.IsEnabled (ns3::LOG_INFO)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; if (g_log.IsEnabled (ns3::LOG_PREFIX_FUNC)) { std
::clog << g_log.Name () << ":" << __FUNCTION__
<< "(): "; }; if (g_log.IsEnabled (ns3::LOG_PREFIX_LEVEL
)) { std::clog << "[" << g_log.GetLevelLabel (ns3
::LOG_INFO) << "] "; }; std::clog << "rejecting connection request for RNTI "
<< m_rnti << std::endl; } } while (false)
;
870
871 // send RRC CONNECTION REJECT to UE
872 LteRrcSap::RrcConnectionReject rejectMsg;
873 rejectMsg.waitTime = 3;
874 m_rrc->m_rrcSapUser->SendRrcConnectionReject (m_rnti, rejectMsg);
875
876 m_connectionRejectedTimeout = Simulator::Schedule (
877 m_rrc->m_connectionRejectedTimeoutDuration,
878 &LteEnbRrc::ConnectionRejectedTimeout, m_rrc, m_rnti);
879 SwitchToState (CONNECTION_REJECTED);
880 }
881 }
882 break;
883
884 default:
885 NS_FATAL_ERROR ("method unexpected in state " << ToString (m_state))do { std::cerr << "msg=\"" << "method unexpected in state "
<< ToString (m_state) << "\", "; do { std::cerr <<
"file=" << "../src/lte/model/lte-enb-rrc.cc" << ", line="
<< 885 << std::endl; ::ns3::FatalImpl::FlushStreams
(); if (true) std::terminate (); } while (false); } while (false
)
;
886 break;
887 }
888}
889
890void
891UeManager::RecvRrcConnectionSetupCompleted (LteRrcSap::RrcConnectionSetupCompleted msg)
892{
893 NS_LOG_FUNCTION (this)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this; std::clog << ")" << std::endl; } } while (
false)
;
894 switch (m_state)
895 {
896 case CONNECTION_SETUP:
897 m_connectionSetupTimeout.Cancel ();
898 if ( m_caSupportConfigured == false && m_rrc->m_numberOfComponentCarriers > 1)
899 {
900 m_pendingRrcConnectionReconfiguration = true; // Force Reconfiguration
901 m_pendingStartDataRadioBearers = true;
902 }
903 else
904 {
905 m_pendingStartDataRadioBearers = false;
906 StartDataRadioBearers ();
907 }
908 SwitchToState (CONNECTED_NORMALLY);
909 m_rrc->m_connectionEstablishedTrace (m_imsi, m_rrc->m_cellId, m_rnti);
910 break;
911
912 default:
913 NS_FATAL_ERROR ("method unexpected in state " << ToString (m_state))do { std::cerr << "msg=\"" << "method unexpected in state "
<< ToString (m_state) << "\", "; do { std::cerr <<
"file=" << "../src/lte/model/lte-enb-rrc.cc" << ", line="
<< 913 << std::endl; ::ns3::FatalImpl::FlushStreams
(); if (true) std::terminate (); } while (false); } while (false
)
;
914 break;
915 }
916}
917
918void
919UeManager::RecvRrcConnectionReconfigurationCompleted (LteRrcSap::RrcConnectionReconfigurationCompleted msg)
920{
921 NS_LOG_FUNCTION (this)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this; std::clog << ")" << std::endl; } } while (
false)
;
922 switch (m_state)
923 {
924 case CONNECTION_RECONFIGURATION:
925 StartDataRadioBearers ();
926 if (m_needPhyMacConfiguration)
927 {
928 // configure MAC (and scheduler)
929 LteEnbCmacSapProvider::UeConfig req;
930 req.m_rnti = m_rnti;
931 req.m_transmissionMode = m_physicalConfigDedicated.antennaInfo.transmissionMode;
932 for (uint8_t i = 0; i < m_rrc->m_numberOfComponentCarriers; i++)
933 {
934 m_rrc->m_cmacSapProvider.at (i)->UeUpdateConfigurationReq (req);
935
936 // configure PHY
937 m_rrc->m_cphySapProvider.at (i)->SetTransmissionMode (req.m_rnti, req.m_transmissionMode);
938 double paDouble = LteRrcSap::ConvertPdschConfigDedicated2Double (m_physicalConfigDedicated.pdschConfigDedicated);
939 m_rrc->m_cphySapProvider.at (i)->SetPa (m_rnti, paDouble);
940 }
941
942 m_needPhyMacConfiguration = false;
943 }
944 SwitchToState (CONNECTED_NORMALLY);
945 m_rrc->m_connectionReconfigurationTrace (m_imsi, m_rrc->m_cellId, m_rnti);
946 break;
947
948 // This case is added to NS-3 in order to handle bearer de-activation scenario for CONNECTED state UE
949 case CONNECTED_NORMALLY:
950 NS_LOG_INFO ("ignoring RecvRrcConnectionReconfigurationCompleted in state " << ToString (m_state))do { if (g_log.IsEnabled (ns3::LOG_INFO)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; if (g_log.IsEnabled (ns3::LOG_PREFIX_FUNC)) { std
::clog << g_log.Name () << ":" << __FUNCTION__
<< "(): "; }; if (g_log.IsEnabled (ns3::LOG_PREFIX_LEVEL
)) { std::clog << "[" << g_log.GetLevelLabel (ns3
::LOG_INFO) << "] "; }; std::clog << "ignoring RecvRrcConnectionReconfigurationCompleted in state "
<< ToString (m_state) << std::endl; } } while (false
)
;
951 break;
952
953 case HANDOVER_LEAVING:
954 NS_LOG_INFO ("ignoring RecvRrcConnectionReconfigurationCompleted in state " << ToString (m_state))do { if (g_log.IsEnabled (ns3::LOG_INFO)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; if (g_log.IsEnabled (ns3::LOG_PREFIX_FUNC)) { std
::clog << g_log.Name () << ":" << __FUNCTION__
<< "(): "; }; if (g_log.IsEnabled (ns3::LOG_PREFIX_LEVEL
)) { std::clog << "[" << g_log.GetLevelLabel (ns3
::LOG_INFO) << "] "; }; std::clog << "ignoring RecvRrcConnectionReconfigurationCompleted in state "
<< ToString (m_state) << std::endl; } } while (false
)
;
955 break;
956
957 case HANDOVER_JOINING:
958 {
959 m_handoverJoiningTimeout.Cancel ();
960 NS_LOG_INFO ("Send PATH SWITCH REQUEST to the MME")do { if (g_log.IsEnabled (ns3::LOG_INFO)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; if (g_log.IsEnabled (ns3::LOG_PREFIX_FUNC)) { std
::clog << g_log.Name () << ":" << __FUNCTION__
<< "(): "; }; if (g_log.IsEnabled (ns3::LOG_PREFIX_LEVEL
)) { std::clog << "[" << g_log.GetLevelLabel (ns3
::LOG_INFO) << "] "; }; std::clog << "Send PATH SWITCH REQUEST to the MME"
<< std::endl; } } while (false)
;
961 EpcEnbS1SapProvider::PathSwitchRequestParameters params;
962 params.rnti = m_rnti;
963 params.cellId = m_rrc->m_cellId;
964 params.mmeUeS1Id = m_imsi;
965 SwitchToState (HANDOVER_PATH_SWITCH);
966 for (std::map <uint8_t, Ptr<LteDataRadioBearerInfo> >::iterator it = m_drbMap.begin ();
967 it != m_drbMap.end ();
968 ++it)
969 {
970 EpcEnbS1SapProvider::BearerToBeSwitched b;
971 b.epsBearerId = it->second->m_epsBearerIdentity;
972 b.teid = it->second->m_gtpTeid;
973 params.bearersToBeSwitched.push_back (b);
974 }
975 m_rrc->m_s1SapProvider->PathSwitchRequest (params);
976 }
977 break;
978
979 default:
980 NS_FATAL_ERROR ("method unexpected in state " << ToString (m_state))do { std::cerr << "msg=\"" << "method unexpected in state "
<< ToString (m_state) << "\", "; do { std::cerr <<
"file=" << "../src/lte/model/lte-enb-rrc.cc" << ", line="
<< 980 << std::endl; ::ns3::FatalImpl::FlushStreams
(); if (true) std::terminate (); } while (false); } while (false
)
;
981 break;
982 }
983}
984
985void
986UeManager::RecvRrcConnectionReestablishmentRequest (LteRrcSap::RrcConnectionReestablishmentRequest msg)
987{
988 NS_LOG_FUNCTION (this)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this; std::clog << ")" << std::endl; } } while (
false)
;
989 switch (m_state)
990 {
991 case CONNECTED_NORMALLY:
992 break;
993
994 case HANDOVER_LEAVING:
995 m_handoverLeavingTimeout.Cancel ();
996 break;
997
998 default:
999 NS_FATAL_ERROR ("method unexpected in state " << ToString (m_state))do { std::cerr << "msg=\"" << "method unexpected in state "
<< ToString (m_state) << "\", "; do { std::cerr <<
"file=" << "../src/lte/model/lte-enb-rrc.cc" << ", line="
<< 999 << std::endl; ::ns3::FatalImpl::FlushStreams
(); if (true) std::terminate (); } while (false); } while (false
)
;
1000 break;
1001 }
1002
1003 LteRrcSap::RrcConnectionReestablishment msg2;
1004 msg2.rrcTransactionIdentifier = GetNewRrcTransactionIdentifier ();
1005 msg2.radioResourceConfigDedicated = BuildRadioResourceConfigDedicated ();
1006 m_rrc->m_rrcSapUser->SendRrcConnectionReestablishment (m_rnti, msg2);
1007 SwitchToState (CONNECTION_REESTABLISHMENT);
1008}
1009
1010void
1011UeManager::RecvRrcConnectionReestablishmentComplete (LteRrcSap::RrcConnectionReestablishmentComplete msg)
1012{
1013 NS_LOG_FUNCTION (this)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this; std::clog << ")" << std::endl; } } while (
false)
;
1014 SwitchToState (CONNECTED_NORMALLY);
1015}
1016
1017void
1018UeManager::RecvMeasurementReport (LteRrcSap::MeasurementReport msg)
1019{
1020 uint8_t measId = msg.measResults.measId;
1021 NS_LOG_FUNCTION (this << (uint16_t) measId)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this << (uint16_t) measId; std::clog << ")" <<
std::endl; } } while (false)
;
1022 NS_LOG_LOGIC ("measId " << (uint16_t) measIddo { if (g_log.IsEnabled (ns3::LOG_LOGIC)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; if (g_log.IsEnabled (ns3::LOG_PREFIX_FUNC)) { std
::clog << g_log.Name () << ":" << __FUNCTION__
<< "(): "; }; if (g_log.IsEnabled (ns3::LOG_PREFIX_LEVEL
)) { std::clog << "[" << g_log.GetLevelLabel (ns3
::LOG_LOGIC) << "] "; }; std::clog << "measId " <<
(uint16_t) measId << " haveMeasResultNeighCells " <<
msg.measResults.haveMeasResultNeighCells << " measResultListEutra "
<< msg.measResults.measResultListEutra.size () <<
" haveScellsMeas " << msg.measResults.haveScellsMeas <<
" measScellResultList " << msg.measResults.measScellResultList
.measResultScell.size () << std::endl; } } while (false
)
1023 << " haveMeasResultNeighCells " << msg.measResults.haveMeasResultNeighCellsdo { if (g_log.IsEnabled (ns3::LOG_LOGIC)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; if (g_log.IsEnabled (ns3::LOG_PREFIX_FUNC)) { std
::clog << g_log.Name () << ":" << __FUNCTION__
<< "(): "; }; if (g_log.IsEnabled (ns3::LOG_PREFIX_LEVEL
)) { std::clog << "[" << g_log.GetLevelLabel (ns3
::LOG_LOGIC) << "] "; }; std::clog << "measId " <<
(uint16_t) measId << " haveMeasResultNeighCells " <<
msg.measResults.haveMeasResultNeighCells << " measResultListEutra "
<< msg.measResults.measResultListEutra.size () <<
" haveScellsMeas " << msg.measResults.haveScellsMeas <<
" measScellResultList " << msg.measResults.measScellResultList
.measResultScell.size () << std::endl; } } while (false
)
1024 << " measResultListEutra " << msg.measResults.measResultListEutra.size ()do { if (g_log.IsEnabled (ns3::LOG_LOGIC)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; if (g_log.IsEnabled (ns3::LOG_PREFIX_FUNC)) { std
::clog << g_log.Name () << ":" << __FUNCTION__
<< "(): "; }; if (g_log.IsEnabled (ns3::LOG_PREFIX_LEVEL
)) { std::clog << "[" << g_log.GetLevelLabel (ns3
::LOG_LOGIC) << "] "; }; std::clog << "measId " <<
(uint16_t) measId << " haveMeasResultNeighCells " <<
msg.measResults.haveMeasResultNeighCells << " measResultListEutra "
<< msg.measResults.measResultListEutra.size () <<
" haveScellsMeas " << msg.measResults.haveScellsMeas <<
" measScellResultList " << msg.measResults.measScellResultList
.measResultScell.size () << std::endl; } } while (false
)
1025 << " haveScellsMeas " << msg.measResults.haveScellsMeasdo { if (g_log.IsEnabled (ns3::LOG_LOGIC)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; if (g_log.IsEnabled (ns3::LOG_PREFIX_FUNC)) { std
::clog << g_log.Name () << ":" << __FUNCTION__
<< "(): "; }; if (g_log.IsEnabled (ns3::LOG_PREFIX_LEVEL
)) { std::clog << "[" << g_log.GetLevelLabel (ns3
::LOG_LOGIC) << "] "; }; std::clog << "measId " <<
(uint16_t) measId << " haveMeasResultNeighCells " <<
msg.measResults.haveMeasResultNeighCells << " measResultListEutra "
<< msg.measResults.measResultListEutra.size () <<
" haveScellsMeas " << msg.measResults.haveScellsMeas <<
" measScellResultList " << msg.measResults.measScellResultList
.measResultScell.size () << std::endl; } } while (false
)
1026 << " measScellResultList " << msg.measResults.measScellResultList.measResultScell.size ())do { if (g_log.IsEnabled (ns3::LOG_LOGIC)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; if (g_log.IsEnabled (ns3::LOG_PREFIX_FUNC)) { std
::clog << g_log.Name () << ":" << __FUNCTION__
<< "(): "; }; if (g_log.IsEnabled (ns3::LOG_PREFIX_LEVEL
)) { std::clog << "[" << g_log.GetLevelLabel (ns3
::LOG_LOGIC) << "] "; }; std::clog << "measId " <<
(uint16_t) measId << " haveMeasResultNeighCells " <<
msg.measResults.haveMeasResultNeighCells << " measResultListEutra "
<< msg.measResults.measResultListEutra.size () <<
" haveScellsMeas " << msg.measResults.haveScellsMeas <<
" measScellResultList " << msg.measResults.measScellResultList
.measResultScell.size () << std::endl; } } while (false
)
;
1027 NS_LOG_LOGIC ("serving cellId " << m_rrc->m_cellIddo { if (g_log.IsEnabled (ns3::LOG_LOGIC)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; if (g_log.IsEnabled (ns3::LOG_PREFIX_FUNC)) { std
::clog << g_log.Name () << ":" << __FUNCTION__
<< "(): "; }; if (g_log.IsEnabled (ns3::LOG_PREFIX_LEVEL
)) { std::clog << "[" << g_log.GetLevelLabel (ns3
::LOG_LOGIC) << "] "; }; std::clog << "serving cellId "
<< m_rrc->m_cellId << " RSRP " << (uint16_t
) msg.measResults.rsrpResult << " RSRQ " << (uint16_t
) msg.measResults.rsrqResult << std::endl; } } while (false
)
1028 << " RSRP " << (uint16_t) msg.measResults.rsrpResultdo { if (g_log.IsEnabled (ns3::LOG_LOGIC)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; if (g_log.IsEnabled (ns3::LOG_PREFIX_FUNC)) { std
::clog << g_log.Name () << ":" << __FUNCTION__
<< "(): "; }; if (g_log.IsEnabled (ns3::LOG_PREFIX_LEVEL
)) { std::clog << "[" << g_log.GetLevelLabel (ns3
::LOG_LOGIC) << "] "; }; std::clog << "serving cellId "
<< m_rrc->m_cellId << " RSRP " << (uint16_t
) msg.measResults.rsrpResult << " RSRQ " << (uint16_t
) msg.measResults.rsrqResult << std::endl; } } while (false
)
1029 << " RSRQ " << (uint16_t) msg.measResults.rsrqResult)do { if (g_log.IsEnabled (ns3::LOG_LOGIC)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; if (g_log.IsEnabled (ns3::LOG_PREFIX_FUNC)) { std
::clog << g_log.Name () << ":" << __FUNCTION__
<< "(): "; }; if (g_log.IsEnabled (ns3::LOG_PREFIX_LEVEL
)) { std::clog << "[" << g_log.GetLevelLabel (ns3
::LOG_LOGIC) << "] "; }; std::clog << "serving cellId "
<< m_rrc->m_cellId << " RSRP " << (uint16_t
) msg.measResults.rsrpResult << " RSRQ " << (uint16_t
) msg.measResults.rsrqResult << std::endl; } } while (false
)
;
1030
1031 for (std::list <LteRrcSap::MeasResultEutra>::iterator it = msg.measResults.measResultListEutra.begin ();
1032 it != msg.measResults.measResultListEutra.end ();
1033 ++it)
1034 {
1035 NS_LOG_LOGIC ("neighbour cellId " << it->physCellIddo { if (g_log.IsEnabled (ns3::LOG_LOGIC)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; if (g_log.IsEnabled (ns3::LOG_PREFIX_FUNC)) { std
::clog << g_log.Name () << ":" << __FUNCTION__
<< "(): "; }; if (g_log.IsEnabled (ns3::LOG_PREFIX_LEVEL
)) { std::clog << "[" << g_log.GetLevelLabel (ns3
::LOG_LOGIC) << "] "; }; std::clog << "neighbour cellId "
<< it->physCellId << " RSRP " << (it->
haveRsrpResult ? (uint16_t) it->rsrpResult : 255) <<
" RSRQ " << (it->haveRsrqResult ? (uint16_t) it->
rsrqResult : 255) << std::endl; } } while (false)
1036 << " RSRP " << (it->haveRsrpResult ? (uint16_t) it->rsrpResult : 255)do { if (g_log.IsEnabled (ns3::LOG_LOGIC)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; if (g_log.IsEnabled (ns3::LOG_PREFIX_FUNC)) { std
::clog << g_log.Name () << ":" << __FUNCTION__
<< "(): "; }; if (g_log.IsEnabled (ns3::LOG_PREFIX_LEVEL
)) { std::clog << "[" << g_log.GetLevelLabel (ns3
::LOG_LOGIC) << "] "; }; std::clog << "neighbour cellId "
<< it->physCellId << " RSRP " << (it->
haveRsrpResult ? (uint16_t) it->rsrpResult : 255) <<
" RSRQ " << (it->haveRsrqResult ? (uint16_t) it->
rsrqResult : 255) << std::endl; } } while (false)
1037 << " RSRQ " << (it->haveRsrqResult ? (uint16_t) it->rsrqResult : 255))do { if (g_log.IsEnabled (ns3::LOG_LOGIC)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; if (g_log.IsEnabled (ns3::LOG_PREFIX_FUNC)) { std
::clog << g_log.Name () << ":" << __FUNCTION__
<< "(): "; }; if (g_log.IsEnabled (ns3::LOG_PREFIX_LEVEL
)) { std::clog << "[" << g_log.GetLevelLabel (ns3
::LOG_LOGIC) << "] "; }; std::clog << "neighbour cellId "
<< it->physCellId << " RSRP " << (it->
haveRsrpResult ? (uint16_t) it->rsrpResult : 255) <<
" RSRQ " << (it->haveRsrqResult ? (uint16_t) it->
rsrqResult : 255) << std::endl; } } while (false)
;
1038 }
1039
1040 if ((m_rrc->m_handoverManagementSapProvider != 0)
1041 && (m_rrc->m_handoverMeasIds.find (measId) != m_rrc->m_handoverMeasIds.end ()))
1042 {
1043 // this measurement was requested by the handover algorithm
1044 m_rrc->m_handoverManagementSapProvider->ReportUeMeas (m_rnti,
1045 msg.measResults);
1046 }
1047
1048 if ((m_rrc->m_ccmRrcSapProvider != 0)
1049 && (m_rrc->m_componentCarrierMeasIds.find (measId) != m_rrc->m_componentCarrierMeasIds.end ()))
1050 {
1051 // this measurement was requested by the handover algorithm
1052 m_rrc->m_ccmRrcSapProvider->ReportUeMeas (m_rnti,
1053 msg.measResults);
1054 }
1055
1056 if ((m_rrc->m_anrSapProvider != 0)
1057 && (m_rrc->m_anrMeasIds.find (measId) != m_rrc->m_anrMeasIds.end ()))
1058 {
1059 // this measurement was requested by the ANR function
1060 m_rrc->m_anrSapProvider->ReportUeMeas (msg.measResults);
1061 }
1062
1063 if ((m_rrc->m_ffrRrcSapProvider.at (0) != 0)
1064 && (m_rrc->m_ffrMeasIds.find (measId) != m_rrc->m_ffrMeasIds.end ()))
1065 {
1066 // this measurement was requested by the FFR function
1067 m_rrc->m_ffrRrcSapProvider.at (0)->ReportUeMeas (m_rnti, msg.measResults);
1068 }
1069 if (msg.measResults.haveScellsMeas == true)
1070 {
1071 for (std::list <LteRrcSap::MeasResultScell>::iterator it = msg.measResults.measScellResultList.measResultScell.begin ();
1072 it != msg.measResults.measScellResultList.measResultScell.end ();
1073 ++it)
1074 {
1075 m_rrc->m_ffrRrcSapProvider.at (it->servFreqId)->ReportUeMeas (m_rnti, msg.measResults);
1076 /// ToDo: implement on Ffr algorithm the code to properly parsing the new measResults message format
1077 /// alternatevely it is needed to 'repack' properly the measResults message before sending to Ffr
1078 }
1079 }
1080
1081 ///Report any measurements to ComponentCarrierManager, so it can react to any change or activate the SCC
1082 m_rrc->m_ccmRrcSapProvider->ReportUeMeas (m_rnti, msg.measResults);
1083 // fire a trace source
1084 m_rrc->m_recvMeasurementReportTrace (m_imsi, m_rrc->m_cellId, m_rnti, msg);
1085
1086} // end of UeManager::RecvMeasurementReport
1087
1088
1089// methods forwarded from CMAC SAP
1090
1091void
1092UeManager::CmacUeConfigUpdateInd (LteEnbCmacSapUser::UeConfig cmacParams)
1093{
1094 NS_LOG_FUNCTION (this << m_rnti)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this << m_rnti; std::clog << ")" << std::endl
; } } while (false)
;
1095 // at this stage used only by the scheduler for updating txMode
1096
1097 m_physicalConfigDedicated.antennaInfo.transmissionMode = cmacParams.m_transmissionMode;
1098
1099 m_needPhyMacConfiguration = true;
1100
1101 // reconfigure the UE RRC
1102 ScheduleRrcConnectionReconfiguration ();
1103}
1104
1105
1106// methods forwarded from PDCP SAP
1107
1108void
1109UeManager::DoReceivePdcpSdu (LtePdcpSapUser::ReceivePdcpSduParameters params)
1110{
1111 NS_LOG_FUNCTION (this)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this; std::clog << ")" << std::endl; } } while (
false)
;
1112 if (params.lcid > 2)
1113 {
1114 // data radio bearer
1115 EpsBearerTag tag;
1116 tag.SetRnti (params.rnti);
1117 tag.SetBid (Lcid2Bid (params.lcid));
1118 params.pdcpSdu->AddPacketTag (tag);
1119 m_rrc->m_forwardUpCallback (params.pdcpSdu);
1120 }
1121}
1122
1123
1124uint16_t
1125UeManager::GetRnti (void) const
1126{
1127 return m_rnti;
1128}
1129
1130uint64_t
1131UeManager::GetImsi (void) const
1132{
1133 return m_imsi;
1134}
1135
1136uint16_t
1137UeManager::GetSrsConfigurationIndex (void) const
1138{
1139 return m_physicalConfigDedicated.soundingRsUlConfigDedicated.srsConfigIndex;
1140}
1141
1142void
1143UeManager::SetSrsConfigurationIndex (uint16_t srsConfIndex)
1144{
1145 NS_LOG_FUNCTION (this)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this; std::clog << ")" << std::endl; } } while (
false)
;
1146 m_physicalConfigDedicated.soundingRsUlConfigDedicated.srsConfigIndex = srsConfIndex;
1147 for (uint16_t i = 0; i < m_rrc->m_numberOfComponentCarriers; i++)
1148 {
1149 m_rrc->m_cphySapProvider.at (i)->SetSrsConfigurationIndex (m_rnti, srsConfIndex);
1150 }
1151 switch (m_state)
1152 {
1153 case INITIAL_RANDOM_ACCESS:
1154 // do nothing, srs conf index will be correctly enforced upon
1155 // RRC connection establishment
1156 break;
1157
1158 default:
1159 ScheduleRrcConnectionReconfiguration ();
1160 break;
1161 }
1162}
1163
1164UeManager::State
1165UeManager::GetState (void) const
1166{
1167 return m_state;
1168}
1169
1170void
1171UeManager::SetPdschConfigDedicated (LteRrcSap::PdschConfigDedicated pdschConfigDedicated)
1172{
1173 NS_LOG_FUNCTION (this)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this; std::clog << ")" << std::endl; } } while (
false)
;
1174 m_physicalConfigDedicated.pdschConfigDedicated = pdschConfigDedicated;
1175
1176 m_needPhyMacConfiguration = true;
1177
1178 // reconfigure the UE RRC
1179 ScheduleRrcConnectionReconfiguration ();
1180}
1181
1182uint8_t
1183UeManager::AddDataRadioBearerInfo (Ptr<LteDataRadioBearerInfo> drbInfo)
1184{
1185 NS_LOG_FUNCTION (this)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this; std::clog << ")" << std::endl; } } while (
false)
;
1186 const uint8_t MAX_DRB_ID = 32;
1187 for (int drbid = (m_lastAllocatedDrbid + 1) % MAX_DRB_ID;
1188 drbid != m_lastAllocatedDrbid;
1189 drbid = (drbid + 1) % MAX_DRB_ID)
1190 {
1191 if (drbid != 0) // 0 is not allowed
1192 {
1193 if (m_drbMap.find (drbid) == m_drbMap.end ())
1194 {
1195 m_drbMap.insert (std::pair<uint8_t, Ptr<LteDataRadioBearerInfo> > (drbid, drbInfo));
1196 drbInfo->m_drbIdentity = drbid;
1197 m_lastAllocatedDrbid = drbid;
1198 return drbid;
1199 }
1200 }
1201 }
1202 NS_FATAL_ERROR ("no more data radio bearer ids available")do { std::cerr << "msg=\"" << "no more data radio bearer ids available"
<< "\", "; do { std::cerr << "file=" << "../src/lte/model/lte-enb-rrc.cc"
<< ", line=" << 1202 << std::endl; ::ns3::
FatalImpl::FlushStreams (); if (true) std::terminate (); } while
(false); } while (false)
;
1203 return 0;
1204}
1205
1206Ptr<LteDataRadioBearerInfo>
1207UeManager::GetDataRadioBearerInfo (uint8_t drbid)
1208{
1209 NS_LOG_FUNCTION (this << (uint32_t) drbid)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this << (uint32_t) drbid; std::clog << ")" <<
std::endl; } } while (false)
;
1210 NS_ASSERT (0 != drbid)do { if (!(0 != drbid)) { std::cerr << "assert failed. cond=\""
<< "0 != drbid" << "\", "; do { std::cerr <<
"file=" << "../src/lte/model/lte-enb-rrc.cc" << ", line="
<< 1210 << std::endl; ::ns3::FatalImpl::FlushStreams
(); if (true) std::terminate (); } while (false); } } while (
false)
;
1211 std::map<uint8_t, Ptr<LteDataRadioBearerInfo> >::iterator it = m_drbMap.find (drbid);
1212 NS_ABORT_IF (it == m_drbMap.end ())do { if (it == m_drbMap.end ()) { std::cerr << "aborted. cond=\""
<< "it == m_drbMap.end ()" << ", "; do { std::cerr
<< "file=" << "../src/lte/model/lte-enb-rrc.cc" <<
", line=" << 1212 << std::endl; ::ns3::FatalImpl
::FlushStreams (); if (true) std::terminate (); } while (false
); } } while (false)
;
1213 return it->second;
1214}
1215
1216
1217void
1218UeManager::RemoveDataRadioBearerInfo (uint8_t drbid)
1219{
1220 NS_LOG_FUNCTION (this << (uint32_t) drbid)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this << (uint32_t) drbid; std::clog << ")" <<
std::endl; } } while (false)
;
1221 std::map <uint8_t, Ptr<LteDataRadioBearerInfo> >::iterator it = m_drbMap.find (drbid);
1222 NS_ASSERT_MSG (it != m_drbMap.end (), "request to remove radio bearer with unknown drbid " << drbid)do { if (!(it != m_drbMap.end ())) { std::cerr << "assert failed. cond=\""
<< "it != m_drbMap.end ()" << "\", "; do { std::
cerr << "msg=\"" << "request to remove radio bearer with unknown drbid "
<< drbid << "\", "; do { std::cerr << "file="
<< "../src/lte/model/lte-enb-rrc.cc" << ", line="
<< 1222 << std::endl; ::ns3::FatalImpl::FlushStreams
(); if (true) std::terminate (); } while (false); } while (false
); } } while (false)
;
1223 m_drbMap.erase (it);
1224}
1225
1226
1227LteRrcSap::RrcConnectionReconfiguration
1228UeManager::BuildRrcConnectionReconfiguration ()
1229{
1230 NS_LOG_FUNCTION (this)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this; std::clog << ")" << std::endl; } } while (
false)
;
1231 LteRrcSap::RrcConnectionReconfiguration msg;
1232 msg.rrcTransactionIdentifier = GetNewRrcTransactionIdentifier ();
1233 msg.haveRadioResourceConfigDedicated = true;
1234 msg.radioResourceConfigDedicated = BuildRadioResourceConfigDedicated ();
1235 msg.haveMobilityControlInfo = false;
1236 msg.haveMeasConfig = true;
1237 msg.measConfig = m_rrc->m_ueMeasConfig;
1238 if ( m_caSupportConfigured == false && m_rrc->m_numberOfComponentCarriers > 1)
1239 {
1240 m_caSupportConfigured = true;
1241 NS_LOG_FUNCTION ( this << "CA not configured. Configure now!" )do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this << "CA not configured. Configure now!"; std::clog
<< ")" << std::endl; } } while (false)
;
1242 msg.haveNonCriticalExtension = true;
1243 msg.nonCriticalExtension = BuildNonCriticalExtentionConfigurationCa ();
1244 NS_LOG_FUNCTION ( this << " haveNonCriticalExtension " << msg.haveNonCriticalExtension )do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this << " haveNonCriticalExtension " << msg.haveNonCriticalExtension
; std::clog << ")" << std::endl; } } while (false
)
;
1245 }
1246 else
1247 {
1248 msg.haveNonCriticalExtension = false;
1249 }
1250
1251 return msg;
1252}
1253
1254LteRrcSap::RadioResourceConfigDedicated
1255UeManager::BuildRadioResourceConfigDedicated ()
1256{
1257 LteRrcSap::RadioResourceConfigDedicated rrcd;
1258
1259 if (m_srb1 != 0)
1260 {
1261 LteRrcSap::SrbToAddMod stam;
1262 stam.srbIdentity = m_srb1->m_srbIdentity;
1263 stam.logicalChannelConfig = m_srb1->m_logicalChannelConfig;
1264 rrcd.srbToAddModList.push_back (stam);
1265 }
1266
1267 for (std::map <uint8_t, Ptr<LteDataRadioBearerInfo> >::iterator it = m_drbMap.begin ();
1268 it != m_drbMap.end ();
1269 ++it)
1270 {
1271 LteRrcSap::DrbToAddMod dtam;
1272 dtam.epsBearerIdentity = it->second->m_epsBearerIdentity;
1273 dtam.drbIdentity = it->second->m_drbIdentity;
1274 dtam.rlcConfig = it->second->m_rlcConfig;
1275 dtam.logicalChannelIdentity = it->second->m_logicalChannelIdentity;
1276 dtam.logicalChannelConfig = it->second->m_logicalChannelConfig;
1277 rrcd.drbToAddModList.push_back (dtam);
1278 }
1279
1280 rrcd.havePhysicalConfigDedicated = true;
1281 rrcd.physicalConfigDedicated = m_physicalConfigDedicated;
1282 return rrcd;
1283}
1284
1285uint8_t
1286UeManager::GetNewRrcTransactionIdentifier ()
1287{
1288 return ++m_lastRrcTransactionIdentifier;
1289}
1290
1291uint8_t
1292UeManager::Lcid2Drbid (uint8_t lcid)
1293{
1294 NS_ASSERT (lcid > 2)do { if (!(lcid > 2)) { std::cerr << "assert failed. cond=\""
<< "lcid > 2" << "\", "; do { std::cerr <<
"file=" << "../src/lte/model/lte-enb-rrc.cc" << ", line="
<< 1294 << std::endl; ::ns3::FatalImpl::FlushStreams
(); if (true) std::terminate (); } while (false); } } while (
false)
;
1295 return lcid - 2;
1296}
1297
1298uint8_t
1299UeManager::Drbid2Lcid (uint8_t drbid)
1300{
1301 return drbid + 2;
1302}
1303uint8_t
1304UeManager::Lcid2Bid (uint8_t lcid)
1305{
1306 NS_ASSERT (lcid > 2)do { if (!(lcid > 2)) { std::cerr << "assert failed. cond=\""
<< "lcid > 2" << "\", "; do { std::cerr <<
"file=" << "../src/lte/model/lte-enb-rrc.cc" << ", line="
<< 1306 << std::endl; ::ns3::FatalImpl::FlushStreams
(); if (true) std::terminate (); } while (false); } } while (
false)
;
1307 return lcid - 2;
1308}
1309
1310uint8_t
1311UeManager::Bid2Lcid (uint8_t bid)
1312{
1313 return bid + 2;
1314}
1315
1316uint8_t
1317UeManager::Drbid2Bid (uint8_t drbid)
1318{
1319 return drbid;
1320}
1321
1322uint8_t
1323UeManager::Bid2Drbid (uint8_t bid)
1324{
1325 return bid;
1326}
1327
1328
1329void
1330UeManager::SwitchToState (State newState)
1331{
1332 NS_LOG_FUNCTION (this << ToString (newState))do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this << ToString (newState); std::clog << ")" <<
std::endl; } } while (false)
;
1333 State oldState = m_state;
1334 m_state = newState;
1335 NS_LOG_INFO (this << " IMSI " << m_imsi << " RNTI " << m_rnti << " UeManager "do { if (g_log.IsEnabled (ns3::LOG_INFO)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; if (g_log.IsEnabled (ns3::LOG_PREFIX_FUNC)) { std
::clog << g_log.Name () << ":" << __FUNCTION__
<< "(): "; }; if (g_log.IsEnabled (ns3::LOG_PREFIX_LEVEL
)) { std::clog << "[" << g_log.GetLevelLabel (ns3
::LOG_INFO) << "] "; }; std::clog << this <<
" IMSI " << m_imsi << " RNTI " << m_rnti <<
" UeManager " << ToString (oldState) << " --> "
<< ToString (newState) << std::endl; } } while (
false)
1336 << ToString (oldState) << " --> " << ToString (newState))do { if (g_log.IsEnabled (ns3::LOG_INFO)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; if (g_log.IsEnabled (ns3::LOG_PREFIX_FUNC)) { std
::clog << g_log.Name () << ":" << __FUNCTION__
<< "(): "; }; if (g_log.IsEnabled (ns3::LOG_PREFIX_LEVEL
)) { std::clog << "[" << g_log.GetLevelLabel (ns3
::LOG_INFO) << "] "; }; std::clog << this <<
" IMSI " << m_imsi << " RNTI " << m_rnti <<
" UeManager " << ToString (oldState) << " --> "
<< ToString (newState) << std::endl; } } while (
false)
;
1337 m_stateTransitionTrace (m_imsi, m_rrc->m_cellId, m_rnti, oldState, newState);
1338
1339 switch (newState)
1340 {
1341 case INITIAL_RANDOM_ACCESS:
1342 case HANDOVER_JOINING:
1343 NS_FATAL_ERROR ("cannot switch to an initial state")do { std::cerr << "msg=\"" << "cannot switch to an initial state"
<< "\", "; do { std::cerr << "file=" << "../src/lte/model/lte-enb-rrc.cc"
<< ", line=" << 1343 << std::endl; ::ns3::
FatalImpl::FlushStreams (); if (true) std::terminate (); } while
(false); } while (false)
;
1344 break;
1345
1346 case CONNECTION_SETUP:
1347 break;
1348
1349 case CONNECTED_NORMALLY:
1350 {
1351 if (m_pendingRrcConnectionReconfiguration == true)
1352 {
1353 ScheduleRrcConnectionReconfiguration ();
1354 }
1355 if (m_pendingStartDataRadioBearers == true && m_caSupportConfigured == true)
1356 {
1357 StartDataRadioBearers ();
1358 }
1359 }
1360 break;
1361
1362 case CONNECTION_RECONFIGURATION:
1363 break;
1364
1365 case CONNECTION_REESTABLISHMENT:
1366 break;
1367
1368 case HANDOVER_LEAVING:
1369 break;
1370
1371 default:
1372 break;
1373 }
1374}
1375
1376LteRrcSap::NonCriticalExtensionConfiguration
1377UeManager::BuildNonCriticalExtentionConfigurationCa ()
1378{
1379 NS_LOG_FUNCTION ( this )do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this; std::clog << ")" << std::endl; } } while (
false)
;
1380 LteRrcSap::NonCriticalExtensionConfiguration ncec;
1381
1382 // LteRrcSap::SCellToAddMod scell;
1383 std::list<LteRrcSap::SCellToAddMod> SccCon;
1384
1385 // sCellToReleaseList is always empty since no Scc is released
1386 std::map<uint8_t, ComponentCarrier >::iterator it = m_rrc->m_componentCarrierPhyConf.begin();
1387
1388 it++;
1389 for (;it!=m_rrc->m_componentCarrierPhyConf.end(); it++)
1390 {
1391
1392 uint8_t ccId = it->first;
1393 ComponentCarrier eNbCcm = it->second;
1394 LteRrcSap::SCellToAddMod component;
1395 component.sCellIndex = ccId;
1396 component.cellIdentification.physCellId = m_rrc->m_cellId;
1397 component.cellIdentification.dlCarrierFreq = eNbCcm.m_dlEarfcn;
1398 component.radioResourceConfigCommonSCell.haveNonUlConfiguration = true;
1399 component.radioResourceConfigCommonSCell.nonUlConfiguration.dlBandwidth = eNbCcm.m_dlBandwidth;
1400 component.radioResourceConfigCommonSCell.nonUlConfiguration.antennaInfoCommon.antennaPortsCount = 0;
1401 component.radioResourceConfigCommonSCell.nonUlConfiguration.pdschConfigCommon.referenceSignalPower = m_rrc->m_cphySapProvider.at (0)->GetReferenceSignalPower ();
1402 component.radioResourceConfigCommonSCell.nonUlConfiguration.pdschConfigCommon.pb = 0;
1403 component.radioResourceConfigCommonSCell.haveUlConfiguration = true;
1404 component.radioResourceConfigCommonSCell.ulConfiguration.ulFreqInfo.ulCarrierFreq = eNbCcm.m_ulEarfcn;
1405 component.radioResourceConfigCommonSCell.ulConfiguration.ulFreqInfo.ulBandwidth = eNbCcm.m_ulBandwidth;
1406 component.radioResourceConfigCommonSCell.ulConfiguration.ulPowerControlCommonSCell.alpha = 0;
1407 //component.radioResourceConfigCommonSCell.ulConfiguration.soundingRsUlConfigCommon.type = LteRrcSap::SoundingRsUlConfigDedicated::SETUP;
1408 component.radioResourceConfigCommonSCell.ulConfiguration.soundingRsUlConfigCommon.srsBandwidthConfig = 0;
1409 component.radioResourceConfigCommonSCell.ulConfiguration.soundingRsUlConfigCommon.srsSubframeConfig = 0;
1410 component.radioResourceConfigCommonSCell.ulConfiguration.prachConfigSCell.index = 0;
1411
1412 if (true)
1413 {
1414 component.haveRadioResourceConfigDedicatedSCell = true;
1415 component.radioResourceConfigDedicateSCell.physicalConfigDedicatedSCell.haveNonUlConfiguration = true;
1416 component.radioResourceConfigDedicateSCell.physicalConfigDedicatedSCell.haveAntennaInfoDedicated = true;
1417 component.radioResourceConfigDedicateSCell.physicalConfigDedicatedSCell.antennaInfo.transmissionMode = m_rrc->m_defaultTransmissionMode;
1418 component.radioResourceConfigDedicateSCell.physicalConfigDedicatedSCell.crossCarrierSchedulingConfig = false;
1419 component.radioResourceConfigDedicateSCell.physicalConfigDedicatedSCell.havePdschConfigDedicated = true;
1420 component.radioResourceConfigDedicateSCell.physicalConfigDedicatedSCell.pdschConfigDedicated.pa = LteRrcSap::PdschConfigDedicated::dB0;
1421 component.radioResourceConfigDedicateSCell.physicalConfigDedicatedSCell.haveUlConfiguration = true;
1422 component.radioResourceConfigDedicateSCell.physicalConfigDedicatedSCell.haveAntennaInfoDedicated = true;
1423 component.radioResourceConfigDedicateSCell.physicalConfigDedicatedSCell.antennaInfoUl.transmissionMode = m_rrc->m_defaultTransmissionMode;
1424 component.radioResourceConfigDedicateSCell.physicalConfigDedicatedSCell.pushConfigDedicatedSCell.nPuschIdentity = 0;
1425 component.radioResourceConfigDedicateSCell.physicalConfigDedicatedSCell.ulPowerControlDedicatedSCell.pSrsOffset = 0;
1426 component.radioResourceConfigDedicateSCell.physicalConfigDedicatedSCell.haveSoundingRsUlConfigDedicated = true;
1427 component.radioResourceConfigDedicateSCell.physicalConfigDedicatedSCell.soundingRsUlConfigDedicated.srsConfigIndex = GetSrsConfigurationIndex();
1428 component.radioResourceConfigDedicateSCell.physicalConfigDedicatedSCell.soundingRsUlConfigDedicated.type = LteRrcSap::SoundingRsUlConfigDedicated::SETUP;
1429 component.radioResourceConfigDedicateSCell.physicalConfigDedicatedSCell.soundingRsUlConfigDedicated.srsBandwidth = 0;
1430 }
1431 else
1432 {
1433 component.haveRadioResourceConfigDedicatedSCell = false;
1434 }
1435 SccCon.push_back (component);
1436 }
1437 ncec.sCellsToAddModList = SccCon;
1438
1439 return ncec;
1440}
1441
1442
1443///////////////////////////////////////////
1444// eNB RRC methods
1445///////////////////////////////////////////
1446
1447NS_OBJECT_ENSURE_REGISTERED (LteEnbRrc)static struct ObjectLteEnbRrcRegistrationClass { ObjectLteEnbRrcRegistrationClass
() { ns3::TypeId tid = LteEnbRrc::GetTypeId (); tid.SetSize (
sizeof (LteEnbRrc)); tid.GetParent (); } } ObjectLteEnbRrcRegistrationVariable
;
1448
1449LteEnbRrc::LteEnbRrc ()
1450 : m_x2SapProvider (0),
1451 m_cmacSapProvider (0),
1452 m_handoverManagementSapProvider (0),
1453 m_ccmRrcSapProvider (0),
1454 m_anrSapProvider (0),
1455 m_ffrRrcSapProvider (0),
1456 m_rrcSapUser (0),
1457 m_macSapProvider (0),
1458 m_s1SapProvider (0),
1459 m_cphySapProvider (0),
1460 m_configured (false),
1461 m_lastAllocatedRnti (0),
1462 m_srsCurrentPeriodicityId (0),
1463 m_lastAllocatedConfigurationIndex (0),
1464 m_reconfigureUes (false),
1465 m_numberOfComponentCarriers (0),
1466 m_carriersConfigured (false)
1467{
1468 NS_LOG_FUNCTION (this)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this; std::clog << ")" << std::endl; } } while (
false)
;
1469 m_cmacSapUser.push_back (new EnbRrcMemberLteEnbCmacSapUser (this));
1470 m_handoverManagementSapUser = new MemberLteHandoverManagementSapUser<LteEnbRrc> (this);
1471 m_anrSapUser = new MemberLteAnrSapUser<LteEnbRrc> (this);
1472 m_ffrRrcSapUser.push_back (new MemberLteFfrRrcSapUser<LteEnbRrc> (this));
1473 m_rrcSapProvider = new MemberLteEnbRrcSapProvider<LteEnbRrc> (this);
1474 m_x2SapUser = new EpcX2SpecificEpcX2SapUser<LteEnbRrc> (this);
1475 m_s1SapUser = new MemberEpcEnbS1SapUser<LteEnbRrc> (this);
1476 m_cphySapUser.push_back (new MemberLteEnbCphySapUser<LteEnbRrc> (this));
1477 m_ccmRrcSapUser = new MemberLteCcmRrcSapUser <LteEnbRrc>(this);
1478 m_cphySapProvider.push_back (0);
1479 m_cmacSapProvider.push_back (0);
1480 m_ffrRrcSapProvider.push_back (0);
1481}
1482
1483void LteEnbRrc::ConfigureCarriers(std::map<uint8_t, ComponentCarrier > ccPhyConf, uint16_t numberOfComponentCarriers)
1484{
1485 NS_ASSERT_MSG (!m_carriersConfigured, "Secondary carriers can be configured only once.")do { if (!(!m_carriersConfigured)) { std::cerr << "assert failed. cond=\""
<< "!m_carriersConfigured" << "\", "; do { std::
cerr << "msg=\"" << "Secondary carriers can be configured only once."
<< "\", "; do { std::cerr << "file=" << "../src/lte/model/lte-enb-rrc.cc"
<< ", line=" << 1485 << std::endl; ::ns3::
FatalImpl::FlushStreams (); if (true) std::terminate (); } while
(false); } while (false); } } while (false)
;
1486 m_componentCarrierPhyConf = ccPhyConf;
1487 m_numberOfComponentCarriers = numberOfComponentCarriers;
1488
1489 if (m_numberOfComponentCarriers < MIN_NO_CC1 || m_numberOfComponentCarriers > MAX_NO_CC5)
1490 {
1491 // this check is neede in order to maintain backward compatibility with scripts and tests
1492 // if case lte-helper is not used (like in several tests) the m_numberOfComponentCarriers
1493 // is not set and then an error is rised
1494 // In this case m_numberOfComponentCarriers is set to 1
1495 m_numberOfComponentCarriers = MIN_NO_CC1;
1496 }
1497
1498 if (m_numberOfComponentCarriers > MIN_NO_CC1)
1499 {
1500 for ( uint8_t i = 1; i < m_numberOfComponentCarriers ; i++)
1501 {
1502 m_cphySapUser.push_back (new MemberLteEnbCphySapUser<LteEnbRrc> (this));
1503 m_cmacSapUser.push_back (new EnbRrcMemberLteEnbCmacSapUser (this));
1504 m_ffrRrcSapUser.push_back (new MemberLteFfrRrcSapUser<LteEnbRrc> (this));
1505 m_cphySapProvider.push_back (0);
1506 m_cmacSapProvider.push_back (0);
1507 m_ffrRrcSapProvider.push_back (0);
1508 }
1509 }
1510 m_carriersConfigured = true;
1511 Object::DoInitialize ();
1512}
1513
1514LteEnbRrc::~LteEnbRrc ()
1515{
1516 NS_LOG_FUNCTION (this)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this; std::clog << ")" << std::endl; } } while (
false)
;
1517}
1518
1519
1520void
1521LteEnbRrc::DoDispose ()
1522{
1523 NS_LOG_FUNCTION (this)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this; std::clog << ")" << std::endl; } } while (
false)
;
1524 for ( uint8_t i = 0; i < m_numberOfComponentCarriers ; i++)
1525 {
1526 delete m_cphySapUser[i];
1527 delete m_cmacSapUser[i];
1528 delete m_ffrRrcSapUser[i];
1529 }
1530 //delete m_cphySapUser;
1531 m_cphySapUser.erase (m_cphySapUser.begin (),m_cphySapUser.end ());
1532 m_cphySapUser.clear ();
1533 //delete m_cmacSapUser;
1534 m_cmacSapUser.erase (m_cmacSapUser.begin (),m_cmacSapUser.end ());
1535 m_cmacSapUser.clear ();
1536 //delete m_ffrRrcSapUser;
1537 m_ffrRrcSapUser.erase (m_ffrRrcSapUser.begin (),m_ffrRrcSapUser.end ());
1538 m_ffrRrcSapUser.clear ();
1539 m_ueMap.clear ();
1540 delete m_handoverManagementSapUser;
1541 delete m_ccmRrcSapUser;
1542 delete m_anrSapUser;
1543 delete m_rrcSapProvider;
1544 delete m_x2SapUser;
1545 delete m_s1SapUser;
1546
1547}
1548
1549TypeId
1550LteEnbRrc::GetTypeId (void)
1551{
1552 NS_LOG_FUNCTION ("LteEnbRrc::GetTypeId")do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
"LteEnbRrc::GetTypeId"; std::clog << ")" << std::
endl; } } while (false)
;
1553 static TypeId tid = TypeId ("ns3::LteEnbRrc")
1554 .SetParent<Object> ()
1555 .SetGroupName("Lte")
1556 .AddConstructor<LteEnbRrc> ()
1557 .AddAttribute ("UeMap", "List of UeManager by C-RNTI.",
1558 ObjectMapValue (),
1559 MakeObjectMapAccessor (&LteEnbRrc::m_ueMap),
1560 MakeObjectMapChecker<UeManager> ())
1561 .AddAttribute ("DefaultTransmissionMode",
1562 "The default UEs' transmission mode (0: SISO)",
1563 UintegerValue (0), // default tx-mode
1564 MakeUintegerAccessor (&LteEnbRrc::m_defaultTransmissionMode),
1565 MakeUintegerChecker<uint8_t> ())
1566 .AddAttribute ("EpsBearerToRlcMapping",
1567 "Specify which type of RLC will be used for each type of EPS bearer. ",
1568 EnumValue (RLC_SM_ALWAYS),
1569 MakeEnumAccessor (&LteEnbRrc::m_epsBearerToRlcMapping),
1570 MakeEnumChecker (RLC_SM_ALWAYS, "RlcSmAlways",
1571 RLC_UM_ALWAYS, "RlcUmAlways",
1572 RLC_AM_ALWAYS, "RlcAmAlways",
1573 PER_BASED, "PacketErrorRateBased"))
1574 .AddAttribute ("SystemInformationPeriodicity",
1575 "The interval for sending system information (Time value)",
1576 TimeValue (MilliSeconds (80)),
1577 MakeTimeAccessor (&LteEnbRrc::m_systemInformationPeriodicity),
1578 MakeTimeChecker ())
1579
1580 // SRS related attributes
1581 .AddAttribute ("SrsPeriodicity",
1582 "The SRS periodicity in milliseconds",
1583 UintegerValue (40),
1584 MakeUintegerAccessor (&LteEnbRrc::SetSrsPeriodicity,
1585 &LteEnbRrc::GetSrsPeriodicity),
1586 MakeUintegerChecker<uint32_t> ())
1587
1588 // Timeout related attributes
1589 .AddAttribute ("ConnectionRequestTimeoutDuration",
1590 "After a RA attempt, if no RRC CONNECTION REQUEST is "
1591 "received before this time, the UE context is destroyed. "
1592 "Must account for reception of RAR and transmission of "
1593 "RRC CONNECTION REQUEST over UL GRANT.",
1594 TimeValue (MilliSeconds (15)),
1595 MakeTimeAccessor (&LteEnbRrc::m_connectionRequestTimeoutDuration),
1596 MakeTimeChecker ())
1597 .AddAttribute ("ConnectionSetupTimeoutDuration",
1598 "After accepting connection request, if no RRC CONNECTION "
1599 "SETUP COMPLETE is received before this time, the UE "
1600 "context is destroyed. Must account for the UE's reception "
1601 "of RRC CONNECTION SETUP and transmission of RRC CONNECTION "
1602 "SETUP COMPLETE.",
1603 TimeValue (MilliSeconds (150)),
1604 MakeTimeAccessor (&LteEnbRrc::m_connectionSetupTimeoutDuration),
1605 MakeTimeChecker ())
1606 .AddAttribute ("ConnectionRejectedTimeoutDuration",
1607 "Time to wait between sending a RRC CONNECTION REJECT and "
1608 "destroying the UE context",
1609 TimeValue (MilliSeconds (30)),
1610 MakeTimeAccessor (&LteEnbRrc::m_connectionRejectedTimeoutDuration),
1611 MakeTimeChecker ())
1612 .AddAttribute ("HandoverJoiningTimeoutDuration",
1613 "After accepting a handover request, if no RRC CONNECTION "
1614 "RECONFIGURATION COMPLETE is received before this time, the "
1615 "UE context is destroyed. Must account for reception of "
1616 "X2 HO REQ ACK by source eNB, transmission of the Handover "
1617 "Command, non-contention-based random access and reception "
1618 "of the RRC CONNECTION RECONFIGURATION COMPLETE message.",
1619 TimeValue (MilliSeconds (200)),
1620 MakeTimeAccessor (&LteEnbRrc::m_handoverJoiningTimeoutDuration),
1621 MakeTimeChecker ())
1622 .AddAttribute ("HandoverLeavingTimeoutDuration",
1623 "After issuing a Handover Command, if neither RRC "
1624 "CONNECTION RE-ESTABLISHMENT nor X2 UE Context Release has "
1625 "been previously received, the UE context is destroyed.",
1626 TimeValue (MilliSeconds (500)),
1627 MakeTimeAccessor (&LteEnbRrc::m_handoverLeavingTimeoutDuration),
1628 MakeTimeChecker ())
1629
1630 // Cell selection related attribute
1631 .AddAttribute ("QRxLevMin",
1632 "One of information transmitted within the SIB1 message, "
1633 "indicating the required minimum RSRP level that any UE must "
1634 "receive from this cell before it is allowed to camp to this "
1635 "cell. The default value -70 corresponds to -140 dBm and is "
1636 "the lowest possible value as defined by Section 6.3.4 of "
1637 "3GPP TS 36.133. This restriction, however, only applies to "
1638 "initial cell selection and EPC-enabled simulation.",
1639 TypeId::ATTR_GET | TypeId::ATTR_CONSTRUCT,
1640 IntegerValue (-70),
1641 MakeIntegerAccessor (&LteEnbRrc::m_qRxLevMin),
1642 MakeIntegerChecker<int8_t> (-70, -22))
1643 .AddAttribute ("NumberOfComponentCarriers",
1644 "Number of Component Carriers ",
1645 UintegerValue (1),
1646 MakeIntegerAccessor (&LteEnbRrc::m_numberOfComponentCarriers),
1647 MakeIntegerChecker<int16_t> (MIN_NO_CC1, 2)) // to change, currently the CC number is liited to 2
1648
1649 // Handover related attributes
1650 .AddAttribute ("AdmitHandoverRequest",
1651 "Whether to admit an X2 handover request from another eNB",
1652 BooleanValue (true),
1653 MakeBooleanAccessor (&LteEnbRrc::m_admitHandoverRequest),
1654 MakeBooleanChecker ())
1655 .AddAttribute ("AdmitRrcConnectionRequest",
1656 "Whether to admit a connection request from a UE",
1657 BooleanValue (true),
1658 MakeBooleanAccessor (&LteEnbRrc::m_admitRrcConnectionRequest),
1659 MakeBooleanChecker ())
1660
1661 // UE measurements related attributes
1662 .AddAttribute ("RsrpFilterCoefficient",
1663 "Determines the strength of smoothing effect induced by "
1664 "layer 3 filtering of RSRP in all attached UE; "
1665 "if set to 0, no layer 3 filtering is applicable",
1666 // i.e. the variable k in 3GPP TS 36.331 section 5.5.3.2
1667 UintegerValue (4),
1668 MakeUintegerAccessor (&LteEnbRrc::m_rsrpFilterCoefficient),
1669 MakeUintegerChecker<uint8_t> (0))
1670 .AddAttribute ("RsrqFilterCoefficient",
1671 "Determines the strength of smoothing effect induced by "
1672 "layer 3 filtering of RSRQ in all attached UE; "
1673 "if set to 0, no layer 3 filtering is applicable",
1674 // i.e. the variable k in 3GPP TS 36.331 section 5.5.3.2
1675 UintegerValue (4),
1676 MakeUintegerAccessor (&LteEnbRrc::m_rsrqFilterCoefficient),
1677 MakeUintegerChecker<uint8_t> (0))
1678
1679 // Trace sources
1680 .AddTraceSource ("NewUeContext",
1681 "Fired upon creation of a new UE context.",
1682 MakeTraceSourceAccessor (&LteEnbRrc::m_newUeContextTrace),
1683 "ns3::LteEnbRrc::NewUeContextTracedCallback")
1684 .AddTraceSource ("ConnectionEstablished",
1685 "Fired upon successful RRC connection establishment.",
1686 MakeTraceSourceAccessor (&LteEnbRrc::m_connectionEstablishedTrace),
1687 "ns3::LteEnbRrc::ConnectionHandoverTracedCallback")
1688 .AddTraceSource ("ConnectionReconfiguration",
1689 "trace fired upon RRC connection reconfiguration",
1690 MakeTraceSourceAccessor (&LteEnbRrc::m_connectionReconfigurationTrace),
1691 "ns3::LteEnbRrc::ConnectionHandoverTracedCallback")
1692 .AddTraceSource ("HandoverStart",
1693 "trace fired upon start of a handover procedure",
1694 MakeTraceSourceAccessor (&LteEnbRrc::m_handoverStartTrace),
1695 "ns3::LteEnbRrc::HandoverStartTracedCallback")
1696 .AddTraceSource ("HandoverEndOk",
1697 "trace fired upon successful termination of a handover procedure",
1698 MakeTraceSourceAccessor (&LteEnbRrc::m_handoverEndOkTrace),
1699 "ns3::LteEnbRrc::ConnectionHandoverTracedCallback")
1700 .AddTraceSource ("RecvMeasurementReport",
1701 "trace fired when measurement report is received",
1702 MakeTraceSourceAccessor (&LteEnbRrc::m_recvMeasurementReportTrace),
1703 "ns3::LteEnbRrc::ReceiveReportTracedCallback")
1704 ;
1705 return tid;
1706}
1707
1708void
1709LteEnbRrc::SetEpcX2SapProvider (EpcX2SapProvider * s)
1710{
1711 NS_LOG_FUNCTION (this << s)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this << s; std::clog << ")" << std::endl; }
} while (false)
;
1712 m_x2SapProvider = s;
1713}
1714
1715EpcX2SapUser*
1716LteEnbRrc::GetEpcX2SapUser ()
1717{
1718 NS_LOG_FUNCTION (this)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this; std::clog << ")" << std::endl; } } while (
false)
;
1719 return m_x2SapUser;
1720}
1721
1722void
1723LteEnbRrc::SetLteEnbCmacSapProvider (LteEnbCmacSapProvider * s)
1724{
1725 NS_LOG_FUNCTION (this << s)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this << s; std::clog << ")" << std::endl; }
} while (false)
;
1726 m_cmacSapProvider.at (0) = s;
1727}
1728
1729void
1730LteEnbRrc::SetLteEnbCmacSapProvider (LteEnbCmacSapProvider * s, uint8_t pos)
1731{
1732 NS_LOG_FUNCTION (this << s)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this << s; std::clog << ")" << std::endl; }
} while (false)
;
1733 m_cmacSapProvider.at (pos) = s;
1734}
1735
1736LteEnbCmacSapUser*
1737LteEnbRrc::GetLteEnbCmacSapUser ()
1738{
1739 NS_LOG_FUNCTION (this)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this; std::clog << ")" << std::endl; } } while (
false)
;
1740 return m_cmacSapUser.at (0);
1741}
1742
1743LteEnbCmacSapUser*
1744LteEnbRrc::GetLteEnbCmacSapUser (uint8_t pos)
1745{
1746 NS_LOG_FUNCTION (this)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this; std::clog << ")" << std::endl; } } while (
false)
;
1747 return m_cmacSapUser.at (pos);
1748}
1749
1750void
1751LteEnbRrc::SetLteHandoverManagementSapProvider (LteHandoverManagementSapProvider * s)
1752{
1753 NS_LOG_FUNCTION (this << s)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this << s; std::clog << ")" << std::endl; }
} while (false)
;
1754 m_handoverManagementSapProvider = s;
1755}
1756
1757LteHandoverManagementSapUser*
1758LteEnbRrc::GetLteHandoverManagementSapUser ()
1759{
1760 NS_LOG_FUNCTION (this)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this; std::clog << ")" << std::endl; } } while (
false)
;
1761 return m_handoverManagementSapUser;
1762}
1763
1764void
1765LteEnbRrc::SetLteCcmRrcSapProvider (LteCcmRrcSapProvider * s)
1766{
1767 NS_LOG_FUNCTION (this << s)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this << s; std::clog << ")" << std::endl; }
} while (false)
;
1768 m_ccmRrcSapProvider = s;
1769}
1770
1771LteCcmRrcSapUser*
1772LteEnbRrc::GetLteCcmRrcSapUser ()
1773{
1774 NS_LOG_FUNCTION (this)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this; std::clog << ")" << std::endl; } } while (
false)
;
1775 return m_ccmRrcSapUser;
1776}
1777
1778void
1779LteEnbRrc::SetLteAnrSapProvider (LteAnrSapProvider * s)
1780{
1781 NS_LOG_FUNCTION (this << s)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this << s; std::clog << ")" << std::endl; }
} while (false)
;
1782 m_anrSapProvider = s;
1783}
1784
1785LteAnrSapUser*
1786LteEnbRrc::GetLteAnrSapUser ()
1787{
1788 NS_LOG_FUNCTION (this)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this; std::clog << ")" << std::endl; } } while (
false)
;
1789 return m_anrSapUser;
1790}
1791
1792void
1793LteEnbRrc::SetLteFfrRrcSapProvider (LteFfrRrcSapProvider * s)
1794{
1795 NS_LOG_FUNCTION (this << s)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this << s; std::clog << ")" << std::endl; }
} while (false)
;
1796 m_ffrRrcSapProvider.at (0) = s;
1797}
1798
1799void
1800LteEnbRrc::SetLteFfrRrcSapProvider (LteFfrRrcSapProvider * s, uint8_t index)
1801{
1802 NS_LOG_FUNCTION (this << s)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this << s; std::clog << ")" << std::endl; }
} while (false)
;
1803 m_ffrRrcSapProvider.at (index) = s;
1804}
1805
1806LteFfrRrcSapUser*
1807LteEnbRrc::GetLteFfrRrcSapUser ()
1808{
1809 NS_LOG_FUNCTION (this)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this; std::clog << ")" << std::endl; } } while (
false)
;
1810 return m_ffrRrcSapUser.at (0);
1811}
1812
1813LteFfrRrcSapUser*
1814LteEnbRrc::GetLteFfrRrcSapUser (uint8_t index)
1815{
1816 NS_LOG_FUNCTION (this)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this; std::clog << ")" << std::endl; } } while (
false)
;
1817 NS_ASSERT_MSG (index < m_numberOfComponentCarriers, "Invalid component carrier index:"<<index<<" provided in order to obtain FfrRrcSapUser.")do { if (!(index < m_numberOfComponentCarriers)) { std::cerr
<< "assert failed. cond=\"" << "index < m_numberOfComponentCarriers"
<< "\", "; do { std::cerr << "msg=\"" << "Invalid component carrier index:"
<<index<<" provided in order to obtain FfrRrcSapUser."
<< "\", "; do { std::cerr << "file=" << "../src/lte/model/lte-enb-rrc.cc"
<< ", line=" << 1817 << std::endl; ::ns3::
FatalImpl::FlushStreams (); if (true) std::terminate (); } while
(false); } while (false); } } while (false)
;
1818 return m_ffrRrcSapUser.at (index);
1819}
1820
1821void
1822LteEnbRrc::SetLteEnbRrcSapUser (LteEnbRrcSapUser * s)
1823{
1824 NS_LOG_FUNCTION (this << s)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this << s; std::clog << ")" << std::endl; }
} while (false)
;
1825 m_rrcSapUser = s;
1826}
1827
1828LteEnbRrcSapProvider*
1829LteEnbRrc::GetLteEnbRrcSapProvider ()
1830{
1831 NS_LOG_FUNCTION (this)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this; std::clog << ")" << std::endl; } } while (
false)
;
1832 return m_rrcSapProvider;
1833}
1834
1835void
1836LteEnbRrc::SetLteMacSapProvider (LteMacSapProvider * s)
1837{
1838 NS_LOG_FUNCTION (this)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this; std::clog << ")" << std::endl; } } while (
false)
;
1839 m_macSapProvider = s;
1840}
1841
1842void
1843LteEnbRrc::SetS1SapProvider (EpcEnbS1SapProvider * s)
1844{
1845 m_s1SapProvider = s;
1846}
1847
1848
1849EpcEnbS1SapUser*
1850LteEnbRrc::GetS1SapUser ()
1851{
1852 return m_s1SapUser;
1853}
1854
1855void
1856LteEnbRrc::SetLteEnbCphySapProvider (LteEnbCphySapProvider * s)
1857{
1858 NS_LOG_FUNCTION (this << s)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this << s; std::clog << ")" << std::endl; }
} while (false)
;
1859 m_cphySapProvider.at(0) = s;
1860}
1861
1862LteEnbCphySapUser*
1863LteEnbRrc::GetLteEnbCphySapUser ()
1864{
1865 NS_LOG_FUNCTION (this)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this; std::clog << ")" << std::endl; } } while (
false)
;
1866 return m_cphySapUser.at(0);
1867}
1868
1869void
1870LteEnbRrc::SetLteEnbCphySapProvider (LteEnbCphySapProvider * s, uint8_t pos)
1871{
1872 NS_LOG_FUNCTION (this << s)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this << s; std::clog << ")" << std::endl; }
} while (false)
;
1873 m_cphySapProvider.at(pos) = s;
1874}
1875
1876LteEnbCphySapUser*
1877LteEnbRrc::GetLteEnbCphySapUser (uint8_t pos)
1878{
1879 NS_LOG_FUNCTION (this)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this; std::clog << ")" << std::endl; } } while (
false)
;
1880 return m_cphySapUser.at(pos);
1881}
1882
1883bool
1884LteEnbRrc::HasUeManager (uint16_t rnti) const
1885{
1886 NS_LOG_FUNCTION (this << (uint32_t) rnti)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this << (uint32_t) rnti; std::clog << ")" <<
std::endl; } } while (false)
;
1887 std::map<uint16_t, Ptr<UeManager> >::const_iterator it = m_ueMap.find (rnti);
1888 return (it != m_ueMap.end ());
1889}
1890
1891Ptr<UeManager>
1892LteEnbRrc::GetUeManager (uint16_t rnti)
1893{
1894 NS_LOG_FUNCTION (this << (uint32_t) rnti)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this << (uint32_t) rnti; std::clog << ")" <<
std::endl; } } while (false)
;
1895 NS_ASSERT (0 != rnti)do { if (!(0 != rnti)) { std::cerr << "assert failed. cond=\""
<< "0 != rnti" << "\", "; do { std::cerr <<
"file=" << "../src/lte/model/lte-enb-rrc.cc" << ", line="
<< 1895 << std::endl; ::ns3::FatalImpl::FlushStreams
(); if (true) std::terminate (); } while (false); } } while (
false)
;
1896 std::map<uint16_t, Ptr<UeManager> >::iterator it = m_ueMap.find (rnti);
1897 NS_ASSERT_MSG (it != m_ueMap.end (), "RNTI " << rnti << " not found in eNB with cellId " << m_cellId)do { if (!(it != m_ueMap.end ())) { std::cerr << "assert failed. cond=\""
<< "it != m_ueMap.end ()" << "\", "; do { std::cerr
<< "msg=\"" << "RNTI " << rnti << " not found in eNB with cellId "
<< m_cellId << "\", "; do { std::cerr << "file="
<< "../src/lte/model/lte-enb-rrc.cc" << ", line="
<< 1897 << std::endl; ::ns3::FatalImpl::FlushStreams
(); if (true) std::terminate (); } while (false); } while (false
); } } while (false)
;
1898 return it->second;
1899}
1900
1901uint8_t
1902LteEnbRrc::AddUeMeasReportConfig (LteRrcSap::ReportConfigEutra config)
1903{
1904 NS_LOG_FUNCTION (this)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this; std::clog << ")" << std::endl; } } while (
false)
;
1905
1906 // SANITY CHECK
1907
1908 NS_ASSERT_MSG (m_ueMeasConfig.measIdToAddModList.size () == m_ueMeasConfig.reportConfigToAddModList.size (),do { if (!(m_ueMeasConfig.measIdToAddModList.size () == m_ueMeasConfig
.reportConfigToAddModList.size ())) { std::cerr << "assert failed. cond=\""
<< "m_ueMeasConfig.measIdToAddModList.size () == m_ueMeasConfig.reportConfigToAddModList.size ()"
<< "\", "; do { std::cerr << "msg=\"" << "Measurement identities and reporting configuration should not have different quantity"
<< "\", "; do { std::cerr << "file=" << "../src/lte/model/lte-enb-rrc.cc"
<< ", line=" << 1909 << std::endl; ::ns3::
FatalImpl::FlushStreams (); if (true) std::terminate (); } while
(false); } while (false); } } while (false)
1909 "Measurement identities and reporting configuration should not have different quantity")do { if (!(m_ueMeasConfig.measIdToAddModList.size () == m_ueMeasConfig
.reportConfigToAddModList.size ())) { std::cerr << "assert failed. cond=\""
<< "m_ueMeasConfig.measIdToAddModList.size () == m_ueMeasConfig.reportConfigToAddModList.size ()"
<< "\", "; do { std::cerr << "msg=\"" << "Measurement identities and reporting configuration should not have different quantity"
<< "\", "; do { std::cerr << "file=" << "../src/lte/model/lte-enb-rrc.cc"
<< ", line=" << 1909 << std::endl; ::ns3::
FatalImpl::FlushStreams (); if (true) std::terminate (); } while
(false); } while (false); } } while (false)
;
1910
1911 if (Simulator::Now () != Seconds (0))
1912 {
1913 NS_FATAL_ERROR ("AddUeMeasReportConfig may not be called after the simulation has run")do { std::cerr << "msg=\"" << "AddUeMeasReportConfig may not be called after the simulation has run"
<< "\", "; do { std::cerr << "file=" << "../src/lte/model/lte-enb-rrc.cc"
<< ", line=" << 1913 << std::endl; ::ns3::
FatalImpl::FlushStreams (); if (true) std::terminate (); } while
(false); } while (false)
;
1914 }
1915
1916 // INPUT VALIDATION
1917
1918 switch (config.triggerQuantity)
1919 {
1920 case LteRrcSap::ReportConfigEutra::RSRP:
1921 if ((config.eventId == LteRrcSap::ReportConfigEutra::EVENT_A5)
1922 && (config.threshold2.choice != LteRrcSap::ThresholdEutra::THRESHOLD_RSRP))
1923 {
1924 NS_FATAL_ERROR ("The given triggerQuantity (RSRP) does not match with the given threshold2.choice")do { std::cerr << "msg=\"" << "The given triggerQuantity (RSRP) does not match with the given threshold2.choice"
<< "\", "; do { std::cerr << "file=" << "../src/lte/model/lte-enb-rrc.cc"
<< ", line=" << 1924 << std::endl; ::ns3::
FatalImpl::FlushStreams (); if (true) std::terminate (); } while
(false); } while (false)
;
1925 }
1926
1927 if (((config.eventId == LteRrcSap::ReportConfigEutra::EVENT_A1)
1928 || (config.eventId == LteRrcSap::ReportConfigEutra::EVENT_A2)
1929 || (config.eventId == LteRrcSap::ReportConfigEutra::EVENT_A4)
1930 || (config.eventId == LteRrcSap::ReportConfigEutra::EVENT_A5))
1931 && (config.threshold1.choice != LteRrcSap::ThresholdEutra::THRESHOLD_RSRP))
1932 {
1933 NS_FATAL_ERROR ("The given triggerQuantity (RSRP) does not match with the given threshold1.choice")do { std::cerr << "msg=\"" << "The given triggerQuantity (RSRP) does not match with the given threshold1.choice"
<< "\", "; do { std::cerr << "file=" << "../src/lte/model/lte-enb-rrc.cc"
<< ", line=" << 1933 << std::endl; ::ns3::
FatalImpl::FlushStreams (); if (true) std::terminate (); } while
(false); } while (false)
;
1934 }
1935 break;
1936
1937 case LteRrcSap::ReportConfigEutra::RSRQ:
1938 if ((config.eventId == LteRrcSap::ReportConfigEutra::EVENT_A5)
1939 && (config.threshold2.choice != LteRrcSap::ThresholdEutra::THRESHOLD_RSRQ))
1940 {
1941 NS_FATAL_ERROR ("The given triggerQuantity (RSRQ) does not match with the given threshold2.choice")do { std::cerr << "msg=\"" << "The given triggerQuantity (RSRQ) does not match with the given threshold2.choice"
<< "\", "; do { std::cerr << "file=" << "../src/lte/model/lte-enb-rrc.cc"
<< ", line=" << 1941 << std::endl; ::ns3::
FatalImpl::FlushStreams (); if (true) std::terminate (); } while
(false); } while (false)
;
1942 }
1943
1944 if (((config.eventId == LteRrcSap::ReportConfigEutra::EVENT_A1)
1945 || (config.eventId == LteRrcSap::ReportConfigEutra::EVENT_A2)
1946 || (config.eventId == LteRrcSap::ReportConfigEutra::EVENT_A4)
1947 || (config.eventId == LteRrcSap::ReportConfigEutra::EVENT_A5))
1948 && (config.threshold1.choice != LteRrcSap::ThresholdEutra::THRESHOLD_RSRQ))
1949 {
1950 NS_FATAL_ERROR ("The given triggerQuantity (RSRQ) does not match with the given threshold1.choice")do { std::cerr << "msg=\"" << "The given triggerQuantity (RSRQ) does not match with the given threshold1.choice"
<< "\", "; do { std::cerr << "file=" << "../src/lte/model/lte-enb-rrc.cc"
<< ", line=" << 1950 << std::endl; ::ns3::
FatalImpl::FlushStreams (); if (true) std::terminate (); } while
(false); } while (false)
;
1951 }
1952 break;
1953
1954 default:
1955 NS_FATAL_ERROR ("unsupported triggerQuantity")do { std::cerr << "msg=\"" << "unsupported triggerQuantity"
<< "\", "; do { std::cerr << "file=" << "../src/lte/model/lte-enb-rrc.cc"
<< ", line=" << 1955 << std::endl; ::ns3::
FatalImpl::FlushStreams (); if (true) std::terminate (); } while
(false); } while (false)
;
1956 break;
1957 }
1958
1959 if (config.purpose != LteRrcSap::ReportConfigEutra::REPORT_STRONGEST_CELLS)
1960 {
1961 NS_FATAL_ERROR ("Only REPORT_STRONGEST_CELLS purpose is supported")do { std::cerr << "msg=\"" << "Only REPORT_STRONGEST_CELLS purpose is supported"
<< "\", "; do { std::cerr << "file=" << "../src/lte/model/lte-enb-rrc.cc"
<< ", line=" << 1961 << std::endl; ::ns3::
FatalImpl::FlushStreams (); if (true) std::terminate (); } while
(false); } while (false)
;
1962 }
1963
1964 if (config.reportQuantity != LteRrcSap::ReportConfigEutra::BOTH)
1965 {
1966 NS_LOG_WARN ("reportQuantity = BOTH will be used instead of the given reportQuantity")do { if (g_log.IsEnabled (ns3::LOG_WARN)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; if (g_log.IsEnabled (ns3::LOG_PREFIX_FUNC)) { std
::clog << g_log.Name () << ":" << __FUNCTION__
<< "(): "; }; if (g_log.IsEnabled (ns3::LOG_PREFIX_LEVEL
)) { std::clog << "[" << g_log.GetLevelLabel (ns3
::LOG_WARN) << "] "; }; std::clog << "reportQuantity = BOTH will be used instead of the given reportQuantity"
<< std::endl; } } while (false)
;
1967 }
1968
1969 uint8_t nextId = m_ueMeasConfig.reportConfigToAddModList.size () + 1;
1970
1971 // create the reporting configuration
1972 LteRrcSap::ReportConfigToAddMod reportConfig;
1973 reportConfig.reportConfigId = nextId;
1974 reportConfig.reportConfigEutra = config;
1975
1976 // create the measurement identity
1977 LteRrcSap::MeasIdToAddMod measId;
1978 measId.measId = nextId;
1979 measId.measObjectId = 1;
1980 measId.reportConfigId = nextId;
1981
1982 // add both to the list of UE measurement configuration
1983 m_ueMeasConfig.reportConfigToAddModList.push_back (reportConfig);
1984 m_ueMeasConfig.measIdToAddModList.push_back (measId);
1985
1986 return nextId;
1987}
1988
1989void
1990LteEnbRrc::ConfigureCell (uint16_t cellId)
1991{
1992 std::map<uint8_t, ComponentCarrier >::iterator it = m_componentCarrierPhyConf.begin ();
1993 uint8_t ulBandwidth = it->second.m_ulBandwidth;
1994 uint8_t dlBandwidth = it->second.m_dlBandwidth;
1995 uint32_t ulEarfcn = it->second.m_ulEarfcn;
1996 uint32_t dlEarfcn = it->second.m_dlEarfcn;
1997 NS_LOG_FUNCTION (this << (uint16_t) ulBandwidth << (uint16_t) dlBandwidthdo { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this << (uint16_t) ulBandwidth << (uint16_t) dlBandwidth
<< ulEarfcn << dlEarfcn << cellId; std::clog
<< ")" << std::endl; } } while (false)
1998 << ulEarfcn << dlEarfcn << cellId)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this << (uint16_t) ulBandwidth << (uint16_t) dlBandwidth
<< ulEarfcn << dlEarfcn << cellId; std::clog
<< ")" << std::endl; } } while (false)
;
1999 NS_ASSERT (!m_configured)do { if (!(!m_configured)) { std::cerr << "assert failed. cond=\""
<< "!m_configured" << "\", "; do { std::cerr <<
"file=" << "../src/lte/model/lte-enb-rrc.cc" << ", line="
<< 1999 << std::endl; ::ns3::FatalImpl::FlushStreams
(); if (true) std::terminate (); } while (false); } } while (
false)
;
2000
2001 for (it = m_componentCarrierPhyConf.begin (); it != m_componentCarrierPhyConf.end (); ++it)
2002 {
2003 m_cphySapProvider[it->first]->SetBandwidth (it->second.m_ulBandwidth, it->second.m_dlBandwidth);
2004 m_cphySapProvider[it->first]->SetEarfcn (it->second.m_ulEarfcn, it->second.m_dlEarfcn);
2005 m_cphySapProvider[it->first]->SetCellId (cellId);
2006 m_cmacSapProvider[it->first]->ConfigureMac (it->second.m_ulBandwidth, it->second.m_dlBandwidth);
2007 m_ffrRrcSapProvider[it->first]->SetCellId (cellId);
2008 m_ffrRrcSapProvider[it->first]->SetBandwidth (it->second.m_ulBandwidth, it->second.m_dlBandwidth);
2009 }
2010
2011 m_dlEarfcn = dlEarfcn;
2012 m_ulEarfcn = ulEarfcn;
2013 m_dlBandwidth = dlBandwidth;
2014 m_ulBandwidth = ulBandwidth;
2015 m_cellId = cellId;
2016
2017 /*
2018 * Initializing the list of UE measurement configuration (m_ueMeasConfig).
2019 * Only intra-frequency measurements are supported, so only one measurement
2020 * object is created.
2021 */
2022
2023 LteRrcSap::MeasObjectToAddMod measObject;
2024 measObject.measObjectId = 1;
2025 measObject.measObjectEutra.carrierFreq = m_dlEarfcn;
2026 measObject.measObjectEutra.allowedMeasBandwidth = m_dlBandwidth;
2027 measObject.measObjectEutra.presenceAntennaPort1 = false;
2028 measObject.measObjectEutra.neighCellConfig = 0;
2029 measObject.measObjectEutra.offsetFreq = 0;
2030 measObject.measObjectEutra.haveCellForWhichToReportCGI = false;
2031
2032 m_ueMeasConfig.measObjectToAddModList.push_back (measObject);
2033 m_ueMeasConfig.haveQuantityConfig = true;
2034 m_ueMeasConfig.quantityConfig.filterCoefficientRSRP = m_rsrpFilterCoefficient;
2035 m_ueMeasConfig.quantityConfig.filterCoefficientRSRQ = m_rsrqFilterCoefficient;
2036 m_ueMeasConfig.haveMeasGapConfig = false;
2037 m_ueMeasConfig.haveSmeasure = false;
2038 m_ueMeasConfig.haveSpeedStatePars = false;
2039
2040 // Enabling MIB transmission
2041 LteRrcSap::MasterInformationBlock mib;
2042 mib.dlBandwidth = m_dlBandwidth;
2043 // Enabling SIB1 transmission with default values
2044 m_sib1.cellAccessRelatedInfo.cellIdentity = cellId;
2045 m_sib1.cellAccessRelatedInfo.csgIndication = false;
2046 m_sib1.cellAccessRelatedInfo.csgIdentity = 0;
2047 m_sib1.cellAccessRelatedInfo.plmnIdentityInfo.plmnIdentity = 0; // not used
2048 m_sib1.cellSelectionInfo.qQualMin = -34; // not used, set as minimum value
2049 m_sib1.cellSelectionInfo.qRxLevMin = m_qRxLevMin; // set as minimum value
2050
2051 for (it = m_componentCarrierPhyConf.begin (); it != m_componentCarrierPhyConf.end (); ++it)
2052 {
2053 m_cphySapProvider.at (it->first)->SetMasterInformationBlock (mib);
2054 m_cphySapProvider.at (it->first)->SetSystemInformationBlockType1 (m_sib1);
2055 }
2056 /*
2057 * Enabling transmission of other SIB. The first time System Information is
2058 * transmitted is arbitrarily assumed to be at +0.016s, and then it will be
2059 * regularly transmitted every 80 ms by default (set the
2060 * SystemInformationPeriodicity attribute to configure this).
2061 */
2062 Simulator::Schedule (MilliSeconds (16), &LteEnbRrc::SendSystemInformation, this);
2063
2064 m_configured = true;
2065
2066}
2067
2068
2069void
2070LteEnbRrc::SetCellId (uint16_t cellId)
2071{
2072 m_cellId = cellId;
2073
2074 // update SIB1 too
2075 m_sib1.cellAccessRelatedInfo.cellIdentity = cellId;
2076 m_cphySapProvider.at (0)->SetSystemInformationBlockType1 (m_sib1);
2077}
2078
2079void
2080LteEnbRrc::SetCellId (uint16_t cellId, uint8_t ccIndex)
2081{
2082 m_cellId = cellId;
2083 // update SIB1 too
2084 m_sib1.cellAccessRelatedInfo.cellIdentity = cellId;
2085 m_cphySapProvider[ccIndex]->SetSystemInformationBlockType1 (m_sib1);
2086}
2087
2088bool
2089LteEnbRrc::SendData (Ptr<Packet> packet)
2090{
2091 NS_LOG_FUNCTION (this << packet)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this << packet; std::clog << ")" << std::endl
; } } while (false)
;
2092
2093 EpsBearerTag tag;
2094 bool found = packet->RemovePacketTag (tag);
2095 NS_ASSERT_MSG (found, "no EpsBearerTag found in packet to be sent")do { if (!(found)) { std::cerr << "assert failed. cond=\""
<< "found" << "\", "; do { std::cerr << "msg=\""
<< "no EpsBearerTag found in packet to be sent" <<
"\", "; do { std::cerr << "file=" << "../src/lte/model/lte-enb-rrc.cc"
<< ", line=" << 2095 << std::endl; ::ns3::
FatalImpl::FlushStreams (); if (true) std::terminate (); } while
(false); } while (false); } } while (false)
;
2096 Ptr<UeManager> ueManager = GetUeManager (tag.GetRnti ());
2097 ueManager->SendData (tag.GetBid (), packet);
2098
2099 return true;
2100}
2101
2102void
2103LteEnbRrc::SetForwardUpCallback (Callback <void, Ptr<Packet> > cb)
2104{
2105 m_forwardUpCallback = cb;
2106}
2107
2108void
2109LteEnbRrc::ConnectionRequestTimeout (uint16_t rnti)
2110{
2111 NS_LOG_FUNCTION (this << rnti)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this << rnti; std::clog << ")" << std::endl
; } } while (false)
;
2112 NS_ASSERT_MSG (GetUeManager (rnti)->GetState () == UeManager::INITIAL_RANDOM_ACCESS,do { if (!(GetUeManager (rnti)->GetState () == UeManager::
INITIAL_RANDOM_ACCESS)) { std::cerr << "assert failed. cond=\""
<< "GetUeManager (rnti)->GetState () == UeManager::INITIAL_RANDOM_ACCESS"
<< "\", "; do { std::cerr << "msg=\"" << "ConnectionRequestTimeout in unexpected state "
<< ToString (GetUeManager (rnti)->GetState ()) <<
"\", "; do { std::cerr << "file=" << "../src/lte/model/lte-enb-rrc.cc"
<< ", line=" << 2113 << std::endl; ::ns3::
FatalImpl::FlushStreams (); if (true) std::terminate (); } while
(false); } while (false); } } while (false)
2113 "ConnectionRequestTimeout in unexpected state " << ToString (GetUeManager (rnti)->GetState ()))do { if (!(GetUeManager (rnti)->GetState () == UeManager::
INITIAL_RANDOM_ACCESS)) { std::cerr << "assert failed. cond=\""
<< "GetUeManager (rnti)->GetState () == UeManager::INITIAL_RANDOM_ACCESS"
<< "\", "; do { std::cerr << "msg=\"" << "ConnectionRequestTimeout in unexpected state "
<< ToString (GetUeManager (rnti)->GetState ()) <<
"\", "; do { std::cerr << "file=" << "../src/lte/model/lte-enb-rrc.cc"
<< ", line=" << 2113 << std::endl; ::ns3::
FatalImpl::FlushStreams (); if (true) std::terminate (); } while
(false); } while (false); } } while (false)
;
2114 RemoveUe (rnti);
2115}
2116
2117void
2118LteEnbRrc::ConnectionSetupTimeout (uint16_t rnti)
2119{
2120 NS_LOG_FUNCTION (this << rnti)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this << rnti; std::clog << ")" << std::endl
; } } while (false)
;
2121 NS_ASSERT_MSG (GetUeManager (rnti)->GetState () == UeManager::CONNECTION_SETUP,do { if (!(GetUeManager (rnti)->GetState () == UeManager::
CONNECTION_SETUP)) { std::cerr << "assert failed. cond=\""
<< "GetUeManager (rnti)->GetState () == UeManager::CONNECTION_SETUP"
<< "\", "; do { std::cerr << "msg=\"" << "ConnectionSetupTimeout in unexpected state "
<< ToString (GetUeManager (rnti)->GetState ()) <<
"\", "; do { std::cerr << "file=" << "../src/lte/model/lte-enb-rrc.cc"
<< ", line=" << 2122 << std::endl; ::ns3::
FatalImpl::FlushStreams (); if (true) std::terminate (); } while
(false); } while (false); } } while (false)
2122 "ConnectionSetupTimeout in unexpected state " << ToString (GetUeManager (rnti)->GetState ()))do { if (!(GetUeManager (rnti)->GetState () == UeManager::
CONNECTION_SETUP)) { std::cerr << "assert failed. cond=\""
<< "GetUeManager (rnti)->GetState () == UeManager::CONNECTION_SETUP"
<< "\", "; do { std::cerr << "msg=\"" << "ConnectionSetupTimeout in unexpected state "
<< ToString (GetUeManager (rnti)->GetState ()) <<
"\", "; do { std::cerr << "file=" << "../src/lte/model/lte-enb-rrc.cc"
<< ", line=" << 2122 << std::endl; ::ns3::
FatalImpl::FlushStreams (); if (true) std::terminate (); } while
(false); } while (false); } } while (false)
;
2123 RemoveUe (rnti);
2124}
2125
2126void
2127LteEnbRrc::ConnectionRejectedTimeout (uint16_t rnti)
2128{
2129 NS_LOG_FUNCTION (this << rnti)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this << rnti; std::clog << ")" << std::endl
; } } while (false)
;
2130 NS_ASSERT_MSG (GetUeManager (rnti)->GetState () == UeManager::CONNECTION_REJECTED,do { if (!(GetUeManager (rnti)->GetState () == UeManager::
CONNECTION_REJECTED)) { std::cerr << "assert failed. cond=\""
<< "GetUeManager (rnti)->GetState () == UeManager::CONNECTION_REJECTED"
<< "\", "; do { std::cerr << "msg=\"" << "ConnectionRejectedTimeout in unexpected state "
<< ToString (GetUeManager (rnti)->GetState ()) <<
"\", "; do { std::cerr << "file=" << "../src/lte/model/lte-enb-rrc.cc"
<< ", line=" << 2131 << std::endl; ::ns3::
FatalImpl::FlushStreams (); if (true) std::terminate (); } while
(false); } while (false); } } while (false)
2131 "ConnectionRejectedTimeout in unexpected state " << ToString (GetUeManager (rnti)->GetState ()))do { if (!(GetUeManager (rnti)->GetState () == UeManager::
CONNECTION_REJECTED)) { std::cerr << "assert failed. cond=\""
<< "GetUeManager (rnti)->GetState () == UeManager::CONNECTION_REJECTED"
<< "\", "; do { std::cerr << "msg=\"" << "ConnectionRejectedTimeout in unexpected state "
<< ToString (GetUeManager (rnti)->GetState ()) <<
"\", "; do { std::cerr << "file=" << "../src/lte/model/lte-enb-rrc.cc"
<< ", line=" << 2131 << std::endl; ::ns3::
FatalImpl::FlushStreams (); if (true) std::terminate (); } while
(false); } while (false); } } while (false)
;
2132 RemoveUe (rnti);
2133}
2134
2135void
2136LteEnbRrc::HandoverJoiningTimeout (uint16_t rnti)
2137{
2138 NS_LOG_FUNCTION (this << rnti)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this << rnti; std::clog << ")" << std::endl
; } } while (false)
;
2139 NS_ASSERT_MSG (GetUeManager (rnti)->GetState () == UeManager::HANDOVER_JOINING,do { if (!(GetUeManager (rnti)->GetState () == UeManager::
HANDOVER_JOINING)) { std::cerr << "assert failed. cond=\""
<< "GetUeManager (rnti)->GetState () == UeManager::HANDOVER_JOINING"
<< "\", "; do { std::cerr << "msg=\"" << "HandoverJoiningTimeout in unexpected state "
<< ToString (GetUeManager (rnti)->GetState ()) <<
"\", "; do { std::cerr << "file=" << "../src/lte/model/lte-enb-rrc.cc"
<< ", line=" << 2140 << std::endl; ::ns3::
FatalImpl::FlushStreams (); if (true) std::terminate (); } while
(false); } while (false); } } while (false)
2140 "HandoverJoiningTimeout in unexpected state " << ToString (GetUeManager (rnti)->GetState ()))do { if (!(GetUeManager (rnti)->GetState () == UeManager::
HANDOVER_JOINING)) { std::cerr << "assert failed. cond=\""
<< "GetUeManager (rnti)->GetState () == UeManager::HANDOVER_JOINING"
<< "\", "; do { std::cerr << "msg=\"" << "HandoverJoiningTimeout in unexpected state "
<< ToString (GetUeManager (rnti)->GetState ()) <<
"\", "; do { std::cerr << "file=" << "../src/lte/model/lte-enb-rrc.cc"
<< ", line=" << 2140 << std::endl; ::ns3::
FatalImpl::FlushStreams (); if (true) std::terminate (); } while
(false); } while (false); } } while (false)
;
2141 RemoveUe (rnti);
2142}
2143
2144void
2145LteEnbRrc::HandoverLeavingTimeout (uint16_t rnti)
2146{
2147 NS_LOG_FUNCTION (this << rnti)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this << rnti; std::clog << ")" << std::endl
; } } while (false)
;
2148 NS_ASSERT_MSG (GetUeManager (rnti)->GetState () == UeManager::HANDOVER_LEAVING,do { if (!(GetUeManager (rnti)->GetState () == UeManager::
HANDOVER_LEAVING)) { std::cerr << "assert failed. cond=\""
<< "GetUeManager (rnti)->GetState () == UeManager::HANDOVER_LEAVING"
<< "\", "; do { std::cerr << "msg=\"" << "HandoverLeavingTimeout in unexpected state "
<< ToString (GetUeManager (rnti)->GetState ()) <<
"\", "; do { std::cerr << "file=" << "../src/lte/model/lte-enb-rrc.cc"
<< ", line=" << 2149 << std::endl; ::ns3::
FatalImpl::FlushStreams (); if (true) std::terminate (); } while
(false); } while (false); } } while (false)
2149 "HandoverLeavingTimeout in unexpected state " << ToString (GetUeManager (rnti)->GetState ()))do { if (!(GetUeManager (rnti)->GetState () == UeManager::
HANDOVER_LEAVING)) { std::cerr << "assert failed. cond=\""
<< "GetUeManager (rnti)->GetState () == UeManager::HANDOVER_LEAVING"
<< "\", "; do { std::cerr << "msg=\"" << "HandoverLeavingTimeout in unexpected state "
<< ToString (GetUeManager (rnti)->GetState ()) <<
"\", "; do { std::cerr << "file=" << "../src/lte/model/lte-enb-rrc.cc"
<< ", line=" << 2149 << std::endl; ::ns3::
FatalImpl::FlushStreams (); if (true) std::terminate (); } while
(false); } while (false); } } while (false)
;
2150 RemoveUe (rnti);
2151}
2152
2153void
2154LteEnbRrc::SendHandoverRequest (uint16_t rnti, uint16_t cellId)
2155{
2156 NS_LOG_FUNCTION (this << rnti << cellId)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this << rnti << cellId; std::clog << ")" <<
std::endl; } } while (false)
;
2157 NS_LOG_LOGIC ("Request to send HANDOVER REQUEST")do { if (g_log.IsEnabled (ns3::LOG_LOGIC)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; if (g_log.IsEnabled (ns3::LOG_PREFIX_FUNC)) { std
::clog << g_log.Name () << ":" << __FUNCTION__
<< "(): "; }; if (g_log.IsEnabled (ns3::LOG_PREFIX_LEVEL
)) { std::clog << "[" << g_log.GetLevelLabel (ns3
::LOG_LOGIC) << "] "; }; std::clog << "Request to send HANDOVER REQUEST"
<< std::endl; } } while (false)
;
2158 NS_ASSERT (m_configured)do { if (!(m_configured)) { std::cerr << "assert failed. cond=\""
<< "m_configured" << "\", "; do { std::cerr <<
"file=" << "../src/lte/model/lte-enb-rrc.cc" << ", line="
<< 2158 << std::endl; ::ns3::FatalImpl::FlushStreams
(); if (true) std::terminate (); } while (false); } } while (
false)
;
2159
2160 Ptr<UeManager> ueManager = GetUeManager (rnti);
2161 ueManager->PrepareHandover (cellId);
2162
2163}
2164
2165void
2166LteEnbRrc::DoCompleteSetupUe (uint16_t rnti, LteEnbRrcSapProvider::CompleteSetupUeParameters params)
2167{
2168 NS_LOG_FUNCTION (this << rnti)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this << rnti; std::clog << ")" << std::endl
; } } while (false)
;
2169 GetUeManager (rnti)->CompleteSetupUe (params);
2170}
2171
2172void
2173LteEnbRrc::DoRecvRrcConnectionRequest (uint16_t rnti, LteRrcSap::RrcConnectionRequest msg)
2174{
2175 NS_LOG_FUNCTION (this << rnti)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this << rnti; std::clog << ")" << std::endl
; } } while (false)
;
2176 GetUeManager (rnti)->RecvRrcConnectionRequest (msg);
2177}
2178
2179void
2180LteEnbRrc::DoRecvRrcConnectionSetupCompleted (uint16_t rnti, LteRrcSap::RrcConnectionSetupCompleted msg)
2181{
2182 NS_LOG_FUNCTION (this << rnti)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this << rnti; std::clog << ")" << std::endl
; } } while (false)
;
2183 GetUeManager (rnti)->RecvRrcConnectionSetupCompleted (msg);
2184}
2185
2186void
2187LteEnbRrc::DoRecvRrcConnectionReconfigurationCompleted (uint16_t rnti, LteRrcSap::RrcConnectionReconfigurationCompleted msg)
2188{
2189 NS_LOG_FUNCTION (this << rnti)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this << rnti; std::clog << ")" << std::endl
; } } while (false)
;
2190 GetUeManager (rnti)->RecvRrcConnectionReconfigurationCompleted (msg);
2191}
2192
2193void
2194LteEnbRrc::DoRecvRrcConnectionReestablishmentRequest (uint16_t rnti, LteRrcSap::RrcConnectionReestablishmentRequest msg)
2195{
2196 NS_LOG_FUNCTION (this << rnti)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this << rnti; std::clog << ")" << std::endl
; } } while (false)
;
2197 GetUeManager (rnti)->RecvRrcConnectionReestablishmentRequest (msg);
2198}
2199
2200void
2201LteEnbRrc::DoRecvRrcConnectionReestablishmentComplete (uint16_t rnti, LteRrcSap::RrcConnectionReestablishmentComplete msg)
2202{
2203 NS_LOG_FUNCTION (this << rnti)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this << rnti; std::clog << ")" << std::endl
; } } while (false)
;
2204 GetUeManager (rnti)->RecvRrcConnectionReestablishmentComplete (msg);
2205}
2206
2207void
2208LteEnbRrc::DoRecvMeasurementReport (uint16_t rnti, LteRrcSap::MeasurementReport msg)
2209{
2210 NS_LOG_FUNCTION (this << rnti)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this << rnti; std::clog << ")" << std::endl
; } } while (false)
;
2211 GetUeManager (rnti)->RecvMeasurementReport (msg);
2212}
2213
2214void
2215LteEnbRrc::DoDataRadioBearerSetupRequest (EpcEnbS1SapUser::DataRadioBearerSetupRequestParameters request)
2216{
2217 Ptr<UeManager> ueManager = GetUeManager (request.rnti);
2218 ueManager->SetupDataRadioBearer (request.bearer, request.bearerId, request.gtpTeid, request.transportLayerAddress);
2219}
2220
2221void
2222LteEnbRrc::DoPathSwitchRequestAcknowledge (EpcEnbS1SapUser::PathSwitchRequestAcknowledgeParameters params)
2223{
2224 Ptr<UeManager> ueManager = GetUeManager (params.rnti);
2225 ueManager->SendUeContextRelease ();
1
Calling 'UeManager::SendUeContextRelease'
2226}
2227
2228void
2229LteEnbRrc::DoRecvHandoverRequest (EpcX2SapUser::HandoverRequestParams req)
2230{
2231 NS_LOG_FUNCTION (this)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this; std::clog << ")" << std::endl; } } while (
false)
;
2232
2233 NS_LOG_LOGIC ("Recv X2 message: HANDOVER REQUEST")do { if (g_log.IsEnabled (ns3::LOG_LOGIC)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; if (g_log.IsEnabled (ns3::LOG_PREFIX_FUNC)) { std
::clog << g_log.Name () << ":" << __FUNCTION__
<< "(): "; }; if (g_log.IsEnabled (ns3::LOG_PREFIX_LEVEL
)) { std::clog << "[" << g_log.GetLevelLabel (ns3
::LOG_LOGIC) << "] "; }; std::clog << "Recv X2 message: HANDOVER REQUEST"
<< std::endl; } } while (false)
;
2234
2235 NS_LOG_LOGIC ("oldEnbUeX2apId = " << req.oldEnbUeX2apId)do { if (g_log.IsEnabled (ns3::LOG_LOGIC)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; if (g_log.IsEnabled (ns3::LOG_PREFIX_FUNC)) { std
::clog << g_log.Name () << ":" << __FUNCTION__
<< "(): "; }; if (g_log.IsEnabled (ns3::LOG_PREFIX_LEVEL
)) { std::clog << "[" << g_log.GetLevelLabel (ns3
::LOG_LOGIC) << "] "; }; std::clog << "oldEnbUeX2apId = "
<< req.oldEnbUeX2apId << std::endl; } } while (false
)
;
2236 NS_LOG_LOGIC ("sourceCellId = " << req.sourceCellId)do { if (g_log.IsEnabled (ns3::LOG_LOGIC)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; if (g_log.IsEnabled (ns3::LOG_PREFIX_FUNC)) { std
::clog << g_log.Name () << ":" << __FUNCTION__
<< "(): "; }; if (g_log.IsEnabled (ns3::LOG_PREFIX_LEVEL
)) { std::clog << "[" << g_log.GetLevelLabel (ns3
::LOG_LOGIC) << "] "; }; std::clog << "sourceCellId = "
<< req.sourceCellId << std::endl; } } while (false
)
;
2237 NS_LOG_LOGIC ("targetCellId = " << req.targetCellId)do { if (g_log.IsEnabled (ns3::LOG_LOGIC)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; if (g_log.IsEnabled (ns3::LOG_PREFIX_FUNC)) { std
::clog << g_log.Name () << ":" << __FUNCTION__
<< "(): "; }; if (g_log.IsEnabled (ns3::LOG_PREFIX_LEVEL
)) { std::clog << "[" << g_log.GetLevelLabel (ns3
::LOG_LOGIC) << "] "; }; std::clog << "targetCellId = "
<< req.targetCellId << std::endl; } } while (false
)
;
2238 NS_LOG_LOGIC ("mmeUeS1apId = " << req.mmeUeS1apId)do { if (g_log.IsEnabled (ns3::LOG_LOGIC)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; if (g_log.IsEnabled (ns3::LOG_PREFIX_FUNC)) { std
::clog << g_log.Name () << ":" << __FUNCTION__
<< "(): "; }; if (g_log.IsEnabled (ns3::LOG_PREFIX_LEVEL
)) { std::clog << "[" << g_log.GetLevelLabel (ns3
::LOG_LOGIC) << "] "; }; std::clog << "mmeUeS1apId = "
<< req.mmeUeS1apId << std::endl; } } while (false
)
;
2239
2240 NS_ASSERT (req.targetCellId == m_cellId)do { if (!(req.targetCellId == m_cellId)) { std::cerr <<
"assert failed. cond=\"" << "req.targetCellId == m_cellId"
<< "\", "; do { std::cerr << "file=" << "../src/lte/model/lte-enb-rrc.cc"
<< ", line=" << 2240 << std::endl; ::ns3::
FatalImpl::FlushStreams (); if (true) std::terminate (); } while
(false); } } while (false)
;
2241
2242 if (m_admitHandoverRequest == false)
2243 {
2244 NS_LOG_INFO ("rejecting handover request from cellId " << req.sourceCellId)do { if (g_log.IsEnabled (ns3::LOG_INFO)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; if (g_log.IsEnabled (ns3::LOG_PREFIX_FUNC)) { std
::clog << g_log.Name () << ":" << __FUNCTION__
<< "(): "; }; if (g_log.IsEnabled (ns3::LOG_PREFIX_LEVEL
)) { std::clog << "[" << g_log.GetLevelLabel (ns3
::LOG_INFO) << "] "; }; std::clog << "rejecting handover request from cellId "
<< req.sourceCellId << std::endl; } } while (false
)
;
2245 EpcX2Sap::HandoverPreparationFailureParams res;
2246 res.oldEnbUeX2apId = req.oldEnbUeX2apId;
2247 res.sourceCellId = req.sourceCellId;
2248 res.targetCellId = req.targetCellId;
2249 res.cause = 0;
2250 res.criticalityDiagnostics = 0;
2251 m_x2SapProvider->SendHandoverPreparationFailure (res);
2252 return;
2253 }
2254
2255 uint16_t rnti = AddUe (UeManager::HANDOVER_JOINING);
2256 LteEnbCmacSapProvider::AllocateNcRaPreambleReturnValue anrcrv = m_cmacSapProvider.at (0)->AllocateNcRaPreamble (rnti);
2257 if (anrcrv.valid == false)
2258 {
2259 NS_LOG_INFO (this << " failed to allocate a preamble for non-contention based RA => cannot accept HO")do { if (g_log.IsEnabled (ns3::LOG_INFO)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; if (g_log.IsEnabled (ns3::LOG_PREFIX_FUNC)) { std
::clog << g_log.Name () << ":" << __FUNCTION__
<< "(): "; }; if (g_log.IsEnabled (ns3::LOG_PREFIX_LEVEL
)) { std::clog << "[" << g_log.GetLevelLabel (ns3
::LOG_INFO) << "] "; }; std::clog << this <<
" failed to allocate a preamble for non-contention based RA => cannot accept HO"
<< std::endl; } } while (false)
;
2260 RemoveUe (rnti);
2261 NS_FATAL_ERROR ("should trigger HO Preparation Failure, but it is not implemented")do { std::cerr << "msg=\"" << "should trigger HO Preparation Failure, but it is not implemented"
<< "\", "; do { std::cerr << "file=" << "../src/lte/model/lte-enb-rrc.cc"
<< ", line=" << 2261 << std::endl; ::ns3::
FatalImpl::FlushStreams (); if (true) std::terminate (); } while
(false); } while (false)
;
2262 return;
2263 }
2264
2265 Ptr<UeManager> ueManager = GetUeManager (rnti);
2266 ueManager->SetSource (req.sourceCellId, req.oldEnbUeX2apId);
2267 ueManager->SetImsi (req.mmeUeS1apId);
2268
2269 EpcX2SapProvider::HandoverRequestAckParams ackParams;
2270 ackParams.oldEnbUeX2apId = req.oldEnbUeX2apId;
2271 ackParams.newEnbUeX2apId = rnti;
2272 ackParams.sourceCellId = req.sourceCellId;
2273 ackParams.targetCellId = req.targetCellId;
2274
2275 for (std::vector <EpcX2Sap::ErabToBeSetupItem>::iterator it = req.bearers.begin ();
2276 it != req.bearers.end ();
2277 ++it)
2278 {
2279 ueManager->SetupDataRadioBearer (it->erabLevelQosParameters, it->erabId, it->gtpTeid, it->transportLayerAddress);
2280 EpcX2Sap::ErabAdmittedItem i;
2281 i.erabId = it->erabId;
2282 ackParams.admittedBearers.push_back (i);
2283 }
2284
2285 LteRrcSap::RrcConnectionReconfiguration handoverCommand = ueManager->GetRrcConnectionReconfigurationForHandover ();
2286 handoverCommand.haveMobilityControlInfo = true;
2287 handoverCommand.mobilityControlInfo.targetPhysCellId = m_cellId;
2288 handoverCommand.mobilityControlInfo.haveCarrierFreq = true;
2289 handoverCommand.mobilityControlInfo.carrierFreq.dlCarrierFreq = m_dlEarfcn;
2290 handoverCommand.mobilityControlInfo.carrierFreq.ulCarrierFreq = m_ulEarfcn;
2291 handoverCommand.mobilityControlInfo.haveCarrierBandwidth = true;
2292 handoverCommand.mobilityControlInfo.carrierBandwidth.dlBandwidth = m_dlBandwidth;
2293 handoverCommand.mobilityControlInfo.carrierBandwidth.ulBandwidth = m_ulBandwidth;
2294 handoverCommand.mobilityControlInfo.newUeIdentity = rnti;
2295 handoverCommand.mobilityControlInfo.haveRachConfigDedicated = true;
2296 handoverCommand.mobilityControlInfo.rachConfigDedicated.raPreambleIndex = anrcrv.raPreambleId;
2297 handoverCommand.mobilityControlInfo.rachConfigDedicated.raPrachMaskIndex = anrcrv.raPrachMaskIndex;
2298
2299 LteEnbCmacSapProvider::RachConfig rc = m_cmacSapProvider.at (0)->GetRachConfig ();
2300 handoverCommand.mobilityControlInfo.radioResourceConfigCommon.rachConfigCommon.preambleInfo.numberOfRaPreambles = rc.numberOfRaPreambles;
2301 handoverCommand.mobilityControlInfo.radioResourceConfigCommon.rachConfigCommon.raSupervisionInfo.preambleTransMax = rc.preambleTransMax;
2302 handoverCommand.mobilityControlInfo.radioResourceConfigCommon.rachConfigCommon.raSupervisionInfo.raResponseWindowSize = rc.raResponseWindowSize;
2303 handoverCommand.haveNonCriticalExtension = false;
2304
2305 Ptr<Packet> encodedHandoverCommand = m_rrcSapUser->EncodeHandoverCommand (handoverCommand);
2306
2307 ackParams.rrcContext = encodedHandoverCommand;
2308
2309 NS_LOG_LOGIC ("Send X2 message: HANDOVER REQUEST ACK")do { if (g_log.IsEnabled (ns3::LOG_LOGIC)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; if (g_log.IsEnabled (ns3::LOG_PREFIX_FUNC)) { std
::clog << g_log.Name () << ":" << __FUNCTION__
<< "(): "; }; if (g_log.IsEnabled (ns3::LOG_PREFIX_LEVEL
)) { std::clog << "[" << g_log.GetLevelLabel (ns3
::LOG_LOGIC) << "] "; }; std::clog << "Send X2 message: HANDOVER REQUEST ACK"
<< std::endl; } } while (false)
;
2310
2311 NS_LOG_LOGIC ("oldEnbUeX2apId = " << ackParams.oldEnbUeX2apId)do { if (g_log.IsEnabled (ns3::LOG_LOGIC)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; if (g_log.IsEnabled (ns3::LOG_PREFIX_FUNC)) { std
::clog << g_log.Name () << ":" << __FUNCTION__
<< "(): "; }; if (g_log.IsEnabled (ns3::LOG_PREFIX_LEVEL
)) { std::clog << "[" << g_log.GetLevelLabel (ns3
::LOG_LOGIC) << "] "; }; std::clog << "oldEnbUeX2apId = "
<< ackParams.oldEnbUeX2apId << std::endl; } } while
(false)
;
2312 NS_LOG_LOGIC ("newEnbUeX2apId = " << ackParams.newEnbUeX2apId)do { if (g_log.IsEnabled (ns3::LOG_LOGIC)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; if (g_log.IsEnabled (ns3::LOG_PREFIX_FUNC)) { std
::clog << g_log.Name () << ":" << __FUNCTION__
<< "(): "; }; if (g_log.IsEnabled (ns3::LOG_PREFIX_LEVEL
)) { std::clog << "[" << g_log.GetLevelLabel (ns3
::LOG_LOGIC) << "] "; }; std::clog << "newEnbUeX2apId = "
<< ackParams.newEnbUeX2apId << std::endl; } } while
(false)
;
2313 NS_LOG_LOGIC ("sourceCellId = " << ackParams.sourceCellId)do { if (g_log.IsEnabled (ns3::LOG_LOGIC)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; if (g_log.IsEnabled (ns3::LOG_PREFIX_FUNC)) { std
::clog << g_log.Name () << ":" << __FUNCTION__
<< "(): "; }; if (g_log.IsEnabled (ns3::LOG_PREFIX_LEVEL
)) { std::clog << "[" << g_log.GetLevelLabel (ns3
::LOG_LOGIC) << "] "; }; std::clog << "sourceCellId = "
<< ackParams.sourceCellId << std::endl; } } while
(false)
;
2314 NS_LOG_LOGIC ("targetCellId = " << ackParams.targetCellId)do { if (g_log.IsEnabled (ns3::LOG_LOGIC)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; if (g_log.IsEnabled (ns3::LOG_PREFIX_FUNC)) { std
::clog << g_log.Name () << ":" << __FUNCTION__
<< "(): "; }; if (g_log.IsEnabled (ns3::LOG_PREFIX_LEVEL
)) { std::clog << "[" << g_log.GetLevelLabel (ns3
::LOG_LOGIC) << "] "; }; std::clog << "targetCellId = "
<< ackParams.targetCellId << std::endl; } } while
(false)
;
2315
2316 m_x2SapProvider->SendHandoverRequestAck (ackParams);
2317}
2318
2319void
2320LteEnbRrc::DoRecvHandoverRequestAck (EpcX2SapUser::HandoverRequestAckParams params)
2321{
2322 NS_LOG_FUNCTION (this)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this; std::clog << ")" << std::endl; } } while (
false)
;
2323
2324 NS_LOG_LOGIC ("Recv X2 message: HANDOVER REQUEST ACK")do { if (g_log.IsEnabled (ns3::LOG_LOGIC)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; if (g_log.IsEnabled (ns3::LOG_PREFIX_FUNC)) { std
::clog << g_log.Name () << ":" << __FUNCTION__
<< "(): "; }; if (g_log.IsEnabled (ns3::LOG_PREFIX_LEVEL
)) { std::clog << "[" << g_log.GetLevelLabel (ns3
::LOG_LOGIC) << "] "; }; std::clog << "Recv X2 message: HANDOVER REQUEST ACK"
<< std::endl; } } while (false)
;
2325
2326 NS_LOG_LOGIC ("oldEnbUeX2apId = " << params.oldEnbUeX2apId)do { if (g_log.IsEnabled (ns3::LOG_LOGIC)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; if (g_log.IsEnabled (ns3::LOG_PREFIX_FUNC)) { std
::clog << g_log.Name () << ":" << __FUNCTION__
<< "(): "; }; if (g_log.IsEnabled (ns3::LOG_PREFIX_LEVEL
)) { std::clog << "[" << g_log.GetLevelLabel (ns3
::LOG_LOGIC) << "] "; }; std::clog << "oldEnbUeX2apId = "
<< params.oldEnbUeX2apId << std::endl; } } while
(false)
;
2327 NS_LOG_LOGIC ("newEnbUeX2apId = " << params.newEnbUeX2apId)do { if (g_log.IsEnabled (ns3::LOG_LOGIC)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; if (g_log.IsEnabled (ns3::LOG_PREFIX_FUNC)) { std
::clog << g_log.Name () << ":" << __FUNCTION__
<< "(): "; }; if (g_log.IsEnabled (ns3::LOG_PREFIX_LEVEL
)) { std::clog << "[" << g_log.GetLevelLabel (ns3
::LOG_LOGIC) << "] "; }; std::clog << "newEnbUeX2apId = "
<< params.newEnbUeX2apId << std::endl; } } while
(false)
;
2328 NS_LOG_LOGIC ("sourceCellId = " << params.sourceCellId)do { if (g_log.IsEnabled (ns3::LOG_LOGIC)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; if (g_log.IsEnabled (ns3::LOG_PREFIX_FUNC)) { std
::clog << g_log.Name () << ":" << __FUNCTION__
<< "(): "; }; if (g_log.IsEnabled (ns3::LOG_PREFIX_LEVEL
)) { std::clog << "[" << g_log.GetLevelLabel (ns3
::LOG_LOGIC) << "] "; }; std::clog << "sourceCellId = "
<< params.sourceCellId << std::endl; } } while (
false)
;
2329 NS_LOG_LOGIC ("targetCellId = " << params.targetCellId)do { if (g_log.IsEnabled (ns3::LOG_LOGIC)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; if (g_log.IsEnabled (ns3::LOG_PREFIX_FUNC)) { std
::clog << g_log.Name () << ":" << __FUNCTION__
<< "(): "; }; if (g_log.IsEnabled (ns3::LOG_PREFIX_LEVEL
)) { std::clog << "[" << g_log.GetLevelLabel (ns3
::LOG_LOGIC) << "] "; }; std::clog << "targetCellId = "
<< params.targetCellId << std::endl; } } while (
false)
;
2330
2331 uint16_t rnti = params.oldEnbUeX2apId;
2332 Ptr<UeManager> ueManager = GetUeManager (rnti);
2333 ueManager->RecvHandoverRequestAck (params);
2334}
2335
2336void
2337LteEnbRrc::DoRecvHandoverPreparationFailure (EpcX2SapUser::HandoverPreparationFailureParams params)
2338{
2339 NS_LOG_FUNCTION (this)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this; std::clog << ")" << std::endl; } } while (
false)
;
2340
2341 NS_LOG_LOGIC ("Recv X2 message: HANDOVER PREPARATION FAILURE")do { if (g_log.IsEnabled (ns3::LOG_LOGIC)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; if (g_log.IsEnabled (ns3::LOG_PREFIX_FUNC)) { std
::clog << g_log.Name () << ":" << __FUNCTION__
<< "(): "; }; if (g_log.IsEnabled (ns3::LOG_PREFIX_LEVEL
)) { std::clog << "[" << g_log.GetLevelLabel (ns3
::LOG_LOGIC) << "] "; }; std::clog << "Recv X2 message: HANDOVER PREPARATION FAILURE"
<< std::endl; } } while (false)
;
2342
2343 NS_LOG_LOGIC ("oldEnbUeX2apId = " << params.oldEnbUeX2apId)do { if (g_log.IsEnabled (ns3::LOG_LOGIC)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; if (g_log.IsEnabled (ns3::LOG_PREFIX_FUNC)) { std
::clog << g_log.Name () << ":" << __FUNCTION__
<< "(): "; }; if (g_log.IsEnabled (ns3::LOG_PREFIX_LEVEL
)) { std::clog << "[" << g_log.GetLevelLabel (ns3
::LOG_LOGIC) << "] "; }; std::clog << "oldEnbUeX2apId = "
<< params.oldEnbUeX2apId << std::endl; } } while
(false)
;
2344 NS_LOG_LOGIC ("sourceCellId = " << params.sourceCellId)do { if (g_log.IsEnabled (ns3::LOG_LOGIC)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; if (g_log.IsEnabled (ns3::LOG_PREFIX_FUNC)) { std
::clog << g_log.Name () << ":" << __FUNCTION__
<< "(): "; }; if (g_log.IsEnabled (ns3::LOG_PREFIX_LEVEL
)) { std::clog << "[" << g_log.GetLevelLabel (ns3
::LOG_LOGIC) << "] "; }; std::clog << "sourceCellId = "
<< params.sourceCellId << std::endl; } } while (
false)
;
2345 NS_LOG_LOGIC ("targetCellId = " << params.targetCellId)do { if (g_log.IsEnabled (ns3::LOG_LOGIC)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; if (g_log.IsEnabled (ns3::LOG_PREFIX_FUNC)) { std
::clog << g_log.Name () << ":" << __FUNCTION__
<< "(): "; }; if (g_log.IsEnabled (ns3::LOG_PREFIX_LEVEL
)) { std::clog << "[" << g_log.GetLevelLabel (ns3
::LOG_LOGIC) << "] "; }; std::clog << "targetCellId = "
<< params.targetCellId << std::endl; } } while (
false)
;
2346 NS_LOG_LOGIC ("cause = " << params.cause)do { if (g_log.IsEnabled (ns3::LOG_LOGIC)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; if (g_log.IsEnabled (ns3::LOG_PREFIX_FUNC)) { std
::clog << g_log.Name () << ":" << __FUNCTION__
<< "(): "; }; if (g_log.IsEnabled (ns3::LOG_PREFIX_LEVEL
)) { std::clog << "[" << g_log.GetLevelLabel (ns3
::LOG_LOGIC) << "] "; }; std::clog << "cause = " <<
params.cause << std::endl; } } while (false)
;
2347 NS_LOG_LOGIC ("criticalityDiagnostics = " << params.criticalityDiagnostics)do { if (g_log.IsEnabled (ns3::LOG_LOGIC)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; if (g_log.IsEnabled (ns3::LOG_PREFIX_FUNC)) { std
::clog << g_log.Name () << ":" << __FUNCTION__
<< "(): "; }; if (g_log.IsEnabled (ns3::LOG_PREFIX_LEVEL
)) { std::clog << "[" << g_log.GetLevelLabel (ns3
::LOG_LOGIC) << "] "; }; std::clog << "criticalityDiagnostics = "
<< params.criticalityDiagnostics << std::endl; }
} while (false)
;
2348
2349 uint16_t rnti = params.oldEnbUeX2apId;
2350 Ptr<UeManager> ueManager = GetUeManager (rnti);
2351 ueManager->RecvHandoverPreparationFailure (params.targetCellId);
2352}
2353
2354void
2355LteEnbRrc::DoRecvSnStatusTransfer (EpcX2SapUser::SnStatusTransferParams params)
2356{
2357 NS_LOG_FUNCTION (this)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this; std::clog << ")" << std::endl; } } while (
false)
;
2358
2359 NS_LOG_LOGIC ("Recv X2 message: SN STATUS TRANSFER")do { if (g_log.IsEnabled (ns3::LOG_LOGIC)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; if (g_log.IsEnabled (ns3::LOG_PREFIX_FUNC)) { std
::clog << g_log.Name () << ":" << __FUNCTION__
<< "(): "; }; if (g_log.IsEnabled (ns3::LOG_PREFIX_LEVEL
)) { std::clog << "[" << g_log.GetLevelLabel (ns3
::LOG_LOGIC) << "] "; }; std::clog << "Recv X2 message: SN STATUS TRANSFER"
<< std::endl; } } while (false)
;
2360
2361 NS_LOG_LOGIC ("oldEnbUeX2apId = " << params.oldEnbUeX2apId)do { if (g_log.IsEnabled (ns3::LOG_LOGIC)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; if (g_log.IsEnabled (ns3::LOG_PREFIX_FUNC)) { std
::clog << g_log.Name () << ":" << __FUNCTION__
<< "(): "; }; if (g_log.IsEnabled (ns3::LOG_PREFIX_LEVEL
)) { std::clog << "[" << g_log.GetLevelLabel (ns3
::LOG_LOGIC) << "] "; }; std::clog << "oldEnbUeX2apId = "
<< params.oldEnbUeX2apId << std::endl; } } while
(false)
;
2362 NS_LOG_LOGIC ("newEnbUeX2apId = " << params.newEnbUeX2apId)do { if (g_log.IsEnabled (ns3::LOG_LOGIC)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; if (g_log.IsEnabled (ns3::LOG_PREFIX_FUNC)) { std
::clog << g_log.Name () << ":" << __FUNCTION__
<< "(): "; }; if (g_log.IsEnabled (ns3::LOG_PREFIX_LEVEL
)) { std::clog << "[" << g_log.GetLevelLabel (ns3
::LOG_LOGIC) << "] "; }; std::clog << "newEnbUeX2apId = "
<< params.newEnbUeX2apId << std::endl; } } while
(false)
;
2363 NS_LOG_LOGIC ("erabsSubjectToStatusTransferList size = " << params.erabsSubjectToStatusTransferList.size ())do { if (g_log.IsEnabled (ns3::LOG_LOGIC)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; if (g_log.IsEnabled (ns3::LOG_PREFIX_FUNC)) { std
::clog << g_log.Name () << ":" << __FUNCTION__
<< "(): "; }; if (g_log.IsEnabled (ns3::LOG_PREFIX_LEVEL
)) { std::clog << "[" << g_log.GetLevelLabel (ns3
::LOG_LOGIC) << "] "; }; std::clog << "erabsSubjectToStatusTransferList size = "
<< params.erabsSubjectToStatusTransferList.size () <<
std::endl; } } while (false)
;
2364
2365 uint16_t rnti = params.newEnbUeX2apId;
2366 Ptr<UeManager> ueManager = GetUeManager (rnti);
2367 ueManager->RecvSnStatusTransfer (params);
2368}
2369
2370void
2371LteEnbRrc::DoRecvUeContextRelease (EpcX2SapUser::UeContextReleaseParams params)
2372{
2373 NS_LOG_FUNCTION (this)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this; std::clog << ")" << std::endl; } } while (
false)
;
2374
2375 NS_LOG_LOGIC ("Recv X2 message: UE CONTEXT RELEASE")do { if (g_log.IsEnabled (ns3::LOG_LOGIC)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; if (g_log.IsEnabled (ns3::LOG_PREFIX_FUNC)) { std
::clog << g_log.Name () << ":" << __FUNCTION__
<< "(): "; }; if (g_log.IsEnabled (ns3::LOG_PREFIX_LEVEL
)) { std::clog << "[" << g_log.GetLevelLabel (ns3
::LOG_LOGIC) << "] "; }; std::clog << "Recv X2 message: UE CONTEXT RELEASE"
<< std::endl; } } while (false)
;
2376
2377 NS_LOG_LOGIC ("oldEnbUeX2apId = " << params.oldEnbUeX2apId)do { if (g_log.IsEnabled (ns3::LOG_LOGIC)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; if (g_log.IsEnabled (ns3::LOG_PREFIX_FUNC)) { std
::clog << g_log.Name () << ":" << __FUNCTION__
<< "(): "; }; if (g_log.IsEnabled (ns3::LOG_PREFIX_LEVEL
)) { std::clog << "[" << g_log.GetLevelLabel (ns3
::LOG_LOGIC) << "] "; }; std::clog << "oldEnbUeX2apId = "
<< params.oldEnbUeX2apId << std::endl; } } while
(false)
;
2378 NS_LOG_LOGIC ("newEnbUeX2apId = " << params.newEnbUeX2apId)do { if (g_log.IsEnabled (ns3::LOG_LOGIC)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; if (g_log.IsEnabled (ns3::LOG_PREFIX_FUNC)) { std
::clog << g_log.Name () << ":" << __FUNCTION__
<< "(): "; }; if (g_log.IsEnabled (ns3::LOG_PREFIX_LEVEL
)) { std::clog << "[" << g_log.GetLevelLabel (ns3
::LOG_LOGIC) << "] "; }; std::clog << "newEnbUeX2apId = "
<< params.newEnbUeX2apId << std::endl; } } while
(false)
;
2379
2380 uint16_t rnti = params.oldEnbUeX2apId;
2381 GetUeManager (rnti)->RecvUeContextRelease (params);
2382 RemoveUe (rnti);
2383}
2384
2385void
2386LteEnbRrc::DoRecvLoadInformation (EpcX2SapUser::LoadInformationParams params)
2387{
2388 NS_LOG_FUNCTION (this)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this; std::clog << ")" << std::endl; } } while (
false)
;
2389
2390 NS_LOG_LOGIC ("Recv X2 message: LOAD INFORMATION")do { if (g_log.IsEnabled (ns3::LOG_LOGIC)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; if (g_log.IsEnabled (ns3::LOG_PREFIX_FUNC)) { std
::clog << g_log.Name () << ":" << __FUNCTION__
<< "(): "; }; if (g_log.IsEnabled (ns3::LOG_PREFIX_LEVEL
)) { std::clog << "[" << g_log.GetLevelLabel (ns3
::LOG_LOGIC) << "] "; }; std::clog << "Recv X2 message: LOAD INFORMATION"
<< std::endl; } } while (false)
;
2391
2392 NS_LOG_LOGIC ("Number of cellInformationItems = " << params.cellInformationList.size ())do { if (g_log.IsEnabled (ns3::LOG_LOGIC)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; if (g_log.IsEnabled (ns3::LOG_PREFIX_FUNC)) { std
::clog << g_log.Name () << ":" << __FUNCTION__
<< "(): "; }; if (g_log.IsEnabled (ns3::LOG_PREFIX_LEVEL
)) { std::clog << "[" << g_log.GetLevelLabel (ns3
::LOG_LOGIC) << "] "; }; std::clog << "Number of cellInformationItems = "
<< params.cellInformationList.size () << std::endl
; } } while (false)
;
2393
2394 m_ffrRrcSapProvider.at (0)->RecvLoadInformation (params);
2395}
2396
2397void
2398LteEnbRrc::DoRecvResourceStatusUpdate (EpcX2SapUser::ResourceStatusUpdateParams params)
2399{
2400 NS_LOG_FUNCTION (this)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this; std::clog << ")" << std::endl; } } while (
false)
;
2401
2402 NS_LOG_LOGIC ("Recv X2 message: RESOURCE STATUS UPDATE")do { if (g_log.IsEnabled (ns3::LOG_LOGIC)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; if (g_log.IsEnabled (ns3::LOG_PREFIX_FUNC)) { std
::clog << g_log.Name () << ":" << __FUNCTION__
<< "(): "; }; if (g_log.IsEnabled (ns3::LOG_PREFIX_LEVEL
)) { std::clog << "[" << g_log.GetLevelLabel (ns3
::LOG_LOGIC) << "] "; }; std::clog << "Recv X2 message: RESOURCE STATUS UPDATE"
<< std::endl; } } while (false)
;
2403
2404 NS_LOG_LOGIC ("Number of cellMeasurementResultItems = " << params.cellMeasurementResultList.size ())do { if (g_log.IsEnabled (ns3::LOG_LOGIC)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; if (g_log.IsEnabled (ns3::LOG_PREFIX_FUNC)) { std
::clog << g_log.Name () << ":" << __FUNCTION__
<< "(): "; }; if (g_log.IsEnabled (ns3::LOG_PREFIX_LEVEL
)) { std::clog << "[" << g_log.GetLevelLabel (ns3
::LOG_LOGIC) << "] "; }; std::clog << "Number of cellMeasurementResultItems = "
<< params.cellMeasurementResultList.size () << std
::endl; } } while (false)
;
2405
2406 NS_ASSERT ("Processing of RESOURCE STATUS UPDATE X2 message IS NOT IMPLEMENTED")do { if (!("Processing of RESOURCE STATUS UPDATE X2 message IS NOT IMPLEMENTED"
)) { std::cerr << "assert failed. cond=\"" << "\"Processing of RESOURCE STATUS UPDATE X2 message IS NOT IMPLEMENTED\""
<< "\", "; do { std::cerr << "file=" << "../src/lte/model/lte-enb-rrc.cc"
<< ", line=" << 2406 << std::endl; ::ns3::
FatalImpl::FlushStreams (); if (true) std::terminate (); } while
(false); } } while (false)
;
2407}
2408
2409void
2410LteEnbRrc::DoRecvUeData (EpcX2SapUser::UeDataParams params)
2411{
2412 NS_LOG_FUNCTION (this)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this; std::clog << ")" << std::endl; } } while (
false)
;
2413
2414 NS_LOG_LOGIC ("Recv UE DATA FORWARDING through X2 interface")do { if (g_log.IsEnabled (ns3::LOG_LOGIC)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; if (g_log.IsEnabled (ns3::LOG_PREFIX_FUNC)) { std
::clog << g_log.Name () << ":" << __FUNCTION__
<< "(): "; }; if (g_log.IsEnabled (ns3::LOG_PREFIX_LEVEL
)) { std::clog << "[" << g_log.GetLevelLabel (ns3
::LOG_LOGIC) << "] "; }; std::clog << "Recv UE DATA FORWARDING through X2 interface"
<< std::endl; } } while (false)
;
2415 NS_LOG_LOGIC ("sourceCellId = " << params.sourceCellId)do { if (g_log.IsEnabled (ns3::LOG_LOGIC)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; if (g_log.IsEnabled (ns3::LOG_PREFIX_FUNC)) { std
::clog << g_log.Name () << ":" << __FUNCTION__
<< "(): "; }; if (g_log.IsEnabled (ns3::LOG_PREFIX_LEVEL
)) { std::clog << "[" << g_log.GetLevelLabel (ns3
::LOG_LOGIC) << "] "; }; std::clog << "sourceCellId = "
<< params.sourceCellId << std::endl; } } while (
false)
;
2416 NS_LOG_LOGIC ("targetCellId = " << params.targetCellId)do { if (g_log.IsEnabled (ns3::LOG_LOGIC)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; if (g_log.IsEnabled (ns3::LOG_PREFIX_FUNC)) { std
::clog << g_log.Name () << ":" << __FUNCTION__
<< "(): "; }; if (g_log.IsEnabled (ns3::LOG_PREFIX_LEVEL
)) { std::clog << "[" << g_log.GetLevelLabel (ns3
::LOG_LOGIC) << "] "; }; std::clog << "targetCellId = "
<< params.targetCellId << std::endl; } } while (
false)
;
2417 NS_LOG_LOGIC ("gtpTeid = " << params.gtpTeid)do { if (g_log.IsEnabled (ns3::LOG_LOGIC)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; if (g_log.IsEnabled (ns3::LOG_PREFIX_FUNC)) { std
::clog << g_log.Name () << ":" << __FUNCTION__
<< "(): "; }; if (g_log.IsEnabled (ns3::LOG_PREFIX_LEVEL
)) { std::clog << "[" << g_log.GetLevelLabel (ns3
::LOG_LOGIC) << "] "; }; std::clog << "gtpTeid = "
<< params.gtpTeid << std::endl; } } while (false
)
;
2418 NS_LOG_LOGIC ("ueData = " << params.ueData)do { if (g_log.IsEnabled (ns3::LOG_LOGIC)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; if (g_log.IsEnabled (ns3::LOG_PREFIX_FUNC)) { std
::clog << g_log.Name () << ":" << __FUNCTION__
<< "(): "; }; if (g_log.IsEnabled (ns3::LOG_PREFIX_LEVEL
)) { std::clog << "[" << g_log.GetLevelLabel (ns3
::LOG_LOGIC) << "] "; }; std::clog << "ueData = "
<< params.ueData << std::endl; } } while (false)
;
2419 NS_LOG_LOGIC ("ueData size = " << params.ueData->GetSize ())do { if (g_log.IsEnabled (ns3::LOG_LOGIC)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; if (g_log.IsEnabled (ns3::LOG_PREFIX_FUNC)) { std
::clog << g_log.Name () << ":" << __FUNCTION__
<< "(): "; }; if (g_log.IsEnabled (ns3::LOG_PREFIX_LEVEL
)) { std::clog << "[" << g_log.GetLevelLabel (ns3
::LOG_LOGIC) << "] "; }; std::clog << "ueData size = "
<< params.ueData->GetSize () << std::endl; } }
while (false)
;
2420
2421 std::map<uint32_t, X2uTeidInfo>::iterator
2422 teidInfoIt = m_x2uTeidInfoMap.find (params.gtpTeid);
2423 if (teidInfoIt != m_x2uTeidInfoMap.end ())
2424 {
2425 GetUeManager (teidInfoIt->second.rnti)->SendData (teidInfoIt->second.drbid, params.ueData);
2426 }
2427 else
2428 {
2429 NS_FATAL_ERROR ("X2-U data received but no X2uTeidInfo found")do { std::cerr << "msg=\"" << "X2-U data received but no X2uTeidInfo found"
<< "\", "; do { std::cerr << "file=" << "../src/lte/model/lte-enb-rrc.cc"
<< ", line=" << 2429 << std::endl; ::ns3::
FatalImpl::FlushStreams (); if (true) std::terminate (); } while
(false); } while (false)
;
2430 }
2431}
2432
2433
2434uint16_t
2435LteEnbRrc::DoAllocateTemporaryCellRnti ()
2436{
2437 NS_LOG_FUNCTION (this)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this; std::clog << ")" << std::endl; } } while (
false)
;
2438 return AddUe (UeManager::INITIAL_RANDOM_ACCESS);
2439}
2440
2441void
2442LteEnbRrc::DoRrcConfigurationUpdateInd (LteEnbCmacSapUser::UeConfig cmacParams)
2443{
2444 Ptr<UeManager> ueManager = GetUeManager (cmacParams.m_rnti);
2445 ueManager->CmacUeConfigUpdateInd (cmacParams);
2446}
2447
2448void
2449LteEnbRrc::DoNotifyLcConfigResult (uint16_t rnti, uint8_t lcid, bool success)
2450{
2451 NS_LOG_FUNCTION (this << (uint32_t) rnti)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this << (uint32_t) rnti; std::clog << ")" <<
std::endl; } } while (false)
;
2452 NS_FATAL_ERROR ("not implemented")do { std::cerr << "msg=\"" << "not implemented" <<
"\", "; do { std::cerr << "file=" << "../src/lte/model/lte-enb-rrc.cc"
<< ", line=" << 2452 << std::endl; ::ns3::
FatalImpl::FlushStreams (); if (true) std::terminate (); } while
(false); } while (false)
;
2453}
2454
2455
2456uint8_t
2457LteEnbRrc::DoAddUeMeasReportConfigForHandover (LteRrcSap::ReportConfigEutra reportConfig)
2458{
2459 NS_LOG_FUNCTION (this)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this; std::clog << ")" << std::endl; } } while (
false)
;
2460 uint8_t measId = AddUeMeasReportConfig (reportConfig);
2461 m_handoverMeasIds.insert (measId);
2462 return measId;
2463}
2464
2465uint8_t
2466LteEnbRrc::DoAddUeMeasReportConfigForComponentCarrier (LteRrcSap::ReportConfigEutra reportConfig)
2467{
2468 NS_LOG_FUNCTION (this)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this; std::clog << ")" << std::endl; } } while (
false)
;
2469 uint8_t measId = AddUeMeasReportConfig (reportConfig);
2470 m_componentCarrierMeasIds.insert (measId);
2471 return measId;
2472}
2473
2474void
2475LteEnbRrc::DoTriggerHandover (uint16_t rnti, uint16_t targetCellId)
2476{
2477 NS_LOG_FUNCTION (this << rnti << targetCellId)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this << rnti << targetCellId; std::clog <<
")" << std::endl; } } while (false)
;
2478
2479 bool isHandoverAllowed = true;
2480
2481 if (m_anrSapProvider != 0)
2482 {
2483 // ensure that proper neighbour relationship exists between source and target cells
2484 bool noHo = m_anrSapProvider->GetNoHo (targetCellId);
2485 bool noX2 = m_anrSapProvider->GetNoX2 (targetCellId);
2486 NS_LOG_DEBUG (this << " cellId=" << m_cellIddo { if (g_log.IsEnabled (ns3::LOG_DEBUG)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; if (g_log.IsEnabled (ns3::LOG_PREFIX_FUNC)) { std
::clog << g_log.Name () << ":" << __FUNCTION__
<< "(): "; }; if (g_log.IsEnabled (ns3::LOG_PREFIX_LEVEL
)) { std::clog << "[" << g_log.GetLevelLabel (ns3
::LOG_DEBUG) << "] "; }; std::clog << this <<
" cellId=" << m_cellId << " targetCellId=" <<
targetCellId << " NRT.NoHo=" << noHo << " NRT.NoX2="
<< noX2 << std::endl; } } while (false)
2487 << " targetCellId=" << targetCellIddo { if (g_log.IsEnabled (ns3::LOG_DEBUG)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; if (g_log.IsEnabled (ns3::LOG_PREFIX_FUNC)) { std
::clog << g_log.Name () << ":" << __FUNCTION__
<< "(): "; }; if (g_log.IsEnabled (ns3::LOG_PREFIX_LEVEL
)) { std::clog << "[" << g_log.GetLevelLabel (ns3
::LOG_DEBUG) << "] "; }; std::clog << this <<
" cellId=" << m_cellId << " targetCellId=" <<
targetCellId << " NRT.NoHo=" << noHo << " NRT.NoX2="
<< noX2 << std::endl; } } while (false)
2488 << " NRT.NoHo=" << noHo << " NRT.NoX2=" << noX2)do { if (g_log.IsEnabled (ns3::LOG_DEBUG)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; if (g_log.IsEnabled (ns3::LOG_PREFIX_FUNC)) { std
::clog << g_log.Name () << ":" << __FUNCTION__
<< "(): "; }; if (g_log.IsEnabled (ns3::LOG_PREFIX_LEVEL
)) { std::clog << "[" << g_log.GetLevelLabel (ns3
::LOG_DEBUG) << "] "; }; std::clog << this <<
" cellId=" << m_cellId << " targetCellId=" <<
targetCellId << " NRT.NoHo=" << noHo << " NRT.NoX2="
<< noX2 << std::endl; } } while (false)
;
2489
2490 if (noHo || noX2)
2491 {
2492 isHandoverAllowed = false;
2493 NS_LOG_LOGIC (this << " handover to cell " << targetCellIddo { if (g_log.IsEnabled (ns3::LOG_LOGIC)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; if (g_log.IsEnabled (ns3::LOG_PREFIX_FUNC)) { std
::clog << g_log.Name () << ":" << __FUNCTION__
<< "(): "; }; if (g_log.IsEnabled (ns3::LOG_PREFIX_LEVEL
)) { std::clog << "[" << g_log.GetLevelLabel (ns3
::LOG_LOGIC) << "] "; }; std::clog << this <<
" handover to cell " << targetCellId << " is not allowed by ANR"
<< std::endl; } } while (false)
2494 << " is not allowed by ANR")do { if (g_log.IsEnabled (ns3::LOG_LOGIC)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; if (g_log.IsEnabled (ns3::LOG_PREFIX_FUNC)) { std
::clog << g_log.Name () << ":" << __FUNCTION__
<< "(): "; }; if (g_log.IsEnabled (ns3::LOG_PREFIX_LEVEL
)) { std::clog << "[" << g_log.GetLevelLabel (ns3
::LOG_LOGIC) << "] "; }; std::clog << this <<
" handover to cell " << targetCellId << " is not allowed by ANR"
<< std::endl; } } while (false)
;
2495 }
2496 }
2497
2498 Ptr<UeManager> ueManager = GetUeManager (rnti);
2499 NS_ASSERT_MSG (ueManager != 0, "Cannot find UE context with RNTI " << rnti)do { if (!(ueManager != 0)) { std::cerr << "assert failed. cond=\""
<< "ueManager != 0" << "\", "; do { std::cerr <<
"msg=\"" << "Cannot find UE context with RNTI " <<
rnti << "\", "; do { std::cerr << "file=" <<
"../src/lte/model/lte-enb-rrc.cc" << ", line=" <<
2499 << std::endl; ::ns3::FatalImpl::FlushStreams (); if
(true) std::terminate (); } while (false); } while (false); }
} while (false)
;
2500
2501 if (ueManager->GetState () != UeManager::CONNECTED_NORMALLY)
2502 {
2503 isHandoverAllowed = false;
2504 NS_LOG_LOGIC (this << " handover is not allowed because the UE"do { if (g_log.IsEnabled (ns3::LOG_LOGIC)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; if (g_log.IsEnabled (ns3::LOG_PREFIX_FUNC)) { std
::clog << g_log.Name () << ":" << __FUNCTION__
<< "(): "; }; if (g_log.IsEnabled (ns3::LOG_PREFIX_LEVEL
)) { std::clog << "[" << g_log.GetLevelLabel (ns3
::LOG_LOGIC) << "] "; }; std::clog << this <<
" handover is not allowed because the UE" << " rnti=" <<
rnti << " is in " << ToString (ueManager->GetState
()) << " state" << std::endl; } } while (false)
2505 << " rnti=" << rnti << " is in "do { if (g_log.IsEnabled (ns3::LOG_LOGIC)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; if (g_log.IsEnabled (ns3::LOG_PREFIX_FUNC)) { std
::clog << g_log.Name () << ":" << __FUNCTION__
<< "(): "; }; if (g_log.IsEnabled (ns3::LOG_PREFIX_LEVEL
)) { std::clog << "[" << g_log.GetLevelLabel (ns3
::LOG_LOGIC) << "] "; }; std::clog << this <<
" handover is not allowed because the UE" << " rnti=" <<
rnti << " is in " << ToString (ueManager->GetState
()) << " state" << std::endl; } } while (false)
2506 << ToString (ueManager->GetState ()) << " state")do { if (g_log.IsEnabled (ns3::LOG_LOGIC)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; if (g_log.IsEnabled (ns3::LOG_PREFIX_FUNC)) { std
::clog << g_log.Name () << ":" << __FUNCTION__
<< "(): "; }; if (g_log.IsEnabled (ns3::LOG_PREFIX_LEVEL
)) { std::clog << "[" << g_log.GetLevelLabel (ns3
::LOG_LOGIC) << "] "; }; std::clog << this <<
" handover is not allowed because the UE" << " rnti=" <<
rnti << " is in " << ToString (ueManager->GetState
()) << " state" << std::endl; } } while (false)
;
2507 }
2508
2509 if (isHandoverAllowed)
2510 {
2511 // initiate handover execution
2512 ueManager->PrepareHandover (targetCellId);
2513 }
2514}
2515
2516uint8_t
2517LteEnbRrc::DoAddUeMeasReportConfigForAnr (LteRrcSap::ReportConfigEutra reportConfig)
2518{
2519 NS_LOG_FUNCTION (this)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this; std::clog << ")" << std::endl; } } while (
false)
;
2520 uint8_t measId = AddUeMeasReportConfig (reportConfig);
2521 m_anrMeasIds.insert (measId);
2522 return measId;
2523}
2524
2525uint8_t
2526LteEnbRrc::DoAddUeMeasReportConfigForFfr (LteRrcSap::ReportConfigEutra reportConfig)
2527{
2528 NS_LOG_FUNCTION (this)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this; std::clog << ")" << std::endl; } } while (
false)
;
2529 uint8_t measId = AddUeMeasReportConfig (reportConfig);
2530 m_ffrMeasIds.insert (measId);
2531 return measId;
2532}
2533
2534void
2535LteEnbRrc::DoSetPdschConfigDedicated (uint16_t rnti, LteRrcSap::PdschConfigDedicated pdschConfigDedicated)
2536{
2537 NS_LOG_FUNCTION (this)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this; std::clog << ")" << std::endl; } } while (
false)
;
2538 Ptr<UeManager> ueManager = GetUeManager (rnti);
2539 ueManager->SetPdschConfigDedicated (pdschConfigDedicated);
2540}
2541
2542void
2543LteEnbRrc::DoSendLoadInformation (EpcX2Sap::LoadInformationParams params)
2544{
2545 NS_LOG_FUNCTION (this)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this; std::clog << ")" << std::endl; } } while (
false)
;
2546
2547 m_x2SapProvider->SendLoadInformation(params);
2548}
2549
2550uint16_t
2551LteEnbRrc::AddUe (UeManager::State state)
2552{
2553 NS_LOG_FUNCTION (this)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this; std::clog << ")" << std::endl; } } while (
false)
;
2554 bool found = false;
2555 uint16_t rnti;
2556 for (rnti = m_lastAllocatedRnti + 1;
2557 (rnti != m_lastAllocatedRnti - 1) && (!found);
2558 ++rnti)
2559 {
2560 if ((rnti != 0) && (m_ueMap.find (rnti) == m_ueMap.end ()))
2561 {
2562 found = true;
2563 break;
2564 }
2565 }
2566
2567 NS_ASSERT_MSG (found, "no more RNTIs available (do you have more than 65535 UEs in a cell?)")do { if (!(found)) { std::cerr << "assert failed. cond=\""
<< "found" << "\", "; do { std::cerr << "msg=\""
<< "no more RNTIs available (do you have more than 65535 UEs in a cell?)"
<< "\", "; do { std::cerr << "file=" << "../src/lte/model/lte-enb-rrc.cc"
<< ", line=" << 2567 << std::endl; ::ns3::
FatalImpl::FlushStreams (); if (true) std::terminate (); } while
(false); } while (false); } } while (false)
;
2568 m_lastAllocatedRnti = rnti;
2569 Ptr<UeManager> ueManager = CreateObject<UeManager> (this, rnti, state);
2570 m_ccmRrcSapProvider-> AddUe (rnti, (uint8_t)state);
2571 m_ueMap.insert (std::pair<uint16_t, Ptr<UeManager> > (rnti, ueManager));
2572 ueManager->Initialize ();
2573 NS_LOG_DEBUG (this << " New UE RNTI " << rnti << " cellId " << m_cellId << " srs CI " << ueManager->GetSrsConfigurationIndex ())do { if (g_log.IsEnabled (ns3::LOG_DEBUG)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; if (g_log.IsEnabled (ns3::LOG_PREFIX_FUNC)) { std
::clog << g_log.Name () << ":" << __FUNCTION__
<< "(): "; }; if (g_log.IsEnabled (ns3::LOG_PREFIX_LEVEL
)) { std::clog << "[" << g_log.GetLevelLabel (ns3
::LOG_DEBUG) << "] "; }; std::clog << this <<
" New UE RNTI " << rnti << " cellId " << m_cellId
<< " srs CI " << ueManager->GetSrsConfigurationIndex
() << std::endl; } } while (false)
;
2574 m_newUeContextTrace (m_cellId, rnti);
2575 return rnti;
2576}
2577
2578void
2579LteEnbRrc::RemoveUe (uint16_t rnti)
2580{
2581 NS_LOG_FUNCTION (this << (uint32_t) rnti)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this << (uint32_t) rnti; std::clog << ")" <<
std::endl; } } while (false)
;
2582 std::map <uint16_t, Ptr<UeManager> >::iterator it = m_ueMap.find (rnti);
2583 NS_ASSERT_MSG (it != m_ueMap.end (), "request to remove UE info with unknown rnti " << rnti)do { if (!(it != m_ueMap.end ())) { std::cerr << "assert failed. cond=\""
<< "it != m_ueMap.end ()" << "\", "; do { std::cerr
<< "msg=\"" << "request to remove UE info with unknown rnti "
<< rnti << "\", "; do { std::cerr << "file="
<< "../src/lte/model/lte-enb-rrc.cc" << ", line="
<< 2583 << std::endl; ::ns3::FatalImpl::FlushStreams
(); if (true) std::terminate (); } while (false); } while (false
); } } while (false)
;
2584 uint16_t srsCi = (*it).second->GetSrsConfigurationIndex ();
2585 m_ueMap.erase (it);
2586 for (uint8_t i = 0; i < m_numberOfComponentCarriers; i++)
2587 {
2588 m_cmacSapProvider.at (i)->RemoveUe (rnti);
2589 m_cphySapProvider.at (i)->RemoveUe (rnti);
2590 }
2591 if (m_s1SapProvider != 0)
2592 {
2593 m_s1SapProvider->UeContextRelease (rnti);
2594 }
2595 m_ccmRrcSapProvider-> RemoveUe (rnti);
2596 // need to do this after UeManager has been deleted
2597 RemoveSrsConfigurationIndex (srsCi);
2598}
2599
2600TypeId
2601LteEnbRrc::GetRlcType (EpsBearer bearer)
2602{
2603 switch (m_epsBearerToRlcMapping)
2604 {
2605 case RLC_SM_ALWAYS:
2606 return LteRlcSm::GetTypeId ();
2607 break;
2608
2609 case RLC_UM_ALWAYS:
2610 return LteRlcUm::GetTypeId ();
2611 break;
2612
2613 case RLC_AM_ALWAYS:
2614 return LteRlcAm::GetTypeId ();
2615 break;
2616
2617 case PER_BASED:
2618 if (bearer.GetPacketErrorLossRate () > 1.0e-5)
2619 {
2620 return LteRlcUm::GetTypeId ();
2621 }
2622 else
2623 {
2624 return LteRlcAm::GetTypeId ();
2625 }
2626 break;
2627
2628 default:
2629 return LteRlcSm::GetTypeId ();
2630 break;
2631 }
2632}
2633
2634
2635void
2636LteEnbRrc::AddX2Neighbour (uint16_t cellId)
2637{
2638 NS_LOG_FUNCTION (this << cellId)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this << cellId; std::clog << ")" << std::endl
; } } while (false)
;
2639
2640 if (m_anrSapProvider != 0)
2641 {
2642 m_anrSapProvider->AddNeighbourRelation (cellId);
2643 }
2644}
2645
2646void
2647LteEnbRrc::SetCsgId (uint32_t csgId, bool csgIndication)
2648{
2649 NS_LOG_FUNCTION (this << csgId << csgIndication)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this << csgId << csgIndication; std::clog <<
")" << std::endl; } } while (false)
;
2650 m_sib1.cellAccessRelatedInfo.csgIdentity = csgId;
2651 m_sib1.cellAccessRelatedInfo.csgIndication = csgIndication;
2652 m_cphySapProvider.at (0)->SetSystemInformationBlockType1 (m_sib1);
2653}
2654
2655void
2656LteEnbRrc::SetNumberOfComponentCarriers(uint16_t numberOfComponentCarriers)
2657{
2658 m_numberOfComponentCarriers = numberOfComponentCarriers;
2659}
2660
2661/// Number of distinct SRS periodicity plus one.
2662static const uint8_t SRS_ENTRIES = 9;
2663/**
2664 * Sounding Reference Symbol (SRS) periodicity (TSRS) in milliseconds. Taken
2665 * from 3GPP TS 36.213 Table 8.2-1. Index starts from 1.
2666 */
2667static const uint16_t g_srsPeriodicity[SRS_ENTRIES] = {0, 2, 5, 10, 20, 40, 80, 160, 320};
2668/**
2669 * The lower bound (inclusive) of the SRS configuration indices (ISRS) which
2670 * use the corresponding SRS periodicity (TSRS). Taken from 3GPP TS 36.213
2671 * Table 8.2-1. Index starts from 1.
2672 */
2673static const uint16_t g_srsCiLow[SRS_ENTRIES] = {0, 0, 2, 7, 17, 37, 77, 157, 317};
2674/**
2675 * The upper bound (inclusive) of the SRS configuration indices (ISRS) which
2676 * use the corresponding SRS periodicity (TSRS). Taken from 3GPP TS 36.213
2677 * Table 8.2-1. Index starts from 1.
2678 */
2679static const uint16_t g_srsCiHigh[SRS_ENTRIES] = {0, 1, 6, 16, 36, 76, 156, 316, 636};
2680
2681void
2682LteEnbRrc::SetSrsPeriodicity (uint32_t p)
2683{
2684 NS_LOG_FUNCTION (this << p)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this << p; std::clog << ")" << std::endl; }
} while (false)
;
2685 for (uint32_t id = 1; id < SRS_ENTRIES; ++id)
2686 {
2687 if (g_srsPeriodicity[id] == p)
2688 {
2689 m_srsCurrentPeriodicityId = id;
2690 return;
2691 }
2692 }
2693 // no match found
2694 std::ostringstream allowedValues;
2695 for (uint32_t id = 1; id < SRS_ENTRIES; ++id)
2696 {
2697 allowedValues << g_srsPeriodicity[id] << " ";
2698 }
2699 NS_FATAL_ERROR ("illecit SRS periodicity value " << p << ". Allowed values: " << allowedValues.str ())do { std::cerr << "msg=\"" << "illecit SRS periodicity value "
<< p << ". Allowed values: " << allowedValues
.str () << "\", "; do { std::cerr << "file=" <<
"../src/lte/model/lte-enb-rrc.cc" << ", line=" <<
2699 << std::endl; ::ns3::FatalImpl::FlushStreams (); if
(true) std::terminate (); } while (false); } while (false)
;
2700}
2701
2702uint32_t
2703LteEnbRrc::GetSrsPeriodicity () const
2704{
2705 NS_LOG_FUNCTION (this)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this; std::clog << ")" << std::endl; } } while (
false)
;
2706 NS_ASSERT (m_srsCurrentPeriodicityId > 0)do { if (!(m_srsCurrentPeriodicityId > 0)) { std::cerr <<
"assert failed. cond=\"" << "m_srsCurrentPeriodicityId > 0"
<< "\", "; do { std::cerr << "file=" << "../src/lte/model/lte-enb-rrc.cc"
<< ", line=" << 2706 << std::endl; ::ns3::
FatalImpl::FlushStreams (); if (true) std::terminate (); } while
(false); } } while (false)
;
2707 NS_ASSERT (m_srsCurrentPeriodicityId < SRS_ENTRIES)do { if (!(m_srsCurrentPeriodicityId < SRS_ENTRIES)) { std
::cerr << "assert failed. cond=\"" << "m_srsCurrentPeriodicityId < SRS_ENTRIES"
<< "\", "; do { std::cerr << "file=" << "../src/lte/model/lte-enb-rrc.cc"
<< ", line=" << 2707 << std::endl; ::ns3::
FatalImpl::FlushStreams (); if (true) std::terminate (); } while
(false); } } while (false)
;
2708 return g_srsPeriodicity[m_srsCurrentPeriodicityId];
2709}
2710
2711
2712uint16_t
2713LteEnbRrc::GetNewSrsConfigurationIndex ()
2714{
2715 NS_LOG_FUNCTION (this << m_ueSrsConfigurationIndexSet.size ())do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this << m_ueSrsConfigurationIndexSet.size (); std::clog
<< ")" << std::endl; } } while (false)
;
2716 // SRS
2717 NS_ASSERT (m_srsCurrentPeriodicityId > 0)do { if (!(m_srsCurrentPeriodicityId > 0)) { std::cerr <<
"assert failed. cond=\"" << "m_srsCurrentPeriodicityId > 0"
<< "\", "; do { std::cerr << "file=" << "../src/lte/model/lte-enb-rrc.cc"
<< ", line=" << 2717 << std::endl; ::ns3::
FatalImpl::FlushStreams (); if (true) std::terminate (); } while
(false); } } while (false)
;
2718 NS_ASSERT (m_srsCurrentPeriodicityId < SRS_ENTRIES)do { if (!(m_srsCurrentPeriodicityId < SRS_ENTRIES)) { std
::cerr << "assert failed. cond=\"" << "m_srsCurrentPeriodicityId < SRS_ENTRIES"
<< "\", "; do { std::cerr << "file=" << "../src/lte/model/lte-enb-rrc.cc"
<< ", line=" << 2718 << std::endl; ::ns3::
FatalImpl::FlushStreams (); if (true) std::terminate (); } while
(false); } } while (false)
;
2719 NS_LOG_DEBUG (this << " SRS p " << g_srsPeriodicity[m_srsCurrentPeriodicityId] << " set " << m_ueSrsConfigurationIndexSet.size ())do { if (g_log.IsEnabled (ns3::LOG_DEBUG)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; if (g_log.IsEnabled (ns3::LOG_PREFIX_FUNC)) { std
::clog << g_log.Name () << ":" << __FUNCTION__
<< "(): "; }; if (g_log.IsEnabled (ns3::LOG_PREFIX_LEVEL
)) { std::clog << "[" << g_log.GetLevelLabel (ns3
::LOG_DEBUG) << "] "; }; std::clog << this <<
" SRS p " << g_srsPeriodicity[m_srsCurrentPeriodicityId
] << " set " << m_ueSrsConfigurationIndexSet.size
() << std::endl; } } while (false)
;
2720 if (m_ueSrsConfigurationIndexSet.size () >= g_srsPeriodicity[m_srsCurrentPeriodicityId])
2721 {
2722 NS_FATAL_ERROR ("too many UEs (" << m_ueSrsConfigurationIndexSet.size () + 1do { std::cerr << "msg=\"" << "too many UEs (" <<
m_ueSrsConfigurationIndexSet.size () + 1 << ") for current SRS periodicity "
<< g_srsPeriodicity[m_srsCurrentPeriodicityId] <<
", consider increasing the value of ns3::LteEnbRrc::SrsPeriodicity"
<< "\", "; do { std::cerr << "file=" << "../src/lte/model/lte-enb-rrc.cc"
<< ", line=" << 2725 << std::endl; ::ns3::
FatalImpl::FlushStreams (); if (true) std::terminate (); } while
(false); } while (false)
2723 << ") for current SRS periodicity "do { std::cerr << "msg=\"" << "too many UEs (" <<
m_ueSrsConfigurationIndexSet.size () + 1 << ") for current SRS periodicity "
<< g_srsPeriodicity[m_srsCurrentPeriodicityId] <<
", consider increasing the value of ns3::LteEnbRrc::SrsPeriodicity"
<< "\", "; do { std::cerr << "file=" << "../src/lte/model/lte-enb-rrc.cc"
<< ", line=" << 2725 << std::endl; ::ns3::
FatalImpl::FlushStreams (); if (true) std::terminate (); } while
(false); } while (false)
2724 << g_srsPeriodicity[m_srsCurrentPeriodicityId]do { std::cerr << "msg=\"" << "too many UEs (" <<
m_ueSrsConfigurationIndexSet.size () + 1 << ") for current SRS periodicity "
<< g_srsPeriodicity[m_srsCurrentPeriodicityId] <<
", consider increasing the value of ns3::LteEnbRrc::SrsPeriodicity"
<< "\", "; do { std::cerr << "file=" << "../src/lte/model/lte-enb-rrc.cc"
<< ", line=" << 2725 << std::endl; ::ns3::
FatalImpl::FlushStreams (); if (true) std::terminate (); } while
(false); } while (false)
2725 << ", consider increasing the value of ns3::LteEnbRrc::SrsPeriodicity")do { std::cerr << "msg=\"" << "too many UEs (" <<
m_ueSrsConfigurationIndexSet.size () + 1 << ") for current SRS periodicity "
<< g_srsPeriodicity[m_srsCurrentPeriodicityId] <<
", consider increasing the value of ns3::LteEnbRrc::SrsPeriodicity"
<< "\", "; do { std::cerr << "file=" << "../src/lte/model/lte-enb-rrc.cc"
<< ", line=" << 2725 << std::endl; ::ns3::
FatalImpl::FlushStreams (); if (true) std::terminate (); } while
(false); } while (false)
;
2726 }
2727
2728 if (m_ueSrsConfigurationIndexSet.empty ())
2729 {
2730 // first entry
2731 m_lastAllocatedConfigurationIndex = g_srsCiLow[m_srsCurrentPeriodicityId];
2732 m_ueSrsConfigurationIndexSet.insert (m_lastAllocatedConfigurationIndex);
2733 }
2734 else
2735 {
2736 // find a CI from the available ones
2737 std::set<uint16_t>::reverse_iterator rit = m_ueSrsConfigurationIndexSet.rbegin ();
2738 NS_ASSERT (rit != m_ueSrsConfigurationIndexSet.rend ())do { if (!(rit != m_ueSrsConfigurationIndexSet.rend ())) { std
::cerr << "assert failed. cond=\"" << "rit != m_ueSrsConfigurationIndexSet.rend ()"
<< "\", "; do { std::cerr << "file=" << "../src/lte/model/lte-enb-rrc.cc"
<< ", line=" << 2738 << std::endl; ::ns3::
FatalImpl::FlushStreams (); if (true) std::terminate (); } while
(false); } } while (false)
;
2739 NS_LOG_DEBUG (this << " lower bound " << (*rit) << " of " << g_srsCiHigh[m_srsCurrentPeriodicityId])do { if (g_log.IsEnabled (ns3::LOG_DEBUG)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; if (g_log.IsEnabled (ns3::LOG_PREFIX_FUNC)) { std
::clog << g_log.Name () << ":" << __FUNCTION__
<< "(): "; }; if (g_log.IsEnabled (ns3::LOG_PREFIX_LEVEL
)) { std::clog << "[" << g_log.GetLevelLabel (ns3
::LOG_DEBUG) << "] "; }; std::clog << this <<
" lower bound " << (*rit) << " of " << g_srsCiHigh
[m_srsCurrentPeriodicityId] << std::endl; } } while (false
)
;
2740 if ((*rit) < g_srsCiHigh[m_srsCurrentPeriodicityId])
2741 {
2742 // got it from the upper bound
2743 m_lastAllocatedConfigurationIndex = (*rit) + 1;
2744 m_ueSrsConfigurationIndexSet.insert (m_lastAllocatedConfigurationIndex);
2745 }
2746 else
2747 {
2748 // look for released ones
2749 for (uint16_t srcCi = g_srsCiLow[m_srsCurrentPeriodicityId]; srcCi < g_srsCiHigh[m_srsCurrentPeriodicityId]; srcCi++)
2750 {
2751 std::set<uint16_t>::iterator it = m_ueSrsConfigurationIndexSet.find (srcCi);
2752 if (it == m_ueSrsConfigurationIndexSet.end ())
2753 {
2754 m_lastAllocatedConfigurationIndex = srcCi;
2755 m_ueSrsConfigurationIndexSet.insert (srcCi);
2756 break;
2757 }
2758 }
2759 }
2760 }
2761 return m_lastAllocatedConfigurationIndex;
2762
2763}
2764
2765
2766void
2767LteEnbRrc::RemoveSrsConfigurationIndex (uint16_t srcCi)
2768{
2769 NS_LOG_FUNCTION (this << srcCi)do { if (g_log.IsEnabled (ns3::LOG_FUNCTION)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; std::clog << g_log.Name () << ":" <<
__FUNCTION__ << "("; ns3::ParameterLogger (std::clog) <<
this << srcCi; std::clog << ")" << std::endl
; } } while (false)
;
2770 std::set<uint16_t>::iterator it = m_ueSrsConfigurationIndexSet.find (srcCi);
2771 NS_ASSERT_MSG (it != m_ueSrsConfigurationIndexSet.end (), "request to remove unkwown SRS CI " << srcCi)do { if (!(it != m_ueSrsConfigurationIndexSet.end ())) { std::
cerr << "assert failed. cond=\"" << "it != m_ueSrsConfigurationIndexSet.end ()"
<< "\", "; do { std::cerr << "msg=\"" << "request to remove unkwown SRS CI "
<< srcCi << "\", "; do { std::cerr << "file="
<< "../src/lte/model/lte-enb-rrc.cc" << ", line="
<< 2771 << std::endl; ::ns3::FatalImpl::FlushStreams
(); if (true) std::terminate (); } while (false); } while (false
); } } while (false)
;
2772 m_ueSrsConfigurationIndexSet.erase (it);
2773}
2774
2775uint8_t
2776LteEnbRrc::GetLogicalChannelGroup (EpsBearer bearer)
2777{
2778 if (bearer.IsGbr ())
2779 {
2780 return 1;
2781 }
2782 else
2783 {
2784 return 2;
2785 }
2786}
2787
2788uint8_t
2789LteEnbRrc::GetLogicalChannelPriority (EpsBearer bearer)
2790{
2791 return bearer.qci;
2792}
2793
2794void
2795LteEnbRrc::SendSystemInformation ()
2796{
2797 // NS_LOG_FUNCTION (this);
2798
2799 /*
2800 * For simplicity, we use the same periodicity for all SIBs. Note that in real
2801 * systems the periodicy of each SIBs could be different.
2802 */
2803 LteRrcSap::SystemInformation si;
2804 si.haveSib2 = true;
2805 si.sib2.freqInfo.ulCarrierFreq = m_ulEarfcn;
2806 si.sib2.freqInfo.ulBandwidth = m_ulBandwidth;
2807 si.sib2.radioResourceConfigCommon.pdschConfigCommon.referenceSignalPower = m_cphySapProvider.at (0)->GetReferenceSignalPower ();
2808 si.sib2.radioResourceConfigCommon.pdschConfigCommon.pb = 0;
2809
2810 LteEnbCmacSapProvider::RachConfig rc = m_cmacSapProvider.at (0)->GetRachConfig ();
2811 LteRrcSap::RachConfigCommon rachConfigCommon;
2812 rachConfigCommon.preambleInfo.numberOfRaPreambles = rc.numberOfRaPreambles;
2813 rachConfigCommon.raSupervisionInfo.preambleTransMax = rc.preambleTransMax;
2814 rachConfigCommon.raSupervisionInfo.raResponseWindowSize = rc.raResponseWindowSize;
2815 si.sib2.radioResourceConfigCommon.rachConfigCommon = rachConfigCommon;
2816
2817 m_rrcSapUser->SendSystemInformation (si);
2818 Simulator::Schedule (m_systemInformationPeriodicity, &LteEnbRrc::SendSystemInformation, this);
2819}
2820
2821
2822} // namespace ns3
2823