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 * SPDX-License-Identifier: GPL-2.0-only
6 *
7 * Authors:
8 * Nicola Baldo <nbaldo@cttc.es>
9 * Marco Miozzo <mmiozzo@cttc.es>
10 * Manuel Requena <manuel.requena@cttc.es>
11 * Modified by:
12 * Danilo Abrignani <danilo.abrignani@unibo.it> (Carrier Aggregation - GSoC 2015),
13 * Biljana Bojovic <biljana.bojovic@cttc.es> (Carrier Aggregation)
14 * Vignesh Babu <ns3-dev@esk.fraunhofer.de> (RLF extensions)
15 */
16
17#include "lte-enb-rrc.h"
18
20#include "eps-bearer-tag.h"
21#include "lte-pdcp.h"
23#include "lte-rlc-am.h"
24#include "lte-rlc-tm.h"
25#include "lte-rlc-um.h"
26#include "lte-rlc.h"
27
28#include <ns3/abort.h>
29#include <ns3/fatal-error.h>
30#include <ns3/log.h>
31#include <ns3/object-factory.h>
32#include <ns3/object-map.h>
33#include <ns3/packet.h>
34#include <ns3/pointer.h>
35#include <ns3/simulator.h>
36
37namespace ns3
38{
39
40NS_LOG_COMPONENT_DEFINE("LteEnbRrc");
41
42///////////////////////////////////////////
43// CMAC SAP forwarder
44///////////////////////////////////////////
45
46/**
47 * @brief Class for forwarding CMAC SAP User functions.
48 */
50{
51 public:
52 /**
53 * Constructor
54 *
55 * @param rrc ENB RRC
56 * @param componentCarrierId
57 */
58 EnbRrcMemberLteEnbCmacSapUser(LteEnbRrc* rrc, uint8_t componentCarrierId);
59
60 uint16_t AllocateTemporaryCellRnti() override;
61 void NotifyLcConfigResult(uint16_t rnti, uint8_t lcid, bool success) override;
62 void RrcConfigurationUpdateInd(UeConfig params) override;
63 bool IsRandomAccessCompleted(uint16_t rnti) override;
64
65 private:
66 LteEnbRrc* m_rrc; ///< the RRC
67 uint8_t m_componentCarrierId; ///< Component carrier ID
68};
69
71 uint8_t componentCarrierId)
72 : m_rrc(rrc),
73 m_componentCarrierId{componentCarrierId}
74{
75}
76
77uint16_t
82
83void
84EnbRrcMemberLteEnbCmacSapUser::NotifyLcConfigResult(uint16_t rnti, uint8_t lcid, bool success)
85{
86 m_rrc->DoNotifyLcConfigResult(rnti, lcid, success);
87}
88
89void
94
95bool
100
101///////////////////////////////////////////
102// UeManager
103///////////////////////////////////////////
104
106
108{
109 NS_FATAL_ERROR("this constructor is not expected to be used");
110}
111
112UeManager::UeManager(Ptr<LteEnbRrc> rrc, uint16_t rnti, State s, uint8_t componentCarrierId)
113 : m_lastAllocatedDrbid(0),
114 m_rnti(rnti),
115 m_imsi(0),
116 m_componentCarrierId(componentCarrierId),
117 m_lastRrcTransactionIdentifier(0),
118 m_rrc(rrc),
119 m_state(s),
120 m_pendingRrcConnectionReconfiguration(false),
121 m_sourceX2apId(0),
122 m_sourceCellId(0),
123 m_needPhyMacConfiguration(false),
124 m_caSupportConfigured(false),
125 m_pendingStartDataRadioBearers(false)
126{
127 NS_LOG_FUNCTION(this);
128}
129
130void
132{
133 NS_LOG_FUNCTION(this);
135
137 m_physicalConfigDedicated.antennaInfo.transmissionMode = m_rrc->m_defaultTransmissionMode;
140 m_rrc->GetNewSrsConfigurationIndex();
146
147 for (uint16_t i = 0; i < m_rrc->m_numberOfComponentCarriers; i++)
148 {
149 m_rrc->m_cmacSapProvider.at(i)->AddUe(m_rnti);
150 m_rrc->m_cphySapProvider.at(i)->AddUe(m_rnti);
151 }
152
153 // setup the eNB side of SRB0
154 {
155 uint8_t lcid = 0;
156
157 Ptr<LteRlc> rlc = CreateObject<LteRlcTm>()->GetObject<LteRlc>();
158 rlc->SetLteMacSapProvider(m_rrc->m_macSapProvider);
159 rlc->SetRnti(m_rnti);
160 rlc->SetLcId(lcid);
161
163 m_srb0->m_rlc = rlc;
164 m_srb0->m_srbIdentity = 0;
165 // no need to store logicalChannelConfig as SRB0 is pre-configured
166
168 lcinfo.rnti = m_rnti;
169 lcinfo.lcId = lcid;
170 // Initialise the rest of lcinfo structure even if CCCH (LCID 0) is pre-configured, and only
171 // m_rnti and lcid will be used from passed lcinfo structure. See FF LTE MAC Scheduler
172 // Iinterface Specification v1.11, 4.3.4 logicalChannelConfigListElement
173 lcinfo.lcGroup = 0;
174 lcinfo.qci = 0;
175 lcinfo.resourceType = 0;
176 lcinfo.mbrUl = 0;
177 lcinfo.mbrDl = 0;
178 lcinfo.gbrUl = 0;
179 lcinfo.gbrDl = 0;
180
181 // MacSapUserForRlc in the ComponentCarrierManager MacSapUser
182 LteMacSapUser* lteMacSapUser =
183 m_rrc->m_ccmRrcSapProvider->ConfigureSignalBearer(lcinfo, rlc->GetLteMacSapUser());
184 // Signal Channel are only on Primary Carrier
185 m_rrc->m_cmacSapProvider.at(m_componentCarrierId)->AddLc(lcinfo, lteMacSapUser);
186 m_rrc->m_ccmRrcSapProvider->AddLc(lcinfo, lteMacSapUser);
187 }
188
189 // setup the eNB side of SRB1; the UE side will be set up upon RRC connection establishment
190 {
191 uint8_t lcid = 1;
192
193 Ptr<LteRlc> rlc = CreateObject<LteRlcAm>()->GetObject<LteRlc>();
194 rlc->SetLteMacSapProvider(m_rrc->m_macSapProvider);
195 rlc->SetRnti(m_rnti);
196 rlc->SetLcId(lcid);
197
199 pdcp->SetRnti(m_rnti);
200 pdcp->SetLcId(lcid);
201 pdcp->SetLtePdcpSapUser(m_drbPdcpSapUser);
202 pdcp->SetLteRlcSapProvider(rlc->GetLteRlcSapProvider());
203 rlc->SetLteRlcSapUser(pdcp->GetLteRlcSapUser());
204
206 m_srb1->m_rlc = rlc;
207 m_srb1->m_pdcp = pdcp;
208 m_srb1->m_srbIdentity = 1;
209 m_srb1->m_logicalChannelConfig.priority = 1;
210 m_srb1->m_logicalChannelConfig.prioritizedBitRateKbps = 100;
211 m_srb1->m_logicalChannelConfig.bucketSizeDurationMs = 100;
212 m_srb1->m_logicalChannelConfig.logicalChannelGroup = 0;
213
215 lcinfo.rnti = m_rnti;
216 lcinfo.lcId = lcid;
217 lcinfo.lcGroup = 0; // all SRBs always mapped to LCG 0
218 lcinfo.qci =
219 EpsBearer::GBR_CONV_VOICE; // not sure why the FF API requires a CQI even for SRBs...
220 lcinfo.resourceType = 1; // GBR resource type
221 lcinfo.mbrUl = 1e6;
222 lcinfo.mbrDl = 1e6;
223 lcinfo.gbrUl = 1e4;
224 lcinfo.gbrDl = 1e4;
225 // MacSapUserForRlc in the ComponentCarrierManager MacSapUser
226 LteMacSapUser* MacSapUserForRlc =
227 m_rrc->m_ccmRrcSapProvider->ConfigureSignalBearer(lcinfo, rlc->GetLteMacSapUser());
228 // Signal Channel are only on Primary Carrier
229 m_rrc->m_cmacSapProvider.at(m_componentCarrierId)->AddLc(lcinfo, MacSapUserForRlc);
230 m_rrc->m_ccmRrcSapProvider->AddLc(lcinfo, MacSapUserForRlc);
231 }
232
234 ueParams.srb0SapProvider = m_srb0->m_rlc->GetLteRlcSapProvider();
235 ueParams.srb1SapProvider = m_srb1->m_pdcp->GetLtePdcpSapProvider();
236 m_rrc->m_rrcSapUser->SetupUe(m_rnti, ueParams);
237
238 // configure MAC (and scheduler)
240 req.m_rnti = m_rnti;
242
243 // configure PHY
244 for (uint16_t i = 0; i < m_rrc->m_numberOfComponentCarriers; i++)
245 {
246 m_rrc->m_cmacSapProvider.at(i)->UeUpdateConfigurationReq(req);
247 m_rrc->m_cphySapProvider.at(i)->SetTransmissionMode(
248 m_rnti,
250 m_rrc->m_cphySapProvider.at(i)->SetSrsConfigurationIndex(
251 m_rnti,
253 }
254 // schedule this UeManager instance to be deleted if the UE does not give any sign of life
255 // within a reasonable time
256 Time maxConnectionDelay;
257 switch (m_state)
258 {
260 m_connectionRequestTimeout = Simulator::Schedule(m_rrc->m_connectionRequestTimeoutDuration,
262 m_rrc,
263 m_rnti);
264 break;
265
266 case HANDOVER_JOINING:
267 m_handoverJoiningTimeout = Simulator::Schedule(m_rrc->m_handoverJoiningTimeoutDuration,
269 m_rrc,
270 m_rnti);
271 break;
272
273 default:
274 NS_FATAL_ERROR("unexpected state " << m_state);
275 break;
276 }
277 m_caSupportConfigured = false;
278}
279
283
284void
286{
287 delete m_drbPdcpSapUser;
288 // delete eventual X2-U TEIDs
289 for (auto it = m_drbMap.begin(); it != m_drbMap.end(); ++it)
290 {
291 m_rrc->m_x2uTeidInfoMap.erase(it->second->m_gtpTeid);
292 }
293}
294
295TypeId
297{
298 static TypeId tid =
299 TypeId("ns3::UeManager")
300 .SetParent<Object>()
301 .AddConstructor<UeManager>()
302 .AddAttribute("DataRadioBearerMap",
303 "List of UE DataRadioBearerInfo by DRBID.",
307 .AddAttribute("Srb0",
308 "SignalingRadioBearerInfo for SRB0",
309 PointerValue(),
312 .AddAttribute("Srb1",
313 "SignalingRadioBearerInfo for SRB1",
314 PointerValue(),
317 .AddAttribute("C-RNTI",
318 "Cell Radio Network Temporary Identifier",
319 TypeId::ATTR_GET, // read-only attribute
320 UintegerValue(0), // unused, read-only attribute
323 .AddTraceSource("StateTransition",
324 "fired upon every UE state transition seen by the "
325 "UeManager at the eNB RRC",
327 "ns3::UeManager::StateTracedCallback")
328 .AddTraceSource("DrbCreated",
329 "trace fired after DRB is created",
331 "ns3::UeManager::ImsiCidRntiLcIdTracedCallback");
332 return tid;
333}
334
335void
336UeManager::SetSource(uint16_t sourceCellId, uint16_t sourceX2apId)
337{
338 m_sourceX2apId = sourceX2apId;
339 m_sourceCellId = sourceCellId;
340}
341
342void
343UeManager::SetImsi(uint64_t imsi)
344{
345 m_imsi = imsi;
346}
347
348void
350{
351 NS_LOG_FUNCTION(this << m_rnti);
352
353 if (m_state == ATTACH_REQUEST)
354 {
356 }
357 else
358 {
359 NS_FATAL_ERROR("method unexpected in state " << m_state);
360 }
361}
362
363void
365 uint8_t bearerId,
366 uint32_t gtpTeid,
367 Ipv4Address transportLayerAddress)
368{
370
372 uint8_t drbid = AddDataRadioBearerInfo(drbInfo);
373 uint8_t lcid = Drbid2Lcid(drbid);
374 uint8_t bid = Drbid2Bid(drbid);
375 NS_ASSERT_MSG(bearerId == 0 || bid == bearerId,
376 "bearer ID mismatch (" << (uint32_t)bid << " != " << (uint32_t)bearerId
377 << ", the assumption that ID are allocated in the same "
378 "way by MME and RRC is not valid any more");
379 drbInfo->m_epsBearer = bearer;
380 drbInfo->m_epsBearerIdentity = bid;
381 drbInfo->m_drbIdentity = drbid;
382 drbInfo->m_logicalChannelIdentity = lcid;
383 drbInfo->m_gtpTeid = gtpTeid;
384 drbInfo->m_transportLayerAddress = transportLayerAddress;
385
387 {
388 // setup TEIDs for receiving data eventually forwarded over X2-U
389 LteEnbRrc::X2uTeidInfo x2uTeidInfo;
390 x2uTeidInfo.rnti = m_rnti;
391 x2uTeidInfo.drbid = drbid;
392 auto ret = m_rrc->m_x2uTeidInfoMap.insert(
393 std::pair<uint32_t, LteEnbRrc::X2uTeidInfo>(gtpTeid, x2uTeidInfo));
394 NS_ASSERT_MSG(ret.second == true, "overwriting a pre-existing entry in m_x2uTeidInfoMap");
395 }
396
397 TypeId rlcTypeId = m_rrc->GetRlcType(bearer);
398
399 ObjectFactory rlcObjectFactory;
400 rlcObjectFactory.SetTypeId(rlcTypeId);
401 Ptr<LteRlc> rlc = rlcObjectFactory.Create()->GetObject<LteRlc>();
402 rlc->SetLteMacSapProvider(m_rrc->m_macSapProvider);
403 rlc->SetRnti(m_rnti);
404 rlc->SetPacketDelayBudgetMs(bearer.GetPacketDelayBudgetMs());
405
406 drbInfo->m_rlc = rlc;
407
408 rlc->SetLcId(lcid);
409
410 // we need PDCP only for real RLC, i.e., RLC/UM or RLC/AM
411 // if we are using RLC/SM we don't care of anything above RLC
412 if (rlcTypeId != LteRlcSm::GetTypeId())
413 {
415 pdcp->SetRnti(m_rnti);
416 pdcp->SetLcId(lcid);
417 pdcp->SetLtePdcpSapUser(m_drbPdcpSapUser);
418 pdcp->SetLteRlcSapProvider(rlc->GetLteRlcSapProvider());
419 rlc->SetLteRlcSapUser(pdcp->GetLteRlcSapUser());
420 drbInfo->m_pdcp = pdcp;
421 }
422
423 m_drbCreatedTrace(m_imsi, m_rrc->ComponentCarrierToCellId(m_componentCarrierId), m_rnti, lcid);
424
425 std::vector<LteCcmRrcSapProvider::LcsConfig> lcOnCcMapping =
426 m_rrc->m_ccmRrcSapProvider->SetupDataRadioBearer(bearer,
427 bearerId,
428 m_rnti,
429 lcid,
430 m_rrc->GetLogicalChannelGroup(bearer),
431 rlc->GetLteMacSapUser());
432 // LteEnbCmacSapProvider::LcInfo lcinfo;
433 // lcinfo.rnti = m_rnti;
434 // lcinfo.lcId = lcid;
435 // lcinfo.lcGroup = m_rrc->GetLogicalChannelGroup (bearer);
436 // lcinfo.qci = bearer.qci;
437 // lcinfo.resourceType = bearer.GetResourceType();
438 // lcinfo.mbrUl = bearer.gbrQosInfo.mbrUl;
439 // lcinfo.mbrDl = bearer.gbrQosInfo.mbrDl;
440 // lcinfo.gbrUl = bearer.gbrQosInfo.gbrUl;
441 // lcinfo.gbrDl = bearer.gbrQosInfo.gbrDl;
442 // use a for cycle to send the AddLc to the appropriate Mac Sap
443 // if the sap is not initialized the appropriated method has to be called
444 auto itLcOnCcMapping = lcOnCcMapping.begin();
445 NS_ASSERT_MSG(itLcOnCcMapping != lcOnCcMapping.end(), "Problem");
446 for (itLcOnCcMapping = lcOnCcMapping.begin(); itLcOnCcMapping != lcOnCcMapping.end();
447 ++itLcOnCcMapping)
448 {
449 NS_LOG_DEBUG(this << " RNTI " << itLcOnCcMapping->lc.rnti << "Lcid "
450 << (uint16_t)itLcOnCcMapping->lc.lcId << " lcGroup "
451 << (uint16_t)itLcOnCcMapping->lc.lcGroup << " ComponentCarrierId "
452 << itLcOnCcMapping->componentCarrierId);
453 uint8_t index = itLcOnCcMapping->componentCarrierId;
454 LteEnbCmacSapProvider::LcInfo lcinfo = itLcOnCcMapping->lc;
455 LteMacSapUser* msu = itLcOnCcMapping->msu;
456 m_rrc->m_cmacSapProvider.at(index)->AddLc(lcinfo, msu);
457 m_rrc->m_ccmRrcSapProvider->AddLc(lcinfo, msu);
458 }
459
460 if (rlcTypeId == LteRlcAm::GetTypeId())
461 {
462 drbInfo->m_rlcConfig.choice = LteRrcSap::RlcConfig::AM;
463 }
464 else
465 {
466 drbInfo->m_rlcConfig.choice = LteRrcSap::RlcConfig::UM_BI_DIRECTIONAL;
467 }
468
469 drbInfo->m_logicalChannelIdentity = lcid;
470 drbInfo->m_logicalChannelConfig.priority = m_rrc->GetLogicalChannelPriority(bearer);
471 drbInfo->m_logicalChannelConfig.logicalChannelGroup = m_rrc->GetLogicalChannelGroup(bearer);
472 if (bearer.GetResourceType() > 0) // 1, 2 for GBR and DC-GBR
473 {
474 drbInfo->m_logicalChannelConfig.prioritizedBitRateKbps = bearer.gbrQosInfo.gbrUl;
475 }
476 else
477 {
478 drbInfo->m_logicalChannelConfig.prioritizedBitRateKbps = 0;
479 }
480 drbInfo->m_logicalChannelConfig.bucketSizeDurationMs = 1000;
481
483}
484
485void
487{
489 for (auto it = m_drbMap.begin(); it != m_drbMap.end(); ++it)
490 {
491 m_drbsToBeStarted.push_back(it->first);
492 }
493}
494
495void
497{
499 for (auto drbIdIt = m_drbsToBeStarted.begin(); drbIdIt != m_drbsToBeStarted.end(); ++drbIdIt)
500 {
501 auto drbIt = m_drbMap.find(*drbIdIt);
502 NS_ASSERT(drbIt != m_drbMap.end());
503 drbIt->second->m_rlc->Initialize();
504 if (drbIt->second->m_pdcp)
505 {
506 drbIt->second->m_pdcp->Initialize();
507 }
508 }
509 m_drbsToBeStarted.clear();
510}
511
512void
514{
515 NS_LOG_FUNCTION(this << (uint32_t)m_rnti << (uint32_t)drbid);
516 uint8_t lcid = Drbid2Lcid(drbid);
517 auto it = m_drbMap.find(drbid);
518 NS_ASSERT_MSG(it != m_drbMap.end(),
519 "request to remove radio bearer with unknown drbid " << drbid);
520
521 // first delete eventual X2-U TEIDs
522 m_rrc->m_x2uTeidInfoMap.erase(it->second->m_gtpTeid);
523
524 m_drbMap.erase(it);
525 std::vector<uint8_t> ccToRelease =
526 m_rrc->m_ccmRrcSapProvider->ReleaseDataRadioBearer(m_rnti, lcid);
527 auto itCcToRelease = ccToRelease.begin();
528 NS_ASSERT_MSG(itCcToRelease != ccToRelease.end(),
529 "request to remove radio bearer with unknown drbid (ComponentCarrierManager)");
530 for (itCcToRelease = ccToRelease.begin(); itCcToRelease != ccToRelease.end(); ++itCcToRelease)
531 {
532 m_rrc->m_cmacSapProvider.at(*itCcToRelease)->ReleaseLc(m_rnti, lcid);
533 }
535 rrcd.havePhysicalConfigDedicated = false;
536 rrcd.drbToReleaseList.push_back(drbid);
537 // populating RadioResourceConfigDedicated information element as per 3GPP TS 36.331
538 // version 9.2.0
539 rrcd.havePhysicalConfigDedicated = true;
541
542 // populating RRCConnectionReconfiguration message as per 3GPP TS 36.331 version 9.2.0 Release 9
544 msg.haveMeasConfig = false;
545 msg.haveMobilityControlInfo = false;
546 msg.radioResourceConfigDedicated = rrcd;
547 msg.haveRadioResourceConfigDedicated = true;
548 // ToDo: Resend in any case this configuration
549 // needs to be initialized
550 msg.haveNonCriticalExtension = false;
551 // RRC Connection Reconfiguration towards UE
552 m_rrc->m_rrcSapUser->SendRrcConnectionReconfiguration(m_rnti, msg);
553}
554
555void
556LteEnbRrc::DoSendReleaseDataRadioBearer(uint64_t imsi, uint16_t rnti, uint8_t bearerId)
557{
558 NS_LOG_FUNCTION(this << imsi << rnti << (uint16_t)bearerId);
559
560 // check if the RNTI to be removed is not stale
561 if (HasUeManager(rnti))
562 {
563 Ptr<UeManager> ueManager = GetUeManager(rnti);
564 // Bearer de-activation towards UE
565 ueManager->ReleaseDataRadioBearer(bearerId);
566 // Bearer de-activation indication towards epc-enb application
567 m_s1SapProvider->DoSendReleaseIndication(imsi, rnti, bearerId);
568 }
569}
570
571void
573{
574 NS_LOG_FUNCTION(this << m_rnti);
575
576 // release the bearer info for the UE at SGW/PGW
577 if (m_rrc->m_s1SapProvider != nullptr) // if EPC is enabled
578 {
579 for (const auto& it : m_drbMap)
580 {
581 NS_LOG_DEBUG("Sending release of bearer id : "
582 << (uint16_t)(it.first)
583 << "LCID : " << (uint16_t)(it.second->m_logicalChannelIdentity));
584 // Bearer de-activation indication towards epc-enb application
585 m_rrc->m_s1SapProvider->DoSendReleaseIndication(GetImsi(), rnti, it.first);
586 }
587 }
588}
589
590void
592{
593 NS_LOG_FUNCTION(this);
594 switch (m_state)
595 {
597 case CONNECTION_SETUP:
598 case ATTACH_REQUEST:
602 case HANDOVER_JOINING:
603 case HANDOVER_LEAVING:
604 // a previous reconfiguration still ongoing, we need to wait for it to be finished
606 break;
607
608 case CONNECTED_NORMALLY: {
611 m_rrc->m_rrcSapUser->SendRrcConnectionReconfiguration(m_rnti, msg);
614 }
615 break;
616
617 default:
618 NS_FATAL_ERROR("method unexpected in state " << m_state);
619 break;
620 }
621}
622
623void
625{
626 NS_LOG_FUNCTION(this << cellId);
627 switch (m_state)
628 {
629 case CONNECTED_NORMALLY: {
630 m_targetCellId = cellId;
631
632 auto sourceComponentCarrier = DynamicCast<ComponentCarrierEnb>(
633 m_rrc->m_componentCarrierPhyConf.at(m_componentCarrierId));
634 NS_ASSERT(m_targetCellId != sourceComponentCarrier->GetCellId());
635
636 if (m_rrc->HasCellId(cellId))
637 {
638 // Intra-eNB handover
639 NS_LOG_DEBUG("Intra-eNB handover for cellId " << cellId);
640 uint8_t componentCarrierId = m_rrc->CellToComponentCarrierId(cellId);
641 uint16_t rnti = m_rrc->AddUe(UeManager::HANDOVER_JOINING, componentCarrierId);
643 m_rrc->m_cmacSapProvider.at(componentCarrierId)->AllocateNcRaPreamble(rnti);
644 if (!anrcrv.valid)
645 {
646 NS_LOG_INFO(this << " failed to allocate a preamble for non-contention based RA => "
647 "cannot perform HO");
648 NS_FATAL_ERROR("should trigger HO Preparation Failure, but it is not implemented");
649 return;
650 }
651
652 Ptr<UeManager> ueManager = m_rrc->GetUeManager(rnti);
653 ueManager->SetSource(sourceComponentCarrier->GetCellId(), m_rnti);
654 ueManager->SetImsi(m_imsi);
655
656 // Setup data radio bearers
657 for (auto& it : m_drbMap)
658 {
659 ueManager->SetupDataRadioBearer(it.second->m_epsBearer,
660 it.second->m_epsBearerIdentity,
661 it.second->m_gtpTeid,
662 it.second->m_transportLayerAddress);
663 }
664
667
668 handoverCommand.mobilityControlInfo.newUeIdentity = rnti;
669 handoverCommand.mobilityControlInfo.haveRachConfigDedicated = true;
671 anrcrv.raPreambleId;
673 anrcrv.raPrachMaskIndex;
674
676 m_rrc->m_cmacSapProvider.at(componentCarrierId)->GetRachConfig();
678 .preambleInfo.numberOfRaPreambles = rc.numberOfRaPreambles;
680 .raSupervisionInfo.preambleTransMax = rc.preambleTransMax;
682 .raSupervisionInfo.raResponseWindowSize = rc.raResponseWindowSize;
683
684 m_rrc->m_rrcSapUser->SendRrcConnectionReconfiguration(m_rnti, handoverCommand);
685
686 // We skip handover preparation
688 m_handoverLeavingTimeout = Simulator::Schedule(m_rrc->m_handoverLeavingTimeoutDuration,
690 m_rrc,
691 m_rnti);
692 m_rrc->m_handoverStartTrace(m_imsi,
693 sourceComponentCarrier->GetCellId(),
694 m_rnti,
695 handoverCommand.mobilityControlInfo.targetPhysCellId);
696 }
697 else
698 {
699 // Inter-eNB aka X2 handover
700 NS_LOG_DEBUG("Inter-eNB handover (i.e., X2) for cellId " << cellId);
702 params.oldEnbUeX2apId = m_rnti;
704 params.sourceCellId = m_rrc->ComponentCarrierToCellId(m_componentCarrierId);
705 params.targetCellId = cellId;
706 params.mmeUeS1apId = m_imsi;
707 params.ueAggregateMaxBitRateDownlink = 200 * 1000;
708 params.ueAggregateMaxBitRateUplink = 100 * 1000;
709 params.bearers = GetErabList();
710
713 hpi.asConfig.sourceDlCarrierFreq = sourceComponentCarrier->GetDlEarfcn();
714 hpi.asConfig.sourceMeasConfig = m_rrc->m_ueMeasConfig;
718 sourceComponentCarrier->GetDlBandwidth();
722 .cellAccessRelatedInfo.plmnIdentityInfo.plmnIdentity;
724 m_rrc->ComponentCarrierToCellId(m_componentCarrierId);
726 m_rrc->m_sib1.at(m_componentCarrierId).cellAccessRelatedInfo.csgIndication;
728 m_rrc->m_sib1.at(m_componentCarrierId).cellAccessRelatedInfo.csgIdentity;
730 m_rrc->m_cmacSapProvider.at(m_componentCarrierId)->GetRachConfig();
732 .rachConfigCommon.preambleInfo.numberOfRaPreambles = rc.numberOfRaPreambles;
738 .rachConfigCommon.txFailParam.connEstFailCount = rc.connEstFailCount;
740 sourceComponentCarrier->GetUlEarfcn();
742 sourceComponentCarrier->GetUlBandwidth();
743 params.rrcContext = m_rrc->m_rrcSapUser->EncodeHandoverPreparationInformation(hpi);
744
745 NS_LOG_LOGIC("oldEnbUeX2apId = " << params.oldEnbUeX2apId);
746 NS_LOG_LOGIC("sourceCellId = " << params.sourceCellId);
747 NS_LOG_LOGIC("targetCellId = " << params.targetCellId);
748 NS_LOG_LOGIC("mmeUeS1apId = " << params.mmeUeS1apId);
749 NS_LOG_LOGIC("rrcContext = " << params.rrcContext);
750
751 m_rrc->m_x2SapProvider->SendHandoverRequest(params);
753 }
754 }
755 break;
756
757 default:
758 NS_FATAL_ERROR("method unexpected in state " << m_state);
759 break;
760 }
761}
762
763void
765{
766 NS_LOG_FUNCTION(this);
767
768 NS_ASSERT_MSG(params.notAdmittedBearers.empty(),
769 "not admission of some bearers upon handover is not supported");
770 NS_ASSERT_MSG(params.admittedBearers.size() == m_drbMap.size(),
771 "not enough bearers in admittedBearers");
772
773 // note: the Handover command from the target eNB to the source eNB
774 // is expected to be sent transparently to the UE; however, here we
775 // decode the message and eventually re-encode it. This way we can
776 // support both a real RRC protocol implementation and an ideal one
777 // without actual RRC protocol encoding.
778
779 Ptr<Packet> encodedHandoverCommand = params.rrcContext;
781 m_rrc->m_rrcSapUser->DecodeHandoverCommand(encodedHandoverCommand);
782 if (handoverCommand.haveNonCriticalExtension)
783 {
784 // Total number of component carriers =
785 // handoverCommand.nonCriticalExtension.sCellToAddModList.size() + 1 (Primary carrier)
786 if (handoverCommand.nonCriticalExtension.sCellToAddModList.size() + 1 !=
787 m_rrc->m_numberOfComponentCarriers)
788 {
789 // Currently handover is only possible if source and target eNBs have equal number of
790 // component carriers
791 NS_FATAL_ERROR("The source and target eNBs have unequal number of component carriers. "
792 "Target eNB CCs = "
793 << handoverCommand.nonCriticalExtension.sCellToAddModList.size() + 1
794 << " Source eNB CCs = " << m_rrc->m_numberOfComponentCarriers);
795 }
796 }
797 m_rrc->m_rrcSapUser->SendRrcConnectionReconfiguration(m_rnti, handoverCommand);
799 m_handoverLeavingTimeout = Simulator::Schedule(m_rrc->m_handoverLeavingTimeoutDuration,
801 m_rrc,
802 m_rnti);
803 NS_ASSERT(handoverCommand.haveMobilityControlInfo);
804 m_rrc->m_handoverStartTrace(m_imsi,
805 m_rrc->ComponentCarrierToCellId(m_componentCarrierId),
806 m_rnti,
807 handoverCommand.mobilityControlInfo.targetPhysCellId);
808
809 // Set the target cell ID and the RNTI so that handover cancel message can be sent if required
810 m_targetX2apId = params.newEnbUeX2apId;
811 m_targetCellId = params.targetCellId;
812
814 sst.oldEnbUeX2apId = params.oldEnbUeX2apId;
815 sst.newEnbUeX2apId = params.newEnbUeX2apId;
816 sst.sourceCellId = params.sourceCellId;
817 sst.targetCellId = params.targetCellId;
818 for (auto drbIt = m_drbMap.begin(); drbIt != m_drbMap.end(); ++drbIt)
819 {
820 // SN status transfer is only for AM RLC
821 if (drbIt->second->m_rlc->GetObject<LteRlcAm>())
822 {
823 LtePdcp::Status status = drbIt->second->m_pdcp->GetStatus();
825 i.dlPdcpSn = status.txSn;
826 i.ulPdcpSn = status.rxSn;
827 sst.erabsSubjectToStatusTransferList.push_back(i);
828 }
829 }
830 m_rrc->m_x2SapProvider->SendSnStatusTransfer(sst);
831}
832
839
842{
843 NS_LOG_FUNCTION(this);
844
846
847 auto targetComponentCarrier =
848 DynamicCast<ComponentCarrierEnb>(m_rrc->m_componentCarrierPhyConf.at(componentCarrierId));
849 result.haveMobilityControlInfo = true;
850 result.mobilityControlInfo.targetPhysCellId = targetComponentCarrier->GetCellId();
852 result.mobilityControlInfo.carrierFreq.dlCarrierFreq = targetComponentCarrier->GetDlEarfcn();
853 result.mobilityControlInfo.carrierFreq.ulCarrierFreq = targetComponentCarrier->GetUlEarfcn();
856 targetComponentCarrier->GetDlBandwidth();
858 targetComponentCarrier->GetUlBandwidth();
859
860 if (m_caSupportConfigured && m_rrc->m_numberOfComponentCarriers > 1)
861 {
862 // Release sCells
863 result.haveNonCriticalExtension = true;
864
865 for (auto& it : m_rrc->m_componentCarrierPhyConf)
866 {
867 uint8_t ccId = it.first;
868
869 if (ccId == m_componentCarrierId)
870 {
871 // Skip primary CC.
872 continue;
873 }
874 else if (ccId < m_componentCarrierId)
875 {
876 // Shift all IDs below PCC forward so PCC can use CC ID 1.
877 result.nonCriticalExtension.sCellToReleaseList.push_back(ccId + 1);
878 }
879 }
880 }
881 else
882 {
883 result.haveNonCriticalExtension = false;
884 }
885
886 return result;
887}
888
889void
891{
892 NS_LOG_FUNCTION(this << p << (uint16_t)bid);
894 params.pdcpSdu = p;
895 params.rnti = m_rnti;
896 params.lcid = Bid2Lcid(bid);
897 uint8_t drbid = Bid2Drbid(bid);
898 // Transmit PDCP sdu only if DRB ID found in drbMap
899 auto it = m_drbMap.find(drbid);
900 if (it != m_drbMap.end())
901 {
903 if (bearerInfo)
904 {
905 NS_LOG_INFO("Send packet to PDCP layer");
906 LtePdcpSapProvider* pdcpSapProvider = bearerInfo->m_pdcp->GetLtePdcpSapProvider();
907 pdcpSapProvider->TransmitPdcpSdu(params);
908 }
909 }
910}
911
912void
914{
915 NS_LOG_FUNCTION(this << p << (uint16_t)bid);
916 switch (m_state)
917 {
919 case CONNECTION_SETUP:
920 NS_LOG_WARN("not connected, discarding packet");
921 return;
922
928 NS_LOG_INFO("queueing data on PDCP for transmission over the air");
929 SendPacket(bid, p);
930 }
931 break;
932
933 case HANDOVER_JOINING: {
934 // Buffer data until RRC Connection Reconfiguration Complete message is received
935 NS_LOG_INFO("buffering data");
936 m_packetBuffer.emplace_back(bid, p);
937 }
938 break;
939
940 case HANDOVER_LEAVING: {
941 NS_LOG_INFO("forwarding data to target eNB over X2-U");
942 uint8_t drbid = Bid2Drbid(bid);
944 params.sourceCellId = m_rrc->ComponentCarrierToCellId(m_componentCarrierId);
945 params.targetCellId = m_targetCellId;
946 params.gtpTeid = GetDataRadioBearerInfo(drbid)->m_gtpTeid;
947 params.ueData = p;
948 m_rrc->m_x2SapProvider->SendUeData(params);
949 }
950 break;
951
952 default:
953 NS_FATAL_ERROR("method unexpected in state " << m_state);
954 break;
955 }
956}
957
958std::vector<EpcX2Sap::ErabToBeSetupItem>
960{
961 NS_LOG_FUNCTION(this);
962 std::vector<EpcX2Sap::ErabToBeSetupItem> ret;
963 for (auto it = m_drbMap.begin(); it != m_drbMap.end(); ++it)
964 {
966 etbsi.erabId = it->second->m_epsBearerIdentity;
967 etbsi.erabLevelQosParameters = it->second->m_epsBearer;
968 etbsi.dlForwarding = false;
969 etbsi.transportLayerAddress = it->second->m_transportLayerAddress;
970 etbsi.gtpTeid = it->second->m_gtpTeid;
971 ret.push_back(etbsi);
972 }
973 return ret;
974}
975
976void
978{
979 NS_LOG_FUNCTION(this);
980 switch (m_state)
981 {
983 NS_LOG_INFO("Send UE CONTEXT RELEASE from target eNB to source eNB");
985 ueCtxReleaseParams.oldEnbUeX2apId = m_sourceX2apId;
986 ueCtxReleaseParams.newEnbUeX2apId = m_rnti;
987 ueCtxReleaseParams.sourceCellId = m_sourceCellId;
988 ueCtxReleaseParams.targetCellId = m_targetCellId;
989 if (!m_rrc->HasCellId(m_sourceCellId))
990 {
991 m_rrc->m_x2SapProvider->SendUeContextRelease(ueCtxReleaseParams);
992 }
993 else
994 {
995 NS_LOG_INFO("Not sending UE CONTEXT RELEASE because handover is internal");
996 m_rrc->DoRecvUeContextRelease(ueCtxReleaseParams);
997 }
999 m_rrc->m_handoverEndOkTrace(m_imsi,
1000 m_rrc->ComponentCarrierToCellId(m_componentCarrierId),
1001 m_rnti);
1002 break;
1003
1004 default:
1005 NS_FATAL_ERROR("method unexpected in state " << m_state);
1006 break;
1007 }
1008}
1009
1010void
1012{
1013 NS_LOG_FUNCTION(this << cellId);
1014 switch (m_state)
1015 {
1017 NS_ASSERT(cellId == m_targetCellId);
1018 NS_LOG_INFO("target eNB sent HO preparation failure, aborting HO");
1020 break;
1021 case HANDOVER_LEAVING: // case added to tackle HO leaving timer expiration
1022 NS_ASSERT(cellId == m_targetCellId);
1023 NS_LOG_INFO("target eNB sent HO preparation failure, aborting HO");
1026 break;
1027
1028 default:
1029 NS_FATAL_ERROR("method unexpected in state " << m_state);
1030 break;
1031 }
1032}
1033
1034void
1036{
1037 NS_LOG_FUNCTION(this);
1038 for (auto erabIt = params.erabsSubjectToStatusTransferList.begin();
1039 erabIt != params.erabsSubjectToStatusTransferList.end();
1040 ++erabIt)
1041 {
1042 // LtePdcp::Status status;
1043 // status.txSn = erabIt->dlPdcpSn;
1044 // status.rxSn = erabIt->ulPdcpSn;
1045 // uint8_t drbId = Bid2Drbid (erabIt->erabId);
1046 // auto drbIt = m_drbMap.find (drbId);
1047 // NS_ASSERT_MSG (drbIt != m_drbMap.end (), "could not find DRBID " << (uint32_t) drbId);
1048 // drbIt->second->m_pdcp->SetStatus (status);
1049 }
1050}
1051
1052void
1059
1060void
1067
1068void
1070{
1071 // TODO implement in the 3gpp way, see Section 5.3.8 of 3GPP TS 36.331.
1073 // De-activation towards UE, it will deactivate all bearers
1076 m_rrc->m_rrcSapUser->SendRrcConnectionRelease(m_rnti, msg);
1077
1078 /**
1079 * Bearer de-activation indication towards epc-enb application
1080 * and removal of UE context at the eNodeB
1081 *
1082 */
1083 m_rrc->DoRecvIdealUeContextRemoveRequest(m_rnti);
1084}
1085
1086// methods forwarded from RRC SAP
1087
1088void
1090{
1091 NS_LOG_FUNCTION(this);
1092 m_srb0->m_rlc->SetLteRlcSapUser(params.srb0SapUser);
1093 m_srb1->m_pdcp->SetLtePdcpSapUser(params.srb1SapUser);
1094}
1095
1096void
1098{
1099 NS_LOG_FUNCTION(this);
1100 switch (m_state)
1101 {
1102 case INITIAL_RANDOM_ACCESS: {
1104
1105 if (m_rrc->m_admitRrcConnectionRequest)
1106 {
1107 m_imsi = msg.ueIdentity;
1108
1109 // send RRC CONNECTION SETUP to UE
1113 m_rrc->m_rrcSapUser->SendRrcConnectionSetup(m_rnti, msg2);
1114
1116 m_connectionSetupTimeout = Simulator::Schedule(m_rrc->m_connectionSetupTimeoutDuration,
1118 m_rrc,
1119 m_rnti);
1121 }
1122 else
1123 {
1124 NS_LOG_INFO("rejecting connection request for RNTI " << m_rnti);
1125
1126 // send RRC CONNECTION REJECT to UE
1128 rejectMsg.waitTime = 3;
1129 m_rrc->m_rrcSapUser->SendRrcConnectionReject(m_rnti, rejectMsg);
1130
1132 Simulator::Schedule(m_rrc->m_connectionRejectedTimeoutDuration,
1134 m_rrc,
1135 m_rnti);
1137 }
1138 }
1139 break;
1140
1141 default:
1142 NS_FATAL_ERROR("method unexpected in state " << m_state);
1143 break;
1144 }
1145}
1146
1147void
1149{
1150 NS_LOG_FUNCTION(this);
1151 switch (m_state)
1152 {
1153 case CONNECTION_SETUP:
1155 if (!m_caSupportConfigured && m_rrc->m_numberOfComponentCarriers > 1)
1156 {
1157 m_pendingRrcConnectionReconfiguration = true; // Force Reconfiguration
1159 }
1160
1161 if (m_rrc->m_s1SapProvider != nullptr)
1162 {
1163 m_rrc->m_s1SapProvider->InitialUeMessage(m_imsi, m_rnti);
1165 }
1166 else
1167 {
1169 }
1170 m_rrc->m_connectionEstablishedTrace(m_imsi,
1171 m_rrc->ComponentCarrierToCellId(m_componentCarrierId),
1172 m_rnti);
1173 break;
1174
1175 default:
1176 NS_FATAL_ERROR("method unexpected in state " << m_state);
1177 break;
1178 }
1179}
1180
1181void
1184{
1185 NS_LOG_FUNCTION(this);
1186 switch (m_state)
1187 {
1191 {
1192 // configure MAC (and scheduler)
1194 req.m_rnti = m_rnti;
1196 for (uint16_t i = 0; i < m_rrc->m_numberOfComponentCarriers; i++)
1197 {
1198 m_rrc->m_cmacSapProvider.at(i)->UeUpdateConfigurationReq(req);
1199
1200 // configure PHY
1201 m_rrc->m_cphySapProvider.at(i)->SetTransmissionMode(req.m_rnti,
1202 req.m_transmissionMode);
1205 m_rrc->m_cphySapProvider.at(i)->SetPa(m_rnti, paDouble);
1206 }
1207
1209 }
1211 m_rrc->m_connectionReconfigurationTrace(
1212 m_imsi,
1213 m_rrc->ComponentCarrierToCellId(m_componentCarrierId),
1214 m_rnti);
1215 break;
1216
1217 // This case is added to NS-3 in order to handle bearer de-activation scenario for CONNECTED
1218 // state UE
1219 case CONNECTED_NORMALLY:
1220 NS_LOG_INFO("ignoring RecvRrcConnectionReconfigurationCompleted in state " << m_state);
1221 break;
1222
1223 case HANDOVER_LEAVING:
1224 NS_LOG_INFO("ignoring RecvRrcConnectionReconfigurationCompleted in state " << m_state);
1225 break;
1226
1227 case HANDOVER_JOINING: {
1229
1230 while (!m_packetBuffer.empty())
1231 {
1232 NS_LOG_LOGIC("dequeueing data from buffer");
1233 std::pair<uint8_t, Ptr<Packet>> bidPacket = m_packetBuffer.front();
1234 uint8_t bid = bidPacket.first;
1235 Ptr<Packet> p = bidPacket.second;
1236
1237 NS_LOG_LOGIC("queueing data on PDCP for transmission over the air");
1238 SendPacket(bid, p);
1239
1240 m_packetBuffer.pop_front();
1241 }
1242
1243 NS_LOG_INFO("Send PATH SWITCH REQUEST to the MME");
1245 params.rnti = m_rnti;
1246 params.cellId = m_rrc->ComponentCarrierToCellId(m_componentCarrierId);
1247 params.mmeUeS1Id = m_imsi;
1249 for (auto it = m_drbMap.begin(); it != m_drbMap.end(); ++it)
1250 {
1252 b.epsBearerId = it->second->m_epsBearerIdentity;
1253 b.teid = it->second->m_gtpTeid;
1254 params.bearersToBeSwitched.push_back(b);
1255 }
1256 m_rrc->m_s1SapProvider->PathSwitchRequest(params);
1257 }
1258 break;
1259
1260 default:
1261 NS_FATAL_ERROR("method unexpected in state " << m_state);
1262 break;
1263 }
1264}
1265
1266void
1269{
1270 NS_LOG_FUNCTION(this);
1271 switch (m_state)
1272 {
1273 case CONNECTED_NORMALLY:
1274 break;
1275
1276 case HANDOVER_LEAVING:
1278 break;
1279
1280 default:
1281 NS_FATAL_ERROR("method unexpected in state " << m_state);
1282 break;
1283 }
1284
1288 m_rrc->m_rrcSapUser->SendRrcConnectionReestablishment(m_rnti, msg2);
1290}
1291
1292void
1299
1300void
1302{
1303 uint8_t measId = msg.measResults.measId;
1304 NS_LOG_FUNCTION(this << (uint16_t)measId);
1306 "measId " << (uint16_t)measId << " haveMeasResultNeighCells "
1307 << msg.measResults.haveMeasResultNeighCells << " measResultListEutra "
1308 << msg.measResults.measResultListEutra.size() << " haveMeasResultServFreqList "
1309 << msg.measResults.haveMeasResultServFreqList << " measResultServFreqList "
1310 << msg.measResults.measResultServFreqList.size());
1311 NS_LOG_LOGIC("serving cellId "
1312 << m_rrc->ComponentCarrierToCellId(m_componentCarrierId) << " RSRP "
1313 << (uint16_t)msg.measResults.measResultPCell.rsrpResult << " RSRQ "
1314 << (uint16_t)msg.measResults.measResultPCell.rsrqResult);
1315
1316 for (auto it = msg.measResults.measResultListEutra.begin();
1317 it != msg.measResults.measResultListEutra.end();
1318 ++it)
1319 {
1320 NS_LOG_LOGIC("neighbour cellId " << it->physCellId << " RSRP "
1321 << (it->haveRsrpResult ? (uint16_t)it->rsrpResult : 255)
1322 << " RSRQ "
1323 << (it->haveRsrqResult ? (uint16_t)it->rsrqResult : 255));
1324 }
1325
1326 if ((m_rrc->m_handoverManagementSapProvider != nullptr) &&
1327 (m_rrc->m_handoverMeasIds.find(measId) != m_rrc->m_handoverMeasIds.end()))
1328 {
1329 // this measurement was requested by the handover algorithm
1330 m_rrc->m_handoverManagementSapProvider->ReportUeMeas(m_rnti, msg.measResults);
1331 }
1332
1333 if ((m_rrc->m_ccmRrcSapProvider != nullptr) &&
1334 (m_rrc->m_componentCarrierMeasIds.find(measId) != m_rrc->m_componentCarrierMeasIds.end()))
1335 {
1336 // this measurement was requested by the handover algorithm
1337 m_rrc->m_ccmRrcSapProvider->ReportUeMeas(m_rnti, msg.measResults);
1338 }
1339
1340 if ((m_rrc->m_anrSapProvider != nullptr) &&
1341 (m_rrc->m_anrMeasIds.find(measId) != m_rrc->m_anrMeasIds.end()))
1342 {
1343 // this measurement was requested by the ANR function
1344 m_rrc->m_anrSapProvider->ReportUeMeas(msg.measResults);
1345 }
1346
1347 if ((!m_rrc->m_ffrRrcSapProvider.empty()) &&
1348 (m_rrc->m_ffrMeasIds.find(measId) != m_rrc->m_ffrMeasIds.end()))
1349 {
1350 // this measurement was requested by the FFR function
1351 m_rrc->m_ffrRrcSapProvider.at(0)->ReportUeMeas(m_rnti, msg.measResults);
1352 }
1354 {
1355 for (const auto& it : msg.measResults.measResultServFreqList)
1356 {
1357 /// ToDo: implement on Ffr algorithm the code to properly parsing the new measResults
1358 /// message format alternatively it is needed to 'repack' properly the measResults
1359 /// message before sending to Ffr
1360 m_rrc->m_ffrRrcSapProvider.at(it.servFreqId)->ReportUeMeas(m_rnti, msg.measResults);
1361 }
1362 }
1363
1364 /// Report any measurements to ComponentCarrierManager, so it can react to any change or
1365 /// activate the SCC
1366 m_rrc->m_ccmRrcSapProvider->ReportUeMeas(m_rnti, msg.measResults);
1367 // fire a trace source
1368 m_rrc->m_recvMeasurementReportTrace(m_imsi,
1369 m_rrc->ComponentCarrierToCellId(m_componentCarrierId),
1370 m_rnti,
1371 msg);
1372
1373} // end of UeManager::RecvMeasurementReport
1374
1375// methods forwarded from CMAC SAP
1376
1377void
1379{
1380 NS_LOG_FUNCTION(this << m_rnti);
1381 // at this stage used only by the scheduler for updating txMode
1382
1384
1386
1387 // reconfigure the UE RRC
1389}
1390
1391// methods forwarded from PDCP SAP
1392
1393void
1395{
1396 NS_LOG_FUNCTION(this);
1397 if (params.lcid > 2)
1398 {
1399 // data radio bearer
1400 EpsBearerTag tag;
1401 tag.SetRnti(params.rnti);
1402 tag.SetBid(Lcid2Bid(params.lcid));
1403 params.pdcpSdu->AddPacketTag(tag);
1404 m_rrc->m_forwardUpCallback(params.pdcpSdu);
1405 }
1406}
1407
1408uint16_t
1410{
1411 return m_rnti;
1412}
1413
1414uint64_t
1416{
1417 return m_imsi;
1418}
1419
1420uint8_t
1425
1426uint16_t
1431
1432void
1434{
1435 NS_LOG_FUNCTION(this);
1437 for (uint16_t i = 0; i < m_rrc->m_numberOfComponentCarriers; i++)
1438 {
1439 m_rrc->m_cphySapProvider.at(i)->SetSrsConfigurationIndex(m_rnti, srsConfIndex);
1440 }
1441 switch (m_state)
1442 {
1444 // do nothing, srs conf index will be correctly enforced upon
1445 // RRC connection establishment
1446 break;
1447
1448 default:
1450 break;
1451 }
1452}
1453
1456{
1457 return m_state;
1458}
1459
1460void
1462{
1463 NS_LOG_FUNCTION(this);
1464 m_physicalConfigDedicated.pdschConfigDedicated = pdschConfigDedicated;
1465
1467
1468 // reconfigure the UE RRC
1470}
1471
1472void
1482
1485{
1486 NS_LOG_FUNCTION(this);
1488 res.oldEnbUeX2apId = m_sourceX2apId;
1489 res.sourceCellId = m_sourceCellId;
1490 res.targetCellId = m_rrc->ComponentCarrierToCellId(m_componentCarrierId);
1491 res.cause = 0;
1492 res.criticalityDiagnostics = 0;
1493
1494 return res;
1495}
1496
1499{
1500 NS_LOG_FUNCTION(this);
1502 res.oldEnbUeX2apId = m_rnti; // source cell rnti
1503 res.newEnbUeX2apId = m_targetX2apId;
1504 res.sourceCellId = m_rrc->ComponentCarrierToCellId(m_componentCarrierId);
1505 res.targetCellId = m_targetCellId;
1506 res.cause = 0;
1507
1508 return res;
1509}
1510
1511uint8_t
1513{
1514 NS_LOG_FUNCTION(this);
1515 const uint8_t MAX_DRB_ID = 32;
1516 for (int drbid = (m_lastAllocatedDrbid + 1) % MAX_DRB_ID; drbid != m_lastAllocatedDrbid;
1517 drbid = (drbid + 1) % MAX_DRB_ID)
1518 {
1519 if (drbid != 0) // 0 is not allowed
1520 {
1521 if (m_drbMap.find(drbid) == m_drbMap.end())
1522 {
1523 m_drbMap.insert(std::pair<uint8_t, Ptr<LteDataRadioBearerInfo>>(drbid, drbInfo));
1524 drbInfo->m_drbIdentity = drbid;
1525 m_lastAllocatedDrbid = drbid;
1526 return drbid;
1527 }
1528 }
1529 }
1530 NS_FATAL_ERROR("no more data radio bearer ids available");
1531 return 0;
1532}
1533
1536{
1537 NS_LOG_FUNCTION(this << (uint32_t)drbid);
1538 NS_ASSERT(0 != drbid);
1539 auto it = m_drbMap.find(drbid);
1540 NS_ABORT_IF(it == m_drbMap.end());
1541 return it->second;
1542}
1543
1544void
1546{
1547 NS_LOG_FUNCTION(this << (uint32_t)drbid);
1548 auto it = m_drbMap.find(drbid);
1549 NS_ASSERT_MSG(it != m_drbMap.end(),
1550 "request to remove radio bearer with unknown drbid " << drbid);
1551 m_drbMap.erase(it);
1552}
1553
1556{
1557 NS_LOG_FUNCTION(this);
1560 msg.haveRadioResourceConfigDedicated = true;
1561 msg.radioResourceConfigDedicated = BuildRadioResourceConfigDedicated();
1562 msg.haveMobilityControlInfo = false;
1563 msg.haveMeasConfig = true;
1564 msg.measConfig = m_rrc->m_ueMeasConfig;
1565 if (!m_caSupportConfigured && m_rrc->m_numberOfComponentCarriers > 1)
1566 {
1567 m_caSupportConfigured = true;
1568 NS_LOG_FUNCTION(this << "CA not configured. Configure now!");
1569 msg.haveNonCriticalExtension = true;
1570 msg.nonCriticalExtension = BuildNonCriticalExtensionConfigurationCa();
1571 NS_LOG_FUNCTION(this << " haveNonCriticalExtension " << msg.haveNonCriticalExtension);
1572 }
1573 else
1574 {
1575 msg.haveNonCriticalExtension = false;
1576 }
1577
1578 return msg;
1579}
1580
1583{
1584 NS_LOG_FUNCTION(this);
1586
1587 if (m_srb1)
1588 {
1590 stam.srbIdentity = m_srb1->m_srbIdentity;
1591 stam.logicalChannelConfig = m_srb1->m_logicalChannelConfig;
1592 rrcd.srbToAddModList.push_back(stam);
1593 }
1594
1595 for (auto it = m_drbMap.begin(); it != m_drbMap.end(); ++it)
1596 {
1598 dtam.epsBearerIdentity = it->second->m_epsBearerIdentity;
1599 dtam.drbIdentity = it->second->m_drbIdentity;
1600 dtam.rlcConfig = it->second->m_rlcConfig;
1601 dtam.logicalChannelIdentity = it->second->m_logicalChannelIdentity;
1602 dtam.logicalChannelConfig = it->second->m_logicalChannelConfig;
1603 rrcd.drbToAddModList.push_back(dtam);
1604 }
1605
1606 rrcd.havePhysicalConfigDedicated = true;
1608 return rrcd;
1609}
1610
1611uint8_t
1619
1620uint8_t
1622{
1623 NS_ASSERT(lcid > 2);
1624 return lcid - 2;
1625}
1626
1627uint8_t
1629{
1630 return drbid + 2;
1631}
1632
1633uint8_t
1635{
1636 NS_ASSERT(lcid > 2);
1637 return lcid - 2;
1638}
1639
1640uint8_t
1642{
1643 return bid + 2;
1644}
1645
1646uint8_t
1648{
1649 return drbid;
1650}
1651
1652uint8_t
1654{
1655 return bid;
1656}
1657
1658void
1660{
1661 NS_LOG_FUNCTION(this << newState);
1662 State oldState = m_state;
1663 m_state = newState;
1664 NS_LOG_INFO(this << " IMSI " << m_imsi << " RNTI " << m_rnti << " UeManager " << oldState
1665 << " --> " << newState);
1667 m_rrc->ComponentCarrierToCellId(m_componentCarrierId),
1668 m_rnti,
1669 oldState,
1670 newState);
1671
1672 switch (newState)
1673 {
1675 case HANDOVER_JOINING:
1676 NS_FATAL_ERROR("cannot switch to an initial state");
1677 break;
1678
1679 case CONNECTION_SETUP:
1680 case ATTACH_REQUEST:
1681 break;
1682
1683 case CONNECTED_NORMALLY: {
1685 {
1687 }
1689 {
1691 }
1692 }
1693 break;
1694
1697 case HANDOVER_LEAVING:
1698 default:
1699 break;
1700 }
1701}
1702
1705{
1706 NS_LOG_FUNCTION(this);
1708
1709 for (auto& it : m_rrc->m_componentCarrierPhyConf)
1710 {
1711 uint8_t ccId = it.first;
1712
1713 if (ccId == m_componentCarrierId)
1714 {
1715 // Skip primary CC.
1716 continue;
1717 }
1718 else if (ccId < m_componentCarrierId)
1719 {
1720 // Shift all IDs below PCC forward so PCC can use CC ID 1.
1721 ccId++;
1722 }
1723
1724 Ptr<ComponentCarrierBaseStation> eNbCcm = it.second;
1725 LteRrcSap::SCellToAddMod component;
1726 component.sCellIndex = ccId;
1727 component.cellIdentification.physCellId = eNbCcm->GetCellId();
1728 component.cellIdentification.dlCarrierFreq = eNbCcm->GetDlEarfcn();
1731 eNbCcm->GetDlBandwidth();
1733 .antennaPortsCount = 0;
1735 .referenceSignalPower = m_rrc->m_cphySapProvider.at(0)->GetReferenceSignalPower();
1739 eNbCcm->GetUlEarfcn();
1741 eNbCcm->GetUlBandwidth();
1743 0;
1744 // component.radioResourceConfigCommonSCell.ulConfiguration.soundingRsUlConfigCommon.type =
1745 // LteRrcSap::SoundingRsUlConfigDedicated::SETUP;
1747 .srsBandwidthConfig = 0;
1749 .srsSubframeConfig = 0;
1751
1754 .haveNonUlConfiguration = true;
1758 .transmissionMode = m_rrc->m_defaultTransmissionMode;
1766 .haveUlConfiguration = true;
1770 .transmissionMode = m_rrc->m_defaultTransmissionMode;
1783
1784 ncec.sCellToAddModList.push_back(component);
1785 }
1786
1787 return ncec;
1788}
1789
1790///////////////////////////////////////////
1791// eNB RRC methods
1792///////////////////////////////////////////
1793
1795
1797 : m_x2SapProvider(nullptr),
1798 m_cmacSapProvider(0),
1799 m_handoverManagementSapProvider(nullptr),
1800 m_ccmRrcSapProvider(nullptr),
1801 m_anrSapProvider(nullptr),
1802 m_ffrRrcSapProvider(0),
1803 m_rrcSapUser(nullptr),
1804 m_macSapProvider(nullptr),
1805 m_s1SapProvider(nullptr),
1806 m_cphySapProvider(0),
1807 m_configured(false),
1808 m_lastAllocatedRnti(0),
1809 m_srsCurrentPeriodicityId(0),
1810 m_lastAllocatedConfigurationIndex(0),
1811 m_reconfigureUes(false),
1812 m_numberOfComponentCarriers(0),
1813 m_carriersConfigured(false)
1814{
1815 NS_LOG_FUNCTION(this);
1816 m_cmacSapUser.push_back(new EnbRrcMemberLteEnbCmacSapUser(this, 0));
1825}
1826
1827void
1829{
1830 NS_ASSERT_MSG(!m_carriersConfigured, "Secondary carriers can be configured only once.");
1831 m_componentCarrierPhyConf = ccPhyConf;
1833 " Number of component carriers "
1834 "are not equal to the number of he component carrier configuration provided");
1835
1836 for (uint16_t i = 1; i < m_numberOfComponentCarriers; i++)
1837 {
1839 m_cmacSapUser.push_back(new EnbRrcMemberLteEnbCmacSapUser(this, i));
1841 }
1842 m_carriersConfigured = true;
1844}
1845
1847{
1848 NS_LOG_FUNCTION(this);
1849}
1850
1851void
1853{
1854 NS_LOG_FUNCTION(this);
1855 for (uint16_t i = 0; i < m_numberOfComponentCarriers; i++)
1856 {
1857 delete m_cphySapUser[i];
1858 delete m_cmacSapUser[i];
1859 delete m_ffrRrcSapUser[i];
1860 }
1861 // delete m_cphySapUser;
1862 m_cphySapUser.erase(m_cphySapUser.begin(), m_cphySapUser.end());
1863 m_cphySapUser.clear();
1864 // delete m_cmacSapUser;
1865 m_cmacSapUser.erase(m_cmacSapUser.begin(), m_cmacSapUser.end());
1866 m_cmacSapUser.clear();
1867 // delete m_ffrRrcSapUser;
1868 m_ffrRrcSapUser.erase(m_ffrRrcSapUser.begin(), m_ffrRrcSapUser.end());
1869 m_ffrRrcSapUser.clear();
1870 m_ueMap.clear();
1872 delete m_ccmRrcSapUser;
1873 delete m_anrSapUser;
1874 delete m_rrcSapProvider;
1875 delete m_x2SapUser;
1876 delete m_s1SapUser;
1877}
1878
1879TypeId
1881{
1882 static TypeId tid =
1883 TypeId("ns3::LteEnbRrc")
1884 .SetParent<Object>()
1885 .SetGroupName("Lte")
1886 .AddConstructor<LteEnbRrc>()
1887 .AddAttribute("UeMap",
1888 "List of UeManager by C-RNTI.",
1892 .AddAttribute("DefaultTransmissionMode",
1893 "The default UEs' transmission mode (0: SISO)",
1894 UintegerValue(0), // default tx-mode
1897 .AddAttribute(
1898 "EpsBearerToRlcMapping",
1899 "Specify which type of RLC will be used for each type of EPS bearer.",
1903 "RlcSmAlways",
1905 "RlcUmAlways",
1907 "RlcAmAlways",
1908 PER_BASED,
1909 "PacketErrorRateBased"))
1910 .AddAttribute("SystemInformationPeriodicity",
1911 "The interval for sending system information (Time value)",
1915
1916 // SRS related attributes
1917 .AddAttribute(
1918 "SrsPeriodicity",
1919 "The SRS periodicity in milliseconds",
1920 UintegerValue(40),
1923
1924 // Timeout related attributes
1925 .AddAttribute("ConnectionRequestTimeoutDuration",
1926 "After a RA attempt, if no RRC CONNECTION REQUEST is "
1927 "received before this time, the UE context is destroyed. "
1928 "Must account for reception of RAR and transmission of "
1929 "RRC CONNECTION REQUEST over UL GRANT. The value of this"
1930 "timer should not be greater than T300 timer at UE RRC",
1934 .AddAttribute("ConnectionSetupTimeoutDuration",
1935 "After accepting connection request, if no RRC CONNECTION "
1936 "SETUP COMPLETE is received before this time, the UE "
1937 "context is destroyed. Must account for the UE's reception "
1938 "of RRC CONNECTION SETUP and transmission of RRC CONNECTION "
1939 "SETUP COMPLETE.",
1940 TimeValue(MilliSeconds(150)),
1943 .AddAttribute("ConnectionRejectedTimeoutDuration",
1944 "Time to wait between sending a RRC CONNECTION REJECT and "
1945 "destroying the UE context",
1949 .AddAttribute("HandoverJoiningTimeoutDuration",
1950 "After accepting a handover request, if no RRC CONNECTION "
1951 "RECONFIGURATION COMPLETE is received before this time, the "
1952 "UE context is destroyed. Must account for reception of "
1953 "X2 HO REQ ACK by source eNB, transmission of the Handover "
1954 "Command, non-contention-based random access and reception "
1955 "of the RRC CONNECTION RECONFIGURATION COMPLETE message.",
1956 TimeValue(MilliSeconds(200)),
1959 .AddAttribute("HandoverLeavingTimeoutDuration",
1960 "After issuing a Handover Command, if neither RRC "
1961 "CONNECTION RE-ESTABLISHMENT nor X2 UE Context Release has "
1962 "been previously received, the UE context is destroyed.",
1963 TimeValue(MilliSeconds(500)),
1966
1967 // Cell selection related attribute
1968 .AddAttribute("QRxLevMin",
1969 "One of information transmitted within the SIB1 message, "
1970 "indicating the required minimum RSRP level that any UE must "
1971 "receive from this cell before it is allowed to camp to this "
1972 "cell. The default value -70 corresponds to -140 dBm and is "
1973 "the lowest possible value as defined by Section 6.3.4 of "
1974 "3GPP TS 36.133. This restriction, however, only applies to "
1975 "initial cell selection and EPC-enabled simulation.",
1977 IntegerValue(-70),
1980 .AddAttribute("NumberOfComponentCarriers",
1981 "Number of Component Carriers",
1982 UintegerValue(1),
1985
1986 // Handover related attributes
1987 .AddAttribute("AdmitHandoverRequest",
1988 "Whether to admit an X2 handover request from another eNB",
1989 BooleanValue(true),
1992 .AddAttribute("AdmitRrcConnectionRequest",
1993 "Whether to admit a connection request from a UE",
1994 BooleanValue(true),
1997
1998 // UE measurements related attributes
1999 .AddAttribute("RsrpFilterCoefficient",
2000 "Determines the strength of smoothing effect induced by "
2001 "layer 3 filtering of RSRP in all attached UE; "
2002 "if set to 0, no layer 3 filtering is applicable",
2003 // i.e. the variable k in 3GPP TS 36.331 section 5.5.3.2
2004 UintegerValue(4),
2007 .AddAttribute("RsrqFilterCoefficient",
2008 "Determines the strength of smoothing effect induced by "
2009 "layer 3 filtering of RSRQ in all attached UE; "
2010 "if set to 0, no layer 3 filtering is applicable",
2011 // i.e. the variable k in 3GPP TS 36.331 section 5.5.3.2
2012 UintegerValue(4),
2015
2016 // Trace sources
2017 .AddTraceSource("NewUeContext",
2018 "Fired upon creation of a new UE context.",
2020 "ns3::LteEnbRrc::NewUeContextTracedCallback")
2021 .AddTraceSource("ConnectionEstablished",
2022 "Fired upon successful RRC connection establishment.",
2024 "ns3::LteEnbRrc::ConnectionHandoverTracedCallback")
2025 .AddTraceSource("ConnectionReconfiguration",
2026 "trace fired upon RRC connection reconfiguration",
2028 "ns3::LteEnbRrc::ConnectionHandoverTracedCallback")
2029 .AddTraceSource("HandoverStart",
2030 "trace fired upon start of a handover procedure",
2032 "ns3::LteEnbRrc::HandoverStartTracedCallback")
2033 .AddTraceSource("HandoverEndOk",
2034 "trace fired upon successful termination of a handover procedure",
2036 "ns3::LteEnbRrc::ConnectionHandoverTracedCallback")
2037 .AddTraceSource("RecvMeasurementReport",
2038 "trace fired when measurement report is received",
2040 "ns3::LteEnbRrc::ReceiveReportTracedCallback")
2041 .AddTraceSource("NotifyConnectionRelease",
2042 "trace fired when an UE is released",
2044 "ns3::LteEnbRrc::ConnectionHandoverTracedCallback")
2045 .AddTraceSource("RrcTimeout",
2046 "trace fired when a timer expires",
2048 "ns3::LteEnbRrc::TimerExpiryTracedCallback")
2049 .AddTraceSource(
2050 "HandoverFailureNoPreamble",
2051 "trace fired upon handover failure due to non-allocation of non-contention based "
2052 "preamble at eNB for UE to handover due to max count reached",
2054 "ns3::LteEnbRrc::HandoverFailureTracedCallback")
2055 .AddTraceSource(
2056 "HandoverFailureMaxRach",
2057 "trace fired upon handover failure due to max RACH attempts from UE to target eNB",
2059 "ns3::LteEnbRrc::HandoverFailureTracedCallback")
2060 .AddTraceSource(
2061 "HandoverFailureLeaving",
2062 "trace fired upon handover failure due to handover leaving timeout at source eNB",
2064 "ns3::LteEnbRrc::HandoverFailureTracedCallback")
2065 .AddTraceSource(
2066 "HandoverFailureJoining",
2067 "trace fired upon handover failure due to handover joining timeout at target eNB",
2069 "ns3::LteEnbRrc::HandoverFailureTracedCallback");
2070 return tid;
2071}
2072
2073void
2079
2082{
2083 NS_LOG_FUNCTION(this);
2084 return m_x2SapUser;
2085}
2086
2087void
2093
2094void
2096{
2097 NS_LOG_FUNCTION(this << s);
2098 if (m_cmacSapProvider.size() > pos)
2099 {
2100 m_cmacSapProvider.at(pos) = s;
2101 }
2102 else
2103 {
2104 m_cmacSapProvider.push_back(s);
2105 NS_ABORT_IF(m_cmacSapProvider.size() - 1 != pos);
2106 }
2107}
2108
2111{
2112 NS_LOG_FUNCTION(this);
2113 return m_cmacSapUser.at(0);
2114}
2115
2118{
2119 NS_LOG_FUNCTION(this);
2120 return m_cmacSapUser.at(pos);
2121}
2122
2123void
2129
2136
2137void
2143
2150
2151void
2157
2160{
2161 NS_LOG_FUNCTION(this);
2162 return m_anrSapUser;
2163}
2164
2165void
2167{
2168 NS_LOG_FUNCTION(this << s);
2169 if (!m_ffrRrcSapProvider.empty())
2170 {
2171 m_ffrRrcSapProvider.at(0) = s;
2172 }
2173 else
2174 {
2175 m_ffrRrcSapProvider.push_back(s);
2176 }
2177}
2178
2179void
2181{
2182 NS_LOG_FUNCTION(this << s);
2183 if (m_ffrRrcSapProvider.size() > index)
2184 {
2185 m_ffrRrcSapProvider.at(index) = s;
2186 }
2187 else
2188 {
2189 m_ffrRrcSapProvider.push_back(s);
2190 NS_ABORT_MSG_IF(m_ffrRrcSapProvider.size() - 1 != index,
2191 "You meant to store the pointer at position "
2192 << static_cast<uint32_t>(index) << " but it went to "
2193 << m_ffrRrcSapProvider.size() - 1);
2194 }
2195}
2196
2199{
2200 NS_LOG_FUNCTION(this);
2201 return m_ffrRrcSapUser.at(0);
2202}
2203
2206{
2207 NS_LOG_FUNCTION(this);
2209 "Invalid component carrier index:"
2210 << index << " provided in order to obtain FfrRrcSapUser.");
2211 return m_ffrRrcSapUser.at(index);
2212}
2213
2214void
2220
2227
2228void
2234
2235void
2240
2243{
2244 return m_s1SapUser;
2245}
2246
2247void
2249{
2250 NS_LOG_FUNCTION(this << s);
2251 if (!m_cphySapProvider.empty())
2252 {
2253 m_cphySapProvider.at(0) = s;
2254 }
2255 else
2256 {
2257 m_cphySapProvider.push_back(s);
2258 }
2259}
2260
2263{
2264 NS_LOG_FUNCTION(this);
2265 return m_cphySapUser.at(0);
2266}
2267
2268void
2270{
2271 NS_LOG_FUNCTION(this << s);
2272 if (m_cphySapProvider.size() > pos)
2273 {
2274 m_cphySapProvider.at(pos) = s;
2275 }
2276 else
2277 {
2278 m_cphySapProvider.push_back(s);
2279 NS_ABORT_IF(m_cphySapProvider.size() - 1 != pos);
2280 }
2281}
2282
2285{
2286 NS_LOG_FUNCTION(this);
2287 return m_cphySapUser.at(pos);
2288}
2289
2290bool
2291LteEnbRrc::HasUeManager(uint16_t rnti) const
2292{
2293 NS_LOG_FUNCTION(this << (uint32_t)rnti);
2294 auto it = m_ueMap.find(rnti);
2295 return (it != m_ueMap.end());
2296}
2297
2300{
2301 NS_LOG_FUNCTION(this << (uint32_t)rnti);
2302 NS_ASSERT(0 != rnti);
2303 auto it = m_ueMap.find(rnti);
2304 NS_ASSERT_MSG(it != m_ueMap.end(), "UE manager for RNTI " << rnti << " not found");
2305 return it->second;
2306}
2307
2308std::vector<uint8_t>
2310{
2311 NS_LOG_FUNCTION(this);
2312
2313 // SANITY CHECK
2314
2318 "Measurement identities and reporting configuration should not have different quantity");
2319
2320 if (!Simulator::Now().IsZero())
2321 {
2322 NS_FATAL_ERROR("AddUeMeasReportConfig may not be called after the simulation has run");
2323 }
2324
2325 // INPUT VALIDATION
2326
2327 switch (config.triggerQuantity)
2328 {
2332 {
2334 "The given triggerQuantity (RSRP) does not match with the given threshold2.choice");
2335 }
2336
2342 {
2344 "The given triggerQuantity (RSRP) does not match with the given threshold1.choice");
2345 }
2346 break;
2347
2351 {
2353 "The given triggerQuantity (RSRQ) does not match with the given threshold2.choice");
2354 }
2355
2361 {
2363 "The given triggerQuantity (RSRQ) does not match with the given threshold1.choice");
2364 }
2365 break;
2366
2367 default:
2368 NS_FATAL_ERROR("unsupported triggerQuantity");
2369 break;
2370 }
2371
2373 {
2374 NS_FATAL_ERROR("Only REPORT_STRONGEST_CELLS purpose is supported");
2375 }
2376
2378 {
2379 NS_LOG_WARN("reportQuantity = BOTH will be used instead of the given reportQuantity");
2380 }
2381
2382 uint8_t nextId = m_ueMeasConfig.reportConfigToAddModList.size() + 1;
2383
2384 // create the reporting configuration
2386 reportConfig.reportConfigId = nextId;
2387 reportConfig.reportConfigEutra = config;
2388
2389 // add reporting configuration to UE measurement configuration
2390 m_ueMeasConfig.reportConfigToAddModList.push_back(reportConfig);
2391
2392 std::vector<uint8_t> measIds;
2393
2394 // create measurement identities, linking reporting configuration to all objects
2395 for (uint16_t componentCarrier = 0; componentCarrier < m_numberOfComponentCarriers;
2396 componentCarrier++)
2397 {
2398 LteRrcSap::MeasIdToAddMod measIdToAddMod;
2399
2400 uint8_t measId = m_ueMeasConfig.measIdToAddModList.size() + 1;
2401
2402 measIdToAddMod.measId = measId;
2403 measIdToAddMod.measObjectId = componentCarrier + 1;
2404 measIdToAddMod.reportConfigId = nextId;
2405
2406 m_ueMeasConfig.measIdToAddModList.push_back(measIdToAddMod);
2407 measIds.push_back(measId);
2408 }
2409
2410 return measIds;
2411}
2412
2413void
2415{
2416 auto it = ccPhyConf.begin();
2417 NS_ASSERT(it != ccPhyConf.end());
2418 uint16_t ulBandwidth = it->second->GetUlBandwidth();
2419 uint16_t dlBandwidth = it->second->GetDlBandwidth();
2420 uint32_t ulEarfcn = it->second->GetUlEarfcn();
2421 uint32_t dlEarfcn = it->second->GetDlEarfcn();
2422 NS_LOG_FUNCTION(this << ulBandwidth << dlBandwidth << ulEarfcn << dlEarfcn);
2424
2425 for (const auto& it : ccPhyConf)
2426 {
2427 m_cphySapProvider.at(it.first)->SetBandwidth(it.second->GetUlBandwidth(),
2428 it.second->GetDlBandwidth());
2429 m_cphySapProvider.at(it.first)->SetEarfcn(it.second->GetUlEarfcn(),
2430 it.second->GetDlEarfcn());
2431 m_cphySapProvider.at(it.first)->SetCellId(it.second->GetCellId());
2432 m_cmacSapProvider.at(it.first)->ConfigureMac(it.second->GetUlBandwidth(),
2433 it.second->GetDlBandwidth());
2434 if (m_ffrRrcSapProvider.size() > it.first)
2435 {
2436 m_ffrRrcSapProvider.at(it.first)->SetCellId(it.second->GetCellId());
2437 m_ffrRrcSapProvider.at(it.first)->SetBandwidth(it.second->GetUlBandwidth(),
2438 it.second->GetDlBandwidth());
2439 }
2440 }
2441
2442 m_dlEarfcn = dlEarfcn;
2443 m_ulEarfcn = ulEarfcn;
2444 m_dlBandwidth = dlBandwidth;
2445 m_ulBandwidth = ulBandwidth;
2446
2447 /*
2448 * Initializing the list of measurement objects.
2449 * Only intra-frequency measurements are supported,
2450 * so one measurement object is created for each carrier frequency.
2451 */
2452 for (const auto& it : ccPhyConf)
2453 {
2455 measObject.measObjectId = it.first + 1;
2456 measObject.measObjectEutra.carrierFreq = it.second->GetDlEarfcn();
2457 measObject.measObjectEutra.allowedMeasBandwidth = it.second->GetDlBandwidth();
2458 measObject.measObjectEutra.presenceAntennaPort1 = false;
2459 measObject.measObjectEutra.neighCellConfig = 0;
2460 measObject.measObjectEutra.offsetFreq = 0;
2462
2463 m_ueMeasConfig.measObjectToAddModList.push_back(measObject);
2464 }
2465
2472
2473 m_sib1.clear();
2474 m_sib1.reserve(ccPhyConf.size());
2475 for (const auto& it : ccPhyConf)
2476 {
2477 // Enabling MIB transmission
2479 mib.dlBandwidth = it.second->GetDlBandwidth();
2480 mib.systemFrameNumber = 0;
2481 m_cphySapProvider.at(it.first)->SetMasterInformationBlock(mib);
2482
2483 // Enabling SIB1 transmission with default values
2485 sib1.cellAccessRelatedInfo.cellIdentity = it.second->GetCellId();
2489 sib1.cellSelectionInfo.qQualMin = -34; // not used, set as minimum value
2490 sib1.cellSelectionInfo.qRxLevMin = m_qRxLevMin; // set as minimum value
2491 m_sib1.push_back(sib1);
2492 m_cphySapProvider.at(it.first)->SetSystemInformationBlockType1(sib1);
2493 }
2494 /*
2495 * Enabling transmission of other SIB. The first time System Information is
2496 * transmitted is arbitrarily assumed to be at +0.016s, and then it will be
2497 * regularly transmitted every 80 ms by default (set the
2498 * SystemInformationPeriodicity attribute to configure this).
2499 */
2501
2502 m_configured = true;
2503}
2504
2505void
2506LteEnbRrc::SetCellId(uint16_t cellId)
2507{
2508 // update SIB1
2509 m_sib1.at(0).cellAccessRelatedInfo.cellIdentity = cellId;
2510 m_cphySapProvider.at(0)->SetSystemInformationBlockType1(m_sib1.at(0));
2511}
2512
2513void
2514LteEnbRrc::SetCellId(uint16_t cellId, uint8_t ccIndex)
2515{
2516 // update SIB1
2517 m_sib1.at(ccIndex).cellAccessRelatedInfo.cellIdentity = cellId;
2518 m_cphySapProvider.at(ccIndex)->SetSystemInformationBlockType1(m_sib1.at(ccIndex));
2519}
2520
2521uint8_t
2523{
2524 NS_LOG_FUNCTION(this << cellId);
2525 for (auto& it : m_componentCarrierPhyConf)
2526 {
2527 if (it.second->GetCellId() == cellId)
2528 {
2529 return it.first;
2530 }
2531 }
2532 NS_FATAL_ERROR("Cell " << cellId << " not found in CC map");
2533}
2534
2535uint16_t
2536LteEnbRrc::ComponentCarrierToCellId(uint8_t componentCarrierId)
2537{
2538 NS_LOG_FUNCTION(this << +componentCarrierId);
2539 return m_componentCarrierPhyConf.at(componentCarrierId)->GetCellId();
2540}
2541
2542bool
2543LteEnbRrc::HasCellId(uint16_t cellId) const
2544{
2545 for (auto& it : m_componentCarrierPhyConf)
2546 {
2547 if (it.second->GetCellId() == cellId)
2548 {
2549 return true;
2550 }
2551 }
2552 return false;
2553}
2554
2555bool
2557{
2558 NS_LOG_FUNCTION(this << packet);
2559 EpsBearerTag tag;
2560 bool found = packet->RemovePacketTag(tag);
2561 NS_ASSERT_MSG(found, "no EpsBearerTag found in packet to be sent");
2562 Ptr<UeManager> ueManager = GetUeManager(tag.GetRnti());
2563
2564 NS_LOG_INFO("Sending a packet of " << packet->GetSize() << " bytes to IMSI "
2565 << ueManager->GetImsi() << ", RNTI " << ueManager->GetRnti()
2566 << ", BID " << (uint16_t)tag.GetBid());
2567 ueManager->SendData(tag.GetBid(), packet);
2568
2569 return true;
2570}
2571
2572void
2577
2578void
2580{
2581 NS_LOG_FUNCTION(this << rnti);
2583 "ConnectionRequestTimeout in unexpected state "
2584 << GetUeManager(rnti)->GetState());
2585 m_rrcTimeoutTrace(GetUeManager(rnti)->GetImsi(),
2586 rnti,
2587 ComponentCarrierToCellId(GetUeManager(rnti)->GetComponentCarrierId()),
2588 "ConnectionRequestTimeout");
2589 RemoveUe(rnti);
2590}
2591
2592void
2594{
2595 NS_LOG_FUNCTION(this << rnti);
2597 "ConnectionSetupTimeout in unexpected state " << GetUeManager(rnti)->GetState());
2598 m_rrcTimeoutTrace(GetUeManager(rnti)->GetImsi(),
2599 rnti,
2600 ComponentCarrierToCellId(GetUeManager(rnti)->GetComponentCarrierId()),
2601 "ConnectionSetupTimeout");
2602 RemoveUe(rnti);
2603}
2604
2605void
2607{
2608 NS_LOG_FUNCTION(this << rnti);
2610 "ConnectionRejectedTimeout in unexpected state "
2611 << GetUeManager(rnti)->GetState());
2612 m_rrcTimeoutTrace(GetUeManager(rnti)->GetImsi(),
2613 rnti,
2614 ComponentCarrierToCellId(GetUeManager(rnti)->GetComponentCarrierId()),
2615 "ConnectionRejectedTimeout");
2616 RemoveUe(rnti);
2617}
2618
2619void
2621{
2622 NS_LOG_FUNCTION(this << rnti);
2624 "HandoverJoiningTimeout in unexpected state " << GetUeManager(rnti)->GetState());
2626 GetUeManager(rnti)->GetImsi(),
2627 rnti,
2628 ComponentCarrierToCellId(GetUeManager(rnti)->GetComponentCarrierId()));
2629 // check if the RNTI to be removed is not stale
2630 if (HasUeManager(rnti))
2631 {
2632 /**
2633 * When the handover joining timer expires at the target cell,
2634 * then notify the source cell to release the RRC connection and
2635 * delete the UE context at eNodeB and SGW/PGW. The
2636 * HandoverPreparationFailure message is reused to notify the source cell
2637 * through the X2 interface instead of creating a new message.
2638 */
2639 Ptr<UeManager> ueManager = GetUeManager(rnti);
2640 EpcX2Sap::HandoverPreparationFailureParams msg = ueManager->BuildHoPrepFailMsg();
2642 RemoveUe(rnti);
2643 }
2644}
2645
2646void
2648{
2649 NS_LOG_FUNCTION(this << rnti);
2651 "HandoverLeavingTimeout in unexpected state " << GetUeManager(rnti)->GetState());
2653 GetUeManager(rnti)->GetImsi(),
2654 rnti,
2655 ComponentCarrierToCellId(GetUeManager(rnti)->GetComponentCarrierId()));
2656 // check if the RNTI to be removed is not stale
2657 if (HasUeManager(rnti))
2658 {
2659 /**
2660 * Send HO cancel msg to the target eNB and release the RRC connection
2661 * with the UE and also delete UE context at the source eNB and bearer
2662 * info at SGW and PGW.
2663 */
2664 Ptr<UeManager> ueManager = GetUeManager(rnti);
2665 EpcX2Sap::HandoverCancelParams msg = ueManager->BuildHoCancelMsg();
2667 ueManager->SendRrcConnectionRelease();
2668 }
2669}
2670
2671void
2672LteEnbRrc::SendHandoverRequest(uint16_t rnti, uint16_t cellId)
2673{
2674 NS_LOG_FUNCTION(this << rnti << cellId);
2675 NS_LOG_LOGIC("Request to send HANDOVER REQUEST");
2677
2678 Ptr<UeManager> ueManager = GetUeManager(rnti);
2679 ueManager->PrepareHandover(cellId);
2680}
2681
2682void
2684{
2685 NS_LOG_FUNCTION(this << rnti);
2686 GetUeManager(rnti)->CompleteSetupUe(params);
2687}
2688
2689void
2691{
2692 NS_LOG_FUNCTION(this << rnti);
2693 GetUeManager(rnti)->RecvRrcConnectionRequest(msg);
2694}
2695
2696void
2699{
2700 NS_LOG_FUNCTION(this << rnti);
2701 GetUeManager(rnti)->RecvRrcConnectionSetupCompleted(msg);
2702}
2703
2704void
2706 uint16_t rnti,
2708{
2709 NS_LOG_FUNCTION(this << rnti);
2710 GetUeManager(rnti)->RecvRrcConnectionReconfigurationCompleted(msg);
2711}
2712
2713void
2715 uint16_t rnti,
2717{
2718 NS_LOG_FUNCTION(this << rnti);
2719 GetUeManager(rnti)->RecvRrcConnectionReestablishmentRequest(msg);
2720}
2721
2722void
2724 uint16_t rnti,
2726{
2727 NS_LOG_FUNCTION(this << rnti);
2728 GetUeManager(rnti)->RecvRrcConnectionReestablishmentComplete(msg);
2729}
2730
2731void
2733{
2734 NS_LOG_FUNCTION(this << rnti);
2735 GetUeManager(rnti)->RecvMeasurementReport(msg);
2736}
2737
2738void
2740{
2741 NS_LOG_FUNCTION(this);
2742 Ptr<UeManager> ueManager = GetUeManager(msg.rnti);
2743 ueManager->InitialContextSetupRequest();
2744}
2745
2746void
2748{
2749 NS_LOG_FUNCTION(this << rnti);
2750
2751 // check if the RNTI to be removed is not stale
2752 if (HasUeManager(rnti))
2753 {
2754 Ptr<UeManager> ueManager = GetUeManager(rnti);
2755
2756 if (ueManager->GetState() == UeManager::HANDOVER_JOINING)
2757 {
2759 GetUeManager(rnti)->GetImsi(),
2760 rnti,
2761 ComponentCarrierToCellId(GetUeManager(rnti)->GetComponentCarrierId()));
2762 /**
2763 * During the HO, when the RACH failure due to the maximum number of
2764 * re-attempts is reached the UE request the target eNB to deletes its
2765 * context. Upon which, the target eNB sends handover preparation
2766 * failure to the source eNB.
2767 */
2768 EpcX2Sap::HandoverPreparationFailureParams msg = ueManager->BuildHoPrepFailMsg();
2770 }
2771
2772 GetUeManager(rnti)->RecvIdealUeContextRemoveRequest(rnti);
2773 // delete the UE context at the eNB
2774 RemoveUe(rnti);
2775 }
2776}
2777
2778void
2781{
2782 NS_LOG_FUNCTION(this);
2783 Ptr<UeManager> ueManager = GetUeManager(request.rnti);
2784 ueManager->SetupDataRadioBearer(request.bearer,
2785 request.bearerId,
2786 request.gtpTeid,
2787 request.transportLayerAddress);
2788}
2789
2790void
2793{
2794 NS_LOG_FUNCTION(this);
2795 Ptr<UeManager> ueManager = GetUeManager(params.rnti);
2796 ueManager->SendUeContextRelease();
2797}
2798
2799void
2801{
2802 NS_LOG_FUNCTION(this);
2803
2804 NS_LOG_LOGIC("Recv X2 message: HANDOVER REQUEST");
2805
2806 NS_LOG_LOGIC("oldEnbUeX2apId = " << req.oldEnbUeX2apId);
2807 NS_LOG_LOGIC("sourceCellId = " << req.sourceCellId);
2808 NS_LOG_LOGIC("targetCellId = " << req.targetCellId);
2809 NS_LOG_LOGIC("mmeUeS1apId = " << req.mmeUeS1apId);
2810
2811 // if no SRS index is available, then do not accept the handover
2813 {
2814 NS_LOG_INFO("rejecting handover request from cellId " << req.sourceCellId);
2816 res.oldEnbUeX2apId = req.oldEnbUeX2apId;
2817 res.sourceCellId = req.sourceCellId;
2818 res.targetCellId = req.targetCellId;
2819 res.cause = 0;
2820 res.criticalityDiagnostics = 0;
2822 return;
2823 }
2824
2825 uint8_t componentCarrierId = CellToComponentCarrierId(req.targetCellId);
2826 uint16_t rnti = AddUe(UeManager::HANDOVER_JOINING, componentCarrierId);
2827 Ptr<UeManager> ueManager = GetUeManager(rnti);
2828 ueManager->SetSource(req.sourceCellId, req.oldEnbUeX2apId);
2829 ueManager->SetImsi(req.mmeUeS1apId);
2831 m_cmacSapProvider.at(componentCarrierId)->AllocateNcRaPreamble(rnti);
2832 if (!anrcrv.valid)
2833 {
2835 this
2836 << " failed to allocate a preamble for non-contention based RA => cannot accept HO");
2838 GetUeManager(rnti)->GetImsi(),
2839 rnti,
2840 ComponentCarrierToCellId(GetUeManager(rnti)->GetComponentCarrierId()));
2841 /**
2842 * When the maximum non-contention based preambles is reached, then it is considered
2843 * handover has failed and source cell is notified to release the RRC connection and delete
2844 * the UE context at eNodeB and SGW/PGW.
2845 */
2846 Ptr<UeManager> ueManager = GetUeManager(rnti);
2847 EpcX2Sap::HandoverPreparationFailureParams msg = ueManager->BuildHoPrepFailMsg();
2849 RemoveUe(rnti); // remove the UE from the target eNB
2850 return;
2851 }
2852
2854 ackParams.oldEnbUeX2apId = req.oldEnbUeX2apId;
2855 ackParams.newEnbUeX2apId = rnti;
2856 ackParams.sourceCellId = req.sourceCellId;
2857 ackParams.targetCellId = req.targetCellId;
2858
2859 for (auto it = req.bearers.begin(); it != req.bearers.end(); ++it)
2860 {
2861 ueManager->SetupDataRadioBearer(it->erabLevelQosParameters,
2862 it->erabId,
2863 it->gtpTeid,
2864 it->transportLayerAddress);
2866 i.erabId = it->erabId;
2867 ackParams.admittedBearers.push_back(i);
2868 }
2869
2871 ueManager->GetRrcConnectionReconfigurationForHandover(componentCarrierId);
2872
2873 handoverCommand.mobilityControlInfo.newUeIdentity = rnti;
2874 handoverCommand.mobilityControlInfo.haveRachConfigDedicated = true;
2877 anrcrv.raPrachMaskIndex;
2878
2880 m_cmacSapProvider.at(componentCarrierId)->GetRachConfig();
2882 .numberOfRaPreambles = rc.numberOfRaPreambles;
2884 .preambleTransMax = rc.preambleTransMax;
2886 .raResponseWindowSize = rc.raResponseWindowSize;
2888 .connEstFailCount = rc.connEstFailCount;
2889
2890 Ptr<Packet> encodedHandoverCommand = m_rrcSapUser->EncodeHandoverCommand(handoverCommand);
2891
2892 ackParams.rrcContext = encodedHandoverCommand;
2893
2894 NS_LOG_LOGIC("Send X2 message: HANDOVER REQUEST ACK");
2895
2896 NS_LOG_LOGIC("oldEnbUeX2apId = " << ackParams.oldEnbUeX2apId);
2897 NS_LOG_LOGIC("newEnbUeX2apId = " << ackParams.newEnbUeX2apId);
2898 NS_LOG_LOGIC("sourceCellId = " << ackParams.sourceCellId);
2899 NS_LOG_LOGIC("targetCellId = " << ackParams.targetCellId);
2900
2902}
2903
2904void
2906{
2907 NS_LOG_FUNCTION(this);
2908
2909 NS_LOG_LOGIC("Recv X2 message: HANDOVER REQUEST ACK");
2910
2911 NS_LOG_LOGIC("oldEnbUeX2apId = " << params.oldEnbUeX2apId);
2912 NS_LOG_LOGIC("newEnbUeX2apId = " << params.newEnbUeX2apId);
2913 NS_LOG_LOGIC("sourceCellId = " << params.sourceCellId);
2914 NS_LOG_LOGIC("targetCellId = " << params.targetCellId);
2915
2916 uint16_t rnti = params.oldEnbUeX2apId;
2917 Ptr<UeManager> ueManager = GetUeManager(rnti);
2918 ueManager->RecvHandoverRequestAck(params);
2919}
2920
2921void
2923{
2924 NS_LOG_FUNCTION(this);
2925
2926 NS_LOG_LOGIC("Recv X2 message: HANDOVER PREPARATION FAILURE");
2927
2928 NS_LOG_LOGIC("oldEnbUeX2apId = " << params.oldEnbUeX2apId);
2929 NS_LOG_LOGIC("sourceCellId = " << params.sourceCellId);
2930 NS_LOG_LOGIC("targetCellId = " << params.targetCellId);
2931 NS_LOG_LOGIC("cause = " << params.cause);
2932 NS_LOG_LOGIC("criticalityDiagnostics = " << params.criticalityDiagnostics);
2933
2934 uint16_t rnti = params.oldEnbUeX2apId;
2935
2936 // check if the RNTI is not stale
2937 if (HasUeManager(rnti))
2938 {
2939 Ptr<UeManager> ueManager = GetUeManager(rnti);
2940 ueManager->RecvHandoverPreparationFailure(params.targetCellId);
2941 }
2942}
2943
2944void
2946{
2947 NS_LOG_FUNCTION(this);
2948
2949 NS_LOG_LOGIC("Recv X2 message: SN STATUS TRANSFER");
2950
2951 NS_LOG_LOGIC("oldEnbUeX2apId = " << params.oldEnbUeX2apId);
2952 NS_LOG_LOGIC("newEnbUeX2apId = " << params.newEnbUeX2apId);
2953 NS_LOG_LOGIC("erabsSubjectToStatusTransferList size = "
2954 << params.erabsSubjectToStatusTransferList.size());
2955
2956 uint16_t rnti = params.newEnbUeX2apId;
2957
2958 // check if the RNTI to receive SN transfer for is not stale
2959 if (HasUeManager(rnti))
2960 {
2961 Ptr<UeManager> ueManager = GetUeManager(rnti);
2962 ueManager->RecvSnStatusTransfer(params);
2963 }
2964}
2965
2966void
2968{
2969 NS_LOG_FUNCTION(this);
2970
2971 NS_LOG_LOGIC("Recv X2 message: UE CONTEXT RELEASE");
2972
2973 NS_LOG_LOGIC("oldEnbUeX2apId = " << params.oldEnbUeX2apId);
2974 NS_LOG_LOGIC("newEnbUeX2apId = " << params.newEnbUeX2apId);
2975
2976 uint16_t rnti = params.oldEnbUeX2apId;
2977
2978 // check if the RNTI to be removed is not stale
2979 if (HasUeManager(rnti))
2980 {
2981 GetUeManager(rnti)->RecvUeContextRelease(params);
2982 RemoveUe(rnti);
2983 }
2984}
2985
2986void
2988{
2989 NS_LOG_FUNCTION(this);
2990
2991 NS_LOG_LOGIC("Recv X2 message: LOAD INFORMATION");
2992
2993 NS_LOG_LOGIC("Number of cellInformationItems = " << params.cellInformationList.size());
2994
2996 m_ffrRrcSapProvider.at(0)->RecvLoadInformation(params);
2997}
2998
2999void
3001{
3002 NS_LOG_FUNCTION(this);
3003
3004 NS_LOG_LOGIC("Recv X2 message: RESOURCE STATUS UPDATE");
3005
3007 "Number of cellMeasurementResultItems = " << params.cellMeasurementResultList.size());
3008
3009 NS_ASSERT("Processing of RESOURCE STATUS UPDATE X2 message IS NOT IMPLEMENTED");
3010}
3011
3012void
3014{
3015 NS_LOG_FUNCTION(this);
3016
3017 NS_LOG_LOGIC("Recv UE DATA FORWARDING through X2 interface");
3018 NS_LOG_LOGIC("sourceCellId = " << params.sourceCellId);
3019 NS_LOG_LOGIC("targetCellId = " << params.targetCellId);
3020 NS_LOG_LOGIC("gtpTeid = " << params.gtpTeid);
3021 NS_LOG_LOGIC("ueData = " << params.ueData);
3022 NS_LOG_LOGIC("ueData size = " << params.ueData->GetSize());
3023
3024 auto teidInfoIt = m_x2uTeidInfoMap.find(params.gtpTeid);
3025 if (teidInfoIt != m_x2uTeidInfoMap.end())
3026 {
3027 GetUeManager(teidInfoIt->second.rnti)->SendData(teidInfoIt->second.drbid, params.ueData);
3028 }
3029 else
3030 {
3031 NS_FATAL_ERROR("X2-U data received but no X2uTeidInfo found");
3032 }
3033}
3034
3035void
3037{
3038 NS_LOG_FUNCTION(this);
3039
3040 NS_LOG_LOGIC("Recv X2 message: HANDOVER CANCEL");
3041
3042 NS_LOG_LOGIC("oldEnbUeX2apId = " << params.oldEnbUeX2apId);
3043 NS_LOG_LOGIC("newEnbUeX2apId = " << params.newEnbUeX2apId);
3044 NS_LOG_LOGIC("sourceCellId = " << params.sourceCellId);
3045 NS_LOG_LOGIC("targetCellId = " << params.targetCellId);
3046 NS_LOG_LOGIC("cause = " << params.cause);
3047
3048 uint16_t rnti = params.newEnbUeX2apId;
3049 if (HasUeManager(rnti))
3050 {
3051 Ptr<UeManager> ueManager = GetUeManager(rnti);
3052 ueManager->RecvHandoverCancel(params);
3053 GetUeManager(rnti)->RecvIdealUeContextRemoveRequest(rnti);
3054 }
3055}
3056
3057uint16_t
3059{
3060 NS_LOG_FUNCTION(this << +componentCarrierId);
3061 // if no SRS index is available, then do not create a new UE context.
3062 if (IsMaxSrsReached())
3063 {
3064 NS_LOG_WARN("Not enough SRS configuration indices, UE context not created");
3065 return 0; // return 0 since new RNTI was not assigned for the received preamble
3066 }
3067 return AddUe(UeManager::INITIAL_RANDOM_ACCESS, componentCarrierId);
3068}
3069
3070void
3072{
3073 Ptr<UeManager> ueManager = GetUeManager(cmacParams.m_rnti);
3074 ueManager->CmacUeConfigUpdateInd(cmacParams);
3075}
3076
3077void
3078LteEnbRrc::DoNotifyLcConfigResult(uint16_t rnti, uint8_t lcid, bool success)
3079{
3080 NS_LOG_FUNCTION(this << (uint32_t)rnti);
3081 NS_FATAL_ERROR("not implemented");
3082}
3083
3084std::vector<uint8_t>
3086{
3087 NS_LOG_FUNCTION(this);
3088 std::vector<uint8_t> measIds = AddUeMeasReportConfig(reportConfig);
3089 m_handoverMeasIds.insert(measIds.begin(), measIds.end());
3090 return measIds;
3091}
3092
3093uint8_t
3095{
3096 NS_LOG_FUNCTION(this);
3097 uint8_t measId = AddUeMeasReportConfig(reportConfig).at(0);
3098 m_componentCarrierMeasIds.insert(measId);
3099 return measId;
3100}
3101
3102void
3103LteEnbRrc::DoSetNumberOfComponentCarriers(uint16_t numberOfComponentCarriers)
3104{
3105 m_numberOfComponentCarriers = numberOfComponentCarriers;
3106}
3107
3108void
3109LteEnbRrc::DoTriggerHandover(uint16_t rnti, uint16_t targetCellId)
3110{
3111 NS_LOG_FUNCTION(this << rnti << targetCellId);
3112
3113 bool isHandoverAllowed = true;
3114
3115 Ptr<UeManager> ueManager = GetUeManager(rnti);
3116 NS_ASSERT_MSG(ueManager, "Cannot find UE context with RNTI " << rnti);
3117
3118 if (m_anrSapProvider != nullptr && !HasCellId(targetCellId))
3119 {
3120 // ensure that proper neighbour relationship exists between source and target cells
3121 bool noHo = m_anrSapProvider->GetNoHo(targetCellId);
3122 bool noX2 = m_anrSapProvider->GetNoX2(targetCellId);
3123 NS_LOG_DEBUG(this << " cellId="
3124 << ComponentCarrierToCellId(ueManager->GetComponentCarrierId())
3125 << " targetCellId=" << targetCellId << " NRT.NoHo=" << noHo
3126 << " NRT.NoX2=" << noX2);
3127
3128 if (noHo || noX2)
3129 {
3130 isHandoverAllowed = false;
3131 NS_LOG_LOGIC(this << " handover to cell " << targetCellId << " is not allowed by ANR");
3132 }
3133 }
3134
3135 if (ueManager->GetState() != UeManager::CONNECTED_NORMALLY)
3136 {
3137 isHandoverAllowed = false;
3138 NS_LOG_LOGIC(this << " handover is not allowed because the UE"
3139 << " rnti=" << rnti << " is in " << ueManager->GetState() << " state");
3140 }
3141
3142 if (isHandoverAllowed)
3143 {
3144 // initiate handover execution
3145 ueManager->PrepareHandover(targetCellId);
3146 }
3147}
3148
3149uint8_t
3151{
3152 NS_LOG_FUNCTION(this);
3153 uint8_t measId = AddUeMeasReportConfig(reportConfig).at(0);
3154 m_anrMeasIds.insert(measId);
3155 return measId;
3156}
3157
3158uint8_t
3160{
3161 NS_LOG_FUNCTION(this);
3162 uint8_t measId = AddUeMeasReportConfig(reportConfig).at(0);
3163 m_ffrMeasIds.insert(measId);
3164 return measId;
3165}
3166
3167void
3169 LteRrcSap::PdschConfigDedicated pdschConfigDedicated)
3170{
3171 NS_LOG_FUNCTION(this);
3172 Ptr<UeManager> ueManager = GetUeManager(rnti);
3173 ueManager->SetPdschConfigDedicated(pdschConfigDedicated);
3174}
3175
3176void
3183
3184uint16_t
3185LteEnbRrc::AddUe(UeManager::State state, uint8_t componentCarrierId)
3186{
3187 NS_LOG_FUNCTION(this);
3188 bool found = false;
3189 uint16_t rnti;
3190 for (rnti = m_lastAllocatedRnti + 1; (rnti != m_lastAllocatedRnti - 1) && (!found); ++rnti)
3191 {
3192 if ((rnti != 0) && (m_ueMap.find(rnti) == m_ueMap.end()))
3193 {
3194 found = true;
3195 break;
3196 }
3197 }
3198
3199 NS_ASSERT_MSG(found, "no more RNTIs available (do you have more than 65535 UEs in a cell?)");
3200 m_lastAllocatedRnti = rnti;
3201 Ptr<UeManager> ueManager = CreateObject<UeManager>(this, rnti, state, componentCarrierId);
3202 m_ccmRrcSapProvider->AddUe(rnti, (uint8_t)state);
3203 m_ueMap.insert(std::pair<uint16_t, Ptr<UeManager>>(rnti, ueManager));
3204 ueManager->Initialize();
3205 const uint16_t cellId = ComponentCarrierToCellId(componentCarrierId);
3206 NS_LOG_DEBUG(this << " New UE RNTI " << rnti << " cellId " << cellId << " srs CI "
3207 << ueManager->GetSrsConfigurationIndex());
3208 m_newUeContextTrace(cellId, rnti);
3209 return rnti;
3210}
3211
3212void
3214{
3215 NS_LOG_FUNCTION(this << (uint32_t)rnti);
3216 auto it = m_ueMap.find(rnti);
3217 NS_ASSERT_MSG(it != m_ueMap.end(), "request to remove UE info with unknown rnti " << rnti);
3218 uint64_t imsi = it->second->GetImsi();
3219 uint16_t srsCi = (*it).second->GetSrsConfigurationIndex();
3220 // cancel pending events
3221 it->second->CancelPendingEvents();
3222 // fire trace upon connection release
3224 ComponentCarrierToCellId(it->second->GetComponentCarrierId()),
3225 rnti);
3226 m_ueMap.erase(it);
3227 for (uint16_t i = 0; i < m_numberOfComponentCarriers; i++)
3228 {
3229 m_cmacSapProvider.at(i)->RemoveUe(rnti);
3230 m_cphySapProvider.at(i)->RemoveUe(rnti);
3231 }
3232 if (m_s1SapProvider != nullptr)
3233 {
3235 }
3237 // need to do this after UeManager has been deleted
3238 if (srsCi != 0)
3239 {
3241 }
3242
3243 m_rrcSapUser->RemoveUe(rnti); // Remove UE context at RRC protocol
3244}
3245
3246TypeId
3248{
3250 {
3251 case RLC_SM_ALWAYS:
3252 return LteRlcSm::GetTypeId();
3253
3254 case RLC_UM_ALWAYS:
3255 return LteRlcUm::GetTypeId();
3256
3257 case RLC_AM_ALWAYS:
3258 return LteRlcAm::GetTypeId();
3259
3260 case PER_BASED:
3261 if (bearer.GetPacketErrorLossRate() > 1.0e-5)
3262 {
3263 return LteRlcUm::GetTypeId();
3264 }
3265 else
3266 {
3267 return LteRlcAm::GetTypeId();
3268 }
3269
3270 default:
3271 return LteRlcSm::GetTypeId();
3272 }
3273}
3274
3275void
3277{
3278 NS_LOG_FUNCTION(this << cellId);
3279
3280 if (m_anrSapProvider != nullptr)
3281 {
3283 }
3284}
3285
3286void
3287LteEnbRrc::SetCsgId(uint32_t csgId, bool csgIndication)
3288{
3289 NS_LOG_FUNCTION(this << csgId << csgIndication);
3290 for (std::size_t componentCarrierId = 0; componentCarrierId < m_sib1.size();
3291 componentCarrierId++)
3292 {
3293 m_sib1.at(componentCarrierId).cellAccessRelatedInfo.csgIdentity = csgId;
3294 m_sib1.at(componentCarrierId).cellAccessRelatedInfo.csgIndication = csgIndication;
3295 m_cphySapProvider.at(componentCarrierId)
3296 ->SetSystemInformationBlockType1(m_sib1.at(componentCarrierId));
3297 }
3298}
3299
3300/// Number of distinct SRS periodicity plus one.
3301static const uint8_t SRS_ENTRIES = 9;
3302/**
3303 * Sounding Reference Symbol (SRS) periodicity (TSRS) in milliseconds. Taken
3304 * from 3GPP TS 36.213 Table 8.2-1. Index starts from 1.
3305 */
3306static const uint16_t g_srsPeriodicity[SRS_ENTRIES] = {0, 2, 5, 10, 20, 40, 80, 160, 320};
3307/**
3308 * The lower bound (inclusive) of the SRS configuration indices (ISRS) which
3309 * use the corresponding SRS periodicity (TSRS). Taken from 3GPP TS 36.213
3310 * Table 8.2-1. Index starts from 1.
3311 */
3312static const uint16_t g_srsCiLow[SRS_ENTRIES] = {0, 0, 2, 7, 17, 37, 77, 157, 317};
3313/**
3314 * The upper bound (inclusive) of the SRS configuration indices (ISRS) which
3315 * use the corresponding SRS periodicity (TSRS). Taken from 3GPP TS 36.213
3316 * Table 8.2-1. Index starts from 1.
3317 */
3318static const uint16_t g_srsCiHigh[SRS_ENTRIES] = {0, 1, 6, 16, 36, 76, 156, 316, 636};
3319
3320void
3322{
3323 NS_LOG_FUNCTION(this << p);
3324 for (uint32_t id = 1; id < SRS_ENTRIES; ++id)
3325 {
3326 if (g_srsPeriodicity[id] == p)
3327 {
3329 return;
3330 }
3331 }
3332 // no match found
3333 std::ostringstream allowedValues;
3334 for (uint32_t id = 1; id < SRS_ENTRIES; ++id)
3335 {
3336 allowedValues << g_srsPeriodicity[id] << " ";
3337 }
3338 NS_FATAL_ERROR("illecit SRS periodicity value " << p
3339 << ". Allowed values: " << allowedValues.str());
3340}
3341
3350
3351uint16_t
3353{
3355 // SRS
3358 NS_LOG_DEBUG(this << " SRS p " << g_srsPeriodicity[m_srsCurrentPeriodicityId] << " set "
3361 {
3362 NS_FATAL_ERROR("too many UEs ("
3363 << m_ueSrsConfigurationIndexSet.size() + 1
3364 << ") for current SRS periodicity "
3366 << ", consider increasing the value of ns3::LteEnbRrc::SrsPeriodicity");
3367 }
3368
3369 if (m_ueSrsConfigurationIndexSet.empty())
3370 {
3371 // first entry
3374 }
3375 else
3376 {
3377 // find a CI from the available ones
3378 auto rit = m_ueSrsConfigurationIndexSet.rbegin();
3380 NS_LOG_DEBUG(this << " lower bound " << (*rit) << " of "
3383 {
3384 // got it from the upper bound
3387 }
3388 else
3389 {
3390 // look for released ones
3391 for (uint16_t srcCi = g_srsCiLow[m_srsCurrentPeriodicityId];
3393 srcCi++)
3394 {
3395 auto it = m_ueSrsConfigurationIndexSet.find(srcCi);
3396 if (it == m_ueSrsConfigurationIndexSet.end())
3397 {
3399 m_ueSrsConfigurationIndexSet.insert(srcCi);
3400 break;
3401 }
3402 }
3403 }
3404 }
3406}
3407
3408void
3410{
3411 NS_LOG_FUNCTION(this << srcCi);
3412 auto it = m_ueSrsConfigurationIndexSet.find(srcCi);
3414 "request to remove unknown SRS CI " << srcCi);
3416}
3417
3418bool
3427
3428uint8_t
3430{
3431 if (bearer.GetResourceType() > 0) // 1, 2 for GBR and DC-GBR
3432 {
3433 return 1;
3434 }
3435 else
3436 {
3437 return 2;
3438 }
3439}
3440
3441uint8_t
3443{
3444 return bearer.qci;
3445}
3446
3447void
3449{
3450 // NS_LOG_FUNCTION (this);
3451
3452 for (auto& it : m_componentCarrierPhyConf)
3453 {
3454 uint8_t ccId = it.first;
3455
3457 si.haveSib2 = true;
3458 si.sib2.freqInfo.ulCarrierFreq = it.second->GetUlEarfcn();
3459 si.sib2.freqInfo.ulBandwidth = it.second->GetUlBandwidth();
3461 m_cphySapProvider.at(ccId)->GetReferenceSignalPower();
3463
3464 LteEnbCmacSapProvider::RachConfig rc = m_cmacSapProvider.at(ccId)->GetRachConfig();
3465 LteRrcSap::RachConfigCommon rachConfigCommon;
3466 rachConfigCommon.preambleInfo.numberOfRaPreambles = rc.numberOfRaPreambles;
3467 rachConfigCommon.raSupervisionInfo.preambleTransMax = rc.preambleTransMax;
3468 rachConfigCommon.raSupervisionInfo.raResponseWindowSize = rc.raResponseWindowSize;
3469 rachConfigCommon.txFailParam.connEstFailCount = rc.connEstFailCount;
3470 si.sib2.radioResourceConfigCommon.rachConfigCommon = rachConfigCommon;
3471
3472 m_rrcSapUser->SendSystemInformation(it.second->GetCellId(), si);
3473 }
3474
3475 /*
3476 * For simplicity, we use the same periodicity for all SIBs. Note that in real
3477 * systems the periodicy of each SIBs could be different.
3478 */
3480}
3481
3482bool
3484{
3485 NS_LOG_FUNCTION(this << (uint32_t)rnti);
3486 Ptr<UeManager> ueManager = GetUeManager(rnti);
3487 switch (ueManager->GetState())
3488 {
3491 return true;
3492 default:
3493 return false;
3494 }
3495}
3496
3497std::ostream&
3498operator<<(std::ostream& os, UeManager::State state)
3499{
3500 switch (state)
3501 {
3503 return os << "INITIAL_RANDOM_ACCESS";
3505 return os << "CONNECTION_SETUP";
3507 return os << "CONNECTION_REJECTED";
3509 return os << "ATTACH_REQUEST";
3511 return os << "CONNECTED_NORMALLY";
3513 return os << "CONNECTION_RECONFIGURATION";
3515 return os << "CONNECTION_REESTABLISHMENT";
3517 return os << "HANDOVER_PREPARATION";
3519 return os << "HANDOVER_JOINING";
3521 return os << "HANDOVER_PATH_SWITCH";
3523 return os << "HANDOVER_LEAVING";
3525 return os << "NUM_STATES";
3526 };
3527 return os << "UNKNOWN(" << static_cast<uint32_t>(state) << ")";
3528}
3529
3530} // namespace ns3
AttributeValue implementation for Boolean.
Definition boolean.h:26
Callback template class.
Definition callback.h:422
Class for forwarding CMAC SAP User functions.
bool IsRandomAccessCompleted(uint16_t rnti) override
Is random access completed function.
EnbRrcMemberLteEnbCmacSapUser(LteEnbRrc *rrc, uint8_t componentCarrierId)
Constructor.
void RrcConfigurationUpdateInd(UeConfig params) override
Notify the RRC of a UE config updated requested by the MAC (normally, by the scheduler)
uint16_t AllocateTemporaryCellRnti() override
request the allocation of a Temporary C-RNTI
uint8_t m_componentCarrierId
Component carrier ID.
void NotifyLcConfigResult(uint16_t rnti, uint8_t lcid, bool success) override
notify the result of the last LC config operation
Hold variables of type enum.
Definition enum.h:52
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:209
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:348
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:416
This class contains the specification of EPS Bearers.
Definition eps-bearer.h:80
uint8_t GetResourceType() const
uint16_t GetPacketDelayBudgetMs() const
double GetPacketErrorLossRate() const
Qci qci
Qos class indicator.
Definition eps-bearer.h:140
GbrQosInformation gbrQosInfo
GBR QOS information.
Definition eps-bearer.h:142
@ GBR_CONV_VOICE
GBR Conversational Voice.
Definition eps-bearer.h:96
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:44
Hold a signed integer type.
Definition integer.h:34
Ipv4 addresses are stored in host order in this class.
Service Access Point (SAP) offered by the ANR instance to the eNodeB RRC instance.
Definition lte-anr-sap.h:26
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:84
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.
~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
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.
std::set< uint16_t > m_ueSrsConfigurationIndexSet
UE SRS configuration index set.
TracedCallback< uint64_t, uint16_t, uint16_t, uint16_t > m_handoverStartTrace
The HandoverStart trace source.
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.
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.
friend class MemberEpcEnbS1SapUser< LteEnbRrc >
allow MemberLteEnbRrcSapProvider<LteEnbRrc> class friend access
Callback< void, Ptr< Packet > > m_forwardUpCallback
forward up callback function
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.
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.
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.
Time m_connectionRequestTimeoutDuration
The ConnectionRequestTimeoutDuration attribute.
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.
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.
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.
Time m_connectionRejectedTimeoutDuration
The ConnectionRejectedTimeoutDuration attribute.
Time m_connectionSetupTimeoutDuration
The ConnectionSetupTimeoutDuration attribute.
std::set< uint8_t > m_handoverMeasIds
List of measurement identities which are intended for handover purpose.
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.
uint16_t m_ulBandwidth
Uplink transmission bandwidth configuration in number of Resource Blocks.
LteAnrSapUser * m_anrSapUser
Receive API calls from the ANR instance.
LteHandoverManagementSapProvider * m_handoverManagementSapProvider
Interface to the handover algorithm instance.
friend class EpcX2SpecificEpcX2SapUser< LteEnbRrc >
allow MemberEpcEnbS1SapUser<LteEnbRrc> class friend access
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.
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.
std::map< uint16_t, Ptr< UeManager > > m_ueMap
The UeMap attribute.
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.
Ptr< UeManager > GetUeManager(uint16_t rnti)
LteCcmRrcSapProvider * m_ccmRrcSapProvider
Interface to the LteEnbComponentCarrierManager instance.
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.
LteAnrSapProvider * m_anrSapProvider
Interface to the ANR instance.
std::set< uint8_t > m_componentCarrierMeasIds
List of measurement identities which are intended for component carrier management purposes.
std::vector< LteEnbCphySapProvider * > m_cphySapProvider
Interface to the eNodeB PHY instances.
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
TracedCallback< uint64_t, uint16_t, uint16_t > m_handoverFailureMaxRachTrace
The 'HandoverFailureMaxRach' Trace source.
friend class MemberLteCcmRrcSapUser< LteEnbRrc >
allow MemberLteCcmRrcSapUser<LteEnbRrc> class friend access
LteRrcSap::MeasConfig m_ueMeasConfig
List of measurement configuration which are active in every UE attached to this eNodeB instance.
friend class MemberLteEnbRrcSapProvider< LteEnbRrc >
allow MemberLteEnbRrcSapProvider<LteEnbRrc> class friend access
TracedCallback< uint64_t, uint16_t, uint16_t > m_handoverFailureNoPreambleTrace
The 'HandoverFailureNoPreamble' Trace source.
TracedCallback< uint16_t, uint16_t > m_newUeContextTrace
The NewUeContext trace source.
Time m_systemInformationPeriodicity
The SystemInformationPeriodicity attribute.
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
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.
void DoInitialContextSetupRequest(EpcEnbS1SapUser::InitialContextSetupRequestParameters params)
Initial context setup request function.
uint32_t m_dlEarfcn
Downlink E-UTRA Absolute Radio Frequency Channel Number.
void SendHandoverRequest(uint16_t rnti, uint16_t cellId)
Send a HandoverRequest through the X2 SAP interface.
uint16_t m_numberOfComponentCarriers
number of component carriers
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.
EpcEnbS1SapProvider * m_s1SapProvider
Interface to send messages to core network over the S1 protocol.
uint16_t m_lastAllocatedRnti
Last allocated RNTI.
uint32_t m_ulEarfcn
Uplink E-UTRA Absolute Radio Frequency Channel Number.
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.
EpcX2SapUser * m_x2SapUser
Interface to receive messages from neighbour eNodeB over the X2 interface.
bool m_admitRrcConnectionRequest
The AdmitRrcConnectionRequest attribute.
void DoRecvUeData(EpcX2SapUser::UeDataParams params)
Receive UE data function.
uint16_t m_srsCurrentPeriodicityId
The SrsPeriodicity attribute.
void DoRecvRrcConnectionReestablishmentRequest(uint16_t rnti, LteRrcSap::RrcConnectionReestablishmentRequest msg)
Part of the RRC protocol.
bool m_configured
True if ConfigureCell() has been completed.
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
friend class MemberLteHandoverManagementSapUser< LteEnbRrc >
allow MemberLteHandoverManagementSapUser<LteEnbRrc> class friend access
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.
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.
std::map< uint32_t, X2uTeidInfo > m_x2uTeidInfoMap
TEID, RNTI, DRBID.
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.
TracedCallback< uint64_t, uint16_t, uint16_t > m_handoverFailureJoiningTrace
The 'HandoverFailureJoining' Trace source.
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.
EpcX2SapProvider * m_x2SapProvider
Interface to send messages to neighbour eNodeB over the X2 interface.
std::vector< LteEnbCmacSapProvider * > m_cmacSapProvider
Interface to the eNodeB MAC instance.
std::vector< LteRrcSap::SystemInformationBlockType1 > m_sib1
The System Information Block Type 1 that is currently broadcasted over BCH.
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.
bool m_carriersConfigured
are carriers configured
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.
TracedCallback< uint64_t, uint16_t, uint16_t > m_handoverFailureLeavingTrace
The 'HandoverFailureLeaving' Trace source.
TracedCallback< uint64_t, uint16_t, uint16_t, std::string > m_rrcTimeoutTrace
The 'TimerExpiry' Trace source.
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.
void RemoveSrsConfigurationIndex(uint16_t srcCi)
remove a previously allocated SRS configuration index
Time m_handoverJoiningTimeoutDuration
The HandoverJoiningTimeoutDuration attribute.
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.
TracedCallback< uint64_t, uint16_t, uint16_t > m_handoverEndOkTrace
The HandoverEndOk trace source.
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.
Part of the RRC protocol.
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:25
Service Access Point (SAP) offered by the MAC to the RLC See Femto Forum MAC Scheduler Interface Spec...
Definition lte-mac-sap.h:85
Service Access Point (SAP) offered by the PDCP entity to the RRC entity See 3GPP 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:27
static TypeId GetTypeId()
Get the type ID.
Definition lte-rlc-am.cc:76
This abstract base class defines the API to interact with the Radio Link Control (LTE_RLC) in LTE,...
Definition lte-rlc.h:38
static TypeId GetTypeId()
Get the type ID.
Definition lte-rlc.cc:186
static TypeId GetTypeId()
Get the type ID.
Definition lte-rlc-um.cc:45
static double ConvertPdschConfigDedicated2Double(PdschConfigDedicated pdschConfigDedicated)
Convert PDSCH config dedicated function.
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:78
Ptr< T > GetObject() const
Get a pointer to the requested aggregated Object.
Definition object.h:511
virtual void DoInitialize()
Initialize() implementation.
Definition object.cc:440
AttributeValue implementation for Pointer.
Smart pointer class similar to boost::intrusive_ptr.
static EventId Schedule(const Time &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
Definition simulator.h:560
static Time Now()
Return the current simulation virtual time.
Definition simulator.cc:197
Simulation virtual time values and global simulation resolution.
Definition nstime.h:94
AttributeValue implementation for Time.
Definition nstime.h:1431
a unique identifier for an interface.
Definition type-id.h:48
@ ATTR_GET
The attribute can be read.
Definition type-id.h:53
@ ATTR_CONSTRUCT
The attribute can be written at construction-time.
Definition type-id.h:55
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition type-id.cc:1001
Manages all the radio bearer information possessed by the ENB RRC for a single UE.
Definition lte-enb-rrc.h:57
bool m_pendingStartDataRadioBearers
Pending start data radio bearers.
void RecvRrcConnectionReestablishmentRequest(LteRrcSap::RrcConnectionReestablishmentRequest msg)
Implement the LteEnbRrcSapProvider::RecvRrcConnectionReestablishmentRequest interface.
void InitialContextSetupRequest()
Process Initial context setup request message from the MME.
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.
std::map< uint8_t, Ptr< LteDataRadioBearerInfo > > m_drbMap
The DataRadioBearerMap attribute.
Ptr< LteSignalingRadioBearerInfo > m_srb1
The Srb1 attribute.
void PrepareHandover(uint16_t cellId)
Start the handover preparation and send the handover request.
void SetImsi(uint64_t imsi)
Set the IMSI.
void SendData(uint8_t bid, Ptr< Packet > p)
Send a data packet over the appropriate Data Radio Bearer.
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
State
The state of the UeManager at the eNB RRC.
Definition lte-enb-rrc.h:67
@ CONNECTION_REESTABLISHMENT
Definition lte-enb-rrc.h:74
@ CONNECTION_RECONFIGURATION
Definition lte-enb-rrc.h:73
LteRrcSap::RadioResourceConfigDedicated GetRadioResourceConfigForHandoverPreparationInfo()
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.
LteRrcSap::RrcConnectionReconfiguration BuildRrcConnectionReconfiguration()
EventId m_handoverJoiningTimeout
Time limit before a handover joining timeout occurs.
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.
void RecvSnStatusTransfer(EpcX2SapUser::SnStatusTransferParams params)
Take the necessary actions in response to the reception of an X2 SN STATUS TRANSFER message.
~UeManager() override
uint8_t Bid2Lcid(uint8_t bid)
LteRrcSap::PhysicalConfigDedicated m_physicalConfigDedicated
physical config dedicated
void RecvRrcConnectionSetupCompleted(LteRrcSap::RrcConnectionSetupCompleted msg)
Implement the LteEnbRrcSapProvider::RecvRrcConnectionSetupCompleted interface.
std::list< uint8_t > m_drbsToBeStarted
DRBS to be started.
uint8_t m_lastAllocatedDrbid
last allocated Data Radio Bearer ID
uint8_t GetComponentCarrierId() const
void DoReceivePdcpSdu(LtePdcpSapUser::ReceivePdcpSduParameters params)
Receive PDCP SDU function.
EventId m_connectionRejectedTimeout
The delay before a connection rejected timeout occurs.
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 ...
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.
State GetState() const
uint16_t m_targetX2apId
target X2 ap ID
uint8_t Drbid2Bid(uint8_t drbid)
static TypeId GetTypeId()
Get the type ID.
Ptr< LteSignalingRadioBearerInfo > m_srb0
The Srb0 attribute.
uint64_t GetImsi() const
EventId m_connectionRequestTimeout
Time limit before a connection request timeout occurs.
uint64_t m_imsi
International Mobile Subscriber Identity assigned to this UE.
uint8_t GetNewRrcTransactionIdentifier()
bool m_caSupportConfigured
Define if the Carrier Aggregation was already configure for the current UE on not.
uint16_t m_targetCellId
target cell ID
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.
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...
LteRrcSap::NonCriticalExtensionConfiguration BuildNonCriticalExtensionConfigurationCa()
std::list< std::pair< uint8_t, Ptr< Packet > > > m_packetBuffer
Packet buffer for when UE is doing the handover.
friend class LtePdcpSpecificLtePdcpSapUser< UeManager >
allow LtePdcpSpecificLtePdcpSapUser<UeManager> class friend access
Definition lte-enb-rrc.h:59
uint8_t m_lastRrcTransactionIdentifier
last RRC transaction identifier
uint8_t m_componentCarrierId
ID of the primary CC for this UE.
State m_state
The current UeManager state.
void RecvMeasurementReport(LteRrcSap::MeasurementReport msg)
Implement the LteEnbRrcSapProvider::RecvMeasurementReport interface.
void DoInitialize() override
Initialize() implementation.
Ptr< LteEnbRrc > m_rrc
Pointer to the parent eNodeB RRC.
TracedCallback< uint64_t, uint16_t, uint16_t, State, State > m_stateTransitionTrace
The StateTransition trace source.
bool m_pendingRrcConnectionReconfiguration
pending RRC connection reconfiguration
void ReleaseDataRadioBearer(uint8_t drbid)
Release a given radio bearer.
void RecvRrcConnectionReestablishmentComplete(LteRrcSap::RrcConnectionReestablishmentComplete msg)
Implement the LteEnbRrcSapProvider::RecvRrcConnectionReestablishmentComplete interface.
uint8_t Bid2Drbid(uint8_t bid)
LteRrcSap::RrcConnectionReconfiguration GetRrcConnectionReconfigurationForHandover(uint8_t componentCarrierId)
void StartDataRadioBearers()
Start the data radio bearers that have been previously recorded to be started using RecordDataRadioBe...
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
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
uint16_t m_sourceCellId
source cell ID
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.
uint16_t m_sourceX2apId
source X2 ap ID
std::vector< EpcX2Sap::ErabToBeSetupItem > GetErabList()
void RecvRrcConnectionRequest(LteRrcSap::RrcConnectionRequest msg)
Implement the LteEnbRrcSapProvider::RecvRrcConnectionRequest interface.
uint8_t Drbid2Lcid(uint8_t drbid)
LtePdcpSapUser * m_drbPdcpSapUser
DRB PDCP SAP user.
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.
void RecvIdealUeContextRemoveRequest(uint16_t rnti)
Implement the LteEnbRrcSapProvider::RecvIdealUeContextRemoveRequest interface.
Hold an unsigned integer type.
Definition uinteger.h:34
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
Definition assert.h:55
#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:75
Ptr< const AttributeChecker > MakeBooleanChecker()
Definition boolean.cc:113
Ptr< const AttributeAccessor > MakeBooleanAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Definition boolean.h:70
Ptr< const AttributeAccessor > MakeEnumAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Definition enum.h:221
Ptr< const AttributeChecker > MakeIntegerChecker()
Definition integer.h:99
Ptr< const AttributeAccessor > MakeIntegerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Definition integer.h:35
ObjectPtrContainerValue ObjectMapValue
ObjectMapValue is an alias for ObjectPtrContainerValue.
Definition object-map.h:29
Ptr< const AttributeAccessor > MakeObjectMapAccessor(U T::*memberVariable)
MakeAccessorHelper implementation for ObjectVector.
Definition object-map.h:65
Ptr< const AttributeChecker > MakeObjectMapChecker()
Definition object-map.h:110
Ptr< const AttributeAccessor > MakePointerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Definition pointer.h:248
Ptr< AttributeChecker > MakePointerChecker()
Create a PointerChecker for a type.
Definition pointer.h:269
Ptr< const AttributeAccessor > MakeTimeAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Definition nstime.h:1432
Ptr< const AttributeChecker > MakeTimeChecker()
Helper to make an unbounded Time checker.
Definition nstime.h:1452
Ptr< const AttributeChecker > MakeUintegerChecker()
Definition uinteger.h:85
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Definition uinteger.h:35
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
#define NS_ABORT_MSG_IF(cond, msg)
Abnormal program termination if a condition is true, with a message.
Definition abort.h:97
#define NS_ABORT_IF(cond)
Abnormal program termination if a condition is true.
Definition abort.h:65
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition log.h:191
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Definition log.h:257
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
Definition log.h:271
#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:250
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
Definition log.h:264
Ptr< T > CreateObject(Args &&... args)
Create an object by type, with varying number of constructor parameters.
Definition object.h:619
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition object-base.h:35
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition nstime.h:1356
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.
std::ostream & operator<<(std::ostream &os, const Angles &a)
Definition angles.cc:148
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:179
Ptr< T1 > DynamicCast(const Ptr< T2 > &p)
Cast a Ptr.
Definition ptr.h:580
constexpr uint32_t MIN_NO_CC
Minimum number of carrier components allowed by 3GPP up to R13.
Definition lte-common.h:25
constexpr uint32_t MAX_NO_CC
Maximum number of carrier components allowed by 3GPP up to R13.
Definition lte-common.h:28
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.
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:65
E-RABs to be setup item as it is used in the HANDOVER REQUEST message.
Definition epc-x2-sap.h:49
bool dlForwarding
DL forwarding.
Definition epc-x2-sap.h:52
Ipv4Address transportLayerAddress
transport layer address
Definition epc-x2-sap.h:53
EpsBearer erabLevelQosParameters
E-RAB level QOS parameters.
Definition epc-x2-sap.h:51
ErabsSubjectToStatusTransferItem structure.
Definition epc-x2-sap.h:91
Parameters of the HANDOVER CANCEL message.
Definition epc-x2-sap.h:334
Parameters of the HANDOVER PREPARATION FAILURE message.
Definition epc-x2-sap.h:253
Parameters of the HANDOVER REQUEST ACKNOWLEDGE message.
Definition epc-x2-sap.h:237
std::vector< ErabAdmittedItem > admittedBearers
admitted bearers
Definition epc-x2-sap.h:242
uint16_t sourceCellId
source cell ID
Definition epc-x2-sap.h:240
uint16_t newEnbUeX2apId
new ENB UE X2 AP ID
Definition epc-x2-sap.h:239
uint16_t targetCellId
target cell ID
Definition epc-x2-sap.h:241
uint16_t oldEnbUeX2apId
old ENB UE X2 AP ID
Definition epc-x2-sap.h:238
Ptr< Packet > rrcContext
RRC context.
Definition epc-x2-sap.h:244
Parameters of the HANDOVER REQUEST message.
Definition epc-x2-sap.h:219
uint16_t oldEnbUeX2apId
old ENB UE X2 AP ID
Definition epc-x2-sap.h:220
uint16_t sourceCellId
source cell ID
Definition epc-x2-sap.h:222
uint16_t targetCellId
target cell ID
Definition epc-x2-sap.h:223
uint32_t mmeUeS1apId
MME UE S1 AP ID.
Definition epc-x2-sap.h:224
std::vector< ErabToBeSetupItem > bearers
bearers
Definition epc-x2-sap.h:227
Parameters of the LOAD INFORMATION message.
Definition epc-x2-sap.h:295
Parameters of the RESOURCE STATUS UPDATE message.
Definition epc-x2-sap.h:306
Parameters of the SN STATUS TRANSFER message.
Definition epc-x2-sap.h:267
uint16_t newEnbUeX2apId
new ENB UE X2 AP ID
Definition epc-x2-sap.h:269
std::vector< ErabsSubjectToStatusTransferItem > erabsSubjectToStatusTransferList
ERABs subject to status transfer list.
Definition epc-x2-sap.h:273
uint16_t oldEnbUeX2apId
old ENB UE X2 AP ID
Definition epc-x2-sap.h:268
uint16_t targetCellId
target cell ID
Definition epc-x2-sap.h:271
uint16_t sourceCellId
source cell ID
Definition epc-x2-sap.h:270
Parameters of the UE CONTEXT RELEASE message.
Definition epc-x2-sap.h:282
uint16_t newEnbUeX2apId
new ENB UE X2 AP ID
Definition epc-x2-sap.h:284
uint16_t oldEnbUeX2apId
old ENB UE X2 AP ID
Definition epc-x2-sap.h:283
uint16_t sourceCellId
source cell ID
Definition epc-x2-sap.h:285
uint16_t targetCellId
target cell ID
Definition epc-x2-sap.h:286
Parameters of the UE DATA primitive.
Definition epc-x2-sap.h:321
uint64_t gbrUl
Guaranteed Bit Rate (bit/s) in uplink.
Definition eps-bearer.h:32
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.
Definition