A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
lte-enb-rrc.cc
Go to the documentation of this file.
1/*
2 * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
3 * Copyright (c) 2018 Fraunhofer ESK : RLF extensions
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:
19 * Nicola Baldo <nbaldo@cttc.es>
20 * Marco Miozzo <mmiozzo@cttc.es>
21 * Manuel Requena <manuel.requena@cttc.es>
22 * Modified by:
23 * Danilo Abrignani <danilo.abrignani@unibo.it> (Carrier Aggregation - GSoC 2015),
24 * Biljana Bojovic <biljana.bojovic@cttc.es> (Carrier Aggregation)
25 * Vignesh Babu <ns3-dev@esk.fraunhofer.de> (RLF extensions)
26 */
27
28#include "lte-enb-rrc.h"
29
31#include "eps-bearer-tag.h"
32#include "lte-pdcp.h"
34#include "lte-rlc-am.h"
35#include "lte-rlc-tm.h"
36#include "lte-rlc-um.h"
37#include "lte-rlc.h"
38
39#include <ns3/abort.h>
40#include <ns3/fatal-error.h>
41#include <ns3/log.h>
42#include <ns3/object-factory.h>
43#include <ns3/object-map.h>
44#include <ns3/packet.h>
45#include <ns3/pointer.h>
46#include <ns3/simulator.h>
47
48namespace ns3
49{
50
51NS_LOG_COMPONENT_DEFINE("LteEnbRrc");
52
53///////////////////////////////////////////
54// CMAC SAP forwarder
55///////////////////////////////////////////
56
57/**
58 * \brief Class for forwarding CMAC SAP User functions.
59 */
61{
62 public:
63 /**
64 * Constructor
65 *
66 * \param rrc ENB RRC
67 * \param componentCarrierId
68 */
69 EnbRrcMemberLteEnbCmacSapUser(LteEnbRrc* rrc, uint8_t componentCarrierId);
70
71 uint16_t AllocateTemporaryCellRnti() override;
72 void NotifyLcConfigResult(uint16_t rnti, uint8_t lcid, bool success) override;
73 void RrcConfigurationUpdateInd(UeConfig params) override;
74 bool IsRandomAccessCompleted(uint16_t rnti) override;
75
76 private:
77 LteEnbRrc* m_rrc; ///< the RRC
78 uint8_t m_componentCarrierId; ///< Component carrier ID
79};
80
82 uint8_t componentCarrierId)
83 : m_rrc(rrc),
84 m_componentCarrierId{componentCarrierId}
85{
86}
87
88uint16_t
90{
92}
93
94void
95EnbRrcMemberLteEnbCmacSapUser::NotifyLcConfigResult(uint16_t rnti, uint8_t lcid, bool success)
96{
97 m_rrc->DoNotifyLcConfigResult(rnti, lcid, success);
98}
99
100void
102{
104}
105
106bool
108{
109 return m_rrc->IsRandomAccessCompleted(rnti);
110}
111
112///////////////////////////////////////////
113// UeManager
114///////////////////////////////////////////
115
116/// Map each of UE Manager states to its string representation.
117static const std::string g_ueManagerStateName[UeManager::NUM_STATES] = {
118 "INITIAL_RANDOM_ACCESS",
119 "CONNECTION_SETUP",
120 "CONNECTION_REJECTED",
121 "ATTACH_REQUEST",
122 "CONNECTED_NORMALLY",
123 "CONNECTION_RECONFIGURATION",
124 "CONNECTION_REESTABLISHMENT",
125 "HANDOVER_PREPARATION",
126 "HANDOVER_JOINING",
127 "HANDOVER_PATH_SWITCH",
128 "HANDOVER_LEAVING",
129};
130
131/**
132 * \param s The UE manager state.
133 * \return The string representation of the given state.
134 */
135static const std::string&
137{
138 return g_ueManagerStateName[s];
139}
140
142
144{
145 NS_FATAL_ERROR("this constructor is not expected to be used");
146}
147
148UeManager::UeManager(Ptr<LteEnbRrc> rrc, uint16_t rnti, State s, uint8_t componentCarrierId)
149 : m_lastAllocatedDrbid(0),
150 m_rnti(rnti),
151 m_imsi(0),
152 m_componentCarrierId(componentCarrierId),
153 m_lastRrcTransactionIdentifier(0),
154 m_rrc(rrc),
155 m_state(s),
156 m_pendingRrcConnectionReconfiguration(false),
157 m_sourceX2apId(0),
158 m_sourceCellId(0),
159 m_needPhyMacConfiguration(false),
160 m_caSupportConfigured(false),
161 m_pendingStartDataRadioBearers(false)
162{
163 NS_LOG_FUNCTION(this);
164}
165
166void
168{
169 NS_LOG_FUNCTION(this);
171
173 m_physicalConfigDedicated.antennaInfo.transmissionMode = m_rrc->m_defaultTransmissionMode;
176 m_rrc->GetNewSrsConfigurationIndex();
182
183 for (uint16_t i = 0; i < m_rrc->m_numberOfComponentCarriers; i++)
184 {
185 m_rrc->m_cmacSapProvider.at(i)->AddUe(m_rnti);
186 m_rrc->m_cphySapProvider.at(i)->AddUe(m_rnti);
187 }
188
189 // setup the eNB side of SRB0
190 {
191 uint8_t lcid = 0;
192
193 Ptr<LteRlc> rlc = CreateObject<LteRlcTm>()->GetObject<LteRlc>();
194 rlc->SetLteMacSapProvider(m_rrc->m_macSapProvider);
195 rlc->SetRnti(m_rnti);
196 rlc->SetLcId(lcid);
197
198 m_srb0 = CreateObject<LteSignalingRadioBearerInfo>();
199 m_srb0->m_rlc = rlc;
200 m_srb0->m_srbIdentity = 0;
201 // no need to store logicalChannelConfig as SRB0 is pre-configured
202
204 lcinfo.rnti = m_rnti;
205 lcinfo.lcId = lcid;
206 // Initialise the rest of lcinfo structure even if CCCH (LCID 0) is pre-configured, and only
207 // m_rnti and lcid will be used from passed lcinfo structure. See FF LTE MAC Scheduler
208 // Iinterface Specification v1.11, 4.3.4 logicalChannelConfigListElement
209 lcinfo.lcGroup = 0;
210 lcinfo.qci = 0;
211 lcinfo.resourceType = 0;
212 lcinfo.mbrUl = 0;
213 lcinfo.mbrDl = 0;
214 lcinfo.gbrUl = 0;
215 lcinfo.gbrDl = 0;
216
217 // MacSapUserForRlc in the ComponentCarrierManager MacSapUser
218 LteMacSapUser* lteMacSapUser =
219 m_rrc->m_ccmRrcSapProvider->ConfigureSignalBearer(lcinfo, rlc->GetLteMacSapUser());
220 // Signal Channel are only on Primary Carrier
221 m_rrc->m_cmacSapProvider.at(m_componentCarrierId)->AddLc(lcinfo, lteMacSapUser);
222 m_rrc->m_ccmRrcSapProvider->AddLc(lcinfo, lteMacSapUser);
223 }
224
225 // setup the eNB side of SRB1; the UE side will be set up upon RRC connection establishment
226 {
227 uint8_t lcid = 1;
228
229 Ptr<LteRlc> rlc = CreateObject<LteRlcAm>()->GetObject<LteRlc>();
230 rlc->SetLteMacSapProvider(m_rrc->m_macSapProvider);
231 rlc->SetRnti(m_rnti);
232 rlc->SetLcId(lcid);
233
234 Ptr<LtePdcp> pdcp = CreateObject<LtePdcp>();
235 pdcp->SetRnti(m_rnti);
236 pdcp->SetLcId(lcid);
237 pdcp->SetLtePdcpSapUser(m_drbPdcpSapUser);
238 pdcp->SetLteRlcSapProvider(rlc->GetLteRlcSapProvider());
239 rlc->SetLteRlcSapUser(pdcp->GetLteRlcSapUser());
240
241 m_srb1 = CreateObject<LteSignalingRadioBearerInfo>();
242 m_srb1->m_rlc = rlc;
243 m_srb1->m_pdcp = pdcp;
244 m_srb1->m_srbIdentity = 1;
245 m_srb1->m_logicalChannelConfig.priority = 1;
246 m_srb1->m_logicalChannelConfig.prioritizedBitRateKbps = 100;
247 m_srb1->m_logicalChannelConfig.bucketSizeDurationMs = 100;
248 m_srb1->m_logicalChannelConfig.logicalChannelGroup = 0;
249
251 lcinfo.rnti = m_rnti;
252 lcinfo.lcId = lcid;
253 lcinfo.lcGroup = 0; // all SRBs always mapped to LCG 0
254 lcinfo.qci =
255 EpsBearer::GBR_CONV_VOICE; // not sure why the FF API requires a CQI even for SRBs...
256 lcinfo.resourceType = 1; // GBR resource type
257 lcinfo.mbrUl = 1e6;
258 lcinfo.mbrDl = 1e6;
259 lcinfo.gbrUl = 1e4;
260 lcinfo.gbrDl = 1e4;
261 // MacSapUserForRlc in the ComponentCarrierManager MacSapUser
262 LteMacSapUser* MacSapUserForRlc =
263 m_rrc->m_ccmRrcSapProvider->ConfigureSignalBearer(lcinfo, rlc->GetLteMacSapUser());
264 // Signal Channel are only on Primary Carrier
265 m_rrc->m_cmacSapProvider.at(m_componentCarrierId)->AddLc(lcinfo, MacSapUserForRlc);
266 m_rrc->m_ccmRrcSapProvider->AddLc(lcinfo, MacSapUserForRlc);
267 }
268
270 ueParams.srb0SapProvider = m_srb0->m_rlc->GetLteRlcSapProvider();
271 ueParams.srb1SapProvider = m_srb1->m_pdcp->GetLtePdcpSapProvider();
272 m_rrc->m_rrcSapUser->SetupUe(m_rnti, ueParams);
273
274 // configure MAC (and scheduler)
276 req.m_rnti = m_rnti;
278
279 // configure PHY
280 for (uint16_t i = 0; i < m_rrc->m_numberOfComponentCarriers; i++)
281 {
282 m_rrc->m_cmacSapProvider.at(i)->UeUpdateConfigurationReq(req);
283 m_rrc->m_cphySapProvider.at(i)->SetTransmissionMode(
284 m_rnti,
286 m_rrc->m_cphySapProvider.at(i)->SetSrsConfigurationIndex(
287 m_rnti,
289 }
290 // schedule this UeManager instance to be deleted if the UE does not give any sign of life
291 // within a reasonable time
292 Time maxConnectionDelay;
293 switch (m_state)
294 {
296 m_connectionRequestTimeout = Simulator::Schedule(m_rrc->m_connectionRequestTimeoutDuration,
298 m_rrc,
299 m_rnti);
300 break;
301
302 case HANDOVER_JOINING:
303 m_handoverJoiningTimeout = Simulator::Schedule(m_rrc->m_handoverJoiningTimeoutDuration,
305 m_rrc,
306 m_rnti);
307 break;
308
309 default:
310 NS_FATAL_ERROR("unexpected state " << ToString(m_state));
311 break;
312 }
313 m_caSupportConfigured = false;
314}
315
317{
318}
319
320void
322{
323 delete m_drbPdcpSapUser;
324 // delete eventual X2-U TEIDs
325 for (auto it = m_drbMap.begin(); it != m_drbMap.end(); ++it)
326 {
327 m_rrc->m_x2uTeidInfoMap.erase(it->second->m_gtpTeid);
328 }
329}
330
331TypeId
333{
334 static TypeId tid =
335 TypeId("ns3::UeManager")
336 .SetParent<Object>()
337 .AddConstructor<UeManager>()
338 .AddAttribute("DataRadioBearerMap",
339 "List of UE DataRadioBearerInfo by DRBID.",
342 MakeObjectMapChecker<LteDataRadioBearerInfo>())
343 .AddAttribute("Srb0",
344 "SignalingRadioBearerInfo for SRB0",
345 PointerValue(),
347 MakePointerChecker<LteSignalingRadioBearerInfo>())
348 .AddAttribute("Srb1",
349 "SignalingRadioBearerInfo for SRB1",
350 PointerValue(),
352 MakePointerChecker<LteSignalingRadioBearerInfo>())
353 .AddAttribute("C-RNTI",
354 "Cell Radio Network Temporary Identifier",
355 TypeId::ATTR_GET, // read-only attribute
356 UintegerValue(0), // unused, read-only attribute
358 MakeUintegerChecker<uint16_t>())
359 .AddTraceSource("StateTransition",
360 "fired upon every UE state transition seen by the "
361 "UeManager at the eNB RRC",
363 "ns3::UeManager::StateTracedCallback")
364 .AddTraceSource("DrbCreated",
365 "trace fired after DRB is created",
367 "ns3::UeManager::ImsiCidRntiLcIdTracedCallback");
368 return tid;
369}
370
371void
372UeManager::SetSource(uint16_t sourceCellId, uint16_t sourceX2apId)
373{
374 m_sourceX2apId = sourceX2apId;
375 m_sourceCellId = sourceCellId;
376}
377
378void
379UeManager::SetImsi(uint64_t imsi)
380{
381 m_imsi = imsi;
382}
383
384void
386{
387 NS_LOG_FUNCTION(this << m_rnti);
388
389 if (m_state == ATTACH_REQUEST)
390 {
392 }
393 else
394 {
395 NS_FATAL_ERROR("method unexpected in state " << ToString(m_state));
396 }
397}
398
399void
401 uint8_t bearerId,
402 uint32_t gtpTeid,
403 Ipv4Address transportLayerAddress)
404{
406
407 Ptr<LteDataRadioBearerInfo> drbInfo = CreateObject<LteDataRadioBearerInfo>();
408 uint8_t drbid = AddDataRadioBearerInfo(drbInfo);
409 uint8_t lcid = Drbid2Lcid(drbid);
410 uint8_t bid = Drbid2Bid(drbid);
411 NS_ASSERT_MSG(bearerId == 0 || bid == bearerId,
412 "bearer ID mismatch (" << (uint32_t)bid << " != " << (uint32_t)bearerId
413 << ", the assumption that ID are allocated in the same "
414 "way by MME and RRC is not valid any more");
415 drbInfo->m_epsBearer = bearer;
416 drbInfo->m_epsBearerIdentity = bid;
417 drbInfo->m_drbIdentity = drbid;
418 drbInfo->m_logicalChannelIdentity = lcid;
419 drbInfo->m_gtpTeid = gtpTeid;
420 drbInfo->m_transportLayerAddress = transportLayerAddress;
421
423 {
424 // setup TEIDs for receiving data eventually forwarded over X2-U
425 LteEnbRrc::X2uTeidInfo x2uTeidInfo;
426 x2uTeidInfo.rnti = m_rnti;
427 x2uTeidInfo.drbid = drbid;
428 auto ret = m_rrc->m_x2uTeidInfoMap.insert(
429 std::pair<uint32_t, LteEnbRrc::X2uTeidInfo>(gtpTeid, x2uTeidInfo));
430 NS_ASSERT_MSG(ret.second == true, "overwriting a pre-existing entry in m_x2uTeidInfoMap");
431 }
432
433 TypeId rlcTypeId = m_rrc->GetRlcType(bearer);
434
435 ObjectFactory rlcObjectFactory;
436 rlcObjectFactory.SetTypeId(rlcTypeId);
437 Ptr<LteRlc> rlc = rlcObjectFactory.Create()->GetObject<LteRlc>();
438 rlc->SetLteMacSapProvider(m_rrc->m_macSapProvider);
439 rlc->SetRnti(m_rnti);
440 rlc->SetPacketDelayBudgetMs(bearer.GetPacketDelayBudgetMs());
441
442 drbInfo->m_rlc = rlc;
443
444 rlc->SetLcId(lcid);
445
446 // we need PDCP only for real RLC, i.e., RLC/UM or RLC/AM
447 // if we are using RLC/SM we don't care of anything above RLC
448 if (rlcTypeId != LteRlcSm::GetTypeId())
449 {
450 Ptr<LtePdcp> pdcp = CreateObject<LtePdcp>();
451 pdcp->SetRnti(m_rnti);
452 pdcp->SetLcId(lcid);
453 pdcp->SetLtePdcpSapUser(m_drbPdcpSapUser);
454 pdcp->SetLteRlcSapProvider(rlc->GetLteRlcSapProvider());
455 rlc->SetLteRlcSapUser(pdcp->GetLteRlcSapUser());
456 drbInfo->m_pdcp = pdcp;
457 }
458
459 m_drbCreatedTrace(m_imsi, m_rrc->ComponentCarrierToCellId(m_componentCarrierId), m_rnti, lcid);
460
461 std::vector<LteCcmRrcSapProvider::LcsConfig> lcOnCcMapping =
462 m_rrc->m_ccmRrcSapProvider->SetupDataRadioBearer(bearer,
463 bearerId,
464 m_rnti,
465 lcid,
466 m_rrc->GetLogicalChannelGroup(bearer),
467 rlc->GetLteMacSapUser());
468 // LteEnbCmacSapProvider::LcInfo lcinfo;
469 // lcinfo.rnti = m_rnti;
470 // lcinfo.lcId = lcid;
471 // lcinfo.lcGroup = m_rrc->GetLogicalChannelGroup (bearer);
472 // lcinfo.qci = bearer.qci;
473 // lcinfo.resourceType = bearer.GetResourceType();
474 // lcinfo.mbrUl = bearer.gbrQosInfo.mbrUl;
475 // lcinfo.mbrDl = bearer.gbrQosInfo.mbrDl;
476 // lcinfo.gbrUl = bearer.gbrQosInfo.gbrUl;
477 // lcinfo.gbrDl = bearer.gbrQosInfo.gbrDl;
478 // use a for cycle to send the AddLc to the appropriate Mac Sap
479 // if the sap is not initialized the appropriated method has to be called
480 auto itLcOnCcMapping = lcOnCcMapping.begin();
481 NS_ASSERT_MSG(itLcOnCcMapping != lcOnCcMapping.end(), "Problem");
482 for (itLcOnCcMapping = lcOnCcMapping.begin(); itLcOnCcMapping != lcOnCcMapping.end();
483 ++itLcOnCcMapping)
484 {
485 NS_LOG_DEBUG(this << " RNTI " << itLcOnCcMapping->lc.rnti << "Lcid "
486 << (uint16_t)itLcOnCcMapping->lc.lcId << " lcGroup "
487 << (uint16_t)itLcOnCcMapping->lc.lcGroup << " ComponentCarrierId "
488 << itLcOnCcMapping->componentCarrierId);
489 uint8_t index = itLcOnCcMapping->componentCarrierId;
490 LteEnbCmacSapProvider::LcInfo lcinfo = itLcOnCcMapping->lc;
491 LteMacSapUser* msu = itLcOnCcMapping->msu;
492 m_rrc->m_cmacSapProvider.at(index)->AddLc(lcinfo, msu);
493 m_rrc->m_ccmRrcSapProvider->AddLc(lcinfo, msu);
494 }
495
496 if (rlcTypeId == LteRlcAm::GetTypeId())
497 {
498 drbInfo->m_rlcConfig.choice = LteRrcSap::RlcConfig::AM;
499 }
500 else
501 {
502 drbInfo->m_rlcConfig.choice = LteRrcSap::RlcConfig::UM_BI_DIRECTIONAL;
503 }
504
505 drbInfo->m_logicalChannelIdentity = lcid;
506 drbInfo->m_logicalChannelConfig.priority = m_rrc->GetLogicalChannelPriority(bearer);
507 drbInfo->m_logicalChannelConfig.logicalChannelGroup = m_rrc->GetLogicalChannelGroup(bearer);
508 if (bearer.GetResourceType() > 0) // 1, 2 for GBR and DC-GBR
509 {
510 drbInfo->m_logicalChannelConfig.prioritizedBitRateKbps = bearer.gbrQosInfo.gbrUl;
511 }
512 else
513 {
514 drbInfo->m_logicalChannelConfig.prioritizedBitRateKbps = 0;
515 }
516 drbInfo->m_logicalChannelConfig.bucketSizeDurationMs = 1000;
517
519}
520
521void
523{
525 for (auto it = m_drbMap.begin(); it != m_drbMap.end(); ++it)
526 {
527 m_drbsToBeStarted.push_back(it->first);
528 }
529}
530
531void
533{
535 for (auto drbIdIt = m_drbsToBeStarted.begin(); drbIdIt != m_drbsToBeStarted.end(); ++drbIdIt)
536 {
537 auto drbIt = m_drbMap.find(*drbIdIt);
538 NS_ASSERT(drbIt != m_drbMap.end());
539 drbIt->second->m_rlc->Initialize();
540 if (drbIt->second->m_pdcp)
541 {
542 drbIt->second->m_pdcp->Initialize();
543 }
544 }
545 m_drbsToBeStarted.clear();
546}
547
548void
550{
551 NS_LOG_FUNCTION(this << (uint32_t)m_rnti << (uint32_t)drbid);
552 uint8_t lcid = Drbid2Lcid(drbid);
553 auto it = m_drbMap.find(drbid);
554 NS_ASSERT_MSG(it != m_drbMap.end(),
555 "request to remove radio bearer with unknown drbid " << drbid);
556
557 // first delete eventual X2-U TEIDs
558 m_rrc->m_x2uTeidInfoMap.erase(it->second->m_gtpTeid);
559
560 m_drbMap.erase(it);
561 std::vector<uint8_t> ccToRelease =
562 m_rrc->m_ccmRrcSapProvider->ReleaseDataRadioBearer(m_rnti, lcid);
563 auto itCcToRelease = ccToRelease.begin();
564 NS_ASSERT_MSG(itCcToRelease != ccToRelease.end(),
565 "request to remove radio bearer with unknown drbid (ComponentCarrierManager)");
566 for (itCcToRelease = ccToRelease.begin(); itCcToRelease != ccToRelease.end(); ++itCcToRelease)
567 {
568 m_rrc->m_cmacSapProvider.at(*itCcToRelease)->ReleaseLc(m_rnti, lcid);
569 }
571 rrcd.havePhysicalConfigDedicated = false;
572 rrcd.drbToReleaseList.push_back(drbid);
573 // populating RadioResourceConfigDedicated information element as per 3GPP TS 36.331
574 // version 9.2.0
575 rrcd.havePhysicalConfigDedicated = true;
577
578 // populating RRCConnectionReconfiguration message as per 3GPP TS 36.331 version 9.2.0 Release 9
580 msg.haveMeasConfig = false;
581 msg.haveMobilityControlInfo = false;
582 msg.radioResourceConfigDedicated = rrcd;
583 msg.haveRadioResourceConfigDedicated = true;
584 // ToDo: Resend in any case this configuration
585 // needs to be initialized
586 msg.haveNonCriticalExtension = false;
587 // RRC Connection Reconfiguration towards UE
588 m_rrc->m_rrcSapUser->SendRrcConnectionReconfiguration(m_rnti, msg);
589}
590
591void
592LteEnbRrc::DoSendReleaseDataRadioBearer(uint64_t imsi, uint16_t rnti, uint8_t bearerId)
593{
594 NS_LOG_FUNCTION(this << imsi << rnti << (uint16_t)bearerId);
595
596 // check if the RNTI to be removed is not stale
597 if (HasUeManager(rnti))
598 {
599 Ptr<UeManager> ueManager = GetUeManager(rnti);
600 // Bearer de-activation towards UE
601 ueManager->ReleaseDataRadioBearer(bearerId);
602 // Bearer de-activation indication towards epc-enb application
603 m_s1SapProvider->DoSendReleaseIndication(imsi, rnti, bearerId);
604 }
605}
606
607void
609{
610 NS_LOG_FUNCTION(this << m_rnti);
611
612 // release the bearer info for the UE at SGW/PGW
613 if (m_rrc->m_s1SapProvider != nullptr) // if EPC is enabled
614 {
615 for (const auto& it : m_drbMap)
616 {
617 NS_LOG_DEBUG("Sending release of bearer id : "
618 << (uint16_t)(it.first)
619 << "LCID : " << (uint16_t)(it.second->m_logicalChannelIdentity));
620 // Bearer de-activation indication towards epc-enb application
621 m_rrc->m_s1SapProvider->DoSendReleaseIndication(GetImsi(), rnti, it.first);
622 }
623 }
624}
625
626void
628{
629 NS_LOG_FUNCTION(this);
630 switch (m_state)
631 {
633 case CONNECTION_SETUP:
634 case ATTACH_REQUEST:
638 case HANDOVER_JOINING:
639 case HANDOVER_LEAVING:
640 // a previous reconfiguration still ongoing, we need to wait for it to be finished
642 break;
643
644 case CONNECTED_NORMALLY: {
647 m_rrc->m_rrcSapUser->SendRrcConnectionReconfiguration(m_rnti, msg);
650 }
651 break;
652
653 default:
654 NS_FATAL_ERROR("method unexpected in state " << ToString(m_state));
655 break;
656 }
657}
658
659void
661{
662 NS_LOG_FUNCTION(this << cellId);
663 switch (m_state)
664 {
665 case CONNECTED_NORMALLY: {
666 m_targetCellId = cellId;
667
668 auto sourceComponentCarrier = DynamicCast<ComponentCarrierEnb>(
669 m_rrc->m_componentCarrierPhyConf.at(m_componentCarrierId));
670 NS_ASSERT(m_targetCellId != sourceComponentCarrier->GetCellId());
671
672 if (m_rrc->HasCellId(cellId))
673 {
674 // Intra-eNB handover
675 NS_LOG_DEBUG("Intra-eNB handover for cellId " << cellId);
676 uint8_t componentCarrierId = m_rrc->CellToComponentCarrierId(cellId);
677 uint16_t rnti = m_rrc->AddUe(UeManager::HANDOVER_JOINING, componentCarrierId);
679 m_rrc->m_cmacSapProvider.at(componentCarrierId)->AllocateNcRaPreamble(rnti);
680 if (!anrcrv.valid)
681 {
682 NS_LOG_INFO(this << " failed to allocate a preamble for non-contention based RA => "
683 "cannot perform HO");
684 NS_FATAL_ERROR("should trigger HO Preparation Failure, but it is not implemented");
685 return;
686 }
687
688 Ptr<UeManager> ueManager = m_rrc->GetUeManager(rnti);
689 ueManager->SetSource(sourceComponentCarrier->GetCellId(), m_rnti);
690 ueManager->SetImsi(m_imsi);
691
692 // Setup data radio bearers
693 for (auto& it : m_drbMap)
694 {
695 ueManager->SetupDataRadioBearer(it.second->m_epsBearer,
696 it.second->m_epsBearerIdentity,
697 it.second->m_gtpTeid,
698 it.second->m_transportLayerAddress);
699 }
700
703
704 handoverCommand.mobilityControlInfo.newUeIdentity = rnti;
705 handoverCommand.mobilityControlInfo.haveRachConfigDedicated = true;
707 anrcrv.raPreambleId;
709 anrcrv.raPrachMaskIndex;
710
712 m_rrc->m_cmacSapProvider.at(componentCarrierId)->GetRachConfig();
714 .preambleInfo.numberOfRaPreambles = rc.numberOfRaPreambles;
716 .raSupervisionInfo.preambleTransMax = rc.preambleTransMax;
718 .raSupervisionInfo.raResponseWindowSize = rc.raResponseWindowSize;
719
720 m_rrc->m_rrcSapUser->SendRrcConnectionReconfiguration(m_rnti, handoverCommand);
721
722 // We skip handover preparation
724 m_handoverLeavingTimeout = Simulator::Schedule(m_rrc->m_handoverLeavingTimeoutDuration,
726 m_rrc,
727 m_rnti);
728 m_rrc->m_handoverStartTrace(m_imsi,
729 sourceComponentCarrier->GetCellId(),
730 m_rnti,
731 handoverCommand.mobilityControlInfo.targetPhysCellId);
732 }
733 else
734 {
735 // Inter-eNB aka X2 handover
736 NS_LOG_DEBUG("Inter-eNB handover (i.e., X2) for cellId " << cellId);
738 params.oldEnbUeX2apId = m_rnti;
740 params.sourceCellId = m_rrc->ComponentCarrierToCellId(m_componentCarrierId);
741 params.targetCellId = cellId;
742 params.mmeUeS1apId = m_imsi;
743 params.ueAggregateMaxBitRateDownlink = 200 * 1000;
744 params.ueAggregateMaxBitRateUplink = 100 * 1000;
745 params.bearers = GetErabList();
746
749 hpi.asConfig.sourceDlCarrierFreq = sourceComponentCarrier->GetDlEarfcn();
750 hpi.asConfig.sourceMeasConfig = m_rrc->m_ueMeasConfig;
754 sourceComponentCarrier->GetDlBandwidth();
758 .cellAccessRelatedInfo.plmnIdentityInfo.plmnIdentity;
760 m_rrc->ComponentCarrierToCellId(m_componentCarrierId);
762 m_rrc->m_sib1.at(m_componentCarrierId).cellAccessRelatedInfo.csgIndication;
764 m_rrc->m_sib1.at(m_componentCarrierId).cellAccessRelatedInfo.csgIdentity;
766 m_rrc->m_cmacSapProvider.at(m_componentCarrierId)->GetRachConfig();
768 .rachConfigCommon.preambleInfo.numberOfRaPreambles = rc.numberOfRaPreambles;
774 .rachConfigCommon.txFailParam.connEstFailCount = rc.connEstFailCount;
776 sourceComponentCarrier->GetUlEarfcn();
778 sourceComponentCarrier->GetUlBandwidth();
779 params.rrcContext = m_rrc->m_rrcSapUser->EncodeHandoverPreparationInformation(hpi);
780
781 NS_LOG_LOGIC("oldEnbUeX2apId = " << params.oldEnbUeX2apId);
782 NS_LOG_LOGIC("sourceCellId = " << params.sourceCellId);
783 NS_LOG_LOGIC("targetCellId = " << params.targetCellId);
784 NS_LOG_LOGIC("mmeUeS1apId = " << params.mmeUeS1apId);
785 NS_LOG_LOGIC("rrcContext = " << params.rrcContext);
786
787 m_rrc->m_x2SapProvider->SendHandoverRequest(params);
789 }
790 }
791 break;
792
793 default:
794 NS_FATAL_ERROR("method unexpected in state " << ToString(m_state));
795 break;
796 }
797}
798
799void
801{
802 NS_LOG_FUNCTION(this);
803
804 NS_ASSERT_MSG(params.notAdmittedBearers.empty(),
805 "not admission of some bearers upon handover is not supported");
806 NS_ASSERT_MSG(params.admittedBearers.size() == m_drbMap.size(),
807 "not enough bearers in admittedBearers");
808
809 // note: the Handover command from the target eNB to the source eNB
810 // is expected to be sent transparently to the UE; however, here we
811 // decode the message and eventually re-encode it. This way we can
812 // support both a real RRC protocol implementation and an ideal one
813 // without actual RRC protocol encoding.
814
815 Ptr<Packet> encodedHandoverCommand = params.rrcContext;
817 m_rrc->m_rrcSapUser->DecodeHandoverCommand(encodedHandoverCommand);
818 if (handoverCommand.haveNonCriticalExtension)
819 {
820 // Total number of component carriers =
821 // handoverCommand.nonCriticalExtension.sCellToAddModList.size() + 1 (Primary carrier)
822 if (handoverCommand.nonCriticalExtension.sCellToAddModList.size() + 1 !=
823 m_rrc->m_numberOfComponentCarriers)
824 {
825 // Currently handover is only possible if source and target eNBs have equal number of
826 // component carriers
827 NS_FATAL_ERROR("The source and target eNBs have unequal number of component carriers. "
828 "Target eNB CCs = "
829 << handoverCommand.nonCriticalExtension.sCellToAddModList.size() + 1
830 << " Source eNB CCs = " << m_rrc->m_numberOfComponentCarriers);
831 }
832 }
833 m_rrc->m_rrcSapUser->SendRrcConnectionReconfiguration(m_rnti, handoverCommand);
835 m_handoverLeavingTimeout = Simulator::Schedule(m_rrc->m_handoverLeavingTimeoutDuration,
837 m_rrc,
838 m_rnti);
839 NS_ASSERT(handoverCommand.haveMobilityControlInfo);
840 m_rrc->m_handoverStartTrace(m_imsi,
841 m_rrc->ComponentCarrierToCellId(m_componentCarrierId),
842 m_rnti,
843 handoverCommand.mobilityControlInfo.targetPhysCellId);
844
845 // Set the target cell ID and the RNTI so that handover cancel message can be sent if required
846 m_targetX2apId = params.newEnbUeX2apId;
847 m_targetCellId = params.targetCellId;
848
850 sst.oldEnbUeX2apId = params.oldEnbUeX2apId;
851 sst.newEnbUeX2apId = params.newEnbUeX2apId;
852 sst.sourceCellId = params.sourceCellId;
853 sst.targetCellId = params.targetCellId;
854 for (auto drbIt = m_drbMap.begin(); drbIt != m_drbMap.end(); ++drbIt)
855 {
856 // SN status transfer is only for AM RLC
857 if (drbIt->second->m_rlc->GetObject<LteRlcAm>())
858 {
859 LtePdcp::Status status = drbIt->second->m_pdcp->GetStatus();
861 i.dlPdcpSn = status.txSn;
862 i.ulPdcpSn = status.rxSn;
863 sst.erabsSubjectToStatusTransferList.push_back(i);
864 }
865 }
866 m_rrc->m_x2SapProvider->SendSnStatusTransfer(sst);
867}
868
871{
872 NS_LOG_FUNCTION(this);
874}
875
878{
879 NS_LOG_FUNCTION(this);
880
882
883 auto targetComponentCarrier =
884 DynamicCast<ComponentCarrierEnb>(m_rrc->m_componentCarrierPhyConf.at(componentCarrierId));
885 result.haveMobilityControlInfo = true;
886 result.mobilityControlInfo.targetPhysCellId = targetComponentCarrier->GetCellId();
888 result.mobilityControlInfo.carrierFreq.dlCarrierFreq = targetComponentCarrier->GetDlEarfcn();
889 result.mobilityControlInfo.carrierFreq.ulCarrierFreq = targetComponentCarrier->GetUlEarfcn();
892 targetComponentCarrier->GetDlBandwidth();
894 targetComponentCarrier->GetUlBandwidth();
895
896 if (m_caSupportConfigured && m_rrc->m_numberOfComponentCarriers > 1)
897 {
898 // Release sCells
899 result.haveNonCriticalExtension = true;
900
901 for (auto& it : m_rrc->m_componentCarrierPhyConf)
902 {
903 uint8_t ccId = it.first;
904
905 if (ccId == m_componentCarrierId)
906 {
907 // Skip primary CC.
908 continue;
909 }
910 else if (ccId < m_componentCarrierId)
911 {
912 // Shift all IDs below PCC forward so PCC can use CC ID 1.
913 result.nonCriticalExtension.sCellToReleaseList.push_back(ccId + 1);
914 }
915 }
916 }
917 else
918 {
919 result.haveNonCriticalExtension = false;
920 }
921
922 return result;
923}
924
925void
927{
928 NS_LOG_FUNCTION(this << p << (uint16_t)bid);
930 params.pdcpSdu = p;
931 params.rnti = m_rnti;
932 params.lcid = Bid2Lcid(bid);
933 uint8_t drbid = Bid2Drbid(bid);
934 // Transmit PDCP sdu only if DRB ID found in drbMap
935 auto it = m_drbMap.find(drbid);
936 if (it != m_drbMap.end())
937 {
939 if (bearerInfo)
940 {
941 NS_LOG_INFO("Send packet to PDCP layer");
942 LtePdcpSapProvider* pdcpSapProvider = bearerInfo->m_pdcp->GetLtePdcpSapProvider();
943 pdcpSapProvider->TransmitPdcpSdu(params);
944 }
945 }
946}
947
948void
950{
951 NS_LOG_FUNCTION(this << p << (uint16_t)bid);
952 switch (m_state)
953 {
955 case CONNECTION_SETUP:
956 NS_LOG_WARN("not connected, discarding packet");
957 return;
958
964 NS_LOG_INFO("queueing data on PDCP for transmission over the air");
965 SendPacket(bid, p);
966 }
967 break;
968
969 case HANDOVER_JOINING: {
970 // Buffer data until RRC Connection Reconfiguration Complete message is received
971 NS_LOG_INFO("buffering data");
972 m_packetBuffer.emplace_back(bid, p);
973 }
974 break;
975
976 case HANDOVER_LEAVING: {
977 NS_LOG_INFO("forwarding data to target eNB over X2-U");
978 uint8_t drbid = Bid2Drbid(bid);
980 params.sourceCellId = m_rrc->ComponentCarrierToCellId(m_componentCarrierId);
981 params.targetCellId = m_targetCellId;
982 params.gtpTeid = GetDataRadioBearerInfo(drbid)->m_gtpTeid;
983 params.ueData = p;
984 m_rrc->m_x2SapProvider->SendUeData(params);
985 }
986 break;
987
988 default:
989 NS_FATAL_ERROR("method unexpected in state " << ToString(m_state));
990 break;
991 }
992}
993
994std::vector<EpcX2Sap::ErabToBeSetupItem>
996{
997 NS_LOG_FUNCTION(this);
998 std::vector<EpcX2Sap::ErabToBeSetupItem> ret;
999 for (auto it = m_drbMap.begin(); it != m_drbMap.end(); ++it)
1000 {
1002 etbsi.erabId = it->second->m_epsBearerIdentity;
1003 etbsi.erabLevelQosParameters = it->second->m_epsBearer;
1004 etbsi.dlForwarding = false;
1005 etbsi.transportLayerAddress = it->second->m_transportLayerAddress;
1006 etbsi.gtpTeid = it->second->m_gtpTeid;
1007 ret.push_back(etbsi);
1008 }
1009 return ret;
1010}
1011
1012void
1014{
1015 NS_LOG_FUNCTION(this);
1016 switch (m_state)
1017 {
1019 NS_LOG_INFO("Send UE CONTEXT RELEASE from target eNB to source eNB");
1021 ueCtxReleaseParams.oldEnbUeX2apId = m_sourceX2apId;
1022 ueCtxReleaseParams.newEnbUeX2apId = m_rnti;
1023 ueCtxReleaseParams.sourceCellId = m_sourceCellId;
1024 ueCtxReleaseParams.targetCellId = m_targetCellId;
1025 if (!m_rrc->HasCellId(m_sourceCellId))
1026 {
1027 m_rrc->m_x2SapProvider->SendUeContextRelease(ueCtxReleaseParams);
1028 }
1029 else
1030 {
1031 NS_LOG_INFO("Not sending UE CONTEXT RELEASE because handover is internal");
1032 m_rrc->DoRecvUeContextRelease(ueCtxReleaseParams);
1033 }
1035 m_rrc->m_handoverEndOkTrace(m_imsi,
1036 m_rrc->ComponentCarrierToCellId(m_componentCarrierId),
1037 m_rnti);
1038 break;
1039
1040 default:
1041 NS_FATAL_ERROR("method unexpected in state " << ToString(m_state));
1042 break;
1043 }
1044}
1045
1046void
1048{
1049 NS_LOG_FUNCTION(this << cellId);
1050 switch (m_state)
1051 {
1053 NS_ASSERT(cellId == m_targetCellId);
1054 NS_LOG_INFO("target eNB sent HO preparation failure, aborting HO");
1056 break;
1057 case HANDOVER_LEAVING: // case added to tackle HO leaving timer expiration
1058 NS_ASSERT(cellId == m_targetCellId);
1059 NS_LOG_INFO("target eNB sent HO preparation failure, aborting HO");
1062 break;
1063
1064 default:
1065 NS_FATAL_ERROR("method unexpected in state " << ToString(m_state));
1066 break;
1067 }
1068}
1069
1070void
1072{
1073 NS_LOG_FUNCTION(this);
1074 for (auto erabIt = params.erabsSubjectToStatusTransferList.begin();
1075 erabIt != params.erabsSubjectToStatusTransferList.end();
1076 ++erabIt)
1077 {
1078 // LtePdcp::Status status;
1079 // status.txSn = erabIt->dlPdcpSn;
1080 // status.rxSn = erabIt->ulPdcpSn;
1081 // uint8_t drbId = Bid2Drbid (erabIt->erabId);
1082 // auto drbIt = m_drbMap.find (drbId);
1083 // NS_ASSERT_MSG (drbIt != m_drbMap.end (), "could not find DRBID " << (uint32_t) drbId);
1084 // drbIt->second->m_pdcp->SetStatus (status);
1085 }
1086}
1087
1088void
1090{
1091 NS_LOG_FUNCTION(this);
1092 NS_ASSERT_MSG(m_state == HANDOVER_LEAVING, "method unexpected in state " << ToString(m_state));
1094}
1095
1096void
1098{
1099 NS_LOG_FUNCTION(this);
1100 NS_ASSERT_MSG(m_state == HANDOVER_JOINING, "method unexpected in state " << ToString(m_state));
1102}
1103
1104void
1106{
1107 // TODO implement in the 3gpp way, see Section 5.3.8 of 3GPP TS 36.331.
1109 // De-activation towards UE, it will deactivate all bearers
1112 m_rrc->m_rrcSapUser->SendRrcConnectionRelease(m_rnti, msg);
1113
1114 /**
1115 * Bearer de-activation indication towards epc-enb application
1116 * and removal of UE context at the eNodeB
1117 *
1118 */
1119 m_rrc->DoRecvIdealUeContextRemoveRequest(m_rnti);
1120}
1121
1122// methods forwarded from RRC SAP
1123
1124void
1126{
1127 NS_LOG_FUNCTION(this);
1128 m_srb0->m_rlc->SetLteRlcSapUser(params.srb0SapUser);
1129 m_srb1->m_pdcp->SetLtePdcpSapUser(params.srb1SapUser);
1130}
1131
1132void
1134{
1135 NS_LOG_FUNCTION(this);
1136 switch (m_state)
1137 {
1138 case INITIAL_RANDOM_ACCESS: {
1140
1141 if (m_rrc->m_admitRrcConnectionRequest)
1142 {
1143 m_imsi = msg.ueIdentity;
1144
1145 // send RRC CONNECTION SETUP to UE
1149 m_rrc->m_rrcSapUser->SendRrcConnectionSetup(m_rnti, msg2);
1150
1152 m_connectionSetupTimeout = Simulator::Schedule(m_rrc->m_connectionSetupTimeoutDuration,
1154 m_rrc,
1155 m_rnti);
1157 }
1158 else
1159 {
1160 NS_LOG_INFO("rejecting connection request for RNTI " << m_rnti);
1161
1162 // send RRC CONNECTION REJECT to UE
1164 rejectMsg.waitTime = 3;
1165 m_rrc->m_rrcSapUser->SendRrcConnectionReject(m_rnti, rejectMsg);
1166
1168 Simulator::Schedule(m_rrc->m_connectionRejectedTimeoutDuration,
1170 m_rrc,
1171 m_rnti);
1173 }
1174 }
1175 break;
1176
1177 default:
1178 NS_FATAL_ERROR("method unexpected in state " << ToString(m_state));
1179 break;
1180 }
1181}
1182
1183void
1185{
1186 NS_LOG_FUNCTION(this);
1187 switch (m_state)
1188 {
1189 case CONNECTION_SETUP:
1191 if (!m_caSupportConfigured && m_rrc->m_numberOfComponentCarriers > 1)
1192 {
1193 m_pendingRrcConnectionReconfiguration = true; // Force Reconfiguration
1195 }
1196
1197 if (m_rrc->m_s1SapProvider != nullptr)
1198 {
1199 m_rrc->m_s1SapProvider->InitialUeMessage(m_imsi, m_rnti);
1201 }
1202 else
1203 {
1205 }
1206 m_rrc->m_connectionEstablishedTrace(m_imsi,
1207 m_rrc->ComponentCarrierToCellId(m_componentCarrierId),
1208 m_rnti);
1209 break;
1210
1211 default:
1212 NS_FATAL_ERROR("method unexpected in state " << ToString(m_state));
1213 break;
1214 }
1215}
1216
1217void
1220{
1221 NS_LOG_FUNCTION(this);
1222 switch (m_state)
1223 {
1227 {
1228 // configure MAC (and scheduler)
1230 req.m_rnti = m_rnti;
1232 for (uint16_t i = 0; i < m_rrc->m_numberOfComponentCarriers; i++)
1233 {
1234 m_rrc->m_cmacSapProvider.at(i)->UeUpdateConfigurationReq(req);
1235
1236 // configure PHY
1237 m_rrc->m_cphySapProvider.at(i)->SetTransmissionMode(req.m_rnti,
1238 req.m_transmissionMode);
1241 m_rrc->m_cphySapProvider.at(i)->SetPa(m_rnti, paDouble);
1242 }
1243
1245 }
1247 m_rrc->m_connectionReconfigurationTrace(
1248 m_imsi,
1249 m_rrc->ComponentCarrierToCellId(m_componentCarrierId),
1250 m_rnti);
1251 break;
1252
1253 // This case is added to NS-3 in order to handle bearer de-activation scenario for CONNECTED
1254 // state UE
1255 case CONNECTED_NORMALLY:
1256 NS_LOG_INFO("ignoring RecvRrcConnectionReconfigurationCompleted in state "
1257 << ToString(m_state));
1258 break;
1259
1260 case HANDOVER_LEAVING:
1261 NS_LOG_INFO("ignoring RecvRrcConnectionReconfigurationCompleted in state "
1262 << ToString(m_state));
1263 break;
1264
1265 case HANDOVER_JOINING: {
1267
1268 while (!m_packetBuffer.empty())
1269 {
1270 NS_LOG_LOGIC("dequeueing data from buffer");
1271 std::pair<uint8_t, Ptr<Packet>> bidPacket = m_packetBuffer.front();
1272 uint8_t bid = bidPacket.first;
1273 Ptr<Packet> p = bidPacket.second;
1274
1275 NS_LOG_LOGIC("queueing data on PDCP for transmission over the air");
1276 SendPacket(bid, p);
1277
1278 m_packetBuffer.pop_front();
1279 }
1280
1281 NS_LOG_INFO("Send PATH SWITCH REQUEST to the MME");
1283 params.rnti = m_rnti;
1284 params.cellId = m_rrc->ComponentCarrierToCellId(m_componentCarrierId);
1285 params.mmeUeS1Id = m_imsi;
1287 for (auto it = m_drbMap.begin(); it != m_drbMap.end(); ++it)
1288 {
1290 b.epsBearerId = it->second->m_epsBearerIdentity;
1291 b.teid = it->second->m_gtpTeid;
1292 params.bearersToBeSwitched.push_back(b);
1293 }
1294 m_rrc->m_s1SapProvider->PathSwitchRequest(params);
1295 }
1296 break;
1297
1298 default:
1299 NS_FATAL_ERROR("method unexpected in state " << ToString(m_state));
1300 break;
1301 }
1302}
1303
1304void
1307{
1308 NS_LOG_FUNCTION(this);
1309 switch (m_state)
1310 {
1311 case CONNECTED_NORMALLY:
1312 break;
1313
1314 case HANDOVER_LEAVING:
1316 break;
1317
1318 default:
1319 NS_FATAL_ERROR("method unexpected in state " << ToString(m_state));
1320 break;
1321 }
1322
1326 m_rrc->m_rrcSapUser->SendRrcConnectionReestablishment(m_rnti, msg2);
1328}
1329
1330void
1333{
1334 NS_LOG_FUNCTION(this);
1336}
1337
1338void
1340{
1341 uint8_t measId = msg.measResults.measId;
1342 NS_LOG_FUNCTION(this << (uint16_t)measId);
1344 "measId " << (uint16_t)measId << " haveMeasResultNeighCells "
1345 << msg.measResults.haveMeasResultNeighCells << " measResultListEutra "
1346 << msg.measResults.measResultListEutra.size() << " haveMeasResultServFreqList "
1347 << msg.measResults.haveMeasResultServFreqList << " measResultServFreqList "
1348 << msg.measResults.measResultServFreqList.size());
1349 NS_LOG_LOGIC("serving cellId "
1350 << m_rrc->ComponentCarrierToCellId(m_componentCarrierId) << " RSRP "
1351 << (uint16_t)msg.measResults.measResultPCell.rsrpResult << " RSRQ "
1352 << (uint16_t)msg.measResults.measResultPCell.rsrqResult);
1353
1354 for (auto it = msg.measResults.measResultListEutra.begin();
1355 it != msg.measResults.measResultListEutra.end();
1356 ++it)
1357 {
1358 NS_LOG_LOGIC("neighbour cellId " << it->physCellId << " RSRP "
1359 << (it->haveRsrpResult ? (uint16_t)it->rsrpResult : 255)
1360 << " RSRQ "
1361 << (it->haveRsrqResult ? (uint16_t)it->rsrqResult : 255));
1362 }
1363
1364 if ((m_rrc->m_handoverManagementSapProvider != nullptr) &&
1365 (m_rrc->m_handoverMeasIds.find(measId) != m_rrc->m_handoverMeasIds.end()))
1366 {
1367 // this measurement was requested by the handover algorithm
1368 m_rrc->m_handoverManagementSapProvider->ReportUeMeas(m_rnti, msg.measResults);
1369 }
1370
1371 if ((m_rrc->m_ccmRrcSapProvider != nullptr) &&
1372 (m_rrc->m_componentCarrierMeasIds.find(measId) != m_rrc->m_componentCarrierMeasIds.end()))
1373 {
1374 // this measurement was requested by the handover algorithm
1375 m_rrc->m_ccmRrcSapProvider->ReportUeMeas(m_rnti, msg.measResults);
1376 }
1377
1378 if ((m_rrc->m_anrSapProvider != nullptr) &&
1379 (m_rrc->m_anrMeasIds.find(measId) != m_rrc->m_anrMeasIds.end()))
1380 {
1381 // this measurement was requested by the ANR function
1382 m_rrc->m_anrSapProvider->ReportUeMeas(msg.measResults);
1383 }
1384
1385 if ((!m_rrc->m_ffrRrcSapProvider.empty()) &&
1386 (m_rrc->m_ffrMeasIds.find(measId) != m_rrc->m_ffrMeasIds.end()))
1387 {
1388 // this measurement was requested by the FFR function
1389 m_rrc->m_ffrRrcSapProvider.at(0)->ReportUeMeas(m_rnti, msg.measResults);
1390 }
1392 {
1393 for (const auto& it : msg.measResults.measResultServFreqList)
1394 {
1395 /// ToDo: implement on Ffr algorithm the code to properly parsing the new measResults
1396 /// message format alternatively it is needed to 'repack' properly the measResults
1397 /// message before sending to Ffr
1398 m_rrc->m_ffrRrcSapProvider.at(it.servFreqId)->ReportUeMeas(m_rnti, msg.measResults);
1399 }
1400 }
1401
1402 /// Report any measurements to ComponentCarrierManager, so it can react to any change or
1403 /// activate the SCC
1404 m_rrc->m_ccmRrcSapProvider->ReportUeMeas(m_rnti, msg.measResults);
1405 // fire a trace source
1406 m_rrc->m_recvMeasurementReportTrace(m_imsi,
1407 m_rrc->ComponentCarrierToCellId(m_componentCarrierId),
1408 m_rnti,
1409 msg);
1410
1411} // end of UeManager::RecvMeasurementReport
1412
1413// methods forwarded from CMAC SAP
1414
1415void
1417{
1418 NS_LOG_FUNCTION(this << m_rnti);
1419 // at this stage used only by the scheduler for updating txMode
1420
1422
1424
1425 // reconfigure the UE RRC
1427}
1428
1429// methods forwarded from PDCP SAP
1430
1431void
1433{
1434 NS_LOG_FUNCTION(this);
1435 if (params.lcid > 2)
1436 {
1437 // data radio bearer
1438 EpsBearerTag tag;
1439 tag.SetRnti(params.rnti);
1440 tag.SetBid(Lcid2Bid(params.lcid));
1441 params.pdcpSdu->AddPacketTag(tag);
1442 m_rrc->m_forwardUpCallback(params.pdcpSdu);
1443 }
1444}
1445
1446uint16_t
1448{
1449 return m_rnti;
1450}
1451
1452uint64_t
1454{
1455 return m_imsi;
1456}
1457
1458uint8_t
1460{
1461 return m_componentCarrierId;
1462}
1463
1464uint16_t
1466{
1468}
1469
1470void
1472{
1473 NS_LOG_FUNCTION(this);
1475 for (uint16_t i = 0; i < m_rrc->m_numberOfComponentCarriers; i++)
1476 {
1477 m_rrc->m_cphySapProvider.at(i)->SetSrsConfigurationIndex(m_rnti, srsConfIndex);
1478 }
1479 switch (m_state)
1480 {
1482 // do nothing, srs conf index will be correctly enforced upon
1483 // RRC connection establishment
1484 break;
1485
1486 default:
1488 break;
1489 }
1490}
1491
1494{
1495 return m_state;
1496}
1497
1498void
1500{
1501 NS_LOG_FUNCTION(this);
1502 m_physicalConfigDedicated.pdschConfigDedicated = pdschConfigDedicated;
1503
1505
1506 // reconfigure the UE RRC
1508}
1509
1510void
1512{
1513 NS_LOG_FUNCTION(this);
1519}
1520
1523{
1524 NS_LOG_FUNCTION(this);
1526 res.oldEnbUeX2apId = m_sourceX2apId;
1527 res.sourceCellId = m_sourceCellId;
1528 res.targetCellId = m_rrc->ComponentCarrierToCellId(m_componentCarrierId);
1529 res.cause = 0;
1530 res.criticalityDiagnostics = 0;
1531
1532 return res;
1533}
1534
1537{
1538 NS_LOG_FUNCTION(this);
1540 res.oldEnbUeX2apId = m_rnti; // source cell rnti
1541 res.newEnbUeX2apId = m_targetX2apId;
1542 res.sourceCellId = m_rrc->ComponentCarrierToCellId(m_componentCarrierId);
1543 res.targetCellId = m_targetCellId;
1544 res.cause = 0;
1545
1546 return res;
1547}
1548
1549uint8_t
1551{
1552 NS_LOG_FUNCTION(this);
1553 const uint8_t MAX_DRB_ID = 32;
1554 for (int drbid = (m_lastAllocatedDrbid + 1) % MAX_DRB_ID; drbid != m_lastAllocatedDrbid;
1555 drbid = (drbid + 1) % MAX_DRB_ID)
1556 {
1557 if (drbid != 0) // 0 is not allowed
1558 {
1559 if (m_drbMap.find(drbid) == m_drbMap.end())
1560 {
1561 m_drbMap.insert(std::pair<uint8_t, Ptr<LteDataRadioBearerInfo>>(drbid, drbInfo));
1562 drbInfo->m_drbIdentity = drbid;
1563 m_lastAllocatedDrbid = drbid;
1564 return drbid;
1565 }
1566 }
1567 }
1568 NS_FATAL_ERROR("no more data radio bearer ids available");
1569 return 0;
1570}
1571
1574{
1575 NS_LOG_FUNCTION(this << (uint32_t)drbid);
1576 NS_ASSERT(0 != drbid);
1577 auto it = m_drbMap.find(drbid);
1578 NS_ABORT_IF(it == m_drbMap.end());
1579 return it->second;
1580}
1581
1582void
1584{
1585 NS_LOG_FUNCTION(this << (uint32_t)drbid);
1586 auto it = m_drbMap.find(drbid);
1587 NS_ASSERT_MSG(it != m_drbMap.end(),
1588 "request to remove radio bearer with unknown drbid " << drbid);
1589 m_drbMap.erase(it);
1590}
1591
1594{
1595 NS_LOG_FUNCTION(this);
1598 msg.haveRadioResourceConfigDedicated = true;
1599 msg.radioResourceConfigDedicated = BuildRadioResourceConfigDedicated();
1600 msg.haveMobilityControlInfo = false;
1601 msg.haveMeasConfig = true;
1602 msg.measConfig = m_rrc->m_ueMeasConfig;
1603 if (!m_caSupportConfigured && m_rrc->m_numberOfComponentCarriers > 1)
1604 {
1605 m_caSupportConfigured = true;
1606 NS_LOG_FUNCTION(this << "CA not configured. Configure now!");
1607 msg.haveNonCriticalExtension = true;
1608 msg.nonCriticalExtension = BuildNonCriticalExtensionConfigurationCa();
1609 NS_LOG_FUNCTION(this << " haveNonCriticalExtension " << msg.haveNonCriticalExtension);
1610 }
1611 else
1612 {
1613 msg.haveNonCriticalExtension = false;
1614 }
1615
1616 return msg;
1617}
1618
1621{
1622 NS_LOG_FUNCTION(this);
1624
1625 if (m_srb1)
1626 {
1628 stam.srbIdentity = m_srb1->m_srbIdentity;
1629 stam.logicalChannelConfig = m_srb1->m_logicalChannelConfig;
1630 rrcd.srbToAddModList.push_back(stam);
1631 }
1632
1633 for (auto it = m_drbMap.begin(); it != m_drbMap.end(); ++it)
1634 {
1636 dtam.epsBearerIdentity = it->second->m_epsBearerIdentity;
1637 dtam.drbIdentity = it->second->m_drbIdentity;
1638 dtam.rlcConfig = it->second->m_rlcConfig;
1639 dtam.logicalChannelIdentity = it->second->m_logicalChannelIdentity;
1640 dtam.logicalChannelConfig = it->second->m_logicalChannelConfig;
1641 rrcd.drbToAddModList.push_back(dtam);
1642 }
1643
1644 rrcd.havePhysicalConfigDedicated = true;
1646 return rrcd;
1647}
1648
1649uint8_t
1651{
1652 NS_LOG_FUNCTION(this);
1656}
1657
1658uint8_t
1660{
1661 NS_ASSERT(lcid > 2);
1662 return lcid - 2;
1663}
1664
1665uint8_t
1667{
1668 return drbid + 2;
1669}
1670
1671uint8_t
1673{
1674 NS_ASSERT(lcid > 2);
1675 return lcid - 2;
1676}
1677
1678uint8_t
1680{
1681 return bid + 2;
1682}
1683
1684uint8_t
1686{
1687 return drbid;
1688}
1689
1690uint8_t
1692{
1693 return bid;
1694}
1695
1696void
1698{
1699 NS_LOG_FUNCTION(this << ToString(newState));
1700 State oldState = m_state;
1701 m_state = newState;
1702 NS_LOG_INFO(this << " IMSI " << m_imsi << " RNTI " << m_rnti << " UeManager "
1703 << ToString(oldState) << " --> " << ToString(newState));
1705 m_rrc->ComponentCarrierToCellId(m_componentCarrierId),
1706 m_rnti,
1707 oldState,
1708 newState);
1709
1710 switch (newState)
1711 {
1713 case HANDOVER_JOINING:
1714 NS_FATAL_ERROR("cannot switch to an initial state");
1715 break;
1716
1717 case CONNECTION_SETUP:
1718 case ATTACH_REQUEST:
1719 break;
1720
1721 case CONNECTED_NORMALLY: {
1723 {
1725 }
1727 {
1729 }
1730 }
1731 break;
1732
1735 case HANDOVER_LEAVING:
1736 default:
1737 break;
1738 }
1739}
1740
1743{
1744 NS_LOG_FUNCTION(this);
1746
1747 for (auto& it : m_rrc->m_componentCarrierPhyConf)
1748 {
1749 uint8_t ccId = it.first;
1750
1751 if (ccId == m_componentCarrierId)
1752 {
1753 // Skip primary CC.
1754 continue;
1755 }
1756 else if (ccId < m_componentCarrierId)
1757 {
1758 // Shift all IDs below PCC forward so PCC can use CC ID 1.
1759 ccId++;
1760 }
1761
1762 Ptr<ComponentCarrierBaseStation> eNbCcm = it.second;
1763 LteRrcSap::SCellToAddMod component;
1764 component.sCellIndex = ccId;
1765 component.cellIdentification.physCellId = eNbCcm->GetCellId();
1766 component.cellIdentification.dlCarrierFreq = eNbCcm->GetDlEarfcn();
1769 eNbCcm->GetDlBandwidth();
1771 .antennaPortsCount = 0;
1773 .referenceSignalPower = m_rrc->m_cphySapProvider.at(0)->GetReferenceSignalPower();
1777 eNbCcm->GetUlEarfcn();
1779 eNbCcm->GetUlBandwidth();
1781 0;
1782 // component.radioResourceConfigCommonSCell.ulConfiguration.soundingRsUlConfigCommon.type =
1783 // LteRrcSap::SoundingRsUlConfigDedicated::SETUP;
1785 .srsBandwidthConfig = 0;
1787 .srsSubframeConfig = 0;
1789
1792 .haveNonUlConfiguration = true;
1796 .transmissionMode = m_rrc->m_defaultTransmissionMode;
1804 .haveUlConfiguration = true;
1808 .transmissionMode = m_rrc->m_defaultTransmissionMode;
1821
1822 ncec.sCellToAddModList.push_back(component);
1823 }
1824
1825 return ncec;
1826}
1827
1828///////////////////////////////////////////
1829// eNB RRC methods
1830///////////////////////////////////////////
1831
1833
1835 : m_x2SapProvider(nullptr),
1836 m_cmacSapProvider(0),
1837 m_handoverManagementSapProvider(nullptr),
1838 m_ccmRrcSapProvider(nullptr),
1839 m_anrSapProvider(nullptr),
1840 m_ffrRrcSapProvider(0),
1841 m_rrcSapUser(nullptr),
1842 m_macSapProvider(nullptr),
1843 m_s1SapProvider(nullptr),
1844 m_cphySapProvider(0),
1845 m_configured(false),
1846 m_lastAllocatedRnti(0),
1847 m_srsCurrentPeriodicityId(0),
1848 m_lastAllocatedConfigurationIndex(0),
1849 m_reconfigureUes(false),
1850 m_numberOfComponentCarriers(0),
1851 m_carriersConfigured(false)
1852{
1853 NS_LOG_FUNCTION(this);
1854 m_cmacSapUser.push_back(new EnbRrcMemberLteEnbCmacSapUser(this, 0));
1863}
1864
1865void
1867{
1868 NS_ASSERT_MSG(!m_carriersConfigured, "Secondary carriers can be configured only once.");
1869 m_componentCarrierPhyConf = ccPhyConf;
1871 " Number of component carriers "
1872 "are not equal to the number of he component carrier configuration provided");
1873
1874 for (uint16_t i = 1; i < m_numberOfComponentCarriers; i++)
1875 {
1877 m_cmacSapUser.push_back(new EnbRrcMemberLteEnbCmacSapUser(this, i));
1879 }
1880 m_carriersConfigured = true;
1882}
1883
1885{
1886 NS_LOG_FUNCTION(this);
1887}
1888
1889void
1891{
1892 NS_LOG_FUNCTION(this);
1893 for (uint16_t i = 0; i < m_numberOfComponentCarriers; i++)
1894 {
1895 delete m_cphySapUser[i];
1896 delete m_cmacSapUser[i];
1897 delete m_ffrRrcSapUser[i];
1898 }
1899 // delete m_cphySapUser;
1900 m_cphySapUser.erase(m_cphySapUser.begin(), m_cphySapUser.end());
1901 m_cphySapUser.clear();
1902 // delete m_cmacSapUser;
1903 m_cmacSapUser.erase(m_cmacSapUser.begin(), m_cmacSapUser.end());
1904 m_cmacSapUser.clear();
1905 // delete m_ffrRrcSapUser;
1906 m_ffrRrcSapUser.erase(m_ffrRrcSapUser.begin(), m_ffrRrcSapUser.end());
1907 m_ffrRrcSapUser.clear();
1908 m_ueMap.clear();
1910 delete m_ccmRrcSapUser;
1911 delete m_anrSapUser;
1912 delete m_rrcSapProvider;
1913 delete m_x2SapUser;
1914 delete m_s1SapUser;
1915}
1916
1917TypeId
1919{
1920 static TypeId tid =
1921 TypeId("ns3::LteEnbRrc")
1922 .SetParent<Object>()
1923 .SetGroupName("Lte")
1924 .AddConstructor<LteEnbRrc>()
1925 .AddAttribute("UeMap",
1926 "List of UeManager by C-RNTI.",
1929 MakeObjectMapChecker<UeManager>())
1930 .AddAttribute("DefaultTransmissionMode",
1931 "The default UEs' transmission mode (0: SISO)",
1932 UintegerValue(0), // default tx-mode
1934 MakeUintegerChecker<uint8_t>())
1935 .AddAttribute(
1936 "EpsBearerToRlcMapping",
1937 "Specify which type of RLC will be used for each type of EPS bearer.",
1939 MakeEnumAccessor<LteEpsBearerToRlcMapping_t>(&LteEnbRrc::m_epsBearerToRlcMapping),
1941 "RlcSmAlways",
1943 "RlcUmAlways",
1945 "RlcAmAlways",
1946 PER_BASED,
1947 "PacketErrorRateBased"))
1948 .AddAttribute("SystemInformationPeriodicity",
1949 "The interval for sending system information (Time value)",
1953
1954 // SRS related attributes
1955 .AddAttribute(
1956 "SrsPeriodicity",
1957 "The SRS periodicity in milliseconds",
1958 UintegerValue(40),
1960 MakeUintegerChecker<uint32_t>())
1961
1962 // Timeout related attributes
1963 .AddAttribute("ConnectionRequestTimeoutDuration",
1964 "After a RA attempt, if no RRC CONNECTION REQUEST is "
1965 "received before this time, the UE context is destroyed. "
1966 "Must account for reception of RAR and transmission of "
1967 "RRC CONNECTION REQUEST over UL GRANT. The value of this"
1968 "timer should not be greater than T300 timer at UE RRC",
1972 .AddAttribute("ConnectionSetupTimeoutDuration",
1973 "After accepting connection request, if no RRC CONNECTION "
1974 "SETUP COMPLETE is received before this time, the UE "
1975 "context is destroyed. Must account for the UE's reception "
1976 "of RRC CONNECTION SETUP and transmission of RRC CONNECTION "
1977 "SETUP COMPLETE.",
1978 TimeValue(MilliSeconds(150)),
1981 .AddAttribute("ConnectionRejectedTimeoutDuration",
1982 "Time to wait between sending a RRC CONNECTION REJECT and "
1983 "destroying the UE context",
1987 .AddAttribute("HandoverJoiningTimeoutDuration",
1988 "After accepting a handover request, if no RRC CONNECTION "
1989 "RECONFIGURATION COMPLETE is received before this time, the "
1990 "UE context is destroyed. Must account for reception of "
1991 "X2 HO REQ ACK by source eNB, transmission of the Handover "
1992 "Command, non-contention-based random access and reception "
1993 "of the RRC CONNECTION RECONFIGURATION COMPLETE message.",
1994 TimeValue(MilliSeconds(200)),
1997 .AddAttribute("HandoverLeavingTimeoutDuration",
1998 "After issuing a Handover Command, if neither RRC "
1999 "CONNECTION RE-ESTABLISHMENT nor X2 UE Context Release has "
2000 "been previously received, the UE context is destroyed.",
2001 TimeValue(MilliSeconds(500)),
2004
2005 // Cell selection related attribute
2006 .AddAttribute("QRxLevMin",
2007 "One of information transmitted within the SIB1 message, "
2008 "indicating the required minimum RSRP level that any UE must "
2009 "receive from this cell before it is allowed to camp to this "
2010 "cell. The default value -70 corresponds to -140 dBm and is "
2011 "the lowest possible value as defined by Section 6.3.4 of "
2012 "3GPP TS 36.133. This restriction, however, only applies to "
2013 "initial cell selection and EPC-enabled simulation.",
2015 IntegerValue(-70),
2017 MakeIntegerChecker<int8_t>(-70, -22))
2018 .AddAttribute("NumberOfComponentCarriers",
2019 "Number of Component Carriers",
2020 UintegerValue(1),
2022 MakeIntegerChecker<int16_t>(MIN_NO_CC, MAX_NO_CC))
2023
2024 // Handover related attributes
2025 .AddAttribute("AdmitHandoverRequest",
2026 "Whether to admit an X2 handover request from another eNB",
2027 BooleanValue(true),
2030 .AddAttribute("AdmitRrcConnectionRequest",
2031 "Whether to admit a connection request from a UE",
2032 BooleanValue(true),
2035
2036 // UE measurements related attributes
2037 .AddAttribute("RsrpFilterCoefficient",
2038 "Determines the strength of smoothing effect induced by "
2039 "layer 3 filtering of RSRP in all attached UE; "
2040 "if set to 0, no layer 3 filtering is applicable",
2041 // i.e. the variable k in 3GPP TS 36.331 section 5.5.3.2
2042 UintegerValue(4),
2044 MakeUintegerChecker<uint8_t>(0))
2045 .AddAttribute("RsrqFilterCoefficient",
2046 "Determines the strength of smoothing effect induced by "
2047 "layer 3 filtering of RSRQ in all attached UE; "
2048 "if set to 0, no layer 3 filtering is applicable",
2049 // i.e. the variable k in 3GPP TS 36.331 section 5.5.3.2
2050 UintegerValue(4),
2052 MakeUintegerChecker<uint8_t>(0))
2053
2054 // Trace sources
2055 .AddTraceSource("NewUeContext",
2056 "Fired upon creation of a new UE context.",
2058 "ns3::LteEnbRrc::NewUeContextTracedCallback")
2059 .AddTraceSource("ConnectionEstablished",
2060 "Fired upon successful RRC connection establishment.",
2062 "ns3::LteEnbRrc::ConnectionHandoverTracedCallback")
2063 .AddTraceSource("ConnectionReconfiguration",
2064 "trace fired upon RRC connection reconfiguration",
2066 "ns3::LteEnbRrc::ConnectionHandoverTracedCallback")
2067 .AddTraceSource("HandoverStart",
2068 "trace fired upon start of a handover procedure",
2070 "ns3::LteEnbRrc::HandoverStartTracedCallback")
2071 .AddTraceSource("HandoverEndOk",
2072 "trace fired upon successful termination of a handover procedure",
2074 "ns3::LteEnbRrc::ConnectionHandoverTracedCallback")
2075 .AddTraceSource("RecvMeasurementReport",
2076 "trace fired when measurement report is received",
2078 "ns3::LteEnbRrc::ReceiveReportTracedCallback")
2079 .AddTraceSource("NotifyConnectionRelease",
2080 "trace fired when an UE is released",
2082 "ns3::LteEnbRrc::ConnectionHandoverTracedCallback")
2083 .AddTraceSource("RrcTimeout",
2084 "trace fired when a timer expires",
2086 "ns3::LteEnbRrc::TimerExpiryTracedCallback")
2087 .AddTraceSource(
2088 "HandoverFailureNoPreamble",
2089 "trace fired upon handover failure due to non-allocation of non-contention based "
2090 "preamble at eNB for UE to handover due to max count reached",
2092 "ns3::LteEnbRrc::HandoverFailureTracedCallback")
2093 .AddTraceSource(
2094 "HandoverFailureMaxRach",
2095 "trace fired upon handover failure due to max RACH attempts from UE to target eNB",
2097 "ns3::LteEnbRrc::HandoverFailureTracedCallback")
2098 .AddTraceSource(
2099 "HandoverFailureLeaving",
2100 "trace fired upon handover failure due to handover leaving timeout at source eNB",
2102 "ns3::LteEnbRrc::HandoverFailureTracedCallback")
2103 .AddTraceSource(
2104 "HandoverFailureJoining",
2105 "trace fired upon handover failure due to handover joining timeout at target eNB",
2107 "ns3::LteEnbRrc::HandoverFailureTracedCallback");
2108 return tid;
2109}
2110
2111void
2113{
2114 NS_LOG_FUNCTION(this << s);
2115 m_x2SapProvider = s;
2116}
2117
2120{
2121 NS_LOG_FUNCTION(this);
2122 return m_x2SapUser;
2123}
2124
2125void
2127{
2128 NS_LOG_FUNCTION(this << s);
2129 m_cmacSapProvider.at(0) = s;
2130}
2131
2132void
2134{
2135 NS_LOG_FUNCTION(this << s);
2136 if (m_cmacSapProvider.size() > pos)
2137 {
2138 m_cmacSapProvider.at(pos) = s;
2139 }
2140 else
2141 {
2142 m_cmacSapProvider.push_back(s);
2143 NS_ABORT_IF(m_cmacSapProvider.size() - 1 != pos);
2144 }
2145}
2146
2149{
2150 NS_LOG_FUNCTION(this);
2151 return m_cmacSapUser.at(0);
2152}
2153
2156{
2157 NS_LOG_FUNCTION(this);
2158 return m_cmacSapUser.at(pos);
2159}
2160
2161void
2163{
2164 NS_LOG_FUNCTION(this << s);
2166}
2167
2170{
2171 NS_LOG_FUNCTION(this);
2173}
2174
2175void
2177{
2178 NS_LOG_FUNCTION(this << s);
2180}
2181
2184{
2185 NS_LOG_FUNCTION(this);
2186 return m_ccmRrcSapUser;
2187}
2188
2189void
2191{
2192 NS_LOG_FUNCTION(this << s);
2193 m_anrSapProvider = s;
2194}
2195
2198{
2199 NS_LOG_FUNCTION(this);
2200 return m_anrSapUser;
2201}
2202
2203void
2205{
2206 NS_LOG_FUNCTION(this << s);
2207 if (!m_ffrRrcSapProvider.empty())
2208 {
2209 m_ffrRrcSapProvider.at(0) = s;
2210 }
2211 else
2212 {
2213 m_ffrRrcSapProvider.push_back(s);
2214 }
2215}
2216
2217void
2219{
2220 NS_LOG_FUNCTION(this << s);
2221 if (m_ffrRrcSapProvider.size() > index)
2222 {
2223 m_ffrRrcSapProvider.at(index) = s;
2224 }
2225 else
2226 {
2227 m_ffrRrcSapProvider.push_back(s);
2228 NS_ABORT_MSG_IF(m_ffrRrcSapProvider.size() - 1 != index,
2229 "You meant to store the pointer at position "
2230 << static_cast<uint32_t>(index) << " but it went to "
2231 << m_ffrRrcSapProvider.size() - 1);
2232 }
2233}
2234
2237{
2238 NS_LOG_FUNCTION(this);
2239 return m_ffrRrcSapUser.at(0);
2240}
2241
2244{
2245 NS_LOG_FUNCTION(this);
2247 "Invalid component carrier index:"
2248 << index << " provided in order to obtain FfrRrcSapUser.");
2249 return m_ffrRrcSapUser.at(index);
2250}
2251
2252void
2254{
2255 NS_LOG_FUNCTION(this << s);
2256 m_rrcSapUser = s;
2257}
2258
2261{
2262 NS_LOG_FUNCTION(this);
2263 return m_rrcSapProvider;
2264}
2265
2266void
2268{
2269 NS_LOG_FUNCTION(this);
2270 m_macSapProvider = s;
2271}
2272
2273void
2275{
2276 m_s1SapProvider = s;
2277}
2278
2281{
2282 return m_s1SapUser;
2283}
2284
2285void
2287{
2288 NS_LOG_FUNCTION(this << s);
2289 if (!m_cphySapProvider.empty())
2290 {
2291 m_cphySapProvider.at(0) = s;
2292 }
2293 else
2294 {
2295 m_cphySapProvider.push_back(s);
2296 }
2297}
2298
2301{
2302 NS_LOG_FUNCTION(this);
2303 return m_cphySapUser.at(0);
2304}
2305
2306void
2308{
2309 NS_LOG_FUNCTION(this << s);
2310 if (m_cphySapProvider.size() > pos)
2311 {
2312 m_cphySapProvider.at(pos) = s;
2313 }
2314 else
2315 {
2316 m_cphySapProvider.push_back(s);
2317 NS_ABORT_IF(m_cphySapProvider.size() - 1 != pos);
2318 }
2319}
2320
2323{
2324 NS_LOG_FUNCTION(this);
2325 return m_cphySapUser.at(pos);
2326}
2327
2328bool
2329LteEnbRrc::HasUeManager(uint16_t rnti) const
2330{
2331 NS_LOG_FUNCTION(this << (uint32_t)rnti);
2332 auto it = m_ueMap.find(rnti);
2333 return (it != m_ueMap.end());
2334}
2335
2338{
2339 NS_LOG_FUNCTION(this << (uint32_t)rnti);
2340 NS_ASSERT(0 != rnti);
2341 auto it = m_ueMap.find(rnti);
2342 NS_ASSERT_MSG(it != m_ueMap.end(), "UE manager for RNTI " << rnti << " not found");
2343 return it->second;
2344}
2345
2346std::vector<uint8_t>
2348{
2349 NS_LOG_FUNCTION(this);
2350
2351 // SANITY CHECK
2352
2356 "Measurement identities and reporting configuration should not have different quantity");
2357
2358 if (Simulator::Now() != Seconds(0))
2359 {
2360 NS_FATAL_ERROR("AddUeMeasReportConfig may not be called after the simulation has run");
2361 }
2362
2363 // INPUT VALIDATION
2364
2365 switch (config.triggerQuantity)
2366 {
2370 {
2372 "The given triggerQuantity (RSRP) does not match with the given threshold2.choice");
2373 }
2374
2380 {
2382 "The given triggerQuantity (RSRP) does not match with the given threshold1.choice");
2383 }
2384 break;
2385
2389 {
2391 "The given triggerQuantity (RSRQ) does not match with the given threshold2.choice");
2392 }
2393
2399 {
2401 "The given triggerQuantity (RSRQ) does not match with the given threshold1.choice");
2402 }
2403 break;
2404
2405 default:
2406 NS_FATAL_ERROR("unsupported triggerQuantity");
2407 break;
2408 }
2409
2411 {
2412 NS_FATAL_ERROR("Only REPORT_STRONGEST_CELLS purpose is supported");
2413 }
2414
2416 {
2417 NS_LOG_WARN("reportQuantity = BOTH will be used instead of the given reportQuantity");
2418 }
2419
2420 uint8_t nextId = m_ueMeasConfig.reportConfigToAddModList.size() + 1;
2421
2422 // create the reporting configuration
2424 reportConfig.reportConfigId = nextId;
2425 reportConfig.reportConfigEutra = config;
2426
2427 // add reporting configuration to UE measurement configuration
2428 m_ueMeasConfig.reportConfigToAddModList.push_back(reportConfig);
2429
2430 std::vector<uint8_t> measIds;
2431
2432 // create measurement identities, linking reporting configuration to all objects
2433 for (uint16_t componentCarrier = 0; componentCarrier < m_numberOfComponentCarriers;
2434 componentCarrier++)
2435 {
2436 LteRrcSap::MeasIdToAddMod measIdToAddMod;
2437
2438 uint8_t measId = m_ueMeasConfig.measIdToAddModList.size() + 1;
2439
2440 measIdToAddMod.measId = measId;
2441 measIdToAddMod.measObjectId = componentCarrier + 1;
2442 measIdToAddMod.reportConfigId = nextId;
2443
2444 m_ueMeasConfig.measIdToAddModList.push_back(measIdToAddMod);
2445 measIds.push_back(measId);
2446 }
2447
2448 return measIds;
2449}
2450
2451void
2453{
2454 auto it = ccPhyConf.begin();
2455 NS_ASSERT(it != ccPhyConf.end());
2456 uint16_t ulBandwidth = it->second->GetUlBandwidth();
2457 uint16_t dlBandwidth = it->second->GetDlBandwidth();
2458 uint32_t ulEarfcn = it->second->GetUlEarfcn();
2459 uint32_t dlEarfcn = it->second->GetDlEarfcn();
2460 NS_LOG_FUNCTION(this << ulBandwidth << dlBandwidth << ulEarfcn << dlEarfcn);
2462
2463 for (const auto& it : ccPhyConf)
2464 {
2465 m_cphySapProvider.at(it.first)->SetBandwidth(it.second->GetUlBandwidth(),
2466 it.second->GetDlBandwidth());
2467 m_cphySapProvider.at(it.first)->SetEarfcn(it.second->GetUlEarfcn(),
2468 it.second->GetDlEarfcn());
2469 m_cphySapProvider.at(it.first)->SetCellId(it.second->GetCellId());
2470 m_cmacSapProvider.at(it.first)->ConfigureMac(it.second->GetUlBandwidth(),
2471 it.second->GetDlBandwidth());
2472 if (m_ffrRrcSapProvider.size() > it.first)
2473 {
2474 m_ffrRrcSapProvider.at(it.first)->SetCellId(it.second->GetCellId());
2475 m_ffrRrcSapProvider.at(it.first)->SetBandwidth(it.second->GetUlBandwidth(),
2476 it.second->GetDlBandwidth());
2477 }
2478 }
2479
2480 m_dlEarfcn = dlEarfcn;
2481 m_ulEarfcn = ulEarfcn;
2482 m_dlBandwidth = dlBandwidth;
2483 m_ulBandwidth = ulBandwidth;
2484
2485 /*
2486 * Initializing the list of measurement objects.
2487 * Only intra-frequency measurements are supported,
2488 * so one measurement object is created for each carrier frequency.
2489 */
2490 for (const auto& it : ccPhyConf)
2491 {
2493 measObject.measObjectId = it.first + 1;
2494 measObject.measObjectEutra.carrierFreq = it.second->GetDlEarfcn();
2495 measObject.measObjectEutra.allowedMeasBandwidth = it.second->GetDlBandwidth();
2496 measObject.measObjectEutra.presenceAntennaPort1 = false;
2497 measObject.measObjectEutra.neighCellConfig = 0;
2498 measObject.measObjectEutra.offsetFreq = 0;
2500
2501 m_ueMeasConfig.measObjectToAddModList.push_back(measObject);
2502 }
2503
2510
2511 m_sib1.clear();
2512 m_sib1.reserve(ccPhyConf.size());
2513 for (const auto& it : ccPhyConf)
2514 {
2515 // Enabling MIB transmission
2517 mib.dlBandwidth = it.second->GetDlBandwidth();
2518 mib.systemFrameNumber = 0;
2519 m_cphySapProvider.at(it.first)->SetMasterInformationBlock(mib);
2520
2521 // Enabling SIB1 transmission with default values
2523 sib1.cellAccessRelatedInfo.cellIdentity = it.second->GetCellId();
2527 sib1.cellSelectionInfo.qQualMin = -34; // not used, set as minimum value
2528 sib1.cellSelectionInfo.qRxLevMin = m_qRxLevMin; // set as minimum value
2529 m_sib1.push_back(sib1);
2530 m_cphySapProvider.at(it.first)->SetSystemInformationBlockType1(sib1);
2531 }
2532 /*
2533 * Enabling transmission of other SIB. The first time System Information is
2534 * transmitted is arbitrarily assumed to be at +0.016s, and then it will be
2535 * regularly transmitted every 80 ms by default (set the
2536 * SystemInformationPeriodicity attribute to configure this).
2537 */
2539
2540 m_configured = true;
2541}
2542
2543void
2544LteEnbRrc::SetCellId(uint16_t cellId)
2545{
2546 // update SIB1
2547 m_sib1.at(0).cellAccessRelatedInfo.cellIdentity = cellId;
2548 m_cphySapProvider.at(0)->SetSystemInformationBlockType1(m_sib1.at(0));
2549}
2550
2551void
2552LteEnbRrc::SetCellId(uint16_t cellId, uint8_t ccIndex)
2553{
2554 // update SIB1
2555 m_sib1.at(ccIndex).cellAccessRelatedInfo.cellIdentity = cellId;
2556 m_cphySapProvider.at(ccIndex)->SetSystemInformationBlockType1(m_sib1.at(ccIndex));
2557}
2558
2559uint8_t
2561{
2562 NS_LOG_FUNCTION(this << cellId);
2563 for (auto& it : m_componentCarrierPhyConf)
2564 {
2565 if (it.second->GetCellId() == cellId)
2566 {
2567 return it.first;
2568 }
2569 }
2570 NS_FATAL_ERROR("Cell " << cellId << " not found in CC map");
2571}
2572
2573uint16_t
2574LteEnbRrc::ComponentCarrierToCellId(uint8_t componentCarrierId)
2575{
2576 NS_LOG_FUNCTION(this << +componentCarrierId);
2577 return m_componentCarrierPhyConf.at(componentCarrierId)->GetCellId();
2578}
2579
2580bool
2581LteEnbRrc::HasCellId(uint16_t cellId) const
2582{
2583 for (auto& it : m_componentCarrierPhyConf)
2584 {
2585 if (it.second->GetCellId() == cellId)
2586 {
2587 return true;
2588 }
2589 }
2590 return false;
2591}
2592
2593bool
2595{
2596 NS_LOG_FUNCTION(this << packet);
2597 EpsBearerTag tag;
2598 bool found = packet->RemovePacketTag(tag);
2599 NS_ASSERT_MSG(found, "no EpsBearerTag found in packet to be sent");
2600 Ptr<UeManager> ueManager = GetUeManager(tag.GetRnti());
2601
2602 NS_LOG_INFO("Sending a packet of " << packet->GetSize() << " bytes to IMSI "
2603 << ueManager->GetImsi() << ", RNTI " << ueManager->GetRnti()
2604 << ", BID " << (uint16_t)tag.GetBid());
2605 ueManager->SendData(tag.GetBid(), packet);
2606
2607 return true;
2608}
2609
2610void
2612{
2614}
2615
2616void
2618{
2619 NS_LOG_FUNCTION(this << rnti);
2621 "ConnectionRequestTimeout in unexpected state "
2622 << ToString(GetUeManager(rnti)->GetState()));
2623 m_rrcTimeoutTrace(GetUeManager(rnti)->GetImsi(),
2624 rnti,
2625 ComponentCarrierToCellId(GetUeManager(rnti)->GetComponentCarrierId()),
2626 "ConnectionRequestTimeout");
2627 RemoveUe(rnti);
2628}
2629
2630void
2632{
2633 NS_LOG_FUNCTION(this << rnti);
2635 "ConnectionSetupTimeout in unexpected state "
2636 << ToString(GetUeManager(rnti)->GetState()));
2637 m_rrcTimeoutTrace(GetUeManager(rnti)->GetImsi(),
2638 rnti,
2639 ComponentCarrierToCellId(GetUeManager(rnti)->GetComponentCarrierId()),
2640 "ConnectionSetupTimeout");
2641 RemoveUe(rnti);
2642}
2643
2644void
2646{
2647 NS_LOG_FUNCTION(this << rnti);
2649 "ConnectionRejectedTimeout in unexpected state "
2650 << ToString(GetUeManager(rnti)->GetState()));
2651 m_rrcTimeoutTrace(GetUeManager(rnti)->GetImsi(),
2652 rnti,
2653 ComponentCarrierToCellId(GetUeManager(rnti)->GetComponentCarrierId()),
2654 "ConnectionRejectedTimeout");
2655 RemoveUe(rnti);
2656}
2657
2658void
2660{
2661 NS_LOG_FUNCTION(this << rnti);
2663 "HandoverJoiningTimeout in unexpected state "
2664 << ToString(GetUeManager(rnti)->GetState()));
2666 GetUeManager(rnti)->GetImsi(),
2667 rnti,
2668 ComponentCarrierToCellId(GetUeManager(rnti)->GetComponentCarrierId()));
2669 // check if the RNTI to be removed is not stale
2670 if (HasUeManager(rnti))
2671 {
2672 /**
2673 * When the handover joining timer expires at the target cell,
2674 * then notify the source cell to release the RRC connection and
2675 * delete the UE context at eNodeB and SGW/PGW. The
2676 * HandoverPreparationFailure message is reused to notify the source cell
2677 * through the X2 interface instead of creating a new message.
2678 */
2679 Ptr<UeManager> ueManager = GetUeManager(rnti);
2680 EpcX2Sap::HandoverPreparationFailureParams msg = ueManager->BuildHoPrepFailMsg();
2682 RemoveUe(rnti);
2683 }
2684}
2685
2686void
2688{
2689 NS_LOG_FUNCTION(this << rnti);
2691 "HandoverLeavingTimeout in unexpected state "
2692 << ToString(GetUeManager(rnti)->GetState()));
2694 GetUeManager(rnti)->GetImsi(),
2695 rnti,
2696 ComponentCarrierToCellId(GetUeManager(rnti)->GetComponentCarrierId()));
2697 // check if the RNTI to be removed is not stale
2698 if (HasUeManager(rnti))
2699 {
2700 /**
2701 * Send HO cancel msg to the target eNB and release the RRC connection
2702 * with the UE and also delete UE context at the source eNB and bearer
2703 * info at SGW and PGW.
2704 */
2705 Ptr<UeManager> ueManager = GetUeManager(rnti);
2706 EpcX2Sap::HandoverCancelParams msg = ueManager->BuildHoCancelMsg();
2708 ueManager->SendRrcConnectionRelease();
2709 }
2710}
2711
2712void
2713LteEnbRrc::SendHandoverRequest(uint16_t rnti, uint16_t cellId)
2714{
2715 NS_LOG_FUNCTION(this << rnti << cellId);
2716 NS_LOG_LOGIC("Request to send HANDOVER REQUEST");
2718
2719 Ptr<UeManager> ueManager = GetUeManager(rnti);
2720 ueManager->PrepareHandover(cellId);
2721}
2722
2723void
2725{
2726 NS_LOG_FUNCTION(this << rnti);
2727 GetUeManager(rnti)->CompleteSetupUe(params);
2728}
2729
2730void
2732{
2733 NS_LOG_FUNCTION(this << rnti);
2734 GetUeManager(rnti)->RecvRrcConnectionRequest(msg);
2735}
2736
2737void
2740{
2741 NS_LOG_FUNCTION(this << rnti);
2742 GetUeManager(rnti)->RecvRrcConnectionSetupCompleted(msg);
2743}
2744
2745void
2747 uint16_t rnti,
2749{
2750 NS_LOG_FUNCTION(this << rnti);
2751 GetUeManager(rnti)->RecvRrcConnectionReconfigurationCompleted(msg);
2752}
2753
2754void
2756 uint16_t rnti,
2758{
2759 NS_LOG_FUNCTION(this << rnti);
2760 GetUeManager(rnti)->RecvRrcConnectionReestablishmentRequest(msg);
2761}
2762
2763void
2765 uint16_t rnti,
2767{
2768 NS_LOG_FUNCTION(this << rnti);
2769 GetUeManager(rnti)->RecvRrcConnectionReestablishmentComplete(msg);
2770}
2771
2772void
2774{
2775 NS_LOG_FUNCTION(this << rnti);
2776 GetUeManager(rnti)->RecvMeasurementReport(msg);
2777}
2778
2779void
2781{
2782 NS_LOG_FUNCTION(this);
2783 Ptr<UeManager> ueManager = GetUeManager(msg.rnti);
2784 ueManager->InitialContextSetupRequest();
2785}
2786
2787void
2789{
2790 NS_LOG_FUNCTION(this << rnti);
2791
2792 // check if the RNTI to be removed is not stale
2793 if (HasUeManager(rnti))
2794 {
2795 Ptr<UeManager> ueManager = GetUeManager(rnti);
2796
2797 if (ueManager->GetState() == UeManager::HANDOVER_JOINING)
2798 {
2800 GetUeManager(rnti)->GetImsi(),
2801 rnti,
2802 ComponentCarrierToCellId(GetUeManager(rnti)->GetComponentCarrierId()));
2803 /**
2804 * During the HO, when the RACH failure due to the maximum number of
2805 * re-attempts is reached the UE request the target eNB to deletes its
2806 * context. Upon which, the target eNB sends handover preparation
2807 * failure to the source eNB.
2808 */
2809 EpcX2Sap::HandoverPreparationFailureParams msg = ueManager->BuildHoPrepFailMsg();
2811 }
2812
2813 GetUeManager(rnti)->RecvIdealUeContextRemoveRequest(rnti);
2814 // delete the UE context at the eNB
2815 RemoveUe(rnti);
2816 }
2817}
2818
2819void
2822{
2823 NS_LOG_FUNCTION(this);
2824 Ptr<UeManager> ueManager = GetUeManager(request.rnti);
2825 ueManager->SetupDataRadioBearer(request.bearer,
2826 request.bearerId,
2827 request.gtpTeid,
2828 request.transportLayerAddress);
2829}
2830
2831void
2834{
2835 NS_LOG_FUNCTION(this);
2836 Ptr<UeManager> ueManager = GetUeManager(params.rnti);
2837 ueManager->SendUeContextRelease();
2838}
2839
2840void
2842{
2843 NS_LOG_FUNCTION(this);
2844
2845 NS_LOG_LOGIC("Recv X2 message: HANDOVER REQUEST");
2846
2847 NS_LOG_LOGIC("oldEnbUeX2apId = " << req.oldEnbUeX2apId);
2848 NS_LOG_LOGIC("sourceCellId = " << req.sourceCellId);
2849 NS_LOG_LOGIC("targetCellId = " << req.targetCellId);
2850 NS_LOG_LOGIC("mmeUeS1apId = " << req.mmeUeS1apId);
2851
2852 // if no SRS index is available, then do not accept the handover
2854 {
2855 NS_LOG_INFO("rejecting handover request from cellId " << req.sourceCellId);
2857 res.oldEnbUeX2apId = req.oldEnbUeX2apId;
2858 res.sourceCellId = req.sourceCellId;
2859 res.targetCellId = req.targetCellId;
2860 res.cause = 0;
2861 res.criticalityDiagnostics = 0;
2863 return;
2864 }
2865
2866 uint8_t componentCarrierId = CellToComponentCarrierId(req.targetCellId);
2867 uint16_t rnti = AddUe(UeManager::HANDOVER_JOINING, componentCarrierId);
2868 Ptr<UeManager> ueManager = GetUeManager(rnti);
2869 ueManager->SetSource(req.sourceCellId, req.oldEnbUeX2apId);
2870 ueManager->SetImsi(req.mmeUeS1apId);
2872 m_cmacSapProvider.at(componentCarrierId)->AllocateNcRaPreamble(rnti);
2873 if (!anrcrv.valid)
2874 {
2876 this
2877 << " failed to allocate a preamble for non-contention based RA => cannot accept HO");
2879 GetUeManager(rnti)->GetImsi(),
2880 rnti,
2881 ComponentCarrierToCellId(GetUeManager(rnti)->GetComponentCarrierId()));
2882 /**
2883 * When the maximum non-contention based preambles is reached, then it is considered
2884 * handover has failed and source cell is notified to release the RRC connection and delete
2885 * the UE context at eNodeB and SGW/PGW.
2886 */
2887 Ptr<UeManager> ueManager = GetUeManager(rnti);
2888 EpcX2Sap::HandoverPreparationFailureParams msg = ueManager->BuildHoPrepFailMsg();
2890 RemoveUe(rnti); // remove the UE from the target eNB
2891 return;
2892 }
2893
2895 ackParams.oldEnbUeX2apId = req.oldEnbUeX2apId;
2896 ackParams.newEnbUeX2apId = rnti;
2897 ackParams.sourceCellId = req.sourceCellId;
2898 ackParams.targetCellId = req.targetCellId;
2899
2900 for (auto it = req.bearers.begin(); it != req.bearers.end(); ++it)
2901 {
2902 ueManager->SetupDataRadioBearer(it->erabLevelQosParameters,
2903 it->erabId,
2904 it->gtpTeid,
2905 it->transportLayerAddress);
2907 i.erabId = it->erabId;
2908 ackParams.admittedBearers.push_back(i);
2909 }
2910
2912 ueManager->GetRrcConnectionReconfigurationForHandover(componentCarrierId);
2913
2914 handoverCommand.mobilityControlInfo.newUeIdentity = rnti;
2915 handoverCommand.mobilityControlInfo.haveRachConfigDedicated = true;
2918 anrcrv.raPrachMaskIndex;
2919
2921 m_cmacSapProvider.at(componentCarrierId)->GetRachConfig();
2923 .numberOfRaPreambles = rc.numberOfRaPreambles;
2925 .preambleTransMax = rc.preambleTransMax;
2927 .raResponseWindowSize = rc.raResponseWindowSize;
2929 .connEstFailCount = rc.connEstFailCount;
2930
2931 Ptr<Packet> encodedHandoverCommand = m_rrcSapUser->EncodeHandoverCommand(handoverCommand);
2932
2933 ackParams.rrcContext = encodedHandoverCommand;
2934
2935 NS_LOG_LOGIC("Send X2 message: HANDOVER REQUEST ACK");
2936
2937 NS_LOG_LOGIC("oldEnbUeX2apId = " << ackParams.oldEnbUeX2apId);
2938 NS_LOG_LOGIC("newEnbUeX2apId = " << ackParams.newEnbUeX2apId);
2939 NS_LOG_LOGIC("sourceCellId = " << ackParams.sourceCellId);
2940 NS_LOG_LOGIC("targetCellId = " << ackParams.targetCellId);
2941
2943}
2944
2945void
2947{
2948 NS_LOG_FUNCTION(this);
2949
2950 NS_LOG_LOGIC("Recv X2 message: HANDOVER REQUEST ACK");
2951
2952 NS_LOG_LOGIC("oldEnbUeX2apId = " << params.oldEnbUeX2apId);
2953 NS_LOG_LOGIC("newEnbUeX2apId = " << params.newEnbUeX2apId);
2954 NS_LOG_LOGIC("sourceCellId = " << params.sourceCellId);
2955 NS_LOG_LOGIC("targetCellId = " << params.targetCellId);
2956
2957 uint16_t rnti = params.oldEnbUeX2apId;
2958 Ptr<UeManager> ueManager = GetUeManager(rnti);
2959 ueManager->RecvHandoverRequestAck(params);
2960}
2961
2962void
2964{
2965 NS_LOG_FUNCTION(this);
2966
2967 NS_LOG_LOGIC("Recv X2 message: HANDOVER PREPARATION FAILURE");
2968
2969 NS_LOG_LOGIC("oldEnbUeX2apId = " << params.oldEnbUeX2apId);
2970 NS_LOG_LOGIC("sourceCellId = " << params.sourceCellId);
2971 NS_LOG_LOGIC("targetCellId = " << params.targetCellId);
2972 NS_LOG_LOGIC("cause = " << params.cause);
2973 NS_LOG_LOGIC("criticalityDiagnostics = " << params.criticalityDiagnostics);
2974
2975 uint16_t rnti = params.oldEnbUeX2apId;
2976
2977 // check if the RNTI is not stale
2978 if (HasUeManager(rnti))
2979 {
2980 Ptr<UeManager> ueManager = GetUeManager(rnti);
2981 ueManager->RecvHandoverPreparationFailure(params.targetCellId);
2982 }
2983}
2984
2985void
2987{
2988 NS_LOG_FUNCTION(this);
2989
2990 NS_LOG_LOGIC("Recv X2 message: SN STATUS TRANSFER");
2991
2992 NS_LOG_LOGIC("oldEnbUeX2apId = " << params.oldEnbUeX2apId);
2993 NS_LOG_LOGIC("newEnbUeX2apId = " << params.newEnbUeX2apId);
2994 NS_LOG_LOGIC("erabsSubjectToStatusTransferList size = "
2995 << params.erabsSubjectToStatusTransferList.size());
2996
2997 uint16_t rnti = params.newEnbUeX2apId;
2998
2999 // check if the RNTI to receive SN transfer for is not stale
3000 if (HasUeManager(rnti))
3001 {
3002 Ptr<UeManager> ueManager = GetUeManager(rnti);
3003 ueManager->RecvSnStatusTransfer(params);
3004 }
3005}
3006
3007void
3009{
3010 NS_LOG_FUNCTION(this);
3011
3012 NS_LOG_LOGIC("Recv X2 message: UE CONTEXT RELEASE");
3013
3014 NS_LOG_LOGIC("oldEnbUeX2apId = " << params.oldEnbUeX2apId);
3015 NS_LOG_LOGIC("newEnbUeX2apId = " << params.newEnbUeX2apId);
3016
3017 uint16_t rnti = params.oldEnbUeX2apId;
3018
3019 // check if the RNTI to be removed is not stale
3020 if (HasUeManager(rnti))
3021 {
3022 GetUeManager(rnti)->RecvUeContextRelease(params);
3023 RemoveUe(rnti);
3024 }
3025}
3026
3027void
3029{
3030 NS_LOG_FUNCTION(this);
3031
3032 NS_LOG_LOGIC("Recv X2 message: LOAD INFORMATION");
3033
3034 NS_LOG_LOGIC("Number of cellInformationItems = " << params.cellInformationList.size());
3035
3037 m_ffrRrcSapProvider.at(0)->RecvLoadInformation(params);
3038}
3039
3040void
3042{
3043 NS_LOG_FUNCTION(this);
3044
3045 NS_LOG_LOGIC("Recv X2 message: RESOURCE STATUS UPDATE");
3046
3048 "Number of cellMeasurementResultItems = " << params.cellMeasurementResultList.size());
3049
3050 NS_ASSERT("Processing of RESOURCE STATUS UPDATE X2 message IS NOT IMPLEMENTED");
3051}
3052
3053void
3055{
3056 NS_LOG_FUNCTION(this);
3057
3058 NS_LOG_LOGIC("Recv UE DATA FORWARDING through X2 interface");
3059 NS_LOG_LOGIC("sourceCellId = " << params.sourceCellId);
3060 NS_LOG_LOGIC("targetCellId = " << params.targetCellId);
3061 NS_LOG_LOGIC("gtpTeid = " << params.gtpTeid);
3062 NS_LOG_LOGIC("ueData = " << params.ueData);
3063 NS_LOG_LOGIC("ueData size = " << params.ueData->GetSize());
3064
3065 auto teidInfoIt = m_x2uTeidInfoMap.find(params.gtpTeid);
3066 if (teidInfoIt != m_x2uTeidInfoMap.end())
3067 {
3068 GetUeManager(teidInfoIt->second.rnti)->SendData(teidInfoIt->second.drbid, params.ueData);
3069 }
3070 else
3071 {
3072 NS_FATAL_ERROR("X2-U data received but no X2uTeidInfo found");
3073 }
3074}
3075
3076void
3078{
3079 NS_LOG_FUNCTION(this);
3080
3081 NS_LOG_LOGIC("Recv X2 message: HANDOVER CANCEL");
3082
3083 NS_LOG_LOGIC("oldEnbUeX2apId = " << params.oldEnbUeX2apId);
3084 NS_LOG_LOGIC("newEnbUeX2apId = " << params.newEnbUeX2apId);
3085 NS_LOG_LOGIC("sourceCellId = " << params.sourceCellId);
3086 NS_LOG_LOGIC("targetCellId = " << params.targetCellId);
3087 NS_LOG_LOGIC("cause = " << params.cause);
3088
3089 uint16_t rnti = params.newEnbUeX2apId;
3090 if (HasUeManager(rnti))
3091 {
3092 Ptr<UeManager> ueManager = GetUeManager(rnti);
3093 ueManager->RecvHandoverCancel(params);
3094 GetUeManager(rnti)->RecvIdealUeContextRemoveRequest(rnti);
3095 }
3096}
3097
3098uint16_t
3100{
3101 NS_LOG_FUNCTION(this << +componentCarrierId);
3102 // if no SRS index is available, then do not create a new UE context.
3103 if (IsMaxSrsReached())
3104 {
3105 NS_LOG_WARN("Not enough SRS configuration indices, UE context not created");
3106 return 0; // return 0 since new RNTI was not assigned for the received preamble
3107 }
3108 return AddUe(UeManager::INITIAL_RANDOM_ACCESS, componentCarrierId);
3109}
3110
3111void
3113{
3114 Ptr<UeManager> ueManager = GetUeManager(cmacParams.m_rnti);
3115 ueManager->CmacUeConfigUpdateInd(cmacParams);
3116}
3117
3118void
3119LteEnbRrc::DoNotifyLcConfigResult(uint16_t rnti, uint8_t lcid, bool success)
3120{
3121 NS_LOG_FUNCTION(this << (uint32_t)rnti);
3122 NS_FATAL_ERROR("not implemented");
3123}
3124
3125std::vector<uint8_t>
3127{
3128 NS_LOG_FUNCTION(this);
3129 std::vector<uint8_t> measIds = AddUeMeasReportConfig(reportConfig);
3130 m_handoverMeasIds.insert(measIds.begin(), measIds.end());
3131 return measIds;
3132}
3133
3134uint8_t
3136{
3137 NS_LOG_FUNCTION(this);
3138 uint8_t measId = AddUeMeasReportConfig(reportConfig).at(0);
3139 m_componentCarrierMeasIds.insert(measId);
3140 return measId;
3141}
3142
3143void
3144LteEnbRrc::DoSetNumberOfComponentCarriers(uint16_t numberOfComponentCarriers)
3145{
3146 m_numberOfComponentCarriers = numberOfComponentCarriers;
3147}
3148
3149void
3150LteEnbRrc::DoTriggerHandover(uint16_t rnti, uint16_t targetCellId)
3151{
3152 NS_LOG_FUNCTION(this << rnti << targetCellId);
3153
3154 bool isHandoverAllowed = true;
3155
3156 Ptr<UeManager> ueManager = GetUeManager(rnti);
3157 NS_ASSERT_MSG(ueManager, "Cannot find UE context with RNTI " << rnti);
3158
3159 if (m_anrSapProvider != nullptr && !HasCellId(targetCellId))
3160 {
3161 // ensure that proper neighbour relationship exists between source and target cells
3162 bool noHo = m_anrSapProvider->GetNoHo(targetCellId);
3163 bool noX2 = m_anrSapProvider->GetNoX2(targetCellId);
3164 NS_LOG_DEBUG(this << " cellId="
3165 << ComponentCarrierToCellId(ueManager->GetComponentCarrierId())
3166 << " targetCellId=" << targetCellId << " NRT.NoHo=" << noHo
3167 << " NRT.NoX2=" << noX2);
3168
3169 if (noHo || noX2)
3170 {
3171 isHandoverAllowed = false;
3172 NS_LOG_LOGIC(this << " handover to cell " << targetCellId << " is not allowed by ANR");
3173 }
3174 }
3175
3176 if (ueManager->GetState() != UeManager::CONNECTED_NORMALLY)
3177 {
3178 isHandoverAllowed = false;
3179 NS_LOG_LOGIC(this << " handover is not allowed because the UE"
3180 << " rnti=" << rnti << " is in " << ToString(ueManager->GetState())
3181 << " state");
3182 }
3183
3184 if (isHandoverAllowed)
3185 {
3186 // initiate handover execution
3187 ueManager->PrepareHandover(targetCellId);
3188 }
3189}
3190
3191uint8_t
3193{
3194 NS_LOG_FUNCTION(this);
3195 uint8_t measId = AddUeMeasReportConfig(reportConfig).at(0);
3196 m_anrMeasIds.insert(measId);
3197 return measId;
3198}
3199
3200uint8_t
3202{
3203 NS_LOG_FUNCTION(this);
3204 uint8_t measId = AddUeMeasReportConfig(reportConfig).at(0);
3205 m_ffrMeasIds.insert(measId);
3206 return measId;
3207}
3208
3209void
3211 LteRrcSap::PdschConfigDedicated pdschConfigDedicated)
3212{
3213 NS_LOG_FUNCTION(this);
3214 Ptr<UeManager> ueManager = GetUeManager(rnti);
3215 ueManager->SetPdschConfigDedicated(pdschConfigDedicated);
3216}
3217
3218void
3220{
3221 NS_LOG_FUNCTION(this);
3222
3224}
3225
3226uint16_t
3227LteEnbRrc::AddUe(UeManager::State state, uint8_t componentCarrierId)
3228{
3229 NS_LOG_FUNCTION(this);
3230 bool found = false;
3231 uint16_t rnti;
3232 for (rnti = m_lastAllocatedRnti + 1; (rnti != m_lastAllocatedRnti - 1) && (!found); ++rnti)
3233 {
3234 if ((rnti != 0) && (m_ueMap.find(rnti) == m_ueMap.end()))
3235 {
3236 found = true;
3237 break;
3238 }
3239 }
3240
3241 NS_ASSERT_MSG(found, "no more RNTIs available (do you have more than 65535 UEs in a cell?)");
3242 m_lastAllocatedRnti = rnti;
3243 Ptr<UeManager> ueManager = CreateObject<UeManager>(this, rnti, state, componentCarrierId);
3244 m_ccmRrcSapProvider->AddUe(rnti, (uint8_t)state);
3245 m_ueMap.insert(std::pair<uint16_t, Ptr<UeManager>>(rnti, ueManager));
3246 ueManager->Initialize();
3247 const uint16_t cellId = ComponentCarrierToCellId(componentCarrierId);
3248 NS_LOG_DEBUG(this << " New UE RNTI " << rnti << " cellId " << cellId << " srs CI "
3249 << ueManager->GetSrsConfigurationIndex());
3250 m_newUeContextTrace(cellId, rnti);
3251 return rnti;
3252}
3253
3254void
3256{
3257 NS_LOG_FUNCTION(this << (uint32_t)rnti);
3258 auto it = m_ueMap.find(rnti);
3259 NS_ASSERT_MSG(it != m_ueMap.end(), "request to remove UE info with unknown rnti " << rnti);
3260 uint64_t imsi = it->second->GetImsi();
3261 uint16_t srsCi = (*it).second->GetSrsConfigurationIndex();
3262 // cancel pending events
3263 it->second->CancelPendingEvents();
3264 // fire trace upon connection release
3266 ComponentCarrierToCellId(it->second->GetComponentCarrierId()),
3267 rnti);
3268 m_ueMap.erase(it);
3269 for (uint16_t i = 0; i < m_numberOfComponentCarriers; i++)
3270 {
3271 m_cmacSapProvider.at(i)->RemoveUe(rnti);
3272 m_cphySapProvider.at(i)->RemoveUe(rnti);
3273 }
3274 if (m_s1SapProvider != nullptr)
3275 {
3277 }
3279 // need to do this after UeManager has been deleted
3280 if (srsCi != 0)
3281 {
3283 }
3284
3285 m_rrcSapUser->RemoveUe(rnti); // Remove UE context at RRC protocol
3286}
3287
3288TypeId
3290{
3292 {
3293 case RLC_SM_ALWAYS:
3294 return LteRlcSm::GetTypeId();
3295
3296 case RLC_UM_ALWAYS:
3297 return LteRlcUm::GetTypeId();
3298
3299 case RLC_AM_ALWAYS:
3300 return LteRlcAm::GetTypeId();
3301
3302 case PER_BASED:
3303 if (bearer.GetPacketErrorLossRate() > 1.0e-5)
3304 {
3305 return LteRlcUm::GetTypeId();
3306 }
3307 else
3308 {
3309 return LteRlcAm::GetTypeId();
3310 }
3311
3312 default:
3313 return LteRlcSm::GetTypeId();
3314 }
3315}
3316
3317void
3319{
3320 NS_LOG_FUNCTION(this << cellId);
3321
3322 if (m_anrSapProvider != nullptr)
3323 {
3325 }
3326}
3327
3328void
3329LteEnbRrc::SetCsgId(uint32_t csgId, bool csgIndication)
3330{
3331 NS_LOG_FUNCTION(this << csgId << csgIndication);
3332 for (std::size_t componentCarrierId = 0; componentCarrierId < m_sib1.size();
3333 componentCarrierId++)
3334 {
3335 m_sib1.at(componentCarrierId).cellAccessRelatedInfo.csgIdentity = csgId;
3336 m_sib1.at(componentCarrierId).cellAccessRelatedInfo.csgIndication = csgIndication;
3337 m_cphySapProvider.at(componentCarrierId)
3338 ->SetSystemInformationBlockType1(m_sib1.at(componentCarrierId));
3339 }
3340}
3341
3342/// Number of distinct SRS periodicity plus one.
3343static const uint8_t SRS_ENTRIES = 9;
3344/**
3345 * Sounding Reference Symbol (SRS) periodicity (TSRS) in milliseconds. Taken
3346 * from 3GPP TS 36.213 Table 8.2-1. Index starts from 1.
3347 */
3348static const uint16_t g_srsPeriodicity[SRS_ENTRIES] = {0, 2, 5, 10, 20, 40, 80, 160, 320};
3349/**
3350 * The lower bound (inclusive) of the SRS configuration indices (ISRS) which
3351 * use the corresponding SRS periodicity (TSRS). Taken from 3GPP TS 36.213
3352 * Table 8.2-1. Index starts from 1.
3353 */
3354static const uint16_t g_srsCiLow[SRS_ENTRIES] = {0, 0, 2, 7, 17, 37, 77, 157, 317};
3355/**
3356 * The upper bound (inclusive) of the SRS configuration indices (ISRS) which
3357 * use the corresponding SRS periodicity (TSRS). Taken from 3GPP TS 36.213
3358 * Table 8.2-1. Index starts from 1.
3359 */
3360static const uint16_t g_srsCiHigh[SRS_ENTRIES] = {0, 1, 6, 16, 36, 76, 156, 316, 636};
3361
3362void
3364{
3365 NS_LOG_FUNCTION(this << p);
3366 for (uint32_t id = 1; id < SRS_ENTRIES; ++id)
3367 {
3368 if (g_srsPeriodicity[id] == p)
3369 {
3371 return;
3372 }
3373 }
3374 // no match found
3375 std::ostringstream allowedValues;
3376 for (uint32_t id = 1; id < SRS_ENTRIES; ++id)
3377 {
3378 allowedValues << g_srsPeriodicity[id] << " ";
3379 }
3380 NS_FATAL_ERROR("illecit SRS periodicity value " << p
3381 << ". Allowed values: " << allowedValues.str());
3382}
3383
3386{
3387 NS_LOG_FUNCTION(this);
3391}
3392
3393uint16_t
3395{
3397 // SRS
3400 NS_LOG_DEBUG(this << " SRS p " << g_srsPeriodicity[m_srsCurrentPeriodicityId] << " set "
3403 {
3404 NS_FATAL_ERROR("too many UEs ("
3405 << m_ueSrsConfigurationIndexSet.size() + 1
3406 << ") for current SRS periodicity "
3408 << ", consider increasing the value of ns3::LteEnbRrc::SrsPeriodicity");
3409 }
3410
3411 if (m_ueSrsConfigurationIndexSet.empty())
3412 {
3413 // first entry
3416 }
3417 else
3418 {
3419 // find a CI from the available ones
3420 auto rit = m_ueSrsConfigurationIndexSet.rbegin();
3422 NS_LOG_DEBUG(this << " lower bound " << (*rit) << " of "
3425 {
3426 // got it from the upper bound
3429 }
3430 else
3431 {
3432 // look for released ones
3433 for (uint16_t srcCi = g_srsCiLow[m_srsCurrentPeriodicityId];
3435 srcCi++)
3436 {
3437 auto it = m_ueSrsConfigurationIndexSet.find(srcCi);
3438 if (it == m_ueSrsConfigurationIndexSet.end())
3439 {
3441 m_ueSrsConfigurationIndexSet.insert(srcCi);
3442 break;
3443 }
3444 }
3445 }
3446 }
3448}
3449
3450void
3452{
3453 NS_LOG_FUNCTION(this << srcCi);
3454 auto it = m_ueSrsConfigurationIndexSet.find(srcCi);
3456 "request to remove unknown SRS CI " << srcCi);
3458}
3459
3460bool
3462{
3465 NS_LOG_DEBUG(this << " SRS p " << g_srsPeriodicity[m_srsCurrentPeriodicityId] << " set "
3468}
3469
3470uint8_t
3472{
3473 if (bearer.GetResourceType() > 0) // 1, 2 for GBR and DC-GBR
3474 {
3475 return 1;
3476 }
3477 else
3478 {
3479 return 2;
3480 }
3481}
3482
3483uint8_t
3485{
3486 return bearer.qci;
3487}
3488
3489void
3491{
3492 // NS_LOG_FUNCTION (this);
3493
3494 for (auto& it : m_componentCarrierPhyConf)
3495 {
3496 uint8_t ccId = it.first;
3497
3499 si.haveSib2 = true;
3500 si.sib2.freqInfo.ulCarrierFreq = it.second->GetUlEarfcn();
3501 si.sib2.freqInfo.ulBandwidth = it.second->GetUlBandwidth();
3503 m_cphySapProvider.at(ccId)->GetReferenceSignalPower();
3505
3506 LteEnbCmacSapProvider::RachConfig rc = m_cmacSapProvider.at(ccId)->GetRachConfig();
3507 LteRrcSap::RachConfigCommon rachConfigCommon;
3508 rachConfigCommon.preambleInfo.numberOfRaPreambles = rc.numberOfRaPreambles;
3509 rachConfigCommon.raSupervisionInfo.preambleTransMax = rc.preambleTransMax;
3510 rachConfigCommon.raSupervisionInfo.raResponseWindowSize = rc.raResponseWindowSize;
3511 rachConfigCommon.txFailParam.connEstFailCount = rc.connEstFailCount;
3512 si.sib2.radioResourceConfigCommon.rachConfigCommon = rachConfigCommon;
3513
3514 m_rrcSapUser->SendSystemInformation(it.second->GetCellId(), si);
3515 }
3516
3517 /*
3518 * For simplicity, we use the same periodicity for all SIBs. Note that in real
3519 * systems the periodicy of each SIBs could be different.
3520 */
3522}
3523
3524bool
3526{
3527 NS_LOG_FUNCTION(this << (uint32_t)rnti);
3528 Ptr<UeManager> ueManager = GetUeManager(rnti);
3529 switch (ueManager->GetState())
3530 {
3533 return true;
3534 default:
3535 return false;
3536 }
3537}
3538
3539} // namespace ns3
Callback template class.
Definition: callback.h:438
Class for forwarding CMAC SAP User functions.
Definition: lte-enb-rrc.cc:61
bool IsRandomAccessCompleted(uint16_t rnti) override
Is random access completed function.
Definition: lte-enb-rrc.cc:107
EnbRrcMemberLteEnbCmacSapUser(LteEnbRrc *rrc, uint8_t componentCarrierId)
Constructor.
Definition: lte-enb-rrc.cc:81
void RrcConfigurationUpdateInd(UeConfig params) override
Notify the RRC of a UE config updated requested by the MAC (normally, by the scheduler)
Definition: lte-enb-rrc.cc:101
uint16_t AllocateTemporaryCellRnti() override
request the allocation of a Temporary C-RNTI
Definition: lte-enb-rrc.cc:89
uint8_t m_componentCarrierId
Component carrier ID.
Definition: lte-enb-rrc.cc:78
void NotifyLcConfigResult(uint16_t rnti, uint8_t lcid, bool success) override
notify the result of the last LC config operation
Definition: lte-enb-rrc.cc:95
Hold variables of type enum.
Definition: enum.h:62
This class implements the Service Access Point (SAP) between the LteEnbRrc and the EpcEnbApplication.
virtual void UeContextRelease(uint16_t rnti)=0
Release UE context at the S1 Application of the source eNB after reception of the UE CONTEXT RELEASE ...
virtual void DoSendReleaseIndication(uint64_t imsi, uint16_t rnti, uint8_t bearerId)=0
Triggers epc-enb-application to send ERAB Release Indication message towards MME.
This class implements the Service Access Point (SAP) between the LteEnbRrc and the EpcEnbApplication.
@ HandoverDesirableForRadioReason
Definition: epc-x2-sap.h:220
These service primitives of this part of the X2 SAP are provided by the X2 entity and issued by RRC e...
Definition: epc-x2-sap.h:359
virtual void SendHandoverRequestAck(HandoverRequestAckParams params)=0
Send handover request ack function.
virtual void SendHandoverPreparationFailure(HandoverPreparationFailureParams params)=0
Send handover preparation failure function.
virtual void SendHandoverCancel(HandoverCancelParams params)=0
Send handover Cancel to the target eNB.
virtual void SendLoadInformation(LoadInformationParams params)=0
Send load information function.
These service primitives of this part of the X2 SAP are provided by the RRC entity and issued by the ...
Definition: epc-x2-sap.h:427
This class contains the specification of EPS Bearers.
Definition: eps-bearer.h:91
uint8_t GetResourceType() const
Definition: eps-bearer.cc:126
uint16_t GetPacketDelayBudgetMs() const
Definition: eps-bearer.cc:138
double GetPacketErrorLossRate() const
Definition: eps-bearer.cc:144
Qci qci
Qos class indicator.
Definition: eps-bearer.h:151
GbrQosInformation gbrQosInfo
GBR QOS information.
Definition: eps-bearer.h:153
@ GBR_CONV_VOICE
GBR Conversational Voice.
Definition: eps-bearer.h:107
Tag used to define the RNTI and EPS bearer ID for packets interchanged between the EpcEnbApplication ...
uint8_t GetBid() const
Get Bearer Id function.
uint16_t GetRnti() const
Get RNTI function.
void SetRnti(uint16_t rnti)
Set the RNTI to the given value.
void SetBid(uint8_t bid)
Set the bearer id to the given value.
void Cancel()
This method is syntactic sugar for the ns3::Simulator::Cancel method.
Definition: event-id.cc:55
Hold a signed integer type.
Definition: integer.h:45
Ipv4 addresses are stored in host order in this class.
Definition: ipv4-address.h:42
Service Access Point (SAP) offered by the ANR instance to the eNodeB RRC instance.
Definition: lte-anr-sap.h:37
virtual void AddNeighbourRelation(uint16_t cellId)=0
Add a new Neighbour Relation entry.
virtual bool GetNoX2(uint16_t cellId) const =0
Get the value of No X2 field of a neighbouring cell from the Neighbour Relation Table (NRT).
virtual bool GetNoHo(uint16_t cellId) const =0
Get the value of No HO field of a neighbouring cell from the Neighbour Relation Table (NRT).
Service Access Point (SAP) offered by the eNodeB RRC instance to the ANR instance.
Definition: lte-anr-sap.h:95
Service Access Point (SAP) offered by the Component Carrier Manager (CCM) instance to the eNodeB RRC ...
virtual void AddUe(uint16_t rnti, uint8_t state)=0
Add a new UE in the LteEnbComponentCarrierManager.
virtual void RemoveUe(uint16_t rnti)=0
Remove an existing UE.
Service Access Point (SAP) offered by the eNodeB RRC instance to the component carrier manager (CCM) ...
Service Access Point (SAP) offered by the eNB MAC to the eNB RRC See Femto Forum MAC Scheduler Interf...
Service Access Point (SAP) offered by the MAC to the RRC See Femto Forum MAC Scheduler Interface Spec...
Service Access Point (SAP) offered by the UE PHY to the UE RRC for control purposes.
Service Access Point (SAP) offered by the UE PHY to the UE RRC for control purposes.
The LTE Radio Resource Control entity at the eNB.
Definition: lte-enb-rrc.h:656
~LteEnbRrc() override
Destructor.
LteEnbRrcSapProvider * GetLteEnbRrcSapProvider()
void SetCsgId(uint32_t csgId, bool csgIndication)
Associate this RRC entity with a particular CSG information.
void RemoveUe(uint16_t rnti)
remove a UE from the cell
void DoSetPdschConfigDedicated(uint16_t rnti, LteRrcSap::PdschConfigDedicated pa)
Set PDSCH config dedicated function.
std::map< uint8_t, Ptr< ComponentCarrierBaseStation > > m_componentCarrierPhyConf
component carrier phy configuration
Definition: lte-enb-rrc.h:1787
void SetSrsPeriodicity(uint32_t p)
bool IsRandomAccessCompleted(uint16_t rnti)
Is random access completed function.
uint8_t GetLogicalChannelGroup(EpsBearer bearer)
int8_t m_qRxLevMin
The QRxLevMin attribute.
Definition: lte-enb-rrc.h:1655
std::set< uint16_t > m_ueSrsConfigurationIndexSet
UE SRS configuration index set.
Definition: lte-enb-rrc.h:1646
TracedCallback< uint64_t, uint16_t, uint16_t, uint16_t > m_handoverStartTrace
The HandoverStart trace source.
Definition: lte-enb-rrc.h:1732
void DoSetNumberOfComponentCarriers(uint16_t numberOfComponentCarriers)
Set number of component carriers.
void DoSendReleaseDataRadioBearer(uint64_t imsi, uint16_t rnti, uint8_t bearerId)
This function acts as an interface to trigger Release indication messages towards eNB and EPC.
Definition: lte-enb-rrc.cc:592
void SendSystemInformation()
method used to periodically send System Information
void DoRecvRrcConnectionRequest(uint16_t rnti, LteRrcSap::RrcConnectionRequest msg)
Part of the RRC protocol.
std::set< uint8_t > m_ffrMeasIds
List of measurement identities which are intended for FFR purpose.
Definition: lte-enb-rrc.h:1613
friend class MemberEpcEnbS1SapUser< LteEnbRrc >
allow MemberLteEnbRrcSapProvider<LteEnbRrc> class friend access
Definition: lte-enb-rrc.h:668
Callback< void, Ptr< Packet > > m_forwardUpCallback
forward up callback function
Definition: lte-enb-rrc.h:1531
void DoRecvSnStatusTransfer(EpcX2SapUser::SnStatusTransferParams params)
Receive SN status transfer function.
void DoRecvHandoverRequest(EpcX2SapUser::HandoverRequestParams params)
Receive handover request function.
LteEnbRrc()
create an RRC instance for use within an eNB
std::set< uint8_t > m_anrMeasIds
List of measurement identities which are intended for ANR purpose.
Definition: lte-enb-rrc.h:1611
uint8_t DoAddUeMeasReportConfigForFfr(LteRrcSap::ReportConfigEutra reportConfig)
Add UE measure report config for FFR function.
LteMacSapProvider * m_macSapProvider
Interface to the eNodeB MAC instance, to be used by RLC instances.
Definition: lte-enb-rrc.h:1569
uint32_t GetSrsPeriodicity() const
bool SendData(Ptr< Packet > p)
Enqueue an IP data packet on the proper bearer for downlink transmission.
EpcEnbS1SapUser * GetS1SapUser()
void AddX2Neighbour(uint16_t cellId)
Add a neighbour with an X2 interface.
LteCcmRrcSapUser * m_ccmRrcSapUser
Receive API calls from the LteEnbComponentCarrierManager instance.
Definition: lte-enb-rrc.h:1549
Time m_connectionRequestTimeoutDuration
The ConnectionRequestTimeoutDuration attribute.
Definition: lte-enb-rrc.h:1684
void HandoverLeavingTimeout(uint16_t rnti)
Method triggered when a UE is expected to leave a cell for a handover but no feedback is received in ...
LteHandoverManagementSapUser * m_handoverManagementSapUser
Receive API calls from the handover algorithm instance.
Definition: lte-enb-rrc.h:1544
static TypeId GetTypeId()
Get the type ID.
void DoRecvMeasurementReport(uint16_t rnti, LteRrcSap::MeasurementReport msg)
Part of the RRC protocol.
void SetLteAnrSapProvider(LteAnrSapProvider *s)
set the ANR SAP this RRC should interact with
void DoRecvHandoverRequestAck(EpcX2SapUser::HandoverRequestAckParams params)
Receive handover request acknowledge function.
LteEnbCphySapUser * GetLteEnbCphySapUser()
bool HasUeManager(uint16_t rnti) const
uint8_t m_rsrqFilterCoefficient
The RsrqFilterCoefficient attribute.
Definition: lte-enb-rrc.h:1677
std::vector< uint8_t > DoAddUeMeasReportConfigForHandover(LteRrcSap::ReportConfigEutra reportConfig)
Add UE measure report config for handover function.
void DoRecvResourceStatusUpdate(EpcX2SapUser::ResourceStatusUpdateParams params)
Receive resource status update function.
uint16_t AddUe(UeManager::State state, uint8_t componentCarrierId)
Allocate a new RNTI for a new UE.
void DoSendLoadInformation(EpcX2Sap::LoadInformationParams params)
Send load information function.
uint8_t GetLogicalChannelPriority(EpsBearer bearer)
void DoCompleteSetupUe(uint16_t rnti, LteEnbRrcSapProvider::CompleteSetupUeParameters params)
Part of the RRC protocol.
uint16_t GetNewSrsConfigurationIndex()
Allocate a new SRS configuration index for a new UE.
uint8_t m_defaultTransmissionMode
The DefaultTransmissionMode attribute.
Definition: lte-enb-rrc.h:1631
Time m_connectionRejectedTimeoutDuration
The ConnectionRejectedTimeoutDuration attribute.
Definition: lte-enb-rrc.h:1696
Time m_connectionSetupTimeoutDuration
The ConnectionSetupTimeoutDuration attribute.
Definition: lte-enb-rrc.h:1691
std::set< uint8_t > m_handoverMeasIds
List of measurement identities which are intended for handover purpose.
Definition: lte-enb-rrc.h:1609
void DoPathSwitchRequestAcknowledge(EpcEnbS1SapUser::PathSwitchRequestAcknowledgeParameters params)
Path switch request acknowledge function.
std::vector< uint8_t > AddUeMeasReportConfig(LteRrcSap::ReportConfigEutra config)
Add a new UE measurement reporting configuration.
bool m_admitHandoverRequest
The AdmitHandoverRequest attribute.
Definition: lte-enb-rrc.h:1660
uint16_t m_ulBandwidth
Uplink transmission bandwidth configuration in number of Resource Blocks.
Definition: lte-enb-rrc.h:1590
LteAnrSapUser * m_anrSapUser
Receive API calls from the ANR instance.
Definition: lte-enb-rrc.h:1554
LteHandoverManagementSapProvider * m_handoverManagementSapProvider
Interface to the handover algorithm instance.
Definition: lte-enb-rrc.h:1546
friend class EpcX2SpecificEpcX2SapUser< LteEnbRrc >
allow MemberEpcEnbS1SapUser<LteEnbRrc> class friend access
Definition: lte-enb-rrc.h:670
uint8_t DoAddUeMeasReportConfigForComponentCarrier(LteRrcSap::ReportConfigEutra reportConfig)
Add UE measure report config for component carrier function.
std::vector< LteFfrRrcSapProvider * > m_ffrRrcSapProvider
Interface to the FFR algorithm instance.
Definition: lte-enb-rrc.h:1561
uint8_t DoAddUeMeasReportConfigForAnr(LteRrcSap::ReportConfigEutra reportConfig)
Add UE measure report config for ANR function.
LteEnbRrcSapUser * m_rrcSapUser
Interface to send messages to UE over the RRC protocol.
Definition: lte-enb-rrc.h:1564
std::map< uint16_t, Ptr< UeManager > > m_ueMap
The UeMap attribute.
Definition: lte-enb-rrc.h:1600
void HandoverJoiningTimeout(uint16_t rnti)
Method triggered when a UE is expected to join the cell for a handover but does not do so in a reason...
LteEpsBearerToRlcMapping_t m_epsBearerToRlcMapping
The EpsBearerToRlcMapping attribute.
Definition: lte-enb-rrc.h:1636
Ptr< UeManager > GetUeManager(uint16_t rnti)
LteCcmRrcSapProvider * m_ccmRrcSapProvider
Interface to the LteEnbComponentCarrierManager instance.
Definition: lte-enb-rrc.h:1551
void DoRecvRrcConnectionReestablishmentComplete(uint16_t rnti, LteRrcSap::RrcConnectionReestablishmentComplete msg)
Part of the RRC protocol.
void DoRrcConfigurationUpdateInd(LteEnbCmacSapUser::UeConfig params)
RRC configuration update indication function.
TracedCallback< uint64_t, uint16_t, uint16_t, LteRrcSap::MeasurementReport > m_recvMeasurementReportTrace
The RecvMeasurementReport trace source.
Definition: lte-enb-rrc.h:1743
LteAnrSapProvider * m_anrSapProvider
Interface to the ANR instance.
Definition: lte-enb-rrc.h:1556
std::set< uint8_t > m_componentCarrierMeasIds
List of measurement identities which are intended for component carrier management purposes.
Definition: lte-enb-rrc.h:1615
std::vector< LteEnbCphySapProvider * > m_cphySapProvider
Interface to the eNodeB PHY instances.
Definition: lte-enb-rrc.h:1579
void SetLteMacSapProvider(LteMacSapProvider *s)
set the MAC SAP provider.
void ConfigureCarriers(std::map< uint8_t, Ptr< ComponentCarrierBaseStation > > ccPhyConf)
Configure carriers.
uint16_t m_lastAllocatedConfigurationIndex
last allocated configuration index
Definition: lte-enb-rrc.h:1647
TracedCallback< uint64_t, uint16_t, uint16_t > m_handoverFailureMaxRachTrace
The 'HandoverFailureMaxRach' Trace source.
Definition: lte-enb-rrc.h:1768
friend class MemberLteCcmRrcSapUser< LteEnbRrc >
allow MemberLteCcmRrcSapUser<LteEnbRrc> class friend access
Definition: lte-enb-rrc.h:674
LteRrcSap::MeasConfig m_ueMeasConfig
List of measurement configuration which are active in every UE attached to this eNodeB instance.
Definition: lte-enb-rrc.h:1606
friend class MemberLteEnbRrcSapProvider< LteEnbRrc >
allow MemberLteEnbRrcSapProvider<LteEnbRrc> class friend access
Definition: lte-enb-rrc.h:666
TracedCallback< uint64_t, uint16_t, uint16_t > m_handoverFailureNoPreambleTrace
The 'HandoverFailureNoPreamble' Trace source.
Definition: lte-enb-rrc.h:1762
TracedCallback< uint16_t, uint16_t > m_newUeContextTrace
The NewUeContext trace source.
Definition: lte-enb-rrc.h:1717
Time m_systemInformationPeriodicity
The SystemInformationPeriodicity attribute.
Definition: lte-enb-rrc.h:1641
void DoRecvRrcConnectionReconfigurationCompleted(uint16_t rnti, LteRrcSap::RrcConnectionReconfigurationCompleted msg)
Part of the RRC protocol.
void SetLteEnbRrcSapUser(LteEnbRrcSapUser *s)
set the RRC SAP this RRC should interact with
friend class MemberLteAnrSapUser< LteEnbRrc >
allow MemberLteAnrSapUser<LteEnbRrc> class friend access
Definition: lte-enb-rrc.h:662
void DoRecvHandoverPreparationFailure(EpcX2SapUser::HandoverPreparationFailureParams params)
Receive handover preparation failure function.
LteHandoverManagementSapUser * GetLteHandoverManagementSapUser()
Get the Handover Management SAP offered by this RRC.
EpcX2SapUser * GetEpcX2SapUser()
Get the X2 SAP offered by this RRC.
std::vector< LteEnbCmacSapUser * > m_cmacSapUser
Receive API calls from the eNodeB MAC instance.
Definition: lte-enb-rrc.h:1539
void DoInitialContextSetupRequest(EpcEnbS1SapUser::InitialContextSetupRequestParameters params)
Initial context setup request function.
uint32_t m_dlEarfcn
Downlink E-UTRA Absolute Radio Frequency Channel Number.
Definition: lte-enb-rrc.h:1584
void SendHandoverRequest(uint16_t rnti, uint16_t cellId)
Send a HandoverRequest through the X2 SAP interface.
uint16_t m_numberOfComponentCarriers
number of component carriers
Definition: lte-enb-rrc.h:1782
void DoNotifyLcConfigResult(uint16_t rnti, uint8_t lcid, bool success)
Notify LC config result function.
TypeId GetRlcType(EpsBearer bearer)
uint8_t m_rsrpFilterCoefficient
The RsrpFilterCoefficient attribute.
Definition: lte-enb-rrc.h:1671
EpcEnbS1SapProvider * m_s1SapProvider
Interface to send messages to core network over the S1 protocol.
Definition: lte-enb-rrc.h:1572
uint16_t m_lastAllocatedRnti
Last allocated RNTI.
Definition: lte-enb-rrc.h:1592
uint32_t m_ulEarfcn
Uplink E-UTRA Absolute Radio Frequency Channel Number.
Definition: lte-enb-rrc.h:1586
uint16_t ComponentCarrierToCellId(uint8_t componentCarrierId)
convert the component carrier id to cell id
LteFfrRrcSapUser * GetLteFfrRrcSapUser()
Get the FFR SAP offered by this RRC.
void SetS1SapProvider(EpcEnbS1SapProvider *s)
Set the S1 SAP Provider.
bool HasCellId(uint16_t cellId) const
TracedCallback< uint64_t, uint16_t, uint16_t > m_connectionReconfigurationTrace
The ConnectionReconfiguration trace source.
Definition: lte-enb-rrc.h:1727
EpcX2SapUser * m_x2SapUser
Interface to receive messages from neighbour eNodeB over the X2 interface.
Definition: lte-enb-rrc.h:1534
bool m_admitRrcConnectionRequest
The AdmitRrcConnectionRequest attribute.
Definition: lte-enb-rrc.h:1665
void DoRecvUeData(EpcX2SapUser::UeDataParams params)
Receive UE data function.
uint16_t m_srsCurrentPeriodicityId
The SrsPeriodicity attribute.
Definition: lte-enb-rrc.h:1645
void DoRecvRrcConnectionReestablishmentRequest(uint16_t rnti, LteRrcSap::RrcConnectionReestablishmentRequest msg)
Part of the RRC protocol.
bool m_configured
True if ConfigureCell() has been completed.
Definition: lte-enb-rrc.h:1582
void ConnectionSetupTimeout(uint16_t rnti)
Method triggered when a UE is expected to complete a connection setup procedure but does not do so in...
friend class EnbRrcMemberLteEnbCmacSapUser
allow EnbRrcMemberLteEnbCmacSapUser class friend access
Definition: lte-enb-rrc.h:658
friend class MemberLteHandoverManagementSapUser< LteEnbRrc >
allow MemberLteHandoverManagementSapUser<LteEnbRrc> class friend access
Definition: lte-enb-rrc.h:660
LteEnbCmacSapUser * GetLteEnbCmacSapUser()
Get the CMAC SAP offered by this RRC.
void DoRecvRrcConnectionSetupCompleted(uint16_t rnti, LteRrcSap::RrcConnectionSetupCompleted msg)
Part of the RRC protocol.
TracedCallback< uint64_t, uint16_t, uint16_t > m_connectionReleaseTrace
The NotifyConnectionRelease trace source.
Definition: lte-enb-rrc.h:1749
void ConnectionRejectedTimeout(uint16_t rnti)
Method triggered a while after sending RRC Connection Rejected.
void DoRecvUeContextRelease(EpcX2SapUser::UeContextReleaseParams params)
Receive UE context release function.
Time m_handoverLeavingTimeoutDuration
The HandoverLeavingTimeoutDuration attribute.
Definition: lte-enb-rrc.h:1711
std::map< uint32_t, X2uTeidInfo > m_x2uTeidInfoMap
TEID, RNTI, DRBID.
Definition: lte-enb-rrc.h:1625
void DoRecvLoadInformation(EpcX2SapUser::LoadInformationParams params)
Receive load information function.
void ConnectionRequestTimeout(uint16_t rnti)
Method triggered when a UE is expected to request for connection but does not do so in a reasonable t...
uint16_t DoAllocateTemporaryCellRnti(uint8_t componentCarrierId)
Allocate temporary cell RNTI function.
std::vector< LteEnbCphySapUser * > m_cphySapUser
Receive API calls from the eNodeB PHY instances.
Definition: lte-enb-rrc.h:1577
TracedCallback< uint64_t, uint16_t, uint16_t > m_handoverFailureJoiningTrace
The 'HandoverFailureJoining' Trace source.
Definition: lte-enb-rrc.h:1780
void SetLteHandoverManagementSapProvider(LteHandoverManagementSapProvider *s)
set the Handover Management SAP this RRC should interact with
void SetLteFfrRrcSapProvider(LteFfrRrcSapProvider *s)
set the FFR SAP this RRC should interact with
LteCcmRrcSapUser * GetLteCcmRrcSapUser()
Get the Component Carrier Management SAP offered by this RRC.
void SetLteEnbCphySapProvider(LteEnbCphySapProvider *s)
set the CPHY SAP this RRC should use to interact with the PHY
void DoDispose() override
Destructor implementation.
std::vector< LteFfrRrcSapUser * > m_ffrRrcSapUser
Receive API calls from the FFR algorithm instance.
Definition: lte-enb-rrc.h:1559
bool IsMaxSrsReached()
EpcX2SapProvider * m_x2SapProvider
Interface to send messages to neighbour eNodeB over the X2 interface.
Definition: lte-enb-rrc.h:1536
std::vector< LteEnbCmacSapProvider * > m_cmacSapProvider
Interface to the eNodeB MAC instance.
Definition: lte-enb-rrc.h:1541
std::vector< LteRrcSap::SystemInformationBlockType1 > m_sib1
The System Information Block Type 1 that is currently broadcasted over BCH.
Definition: lte-enb-rrc.h:1595
void DoDataRadioBearerSetupRequest(EpcEnbS1SapUser::DataRadioBearerSetupRequestParameters params)
Data radio beaerer setup request function.
LteAnrSapUser * GetLteAnrSapUser()
Get the ANR SAP offered by this RRC.
void SetLteCcmRrcSapProvider(LteCcmRrcSapProvider *s)
set the Component Carrier Management SAP this RRC should interact with
LteEnbRrcSapProvider * m_rrcSapProvider
Interface to receive messages from UE over the RRC protocol.
Definition: lte-enb-rrc.h:1566
bool m_carriersConfigured
are carriers configured
Definition: lte-enb-rrc.h:1784
void SetForwardUpCallback(Callback< void, Ptr< Packet > > cb)
set the callback used to forward data packets up the stack
TracedCallback< uint64_t, uint16_t, uint16_t > m_connectionEstablishedTrace
The ConnectionEstablished trace source.
Definition: lte-enb-rrc.h:1722
TracedCallback< uint64_t, uint16_t, uint16_t > m_handoverFailureLeavingTrace
The 'HandoverFailureLeaving' Trace source.
Definition: lte-enb-rrc.h:1774
TracedCallback< uint64_t, uint16_t, uint16_t, std::string > m_rrcTimeoutTrace
The 'TimerExpiry' Trace source.
Definition: lte-enb-rrc.h:1755
void DoTriggerHandover(uint16_t rnti, uint16_t targetCellId)
Trigger handover function.
void DoRecvIdealUeContextRemoveRequest(uint16_t rnti)
Part of the RRC protocol.
void SetCellId(uint16_t m_cellId)
set the cell id of this eNB
EpcEnbS1SapUser * m_s1SapUser
Interface to receive messages from core network over the S1 protocol.
Definition: lte-enb-rrc.h:1574
void RemoveSrsConfigurationIndex(uint16_t srcCi)
remove a previously allocated SRS configuration index
Time m_handoverJoiningTimeoutDuration
The HandoverJoiningTimeoutDuration attribute.
Definition: lte-enb-rrc.h:1705
void ConfigureCell(std::map< uint8_t, Ptr< ComponentCarrierBaseStation > > ccPhyConf)
Configure cell-specific parameters.
void SetLteEnbCmacSapProvider(LteEnbCmacSapProvider *s)
set the CMAC SAP this RRC should interact with
uint16_t m_dlBandwidth
Downlink transmission bandwidth configuration in number of Resource Blocks.
Definition: lte-enb-rrc.h:1588
TracedCallback< uint64_t, uint16_t, uint16_t > m_handoverEndOkTrace
The HandoverEndOk trace source.
Definition: lte-enb-rrc.h:1737
uint8_t CellToComponentCarrierId(uint16_t cellId)
convert the cell id to component carrier id
void SetEpcX2SapProvider(EpcX2SapProvider *s)
Set the X2 SAP this RRC should interact with.
void DoRecvHandoverCancel(EpcX2SapUser::HandoverCancelParams params)
Receive Handover Cancel function.
Part of the RRC protocol.
Definition: lte-rrc-sap.h:1244
Part of the RRC protocol.
Definition: lte-rrc-sap.h:1124
virtual void SendSystemInformation(uint16_t cellId, SystemInformation msg)=0
Send a SystemInformation message to all attached UEs during a system information acquisition procedur...
virtual void RemoveUe(uint16_t rnti)=0
Remove UE function.
virtual Ptr< Packet > EncodeHandoverCommand(RrcConnectionReconfiguration msg)=0
Encode handover command.
Service Access Point (SAP) offered by the Frequency Reuse algorithm instance to the eNodeB RRC instan...
Service Access Point (SAP) offered by the eNodeB RRC instance to the Frequency Reuse algorithm instan...
Service Access Point (SAP) offered by the handover algorithm instance to the eNodeB RRC instance.
Service Access Point (SAP) offered by the eNodeB RRC instance to the handover algorithm instance.
Service Access Point (SAP) offered by the MAC to the RLC See Femto Forum MAC Scheduler Interface Spec...
Definition: lte-mac-sap.h:36
Service Access Point (SAP) offered by the MAC to the RLC See Femto Forum MAC Scheduler Interface Spec...
Definition: lte-mac-sap.h:96
Service Access Point (SAP) offered by the PDCP entity to the RRC entity See 3GPP 36....
Definition: lte-pdcp-sap.h:36
virtual void TransmitPdcpSdu(TransmitPdcpSduParameters params)=0
Send RRC PDU parameters to the PDCP for transmission.
LTE RLC Acknowledged Mode (AM), see 3GPP TS 36.322.
Definition: lte-rlc-am.h:38
static TypeId GetTypeId()
Get the type ID.
Definition: lte-rlc-am.cc:87
This abstract base class defines the API to interact with the Radio Link Control (LTE_RLC) in LTE,...
Definition: lte-rlc.h:49
static TypeId GetTypeId()
Get the type ID.
Definition: lte-rlc.cc:197
static TypeId GetTypeId()
Get the type ID.
Definition: lte-rlc-um.cc:56
static double ConvertPdschConfigDedicated2Double(PdschConfigDedicated pdschConfigDedicated)
Convert PDSCH config dedicated function.
Definition: lte-rrc-sap.h:189
Template for the implementation of the LteEnbCphySapUser as a member of an owner class of type C to w...
Template for the implementation of the LteFfrRrcSapUser as a member of an owner class of type C to wh...
Instantiate subclasses of ns3::Object.
Ptr< Object > Create() const
Create an Object instance of the configured TypeId.
void SetTypeId(TypeId tid)
Set the TypeId of the Objects to be created by this factory.
A base class which provides memory management and object aggregation.
Definition: object.h:89
Ptr< T > GetObject() const
Get a pointer to the requested aggregated Object.
Definition: object.h:522
virtual void DoInitialize()
Initialize() implementation.
Definition: object.cc:451
AttributeValue implementation for Pointer.
Definition: pointer.h:48
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:77
static EventId Schedule(const Time &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
Definition: simulator.h:571
static Time Now()
Return the current simulation virtual time.
Definition: simulator.cc:208
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:105
a unique identifier for an interface.
Definition: type-id.h:59
@ ATTR_GET
The attribute can be read.
Definition: type-id.h:64
@ ATTR_CONSTRUCT
The attribute can be written at construction-time.
Definition: type-id.h:66
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition: type-id.cc:932
bool m_pendingStartDataRadioBearers
Pending start data radio bearers.
Definition: lte-enb-rrc.h:635
void RecvRrcConnectionReestablishmentRequest(LteRrcSap::RrcConnectionReestablishmentRequest msg)
Implement the LteEnbRrcSapProvider::RecvRrcConnectionReestablishmentRequest interface.
void InitialContextSetupRequest()
Process Initial context setup request message from the MME.
Definition: lte-enb-rrc.cc:385
void RecvUeContextRelease(EpcX2SapUser::UeContextReleaseParams params)
Take the necessary actions in response to the reception of an X2 UE CONTEXT RELEASE message.
void RecordDataRadioBearersToBeStarted()
Start all configured data radio bearers.
Definition: lte-enb-rrc.cc:522
std::map< uint8_t, Ptr< LteDataRadioBearerInfo > > m_drbMap
The DataRadioBearerMap attribute.
Definition: lte-enb-rrc.h:539
Ptr< LteSignalingRadioBearerInfo > m_srb1
The Srb1 attribute.
Definition: lte-enb-rrc.h:548
void PrepareHandover(uint16_t cellId)
Start the handover preparation and send the handover request.
Definition: lte-enb-rrc.cc:660
void SetImsi(uint64_t imsi)
Set the IMSI.
Definition: lte-enb-rrc.cc:379
void SendData(uint8_t bid, Ptr< Packet > p)
Send a data packet over the appropriate Data Radio Bearer.
Definition: lte-enb-rrc.cc:949
void SendRrcConnectionRelease()
This function acts as an interface to trigger the connection release towards eNB, EPC and UE.
EpcX2Sap::HandoverCancelParams BuildHoCancelMsg()
build handover cancel message
void CompleteSetupUe(LteEnbRrcSapProvider::CompleteSetupUeParameters params)
Implement the LteEnbRrcSapProvider::CompleteSetupUe interface.
bool m_needPhyMacConfiguration
need Phy MAC configuration
Definition: lte-enb-rrc.h:595
State
The state of the UeManager at the eNB RRC.
Definition: lte-enb-rrc.h:78
@ CONNECTION_REESTABLISHMENT
Definition: lte-enb-rrc.h:85
@ CONNECTION_RECONFIGURATION
Definition: lte-enb-rrc.h:84
LteRrcSap::RadioResourceConfigDedicated GetRadioResourceConfigForHandoverPreparationInfo()
Definition: lte-enb-rrc.cc:870
void CmacUeConfigUpdateInd(LteEnbCmacSapUser::UeConfig cmacParams)
CMAC UE config update indication function.
void RecvHandoverCancel(EpcX2SapUser::HandoverCancelParams params)
Take the necessary actions in response to the reception of an X2 UE CONTEXT RELEASE message.
void DoDispose() override
Destructor implementation.
Definition: lte-enb-rrc.cc:321
LteRrcSap::RrcConnectionReconfiguration BuildRrcConnectionReconfiguration()
EventId m_handoverJoiningTimeout
Time limit before a handover joining timeout occurs.
Definition: lte-enb-rrc.h:622
uint8_t AddDataRadioBearerInfo(Ptr< LteDataRadioBearerInfo > radioBearerInfo)
Add a new LteDataRadioBearerInfo structure to the UeManager.
uint16_t GetSrsConfigurationIndex() const
uint8_t Lcid2Bid(uint8_t lcid)
uint16_t m_rnti
The C-RNTI attribute.
Definition: lte-enb-rrc.h:553
void RecvSnStatusTransfer(EpcX2SapUser::SnStatusTransferParams params)
Take the necessary actions in response to the reception of an X2 SN STATUS TRANSFER message.
~UeManager() override
Definition: lte-enb-rrc.cc:316
uint8_t Bid2Lcid(uint8_t bid)
LteRrcSap::PhysicalConfigDedicated m_physicalConfigDedicated
physical config dedicated
Definition: lte-enb-rrc.h:566
void RecvRrcConnectionSetupCompleted(LteRrcSap::RrcConnectionSetupCompleted msg)
Implement the LteEnbRrcSapProvider::RecvRrcConnectionSetupCompleted interface.
std::list< uint8_t > m_drbsToBeStarted
DRBS to be started.
Definition: lte-enb-rrc.h:594
uint8_t m_lastAllocatedDrbid
last allocated Data Radio Bearer ID
Definition: lte-enb-rrc.h:533
uint8_t GetComponentCarrierId() const
void DoReceivePdcpSdu(LtePdcpSapUser::ReceivePdcpSduParameters params)
Receive PDCP SDU function.
EventId m_connectionRejectedTimeout
The delay before a connection rejected timeout occurs.
Definition: lte-enb-rrc.h:615
void RemoveDataRadioBearerInfo(uint8_t drbid)
remove the LteDataRadioBearerInfo corresponding to a bearer being released
void SetupDataRadioBearer(EpsBearer bearer, uint8_t bearerId, uint32_t gtpTeid, Ipv4Address transportLayerAddress)
Setup a new data radio bearer, including both the configuration within the eNB and the necessary RRC ...
Definition: lte-enb-rrc.cc:400
void RecvRrcConnectionReconfigurationCompleted(LteRrcSap::RrcConnectionReconfigurationCompleted msg)
Implement the LteEnbRrcSapProvider::RecvRrcConnectionReconfigurationCompleted interface.
TracedCallback< uint64_t, uint16_t, uint16_t, uint8_t > m_drbCreatedTrace
The DrbCreated trace source.
Definition: lte-enb-rrc.h:588
State GetState() const
uint16_t m_targetX2apId
target X2 ap ID
Definition: lte-enb-rrc.h:591
uint8_t Drbid2Bid(uint8_t drbid)
static TypeId GetTypeId()
Get the type ID.
Definition: lte-enb-rrc.cc:332
Ptr< LteSignalingRadioBearerInfo > m_srb0
The Srb0 attribute.
Definition: lte-enb-rrc.h:544
uint64_t GetImsi() const
EventId m_connectionRequestTimeout
Time limit before a connection request timeout occurs.
Definition: lte-enb-rrc.h:603
uint64_t m_imsi
International Mobile Subscriber Identity assigned to this UE.
Definition: lte-enb-rrc.h:558
uint8_t GetNewRrcTransactionIdentifier()
bool m_caSupportConfigured
Define if the Carrier Aggregation was already configure for the current UE on not.
Definition: lte-enb-rrc.h:632
uint16_t m_targetCellId
target cell ID
Definition: lte-enb-rrc.h:593
void SetSrsConfigurationIndex(uint16_t srsConfIndex)
Set the SRS configuration index and do the necessary reconfiguration.
uint16_t GetRnti() const
Ptr< LteDataRadioBearerInfo > GetDataRadioBearerInfo(uint8_t drbid)
void SendPacket(uint8_t bid, Ptr< Packet > p)
Send a data packet over the appropriate Data Radio Bearer.
Definition: lte-enb-rrc.cc:926
void SetSource(uint16_t sourceCellId, uint16_t sourceX2apId)
Set the identifiers of the source eNB for the case where a UE joins the current eNB as part of a hand...
Definition: lte-enb-rrc.cc:372
LteRrcSap::NonCriticalExtensionConfiguration BuildNonCriticalExtensionConfigurationCa()
std::list< std::pair< uint8_t, Ptr< Packet > > > m_packetBuffer
Packet buffer for when UE is doing the handover.
Definition: lte-enb-rrc.h:646
friend class LtePdcpSpecificLtePdcpSapUser< UeManager >
allow LtePdcpSpecificLtePdcpSapUser<UeManager> class friend access
Definition: lte-enb-rrc.h:70
uint8_t m_lastRrcTransactionIdentifier
last RRC transaction identifier
Definition: lte-enb-rrc.h:564
uint8_t m_componentCarrierId
ID of the primary CC for this UE.
Definition: lte-enb-rrc.h:562
State m_state
The current UeManager state.
Definition: lte-enb-rrc.h:570
void RecvMeasurementReport(LteRrcSap::MeasurementReport msg)
Implement the LteEnbRrcSapProvider::RecvMeasurementReport interface.
void DoInitialize() override
Initialize() implementation.
Definition: lte-enb-rrc.cc:167
Ptr< LteEnbRrc > m_rrc
Pointer to the parent eNodeB RRC.
Definition: lte-enb-rrc.h:568
TracedCallback< uint64_t, uint16_t, uint16_t, State, State > m_stateTransitionTrace
The StateTransition trace source.
Definition: lte-enb-rrc.h:581
bool m_pendingRrcConnectionReconfiguration
pending RRC connection reconfiguration
Definition: lte-enb-rrc.h:574
void ReleaseDataRadioBearer(uint8_t drbid)
Release a given radio bearer.
Definition: lte-enb-rrc.cc:549
void RecvRrcConnectionReestablishmentComplete(LteRrcSap::RrcConnectionReestablishmentComplete msg)
Implement the LteEnbRrcSapProvider::RecvRrcConnectionReestablishmentComplete interface.
uint8_t Bid2Drbid(uint8_t bid)
LteRrcSap::RrcConnectionReconfiguration GetRrcConnectionReconfigurationForHandover(uint8_t componentCarrierId)
Definition: lte-enb-rrc.cc:877
void StartDataRadioBearers()
Start the data radio bearers that have been previously recorded to be started using RecordDataRadioBe...
Definition: lte-enb-rrc.cc:532
void SendUeContextRelease()
send the UE CONTEXT RELEASE X2 message to the source eNB, thus successfully terminating an X2 handove...
void RecvHandoverRequestAck(EpcX2SapUser::HandoverRequestAckParams params)
take the necessary actions in response to the reception of an X2 HANDOVER REQUEST ACK message
Definition: lte-enb-rrc.cc:800
LteRrcSap::RadioResourceConfigDedicated BuildRadioResourceConfigDedicated()
void CancelPendingEvents()
Cancel all timers which are running for the UE.
uint8_t Lcid2Drbid(uint8_t lcid)
void ScheduleRrcConnectionReconfiguration()
schedule an RRC Connection Reconfiguration procedure with the UE
Definition: lte-enb-rrc.cc:627
uint16_t m_sourceCellId
source cell ID
Definition: lte-enb-rrc.h:592
void RecvHandoverPreparationFailure(uint16_t cellId)
Take the necessary actions in response to the reception of an X2 HO preparation failure message.
EpcX2Sap::HandoverPreparationFailureParams BuildHoPrepFailMsg()
build handover preparation failure message
EventId m_handoverLeavingTimeout
Time limit before a handover leaving timeout occurs.
Definition: lte-enb-rrc.h:629
uint16_t m_sourceX2apId
source X2 ap ID
Definition: lte-enb-rrc.h:590
std::vector< EpcX2Sap::ErabToBeSetupItem > GetErabList()
Definition: lte-enb-rrc.cc:995
void RecvRrcConnectionRequest(LteRrcSap::RrcConnectionRequest msg)
Implement the LteEnbRrcSapProvider::RecvRrcConnectionRequest interface.
uint8_t Drbid2Lcid(uint8_t drbid)
LtePdcpSapUser * m_drbPdcpSapUser
DRB PDCP SAP user.
Definition: lte-enb-rrc.h:572
void SwitchToState(State s)
Switch the UeManager to the given state.
void SetPdschConfigDedicated(LteRrcSap::PdschConfigDedicated pdschConfigDedicated)
Configure PdschConfigDedicated (i.e.
EventId m_connectionSetupTimeout
Time limit before a connection setup timeout occurs.
Definition: lte-enb-rrc.h:609
void RecvIdealUeContextRemoveRequest(uint16_t rnti)
Implement the LteEnbRrcSapProvider::RecvIdealUeContextRemoveRequest interface.
Definition: lte-enb-rrc.cc:608
Hold an unsigned integer type.
Definition: uinteger.h:45
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
Definition: assert.h:66
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
Definition: assert.h:86
Ptr< const AttributeAccessor > MakePointerAccessor(T1 a1)
Definition: pointer.h:259
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
Definition: fatal-error.h:179
#define NS_ABORT_MSG_IF(cond, msg)
Abnormal program termination if a condition is true, with a message.
Definition: abort.h:108
#define NS_ABORT_IF(cond)
Abnormal program termination if a condition is true.
Definition: abort.h:76
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:202
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Definition: log.h:268
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
Definition: log.h:282
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_LOG_WARN(msg)
Use NS_LOG to output a message of level LOG_WARN.
Definition: log.h:261
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
Definition: log.h:275
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition: object-base.h:46
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition: nstime.h:1319
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition: nstime.h:1331
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
Create a TraceSourceAccessor which will control access to the underlying trace source.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Ptr< const AttributeChecker > MakeBooleanChecker()
Definition: boolean.cc:124
Ptr< const AttributeAccessor > MakeIntegerAccessor(T1 a1)
Definition: integer.h:46
Ptr< const AttributeAccessor > MakeTimeAccessor(T1 a1)
Definition: nstime.h:1407
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Definition: uinteger.h:46
ObjectPtrContainerValue ObjectMapValue
ObjectMapValue is an alias for ObjectPtrContainerValue.
Definition: object-map.h:40
Ptr< const AttributeChecker > MakeEnumChecker(T v, std::string n, Ts... args)
Make an EnumChecker pre-configured with a set of allowed values by name.
Definition: enum.h:189
constexpr uint32_t MIN_NO_CC
Minimum number of carrier components allowed by 3GPP up to R13.
Definition: lte-common.h:36
constexpr uint32_t MAX_NO_CC
Maximum number of carrier components allowed by 3GPP up to R13.
Definition: lte-common.h:39
static const std::string g_ueManagerStateName[UeManager::NUM_STATES]
Map each of UE Manager states to its string representation.
Definition: lte-enb-rrc.cc:117
static const uint16_t g_srsCiLow[SRS_ENTRIES]
The lower bound (inclusive) of the SRS configuration indices (ISRS) which use the corresponding SRS p...
static const uint16_t g_srsCiHigh[SRS_ENTRIES]
The upper bound (inclusive) of the SRS configuration indices (ISRS) which use the corresponding SRS p...
static const uint8_t SRS_ENTRIES
Number of distinct SRS periodicity plus one.
static const uint16_t g_srsPeriodicity[SRS_ENTRIES]
Sounding Reference Symbol (SRS) periodicity (TSRS) in milliseconds.
Ptr< const AttributeAccessor > MakeBooleanAccessor(T1 a1)
Definition: boolean.h:81
Ptr< const AttributeAccessor > MakeObjectMapAccessor(U T::*memberVariable)
MakeAccessorHelper implementation for ObjectVector.
Definition: object-map.h:76
Ptr< const AttributeChecker > MakeTimeChecker()
Helper to make an unbounded Time checker.
Definition: nstime.h:1427
static const std::string & ToString(EpcUeNas::State s)
Definition: epc-ue-nas.cc:48
PathSwitchRequestParameters structure.
Parameters passed to DataRadioBearerSetupRequest ()
EpsBearer bearer
the characteristics of the bearer to be setup
uint16_t rnti
the RNTI identifying the UE for which the DataRadioBearer is to be created
uint32_t gtpTeid
S1-bearer GTP tunnel endpoint identifier, see 36.423 9.2.1.
Ipv4Address transportLayerAddress
IP Address of the SGW, see 36.423 9.2.1.
Parameters passed to InitialContextSetupRequest ()
PathSwitchRequestAcknowledgeParameters structure.
E-RABs admitted item as it is used in the HANDOVER REQUEST ACKNOWLEDGE message.
Definition: epc-x2-sap.h:76
uint16_t erabId
E-RAB ID.
Definition: epc-x2-sap.h:77
E-RABs to be setup item as it is used in the HANDOVER REQUEST message.
Definition: epc-x2-sap.h:60
bool dlForwarding
DL forwarding.
Definition: epc-x2-sap.h:63
Ipv4Address transportLayerAddress
transport layer address
Definition: epc-x2-sap.h:64
EpsBearer erabLevelQosParameters
E-RAB level QOS parameters.
Definition: epc-x2-sap.h:62
ErabsSubjectToStatusTransferItem structure.
Definition: epc-x2-sap.h:102
Parameters of the HANDOVER CANCEL message.
Definition: epc-x2-sap.h:345
Parameters of the HANDOVER PREPARATION FAILURE message.
Definition: epc-x2-sap.h:264
Parameters of the HANDOVER REQUEST ACKNOWLEDGE message.
Definition: epc-x2-sap.h:248
std::vector< ErabAdmittedItem > admittedBearers
admitted bearers
Definition: epc-x2-sap.h:253
uint16_t sourceCellId
source cell ID
Definition: epc-x2-sap.h:251
uint16_t newEnbUeX2apId
new ENB UE X2 AP ID
Definition: epc-x2-sap.h:250
uint16_t targetCellId
target cell ID
Definition: epc-x2-sap.h:252
uint16_t oldEnbUeX2apId
old ENB UE X2 AP ID
Definition: epc-x2-sap.h:249
Ptr< Packet > rrcContext
RRC context.
Definition: epc-x2-sap.h:255
Parameters of the HANDOVER REQUEST message.
Definition: epc-x2-sap.h:230
uint16_t oldEnbUeX2apId
old ENB UE X2 AP ID
Definition: epc-x2-sap.h:231
uint16_t sourceCellId
source cell ID
Definition: epc-x2-sap.h:233
uint16_t targetCellId
target cell ID
Definition: epc-x2-sap.h:234
uint32_t mmeUeS1apId
MME UE S1 AP ID.
Definition: epc-x2-sap.h:235
std::vector< ErabToBeSetupItem > bearers
bearers
Definition: epc-x2-sap.h:238
Parameters of the LOAD INFORMATION message.
Definition: epc-x2-sap.h:306
Parameters of the RESOURCE STATUS UPDATE message.
Definition: epc-x2-sap.h:317
Parameters of the SN STATUS TRANSFER message.
Definition: epc-x2-sap.h:278
uint16_t newEnbUeX2apId
new ENB UE X2 AP ID
Definition: epc-x2-sap.h:280
std::vector< ErabsSubjectToStatusTransferItem > erabsSubjectToStatusTransferList
ERABs subject to status transfer list.
Definition: epc-x2-sap.h:284
uint16_t oldEnbUeX2apId
old ENB UE X2 AP ID
Definition: epc-x2-sap.h:279
uint16_t targetCellId
target cell ID
Definition: epc-x2-sap.h:282
uint16_t sourceCellId
source cell ID
Definition: epc-x2-sap.h:281
Parameters of the UE CONTEXT RELEASE message.
Definition: epc-x2-sap.h:293
uint16_t newEnbUeX2apId
new ENB UE X2 AP ID
Definition: epc-x2-sap.h:295
uint16_t oldEnbUeX2apId
old ENB UE X2 AP ID
Definition: epc-x2-sap.h:294
uint16_t sourceCellId
source cell ID
Definition: epc-x2-sap.h:296
uint16_t targetCellId
target cell ID
Definition: epc-x2-sap.h:297
Parameters of the UE DATA primitive.
Definition: epc-x2-sap.h:332
uint64_t gbrUl
Guaranteed Bit Rate (bit/s) in uplink.
Definition: eps-bearer.h:43
AllocateNcRaPreambleReturnValue structure.
bool valid
true if a valid RA config was allocated, false otherwise
Logical Channel information to be passed to CmacSapProvider::ConfigureLc.
uint64_t gbrUl
guaranteed bitrate in uplink
uint8_t qci
QoS Class Identifier.
uint64_t mbrDl
maximum bitrate in downlink
uint64_t mbrUl
maximum bitrate in uplink
uint8_t lcGroup
logical channel group
uint8_t resourceType
0 if the bearer is NON-GBR, 1 if the bearer is GBR, 2 if the bearer in DC-GBR
uint64_t gbrDl
guaranteed bitrate in downlink
uint8_t lcId
logical channel identifier
uint16_t rnti
C-RNTI identifying the UE.
struct defining the RACH configuration of the MAC
Parameters for [re]configuring the UE.
uint16_t m_rnti
UE id within this cell.
uint8_t m_transmissionMode
Transmission mode [1..7] (i.e., SISO, MIMO, etc.)
Parameters for [re]configuring the UE.
uint16_t m_rnti
UE id within this cell.
uint8_t m_transmissionMode
Transmission mode [1..7] (i.e., SISO, MIMO, etc.)
X2uTeidInfo structure.
Definition: lte-enb-rrc.h:1619
CompleteSetupUeParameters structure.
Definition: lte-rrc-sap.h:1248
SetupUeParameters structure.
Definition: lte-rrc-sap.h:1128
LtePdcpSapProvider * srb1SapProvider
SRB1 SAP provider.
Definition: lte-rrc-sap.h:1130
LteRlcSapProvider * srb0SapProvider
SRB0 SAP provider.
Definition: lte-rrc-sap.h:1129
Status variables of the PDCP.
Definition: lte-pdcp.h:102
uint16_t rxSn
RX sequence number.
Definition: lte-pdcp.h:104
uint16_t txSn
TX sequence number.
Definition: lte-pdcp.h:103
Parameters for LtePdcpSapProvider::TransmitPdcpSdu.
Definition: lte-pdcp-sap.h:44
Parameters for LtePdcpSapUser::ReceivePdcpSdu.
Definition: lte-pdcp-sap.h:77
uint16_t antennaPortsCount
antenna ports count
Definition: lte-rrc-sap.h:758
uint8_t transmissionMode
transmission mode
Definition: lte-rrc-sap.h:151
RadioResourceConfigDedicated sourceRadioResourceConfig
source radio resource config
Definition: lte-rrc-sap.h:652
MasterInformationBlock sourceMasterInformationBlock
source master information block
Definition: lte-rrc-sap.h:654
uint16_t sourceUeIdentity
source UE identity
Definition: lte-rrc-sap.h:653
MeasConfig sourceMeasConfig
source measure config
Definition: lte-rrc-sap.h:651
uint32_t sourceDlCarrierFreq
source DL carrier frequency
Definition: lte-rrc-sap.h:659
SystemInformationBlockType1 sourceSystemInformationBlockType1
source system information block type 1
Definition: lte-rrc-sap.h:656
SystemInformationBlockType2 sourceSystemInformationBlockType2
source system information block type 2
Definition: lte-rrc-sap.h:658
uint16_t dlBandwidth
DL bandwidth.
Definition: lte-rrc-sap.h:580
uint16_t ulBandwidth
UL bandwidth.
Definition: lte-rrc-sap.h:581
uint32_t dlCarrierFreq
DL carrier frequency.
Definition: lte-rrc-sap.h:573
uint32_t ulCarrierFreq
UL carrier frequency.
Definition: lte-rrc-sap.h:574
uint32_t dlCarrierFreq
ARFCN - valueEUTRA.
Definition: lte-rrc-sap.h:752
uint32_t physCellId
physical cell ID
Definition: lte-rrc-sap.h:751
int8_t qRxLevMin
INTEGER (-70..-22), actual value = IE value * 2 [dBm].
Definition: lte-rrc-sap.h:81
int8_t qQualMin
INTEGER (-34..-3), actual value = IE value [dB].
Definition: lte-rrc-sap.h:82
DrbToAddMod structure.
Definition: lte-rrc-sap.h:245
uint8_t epsBearerIdentity
EPS bearer identity.
Definition: lte-rrc-sap.h:246
RlcConfig rlcConfig
RLC config.
Definition: lte-rrc-sap.h:248
uint8_t logicalChannelIdentity
logical channel identify
Definition: lte-rrc-sap.h:249
uint8_t drbIdentity
DRB identity.
Definition: lte-rrc-sap.h:247
LogicalChannelConfig logicalChannelConfig
logical channel config
Definition: lte-rrc-sap.h:250
uint32_t ulCarrierFreq
UL carrier frequency.
Definition: lte-rrc-sap.h:88
uint16_t ulBandwidth
UL bandwidth.
Definition: lte-rrc-sap.h:89
HandoverPreparationInfo structure.
Definition: lte-rrc-sap.h:942
MasterInformationBlock structure.
Definition: lte-rrc-sap.h:622
uint16_t systemFrameNumber
system frame number
Definition: lte-rrc-sap.h:624
std::list< MeasObjectToAddMod > measObjectToAddModList
measure object to add mod list
Definition: lte-rrc-sap.h:555
bool haveMeasGapConfig
have measure gap config?
Definition: lte-rrc-sap.h:562
QuantityConfig quantityConfig
quantity config
Definition: lte-rrc-sap.h:561
bool haveSmeasure
have S measure?
Definition: lte-rrc-sap.h:564
bool haveSpeedStatePars
have speed state parameters?
Definition: lte-rrc-sap.h:566
std::list< ReportConfigToAddMod > reportConfigToAddModList
report config to add mod list
Definition: lte-rrc-sap.h:557
std::list< MeasIdToAddMod > measIdToAddModList
measure ID to add mod list
Definition: lte-rrc-sap.h:559
bool haveQuantityConfig
have quantity config?
Definition: lte-rrc-sap.h:560
MeasIdToAddMod structure.
Definition: lte-rrc-sap.h:488
uint8_t measObjectId
measure object ID
Definition: lte-rrc-sap.h:490
uint8_t reportConfigId
report config ID
Definition: lte-rrc-sap.h:491
bool haveCellForWhichToReportCGI
have cell for which to report CGI?
Definition: lte-rrc-sap.h:346
uint16_t allowedMeasBandwidth
allowed measure bandwidth
Definition: lte-rrc-sap.h:338
int8_t offsetFreq
offset frequency
Definition: lte-rrc-sap.h:341
uint8_t neighCellConfig
neighbor cell config
Definition: lte-rrc-sap.h:340
bool presenceAntennaPort1
antenna port 1 present?
Definition: lte-rrc-sap.h:339
uint32_t carrierFreq
carrier frequency
Definition: lte-rrc-sap.h:337
MeasObjectToAddMod structure.
Definition: lte-rrc-sap.h:474
uint8_t measObjectId
measure object ID
Definition: lte-rrc-sap.h:475
MeasObjectEutra measObjectEutra
measure object eutra
Definition: lte-rrc-sap.h:476
uint8_t rsrqResult
the RSRQ result
Definition: lte-rrc-sap.h:675
uint8_t rsrpResult
the RSRP result
Definition: lte-rrc-sap.h:674
uint8_t measId
measure ID
Definition: lte-rrc-sap.h:718
bool haveMeasResultNeighCells
have measure result neighbor cells
Definition: lte-rrc-sap.h:720
std::list< MeasResultEutra > measResultListEutra
measure result list eutra
Definition: lte-rrc-sap.h:721
bool haveMeasResultServFreqList
has measResultServFreqList-r10
Definition: lte-rrc-sap.h:722
std::list< MeasResultServFreq > measResultServFreqList
MeasResultServFreqList-r10.
Definition: lte-rrc-sap.h:723
MeasResultPCell measResultPCell
measurement result primary cell
Definition: lte-rrc-sap.h:719
MeasurementReport structure.
Definition: lte-rrc-sap.h:948
MeasResults measResults
measure results
Definition: lte-rrc-sap.h:949
RadioResourceConfigCommon radioResourceConfigCommon
radio resource config common
Definition: lte-rrc-sap.h:600
RachConfigDedicated rachConfigDedicated
RACH config dedicated.
Definition: lte-rrc-sap.h:602
bool haveRachConfigDedicated
Have RACH config dedicated?
Definition: lte-rrc-sap.h:601
uint16_t newUeIdentity
new UE identity
Definition: lte-rrc-sap.h:599
bool haveCarrierBandwidth
have carrier bandwidth?
Definition: lte-rrc-sap.h:597
bool haveCarrierFreq
have carrier frequency?
Definition: lte-rrc-sap.h:595
CarrierBandwidthEutra carrierBandwidth
carrier bandwidth
Definition: lte-rrc-sap.h:598
CarrierFreqEutra carrierFreq
carrier frequency
Definition: lte-rrc-sap.h:596
uint16_t targetPhysCellId
target Phy cell ID
Definition: lte-rrc-sap.h:594
NonCriticalExtensionConfiguration structure.
Definition: lte-rrc-sap.h:874
std::list< uint8_t > sCellToReleaseList
SCell to release list.
Definition: lte-rrc-sap.h:876
std::list< SCellToAddMod > sCellToAddModList
SCell to add mod list.
Definition: lte-rrc-sap.h:875
AntennaInfoCommon antennaInfoCommon
2: Physical configuration, general antennaInfoCommon-r10
Definition: lte-rrc-sap.h:780
PdschConfigCommon pdschConfigCommon
4: Physical configuration, physical channels pdsch-ConfigCommon-r10
Definition: lte-rrc-sap.h:784
uint16_t dlBandwidth
1: Cell characteristics
Definition: lte-rrc-sap.h:778
int8_t referenceSignalPower
INTEGER (-60..50),.
Definition: lte-rrc-sap.h:157
int8_t pb
INTEGER (0..3),.
Definition: lte-rrc-sap.h:158
PdschConfigDedicated structure.
Definition: lte-rrc-sap.h:163
PdschConfigDedicated pdschConfigDedicated
PDSCH config dedicated.
Definition: lte-rrc-sap.h:233
bool haveAntennaInfoDedicated
have antenna info dedicated?
Definition: lte-rrc-sap.h:230
SoundingRsUlConfigDedicated soundingRsUlConfigDedicated
sounding RS UL config dedicated
Definition: lte-rrc-sap.h:229
bool haveSoundingRsUlConfigDedicated
have sounding RS UL config dedicated?
Definition: lte-rrc-sap.h:227
bool havePdschConfigDedicated
have PDSCH config dedicated?
Definition: lte-rrc-sap.h:232
AntennaInfoDedicated antennaInfo
antenna info
Definition: lte-rrc-sap.h:231
PuschConfigDedicatedSCell pushConfigDedicatedSCell
PUSCH config dedicated SCell.
Definition: lte-rrc-sap.h:836
AntennaInfoDedicated antennaInfoUl
antenna info UL
Definition: lte-rrc-sap.h:835
SoundingRsUlConfigDedicated soundingRsUlConfigDedicated
sounding RS UL config dedicated
Definition: lte-rrc-sap.h:841
PdschConfigDedicated pdschConfigDedicated
PDSCH config dedicated.
Definition: lte-rrc-sap.h:830
bool haveSoundingRsUlConfigDedicated
have sounding RS UL config dedicated?
Definition: lte-rrc-sap.h:839
bool haveUlConfiguration
have UL configuration?
Definition: lte-rrc-sap.h:833
bool haveAntennaInfoUlDedicated
have antenna info UL dedicated?
Definition: lte-rrc-sap.h:834
bool havePdschConfigDedicated
have PDSCH config dedicated?
Definition: lte-rrc-sap.h:829
bool crossCarrierSchedulingConfig
currently implemented as boolean variable --> implementing crossCarrierScheduling is out of the scope...
Definition: lte-rrc-sap.h:826
bool haveNonUlConfiguration
have non UL configuration?
Definition: lte-rrc-sap.h:823
AntennaInfoDedicated antennaInfo
antenna info dedicated
Definition: lte-rrc-sap.h:825
bool haveAntennaInfoDedicated
have antenna info dedicated?
Definition: lte-rrc-sap.h:824
UlPowerControlDedicatedSCell ulPowerControlDedicatedSCell
UL power control dedicated SCell.
Definition: lte-rrc-sap.h:838
uint32_t plmnIdentity
PLMN identity.
Definition: lte-rrc-sap.h:66
uint8_t numberOfRaPreambles
number of RA preambles
Definition: lte-rrc-sap.h:256
uint16_t nPuschIdentity
3GPP TS 36.331 v.11.10 R11 page 216
Definition: lte-rrc-sap.h:809
uint8_t filterCoefficientRSRQ
filter coefficient RSRQ
Definition: lte-rrc-sap.h:308
uint8_t filterCoefficientRSRP
filter coefficient RSRP
Definition: lte-rrc-sap.h:307
uint8_t raResponseWindowSize
RA response window size.
Definition: lte-rrc-sap.h:263
uint8_t preambleTransMax
preamble transmit maximum
Definition: lte-rrc-sap.h:262
RachConfigCommon structure.
Definition: lte-rrc-sap.h:275
TxFailParam txFailParam
txFailParams
Definition: lte-rrc-sap.h:278
PreambleInfo preambleInfo
preamble info
Definition: lte-rrc-sap.h:276
RaSupervisionInfo raSupervisionInfo
RA supervision info.
Definition: lte-rrc-sap.h:277
uint8_t raPreambleIndex
RA preamble index.
Definition: lte-rrc-sap.h:587
uint8_t raPrachMaskIndex
RA PRACH mask index.
Definition: lte-rrc-sap.h:588
RachConfigCommon rachConfigCommon
RACH config common.
Definition: lte-rrc-sap.h:284
NonUlConfiguration nonUlConfiguration
non UL configuration
Definition: lte-rrc-sap.h:848
bool haveUlConfiguration
have UL configuration
Definition: lte-rrc-sap.h:849
bool haveNonUlConfiguration
have non UL configuration?
Definition: lte-rrc-sap.h:847
UlConfiguration ulConfiguration
UL configuration.
Definition: lte-rrc-sap.h:850
RachConfigCommon rachConfigCommon
RACH config common.
Definition: lte-rrc-sap.h:290
PdschConfigCommon pdschConfigCommon
PDSCH config common.
Definition: lte-rrc-sap.h:291
RadioResourceConfigDedicated structure.
Definition: lte-rrc-sap.h:296
PhysicalConfigDedicated physicalConfigDedicated
physical config dedicated
Definition: lte-rrc-sap.h:301
std::list< uint8_t > drbToReleaseList
DRB to release list.
Definition: lte-rrc-sap.h:299
bool havePhysicalConfigDedicated
have physical config dedicated?
Definition: lte-rrc-sap.h:300
std::list< DrbToAddMod > drbToAddModList
DRB to add mod list.
Definition: lte-rrc-sap.h:298
std::list< SrbToAddMod > srbToAddModList
SRB to add mod list.
Definition: lte-rrc-sap.h:297
PhysicalConfigDedicatedSCell physicalConfigDedicatedSCell
physical config dedicated SCell
Definition: lte-rrc-sap.h:857
Specifies criteria for triggering of an E-UTRA measurement reporting event.
Definition: lte-rrc-sap.h:373
enum ns3::LteRrcSap::ReportConfigEutra::@62 eventId
Event enumeration.
@ RSRP
Reference Signal Received Power.
Definition: lte-rrc-sap.h:425
@ RSRQ
Reference Signal Received Quality.
Definition: lte-rrc-sap.h:426
@ EVENT_A2
Event A2: Serving becomes worse than absolute threshold.
Definition: lte-rrc-sap.h:385
@ EVENT_A4
Event A4: Neighbour becomes better than absolute threshold.
Definition: lte-rrc-sap.h:387
@ EVENT_A1
Event A1: Serving becomes better than absolute threshold.
Definition: lte-rrc-sap.h:384
@ EVENT_A5
Event A5: PCell becomes worse than absolute threshold1 AND Neighbour becomes better than another abso...
Definition: lte-rrc-sap.h:388
ThresholdEutra threshold2
Threshold for event A5.
Definition: lte-rrc-sap.h:394
enum ns3::LteRrcSap::ReportConfigEutra::@63 triggerQuantity
Trigger type enumeration.
@ BOTH
Both the RSRP and RSRQ quantities are to be included in the measurement report.
Definition: lte-rrc-sap.h:434
ThresholdEutra threshold1
Threshold for event A1, A2, A4, and A5.
Definition: lte-rrc-sap.h:393
enum ns3::LteRrcSap::ReportConfigEutra::@64 reportQuantity
Report type enumeration.
ReportConfigToAddMod structure.
Definition: lte-rrc-sap.h:481
uint8_t reportConfigId
report config ID
Definition: lte-rrc-sap.h:482
ReportConfigEutra reportConfigEutra
report config eutra
Definition: lte-rrc-sap.h:483
RrcConnectionReconfigurationCompleted structure.
Definition: lte-rrc-sap.h:898
RrcConnectionReconfiguration structure.
Definition: lte-rrc-sap.h:881
uint8_t rrcTransactionIdentifier
RRC transaction identifier.
Definition: lte-rrc-sap.h:882
bool haveMobilityControlInfo
have mobility control info
Definition: lte-rrc-sap.h:885
NonCriticalExtensionConfiguration nonCriticalExtension
3GPP TS 36.331 v.11.10 R11 Sec.
Definition: lte-rrc-sap.h:893
bool haveNonCriticalExtension
have critical extension?
Definition: lte-rrc-sap.h:890
MobilityControlInfo mobilityControlInfo
mobility control info
Definition: lte-rrc-sap.h:886
RrcConnectionReestablishmentComplete structure.
Definition: lte-rrc-sap.h:919
RrcConnectionReestablishment structure.
Definition: lte-rrc-sap.h:911
RadioResourceConfigDedicated radioResourceConfigDedicated
radio resource config dedicated
Definition: lte-rrc-sap.h:914
uint8_t rrcTransactionIdentifier
RRC transaction identifier.
Definition: lte-rrc-sap.h:912
RrcConnectionReestablishmentRequest structure.
Definition: lte-rrc-sap.h:904
RrcConnectionReject structure.
Definition: lte-rrc-sap.h:936
RrcConnectionRelease structure.
Definition: lte-rrc-sap.h:930
uint8_t rrcTransactionIdentifier
RRC transaction identifier.
Definition: lte-rrc-sap.h:931
RrcConnectionRequest structure.
Definition: lte-rrc-sap.h:730
RrcConnectionSetupCompleted structure.
Definition: lte-rrc-sap.h:744
RrcConnectionSetup structure.
Definition: lte-rrc-sap.h:736
uint8_t rrcTransactionIdentifier
RRC transaction identifier.
Definition: lte-rrc-sap.h:737
RadioResourceConfigDedicated radioResourceConfigDedicated
radio resource config dedicated
Definition: lte-rrc-sap.h:739
SCellToAddMod structure.
Definition: lte-rrc-sap.h:862
RadioResourceConfigDedicatedSCell radioResourceConfigDedicatedSCell
radio resource config dedicated SCell
Definition: lte-rrc-sap.h:869
uint32_t sCellIndex
SCell index.
Definition: lte-rrc-sap.h:863
bool haveRadioResourceConfigDedicatedSCell
have radio resource config dedicated SCell?
Definition: lte-rrc-sap.h:867
CellIdentification cellIdentification
cell identification
Definition: lte-rrc-sap.h:864
RadioResourceConfigCommonSCell radioResourceConfigCommonSCell
radio resource config common SCell
Definition: lte-rrc-sap.h:866
uint8_t srsSubframeConfig
SRS subframe config.
Definition: lte-rrc-sap.h:129
uint16_t srsBandwidthConfig
SRS bandwidth config.
Definition: lte-rrc-sap.h:128
uint16_t srsConfigIndex
SRS config index.
Definition: lte-rrc-sap.h:145
SrbToAddMod structure.
Definition: lte-rrc-sap.h:238
LogicalChannelConfig logicalChannelConfig
logical channel config
Definition: lte-rrc-sap.h:240
uint8_t srbIdentity
SB identity.
Definition: lte-rrc-sap.h:239
SystemInformationBlockType1 structure.
Definition: lte-rrc-sap.h:629
CellSelectionInfo cellSelectionInfo
cell selection info
Definition: lte-rrc-sap.h:631
CellAccessRelatedInfo cellAccessRelatedInfo
cell access related info
Definition: lte-rrc-sap.h:630
RadioResourceConfigCommonSib radioResourceConfigCommon
radio resource config common
Definition: lte-rrc-sap.h:637
SystemInformation structure.
Definition: lte-rrc-sap.h:643
SystemInformationBlockType2 sib2
SIB2.
Definition: lte-rrc-sap.h:645
@ THRESHOLD_RSRP
RSRP is used for the threshold.
Definition: lte-rrc-sap.h:364
@ THRESHOLD_RSRQ
RSRQ is used for the threshold.
Definition: lte-rrc-sap.h:365
enum ns3::LteRrcSap::ThresholdEutra::@60 choice
Threshold enumeration.
uint8_t connEstFailCount
Number of times that the UE detects T300 expiry on the same cell.
Definition: lte-rrc-sap.h:269
UlPowerControlCommonSCell ulPowerControlCommonSCell
3GPP TS 36.331 v.11.10 R11 pag.223
Definition: lte-rrc-sap.h:793
FreqInfo ulFreqInfo
UL frequency info.
Definition: lte-rrc-sap.h:792
SoundingRsUlConfigCommon soundingRsUlConfigCommon
sounding RS UL config common
Definition: lte-rrc-sap.h:794
PrachConfigSCell prachConfigSCell
PRACH config SCell.
Definition: lte-rrc-sap.h:795
uint16_t pSrsOffset
3GPP TS 36.331 v.11.10 R11 page 234
Definition: lte-rrc-sap.h:816