A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Authors: Nicola Baldo <nbaldo@cttc.es>
19  * Marco Miozzo <mmiozzo@cttc.es>
20  * Manuel Requena <manuel.requena@cttc.es>
21  */
22 
23 #include "lte-enb-rrc.h"
24 
25 #include <ns3/fatal-error.h>
26 #include <ns3/log.h>
27 #include <ns3/abort.h>
28 
29 #include <ns3/pointer.h>
30 #include <ns3/object-map.h>
31 #include <ns3/object-factory.h>
32 #include <ns3/simulator.h>
33 
34 #include <ns3/lte-radio-bearer-info.h>
35 #include <ns3/eps-bearer-tag.h>
36 #include <ns3/packet.h>
37 
38 #include <ns3/lte-rlc.h>
39 #include <ns3/lte-rlc-tm.h>
40 #include <ns3/lte-rlc-um.h>
41 #include <ns3/lte-rlc-am.h>
42 #include <ns3/lte-pdcp.h>
43 
44 
45 
46 
47 NS_LOG_COMPONENT_DEFINE ("LteEnbRrc");
48 
49 
50 namespace ns3 {
51 
52 
54 // CMAC SAP forwarder
56 
61 {
62 public:
64 
65  virtual uint16_t AllocateTemporaryCellRnti ();
66  virtual void NotifyLcConfigResult (uint16_t rnti, uint8_t lcid, bool success);
67  virtual void RrcConfigurationUpdateInd (UeConfig params);
68 
69 private:
71 };
72 
74  : m_rrc (rrc)
75 {
76 }
77 
78 uint16_t
80 {
82 }
83 
84 void
85 EnbRrcMemberLteEnbCmacSapUser::NotifyLcConfigResult (uint16_t rnti, uint8_t lcid, bool success)
86 {
87  m_rrc->DoNotifyLcConfigResult (rnti, lcid, success);
88 }
89 
90 void
92 {
94 }
95 
96 
97 
99 // UeManager
101 
102 
103 static const std::string g_ueManagerStateName[UeManager::NUM_STATES] =
104 {
105  "INITIAL_RANDOM_ACCESS",
106  "CONNECTION_SETUP",
107  "CONNECTION_REJECTED",
108  "CONNECTED_NORMALLY",
109  "CONNECTION_RECONFIGURATION",
110  "CONNECTION_REESTABLISHMENT",
111  "HANDOVER_PREPARATION",
112  "HANDOVER_JOINING",
113  "HANDOVER_PATH_SWITCH",
114  "HANDOVER_LEAVING",
115 };
116 
117 static const std::string & ToString (UeManager::State s)
118 {
119  return g_ueManagerStateName[s];
120 }
121 
122 
123 NS_OBJECT_ENSURE_REGISTERED (UeManager);
124 
125 
127 {
128  NS_FATAL_ERROR ("this constructor is not espected to be used");
129 }
130 
131 
133  : m_lastAllocatedDrbid (0),
134  m_rnti (rnti),
135  m_imsi (0),
136  m_lastRrcTransactionIdentifier (0),
137  m_rrc (rrc),
138  m_state (s),
139  m_pendingRrcConnectionReconfiguration (false),
140  m_sourceX2apId (0),
141  m_sourceCellId (0),
142  m_needPhyMacConfiguration (false)
143 {
144  NS_LOG_FUNCTION (this);
145 }
146 
147 void
149 {
150  NS_LOG_FUNCTION (this);
152 
154  m_physicalConfigDedicated.antennaInfo.transmissionMode = m_rrc->m_defaultTransmissionMode;
161 
162  m_rrc->m_cmacSapProvider->AddUe (m_rnti);
163  m_rrc->m_cphySapProvider->AddUe (m_rnti);
164 
165  // setup the eNB side of SRB0
166  {
167  uint8_t lcid = 0;
168 
169  Ptr<LteRlc> rlc = CreateObject<LteRlcTm> ()->GetObject<LteRlc> ();
170  rlc->SetLteMacSapProvider (m_rrc->m_macSapProvider);
171  rlc->SetRnti (m_rnti);
172  rlc->SetLcId (lcid);
173 
174  m_srb0 = CreateObject<LteSignalingRadioBearerInfo> ();
175  m_srb0->m_rlc = rlc;
176  m_srb0->m_srbIdentity = 0;
177  // no need to store logicalChannelConfig as SRB0 is pre-configured
178 
180  lcinfo.rnti = m_rnti;
181  lcinfo.lcId = lcid;
182  // leave the rest of lcinfo empty as CCCH (LCID 0) is pre-configured
183  m_rrc->m_cmacSapProvider->AddLc (lcinfo, rlc->GetLteMacSapUser ());
184 
185  }
186 
187  // setup the eNB side of SRB1; the UE side will be set up upon RRC connection establishment
188  {
189  uint8_t lcid = 1;
190 
191  Ptr<LteRlc> rlc = CreateObject<LteRlcAm> ()->GetObject<LteRlc> ();
192  rlc->SetLteMacSapProvider (m_rrc->m_macSapProvider);
193  rlc->SetRnti (m_rnti);
194  rlc->SetLcId (lcid);
195 
196  Ptr<LtePdcp> pdcp = CreateObject<LtePdcp> ();
197  pdcp->SetRnti (m_rnti);
198  pdcp->SetLcId (lcid);
199  pdcp->SetLtePdcpSapUser (m_drbPdcpSapUser);
200  pdcp->SetLteRlcSapProvider (rlc->GetLteRlcSapProvider ());
201  rlc->SetLteRlcSapUser (pdcp->GetLteRlcSapUser ());
202 
203  m_srb1 = CreateObject<LteSignalingRadioBearerInfo> ();
204  m_srb1->m_rlc = rlc;
205  m_srb1->m_pdcp = pdcp;
206  m_srb1->m_srbIdentity = 1;
207  m_srb1->m_logicalChannelConfig.priority = 0;
208  m_srb1->m_logicalChannelConfig.prioritizedBitRateKbps = 100;
209  m_srb1->m_logicalChannelConfig.bucketSizeDurationMs = 100;
210  m_srb1->m_logicalChannelConfig.logicalChannelGroup = 0;
211 
213  lcinfo.rnti = m_rnti;
214  lcinfo.lcId = lcid;
215  lcinfo.lcGroup = 0; // all SRBs always mapped to LCG 0
216  lcinfo.qci = EpsBearer::GBR_CONV_VOICE; // not sure why the FF API requires a CQI even for SRBs...
217  lcinfo.isGbr = true;
218  lcinfo.mbrUl = 1e6;
219  lcinfo.mbrDl = 1e6;
220  lcinfo.gbrUl = 1e4;
221  lcinfo.gbrDl = 1e4;
222  m_rrc->m_cmacSapProvider->AddLc (lcinfo, rlc->GetLteMacSapUser ());
223  }
224 
226  ueParams.srb0SapProvider = m_srb0->m_rlc->GetLteRlcSapProvider ();
227  ueParams.srb1SapProvider = m_srb1->m_pdcp->GetLtePdcpSapProvider ();
228  m_rrc->m_rrcSapUser->SetupUe (m_rnti, ueParams);
229 
230  // configure MAC (and scheduler)
232  req.m_rnti = m_rnti;
234  m_rrc->m_cmacSapProvider->UeUpdateConfigurationReq (req);
235 
236  // configure PHY
237  m_rrc->m_cphySapProvider->SetTransmissionMode (m_rnti, m_physicalConfigDedicated.antennaInfo.transmissionMode);
238  m_rrc->m_cphySapProvider->SetSrsConfigurationIndex (m_rnti, m_physicalConfigDedicated.soundingRsUlConfigDedicated.srsConfigIndex);
239 
240  // schedule this UeManager instance to be deleted if the UE does not give any sign of life within a reasonable time
241  Time maxConnectionDelay;
242  switch (m_state)
243  {
245  m_connectionRequestTimeout = Simulator::Schedule (m_rrc->m_connectionRequestTimeoutDuration,
247  m_rrc, m_rnti);
248  break;
249 
250  case HANDOVER_JOINING:
251  m_handoverJoiningTimeout = Simulator::Schedule (m_rrc->m_handoverJoiningTimeoutDuration,
253  m_rrc, m_rnti);
254  break;
255 
256  default:
257  NS_FATAL_ERROR ("unexpected state " << ToString (m_state));
258  break;
259  }
260 
261 }
262 
263 
265 {
266 }
267 
268 void
270 {
271  delete m_drbPdcpSapUser;
272  // delete eventual X2-U TEIDs
273  for (std::map <uint8_t, Ptr<LteDataRadioBearerInfo> >::iterator it = m_drbMap.begin ();
274  it != m_drbMap.end ();
275  ++it)
276  {
277  m_rrc->m_x2uTeidInfoMap.erase (it->second->m_gtpTeid);
278  }
279 
280 }
281 
283 {
284  static TypeId tid = TypeId ("ns3::UeManager")
285  .SetParent<Object> ()
286  .AddConstructor<UeManager> ()
287  .AddAttribute ("DataRadioBearerMap", "List of UE DataRadioBearerInfo by DRBID.",
288  ObjectMapValue (),
290  MakeObjectMapChecker<LteDataRadioBearerInfo> ())
291  .AddAttribute ("Srb0", "SignalingRadioBearerInfo for SRB0",
292  PointerValue (),
293  MakePointerAccessor (&UeManager::m_srb0),
294  MakePointerChecker<LteSignalingRadioBearerInfo> ())
295  .AddAttribute ("Srb1", "SignalingRadioBearerInfo for SRB1",
296  PointerValue (),
297  MakePointerAccessor (&UeManager::m_srb1),
298  MakePointerChecker<LteSignalingRadioBearerInfo> ())
299  .AddAttribute ("C-RNTI",
300  "Cell Radio Network Temporary Identifier",
301  TypeId::ATTR_GET, // read-only attribute
302  UintegerValue (0), // unused, read-only attribute
303  MakeUintegerAccessor (&UeManager::m_rnti),
304  MakeUintegerChecker<uint16_t> ())
305  .AddTraceSource ("StateTransition",
306  "fired upon every UE state transition seen by the UeManager at the eNB RRC",
308  ;
309  return tid;
310 }
311 
312 void
313 UeManager::SetSource (uint16_t sourceCellId, uint16_t sourceX2apId)
314 {
315  m_sourceX2apId = sourceX2apId;
316  m_sourceCellId = sourceCellId;
317 }
318 
319 void
320 UeManager::SetImsi (uint64_t imsi)
321 {
322  m_imsi = imsi;
323 }
324 
325 void
326 UeManager::SetupDataRadioBearer (EpsBearer bearer, uint8_t bearerId, uint32_t gtpTeid, Ipv4Address transportLayerAddress)
327 {
328  NS_LOG_FUNCTION (this << (uint32_t) m_rnti);
329 
330  Ptr<LteDataRadioBearerInfo> drbInfo = CreateObject<LteDataRadioBearerInfo> ();
331  uint8_t drbid = AddDataRadioBearerInfo (drbInfo);
332  uint8_t lcid = Drbid2Lcid (drbid);
333  uint8_t bid = Drbid2Bid (drbid);
334  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");
335  drbInfo->m_epsBearerIdentity = bid;
336  drbInfo->m_drbIdentity = drbid;
337  drbInfo->m_logicalChannelIdentity = lcid;
338  drbInfo->m_gtpTeid = gtpTeid;
339  drbInfo->m_transportLayerAddress = transportLayerAddress;
340 
341  if (m_state == HANDOVER_JOINING)
342  {
343  // setup TEIDs for receiving data eventually forwarded over X2-U
344  LteEnbRrc::X2uTeidInfo x2uTeidInfo;
345  x2uTeidInfo.rnti = m_rnti;
346  x2uTeidInfo.drbid = drbid;
347  std::pair<std::map<uint32_t, LteEnbRrc::X2uTeidInfo>::iterator, bool>
348  ret = m_rrc->m_x2uTeidInfoMap.insert (std::pair<uint32_t, LteEnbRrc::X2uTeidInfo> (gtpTeid, x2uTeidInfo));
349  NS_ASSERT_MSG (ret.second == true, "overwriting a pre-existing entry in m_x2uTeidInfoMap");
350  }
351 
352  TypeId rlcTypeId = m_rrc->GetRlcType (bearer);
353 
354  ObjectFactory rlcObjectFactory;
355  rlcObjectFactory.SetTypeId (rlcTypeId);
356  Ptr<LteRlc> rlc = rlcObjectFactory.Create ()->GetObject<LteRlc> ();
357  rlc->SetLteMacSapProvider (m_rrc->m_macSapProvider);
358  rlc->SetRnti (m_rnti);
359 
360  drbInfo->m_rlc = rlc;
361 
362  rlc->SetLcId (lcid);
363 
364  // we need PDCP only for real RLC, i.e., RLC/UM or RLC/AM
365  // if we are using RLC/SM we don't care of anything above RLC
366  if (rlcTypeId != LteRlcSm::GetTypeId ())
367  {
368  Ptr<LtePdcp> pdcp = CreateObject<LtePdcp> ();
369  pdcp->SetRnti (m_rnti);
370  pdcp->SetLcId (lcid);
371  pdcp->SetLtePdcpSapUser (m_drbPdcpSapUser);
372  pdcp->SetLteRlcSapProvider (rlc->GetLteRlcSapProvider ());
373  rlc->SetLteRlcSapUser (pdcp->GetLteRlcSapUser ());
374  drbInfo->m_pdcp = pdcp;
375  }
376 
378  lcinfo.rnti = m_rnti;
379  lcinfo.lcId = lcid;
380  lcinfo.lcGroup = m_rrc->GetLogicalChannelGroup (bearer);
381  lcinfo.qci = bearer.qci;
382  lcinfo.isGbr = bearer.IsGbr ();
383  lcinfo.mbrUl = bearer.gbrQosInfo.mbrUl;
384  lcinfo.mbrDl = bearer.gbrQosInfo.mbrDl;
385  lcinfo.gbrUl = bearer.gbrQosInfo.gbrUl;
386  lcinfo.gbrDl = bearer.gbrQosInfo.gbrDl;
387  m_rrc->m_cmacSapProvider->AddLc (lcinfo, rlc->GetLteMacSapUser ());
388 
389  if (rlcTypeId == LteRlcAm::GetTypeId ())
390  {
391  drbInfo->m_rlcConfig.choice = LteRrcSap::RlcConfig::AM;
392  }
393  else
394  {
395  drbInfo->m_rlcConfig.choice = LteRrcSap::RlcConfig::UM_BI_DIRECTIONAL;
396  }
397 
398  drbInfo->m_logicalChannelIdentity = lcid;
399  drbInfo->m_logicalChannelConfig.priority = m_rrc->GetLogicalChannelPriority (bearer);
400  drbInfo->m_logicalChannelConfig.logicalChannelGroup = m_rrc->GetLogicalChannelGroup (bearer);
401  if (bearer.IsGbr ())
402  {
403  drbInfo->m_logicalChannelConfig.prioritizedBitRateKbps = bearer.gbrQosInfo.gbrUl;
404  }
405  else
406  {
407  drbInfo->m_logicalChannelConfig.prioritizedBitRateKbps = 0;
408  }
409  drbInfo->m_logicalChannelConfig.bucketSizeDurationMs = 1000;
410 
412 }
413 
414 void
416 {
417  NS_LOG_FUNCTION (this << (uint32_t) m_rnti);
418  for (std::map <uint8_t, Ptr<LteDataRadioBearerInfo> >::iterator it = m_drbMap.begin ();
419  it != m_drbMap.end ();
420  ++it)
421  {
422  m_drbsToBeStarted.push_back (it->first);
423  }
424 }
425 
426 void
428 {
429  NS_LOG_FUNCTION (this << (uint32_t) m_rnti);
430  for (std::list <uint8_t>::iterator drbIdIt = m_drbsToBeStarted.begin ();
431  drbIdIt != m_drbsToBeStarted.end ();
432  ++drbIdIt)
433  {
434  std::map <uint8_t, Ptr<LteDataRadioBearerInfo> >::iterator drbIt = m_drbMap.find (*drbIdIt);
435  NS_ASSERT (drbIt != m_drbMap.end ());
436  drbIt->second->m_rlc->Initialize ();
437  if (drbIt->second->m_pdcp)
438  {
439  drbIt->second->m_pdcp->Initialize ();
440  }
441  }
442  m_drbsToBeStarted.clear ();
443 }
444 
445 
446 void
448 {
449  NS_LOG_FUNCTION (this << (uint32_t) m_rnti << (uint32_t) drbid);
450  uint8_t lcid = Drbid2Lcid (drbid);
451  std::map <uint8_t, Ptr<LteDataRadioBearerInfo> >::iterator it = m_drbMap.find (drbid);
452  NS_ASSERT_MSG (it != m_drbMap.end (), "request to remove radio bearer with unknown drbid " << drbid);
453 
454  // first delete eventual X2-U TEIDs
455  m_rrc->m_x2uTeidInfoMap.erase (it->second->m_gtpTeid);
456 
457  m_drbMap.erase (it);
458  m_rrc->m_cmacSapProvider->ReleaseLc (m_rnti, lcid);
459 
461  rrcd.havePhysicalConfigDedicated = false;
462  rrcd.drbToReleaseList.push_back (drbid);
463 
465  msg.haveMeasConfig = false;
466  msg.haveMobilityControlInfo = false;
467 
468  m_rrc->m_rrcSapUser->SendRrcConnectionReconfiguration (m_rnti, msg);
469 }
470 
471 
472 void
474 {
475  NS_LOG_FUNCTION (this);
476  switch (m_state)
477  {
479  case CONNECTION_SETUP:
483  case HANDOVER_JOINING:
484  case HANDOVER_LEAVING:
485  // a previous reconfiguration still ongoing, we need to wait for it to be finished
487  break;
488 
489  case CONNECTED_NORMALLY:
490  {
493  m_rrc->m_rrcSapUser->SendRrcConnectionReconfiguration (m_rnti, msg);
496  }
497  break;
498 
499  default:
500  NS_FATAL_ERROR ("method unexpected in state " << ToString (m_state));
501  break;
502  }
503 }
504 
505 void
506 UeManager::PrepareHandover (uint16_t cellId)
507 {
508  NS_LOG_FUNCTION (this << cellId);
509  switch (m_state)
510  {
511  case CONNECTED_NORMALLY:
512  {
513  m_targetCellId = cellId;
515  params.oldEnbUeX2apId = m_rnti;
517  params.sourceCellId = m_rrc->m_cellId;
518  params.targetCellId = cellId;
519  params.mmeUeS1apId = m_imsi;
520  params.ueAggregateMaxBitRateDownlink = 200 * 1000;
521  params.ueAggregateMaxBitRateUplink = 100 * 1000;
522  params.bearers = GetErabList ();
523 
526  hpi.asConfig.sourceDlCarrierFreq = m_rrc->m_dlEarfcn;
527  hpi.asConfig.sourceMeasConfig = m_rrc->m_ueMeasConfig;
531  hpi.asConfig.sourceSystemInformationBlockType1.cellAccessRelatedInfo.plmnIdentityInfo.plmnIdentity = m_rrc->m_sib1.cellAccessRelatedInfo.plmnIdentityInfo.plmnIdentity;
533  hpi.asConfig.sourceSystemInformationBlockType1.cellAccessRelatedInfo.csgIndication = m_rrc->m_sib1.cellAccessRelatedInfo.csgIndication;
534  hpi.asConfig.sourceSystemInformationBlockType1.cellAccessRelatedInfo.csgIdentity = m_rrc->m_sib1.cellAccessRelatedInfo.csgIdentity;
535  LteEnbCmacSapProvider::RachConfig rc = m_rrc->m_cmacSapProvider->GetRachConfig ();
541  params.rrcContext = m_rrc->m_rrcSapUser->EncodeHandoverPreparationInformation (hpi);
542 
543  NS_LOG_LOGIC ("oldEnbUeX2apId = " << params.oldEnbUeX2apId);
544  NS_LOG_LOGIC ("sourceCellId = " << params.sourceCellId);
545  NS_LOG_LOGIC ("targetCellId = " << params.targetCellId);
546  NS_LOG_LOGIC ("mmeUeS1apId = " << params.mmeUeS1apId);
547  NS_LOG_LOGIC ("rrcContext = " << params.rrcContext);
548 
549  m_rrc->m_x2SapProvider->SendHandoverRequest (params);
551  }
552  break;
553 
554  default:
555  NS_FATAL_ERROR ("method unexpected in state " << ToString (m_state));
556  break;
557  }
558 
559 }
560 
561 void
563 {
564  NS_LOG_FUNCTION (this);
565 
566  NS_ASSERT_MSG (params.notAdmittedBearers.empty (), "not admission of some bearers upon handover is not supported");
567  NS_ASSERT_MSG (params.admittedBearers.size () == m_drbMap.size (), "not enough bearers in admittedBearers");
568 
569  // note: the Handover command from the target eNB to the source eNB
570  // is expected to be sent transparently to the UE; however, here we
571  // decode the message and eventually reencode it. This way we can
572  // support both a real RRC protocol implementation and an ideal one
573  // without actual RRC protocol encoding.
574 
575  Ptr<Packet> encodedHandoverCommand = params.rrcContext;
576  LteRrcSap::RrcConnectionReconfiguration handoverCommand = m_rrc->m_rrcSapUser->DecodeHandoverCommand (encodedHandoverCommand);
577  m_rrc->m_rrcSapUser->SendRrcConnectionReconfiguration (m_rnti, handoverCommand);
579  m_handoverLeavingTimeout = Simulator::Schedule (m_rrc->m_handoverLeavingTimeoutDuration,
581  m_rrc, m_rnti);
582  NS_ASSERT (handoverCommand.haveMobilityControlInfo);
583  m_rrc->m_handoverStartTrace (m_imsi, m_rrc->m_cellId, m_rnti, handoverCommand.mobilityControlInfo.targetPhysCellId);
584 
586  sst.oldEnbUeX2apId = params.oldEnbUeX2apId;
587  sst.newEnbUeX2apId = params.newEnbUeX2apId;
588  sst.sourceCellId = params.sourceCellId;
589  sst.targetCellId = params.targetCellId;
590  for ( std::map <uint8_t, Ptr<LteDataRadioBearerInfo> >::iterator drbIt = m_drbMap.begin ();
591  drbIt != m_drbMap.end ();
592  ++drbIt)
593  {
594  // SN status transfer is only for AM RLC
595  if (0 != drbIt->second->m_rlc->GetObject<LteRlcAm> ())
596  {
597  LtePdcp::Status status = drbIt->second->m_pdcp->GetStatus ();
599  i.dlPdcpSn = status.txSn;
600  i.ulPdcpSn = status.rxSn;
601  sst.erabsSubjectToStatusTransferList.push_back (i);
602  }
603  }
604  m_rrc->m_x2SapProvider->SendSnStatusTransfer (sst);
605 }
606 
607 
610 {
611  NS_LOG_FUNCTION (this);
613 }
614 
617 {
618  NS_LOG_FUNCTION (this);
620 }
621 
622 void
624 {
625  NS_LOG_FUNCTION (this << p << (uint16_t) bid);
626  switch (m_state)
627  {
629  case CONNECTION_SETUP:
630  NS_LOG_WARN ("not connected, discarding packet");
631  return;
632  break;
633 
634  case CONNECTED_NORMALLY:
638  case HANDOVER_JOINING:
640  {
641  NS_LOG_LOGIC ("queueing data on PDCP for transmission over the air");
643  params.pdcpSdu = p;
644  params.rnti = m_rnti;
645  params.lcid = Bid2Lcid (bid);
646  uint8_t drbid = Bid2Drbid (bid);
647  LtePdcpSapProvider* pdcpSapProvider = GetDataRadioBearerInfo (drbid)->m_pdcp->GetLtePdcpSapProvider ();
648  pdcpSapProvider->TransmitPdcpSdu (params);
649  }
650  break;
651 
652  case HANDOVER_LEAVING:
653  {
654  NS_LOG_LOGIC ("forwarding data to target eNB over X2-U");
655  uint8_t drbid = Bid2Drbid (bid);
656  EpcX2Sap::UeDataParams params;
657  params.sourceCellId = m_rrc->m_cellId;
658  params.targetCellId = m_targetCellId;
659  params.gtpTeid = GetDataRadioBearerInfo (drbid)->m_gtpTeid;
660  params.ueData = p;
661  m_rrc->m_x2SapProvider->SendUeData (params);
662  }
663  break;
664 
665  default:
666  NS_FATAL_ERROR ("method unexpected in state " << ToString (m_state));
667  break;
668  }
669 }
670 
671 std::vector<EpcX2Sap::ErabToBeSetupItem>
673 {
674  NS_LOG_FUNCTION (this);
675  std::vector<EpcX2Sap::ErabToBeSetupItem> ret;
676  for (std::map <uint8_t, Ptr<LteDataRadioBearerInfo> >::iterator it = m_drbMap.begin ();
677  it != m_drbMap.end ();
678  ++it)
679  {
681  etbsi.erabId = it->second->m_epsBearerIdentity;
682  etbsi.erabLevelQosParameters = it->second->m_epsBearer;
683  etbsi.dlForwarding = false;
684  etbsi.transportLayerAddress = it->second->m_transportLayerAddress;
685  etbsi.gtpTeid = it->second->m_gtpTeid;
686  ret.push_back (etbsi);
687  }
688  return ret;
689 }
690 
691 void
693 {
694  NS_LOG_FUNCTION (this);
695  switch (m_state)
696  {
698  NS_LOG_INFO ("Send UE CONTEXT RELEASE from target eNB to source eNB");
699  EpcX2SapProvider::UeContextReleaseParams ueCtxReleaseParams;
700  ueCtxReleaseParams.oldEnbUeX2apId = m_sourceX2apId;
701  ueCtxReleaseParams.newEnbUeX2apId = m_rnti;
702  ueCtxReleaseParams.sourceCellId = m_sourceCellId;
703  m_rrc->m_x2SapProvider->SendUeContextRelease (ueCtxReleaseParams);
705  m_rrc->m_handoverEndOkTrace (m_imsi, m_rrc->m_cellId, m_rnti);
706  break;
707 
708  default:
709  NS_FATAL_ERROR ("method unexpected in state " << ToString (m_state));
710  break;
711  }
712 }
713 
714 void
716 {
717  NS_LOG_FUNCTION (this << cellId);
718  switch (m_state)
719  {
721  NS_ASSERT (cellId == m_targetCellId);
722  NS_LOG_INFO ("target eNB sent HO preparation failure, aborting HO");
724  break;
725 
726  default:
727  NS_FATAL_ERROR ("method unexpected in state " << ToString (m_state));
728  break;
729  }
730 }
731 
732 void
734 {
735  NS_LOG_FUNCTION (this);
736  for (std::vector<EpcX2Sap::ErabsSubjectToStatusTransferItem>::iterator erabIt
737  = params.erabsSubjectToStatusTransferList.begin ();
738  erabIt != params.erabsSubjectToStatusTransferList.end ();
739  ++erabIt)
740  {
741  // LtePdcp::Status status;
742  // status.txSn = erabIt->dlPdcpSn;
743  // status.rxSn = erabIt->ulPdcpSn;
744  // uint8_t drbId = Bid2Drbid (erabIt->erabId);
745  // std::map <uint8_t, Ptr<LteDataRadioBearerInfo> >::iterator drbIt = m_drbMap.find (drbId);
746  // NS_ASSERT_MSG (drbIt != m_drbMap.end (), "could not find DRBID " << (uint32_t) drbId);
747  // drbIt->second->m_pdcp->SetStatus (status);
748  }
749 }
750 
751 void
753 {
754  NS_LOG_FUNCTION (this);
755  NS_ASSERT_MSG (m_state == HANDOVER_LEAVING, "method unexpected in state " << ToString (m_state));
757 }
758 
759 
760 // methods forwarded from RRC SAP
761 
762 void
764 {
765  NS_LOG_FUNCTION (this);
766  m_srb0->m_rlc->SetLteRlcSapUser (params.srb0SapUser);
767  m_srb1->m_pdcp->SetLtePdcpSapUser (params.srb1SapUser);
768 }
769 
770 void
772 {
773  NS_LOG_FUNCTION (this);
774  switch (m_state)
775  {
777  {
779 
780  if (m_rrc->m_admitRrcConnectionRequest == true)
781  {
782  m_imsi = msg.ueIdentity;
783  if (m_rrc->m_s1SapProvider != 0)
784  {
785  m_rrc->m_s1SapProvider->InitialUeMessage (m_imsi, m_rnti);
786  }
787 
788  // send RRC CONNECTION SETUP to UE
792  m_rrc->m_rrcSapUser->SendRrcConnectionSetup (m_rnti, msg2);
793 
796  m_rrc->m_connectionSetupTimeoutDuration,
799  }
800  else
801  {
802  NS_LOG_INFO ("rejecting connection request for RNTI " << m_rnti);
803 
804  // send RRC CONNECTION REJECT to UE
806  rejectMsg.waitTime = 3;
807  m_rrc->m_rrcSapUser->SendRrcConnectionReject (m_rnti, rejectMsg);
808 
810  m_rrc->m_connectionRejectedTimeoutDuration,
813  }
814  }
815  break;
816 
817  default:
818  NS_FATAL_ERROR ("method unexpected in state " << ToString (m_state));
819  break;
820  }
821 }
822 
823 void
825 {
826  NS_LOG_FUNCTION (this);
827  switch (m_state)
828  {
829  case CONNECTION_SETUP:
833  m_rrc->m_connectionEstablishedTrace (m_imsi, m_rrc->m_cellId, m_rnti);
834  break;
835 
836  default:
837  NS_FATAL_ERROR ("method unexpected in state " << ToString (m_state));
838  break;
839  }
840 }
841 
842 void
844 {
845  NS_LOG_FUNCTION (this);
846  switch (m_state)
847  {
851  {
852  // configure MAC (and scheduler)
854  req.m_rnti = m_rnti;
856  m_rrc->m_cmacSapProvider->UeUpdateConfigurationReq (req);
857 
858  // configure PHY
859  m_rrc->m_cphySapProvider->SetTransmissionMode (req.m_rnti, req.m_transmissionMode);
860 
862  m_rrc->m_cphySapProvider->SetPa (m_rnti, paDouble);
863 
865  }
867  m_rrc->m_connectionReconfigurationTrace (m_imsi, m_rrc->m_cellId, m_rnti);
868  break;
869 
870  case HANDOVER_LEAVING:
871  NS_LOG_INFO ("ignoring RecvRrcConnectionReconfigurationCompleted in state " << ToString (m_state));
872  break;
873 
874  case HANDOVER_JOINING:
875  {
877  NS_LOG_INFO ("Send PATH SWITCH REQUEST to the MME");
879  params.rnti = m_rnti;
880  params.cellId = m_rrc->m_cellId;
881  params.mmeUeS1Id = m_imsi;
883  for (std::map <uint8_t, Ptr<LteDataRadioBearerInfo> >::iterator it = m_drbMap.begin ();
884  it != m_drbMap.end ();
885  ++it)
886  {
888  b.epsBearerId = it->second->m_epsBearerIdentity;
889  b.teid = it->second->m_gtpTeid;
890  params.bearersToBeSwitched.push_back (b);
891  }
892  m_rrc->m_s1SapProvider->PathSwitchRequest (params);
893  }
894  break;
895 
896  default:
897  NS_FATAL_ERROR ("method unexpected in state " << ToString (m_state));
898  break;
899  }
900 }
901 
902 void
904 {
905  NS_LOG_FUNCTION (this);
906  switch (m_state)
907  {
908  case CONNECTED_NORMALLY:
909  break;
910 
911  case HANDOVER_LEAVING:
913  break;
914 
915  default:
916  NS_FATAL_ERROR ("method unexpected in state " << ToString (m_state));
917  break;
918  }
919 
923  m_rrc->m_rrcSapUser->SendRrcConnectionReestablishment (m_rnti, msg2);
925 }
926 
927 void
929 {
930  NS_LOG_FUNCTION (this);
932 }
933 
934 void
936 {
937  uint8_t measId = msg.measResults.measId;
938  NS_LOG_FUNCTION (this << (uint16_t) measId);
939  NS_LOG_LOGIC ("measId " << (uint16_t) measId
940  << " haveMeasResultNeighCells " << msg.measResults.haveMeasResultNeighCells
941  << " measResultListEutra " << msg.measResults.measResultListEutra.size ());
942  NS_LOG_LOGIC ("serving cellId " << m_rrc->m_cellId
943  << " RSRP " << (uint16_t) msg.measResults.rsrpResult
944  << " RSRQ " << (uint16_t) msg.measResults.rsrqResult);
945 
946  for (std::list <LteRrcSap::MeasResultEutra>::iterator it = msg.measResults.measResultListEutra.begin ();
947  it != msg.measResults.measResultListEutra.end ();
948  ++it)
949  {
950  NS_LOG_LOGIC ("neighbour cellId " << it->physCellId
951  << " RSRP " << (it->haveRsrpResult ? (uint16_t) it->rsrpResult : 255)
952  << " RSRQ " << (it->haveRsrqResult ? (uint16_t) it->rsrqResult : 255));
953  }
954 
955  if ((m_rrc->m_handoverManagementSapProvider != 0)
956  && (m_rrc->m_handoverMeasIds.find (measId) != m_rrc->m_handoverMeasIds.end ()))
957  {
958  // this measurement was requested by the handover algorithm
959  m_rrc->m_handoverManagementSapProvider->ReportUeMeas (m_rnti,
960  msg.measResults);
961  }
962 
963  if ((m_rrc->m_anrSapProvider != 0)
964  && (m_rrc->m_anrMeasIds.find (measId) != m_rrc->m_anrMeasIds.end ()))
965  {
966  // this measurement was requested by the ANR function
967  m_rrc->m_anrSapProvider->ReportUeMeas (msg.measResults);
968  }
969 
970  if ((m_rrc->m_ffrRrcSapProvider != 0)
971  && (m_rrc->m_ffrMeasIds.find (measId) != m_rrc->m_ffrMeasIds.end ()))
972  {
973  // this measurement was requested by the FFR function
974  m_rrc->m_ffrRrcSapProvider->ReportUeMeas (m_rnti, msg.measResults);
975  }
976 
977  // fire a trace source
978  m_rrc->m_recvMeasurementReportTrace (m_imsi, m_rrc->m_cellId, m_rnti, msg);
979 
980 } // end of UeManager::RecvMeasurementReport
981 
982 
983 // methods forwarded from CMAC SAP
984 
985 void
987 {
988  NS_LOG_FUNCTION (this << m_rnti);
989  // at this stage used only by the scheduler for updating txMode
990 
992 
994 
995  // reconfigure the UE RRC
997 }
998 
999 
1000 // methods forwarded from PDCP SAP
1001 
1002 void
1004 {
1005  NS_LOG_FUNCTION (this);
1006  if (params.lcid > 2)
1007  {
1008  // data radio bearer
1009  EpsBearerTag tag;
1010  tag.SetRnti (params.rnti);
1011  tag.SetBid (Lcid2Bid (params.lcid));
1012  params.pdcpSdu->AddPacketTag (tag);
1013  m_rrc->m_forwardUpCallback (params.pdcpSdu);
1014  }
1015 }
1016 
1017 
1018 uint16_t
1020 {
1021  return m_rnti;
1022 }
1023 
1024 uint64_t
1026 {
1027  return m_imsi;
1028 }
1029 
1030 uint16_t
1032 {
1034 }
1035 
1036 void
1038 {
1039  NS_LOG_FUNCTION (this);
1041  m_rrc->m_cphySapProvider->SetSrsConfigurationIndex (m_rnti, srsConfIndex);
1042  switch (m_state)
1043  {
1044  case INITIAL_RANDOM_ACCESS:
1045  // do nothing, srs conf index will be correctly enforced upon
1046  // RRC connection establishment
1047  break;
1048 
1049  default:
1051  break;
1052  }
1053 }
1054 
1057 {
1058  return m_state;
1059 }
1060 
1061 void
1063 {
1064  NS_LOG_FUNCTION (this);
1065  m_physicalConfigDedicated.pdschConfigDedicated = pdschConfigDedicated;
1066 
1068 
1069  // reconfigure the UE RRC
1071 }
1072 
1073 uint8_t
1075 {
1076  NS_LOG_FUNCTION (this);
1077  const uint8_t MAX_DRB_ID = 32;
1078  for (int drbid = (m_lastAllocatedDrbid + 1) % MAX_DRB_ID;
1079  drbid != m_lastAllocatedDrbid;
1080  drbid = (drbid + 1) % MAX_DRB_ID)
1081  {
1082  if (drbid != 0) // 0 is not allowed
1083  {
1084  if (m_drbMap.find (drbid) == m_drbMap.end ())
1085  {
1086  m_drbMap.insert (std::pair<uint8_t, Ptr<LteDataRadioBearerInfo> > (drbid, drbInfo));
1087  drbInfo->m_drbIdentity = drbid;
1088  m_lastAllocatedDrbid = drbid;
1089  return drbid;
1090  }
1091  }
1092  }
1093  NS_FATAL_ERROR ("no more data radio bearer ids available");
1094  return 0;
1095 }
1096 
1099 {
1100  NS_LOG_FUNCTION (this << (uint32_t) drbid);
1101  NS_ASSERT (0 != drbid);
1102  std::map<uint8_t, Ptr<LteDataRadioBearerInfo> >::iterator it = m_drbMap.find (drbid);
1103  NS_ABORT_IF (it == m_drbMap.end ());
1104  return it->second;
1105 }
1106 
1107 
1108 void
1110 {
1111  NS_LOG_FUNCTION (this << (uint32_t) drbid);
1112  std::map <uint8_t, Ptr<LteDataRadioBearerInfo> >::iterator it = m_drbMap.find (drbid);
1113  NS_ASSERT_MSG (it != m_drbMap.end (), "request to remove radio bearer with unknown drbid " << drbid);
1114  m_drbMap.erase (it);
1115 }
1116 
1117 
1120 {
1125  msg.haveMobilityControlInfo = false;
1126  msg.haveMeasConfig = true;
1127  msg.measConfig = m_rrc->m_ueMeasConfig;
1128 
1129  return msg;
1130 }
1131 
1134 {
1136 
1137  if (m_srb1 != 0)
1138  {
1140  stam.srbIdentity = m_srb1->m_srbIdentity;
1141  stam.logicalChannelConfig = m_srb1->m_logicalChannelConfig;
1142  rrcd.srbToAddModList.push_back (stam);
1143  }
1144 
1145  for (std::map <uint8_t, Ptr<LteDataRadioBearerInfo> >::iterator it = m_drbMap.begin ();
1146  it != m_drbMap.end ();
1147  ++it)
1148  {
1150  dtam.epsBearerIdentity = it->second->m_epsBearerIdentity;
1151  dtam.drbIdentity = it->second->m_drbIdentity;
1152  dtam.rlcConfig = it->second->m_rlcConfig;
1153  dtam.logicalChannelIdentity = it->second->m_logicalChannelIdentity;
1154  dtam.logicalChannelConfig = it->second->m_logicalChannelConfig;
1155  rrcd.drbToAddModList.push_back (dtam);
1156  }
1157 
1158  rrcd.havePhysicalConfigDedicated = true;
1160  return rrcd;
1161 }
1162 
1163 uint8_t
1165 {
1167 }
1168 
1169 uint8_t
1171 {
1172  NS_ASSERT (lcid > 2);
1173  return lcid - 2;
1174 }
1175 
1176 uint8_t
1177 UeManager::Drbid2Lcid (uint8_t drbid)
1178 {
1179  return drbid + 2;
1180 }
1181 uint8_t
1182 UeManager::Lcid2Bid (uint8_t lcid)
1183 {
1184  NS_ASSERT (lcid > 2);
1185  return lcid - 2;
1186 }
1187 
1188 uint8_t
1189 UeManager::Bid2Lcid (uint8_t bid)
1190 {
1191  return bid + 2;
1192 }
1193 
1194 uint8_t
1195 UeManager::Drbid2Bid (uint8_t drbid)
1196 {
1197  return drbid;
1198 }
1199 
1200 uint8_t
1202 {
1203  return bid;
1204 }
1205 
1206 
1207 void
1209 {
1210  NS_LOG_FUNCTION (this << ToString (newState));
1211  State oldState = m_state;
1212  m_state = newState;
1213  NS_LOG_INFO (this << " IMSI " << m_imsi << " RNTI " << m_rnti << " UeManager "
1214  << ToString (oldState) << " --> " << ToString (newState));
1215  m_stateTransitionTrace (m_imsi, m_rrc->m_cellId, m_rnti, oldState, newState);
1216 
1217  switch (newState)
1218  {
1219  case INITIAL_RANDOM_ACCESS:
1220  case HANDOVER_JOINING:
1221  NS_FATAL_ERROR ("cannot switch to an initial state");
1222  break;
1223 
1224  case CONNECTION_SETUP:
1225  break;
1226 
1227  case CONNECTED_NORMALLY:
1228  {
1230  {
1232  }
1233  }
1234  break;
1235 
1237  break;
1238 
1240  break;
1241 
1242  case HANDOVER_LEAVING:
1243  break;
1244 
1245  default:
1246  break;
1247  }
1248 }
1249 
1250 
1251 
1253 // eNB RRC methods
1255 
1257 
1259  : m_x2SapProvider (0),
1260  m_cmacSapProvider (0),
1261  m_handoverManagementSapProvider (0),
1262  m_anrSapProvider (0),
1263  m_ffrRrcSapProvider (0),
1264  m_rrcSapUser (0),
1265  m_macSapProvider (0),
1266  m_s1SapProvider (0),
1267  m_cphySapProvider (0),
1268  m_configured (false),
1269  m_lastAllocatedRnti (0),
1270  m_srsCurrentPeriodicityId (0),
1271  m_lastAllocatedConfigurationIndex (0),
1272  m_reconfigureUes (false)
1273 {
1274  NS_LOG_FUNCTION (this);
1283 }
1284 
1285 
1287 {
1288  NS_LOG_FUNCTION (this);
1289 }
1290 
1291 
1292 void
1294 {
1295  NS_LOG_FUNCTION (this);
1296  m_ueMap.clear ();
1297  delete m_cmacSapUser;
1299  delete m_anrSapUser;
1300  delete m_ffrRrcSapUser;
1301  delete m_rrcSapProvider;
1302  delete m_x2SapUser;
1303  delete m_s1SapUser;
1304  delete m_cphySapUser;
1305 }
1306 
1307 TypeId
1309 {
1310  NS_LOG_FUNCTION ("LteEnbRrc::GetTypeId");
1311  static TypeId tid = TypeId ("ns3::LteEnbRrc")
1312  .SetParent<Object> ()
1313  .AddConstructor<LteEnbRrc> ()
1314  .AddAttribute ("UeMap", "List of UeManager by C-RNTI.",
1315  ObjectMapValue (),
1317  MakeObjectMapChecker<UeManager> ())
1318  .AddAttribute ("DefaultTransmissionMode",
1319  "The default UEs' transmission mode (0: SISO)",
1320  UintegerValue (0), // default tx-mode
1321  MakeUintegerAccessor (&LteEnbRrc::m_defaultTransmissionMode),
1322  MakeUintegerChecker<uint8_t> ())
1323  .AddAttribute ("EpsBearerToRlcMapping",
1324  "Specify which type of RLC will be used for each type of EPS bearer. ",
1327  MakeEnumChecker (RLC_SM_ALWAYS, "RlcSmAlways",
1328  RLC_UM_ALWAYS, "RlcUmAlways",
1329  RLC_AM_ALWAYS, "RlcAmAlways",
1330  PER_BASED, "PacketErrorRateBased"))
1331  .AddAttribute ("SystemInformationPeriodicity",
1332  "The interval for sending system information (Time value)",
1333  TimeValue (MilliSeconds (80)),
1334  MakeTimeAccessor (&LteEnbRrc::m_systemInformationPeriodicity),
1335  MakeTimeChecker ())
1336 
1337  // SRS related attributes
1338  .AddAttribute ("SrsPeriodicity",
1339  "The SRS periodicity in milliseconds",
1340  UintegerValue (40),
1341  MakeUintegerAccessor (&LteEnbRrc::SetSrsPeriodicity,
1343  MakeUintegerChecker<uint32_t> ())
1344 
1345  // Timeout related attributes
1346  .AddAttribute ("ConnectionRequestTimeoutDuration",
1347  "After a RA attempt, if no RRC CONNECTION REQUEST is "
1348  "received before this time, the UE context is destroyed. "
1349  "Must account for reception of RAR and transmission of "
1350  "RRC CONNECTION REQUEST over UL GRANT.",
1351  TimeValue (MilliSeconds (15)),
1353  MakeTimeChecker ())
1354  .AddAttribute ("ConnectionSetupTimeoutDuration",
1355  "After accepting connection request, if no RRC CONNECTION "
1356  "SETUP COMPLETE is received before this time, the UE "
1357  "context is destroyed. Must account for the UE's reception "
1358  "of RRC CONNECTION SETUP and transmission of RRC CONNECTION "
1359  "SETUP COMPLETE.",
1360  TimeValue (MilliSeconds (150)),
1361  MakeTimeAccessor (&LteEnbRrc::m_connectionSetupTimeoutDuration),
1362  MakeTimeChecker ())
1363  .AddAttribute ("ConnectionRejectedTimeoutDuration",
1364  "Time to wait between sending a RRC CONNECTION REJECT and "
1365  "destroying the UE context",
1366  TimeValue (MilliSeconds (30)),
1368  MakeTimeChecker ())
1369  .AddAttribute ("HandoverJoiningTimeoutDuration",
1370  "After accepting a handover request, if no RRC CONNECTION "
1371  "RECONFIGURATION COMPLETE is received before this time, the "
1372  "UE context is destroyed. Must account for reception of "
1373  "X2 HO REQ ACK by source eNB, transmission of the Handover "
1374  "Command, non-contention-based random access and reception "
1375  "of the RRC CONNECTION RECONFIGURATION COMPLETE message.",
1376  TimeValue (MilliSeconds (200)),
1377  MakeTimeAccessor (&LteEnbRrc::m_handoverJoiningTimeoutDuration),
1378  MakeTimeChecker ())
1379  .AddAttribute ("HandoverLeavingTimeoutDuration",
1380  "After issuing a Handover Command, if neither RRC "
1381  "CONNECTION RE-ESTABLISHMENT nor X2 UE Context Release has "
1382  "been previously received, the UE context is destroyed.",
1383  TimeValue (MilliSeconds (500)),
1384  MakeTimeAccessor (&LteEnbRrc::m_handoverLeavingTimeoutDuration),
1385  MakeTimeChecker ())
1386 
1387  // Cell selection related attribute
1388  .AddAttribute ("QRxLevMin",
1389  "One of information transmitted within the SIB1 message, "
1390  "indicating the required minimum RSRP level that any UE must "
1391  "receive from this cell before it is allowed to camp to this "
1392  "cell. The default value -70 corresponds to -140 dBm and is "
1393  "the lowest possible value as defined by Section 6.3.4 of "
1394  "3GPP TS 36.133. This restriction, however, only applies to "
1395  "initial cell selection and EPC-enabled simulation.",
1397  IntegerValue (-70),
1398  MakeIntegerAccessor (&LteEnbRrc::m_qRxLevMin),
1399  MakeIntegerChecker<int8_t> (-70, -22))
1400 
1401  // Handover related attributes
1402  .AddAttribute ("AdmitHandoverRequest",
1403  "Whether to admit an X2 handover request from another eNB",
1404  BooleanValue (true),
1405  MakeBooleanAccessor (&LteEnbRrc::m_admitHandoverRequest),
1406  MakeBooleanChecker ())
1407  .AddAttribute ("AdmitRrcConnectionRequest",
1408  "Whether to admit a connection request from a UE",
1409  BooleanValue (true),
1410  MakeBooleanAccessor (&LteEnbRrc::m_admitRrcConnectionRequest),
1411  MakeBooleanChecker ())
1412 
1413  // UE measurements related attributes
1414  .AddAttribute ("RsrpFilterCoefficient",
1415  "Determines the strength of smoothing effect induced by "
1416  "layer 3 filtering of RSRP in all attached UE; "
1417  "if set to 0, no layer 3 filtering is applicable",
1418  // i.e. the variable k in 3GPP TS 36.331 section 5.5.3.2
1419  UintegerValue (4),
1420  MakeUintegerAccessor (&LteEnbRrc::m_rsrpFilterCoefficient),
1421  MakeUintegerChecker<uint8_t> (0))
1422  .AddAttribute ("RsrqFilterCoefficient",
1423  "Determines the strength of smoothing effect induced by "
1424  "layer 3 filtering of RSRQ in all attached UE; "
1425  "if set to 0, no layer 3 filtering is applicable",
1426  // i.e. the variable k in 3GPP TS 36.331 section 5.5.3.2
1427  UintegerValue (4),
1428  MakeUintegerAccessor (&LteEnbRrc::m_rsrqFilterCoefficient),
1429  MakeUintegerChecker<uint8_t> (0))
1430 
1431  // Trace sources
1432  .AddTraceSource ("NewUeContext",
1433  "trace fired upon creation of a new UE context",
1435  .AddTraceSource ("ConnectionEstablished",
1436  "trace fired upon successful RRC connection establishment",
1438  .AddTraceSource ("ConnectionReconfiguration",
1439  "trace fired upon RRC connection reconfiguration",
1441  .AddTraceSource ("HandoverStart",
1442  "trace fired upon start of a handover procedure",
1444  .AddTraceSource ("HandoverEndOk",
1445  "trace fired upon successful termination of a handover procedure",
1447  .AddTraceSource ("RecvMeasurementReport",
1448  "trace fired when measurement report is received",
1450  ;
1451  return tid;
1452 }
1453 
1454 void
1456 {
1457  NS_LOG_FUNCTION (this << s);
1458  m_x2SapProvider = s;
1459 }
1460 
1461 EpcX2SapUser*
1463 {
1464  NS_LOG_FUNCTION (this);
1465  return m_x2SapUser;
1466 }
1467 
1468 void
1470 {
1471  NS_LOG_FUNCTION (this << s);
1472  m_cmacSapProvider = s;
1473 }
1474 
1477 {
1478  NS_LOG_FUNCTION (this);
1479  return m_cmacSapUser;
1480 }
1481 
1482 void
1484 {
1485  NS_LOG_FUNCTION (this << s);
1487 }
1488 
1491 {
1492  NS_LOG_FUNCTION (this);
1494 }
1495 
1496 void
1498 {
1499  NS_LOG_FUNCTION (this << s);
1500  m_anrSapProvider = s;
1501 }
1502 
1505 {
1506  NS_LOG_FUNCTION (this);
1507  return m_anrSapUser;
1508 }
1509 
1510 void
1512 {
1513  NS_LOG_FUNCTION (this << s);
1515 }
1516 
1519 {
1520  NS_LOG_FUNCTION (this);
1521  return m_ffrRrcSapUser;
1522 }
1523 
1524 void
1526 {
1527  NS_LOG_FUNCTION (this << s);
1528  m_rrcSapUser = s;
1529 }
1530 
1533 {
1534  NS_LOG_FUNCTION (this);
1535  return m_rrcSapProvider;
1536 }
1537 
1538 void
1540 {
1541  NS_LOG_FUNCTION (this);
1542  m_macSapProvider = s;
1543 }
1544 
1545 void
1547 {
1548  m_s1SapProvider = s;
1549 }
1550 
1551 
1554 {
1555  return m_s1SapUser;
1556 }
1557 
1558 void
1560 {
1561  NS_LOG_FUNCTION (this << s);
1562  m_cphySapProvider = s;
1563 }
1564 
1567 {
1568  NS_LOG_FUNCTION (this);
1569  return m_cphySapUser;
1570 }
1571 
1572 bool
1573 LteEnbRrc::HasUeManager (uint16_t rnti) const
1574 {
1575  NS_LOG_FUNCTION (this << (uint32_t) rnti);
1576  std::map<uint16_t, Ptr<UeManager> >::const_iterator it = m_ueMap.find (rnti);
1577  return (it != m_ueMap.end ());
1578 }
1579 
1582 {
1583  NS_LOG_FUNCTION (this << (uint32_t) rnti);
1584  NS_ASSERT (0 != rnti);
1585  std::map<uint16_t, Ptr<UeManager> >::iterator it = m_ueMap.find (rnti);
1586  NS_ASSERT_MSG (it != m_ueMap.end (), "RNTI " << rnti << " not found in eNB with cellId " << m_cellId);
1587  return it->second;
1588 }
1589 
1590 uint8_t
1592 {
1593  NS_LOG_FUNCTION (this);
1594 
1595  // SANITY CHECK
1596 
1598  "Measurement identities and reporting configuration should not have different quantity");
1599 
1600  if (Simulator::Now () != Seconds (0))
1601  {
1602  NS_FATAL_ERROR ("AddUeMeasReportConfig may not be called after the simulation has run");
1603  }
1604 
1605  // INPUT VALIDATION
1606 
1607  switch (config.triggerQuantity)
1608  {
1612  {
1613  NS_FATAL_ERROR ("The given triggerQuantity (RSRP) does not match with the given threshold2.choice");
1614  }
1615 
1621  {
1622  NS_FATAL_ERROR ("The given triggerQuantity (RSRP) does not match with the given threshold1.choice");
1623  }
1624  break;
1625 
1629  {
1630  NS_FATAL_ERROR ("The given triggerQuantity (RSRQ) does not match with the given threshold2.choice");
1631  }
1632 
1638  {
1639  NS_FATAL_ERROR ("The given triggerQuantity (RSRQ) does not match with the given threshold1.choice");
1640  }
1641  break;
1642 
1643  default:
1644  NS_FATAL_ERROR ("unsupported triggerQuantity");
1645  break;
1646  }
1647 
1649  {
1650  NS_FATAL_ERROR ("Only REPORT_STRONGEST_CELLS purpose is supported");
1651  }
1652 
1654  {
1655  NS_LOG_WARN ("reportQuantity = BOTH will be used instead of the given reportQuantity");
1656  }
1657 
1658  uint8_t nextId = m_ueMeasConfig.reportConfigToAddModList.size () + 1;
1659 
1660  // create the reporting configuration
1661  LteRrcSap::ReportConfigToAddMod reportConfig;
1662  reportConfig.reportConfigId = nextId;
1663  reportConfig.reportConfigEutra = config;
1664 
1665  // create the measurement identity
1667  measId.measId = nextId;
1668  measId.measObjectId = 1;
1669  measId.reportConfigId = nextId;
1670 
1671  // add both to the list of UE measurement configuration
1672  m_ueMeasConfig.reportConfigToAddModList.push_back (reportConfig);
1673  m_ueMeasConfig.measIdToAddModList.push_back (measId);
1674 
1675  return nextId;
1676 }
1677 
1678 void
1679 LteEnbRrc::ConfigureCell (uint8_t ulBandwidth, uint8_t dlBandwidth,
1680  uint16_t ulEarfcn, uint16_t dlEarfcn, uint16_t cellId)
1681 {
1682  NS_LOG_FUNCTION (this << (uint16_t) ulBandwidth << (uint16_t) dlBandwidth
1683  << ulEarfcn << dlEarfcn << cellId);
1685  m_cmacSapProvider->ConfigureMac (ulBandwidth, dlBandwidth);
1686  m_cphySapProvider->SetBandwidth (ulBandwidth, dlBandwidth);
1687  m_cphySapProvider->SetEarfcn (ulEarfcn, dlEarfcn);
1688  m_dlEarfcn = dlEarfcn;
1689  m_ulEarfcn = ulEarfcn;
1690  m_dlBandwidth = dlBandwidth;
1691  m_ulBandwidth = ulBandwidth;
1692  m_cellId = cellId;
1693  m_cphySapProvider->SetCellId (cellId);
1694  m_ffrRrcSapProvider->SetCellId (cellId);
1695  m_ffrRrcSapProvider->SetBandwidth(ulBandwidth, dlBandwidth);
1696 
1697  /*
1698  * Initializing the list of UE measurement configuration (m_ueMeasConfig).
1699  * Only intra-frequency measurements are supported, so only one measurement
1700  * object is created.
1701  */
1702 
1703  LteRrcSap::MeasObjectToAddMod measObject;
1704  measObject.measObjectId = 1;
1705  measObject.measObjectEutra.carrierFreq = m_dlEarfcn;
1707  measObject.measObjectEutra.presenceAntennaPort1 = false;
1708  measObject.measObjectEutra.neighCellConfig = 0;
1709  measObject.measObjectEutra.offsetFreq = 0;
1710  measObject.measObjectEutra.haveCellForWhichToReportCGI = false;
1711 
1712  m_ueMeasConfig.measObjectToAddModList.push_back (measObject);
1717  m_ueMeasConfig.haveSmeasure = false;
1719 
1720  // Enabling MIB transmission
1722  mib.dlBandwidth = m_dlBandwidth;
1724 
1725  // Enabling SIB1 transmission with default values
1730  m_sib1.cellSelectionInfo.qQualMin = -34; // not used, set as minimum value
1731  m_sib1.cellSelectionInfo.qRxLevMin = m_qRxLevMin; // set as minimum value
1733 
1734  /*
1735  * Enabling transmission of other SIB. The first time System Information is
1736  * transmitted is arbitrarily assumed to be at +0.016s, and then it will be
1737  * regularly transmitted every 80 ms by default (set the
1738  * SystemInformationPeriodicity attribute to configure this).
1739  */
1741 
1742  m_configured = true;
1743 
1744 }
1745 
1746 
1747 void
1748 LteEnbRrc::SetCellId (uint16_t cellId)
1749 {
1750  m_cellId = cellId;
1751 
1752  // update SIB1 too
1755 }
1756 
1757 bool
1759 {
1760  NS_LOG_FUNCTION (this << packet);
1761 
1762  EpsBearerTag tag;
1763  bool found = packet->RemovePacketTag (tag);
1764  NS_ASSERT_MSG (found, "no EpsBearerTag found in packet to be sent");
1765  Ptr<UeManager> ueManager = GetUeManager (tag.GetRnti ());
1766  ueManager->SendData (tag.GetBid (), packet);
1767 
1768  return true;
1769 }
1770 
1771 void
1773 {
1774  m_forwardUpCallback = cb;
1775 }
1776 
1777 void
1779 {
1780  NS_LOG_FUNCTION (this << rnti);
1782  "ConnectionRequestTimeout in unexpected state " << ToString (GetUeManager (rnti)->GetState ()));
1783  RemoveUe (rnti);
1784 }
1785 
1786 void
1788 {
1789  NS_LOG_FUNCTION (this << rnti);
1790  NS_ASSERT_MSG (GetUeManager (rnti)->GetState () == UeManager::CONNECTION_SETUP,
1791  "ConnectionSetupTimeout in unexpected state " << ToString (GetUeManager (rnti)->GetState ()));
1792  RemoveUe (rnti);
1793 }
1794 
1795 void
1797 {
1798  NS_LOG_FUNCTION (this << rnti);
1800  "ConnectionRejectedTimeout in unexpected state " << ToString (GetUeManager (rnti)->GetState ()));
1801  RemoveUe (rnti);
1802 }
1803 
1804 void
1806 {
1807  NS_LOG_FUNCTION (this << rnti);
1808  NS_ASSERT_MSG (GetUeManager (rnti)->GetState () == UeManager::HANDOVER_JOINING,
1809  "HandoverJoiningTimeout in unexpected state " << ToString (GetUeManager (rnti)->GetState ()));
1810  RemoveUe (rnti);
1811 }
1812 
1813 void
1815 {
1816  NS_LOG_FUNCTION (this << rnti);
1817  NS_ASSERT_MSG (GetUeManager (rnti)->GetState () == UeManager::HANDOVER_LEAVING,
1818  "HandoverLeavingTimeout in unexpected state " << ToString (GetUeManager (rnti)->GetState ()));
1819  RemoveUe (rnti);
1820 }
1821 
1822 void
1823 LteEnbRrc::SendHandoverRequest (uint16_t rnti, uint16_t cellId)
1824 {
1825  NS_LOG_FUNCTION (this << rnti << cellId);
1826  NS_LOG_LOGIC ("Request to send HANDOVER REQUEST");
1828 
1829  Ptr<UeManager> ueManager = GetUeManager (rnti);
1830  ueManager->PrepareHandover (cellId);
1831 
1832 }
1833 
1834 void
1836 {
1837  NS_LOG_FUNCTION (this << rnti);
1838  GetUeManager (rnti)->CompleteSetupUe (params);
1839 }
1840 
1841 void
1843 {
1844  NS_LOG_FUNCTION (this << rnti);
1845  GetUeManager (rnti)->RecvRrcConnectionRequest (msg);
1846 }
1847 
1848 void
1850 {
1851  NS_LOG_FUNCTION (this << rnti);
1852  GetUeManager (rnti)->RecvRrcConnectionSetupCompleted (msg);
1853 }
1854 
1855 void
1857 {
1858  NS_LOG_FUNCTION (this << rnti);
1859  GetUeManager (rnti)->RecvRrcConnectionReconfigurationCompleted (msg);
1860 }
1861 
1862 void
1864 {
1865  NS_LOG_FUNCTION (this << rnti);
1866  GetUeManager (rnti)->RecvRrcConnectionReestablishmentRequest (msg);
1867 }
1868 
1869 void
1871 {
1872  NS_LOG_FUNCTION (this << rnti);
1873  GetUeManager (rnti)->RecvRrcConnectionReestablishmentComplete (msg);
1874 }
1875 
1876 void
1878 {
1879  NS_LOG_FUNCTION (this << rnti);
1880  GetUeManager (rnti)->RecvMeasurementReport (msg);
1881 }
1882 
1883 void
1885 {
1886  Ptr<UeManager> ueManager = GetUeManager (request.rnti);
1887  ueManager->SetupDataRadioBearer (request.bearer, request.bearerId, request.gtpTeid, request.transportLayerAddress);
1888 }
1889 
1890 void
1892 {
1893  Ptr<UeManager> ueManager = GetUeManager (params.rnti);
1894  ueManager->SendUeContextRelease ();
1895 }
1896 
1897 void
1899 {
1900  NS_LOG_FUNCTION (this);
1901 
1902  NS_LOG_LOGIC ("Recv X2 message: HANDOVER REQUEST");
1903 
1904  NS_LOG_LOGIC ("oldEnbUeX2apId = " << req.oldEnbUeX2apId);
1905  NS_LOG_LOGIC ("sourceCellId = " << req.sourceCellId);
1906  NS_LOG_LOGIC ("targetCellId = " << req.targetCellId);
1907  NS_LOG_LOGIC ("mmeUeS1apId = " << req.mmeUeS1apId);
1908 
1909  NS_ASSERT (req.targetCellId == m_cellId);
1910 
1911  if (m_admitHandoverRequest == false)
1912  {
1913  NS_LOG_INFO ("rejecting handover request from cellId " << req.sourceCellId);
1915  res.oldEnbUeX2apId = req.oldEnbUeX2apId;
1916  res.sourceCellId = req.sourceCellId;
1917  res.targetCellId = req.targetCellId;
1918  res.cause = 0;
1919  res.criticalityDiagnostics = 0;
1921  return;
1922  }
1923 
1924  uint16_t rnti = AddUe (UeManager::HANDOVER_JOINING);
1926  if (anrcrv.valid == false)
1927  {
1928  NS_LOG_INFO (this << " failed to allocate a preamble for non-contention based RA => cannot accept HO");
1929  RemoveUe (rnti);
1930  NS_FATAL_ERROR ("should trigger HO Preparation Failure, but it is not implemented");
1931  return;
1932  }
1933 
1934  Ptr<UeManager> ueManager = GetUeManager (rnti);
1935  ueManager->SetSource (req.sourceCellId, req.oldEnbUeX2apId);
1936  ueManager->SetImsi (req.mmeUeS1apId);
1937 
1939  ackParams.oldEnbUeX2apId = req.oldEnbUeX2apId;
1940  ackParams.newEnbUeX2apId = rnti;
1941  ackParams.sourceCellId = req.sourceCellId;
1942  ackParams.targetCellId = req.targetCellId;
1943 
1944  for (std::vector <EpcX2Sap::ErabToBeSetupItem>::iterator it = req.bearers.begin ();
1945  it != req.bearers.end ();
1946  ++it)
1947  {
1948  ueManager->SetupDataRadioBearer (it->erabLevelQosParameters, it->erabId, it->gtpTeid, it->transportLayerAddress);
1950  i.erabId = it->erabId;
1951  ackParams.admittedBearers.push_back (i);
1952  }
1953 
1954  LteRrcSap::RrcConnectionReconfiguration handoverCommand = ueManager->GetRrcConnectionReconfigurationForHandover ();
1955  handoverCommand.haveMobilityControlInfo = true;
1956  handoverCommand.mobilityControlInfo.targetPhysCellId = m_cellId;
1957  handoverCommand.mobilityControlInfo.haveCarrierFreq = true;
1960  handoverCommand.mobilityControlInfo.haveCarrierBandwidth = true;
1963  handoverCommand.mobilityControlInfo.newUeIdentity = rnti;
1964  handoverCommand.mobilityControlInfo.haveRachConfigDedicated = true;
1967 
1972 
1973  Ptr<Packet> encodedHandoverCommand = m_rrcSapUser->EncodeHandoverCommand (handoverCommand);
1974 
1975  ackParams.rrcContext = encodedHandoverCommand;
1976 
1977  NS_LOG_LOGIC ("Send X2 message: HANDOVER REQUEST ACK");
1978 
1979  NS_LOG_LOGIC ("oldEnbUeX2apId = " << ackParams.oldEnbUeX2apId);
1980  NS_LOG_LOGIC ("newEnbUeX2apId = " << ackParams.newEnbUeX2apId);
1981  NS_LOG_LOGIC ("sourceCellId = " << ackParams.sourceCellId);
1982  NS_LOG_LOGIC ("targetCellId = " << ackParams.targetCellId);
1983 
1985 }
1986 
1987 void
1989 {
1990  NS_LOG_FUNCTION (this);
1991 
1992  NS_LOG_LOGIC ("Recv X2 message: HANDOVER REQUEST ACK");
1993 
1994  NS_LOG_LOGIC ("oldEnbUeX2apId = " << params.oldEnbUeX2apId);
1995  NS_LOG_LOGIC ("newEnbUeX2apId = " << params.newEnbUeX2apId);
1996  NS_LOG_LOGIC ("sourceCellId = " << params.sourceCellId);
1997  NS_LOG_LOGIC ("targetCellId = " << params.targetCellId);
1998 
1999  uint16_t rnti = params.oldEnbUeX2apId;
2000  Ptr<UeManager> ueManager = GetUeManager (rnti);
2001  ueManager->RecvHandoverRequestAck (params);
2002 }
2003 
2004 void
2006 {
2007  NS_LOG_FUNCTION (this);
2008 
2009  NS_LOG_LOGIC ("Recv X2 message: HANDOVER PREPARATION FAILURE");
2010 
2011  NS_LOG_LOGIC ("oldEnbUeX2apId = " << params.oldEnbUeX2apId);
2012  NS_LOG_LOGIC ("sourceCellId = " << params.sourceCellId);
2013  NS_LOG_LOGIC ("targetCellId = " << params.targetCellId);
2014  NS_LOG_LOGIC ("cause = " << params.cause);
2015  NS_LOG_LOGIC ("criticalityDiagnostics = " << params.criticalityDiagnostics);
2016 
2017  uint16_t rnti = params.oldEnbUeX2apId;
2018  Ptr<UeManager> ueManager = GetUeManager (rnti);
2019  ueManager->RecvHandoverPreparationFailure (params.targetCellId);
2020 }
2021 
2022 void
2024 {
2025  NS_LOG_FUNCTION (this);
2026 
2027  NS_LOG_LOGIC ("Recv X2 message: SN STATUS TRANSFER");
2028 
2029  NS_LOG_LOGIC ("oldEnbUeX2apId = " << params.oldEnbUeX2apId);
2030  NS_LOG_LOGIC ("newEnbUeX2apId = " << params.newEnbUeX2apId);
2031  NS_LOG_LOGIC ("erabsSubjectToStatusTransferList size = " << params.erabsSubjectToStatusTransferList.size ());
2032 
2033  uint16_t rnti = params.newEnbUeX2apId;
2034  Ptr<UeManager> ueManager = GetUeManager (rnti);
2035  ueManager->RecvSnStatusTransfer (params);
2036 }
2037 
2038 void
2040 {
2041  NS_LOG_FUNCTION (this);
2042 
2043  NS_LOG_LOGIC ("Recv X2 message: UE CONTEXT RELEASE");
2044 
2045  NS_LOG_LOGIC ("oldEnbUeX2apId = " << params.oldEnbUeX2apId);
2046  NS_LOG_LOGIC ("newEnbUeX2apId = " << params.newEnbUeX2apId);
2047 
2048  uint16_t rnti = params.oldEnbUeX2apId;
2049  GetUeManager (rnti)->RecvUeContextRelease (params);
2050  RemoveUe (rnti);
2051 }
2052 
2053 void
2055 {
2056  NS_LOG_FUNCTION (this);
2057 
2058  NS_LOG_LOGIC ("Recv X2 message: LOAD INFORMATION");
2059 
2060  NS_LOG_LOGIC ("Number of cellInformationItems = " << params.cellInformationList.size ());
2061 
2063 }
2064 
2065 void
2067 {
2068  NS_LOG_FUNCTION (this);
2069 
2070  NS_LOG_LOGIC ("Recv X2 message: RESOURCE STATUS UPDATE");
2071 
2072  NS_LOG_LOGIC ("Number of cellMeasurementResultItems = " << params.cellMeasurementResultList.size ());
2073 
2074  NS_ASSERT ("Processing of RESOURCE STATUS UPDATE X2 message IS NOT IMPLEMENTED");
2075 }
2076 
2077 void
2079 {
2080  NS_LOG_FUNCTION (this);
2081 
2082  NS_LOG_LOGIC ("Recv UE DATA FORWARDING through X2 interface");
2083  NS_LOG_LOGIC ("sourceCellId = " << params.sourceCellId);
2084  NS_LOG_LOGIC ("targetCellId = " << params.targetCellId);
2085  NS_LOG_LOGIC ("gtpTeid = " << params.gtpTeid);
2086  NS_LOG_LOGIC ("ueData = " << params.ueData);
2087  NS_LOG_LOGIC ("ueData size = " << params.ueData->GetSize ());
2088 
2089  std::map<uint32_t, X2uTeidInfo>::iterator
2090  teidInfoIt = m_x2uTeidInfoMap.find (params.gtpTeid);
2091  if (teidInfoIt != m_x2uTeidInfoMap.end ())
2092  {
2093  GetUeManager (teidInfoIt->second.rnti)->SendData (teidInfoIt->second.drbid, params.ueData);
2094  }
2095  else
2096  {
2097  NS_FATAL_ERROR ("X2-U data received but no X2uTeidInfo found");
2098  }
2099 }
2100 
2101 
2102 uint16_t
2104 {
2105  NS_LOG_FUNCTION (this);
2107 }
2108 
2109 void
2111 {
2112  Ptr<UeManager> ueManager = GetUeManager (cmacParams.m_rnti);
2113  ueManager->CmacUeConfigUpdateInd (cmacParams);
2114 }
2115 
2116 void
2117 LteEnbRrc::DoNotifyLcConfigResult (uint16_t rnti, uint8_t lcid, bool success)
2118 {
2119  NS_LOG_FUNCTION (this << (uint32_t) rnti);
2120  NS_FATAL_ERROR ("not implemented");
2121 }
2122 
2123 
2124 uint8_t
2126 {
2127  NS_LOG_FUNCTION (this);
2128  uint8_t measId = AddUeMeasReportConfig (reportConfig);
2129  m_handoverMeasIds.insert (measId);
2130  return measId;
2131 }
2132 
2133 void
2134 LteEnbRrc::DoTriggerHandover (uint16_t rnti, uint16_t targetCellId)
2135 {
2136  NS_LOG_FUNCTION (this << rnti << targetCellId);
2137 
2138  bool isHandoverAllowed = true;
2139 
2140  if (m_anrSapProvider != 0)
2141  {
2142  // ensure that proper neighbour relationship exists between source and target cells
2143  bool noHo = m_anrSapProvider->GetNoHo (targetCellId);
2144  bool noX2 = m_anrSapProvider->GetNoX2 (targetCellId);
2145  NS_LOG_DEBUG (this << " cellId=" << m_cellId
2146  << " targetCellId=" << targetCellId
2147  << " NRT.NoHo=" << noHo << " NRT.NoX2=" << noX2);
2148 
2149  if (noHo || noX2)
2150  {
2151  isHandoverAllowed = false;
2152  NS_LOG_LOGIC (this << " handover to cell " << targetCellId
2153  << " is not allowed by ANR");
2154  }
2155  }
2156 
2157  Ptr<UeManager> ueManager = GetUeManager (rnti);
2158  NS_ASSERT_MSG (ueManager != 0, "Cannot find UE context with RNTI " << rnti);
2159 
2160  if (ueManager->GetState () != UeManager::CONNECTED_NORMALLY)
2161  {
2162  isHandoverAllowed = false;
2163  NS_LOG_LOGIC (this << " handover is not allowed because the UE"
2164  << " rnti=" << rnti << " is in "
2165  << ToString (ueManager->GetState ()) << " state");
2166  }
2167 
2168  if (isHandoverAllowed)
2169  {
2170  // initiate handover execution
2171  ueManager->PrepareHandover (targetCellId);
2172  }
2173 }
2174 
2175 uint8_t
2177 {
2178  NS_LOG_FUNCTION (this);
2179  uint8_t measId = AddUeMeasReportConfig (reportConfig);
2180  m_anrMeasIds.insert (measId);
2181  return measId;
2182 }
2183 
2184 uint8_t
2186 {
2187  NS_LOG_FUNCTION (this);
2188  uint8_t measId = AddUeMeasReportConfig (reportConfig);
2189  m_ffrMeasIds.insert (measId);
2190  return measId;
2191 }
2192 
2193 void
2195 {
2196  NS_LOG_FUNCTION (this);
2197  Ptr<UeManager> ueManager = GetUeManager (rnti);
2198  ueManager->SetPdschConfigDedicated (pdschConfigDedicated);
2199 }
2200 
2201 void
2203 {
2204  NS_LOG_FUNCTION (this);
2205 
2207 }
2208 
2209 uint16_t
2211 {
2212  NS_LOG_FUNCTION (this);
2213  bool found = false;
2214  uint16_t rnti;
2215  for (rnti = m_lastAllocatedRnti + 1;
2216  (rnti != m_lastAllocatedRnti - 1) && (!found);
2217  ++rnti)
2218  {
2219  if ((rnti != 0) && (m_ueMap.find (rnti) == m_ueMap.end ()))
2220  {
2221  found = true;
2222  break;
2223  }
2224  }
2225 
2226  NS_ASSERT_MSG (found, "no more RNTIs available (do you have more than 65535 UEs in a cell?)");
2227  m_lastAllocatedRnti = rnti;
2228  Ptr<UeManager> ueManager = CreateObject<UeManager> (this, rnti, state);
2229  m_ueMap.insert (std::pair<uint16_t, Ptr<UeManager> > (rnti, ueManager));
2230  ueManager->Initialize ();
2231  NS_LOG_DEBUG (this << " New UE RNTI " << rnti << " cellId " << m_cellId << " srs CI " << ueManager->GetSrsConfigurationIndex ());
2232  m_newUeContextTrace (m_cellId, rnti);
2233  return rnti;
2234 }
2235 
2236 void
2237 LteEnbRrc::RemoveUe (uint16_t rnti)
2238 {
2239  NS_LOG_FUNCTION (this << (uint32_t) rnti);
2240  std::map <uint16_t, Ptr<UeManager> >::iterator it = m_ueMap.find (rnti);
2241  NS_ASSERT_MSG (it != m_ueMap.end (), "request to remove UE info with unknown rnti " << rnti);
2242  uint16_t srsCi = (*it).second->GetSrsConfigurationIndex ();
2243  m_ueMap.erase (it);
2244  m_cmacSapProvider->RemoveUe (rnti);
2245  m_cphySapProvider->RemoveUe (rnti);
2246  if (m_s1SapProvider != 0)
2247  {
2249  }
2250  // need to do this after UeManager has been deleted
2251  RemoveSrsConfigurationIndex (srsCi);
2252 }
2253 
2254 TypeId
2256 {
2257  switch (m_epsBearerToRlcMapping)
2258  {
2259  case RLC_SM_ALWAYS:
2260  return LteRlcSm::GetTypeId ();
2261  break;
2262 
2263  case RLC_UM_ALWAYS:
2264  return LteRlcUm::GetTypeId ();
2265  break;
2266 
2267  case RLC_AM_ALWAYS:
2268  return LteRlcAm::GetTypeId ();
2269  break;
2270 
2271  case PER_BASED:
2272  if (bearer.GetPacketErrorLossRate () > 1.0e-5)
2273  {
2274  return LteRlcUm::GetTypeId ();
2275  }
2276  else
2277  {
2278  return LteRlcAm::GetTypeId ();
2279  }
2280  break;
2281 
2282  default:
2283  return LteRlcSm::GetTypeId ();
2284  break;
2285  }
2286 }
2287 
2288 
2289 void
2290 LteEnbRrc::AddX2Neighbour (uint16_t cellId)
2291 {
2292  NS_LOG_FUNCTION (this << cellId);
2293 
2294  if (m_anrSapProvider != 0)
2295  {
2297  }
2298 }
2299 
2300 void
2301 LteEnbRrc::SetCsgId (uint32_t csgId, bool csgIndication)
2302 {
2303  NS_LOG_FUNCTION (this << csgId << csgIndication);
2305  m_sib1.cellAccessRelatedInfo.csgIndication = csgIndication;
2307 }
2308 
2309 
2310 // from 3GPP TS 36.213 table 8.2-1 UE Specific SRS Periodicity
2311 static const uint8_t SRS_ENTRIES = 9;
2312 static const uint16_t g_srsPeriodicity[SRS_ENTRIES] = {0, 2, 5, 10, 20, 40, 80, 160, 320};
2313 static const uint16_t g_srsCiLow[SRS_ENTRIES] = {0, 0, 2, 7, 17, 37, 77, 157, 317};
2314 static const uint16_t g_srsCiHigh[SRS_ENTRIES] = {0, 1, 6, 16, 36, 76, 156, 316, 636};
2315 
2316 void
2318 {
2319  NS_LOG_FUNCTION (this << p);
2320  for (uint32_t id = 1; id < SRS_ENTRIES; ++id)
2321  {
2322  if (g_srsPeriodicity[id] == p)
2323  {
2325  return;
2326  }
2327  }
2328  // no match found
2329  std::ostringstream allowedValues;
2330  for (uint32_t id = 1; id < SRS_ENTRIES; ++id)
2331  {
2332  allowedValues << g_srsPeriodicity[id] << " ";
2333  }
2334  NS_FATAL_ERROR ("illecit SRS periodicity value " << p << ". Allowed values: " << allowedValues.str ());
2335 }
2336 
2337 uint32_t
2339 {
2340  NS_LOG_FUNCTION (this);
2344 }
2345 
2346 
2347 uint16_t
2349 {
2351  // SRS
2354  NS_LOG_DEBUG (this << " SRS p " << g_srsPeriodicity[m_srsCurrentPeriodicityId] << " set " << m_ueSrsConfigurationIndexSet.size ());
2356  {
2357  NS_FATAL_ERROR ("too many UEs (" << m_ueSrsConfigurationIndexSet.size () + 1
2358  << ") for current SRS periodicity "
2360  << ", consider increasing the value of ns3::LteEnbRrc::SrsPeriodicity");
2361  }
2362 
2363  if (m_ueSrsConfigurationIndexSet.empty ())
2364  {
2365  // first entry
2368  }
2369  else
2370  {
2371  // find a CI from the available ones
2372  std::set<uint16_t>::reverse_iterator rit = m_ueSrsConfigurationIndexSet.rbegin ();
2373  NS_ASSERT (rit != m_ueSrsConfigurationIndexSet.rend ());
2374  NS_LOG_DEBUG (this << " lower bound " << (*rit) << " of " << g_srsCiHigh[m_srsCurrentPeriodicityId]);
2375  if ((*rit) < g_srsCiHigh[m_srsCurrentPeriodicityId])
2376  {
2377  // got it from the upper bound
2378  m_lastAllocatedConfigurationIndex = (*rit) + 1;
2380  }
2381  else
2382  {
2383  // look for released ones
2384  for (uint16_t srcCi = g_srsCiLow[m_srsCurrentPeriodicityId]; srcCi < g_srsCiHigh[m_srsCurrentPeriodicityId]; srcCi++)
2385  {
2386  std::set<uint16_t>::iterator it = m_ueSrsConfigurationIndexSet.find (srcCi);
2387  if (it==m_ueSrsConfigurationIndexSet.end ())
2388  {
2390  m_ueSrsConfigurationIndexSet.insert (srcCi);
2391  break;
2392  }
2393  }
2394  }
2395  }
2397 
2398 }
2399 
2400 
2401 void
2403 {
2404  NS_LOG_FUNCTION (this << srcCi);
2405  std::set<uint16_t>::iterator it = m_ueSrsConfigurationIndexSet.find (srcCi);
2406  NS_ASSERT_MSG (it != m_ueSrsConfigurationIndexSet.end (), "request to remove unkwown SRS CI " << srcCi);
2407  m_ueSrsConfigurationIndexSet.erase (it);
2408 }
2409 
2410 uint8_t
2412 {
2413  if (bearer.IsGbr ())
2414  {
2415  return 1;
2416  }
2417  else
2418  {
2419  return 2;
2420  }
2421 }
2422 
2423 uint8_t
2425 {
2426  return bearer.qci;
2427 }
2428 
2429 void
2431 {
2432  // NS_LOG_FUNCTION (this);
2433 
2434  /*
2435  * For simplicity, we use the same periodicity for all SIBs. Note that in real
2436  * systems the periodicy of each SIBs could be different.
2437  */
2439  si.haveSib2 = true;
2444 
2446  LteRrcSap::RachConfigCommon rachConfigCommon;
2448  rachConfigCommon.raSupervisionInfo.preambleTransMax = rc.preambleTransMax;
2450  si.sib2.radioResourceConfigCommon.rachConfigCommon = rachConfigCommon;
2451 
2454 }
2455 
2456 
2457 } // namespace ns3
2458 
virtual void AddNeighbourRelation(uint16_t cellId)=0
Add a new Neighbour Relation entry.
Callback< void, Ptr< Packet > > m_forwardUpCallback
Definition: lte-enb-rrc.h:919
Ipv4Address transportLayerAddress
IP Address of the SGW, see 36.423 9.2.1.
static const uint8_t SRS_ENTRIES
virtual void SetMasterInformationBlock(LteRrcSap::MasterInformationBlock mib)=0
TracedCallback< uint64_t, uint16_t, uint16_t, State, State > m_stateTransitionTrace
Definition: lte-enb-rrc.h:414
TracedCallback< uint64_t, uint16_t, uint16_t > m_handoverEndOkTrace
Definition: lte-enb-rrc.h:1018
RSRQ is used for the threshold.
Definition: lte-rrc-sap.h:315
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...
bool HasUeManager(uint16_t rnti) const
SystemInformationBlockType2 sourceSystemInformationBlockType2
Definition: lte-rrc-sap.h:553
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...
Service Access Point (SAP) offered by the Frequency Reuse algorithm instance to the eNodeB RRC instan...
void SetEpcX2SapProvider(EpcX2SapProvider *s)
Set the X2 SAP this RRC should interact with.
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...
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:95
Ptr< LteSignalingRadioBearerInfo > m_srb1
Definition: lte-enb-rrc.h:403
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
LteRrcSap::RadioResourceConfigDedicated GetRadioResourceConfigForHandoverPreparationInfo()
Definition: lte-enb-rrc.cc:609
smart pointer class similar to boost::intrusive_ptr
Definition: ptr.h:60
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:340
#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
uint16_t AddUe(UeManager::State state)
Allocate a new RNTI for a new UE.
PdschConfigDedicated pdschConfigDedicated
Definition: lte-rrc-sap.h:204
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)
Definition: enum.cc:178
State
The state of the UeManager at the eNB RRC.
Definition: lte-enb-rrc.h:72
Hold a bool native type.
Definition: boolean.h:38
Callback template class.
Definition: callback.h:972
void RecordDataRadioBearersToBeStarted()
Start all configured data radio bearers.
Definition: lte-enb-rrc.cc:415
virtual void DoDispose()
This method is called by Object::Dispose or by the object's destructor, whichever comes first...
Definition: lte-enb-rrc.cc:269
uint16_t m_dlBandwidth
Definition: lte-enb-rrc.h:951
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:752
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:313
std::list< MeasObjectToAddMod > measObjectToAddModList
Definition: lte-rrc-sap.h:463
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:715
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register the class in the ns-3 factory.
Definition: object-base.h:38
void DoNotifyLcConfigResult(uint16_t rnti, uint8_t lcid, bool success)
enum ns3::LteRrcSap::ReportConfigEutra::@74 purpose
uint16_t m_rnti
UE id within this cell.
static double ConvertPdschConfigDedicated2Double(PdschConfigDedicated pdschConfigDedicated)
Definition: lte-rrc-sap.h:162
SoundingRsUlConfigDedicated soundingRsUlConfigDedicated
Definition: lte-rrc-sap.h:200
LteFfrRrcSapProvider * m_ffrRrcSapProvider
Definition: lte-enb-rrc.h:934
virtual void SetEarfcn(uint16_t ulEarfcn, uint16_t dlEarfcn)=0
static TypeId GetTypeId(void)
Definition: lte-rlc.cc:183
void SetCellId(uint16_t m_cellId)
set the cell id of this eNB
LteFfrRrcSapUser * m_ffrRrcSapUser
Definition: lte-enb-rrc.h:933
uint8_t GetLogicalChannelGroup(EpsBearer bearer)
uint8_t m_transmissionMode
Transmission mode 1..7
void AddX2Neighbour(uint16_t cellId)
Add a neighbour with an X2 interface.
QuantityConfig quantityConfig
Definition: lte-rrc-sap.h:469
uint8_t Drbid2Bid(uint8_t drbid)
uint16_t txSn
TX sequence number.
Definition: lte-pdcp.h:97
uint16_t rnti
the RNTI identifying the UE for which the DataRadioBearer is to be created
bool m_admitHandoverRequest
Definition: lte-enb-rrc.h:995
std::vector< CellMeasurementResultItem > cellMeasurementResultList
Definition: epc-x2-sap.h:316
friend class EnbRrcMemberLteEnbCmacSapUser
Definition: lte-enb-rrc.h:439
std::list< MeasResultEutra > measResultListEutra
Definition: lte-rrc-sap.h:582
Parameters of the HANDOVER REQUEST message.
Definition: epc-x2-sap.h:225
int8_t qRxLevMin
INTEGER (-70..-22), actual value = IE value * 2 [dBm].
Definition: lte-rrc-sap.h:82
Part of the RRC protocol.
Definition: lte-rrc-sap.h:903
ThresholdEutra threshold1
Threshold for event A1, A2, A4, and A5.
Definition: lte-rrc-sap.h:339
void DoRecvRrcConnectionReconfigurationCompleted(uint16_t rnti, LteRrcSap::RrcConnectionReconfigurationCompleted msg)
Part of the RRC protocol. Forwarding LteEnbRrcSapProvider::RecvRrcConnectionReconfigurationCompleted ...
Template for the implementation of the LteHandoverManagementSapUser as a member of an owner class of ...
Status variables of the PDCP.
Definition: lte-pdcp.h:95
Class for forwarding CMAC SAP User functions.
Definition: lte-enb-rrc.cc:60
void AddPacketTag(const Tag &tag) const
Add a packet tag.
Definition: packet.cc:841
Specifies criteria for triggering of an E-UTRA measurement reporting event.
Definition: lte-rrc-sap.h:321
void SetCsgId(uint32_t csgId, bool csgIndication)
Associate this RRC entity with a particular CSG information.
uint16_t GetSrsConfigurationIndex(void) const
uint8_t qci
QoS Class Identifier.
static TypeId GetTypeId(void)
uint16_t m_sourceCellId
Definition: lte-enb-rrc.h:416
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:61
uint16_t m_rnti
Definition: lte-enb-rrc.h:405
std::list< SrbToAddMod > srbToAddModList
Definition: lte-rrc-sap.h:253
Hold a signed integer type.
Definition: integer.h:45
uint8_t Lcid2Bid(uint8_t lcid)
virtual void SendHandoverPreparationFailure(HandoverPreparationFailureParams params)=0
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
Definition: lte-rrc-sap.h:611
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:170
void SetLteEnbCphySapProvider(LteEnbCphySapProvider *s)
set the CPHY SAP this RRC should use to interact with the PHY
uint16_t m_lastAllocatedRnti
Definition: lte-enb-rrc.h:953
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition: nstime.h:853
uint16_t GetNewSrsConfigurationIndex(void)
Allocate a new SRS configuration index for a new UE.
void SetTypeId(TypeId tid)
std::list< BearerToBeSwitched > bearersToBeSwitched
uint32_t GetSize(void) const
Returns the the size in bytes of the packet (including the zero-filled initial payload).
Definition: packet.h:744
LteEnbCmacSapUser * GetLteEnbCmacSapUser()
Get the CMAC SAP offered by this RRC.
uint8_t m_transmissionMode
Transmission mode 1..7
Tag used to define the RNTI and EPS bearer ID for packets interchanged between the EpcEnbApplication ...
uint16_t m_ulBandwidth
Definition: lte-enb-rrc.h:952
uint8_t m_lastRrcTransactionIdentifier
Definition: lte-enb-rrc.h:407
uint16_t m_srsCurrentPeriodicityId
Definition: lte-enb-rrc.h:986
The LTE Radio Resource Control entity at the eNB.
Definition: lte-enb-rrc.h:436
void SetLteEnbRrcSapUser(LteEnbRrcSapUser *s)
set the RRC SAP this RRC should interact with
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:223
uint16_t DoAllocateTemporaryCellRnti()
#define NS_FATAL_ERROR(msg)
fatal error handling
Definition: fatal-error.h:95
Ptr< const AttributeAccessor > MakeObjectMapAccessor(U T::*memberContainer)
Definition: object-map.h:51
uint64_t m_imsi
Definition: lte-enb-rrc.h:406
enum ns3::LteRrcSap::ReportConfigEutra::@76 reportQuantity
The quantities to be included in the measurement report, always assumed to be BOTH.
virtual uint16_t AllocateTemporaryCellRnti()
request the allocation of a Temporary C-RNTI
Definition: lte-enb-rrc.cc:79
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 set up
The attribute can be written at construction-time.
Definition: type-id.h:58
Time m_handoverLeavingTimeoutDuration
Definition: lte-enb-rrc.h:1007
uint64_t mbrDl
maximum bitrate in downlink
void SetBid(uint8_t bid)
Set the bearer id to the given value.
static EventId Schedule(Time const &time, MEM mem_ptr, OBJ obj)
Schedule an event to expire at the relative time "time" is reached.
Definition: simulator.h:825
uint8_t GetBid(void) const
Time m_connectionRejectedTimeoutDuration
Definition: lte-enb-rrc.h:1005
LteMacSapProvider * m_macSapProvider
Definition: lte-enb-rrc.h:939
LteHandoverManagementSapUser * GetLteHandoverManagementSapUser()
Get the Handover Management SAP offered by this RRC.
LteEnbRrcSapProvider * m_rrcSapProvider
Definition: lte-enb-rrc.h:937
RachConfigDedicated rachConfigDedicated
Definition: lte-rrc-sap.h:506
uint16_t GetRnti(void) const
virtual void RecvLoadInformation(EpcX2Sap::LoadInformationParams params)=0
RecvLoadInformation.
bool IsGbr() const
Definition: eps-bearer.cc:61
void RemoveSrsConfigurationIndex(uint16_t srcCi)
remove a previously allocated SRS configuration index
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:91
State GetState() const
void SetImsi(uint64_t imsi)
Set the IMSI.
Definition: lte-enb-rrc.cc:320
void SetRnti(uint16_t rnti)
Definition: lte-rlc.cc:125
void SetLteMacSapProvider(LteMacSapProvider *s)
set the MAC SAP provider.
Both the RSRP and RSRQ quantities are to be included in the measurement report.
Definition: lte-rrc-sap.h:369
void SendUeContextRelease()
send the UE CONTEXT RELEASE X2 message to the source eNB, thus successfully terminating an X2 handove...
Definition: lte-enb-rrc.cc:692
LteRrcSap::RrcConnectionReconfiguration GetRrcConnectionReconfigurationForHandover()
Definition: lte-enb-rrc.cc:616
void SwitchToState(State s)
Switch the UeManager to the given state.
Time m_connectionSetupTimeoutDuration
Definition: lte-enb-rrc.h:1004
static const std::string g_ueManagerStateName[UeManager::NUM_STATES]
Definition: lte-enb-rrc.cc:103
void RecvRrcConnectionReconfigurationCompleted(LteRrcSap::RrcConnectionReconfigurationCompleted msg)
Part of the RRC protocol. Implement the LteEnbRrcSapProvider::RecvRrcConnectionReconfigurationComplet...
Definition: lte-enb-rrc.cc:843
void ReleaseDataRadioBearer(uint8_t drbid)
Release a given radio bearer.
Definition: lte-enb-rrc.cc:447
double GetPacketErrorLossRate() const
Definition: eps-bearer.cc:144
uint8_t AddDataRadioBearerInfo(Ptr< LteDataRadioBearerInfo > radioBearerInfo)
Add a new LteDataRadioBearerInfo structure to the UeManager.
EpcX2SapUser * m_x2SapUser
Definition: lte-enb-rrc.h:921
uint8_t m_rsrqFilterCoefficient
Definition: lte-enb-rrc.h:1000
LteEnbRrcSapUser * m_rrcSapUser
Definition: lte-enb-rrc.h:936
uint16_t m_dlEarfcn
Definition: lte-enb-rrc.h:949
bool m_needPhyMacConfiguration
Definition: lte-enb-rrc.h:419
Ptr< LteEnbRrc > m_rrc
Definition: lte-enb-rrc.h:409
EpcEnbS1SapProvider * m_s1SapProvider
Definition: lte-enb-rrc.h:941
LteRrcSap::SystemInformationBlockType1 m_sib1
the System Information Block Type 1 that is currently broadcasted over BCH
Definition: lte-enb-rrc.h:956
Time m_connectionRequestTimeoutDuration
Definition: lte-enb-rrc.h:1003
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:444
void DoRecvRrcConnectionSetupCompleted(uint16_t rnti, LteRrcSap::RrcConnectionSetupCompleted msg)
Part of the RRC protocol. Forwarding LteEnbRrcSapProvider::RecvRrcConnectionSetupCompleted interface ...
void DoRecvRrcConnectionReestablishmentComplete(uint16_t rnti, LteRrcSap::RrcConnectionReestablishmentComplete msg)
Part of the RRC protocol. Forwarding LteEnbRrcSapProvider::RecvRrcConnectionReestablishmentComplete i...
uint64_t gbrUl
Guaranteed Bit Rate (bit/s) in uplink.
Definition: eps-bearer.h:41
The attribute can be read.
Definition: type-id.h:56
LteHandoverManagementSapUser * m_handoverManagementSapUser
Definition: lte-enb-rrc.h:927
void DoCompleteSetupUe(uint16_t rnti, LteEnbRrcSapProvider::CompleteSetupUeParameters params)
Part of the RRC protocol. Forwarding LteEnbRrcSapProvider::CompleteSetupUe interface to UeManager::Co...
SystemInformationBlockType1 sourceSystemInformationBlockType1
Definition: lte-rrc-sap.h:552
TracedCallback< uint16_t, uint16_t > m_newUeContextTrace
Definition: lte-enb-rrc.h:1010
Service Access Point (SAP) offered by the MAC to the RRC See Femto Forum MAC Scheduler Interface Spec...
Event A4: Neighbour becomes better than absolute threshold.
Definition: lte-rrc-sap.h:334
Template for the implementation of the LteFfrRrcSapUser as a member of an owner class of type C to wh...
LteEnbCmacSapUser * m_cmacSapUser
Definition: lte-enb-rrc.h:924
Ptr< UeManager > GetUeManager(uint16_t rnti)
Parameters for LtePdcpSapUser::ReceivePdcpSdu.
Definition: lte-pdcp-sap.h:76
uint8_t lcId
logical channel identifier
This class contains the specification of EPS Bearers.
Definition: eps-bearer.h:71
uint16_t m_rnti
UE id within this cell.
bool m_admitRrcConnectionRequest
Definition: lte-enb-rrc.h:996
int8_t m_qRxLevMin
Definition: lte-enb-rrc.h:992
uint16_t rnti
the C-RNTI identifying the UE
Definition: lte-pdcp-sap.h:79
LtePdcpSapUser * m_drbPdcpSapUser
Definition: lte-enb-rrc.h:411
uint8_t AddUeMeasReportConfig(LteRrcSap::ReportConfigEutra config)
Add a new UE measurement reporting configuration.
EventId m_connectionRejectedTimeout
Definition: lte-enb-rrc.h:423
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 ...
hold variables of type 'enum'
Definition: enum.h:37
LteRrcSap::RrcConnectionReconfiguration BuildRrcConnectionReconfiguration()
Ptr< LteSignalingRadioBearerInfo > m_srb0
Definition: lte-enb-rrc.h:402
void DoRecvRrcConnectionRequest(uint16_t rnti, LteRrcSap::RrcConnectionRequest msg)
Part of the RRC protocol. Forwarding LteEnbRrcSapProvider::RecvRrcConnectionRequest interface to UeMa...
Attribute for objects of type ns3::Time.
Definition: nstime.h:912
uint16_t m_ulEarfcn
Definition: lte-enb-rrc.h:950
static TypeId GetTypeId(void)
Definition: lte-rlc-um.cc:55
void SetSrsConfigurationIndex(uint16_t srsConfIndex)
Set the SRS configuration index and do the necessary reconfiguration.
void DoTriggerHandover(uint16_t rnti, uint16_t targetCellId)
LogicalChannelConfig logicalChannelConfig
Definition: lte-rrc-sap.h:211
virtual void SendLoadInformation(LoadInformationParams params)=0
Ptr< Object > Create(void) const
enum ns3::LteRrcSap::SoundingRsUlConfigDedicated::@69 type
TracedCallback< uint64_t, uint16_t, uint16_t > m_connectionEstablishedTrace
Definition: lte-enb-rrc.h:1012
Parameters of the HANDOVER PREPARATION FAILURE message.
Definition: epc-x2-sap.h:259
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:46
Logical Channel information to be passed to CmacSapProvider::ConfigureLc.
Ptr< SampleEmitter > s
virtual void SetCellId(uint16_t cellId)=0
GbrQosInformation gbrQosInfo
Definition: eps-bearer.h:90
void DoPathSwitchRequestAcknowledge(EpcEnbS1SapUser::PathSwitchRequestAcknowledgeParameters params)
virtual void SetBandwidth(uint8_t ulBandwidth, uint8_t dlBandwidth)=0
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:85
std::vector< ErabAdmittedItem > admittedBearers
Definition: epc-x2-sap.h:249
std::vector< CellInformationItem > cellInformationList
Definition: epc-x2-sap.h:303
uint16_t rnti
the C-RNTI identifying the UE
Definition: lte-pdcp-sap.h:46
std::list< MeasIdToAddMod > measIdToAddModList
Definition: lte-rrc-sap.h:467
Parameters of the SN STATUS TRANSFER message.
Definition: epc-x2-sap.h:273
PhysicalConfigDedicated physicalConfigDedicated
Definition: lte-rrc-sap.h:257
LteEnbCphySapProvider * m_cphySapProvider
Definition: lte-enb-rrc.h:945
std::set< uint8_t > m_ffrMeasIds
Definition: lte-enb-rrc.h:968
Service Access Point (SAP) offered by the eNodeB RRC instance to the ANR instance.
Definition: lte-anr-sap.h:97
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...
uint8_t Drbid2Lcid(uint8_t drbid)
uint64_t gbrDl
Guaranteed Bit Rate (bit/s) in downlink.
Definition: eps-bearer.h:40
uint16_t rxSn
RX sequence number.
Definition: lte-pdcp.h:98
LteMacSapUser * GetLteMacSapUser()
Definition: lte-rlc.cc:160
void SendData(uint8_t bid, Ptr< Packet > p)
Send a data packet over the appropriate Data Radio Bearer.
Definition: lte-enb-rrc.cc:623
std::set< uint8_t > m_handoverMeasIds
Definition: lte-enb-rrc.h:966
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
Definition: log.h:233
virtual RachConfig GetRachConfig()=0
RadioResourceConfigDedicated radioResourceConfigDedicated
Definition: lte-rrc-sap.h:595
void DoRecvUeContextRelease(EpcX2SapUser::UeContextReleaseParams params)
uint8_t m_lastAllocatedDrbid
Definition: lte-enb-rrc.h:404
Event A5: PCell becomes worse than absolute threshold1 AND Neighbour becomes better than another abso...
Definition: lte-rrc-sap.h:335
uint8_t Bid2Lcid(uint8_t bid)
uint16_t m_sourceX2apId
Definition: lte-enb-rrc.h:415
Parameters for [re]configuring the UE.
std::map< uint32_t, X2uTeidInfo > m_x2uTeidInfoMap
Definition: lte-enb-rrc.h:977
TracedCallback< uint64_t, uint16_t, uint16_t, LteRrcSap::MeasurementReport > m_recvMeasurementReportTrace
Definition: lte-enb-rrc.h:1021
void SetRnti(uint16_t rnti)
Set the RNTI to the given value.
virtual ~UeManager(void)
Definition: lte-enb-rrc.cc:264
uint8_t m_rsrpFilterCoefficient
Definition: lte-enb-rrc.h:999
E-RABs to be setup item as it is used in the HANDOVER REQUEST message.
Definition: epc-x2-sap.h:59
RadioResourceConfigDedicated sourceRadioResourceConfig
Definition: lte-rrc-sap.h:549
Part of the RRC protocol.
Definition: lte-rrc-sap.h:815
uint8_t DoAddUeMeasReportConfigForAnr(LteRrcSap::ReportConfigEutra reportConfig)
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:326
void RemoveDataRadioBearerInfo(uint8_t drbid)
remove the LteDataRadioBearerInfo corresponding to a bearer being released
static TypeId GetTypeId(void)
Definition: lte-enb-rrc.cc:282
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:733
EpcX2SapProvider * m_x2SapProvider
Definition: lte-enb-rrc.h:922
Event A1: Serving becomes better than absolute threshold.
Definition: lte-rrc-sap.h:331
Parameters of the RESOURCE STATUS UPDATE message.
Definition: epc-x2-sap.h:311
hold objects of type Ptr
Definition: pointer.h:33
virtual void SendHandoverRequestAck(HandoverRequestAckParams params)=0
LteRrcSap::RadioResourceConfigDedicated BuildRadioResourceConfigDedicated()
void SetLteRlcSapUser(LteRlcSapUser *s)
Definition: lte-rlc.cc:139
enum ns3::EpsBearer::Qci qci
EventId m_handoverLeavingTimeout
Definition: lte-enb-rrc.h:425
uint8_t lcGroup
logical channel group
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
void SetLteAnrSapProvider(LteAnrSapProvider *s)
set the ANR SAP this RRC should interact with
Parameters of the UE CONTEXT RELEASE message.
Definition: epc-x2-sap.h:287
uint64_t mbrUl
Maximum Bit Rate (bit/s) in uplink.
Definition: eps-bearer.h:43
Parameters of the HANDOVER REQUEST ACKNOWLEDGE message.
Definition: epc-x2-sap.h:243
void RecvRrcConnectionSetupCompleted(LteRrcSap::RrcConnectionSetupCompleted msg)
Part of the RRC protocol. Implement the LteEnbRrcSapProvider::RecvRrcConnectionSetupCompleted interfa...
Definition: lte-enb-rrc.cc:824
RadioResourceConfigDedicated radioResourceConfigDedicated
Definition: lte-rrc-sap.h:629
std::list< uint8_t > m_drbsToBeStarted
Definition: lte-enb-rrc.h:418
void DoReceivePdcpSdu(LtePdcpSapUser::ReceivePdcpSduParameters params)
enum ns3::LteRrcSap::ReportConfigEutra::@73 eventId
Choice of E-UTRA event triggered reporting criteria.
static const uint16_t g_srsCiLow[SRS_ENTRIES]
TracedCallback< uint64_t, uint16_t, uint16_t, uint16_t > m_handoverStartTrace
Definition: lte-enb-rrc.h:1016
std::vector< EpcX2Sap::ErabToBeSetupItem > GetErabList()
Definition: lte-enb-rrc.cc:672
virtual void SetSystemInformationBlockType1(LteRrcSap::SystemInformationBlockType1 sib1)=0
virtual int8_t GetReferenceSignalPower()=0
void ScheduleRrcConnectionReconfiguration()
schedule an RRC Connection Reconfiguration procedure with the UE
Definition: lte-enb-rrc.cc:473
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:371
LteAnrSapUser * GetLteAnrSapUser()
Get the ANR SAP offered by this RRC.
Parameters for [re]configuring the UE.
Time m_systemInformationPeriodicity
Definition: lte-enb-rrc.h:983
LteEnbRrcSapProvider * GetLteEnbRrcSapProvider()
RadioResourceConfigCommonSib radioResourceConfigCommon
Definition: lte-rrc-sap.h:536
static Time Now(void)
Return the "current simulation time".
Definition: simulator.cc:180
std::vector< ErabToBeSetupItem > bearers
Definition: epc-x2-sap.h:234
uint8_t m_defaultTransmissionMode
Definition: lte-enb-rrc.h:979
void DoRecvResourceStatusUpdate(EpcX2SapUser::ResourceStatusUpdateParams params)
void SetLcId(uint8_t lcId)
Definition: lte-rlc.cc:132
Service Access Point (SAP) offered by the eNodeB RRC instance to the Frequency Reuse algorithm instan...
void DoRecvUeData(EpcX2SapUser::UeDataParams params)
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...
Ptr< const AttributeAccessor > MakeEnumAccessor(T1 a1)
Definition: enum.h:118
RadioResourceConfigCommon radioResourceConfigCommon
Definition: lte-rrc-sap.h:504
uint64_t GetImsi(void) const
EnbRrcMemberLteEnbCmacSapUser(LteEnbRrc *rrc)
Definition: lte-enb-rrc.cc:73
void PrepareHandover(uint16_t cellId)
Start the handover preparation and send the handover request.
Definition: lte-enb-rrc.cc:506
CarrierBandwidthEutra carrierBandwidth
Definition: lte-rrc-sap.h:502
uint8_t DoAddUeMeasReportConfigForHandover(LteRrcSap::ReportConfigEutra reportConfig)
uint16_t GetRnti(void) const
void RecvRrcConnectionReestablishmentComplete(LteRrcSap::RrcConnectionReestablishmentComplete msg)
Part of the RRC protocol. Implement the LteEnbRrcSapProvider::RecvRrcConnectionReestablishmentComplet...
Definition: lte-enb-rrc.cc:928
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
Definition: assert.h:84
EpcEnbS1SapUser * m_s1SapUser
Definition: lte-enb-rrc.h:942
std::set< uint16_t > m_ueSrsConfigurationIndexSet
Definition: lte-enb-rrc.h:987
void SetSrsPeriodicity(uint32_t p)
Event A2: Serving becomes worse than absolute threshold.
Definition: lte-rrc-sap.h:332
uint16_t rnti
C-RNTI identifying the UE.
virtual void DoDispose(void)
This method is called by Object::Dispose or by the object's destructor, whichever comes first...
TypeId GetRlcType(EpsBearer bearer)
LogicalChannelConfig logicalChannelConfig
Definition: lte-rrc-sap.h:220
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...
#define NS_ABORT_IF(cond)
Abnormal program termination if cond is true.
Definition: abort.h:71
instantiate subclasses of ns3::Object.
Ipv4 addresses are stored in host order in this class.
Definition: ipv4-address.h:38
uint64_t gbrUl
guaranteed bitrate in uplink
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
static const std::string & ToString(EpcUeNas::State s)
Definition: epc-ue-nas.cc:47
LteAnrSapUser * m_anrSapUser
Definition: lte-enb-rrc.h:930
virtual void SetBandwidth(uint8_t ulBandwidth, uint8_t dlBandwidth)=0
Configure DL and UL bandwidth in Frequency Reuse Algorithm function is called during Cell configurati...
EventId m_connectionSetupTimeout
Definition: lte-enb-rrc.h:422
Template for the implementation of the LteEnbRrcSapProvider as a member of an owner class of type C t...
Definition: lte-rrc-sap.h:1305
bool m_pendingRrcConnectionReconfiguration
Definition: lte-enb-rrc.h:412
std::vector< ErabNotAdmittedItem > notAdmittedBearers
Definition: epc-x2-sap.h:250
Service Access Point (SAP) offered by the ANR instance to the eNodeB RRC instance.
Definition: lte-anr-sap.h:37
void DoRrcConfigurationUpdateInd(LteEnbCmacSapUser::UeConfig params)
virtual void ConfigureMac(uint8_t ulBandwidth, uint8_t dlBandwidth)=0
void DoSetPdschConfigDedicated(uint16_t rnti, LteRrcSap::PdschConfigDedicated pa)
uint8_t DoAddUeMeasReportConfigForFfr(LteRrcSap::ReportConfigEutra reportConfig)
struct defining the RACH configuration of the MAC
void DoRecvHandoverPreparationFailure(EpcX2SapUser::HandoverPreparationFailureParams params)
#define NS_LOG_WARN(msg)
Use NS_LOG to output a message of level LOG_WARN.
Definition: log.h:203
Service Access Point (SAP) offered by the handover algorithm instance to the eNodeB RRC instance...
void StartDataRadioBearers()
Start the data radio bearers that have been previously recorded to be started using RecordDataRadioBe...
Definition: lte-enb-rrc.cc:427
virtual AllocateNcRaPreambleReturnValue AllocateNcRaPreamble(uint16_t rnti)=0
Allocate a random access preamble for non-contention based random access (e.g., for handover)...
static const uint16_t g_srsPeriodicity[SRS_ENTRIES]
enum ns3::LteRrcSap::ReportConfigEutra::@75 triggerQuantity
The quantities used to evaluate the triggering condition for the event, see 3GPP TS 36...
EpcEnbS1SapUser * GetS1SapUser()
std::list< DrbToAddMod > drbToAddModList
Definition: lte-rrc-sap.h:254
void RecvRrcConnectionReestablishmentRequest(LteRrcSap::RrcConnectionReestablishmentRequest msg)
Part of the RRC protocol. Implement the LteEnbRrcSapProvider::RecvRrcConnectionReestablishmentRequest...
Definition: lte-enb-rrc.cc:903
bool RemovePacketTag(Tag &tag)
Remove a packet tag.
Definition: packet.cc:848
LteEnbCmacSapProvider * m_cmacSapProvider
Definition: lte-enb-rrc.h:925
LteRrcSap::PhysicalConfigDedicated m_physicalConfigDedicated
Definition: lte-enb-rrc.h:408
std::map< uint16_t, Ptr< UeManager > > m_ueMap
Definition: lte-enb-rrc.h:958
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Definition: log.h:213
static const uint16_t g_srsCiHigh[SRS_ENTRIES]
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition: nstime.h:845
LteFfrRrcSapUser * GetLteFfrRrcSapUser()
Get the FFR SAP offered by this RRC.
Parameters of the LOAD INFORMATION message.
Definition: epc-x2-sap.h:300
virtual Ptr< Packet > EncodeHandoverCommand(RrcConnectionReconfiguration msg)=0
void RecvRrcConnectionRequest(LteRrcSap::RrcConnectionRequest msg)
Part of the RRC protocol. Implement the LteEnbRrcSapProvider::RecvRrcConnectionRequest interface...
Definition: lte-enb-rrc.cc:771
SystemInformationBlockType2 sib2
Definition: lte-rrc-sap.h:543
void Cancel(void)
This method is syntactic sugar for the ns3::Simulator::cancel method.
Definition: event-id.cc:47
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
Definition: lte-enb-rrc.h:401
Reference Signal Received Power.
Definition: lte-rrc-sap.h:362
TracedCallback< uint64_t, uint16_t, uint16_t > m_connectionReconfigurationTrace
Definition: lte-enb-rrc.h:1014
uint8_t GetLogicalChannelPriority(EpsBearer bearer)
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
uint8_t GetNewRrcTransactionIdentifier()
void DoRecvSnStatusTransfer(EpcX2SapUser::SnStatusTransferParams params)
LteEnbCphySapUser * GetLteEnbCphySapUser()
void ConnectionRejectedTimeout(uint16_t rnti)
Method triggered a while after sending RRC Connection Rejected.
uint32_t GetSrsPeriodicity() const
Ptr< LteDataRadioBearerInfo > GetDataRadioBearerInfo(uint8_t drbid)
Template for the implementation of the LteAnrSapUser as a member of an owner class of type C to which...
Definition: lte-anr-sap.h:200
Time m_handoverJoiningTimeoutDuration
Definition: lte-enb-rrc.h:1006
LteRlcSapProvider * GetLteRlcSapProvider()
Definition: lte-rlc.cc:146
uint16_t m_lastAllocatedConfigurationIndex
Definition: lte-enb-rrc.h:988
Reference Signal Received Quality.
Definition: lte-rrc-sap.h:363
RSRP is used for the threshold.
Definition: lte-rrc-sap.h:314
virtual void SendSystemInformation(SystemInformation msg)=0
Send a SystemInformation message to all attached UEs during a system information acquisition procedur...
virtual void RemoveUe(uint16_t rnti)=0
remove the UE, e.g., after handover or termination of the RRC connection
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
LteHandoverManagementSapProvider * m_handoverManagementSapProvider
Definition: lte-enb-rrc.h:928
a base class which provides memory management and object aggregation
Definition: object.h:64
std::set< uint8_t > m_anrMeasIds
Definition: lte-enb-rrc.h:967
enum ns3::LteRrcSap::ThresholdEutra::@71 choice
contain a set of ns3::Object pointers.
uint64_t mbrDl
Maximum Bit Rate (bit/s) in downlink.
Definition: eps-bearer.h:42
void ConfigureCell(uint8_t ulBandwidth, uint8_t dlBandwidth, uint16_t ulEarfcn, uint16_t dlEarfcn, uint16_t cellId)
Configure cell-specific parameters.
void DoRecvRrcConnectionReestablishmentRequest(uint16_t rnti, LteRrcSap::RrcConnectionReestablishmentRequest msg)
Part of the RRC protocol. Forwarding LteEnbRrcSapProvider::RecvRrcConnectionReestablishmentRequest in...
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...
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
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. Forwarding LteEnbRrcSapProvider::RecvMeasurementReport interface to UeManag...
void CmacUeConfigUpdateInd(LteEnbCmacSapUser::UeConfig cmacParams)
Definition: lte-enb-rrc.cc:986
Parameters of the UE DATA primitive.
Definition: epc-x2-sap.h:325
enum LteEpsBearerToRlcMapping_t m_epsBearerToRlcMapping
Definition: lte-enb-rrc.h:981
Ptr< T > GetObject(void) const
Definition: object.h:362
std::vector< ErabsSubjectToStatusTransferItem > erabsSubjectToStatusTransferList
Definition: epc-x2-sap.h:279
virtual void SetCellId(uint16_t cellId)=0
SetCellId.
void DoSendLoadInformation(EpcX2Sap::LoadInformationParams params)
void RecvMeasurementReport(LteRrcSap::MeasurementReport msg)
Part of the RRC protocol. Implement the LteEnbRrcSapProvider::RecvMeasurementReport interface...
Definition: lte-enb-rrc.cc:935
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:49
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
Definition: lte-enb-rrc.h:417
std::list< ReportConfigToAddMod > reportConfigToAddModList
Definition: lte-rrc-sap.h:465
TypeId SetParent(TypeId tid)
Definition: type-id.cc:610
uint8_t Bid2Drbid(uint8_t bid)
static TypeId GetTypeId(void)
Definition: lte-rlc-am.cc:86
void SetS1SapProvider(EpcEnbS1SapProvider *s)
Set the S1 SAP Provider.
uint8_t Lcid2Drbid(uint8_t lcid)
virtual void RemoveUe(uint16_t rnti)=0
Remove an UE from the the cell.
EventId m_connectionRequestTimeout
Definition: lte-enb-rrc.h:421
LteEnbCphySapUser * m_cphySapUser
Definition: lte-enb-rrc.h:944
LteAnrSapProvider * m_anrSapProvider
Definition: lte-enb-rrc.h:931
Service Access Point (SAP) offered by the eNodeB RRC instance to the handover algorithm instance...
void DoDataRadioBearerSetupRequest(EpcEnbS1SapUser::DataRadioBearerSetupRequestParameters params)
void DoRecvLoadInformation(EpcX2SapUser::LoadInformationParams params)
RaSupervisionInfo raSupervisionInfo
Definition: lte-rrc-sap.h:237
void SetLteMacSapProvider(LteMacSapProvider *s)
Definition: lte-rlc.cc:153
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:562
bool SendData(Ptr< Packet > p)
Enqueue an IP data packet on the proper bearer for downlink transmission.
EventId m_handoverJoiningTimeout
Definition: lte-enb-rrc.h:424
bool isGbr
true if the bearer is GBR, false if the bearer is NON-GBR
void CompleteSetupUe(LteEnbRrcSapProvider::CompleteSetupUeParameters params)
Part of the RRC protocol. Implement the LteEnbRrcSapProvider::CompleteSetupUe interface.
Definition: lte-enb-rrc.cc:763
uint16_t m_cellId
Definition: lte-enb-rrc.h:948
virtual void DoInitialize()
This method is called only once by Object::Initialize.
Definition: lte-enb-rrc.cc:148
MasterInformationBlock sourceMasterInformationBlock
Definition: lte-rrc-sap.h:551
LteRrcSap::MeasConfig m_ueMeasConfig
List of measurement configuration which are active in every UE attached to this eNodeB instance...
Definition: lte-enb-rrc.h:964
int8_t qQualMin
INTEGER (-34..-3), actual value = IE value [dB].
Definition: lte-rrc-sap.h:83
void DoRecvHandoverRequestAck(EpcX2SapUser::HandoverRequestAckParams params)
ThresholdEutra threshold2
Threshold for event A5.
Definition: lte-rrc-sap.h:340
void DoRecvHandoverRequest(EpcX2SapUser::HandoverRequestParams params)