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 expected 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;
644  params.oldEnbUeX2apId = m_rnti;
646  params.sourceCellId = m_rrc->ComponentCarrierToCellId (m_componentCarrierId);
647  params.targetCellId = cellId;
648  params.mmeUeS1apId = m_imsi;
649  params.ueAggregateMaxBitRateDownlink = 200 * 1000;
650  params.ueAggregateMaxBitRateUplink = 100 * 1000;
651  params.bearers = GetErabList ();
652 
655  hpi.asConfig.sourceDlCarrierFreq = m_rrc->m_dlEarfcn;
656  hpi.asConfig.sourceMeasConfig = m_rrc->m_ueMeasConfig;
660  hpi.asConfig.sourceSystemInformationBlockType1.cellAccessRelatedInfo.plmnIdentityInfo.plmnIdentity = m_rrc->m_sib1.at (m_componentCarrierId).cellAccessRelatedInfo.plmnIdentityInfo.plmnIdentity;
662  hpi.asConfig.sourceSystemInformationBlockType1.cellAccessRelatedInfo.csgIndication = m_rrc->m_sib1.at (m_componentCarrierId).cellAccessRelatedInfo.csgIndication;
663  hpi.asConfig.sourceSystemInformationBlockType1.cellAccessRelatedInfo.csgIdentity = m_rrc->m_sib1.at (m_componentCarrierId).cellAccessRelatedInfo.csgIdentity;
664  LteEnbCmacSapProvider::RachConfig rc = m_rrc->m_cmacSapProvider.at (m_componentCarrierId)->GetRachConfig ();
671  params.rrcContext = m_rrc->m_rrcSapUser->EncodeHandoverPreparationInformation (hpi);
672 
673  NS_LOG_LOGIC ("oldEnbUeX2apId = " << params.oldEnbUeX2apId);
674  NS_LOG_LOGIC ("sourceCellId = " << params.sourceCellId);
675  NS_LOG_LOGIC ("targetCellId = " << params.targetCellId);
676  NS_LOG_LOGIC ("mmeUeS1apId = " << params.mmeUeS1apId);
677  NS_LOG_LOGIC ("rrcContext = " << params.rrcContext);
678 
679  m_rrc->m_x2SapProvider->SendHandoverRequest (params);
681  }
682  break;
683 
684  default:
685  NS_FATAL_ERROR ("method unexpected in state " << ToString (m_state));
686  break;
687  }
688 
689 }
690 
691 void
693 {
694  NS_LOG_FUNCTION (this);
695 
696  NS_ASSERT_MSG (params.notAdmittedBearers.empty (), "not admission of some bearers upon handover is not supported");
697  NS_ASSERT_MSG (params.admittedBearers.size () == m_drbMap.size (), "not enough bearers in admittedBearers");
698 
699  // note: the Handover command from the target eNB to the source eNB
700  // is expected to be sent transparently to the UE; however, here we
701  // decode the message and eventually re-encode it. This way we can
702  // support both a real RRC protocol implementation and an ideal one
703  // without actual RRC protocol encoding.
704 
705  Ptr<Packet> encodedHandoverCommand = params.rrcContext;
706  LteRrcSap::RrcConnectionReconfiguration handoverCommand = m_rrc->m_rrcSapUser->DecodeHandoverCommand (encodedHandoverCommand);
707  if (handoverCommand.haveNonCriticalExtension)
708  {
709  //Total number of component carriers = handoverCommand.nonCriticalExtension.sCellsToAddModList.size() + 1 (Primary carrier)
710  if (handoverCommand.nonCriticalExtension.sCellsToAddModList.size() + 1 != m_rrc->m_numberOfComponentCarriers)
711  {
712  //Currently handover is only possible if source and target eNBs have equal number of component carriers
713  NS_FATAL_ERROR ("The source and target eNBs have unequal number of component carriers. Target eNB CCs = "
714  << handoverCommand.nonCriticalExtension.sCellsToAddModList.size() + 1
715  << " Source eNB CCs = " << m_rrc->m_numberOfComponentCarriers);
716  }
717  }
718  m_rrc->m_rrcSapUser->SendRrcConnectionReconfiguration (m_rnti, handoverCommand);
720  m_handoverLeavingTimeout = Simulator::Schedule (m_rrc->m_handoverLeavingTimeoutDuration,
722  m_rrc, m_rnti);
723  NS_ASSERT (handoverCommand.haveMobilityControlInfo);
724  m_rrc->m_handoverStartTrace (m_imsi, m_rrc->ComponentCarrierToCellId (m_componentCarrierId), m_rnti, handoverCommand.mobilityControlInfo.targetPhysCellId);
725 
726  //Set the target cell ID and the RNTI so that handover cancel message can be sent if required
728  m_targetCellId = params.targetCellId;
729 
731  sst.oldEnbUeX2apId = params.oldEnbUeX2apId;
732  sst.newEnbUeX2apId = params.newEnbUeX2apId;
733  sst.sourceCellId = params.sourceCellId;
734  sst.targetCellId = params.targetCellId;
735  for ( std::map <uint8_t, Ptr<LteDataRadioBearerInfo> >::iterator drbIt = m_drbMap.begin ();
736  drbIt != m_drbMap.end ();
737  ++drbIt)
738  {
739  // SN status transfer is only for AM RLC
740  if (0 != drbIt->second->m_rlc->GetObject<LteRlcAm> ())
741  {
742  LtePdcp::Status status = drbIt->second->m_pdcp->GetStatus ();
744  i.dlPdcpSn = status.txSn;
745  i.ulPdcpSn = status.rxSn;
746  sst.erabsSubjectToStatusTransferList.push_back (i);
747  }
748  }
749  m_rrc->m_x2SapProvider->SendSnStatusTransfer (sst);
750 }
751 
752 
755 {
756  NS_LOG_FUNCTION (this);
758 }
759 
762 {
763  NS_LOG_FUNCTION (this);
765 }
766 
767 void
769 {
770  NS_LOG_FUNCTION (this << p << (uint16_t) bid);
772  params.pdcpSdu = p;
773  params.rnti = m_rnti;
774  params.lcid = Bid2Lcid (bid);
775  uint8_t drbid = Bid2Drbid (bid);
776  // Transmit PDCP sdu only if DRB ID found in drbMap
777  std::map<uint8_t, Ptr<LteDataRadioBearerInfo> >::iterator it = m_drbMap.find (drbid);
778  if (it != m_drbMap.end ())
779  {
781  if (bearerInfo != NULL)
782  {
783  LtePdcpSapProvider* pdcpSapProvider = bearerInfo->m_pdcp->GetLtePdcpSapProvider ();
784  pdcpSapProvider->TransmitPdcpSdu (params);
785  }
786  }
787 }
788 
789 void
791 {
792  NS_LOG_FUNCTION (this << p << (uint16_t) bid);
793  switch (m_state)
794  {
796  case CONNECTION_SETUP:
797  NS_LOG_WARN ("not connected, discarding packet");
798  return;
799  break;
800 
801  case CONNECTED_NORMALLY:
806  {
807  NS_LOG_LOGIC ("queueing data on PDCP for transmission over the air");
808  SendPacket (bid, p);
809  }
810  break;
811 
812  case HANDOVER_JOINING:
813  {
814  // Buffer data until RRC Connection Reconfiguration Complete message is received
815  NS_LOG_LOGIC ("buffering data");
816  m_packetBuffer.push_back (std::make_pair (bid, p));
817  }
818  break;
819 
820  case HANDOVER_LEAVING:
821  {
822  NS_LOG_LOGIC ("forwarding data to target eNB over X2-U");
823  uint8_t drbid = Bid2Drbid (bid);
824  EpcX2Sap::UeDataParams params;
825  params.sourceCellId = m_rrc->ComponentCarrierToCellId (m_componentCarrierId);
826  params.targetCellId = m_targetCellId;
827  params.gtpTeid = GetDataRadioBearerInfo (drbid)->m_gtpTeid;
828  params.ueData = p;
829  m_rrc->m_x2SapProvider->SendUeData (params);
830  }
831  break;
832 
833  default:
834  NS_FATAL_ERROR ("method unexpected in state " << ToString (m_state));
835  break;
836  }
837 }
838 
839 std::vector<EpcX2Sap::ErabToBeSetupItem>
841 {
842  NS_LOG_FUNCTION (this);
843  std::vector<EpcX2Sap::ErabToBeSetupItem> ret;
844  for (std::map <uint8_t, Ptr<LteDataRadioBearerInfo> >::iterator it = m_drbMap.begin ();
845  it != m_drbMap.end ();
846  ++it)
847  {
849  etbsi.erabId = it->second->m_epsBearerIdentity;
850  etbsi.erabLevelQosParameters = it->second->m_epsBearer;
851  etbsi.dlForwarding = false;
852  etbsi.transportLayerAddress = it->second->m_transportLayerAddress;
853  etbsi.gtpTeid = it->second->m_gtpTeid;
854  ret.push_back (etbsi);
855  }
856  return ret;
857 }
858 
859 void
861 {
862  NS_LOG_FUNCTION (this);
863  switch (m_state)
864  {
866  NS_LOG_INFO ("Send UE CONTEXT RELEASE from target eNB to source eNB");
867  EpcX2SapProvider::UeContextReleaseParams ueCtxReleaseParams;
868  ueCtxReleaseParams.oldEnbUeX2apId = m_sourceX2apId;
869  ueCtxReleaseParams.newEnbUeX2apId = m_rnti;
870  ueCtxReleaseParams.sourceCellId = m_sourceCellId;
871  ueCtxReleaseParams.targetCellId = m_targetCellId;
872  m_rrc->m_x2SapProvider->SendUeContextRelease (ueCtxReleaseParams);
874  m_rrc->m_handoverEndOkTrace (m_imsi, m_rrc->ComponentCarrierToCellId (m_componentCarrierId), m_rnti);
875  break;
876 
877  default:
878  NS_FATAL_ERROR ("method unexpected in state " << ToString (m_state));
879  break;
880  }
881 }
882 
883 void
885 {
886  NS_LOG_FUNCTION (this << cellId);
887  switch (m_state)
888  {
890  NS_ASSERT (cellId == m_targetCellId);
891  NS_LOG_INFO ("target eNB sent HO preparation failure, aborting HO");
893  break;
894 
895  default:
896  NS_FATAL_ERROR ("method unexpected in state " << ToString (m_state));
897  break;
898  }
899 }
900 
901 void
903 {
904  NS_LOG_FUNCTION (this);
905  for (std::vector<EpcX2Sap::ErabsSubjectToStatusTransferItem>::iterator erabIt
906  = params.erabsSubjectToStatusTransferList.begin ();
907  erabIt != params.erabsSubjectToStatusTransferList.end ();
908  ++erabIt)
909  {
910  // LtePdcp::Status status;
911  // status.txSn = erabIt->dlPdcpSn;
912  // status.rxSn = erabIt->ulPdcpSn;
913  // uint8_t drbId = Bid2Drbid (erabIt->erabId);
914  // std::map <uint8_t, Ptr<LteDataRadioBearerInfo> >::iterator drbIt = m_drbMap.find (drbId);
915  // NS_ASSERT_MSG (drbIt != m_drbMap.end (), "could not find DRBID " << (uint32_t) drbId);
916  // drbIt->second->m_pdcp->SetStatus (status);
917  }
918 }
919 
920 void
922 {
923  NS_LOG_FUNCTION (this);
924  NS_ASSERT_MSG (m_state == HANDOVER_LEAVING, "method unexpected in state " << ToString (m_state));
926 }
927 
928 
929 // methods forwarded from RRC SAP
930 
931 void
933 {
934  NS_LOG_FUNCTION (this);
935  m_srb0->m_rlc->SetLteRlcSapUser (params.srb0SapUser);
936  m_srb1->m_pdcp->SetLtePdcpSapUser (params.srb1SapUser);
937 }
938 
939 void
941 {
942  NS_LOG_FUNCTION (this);
943  switch (m_state)
944  {
946  {
948 
949  if (m_rrc->m_admitRrcConnectionRequest == true)
950  {
951  m_imsi = msg.ueIdentity;
952 
953  // send RRC CONNECTION SETUP to UE
957  m_rrc->m_rrcSapUser->SendRrcConnectionSetup (m_rnti, msg2);
958 
961  m_rrc->m_connectionSetupTimeoutDuration,
964  }
965  else
966  {
967  NS_LOG_INFO ("rejecting connection request for RNTI " << m_rnti);
968 
969  // send RRC CONNECTION REJECT to UE
971  rejectMsg.waitTime = 3;
972  m_rrc->m_rrcSapUser->SendRrcConnectionReject (m_rnti, rejectMsg);
973 
975  m_rrc->m_connectionRejectedTimeoutDuration,
978  }
979  }
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);
992  switch (m_state)
993  {
994  case CONNECTION_SETUP:
996  if ( m_caSupportConfigured == false && m_rrc->m_numberOfComponentCarriers > 1)
997  {
998  m_pendingRrcConnectionReconfiguration = true; // Force Reconfiguration
1000  }
1001 
1002  if (m_rrc->m_s1SapProvider != 0)
1003  {
1004  m_rrc->m_s1SapProvider->InitialUeMessage (m_imsi, m_rnti);
1006  }
1007  else
1008  {
1010  }
1011  m_rrc->m_connectionEstablishedTrace (m_imsi, m_rrc->ComponentCarrierToCellId (m_componentCarrierId), m_rnti);
1012  break;
1013 
1014  default:
1015  NS_FATAL_ERROR ("method unexpected in state " << ToString (m_state));
1016  break;
1017  }
1018 }
1019 
1020 void
1022 {
1023  NS_LOG_FUNCTION (this);
1024  switch (m_state)
1025  {
1029  {
1030  // configure MAC (and scheduler)
1032  req.m_rnti = m_rnti;
1034  for (uint8_t i = 0; i < m_rrc->m_numberOfComponentCarriers; i++)
1035  {
1036  m_rrc->m_cmacSapProvider.at (i)->UeUpdateConfigurationReq (req);
1037 
1038  // configure PHY
1039  m_rrc->m_cphySapProvider.at (i)->SetTransmissionMode (req.m_rnti, req.m_transmissionMode);
1041  m_rrc->m_cphySapProvider.at (i)->SetPa (m_rnti, paDouble);
1042  }
1043 
1044  m_needPhyMacConfiguration = false;
1045  }
1047  m_rrc->m_connectionReconfigurationTrace (m_imsi, m_rrc->ComponentCarrierToCellId (m_componentCarrierId), m_rnti);
1048  break;
1049 
1050  // This case is added to NS-3 in order to handle bearer de-activation scenario for CONNECTED state UE
1051  case CONNECTED_NORMALLY:
1052  NS_LOG_INFO ("ignoring RecvRrcConnectionReconfigurationCompleted in state " << ToString (m_state));
1053  break;
1054 
1055  case HANDOVER_LEAVING:
1056  NS_LOG_INFO ("ignoring RecvRrcConnectionReconfigurationCompleted in state " << ToString (m_state));
1057  break;
1058 
1059  case HANDOVER_JOINING:
1060  {
1062 
1063  while (!m_packetBuffer.empty ())
1064  {
1065  NS_LOG_LOGIC ("dequeueing data from buffer");
1066  std::pair <uint8_t, Ptr<Packet> > bidPacket = m_packetBuffer.front ();
1067  uint8_t bid = bidPacket.first;
1068  Ptr<Packet> p = bidPacket.second;
1069 
1070  NS_LOG_LOGIC ("queueing data on PDCP for transmission over the air");
1071  SendPacket (bid, p);
1072 
1073  m_packetBuffer.pop_front ();
1074  }
1075 
1076  NS_LOG_INFO ("Send PATH SWITCH REQUEST to the MME");
1078  params.rnti = m_rnti;
1079  params.cellId = m_rrc->ComponentCarrierToCellId (m_componentCarrierId);
1080  params.mmeUeS1Id = m_imsi;
1082  for (std::map <uint8_t, Ptr<LteDataRadioBearerInfo> >::iterator it = m_drbMap.begin ();
1083  it != m_drbMap.end ();
1084  ++it)
1085  {
1087  b.epsBearerId = it->second->m_epsBearerIdentity;
1088  b.teid = it->second->m_gtpTeid;
1089  params.bearersToBeSwitched.push_back (b);
1090  }
1091  m_rrc->m_s1SapProvider->PathSwitchRequest (params);
1092  }
1093  break;
1094 
1095  default:
1096  NS_FATAL_ERROR ("method unexpected in state " << ToString (m_state));
1097  break;
1098  }
1099 }
1100 
1101 void
1103 {
1104  NS_LOG_FUNCTION (this);
1105  switch (m_state)
1106  {
1107  case CONNECTED_NORMALLY:
1108  break;
1109 
1110  case HANDOVER_LEAVING:
1112  break;
1113 
1114  default:
1115  NS_FATAL_ERROR ("method unexpected in state " << ToString (m_state));
1116  break;
1117  }
1118 
1122  m_rrc->m_rrcSapUser->SendRrcConnectionReestablishment (m_rnti, msg2);
1124 }
1125 
1126 void
1128 {
1129  NS_LOG_FUNCTION (this);
1131 }
1132 
1133 void
1135 {
1136  uint8_t measId = msg.measResults.measId;
1137  NS_LOG_FUNCTION (this << (uint16_t) measId);
1138  NS_LOG_LOGIC ("measId " << (uint16_t) measId
1139  << " haveMeasResultNeighCells " << msg.measResults.haveMeasResultNeighCells
1140  << " measResultListEutra " << msg.measResults.measResultListEutra.size ()
1141  << " haveScellsMeas " << msg.measResults.haveScellsMeas
1142  << " measScellResultList " << msg.measResults.measScellResultList.measResultScell.size ());
1143  NS_LOG_LOGIC ("serving cellId " << m_rrc->ComponentCarrierToCellId (m_componentCarrierId)
1144  << " RSRP " << (uint16_t) msg.measResults.rsrpResult
1145  << " RSRQ " << (uint16_t) msg.measResults.rsrqResult);
1146 
1147  for (std::list <LteRrcSap::MeasResultEutra>::iterator it = msg.measResults.measResultListEutra.begin ();
1148  it != msg.measResults.measResultListEutra.end ();
1149  ++it)
1150  {
1151  NS_LOG_LOGIC ("neighbour cellId " << it->physCellId
1152  << " RSRP " << (it->haveRsrpResult ? (uint16_t) it->rsrpResult : 255)
1153  << " RSRQ " << (it->haveRsrqResult ? (uint16_t) it->rsrqResult : 255));
1154  }
1155 
1156  if ((m_rrc->m_handoverManagementSapProvider != 0)
1157  && (m_rrc->m_handoverMeasIds.find (measId) != m_rrc->m_handoverMeasIds.end ()))
1158  {
1159  // this measurement was requested by the handover algorithm
1160  m_rrc->m_handoverManagementSapProvider->ReportUeMeas (m_rnti,
1161  msg.measResults);
1162  }
1163 
1164  if ((m_rrc->m_ccmRrcSapProvider != 0)
1165  && (m_rrc->m_componentCarrierMeasIds.find (measId) != m_rrc->m_componentCarrierMeasIds.end ()))
1166  {
1167  // this measurement was requested by the handover algorithm
1168  m_rrc->m_ccmRrcSapProvider->ReportUeMeas (m_rnti,
1169  msg.measResults);
1170  }
1171 
1172  if ((m_rrc->m_anrSapProvider != 0)
1173  && (m_rrc->m_anrMeasIds.find (measId) != m_rrc->m_anrMeasIds.end ()))
1174  {
1175  // this measurement was requested by the ANR function
1176  m_rrc->m_anrSapProvider->ReportUeMeas (msg.measResults);
1177  }
1178 
1179  if ((m_rrc->m_ffrRrcSapProvider.size () > 0)
1180  && (m_rrc->m_ffrMeasIds.find (measId) != m_rrc->m_ffrMeasIds.end ()))
1181  {
1182  // this measurement was requested by the FFR function
1183  m_rrc->m_ffrRrcSapProvider.at (0)->ReportUeMeas (m_rnti, msg.measResults);
1184  }
1185  if (msg.measResults.haveScellsMeas == true)
1186  {
1187  for (std::list <LteRrcSap::MeasResultScell>::iterator it = msg.measResults.measScellResultList.measResultScell.begin ();
1189  ++it)
1190  {
1191  m_rrc->m_ffrRrcSapProvider.at (it->servFreqId)->ReportUeMeas (m_rnti, msg.measResults);
1194  }
1195  }
1196 
1198  m_rrc->m_ccmRrcSapProvider->ReportUeMeas (m_rnti, msg.measResults);
1199  // fire a trace source
1200  m_rrc->m_recvMeasurementReportTrace (m_imsi, m_rrc->ComponentCarrierToCellId (m_componentCarrierId), m_rnti, msg);
1201 
1202 } // end of UeManager::RecvMeasurementReport
1203 
1204 
1205 // methods forwarded from CMAC SAP
1206 
1207 void
1209 {
1210  NS_LOG_FUNCTION (this << m_rnti);
1211  // at this stage used only by the scheduler for updating txMode
1212 
1214 
1216 
1217  // reconfigure the UE RRC
1219 }
1220 
1221 
1222 // methods forwarded from PDCP SAP
1223 
1224 void
1226 {
1227  NS_LOG_FUNCTION (this);
1228  if (params.lcid > 2)
1229  {
1230  // data radio bearer
1231  EpsBearerTag tag;
1232  tag.SetRnti (params.rnti);
1233  tag.SetBid (Lcid2Bid (params.lcid));
1234  params.pdcpSdu->AddPacketTag (tag);
1235  m_rrc->m_forwardUpCallback (params.pdcpSdu);
1236  }
1237 }
1238 
1239 
1240 uint16_t
1242 {
1243  return m_rnti;
1244 }
1245 
1246 uint64_t
1248 {
1249  return m_imsi;
1250 }
1251 
1252 uint8_t
1254 {
1255  return m_componentCarrierId;
1256 }
1257 
1258 uint16_t
1260 {
1262 }
1263 
1264 void
1266 {
1267  NS_LOG_FUNCTION (this);
1269  for (uint16_t i = 0; i < m_rrc->m_numberOfComponentCarriers; i++)
1270  {
1271  m_rrc->m_cphySapProvider.at (i)->SetSrsConfigurationIndex (m_rnti, srsConfIndex);
1272  }
1273  switch (m_state)
1274  {
1275  case INITIAL_RANDOM_ACCESS:
1276  // do nothing, srs conf index will be correctly enforced upon
1277  // RRC connection establishment
1278  break;
1279 
1280  default:
1282  break;
1283  }
1284 }
1285 
1288 {
1289  return m_state;
1290 }
1291 
1292 void
1294 {
1295  NS_LOG_FUNCTION (this);
1296  m_physicalConfigDedicated.pdschConfigDedicated = pdschConfigDedicated;
1297 
1299 
1300  // reconfigure the UE RRC
1302 }
1303 
1304 void
1306 {
1307  NS_LOG_FUNCTION (this);
1313 }
1314 
1315 uint8_t
1317 {
1318  NS_LOG_FUNCTION (this);
1319  const uint8_t MAX_DRB_ID = 32;
1320  for (int drbid = (m_lastAllocatedDrbid + 1) % MAX_DRB_ID;
1321  drbid != m_lastAllocatedDrbid;
1322  drbid = (drbid + 1) % MAX_DRB_ID)
1323  {
1324  if (drbid != 0) // 0 is not allowed
1325  {
1326  if (m_drbMap.find (drbid) == m_drbMap.end ())
1327  {
1328  m_drbMap.insert (std::pair<uint8_t, Ptr<LteDataRadioBearerInfo> > (drbid, drbInfo));
1329  drbInfo->m_drbIdentity = drbid;
1330  m_lastAllocatedDrbid = drbid;
1331  return drbid;
1332  }
1333  }
1334  }
1335  NS_FATAL_ERROR ("no more data radio bearer ids available");
1336  return 0;
1337 }
1338 
1341 {
1342  NS_LOG_FUNCTION (this << (uint32_t) drbid);
1343  NS_ASSERT (0 != drbid);
1344  std::map<uint8_t, Ptr<LteDataRadioBearerInfo> >::iterator it = m_drbMap.find (drbid);
1345  NS_ABORT_IF (it == m_drbMap.end ());
1346  return it->second;
1347 }
1348 
1349 
1350 void
1352 {
1353  NS_LOG_FUNCTION (this << (uint32_t) drbid);
1354  std::map <uint8_t, Ptr<LteDataRadioBearerInfo> >::iterator it = m_drbMap.find (drbid);
1355  NS_ASSERT_MSG (it != m_drbMap.end (), "request to remove radio bearer with unknown drbid " << drbid);
1356  m_drbMap.erase (it);
1357 }
1358 
1359 
1362 {
1363  NS_LOG_FUNCTION (this);
1368  msg.haveMobilityControlInfo = false;
1369  msg.haveMeasConfig = true;
1370  msg.measConfig = m_rrc->m_ueMeasConfig;
1371  if ( m_caSupportConfigured == false && m_rrc->m_numberOfComponentCarriers > 1)
1372  {
1373  m_caSupportConfigured = true;
1374  NS_LOG_FUNCTION ( this << "CA not configured. Configure now!" );
1375  msg.haveNonCriticalExtension = true;
1377  NS_LOG_FUNCTION ( this << " haveNonCriticalExtension " << msg.haveNonCriticalExtension );
1378  }
1379  else
1380  {
1381  msg.haveNonCriticalExtension = false;
1382  }
1383 
1384  return msg;
1385 }
1386 
1389 {
1390  NS_LOG_FUNCTION (this);
1392 
1393  if (m_srb1 != 0)
1394  {
1396  stam.srbIdentity = m_srb1->m_srbIdentity;
1397  stam.logicalChannelConfig = m_srb1->m_logicalChannelConfig;
1398  rrcd.srbToAddModList.push_back (stam);
1399  }
1400 
1401  for (std::map <uint8_t, Ptr<LteDataRadioBearerInfo> >::iterator it = m_drbMap.begin ();
1402  it != m_drbMap.end ();
1403  ++it)
1404  {
1406  dtam.epsBearerIdentity = it->second->m_epsBearerIdentity;
1407  dtam.drbIdentity = it->second->m_drbIdentity;
1408  dtam.rlcConfig = it->second->m_rlcConfig;
1409  dtam.logicalChannelIdentity = it->second->m_logicalChannelIdentity;
1410  dtam.logicalChannelConfig = it->second->m_logicalChannelConfig;
1411  rrcd.drbToAddModList.push_back (dtam);
1412  }
1413 
1414  rrcd.havePhysicalConfigDedicated = true;
1416  return rrcd;
1417 }
1418 
1419 uint8_t
1421 {
1422  NS_LOG_FUNCTION (this);
1426 }
1427 
1428 uint8_t
1430 {
1431  NS_ASSERT (lcid > 2);
1432  return lcid - 2;
1433 }
1434 
1435 uint8_t
1436 UeManager::Drbid2Lcid (uint8_t drbid)
1437 {
1438  return drbid + 2;
1439 }
1440 uint8_t
1441 UeManager::Lcid2Bid (uint8_t lcid)
1442 {
1443  NS_ASSERT (lcid > 2);
1444  return lcid - 2;
1445 }
1446 
1447 uint8_t
1448 UeManager::Bid2Lcid (uint8_t bid)
1449 {
1450  return bid + 2;
1451 }
1452 
1453 uint8_t
1454 UeManager::Drbid2Bid (uint8_t drbid)
1455 {
1456  return drbid;
1457 }
1458 
1459 uint8_t
1461 {
1462  return bid;
1463 }
1464 
1465 
1466 void
1468 {
1469  NS_LOG_FUNCTION (this << ToString (newState));
1470  State oldState = m_state;
1471  m_state = newState;
1472  NS_LOG_INFO (this << " IMSI " << m_imsi << " RNTI " << m_rnti << " UeManager "
1473  << ToString (oldState) << " --> " << ToString (newState));
1474  m_stateTransitionTrace (m_imsi, m_rrc->ComponentCarrierToCellId (m_componentCarrierId), m_rnti, oldState, newState);
1475 
1476  switch (newState)
1477  {
1478  case INITIAL_RANDOM_ACCESS:
1479  case HANDOVER_JOINING:
1480  NS_FATAL_ERROR ("cannot switch to an initial state");
1481  break;
1482 
1483  case CONNECTION_SETUP:
1484  break;
1485 
1486  case ATTACH_REQUEST:
1487  break;
1488 
1489  case CONNECTED_NORMALLY:
1490  {
1492  {
1494  }
1496  {
1498  }
1499  }
1500  break;
1501 
1503  break;
1504 
1506  break;
1507 
1508  case HANDOVER_LEAVING:
1509  break;
1510 
1511  default:
1512  break;
1513  }
1514 }
1515 
1518 {
1519  NS_LOG_FUNCTION ( this );
1521 
1522  // LteRrcSap::SCellToAddMod scell;
1523  std::list<LteRrcSap::SCellToAddMod> SccCon;
1524 
1525  // sCellToReleaseList is always empty since no Scc is released
1526 
1527  for (auto &it: m_rrc->m_componentCarrierPhyConf)
1528  {
1529  uint8_t ccId = it.first;
1530 
1531  if (ccId == m_componentCarrierId)
1532  {
1533  // Skip primary CC.
1534  continue;
1535  }
1536  else if (ccId < m_componentCarrierId)
1537  {
1538  // Shift all IDs below PCC forward so PCC can use CC ID 1.
1539  ccId++;
1540  }
1541 
1542  Ptr<ComponentCarrierBaseStation> eNbCcm = it.second;
1543  LteRrcSap::SCellToAddMod component;
1544  component.sCellIndex = ccId;
1545  component.cellIdentification.physCellId = eNbCcm->GetCellId ();
1546  component.cellIdentification.dlCarrierFreq = eNbCcm->GetDlEarfcn ();
1548  component.radioResourceConfigCommonSCell.nonUlConfiguration.dlBandwidth = eNbCcm->GetDlBandwidth ();
1550  component.radioResourceConfigCommonSCell.nonUlConfiguration.pdschConfigCommon.referenceSignalPower = m_rrc->m_cphySapProvider.at (0)->GetReferenceSignalPower ();
1553  component.radioResourceConfigCommonSCell.ulConfiguration.ulFreqInfo.ulCarrierFreq = eNbCcm->GetUlEarfcn ();
1554  component.radioResourceConfigCommonSCell.ulConfiguration.ulFreqInfo.ulBandwidth = eNbCcm->GetUlBandwidth ();
1556  //component.radioResourceConfigCommonSCell.ulConfiguration.soundingRsUlConfigCommon.type = LteRrcSap::SoundingRsUlConfigDedicated::SETUP;
1560 
1561  if (true)
1562  {
1563  component.haveRadioResourceConfigDedicatedSCell = true;
1579  }
1580  else
1581  {
1582  component.haveRadioResourceConfigDedicatedSCell = false;
1583  }
1584  SccCon.push_back (component);
1585  }
1586  ncec.sCellsToAddModList = SccCon;
1587 
1588  return ncec;
1589 }
1590 
1591 
1593 // eNB RRC methods
1595 
1597 
1599  : m_x2SapProvider (0),
1600  m_cmacSapProvider (0),
1601  m_handoverManagementSapProvider (0),
1602  m_ccmRrcSapProvider (0),
1603  m_anrSapProvider (0),
1604  m_ffrRrcSapProvider (0),
1605  m_rrcSapUser (0),
1606  m_macSapProvider (0),
1607  m_s1SapProvider (0),
1608  m_cphySapProvider (0),
1609  m_configured (false),
1610  m_lastAllocatedRnti (0),
1611  m_srsCurrentPeriodicityId (0),
1612  m_lastAllocatedConfigurationIndex (0),
1613  m_reconfigureUes (false),
1614  m_numberOfComponentCarriers (0),
1615  m_carriersConfigured (false)
1616 {
1617  NS_LOG_FUNCTION (this);
1618  m_cmacSapUser.push_back (new EnbRrcMemberLteEnbCmacSapUser (this, 0));
1621  m_ffrRrcSapUser.push_back (new MemberLteFfrRrcSapUser<LteEnbRrc> (this));
1625  m_cphySapUser.push_back (new MemberLteEnbCphySapUser<LteEnbRrc> (this));
1627 }
1628 
1629 void
1631 {
1632  NS_ASSERT_MSG (!m_carriersConfigured, "Secondary carriers can be configured only once.");
1633  m_componentCarrierPhyConf = ccPhyConf;
1634  NS_ABORT_MSG_IF (m_numberOfComponentCarriers != m_componentCarrierPhyConf.size (), " Number of component carriers "
1635  "are not equal to the number of he component carrier configuration provided");
1636 
1637  for (uint8_t i = 1; i < m_numberOfComponentCarriers; i++)
1638  {
1639  m_cphySapUser.push_back (new MemberLteEnbCphySapUser<LteEnbRrc> (this));
1640  m_cmacSapUser.push_back (new EnbRrcMemberLteEnbCmacSapUser (this, i));
1641  m_ffrRrcSapUser.push_back (new MemberLteFfrRrcSapUser<LteEnbRrc> (this));
1642  }
1643  m_carriersConfigured = true;
1645 }
1646 
1648 {
1649  NS_LOG_FUNCTION (this);
1650 }
1651 
1652 
1653 void
1655 {
1656  NS_LOG_FUNCTION (this);
1657  for ( uint8_t i = 0; i < m_numberOfComponentCarriers ; i++)
1658  {
1659  delete m_cphySapUser[i];
1660  delete m_cmacSapUser[i];
1661  delete m_ffrRrcSapUser[i];
1662  }
1663  //delete m_cphySapUser;
1664  m_cphySapUser.erase (m_cphySapUser.begin (),m_cphySapUser.end ());
1665  m_cphySapUser.clear ();
1666  //delete m_cmacSapUser;
1667  m_cmacSapUser.erase (m_cmacSapUser.begin (),m_cmacSapUser.end ());
1668  m_cmacSapUser.clear ();
1669  //delete m_ffrRrcSapUser;
1670  m_ffrRrcSapUser.erase (m_ffrRrcSapUser.begin (),m_ffrRrcSapUser.end ());
1671  m_ffrRrcSapUser.clear ();
1672  m_ueMap.clear ();
1674  delete m_ccmRrcSapUser;
1675  delete m_anrSapUser;
1676  delete m_rrcSapProvider;
1677  delete m_x2SapUser;
1678  delete m_s1SapUser;
1679 
1680 }
1681 
1682 TypeId
1684 {
1685  NS_LOG_FUNCTION ("LteEnbRrc::GetTypeId");
1686  static TypeId tid = TypeId ("ns3::LteEnbRrc")
1687  .SetParent<Object> ()
1688  .SetGroupName("Lte")
1689  .AddConstructor<LteEnbRrc> ()
1690  .AddAttribute ("UeMap", "List of UeManager by C-RNTI.",
1691  ObjectMapValue (),
1693  MakeObjectMapChecker<UeManager> ())
1694  .AddAttribute ("DefaultTransmissionMode",
1695  "The default UEs' transmission mode (0: SISO)",
1696  UintegerValue (0), // default tx-mode
1698  MakeUintegerChecker<uint8_t> ())
1699  .AddAttribute ("EpsBearerToRlcMapping",
1700  "Specify which type of RLC will be used for each type of EPS bearer. ",
1703  MakeEnumChecker (RLC_SM_ALWAYS, "RlcSmAlways",
1704  RLC_UM_ALWAYS, "RlcUmAlways",
1705  RLC_AM_ALWAYS, "RlcAmAlways",
1706  PER_BASED, "PacketErrorRateBased"))
1707  .AddAttribute ("SystemInformationPeriodicity",
1708  "The interval for sending system information (Time value)",
1709  TimeValue (MilliSeconds (80)),
1711  MakeTimeChecker ())
1712 
1713  // SRS related attributes
1714  .AddAttribute ("SrsPeriodicity",
1715  "The SRS periodicity in milliseconds",
1716  UintegerValue (40),
1719  MakeUintegerChecker<uint32_t> ())
1720 
1721  // Timeout related attributes
1722  .AddAttribute ("ConnectionRequestTimeoutDuration",
1723  "After a RA attempt, if no RRC CONNECTION REQUEST is "
1724  "received before this time, the UE context is destroyed. "
1725  "Must account for reception of RAR and transmission of "
1726  "RRC CONNECTION REQUEST over UL GRANT. The value of this"
1727  "timer should not be greater than T300 timer at UE RRC",
1728  TimeValue (MilliSeconds (15)),
1731  .AddAttribute ("ConnectionSetupTimeoutDuration",
1732  "After accepting connection request, if no RRC CONNECTION "
1733  "SETUP COMPLETE is received before this time, the UE "
1734  "context is destroyed. Must account for the UE's reception "
1735  "of RRC CONNECTION SETUP and transmission of RRC CONNECTION "
1736  "SETUP COMPLETE.",
1737  TimeValue (MilliSeconds (150)),
1739  MakeTimeChecker ())
1740  .AddAttribute ("ConnectionRejectedTimeoutDuration",
1741  "Time to wait between sending a RRC CONNECTION REJECT and "
1742  "destroying the UE context",
1743  TimeValue (MilliSeconds (30)),
1745  MakeTimeChecker ())
1746  .AddAttribute ("HandoverJoiningTimeoutDuration",
1747  "After accepting a handover request, if no RRC CONNECTION "
1748  "RECONFIGURATION COMPLETE is received before this time, the "
1749  "UE context is destroyed. Must account for reception of "
1750  "X2 HO REQ ACK by source eNB, transmission of the Handover "
1751  "Command, non-contention-based random access and reception "
1752  "of the RRC CONNECTION RECONFIGURATION COMPLETE message.",
1753  TimeValue (MilliSeconds (200)),
1755  MakeTimeChecker ())
1756  .AddAttribute ("HandoverLeavingTimeoutDuration",
1757  "After issuing a Handover Command, if neither RRC "
1758  "CONNECTION RE-ESTABLISHMENT nor X2 UE Context Release has "
1759  "been previously received, the UE context is destroyed.",
1760  TimeValue (MilliSeconds (500)),
1762  MakeTimeChecker ())
1763 
1764  // Cell selection related attribute
1765  .AddAttribute ("QRxLevMin",
1766  "One of information transmitted within the SIB1 message, "
1767  "indicating the required minimum RSRP level that any UE must "
1768  "receive from this cell before it is allowed to camp to this "
1769  "cell. The default value -70 corresponds to -140 dBm and is "
1770  "the lowest possible value as defined by Section 6.3.4 of "
1771  "3GPP TS 36.133. This restriction, however, only applies to "
1772  "initial cell selection and EPC-enabled simulation.",
1774  IntegerValue (-70),
1776  MakeIntegerChecker<int8_t> (-70, -22))
1777  .AddAttribute ("NumberOfComponentCarriers",
1778  "Number of Component Carriers ",
1779  UintegerValue (1),
1781  MakeIntegerChecker<int16_t> (MIN_NO_CC, MAX_NO_CC))
1782 
1783  // Handover related attributes
1784  .AddAttribute ("AdmitHandoverRequest",
1785  "Whether to admit an X2 handover request from another eNB",
1786  BooleanValue (true),
1788  MakeBooleanChecker ())
1789  .AddAttribute ("AdmitRrcConnectionRequest",
1790  "Whether to admit a connection request from a UE",
1791  BooleanValue (true),
1793  MakeBooleanChecker ())
1794 
1795  // UE measurements related attributes
1796  .AddAttribute ("RsrpFilterCoefficient",
1797  "Determines the strength of smoothing effect induced by "
1798  "layer 3 filtering of RSRP in all attached UE; "
1799  "if set to 0, no layer 3 filtering is applicable",
1800  // i.e. the variable k in 3GPP TS 36.331 section 5.5.3.2
1801  UintegerValue (4),
1803  MakeUintegerChecker<uint8_t> (0))
1804  .AddAttribute ("RsrqFilterCoefficient",
1805  "Determines the strength of smoothing effect induced by "
1806  "layer 3 filtering of RSRQ in all attached UE; "
1807  "if set to 0, no layer 3 filtering is applicable",
1808  // i.e. the variable k in 3GPP TS 36.331 section 5.5.3.2
1809  UintegerValue (4),
1811  MakeUintegerChecker<uint8_t> (0))
1812 
1813  // Trace sources
1814  .AddTraceSource ("NewUeContext",
1815  "Fired upon creation of a new UE context.",
1817  "ns3::LteEnbRrc::NewUeContextTracedCallback")
1818  .AddTraceSource ("ConnectionEstablished",
1819  "Fired upon successful RRC connection establishment.",
1821  "ns3::LteEnbRrc::ConnectionHandoverTracedCallback")
1822  .AddTraceSource ("ConnectionReconfiguration",
1823  "trace fired upon RRC connection reconfiguration",
1825  "ns3::LteEnbRrc::ConnectionHandoverTracedCallback")
1826  .AddTraceSource ("HandoverStart",
1827  "trace fired upon start of a handover procedure",
1829  "ns3::LteEnbRrc::HandoverStartTracedCallback")
1830  .AddTraceSource ("HandoverEndOk",
1831  "trace fired upon successful termination of a handover procedure",
1833  "ns3::LteEnbRrc::ConnectionHandoverTracedCallback")
1834  .AddTraceSource ("RecvMeasurementReport",
1835  "trace fired when measurement report is received",
1837  "ns3::LteEnbRrc::ReceiveReportTracedCallback")
1838  .AddTraceSource ("NotifyConnectionRelease",
1839  "trace fired when an UE is released",
1841  "ns3::LteEnbRrc::ConnectionHandoverTracedCallback")
1842  .AddTraceSource ("RrcTimeout",
1843  "trace fired when a timer expires",
1845  "ns3::LteEnbRrc::TimerExpiryTracedCallback")
1846  ;
1847  return tid;
1848 }
1849 
1850 void
1852 {
1853  NS_LOG_FUNCTION (this << s);
1854  m_x2SapProvider = s;
1855 }
1856 
1857 EpcX2SapUser*
1859 {
1860  NS_LOG_FUNCTION (this);
1861  return m_x2SapUser;
1862 }
1863 
1864 void
1866 {
1867  NS_LOG_FUNCTION (this << s);
1868  m_cmacSapProvider.at (0) = s;
1869 }
1870 
1871 void
1873 {
1874  NS_LOG_FUNCTION (this << s);
1875  if (m_cmacSapProvider.size () > pos)
1876  {
1877  m_cmacSapProvider.at (pos) = s;
1878  }
1879  else
1880  {
1881  m_cmacSapProvider.push_back (s);
1882  NS_ABORT_IF (m_cmacSapProvider.size () - 1 != pos);
1883  }
1884 }
1885 
1888 {
1889  NS_LOG_FUNCTION (this);
1890  return m_cmacSapUser.at (0);
1891 }
1892 
1895 {
1896  NS_LOG_FUNCTION (this);
1897  return m_cmacSapUser.at (pos);
1898 }
1899 
1900 void
1902 {
1903  NS_LOG_FUNCTION (this << s);
1905 }
1906 
1909 {
1910  NS_LOG_FUNCTION (this);
1912 }
1913 
1914 void
1916 {
1917  NS_LOG_FUNCTION (this << s);
1918  m_ccmRrcSapProvider = s;
1919 }
1920 
1923 {
1924  NS_LOG_FUNCTION (this);
1925  return m_ccmRrcSapUser;
1926 }
1927 
1928 void
1930 {
1931  NS_LOG_FUNCTION (this << s);
1932  m_anrSapProvider = s;
1933 }
1934 
1937 {
1938  NS_LOG_FUNCTION (this);
1939  return m_anrSapUser;
1940 }
1941 
1942 void
1944 {
1945  NS_LOG_FUNCTION (this << s);
1946  if (m_ffrRrcSapProvider.size () > 0)
1947  {
1948  m_ffrRrcSapProvider.at (0) = s;
1949  }
1950  else
1951  {
1952  m_ffrRrcSapProvider.push_back (s);
1953  }
1954 
1955 }
1956 
1957 void
1959 {
1960  NS_LOG_FUNCTION (this << s);
1961  if (m_ffrRrcSapProvider.size () > index)
1962  {
1963  m_ffrRrcSapProvider.at (index) = s;
1964  }
1965  else
1966  {
1967  m_ffrRrcSapProvider.push_back (s);
1968  NS_ABORT_MSG_IF (m_ffrRrcSapProvider.size () - 1 != index,
1969  "You meant to store the pointer at position " <<
1970  static_cast<uint32_t> (index) <<
1971  " but it went to " << m_ffrRrcSapProvider.size () - 1);
1972  }
1973 }
1974 
1977 {
1978  NS_LOG_FUNCTION (this);
1979  return m_ffrRrcSapUser.at (0);
1980 }
1981 
1984 {
1985  NS_LOG_FUNCTION (this);
1986  NS_ASSERT_MSG (index < m_numberOfComponentCarriers, "Invalid component carrier index:"<<index<<" provided in order to obtain FfrRrcSapUser.");
1987  return m_ffrRrcSapUser.at (index);
1988 }
1989 
1990 void
1992 {
1993  NS_LOG_FUNCTION (this << s);
1994  m_rrcSapUser = s;
1995 }
1996 
1999 {
2000  NS_LOG_FUNCTION (this);
2001  return m_rrcSapProvider;
2002 }
2003 
2004 void
2006 {
2007  NS_LOG_FUNCTION (this);
2008  m_macSapProvider = s;
2009 }
2010 
2011 void
2013 {
2014  m_s1SapProvider = s;
2015 }
2016 
2017 
2020 {
2021  return m_s1SapUser;
2022 }
2023 
2024 void
2026 {
2027  NS_LOG_FUNCTION (this << s);
2028  if (m_cphySapProvider.size () > 0)
2029  {
2030  m_cphySapProvider.at (0) = s;
2031  }
2032  else
2033  {
2034  m_cphySapProvider.push_back (s);
2035  }
2036 }
2037 
2040 {
2041  NS_LOG_FUNCTION (this);
2042  return m_cphySapUser.at(0);
2043 }
2044 
2045 void
2047 {
2048  NS_LOG_FUNCTION (this << s);
2049  if (m_cphySapProvider.size () > pos)
2050  {
2051  m_cphySapProvider.at(pos) = s;
2052  }
2053  else
2054  {
2055  m_cphySapProvider.push_back (s);
2056  NS_ABORT_IF (m_cphySapProvider.size () - 1 != pos);
2057  }
2058 }
2059 
2062 {
2063  NS_LOG_FUNCTION (this);
2064  return m_cphySapUser.at(pos);
2065 }
2066 
2067 bool
2068 LteEnbRrc::HasUeManager (uint16_t rnti) const
2069 {
2070  NS_LOG_FUNCTION (this << (uint32_t) rnti);
2071  std::map<uint16_t, Ptr<UeManager> >::const_iterator it = m_ueMap.find (rnti);
2072  return (it != m_ueMap.end ());
2073 }
2074 
2077 {
2078  NS_LOG_FUNCTION (this << (uint32_t) rnti);
2079  NS_ASSERT (0 != rnti);
2080  std::map<uint16_t, Ptr<UeManager> >::iterator it = m_ueMap.find (rnti);
2081  NS_ASSERT_MSG (it != m_ueMap.end (), "UE manager for RNTI " << rnti << " not found");
2082  return it->second;
2083 }
2084 
2085 uint8_t
2087 {
2088  NS_LOG_FUNCTION (this);
2089 
2090  // SANITY CHECK
2091 
2093  "Measurement identities and reporting configuration should not have different quantity");
2094 
2095  if (Simulator::Now () != Seconds (0))
2096  {
2097  NS_FATAL_ERROR ("AddUeMeasReportConfig may not be called after the simulation has run");
2098  }
2099 
2100  // INPUT VALIDATION
2101 
2102  switch (config.triggerQuantity)
2103  {
2107  {
2108  NS_FATAL_ERROR ("The given triggerQuantity (RSRP) does not match with the given threshold2.choice");
2109  }
2110 
2116  {
2117  NS_FATAL_ERROR ("The given triggerQuantity (RSRP) does not match with the given threshold1.choice");
2118  }
2119  break;
2120 
2124  {
2125  NS_FATAL_ERROR ("The given triggerQuantity (RSRQ) does not match with the given threshold2.choice");
2126  }
2127 
2133  {
2134  NS_FATAL_ERROR ("The given triggerQuantity (RSRQ) does not match with the given threshold1.choice");
2135  }
2136  break;
2137 
2138  default:
2139  NS_FATAL_ERROR ("unsupported triggerQuantity");
2140  break;
2141  }
2142 
2144  {
2145  NS_FATAL_ERROR ("Only REPORT_STRONGEST_CELLS purpose is supported");
2146  }
2147 
2149  {
2150  NS_LOG_WARN ("reportQuantity = BOTH will be used instead of the given reportQuantity");
2151  }
2152 
2153  uint8_t nextId = m_ueMeasConfig.reportConfigToAddModList.size () + 1;
2154 
2155  // create the reporting configuration
2156  LteRrcSap::ReportConfigToAddMod reportConfig;
2157  reportConfig.reportConfigId = nextId;
2158  reportConfig.reportConfigEutra = config;
2159 
2160  // create the measurement identity
2162  measId.measId = nextId;
2163  measId.measObjectId = 1;
2164  measId.reportConfigId = nextId;
2165 
2166  // add both to the list of UE measurement configuration
2167  m_ueMeasConfig.reportConfigToAddModList.push_back (reportConfig);
2168  m_ueMeasConfig.measIdToAddModList.push_back (measId);
2169 
2170  return nextId;
2171 }
2172 
2173 void
2175 {
2176  auto it = ccPhyConf.begin ();
2177  NS_ASSERT (it != ccPhyConf.end ());
2178  uint8_t ulBandwidth = it->second->GetUlBandwidth ();
2179  uint8_t dlBandwidth = it->second->GetDlBandwidth ();
2180  uint32_t ulEarfcn = it->second->GetUlEarfcn ();
2181  uint32_t dlEarfcn = it->second->GetDlEarfcn ();
2182  NS_LOG_FUNCTION (this << (uint16_t) ulBandwidth << (uint16_t) dlBandwidth
2183  << ulEarfcn << dlEarfcn);
2185 
2186  for (const auto &it: ccPhyConf)
2187  {
2188  m_cphySapProvider.at (it.first)->SetBandwidth (it.second->GetUlBandwidth (), it.second->GetDlBandwidth ());
2189  m_cphySapProvider.at (it.first)->SetEarfcn (it.second->GetUlEarfcn (), it.second->GetDlEarfcn ());
2190  m_cphySapProvider.at (it.first)->SetCellId (it.second->GetCellId ());
2191  m_cmacSapProvider.at (it.first)->ConfigureMac (it.second->GetUlBandwidth (), it.second->GetDlBandwidth ());
2192  if (m_ffrRrcSapProvider.size () > it.first)
2193  {
2194  m_ffrRrcSapProvider.at (it.first)->SetCellId (it.second->GetCellId ());
2195  m_ffrRrcSapProvider.at (it.first)->SetBandwidth (it.second->GetUlBandwidth (), it.second->GetDlBandwidth ());
2196  }
2197  }
2198 
2199  m_dlEarfcn = dlEarfcn;
2200  m_ulEarfcn = ulEarfcn;
2201  m_dlBandwidth = dlBandwidth;
2202  m_ulBandwidth = ulBandwidth;
2203 
2204  /*
2205  * Initializing the list of UE measurement configuration (m_ueMeasConfig).
2206  * Only intra-frequency measurements are supported, so only one measurement
2207  * object is created.
2208  */
2209 
2210  LteRrcSap::MeasObjectToAddMod measObject;
2211  measObject.measObjectId = 1;
2212  measObject.measObjectEutra.carrierFreq = m_dlEarfcn;
2214  measObject.measObjectEutra.presenceAntennaPort1 = false;
2215  measObject.measObjectEutra.neighCellConfig = 0;
2216  measObject.measObjectEutra.offsetFreq = 0;
2217  measObject.measObjectEutra.haveCellForWhichToReportCGI = false;
2218 
2219  m_ueMeasConfig.measObjectToAddModList.push_back (measObject);
2224  m_ueMeasConfig.haveSmeasure = false;
2226 
2227  m_sib1.clear ();
2228  m_sib1.reserve (ccPhyConf.size ());
2229  for (const auto &it: ccPhyConf)
2230  {
2231  // Enabling MIB transmission
2233  mib.dlBandwidth = it.second->GetDlBandwidth ();
2234  mib.systemFrameNumber = 0;
2235  m_cphySapProvider.at (it.first)->SetMasterInformationBlock (mib);
2236 
2237  // Enabling SIB1 transmission with default values
2239  sib1.cellAccessRelatedInfo.cellIdentity = it.second->GetCellId ();
2240  sib1.cellAccessRelatedInfo.csgIndication = false;
2243  sib1.cellSelectionInfo.qQualMin = -34; // not used, set as minimum value
2244  sib1.cellSelectionInfo.qRxLevMin = m_qRxLevMin; // set as minimum value
2245  m_sib1.push_back (sib1);
2246  m_cphySapProvider.at (it.first)->SetSystemInformationBlockType1 (sib1);
2247  }
2248  /*
2249  * Enabling transmission of other SIB. The first time System Information is
2250  * transmitted is arbitrarily assumed to be at +0.016s, and then it will be
2251  * regularly transmitted every 80 ms by default (set the
2252  * SystemInformationPeriodicity attribute to configure this).
2253  */
2255 
2256  m_configured = true;
2257 
2258 }
2259 
2260 
2261 void
2262 LteEnbRrc::SetCellId (uint16_t cellId)
2263 {
2264  // update SIB1
2265  m_sib1.at (0).cellAccessRelatedInfo.cellIdentity = cellId;
2266  m_cphySapProvider.at (0)->SetSystemInformationBlockType1 (m_sib1.at (0));
2267 }
2268 
2269 void
2270 LteEnbRrc::SetCellId (uint16_t cellId, uint8_t ccIndex)
2271 {
2272  // update SIB1
2273  m_sib1.at (ccIndex).cellAccessRelatedInfo.cellIdentity = cellId;
2274  m_cphySapProvider.at (ccIndex)->SetSystemInformationBlockType1 (m_sib1.at (ccIndex));
2275 }
2276 
2277 uint8_t
2279 {
2280  NS_LOG_FUNCTION (this << cellId);
2281  for (auto &it: m_componentCarrierPhyConf)
2282  {
2283  if (it.second->GetCellId () == cellId)
2284  {
2285  return it.first;
2286  }
2287  }
2288  NS_FATAL_ERROR ("Cell " << cellId << " not found in CC map");
2289 }
2290 
2291 uint16_t
2292 LteEnbRrc::ComponentCarrierToCellId (uint8_t componentCarrierId)
2293 {
2294  NS_LOG_FUNCTION (this << +componentCarrierId);
2295  return m_componentCarrierPhyConf.at (componentCarrierId)->GetCellId ();
2296 }
2297 
2298 bool
2300 {
2301  NS_LOG_FUNCTION (this << packet);
2302 
2303  EpsBearerTag tag;
2304  bool found = packet->RemovePacketTag (tag);
2305  NS_ASSERT_MSG (found, "no EpsBearerTag found in packet to be sent");
2306  Ptr<UeManager> ueManager = GetUeManager (tag.GetRnti ());
2307  ueManager->SendData (tag.GetBid (), packet);
2308 
2309  return true;
2310 }
2311 
2312 void
2314 {
2315  m_forwardUpCallback = cb;
2316 }
2317 
2318 void
2320 {
2321  NS_LOG_FUNCTION (this << rnti);
2323  "ConnectionRequestTimeout in unexpected state " << ToString (GetUeManager (rnti)->GetState ()));
2324  m_rrcTimeoutTrace (GetUeManager (rnti)->GetImsi (), rnti,
2325  ComponentCarrierToCellId (GetUeManager (rnti)->GetComponentCarrierId ()), "ConnectionRequestTimeout");
2326  RemoveUe (rnti);
2327 }
2328 
2329 void
2331 {
2332  NS_LOG_FUNCTION (this << rnti);
2333  NS_ASSERT_MSG (GetUeManager (rnti)->GetState () == UeManager::CONNECTION_SETUP,
2334  "ConnectionSetupTimeout in unexpected state " << ToString (GetUeManager (rnti)->GetState ()));
2335  m_rrcTimeoutTrace (GetUeManager (rnti)->GetImsi (), rnti,
2336  ComponentCarrierToCellId (GetUeManager (rnti)->GetComponentCarrierId ()), "ConnectionSetupTimeout");
2337  RemoveUe (rnti);
2338 }
2339 
2340 void
2342 {
2343  NS_LOG_FUNCTION (this << rnti);
2345  "ConnectionRejectedTimeout in unexpected state " << ToString (GetUeManager (rnti)->GetState ()));
2346  m_rrcTimeoutTrace (GetUeManager (rnti)->GetImsi (), rnti,
2347  ComponentCarrierToCellId (GetUeManager (rnti)->GetComponentCarrierId ()), "ConnectionRejectedTimeout");
2348  RemoveUe (rnti);
2349 }
2350 
2351 void
2353 {
2354  NS_LOG_FUNCTION (this << rnti);
2355  NS_ASSERT_MSG (GetUeManager (rnti)->GetState () == UeManager::HANDOVER_JOINING,
2356  "HandoverJoiningTimeout in unexpected state " << ToString (GetUeManager (rnti)->GetState ()));
2357  m_rrcTimeoutTrace (GetUeManager (rnti)->GetImsi (), rnti,
2358  ComponentCarrierToCellId (GetUeManager (rnti)->GetComponentCarrierId ()), "HandoverJoiningTimeout");
2359  RemoveUe (rnti);
2360 }
2361 
2362 void
2364 {
2365  NS_LOG_FUNCTION (this << rnti);
2366  NS_ASSERT_MSG (GetUeManager (rnti)->GetState () == UeManager::HANDOVER_LEAVING,
2367  "HandoverLeavingTimeout in unexpected state " << ToString (GetUeManager (rnti)->GetState ()));
2368  m_rrcTimeoutTrace (GetUeManager (rnti)->GetImsi (), rnti,
2369  ComponentCarrierToCellId (GetUeManager (rnti)->GetComponentCarrierId ()), "HandoverLeavingTimeout");
2370  RemoveUe (rnti);
2371 }
2372 
2373 void
2374 LteEnbRrc::SendHandoverRequest (uint16_t rnti, uint16_t cellId)
2375 {
2376  NS_LOG_FUNCTION (this << rnti << cellId);
2377  NS_LOG_LOGIC ("Request to send HANDOVER REQUEST");
2379 
2380  Ptr<UeManager> ueManager = GetUeManager (rnti);
2381  ueManager->PrepareHandover (cellId);
2382 
2383 }
2384 
2385 void
2387 {
2388  NS_LOG_FUNCTION (this << rnti);
2389  GetUeManager (rnti)->CompleteSetupUe (params);
2390 }
2391 
2392 void
2394 {
2395  NS_LOG_FUNCTION (this << rnti);
2396  GetUeManager (rnti)->RecvRrcConnectionRequest (msg);
2397 }
2398 
2399 void
2401 {
2402  NS_LOG_FUNCTION (this << rnti);
2403  GetUeManager (rnti)->RecvRrcConnectionSetupCompleted (msg);
2404 }
2405 
2406 void
2408 {
2409  NS_LOG_FUNCTION (this << rnti);
2410  GetUeManager (rnti)->RecvRrcConnectionReconfigurationCompleted (msg);
2411 }
2412 
2413 void
2415 {
2416  NS_LOG_FUNCTION (this << rnti);
2417  GetUeManager (rnti)->RecvRrcConnectionReestablishmentRequest (msg);
2418 }
2419 
2420 void
2422 {
2423  NS_LOG_FUNCTION (this << rnti);
2424  GetUeManager (rnti)->RecvRrcConnectionReestablishmentComplete (msg);
2425 }
2426 
2427 void
2429 {
2430  NS_LOG_FUNCTION (this << rnti);
2431  GetUeManager (rnti)->RecvMeasurementReport (msg);
2432 }
2433 
2434 void
2436 {
2437  NS_LOG_FUNCTION (this);
2438  Ptr<UeManager> ueManager = GetUeManager (msg.rnti);
2439  ueManager->InitialContextSetupRequest ();
2440 }
2441 
2442 void
2444 {
2445  NS_LOG_FUNCTION (this << rnti);
2446  GetUeManager (rnti)->RecvIdealUeContextRemoveRequest (rnti);
2447  //delete the UE context at the eNB
2448  RemoveUe (rnti);
2449 }
2450 
2451 void
2453 {
2454  NS_LOG_FUNCTION (this);
2455  Ptr<UeManager> ueManager = GetUeManager (request.rnti);
2456  ueManager->SetupDataRadioBearer (request.bearer, request.bearerId, request.gtpTeid, request.transportLayerAddress);
2457 }
2458 
2459 void
2461 {
2462  NS_LOG_FUNCTION (this);
2463  Ptr<UeManager> ueManager = GetUeManager (params.rnti);
2464  ueManager->SendUeContextRelease ();
2465 }
2466 
2467 void
2469 {
2470  NS_LOG_FUNCTION (this);
2471 
2472  NS_LOG_LOGIC ("Recv X2 message: HANDOVER REQUEST");
2473 
2474  NS_LOG_LOGIC ("oldEnbUeX2apId = " << req.oldEnbUeX2apId);
2475  NS_LOG_LOGIC ("sourceCellId = " << req.sourceCellId);
2476  NS_LOG_LOGIC ("targetCellId = " << req.targetCellId);
2477  NS_LOG_LOGIC ("mmeUeS1apId = " << req.mmeUeS1apId);
2478 
2479  if (m_admitHandoverRequest == false)
2480  {
2481  NS_LOG_INFO ("rejecting handover request from cellId " << req.sourceCellId);
2483  res.oldEnbUeX2apId = req.oldEnbUeX2apId;
2484  res.sourceCellId = req.sourceCellId;
2485  res.targetCellId = req.targetCellId;
2486  res.cause = 0;
2487  res.criticalityDiagnostics = 0;
2489  return;
2490  }
2491 
2493  LteEnbCmacSapProvider::AllocateNcRaPreambleReturnValue anrcrv = m_cmacSapProvider.at (0)->AllocateNcRaPreamble (rnti);
2494  if (anrcrv.valid == false)
2495  {
2496  NS_LOG_INFO (this << " failed to allocate a preamble for non-contention based RA => cannot accept HO");
2497  RemoveUe (rnti);
2498  NS_FATAL_ERROR ("should trigger HO Preparation Failure, but it is not implemented");
2499  return;
2500  }
2501 
2502  Ptr<UeManager> ueManager = GetUeManager (rnti);
2503  ueManager->SetSource (req.sourceCellId, req.oldEnbUeX2apId);
2504  ueManager->SetImsi (req.mmeUeS1apId);
2505 
2507  ackParams.oldEnbUeX2apId = req.oldEnbUeX2apId;
2508  ackParams.newEnbUeX2apId = rnti;
2509  ackParams.sourceCellId = req.sourceCellId;
2510  ackParams.targetCellId = req.targetCellId;
2511 
2512  for (std::vector <EpcX2Sap::ErabToBeSetupItem>::iterator it = req.bearers.begin ();
2513  it != req.bearers.end ();
2514  ++it)
2515  {
2516  ueManager->SetupDataRadioBearer (it->erabLevelQosParameters, it->erabId, it->gtpTeid, it->transportLayerAddress);
2518  i.erabId = it->erabId;
2519  ackParams.admittedBearers.push_back (i);
2520  }
2521 
2522  LteRrcSap::RrcConnectionReconfiguration handoverCommand = ueManager->GetRrcConnectionReconfigurationForHandover ();
2523  handoverCommand.haveMobilityControlInfo = true;
2524  handoverCommand.mobilityControlInfo.targetPhysCellId = req.targetCellId;
2525  handoverCommand.mobilityControlInfo.haveCarrierFreq = true;
2528  handoverCommand.mobilityControlInfo.haveCarrierBandwidth = true;
2531  handoverCommand.mobilityControlInfo.newUeIdentity = rnti;
2532  handoverCommand.mobilityControlInfo.haveRachConfigDedicated = true;
2535 
2536  LteEnbCmacSapProvider::RachConfig rc = m_cmacSapProvider.at (0)->GetRachConfig ();
2541 
2542  Ptr<Packet> encodedHandoverCommand = m_rrcSapUser->EncodeHandoverCommand (handoverCommand);
2543 
2544  ackParams.rrcContext = encodedHandoverCommand;
2545 
2546  NS_LOG_LOGIC ("Send X2 message: HANDOVER REQUEST ACK");
2547 
2548  NS_LOG_LOGIC ("oldEnbUeX2apId = " << ackParams.oldEnbUeX2apId);
2549  NS_LOG_LOGIC ("newEnbUeX2apId = " << ackParams.newEnbUeX2apId);
2550  NS_LOG_LOGIC ("sourceCellId = " << ackParams.sourceCellId);
2551  NS_LOG_LOGIC ("targetCellId = " << ackParams.targetCellId);
2552 
2554 }
2555 
2556 void
2558 {
2559  NS_LOG_FUNCTION (this);
2560 
2561  NS_LOG_LOGIC ("Recv X2 message: HANDOVER REQUEST ACK");
2562 
2563  NS_LOG_LOGIC ("oldEnbUeX2apId = " << params.oldEnbUeX2apId);
2564  NS_LOG_LOGIC ("newEnbUeX2apId = " << params.newEnbUeX2apId);
2565  NS_LOG_LOGIC ("sourceCellId = " << params.sourceCellId);
2566  NS_LOG_LOGIC ("targetCellId = " << params.targetCellId);
2567 
2568  uint16_t rnti = params.oldEnbUeX2apId;
2569  Ptr<UeManager> ueManager = GetUeManager (rnti);
2570  ueManager->RecvHandoverRequestAck (params);
2571 }
2572 
2573 void
2575 {
2576  NS_LOG_FUNCTION (this);
2577 
2578  NS_LOG_LOGIC ("Recv X2 message: HANDOVER PREPARATION FAILURE");
2579 
2580  NS_LOG_LOGIC ("oldEnbUeX2apId = " << params.oldEnbUeX2apId);
2581  NS_LOG_LOGIC ("sourceCellId = " << params.sourceCellId);
2582  NS_LOG_LOGIC ("targetCellId = " << params.targetCellId);
2583  NS_LOG_LOGIC ("cause = " << params.cause);
2584  NS_LOG_LOGIC ("criticalityDiagnostics = " << params.criticalityDiagnostics);
2585 
2586  uint16_t rnti = params.oldEnbUeX2apId;
2587  Ptr<UeManager> ueManager = GetUeManager (rnti);
2588  ueManager->RecvHandoverPreparationFailure (params.targetCellId);
2589 }
2590 
2591 void
2593 {
2594  NS_LOG_FUNCTION (this);
2595 
2596  NS_LOG_LOGIC ("Recv X2 message: SN STATUS TRANSFER");
2597 
2598  NS_LOG_LOGIC ("oldEnbUeX2apId = " << params.oldEnbUeX2apId);
2599  NS_LOG_LOGIC ("newEnbUeX2apId = " << params.newEnbUeX2apId);
2600  NS_LOG_LOGIC ("erabsSubjectToStatusTransferList size = " << params.erabsSubjectToStatusTransferList.size ());
2601 
2602  uint16_t rnti = params.newEnbUeX2apId;
2603  Ptr<UeManager> ueManager = GetUeManager (rnti);
2604  ueManager->RecvSnStatusTransfer (params);
2605 }
2606 
2607 void
2609 {
2610  NS_LOG_FUNCTION (this);
2611 
2612  NS_LOG_LOGIC ("Recv X2 message: UE CONTEXT RELEASE");
2613 
2614  NS_LOG_LOGIC ("oldEnbUeX2apId = " << params.oldEnbUeX2apId);
2615  NS_LOG_LOGIC ("newEnbUeX2apId = " << params.newEnbUeX2apId);
2616 
2617  uint16_t rnti = params.oldEnbUeX2apId;
2618  GetUeManager (rnti)->RecvUeContextRelease (params);
2619  RemoveUe (rnti);
2620 }
2621 
2622 void
2624 {
2625  NS_LOG_FUNCTION (this);
2626 
2627  NS_LOG_LOGIC ("Recv X2 message: LOAD INFORMATION");
2628 
2629  NS_LOG_LOGIC ("Number of cellInformationItems = " << params.cellInformationList.size ());
2630 
2631  NS_ABORT_IF (m_ffrRrcSapProvider.size () == 0);
2632  m_ffrRrcSapProvider.at (0)->RecvLoadInformation (params);
2633 }
2634 
2635 void
2637 {
2638  NS_LOG_FUNCTION (this);
2639 
2640  NS_LOG_LOGIC ("Recv X2 message: RESOURCE STATUS UPDATE");
2641 
2642  NS_LOG_LOGIC ("Number of cellMeasurementResultItems = " << params.cellMeasurementResultList.size ());
2643 
2644  NS_ASSERT ("Processing of RESOURCE STATUS UPDATE X2 message IS NOT IMPLEMENTED");
2645 }
2646 
2647 void
2649 {
2650  NS_LOG_FUNCTION (this);
2651 
2652  NS_LOG_LOGIC ("Recv UE DATA FORWARDING through X2 interface");
2653  NS_LOG_LOGIC ("sourceCellId = " << params.sourceCellId);
2654  NS_LOG_LOGIC ("targetCellId = " << params.targetCellId);
2655  NS_LOG_LOGIC ("gtpTeid = " << params.gtpTeid);
2656  NS_LOG_LOGIC ("ueData = " << params.ueData);
2657  NS_LOG_LOGIC ("ueData size = " << params.ueData->GetSize ());
2658 
2659  std::map<uint32_t, X2uTeidInfo>::iterator
2660  teidInfoIt = m_x2uTeidInfoMap.find (params.gtpTeid);
2661  if (teidInfoIt != m_x2uTeidInfoMap.end ())
2662  {
2663  GetUeManager (teidInfoIt->second.rnti)->SendData (teidInfoIt->second.drbid, params.ueData);
2664  }
2665  else
2666  {
2667  NS_FATAL_ERROR ("X2-U data received but no X2uTeidInfo found");
2668  }
2669 }
2670 
2671 
2672 uint16_t
2673 LteEnbRrc::DoAllocateTemporaryCellRnti (uint8_t componentCarrierId)
2674 {
2675  NS_LOG_FUNCTION (this << +componentCarrierId);
2676  return AddUe (UeManager::INITIAL_RANDOM_ACCESS, componentCarrierId);
2677 }
2678 
2679 void
2681 {
2682  Ptr<UeManager> ueManager = GetUeManager (cmacParams.m_rnti);
2683  ueManager->CmacUeConfigUpdateInd (cmacParams);
2684 }
2685 
2686 void
2687 LteEnbRrc::DoNotifyLcConfigResult (uint16_t rnti, uint8_t lcid, bool success)
2688 {
2689  NS_LOG_FUNCTION (this << (uint32_t) rnti);
2690  NS_FATAL_ERROR ("not implemented");
2691 }
2692 
2693 
2694 uint8_t
2696 {
2697  NS_LOG_FUNCTION (this);
2698  uint8_t measId = AddUeMeasReportConfig (reportConfig);
2699  m_handoverMeasIds.insert (measId);
2700  return measId;
2701 }
2702 
2703 uint8_t
2705 {
2706  NS_LOG_FUNCTION (this);
2707  uint8_t measId = AddUeMeasReportConfig (reportConfig);
2708  m_componentCarrierMeasIds.insert (measId);
2709  return measId;
2710 }
2711 
2712 void
2713 LteEnbRrc::DoSetNumberOfComponentCarriers (uint16_t numberOfComponentCarriers)
2714 {
2715  m_numberOfComponentCarriers = numberOfComponentCarriers;
2716 }
2717 
2718 void
2719 LteEnbRrc::DoTriggerHandover (uint16_t rnti, uint16_t targetCellId)
2720 {
2721  NS_LOG_FUNCTION (this << rnti << targetCellId);
2722 
2723  bool isHandoverAllowed = true;
2724 
2725  Ptr<UeManager> ueManager = GetUeManager (rnti);
2726  NS_ASSERT_MSG (ueManager != 0, "Cannot find UE context with RNTI " << rnti);
2727 
2728  if (m_anrSapProvider != 0)
2729  {
2730  // ensure that proper neighbour relationship exists between source and target cells
2731  bool noHo = m_anrSapProvider->GetNoHo (targetCellId);
2732  bool noX2 = m_anrSapProvider->GetNoX2 (targetCellId);
2733  NS_LOG_DEBUG (this << " cellId=" << ComponentCarrierToCellId (ueManager->GetComponentCarrierId ())
2734  << " targetCellId=" << targetCellId
2735  << " NRT.NoHo=" << noHo << " NRT.NoX2=" << noX2);
2736 
2737  if (noHo || noX2)
2738  {
2739  isHandoverAllowed = false;
2740  NS_LOG_LOGIC (this << " handover to cell " << targetCellId
2741  << " is not allowed by ANR");
2742  }
2743  }
2744 
2745  if (ueManager->GetState () != UeManager::CONNECTED_NORMALLY)
2746  {
2747  isHandoverAllowed = false;
2748  NS_LOG_LOGIC (this << " handover is not allowed because the UE"
2749  << " rnti=" << rnti << " is in "
2750  << ToString (ueManager->GetState ()) << " state");
2751  }
2752 
2753  if (isHandoverAllowed)
2754  {
2755  // initiate handover execution
2756  ueManager->PrepareHandover (targetCellId);
2757  }
2758 }
2759 
2760 uint8_t
2762 {
2763  NS_LOG_FUNCTION (this);
2764  uint8_t measId = AddUeMeasReportConfig (reportConfig);
2765  m_anrMeasIds.insert (measId);
2766  return measId;
2767 }
2768 
2769 uint8_t
2771 {
2772  NS_LOG_FUNCTION (this);
2773  uint8_t measId = AddUeMeasReportConfig (reportConfig);
2774  m_ffrMeasIds.insert (measId);
2775  return measId;
2776 }
2777 
2778 void
2780 {
2781  NS_LOG_FUNCTION (this);
2782  Ptr<UeManager> ueManager = GetUeManager (rnti);
2783  ueManager->SetPdschConfigDedicated (pdschConfigDedicated);
2784 }
2785 
2786 void
2788 {
2789  NS_LOG_FUNCTION (this);
2790 
2792 }
2793 
2794 uint16_t
2795 LteEnbRrc::AddUe (UeManager::State state, uint8_t componentCarrierId)
2796 {
2797  NS_LOG_FUNCTION (this);
2798  bool found = false;
2799  uint16_t rnti;
2800  for (rnti = m_lastAllocatedRnti + 1;
2801  (rnti != m_lastAllocatedRnti - 1) && (!found);
2802  ++rnti)
2803  {
2804  if ((rnti != 0) && (m_ueMap.find (rnti) == m_ueMap.end ()))
2805  {
2806  found = true;
2807  break;
2808  }
2809  }
2810 
2811  NS_ASSERT_MSG (found, "no more RNTIs available (do you have more than 65535 UEs in a cell?)");
2812  m_lastAllocatedRnti = rnti;
2813  Ptr<UeManager> ueManager = CreateObject<UeManager> (this, rnti, state, componentCarrierId);
2814  m_ccmRrcSapProvider-> AddUe (rnti, (uint8_t)state);
2815  m_ueMap.insert (std::pair<uint16_t, Ptr<UeManager> > (rnti, ueManager));
2816  ueManager->Initialize ();
2817  const uint16_t cellId = ComponentCarrierToCellId (componentCarrierId);
2818  NS_LOG_DEBUG (this << " New UE RNTI " << rnti << " cellId " << cellId << " srs CI " << ueManager->GetSrsConfigurationIndex ());
2819  m_newUeContextTrace (cellId, rnti);
2820  return rnti;
2821 }
2822 
2823 void
2824 LteEnbRrc::RemoveUe (uint16_t rnti)
2825 {
2826  NS_LOG_FUNCTION (this << (uint32_t) rnti);
2827  std::map <uint16_t, Ptr<UeManager> >::iterator it = m_ueMap.find (rnti);
2828  NS_ASSERT_MSG (it != m_ueMap.end (), "request to remove UE info with unknown rnti " << rnti);
2829  uint64_t imsi = it->second->GetImsi ();
2830  uint16_t srsCi = (*it).second->GetSrsConfigurationIndex ();
2831  //cancel pending events
2832  it->second->CancelPendingEvents ();
2833  // fire trace upon connection release
2834  m_connectionReleaseTrace (imsi, ComponentCarrierToCellId (it->second->GetComponentCarrierId ()), rnti);
2835  m_ueMap.erase (it);
2836  for (uint8_t i = 0; i < m_numberOfComponentCarriers; i++)
2837  {
2838  m_cmacSapProvider.at (i)->RemoveUe (rnti);
2839  m_cphySapProvider.at (i)->RemoveUe (rnti);
2840  }
2841  if (m_s1SapProvider != 0)
2842  {
2844  }
2845  m_ccmRrcSapProvider-> RemoveUe (rnti);
2846  // need to do this after UeManager has been deleted
2847  if (srsCi != 0)
2848  {
2850  }
2851 
2852  m_rrcSapUser->RemoveUe (rnti); // Remove UE context at RRC protocol
2853 }
2854 
2855 TypeId
2857 {
2858  switch (m_epsBearerToRlcMapping)
2859  {
2860  case RLC_SM_ALWAYS:
2861  return LteRlcSm::GetTypeId ();
2862  break;
2863 
2864  case RLC_UM_ALWAYS:
2865  return LteRlcUm::GetTypeId ();
2866  break;
2867 
2868  case RLC_AM_ALWAYS:
2869  return LteRlcAm::GetTypeId ();
2870  break;
2871 
2872  case PER_BASED:
2873  if (bearer.GetPacketErrorLossRate () > 1.0e-5)
2874  {
2875  return LteRlcUm::GetTypeId ();
2876  }
2877  else
2878  {
2879  return LteRlcAm::GetTypeId ();
2880  }
2881  break;
2882 
2883  default:
2884  return LteRlcSm::GetTypeId ();
2885  break;
2886  }
2887 }
2888 
2889 
2890 void
2891 LteEnbRrc::AddX2Neighbour (uint16_t cellId)
2892 {
2893  NS_LOG_FUNCTION (this << cellId);
2894 
2895  if (m_anrSapProvider != 0)
2896  {
2898  }
2899 }
2900 
2901 void
2902 LteEnbRrc::SetCsgId (uint32_t csgId, bool csgIndication)
2903 {
2904  NS_LOG_FUNCTION (this << csgId << csgIndication);
2905  for (uint8_t componentCarrierId = 0; componentCarrierId < m_sib1.size (); componentCarrierId++)
2906  {
2907  m_sib1.at (componentCarrierId).cellAccessRelatedInfo.csgIdentity = csgId;
2908  m_sib1.at (componentCarrierId).cellAccessRelatedInfo.csgIndication = csgIndication;
2909  m_cphySapProvider.at (componentCarrierId)->SetSystemInformationBlockType1 (m_sib1.at (componentCarrierId));
2910  }
2911 }
2912 
2914 static const uint8_t SRS_ENTRIES = 9;
2919 static const uint16_t g_srsPeriodicity[SRS_ENTRIES] = {0, 2, 5, 10, 20, 40, 80, 160, 320};
2925 static const uint16_t g_srsCiLow[SRS_ENTRIES] = {0, 0, 2, 7, 17, 37, 77, 157, 317};
2931 static const uint16_t g_srsCiHigh[SRS_ENTRIES] = {0, 1, 6, 16, 36, 76, 156, 316, 636};
2932 
2933 void
2935 {
2936  NS_LOG_FUNCTION (this << p);
2937  for (uint32_t id = 1; id < SRS_ENTRIES; ++id)
2938  {
2939  if (g_srsPeriodicity[id] == p)
2940  {
2942  return;
2943  }
2944  }
2945  // no match found
2946  std::ostringstream allowedValues;
2947  for (uint32_t id = 1; id < SRS_ENTRIES; ++id)
2948  {
2949  allowedValues << g_srsPeriodicity[id] << " ";
2950  }
2951  NS_FATAL_ERROR ("illecit SRS periodicity value " << p << ". Allowed values: " << allowedValues.str ());
2952 }
2953 
2954 uint32_t
2956 {
2957  NS_LOG_FUNCTION (this);
2961 }
2962 
2963 
2964 uint16_t
2966 {
2968  // SRS
2971  NS_LOG_DEBUG (this << " SRS p " << g_srsPeriodicity[m_srsCurrentPeriodicityId] << " set " << m_ueSrsConfigurationIndexSet.size ());
2973  {
2974  NS_FATAL_ERROR ("too many UEs (" << m_ueSrsConfigurationIndexSet.size () + 1
2975  << ") for current SRS periodicity "
2977  << ", consider increasing the value of ns3::LteEnbRrc::SrsPeriodicity");
2978  }
2979 
2980  if (m_ueSrsConfigurationIndexSet.empty ())
2981  {
2982  // first entry
2985  }
2986  else
2987  {
2988  // find a CI from the available ones
2989  std::set<uint16_t>::reverse_iterator rit = m_ueSrsConfigurationIndexSet.rbegin ();
2990  NS_ASSERT (rit != m_ueSrsConfigurationIndexSet.rend ());
2991  NS_LOG_DEBUG (this << " lower bound " << (*rit) << " of " << g_srsCiHigh[m_srsCurrentPeriodicityId]);
2992  if ((*rit) < g_srsCiHigh[m_srsCurrentPeriodicityId])
2993  {
2994  // got it from the upper bound
2995  m_lastAllocatedConfigurationIndex = (*rit) + 1;
2997  }
2998  else
2999  {
3000  // look for released ones
3001  for (uint16_t srcCi = g_srsCiLow[m_srsCurrentPeriodicityId]; srcCi < g_srsCiHigh[m_srsCurrentPeriodicityId]; srcCi++)
3002  {
3003  std::set<uint16_t>::iterator it = m_ueSrsConfigurationIndexSet.find (srcCi);
3004  if (it == m_ueSrsConfigurationIndexSet.end ())
3005  {
3007  m_ueSrsConfigurationIndexSet.insert (srcCi);
3008  break;
3009  }
3010  }
3011  }
3012  }
3014 
3015 }
3016 
3017 
3018 void
3020 {
3021  NS_LOG_FUNCTION (this << srcCi);
3022  std::set<uint16_t>::iterator it = m_ueSrsConfigurationIndexSet.find (srcCi);
3023  NS_ASSERT_MSG (it != m_ueSrsConfigurationIndexSet.end (), "request to remove unkwown SRS CI " << srcCi);
3024  m_ueSrsConfigurationIndexSet.erase (it);
3025 }
3026 
3027 uint8_t
3029 {
3030  if (bearer.IsGbr ())
3031  {
3032  return 1;
3033  }
3034  else
3035  {
3036  return 2;
3037  }
3038 }
3039 
3040 uint8_t
3042 {
3043  return bearer.qci;
3044 }
3045 
3046 void
3048 {
3049  // NS_LOG_FUNCTION (this);
3050 
3051  for (auto &it: m_componentCarrierPhyConf)
3052  {
3053  uint8_t ccId = it.first;
3054 
3056  si.haveSib2 = true;
3057  si.sib2.freqInfo.ulCarrierFreq = it.second->GetUlEarfcn ();
3058  si.sib2.freqInfo.ulBandwidth = it.second->GetUlBandwidth ();
3059  si.sib2.radioResourceConfigCommon.pdschConfigCommon.referenceSignalPower = m_cphySapProvider.at (ccId)->GetReferenceSignalPower ();
3061 
3062  LteEnbCmacSapProvider::RachConfig rc = m_cmacSapProvider.at (ccId)->GetRachConfig ();
3063  LteRrcSap::RachConfigCommon rachConfigCommon;
3065  rachConfigCommon.raSupervisionInfo.preambleTransMax = rc.preambleTransMax;
3067  rachConfigCommon.txFailParam.connEstFailCount = rc.connEstFailCount;
3068  si.sib2.radioResourceConfigCommon.rachConfigCommon = rachConfigCommon;
3069 
3070  m_rrcSapUser->SendSystemInformation (it.second->GetCellId (), si);
3071  }
3072 
3073  /*
3074  * For simplicity, we use the same periodicity for all SIBs. Note that in real
3075  * systems the periodicy of each SIBs could be different.
3076  */
3078 }
3079 
3080 bool
3082 {
3083  NS_LOG_FUNCTION (this << (uint32_t) rnti);
3084  Ptr<UeManager> ueManager = GetUeManager (rnti);
3085  switch (ueManager->GetState ())
3086  {
3089  return true;
3090  break;
3091  default:
3092  return false;
3093  break;
3094 
3095  }
3096 }
3097 
3098 
3099 } // namespace ns3
3100 
virtual void AddNeighbourRelation(uint16_t cellId)=0
Add a new Neighbour Relation entry.
void DoInitialContextSetupRequest(EpcEnbS1SapUser::InitialContextSetupRequestParameters params)
Initial context setup request function.
uint32_t sCellIndex
SCell index.
Definition: lte-rrc-sap.h:821
Callback< void, Ptr< Packet > > m_forwardUpCallback
forward up callback function
Definition: lte-enb-rrc.h:1465
Ipv4Address transportLayerAddress
IP Address of the SGW, see 36.423 9.2.1.
static const uint8_t SRS_ENTRIES
Number of distinct SRS periodicity plus one.
TracedCallback< uint64_t, uint16_t, uint16_t, State, State > m_stateTransitionTrace
The StateTransition trace source.
Definition: lte-enb-rrc.h:557
TracedCallback< uint64_t, uint16_t, uint16_t > m_handoverEndOkTrace
The HandoverEndOk trace source.
Definition: lte-enb-rrc.h:1671
RrcConnectionRequest structure.
Definition: lte-rrc-sap.h:692
enum ns3::LteRrcSap::ReportConfigEutra::@67 reportQuantity
Report type enumeration.
uint8_t measId
measure ID
Definition: lte-rrc-sap.h:466
void ConnectionRequestTimeout(uint16_t rnti)
Method triggered when a UE is expected to request for connection but does not do so in a reasonable t...
uint16_t sourceCellId
source cell ID
Definition: epc-x2-sap.h:330
SystemInformationBlockType2 sourceSystemInformationBlockType2
source system information block type 2
Definition: lte-rrc-sap.h:622
Parameters passed to DataRadioBearerSetupRequest ()
void ConnectionSetupTimeout(uint16_t rnti)
Method triggered when a UE is expected to complete a connection setup procedure but does not do so in...
enum ns3::LteRrcSap::ThresholdEutra::@63 choice
Threshold enumeration.
Service Access Point (SAP) offered by the Frequency Reuse algorithm instance to the eNodeB RRC instan...
bool haveNonCriticalExtension
have critical extension?
Definition: lte-rrc-sap.h:845
void SetEpcX2SapProvider(EpcX2SapProvider *s)
Set the X2 SAP this RRC should interact with.
uint32_t mmeUeS1apId
MME UE S1 AP ID.
Definition: epc-x2-sap.h:234
Template for the implementation of the EpcEnbS1SapUser as a member of an owner class of type C to whi...
This class implements the Service Access Point (SAP) between the LteEnbRrc and the EpcEnbApplication...
virtual void DoInitialize(void)
Initialize() implementation.
Definition: object.cc:353
AllocateNcRaPreambleReturnValue structure.
SCellToAddMod structure.
Definition: lte-rrc-sap.h:819
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:102
uint32_t carrierFreq
carrier frequency
Definition: lte-rrc-sap.h:327
Ptr< LteSignalingRadioBearerInfo > m_srb1
The Srb1 attribute.
Definition: lte-enb-rrc.h:524
void SendHandoverRequest(uint16_t rnti, uint16_t cellId)
Send a HandoverRequest through the X2 SAP interface.
void SendSystemInformation()
method used to periodically send System Information
uint8_t drbIdentity
DRB identity.
Definition: lte-rrc-sap.h:238
RadioResourceConfigCommonSCell radioResourceConfigCommonSCell
radio resource config common SCell
Definition: lte-rrc-sap.h:823
bool IsRandomAccessCompleted(uint16_t rnti)
Is random access completed function.
LteRrcSap::RadioResourceConfigDedicated GetRadioResourceConfigForHandoverPreparationInfo()
Definition: lte-enb-rrc.cc:754
CarrierFreqEutra carrierFreq
carrier frequency
Definition: lte-rrc-sap.h:562
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:73
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:343
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
E-RABs admitted item as it is used in the HANDOVER REQUEST ACKNOWLEDGE message.
Definition: epc-x2-sap.h:75
LteEnbRrc()
create an RRC instance for use within an eNB
PdschConfigDedicated pdschConfigDedicated
PDSCH config dedicated.
Definition: lte-rrc-sap.h:223
State
The state of the UeManager at the eNB RRC.
Definition: lte-enb-rrc.h:86
MeasurementReport structure.
Definition: lte-rrc-sap.h:901
AttributeValue implementation for Boolean.
Definition: boolean.h:36
uint32_t mmeUeS1Id
mmeUeS1Id in practice, we use the IMSI
uint8_t measObjectId
measure object ID
Definition: lte-rrc-sap.h:452
Callback template class.
Definition: callback.h:1176
EpcX2SpecificEpcX2SapUser.
Definition: epc-x2-sap.h:608
void RecordDataRadioBearersToBeStarted()
Start all configured data radio bearers.
Definition: lte-enb-rrc.cc:500
ErabsSubjectToStatusTransferItem structure.
Definition: epc-x2-sap.h:101
PdschConfigDedicated pdschConfigDedicated
PDSCH config dedicated.
Definition: lte-rrc-sap.h:791
void ConfigureCarriers(std::map< uint8_t, Ptr< ComponentCarrierBaseStation >> ccPhyConf)
Configure carriers.
virtual void DoDispose()
Destructor implementation.
Definition: lte-enb-rrc.cc:317
uint16_t m_dlBandwidth
Downlink transmission bandwidth configuration in number of Resource Blocks.
Definition: lte-enb-rrc.h:1522
MeasConfig sourceMeasConfig
source measure config
Definition: lte-rrc-sap.h:617
uint32_t sourceDlCarrierFreq
source DL carrier frequency
Definition: lte-rrc-sap.h:623
bool m_caSupportConfigured
Define if the Carrier Aggregation was already configure for the current UE on not.
Definition: lte-enb-rrc.h:608
uint8_t srbIdentity
SB identity.
Definition: lte-rrc-sap.h:230
uint16_t m_targetX2apId
target X2 ap ID
Definition: lte-enb-rrc.h:567
void RecvUeContextRelease(EpcX2SapUser::UeContextReleaseParams params)
Take the necessary actions in response to the reception of an X2 UE CONTEXT RELEASE message...
Definition: lte-enb-rrc.cc:921
This class implements the Service Access Point (SAP) between the LteEnbRrc and the EpcEnbApplication...
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
std::list< MeasObjectToAddMod > measObjectToAddModList
measure object to add mod list
Definition: lte-rrc-sap.h:521
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:884
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition: object-base.h:45
void DoNotifyLcConfigResult(uint16_t rnti, uint8_t lcid, bool success)
Notify LC config result function.
uint8_t numberOfRaPreambles
number of RA preambles
Definition: lte-rrc-sap.h:247
uint32_t GetSize(void) const
Returns the the size in bytes of the packet (including the zero-filled initial payload).
Definition: packet.h:852
uint16_t sourceCellId
source cell ID
Definition: epc-x2-sap.h:250
uint16_t m_rnti
UE id within this cell.
static double ConvertPdschConfigDedicated2Double(PdschConfigDedicated pdschConfigDedicated)
Convert PDSCH config dedicated function.
Definition: lte-rrc-sap.h:180
SoundingRsUlConfigDedicated soundingRsUlConfigDedicated
sounding RS UL config dedicated
Definition: lte-rrc-sap.h:219
NS_ASSERT_MSG(false, "Ipv4AddressGenerator::MaskToIndex(): Impossible")
uint16_t erabId
E-RAB ID.
Definition: epc-x2-sap.h:77
bool presenceAntennaPort1
antenna port 1 present?
Definition: lte-rrc-sap.h:329
static TypeId GetTypeId(void)
Get the type ID.
Definition: lte-rlc.cc:188
uint16_t targetCellId
target cell ID
Definition: epc-x2-sap.h:233
void SetCellId(uint16_t m_cellId)
set the cell id of this eNB
uint8_t GetLogicalChannelGroup(EpsBearer bearer)
void SendPacket(uint8_t bid, Ptr< Packet > p)
Send a data packet over the appropriate Data Radio Bearer.
Definition: lte-enb-rrc.cc:768
RSRP is used for the threshold.
Definition: lte-rrc-sap.h:354
uint8_t m_transmissionMode
Transmission mode 1..7
void AddX2Neighbour(uint16_t cellId)
Add a neighbour with an X2 interface.
uint8_t preambleTransMax
preamble transmit maximum
QuantityConfig quantityConfig
quantity config
Definition: lte-rrc-sap.h:527
uint8_t Drbid2Bid(uint8_t drbid)
uint16_t erabId
E-RAB ID.
Definition: epc-x2-sap.h:61
RlcConfig rlcConfig
RLC config.
Definition: lte-rrc-sap.h:239
uint16_t txSn
TX sequence number.
Definition: lte-pdcp.h:103
uint16_t rnti
the RNTI identifying the UE for which the DataRadioBearer is to be created
bool m_admitHandoverRequest
The AdmitHandoverRequest attribute.
Definition: lte-enb-rrc.h:1594
std::vector< CellMeasurementResultItem > cellMeasurementResultList
cell measurement result list
Definition: epc-x2-sap.h:319
uint32_t GetSrsPeriodicity() const
std::list< MeasResultEutra > measResultListEutra
measure result list eutra
Definition: lte-rrc-sap.h:684
Parameters of the HANDOVER REQUEST message.
Definition: epc-x2-sap.h:228
int8_t qRxLevMin
INTEGER (-70..-22), actual value = IE value * 2 [dBm].
Definition: lte-rrc-sap.h:83
uint8_t reportConfigId
report config ID
Definition: lte-rrc-sap.h:459
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:209
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:84
Part of the RRC protocol.
Definition: lte-rrc-sap.h:1200
ThresholdEutra threshold1
Threshold for event A1, A2, A4, and A5.
Definition: lte-rrc-sap.h:381
void DoRecvRrcConnectionReconfigurationCompleted(uint16_t rnti, LteRrcSap::RrcConnectionReconfigurationCompleted msg)
Part of the RRC protocol.
Template for the implementation of the LteHandoverManagementSapUser as a member of an owner class of ...
Status variables of the PDCP.
Definition: lte-pdcp.h:101
uint16_t targetCellId
target cell ID
Definition: epc-x2-sap.h:295
Class for forwarding CMAC SAP User functions.
Definition: lte-enb-rrc.cc:62
Specifies criteria for triggering of an E-UTRA measurement reporting event.
Definition: lte-rrc-sap.h:361
void SetCsgId(uint32_t csgId, bool csgIndication)
Associate this RRC entity with a particular CSG information.
uint8_t DoAddUeMeasReportConfigForComponentCarrier(LteRrcSap::ReportConfigEutra reportConfig)
Add UE measure report config for component carrier function.
uint8_t raResponseWindowSize
RA response window size.
void ConfigureCell(std::map< uint8_t, Ptr< ComponentCarrierBaseStation > > ccPhyConf)
Configure cell-specific parameters.
RadioResourceConfigDedicatedSCell radioResourceConfigDedicateSCell
radio resource config dedicated SCell
Definition: lte-rrc-sap.h:825
uint8_t qci
QoS Class Identifier.
X2uTeidInfo structure.
Definition: lte-enb-rrc.h:1552
static TypeId GetTypeId(void)
Get the type ID.
uint16_t m_sourceCellId
source cell ID
Definition: lte-enb-rrc.h:568
uint16_t nPuschIdentity
3GPP TS 36.331 v.11.10 R11 page 216
Definition: lte-rrc-sap.h:772
virtual ~LteEnbRrc()
Destructor.
#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
uint16_t m_rnti
The C-RNTI attribute.
Definition: lte-enb-rrc.h:529
std::list< SrbToAddMod > srbToAddModList
SRB to add mod list.
Definition: lte-rrc-sap.h:287
Hold a signed integer type.
Definition: integer.h:44
enum ns3::LteRrcSap::ReportConfigEutra::report purpose
purpose
uint8_t Lcid2Bid(uint8_t lcid)
virtual void SendHandoverPreparationFailure(HandoverPreparationFailureParams params)=0
Send handover preparation failure function.
void SetLteHandoverManagementSapProvider(LteHandoverManagementSapProvider *s)
set the Handover Management SAP this RRC should interact with
EpcX2SapUser * GetEpcX2SapUser()
Get the X2 SAP offered by this RRC.
RadioResourceConfigDedicated radioResourceConfigDedicated
radio resource config dedicated
Definition: lte-rrc-sap.h:844
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:204
void SetLteEnbCphySapProvider(LteEnbCphySapProvider *s)
set the CPHY SAP this RRC should use to interact with the PHY
uint16_t m_lastAllocatedRnti
Last allocated RNTI.
Definition: lte-enb-rrc.h:1526
uint16_t newEnbUeX2apId
new ENB UE X2 AP ID
Definition: epc-x2-sap.h:249
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition: nstime.h:1070
uint16_t GetNewSrsConfigurationIndex(void)
Allocate a new SRS configuration index for a new UE.
void SetTypeId(TypeId tid)
Set the TypeId of the Objects to be created by this factory.
uint16_t oldEnbUeX2apId
old ENB UE X2 AP ID
Definition: epc-x2-sap.h:292
bool haveNonUlConfiguration
have non UL configuration?
Definition: lte-rrc-sap.h:786
std::list< BearerToBeSwitched > bearersToBeSwitched
list of bearers to be switched
LteEnbCmacSapUser * GetLteEnbCmacSapUser()
Get the CMAC SAP offered by this RRC.
uint8_t m_transmissionMode
Transmission mode 1..7
std::vector< LteEnbCphySapProvider * > m_cphySapProvider
Interface to the eNodeB PHY instances.
Definition: lte-enb-rrc.h:1513
State GetState() const
PdschConfigCommon pdschConfigCommon
4: Physical configuration, physical channels pdsch-ConfigCommon-r10
Definition: lte-rrc-sap.h:747
Tag used to define the RNTI and EPS bearer ID for packets interchanged between the EpcEnbApplication ...
uint16_t srsConfigIndex
SRS config index.
Definition: lte-rrc-sap.h:137
uint16_t m_ulBandwidth
Uplink transmission bandwidth configuration in number of Resource Blocks.
Definition: lte-enb-rrc.h:1524
uint64_t GetImsi(void) const
uint8_t m_lastRrcTransactionIdentifier
last RRC transaction identifier
Definition: lte-enb-rrc.h:540
uint16_t m_srsCurrentPeriodicityId
The SrsPeriodicity attribute.
Definition: lte-enb-rrc.h:1579
The LTE Radio Resource Control entity at the eNB.
Definition: lte-enb-rrc.h:634
bool m_pendingStartDataRadioBearers
Pending start data radio bearers.
Definition: lte-enb-rrc.h:611
void SetLteEnbRrcSapUser(LteEnbRrcSapUser *s)
set the RRC SAP this RRC should interact with
MeasObjectEutra measObjectEutra
measure object eutra
Definition: lte-rrc-sap.h:453
uint16_t sourceUeIdentity
source UE identity
Definition: lte-rrc-sap.h:619
void SetLteEnbCmacSapProvider(LteEnbCmacSapProvider *s)
set the CMAC SAP this RRC should interact with
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
Definition: log.h:280
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
Definition: fatal-error.h:162
uint64_t m_imsi
International Mobile Subscriber Identity assigned to this UE.
Definition: lte-enb-rrc.h:534
virtual uint16_t AllocateTemporaryCellRnti()
request the allocation of a Temporary C-RNTI
Definition: lte-enb-rrc.cc:90
std::vector< LteEnbCmacSapProvider * > m_cmacSapProvider
Interface to the eNodeB MAC instance.
Definition: lte-enb-rrc.h:1475
Service Access Point (SAP) offered by the UE PHY to the UE RRC for control purposes.
EpsBearer bearer
the characteristics of the bearer to be setup
TxFailParam txFailParam
txFailParams
Definition: lte-rrc-sap.h:268
The attribute can be written at construction-time.
Definition: type-id.h:65
Time m_handoverLeavingTimeoutDuration
The HandoverLeavingTimeoutDuration attribute.
Definition: lte-enb-rrc.h:1645
LteRlcSapProvider * srb0SapProvider
SRB0 SAP provider.
Definition: lte-rrc-sap.h:1087
uint64_t mbrDl
maximum bitrate in downlink
void SetBid(uint8_t bid)
Set the bearer id to the given value.
Ipv4Address transportLayerAddress
transport layer address
Definition: epc-x2-sap.h:64
bool haveCarrierFreq
have carrier frequency?
Definition: lte-rrc-sap.h:561
enum ns3::LteRrcSap::ReportConfigEutra::@66 triggerQuantity
Trigger type enumeration.
uint8_t neighCellConfig
neighbor cell config
Definition: lte-rrc-sap.h:330
Time m_connectionRejectedTimeoutDuration
The ConnectionRejectedTimeoutDuration attribute.
Definition: lte-enb-rrc.h:1630
LteMacSapProvider * m_macSapProvider
Interface to the eNodeB MAC instance, to be used by RLC instances.
Definition: lte-enb-rrc.h:1503
LteHandoverManagementSapUser * GetLteHandoverManagementSapUser()
Get the Handover Management SAP offered by this RRC.
LteEnbRrcSapProvider * m_rrcSapProvider
Interface to receive messages from UE over the RRC protocol.
Definition: lte-enb-rrc.h:1500
RachConfigDedicated rachConfigDedicated
RACH config dedicated.
Definition: lte-rrc-sap.h:568
bool haveSmeasure
have S measure?
Definition: lte-rrc-sap.h:530
void RemoveSrsConfigurationIndex(uint16_t srcCi)
remove a previously allocated SRS configuration index
uint8_t connEstFailCount
the counter value for T300 timer expiration
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
Reference Signal Received Quality.
Definition: lte-rrc-sap.h:407
MemberLteCcmRrcSapUser class.
void SetImsi(uint64_t imsi)
Set the IMSI.
Definition: lte-enb-rrc.cc:374
uint64_t ueAggregateMaxBitRateUplink
UE aggregrate max bit rate uplink.
Definition: epc-x2-sap.h:236
void SetRnti(uint16_t rnti)
Definition: lte-rlc.cc:130
uint16_t newEnbUeX2apId
new ENB UE X2 AP ID
Definition: epc-x2-sap.h:293
void SetLteMacSapProvider(LteMacSapProvider *s)
set the MAC SAP provider.
void SendUeContextRelease()
send the UE CONTEXT RELEASE X2 message to the source eNB, thus successfully terminating an X2 handove...
Definition: lte-enb-rrc.cc:860
LteRrcSap::RrcConnectionReconfiguration GetRrcConnectionReconfigurationForHandover()
Definition: lte-enb-rrc.cc:761
void SwitchToState(State s)
Switch the UeManager to the given state.
EnbRrcMemberLteEnbCmacSapUser(LteEnbRrc *rrc, uint8_t componentCarrierId)
Constructor.
Definition: lte-enb-rrc.cc:83
Time m_connectionSetupTimeoutDuration
The ConnectionSetupTimeoutDuration attribute.
Definition: lte-enb-rrc.h:1625
uint32_t ulCarrierFreq
UL carrier frequency.
Definition: lte-rrc-sap.h:90
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
void RecvRrcConnectionReconfigurationCompleted(LteRrcSap::RrcConnectionReconfigurationCompleted msg)
Implement the LteEnbRrcSapProvider::RecvRrcConnectionReconfigurationCompleted interface.
void ReleaseDataRadioBearer(uint8_t drbid)
Release a given radio bearer.
Definition: lte-enb-rrc.cc:532
uint16_t ComponentCarrierToCellId(uint8_t componentCarrierId)
convert the component carrier id to cell id
uint8_t AddDataRadioBearerInfo(Ptr< LteDataRadioBearerInfo > radioBearerInfo)
Add a new LteDataRadioBearerInfo structure to the UeManager.
EpcX2SapUser * m_x2SapUser
Interface to receive messages from neighbour eNodeB over the X2 interface.
Definition: lte-enb-rrc.h:1468
uint8_t m_rsrqFilterCoefficient
The RsrqFilterCoefficient attribute.
Definition: lte-enb-rrc.h:1611
LteEnbRrcSapUser * m_rrcSapUser
Interface to send messages to UE over the RRC protocol.
Definition: lte-enb-rrc.h:1498
Ptr< Packet > rrcContext
RRC context.
Definition: epc-x2-sap.h:254
bool haveRadioResourceConfigDedicated
have radio resource config dedicated
Definition: lte-rrc-sap.h:843
bool m_needPhyMacConfiguration
need Phy MAC configuration
Definition: lte-enb-rrc.h:571
Ptr< LteEnbRrc > m_rrc
Pointer to the parent eNodeB RRC.
Definition: lte-enb-rrc.h:544
EpcEnbS1SapProvider * m_s1SapProvider
Interface to send messages to core network over the S1 protocol.
Definition: lte-enb-rrc.h:1506
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
Create a TraceSourceAccessor which will control access to the underlying trace source.
Time m_connectionRequestTimeoutDuration
The ConnectionRequestTimeoutDuration attribute.
Definition: lte-enb-rrc.h:1618
bool havePdschConfigDedicated
have PDSCH config dedicated?
Definition: lte-rrc-sap.h:790
bool haveNonUlConfiguration
have non UL configuration?
Definition: lte-rrc-sap.h:806
void SetForwardUpCallback(Callback< void, Ptr< Packet > > cb)
set the callback used to forward data packets up the stack
Ptr< const AttributeChecker > MakeTimeChecker(const Time min, const Time max)
Helper to make a Time checker with bounded range.
Definition: time.cc:446
void DoRecvRrcConnectionSetupCompleted(uint16_t rnti, LteRrcSap::RrcConnectionSetupCompleted msg)
Part of the RRC protocol.
DrbToAddMod structure.
Definition: lte-rrc-sap.h:235
void DoRecvRrcConnectionReestablishmentComplete(uint16_t rnti, LteRrcSap::RrcConnectionReestablishmentComplete msg)
Part of the RRC protocol.
uint64_t gbrUl
Guaranteed Bit Rate (bit/s) in uplink.
Definition: eps-bearer.h:43
The attribute can be read.
Definition: type-id.h:63
LteHandoverManagementSapUser * m_handoverManagementSapUser
Receive API calls from the handover algorithm instance.
Definition: lte-enb-rrc.h:1478
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
void DoCompleteSetupUe(uint16_t rnti, LteEnbRrcSapProvider::CompleteSetupUeParameters params)
Part of the RRC protocol.
SystemInformationBlockType1 sourceSystemInformationBlockType1
source system information block type 1
Definition: lte-rrc-sap.h:621
TracedCallback< uint16_t, uint16_t > m_newUeContextTrace
The NewUeContext trace source.
Definition: lte-enb-rrc.h:1651
uint8_t rrcTransactionIdentifier
RRC transaction identifier.
Definition: lte-rrc-sap.h:838
#define MIN_NO_CC
Definition: lte-enb-rrc.h:56
Service Access Point (SAP) offered by the MAC to the RRC See Femto Forum MAC Scheduler Interface Spec...
PreambleInfo preambleInfo
preamble info
Definition: lte-rrc-sap.h:266
Template for the implementation of the LteFfrRrcSapUser as a member of an owner class of type C to wh...
uint8_t rsrpResult
RSRP result.
Definition: lte-rrc-sap.h:681
SystemInformation structure.
Definition: lte-rrc-sap.h:608
Ptr< UeManager > GetUeManager(uint16_t rnti)
Parameters for LtePdcpSapUser::ReceivePdcpSdu.
Definition: lte-pdcp-sap.h:76
uint8_t lcId
logical channel identifier
uint16_t m_rnti
UE id within this cell.
bool m_admitRrcConnectionRequest
The AdmitRrcConnectionRequest attribute.
Definition: lte-enb-rrc.h:1599
int8_t m_qRxLevMin
The QRxLevMin attribute.
Definition: lte-enb-rrc.h:1589
uint16_t rnti
the C-RNTI identifying the UE
Definition: lte-pdcp-sap.h:79
LtePdcpSapUser * m_drbPdcpSapUser
DRB PDCP SAP user.
Definition: lte-enb-rrc.h:548
uint8_t AddUeMeasReportConfig(LteRrcSap::ReportConfigEutra config)
Add a new UE measurement reporting configuration.
CellIdentification cellIdentification
cell identification
Definition: lte-rrc-sap.h:822
bool haveUlConfiguration
have UL configuration
Definition: lte-rrc-sap.h:808
AntennaInfoCommon antennaInfoCommon
2: Physical configuration, general antennaInfoCommon-r10
Definition: lte-rrc-sap.h:743
EventId m_connectionRejectedTimeout
The delay before a connection rejected timeout occurs.
Definition: lte-enb-rrc.h:591
void SetLteFfrRrcSapProvider(LteFfrRrcSapProvider *s)
set the FFR SAP this RRC should interact with
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 ...
uint16_t m_numberOfComponentCarriers
number of component carriers
Definition: lte-enb-rrc.h:1690
std::vector< LteFfrRrcSapProvider * > m_ffrRrcSapProvider
Interface to the FFR algorithm instance.
Definition: lte-enb-rrc.h:1495
LteRrcSap::NonCriticalExtensionConfiguration BuildNonCriticalExtentionConfigurationCa()
bool m_carriersConfigured
are carriers configured
Definition: lte-enb-rrc.h:1692
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:220
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:54
static EventId Schedule(Time const &delay, MEM mem_ptr, OBJ obj)
Schedule an event to expire after delay.
Definition: simulator.h:1389
uint16_t oldEnbUeX2apId
old ENB UE X2 AP ID
Definition: epc-x2-sap.h:248
LteRrcSap::RrcConnectionReconfiguration BuildRrcConnectionReconfiguration()
Ptr< LteSignalingRadioBearerInfo > m_srb0
The Srb0 attribute.
Definition: lte-enb-rrc.h:520
void DoRecvRrcConnectionRequest(uint16_t rnti, LteRrcSap::RrcConnectionRequest msg)
Part of the RRC protocol.
uint8_t preambleTransMax
preamble transmit maximum
Definition: lte-rrc-sap.h:253
MeasResults measResults
measure results
Definition: lte-rrc-sap.h:903
FreqInfo ulFreqInfo
UL frequency info.
Definition: lte-rrc-sap.h:755
uint64_t ueAggregateMaxBitRateDownlink
UE aggregrate max bit rate downlink.
Definition: epc-x2-sap.h:235
uint8_t epsBearerIdentity
EPS bearer identity.
Definition: lte-rrc-sap.h:237
AttributeValue implementation for Time.
Definition: nstime.h:1124
Ptr< Object > Create(void) const
Create an Object instance of the configured TypeId.
UlPowerControlCommonSCell ulPowerControlCommonSCell
3GPP TS 36.331 v.11.10 R11 pag.223
Definition: lte-rrc-sap.h:756
uint64_t ueIdentity
UE identity.
Definition: lte-rrc-sap.h:694
static TypeId GetTypeId(void)
Get the type ID.
Definition: lte-rlc-um.cc:55
int8_t referenceSignalPower
INTEGER (-60..50),.
Definition: lte-rrc-sap.h:149
RrcConnectionReestablishment structure.
Definition: lte-rrc-sap.h:865
void SetSrsConfigurationIndex(uint16_t srsConfIndex)
Set the SRS configuration index and do the necessary reconfiguration.
void DoTriggerHandover(uint16_t rnti, uint16_t targetCellId)
Trigger handover function.
LogicalChannelConfig logicalChannelConfig
logical channel config
Definition: lte-rrc-sap.h:231
virtual void SendLoadInformation(LoadInformationParams params)=0
Send load information function.
RachConfigCommon rachConfigCommon
RACH config common.
Definition: lte-rrc-sap.h:274
ReportConfigEutra reportConfigEutra
report config eutra
Definition: lte-rrc-sap.h:460
TracedCallback< uint64_t, uint16_t, uint16_t > m_connectionEstablishedTrace
The ConnectionEstablished trace source.
Definition: lte-enb-rrc.h:1656
std::set< uint8_t > m_componentCarrierMeasIds
List of measurement identities which are intended for component carrier management purposes...
Definition: lte-enb-rrc.h:1549
Parameters of the HANDOVER PREPARATION FAILURE message.
Definition: epc-x2-sap.h:262
CellAccessRelatedInfo cellAccessRelatedInfo
cell access related info
Definition: lte-rrc-sap.h:596
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)...
Hold an unsigned integer type.
Definition: uinteger.h:44
NonUlConfiguration nonUlConfiguration
non UL configuration
Definition: lte-rrc-sap.h:807
Logical Channel information to be passed to CmacSapProvider::ConfigureLc.
bool haveRadioResourceConfigDedicatedSCell
have radio resource config dedicated SCell?
Definition: lte-rrc-sap.h:824
uint32_t m_ulEarfcn
Uplink E-UTRA Absolute Radio Frequency Channel Number.
Definition: lte-enb-rrc.h:1520
Event A5: PCell becomes worse than absolute threshold1 AND Neighbour becomes better than another abso...
Definition: lte-rrc-sap.h:377
uint8_t CellToComponentCarrierId(uint16_t cellId)
convert the cell id to component carrier id
void DoPathSwitchRequestAcknowledge(EpcEnbS1SapUser::PathSwitchRequestAcknowledgeParameters params)
Path switch request acknowledge function.
bool HasUeManager(uint16_t rnti) const
TracedCallback< uint64_t, uint16_t, uint16_t, std::string > m_rrcTimeoutTrace
The &#39;TimerExpiry&#39; Trace source.
Definition: lte-enb-rrc.h:1688
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
uint32_t dlCarrierFreq
ARFCN - valueEUTRA.
Definition: lte-rrc-sap.h:715
std::vector< ErabAdmittedItem > admittedBearers
admitted bearers
Definition: epc-x2-sap.h:252
bool haveMeasGapConfig
have measure gap config?
Definition: lte-rrc-sap.h:528
std::list< MeasResultScell > measResultScell
measure results Scells
Definition: lte-rrc-sap.h:672
std::vector< CellInformationItem > cellInformationList
cell information list
Definition: epc-x2-sap.h:306
RrcConnectionReconfiguration structure.
Definition: lte-rrc-sap.h:836
uint16_t rnti
the C-RNTI identifying the UE
Definition: lte-pdcp-sap.h:46
std::list< MeasIdToAddMod > measIdToAddModList
measure ID to add mod list
Definition: lte-rrc-sap.h:525
bool haveRachConfigDedicated
Have RACH config dedicated?
Definition: lte-rrc-sap.h:567
SetupUeParameters structure.
Definition: lte-rrc-sap.h:1085
uint8_t raPrachMaskIndex
RA PRACH mask index.
Definition: lte-rrc-sap.h:554
Parameters of the SN STATUS TRANSFER message.
Definition: epc-x2-sap.h:276
PhysicalConfigDedicated physicalConfigDedicated
physical config dedicated
Definition: lte-rrc-sap.h:291
TracedCallback< uint64_t, uint16_t, uint16_t, uint8_t > m_drbCreatedTrace
The DrbCreated trace source.
Definition: lte-enb-rrc.h:564
std::set< uint8_t > m_ffrMeasIds
List of measurement identities which are intended for FFR purpose.
Definition: lte-enb-rrc.h:1547
uint8_t filterCoefficientRSRP
filter coefficient RSRP
Definition: lte-rrc-sap.h:297
Service Access Point (SAP) offered by the eNodeB RRC instance to the ANR instance.
Definition: lte-anr-sap.h:97
uint16_t oldEnbUeX2apId
old ENB UE X2 AP ID
Definition: epc-x2-sap.h:264
uint8_t srsSubframeConfig
SRS subframe config.
Definition: lte-rrc-sap.h:125
RrcConnectionReconfigurationCompleted structure.
Definition: lte-rrc-sap.h:851
MeasResultServFreqList measScellResultList
measure SCell result list
Definition: lte-rrc-sap.h:686
Parameters for LtePdcpSapProvider::TransmitPdcpSdu.
Definition: lte-pdcp-sap.h:43
uint32_t gtpTeid
S1-bearer GTP tunnel endpoint identifier, see 36.423 9.2.1.
Template for the implementation of the LteEnbCphySapUser as a member of an owner class of type C to w...
bool haveAntennaInfoUlDedicated
have antenna info UL dedicated?
Definition: lte-rrc-sap.h:795
uint8_t Drbid2Lcid(uint8_t drbid)
enum ns3::LteRrcSap::ReportConfigEutra::@65 eventId
Event enumeration.
std::list< SCellToAddMod > sCellsToAddModList
SCell to add mod list.
Definition: lte-rrc-sap.h:831
LtePdcpSapProvider * srb1SapProvider
SRB1 SAP provider.
Definition: lte-rrc-sap.h:1088
void SetLteCcmRrcSapProvider(LteCcmRrcSapProvider *s)
set the Component Carrier Management SAP this RRC should interact with
uint16_t rxSn
RX sequence number.
Definition: lte-pdcp.h:104
LteMacSapUser * GetLteMacSapUser()
Definition: lte-rlc.cc:165
void SendData(uint8_t bid, Ptr< Packet > p)
Send a data packet over the appropriate Data Radio Bearer.
Definition: lte-enb-rrc.cc:790
MeasIdToAddMod structure.
Definition: lte-rrc-sap.h:464
uint8_t rrcTransactionIdentifier
RRC transaction identifier.
Definition: lte-rrc-sap.h:700
std::set< uint8_t > m_handoverMeasIds
List of measurement identities which are intended for handover purpose.
Definition: lte-enb-rrc.h:1543
PrachConfigSCell prachConfigSCell
PRACH config SCell.
Definition: lte-rrc-sap.h:758
uint8_t m_componentCarrierId
ID of the primary CC for this UE.
Definition: lte-enb-rrc.h:538
RrcConnectionSetupCompleted structure.
Definition: lte-rrc-sap.h:705
HandoverPreparationInfo structure.
Definition: lte-rrc-sap.h:895
RadioResourceConfigDedicated radioResourceConfigDedicated
radio resource config dedicated
Definition: lte-rrc-sap.h:701
PathSwitchRequestParameters structure.
RrcConnectionSetup structure.
Definition: lte-rrc-sap.h:698
void DoRecvUeContextRelease(EpcX2SapUser::UeContextReleaseParams params)
Receive UE context release function.
uint8_t m_lastAllocatedDrbid
last allocated Data Radio Bearer ID
Definition: lte-enb-rrc.h:509
BearerToBeSwitched structure.
UlPowerControlDedicatedSCell ulPowerControlDedicatedSCell
UL power control dedicated SCell.
Definition: lte-rrc-sap.h:798
uint8_t Bid2Lcid(uint8_t bid)
uint16_t m_sourceX2apId
source X2 ap ID
Definition: lte-enb-rrc.h:566
Parameters for [re]configuring the UE.
RrcConnectionReestablishmentRequest structure.
Definition: lte-rrc-sap.h:858
Ptr< Packet > rrcContext
RRC context.
Definition: epc-x2-sap.h:238
std::map< uint32_t, X2uTeidInfo > m_x2uTeidInfoMap
TEID, RNTI, DRBID.
Definition: lte-enb-rrc.h:1559
Ptr< T > GetObject(void) const
Get a pointer to the requested aggregated Object.
Definition: object.h:459
TracedCallback< uint64_t, uint16_t, uint16_t, LteRrcSap::MeasurementReport > m_recvMeasurementReportTrace
The RecvMeasurementReport trace source.
Definition: lte-enb-rrc.h:1676
bool crossCarrierSchedulingConfig
currently implemented as boolean variable –> implementing crossCarrierScheduling is out of the scope...
Definition: lte-rrc-sap.h:789
void SetRnti(uint16_t rnti)
Set the RNTI to the given value.
uint8_t raPreambleIndex
RA preamble index.
Definition: lte-rrc-sap.h:553
uint8_t numberOfRaPreambles
number of RA preambles
uint16_t targetCellId
target cell ID
Definition: epc-x2-sap.h:281
virtual ~UeManager(void)
Definition: lte-enb-rrc.cc:312
uint8_t m_rsrpFilterCoefficient
The RsrpFilterCoefficient attribute.
Definition: lte-enb-rrc.h:1605
SystemInformationBlockType1 structure.
Definition: lte-rrc-sap.h:594
E-RABs to be setup item as it is used in the HANDOVER REQUEST message.
Definition: epc-x2-sap.h:59
LteCcmRrcSapUser * m_ccmRrcSapUser
Receive API calls from the LteEnbComponentCarrierManager instance.
Definition: lte-enb-rrc.h:1483
uint8_t GetBid(void) const
Get Bearer Id function.
uint32_t gtpTeid
GTP TEID.
Definition: epc-x2-sap.h:332
RadioResourceConfigDedicated sourceRadioResourceConfig
source radio resource config
Definition: lte-rrc-sap.h:618
Part of the RRC protocol.
Definition: lte-rrc-sap.h:1081
uint8_t DoAddUeMeasReportConfigForAnr(LteRrcSap::ReportConfigEutra reportConfig)
Add UE measure report config for ANR function.
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 RemoveDataRadioBearerInfo(uint8_t drbid)
remove the LteDataRadioBearerInfo corresponding to a bearer being released
static TypeId GetTypeId(void)
Get the type ID.
Definition: lte-enb-rrc.cc:330
uint8_t reportConfigId
report config ID
Definition: lte-rrc-sap.h:468
void RecvSnStatusTransfer(EpcX2SapUser::SnStatusTransferParams params)
Take the necessary actions in response to the reception of an X2 SN STATUS TRANSFER message...
Definition: lte-enb-rrc.cc:902
EpcX2SapProvider * m_x2SapProvider
Interface to send messages to neighbour eNodeB over the X2 interface.
Definition: lte-enb-rrc.h:1470
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Parameters of the RESOURCE STATUS UPDATE message.
Definition: epc-x2-sap.h:314
uint16_t oldEnbUeX2apId
old ENB UE X2 AP ID
Definition: epc-x2-sap.h:278
bool haveQuantityConfig
have quantity config?
Definition: lte-rrc-sap.h:526
Hold objects of type Ptr<T>.
Definition: pointer.h:36
virtual void SendHandoverRequestAck(HandoverRequestAckParams params)=0
Send handover request ack function.
LteRrcSap::RadioResourceConfigDedicated BuildRadioResourceConfigDedicated()
void SetLteRlcSapUser(LteRlcSapUser *s)
Definition: lte-rlc.cc:144
LteCcmRrcSapUser * GetLteCcmRrcSapUser()
Get the Component Carrier Management SAP offered by this RRC.
uint16_t targetPhysCellId
target Phy cell ID
Definition: lte-rrc-sap.h:560
RrcConnectionReject structure.
Definition: lte-rrc-sap.h:889
uint16_t targetCellId
target cell ID
Definition: epc-x2-sap.h:251
PhysicalConfigDedicatedSCell physicalConfigDedicatedSCell
physical config dedicated SCell
Definition: lte-rrc-sap.h:815
EventId m_handoverLeavingTimeout
Time limit before a handover leaving timeout occurs.
Definition: lte-enb-rrc.h:605
Ptr< const AttributeChecker > MakeBooleanChecker(void)
Definition: boolean.cc:121
uint8_t lcGroup
logical channel group
uint8_t rrcTransactionIdentifier
RRC transaction identifier.
Definition: lte-rrc-sap.h:867
void SetLteAnrSapProvider(LteAnrSapProvider *s)
set the ANR SAP this RRC should interact with
bool haveMobilityControlInfo
have mobility control info
Definition: lte-rrc-sap.h:841
Parameters of the UE CONTEXT RELEASE message.
Definition: epc-x2-sap.h:290
uint8_t connEstFailCount
Number of times that the UE detects T300 expiry on the same cell.
Definition: lte-rrc-sap.h:260
bool IsGbr() const
Definition: eps-bearer.cc:119
EpsBearer erabLevelQosParameters
E-RAB level QOS parameters.
Definition: epc-x2-sap.h:62
uint16_t sourceCellId
source cell ID
Definition: epc-x2-sap.h:294
Reference Signal Received Power.
Definition: lte-rrc-sap.h:406
Parameters of the HANDOVER REQUEST ACKNOWLEDGE message.
Definition: epc-x2-sap.h:246
void RecvRrcConnectionSetupCompleted(LteRrcSap::RrcConnectionSetupCompleted msg)
Implement the LteEnbRrcSapProvider::RecvRrcConnectionSetupCompleted interface.
Definition: lte-enb-rrc.cc:989
RadioResourceConfigDedicated radioResourceConfigDedicated
radio resource config dedicated
Definition: lte-rrc-sap.h:868
std::list< uint8_t > m_drbsToBeStarted
DRBS to be started.
Definition: lte-enb-rrc.h:570
void DoReceivePdcpSdu(LtePdcpSapUser::ReceivePdcpSduParameters params)
Receive PDCP SDU function.
MasterInformationBlock structure.
Definition: lte-rrc-sap.h:587
bool haveMeasResultNeighCells
have measure result neighbor cells
Definition: lte-rrc-sap.h:683
uint16_t dlBandwidth
1: Cell characteristics
Definition: lte-rrc-sap.h:741
uint32_t physCellId
physical cell ID
Definition: lte-rrc-sap.h:714
uint8_t filterCoefficientRSRQ
filter coefficient RSRQ
Definition: lte-rrc-sap.h:298
PuschConfigDedicatedSCell pushConfigDedicatedSCell
PUSCH config dedicated SCell.
Definition: lte-rrc-sap.h:797
bool havePdschConfigDedicated
have PDSCH config dedicated?
Definition: lte-rrc-sap.h:222
static const uint16_t g_srsCiLow[SRS_ENTRIES]
The lower bound (inclusive) of the SRS configuration indices (ISRS) which use the corresponding SRS p...
uint8_t logicalChannelIdentity
logical channel identify
Definition: lte-rrc-sap.h:240
uint16_t newUeIdentity
new UE identity
Definition: lte-rrc-sap.h:565
TracedCallback< uint64_t, uint16_t, uint16_t, uint16_t > m_handoverStartTrace
The HandoverStart trace source.
Definition: lte-enb-rrc.h:1666
RachConfigCommon structure.
Definition: lte-rrc-sap.h:264
void CancelPendingEvents()
Cancel all timers which are running for the UE.
bool havePhysicalConfigDedicated
have physical config dedicated?
Definition: lte-rrc-sap.h:290
void RecvIdealUeContextRemoveRequest(uint16_t rnti)
Implement the LteEnbRrcSapProvider::RecvIdealUeContextRemoveRequest interface.
Definition: lte-enb-rrc.cc:582
std::vector< EpcX2Sap::ErabToBeSetupItem > GetErabList()
Definition: lte-enb-rrc.cc:840
uint8_t ulBandwidth
UL bandwidth.
Definition: lte-rrc-sap.h:91
void ScheduleRrcConnectionReconfiguration()
schedule an RRC Connection Reconfiguration procedure with the UE
Definition: lte-enb-rrc.cc:601
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:406
LteAnrSapUser * GetLteAnrSapUser()
Get the ANR SAP offered by this RRC.
This class contains the specification of EPS Bearers.
Definition: eps-bearer.h:91
LtePdcpSpecificLtePdcpSapUser class.
Definition: lte-pdcp-sap.h:132
PathSwitchRequestAcknowledgeParameters structure.
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:1125
Parameters for [re]configuring the UE.
bool haveSoundingRsUlConfigDedicated
have sounding RS UL config dedicated?
Definition: lte-rrc-sap.h:218
Time m_systemInformationPeriodicity
The SystemInformationPeriodicity attribute.
Definition: lte-enb-rrc.h:1575
LteEnbRrcSapProvider * GetLteEnbRrcSapProvider()
RadioResourceConfigCommonSib radioResourceConfigCommon
radio resource config common
Definition: lte-rrc-sap.h:603
static Time Now(void)
Return the current simulation virtual time.
Definition: simulator.cc:193
std::vector< ErabToBeSetupItem > bearers
bearers
Definition: epc-x2-sap.h:237
uint8_t m_defaultTransmissionMode
The DefaultTransmissionMode attribute.
Definition: lte-enb-rrc.h:1565
void DoRecvResourceStatusUpdate(EpcX2SapUser::ResourceStatusUpdateParams params)
Receive resource status update function.
void SetLcId(uint8_t lcId)
Definition: lte-rlc.cc:137
uint8_t measObjectId
measure object ID
Definition: lte-rrc-sap.h:467
Service Access Point (SAP) offered by the eNodeB RRC instance to the Frequency Reuse algorithm instan...
void DoRecvUeData(EpcX2SapUser::UeDataParams params)
Receive UE data function.
virtual void TransmitPdcpSdu(TransmitPdcpSduParameters params)=0
Send a RRC PDU to the RDCP for transmission This method is to be called when upper RRC entity has a R...
NS_LOG_LOGIC("Net device "<< nd<< " is not bridged")
RadioResourceConfigCommon radioResourceConfigCommon
radio resource config common
Definition: lte-rrc-sap.h:566
uint32_t plmnIdentity
PLMN identity.
Definition: lte-rrc-sap.h:68
enum ns3::EpsBearer::Qci qci
Qos class indicator.
uint16_t oldEnbUeX2apId
old ENB UE X2 AP ID
Definition: epc-x2-sap.h:230
uint32_t dlCarrierFreq
DL carrier frequency.
Definition: lte-rrc-sap.h:539
void PrepareHandover(uint16_t cellId)
Start the handover preparation and send the handover request.
Definition: lte-enb-rrc.cc:635
CarrierBandwidthEutra carrierBandwidth
carrier bandwidth
Definition: lte-rrc-sap.h:564
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
uint8_t DoAddUeMeasReportConfigForHandover(LteRrcSap::ReportConfigEutra reportConfig)
Add UE measure report config for handover function.
uint8_t m_componentCarrierId
Component carrier ID.
Definition: lte-enb-rrc.cc:80
uint16_t sourceCellId
source cell ID
Definition: epc-x2-sap.h:280
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. ...
void RecvRrcConnectionReestablishmentComplete(LteRrcSap::RrcConnectionReestablishmentComplete msg)
Implement the LteEnbRrcSapProvider::RecvRrcConnectionReestablishmentComplete interface.
EpcEnbS1SapUser * m_s1SapUser
Interface to receive messages from core network over the S1 protocol.
Definition: lte-enb-rrc.h:1508
std::set< uint16_t > m_ueSrsConfigurationIndexSet
UE SRS configuration index set.
Definition: lte-enb-rrc.h:1580
void SetSrsPeriodicity(uint32_t p)
uint8_t measId
measure ID
Definition: lte-rrc-sap.h:680
uint16_t rnti
C-RNTI identifying the UE.
virtual void DoDispose(void)
Destructor implementation.
bool haveUlConfiguration
have UL configuration?
Definition: lte-rrc-sap.h:794
TypeId GetRlcType(EpsBearer bearer)
bool m_configured
True if ConfigureCell() has been completed.
Definition: lte-enb-rrc.h:1516
LogicalChannelConfig logicalChannelConfig
logical channel config
Definition: lte-rrc-sap.h:241
uint64_t mbrUl
maximum bitrate in uplink
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...
RachConfigCommon rachConfigCommon
RACH config common.
Definition: lte-rrc-sap.h:280
Ptr< const AttributeChecker > MakeEnumChecker(int v1, std::string n1, int v2, std::string n2, int v3, std::string n3, int v4, std::string n4, int v5, std::string n5, int v6, std::string n6, int v7, std::string n7, int v8, std::string n8, int v9, std::string n9, int v10, std::string n10, int v11, std::string n11, int v12, std::string n12, int v13, std::string n13, int v14, std::string n14, int v15, std::string n15, int v16, std::string n16, int v17, std::string n17, int v18, std::string n18, int v19, std::string n19, int v20, std::string n20, int v21, std::string n21, int v22, std::string n22)
Make an EnumChecker pre-configured with a set of allowed values by name.
Definition: enum.cc:184
#define NS_ABORT_IF(cond)
Abnormal program termination if a condition is true.
Definition: abort.h:77
void InitialContextSetupRequest()
Process Initial context setup request message from the MME.
Definition: lte-enb-rrc.cc:380
Instantiate subclasses of ns3::Object.
Ipv4 addresses are stored in host order in this class.
Definition: ipv4-address.h:40
uint64_t gbrUl
guaranteed bitrate in uplink
uint8_t srsBandwidthConfig
SRS bandwidth config.
Definition: lte-rrc-sap.h:124
std::list< std::pair< uint8_t, Ptr< Packet > > > m_packetBuffer
Packet buffer for when UE is doing the handover.
Definition: lte-enb-rrc.h:623
uint8_t raResponseWindowSize
RA response window size.
Definition: lte-rrc-sap.h:254
CellSelectionInfo cellSelectionInfo
cell selection info
Definition: lte-rrc-sap.h:597
bool haveCarrierBandwidth
have carrier bandwidth?
Definition: lte-rrc-sap.h:563
Service Access Point (SAP) offered by the PDCP entity to the RRC entity See 3GPP 36.323 Packet Data Convergence Protocol (PDCP) specification.
Definition: lte-pdcp-sap.h:35
bool haveAntennaInfoDedicated
have antenna info dedicated?
Definition: lte-rrc-sap.h:220
uint8_t ulBandwidth
UL bandwidth.
Definition: lte-rrc-sap.h:547
std::vector< LteEnbCmacSapUser * > m_cmacSapUser
Receive API calls from the eNodeB MAC instance.
Definition: lte-enb-rrc.h:1473
static const std::string & ToString(EpcUeNas::State s)
Definition: epc-ue-nas.cc:50
LteAnrSapUser * m_anrSapUser
Receive API calls from the ANR instance.
Definition: lte-enb-rrc.h:1488
EventId m_connectionSetupTimeout
Time limit before a connection setup timeout occurs.
Definition: lte-enb-rrc.h:585
std::vector< LteRrcSap::SystemInformationBlockType1 > m_sib1
The System Information Block Type 1 that is currently broadcasted over BCH.
Definition: lte-enb-rrc.h:1529
Template for the implementation of the LteEnbRrcSapProvider as a member of an owner class of type C t...
Definition: lte-rrc-sap.h:1642
bool m_pendingRrcConnectionReconfiguration
pending RRC connection reconfiguration
Definition: lte-enb-rrc.h:550
#define NS_ABORT_MSG_IF(cond, msg)
Abnormal program termination if a condition is true, with a message.
Definition: abort.h:108
std::vector< ErabNotAdmittedItem > notAdmittedBearers
not admitted bearers
Definition: epc-x2-sap.h:253
Service Access Point (SAP) offered by the ANR instance to the eNodeB RRC instance.
Definition: lte-anr-sap.h:37
GbrQosInformation gbrQosInfo
GBR QOS information.
Definition: eps-bearer.h:131
void DoRrcConfigurationUpdateInd(LteEnbCmacSapUser::UeConfig params)
RRC configuration update indication function.
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.10 Feb-2015)
Definition: lte-rrc-sap.h:847
uint16_t newEnbUeX2apId
new ENB UE X2 AP ID
Definition: epc-x2-sap.h:279
virtual void RemoveUe(uint16_t rnti)=0
Remove UE function.
void AddPacketTag(const Tag &tag) const
Add a packet tag.
Definition: packet.cc:863
void DoSetPdschConfigDedicated(uint16_t rnti, LteRrcSap::PdschConfigDedicated pa)
Set PDSCH config dedicated function.
uint8_t DoAddUeMeasReportConfigForFfr(LteRrcSap::ReportConfigEutra reportConfig)
Add UE measure report config for FFR function.
Service Access Point (SAP) offered by the MAC to the RLC See Femto Forum MAC Scheduler Interface Spec...
Definition: lte-mac-sap.h:95
struct defining the RACH configuration of the MAC
Service Access Point (SAP) offered by the Component Carrier Manager (CCM) instance to the eNodeB RRC ...
void DoRecvHandoverPreparationFailure(EpcX2SapUser::HandoverPreparationFailureParams params)
Receive handover preparation failure function.
#define NS_LOG_WARN(msg)
Use NS_LOG to output a message of level LOG_WARN.
Definition: log.h:264
Service Access Point (SAP) offered by the handover algorithm instance to the eNodeB RRC instance...
Both the RSRP and RSRQ quantities are to be included in the measurement report.
Definition: lte-rrc-sap.h:414
void StartDataRadioBearers()
Start the data radio bearers that have been previously recorded to be started using RecordDataRadioBe...
Definition: lte-enb-rrc.cc:512
int8_t pb
INTEGER (0..3),.
Definition: lte-rrc-sap.h:150
bool haveSpeedStatePars
have speed state parameters?
Definition: lte-rrc-sap.h:532
static const uint16_t g_srsPeriodicity[SRS_ENTRIES]
Sounding Reference Symbol (SRS) periodicity (TSRS) in milliseconds.
void DoSetNumberOfComponentCarriers(uint16_t numberOfComponentCarriers)
Set number of component carriers.
bool haveSoundingRsUlConfigDedicated
have sounding RS UL config dedicated?
Definition: lte-rrc-sap.h:799
EpcEnbS1SapUser * GetS1SapUser()
uint8_t allowedMeasBandwidth
allowed measure bandwidth
Definition: lte-rrc-sap.h:328
std::list< DrbToAddMod > drbToAddModList
DRB to add mod list.
Definition: lte-rrc-sap.h:288
void RecvRrcConnectionReestablishmentRequest(LteRrcSap::RrcConnectionReestablishmentRequest msg)
Implement the LteEnbRrcSapProvider::RecvRrcConnectionReestablishmentRequest interface.
bool RemovePacketTag(Tag &tag)
Remove a packet tag.
Definition: packet.cc:870
enum ns3::LteRrcSap::SoundingRsUlConfigDedicated::action type
action type
LteRrcSap::PhysicalConfigDedicated m_physicalConfigDedicated
physical config dedicated
Definition: lte-enb-rrc.h:542
Parameters passed to InitialContextSetupRequest ()
std::map< uint16_t, Ptr< UeManager > > m_ueMap
The UeMap attribute.
Definition: lte-enb-rrc.h:1534
uint8_t systemFrameNumber
system frame number
Definition: lte-rrc-sap.h:590
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Definition: log.h:272
static const uint16_t g_srsCiHigh[SRS_ENTRIES]
The upper bound (inclusive) of the SRS configuration indices (ISRS) which use the corresponding SRS p...
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition: nstime.h:1062
LteFfrRrcSapUser * GetLteFfrRrcSapUser()
Get the FFR SAP offered by this RRC.
virtual void SendSystemInformation(uint16_t cellId, SystemInformation msg)=0
Send a SystemInformation message to all attached UEs during a system information acquisition procedur...
int8_t offsetFreq
offset frequency
Definition: lte-rrc-sap.h:331
CompleteSetupUeParameters structure.
Definition: lte-rrc-sap.h:1204
Parameters of the LOAD INFORMATION message.
Definition: epc-x2-sap.h:303
uint16_t criticalityDiagnostics
criticality diagnostics
Definition: epc-x2-sap.h:268
bool haveAntennaInfoDedicated
have antenna info dedicated?
Definition: lte-rrc-sap.h:787
GBR Conversational Voice.
Definition: eps-bearer.h:108
std::vector< LteEnbCphySapUser * > m_cphySapUser
Receive API calls from the eNodeB PHY instances.
Definition: lte-enb-rrc.h:1511
virtual Ptr< Packet > EncodeHandoverCommand(RrcConnectionReconfiguration msg)=0
Encode handover command.
void RecvRrcConnectionRequest(LteRrcSap::RrcConnectionRequest msg)
Implement the LteEnbRrcSapProvider::RecvRrcConnectionRequest interface.
Definition: lte-enb-rrc.cc:940
RrcConnectionReestablishmentComplete structure.
Definition: lte-rrc-sap.h:872
uint8_t transmissionMode
transmission mode
Definition: lte-rrc-sap.h:143
SystemInformationBlockType2 sib2
SIB2.
Definition: lte-rrc-sap.h:611
LteCcmRrcSapProvider * m_ccmRrcSapProvider
Interface to the LteEnbComponentCarrierManager instance.
Definition: lte-enb-rrc.h:1485
void Cancel(void)
This method is syntactic sugar for the ns3::Simulator::Cancel method.
Definition: event-id.cc:53
Event A1: Serving becomes better than absolute threshold.
Definition: lte-rrc-sap.h:373
Service Access Point (SAP) offered by the MAC to the RLC See Femto Forum MAC Scheduler Interface Spec...
Definition: lte-mac-sap.h:36
std::map< uint8_t, Ptr< LteDataRadioBearerInfo > > m_drbMap
The DataRadioBearerMap attribute.
Definition: lte-enb-rrc.h:515
uint8_t GetComponentCarrierId() const
TracedCallback< uint64_t, uint16_t, uint16_t > m_connectionReconfigurationTrace
The ConnectionReconfiguration trace source.
Definition: lte-enb-rrc.h:1661
uint8_t GetLogicalChannelPriority(EpsBearer bearer)
Service Access Point (SAP) offered by the eNodeB RRC instance to the component carrier manager (CCM) ...
uint8_t lcid
the logical channel id corresponding to the sending RLC instance
Definition: lte-pdcp-sap.h:80
bool valid
true if a valid RA config was allocated, false otherwise
RSRQ is used for the threshold.
Definition: lte-rrc-sap.h:355
uint8_t GetNewRrcTransactionIdentifier()
MobilityControlInfo mobilityControlInfo
mobility control info
Definition: lte-rrc-sap.h:842
void DoRecvSnStatusTransfer(EpcX2SapUser::SnStatusTransferParams params)
Receive SN status transfer function.
Event A4: Neighbour becomes better than absolute threshold.
Definition: lte-rrc-sap.h:376
LteEnbCphySapUser * GetLteEnbCphySapUser()
void ConnectionRejectedTimeout(uint16_t rnti)
Method triggered a while after sending RRC Connection Rejected.
SrbToAddMod structure.
Definition: lte-rrc-sap.h:228
Ptr< const AttributeAccessor > MakeObjectMapAccessor(U T::*memberVariable)
MakeAccessorHelper implementation for ObjectVector.
Definition: object-map.h:80
void DoRecvIdealUeContextRemoveRequest(uint16_t rnti)
Part of the RRC protocol.
Ptr< Packet > ueData
UE data.
Definition: epc-x2-sap.h:333
Ptr< LteDataRadioBearerInfo > GetDataRadioBearerInfo(uint8_t drbid)
std::map< uint8_t, Ptr< ComponentCarrierBaseStation > > m_componentCarrierPhyConf
component carrier phy configuration
Definition: lte-enb-rrc.h:1694
Template for the implementation of the LteAnrSapUser as a member of an owner class of type C to which...
Definition: lte-anr-sap.h:205
uint16_t GetRnti(void) const
AntennaInfoDedicated antennaInfo
antenna info
Definition: lte-rrc-sap.h:221
Time m_handoverJoiningTimeoutDuration
The HandoverJoiningTimeoutDuration attribute.
Definition: lte-enb-rrc.h:1639
LteRlcSapProvider * GetLteRlcSapProvider()
Definition: lte-rlc.cc:151
uint16_t m_lastAllocatedConfigurationIndex
last allocated configuration index
Definition: lte-enb-rrc.h:1581
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 ...
LTE RLC Acknowledged Mode (AM), see 3GPP TS 36.322.
Definition: lte-rlc-am.h:36
uint8_t rsrqResult
RSRQ result.
Definition: lte-rrc-sap.h:682
LteHandoverManagementSapProvider * m_handoverManagementSapProvider
Interface to the handover algorithm instance.
Definition: lte-enb-rrc.h:1480
A base class which provides memory management and object aggregation.
Definition: object.h:87
PdschConfigCommon pdschConfigCommon
PDSCH config common.
Definition: lte-rrc-sap.h:281
bool dlForwarding
DL forwarding.
Definition: epc-x2-sap.h:63
std::set< uint8_t > m_anrMeasIds
List of measurement identities which are intended for ANR purpose.
Definition: lte-enb-rrc.h:1545
uint16_t targetCellId
target cell ID
Definition: epc-x2-sap.h:331
TracedCallback< uint64_t, uint16_t, uint16_t > m_connectionReleaseTrace
The NotifyConnectionRelease trace source.
Definition: lte-enb-rrc.h:1682
Container for a set of ns3::Object pointers.
void DoRecvRrcConnectionReestablishmentRequest(uint16_t rnti, LteRrcSap::RrcConnectionReestablishmentRequest msg)
Part of the RRC protocol.
void SetPdschConfigDedicated(LteRrcSap::PdschConfigDedicated pdschConfigDedicated)
Configure PdschConfigDedicated (i.e.
Service Access Point (SAP) offered by the eNB MAC to the eNB RRC See Femto Forum MAC Scheduler Interf...
uint8_t dlBandwidth
DL bandwidth.
Definition: lte-rrc-sap.h:546
SoundingRsUlConfigCommon soundingRsUlConfigCommon
sounding RS UL config common
Definition: lte-rrc-sap.h:757
NonCriticalExtensionConfiguration structure.
Definition: lte-rrc-sap.h:829
Service Access Point (SAP) offered by the UE PHY to the UE RRC for control purposes.
void RemoveUe(uint16_t rnti)
remove a UE from the cell
PdschConfigDedicated structure.
Definition: lte-rrc-sap.h:154
State m_state
The current UeManager state.
Definition: lte-enb-rrc.h:546
uint64_t gbrDl
guaranteed bitrate in downlink
uint8_t lcid
the logical channel id corresponding to the sending RLC instance
Definition: lte-pdcp-sap.h:47
void DoRecvMeasurementReport(uint16_t rnti, LteRrcSap::MeasurementReport msg)
Part of the RRC protocol.
SoundingRsUlConfigDedicated soundingRsUlConfigDedicated
sounding RS UL config dedicated
Definition: lte-rrc-sap.h:800
void CmacUeConfigUpdateInd(LteEnbCmacSapUser::UeConfig cmacParams)
CMAC UE config update indication function.
UlConfiguration ulConfiguration
UL configuration.
Definition: lte-rrc-sap.h:809
Event A2: Serving becomes worse than absolute threshold.
Definition: lte-rrc-sap.h:374
Parameters of the UE DATA primitive.
Definition: epc-x2-sap.h:328
enum LteEpsBearerToRlcMapping_t m_epsBearerToRlcMapping
The EpsBearerToRlcMapping attribute.
Definition: lte-enb-rrc.h:1570
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 MAX_NO_CC
Definition: lte-enb-rrc.h:57
std::vector< ErabsSubjectToStatusTransferItem > erabsSubjectToStatusTransferList
ERABs subject to status transfer list.
Definition: epc-x2-sap.h:282
uint32_t m_dlEarfcn
Downlink E-UTRA Absolute Radio Frequency Channel Number.
Definition: lte-enb-rrc.h:1518
void DoSendLoadInformation(EpcX2Sap::LoadInformationParams params)
Send load information function.
void RecvMeasurementReport(LteRrcSap::MeasurementReport msg)
Implement the LteEnbRrcSapProvider::RecvMeasurementReport interface.
This abstract base class defines the API to interact with the Radio Link Control (LTE_RLC) in LTE...
Definition: lte-rlc.h:50
a unique identifier for an interface.
Definition: type-id.h:58
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)...
uint16_t m_targetCellId
target cell ID
Definition: lte-enb-rrc.h:569
std::list< ReportConfigToAddMod > reportConfigToAddModList
report config to add mod list
Definition: lte-rrc-sap.h:523
ReportConfigToAddMod structure.
Definition: lte-rrc-sap.h:457
uint16_t sourceCellId
source cell ID
Definition: epc-x2-sap.h:232
uint16_t DoAllocateTemporaryCellRnti(uint8_t componentCarrierId)
Allocate temporary cell RNTI function.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition: type-id.cc:915
uint16_t GetSrsConfigurationIndex(void) const
std::list< uint8_t > drbToReleaseList
DRB to release list.
Definition: lte-rrc-sap.h:289
uint8_t Bid2Drbid(uint8_t bid)
static TypeId GetTypeId(void)
Get the type ID.
Definition: lte-rlc-am.cc:88
void SetS1SapProvider(EpcEnbS1SapProvider *s)
Set the S1 SAP Provider.
uint8_t Lcid2Drbid(uint8_t lcid)
EventId m_connectionRequestTimeout
Time limit before a connection request timeout occurs.
Definition: lte-enb-rrc.h:579
uint16_t GetRnti(void) const
Get RNTI function.
LteAnrSapProvider * m_anrSapProvider
Interface to the ANR instance.
Definition: lte-enb-rrc.h:1490
MeasObjectToAddMod structure.
Definition: lte-rrc-sap.h:450
double GetPacketErrorLossRate() const
Definition: eps-bearer.cc:137
uint16_t AddUe(UeManager::State state, uint8_t componentCarrierId)
Allocate a new RNTI for a new UE.
Service Access Point (SAP) offered by the eNodeB RRC instance to the handover algorithm instance...
void DoDataRadioBearerSetupRequest(EpcEnbS1SapUser::DataRadioBearerSetupRequestParameters params)
Data radio beaerer setup request function.
uint16_t antennaPortsCount
antenna ports count
Definition: lte-rrc-sap.h:721
uint16_t pSrsOffset
3GPP TS 36.331 v.11.10 R11 page 234
Definition: lte-rrc-sap.h:779
std::vector< LteFfrRrcSapUser * > m_ffrRrcSapUser
Receive API calls from the FFR algorithm instance.
Definition: lte-enb-rrc.h:1493
void DoRecvLoadInformation(EpcX2SapUser::LoadInformationParams params)
Receive load information function.
RaSupervisionInfo raSupervisionInfo
RA supervision info.
Definition: lte-rrc-sap.h:267
void SetLteMacSapProvider(LteMacSapProvider *s)
Definition: lte-rlc.cc:158
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:692
bool SendData(Ptr< Packet > p)
Enqueue an IP data packet on the proper bearer for downlink transmission.
EventId m_handoverJoiningTimeout
Time limit before a handover joining timeout occurs.
Definition: lte-enb-rrc.h:598
bool haveScellsMeas
has SCells measure
Definition: lte-rrc-sap.h:685
bool isGbr
true if the bearer is GBR, false if the bearer is NON-GBR
AntennaInfoDedicated antennaInfo
antenna info dedicated
Definition: lte-rrc-sap.h:788
void CompleteSetupUe(LteEnbRrcSapProvider::CompleteSetupUeParameters params)
Implement the LteEnbRrcSapProvider::CompleteSetupUe interface.
Definition: lte-enb-rrc.cc:932
RadioResourceConfigDedicated structure.
Definition: lte-rrc-sap.h:285
uint32_t ulCarrierFreq
UL carrier frequency.
Definition: lte-rrc-sap.h:540
virtual void DoInitialize()
Initialize() implementation.
Definition: lte-enb-rrc.cc:174
MasterInformationBlock sourceMasterInformationBlock
source master information block
Definition: lte-rrc-sap.h:620
LteRrcSap::MeasConfig m_ueMeasConfig
List of measurement configuration which are active in every UE attached to this eNodeB instance...
Definition: lte-enb-rrc.h:1540
int8_t qQualMin
INTEGER (-34..-3), actual value = IE value [dB].
Definition: lte-rrc-sap.h:84
void DoRecvHandoverRequestAck(EpcX2SapUser::HandoverRequestAckParams params)
Receive handover request acknowledge function.
bool haveCellForWhichToReportCGI
have cell for which to report CGI?
Definition: lte-rrc-sap.h:336
AntennaInfoDedicated antennaInfoUl
antenna info UL
Definition: lte-rrc-sap.h:796
ThresholdEutra threshold2
Threshold for event A5.
Definition: lte-rrc-sap.h:382
void DoRecvHandoverRequest(EpcX2SapUser::HandoverRequestParams params)
Receive handover request function.