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