A Discrete-Event Network Simulator
API
lte-enb-rrc.cc
Go to the documentation of this file.
1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
4  * Copyright (c) 2018 Fraunhofer ESK : RLF extensions
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation;
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18  *
19  * Authors: Nicola Baldo <nbaldo@cttc.es>
20  * Marco Miozzo <mmiozzo@cttc.es>
21  * Manuel Requena <manuel.requena@cttc.es>
22  * Modified by: Danilo Abrignani <danilo.abrignani@unibo.it> (Carrier Aggregation - GSoC 2015),
23  * Biljana Bojovic <biljana.bojovic@cttc.es> (Carrier Aggregation)
24  * Vignesh Babu <ns3-dev@esk.fraunhofer.de> (RLF extensions)
25  */
26 
27 #include "lte-enb-rrc.h"
28 
29 #include <ns3/fatal-error.h>
30 #include <ns3/log.h>
31 #include <ns3/abort.h>
32 
33 #include <ns3/pointer.h>
34 #include <ns3/object-map.h>
35 #include <ns3/object-factory.h>
36 #include <ns3/simulator.h>
37 
38 #include <ns3/lte-radio-bearer-info.h>
39 #include <ns3/eps-bearer-tag.h>
40 #include <ns3/packet.h>
41 
42 #include <ns3/lte-rlc.h>
43 #include <ns3/lte-rlc-tm.h>
44 #include <ns3/lte-rlc-um.h>
45 #include <ns3/lte-rlc-am.h>
46 #include <ns3/lte-pdcp.h>
47 
48 
49 
50 
51 namespace ns3 {
52 
53 NS_LOG_COMPONENT_DEFINE ("LteEnbRrc");
54 
56 // CMAC SAP forwarder
58 
63 {
64 public:
71  EnbRrcMemberLteEnbCmacSapUser (LteEnbRrc* rrc, uint8_t componentCarrierId);
72 
73  virtual uint16_t AllocateTemporaryCellRnti ();
74  virtual void NotifyLcConfigResult (uint16_t rnti, uint8_t lcid, bool success);
75  virtual void RrcConfigurationUpdateInd (UeConfig params);
76  virtual bool IsRandomAccessCompleted (uint16_t rnti);
77 
78 private:
81 };
82 
84  : m_rrc (rrc)
85  , m_componentCarrierId {componentCarrierId}
86 {
87 }
88 
89 uint16_t
91 {
93 }
94 
95 void
96 EnbRrcMemberLteEnbCmacSapUser::NotifyLcConfigResult (uint16_t rnti, uint8_t lcid, bool success)
97 {
98  m_rrc->DoNotifyLcConfigResult (rnti, lcid, success);
99 }
100 
101 void
103 {
105 }
106 
107 bool
109 {
110  return m_rrc->IsRandomAccessCompleted (rnti);
111 }
112 
113 
114 
116 // UeManager
118 
119 
121 static const std::string g_ueManagerStateName[UeManager::NUM_STATES] =
122 {
123  "INITIAL_RANDOM_ACCESS",
124  "CONNECTION_SETUP",
125  "CONNECTION_REJECTED",
126  "ATTACH_REQUEST",
127  "CONNECTED_NORMALLY",
128  "CONNECTION_RECONFIGURATION",
129  "CONNECTION_REESTABLISHMENT",
130  "HANDOVER_PREPARATION",
131  "HANDOVER_JOINING",
132  "HANDOVER_PATH_SWITCH",
133  "HANDOVER_LEAVING",
134 };
135 
140 static const std::string & ToString (UeManager::State s)
141 {
142  return g_ueManagerStateName[s];
143 }
144 
145 
146 NS_OBJECT_ENSURE_REGISTERED (UeManager);
147 
148 
150 {
151  NS_FATAL_ERROR ("this constructor is not espected to be used");
152 }
153 
154 
155 UeManager::UeManager (Ptr<LteEnbRrc> rrc, uint16_t rnti, State s, uint8_t componentCarrierId)
156  : m_lastAllocatedDrbid (0),
157  m_rnti (rnti),
158  m_imsi (0),
159  m_componentCarrierId (componentCarrierId),
160  m_lastRrcTransactionIdentifier (0),
161  m_rrc (rrc),
162  m_state (s),
163  m_pendingRrcConnectionReconfiguration (false),
164  m_sourceX2apId (0),
165  m_sourceCellId (0),
166  m_needPhyMacConfiguration (false),
167  m_caSupportConfigured (false),
168  m_pendingStartDataRadioBearers (false)
169 {
170  NS_LOG_FUNCTION (this);
171 }
172 
173 void
175 {
176  NS_LOG_FUNCTION (this);
178 
180  m_physicalConfigDedicated.antennaInfo.transmissionMode = m_rrc->m_defaultTransmissionMode;
187 
188 
189  for (uint8_t i = 0; i < m_rrc->m_numberOfComponentCarriers; i++)
190  {
191  m_rrc->m_cmacSapProvider.at (i)->AddUe (m_rnti);
192  m_rrc->m_cphySapProvider.at (i)->AddUe (m_rnti);
193  }
194 
195  // setup the eNB side of SRB0
196  {
197  uint8_t lcid = 0;
198 
199  Ptr<LteRlc> rlc = CreateObject<LteRlcTm> ()->GetObject<LteRlc> ();
200  rlc->SetLteMacSapProvider (m_rrc->m_macSapProvider);
201  rlc->SetRnti (m_rnti);
202  rlc->SetLcId (lcid);
203 
204  m_srb0 = CreateObject<LteSignalingRadioBearerInfo> ();
205  m_srb0->m_rlc = rlc;
206  m_srb0->m_srbIdentity = 0;
207  // no need to store logicalChannelConfig as SRB0 is pre-configured
208 
210  lcinfo.rnti = m_rnti;
211  lcinfo.lcId = lcid;
212  // Initialise the rest of lcinfo structure even if CCCH (LCID 0) is pre-configured, and only m_rnti and lcid will be used from passed lcinfo structure.
213  // See FF LTE MAC Scheduler Iinterface Specification v1.11, 4.3.4 logicalChannelConfigListElement
214  lcinfo.lcGroup = 0;
215  lcinfo.qci = 0;
216  lcinfo.isGbr = false;
217  lcinfo.mbrUl = 0;
218  lcinfo.mbrDl = 0;
219  lcinfo.gbrUl = 0;
220  lcinfo.gbrDl = 0;
221 
222  // MacSapUserForRlc in the ComponentCarrierManager MacSapUser
223  LteMacSapUser* lteMacSapUser = m_rrc->m_ccmRrcSapProvider->ConfigureSignalBearer(lcinfo, rlc->GetLteMacSapUser ());
224  // Signal Channel are only on Primary Carrier
225  m_rrc->m_cmacSapProvider.at (m_componentCarrierId)->AddLc (lcinfo, lteMacSapUser);
226  m_rrc->m_ccmRrcSapProvider->AddLc (lcinfo, lteMacSapUser);
227  }
228 
229  // setup the eNB side of SRB1; the UE side will be set up upon RRC connection establishment
230  {
231  uint8_t lcid = 1;
232 
233  Ptr<LteRlc> rlc = CreateObject<LteRlcAm> ()->GetObject<LteRlc> ();
234  rlc->SetLteMacSapProvider (m_rrc->m_macSapProvider);
235  rlc->SetRnti (m_rnti);
236  rlc->SetLcId (lcid);
237 
238  Ptr<LtePdcp> pdcp = CreateObject<LtePdcp> ();
239  pdcp->SetRnti (m_rnti);
240  pdcp->SetLcId (lcid);
241  pdcp->SetLtePdcpSapUser (m_drbPdcpSapUser);
242  pdcp->SetLteRlcSapProvider (rlc->GetLteRlcSapProvider ());
243  rlc->SetLteRlcSapUser (pdcp->GetLteRlcSapUser ());
244 
245  m_srb1 = CreateObject<LteSignalingRadioBearerInfo> ();
246  m_srb1->m_rlc = rlc;
247  m_srb1->m_pdcp = pdcp;
248  m_srb1->m_srbIdentity = 1;
249  m_srb1->m_logicalChannelConfig.priority = 1;
250  m_srb1->m_logicalChannelConfig.prioritizedBitRateKbps = 100;
251  m_srb1->m_logicalChannelConfig.bucketSizeDurationMs = 100;
252  m_srb1->m_logicalChannelConfig.logicalChannelGroup = 0;
253 
255  lcinfo.rnti = m_rnti;
256  lcinfo.lcId = lcid;
257  lcinfo.lcGroup = 0; // all SRBs always mapped to LCG 0
258  lcinfo.qci = EpsBearer::GBR_CONV_VOICE; // not sure why the FF API requires a CQI even for SRBs...
259  lcinfo.isGbr = true;
260  lcinfo.mbrUl = 1e6;
261  lcinfo.mbrDl = 1e6;
262  lcinfo.gbrUl = 1e4;
263  lcinfo.gbrDl = 1e4;
264  // MacSapUserForRlc in the ComponentCarrierManager MacSapUser
265  LteMacSapUser* MacSapUserForRlc = m_rrc->m_ccmRrcSapProvider->ConfigureSignalBearer(lcinfo, rlc->GetLteMacSapUser ());
266  // Signal Channel are only on Primary Carrier
267  m_rrc->m_cmacSapProvider.at (m_componentCarrierId)->AddLc (lcinfo, MacSapUserForRlc);
268  m_rrc->m_ccmRrcSapProvider->AddLc (lcinfo, MacSapUserForRlc);
269  }
270 
272  ueParams.srb0SapProvider = m_srb0->m_rlc->GetLteRlcSapProvider ();
273  ueParams.srb1SapProvider = m_srb1->m_pdcp->GetLtePdcpSapProvider ();
274  m_rrc->m_rrcSapUser->SetupUe (m_rnti, ueParams);
275 
276  // configure MAC (and scheduler)
278  req.m_rnti = m_rnti;
280 
281  // configure PHY
282  for (uint16_t i = 0; i < m_rrc->m_numberOfComponentCarriers; i++)
283  {
284  m_rrc->m_cmacSapProvider.at (i)->UeUpdateConfigurationReq (req);
285  m_rrc->m_cphySapProvider.at (i)->SetTransmissionMode (m_rnti, m_physicalConfigDedicated.antennaInfo.transmissionMode);
286  m_rrc->m_cphySapProvider.at (i)->SetSrsConfigurationIndex (m_rnti, m_physicalConfigDedicated.soundingRsUlConfigDedicated.srsConfigIndex);
287  }
288  // schedule this UeManager instance to be deleted if the UE does not give any sign of life within a reasonable time
289  Time maxConnectionDelay;
290  switch (m_state)
291  {
293  m_connectionRequestTimeout = Simulator::Schedule (m_rrc->m_connectionRequestTimeoutDuration,
295  m_rrc, m_rnti);
296  break;
297 
298  case HANDOVER_JOINING:
299  m_handoverJoiningTimeout = Simulator::Schedule (m_rrc->m_handoverJoiningTimeoutDuration,
301  m_rrc, m_rnti);
302  break;
303 
304  default:
305  NS_FATAL_ERROR ("unexpected state " << ToString (m_state));
306  break;
307  }
308  m_caSupportConfigured = false;
309 }
310 
311 
313 {
314 }
315 
316 void
318 {
319  delete m_drbPdcpSapUser;
320  // delete eventual X2-U TEIDs
321  for (std::map <uint8_t, Ptr<LteDataRadioBearerInfo> >::iterator it = m_drbMap.begin ();
322  it != m_drbMap.end ();
323  ++it)
324  {
325  m_rrc->m_x2uTeidInfoMap.erase (it->second->m_gtpTeid);
326  }
327 
328 }
329 
331 {
332  static TypeId tid = TypeId ("ns3::UeManager")
333  .SetParent<Object> ()
334  .AddConstructor<UeManager> ()
335  .AddAttribute ("DataRadioBearerMap", "List of UE DataRadioBearerInfo by DRBID.",
336  ObjectMapValue (),
338  MakeObjectMapChecker<LteDataRadioBearerInfo> ())
339  .AddAttribute ("Srb0", "SignalingRadioBearerInfo for SRB0",
340  PointerValue (),
342  MakePointerChecker<LteSignalingRadioBearerInfo> ())
343  .AddAttribute ("Srb1", "SignalingRadioBearerInfo for SRB1",
344  PointerValue (),
346  MakePointerChecker<LteSignalingRadioBearerInfo> ())
347  .AddAttribute ("C-RNTI",
348  "Cell Radio Network Temporary Identifier",
349  TypeId::ATTR_GET, // read-only attribute
350  UintegerValue (0), // unused, read-only attribute
352  MakeUintegerChecker<uint16_t> ())
353  .AddTraceSource ("StateTransition",
354  "fired upon every UE state transition seen by the "
355  "UeManager at the eNB RRC",
357  "ns3::UeManager::StateTracedCallback")
358  .AddTraceSource ("DrbCreated",
359  "trace fired after DRB is created",
361  "ns3::UeManager::ImsiCidRntiLcIdTracedCallback")
362  ;
363  return tid;
364 }
365 
366 void
367 UeManager::SetSource (uint16_t sourceCellId, uint16_t sourceX2apId)
368 {
369  m_sourceX2apId = sourceX2apId;
370  m_sourceCellId = sourceCellId;
371 }
372 
373 void
374 UeManager::SetImsi (uint64_t imsi)
375 {
376  m_imsi = imsi;
377 }
378 
379 void
381 {
382  NS_LOG_FUNCTION (this << m_rnti);
383 
384  if (m_state == ATTACH_REQUEST)
385  {
387  }
388  else
389  {
390  NS_FATAL_ERROR ("method unexpected in state " << ToString (m_state));
391  }
392 }
393 
394 void
395 UeManager::SetupDataRadioBearer (EpsBearer bearer, uint8_t bearerId, uint32_t gtpTeid, Ipv4Address transportLayerAddress)
396 {
397  NS_LOG_FUNCTION (this << (uint32_t) m_rnti);
398 
399  Ptr<LteDataRadioBearerInfo> drbInfo = CreateObject<LteDataRadioBearerInfo> ();
400  uint8_t drbid = AddDataRadioBearerInfo (drbInfo);
401  uint8_t lcid = Drbid2Lcid (drbid);
402  uint8_t bid = Drbid2Bid (drbid);
403  NS_ASSERT_MSG ( bearerId == 0 || bid == bearerId, "bearer ID mismatch (" << (uint32_t) bid << " != " << (uint32_t) bearerId << ", the assumption that ID are allocated in the same way by MME and RRC is not valid any more");
404  drbInfo->m_epsBearer = bearer;
405  drbInfo->m_epsBearerIdentity = bid;
406  drbInfo->m_drbIdentity = drbid;
407  drbInfo->m_logicalChannelIdentity = lcid;
408  drbInfo->m_gtpTeid = gtpTeid;
409  drbInfo->m_transportLayerAddress = transportLayerAddress;
410 
411  if (m_state == HANDOVER_JOINING)
412  {
413  // setup TEIDs for receiving data eventually forwarded over X2-U
414  LteEnbRrc::X2uTeidInfo x2uTeidInfo;
415  x2uTeidInfo.rnti = m_rnti;
416  x2uTeidInfo.drbid = drbid;
417  std::pair<std::map<uint32_t, LteEnbRrc::X2uTeidInfo>::iterator, bool>
418  ret = m_rrc->m_x2uTeidInfoMap.insert (std::pair<uint32_t, LteEnbRrc::X2uTeidInfo> (gtpTeid, x2uTeidInfo));
419  NS_ASSERT_MSG (ret.second == true, "overwriting a pre-existing entry in m_x2uTeidInfoMap");
420  }
421 
422  TypeId rlcTypeId = m_rrc->GetRlcType (bearer);
423 
424  ObjectFactory rlcObjectFactory;
425  rlcObjectFactory.SetTypeId (rlcTypeId);
426  Ptr<LteRlc> rlc = rlcObjectFactory.Create ()->GetObject<LteRlc> ();
427  rlc->SetLteMacSapProvider (m_rrc->m_macSapProvider);
428  rlc->SetRnti (m_rnti);
429 
430  drbInfo->m_rlc = rlc;
431 
432  rlc->SetLcId (lcid);
433 
434  // we need PDCP only for real RLC, i.e., RLC/UM or RLC/AM
435  // if we are using RLC/SM we don't care of anything above RLC
436  if (rlcTypeId != LteRlcSm::GetTypeId ())
437  {
438  Ptr<LtePdcp> pdcp = CreateObject<LtePdcp> ();
439  pdcp->SetRnti (m_rnti);
440  pdcp->SetLcId (lcid);
441  pdcp->SetLtePdcpSapUser (m_drbPdcpSapUser);
442  pdcp->SetLteRlcSapProvider (rlc->GetLteRlcSapProvider ());
443  rlc->SetLteRlcSapUser (pdcp->GetLteRlcSapUser ());
444  drbInfo->m_pdcp = pdcp;
445  }
446 
447  m_drbCreatedTrace (m_imsi, m_rrc->ComponentCarrierToCellId (m_componentCarrierId), m_rnti, lcid);
448 
449  std::vector<LteCcmRrcSapProvider::LcsConfig> lcOnCcMapping = m_rrc->m_ccmRrcSapProvider->SetupDataRadioBearer (bearer, bearerId, m_rnti, lcid, m_rrc->GetLogicalChannelGroup (bearer), rlc->GetLteMacSapUser ());
450  // LteEnbCmacSapProvider::LcInfo lcinfo;
451  // lcinfo.rnti = m_rnti;
452  // lcinfo.lcId = lcid;
453  // lcinfo.lcGroup = m_rrc->GetLogicalChannelGroup (bearer);
454  // lcinfo.qci = bearer.qci;
455  // lcinfo.isGbr = bearer.IsGbr ();
456  // lcinfo.mbrUl = bearer.gbrQosInfo.mbrUl;
457  // lcinfo.mbrDl = bearer.gbrQosInfo.mbrDl;
458  // lcinfo.gbrUl = bearer.gbrQosInfo.gbrUl;
459  // lcinfo.gbrDl = bearer.gbrQosInfo.gbrDl;
460  // use a for cycle to send the AddLc to the appropriate Mac Sap
461  // if the sap is not initialized the appropriated method has to be called
462  std::vector<LteCcmRrcSapProvider::LcsConfig>::iterator itLcOnCcMapping = lcOnCcMapping.begin ();
463  NS_ASSERT_MSG (itLcOnCcMapping != lcOnCcMapping.end (), "Problem");
464  for (itLcOnCcMapping = lcOnCcMapping.begin (); itLcOnCcMapping != lcOnCcMapping.end (); ++itLcOnCcMapping)
465  {
466  NS_LOG_DEBUG (this << " RNTI " << itLcOnCcMapping->lc.rnti << "Lcid " << (uint16_t) itLcOnCcMapping->lc.lcId << " lcGroup " << (uint16_t) itLcOnCcMapping->lc.lcGroup << " ComponentCarrierId " << itLcOnCcMapping->componentCarrierId);
467  uint8_t index = itLcOnCcMapping->componentCarrierId;
468  LteEnbCmacSapProvider::LcInfo lcinfo = itLcOnCcMapping->lc;
469  LteMacSapUser *msu = itLcOnCcMapping->msu;
470  m_rrc->m_cmacSapProvider.at (index)->AddLc (lcinfo, msu);
471  m_rrc->m_ccmRrcSapProvider->AddLc (lcinfo, msu);
472  }
473 
474  if (rlcTypeId == LteRlcAm::GetTypeId ())
475  {
476  drbInfo->m_rlcConfig.choice = LteRrcSap::RlcConfig::AM;
477  }
478  else
479  {
480  drbInfo->m_rlcConfig.choice = LteRrcSap::RlcConfig::UM_BI_DIRECTIONAL;
481  }
482 
483  drbInfo->m_logicalChannelIdentity = lcid;
484  drbInfo->m_logicalChannelConfig.priority = m_rrc->GetLogicalChannelPriority (bearer);
485  drbInfo->m_logicalChannelConfig.logicalChannelGroup = m_rrc->GetLogicalChannelGroup (bearer);
486  if (bearer.IsGbr ())
487  {
488  drbInfo->m_logicalChannelConfig.prioritizedBitRateKbps = bearer.gbrQosInfo.gbrUl;
489  }
490  else
491  {
492  drbInfo->m_logicalChannelConfig.prioritizedBitRateKbps = 0;
493  }
494  drbInfo->m_logicalChannelConfig.bucketSizeDurationMs = 1000;
495 
497 }
498 
499 void
501 {
502  NS_LOG_FUNCTION (this << (uint32_t) m_rnti);
503  for (std::map <uint8_t, Ptr<LteDataRadioBearerInfo> >::iterator it = m_drbMap.begin ();
504  it != m_drbMap.end ();
505  ++it)
506  {
507  m_drbsToBeStarted.push_back (it->first);
508  }
509 }
510 
511 void
513 {
514  NS_LOG_FUNCTION (this << (uint32_t) m_rnti);
515  for (std::list <uint8_t>::iterator drbIdIt = m_drbsToBeStarted.begin ();
516  drbIdIt != m_drbsToBeStarted.end ();
517  ++drbIdIt)
518  {
519  std::map <uint8_t, Ptr<LteDataRadioBearerInfo> >::iterator drbIt = m_drbMap.find (*drbIdIt);
520  NS_ASSERT (drbIt != m_drbMap.end ());
521  drbIt->second->m_rlc->Initialize ();
522  if (drbIt->second->m_pdcp)
523  {
524  drbIt->second->m_pdcp->Initialize ();
525  }
526  }
527  m_drbsToBeStarted.clear ();
528 }
529 
530 
531 void
533 {
534  NS_LOG_FUNCTION (this << (uint32_t) m_rnti << (uint32_t) drbid);
535  uint8_t lcid = Drbid2Lcid (drbid);
536  std::map <uint8_t, Ptr<LteDataRadioBearerInfo> >::iterator it = m_drbMap.find (drbid);
537  NS_ASSERT_MSG (it != m_drbMap.end (), "request to remove radio bearer with unknown drbid " << drbid);
538 
539  // first delete eventual X2-U TEIDs
540  m_rrc->m_x2uTeidInfoMap.erase (it->second->m_gtpTeid);
541 
542  m_drbMap.erase (it);
543  std::vector<uint8_t> ccToRelease = m_rrc->m_ccmRrcSapProvider->ReleaseDataRadioBearer (m_rnti, lcid);
544  std::vector<uint8_t>::iterator itCcToRelease = ccToRelease.begin ();
545  NS_ASSERT_MSG (itCcToRelease != ccToRelease.end (), "request to remove radio bearer with unknown drbid (ComponentCarrierManager)");
546  for (itCcToRelease = ccToRelease.begin (); itCcToRelease != ccToRelease.end (); ++itCcToRelease)
547  {
548  m_rrc->m_cmacSapProvider.at (*itCcToRelease)->ReleaseLc (m_rnti, lcid);
549  }
551  rrcd.havePhysicalConfigDedicated = false;
552  rrcd.drbToReleaseList.push_back (drbid);
553  //populating RadioResourceConfigDedicated information element as per 3GPP TS 36.331 version 9.2.0
554  rrcd.havePhysicalConfigDedicated = true;
556 
557  //populating RRCConnectionReconfiguration message as per 3GPP TS 36.331 version 9.2.0 Release 9
559  msg.haveMeasConfig = false;
560  msg.haveMobilityControlInfo = false;
561  msg.radioResourceConfigDedicated = rrcd;
563  // ToDo: Resend in any case this configuration
564  // needs to be initialized
565  msg.haveNonCriticalExtension = false;
566  //RRC Connection Reconfiguration towards UE
567  m_rrc->m_rrcSapUser->SendRrcConnectionReconfiguration (m_rnti, msg);
568 }
569 
570 void
571 LteEnbRrc::DoSendReleaseDataRadioBearer (uint64_t imsi, uint16_t rnti, uint8_t bearerId)
572 {
573  NS_LOG_FUNCTION (this << imsi << rnti << (uint16_t) bearerId);
574  Ptr<UeManager> ueManager = GetUeManager (rnti);
575  // Bearer de-activation towards UE
576  ueManager->ReleaseDataRadioBearer (bearerId);
577  // Bearer de-activation indication towards epc-enb application
578  m_s1SapProvider->DoSendReleaseIndication (imsi,rnti,bearerId);
579 }
580 
581 void
583 {
584  NS_LOG_FUNCTION (this << m_rnti);
585 
586  //release the bearer info for the UE at SGW/PGW
587  if (m_rrc->m_s1SapProvider != 0) //if EPC is enabled
588  {
589  for (const auto &it:m_drbMap)
590  {
591  NS_LOG_DEBUG ("Sending release of bearer id : " << (uint16_t) (it.first)
592  << "LCID : "
593  << (uint16_t) (it.second->m_logicalChannelIdentity));
594  // Bearer de-activation indication towards epc-enb application
595  m_rrc->m_s1SapProvider->DoSendReleaseIndication (GetImsi (), rnti, it.first);
596  }
597  }
598 }
599 
600 void
602 {
603  NS_LOG_FUNCTION (this);
604  switch (m_state)
605  {
607  case CONNECTION_SETUP:
608  case ATTACH_REQUEST:
612  case HANDOVER_JOINING:
613  case HANDOVER_LEAVING:
614  // a previous reconfiguration still ongoing, we need to wait for it to be finished
616  break;
617 
618  case CONNECTED_NORMALLY:
619  {
622  m_rrc->m_rrcSapUser->SendRrcConnectionReconfiguration (m_rnti, msg);
625  }
626  break;
627 
628  default:
629  NS_FATAL_ERROR ("method unexpected in state " << ToString (m_state));
630  break;
631  }
632 }
633 
634 void
635 UeManager::PrepareHandover (uint16_t cellId)
636 {
637  NS_LOG_FUNCTION (this << cellId);
638  switch (m_state)
639  {
640  case CONNECTED_NORMALLY:
641  {
642  m_targetCellId = cellId;
643 
644  auto sourceComponentCarrier = DynamicCast<ComponentCarrierEnb> (m_rrc->m_componentCarrierPhyConf.at (m_componentCarrierId));
645  NS_ASSERT (m_targetCellId != sourceComponentCarrier->GetCellId ());
646 
647  if (m_rrc->HasCellId (cellId))
648  {
649  // Intra-eNB handover
650  NS_LOG_DEBUG ("Intra-eNB handover for cellId " << cellId);
651  uint8_t componentCarrierId = m_rrc->CellToComponentCarrierId (cellId);
652  uint16_t rnti = m_rrc->AddUe (UeManager::HANDOVER_JOINING, componentCarrierId);
653  LteEnbCmacSapProvider::AllocateNcRaPreambleReturnValue anrcrv = m_rrc->m_cmacSapProvider.at (componentCarrierId)->AllocateNcRaPreamble (rnti);
654  if (anrcrv.valid == false)
655  {
656  NS_LOG_INFO (this << " failed to allocate a preamble for non-contention based RA => cannot perform HO");
657  NS_FATAL_ERROR ("should trigger HO Preparation Failure, but it is not implemented");
658  return;
659  }
660 
661  Ptr<UeManager> ueManager = m_rrc->GetUeManager (rnti);
662  ueManager->SetSource (sourceComponentCarrier->GetCellId (), m_rnti);
663  ueManager->SetImsi (m_imsi);
664 
665  // Setup data radio bearers
666  for (auto &it: m_drbMap)
667  {
668  ueManager->SetupDataRadioBearer (it.second->m_epsBearer,
669  it.second->m_epsBearerIdentity,
670  it.second->m_gtpTeid,
671  it.second->m_transportLayerAddress);
672 
673  }
674 
676 
677  handoverCommand.mobilityControlInfo.newUeIdentity = rnti;
678  handoverCommand.mobilityControlInfo.haveRachConfigDedicated = true;
681 
682  LteEnbCmacSapProvider::RachConfig rc = m_rrc->m_cmacSapProvider.at (componentCarrierId)->GetRachConfig ();
686 
687  m_rrc->m_rrcSapUser->SendRrcConnectionReconfiguration (m_rnti, handoverCommand);
688 
689  // We skip handover preparation
691  m_handoverLeavingTimeout = Simulator::Schedule (m_rrc->m_handoverLeavingTimeoutDuration,
693  m_rrc, m_rnti);
694  m_rrc->m_handoverStartTrace (m_imsi, sourceComponentCarrier->GetCellId (), m_rnti, handoverCommand.mobilityControlInfo.targetPhysCellId);
695  }
696  else
697  {
698  // Inter-eNB aka X2 handover
699  NS_LOG_DEBUG ("Inter-eNB handover (i.e., X2) for cellId " << cellId);
701  params.oldEnbUeX2apId = m_rnti;
703  params.sourceCellId = m_rrc->ComponentCarrierToCellId (m_componentCarrierId);
704  params.targetCellId = cellId;
705  params.mmeUeS1apId = m_imsi;
706  params.ueAggregateMaxBitRateDownlink = 200 * 1000;
707  params.ueAggregateMaxBitRateUplink = 100 * 1000;
708  params.bearers = GetErabList ();
709 
712  hpi.asConfig.sourceDlCarrierFreq = sourceComponentCarrier->GetDlEarfcn ();
713  hpi.asConfig.sourceMeasConfig = m_rrc->m_ueMeasConfig;
715  hpi.asConfig.sourceMasterInformationBlock.dlBandwidth = sourceComponentCarrier->GetDlBandwidth ();
717  hpi.asConfig.sourceSystemInformationBlockType1.cellAccessRelatedInfo.plmnIdentityInfo.plmnIdentity = m_rrc->m_sib1.at (m_componentCarrierId).cellAccessRelatedInfo.plmnIdentityInfo.plmnIdentity;
719  hpi.asConfig.sourceSystemInformationBlockType1.cellAccessRelatedInfo.csgIndication = m_rrc->m_sib1.at (m_componentCarrierId).cellAccessRelatedInfo.csgIndication;
720  hpi.asConfig.sourceSystemInformationBlockType1.cellAccessRelatedInfo.csgIdentity = m_rrc->m_sib1.at (m_componentCarrierId).cellAccessRelatedInfo.csgIdentity;
721  LteEnbCmacSapProvider::RachConfig rc = m_rrc->m_cmacSapProvider.at (m_componentCarrierId)->GetRachConfig ();
726  hpi.asConfig.sourceSystemInformationBlockType2.freqInfo.ulCarrierFreq = sourceComponentCarrier->GetUlEarfcn ();
727  hpi.asConfig.sourceSystemInformationBlockType2.freqInfo.ulBandwidth = sourceComponentCarrier->GetUlBandwidth ();
728  params.rrcContext = m_rrc->m_rrcSapUser->EncodeHandoverPreparationInformation (hpi);
729 
730  NS_LOG_LOGIC ("oldEnbUeX2apId = " << params.oldEnbUeX2apId);
731  NS_LOG_LOGIC ("sourceCellId = " << params.sourceCellId);
732  NS_LOG_LOGIC ("targetCellId = " << params.targetCellId);
733  NS_LOG_LOGIC ("mmeUeS1apId = " << params.mmeUeS1apId);
734  NS_LOG_LOGIC ("rrcContext = " << params.rrcContext);
735 
736  m_rrc->m_x2SapProvider->SendHandoverRequest (params);
738  }
739  }
740  break;
741 
742  default:
743  NS_FATAL_ERROR ("method unexpected in state " << ToString (m_state));
744  break;
745  }
746 
747 }
748 
749 void
751 {
752  NS_LOG_FUNCTION (this);
753 
754  NS_ASSERT_MSG (params.notAdmittedBearers.empty (), "not admission of some bearers upon handover is not supported");
755  NS_ASSERT_MSG (params.admittedBearers.size () == m_drbMap.size (), "not enough bearers in admittedBearers");
756 
757  // note: the Handover command from the target eNB to the source eNB
758  // is expected to be sent transparently to the UE; however, here we
759  // decode the message and eventually re-encode it. This way we can
760  // support both a real RRC protocol implementation and an ideal one
761  // without actual RRC protocol encoding.
762 
763  Ptr<Packet> encodedHandoverCommand = params.rrcContext;
764  LteRrcSap::RrcConnectionReconfiguration handoverCommand = m_rrc->m_rrcSapUser->DecodeHandoverCommand (encodedHandoverCommand);
765  if (handoverCommand.haveNonCriticalExtension)
766  {
767  //Total number of component carriers = handoverCommand.nonCriticalExtension.sCellToAddModList.size() + 1 (Primary carrier)
768  if (handoverCommand.nonCriticalExtension.sCellToAddModList.size() + 1 != m_rrc->m_numberOfComponentCarriers)
769  {
770  //Currently handover is only possible if source and target eNBs have equal number of component carriers
771  NS_FATAL_ERROR ("The source and target eNBs have unequal number of component carriers. Target eNB CCs = "
772  << handoverCommand.nonCriticalExtension.sCellToAddModList.size() + 1
773  << " Source eNB CCs = " << m_rrc->m_numberOfComponentCarriers);
774  }
775  }
776  m_rrc->m_rrcSapUser->SendRrcConnectionReconfiguration (m_rnti, handoverCommand);
778  m_handoverLeavingTimeout = Simulator::Schedule (m_rrc->m_handoverLeavingTimeoutDuration,
780  m_rrc, m_rnti);
781  NS_ASSERT (handoverCommand.haveMobilityControlInfo);
782  m_rrc->m_handoverStartTrace (m_imsi, m_rrc->ComponentCarrierToCellId (m_componentCarrierId), m_rnti, handoverCommand.mobilityControlInfo.targetPhysCellId);
783 
784  //Set the target cell ID and the RNTI so that handover cancel message can be sent if required
786  m_targetCellId = params.targetCellId;
787 
789  sst.oldEnbUeX2apId = params.oldEnbUeX2apId;
790  sst.newEnbUeX2apId = params.newEnbUeX2apId;
791  sst.sourceCellId = params.sourceCellId;
792  sst.targetCellId = params.targetCellId;
793  for ( std::map <uint8_t, Ptr<LteDataRadioBearerInfo> >::iterator drbIt = m_drbMap.begin ();
794  drbIt != m_drbMap.end ();
795  ++drbIt)
796  {
797  // SN status transfer is only for AM RLC
798  if (0 != drbIt->second->m_rlc->GetObject<LteRlcAm> ())
799  {
800  LtePdcp::Status status = drbIt->second->m_pdcp->GetStatus ();
802  i.dlPdcpSn = status.txSn;
803  i.ulPdcpSn = status.rxSn;
804  sst.erabsSubjectToStatusTransferList.push_back (i);
805  }
806  }
807  m_rrc->m_x2SapProvider->SendSnStatusTransfer (sst);
808 }
809 
810 
813 {
814  NS_LOG_FUNCTION (this);
816 }
817 
820 {
821  NS_LOG_FUNCTION (this);
822 
824 
825  auto targetComponentCarrier = DynamicCast<ComponentCarrierEnb> (m_rrc->m_componentCarrierPhyConf.at (componentCarrierId));
826  result.haveMobilityControlInfo = true;
827  result.mobilityControlInfo.targetPhysCellId = targetComponentCarrier->GetCellId ();
828  result.mobilityControlInfo.haveCarrierFreq = true;
829  result.mobilityControlInfo.carrierFreq.dlCarrierFreq = targetComponentCarrier->GetDlEarfcn ();
830  result.mobilityControlInfo.carrierFreq.ulCarrierFreq = targetComponentCarrier->GetUlEarfcn ();
831  result.mobilityControlInfo.haveCarrierBandwidth = true;
832  result.mobilityControlInfo.carrierBandwidth.dlBandwidth = targetComponentCarrier->GetDlBandwidth ();
833  result.mobilityControlInfo.carrierBandwidth.ulBandwidth = targetComponentCarrier->GetUlBandwidth ();
834 
835  if (m_caSupportConfigured && m_rrc->m_numberOfComponentCarriers > 1)
836  {
837  // Release sCells
838  result.haveNonCriticalExtension = true;
839 
840  for (auto &it: m_rrc->m_componentCarrierPhyConf)
841  {
842  uint8_t ccId = it.first;
843 
844  if (ccId == m_componentCarrierId)
845  {
846  // Skip primary CC.
847  continue;
848  }
849  else if (ccId < m_componentCarrierId)
850  {
851  // Shift all IDs below PCC forward so PCC can use CC ID 1.
852  result.nonCriticalExtension.sCellToReleaseList.push_back (ccId + 1);
853  }
854  }
855  }
856  else
857  {
858  result.haveNonCriticalExtension = false;
859  }
860 
861  return result;
862 }
863 
864 void
866 {
867  NS_LOG_FUNCTION (this << p << (uint16_t) bid);
869  params.pdcpSdu = p;
870  params.rnti = m_rnti;
871  params.lcid = Bid2Lcid (bid);
872  uint8_t drbid = Bid2Drbid (bid);
873  // Transmit PDCP sdu only if DRB ID found in drbMap
874  std::map<uint8_t, Ptr<LteDataRadioBearerInfo> >::iterator it = m_drbMap.find (drbid);
875  if (it != m_drbMap.end ())
876  {
878  if (bearerInfo != NULL)
879  {
880  LtePdcpSapProvider* pdcpSapProvider = bearerInfo->m_pdcp->GetLtePdcpSapProvider ();
881  pdcpSapProvider->TransmitPdcpSdu (params);
882  }
883  }
884 }
885 
886 void
888 {
889  NS_LOG_FUNCTION (this << p << (uint16_t) bid);
890  switch (m_state)
891  {
893  case CONNECTION_SETUP:
894  NS_LOG_WARN ("not connected, discarding packet");
895  return;
896  break;
897 
898  case CONNECTED_NORMALLY:
903  {
904  NS_LOG_LOGIC ("queueing data on PDCP for transmission over the air");
905  SendPacket (bid, p);
906  }
907  break;
908 
909  case HANDOVER_JOINING:
910  {
911  // Buffer data until RRC Connection Reconfiguration Complete message is received
912  NS_LOG_LOGIC ("buffering data");
913  m_packetBuffer.push_back (std::make_pair (bid, p));
914  }
915  break;
916 
917  case HANDOVER_LEAVING:
918  {
919  NS_LOG_LOGIC ("forwarding data to target eNB over X2-U");
920  uint8_t drbid = Bid2Drbid (bid);
921  EpcX2Sap::UeDataParams params;
922  params.sourceCellId = m_rrc->ComponentCarrierToCellId (m_componentCarrierId);
923  params.targetCellId = m_targetCellId;
924  params.gtpTeid = GetDataRadioBearerInfo (drbid)->m_gtpTeid;
925  params.ueData = p;
926  m_rrc->m_x2SapProvider->SendUeData (params);
927  }
928  break;
929 
930  default:
931  NS_FATAL_ERROR ("method unexpected in state " << ToString (m_state));
932  break;
933  }
934 }
935 
936 std::vector<EpcX2Sap::ErabToBeSetupItem>
938 {
939  NS_LOG_FUNCTION (this);
940  std::vector<EpcX2Sap::ErabToBeSetupItem> ret;
941  for (std::map <uint8_t, Ptr<LteDataRadioBearerInfo> >::iterator it = m_drbMap.begin ();
942  it != m_drbMap.end ();
943  ++it)
944  {
946  etbsi.erabId = it->second->m_epsBearerIdentity;
947  etbsi.erabLevelQosParameters = it->second->m_epsBearer;
948  etbsi.dlForwarding = false;
949  etbsi.transportLayerAddress = it->second->m_transportLayerAddress;
950  etbsi.gtpTeid = it->second->m_gtpTeid;
951  ret.push_back (etbsi);
952  }
953  return ret;
954 }
955 
956 void
958 {
959  NS_LOG_FUNCTION (this);
960  switch (m_state)
961  {
963  NS_LOG_INFO ("Send UE CONTEXT RELEASE from target eNB to source eNB");
964  EpcX2SapProvider::UeContextReleaseParams ueCtxReleaseParams;
965  ueCtxReleaseParams.oldEnbUeX2apId = m_sourceX2apId;
966  ueCtxReleaseParams.newEnbUeX2apId = m_rnti;
967  ueCtxReleaseParams.sourceCellId = m_sourceCellId;
968  ueCtxReleaseParams.targetCellId = m_targetCellId;
969  if (!m_rrc->HasCellId (m_sourceCellId))
970  {
971  m_rrc->m_x2SapProvider->SendUeContextRelease (ueCtxReleaseParams);
972  }
973  else
974  {
975  NS_LOG_INFO ("Not sending UE CONTEXT RELEASE because handover is internal");
976  m_rrc->DoRecvUeContextRelease (ueCtxReleaseParams);
977  }
979  m_rrc->m_handoverEndOkTrace (m_imsi, m_rrc->ComponentCarrierToCellId (m_componentCarrierId), m_rnti);
980  break;
981 
982  default:
983  NS_FATAL_ERROR ("method unexpected in state " << ToString (m_state));
984  break;
985  }
986 }
987 
988 void
990 {
991  NS_LOG_FUNCTION (this << cellId);
992  switch (m_state)
993  {
995  NS_ASSERT (cellId == m_targetCellId);
996  NS_LOG_INFO ("target eNB sent HO preparation failure, aborting HO");
998  break;
999 
1000  default:
1001  NS_FATAL_ERROR ("method unexpected in state " << ToString (m_state));
1002  break;
1003  }
1004 }
1005 
1006 void
1008 {
1009  NS_LOG_FUNCTION (this);
1010  for (std::vector<EpcX2Sap::ErabsSubjectToStatusTransferItem>::iterator erabIt
1011  = params.erabsSubjectToStatusTransferList.begin ();
1012  erabIt != params.erabsSubjectToStatusTransferList.end ();
1013  ++erabIt)
1014  {
1015  // LtePdcp::Status status;
1016  // status.txSn = erabIt->dlPdcpSn;
1017  // status.rxSn = erabIt->ulPdcpSn;
1018  // uint8_t drbId = Bid2Drbid (erabIt->erabId);
1019  // std::map <uint8_t, Ptr<LteDataRadioBearerInfo> >::iterator drbIt = m_drbMap.find (drbId);
1020  // NS_ASSERT_MSG (drbIt != m_drbMap.end (), "could not find DRBID " << (uint32_t) drbId);
1021  // drbIt->second->m_pdcp->SetStatus (status);
1022  }
1023 }
1024 
1025 void
1027 {
1028  NS_LOG_FUNCTION (this);
1029  NS_ASSERT_MSG (m_state == HANDOVER_LEAVING, "method unexpected in state " << ToString (m_state));
1031 }
1032 
1033 
1034 // methods forwarded from RRC SAP
1035 
1036 void
1038 {
1039  NS_LOG_FUNCTION (this);
1040  m_srb0->m_rlc->SetLteRlcSapUser (params.srb0SapUser);
1041  m_srb1->m_pdcp->SetLtePdcpSapUser (params.srb1SapUser);
1042 }
1043 
1044 void
1046 {
1047  NS_LOG_FUNCTION (this);
1048  switch (m_state)
1049  {
1050  case INITIAL_RANDOM_ACCESS:
1051  {
1053 
1054  if (m_rrc->m_admitRrcConnectionRequest == true)
1055  {
1056  m_imsi = msg.ueIdentity;
1057 
1058  // send RRC CONNECTION SETUP to UE
1062  m_rrc->m_rrcSapUser->SendRrcConnectionSetup (m_rnti, msg2);
1063 
1066  m_rrc->m_connectionSetupTimeoutDuration,
1069  }
1070  else
1071  {
1072  NS_LOG_INFO ("rejecting connection request for RNTI " << m_rnti);
1073 
1074  // send RRC CONNECTION REJECT to UE
1076  rejectMsg.waitTime = 3;
1077  m_rrc->m_rrcSapUser->SendRrcConnectionReject (m_rnti, rejectMsg);
1078 
1080  m_rrc->m_connectionRejectedTimeoutDuration,
1083  }
1084  }
1085  break;
1086 
1087  default:
1088  NS_FATAL_ERROR ("method unexpected in state " << ToString (m_state));
1089  break;
1090  }
1091 }
1092 
1093 void
1095 {
1096  NS_LOG_FUNCTION (this);
1097  switch (m_state)
1098  {
1099  case CONNECTION_SETUP:
1101  if ( m_caSupportConfigured == false && m_rrc->m_numberOfComponentCarriers > 1)
1102  {
1103  m_pendingRrcConnectionReconfiguration = true; // Force Reconfiguration
1105  }
1106 
1107  if (m_rrc->m_s1SapProvider != 0)
1108  {
1109  m_rrc->m_s1SapProvider->InitialUeMessage (m_imsi, m_rnti);
1111  }
1112  else
1113  {
1115  }
1116  m_rrc->m_connectionEstablishedTrace (m_imsi, m_rrc->ComponentCarrierToCellId (m_componentCarrierId), m_rnti);
1117  break;
1118 
1119  default:
1120  NS_FATAL_ERROR ("method unexpected in state " << ToString (m_state));
1121  break;
1122  }
1123 }
1124 
1125 void
1127 {
1128  NS_LOG_FUNCTION (this);
1129  switch (m_state)
1130  {
1134  {
1135  // configure MAC (and scheduler)
1137  req.m_rnti = m_rnti;
1139  for (uint8_t i = 0; i < m_rrc->m_numberOfComponentCarriers; i++)
1140  {
1141  m_rrc->m_cmacSapProvider.at (i)->UeUpdateConfigurationReq (req);
1142 
1143  // configure PHY
1144  m_rrc->m_cphySapProvider.at (i)->SetTransmissionMode (req.m_rnti, req.m_transmissionMode);
1146  m_rrc->m_cphySapProvider.at (i)->SetPa (m_rnti, paDouble);
1147  }
1148 
1149  m_needPhyMacConfiguration = false;
1150  }
1152  m_rrc->m_connectionReconfigurationTrace (m_imsi, m_rrc->ComponentCarrierToCellId (m_componentCarrierId), m_rnti);
1153  break;
1154 
1155  // This case is added to NS-3 in order to handle bearer de-activation scenario for CONNECTED state UE
1156  case CONNECTED_NORMALLY:
1157  NS_LOG_INFO ("ignoring RecvRrcConnectionReconfigurationCompleted in state " << ToString (m_state));
1158  break;
1159 
1160  case HANDOVER_LEAVING:
1161  NS_LOG_INFO ("ignoring RecvRrcConnectionReconfigurationCompleted in state " << ToString (m_state));
1162  break;
1163 
1164  case HANDOVER_JOINING:
1165  {
1167 
1168  while (!m_packetBuffer.empty ())
1169  {
1170  NS_LOG_LOGIC ("dequeueing data from buffer");
1171  std::pair <uint8_t, Ptr<Packet> > bidPacket = m_packetBuffer.front ();
1172  uint8_t bid = bidPacket.first;
1173  Ptr<Packet> p = bidPacket.second;
1174 
1175  NS_LOG_LOGIC ("queueing data on PDCP for transmission over the air");
1176  SendPacket (bid, p);
1177 
1178  m_packetBuffer.pop_front ();
1179  }
1180 
1181  NS_LOG_INFO ("Send PATH SWITCH REQUEST to the MME");
1183  params.rnti = m_rnti;
1184  params.cellId = m_rrc->ComponentCarrierToCellId (m_componentCarrierId);
1185  params.mmeUeS1Id = m_imsi;
1187  for (std::map <uint8_t, Ptr<LteDataRadioBearerInfo> >::iterator it = m_drbMap.begin ();
1188  it != m_drbMap.end ();
1189  ++it)
1190  {
1192  b.epsBearerId = it->second->m_epsBearerIdentity;
1193  b.teid = it->second->m_gtpTeid;
1194  params.bearersToBeSwitched.push_back (b);
1195  }
1196  m_rrc->m_s1SapProvider->PathSwitchRequest (params);
1197  }
1198  break;
1199 
1200  default:
1201  NS_FATAL_ERROR ("method unexpected in state " << ToString (m_state));
1202  break;
1203  }
1204 }
1205 
1206 void
1208 {
1209  NS_LOG_FUNCTION (this);
1210  switch (m_state)
1211  {
1212  case CONNECTED_NORMALLY:
1213  break;
1214 
1215  case HANDOVER_LEAVING:
1217  break;
1218 
1219  default:
1220  NS_FATAL_ERROR ("method unexpected in state " << ToString (m_state));
1221  break;
1222  }
1223 
1227  m_rrc->m_rrcSapUser->SendRrcConnectionReestablishment (m_rnti, msg2);
1229 }
1230 
1231 void
1233 {
1234  NS_LOG_FUNCTION (this);
1236 }
1237 
1238 void
1240 {
1241  uint8_t measId = msg.measResults.measId;
1242  NS_LOG_FUNCTION (this << (uint16_t) measId);
1243  NS_LOG_LOGIC ("measId " << (uint16_t) measId
1244  << " haveMeasResultNeighCells " << msg.measResults.haveMeasResultNeighCells
1245  << " measResultListEutra " << msg.measResults.measResultListEutra.size ()
1246  << " haveMeasResultServFreqList " << msg.measResults.haveMeasResultServFreqList
1247  << " measResultServFreqList " << msg.measResults.measResultServFreqList.size ());
1248  NS_LOG_LOGIC ("serving cellId " << m_rrc->ComponentCarrierToCellId (m_componentCarrierId)
1249  << " RSRP " << (uint16_t) msg.measResults.measResultPCell.rsrpResult
1250  << " RSRQ " << (uint16_t) msg.measResults.measResultPCell.rsrqResult);
1251 
1252  for (std::list <LteRrcSap::MeasResultEutra>::iterator it = msg.measResults.measResultListEutra.begin ();
1253  it != msg.measResults.measResultListEutra.end ();
1254  ++it)
1255  {
1256  NS_LOG_LOGIC ("neighbour cellId " << it->physCellId
1257  << " RSRP " << (it->haveRsrpResult ? (uint16_t) it->rsrpResult : 255)
1258  << " RSRQ " << (it->haveRsrqResult ? (uint16_t) it->rsrqResult : 255));
1259  }
1260 
1261  if ((m_rrc->m_handoverManagementSapProvider != 0)
1262  && (m_rrc->m_handoverMeasIds.find (measId) != m_rrc->m_handoverMeasIds.end ()))
1263  {
1264  // this measurement was requested by the handover algorithm
1265  m_rrc->m_handoverManagementSapProvider->ReportUeMeas (m_rnti,
1266  msg.measResults);
1267  }
1268 
1269  if ((m_rrc->m_ccmRrcSapProvider != 0)
1270  && (m_rrc->m_componentCarrierMeasIds.find (measId) != m_rrc->m_componentCarrierMeasIds.end ()))
1271  {
1272  // this measurement was requested by the handover algorithm
1273  m_rrc->m_ccmRrcSapProvider->ReportUeMeas (m_rnti,
1274  msg.measResults);
1275  }
1276 
1277  if ((m_rrc->m_anrSapProvider != 0)
1278  && (m_rrc->m_anrMeasIds.find (measId) != m_rrc->m_anrMeasIds.end ()))
1279  {
1280  // this measurement was requested by the ANR function
1281  m_rrc->m_anrSapProvider->ReportUeMeas (msg.measResults);
1282  }
1283 
1284  if ((m_rrc->m_ffrRrcSapProvider.size () > 0)
1285  && (m_rrc->m_ffrMeasIds.find (measId) != m_rrc->m_ffrMeasIds.end ()))
1286  {
1287  // this measurement was requested by the FFR function
1288  m_rrc->m_ffrRrcSapProvider.at (0)->ReportUeMeas (m_rnti, msg.measResults);
1289  }
1291  {
1292  for (const auto &it: msg.measResults.measResultServFreqList)
1293  {
1296  m_rrc->m_ffrRrcSapProvider.at (it.servFreqId)->ReportUeMeas (m_rnti, msg.measResults);
1297  }
1298  }
1299 
1301  m_rrc->m_ccmRrcSapProvider->ReportUeMeas (m_rnti, msg.measResults);
1302  // fire a trace source
1303  m_rrc->m_recvMeasurementReportTrace (m_imsi, m_rrc->ComponentCarrierToCellId (m_componentCarrierId), m_rnti, msg);
1304 
1305 } // end of UeManager::RecvMeasurementReport
1306 
1307 
1308 // methods forwarded from CMAC SAP
1309 
1310 void
1312 {
1313  NS_LOG_FUNCTION (this << m_rnti);
1314  // at this stage used only by the scheduler for updating txMode
1315 
1317 
1319 
1320  // reconfigure the UE RRC
1322 }
1323 
1324 
1325 // methods forwarded from PDCP SAP
1326 
1327 void
1329 {
1330  NS_LOG_FUNCTION (this);
1331  if (params.lcid > 2)
1332  {
1333  // data radio bearer
1334  EpsBearerTag tag;
1335  tag.SetRnti (params.rnti);
1336  tag.SetBid (Lcid2Bid (params.lcid));
1337  params.pdcpSdu->AddPacketTag (tag);
1338  m_rrc->m_forwardUpCallback (params.pdcpSdu);
1339  }
1340 }
1341 
1342 
1343 uint16_t
1345 {
1346  return m_rnti;
1347 }
1348 
1349 uint64_t
1351 {
1352  return m_imsi;
1353 }
1354 
1355 uint8_t
1357 {
1358  return m_componentCarrierId;
1359 }
1360 
1361 uint16_t
1363 {
1365 }
1366 
1367 void
1369 {
1370  NS_LOG_FUNCTION (this);
1372  for (uint16_t i = 0; i < m_rrc->m_numberOfComponentCarriers; i++)
1373  {
1374  m_rrc->m_cphySapProvider.at (i)->SetSrsConfigurationIndex (m_rnti, srsConfIndex);
1375  }
1376  switch (m_state)
1377  {
1378  case INITIAL_RANDOM_ACCESS:
1379  // do nothing, srs conf index will be correctly enforced upon
1380  // RRC connection establishment
1381  break;
1382 
1383  default:
1385  break;
1386  }
1387 }
1388 
1391 {
1392  return m_state;
1393 }
1394 
1395 void
1397 {
1398  NS_LOG_FUNCTION (this);
1399  m_physicalConfigDedicated.pdschConfigDedicated = pdschConfigDedicated;
1400 
1402 
1403  // reconfigure the UE RRC
1405 }
1406 
1407 void
1409 {
1410  NS_LOG_FUNCTION (this);
1416 }
1417 
1418 uint8_t
1420 {
1421  NS_LOG_FUNCTION (this);
1422  const uint8_t MAX_DRB_ID = 32;
1423  for (int drbid = (m_lastAllocatedDrbid + 1) % MAX_DRB_ID;
1424  drbid != m_lastAllocatedDrbid;
1425  drbid = (drbid + 1) % MAX_DRB_ID)
1426  {
1427  if (drbid != 0) // 0 is not allowed
1428  {
1429  if (m_drbMap.find (drbid) == m_drbMap.end ())
1430  {
1431  m_drbMap.insert (std::pair<uint8_t, Ptr<LteDataRadioBearerInfo> > (drbid, drbInfo));
1432  drbInfo->m_drbIdentity = drbid;
1433  m_lastAllocatedDrbid = drbid;
1434  return drbid;
1435  }
1436  }
1437  }
1438  NS_FATAL_ERROR ("no more data radio bearer ids available");
1439  return 0;
1440 }
1441 
1444 {
1445  NS_LOG_FUNCTION (this << (uint32_t) drbid);
1446  NS_ASSERT (0 != drbid);
1447  std::map<uint8_t, Ptr<LteDataRadioBearerInfo> >::iterator it = m_drbMap.find (drbid);
1448  NS_ABORT_IF (it == m_drbMap.end ());
1449  return it->second;
1450 }
1451 
1452 
1453 void
1455 {
1456  NS_LOG_FUNCTION (this << (uint32_t) drbid);
1457  std::map <uint8_t, Ptr<LteDataRadioBearerInfo> >::iterator it = m_drbMap.find (drbid);
1458  NS_ASSERT_MSG (it != m_drbMap.end (), "request to remove radio bearer with unknown drbid " << drbid);
1459  m_drbMap.erase (it);
1460 }
1461 
1462 
1465 {
1466  NS_LOG_FUNCTION (this);
1471  msg.haveMobilityControlInfo = false;
1472  msg.haveMeasConfig = true;
1473  msg.measConfig = m_rrc->m_ueMeasConfig;
1474  if ( m_caSupportConfigured == false && m_rrc->m_numberOfComponentCarriers > 1)
1475  {
1476  m_caSupportConfigured = true;
1477  NS_LOG_FUNCTION ( this << "CA not configured. Configure now!" );
1478  msg.haveNonCriticalExtension = true;
1480  NS_LOG_FUNCTION ( this << " haveNonCriticalExtension " << msg.haveNonCriticalExtension );
1481  }
1482  else
1483  {
1484  msg.haveNonCriticalExtension = false;
1485  }
1486 
1487  return msg;
1488 }
1489 
1492 {
1493  NS_LOG_FUNCTION (this);
1495 
1496  if (m_srb1 != 0)
1497  {
1499  stam.srbIdentity = m_srb1->m_srbIdentity;
1500  stam.logicalChannelConfig = m_srb1->m_logicalChannelConfig;
1501  rrcd.srbToAddModList.push_back (stam);
1502  }
1503 
1504  for (std::map <uint8_t, Ptr<LteDataRadioBearerInfo> >::iterator it = m_drbMap.begin ();
1505  it != m_drbMap.end ();
1506  ++it)
1507  {
1509  dtam.epsBearerIdentity = it->second->m_epsBearerIdentity;
1510  dtam.drbIdentity = it->second->m_drbIdentity;
1511  dtam.rlcConfig = it->second->m_rlcConfig;
1512  dtam.logicalChannelIdentity = it->second->m_logicalChannelIdentity;
1513  dtam.logicalChannelConfig = it->second->m_logicalChannelConfig;
1514  rrcd.drbToAddModList.push_back (dtam);
1515  }
1516 
1517  rrcd.havePhysicalConfigDedicated = true;
1519  return rrcd;
1520 }
1521 
1522 uint8_t
1524 {
1525  NS_LOG_FUNCTION (this);
1529 }
1530 
1531 uint8_t
1533 {
1534  NS_ASSERT (lcid > 2);
1535  return lcid - 2;
1536 }
1537 
1538 uint8_t
1539 UeManager::Drbid2Lcid (uint8_t drbid)
1540 {
1541  return drbid + 2;
1542 }
1543 uint8_t
1544 UeManager::Lcid2Bid (uint8_t lcid)
1545 {
1546  NS_ASSERT (lcid > 2);
1547  return lcid - 2;
1548 }
1549 
1550 uint8_t
1551 UeManager::Bid2Lcid (uint8_t bid)
1552 {
1553  return bid + 2;
1554 }
1555 
1556 uint8_t
1557 UeManager::Drbid2Bid (uint8_t drbid)
1558 {
1559  return drbid;
1560 }
1561 
1562 uint8_t
1564 {
1565  return bid;
1566 }
1567 
1568 
1569 void
1571 {
1572  NS_LOG_FUNCTION (this << ToString (newState));
1573  State oldState = m_state;
1574  m_state = newState;
1575  NS_LOG_INFO (this << " IMSI " << m_imsi << " RNTI " << m_rnti << " UeManager "
1576  << ToString (oldState) << " --> " << ToString (newState));
1577  m_stateTransitionTrace (m_imsi, m_rrc->ComponentCarrierToCellId (m_componentCarrierId), m_rnti, oldState, newState);
1578 
1579  switch (newState)
1580  {
1581  case INITIAL_RANDOM_ACCESS:
1582  case HANDOVER_JOINING:
1583  NS_FATAL_ERROR ("cannot switch to an initial state");
1584  break;
1585 
1586  case CONNECTION_SETUP:
1587  break;
1588 
1589  case ATTACH_REQUEST:
1590  break;
1591 
1592  case CONNECTED_NORMALLY:
1593  {
1595  {
1597  }
1599  {
1601  }
1602  }
1603  break;
1604 
1606  break;
1607 
1609  break;
1610 
1611  case HANDOVER_LEAVING:
1612  break;
1613 
1614  default:
1615  break;
1616  }
1617 }
1618 
1621 {
1622  NS_LOG_FUNCTION ( this );
1624 
1625  for (auto &it: m_rrc->m_componentCarrierPhyConf)
1626  {
1627  uint8_t ccId = it.first;
1628 
1629  if (ccId == m_componentCarrierId)
1630  {
1631  // Skip primary CC.
1632  continue;
1633  }
1634  else if (ccId < m_componentCarrierId)
1635  {
1636  // Shift all IDs below PCC forward so PCC can use CC ID 1.
1637  ccId++;
1638  }
1639 
1640  Ptr<ComponentCarrierBaseStation> eNbCcm = it.second;
1641  LteRrcSap::SCellToAddMod component;
1642  component.sCellIndex = ccId;
1643  component.cellIdentification.physCellId = eNbCcm->GetCellId ();
1644  component.cellIdentification.dlCarrierFreq = eNbCcm->GetDlEarfcn ();
1646  component.radioResourceConfigCommonSCell.nonUlConfiguration.dlBandwidth = eNbCcm->GetDlBandwidth ();
1648  component.radioResourceConfigCommonSCell.nonUlConfiguration.pdschConfigCommon.referenceSignalPower = m_rrc->m_cphySapProvider.at (0)->GetReferenceSignalPower ();
1651  component.radioResourceConfigCommonSCell.ulConfiguration.ulFreqInfo.ulCarrierFreq = eNbCcm->GetUlEarfcn ();
1652  component.radioResourceConfigCommonSCell.ulConfiguration.ulFreqInfo.ulBandwidth = eNbCcm->GetUlBandwidth ();
1654  //component.radioResourceConfigCommonSCell.ulConfiguration.soundingRsUlConfigCommon.type = LteRrcSap::SoundingRsUlConfigDedicated::SETUP;
1658 
1659  component.haveRadioResourceConfigDedicatedSCell = true;
1675 
1676  ncec.sCellToAddModList.push_back (component);
1677  }
1678 
1679  return ncec;
1680 }
1681 
1682 
1684 // eNB RRC methods
1686 
1688 
1690  : m_x2SapProvider (0),
1691  m_cmacSapProvider (0),
1692  m_handoverManagementSapProvider (0),
1693  m_ccmRrcSapProvider (0),
1694  m_anrSapProvider (0),
1695  m_ffrRrcSapProvider (0),
1696  m_rrcSapUser (0),
1697  m_macSapProvider (0),
1698  m_s1SapProvider (0),
1699  m_cphySapProvider (0),
1700  m_configured (false),
1701  m_lastAllocatedRnti (0),
1702  m_srsCurrentPeriodicityId (0),
1703  m_lastAllocatedConfigurationIndex (0),
1704  m_reconfigureUes (false),
1705  m_numberOfComponentCarriers (0),
1706  m_carriersConfigured (false)
1707 {
1708  NS_LOG_FUNCTION (this);
1709  m_cmacSapUser.push_back (new EnbRrcMemberLteEnbCmacSapUser (this, 0));
1712  m_ffrRrcSapUser.push_back (new MemberLteFfrRrcSapUser<LteEnbRrc> (this));
1716  m_cphySapUser.push_back (new MemberLteEnbCphySapUser<LteEnbRrc> (this));
1718 }
1719 
1720 void
1722 {
1723  NS_ASSERT_MSG (!m_carriersConfigured, "Secondary carriers can be configured only once.");
1724  m_componentCarrierPhyConf = ccPhyConf;
1725  NS_ABORT_MSG_IF (m_numberOfComponentCarriers != m_componentCarrierPhyConf.size (), " Number of component carriers "
1726  "are not equal to the number of he component carrier configuration provided");
1727 
1728  for (uint8_t i = 1; i < m_numberOfComponentCarriers; i++)
1729  {
1730  m_cphySapUser.push_back (new MemberLteEnbCphySapUser<LteEnbRrc> (this));
1731  m_cmacSapUser.push_back (new EnbRrcMemberLteEnbCmacSapUser (this, i));
1732  m_ffrRrcSapUser.push_back (new MemberLteFfrRrcSapUser<LteEnbRrc> (this));
1733  }
1734  m_carriersConfigured = true;
1736 }
1737 
1739 {
1740  NS_LOG_FUNCTION (this);
1741 }
1742 
1743 
1744 void
1746 {
1747  NS_LOG_FUNCTION (this);
1748  for ( uint8_t i = 0; i < m_numberOfComponentCarriers ; i++)
1749  {
1750  delete m_cphySapUser[i];
1751  delete m_cmacSapUser[i];
1752  delete m_ffrRrcSapUser[i];
1753  }
1754  //delete m_cphySapUser;
1755  m_cphySapUser.erase (m_cphySapUser.begin (),m_cphySapUser.end ());
1756  m_cphySapUser.clear ();
1757  //delete m_cmacSapUser;
1758  m_cmacSapUser.erase (m_cmacSapUser.begin (),m_cmacSapUser.end ());
1759  m_cmacSapUser.clear ();
1760  //delete m_ffrRrcSapUser;
1761  m_ffrRrcSapUser.erase (m_ffrRrcSapUser.begin (),m_ffrRrcSapUser.end ());
1762  m_ffrRrcSapUser.clear ();
1763  m_ueMap.clear ();
1765  delete m_ccmRrcSapUser;
1766  delete m_anrSapUser;
1767  delete m_rrcSapProvider;
1768  delete m_x2SapUser;
1769  delete m_s1SapUser;
1770 
1771 }
1772 
1773 TypeId
1775 {
1776  NS_LOG_FUNCTION ("LteEnbRrc::GetTypeId");
1777  static TypeId tid = TypeId ("ns3::LteEnbRrc")
1778  .SetParent<Object> ()
1779  .SetGroupName("Lte")
1780  .AddConstructor<LteEnbRrc> ()
1781  .AddAttribute ("UeMap", "List of UeManager by C-RNTI.",
1782  ObjectMapValue (),
1784  MakeObjectMapChecker<UeManager> ())
1785  .AddAttribute ("DefaultTransmissionMode",
1786  "The default UEs' transmission mode (0: SISO)",
1787  UintegerValue (0), // default tx-mode
1789  MakeUintegerChecker<uint8_t> ())
1790  .AddAttribute ("EpsBearerToRlcMapping",
1791  "Specify which type of RLC will be used for each type of EPS bearer. ",
1794  MakeEnumChecker (RLC_SM_ALWAYS, "RlcSmAlways",
1795  RLC_UM_ALWAYS, "RlcUmAlways",
1796  RLC_AM_ALWAYS, "RlcAmAlways",
1797  PER_BASED, "PacketErrorRateBased"))
1798  .AddAttribute ("SystemInformationPeriodicity",
1799  "The interval for sending system information (Time value)",
1800  TimeValue (MilliSeconds (80)),
1802  MakeTimeChecker ())
1803 
1804  // SRS related attributes
1805  .AddAttribute ("SrsPeriodicity",
1806  "The SRS periodicity in milliseconds",
1807  UintegerValue (40),
1810  MakeUintegerChecker<uint32_t> ())
1811 
1812  // Timeout related attributes
1813  .AddAttribute ("ConnectionRequestTimeoutDuration",
1814  "After a RA attempt, if no RRC CONNECTION REQUEST is "
1815  "received before this time, the UE context is destroyed. "
1816  "Must account for reception of RAR and transmission of "
1817  "RRC CONNECTION REQUEST over UL GRANT. The value of this"
1818  "timer should not be greater than T300 timer at UE RRC",
1819  TimeValue (MilliSeconds (15)),
1822  .AddAttribute ("ConnectionSetupTimeoutDuration",
1823  "After accepting connection request, if no RRC CONNECTION "
1824  "SETUP COMPLETE is received before this time, the UE "
1825  "context is destroyed. Must account for the UE's reception "
1826  "of RRC CONNECTION SETUP and transmission of RRC CONNECTION "
1827  "SETUP COMPLETE.",
1828  TimeValue (MilliSeconds (150)),
1830  MakeTimeChecker ())
1831  .AddAttribute ("ConnectionRejectedTimeoutDuration",
1832  "Time to wait between sending a RRC CONNECTION REJECT and "
1833  "destroying the UE context",
1834  TimeValue (MilliSeconds (30)),
1836  MakeTimeChecker ())
1837  .AddAttribute ("HandoverJoiningTimeoutDuration",
1838  "After accepting a handover request, if no RRC CONNECTION "
1839  "RECONFIGURATION COMPLETE is received before this time, the "
1840  "UE context is destroyed. Must account for reception of "
1841  "X2 HO REQ ACK by source eNB, transmission of the Handover "
1842  "Command, non-contention-based random access and reception "
1843  "of the RRC CONNECTION RECONFIGURATION COMPLETE message.",
1844  TimeValue (MilliSeconds (200)),
1846  MakeTimeChecker ())
1847  .AddAttribute ("HandoverLeavingTimeoutDuration",
1848  "After issuing a Handover Command, if neither RRC "
1849  "CONNECTION RE-ESTABLISHMENT nor X2 UE Context Release has "
1850  "been previously received, the UE context is destroyed.",
1851  TimeValue (MilliSeconds (500)),
1853  MakeTimeChecker ())
1854 
1855  // Cell selection related attribute
1856  .AddAttribute ("QRxLevMin",
1857  "One of information transmitted within the SIB1 message, "
1858  "indicating the required minimum RSRP level that any UE must "
1859  "receive from this cell before it is allowed to camp to this "
1860  "cell. The default value -70 corresponds to -140 dBm and is "
1861  "the lowest possible value as defined by Section 6.3.4 of "
1862  "3GPP TS 36.133. This restriction, however, only applies to "
1863  "initial cell selection and EPC-enabled simulation.",
1865  IntegerValue (-70),
1867  MakeIntegerChecker<int8_t> (-70, -22))
1868  .AddAttribute ("NumberOfComponentCarriers",
1869  "Number of Component Carriers ",
1870  UintegerValue (1),
1872  MakeIntegerChecker<int16_t> (MIN_NO_CC, MAX_NO_CC))
1873 
1874  // Handover related attributes
1875  .AddAttribute ("AdmitHandoverRequest",
1876  "Whether to admit an X2 handover request from another eNB",
1877  BooleanValue (true),
1879  MakeBooleanChecker ())
1880  .AddAttribute ("AdmitRrcConnectionRequest",
1881  "Whether to admit a connection request from a UE",
1882  BooleanValue (true),
1884  MakeBooleanChecker ())
1885 
1886  // UE measurements related attributes
1887  .AddAttribute ("RsrpFilterCoefficient",
1888  "Determines the strength of smoothing effect induced by "
1889  "layer 3 filtering of RSRP in all attached UE; "
1890  "if set to 0, no layer 3 filtering is applicable",
1891  // i.e. the variable k in 3GPP TS 36.331 section 5.5.3.2
1892  UintegerValue (4),
1894  MakeUintegerChecker<uint8_t> (0))
1895  .AddAttribute ("RsrqFilterCoefficient",
1896  "Determines the strength of smoothing effect induced by "
1897  "layer 3 filtering of RSRQ in all attached UE; "
1898  "if set to 0, no layer 3 filtering is applicable",
1899  // i.e. the variable k in 3GPP TS 36.331 section 5.5.3.2
1900  UintegerValue (4),
1902  MakeUintegerChecker<uint8_t> (0))
1903 
1904  // Trace sources
1905  .AddTraceSource ("NewUeContext",
1906  "Fired upon creation of a new UE context.",
1908  "ns3::LteEnbRrc::NewUeContextTracedCallback")
1909  .AddTraceSource ("ConnectionEstablished",
1910  "Fired upon successful RRC connection establishment.",
1912  "ns3::LteEnbRrc::ConnectionHandoverTracedCallback")
1913  .AddTraceSource ("ConnectionReconfiguration",
1914  "trace fired upon RRC connection reconfiguration",
1916  "ns3::LteEnbRrc::ConnectionHandoverTracedCallback")
1917  .AddTraceSource ("HandoverStart",
1918  "trace fired upon start of a handover procedure",
1920  "ns3::LteEnbRrc::HandoverStartTracedCallback")
1921  .AddTraceSource ("HandoverEndOk",
1922  "trace fired upon successful termination of a handover procedure",
1924  "ns3::LteEnbRrc::ConnectionHandoverTracedCallback")
1925  .AddTraceSource ("RecvMeasurementReport",
1926  "trace fired when measurement report is received",
1928  "ns3::LteEnbRrc::ReceiveReportTracedCallback")
1929  .AddTraceSource ("NotifyConnectionRelease",
1930  "trace fired when an UE is released",
1932  "ns3::LteEnbRrc::ConnectionHandoverTracedCallback")
1933  .AddTraceSource ("RrcTimeout",
1934  "trace fired when a timer expires",
1936  "ns3::LteEnbRrc::TimerExpiryTracedCallback")
1937  ;
1938  return tid;
1939 }
1940 
1941 void
1943 {
1944  NS_LOG_FUNCTION (this << s);
1945  m_x2SapProvider = s;
1946 }
1947 
1948 EpcX2SapUser*
1950 {
1951  NS_LOG_FUNCTION (this);
1952  return m_x2SapUser;
1953 }
1954 
1955 void
1957 {
1958  NS_LOG_FUNCTION (this << s);
1959  m_cmacSapProvider.at (0) = s;
1960 }
1961 
1962 void
1964 {
1965  NS_LOG_FUNCTION (this << s);
1966  if (m_cmacSapProvider.size () > pos)
1967  {
1968  m_cmacSapProvider.at (pos) = s;
1969  }
1970  else
1971  {
1972  m_cmacSapProvider.push_back (s);
1973  NS_ABORT_IF (m_cmacSapProvider.size () - 1 != pos);
1974  }
1975 }
1976 
1979 {
1980  NS_LOG_FUNCTION (this);
1981  return m_cmacSapUser.at (0);
1982 }
1983 
1986 {
1987  NS_LOG_FUNCTION (this);
1988  return m_cmacSapUser.at (pos);
1989 }
1990 
1991 void
1993 {
1994  NS_LOG_FUNCTION (this << s);
1996 }
1997 
2000 {
2001  NS_LOG_FUNCTION (this);
2003 }
2004 
2005 void
2007 {
2008  NS_LOG_FUNCTION (this << s);
2009  m_ccmRrcSapProvider = s;
2010 }
2011 
2014 {
2015  NS_LOG_FUNCTION (this);
2016  return m_ccmRrcSapUser;
2017 }
2018 
2019 void
2021 {
2022  NS_LOG_FUNCTION (this << s);
2023  m_anrSapProvider = s;
2024 }
2025 
2028 {
2029  NS_LOG_FUNCTION (this);
2030  return m_anrSapUser;
2031 }
2032 
2033 void
2035 {
2036  NS_LOG_FUNCTION (this << s);
2037  if (m_ffrRrcSapProvider.size () > 0)
2038  {
2039  m_ffrRrcSapProvider.at (0) = s;
2040  }
2041  else
2042  {
2043  m_ffrRrcSapProvider.push_back (s);
2044  }
2045 
2046 }
2047 
2048 void
2050 {
2051  NS_LOG_FUNCTION (this << s);
2052  if (m_ffrRrcSapProvider.size () > index)
2053  {
2054  m_ffrRrcSapProvider.at (index) = s;
2055  }
2056  else
2057  {
2058  m_ffrRrcSapProvider.push_back (s);
2059  NS_ABORT_MSG_IF (m_ffrRrcSapProvider.size () - 1 != index,
2060  "You meant to store the pointer at position " <<
2061  static_cast<uint32_t> (index) <<
2062  " but it went to " << m_ffrRrcSapProvider.size () - 1);
2063  }
2064 }
2065 
2068 {
2069  NS_LOG_FUNCTION (this);
2070  return m_ffrRrcSapUser.at (0);
2071 }
2072 
2075 {
2076  NS_LOG_FUNCTION (this);
2077  NS_ASSERT_MSG (index < m_numberOfComponentCarriers, "Invalid component carrier index:"<<index<<" provided in order to obtain FfrRrcSapUser.");
2078  return m_ffrRrcSapUser.at (index);
2079 }
2080 
2081 void
2083 {
2084  NS_LOG_FUNCTION (this << s);
2085  m_rrcSapUser = s;
2086 }
2087 
2090 {
2091  NS_LOG_FUNCTION (this);
2092  return m_rrcSapProvider;
2093 }
2094 
2095 void
2097 {
2098  NS_LOG_FUNCTION (this);
2099  m_macSapProvider = s;
2100 }
2101 
2102 void
2104 {
2105  m_s1SapProvider = s;
2106 }
2107 
2108 
2111 {
2112  return m_s1SapUser;
2113 }
2114 
2115 void
2117 {
2118  NS_LOG_FUNCTION (this << s);
2119  if (m_cphySapProvider.size () > 0)
2120  {
2121  m_cphySapProvider.at (0) = s;
2122  }
2123  else
2124  {
2125  m_cphySapProvider.push_back (s);
2126  }
2127 }
2128 
2131 {
2132  NS_LOG_FUNCTION (this);
2133  return m_cphySapUser.at(0);
2134 }
2135 
2136 void
2138 {
2139  NS_LOG_FUNCTION (this << s);
2140  if (m_cphySapProvider.size () > pos)
2141  {
2142  m_cphySapProvider.at(pos) = s;
2143  }
2144  else
2145  {
2146  m_cphySapProvider.push_back (s);
2147  NS_ABORT_IF (m_cphySapProvider.size () - 1 != pos);
2148  }
2149 }
2150 
2153 {
2154  NS_LOG_FUNCTION (this);
2155  return m_cphySapUser.at(pos);
2156 }
2157 
2158 bool
2159 LteEnbRrc::HasUeManager (uint16_t rnti) const
2160 {
2161  NS_LOG_FUNCTION (this << (uint32_t) rnti);
2162  std::map<uint16_t, Ptr<UeManager> >::const_iterator it = m_ueMap.find (rnti);
2163  return (it != m_ueMap.end ());
2164 }
2165 
2168 {
2169  NS_LOG_FUNCTION (this << (uint32_t) rnti);
2170  NS_ASSERT (0 != rnti);
2171  std::map<uint16_t, Ptr<UeManager> >::iterator it = m_ueMap.find (rnti);
2172  NS_ASSERT_MSG (it != m_ueMap.end (), "UE manager for RNTI " << rnti << " not found");
2173  return it->second;
2174 }
2175 
2176 std::vector<uint8_t>
2178 {
2179  NS_LOG_FUNCTION (this);
2180 
2181  // SANITY CHECK
2182 
2184  "Measurement identities and reporting configuration should not have different quantity");
2185 
2186  if (Simulator::Now () != Seconds (0))
2187  {
2188  NS_FATAL_ERROR ("AddUeMeasReportConfig may not be called after the simulation has run");
2189  }
2190 
2191  // INPUT VALIDATION
2192 
2193  switch (config.triggerQuantity)
2194  {
2198  {
2199  NS_FATAL_ERROR ("The given triggerQuantity (RSRP) does not match with the given threshold2.choice");
2200  }
2201 
2207  {
2208  NS_FATAL_ERROR ("The given triggerQuantity (RSRP) does not match with the given threshold1.choice");
2209  }
2210  break;
2211 
2215  {
2216  NS_FATAL_ERROR ("The given triggerQuantity (RSRQ) does not match with the given threshold2.choice");
2217  }
2218 
2224  {
2225  NS_FATAL_ERROR ("The given triggerQuantity (RSRQ) does not match with the given threshold1.choice");
2226  }
2227  break;
2228 
2229  default:
2230  NS_FATAL_ERROR ("unsupported triggerQuantity");
2231  break;
2232  }
2233 
2235  {
2236  NS_FATAL_ERROR ("Only REPORT_STRONGEST_CELLS purpose is supported");
2237  }
2238 
2240  {
2241  NS_LOG_WARN ("reportQuantity = BOTH will be used instead of the given reportQuantity");
2242  }
2243 
2244  uint8_t nextId = m_ueMeasConfig.reportConfigToAddModList.size () + 1;
2245 
2246  // create the reporting configuration
2247  LteRrcSap::ReportConfigToAddMod reportConfig;
2248  reportConfig.reportConfigId = nextId;
2249  reportConfig.reportConfigEutra = config;
2250 
2251  // add reporting configuration to UE measurement configuration
2252  m_ueMeasConfig.reportConfigToAddModList.push_back (reportConfig);
2253 
2254  std::vector<uint8_t> measIds;
2255 
2256  // create measurement identities, linking reporting configuration to all objects
2257  for (uint8_t componentCarrier = 0; componentCarrier < m_numberOfComponentCarriers; componentCarrier++)
2258  {
2259  LteRrcSap::MeasIdToAddMod measIdToAddMod;
2260 
2261  uint8_t measId = m_ueMeasConfig.measIdToAddModList.size () + 1;
2262 
2263  measIdToAddMod.measId = measId;
2264  measIdToAddMod.measObjectId = componentCarrier + 1;
2265  measIdToAddMod.reportConfigId = nextId;
2266 
2267  m_ueMeasConfig.measIdToAddModList.push_back (measIdToAddMod);
2268  measIds.push_back (measId);
2269  }
2270 
2271  return measIds;
2272 }
2273 
2274 void
2276 {
2277  auto it = ccPhyConf.begin ();
2278  NS_ASSERT (it != ccPhyConf.end ());
2279  uint16_t ulBandwidth = it->second->GetUlBandwidth ();
2280  uint16_t dlBandwidth = it->second->GetDlBandwidth ();
2281  uint32_t ulEarfcn = it->second->GetUlEarfcn ();
2282  uint32_t dlEarfcn = it->second->GetDlEarfcn ();
2283  NS_LOG_FUNCTION (this << ulBandwidth << dlBandwidth
2284  << ulEarfcn << dlEarfcn);
2286 
2287  for (const auto &it: ccPhyConf)
2288  {
2289  m_cphySapProvider.at (it.first)->SetBandwidth (it.second->GetUlBandwidth (), it.second->GetDlBandwidth ());
2290  m_cphySapProvider.at (it.first)->SetEarfcn (it.second->GetUlEarfcn (), it.second->GetDlEarfcn ());
2291  m_cphySapProvider.at (it.first)->SetCellId (it.second->GetCellId ());
2292  m_cmacSapProvider.at (it.first)->ConfigureMac (it.second->GetUlBandwidth (), it.second->GetDlBandwidth ());
2293  if (m_ffrRrcSapProvider.size () > it.first)
2294  {
2295  m_ffrRrcSapProvider.at (it.first)->SetCellId (it.second->GetCellId ());
2296  m_ffrRrcSapProvider.at (it.first)->SetBandwidth (it.second->GetUlBandwidth (), it.second->GetDlBandwidth ());
2297  }
2298  }
2299 
2300  m_dlEarfcn = dlEarfcn;
2301  m_ulEarfcn = ulEarfcn;
2302  m_dlBandwidth = dlBandwidth;
2303  m_ulBandwidth = ulBandwidth;
2304 
2305  /*
2306  * Initializing the list of measurement objects.
2307  * Only intra-frequency measurements are supported,
2308  * so one measurement object is created for each carrier frequency.
2309  */
2310  for (const auto &it: ccPhyConf)
2311  {
2312  LteRrcSap::MeasObjectToAddMod measObject;
2313  measObject.measObjectId = it.first + 1;
2314  measObject.measObjectEutra.carrierFreq = it.second->GetDlEarfcn ();
2315  measObject.measObjectEutra.allowedMeasBandwidth = it.second->GetDlBandwidth ();
2316  measObject.measObjectEutra.presenceAntennaPort1 = false;
2317  measObject.measObjectEutra.neighCellConfig = 0;
2318  measObject.measObjectEutra.offsetFreq = 0;
2319  measObject.measObjectEutra.haveCellForWhichToReportCGI = false;
2320 
2321  m_ueMeasConfig.measObjectToAddModList.push_back (measObject);
2322  }
2323 
2328  m_ueMeasConfig.haveSmeasure = false;
2330 
2331  m_sib1.clear ();
2332  m_sib1.reserve (ccPhyConf.size ());
2333  for (const auto &it: ccPhyConf)
2334  {
2335  // Enabling MIB transmission
2337  mib.dlBandwidth = it.second->GetDlBandwidth ();
2338  mib.systemFrameNumber = 0;
2339  m_cphySapProvider.at (it.first)->SetMasterInformationBlock (mib);
2340 
2341  // Enabling SIB1 transmission with default values
2343  sib1.cellAccessRelatedInfo.cellIdentity = it.second->GetCellId ();
2344  sib1.cellAccessRelatedInfo.csgIndication = false;
2347  sib1.cellSelectionInfo.qQualMin = -34; // not used, set as minimum value
2348  sib1.cellSelectionInfo.qRxLevMin = m_qRxLevMin; // set as minimum value
2349  m_sib1.push_back (sib1);
2350  m_cphySapProvider.at (it.first)->SetSystemInformationBlockType1 (sib1);
2351  }
2352  /*
2353  * Enabling transmission of other SIB. The first time System Information is
2354  * transmitted is arbitrarily assumed to be at +0.016s, and then it will be
2355  * regularly transmitted every 80 ms by default (set the
2356  * SystemInformationPeriodicity attribute to configure this).
2357  */
2359 
2360  m_configured = true;
2361 
2362 }
2363 
2364 
2365 void
2366 LteEnbRrc::SetCellId (uint16_t cellId)
2367 {
2368  // update SIB1
2369  m_sib1.at (0).cellAccessRelatedInfo.cellIdentity = cellId;
2370  m_cphySapProvider.at (0)->SetSystemInformationBlockType1 (m_sib1.at (0));
2371 }
2372 
2373 void
2374 LteEnbRrc::SetCellId (uint16_t cellId, uint8_t ccIndex)
2375 {
2376  // update SIB1
2377  m_sib1.at (ccIndex).cellAccessRelatedInfo.cellIdentity = cellId;
2378  m_cphySapProvider.at (ccIndex)->SetSystemInformationBlockType1 (m_sib1.at (ccIndex));
2379 }
2380 
2381 uint8_t
2383 {
2384  NS_LOG_FUNCTION (this << cellId);
2385  for (auto &it: m_componentCarrierPhyConf)
2386  {
2387  if (it.second->GetCellId () == cellId)
2388  {
2389  return it.first;
2390  }
2391  }
2392  NS_FATAL_ERROR ("Cell " << cellId << " not found in CC map");
2393 }
2394 
2395 uint16_t
2396 LteEnbRrc::ComponentCarrierToCellId (uint8_t componentCarrierId)
2397 {
2398  NS_LOG_FUNCTION (this << +componentCarrierId);
2399  return m_componentCarrierPhyConf.at (componentCarrierId)->GetCellId ();
2400 }
2401 
2402 bool
2403 LteEnbRrc::HasCellId (uint16_t cellId) const
2404 {
2405  for (auto &it: m_componentCarrierPhyConf)
2406  {
2407  if (it.second->GetCellId () == cellId)
2408  {
2409  return true;
2410  }
2411  }
2412  return false;
2413 }
2414 
2415 bool
2417 {
2418  NS_LOG_FUNCTION (this << packet);
2419 
2420  EpsBearerTag tag;
2421  bool found = packet->RemovePacketTag (tag);
2422  NS_ASSERT_MSG (found, "no EpsBearerTag found in packet to be sent");
2423  Ptr<UeManager> ueManager = GetUeManager (tag.GetRnti ());
2424  ueManager->SendData (tag.GetBid (), packet);
2425 
2426  return true;
2427 }
2428 
2429 void
2431 {
2432  m_forwardUpCallback = cb;
2433 }
2434 
2435 void
2437 {
2438  NS_LOG_FUNCTION (this << rnti);
2440  "ConnectionRequestTimeout in unexpected state " << ToString (GetUeManager (rnti)->GetState ()));
2441  m_rrcTimeoutTrace (GetUeManager (rnti)->GetImsi (), rnti,
2442  ComponentCarrierToCellId (GetUeManager (rnti)->GetComponentCarrierId ()), "ConnectionRequestTimeout");
2443  RemoveUe (rnti);
2444 }
2445 
2446 void
2448 {
2449  NS_LOG_FUNCTION (this << rnti);
2450  NS_ASSERT_MSG (GetUeManager (rnti)->GetState () == UeManager::CONNECTION_SETUP,
2451  "ConnectionSetupTimeout in unexpected state " << ToString (GetUeManager (rnti)->GetState ()));
2452  m_rrcTimeoutTrace (GetUeManager (rnti)->GetImsi (), rnti,
2453  ComponentCarrierToCellId (GetUeManager (rnti)->GetComponentCarrierId ()), "ConnectionSetupTimeout");
2454  RemoveUe (rnti);
2455 }
2456 
2457 void
2459 {
2460  NS_LOG_FUNCTION (this << rnti);
2462  "ConnectionRejectedTimeout in unexpected state " << ToString (GetUeManager (rnti)->GetState ()));
2463  m_rrcTimeoutTrace (GetUeManager (rnti)->GetImsi (), rnti,
2464  ComponentCarrierToCellId (GetUeManager (rnti)->GetComponentCarrierId ()), "ConnectionRejectedTimeout");
2465  RemoveUe (rnti);
2466 }
2467 
2468 void
2470 {
2471  NS_LOG_FUNCTION (this << rnti);
2472  NS_ASSERT_MSG (GetUeManager (rnti)->GetState () == UeManager::HANDOVER_JOINING,
2473  "HandoverJoiningTimeout in unexpected state " << ToString (GetUeManager (rnti)->GetState ()));
2474  m_rrcTimeoutTrace (GetUeManager (rnti)->GetImsi (), rnti,
2475  ComponentCarrierToCellId (GetUeManager (rnti)->GetComponentCarrierId ()), "HandoverJoiningTimeout");
2476  RemoveUe (rnti);
2477 }
2478 
2479 void
2481 {
2482  NS_LOG_FUNCTION (this << rnti);
2483  NS_ASSERT_MSG (GetUeManager (rnti)->GetState () == UeManager::HANDOVER_LEAVING,
2484  "HandoverLeavingTimeout in unexpected state " << ToString (GetUeManager (rnti)->GetState ()));
2485  m_rrcTimeoutTrace (GetUeManager (rnti)->GetImsi (), rnti,
2486  ComponentCarrierToCellId (GetUeManager (rnti)->GetComponentCarrierId ()), "HandoverLeavingTimeout");
2487  RemoveUe (rnti);
2488 }
2489 
2490 void
2491 LteEnbRrc::SendHandoverRequest (uint16_t rnti, uint16_t cellId)
2492 {
2493  NS_LOG_FUNCTION (this << rnti << cellId);
2494  NS_LOG_LOGIC ("Request to send HANDOVER REQUEST");
2496 
2497  Ptr<UeManager> ueManager = GetUeManager (rnti);
2498  ueManager->PrepareHandover (cellId);
2499 
2500 }
2501 
2502 void
2504 {
2505  NS_LOG_FUNCTION (this << rnti);
2506  GetUeManager (rnti)->CompleteSetupUe (params);
2507 }
2508 
2509 void
2511 {
2512  NS_LOG_FUNCTION (this << rnti);
2513  GetUeManager (rnti)->RecvRrcConnectionRequest (msg);
2514 }
2515 
2516 void
2518 {
2519  NS_LOG_FUNCTION (this << rnti);
2520  GetUeManager (rnti)->RecvRrcConnectionSetupCompleted (msg);
2521 }
2522 
2523 void
2525 {
2526  NS_LOG_FUNCTION (this << rnti);
2527  GetUeManager (rnti)->RecvRrcConnectionReconfigurationCompleted (msg);
2528 }
2529 
2530 void
2532 {
2533  NS_LOG_FUNCTION (this << rnti);
2534  GetUeManager (rnti)->RecvRrcConnectionReestablishmentRequest (msg);
2535 }
2536 
2537 void
2539 {
2540  NS_LOG_FUNCTION (this << rnti);
2541  GetUeManager (rnti)->RecvRrcConnectionReestablishmentComplete (msg);
2542 }
2543 
2544 void
2546 {
2547  NS_LOG_FUNCTION (this << rnti);
2548  GetUeManager (rnti)->RecvMeasurementReport (msg);
2549 }
2550 
2551 void
2553 {
2554  NS_LOG_FUNCTION (this);
2555  Ptr<UeManager> ueManager = GetUeManager (msg.rnti);
2556  ueManager->InitialContextSetupRequest ();
2557 }
2558 
2559 void
2561 {
2562  NS_LOG_FUNCTION (this << rnti);
2563  // TODO: remove after merge of ho_failure branch
2564  // check if the RNTI to be removed is not stale
2565  if (HasUeManager (rnti))
2566  {
2567  GetUeManager (rnti)->RecvIdealUeContextRemoveRequest (rnti);
2568  // delete the UE context at the eNB
2569  RemoveUe (rnti);
2570  }
2571 }
2572 
2573 void
2575 {
2576  NS_LOG_FUNCTION (this);
2577  Ptr<UeManager> ueManager = GetUeManager (request.rnti);
2578  ueManager->SetupDataRadioBearer (request.bearer, request.bearerId, request.gtpTeid, request.transportLayerAddress);
2579 }
2580 
2581 void
2583 {
2584  NS_LOG_FUNCTION (this);
2585  Ptr<UeManager> ueManager = GetUeManager (params.rnti);
2586  ueManager->SendUeContextRelease ();
2587 }
2588 
2589 void
2591 {
2592  NS_LOG_FUNCTION (this);
2593 
2594  NS_LOG_LOGIC ("Recv X2 message: HANDOVER REQUEST");
2595 
2596  NS_LOG_LOGIC ("oldEnbUeX2apId = " << req.oldEnbUeX2apId);
2597  NS_LOG_LOGIC ("sourceCellId = " << req.sourceCellId);
2598  NS_LOG_LOGIC ("targetCellId = " << req.targetCellId);
2599  NS_LOG_LOGIC ("mmeUeS1apId = " << req.mmeUeS1apId);
2600 
2601  if (m_admitHandoverRequest == false)
2602  {
2603  NS_LOG_INFO ("rejecting handover request from cellId " << req.sourceCellId);
2605  res.oldEnbUeX2apId = req.oldEnbUeX2apId;
2606  res.sourceCellId = req.sourceCellId;
2607  res.targetCellId = req.targetCellId;
2608  res.cause = 0;
2609  res.criticalityDiagnostics = 0;
2611  return;
2612  }
2613 
2614  uint8_t componentCarrierId = CellToComponentCarrierId (req.targetCellId);
2615  uint16_t rnti = AddUe (UeManager::HANDOVER_JOINING, componentCarrierId);
2616  LteEnbCmacSapProvider::AllocateNcRaPreambleReturnValue anrcrv = m_cmacSapProvider.at (componentCarrierId)->AllocateNcRaPreamble (rnti);
2617  if (anrcrv.valid == false)
2618  {
2619  NS_LOG_INFO (this << " failed to allocate a preamble for non-contention based RA => cannot accept HO");
2620  RemoveUe (rnti);
2621  NS_FATAL_ERROR ("should trigger HO Preparation Failure, but it is not implemented");
2622  return;
2623  }
2624 
2625  Ptr<UeManager> ueManager = GetUeManager (rnti);
2626  ueManager->SetSource (req.sourceCellId, req.oldEnbUeX2apId);
2627  ueManager->SetImsi (req.mmeUeS1apId);
2628 
2630  ackParams.oldEnbUeX2apId = req.oldEnbUeX2apId;
2631  ackParams.newEnbUeX2apId = rnti;
2632  ackParams.sourceCellId = req.sourceCellId;
2633  ackParams.targetCellId = req.targetCellId;
2634 
2635  for (std::vector <EpcX2Sap::ErabToBeSetupItem>::iterator it = req.bearers.begin ();
2636  it != req.bearers.end ();
2637  ++it)
2638  {
2639  ueManager->SetupDataRadioBearer (it->erabLevelQosParameters, it->erabId, it->gtpTeid, it->transportLayerAddress);
2641  i.erabId = it->erabId;
2642  ackParams.admittedBearers.push_back (i);
2643  }
2644 
2645  LteRrcSap::RrcConnectionReconfiguration handoverCommand = ueManager->GetRrcConnectionReconfigurationForHandover (componentCarrierId);
2646 
2647  handoverCommand.mobilityControlInfo.newUeIdentity = rnti;
2648  handoverCommand.mobilityControlInfo.haveRachConfigDedicated = true;
2651 
2652  LteEnbCmacSapProvider::RachConfig rc = m_cmacSapProvider.at (componentCarrierId)->GetRachConfig ();
2657 
2658  Ptr<Packet> encodedHandoverCommand = m_rrcSapUser->EncodeHandoverCommand (handoverCommand);
2659 
2660  ackParams.rrcContext = encodedHandoverCommand;
2661 
2662  NS_LOG_LOGIC ("Send X2 message: HANDOVER REQUEST ACK");
2663 
2664  NS_LOG_LOGIC ("oldEnbUeX2apId = " << ackParams.oldEnbUeX2apId);
2665  NS_LOG_LOGIC ("newEnbUeX2apId = " << ackParams.newEnbUeX2apId);
2666  NS_LOG_LOGIC ("sourceCellId = " << ackParams.sourceCellId);
2667  NS_LOG_LOGIC ("targetCellId = " << ackParams.targetCellId);
2668 
2670 }
2671 
2672 void
2674 {
2675  NS_LOG_FUNCTION (this);
2676 
2677  NS_LOG_LOGIC ("Recv X2 message: HANDOVER REQUEST ACK");
2678 
2679  NS_LOG_LOGIC ("oldEnbUeX2apId = " << params.oldEnbUeX2apId);
2680  NS_LOG_LOGIC ("newEnbUeX2apId = " << params.newEnbUeX2apId);
2681  NS_LOG_LOGIC ("sourceCellId = " << params.sourceCellId);
2682  NS_LOG_LOGIC ("targetCellId = " << params.targetCellId);
2683 
2684  uint16_t rnti = params.oldEnbUeX2apId;
2685  Ptr<UeManager> ueManager = GetUeManager (rnti);
2686  ueManager->RecvHandoverRequestAck (params);
2687 }
2688 
2689 void
2691 {
2692  NS_LOG_FUNCTION (this);
2693 
2694  NS_LOG_LOGIC ("Recv X2 message: HANDOVER PREPARATION FAILURE");
2695 
2696  NS_LOG_LOGIC ("oldEnbUeX2apId = " << params.oldEnbUeX2apId);
2697  NS_LOG_LOGIC ("sourceCellId = " << params.sourceCellId);
2698  NS_LOG_LOGIC ("targetCellId = " << params.targetCellId);
2699  NS_LOG_LOGIC ("cause = " << params.cause);
2700  NS_LOG_LOGIC ("criticalityDiagnostics = " << params.criticalityDiagnostics);
2701 
2702  uint16_t rnti = params.oldEnbUeX2apId;
2703  Ptr<UeManager> ueManager = GetUeManager (rnti);
2704  ueManager->RecvHandoverPreparationFailure (params.targetCellId);
2705 }
2706 
2707 void
2709 {
2710  NS_LOG_FUNCTION (this);
2711 
2712  NS_LOG_LOGIC ("Recv X2 message: SN STATUS TRANSFER");
2713 
2714  NS_LOG_LOGIC ("oldEnbUeX2apId = " << params.oldEnbUeX2apId);
2715  NS_LOG_LOGIC ("newEnbUeX2apId = " << params.newEnbUeX2apId);
2716  NS_LOG_LOGIC ("erabsSubjectToStatusTransferList size = " << params.erabsSubjectToStatusTransferList.size ());
2717 
2718  uint16_t rnti = params.newEnbUeX2apId;
2719  Ptr<UeManager> ueManager = GetUeManager (rnti);
2720  ueManager->RecvSnStatusTransfer (params);
2721 }
2722 
2723 void
2725 {
2726  NS_LOG_FUNCTION (this);
2727 
2728  NS_LOG_LOGIC ("Recv X2 message: UE CONTEXT RELEASE");
2729 
2730  NS_LOG_LOGIC ("oldEnbUeX2apId = " << params.oldEnbUeX2apId);
2731  NS_LOG_LOGIC ("newEnbUeX2apId = " << params.newEnbUeX2apId);
2732 
2733  uint16_t rnti = params.oldEnbUeX2apId;
2734  GetUeManager (rnti)->RecvUeContextRelease (params);
2735  RemoveUe (rnti);
2736 }
2737 
2738 void
2740 {
2741  NS_LOG_FUNCTION (this);
2742 
2743  NS_LOG_LOGIC ("Recv X2 message: LOAD INFORMATION");
2744 
2745  NS_LOG_LOGIC ("Number of cellInformationItems = " << params.cellInformationList.size ());
2746 
2747  NS_ABORT_IF (m_ffrRrcSapProvider.size () == 0);
2748  m_ffrRrcSapProvider.at (0)->RecvLoadInformation (params);
2749 }
2750 
2751 void
2753 {
2754  NS_LOG_FUNCTION (this);
2755 
2756  NS_LOG_LOGIC ("Recv X2 message: RESOURCE STATUS UPDATE");
2757 
2758  NS_LOG_LOGIC ("Number of cellMeasurementResultItems = " << params.cellMeasurementResultList.size ());
2759 
2760  NS_ASSERT ("Processing of RESOURCE STATUS UPDATE X2 message IS NOT IMPLEMENTED");
2761 }
2762 
2763 void
2765 {
2766  NS_LOG_FUNCTION (this);
2767 
2768  NS_LOG_LOGIC ("Recv UE DATA FORWARDING through X2 interface");
2769  NS_LOG_LOGIC ("sourceCellId = " << params.sourceCellId);
2770  NS_LOG_LOGIC ("targetCellId = " << params.targetCellId);
2771  NS_LOG_LOGIC ("gtpTeid = " << params.gtpTeid);
2772  NS_LOG_LOGIC ("ueData = " << params.ueData);
2773  NS_LOG_LOGIC ("ueData size = " << params.ueData->GetSize ());
2774 
2775  std::map<uint32_t, X2uTeidInfo>::iterator
2776  teidInfoIt = m_x2uTeidInfoMap.find (params.gtpTeid);
2777  if (teidInfoIt != m_x2uTeidInfoMap.end ())
2778  {
2779  GetUeManager (teidInfoIt->second.rnti)->SendData (teidInfoIt->second.drbid, params.ueData);
2780  }
2781  else
2782  {
2783  NS_FATAL_ERROR ("X2-U data received but no X2uTeidInfo found");
2784  }
2785 }
2786 
2787 
2788 uint16_t
2789 LteEnbRrc::DoAllocateTemporaryCellRnti (uint8_t componentCarrierId)
2790 {
2791  NS_LOG_FUNCTION (this << +componentCarrierId);
2792  return AddUe (UeManager::INITIAL_RANDOM_ACCESS, componentCarrierId);
2793 }
2794 
2795 void
2797 {
2798  Ptr<UeManager> ueManager = GetUeManager (cmacParams.m_rnti);
2799  ueManager->CmacUeConfigUpdateInd (cmacParams);
2800 }
2801 
2802 void
2803 LteEnbRrc::DoNotifyLcConfigResult (uint16_t rnti, uint8_t lcid, bool success)
2804 {
2805  NS_LOG_FUNCTION (this << (uint32_t) rnti);
2806  NS_FATAL_ERROR ("not implemented");
2807 }
2808 
2809 
2810 std::vector<uint8_t>
2812 {
2813  NS_LOG_FUNCTION (this);
2814  std::vector<uint8_t> measIds = AddUeMeasReportConfig (reportConfig);
2815  m_handoverMeasIds.insert (measIds.begin (), measIds.end());
2816  return measIds;
2817 }
2818 
2819 uint8_t
2821 {
2822  NS_LOG_FUNCTION (this);
2823  uint8_t measId = AddUeMeasReportConfig (reportConfig).at (0);
2824  m_componentCarrierMeasIds.insert (measId);
2825  return measId;
2826 }
2827 
2828 void
2829 LteEnbRrc::DoSetNumberOfComponentCarriers (uint16_t numberOfComponentCarriers)
2830 {
2831  m_numberOfComponentCarriers = numberOfComponentCarriers;
2832 }
2833 
2834 void
2835 LteEnbRrc::DoTriggerHandover (uint16_t rnti, uint16_t targetCellId)
2836 {
2837  NS_LOG_FUNCTION (this << rnti << targetCellId);
2838 
2839  bool isHandoverAllowed = true;
2840 
2841  Ptr<UeManager> ueManager = GetUeManager (rnti);
2842  NS_ASSERT_MSG (ueManager != 0, "Cannot find UE context with RNTI " << rnti);
2843 
2844  if (m_anrSapProvider != 0 && !HasCellId (targetCellId))
2845  {
2846  // ensure that proper neighbour relationship exists between source and target cells
2847  bool noHo = m_anrSapProvider->GetNoHo (targetCellId);
2848  bool noX2 = m_anrSapProvider->GetNoX2 (targetCellId);
2849  NS_LOG_DEBUG (this << " cellId=" << ComponentCarrierToCellId (ueManager->GetComponentCarrierId ())
2850  << " targetCellId=" << targetCellId
2851  << " NRT.NoHo=" << noHo << " NRT.NoX2=" << noX2);
2852 
2853  if (noHo || noX2)
2854  {
2855  isHandoverAllowed = false;
2856  NS_LOG_LOGIC (this << " handover to cell " << targetCellId
2857  << " is not allowed by ANR");
2858  }
2859  }
2860 
2861  if (ueManager->GetState () != UeManager::CONNECTED_NORMALLY)
2862  {
2863  isHandoverAllowed = false;
2864  NS_LOG_LOGIC (this << " handover is not allowed because the UE"
2865  << " rnti=" << rnti << " is in "
2866  << ToString (ueManager->GetState ()) << " state");
2867  }
2868 
2869  if (isHandoverAllowed)
2870  {
2871  // initiate handover execution
2872  ueManager->PrepareHandover (targetCellId);
2873  }
2874 }
2875 
2876 uint8_t
2878 {
2879  NS_LOG_FUNCTION (this);
2880  uint8_t measId = AddUeMeasReportConfig (reportConfig).at (0);
2881  m_anrMeasIds.insert (measId);
2882  return measId;
2883 }
2884 
2885 uint8_t
2887 {
2888  NS_LOG_FUNCTION (this);
2889  uint8_t measId = AddUeMeasReportConfig (reportConfig).at (0);
2890  m_ffrMeasIds.insert (measId);
2891  return measId;
2892 }
2893 
2894 void
2896 {
2897  NS_LOG_FUNCTION (this);
2898  Ptr<UeManager> ueManager = GetUeManager (rnti);
2899  ueManager->SetPdschConfigDedicated (pdschConfigDedicated);
2900 }
2901 
2902 void
2904 {
2905  NS_LOG_FUNCTION (this);
2906 
2908 }
2909 
2910 uint16_t
2911 LteEnbRrc::AddUe (UeManager::State state, uint8_t componentCarrierId)
2912 {
2913  NS_LOG_FUNCTION (this);
2914  bool found = false;
2915  uint16_t rnti;
2916  for (rnti = m_lastAllocatedRnti + 1;
2917  (rnti != m_lastAllocatedRnti - 1) && (!found);
2918  ++rnti)
2919  {
2920  if ((rnti != 0) && (m_ueMap.find (rnti) == m_ueMap.end ()))
2921  {
2922  found = true;
2923  break;
2924  }
2925  }
2926 
2927  NS_ASSERT_MSG (found, "no more RNTIs available (do you have more than 65535 UEs in a cell?)");
2928  m_lastAllocatedRnti = rnti;
2929  Ptr<UeManager> ueManager = CreateObject<UeManager> (this, rnti, state, componentCarrierId);
2930  m_ccmRrcSapProvider-> AddUe (rnti, (uint8_t)state);
2931  m_ueMap.insert (std::pair<uint16_t, Ptr<UeManager> > (rnti, ueManager));
2932  ueManager->Initialize ();
2933  const uint16_t cellId = ComponentCarrierToCellId (componentCarrierId);
2934  NS_LOG_DEBUG (this << " New UE RNTI " << rnti << " cellId " << cellId << " srs CI " << ueManager->GetSrsConfigurationIndex ());
2935  m_newUeContextTrace (cellId, rnti);
2936  return rnti;
2937 }
2938 
2939 void
2940 LteEnbRrc::RemoveUe (uint16_t rnti)
2941 {
2942  NS_LOG_FUNCTION (this << (uint32_t) rnti);
2943  std::map <uint16_t, Ptr<UeManager> >::iterator it = m_ueMap.find (rnti);
2944  NS_ASSERT_MSG (it != m_ueMap.end (), "request to remove UE info with unknown rnti " << rnti);
2945  uint64_t imsi = it->second->GetImsi ();
2946  uint16_t srsCi = (*it).second->GetSrsConfigurationIndex ();
2947  //cancel pending events
2948  it->second->CancelPendingEvents ();
2949  // fire trace upon connection release
2950  m_connectionReleaseTrace (imsi, ComponentCarrierToCellId (it->second->GetComponentCarrierId ()), rnti);
2951  m_ueMap.erase (it);
2952  for (uint8_t i = 0; i < m_numberOfComponentCarriers; i++)
2953  {
2954  m_cmacSapProvider.at (i)->RemoveUe (rnti);
2955  m_cphySapProvider.at (i)->RemoveUe (rnti);
2956  }
2957  if (m_s1SapProvider != 0)
2958  {
2960  }
2961  m_ccmRrcSapProvider-> RemoveUe (rnti);
2962  // need to do this after UeManager has been deleted
2963  if (srsCi != 0)
2964  {
2966  }
2967 
2968  m_rrcSapUser->RemoveUe (rnti); // Remove UE context at RRC protocol
2969 }
2970 
2971 TypeId
2973 {
2974  switch (m_epsBearerToRlcMapping)
2975  {
2976  case RLC_SM_ALWAYS:
2977  return LteRlcSm::GetTypeId ();
2978  break;
2979 
2980  case RLC_UM_ALWAYS:
2981  return LteRlcUm::GetTypeId ();
2982  break;
2983 
2984  case RLC_AM_ALWAYS:
2985  return LteRlcAm::GetTypeId ();
2986  break;
2987 
2988  case PER_BASED:
2989  if (bearer.GetPacketErrorLossRate () > 1.0e-5)
2990  {
2991  return LteRlcUm::GetTypeId ();
2992  }
2993  else
2994  {
2995  return LteRlcAm::GetTypeId ();
2996  }
2997  break;
2998 
2999  default:
3000  return LteRlcSm::GetTypeId ();
3001  break;
3002  }
3003 }
3004 
3005 
3006 void
3007 LteEnbRrc::AddX2Neighbour (uint16_t cellId)
3008 {
3009  NS_LOG_FUNCTION (this << cellId);
3010 
3011  if (m_anrSapProvider != 0)
3012  {
3014  }
3015 }
3016 
3017 void
3018 LteEnbRrc::SetCsgId (uint32_t csgId, bool csgIndication)
3019 {
3020  NS_LOG_FUNCTION (this << csgId << csgIndication);
3021  for (uint8_t componentCarrierId = 0; componentCarrierId < m_sib1.size (); componentCarrierId++)
3022  {
3023  m_sib1.at (componentCarrierId).cellAccessRelatedInfo.csgIdentity = csgId;
3024  m_sib1.at (componentCarrierId).cellAccessRelatedInfo.csgIndication = csgIndication;
3025  m_cphySapProvider.at (componentCarrierId)->SetSystemInformationBlockType1 (m_sib1.at (componentCarrierId));
3026  }
3027 }
3028 
3030 static const uint8_t SRS_ENTRIES = 9;
3035 static const uint16_t g_srsPeriodicity[SRS_ENTRIES] = {0, 2, 5, 10, 20, 40, 80, 160, 320};
3041 static const uint16_t g_srsCiLow[SRS_ENTRIES] = {0, 0, 2, 7, 17, 37, 77, 157, 317};
3047 static const uint16_t g_srsCiHigh[SRS_ENTRIES] = {0, 1, 6, 16, 36, 76, 156, 316, 636};
3048 
3049 void
3051 {
3052  NS_LOG_FUNCTION (this << p);
3053  for (uint32_t id = 1; id < SRS_ENTRIES; ++id)
3054  {
3055  if (g_srsPeriodicity[id] == p)
3056  {
3058  return;
3059  }
3060  }
3061  // no match found
3062  std::ostringstream allowedValues;
3063  for (uint32_t id = 1; id < SRS_ENTRIES; ++id)
3064  {
3065  allowedValues << g_srsPeriodicity[id] << " ";
3066  }
3067  NS_FATAL_ERROR ("illecit SRS periodicity value " << p << ". Allowed values: " << allowedValues.str ());
3068 }
3069 
3070 uint32_t
3072 {
3073  NS_LOG_FUNCTION (this);
3077 }
3078 
3079 
3080 uint16_t
3082 {
3084  // SRS
3087  NS_LOG_DEBUG (this << " SRS p " << g_srsPeriodicity[m_srsCurrentPeriodicityId] << " set " << m_ueSrsConfigurationIndexSet.size ());
3089  {
3090  NS_FATAL_ERROR ("too many UEs (" << m_ueSrsConfigurationIndexSet.size () + 1
3091  << ") for current SRS periodicity "
3093  << ", consider increasing the value of ns3::LteEnbRrc::SrsPeriodicity");
3094  }
3095 
3096  if (m_ueSrsConfigurationIndexSet.empty ())
3097  {
3098  // first entry
3101  }
3102  else
3103  {
3104  // find a CI from the available ones
3105  std::set<uint16_t>::reverse_iterator rit = m_ueSrsConfigurationIndexSet.rbegin ();
3106  NS_ASSERT (rit != m_ueSrsConfigurationIndexSet.rend ());
3107  NS_LOG_DEBUG (this << " lower bound " << (*rit) << " of " << g_srsCiHigh[m_srsCurrentPeriodicityId]);
3108  if ((*rit) < g_srsCiHigh[m_srsCurrentPeriodicityId])
3109  {
3110  // got it from the upper bound
3111  m_lastAllocatedConfigurationIndex = (*rit) + 1;
3113  }
3114  else
3115  {
3116  // look for released ones
3117  for (uint16_t srcCi = g_srsCiLow[m_srsCurrentPeriodicityId]; srcCi < g_srsCiHigh[m_srsCurrentPeriodicityId]; srcCi++)
3118  {
3119  std::set<uint16_t>::iterator it = m_ueSrsConfigurationIndexSet.find (srcCi);
3120  if (it == m_ueSrsConfigurationIndexSet.end ())
3121  {
3123  m_ueSrsConfigurationIndexSet.insert (srcCi);
3124  break;
3125  }
3126  }
3127  }
3128  }
3130 
3131 }
3132 
3133 
3134 void
3136 {
3137  NS_LOG_FUNCTION (this << srcCi);
3138  std::set<uint16_t>::iterator it = m_ueSrsConfigurationIndexSet.find (srcCi);
3139  NS_ASSERT_MSG (it != m_ueSrsConfigurationIndexSet.end (), "request to remove unkwown SRS CI " << srcCi);
3140  m_ueSrsConfigurationIndexSet.erase (it);
3141 }
3142 
3143 uint8_t
3145 {
3146  if (bearer.IsGbr ())
3147  {
3148  return 1;
3149  }
3150  else
3151  {
3152  return 2;
3153  }
3154 }
3155 
3156 uint8_t
3158 {
3159  return bearer.qci;
3160 }
3161 
3162 void
3164 {
3165  // NS_LOG_FUNCTION (this);
3166 
3167  for (auto &it: m_componentCarrierPhyConf)
3168  {
3169  uint8_t ccId = it.first;
3170 
3172  si.haveSib2 = true;
3173  si.sib2.freqInfo.ulCarrierFreq = it.second->GetUlEarfcn ();
3174  si.sib2.freqInfo.ulBandwidth = it.second->GetUlBandwidth ();
3175  si.sib2.radioResourceConfigCommon.pdschConfigCommon.referenceSignalPower = m_cphySapProvider.at (ccId)->GetReferenceSignalPower ();
3177 
3178  LteEnbCmacSapProvider::RachConfig rc = m_cmacSapProvider.at (ccId)->GetRachConfig ();
3179  LteRrcSap::RachConfigCommon rachConfigCommon;
3181  rachConfigCommon.raSupervisionInfo.preambleTransMax = rc.preambleTransMax;
3183  rachConfigCommon.txFailParam.connEstFailCount = rc.connEstFailCount;
3184  si.sib2.radioResourceConfigCommon.rachConfigCommon = rachConfigCommon;
3185 
3186  m_rrcSapUser->SendSystemInformation (it.second->GetCellId (), si);
3187  }
3188 
3189  /*
3190  * For simplicity, we use the same periodicity for all SIBs. Note that in real
3191  * systems the periodicy of each SIBs could be different.
3192  */
3194 }
3195 
3196 bool
3198 {
3199  NS_LOG_FUNCTION (this << (uint32_t) rnti);
3200  Ptr<UeManager> ueManager = GetUeManager (rnti);
3201  switch (ueManager->GetState ())
3202  {
3205  return true;
3206  break;
3207  default:
3208  return false;
3209  break;
3210 
3211  }
3212 }
3213 
3214 
3215 } // namespace ns3
3216 
AttributeValue implementation for Boolean.
Definition: boolean.h:37
Callback template class.
Definition: callback.h:1279
Class for forwarding CMAC SAP User functions.
Definition: lte-enb-rrc.cc:63
virtual void NotifyLcConfigResult(uint16_t rnti, uint8_t lcid, bool success)
notify the result of the last LC config operation
Definition: lte-enb-rrc.cc:96
EnbRrcMemberLteEnbCmacSapUser(LteEnbRrc *rrc, uint8_t componentCarrierId)
Constructor.
Definition: lte-enb-rrc.cc:83
virtual uint16_t AllocateTemporaryCellRnti()
request the allocation of a Temporary C-RNTI
Definition: lte-enb-rrc.cc:90
virtual void RrcConfigurationUpdateInd(UeConfig params)
Notify the RRC of a UE config updated requested by the MAC (normally, by the scheduler)
Definition: lte-enb-rrc.cc:102
uint8_t m_componentCarrierId
Component carrier ID.
Definition: lte-enb-rrc.cc:80
virtual bool IsRandomAccessCompleted(uint16_t rnti)
Is random access completed function.
Definition: lte-enb-rrc.cc:108
Hold variables of type enum.
Definition: enum.h:55
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:218
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:344
virtual void SendHandoverRequestAck(HandoverRequestAckParams params)=0
Send handover request ack function.
virtual void SendHandoverPreparationFailure(HandoverPreparationFailureParams params)=0
Send handover preparation failure function.
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:407
This class contains the specification of EPS Bearers.
Definition: eps-bearer.h:92
enum ns3::EpsBearer::Qci qci
Qos class indicator.
double GetPacketErrorLossRate() const
Definition: eps-bearer.cc:137
bool IsGbr() const
Definition: eps-bearer.cc:119
GbrQosInformation gbrQosInfo
GBR QOS information.
Definition: eps-bearer.h:131
@ GBR_CONV_VOICE
GBR Conversational Voice.
Definition: eps-bearer.h:108
Tag used to define the RNTI and EPS bearer ID for packets interchanged between the EpcEnbApplication ...
uint16_t GetRnti(void) const
Get RNTI function.
void SetRnti(uint16_t rnti)
Set the RNTI to the given value.
uint8_t GetBid(void) const
Get Bearer Id function.
void SetBid(uint8_t bid)
Set the bearer id to the given value.
void Cancel(void)
This method is syntactic sugar for the ns3::Simulator::Cancel method.
Definition: event-id.cc:53
Hold a signed integer type.
Definition: integer.h:44
Ipv4 addresses are stored in host order in this class.
Definition: ipv4-address.h:41
Service Access Point (SAP) offered by the ANR instance to the eNodeB RRC instance.
Definition: lte-anr-sap.h:38
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:98
Service Access Point (SAP) offered by the Component Carrier Manager (CCM) instance to the eNodeB RRC ...
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:634
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:1699
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:1594
std::set< uint16_t > m_ueSrsConfigurationIndexSet
UE SRS configuration index set.
Definition: lte-enb-rrc.h:1585
TracedCallback< uint64_t, uint16_t, uint16_t, uint16_t > m_handoverStartTrace
The HandoverStart trace source.
Definition: lte-enb-rrc.h:1671
void DoSetNumberOfComponentCarriers(uint16_t numberOfComponentCarriers)
Set number of component carriers.
static TypeId GetTypeId(void)
Get the type ID.
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:571
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:1552
virtual ~LteEnbRrc()
Destructor.
friend class MemberEpcEnbS1SapUser< LteEnbRrc >
allow MemberLteEnbRrcSapProvider<LteEnbRrc> class friend access
Definition: lte-enb-rrc.h:647
Callback< void, Ptr< Packet > > m_forwardUpCallback
forward up callback function
Definition: lte-enb-rrc.h:1470
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:1550
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:1508
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:1488
Time m_connectionRequestTimeoutDuration
The ConnectionRequestTimeoutDuration attribute.
Definition: lte-enb-rrc.h:1623
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:1483
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:1616
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.
uint8_t m_defaultTransmissionMode
The DefaultTransmissionMode attribute.
Definition: lte-enb-rrc.h:1570
Time m_connectionRejectedTimeoutDuration
The ConnectionRejectedTimeoutDuration attribute.
Definition: lte-enb-rrc.h:1635
Time m_connectionSetupTimeoutDuration
The ConnectionSetupTimeoutDuration attribute.
Definition: lte-enb-rrc.h:1630
virtual void DoDispose(void)
Destructor implementation.
std::set< uint8_t > m_handoverMeasIds
List of measurement identities which are intended for handover purpose.
Definition: lte-enb-rrc.h:1548
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:1599
uint16_t m_ulBandwidth
Uplink transmission bandwidth configuration in number of Resource Blocks.
Definition: lte-enb-rrc.h:1529
LteAnrSapUser * m_anrSapUser
Receive API calls from the ANR instance.
Definition: lte-enb-rrc.h:1493
LteHandoverManagementSapProvider * m_handoverManagementSapProvider
Interface to the handover algorithm instance.
Definition: lte-enb-rrc.h:1485
friend class EpcX2SpecificEpcX2SapUser< LteEnbRrc >
allow MemberEpcEnbS1SapUser<LteEnbRrc> class friend access
Definition: lte-enb-rrc.h:649
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:1500
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:1503
std::map< uint16_t, Ptr< UeManager > > m_ueMap
The UeMap attribute.
Definition: lte-enb-rrc.h:1539
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...
Ptr< UeManager > GetUeManager(uint16_t rnti)
LteCcmRrcSapProvider * m_ccmRrcSapProvider
Interface to the LteEnbComponentCarrierManager instance.
Definition: lte-enb-rrc.h:1490
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:1681
LteAnrSapProvider * m_anrSapProvider
Interface to the ANR instance.
Definition: lte-enb-rrc.h:1495
std::set< uint8_t > m_componentCarrierMeasIds
List of measurement identities which are intended for component carrier management purposes.
Definition: lte-enb-rrc.h:1554
std::vector< LteEnbCphySapProvider * > m_cphySapProvider
Interface to the eNodeB PHY instances.
Definition: lte-enb-rrc.h:1518
void SetLteMacSapProvider(LteMacSapProvider *s)
set the MAC SAP provider.
uint16_t m_lastAllocatedConfigurationIndex
last allocated configuration index
Definition: lte-enb-rrc.h:1586
friend class MemberLteCcmRrcSapUser< LteEnbRrc >
allow MemberLteCcmRrcSapUser<LteEnbRrc> class friend access
Definition: lte-enb-rrc.h:653
LteRrcSap::MeasConfig m_ueMeasConfig
List of measurement configuration which are active in every UE attached to this eNodeB instance.
Definition: lte-enb-rrc.h:1545
void ConfigureCarriers(std::map< uint8_t, Ptr< ComponentCarrierBaseStation >> ccPhyConf)
Configure carriers.
friend class MemberLteEnbRrcSapProvider< LteEnbRrc >
allow MemberLteEnbRrcSapProvider<LteEnbRrc> class friend access
Definition: lte-enb-rrc.h:645
TracedCallback< uint16_t, uint16_t > m_newUeContextTrace
The NewUeContext trace source.
Definition: lte-enb-rrc.h:1656
Time m_systemInformationPeriodicity
The SystemInformationPeriodicity attribute.
Definition: lte-enb-rrc.h:1580
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:641
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:1478
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:1523
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:1695
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:1610
EpcEnbS1SapProvider * m_s1SapProvider
Interface to send messages to core network over the S1 protocol.
Definition: lte-enb-rrc.h:1511
uint16_t m_lastAllocatedRnti
Last allocated RNTI.
Definition: lte-enb-rrc.h:1531
uint32_t m_ulEarfcn
Uplink E-UTRA Absolute Radio Frequency Channel Number.
Definition: lte-enb-rrc.h:1525
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:1666
EpcX2SapUser * m_x2SapUser
Interface to receive messages from neighbour eNodeB over the X2 interface.
Definition: lte-enb-rrc.h:1473
bool m_admitRrcConnectionRequest
The AdmitRrcConnectionRequest attribute.
Definition: lte-enb-rrc.h:1604
void DoRecvUeData(EpcX2SapUser::UeDataParams params)
Receive UE data function.
uint16_t m_srsCurrentPeriodicityId
The SrsPeriodicity attribute.
Definition: lte-enb-rrc.h:1584
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:1521
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 MemberLteHandoverManagementSapUser< LteEnbRrc >
allow MemberLteHandoverManagementSapUser<LteEnbRrc> class friend access
Definition: lte-enb-rrc.h:639
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:1687
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:1650
std::map< uint32_t, X2uTeidInfo > m_x2uTeidInfoMap
TEID, RNTI, DRBID.
Definition: lte-enb-rrc.h:1564
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...
enum LteEpsBearerToRlcMapping_t m_epsBearerToRlcMapping
The EpsBearerToRlcMapping attribute.
Definition: lte-enb-rrc.h:1575
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:1516
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
uint16_t GetNewSrsConfigurationIndex(void)
Allocate a new SRS configuration index for a new UE.
std::vector< LteFfrRrcSapUser * > m_ffrRrcSapUser
Receive API calls from the FFR algorithm instance.
Definition: lte-enb-rrc.h:1498
EpcX2SapProvider * m_x2SapProvider
Interface to send messages to neighbour eNodeB over the X2 interface.
Definition: lte-enb-rrc.h:1475
std::vector< LteEnbCmacSapProvider * > m_cmacSapProvider
Interface to the eNodeB MAC instance.
Definition: lte-enb-rrc.h:1480
std::vector< LteRrcSap::SystemInformationBlockType1 > m_sib1
The System Information Block Type 1 that is currently broadcasted over BCH.
Definition: lte-enb-rrc.h:1534
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:1505
bool m_carriersConfigured
are carriers configured
Definition: lte-enb-rrc.h:1697
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:1661
TracedCallback< uint64_t, uint16_t, uint16_t, std::string > m_rrcTimeoutTrace
The 'TimerExpiry' Trace source.
Definition: lte-enb-rrc.h:1693
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:1513
void RemoveSrsConfigurationIndex(uint16_t srcCi)
remove a previously allocated SRS configuration index
Time m_handoverJoiningTimeoutDuration
The HandoverJoiningTimeoutDuration attribute.
Definition: lte-enb-rrc.h:1644
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:1527
TracedCallback< uint64_t, uint16_t, uint16_t > m_handoverEndOkTrace
The HandoverEndOk trace source.
Definition: lte-enb-rrc.h:1676
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.
Part of the RRC protocol.
Definition: lte-rrc-sap.h:1201
Part of the RRC protocol.
Definition: lte-rrc-sap.h:1082
virtual Ptr< Packet > EncodeHandoverCommand(RrcConnectionReconfiguration msg)=0
Encode handover command.
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.
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:37
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:37
static TypeId GetTypeId(void)
Get the type ID.
Definition: lte-rlc-am.cc:88
This abstract base class defines the API to interact with the Radio Link Control (LTE_RLC) in LTE,...
Definition: lte-rlc.h:51
void SetLteRlcSapUser(LteRlcSapUser *s)
Definition: lte-rlc.cc:147
void SetRnti(uint16_t rnti)
Definition: lte-rlc.cc:133
void SetLteMacSapProvider(LteMacSapProvider *s)
Definition: lte-rlc.cc:161
LteMacSapUser * GetLteMacSapUser()
Definition: lte-rlc.cc:168
void SetLcId(uint8_t lcId)
Definition: lte-rlc.cc:140
LteRlcSapProvider * GetLteRlcSapProvider()
Definition: lte-rlc.cc:154
static TypeId GetTypeId(void)
Get the type ID.
Definition: lte-rlc.cc:191
static TypeId GetTypeId(void)
Get the type ID.
Definition: lte-rlc-um.cc:55
static double ConvertPdschConfigDedicated2Double(PdschConfigDedicated pdschConfigDedicated)
Convert PDSCH config dedicated function.
Definition: lte-rrc-sap.h:180
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(void) 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:88
Ptr< T > GetObject(void) const
Get a pointer to the requested aggregated Object.
Definition: object.h:470
virtual void DoInitialize(void)
Initialize() implementation.
Definition: object.cc:353
Container for a set of ns3::Object pointers.
bool RemovePacketTag(Tag &tag)
Remove a packet tag.
Definition: packet.cc:963
void AddPacketTag(const Tag &tag) const
Add a packet tag.
Definition: packet.cc:956
uint32_t GetSize(void) const
Returns the the size in bytes of the packet (including the zero-filled initial payload).
Definition: packet.h:856
Hold objects of type Ptr<T>.
Definition: pointer.h:37
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:74
static EventId Schedule(Time const &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
Definition: simulator.h:556
static Time Now(void)
Return the current simulation virtual time.
Definition: simulator.cc:195
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:103
AttributeValue implementation for Time.
Definition: nstime.h:1308
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:922
bool m_pendingStartDataRadioBearers
Pending start data radio bearers.
Definition: lte-enb-rrc.h:610
void RecvRrcConnectionReestablishmentRequest(LteRrcSap::RrcConnectionReestablishmentRequest msg)
Implement the LteEnbRrcSapProvider::RecvRrcConnectionReestablishmentRequest interface.
static TypeId GetTypeId(void)
Get the type ID.
Definition: lte-enb-rrc.cc:330
void InitialContextSetupRequest()
Process Initial context setup request message from the MME.
Definition: lte-enb-rrc.cc:380
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:500
std::map< uint8_t, Ptr< LteDataRadioBearerInfo > > m_drbMap
The DataRadioBearerMap attribute.
Definition: lte-enb-rrc.h:514
Ptr< LteSignalingRadioBearerInfo > m_srb1
The Srb1 attribute.
Definition: lte-enb-rrc.h:523
void PrepareHandover(uint16_t cellId)
Start the handover preparation and send the handover request.
Definition: lte-enb-rrc.cc:635
void SetImsi(uint64_t imsi)
Set the IMSI.
Definition: lte-enb-rrc.cc:374
uint64_t GetImsi(void) const
void SendData(uint8_t bid, Ptr< Packet > p)
Send a data packet over the appropriate Data Radio Bearer.
Definition: lte-enb-rrc.cc:887
virtual ~UeManager(void)
Definition: lte-enb-rrc.cc:312
void CompleteSetupUe(LteEnbRrcSapProvider::CompleteSetupUeParameters params)
Implement the LteEnbRrcSapProvider::CompleteSetupUe interface.
bool m_needPhyMacConfiguration
need Phy MAC configuration
Definition: lte-enb-rrc.h:570
State
The state of the UeManager at the eNB RRC.
Definition: lte-enb-rrc.h:87
@ CONNECTION_REESTABLISHMENT
Definition: lte-enb-rrc.h:94
@ CONNECTION_RECONFIGURATION
Definition: lte-enb-rrc.h:93
LteRrcSap::RadioResourceConfigDedicated GetRadioResourceConfigForHandoverPreparationInfo()
Definition: lte-enb-rrc.cc:812
void CmacUeConfigUpdateInd(LteEnbCmacSapUser::UeConfig cmacParams)
CMAC UE config update indication function.
LteRrcSap::RrcConnectionReconfiguration BuildRrcConnectionReconfiguration()
EventId m_handoverJoiningTimeout
Time limit before a handover joining timeout occurs.
Definition: lte-enb-rrc.h:597
uint8_t AddDataRadioBearerInfo(Ptr< LteDataRadioBearerInfo > radioBearerInfo)
Add a new LteDataRadioBearerInfo structure to the UeManager.
uint8_t Lcid2Bid(uint8_t lcid)
uint16_t m_rnti
The C-RNTI attribute.
Definition: lte-enb-rrc.h:528
void RecvSnStatusTransfer(EpcX2SapUser::SnStatusTransferParams params)
Take the necessary actions in response to the reception of an X2 SN STATUS TRANSFER message.
uint8_t Bid2Lcid(uint8_t bid)
LteRrcSap::PhysicalConfigDedicated m_physicalConfigDedicated
physical config dedicated
Definition: lte-enb-rrc.h:541
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:569
uint8_t m_lastAllocatedDrbid
last allocated Data Radio Bearer ID
Definition: lte-enb-rrc.h:508
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:590
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:395
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:563
State GetState() const
uint16_t m_targetX2apId
target X2 ap ID
Definition: lte-enb-rrc.h:566
uint8_t Drbid2Bid(uint8_t drbid)
Ptr< LteSignalingRadioBearerInfo > m_srb0
The Srb0 attribute.
Definition: lte-enb-rrc.h:519
EventId m_connectionRequestTimeout
Time limit before a connection request timeout occurs.
Definition: lte-enb-rrc.h:578
uint64_t m_imsi
International Mobile Subscriber Identity assigned to this UE.
Definition: lte-enb-rrc.h:533
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:607
uint16_t m_targetCellId
target cell ID
Definition: lte-enb-rrc.h:568
void SetSrsConfigurationIndex(uint16_t srsConfIndex)
Set the SRS configuration index and do the necessary reconfiguration.
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:865
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:367
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:622
friend class LtePdcpSpecificLtePdcpSapUser< UeManager >
allow LtePdcpSpecificLtePdcpSapUser<UeManager> class friend access
Definition: lte-enb-rrc.h:77
uint8_t m_lastRrcTransactionIdentifier
last RRC transaction identifier
Definition: lte-enb-rrc.h:539
uint8_t m_componentCarrierId
ID of the primary CC for this UE.
Definition: lte-enb-rrc.h:537
State m_state
The current UeManager state.
Definition: lte-enb-rrc.h:545
void RecvMeasurementReport(LteRrcSap::MeasurementReport msg)
Implement the LteEnbRrcSapProvider::RecvMeasurementReport interface.
Ptr< LteEnbRrc > m_rrc
Pointer to the parent eNodeB RRC.
Definition: lte-enb-rrc.h:543
uint16_t GetSrsConfigurationIndex(void) const
TracedCallback< uint64_t, uint16_t, uint16_t, State, State > m_stateTransitionTrace
The StateTransition trace source.
Definition: lte-enb-rrc.h:556
bool m_pendingRrcConnectionReconfiguration
pending RRC connection reconfiguration
Definition: lte-enb-rrc.h:549
void ReleaseDataRadioBearer(uint8_t drbid)
Release a given radio bearer.
Definition: lte-enb-rrc.cc:532
void RecvRrcConnectionReestablishmentComplete(LteRrcSap::RrcConnectionReestablishmentComplete msg)
Implement the LteEnbRrcSapProvider::RecvRrcConnectionReestablishmentComplete interface.
uint8_t Bid2Drbid(uint8_t bid)
uint16_t GetRnti(void) const
LteRrcSap::RrcConnectionReconfiguration GetRrcConnectionReconfigurationForHandover(uint8_t componentCarrierId)
Definition: lte-enb-rrc.cc:819
void StartDataRadioBearers()
Start the data radio bearers that have been previously recorded to be started using RecordDataRadioBe...
Definition: lte-enb-rrc.cc:512
void SendUeContextRelease()
send the UE CONTEXT RELEASE X2 message to the source eNB, thus successfully terminating an X2 handove...
Definition: lte-enb-rrc.cc:957
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:750
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:601
uint16_t m_sourceCellId
source cell ID
Definition: lte-enb-rrc.h:567
void RecvHandoverPreparationFailure(uint16_t cellId)
Take the necessary actions in response to the reception of an X2 HO preparation failure message.
Definition: lte-enb-rrc.cc:989
virtual void DoInitialize()
Initialize() implementation.
Definition: lte-enb-rrc.cc:174
EventId m_handoverLeavingTimeout
Time limit before a handover leaving timeout occurs.
Definition: lte-enb-rrc.h:604
uint16_t m_sourceX2apId
source X2 ap ID
Definition: lte-enb-rrc.h:565
std::vector< EpcX2Sap::ErabToBeSetupItem > GetErabList()
Definition: lte-enb-rrc.cc:937
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:547
void SwitchToState(State s)
Switch the UeManager to the given state.
void SetPdschConfigDedicated(LteRrcSap::PdschConfigDedicated pdschConfigDedicated)
Configure PdschConfigDedicated (i.e.
virtual void DoDispose()
Destructor implementation.
Definition: lte-enb-rrc.cc:317
EventId m_connectionSetupTimeout
Time limit before a connection setup timeout occurs.
Definition: lte-enb-rrc.h:584
void RecvIdealUeContextRemoveRequest(uint16_t rnti)
Implement the LteEnbRrcSapProvider::RecvIdealUeContextRemoveRequest interface.
Definition: lte-enb-rrc.cc:582
Hold an unsigned integer type.
Definition: uinteger.h:44
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
Definition: assert.h:67
#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:88
Ptr< const AttributeChecker > MakeBooleanChecker(void)
Definition: boolean.cc:121
Ptr< const AttributeAccessor > MakeBooleanAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Definition: boolean.h:85
Ptr< const AttributeAccessor > MakeEnumAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Definition: enum.h:205
Ptr< const AttributeAccessor > MakeIntegerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Definition: integer.h:45
Ptr< const AttributeAccessor > MakeObjectMapAccessor(U T::*memberVariable)
MakeAccessorHelper implementation for ObjectVector.
Definition: object-map.h:80
Ptr< const AttributeAccessor > MakePointerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Definition: pointer.h:227
Ptr< const AttributeAccessor > MakeTimeAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Definition: nstime.h:1309
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Definition: uinteger.h:45
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
Definition: fatal-error.h:165
#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:77
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:205
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Definition: log.h:273
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
Definition: log.h:289
#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:265
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
Definition: log.h:281
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition: object-base.h:45
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition: nstime.h:1244
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition: nstime.h:1252
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
Create a TraceSourceAccessor which will control access to the underlying trace source.
#define MIN_NO_CC
Definition: lte-enb-rrc.h:56
#define MAX_NO_CC
Definition: lte-enb-rrc.h:57
Every class exported by the ns3 library is enclosed in the ns3 namespace.
static const std::string & ToString(EpcUeNas::State s)
Definition: epc-ue-nas.cc:50
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:162
Ptr< const AttributeChecker > MakeTimeChecker(const Time min, const Time max)
Helper to make a Time checker with bounded range.
Definition: time.cc:522
static const std::string g_ueManagerStateName[UeManager::NUM_STATES]
Map each of UE Manager states to its string representation.
Definition: lte-enb-rrc.cc:121
static const uint16_t g_srsCiLow[SRS_ENTRIES]
The lower bound (inclusive) of the SRS configuration indices (ISRS) which use the corresponding SRS p...
static const uint16_t g_srsCiHigh[SRS_ENTRIES]
The upper bound (inclusive) of the SRS configuration indices (ISRS) which use the corresponding SRS p...
static const uint8_t SRS_ENTRIES
Number of distinct SRS periodicity plus one.
static const uint16_t g_srsPeriodicity[SRS_ENTRIES]
Sounding Reference Symbol (SRS) periodicity (TSRS) in milliseconds.
PathSwitchRequestParameters structure.
std::list< BearerToBeSwitched > bearersToBeSwitched
list of bearers to be switched
uint32_t mmeUeS1Id
mmeUeS1Id in practice, we use the IMSI
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 PREPARATION FAILURE message.
Definition: epc-x2-sap.h:263
uint16_t criticalityDiagnostics
criticality diagnostics
Definition: epc-x2-sap.h:268
uint16_t oldEnbUeX2apId
old ENB UE X2 AP ID
Definition: epc-x2-sap.h:264
Parameters of the HANDOVER REQUEST ACKNOWLEDGE message.
Definition: epc-x2-sap.h:247
std::vector< ErabNotAdmittedItem > notAdmittedBearers
not admitted bearers
Definition: epc-x2-sap.h:253
std::vector< ErabAdmittedItem > admittedBearers
admitted bearers
Definition: epc-x2-sap.h:252
uint16_t sourceCellId
source cell ID
Definition: epc-x2-sap.h:250
uint16_t newEnbUeX2apId
new ENB UE X2 AP ID
Definition: epc-x2-sap.h:249
uint16_t targetCellId
target cell ID
Definition: epc-x2-sap.h:251
uint16_t oldEnbUeX2apId
old ENB UE X2 AP ID
Definition: epc-x2-sap.h:248
Ptr< Packet > rrcContext
RRC context.
Definition: epc-x2-sap.h:254
Parameters of the HANDOVER REQUEST message.
Definition: epc-x2-sap.h:229
uint16_t oldEnbUeX2apId
old ENB UE X2 AP ID
Definition: epc-x2-sap.h:230
uint64_t ueAggregateMaxBitRateDownlink
UE aggregrate max bit rate downlink.
Definition: epc-x2-sap.h:235
uint16_t sourceCellId
source cell ID
Definition: epc-x2-sap.h:232
uint64_t ueAggregateMaxBitRateUplink
UE aggregrate max bit rate uplink.
Definition: epc-x2-sap.h:236
uint16_t targetCellId
target cell ID
Definition: epc-x2-sap.h:233
Ptr< Packet > rrcContext
RRC context.
Definition: epc-x2-sap.h:238
uint32_t mmeUeS1apId
MME UE S1 AP ID.
Definition: epc-x2-sap.h:234
std::vector< ErabToBeSetupItem > bearers
bearers
Definition: epc-x2-sap.h:237
Parameters of the LOAD INFORMATION message.
Definition: epc-x2-sap.h:304
std::vector< CellInformationItem > cellInformationList
cell information list
Definition: epc-x2-sap.h:306
Parameters of the RESOURCE STATUS UPDATE message.
Definition: epc-x2-sap.h:315
std::vector< CellMeasurementResultItem > cellMeasurementResultList
cell measurement result list
Definition: epc-x2-sap.h:319
Parameters of the SN STATUS TRANSFER message.
Definition: epc-x2-sap.h:277
uint16_t newEnbUeX2apId
new ENB UE X2 AP ID
Definition: epc-x2-sap.h:279
std::vector< ErabsSubjectToStatusTransferItem > erabsSubjectToStatusTransferList
ERABs subject to status transfer list.
Definition: epc-x2-sap.h:282
uint16_t oldEnbUeX2apId
old ENB UE X2 AP ID
Definition: epc-x2-sap.h:278
uint16_t targetCellId
target cell ID
Definition: epc-x2-sap.h:281
uint16_t sourceCellId
source cell ID
Definition: epc-x2-sap.h:280
Parameters of the UE CONTEXT RELEASE message.
Definition: epc-x2-sap.h:291
uint16_t newEnbUeX2apId
new ENB UE X2 AP ID
Definition: epc-x2-sap.h:293
uint16_t oldEnbUeX2apId
old ENB UE X2 AP ID
Definition: epc-x2-sap.h:292
uint16_t sourceCellId
source cell ID
Definition: epc-x2-sap.h:294
uint16_t targetCellId
target cell ID
Definition: epc-x2-sap.h:295
Parameters of the UE DATA primitive.
Definition: epc-x2-sap.h:329
Ptr< Packet > ueData
UE data.
Definition: epc-x2-sap.h:333
uint16_t sourceCellId
source cell ID
Definition: epc-x2-sap.h:330
uint32_t gtpTeid
GTP TEID.
Definition: epc-x2-sap.h:332
uint16_t targetCellId
target cell ID
Definition: epc-x2-sap.h:331
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
uint64_t gbrDl
guaranteed bitrate in downlink
uint8_t lcId
logical channel identifier
bool isGbr
true if the bearer is GBR, false if the bearer is NON-GBR
uint16_t rnti
C-RNTI identifying the UE.
struct defining the RACH configuration of the MAC
uint8_t preambleTransMax
preamble transmit maximum
uint8_t raResponseWindowSize
RA response window size.
uint8_t connEstFailCount
the counter value for T300 timer expiration
uint8_t numberOfRaPreambles
number of RA preambles
Parameters for [re]configuring the UE.
uint16_t m_rnti
UE id within this cell.
uint8_t m_transmissionMode
Transmission mode 1..7
Parameters for [re]configuring the UE.
uint16_t m_rnti
UE id within this cell.
uint8_t m_transmissionMode
Transmission mode 1..7
X2uTeidInfo structure.
Definition: lte-enb-rrc.h:1558
CompleteSetupUeParameters structure.
Definition: lte-rrc-sap.h:1205
SetupUeParameters structure.
Definition: lte-rrc-sap.h:1086
LtePdcpSapProvider * srb1SapProvider
SRB1 SAP provider.
Definition: lte-rrc-sap.h:1088
LteRlcSapProvider * srb0SapProvider
SRB0 SAP provider.
Definition: lte-rrc-sap.h:1087
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
uint8_t lcid
the logical channel id corresponding to the sending RLC instance
Definition: lte-pdcp-sap.h:47
uint16_t rnti
the C-RNTI identifying the UE
Definition: lte-pdcp-sap.h:46
Parameters for LtePdcpSapUser::ReceivePdcpSdu.
Definition: lte-pdcp-sap.h:78
uint8_t lcid
the logical channel id corresponding to the sending RLC instance
Definition: lte-pdcp-sap.h:81
uint16_t rnti
the C-RNTI identifying the UE
Definition: lte-pdcp-sap.h:80
uint16_t antennaPortsCount
antenna ports count
Definition: lte-rrc-sap.h:721
uint8_t transmissionMode
transmission mode
Definition: lte-rrc-sap.h:143
RadioResourceConfigDedicated sourceRadioResourceConfig
source radio resource config
Definition: lte-rrc-sap.h:618
MasterInformationBlock sourceMasterInformationBlock
source master information block
Definition: lte-rrc-sap.h:620
uint16_t sourceUeIdentity
source UE identity
Definition: lte-rrc-sap.h:619
MeasConfig sourceMeasConfig
source measure config
Definition: lte-rrc-sap.h:617
uint32_t sourceDlCarrierFreq
source DL carrier frequency
Definition: lte-rrc-sap.h:623
SystemInformationBlockType1 sourceSystemInformationBlockType1
source system information block type 1
Definition: lte-rrc-sap.h:621
SystemInformationBlockType2 sourceSystemInformationBlockType2
source system information block type 2
Definition: lte-rrc-sap.h:622
uint32_t dlCarrierFreq
ARFCN - valueEUTRA.
Definition: lte-rrc-sap.h:715
uint32_t physCellId
physical cell ID
Definition: lte-rrc-sap.h:714
int8_t qRxLevMin
INTEGER (-70..-22), actual value = IE value * 2 [dBm].
Definition: lte-rrc-sap.h:83
int8_t qQualMin
INTEGER (-34..-3), actual value = IE value [dB].
Definition: lte-rrc-sap.h:84
DrbToAddMod structure.
Definition: lte-rrc-sap.h:236
uint8_t epsBearerIdentity
EPS bearer identity.
Definition: lte-rrc-sap.h:237
RlcConfig rlcConfig
RLC config.
Definition: lte-rrc-sap.h:239
uint8_t logicalChannelIdentity
logical channel identify
Definition: lte-rrc-sap.h:240
uint8_t drbIdentity
DRB identity.
Definition: lte-rrc-sap.h:238
LogicalChannelConfig logicalChannelConfig
logical channel config
Definition: lte-rrc-sap.h:241
uint32_t ulCarrierFreq
UL carrier frequency.
Definition: lte-rrc-sap.h:90
uint16_t ulBandwidth
UL bandwidth.
Definition: lte-rrc-sap.h:91
HandoverPreparationInfo structure.
Definition: lte-rrc-sap.h:896
MasterInformationBlock structure.
Definition: lte-rrc-sap.h:588
uint16_t systemFrameNumber
system frame number
Definition: lte-rrc-sap.h:590
std::list< MeasObjectToAddMod > measObjectToAddModList
measure object to add mod list
Definition: lte-rrc-sap.h:521
bool haveMeasGapConfig
have measure gap config?
Definition: lte-rrc-sap.h:528
QuantityConfig quantityConfig
quantity config
Definition: lte-rrc-sap.h:527
bool haveSmeasure
have S measure?
Definition: lte-rrc-sap.h:530
bool haveSpeedStatePars
have speed state parameters?
Definition: lte-rrc-sap.h:532
std::list< ReportConfigToAddMod > reportConfigToAddModList
report config to add mod list
Definition: lte-rrc-sap.h:523
std::list< MeasIdToAddMod > measIdToAddModList
measure ID to add mod list
Definition: lte-rrc-sap.h:525
bool haveQuantityConfig
have quantity config?
Definition: lte-rrc-sap.h:526
MeasIdToAddMod structure.
Definition: lte-rrc-sap.h:465
uint8_t measObjectId
measure object ID
Definition: lte-rrc-sap.h:467
uint8_t reportConfigId
report config ID
Definition: lte-rrc-sap.h:468
bool haveCellForWhichToReportCGI
have cell for which to report CGI?
Definition: lte-rrc-sap.h:336
uint16_t allowedMeasBandwidth
allowed measure bandwidth
Definition: lte-rrc-sap.h:328
int8_t offsetFreq
offset frequency
Definition: lte-rrc-sap.h:331
uint8_t neighCellConfig
neighbor cell config
Definition: lte-rrc-sap.h:330
bool presenceAntennaPort1
antenna port 1 present?
Definition: lte-rrc-sap.h:329
uint32_t carrierFreq
carrier frequency
Definition: lte-rrc-sap.h:327
MeasObjectToAddMod structure.
Definition: lte-rrc-sap.h:451
uint8_t measObjectId
measure object ID
Definition: lte-rrc-sap.h:452
MeasObjectEutra measObjectEutra
measure object eutra
Definition: lte-rrc-sap.h:453
uint8_t rsrqResult
the RSRQ result
Definition: lte-rrc-sap.h:639
uint8_t rsrpResult
the RSRP result
Definition: lte-rrc-sap.h:638
uint8_t measId
measure ID
Definition: lte-rrc-sap.h:681
bool haveMeasResultNeighCells
have measure result neighbor cells
Definition: lte-rrc-sap.h:683
std::list< MeasResultEutra > measResultListEutra
measure result list eutra
Definition: lte-rrc-sap.h:684
bool haveMeasResultServFreqList
has measResultServFreqList-r10
Definition: lte-rrc-sap.h:685
std::list< MeasResultServFreq > measResultServFreqList
MeasResultServFreqList-r10.
Definition: lte-rrc-sap.h:686
MeasResultPCell measResultPCell
measurement result primary cell
Definition: lte-rrc-sap.h:682
MeasurementReport structure.
Definition: lte-rrc-sap.h:902
MeasResults measResults
measure results
Definition: lte-rrc-sap.h:903
RadioResourceConfigCommon radioResourceConfigCommon
radio resource config common
Definition: lte-rrc-sap.h:566
RachConfigDedicated rachConfigDedicated
RACH config dedicated.
Definition: lte-rrc-sap.h:568
bool haveRachConfigDedicated
Have RACH config dedicated?
Definition: lte-rrc-sap.h:567
uint16_t newUeIdentity
new UE identity
Definition: lte-rrc-sap.h:565
uint16_t targetPhysCellId
target Phy cell ID
Definition: lte-rrc-sap.h:560
NonCriticalExtensionConfiguration structure.
Definition: lte-rrc-sap.h:830
std::list< SCellToAddMod > sCellToAddModList
SCell to add mod list.
Definition: lte-rrc-sap.h:831
AntennaInfoCommon antennaInfoCommon
2: Physical configuration, general antennaInfoCommon-r10
Definition: lte-rrc-sap.h:743
PdschConfigCommon pdschConfigCommon
4: Physical configuration, physical channels pdsch-ConfigCommon-r10
Definition: lte-rrc-sap.h:747
uint16_t dlBandwidth
1: Cell characteristics
Definition: lte-rrc-sap.h:741
int8_t referenceSignalPower
INTEGER (-60..50),.
Definition: lte-rrc-sap.h:149
int8_t pb
INTEGER (0..3),.
Definition: lte-rrc-sap.h:150
PdschConfigDedicated structure.
Definition: lte-rrc-sap.h:155
PdschConfigDedicated pdschConfigDedicated
PDSCH config dedicated.
Definition: lte-rrc-sap.h:223
bool haveAntennaInfoDedicated
have antenna info dedicated?
Definition: lte-rrc-sap.h:220
SoundingRsUlConfigDedicated soundingRsUlConfigDedicated
sounding RS UL config dedicated
Definition: lte-rrc-sap.h:219
bool haveSoundingRsUlConfigDedicated
have sounding RS UL config dedicated?
Definition: lte-rrc-sap.h:218
bool havePdschConfigDedicated
have PDSCH config dedicated?
Definition: lte-rrc-sap.h:222
AntennaInfoDedicated antennaInfo
antenna info
Definition: lte-rrc-sap.h:221
PuschConfigDedicatedSCell pushConfigDedicatedSCell
PUSCH config dedicated SCell.
Definition: lte-rrc-sap.h:797
AntennaInfoDedicated antennaInfoUl
antenna info UL
Definition: lte-rrc-sap.h:796
SoundingRsUlConfigDedicated soundingRsUlConfigDedicated
sounding RS UL config dedicated
Definition: lte-rrc-sap.h:800
PdschConfigDedicated pdschConfigDedicated
PDSCH config dedicated.
Definition: lte-rrc-sap.h:791
bool haveSoundingRsUlConfigDedicated
have sounding RS UL config dedicated?
Definition: lte-rrc-sap.h:799
bool haveUlConfiguration
have UL configuration?
Definition: lte-rrc-sap.h:794
bool haveAntennaInfoUlDedicated
have antenna info UL dedicated?
Definition: lte-rrc-sap.h:795
bool havePdschConfigDedicated
have PDSCH config dedicated?
Definition: lte-rrc-sap.h:790
bool crossCarrierSchedulingConfig
currently implemented as boolean variable --> implementing crossCarrierScheduling is out of the scope...
Definition: lte-rrc-sap.h:789
bool haveNonUlConfiguration
have non UL configuration?
Definition: lte-rrc-sap.h:786
AntennaInfoDedicated antennaInfo
antenna info dedicated
Definition: lte-rrc-sap.h:788
bool haveAntennaInfoDedicated
have antenna info dedicated?
Definition: lte-rrc-sap.h:787
UlPowerControlDedicatedSCell ulPowerControlDedicatedSCell
UL power control dedicated SCell.
Definition: lte-rrc-sap.h:798
uint32_t plmnIdentity
PLMN identity.
Definition: lte-rrc-sap.h:68
uint8_t numberOfRaPreambles
number of RA preambles
Definition: lte-rrc-sap.h:247
uint16_t nPuschIdentity
3GPP TS 36.331 v.11.10 R11 page 216
Definition: lte-rrc-sap.h:772
uint8_t filterCoefficientRSRQ
filter coefficient RSRQ
Definition: lte-rrc-sap.h:298
uint8_t filterCoefficientRSRP
filter coefficient RSRP
Definition: lte-rrc-sap.h:297
uint8_t raResponseWindowSize
RA response window size.
Definition: lte-rrc-sap.h:254
uint8_t preambleTransMax
preamble transmit maximum
Definition: lte-rrc-sap.h:253
RachConfigCommon structure.
Definition: lte-rrc-sap.h:265
TxFailParam txFailParam
txFailParams
Definition: lte-rrc-sap.h:268
PreambleInfo preambleInfo
preamble info
Definition: lte-rrc-sap.h:266
RaSupervisionInfo raSupervisionInfo
RA supervision info.
Definition: lte-rrc-sap.h:267
uint8_t raPreambleIndex
RA preamble index.
Definition: lte-rrc-sap.h:553
uint8_t raPrachMaskIndex
RA PRACH mask index.
Definition: lte-rrc-sap.h:554
RachConfigCommon rachConfigCommon
RACH config common.
Definition: lte-rrc-sap.h:274
NonUlConfiguration nonUlConfiguration
non UL configuration
Definition: lte-rrc-sap.h:807
bool haveUlConfiguration
have UL configuration
Definition: lte-rrc-sap.h:808
bool haveNonUlConfiguration
have non UL configuration?
Definition: lte-rrc-sap.h:806
UlConfiguration ulConfiguration
UL configuration.
Definition: lte-rrc-sap.h:809
RachConfigCommon rachConfigCommon
RACH config common.
Definition: lte-rrc-sap.h:280
PdschConfigCommon pdschConfigCommon
PDSCH config common.
Definition: lte-rrc-sap.h:281
RadioResourceConfigDedicated structure.
Definition: lte-rrc-sap.h:286
PhysicalConfigDedicated physicalConfigDedicated
physical config dedicated
Definition: lte-rrc-sap.h:291
std::list< uint8_t > drbToReleaseList
DRB to release list.
Definition: lte-rrc-sap.h:289
bool havePhysicalConfigDedicated
have physical config dedicated?
Definition: lte-rrc-sap.h:290
std::list< DrbToAddMod > drbToAddModList
DRB to add mod list.
Definition: lte-rrc-sap.h:288
std::list< SrbToAddMod > srbToAddModList
SRB to add mod list.
Definition: lte-rrc-sap.h:287
PhysicalConfigDedicatedSCell physicalConfigDedicatedSCell
physical config dedicated SCell
Definition: lte-rrc-sap.h:815
Specifies criteria for triggering of an E-UTRA measurement reporting event.
Definition: lte-rrc-sap.h:362
@ EVENT_A2
Event A2: Serving becomes worse than absolute threshold.
Definition: lte-rrc-sap.h:374
@ EVENT_A4
Event A4: Neighbour becomes better than absolute threshold.
Definition: lte-rrc-sap.h:376
@ EVENT_A1
Event A1: Serving becomes better than absolute threshold.
Definition: lte-rrc-sap.h:373
@ EVENT_A5
Event A5: PCell becomes worse than absolute threshold1 AND Neighbour becomes better than another abso...
Definition: lte-rrc-sap.h:377
enum ns3::LteRrcSap::ReportConfigEutra::@68 reportQuantity
Report type enumeration.
@ RSRP
Reference Signal Received Power.
Definition: lte-rrc-sap.h:406
@ RSRQ
Reference Signal Received Quality.
Definition: lte-rrc-sap.h:407
ThresholdEutra threshold2
Threshold for event A5.
Definition: lte-rrc-sap.h:382
ThresholdEutra threshold1
Threshold for event A1, A2, A4, and A5.
Definition: lte-rrc-sap.h:381
enum ns3::LteRrcSap::ReportConfigEutra::@67 triggerQuantity
Trigger type enumeration.
@ BOTH
Both the RSRP and RSRQ quantities are to be included in the measurement report.
Definition: lte-rrc-sap.h:414
enum ns3::LteRrcSap::ReportConfigEutra::report purpose
purpose
enum ns3::LteRrcSap::ReportConfigEutra::@66 eventId
Event enumeration.
ReportConfigToAddMod structure.
Definition: lte-rrc-sap.h:458
uint8_t reportConfigId
report config ID
Definition: lte-rrc-sap.h:459
ReportConfigEutra reportConfigEutra
report config eutra
Definition: lte-rrc-sap.h:460
RrcConnectionReconfigurationCompleted structure.
Definition: lte-rrc-sap.h:852
RrcConnectionReconfiguration structure.
Definition: lte-rrc-sap.h:837
uint8_t rrcTransactionIdentifier
RRC transaction identifier.
Definition: lte-rrc-sap.h:838
bool haveMobilityControlInfo
have mobility control info
Definition: lte-rrc-sap.h:841
NonCriticalExtensionConfiguration nonCriticalExtension
3GPP TS 36.331 v.11.10 R11 Sec. 6.2.2 pag. 147 (also known as ETSI TS 136 331 v.11....
Definition: lte-rrc-sap.h:847
bool haveRadioResourceConfigDedicated
have radio resource config dedicated
Definition: lte-rrc-sap.h:843
RadioResourceConfigDedicated radioResourceConfigDedicated
radio resource config dedicated
Definition: lte-rrc-sap.h:844
bool haveNonCriticalExtension
have critical extension?
Definition: lte-rrc-sap.h:845
MobilityControlInfo mobilityControlInfo
mobility control info
Definition: lte-rrc-sap.h:842
RrcConnectionReestablishmentComplete structure.
Definition: lte-rrc-sap.h:873
RrcConnectionReestablishment structure.
Definition: lte-rrc-sap.h:866
RadioResourceConfigDedicated radioResourceConfigDedicated
radio resource config dedicated
Definition: lte-rrc-sap.h:868
uint8_t rrcTransactionIdentifier
RRC transaction identifier.
Definition: lte-rrc-sap.h:867
RrcConnectionReestablishmentRequest structure.
Definition: lte-rrc-sap.h:859
RrcConnectionReject structure.
Definition: lte-rrc-sap.h:890
RrcConnectionRequest structure.
Definition: lte-rrc-sap.h:693
RrcConnectionSetupCompleted structure.
Definition: lte-rrc-sap.h:706
RrcConnectionSetup structure.
Definition: lte-rrc-sap.h:699
uint8_t rrcTransactionIdentifier
RRC transaction identifier.
Definition: lte-rrc-sap.h:700
RadioResourceConfigDedicated radioResourceConfigDedicated
radio resource config dedicated
Definition: lte-rrc-sap.h:701
SCellToAddMod structure.
Definition: lte-rrc-sap.h:820
RadioResourceConfigDedicatedSCell radioResourceConfigDedicatedSCell
radio resource config dedicated SCell
Definition: lte-rrc-sap.h:825
uint32_t sCellIndex
SCell index.
Definition: lte-rrc-sap.h:821
bool haveRadioResourceConfigDedicatedSCell
have radio resource config dedicated SCell?
Definition: lte-rrc-sap.h:824
CellIdentification cellIdentification
cell identification
Definition: lte-rrc-sap.h:822
RadioResourceConfigCommonSCell radioResourceConfigCommonSCell
radio resource config common SCell
Definition: lte-rrc-sap.h:823
uint8_t srsSubframeConfig
SRS subframe config.
Definition: lte-rrc-sap.h:125
uint16_t srsBandwidthConfig
SRS bandwidth config.
Definition: lte-rrc-sap.h:124
enum ns3::LteRrcSap::SoundingRsUlConfigDedicated::action type
action type
uint16_t srsConfigIndex
SRS config index.
Definition: lte-rrc-sap.h:137
SrbToAddMod structure.
Definition: lte-rrc-sap.h:229
LogicalChannelConfig logicalChannelConfig
logical channel config
Definition: lte-rrc-sap.h:231
uint8_t srbIdentity
SB identity.
Definition: lte-rrc-sap.h:230
SystemInformationBlockType1 structure.
Definition: lte-rrc-sap.h:595
CellSelectionInfo cellSelectionInfo
cell selection info
Definition: lte-rrc-sap.h:597
CellAccessRelatedInfo cellAccessRelatedInfo
cell access related info
Definition: lte-rrc-sap.h:596
RadioResourceConfigCommonSib radioResourceConfigCommon
radio resource config common
Definition: lte-rrc-sap.h:603
SystemInformation structure.
Definition: lte-rrc-sap.h:609
SystemInformationBlockType2 sib2
SIB2.
Definition: lte-rrc-sap.h:611
@ THRESHOLD_RSRP
RSRP is used for the threshold.
Definition: lte-rrc-sap.h:354
@ THRESHOLD_RSRQ
RSRQ is used for the threshold.
Definition: lte-rrc-sap.h:355
enum ns3::LteRrcSap::ThresholdEutra::@64 choice
Threshold enumeration.
uint8_t connEstFailCount
Number of times that the UE detects T300 expiry on the same cell.
Definition: lte-rrc-sap.h:260
UlPowerControlCommonSCell ulPowerControlCommonSCell
3GPP TS 36.331 v.11.10 R11 pag.223
Definition: lte-rrc-sap.h:756
FreqInfo ulFreqInfo
UL frequency info.
Definition: lte-rrc-sap.h:755
SoundingRsUlConfigCommon soundingRsUlConfigCommon
sounding RS UL config common
Definition: lte-rrc-sap.h:757
PrachConfigSCell prachConfigSCell
PRACH config SCell.
Definition: lte-rrc-sap.h:758
uint16_t pSrsOffset
3GPP TS 36.331 v.11.10 R11 page 234
Definition: lte-rrc-sap.h:779