A Discrete-Event Network Simulator
API
lte-enb-rrc.cc
Go to the documentation of this file.
1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
4  *
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 namespace ns3 {
48 
49 NS_LOG_COMPONENT_DEFINE ("LteEnbRrc");
50 
52 // CMAC SAP forwarder
54 
59 {
60 public:
62 
63  virtual uint16_t AllocateTemporaryCellRnti ();
64  virtual void NotifyLcConfigResult (uint16_t rnti, uint8_t lcid, bool success);
65  virtual void RrcConfigurationUpdateInd (UeConfig params);
66 
67 private:
69 };
70 
72  : m_rrc (rrc)
73 {
74 }
75 
76 uint16_t
78 {
80 }
81 
82 void
83 EnbRrcMemberLteEnbCmacSapUser::NotifyLcConfigResult (uint16_t rnti, uint8_t lcid, bool success)
84 {
85  m_rrc->DoNotifyLcConfigResult (rnti, lcid, success);
86 }
87 
88 void
90 {
92 }
93 
94 
95 
97 // UeManager
99 
100 
102 static const std::string g_ueManagerStateName[UeManager::NUM_STATES] =
103 {
104  "INITIAL_RANDOM_ACCESS",
105  "CONNECTION_SETUP",
106  "CONNECTION_REJECTED",
107  "CONNECTED_NORMALLY",
108  "CONNECTION_RECONFIGURATION",
109  "CONNECTION_REESTABLISHMENT",
110  "HANDOVER_PREPARATION",
111  "HANDOVER_JOINING",
112  "HANDOVER_PATH_SWITCH",
113  "HANDOVER_LEAVING",
114 };
115 
120 static const std::string & ToString (UeManager::State s)
121 {
122  return g_ueManagerStateName[s];
123 }
124 
125 
126 NS_OBJECT_ENSURE_REGISTERED (UeManager);
127 
128 
130 {
131  NS_FATAL_ERROR ("this constructor is not espected to be used");
132 }
133 
134 
136  : m_lastAllocatedDrbid (0),
137  m_rnti (rnti),
138  m_imsi (0),
139  m_lastRrcTransactionIdentifier (0),
140  m_rrc (rrc),
141  m_state (s),
142  m_pendingRrcConnectionReconfiguration (false),
143  m_sourceX2apId (0),
144  m_sourceCellId (0),
145  m_needPhyMacConfiguration (false)
146 {
147  NS_LOG_FUNCTION (this);
148 }
149 
150 void
152 {
153  NS_LOG_FUNCTION (this);
155 
157  m_physicalConfigDedicated.antennaInfo.transmissionMode = m_rrc->m_defaultTransmissionMode;
164 
165  m_rrc->m_cmacSapProvider->AddUe (m_rnti);
166  m_rrc->m_cphySapProvider->AddUe (m_rnti);
167 
168  // setup the eNB side of SRB0
169  {
170  uint8_t lcid = 0;
171 
172  Ptr<LteRlc> rlc = CreateObject<LteRlcTm> ()->GetObject<LteRlc> ();
173  rlc->SetLteMacSapProvider (m_rrc->m_macSapProvider);
174  rlc->SetRnti (m_rnti);
175  rlc->SetLcId (lcid);
176 
177  m_srb0 = CreateObject<LteSignalingRadioBearerInfo> ();
178  m_srb0->m_rlc = rlc;
179  m_srb0->m_srbIdentity = 0;
180  // no need to store logicalChannelConfig as SRB0 is pre-configured
181 
183  lcinfo.rnti = m_rnti;
184  lcinfo.lcId = lcid;
185  // leave the rest of lcinfo empty as CCCH (LCID 0) is pre-configured
186  m_rrc->m_cmacSapProvider->AddLc (lcinfo, rlc->GetLteMacSapUser ());
187 
188  }
189 
190  // setup the eNB side of SRB1; the UE side will be set up upon RRC connection establishment
191  {
192  uint8_t lcid = 1;
193 
194  Ptr<LteRlc> rlc = CreateObject<LteRlcAm> ()->GetObject<LteRlc> ();
195  rlc->SetLteMacSapProvider (m_rrc->m_macSapProvider);
196  rlc->SetRnti (m_rnti);
197  rlc->SetLcId (lcid);
198 
199  Ptr<LtePdcp> pdcp = CreateObject<LtePdcp> ();
200  pdcp->SetRnti (m_rnti);
201  pdcp->SetLcId (lcid);
202  pdcp->SetLtePdcpSapUser (m_drbPdcpSapUser);
203  pdcp->SetLteRlcSapProvider (rlc->GetLteRlcSapProvider ());
204  rlc->SetLteRlcSapUser (pdcp->GetLteRlcSapUser ());
205 
206  m_srb1 = CreateObject<LteSignalingRadioBearerInfo> ();
207  m_srb1->m_rlc = rlc;
208  m_srb1->m_pdcp = pdcp;
209  m_srb1->m_srbIdentity = 1;
210  m_srb1->m_logicalChannelConfig.priority = 0;
211  m_srb1->m_logicalChannelConfig.prioritizedBitRateKbps = 100;
212  m_srb1->m_logicalChannelConfig.bucketSizeDurationMs = 100;
213  m_srb1->m_logicalChannelConfig.logicalChannelGroup = 0;
214 
216  lcinfo.rnti = m_rnti;
217  lcinfo.lcId = lcid;
218  lcinfo.lcGroup = 0; // all SRBs always mapped to LCG 0
219  lcinfo.qci = EpsBearer::GBR_CONV_VOICE; // not sure why the FF API requires a CQI even for SRBs...
220  lcinfo.isGbr = true;
221  lcinfo.mbrUl = 1e6;
222  lcinfo.mbrDl = 1e6;
223  lcinfo.gbrUl = 1e4;
224  lcinfo.gbrDl = 1e4;
225  m_rrc->m_cmacSapProvider->AddLc (lcinfo, rlc->GetLteMacSapUser ());
226  }
227 
229  ueParams.srb0SapProvider = m_srb0->m_rlc->GetLteRlcSapProvider ();
230  ueParams.srb1SapProvider = m_srb1->m_pdcp->GetLtePdcpSapProvider ();
231  m_rrc->m_rrcSapUser->SetupUe (m_rnti, ueParams);
232 
233  // configure MAC (and scheduler)
235  req.m_rnti = m_rnti;
237  m_rrc->m_cmacSapProvider->UeUpdateConfigurationReq (req);
238 
239  // configure PHY
240  m_rrc->m_cphySapProvider->SetTransmissionMode (m_rnti, m_physicalConfigDedicated.antennaInfo.transmissionMode);
241  m_rrc->m_cphySapProvider->SetSrsConfigurationIndex (m_rnti, m_physicalConfigDedicated.soundingRsUlConfigDedicated.srsConfigIndex);
242 
243  // schedule this UeManager instance to be deleted if the UE does not give any sign of life within a reasonable time
244  Time maxConnectionDelay;
245  switch (m_state)
246  {
248  m_connectionRequestTimeout = Simulator::Schedule (m_rrc->m_connectionRequestTimeoutDuration,
250  m_rrc, m_rnti);
251  break;
252 
253  case HANDOVER_JOINING:
254  m_handoverJoiningTimeout = Simulator::Schedule (m_rrc->m_handoverJoiningTimeoutDuration,
256  m_rrc, m_rnti);
257  break;
258 
259  default:
260  NS_FATAL_ERROR ("unexpected state " << ToString (m_state));
261  break;
262  }
263 
264 }
265 
266 
268 {
269 }
270 
271 void
273 {
274  delete m_drbPdcpSapUser;
275  // delete eventual X2-U TEIDs
276  for (std::map <uint8_t, Ptr<LteDataRadioBearerInfo> >::iterator it = m_drbMap.begin ();
277  it != m_drbMap.end ();
278  ++it)
279  {
280  m_rrc->m_x2uTeidInfoMap.erase (it->second->m_gtpTeid);
281  }
282 
283 }
284 
286 {
287  static TypeId tid = TypeId ("ns3::UeManager")
288  .SetParent<Object> ()
289  .AddConstructor<UeManager> ()
290  .AddAttribute ("DataRadioBearerMap", "List of UE DataRadioBearerInfo by DRBID.",
291  ObjectMapValue (),
293  MakeObjectMapChecker<LteDataRadioBearerInfo> ())
294  .AddAttribute ("Srb0", "SignalingRadioBearerInfo for SRB0",
295  PointerValue (),
297  MakePointerChecker<LteSignalingRadioBearerInfo> ())
298  .AddAttribute ("Srb1", "SignalingRadioBearerInfo for SRB1",
299  PointerValue (),
301  MakePointerChecker<LteSignalingRadioBearerInfo> ())
302  .AddAttribute ("C-RNTI",
303  "Cell Radio Network Temporary Identifier",
304  TypeId::ATTR_GET, // read-only attribute
305  UintegerValue (0), // unused, read-only attribute
307  MakeUintegerChecker<uint16_t> ())
308  .AddTraceSource ("StateTransition",
309  "fired upon every UE state transition seen by the "
310  "UeManager at the eNB RRC",
312  "ns3::UeManager::StateTracedCallback")
313  ;
314  return tid;
315 }
316 
317 void
318 UeManager::SetSource (uint16_t sourceCellId, uint16_t sourceX2apId)
319 {
320  m_sourceX2apId = sourceX2apId;
321  m_sourceCellId = sourceCellId;
322 }
323 
324 void
325 UeManager::SetImsi (uint64_t imsi)
326 {
327  m_imsi = imsi;
328 }
329 
330 void
331 UeManager::SetupDataRadioBearer (EpsBearer bearer, uint8_t bearerId, uint32_t gtpTeid, Ipv4Address transportLayerAddress)
332 {
333  NS_LOG_FUNCTION (this << (uint32_t) m_rnti);
334 
335  Ptr<LteDataRadioBearerInfo> drbInfo = CreateObject<LteDataRadioBearerInfo> ();
336  uint8_t drbid = AddDataRadioBearerInfo (drbInfo);
337  uint8_t lcid = Drbid2Lcid (drbid);
338  uint8_t bid = Drbid2Bid (drbid);
339  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");
340  drbInfo->m_epsBearerIdentity = bid;
341  drbInfo->m_drbIdentity = drbid;
342  drbInfo->m_logicalChannelIdentity = lcid;
343  drbInfo->m_gtpTeid = gtpTeid;
344  drbInfo->m_transportLayerAddress = transportLayerAddress;
345 
346  if (m_state == HANDOVER_JOINING)
347  {
348  // setup TEIDs for receiving data eventually forwarded over X2-U
349  LteEnbRrc::X2uTeidInfo x2uTeidInfo;
350  x2uTeidInfo.rnti = m_rnti;
351  x2uTeidInfo.drbid = drbid;
352  std::pair<std::map<uint32_t, LteEnbRrc::X2uTeidInfo>::iterator, bool>
353  ret = m_rrc->m_x2uTeidInfoMap.insert (std::pair<uint32_t, LteEnbRrc::X2uTeidInfo> (gtpTeid, x2uTeidInfo));
354  NS_ASSERT_MSG (ret.second == true, "overwriting a pre-existing entry in m_x2uTeidInfoMap");
355  }
356 
357  TypeId rlcTypeId = m_rrc->GetRlcType (bearer);
358 
359  ObjectFactory rlcObjectFactory;
360  rlcObjectFactory.SetTypeId (rlcTypeId);
361  Ptr<LteRlc> rlc = rlcObjectFactory.Create ()->GetObject<LteRlc> ();
362  rlc->SetLteMacSapProvider (m_rrc->m_macSapProvider);
363  rlc->SetRnti (m_rnti);
364 
365  drbInfo->m_rlc = rlc;
366 
367  rlc->SetLcId (lcid);
368 
369  // we need PDCP only for real RLC, i.e., RLC/UM or RLC/AM
370  // if we are using RLC/SM we don't care of anything above RLC
371  if (rlcTypeId != LteRlcSm::GetTypeId ())
372  {
373  Ptr<LtePdcp> pdcp = CreateObject<LtePdcp> ();
374  pdcp->SetRnti (m_rnti);
375  pdcp->SetLcId (lcid);
376  pdcp->SetLtePdcpSapUser (m_drbPdcpSapUser);
377  pdcp->SetLteRlcSapProvider (rlc->GetLteRlcSapProvider ());
378  rlc->SetLteRlcSapUser (pdcp->GetLteRlcSapUser ());
379  drbInfo->m_pdcp = pdcp;
380  }
381 
383  lcinfo.rnti = m_rnti;
384  lcinfo.lcId = lcid;
385  lcinfo.lcGroup = m_rrc->GetLogicalChannelGroup (bearer);
386  lcinfo.qci = bearer.qci;
387  lcinfo.isGbr = bearer.IsGbr ();
388  lcinfo.mbrUl = bearer.gbrQosInfo.mbrUl;
389  lcinfo.mbrDl = bearer.gbrQosInfo.mbrDl;
390  lcinfo.gbrUl = bearer.gbrQosInfo.gbrUl;
391  lcinfo.gbrDl = bearer.gbrQosInfo.gbrDl;
392  m_rrc->m_cmacSapProvider->AddLc (lcinfo, rlc->GetLteMacSapUser ());
393 
394  if (rlcTypeId == LteRlcAm::GetTypeId ())
395  {
396  drbInfo->m_rlcConfig.choice = LteRrcSap::RlcConfig::AM;
397  }
398  else
399  {
400  drbInfo->m_rlcConfig.choice = LteRrcSap::RlcConfig::UM_BI_DIRECTIONAL;
401  }
402 
403  drbInfo->m_logicalChannelIdentity = lcid;
404  drbInfo->m_logicalChannelConfig.priority = m_rrc->GetLogicalChannelPriority (bearer);
405  drbInfo->m_logicalChannelConfig.logicalChannelGroup = m_rrc->GetLogicalChannelGroup (bearer);
406  if (bearer.IsGbr ())
407  {
408  drbInfo->m_logicalChannelConfig.prioritizedBitRateKbps = bearer.gbrQosInfo.gbrUl;
409  }
410  else
411  {
412  drbInfo->m_logicalChannelConfig.prioritizedBitRateKbps = 0;
413  }
414  drbInfo->m_logicalChannelConfig.bucketSizeDurationMs = 1000;
415 
417 }
418 
419 void
421 {
422  NS_LOG_FUNCTION (this << (uint32_t) m_rnti);
423  for (std::map <uint8_t, Ptr<LteDataRadioBearerInfo> >::iterator it = m_drbMap.begin ();
424  it != m_drbMap.end ();
425  ++it)
426  {
427  m_drbsToBeStarted.push_back (it->first);
428  }
429 }
430 
431 void
433 {
434  NS_LOG_FUNCTION (this << (uint32_t) m_rnti);
435  for (std::list <uint8_t>::iterator drbIdIt = m_drbsToBeStarted.begin ();
436  drbIdIt != m_drbsToBeStarted.end ();
437  ++drbIdIt)
438  {
439  std::map <uint8_t, Ptr<LteDataRadioBearerInfo> >::iterator drbIt = m_drbMap.find (*drbIdIt);
440  NS_ASSERT (drbIt != m_drbMap.end ());
441  drbIt->second->m_rlc->Initialize ();
442  if (drbIt->second->m_pdcp)
443  {
444  drbIt->second->m_pdcp->Initialize ();
445  }
446  }
447  m_drbsToBeStarted.clear ();
448 }
449 
450 
451 void
453 {
454  NS_LOG_FUNCTION (this << (uint32_t) m_rnti << (uint32_t) drbid);
455  uint8_t lcid = Drbid2Lcid (drbid);
456  std::map <uint8_t, Ptr<LteDataRadioBearerInfo> >::iterator it = m_drbMap.find (drbid);
457  NS_ASSERT_MSG (it != m_drbMap.end (), "request to remove radio bearer with unknown drbid " << drbid);
458 
459  // first delete eventual X2-U TEIDs
460  m_rrc->m_x2uTeidInfoMap.erase (it->second->m_gtpTeid);
461 
462  m_drbMap.erase (it);
463  m_rrc->m_cmacSapProvider->ReleaseLc (m_rnti, lcid);
464 
466  rrcd.havePhysicalConfigDedicated = false;
467  rrcd.drbToReleaseList.push_back (drbid);
468  //populating RadioResourceConfigDedicated information element as per 3GPP TS 36.331 version 9.2.0
469  rrcd.havePhysicalConfigDedicated = true;
471 
472  //populating RRCConnectionReconfiguration message as per 3GPP TS 36.331 version 9.2.0 Release 9
474  msg.haveMeasConfig = false;
475  msg.haveMobilityControlInfo = false;
476  msg.radioResourceConfigDedicated = rrcd;
478  //RRC Connection Reconfiguration towards UE
479  m_rrc->m_rrcSapUser->SendRrcConnectionReconfiguration (m_rnti, msg);
480 }
481 
482 void
483 LteEnbRrc::DoSendReleaseDataRadioBearer (uint64_t imsi, uint16_t rnti, uint8_t bearerId)
484 {
485  Ptr<UeManager> ueManager = GetUeManager (rnti);
486  // Bearer de-activation towards UE
487  ueManager->ReleaseDataRadioBearer (bearerId);
488  // Bearer de-activation indication towards epc-enb application
489  m_s1SapProvider->DoSendReleaseIndication (imsi,rnti,bearerId);
490 }
491 
492 void
494 {
495  NS_LOG_FUNCTION (this);
496  switch (m_state)
497  {
499  case CONNECTION_SETUP:
503  case HANDOVER_JOINING:
504  case HANDOVER_LEAVING:
505  // a previous reconfiguration still ongoing, we need to wait for it to be finished
507  break;
508 
509  case CONNECTED_NORMALLY:
510  {
513  m_rrc->m_rrcSapUser->SendRrcConnectionReconfiguration (m_rnti, msg);
516  }
517  break;
518 
519  default:
520  NS_FATAL_ERROR ("method unexpected in state " << ToString (m_state));
521  break;
522  }
523 }
524 
525 void
526 UeManager::PrepareHandover (uint16_t cellId)
527 {
528  NS_LOG_FUNCTION (this << cellId);
529  switch (m_state)
530  {
531  case CONNECTED_NORMALLY:
532  {
533  m_targetCellId = cellId;
535  params.oldEnbUeX2apId = m_rnti;
537  params.sourceCellId = m_rrc->m_cellId;
538  params.targetCellId = cellId;
539  params.mmeUeS1apId = m_imsi;
540  params.ueAggregateMaxBitRateDownlink = 200 * 1000;
541  params.ueAggregateMaxBitRateUplink = 100 * 1000;
542  params.bearers = GetErabList ();
543 
546  hpi.asConfig.sourceDlCarrierFreq = m_rrc->m_dlEarfcn;
547  hpi.asConfig.sourceMeasConfig = m_rrc->m_ueMeasConfig;
551  hpi.asConfig.sourceSystemInformationBlockType1.cellAccessRelatedInfo.plmnIdentityInfo.plmnIdentity = m_rrc->m_sib1.cellAccessRelatedInfo.plmnIdentityInfo.plmnIdentity;
553  hpi.asConfig.sourceSystemInformationBlockType1.cellAccessRelatedInfo.csgIndication = m_rrc->m_sib1.cellAccessRelatedInfo.csgIndication;
554  hpi.asConfig.sourceSystemInformationBlockType1.cellAccessRelatedInfo.csgIdentity = m_rrc->m_sib1.cellAccessRelatedInfo.csgIdentity;
555  LteEnbCmacSapProvider::RachConfig rc = m_rrc->m_cmacSapProvider->GetRachConfig ();
561  params.rrcContext = m_rrc->m_rrcSapUser->EncodeHandoverPreparationInformation (hpi);
562 
563  NS_LOG_LOGIC ("oldEnbUeX2apId = " << params.oldEnbUeX2apId);
564  NS_LOG_LOGIC ("sourceCellId = " << params.sourceCellId);
565  NS_LOG_LOGIC ("targetCellId = " << params.targetCellId);
566  NS_LOG_LOGIC ("mmeUeS1apId = " << params.mmeUeS1apId);
567  NS_LOG_LOGIC ("rrcContext = " << params.rrcContext);
568 
569  m_rrc->m_x2SapProvider->SendHandoverRequest (params);
571  }
572  break;
573 
574  default:
575  NS_FATAL_ERROR ("method unexpected in state " << ToString (m_state));
576  break;
577  }
578 
579 }
580 
581 void
583 {
584  NS_LOG_FUNCTION (this);
585 
586  NS_ASSERT_MSG (params.notAdmittedBearers.empty (), "not admission of some bearers upon handover is not supported");
587  NS_ASSERT_MSG (params.admittedBearers.size () == m_drbMap.size (), "not enough bearers in admittedBearers");
588 
589  // note: the Handover command from the target eNB to the source eNB
590  // is expected to be sent transparently to the UE; however, here we
591  // decode the message and eventually reencode it. This way we can
592  // support both a real RRC protocol implementation and an ideal one
593  // without actual RRC protocol encoding.
594 
595  Ptr<Packet> encodedHandoverCommand = params.rrcContext;
596  LteRrcSap::RrcConnectionReconfiguration handoverCommand = m_rrc->m_rrcSapUser->DecodeHandoverCommand (encodedHandoverCommand);
597  m_rrc->m_rrcSapUser->SendRrcConnectionReconfiguration (m_rnti, handoverCommand);
599  m_handoverLeavingTimeout = Simulator::Schedule (m_rrc->m_handoverLeavingTimeoutDuration,
601  m_rrc, m_rnti);
602  NS_ASSERT (handoverCommand.haveMobilityControlInfo);
603  m_rrc->m_handoverStartTrace (m_imsi, m_rrc->m_cellId, m_rnti, handoverCommand.mobilityControlInfo.targetPhysCellId);
604 
606  sst.oldEnbUeX2apId = params.oldEnbUeX2apId;
607  sst.newEnbUeX2apId = params.newEnbUeX2apId;
608  sst.sourceCellId = params.sourceCellId;
609  sst.targetCellId = params.targetCellId;
610  for ( std::map <uint8_t, Ptr<LteDataRadioBearerInfo> >::iterator drbIt = m_drbMap.begin ();
611  drbIt != m_drbMap.end ();
612  ++drbIt)
613  {
614  // SN status transfer is only for AM RLC
615  if (0 != drbIt->second->m_rlc->GetObject<LteRlcAm> ())
616  {
617  LtePdcp::Status status = drbIt->second->m_pdcp->GetStatus ();
619  i.dlPdcpSn = status.txSn;
620  i.ulPdcpSn = status.rxSn;
621  sst.erabsSubjectToStatusTransferList.push_back (i);
622  }
623  }
624  m_rrc->m_x2SapProvider->SendSnStatusTransfer (sst);
625 }
626 
627 
630 {
631  NS_LOG_FUNCTION (this);
633 }
634 
637 {
638  NS_LOG_FUNCTION (this);
640 }
641 
642 void
644 {
645  NS_LOG_FUNCTION (this << p << (uint16_t) bid);
646  switch (m_state)
647  {
649  case CONNECTION_SETUP:
650  NS_LOG_WARN ("not connected, discarding packet");
651  return;
652  break;
653 
654  case CONNECTED_NORMALLY:
658  case HANDOVER_JOINING:
660  {
661  NS_LOG_LOGIC ("queueing data on PDCP for transmission over the air");
663  params.pdcpSdu = p;
664  params.rnti = m_rnti;
665  params.lcid = Bid2Lcid (bid);
666  uint8_t drbid = Bid2Drbid (bid);
667  //Transmit PDCP sdu only if DRB ID found in drbMap
668  std::map<uint8_t, Ptr<LteDataRadioBearerInfo> >::iterator it = m_drbMap.find (drbid);
669  if (it != m_drbMap.end ())
670  {
672  if (bearerInfo != NULL)
673  {
674  LtePdcpSapProvider* pdcpSapProvider = bearerInfo->m_pdcp->GetLtePdcpSapProvider ();
675  pdcpSapProvider->TransmitPdcpSdu (params);
676  }
677  }
678  }
679  break;
680 
681  case HANDOVER_LEAVING:
682  {
683  NS_LOG_LOGIC ("forwarding data to target eNB over X2-U");
684  uint8_t drbid = Bid2Drbid (bid);
685  EpcX2Sap::UeDataParams params;
686  params.sourceCellId = m_rrc->m_cellId;
687  params.targetCellId = m_targetCellId;
688  params.gtpTeid = GetDataRadioBearerInfo (drbid)->m_gtpTeid;
689  params.ueData = p;
690  m_rrc->m_x2SapProvider->SendUeData (params);
691  }
692  break;
693 
694  default:
695  NS_FATAL_ERROR ("method unexpected in state " << ToString (m_state));
696  break;
697  }
698 }
699 
700 std::vector<EpcX2Sap::ErabToBeSetupItem>
702 {
703  NS_LOG_FUNCTION (this);
704  std::vector<EpcX2Sap::ErabToBeSetupItem> ret;
705  for (std::map <uint8_t, Ptr<LteDataRadioBearerInfo> >::iterator it = m_drbMap.begin ();
706  it != m_drbMap.end ();
707  ++it)
708  {
710  etbsi.erabId = it->second->m_epsBearerIdentity;
711  etbsi.erabLevelQosParameters = it->second->m_epsBearer;
712  etbsi.dlForwarding = false;
713  etbsi.transportLayerAddress = it->second->m_transportLayerAddress;
714  etbsi.gtpTeid = it->second->m_gtpTeid;
715  ret.push_back (etbsi);
716  }
717  return ret;
718 }
719 
720 void
722 {
723  NS_LOG_FUNCTION (this);
724  switch (m_state)
725  {
727  NS_LOG_INFO ("Send UE CONTEXT RELEASE from target eNB to source eNB");
728  EpcX2SapProvider::UeContextReleaseParams ueCtxReleaseParams;
729  ueCtxReleaseParams.oldEnbUeX2apId = m_sourceX2apId;
730  ueCtxReleaseParams.newEnbUeX2apId = m_rnti;
731  ueCtxReleaseParams.sourceCellId = m_sourceCellId;
732  m_rrc->m_x2SapProvider->SendUeContextRelease (ueCtxReleaseParams);
734  m_rrc->m_handoverEndOkTrace (m_imsi, m_rrc->m_cellId, m_rnti);
735  break;
736 
737  default:
738  NS_FATAL_ERROR ("method unexpected in state " << ToString (m_state));
739  break;
740  }
741 }
742 
743 void
745 {
746  NS_LOG_FUNCTION (this << cellId);
747  switch (m_state)
748  {
750  NS_ASSERT (cellId == m_targetCellId);
751  NS_LOG_INFO ("target eNB sent HO preparation failure, aborting HO");
753  break;
754 
755  default:
756  NS_FATAL_ERROR ("method unexpected in state " << ToString (m_state));
757  break;
758  }
759 }
760 
761 void
763 {
764  NS_LOG_FUNCTION (this);
765  for (std::vector<EpcX2Sap::ErabsSubjectToStatusTransferItem>::iterator erabIt
766  = params.erabsSubjectToStatusTransferList.begin ();
767  erabIt != params.erabsSubjectToStatusTransferList.end ();
768  ++erabIt)
769  {
770  // LtePdcp::Status status;
771  // status.txSn = erabIt->dlPdcpSn;
772  // status.rxSn = erabIt->ulPdcpSn;
773  // uint8_t drbId = Bid2Drbid (erabIt->erabId);
774  // std::map <uint8_t, Ptr<LteDataRadioBearerInfo> >::iterator drbIt = m_drbMap.find (drbId);
775  // NS_ASSERT_MSG (drbIt != m_drbMap.end (), "could not find DRBID " << (uint32_t) drbId);
776  // drbIt->second->m_pdcp->SetStatus (status);
777  }
778 }
779 
780 void
782 {
783  NS_LOG_FUNCTION (this);
784  NS_ASSERT_MSG (m_state == HANDOVER_LEAVING, "method unexpected in state " << ToString (m_state));
786 }
787 
788 
789 // methods forwarded from RRC SAP
790 
791 void
793 {
794  NS_LOG_FUNCTION (this);
795  m_srb0->m_rlc->SetLteRlcSapUser (params.srb0SapUser);
796  m_srb1->m_pdcp->SetLtePdcpSapUser (params.srb1SapUser);
797 }
798 
799 void
801 {
802  NS_LOG_FUNCTION (this);
803  switch (m_state)
804  {
806  {
808 
809  if (m_rrc->m_admitRrcConnectionRequest == true)
810  {
811  m_imsi = msg.ueIdentity;
812  if (m_rrc->m_s1SapProvider != 0)
813  {
814  m_rrc->m_s1SapProvider->InitialUeMessage (m_imsi, m_rnti);
815  }
816 
817  // send RRC CONNECTION SETUP to UE
821  m_rrc->m_rrcSapUser->SendRrcConnectionSetup (m_rnti, msg2);
822 
825  m_rrc->m_connectionSetupTimeoutDuration,
828  }
829  else
830  {
831  NS_LOG_INFO ("rejecting connection request for RNTI " << m_rnti);
832 
833  // send RRC CONNECTION REJECT to UE
835  rejectMsg.waitTime = 3;
836  m_rrc->m_rrcSapUser->SendRrcConnectionReject (m_rnti, rejectMsg);
837 
839  m_rrc->m_connectionRejectedTimeoutDuration,
842  }
843  }
844  break;
845 
846  default:
847  NS_FATAL_ERROR ("method unexpected in state " << ToString (m_state));
848  break;
849  }
850 }
851 
852 void
854 {
855  NS_LOG_FUNCTION (this);
856  switch (m_state)
857  {
858  case CONNECTION_SETUP:
862  m_rrc->m_connectionEstablishedTrace (m_imsi, m_rrc->m_cellId, m_rnti);
863  break;
864 
865  default:
866  NS_FATAL_ERROR ("method unexpected in state " << ToString (m_state));
867  break;
868  }
869 }
870 
871 void
873 {
874  NS_LOG_FUNCTION (this);
875  switch (m_state)
876  {
880  {
881  // configure MAC (and scheduler)
883  req.m_rnti = m_rnti;
885  m_rrc->m_cmacSapProvider->UeUpdateConfigurationReq (req);
886 
887  // configure PHY
888  m_rrc->m_cphySapProvider->SetTransmissionMode (req.m_rnti, req.m_transmissionMode);
889 
891  m_rrc->m_cphySapProvider->SetPa (m_rnti, paDouble);
892 
894  }
896  m_rrc->m_connectionReconfigurationTrace (m_imsi, m_rrc->m_cellId, m_rnti);
897  break;
898 
899  // This case is added to NS-3 in order to handle bearer de-activation scenario for CONNECTED state UE
900  case CONNECTED_NORMALLY:
901  NS_LOG_INFO ("ignoring RecvRrcConnectionReconfigurationCompleted in state " << ToString (m_state));
902  break;
903 
904  case HANDOVER_LEAVING:
905  NS_LOG_INFO ("ignoring RecvRrcConnectionReconfigurationCompleted in state " << ToString (m_state));
906  break;
907 
908  case HANDOVER_JOINING:
909  {
911  NS_LOG_INFO ("Send PATH SWITCH REQUEST to the MME");
913  params.rnti = m_rnti;
914  params.cellId = m_rrc->m_cellId;
915  params.mmeUeS1Id = m_imsi;
917  for (std::map <uint8_t, Ptr<LteDataRadioBearerInfo> >::iterator it = m_drbMap.begin ();
918  it != m_drbMap.end ();
919  ++it)
920  {
922  b.epsBearerId = it->second->m_epsBearerIdentity;
923  b.teid = it->second->m_gtpTeid;
924  params.bearersToBeSwitched.push_back (b);
925  }
926  m_rrc->m_s1SapProvider->PathSwitchRequest (params);
927  }
928  break;
929 
930  default:
931  NS_FATAL_ERROR ("method unexpected in state " << ToString (m_state));
932  break;
933  }
934 }
935 
936 void
938 {
939  NS_LOG_FUNCTION (this);
940  switch (m_state)
941  {
942  case CONNECTED_NORMALLY:
943  break;
944 
945  case HANDOVER_LEAVING:
947  break;
948 
949  default:
950  NS_FATAL_ERROR ("method unexpected in state " << ToString (m_state));
951  break;
952  }
953 
957  m_rrc->m_rrcSapUser->SendRrcConnectionReestablishment (m_rnti, msg2);
959 }
960 
961 void
963 {
964  NS_LOG_FUNCTION (this);
966 }
967 
968 void
970 {
971  uint8_t measId = msg.measResults.measId;
972  NS_LOG_FUNCTION (this << (uint16_t) measId);
973  NS_LOG_LOGIC ("measId " << (uint16_t) measId
974  << " haveMeasResultNeighCells " << msg.measResults.haveMeasResultNeighCells
975  << " measResultListEutra " << msg.measResults.measResultListEutra.size ());
976  NS_LOG_LOGIC ("serving cellId " << m_rrc->m_cellId
977  << " RSRP " << (uint16_t) msg.measResults.rsrpResult
978  << " RSRQ " << (uint16_t) msg.measResults.rsrqResult);
979 
980  for (std::list <LteRrcSap::MeasResultEutra>::iterator it = msg.measResults.measResultListEutra.begin ();
981  it != msg.measResults.measResultListEutra.end ();
982  ++it)
983  {
984  NS_LOG_LOGIC ("neighbour cellId " << it->physCellId
985  << " RSRP " << (it->haveRsrpResult ? (uint16_t) it->rsrpResult : 255)
986  << " RSRQ " << (it->haveRsrqResult ? (uint16_t) it->rsrqResult : 255));
987  }
988 
989  if ((m_rrc->m_handoverManagementSapProvider != 0)
990  && (m_rrc->m_handoverMeasIds.find (measId) != m_rrc->m_handoverMeasIds.end ()))
991  {
992  // this measurement was requested by the handover algorithm
993  m_rrc->m_handoverManagementSapProvider->ReportUeMeas (m_rnti,
994  msg.measResults);
995  }
996 
997  if ((m_rrc->m_anrSapProvider != 0)
998  && (m_rrc->m_anrMeasIds.find (measId) != m_rrc->m_anrMeasIds.end ()))
999  {
1000  // this measurement was requested by the ANR function
1001  m_rrc->m_anrSapProvider->ReportUeMeas (msg.measResults);
1002  }
1003 
1004  if ((m_rrc->m_ffrRrcSapProvider != 0)
1005  && (m_rrc->m_ffrMeasIds.find (measId) != m_rrc->m_ffrMeasIds.end ()))
1006  {
1007  // this measurement was requested by the FFR function
1008  m_rrc->m_ffrRrcSapProvider->ReportUeMeas (m_rnti, msg.measResults);
1009  }
1010 
1011  // fire a trace source
1012  m_rrc->m_recvMeasurementReportTrace (m_imsi, m_rrc->m_cellId, m_rnti, msg);
1013 
1014 } // end of UeManager::RecvMeasurementReport
1015 
1016 
1017 // methods forwarded from CMAC SAP
1018 
1019 void
1021 {
1022  NS_LOG_FUNCTION (this << m_rnti);
1023  // at this stage used only by the scheduler for updating txMode
1024 
1026 
1028 
1029  // reconfigure the UE RRC
1031 }
1032 
1033 
1034 // methods forwarded from PDCP SAP
1035 
1036 void
1038 {
1039  NS_LOG_FUNCTION (this);
1040  if (params.lcid > 2)
1041  {
1042  // data radio bearer
1043  EpsBearerTag tag;
1044  tag.SetRnti (params.rnti);
1045  tag.SetBid (Lcid2Bid (params.lcid));
1046  params.pdcpSdu->AddPacketTag (tag);
1047  m_rrc->m_forwardUpCallback (params.pdcpSdu);
1048  }
1049 }
1050 
1051 
1052 uint16_t
1054 {
1055  return m_rnti;
1056 }
1057 
1058 uint64_t
1060 {
1061  return m_imsi;
1062 }
1063 
1064 uint16_t
1066 {
1068 }
1069 
1070 void
1072 {
1073  NS_LOG_FUNCTION (this);
1075  m_rrc->m_cphySapProvider->SetSrsConfigurationIndex (m_rnti, srsConfIndex);
1076  switch (m_state)
1077  {
1078  case INITIAL_RANDOM_ACCESS:
1079  // do nothing, srs conf index will be correctly enforced upon
1080  // RRC connection establishment
1081  break;
1082 
1083  default:
1085  break;
1086  }
1087 }
1088 
1091 {
1092  return m_state;
1093 }
1094 
1095 void
1097 {
1098  NS_LOG_FUNCTION (this);
1099  m_physicalConfigDedicated.pdschConfigDedicated = pdschConfigDedicated;
1100 
1102 
1103  // reconfigure the UE RRC
1105 }
1106 
1107 uint8_t
1109 {
1110  NS_LOG_FUNCTION (this);
1111  const uint8_t MAX_DRB_ID = 32;
1112  for (int drbid = (m_lastAllocatedDrbid + 1) % MAX_DRB_ID;
1113  drbid != m_lastAllocatedDrbid;
1114  drbid = (drbid + 1) % MAX_DRB_ID)
1115  {
1116  if (drbid != 0) // 0 is not allowed
1117  {
1118  if (m_drbMap.find (drbid) == m_drbMap.end ())
1119  {
1120  m_drbMap.insert (std::pair<uint8_t, Ptr<LteDataRadioBearerInfo> > (drbid, drbInfo));
1121  drbInfo->m_drbIdentity = drbid;
1122  m_lastAllocatedDrbid = drbid;
1123  return drbid;
1124  }
1125  }
1126  }
1127  NS_FATAL_ERROR ("no more data radio bearer ids available");
1128  return 0;
1129 }
1130 
1133 {
1134  NS_LOG_FUNCTION (this << (uint32_t) drbid);
1135  NS_ASSERT (0 != drbid);
1136  std::map<uint8_t, Ptr<LteDataRadioBearerInfo> >::iterator it = m_drbMap.find (drbid);
1137  NS_ABORT_IF (it == m_drbMap.end ());
1138  return it->second;
1139 }
1140 
1141 
1142 void
1144 {
1145  NS_LOG_FUNCTION (this << (uint32_t) drbid);
1146  std::map <uint8_t, Ptr<LteDataRadioBearerInfo> >::iterator it = m_drbMap.find (drbid);
1147  NS_ASSERT_MSG (it != m_drbMap.end (), "request to remove radio bearer with unknown drbid " << drbid);
1148  m_drbMap.erase (it);
1149 }
1150 
1151 
1154 {
1159  msg.haveMobilityControlInfo = false;
1160  msg.haveMeasConfig = true;
1161  msg.measConfig = m_rrc->m_ueMeasConfig;
1162 
1163  return msg;
1164 }
1165 
1168 {
1170 
1171  if (m_srb1 != 0)
1172  {
1174  stam.srbIdentity = m_srb1->m_srbIdentity;
1175  stam.logicalChannelConfig = m_srb1->m_logicalChannelConfig;
1176  rrcd.srbToAddModList.push_back (stam);
1177  }
1178 
1179  for (std::map <uint8_t, Ptr<LteDataRadioBearerInfo> >::iterator it = m_drbMap.begin ();
1180  it != m_drbMap.end ();
1181  ++it)
1182  {
1184  dtam.epsBearerIdentity = it->second->m_epsBearerIdentity;
1185  dtam.drbIdentity = it->second->m_drbIdentity;
1186  dtam.rlcConfig = it->second->m_rlcConfig;
1187  dtam.logicalChannelIdentity = it->second->m_logicalChannelIdentity;
1188  dtam.logicalChannelConfig = it->second->m_logicalChannelConfig;
1189  rrcd.drbToAddModList.push_back (dtam);
1190  }
1191 
1192  rrcd.havePhysicalConfigDedicated = true;
1194  return rrcd;
1195 }
1196 
1197 uint8_t
1199 {
1201 }
1202 
1203 uint8_t
1205 {
1206  NS_ASSERT (lcid > 2);
1207  return lcid - 2;
1208 }
1209 
1210 uint8_t
1211 UeManager::Drbid2Lcid (uint8_t drbid)
1212 {
1213  return drbid + 2;
1214 }
1215 uint8_t
1216 UeManager::Lcid2Bid (uint8_t lcid)
1217 {
1218  NS_ASSERT (lcid > 2);
1219  return lcid - 2;
1220 }
1221 
1222 uint8_t
1223 UeManager::Bid2Lcid (uint8_t bid)
1224 {
1225  return bid + 2;
1226 }
1227 
1228 uint8_t
1229 UeManager::Drbid2Bid (uint8_t drbid)
1230 {
1231  return drbid;
1232 }
1233 
1234 uint8_t
1236 {
1237  return bid;
1238 }
1239 
1240 
1241 void
1243 {
1244  NS_LOG_FUNCTION (this << ToString (newState));
1245  State oldState = m_state;
1246  m_state = newState;
1247  NS_LOG_INFO (this << " IMSI " << m_imsi << " RNTI " << m_rnti << " UeManager "
1248  << ToString (oldState) << " --> " << ToString (newState));
1249  m_stateTransitionTrace (m_imsi, m_rrc->m_cellId, m_rnti, oldState, newState);
1250 
1251  switch (newState)
1252  {
1253  case INITIAL_RANDOM_ACCESS:
1254  case HANDOVER_JOINING:
1255  NS_FATAL_ERROR ("cannot switch to an initial state");
1256  break;
1257 
1258  case CONNECTION_SETUP:
1259  break;
1260 
1261  case CONNECTED_NORMALLY:
1262  {
1264  {
1266  }
1267  }
1268  break;
1269 
1271  break;
1272 
1274  break;
1275 
1276  case HANDOVER_LEAVING:
1277  break;
1278 
1279  default:
1280  break;
1281  }
1282 }
1283 
1284 
1285 
1287 // eNB RRC methods
1289 
1291 
1293  : m_x2SapProvider (0),
1294  m_cmacSapProvider (0),
1295  m_handoverManagementSapProvider (0),
1296  m_anrSapProvider (0),
1297  m_ffrRrcSapProvider (0),
1298  m_rrcSapUser (0),
1299  m_macSapProvider (0),
1300  m_s1SapProvider (0),
1301  m_cphySapProvider (0),
1302  m_configured (false),
1303  m_lastAllocatedRnti (0),
1304  m_srsCurrentPeriodicityId (0),
1305  m_lastAllocatedConfigurationIndex (0),
1306  m_reconfigureUes (false)
1307 {
1308  NS_LOG_FUNCTION (this);
1317 }
1318 
1319 
1321 {
1322  NS_LOG_FUNCTION (this);
1323 }
1324 
1325 
1326 void
1328 {
1329  NS_LOG_FUNCTION (this);
1330  m_ueMap.clear ();
1331  delete m_cmacSapUser;
1333  delete m_anrSapUser;
1334  delete m_ffrRrcSapUser;
1335  delete m_rrcSapProvider;
1336  delete m_x2SapUser;
1337  delete m_s1SapUser;
1338  delete m_cphySapUser;
1339 }
1340 
1341 TypeId
1343 {
1344  NS_LOG_FUNCTION ("LteEnbRrc::GetTypeId");
1345  static TypeId tid = TypeId ("ns3::LteEnbRrc")
1346  .SetParent<Object> ()
1347  .AddConstructor<LteEnbRrc> ()
1348  .AddAttribute ("UeMap", "List of UeManager by C-RNTI.",
1349  ObjectMapValue (),
1351  MakeObjectMapChecker<UeManager> ())
1352  .AddAttribute ("DefaultTransmissionMode",
1353  "The default UEs' transmission mode (0: SISO)",
1354  UintegerValue (0), // default tx-mode
1356  MakeUintegerChecker<uint8_t> ())
1357  .AddAttribute ("EpsBearerToRlcMapping",
1358  "Specify which type of RLC will be used for each type of EPS bearer. ",
1361  MakeEnumChecker (RLC_SM_ALWAYS, "RlcSmAlways",
1362  RLC_UM_ALWAYS, "RlcUmAlways",
1363  RLC_AM_ALWAYS, "RlcAmAlways",
1364  PER_BASED, "PacketErrorRateBased"))
1365  .AddAttribute ("SystemInformationPeriodicity",
1366  "The interval for sending system information (Time value)",
1367  TimeValue (MilliSeconds (80)),
1369  MakeTimeChecker ())
1370 
1371  // SRS related attributes
1372  .AddAttribute ("SrsPeriodicity",
1373  "The SRS periodicity in milliseconds",
1374  UintegerValue (40),
1377  MakeUintegerChecker<uint32_t> ())
1378 
1379  // Timeout related attributes
1380  .AddAttribute ("ConnectionRequestTimeoutDuration",
1381  "After a RA attempt, if no RRC CONNECTION REQUEST is "
1382  "received before this time, the UE context is destroyed. "
1383  "Must account for reception of RAR and transmission of "
1384  "RRC CONNECTION REQUEST over UL GRANT.",
1385  TimeValue (MilliSeconds (15)),
1387  MakeTimeChecker ())
1388  .AddAttribute ("ConnectionSetupTimeoutDuration",
1389  "After accepting connection request, if no RRC CONNECTION "
1390  "SETUP COMPLETE is received before this time, the UE "
1391  "context is destroyed. Must account for the UE's reception "
1392  "of RRC CONNECTION SETUP and transmission of RRC CONNECTION "
1393  "SETUP COMPLETE.",
1394  TimeValue (MilliSeconds (150)),
1396  MakeTimeChecker ())
1397  .AddAttribute ("ConnectionRejectedTimeoutDuration",
1398  "Time to wait between sending a RRC CONNECTION REJECT and "
1399  "destroying the UE context",
1400  TimeValue (MilliSeconds (30)),
1402  MakeTimeChecker ())
1403  .AddAttribute ("HandoverJoiningTimeoutDuration",
1404  "After accepting a handover request, if no RRC CONNECTION "
1405  "RECONFIGURATION COMPLETE is received before this time, the "
1406  "UE context is destroyed. Must account for reception of "
1407  "X2 HO REQ ACK by source eNB, transmission of the Handover "
1408  "Command, non-contention-based random access and reception "
1409  "of the RRC CONNECTION RECONFIGURATION COMPLETE message.",
1410  TimeValue (MilliSeconds (200)),
1412  MakeTimeChecker ())
1413  .AddAttribute ("HandoverLeavingTimeoutDuration",
1414  "After issuing a Handover Command, if neither RRC "
1415  "CONNECTION RE-ESTABLISHMENT nor X2 UE Context Release has "
1416  "been previously received, the UE context is destroyed.",
1417  TimeValue (MilliSeconds (500)),
1419  MakeTimeChecker ())
1420 
1421  // Cell selection related attribute
1422  .AddAttribute ("QRxLevMin",
1423  "One of information transmitted within the SIB1 message, "
1424  "indicating the required minimum RSRP level that any UE must "
1425  "receive from this cell before it is allowed to camp to this "
1426  "cell. The default value -70 corresponds to -140 dBm and is "
1427  "the lowest possible value as defined by Section 6.3.4 of "
1428  "3GPP TS 36.133. This restriction, however, only applies to "
1429  "initial cell selection and EPC-enabled simulation.",
1431  IntegerValue (-70),
1433  MakeIntegerChecker<int8_t> (-70, -22))
1434 
1435  // Handover related attributes
1436  .AddAttribute ("AdmitHandoverRequest",
1437  "Whether to admit an X2 handover request from another eNB",
1438  BooleanValue (true),
1440  MakeBooleanChecker ())
1441  .AddAttribute ("AdmitRrcConnectionRequest",
1442  "Whether to admit a connection request from a UE",
1443  BooleanValue (true),
1445  MakeBooleanChecker ())
1446 
1447  // UE measurements related attributes
1448  .AddAttribute ("RsrpFilterCoefficient",
1449  "Determines the strength of smoothing effect induced by "
1450  "layer 3 filtering of RSRP in all attached UE; "
1451  "if set to 0, no layer 3 filtering is applicable",
1452  // i.e. the variable k in 3GPP TS 36.331 section 5.5.3.2
1453  UintegerValue (4),
1455  MakeUintegerChecker<uint8_t> (0))
1456  .AddAttribute ("RsrqFilterCoefficient",
1457  "Determines the strength of smoothing effect induced by "
1458  "layer 3 filtering of RSRQ in all attached UE; "
1459  "if set to 0, no layer 3 filtering is applicable",
1460  // i.e. the variable k in 3GPP TS 36.331 section 5.5.3.2
1461  UintegerValue (4),
1463  MakeUintegerChecker<uint8_t> (0))
1464 
1465  // Trace sources
1466  .AddTraceSource ("NewUeContext",
1467  "Fired upon creation of a new UE context.",
1469  "ns3::LteEnbRrc::NewUeContextTracedCallback")
1470  .AddTraceSource ("ConnectionEstablished",
1471  "Fired upon successful RRC connection establishment.",
1473  "ns3::LteEnbRrc::ConnectionHandoverTracedCallback")
1474  .AddTraceSource ("ConnectionReconfiguration",
1475  "trace fired upon RRC connection reconfiguration",
1477  "ns3::LteEnbRrc::ConnectionHandoverTracedCallback")
1478  .AddTraceSource ("HandoverStart",
1479  "trace fired upon start of a handover procedure",
1481  "ns3::LteEnbRrc::HandoverStartTracedCallback")
1482  .AddTraceSource ("HandoverEndOk",
1483  "trace fired upon successful termination of a handover procedure",
1485  "ns3::LteEnbRrc::ConnectionHandoverTracedCallback")
1486  .AddTraceSource ("RecvMeasurementReport",
1487  "trace fired when measurement report is received",
1489  "ns3::LteEnbRrc::ReceiveReportTracedCallback")
1490  ;
1491  return tid;
1492 }
1493 
1494 void
1496 {
1497  NS_LOG_FUNCTION (this << s);
1498  m_x2SapProvider = s;
1499 }
1500 
1501 EpcX2SapUser*
1503 {
1504  NS_LOG_FUNCTION (this);
1505  return m_x2SapUser;
1506 }
1507 
1508 void
1510 {
1511  NS_LOG_FUNCTION (this << s);
1512  m_cmacSapProvider = s;
1513 }
1514 
1517 {
1518  NS_LOG_FUNCTION (this);
1519  return m_cmacSapUser;
1520 }
1521 
1522 void
1524 {
1525  NS_LOG_FUNCTION (this << s);
1527 }
1528 
1531 {
1532  NS_LOG_FUNCTION (this);
1534 }
1535 
1536 void
1538 {
1539  NS_LOG_FUNCTION (this << s);
1540  m_anrSapProvider = s;
1541 }
1542 
1545 {
1546  NS_LOG_FUNCTION (this);
1547  return m_anrSapUser;
1548 }
1549 
1550 void
1552 {
1553  NS_LOG_FUNCTION (this << s);
1555 }
1556 
1559 {
1560  NS_LOG_FUNCTION (this);
1561  return m_ffrRrcSapUser;
1562 }
1563 
1564 void
1566 {
1567  NS_LOG_FUNCTION (this << s);
1568  m_rrcSapUser = s;
1569 }
1570 
1573 {
1574  NS_LOG_FUNCTION (this);
1575  return m_rrcSapProvider;
1576 }
1577 
1578 void
1580 {
1581  NS_LOG_FUNCTION (this);
1582  m_macSapProvider = s;
1583 }
1584 
1585 void
1587 {
1588  m_s1SapProvider = s;
1589 }
1590 
1591 
1594 {
1595  return m_s1SapUser;
1596 }
1597 
1598 void
1600 {
1601  NS_LOG_FUNCTION (this << s);
1602  m_cphySapProvider = s;
1603 }
1604 
1607 {
1608  NS_LOG_FUNCTION (this);
1609  return m_cphySapUser;
1610 }
1611 
1612 bool
1613 LteEnbRrc::HasUeManager (uint16_t rnti) const
1614 {
1615  NS_LOG_FUNCTION (this << (uint32_t) rnti);
1616  std::map<uint16_t, Ptr<UeManager> >::const_iterator it = m_ueMap.find (rnti);
1617  return (it != m_ueMap.end ());
1618 }
1619 
1622 {
1623  NS_LOG_FUNCTION (this << (uint32_t) rnti);
1624  NS_ASSERT (0 != rnti);
1625  std::map<uint16_t, Ptr<UeManager> >::iterator it = m_ueMap.find (rnti);
1626  NS_ASSERT_MSG (it != m_ueMap.end (), "RNTI " << rnti << " not found in eNB with cellId " << m_cellId);
1627  return it->second;
1628 }
1629 
1630 uint8_t
1632 {
1633  NS_LOG_FUNCTION (this);
1634 
1635  // SANITY CHECK
1636 
1638  "Measurement identities and reporting configuration should not have different quantity");
1639 
1640  if (Simulator::Now () != Seconds (0))
1641  {
1642  NS_FATAL_ERROR ("AddUeMeasReportConfig may not be called after the simulation has run");
1643  }
1644 
1645  // INPUT VALIDATION
1646 
1647  switch (config.triggerQuantity)
1648  {
1652  {
1653  NS_FATAL_ERROR ("The given triggerQuantity (RSRP) does not match with the given threshold2.choice");
1654  }
1655 
1661  {
1662  NS_FATAL_ERROR ("The given triggerQuantity (RSRP) does not match with the given threshold1.choice");
1663  }
1664  break;
1665 
1669  {
1670  NS_FATAL_ERROR ("The given triggerQuantity (RSRQ) does not match with the given threshold2.choice");
1671  }
1672 
1678  {
1679  NS_FATAL_ERROR ("The given triggerQuantity (RSRQ) does not match with the given threshold1.choice");
1680  }
1681  break;
1682 
1683  default:
1684  NS_FATAL_ERROR ("unsupported triggerQuantity");
1685  break;
1686  }
1687 
1689  {
1690  NS_FATAL_ERROR ("Only REPORT_STRONGEST_CELLS purpose is supported");
1691  }
1692 
1694  {
1695  NS_LOG_WARN ("reportQuantity = BOTH will be used instead of the given reportQuantity");
1696  }
1697 
1698  uint8_t nextId = m_ueMeasConfig.reportConfigToAddModList.size () + 1;
1699 
1700  // create the reporting configuration
1701  LteRrcSap::ReportConfigToAddMod reportConfig;
1702  reportConfig.reportConfigId = nextId;
1703  reportConfig.reportConfigEutra = config;
1704 
1705  // create the measurement identity
1707  measId.measId = nextId;
1708  measId.measObjectId = 1;
1709  measId.reportConfigId = nextId;
1710 
1711  // add both to the list of UE measurement configuration
1712  m_ueMeasConfig.reportConfigToAddModList.push_back (reportConfig);
1713  m_ueMeasConfig.measIdToAddModList.push_back (measId);
1714 
1715  return nextId;
1716 }
1717 
1718 void
1719 LteEnbRrc::ConfigureCell (uint8_t ulBandwidth, uint8_t dlBandwidth,
1720  uint16_t ulEarfcn, uint16_t dlEarfcn, uint16_t cellId)
1721 {
1722  NS_LOG_FUNCTION (this << (uint16_t) ulBandwidth << (uint16_t) dlBandwidth
1723  << ulEarfcn << dlEarfcn << cellId);
1725  m_cmacSapProvider->ConfigureMac (ulBandwidth, dlBandwidth);
1726  m_cphySapProvider->SetBandwidth (ulBandwidth, dlBandwidth);
1727  m_cphySapProvider->SetEarfcn (ulEarfcn, dlEarfcn);
1728  m_dlEarfcn = dlEarfcn;
1729  m_ulEarfcn = ulEarfcn;
1730  m_dlBandwidth = dlBandwidth;
1731  m_ulBandwidth = ulBandwidth;
1732  m_cellId = cellId;
1733  m_cphySapProvider->SetCellId (cellId);
1734  m_ffrRrcSapProvider->SetCellId (cellId);
1735  m_ffrRrcSapProvider->SetBandwidth(ulBandwidth, dlBandwidth);
1736 
1737  /*
1738  * Initializing the list of UE measurement configuration (m_ueMeasConfig).
1739  * Only intra-frequency measurements are supported, so only one measurement
1740  * object is created.
1741  */
1742 
1743  LteRrcSap::MeasObjectToAddMod measObject;
1744  measObject.measObjectId = 1;
1745  measObject.measObjectEutra.carrierFreq = m_dlEarfcn;
1747  measObject.measObjectEutra.presenceAntennaPort1 = false;
1748  measObject.measObjectEutra.neighCellConfig = 0;
1749  measObject.measObjectEutra.offsetFreq = 0;
1750  measObject.measObjectEutra.haveCellForWhichToReportCGI = false;
1751 
1752  m_ueMeasConfig.measObjectToAddModList.push_back (measObject);
1757  m_ueMeasConfig.haveSmeasure = false;
1759 
1760  // Enabling MIB transmission
1762  mib.dlBandwidth = m_dlBandwidth;
1764 
1765  // Enabling SIB1 transmission with default values
1770  m_sib1.cellSelectionInfo.qQualMin = -34; // not used, set as minimum value
1771  m_sib1.cellSelectionInfo.qRxLevMin = m_qRxLevMin; // set as minimum value
1773 
1774  /*
1775  * Enabling transmission of other SIB. The first time System Information is
1776  * transmitted is arbitrarily assumed to be at +0.016s, and then it will be
1777  * regularly transmitted every 80 ms by default (set the
1778  * SystemInformationPeriodicity attribute to configure this).
1779  */
1781 
1782  m_configured = true;
1783 
1784 }
1785 
1786 
1787 void
1788 LteEnbRrc::SetCellId (uint16_t cellId)
1789 {
1790  m_cellId = cellId;
1791 
1792  // update SIB1 too
1795 }
1796 
1797 bool
1799 {
1800  NS_LOG_FUNCTION (this << packet);
1801 
1802  EpsBearerTag tag;
1803  bool found = packet->RemovePacketTag (tag);
1804  NS_ASSERT_MSG (found, "no EpsBearerTag found in packet to be sent");
1805  Ptr<UeManager> ueManager = GetUeManager (tag.GetRnti ());
1806  ueManager->SendData (tag.GetBid (), packet);
1807 
1808  return true;
1809 }
1810 
1811 void
1813 {
1814  m_forwardUpCallback = cb;
1815 }
1816 
1817 void
1819 {
1820  NS_LOG_FUNCTION (this << rnti);
1822  "ConnectionRequestTimeout in unexpected state " << ToString (GetUeManager (rnti)->GetState ()));
1823  RemoveUe (rnti);
1824 }
1825 
1826 void
1828 {
1829  NS_LOG_FUNCTION (this << rnti);
1830  NS_ASSERT_MSG (GetUeManager (rnti)->GetState () == UeManager::CONNECTION_SETUP,
1831  "ConnectionSetupTimeout in unexpected state " << ToString (GetUeManager (rnti)->GetState ()));
1832  RemoveUe (rnti);
1833 }
1834 
1835 void
1837 {
1838  NS_LOG_FUNCTION (this << rnti);
1840  "ConnectionRejectedTimeout in unexpected state " << ToString (GetUeManager (rnti)->GetState ()));
1841  RemoveUe (rnti);
1842 }
1843 
1844 void
1846 {
1847  NS_LOG_FUNCTION (this << rnti);
1848  NS_ASSERT_MSG (GetUeManager (rnti)->GetState () == UeManager::HANDOVER_JOINING,
1849  "HandoverJoiningTimeout in unexpected state " << ToString (GetUeManager (rnti)->GetState ()));
1850  RemoveUe (rnti);
1851 }
1852 
1853 void
1855 {
1856  NS_LOG_FUNCTION (this << rnti);
1857  NS_ASSERT_MSG (GetUeManager (rnti)->GetState () == UeManager::HANDOVER_LEAVING,
1858  "HandoverLeavingTimeout in unexpected state " << ToString (GetUeManager (rnti)->GetState ()));
1859  RemoveUe (rnti);
1860 }
1861 
1862 void
1863 LteEnbRrc::SendHandoverRequest (uint16_t rnti, uint16_t cellId)
1864 {
1865  NS_LOG_FUNCTION (this << rnti << cellId);
1866  NS_LOG_LOGIC ("Request to send HANDOVER REQUEST");
1868 
1869  Ptr<UeManager> ueManager = GetUeManager (rnti);
1870  ueManager->PrepareHandover (cellId);
1871 
1872 }
1873 
1874 void
1876 {
1877  NS_LOG_FUNCTION (this << rnti);
1878  GetUeManager (rnti)->CompleteSetupUe (params);
1879 }
1880 
1881 void
1883 {
1884  NS_LOG_FUNCTION (this << rnti);
1885  GetUeManager (rnti)->RecvRrcConnectionRequest (msg);
1886 }
1887 
1888 void
1890 {
1891  NS_LOG_FUNCTION (this << rnti);
1892  GetUeManager (rnti)->RecvRrcConnectionSetupCompleted (msg);
1893 }
1894 
1895 void
1897 {
1898  NS_LOG_FUNCTION (this << rnti);
1899  GetUeManager (rnti)->RecvRrcConnectionReconfigurationCompleted (msg);
1900 }
1901 
1902 void
1904 {
1905  NS_LOG_FUNCTION (this << rnti);
1906  GetUeManager (rnti)->RecvRrcConnectionReestablishmentRequest (msg);
1907 }
1908 
1909 void
1911 {
1912  NS_LOG_FUNCTION (this << rnti);
1913  GetUeManager (rnti)->RecvRrcConnectionReestablishmentComplete (msg);
1914 }
1915 
1916 void
1918 {
1919  NS_LOG_FUNCTION (this << rnti);
1920  GetUeManager (rnti)->RecvMeasurementReport (msg);
1921 }
1922 
1923 void
1925 {
1926  Ptr<UeManager> ueManager = GetUeManager (request.rnti);
1927  ueManager->SetupDataRadioBearer (request.bearer, request.bearerId, request.gtpTeid, request.transportLayerAddress);
1928 }
1929 
1930 void
1932 {
1933  Ptr<UeManager> ueManager = GetUeManager (params.rnti);
1934  ueManager->SendUeContextRelease ();
1935 }
1936 
1937 void
1939 {
1940  NS_LOG_FUNCTION (this);
1941 
1942  NS_LOG_LOGIC ("Recv X2 message: HANDOVER REQUEST");
1943 
1944  NS_LOG_LOGIC ("oldEnbUeX2apId = " << req.oldEnbUeX2apId);
1945  NS_LOG_LOGIC ("sourceCellId = " << req.sourceCellId);
1946  NS_LOG_LOGIC ("targetCellId = " << req.targetCellId);
1947  NS_LOG_LOGIC ("mmeUeS1apId = " << req.mmeUeS1apId);
1948 
1949  NS_ASSERT (req.targetCellId == m_cellId);
1950 
1951  if (m_admitHandoverRequest == false)
1952  {
1953  NS_LOG_INFO ("rejecting handover request from cellId " << req.sourceCellId);
1955  res.oldEnbUeX2apId = req.oldEnbUeX2apId;
1956  res.sourceCellId = req.sourceCellId;
1957  res.targetCellId = req.targetCellId;
1958  res.cause = 0;
1959  res.criticalityDiagnostics = 0;
1961  return;
1962  }
1963 
1964  uint16_t rnti = AddUe (UeManager::HANDOVER_JOINING);
1966  if (anrcrv.valid == false)
1967  {
1968  NS_LOG_INFO (this << " failed to allocate a preamble for non-contention based RA => cannot accept HO");
1969  RemoveUe (rnti);
1970  NS_FATAL_ERROR ("should trigger HO Preparation Failure, but it is not implemented");
1971  return;
1972  }
1973 
1974  Ptr<UeManager> ueManager = GetUeManager (rnti);
1975  ueManager->SetSource (req.sourceCellId, req.oldEnbUeX2apId);
1976  ueManager->SetImsi (req.mmeUeS1apId);
1977 
1979  ackParams.oldEnbUeX2apId = req.oldEnbUeX2apId;
1980  ackParams.newEnbUeX2apId = rnti;
1981  ackParams.sourceCellId = req.sourceCellId;
1982  ackParams.targetCellId = req.targetCellId;
1983 
1984  for (std::vector <EpcX2Sap::ErabToBeSetupItem>::iterator it = req.bearers.begin ();
1985  it != req.bearers.end ();
1986  ++it)
1987  {
1988  ueManager->SetupDataRadioBearer (it->erabLevelQosParameters, it->erabId, it->gtpTeid, it->transportLayerAddress);
1990  i.erabId = it->erabId;
1991  ackParams.admittedBearers.push_back (i);
1992  }
1993 
1994  LteRrcSap::RrcConnectionReconfiguration handoverCommand = ueManager->GetRrcConnectionReconfigurationForHandover ();
1995  handoverCommand.haveMobilityControlInfo = true;
1996  handoverCommand.mobilityControlInfo.targetPhysCellId = m_cellId;
1997  handoverCommand.mobilityControlInfo.haveCarrierFreq = true;
2000  handoverCommand.mobilityControlInfo.haveCarrierBandwidth = true;
2003  handoverCommand.mobilityControlInfo.newUeIdentity = rnti;
2004  handoverCommand.mobilityControlInfo.haveRachConfigDedicated = true;
2007 
2012 
2013  Ptr<Packet> encodedHandoverCommand = m_rrcSapUser->EncodeHandoverCommand (handoverCommand);
2014 
2015  ackParams.rrcContext = encodedHandoverCommand;
2016 
2017  NS_LOG_LOGIC ("Send X2 message: HANDOVER REQUEST ACK");
2018 
2019  NS_LOG_LOGIC ("oldEnbUeX2apId = " << ackParams.oldEnbUeX2apId);
2020  NS_LOG_LOGIC ("newEnbUeX2apId = " << ackParams.newEnbUeX2apId);
2021  NS_LOG_LOGIC ("sourceCellId = " << ackParams.sourceCellId);
2022  NS_LOG_LOGIC ("targetCellId = " << ackParams.targetCellId);
2023 
2025 }
2026 
2027 void
2029 {
2030  NS_LOG_FUNCTION (this);
2031 
2032  NS_LOG_LOGIC ("Recv X2 message: HANDOVER REQUEST ACK");
2033 
2034  NS_LOG_LOGIC ("oldEnbUeX2apId = " << params.oldEnbUeX2apId);
2035  NS_LOG_LOGIC ("newEnbUeX2apId = " << params.newEnbUeX2apId);
2036  NS_LOG_LOGIC ("sourceCellId = " << params.sourceCellId);
2037  NS_LOG_LOGIC ("targetCellId = " << params.targetCellId);
2038 
2039  uint16_t rnti = params.oldEnbUeX2apId;
2040  Ptr<UeManager> ueManager = GetUeManager (rnti);
2041  ueManager->RecvHandoverRequestAck (params);
2042 }
2043 
2044 void
2046 {
2047  NS_LOG_FUNCTION (this);
2048 
2049  NS_LOG_LOGIC ("Recv X2 message: HANDOVER PREPARATION FAILURE");
2050 
2051  NS_LOG_LOGIC ("oldEnbUeX2apId = " << params.oldEnbUeX2apId);
2052  NS_LOG_LOGIC ("sourceCellId = " << params.sourceCellId);
2053  NS_LOG_LOGIC ("targetCellId = " << params.targetCellId);
2054  NS_LOG_LOGIC ("cause = " << params.cause);
2055  NS_LOG_LOGIC ("criticalityDiagnostics = " << params.criticalityDiagnostics);
2056 
2057  uint16_t rnti = params.oldEnbUeX2apId;
2058  Ptr<UeManager> ueManager = GetUeManager (rnti);
2059  ueManager->RecvHandoverPreparationFailure (params.targetCellId);
2060 }
2061 
2062 void
2064 {
2065  NS_LOG_FUNCTION (this);
2066 
2067  NS_LOG_LOGIC ("Recv X2 message: SN STATUS TRANSFER");
2068 
2069  NS_LOG_LOGIC ("oldEnbUeX2apId = " << params.oldEnbUeX2apId);
2070  NS_LOG_LOGIC ("newEnbUeX2apId = " << params.newEnbUeX2apId);
2071  NS_LOG_LOGIC ("erabsSubjectToStatusTransferList size = " << params.erabsSubjectToStatusTransferList.size ());
2072 
2073  uint16_t rnti = params.newEnbUeX2apId;
2074  Ptr<UeManager> ueManager = GetUeManager (rnti);
2075  ueManager->RecvSnStatusTransfer (params);
2076 }
2077 
2078 void
2080 {
2081  NS_LOG_FUNCTION (this);
2082 
2083  NS_LOG_LOGIC ("Recv X2 message: UE CONTEXT RELEASE");
2084 
2085  NS_LOG_LOGIC ("oldEnbUeX2apId = " << params.oldEnbUeX2apId);
2086  NS_LOG_LOGIC ("newEnbUeX2apId = " << params.newEnbUeX2apId);
2087 
2088  uint16_t rnti = params.oldEnbUeX2apId;
2089  GetUeManager (rnti)->RecvUeContextRelease (params);
2090  RemoveUe (rnti);
2091 }
2092 
2093 void
2095 {
2096  NS_LOG_FUNCTION (this);
2097 
2098  NS_LOG_LOGIC ("Recv X2 message: LOAD INFORMATION");
2099 
2100  NS_LOG_LOGIC ("Number of cellInformationItems = " << params.cellInformationList.size ());
2101 
2103 }
2104 
2105 void
2107 {
2108  NS_LOG_FUNCTION (this);
2109 
2110  NS_LOG_LOGIC ("Recv X2 message: RESOURCE STATUS UPDATE");
2111 
2112  NS_LOG_LOGIC ("Number of cellMeasurementResultItems = " << params.cellMeasurementResultList.size ());
2113 
2114  NS_ASSERT ("Processing of RESOURCE STATUS UPDATE X2 message IS NOT IMPLEMENTED");
2115 }
2116 
2117 void
2119 {
2120  NS_LOG_FUNCTION (this);
2121 
2122  NS_LOG_LOGIC ("Recv UE DATA FORWARDING through X2 interface");
2123  NS_LOG_LOGIC ("sourceCellId = " << params.sourceCellId);
2124  NS_LOG_LOGIC ("targetCellId = " << params.targetCellId);
2125  NS_LOG_LOGIC ("gtpTeid = " << params.gtpTeid);
2126  NS_LOG_LOGIC ("ueData = " << params.ueData);
2127  NS_LOG_LOGIC ("ueData size = " << params.ueData->GetSize ());
2128 
2129  std::map<uint32_t, X2uTeidInfo>::iterator
2130  teidInfoIt = m_x2uTeidInfoMap.find (params.gtpTeid);
2131  if (teidInfoIt != m_x2uTeidInfoMap.end ())
2132  {
2133  GetUeManager (teidInfoIt->second.rnti)->SendData (teidInfoIt->second.drbid, params.ueData);
2134  }
2135  else
2136  {
2137  NS_FATAL_ERROR ("X2-U data received but no X2uTeidInfo found");
2138  }
2139 }
2140 
2141 
2142 uint16_t
2144 {
2145  NS_LOG_FUNCTION (this);
2147 }
2148 
2149 void
2151 {
2152  Ptr<UeManager> ueManager = GetUeManager (cmacParams.m_rnti);
2153  ueManager->CmacUeConfigUpdateInd (cmacParams);
2154 }
2155 
2156 void
2157 LteEnbRrc::DoNotifyLcConfigResult (uint16_t rnti, uint8_t lcid, bool success)
2158 {
2159  NS_LOG_FUNCTION (this << (uint32_t) rnti);
2160  NS_FATAL_ERROR ("not implemented");
2161 }
2162 
2163 
2164 uint8_t
2166 {
2167  NS_LOG_FUNCTION (this);
2168  uint8_t measId = AddUeMeasReportConfig (reportConfig);
2169  m_handoverMeasIds.insert (measId);
2170  return measId;
2171 }
2172 
2173 void
2174 LteEnbRrc::DoTriggerHandover (uint16_t rnti, uint16_t targetCellId)
2175 {
2176  NS_LOG_FUNCTION (this << rnti << targetCellId);
2177 
2178  bool isHandoverAllowed = true;
2179 
2180  if (m_anrSapProvider != 0)
2181  {
2182  // ensure that proper neighbour relationship exists between source and target cells
2183  bool noHo = m_anrSapProvider->GetNoHo (targetCellId);
2184  bool noX2 = m_anrSapProvider->GetNoX2 (targetCellId);
2185  NS_LOG_DEBUG (this << " cellId=" << m_cellId
2186  << " targetCellId=" << targetCellId
2187  << " NRT.NoHo=" << noHo << " NRT.NoX2=" << noX2);
2188 
2189  if (noHo || noX2)
2190  {
2191  isHandoverAllowed = false;
2192  NS_LOG_LOGIC (this << " handover to cell " << targetCellId
2193  << " is not allowed by ANR");
2194  }
2195  }
2196 
2197  Ptr<UeManager> ueManager = GetUeManager (rnti);
2198  NS_ASSERT_MSG (ueManager != 0, "Cannot find UE context with RNTI " << rnti);
2199 
2200  if (ueManager->GetState () != UeManager::CONNECTED_NORMALLY)
2201  {
2202  isHandoverAllowed = false;
2203  NS_LOG_LOGIC (this << " handover is not allowed because the UE"
2204  << " rnti=" << rnti << " is in "
2205  << ToString (ueManager->GetState ()) << " state");
2206  }
2207 
2208  if (isHandoverAllowed)
2209  {
2210  // initiate handover execution
2211  ueManager->PrepareHandover (targetCellId);
2212  }
2213 }
2214 
2215 uint8_t
2217 {
2218  NS_LOG_FUNCTION (this);
2219  uint8_t measId = AddUeMeasReportConfig (reportConfig);
2220  m_anrMeasIds.insert (measId);
2221  return measId;
2222 }
2223 
2224 uint8_t
2226 {
2227  NS_LOG_FUNCTION (this);
2228  uint8_t measId = AddUeMeasReportConfig (reportConfig);
2229  m_ffrMeasIds.insert (measId);
2230  return measId;
2231 }
2232 
2233 void
2235 {
2236  NS_LOG_FUNCTION (this);
2237  Ptr<UeManager> ueManager = GetUeManager (rnti);
2238  ueManager->SetPdschConfigDedicated (pdschConfigDedicated);
2239 }
2240 
2241 void
2243 {
2244  NS_LOG_FUNCTION (this);
2245 
2247 }
2248 
2249 uint16_t
2251 {
2252  NS_LOG_FUNCTION (this);
2253  bool found = false;
2254  uint16_t rnti;
2255  for (rnti = m_lastAllocatedRnti + 1;
2256  (rnti != m_lastAllocatedRnti - 1) && (!found);
2257  ++rnti)
2258  {
2259  if ((rnti != 0) && (m_ueMap.find (rnti) == m_ueMap.end ()))
2260  {
2261  found = true;
2262  break;
2263  }
2264  }
2265 
2266  NS_ASSERT_MSG (found, "no more RNTIs available (do you have more than 65535 UEs in a cell?)");
2267  m_lastAllocatedRnti = rnti;
2268  Ptr<UeManager> ueManager = CreateObject<UeManager> (this, rnti, state);
2269  m_ueMap.insert (std::pair<uint16_t, Ptr<UeManager> > (rnti, ueManager));
2270  ueManager->Initialize ();
2271  NS_LOG_DEBUG (this << " New UE RNTI " << rnti << " cellId " << m_cellId << " srs CI " << ueManager->GetSrsConfigurationIndex ());
2272  m_newUeContextTrace (m_cellId, rnti);
2273  return rnti;
2274 }
2275 
2276 void
2277 LteEnbRrc::RemoveUe (uint16_t rnti)
2278 {
2279  NS_LOG_FUNCTION (this << (uint32_t) rnti);
2280  std::map <uint16_t, Ptr<UeManager> >::iterator it = m_ueMap.find (rnti);
2281  NS_ASSERT_MSG (it != m_ueMap.end (), "request to remove UE info with unknown rnti " << rnti);
2282  uint16_t srsCi = (*it).second->GetSrsConfigurationIndex ();
2283  m_ueMap.erase (it);
2284  m_cmacSapProvider->RemoveUe (rnti);
2285  m_cphySapProvider->RemoveUe (rnti);
2286  if (m_s1SapProvider != 0)
2287  {
2289  }
2290  // need to do this after UeManager has been deleted
2291  RemoveSrsConfigurationIndex (srsCi);
2292 }
2293 
2294 TypeId
2296 {
2297  switch (m_epsBearerToRlcMapping)
2298  {
2299  case RLC_SM_ALWAYS:
2300  return LteRlcSm::GetTypeId ();
2301  break;
2302 
2303  case RLC_UM_ALWAYS:
2304  return LteRlcUm::GetTypeId ();
2305  break;
2306 
2307  case RLC_AM_ALWAYS:
2308  return LteRlcAm::GetTypeId ();
2309  break;
2310 
2311  case PER_BASED:
2312  if (bearer.GetPacketErrorLossRate () > 1.0e-5)
2313  {
2314  return LteRlcUm::GetTypeId ();
2315  }
2316  else
2317  {
2318  return LteRlcAm::GetTypeId ();
2319  }
2320  break;
2321 
2322  default:
2323  return LteRlcSm::GetTypeId ();
2324  break;
2325  }
2326 }
2327 
2328 
2329 void
2330 LteEnbRrc::AddX2Neighbour (uint16_t cellId)
2331 {
2332  NS_LOG_FUNCTION (this << cellId);
2333 
2334  if (m_anrSapProvider != 0)
2335  {
2337  }
2338 }
2339 
2340 void
2341 LteEnbRrc::SetCsgId (uint32_t csgId, bool csgIndication)
2342 {
2343  NS_LOG_FUNCTION (this << csgId << csgIndication);
2345  m_sib1.cellAccessRelatedInfo.csgIndication = csgIndication;
2347 }
2348 
2349 
2351 static const uint8_t SRS_ENTRIES = 9;
2356 static const uint16_t g_srsPeriodicity[SRS_ENTRIES] = {0, 2, 5, 10, 20, 40, 80, 160, 320};
2362 static const uint16_t g_srsCiLow[SRS_ENTRIES] = {0, 0, 2, 7, 17, 37, 77, 157, 317};
2368 static const uint16_t g_srsCiHigh[SRS_ENTRIES] = {0, 1, 6, 16, 36, 76, 156, 316, 636};
2369 
2370 void
2372 {
2373  NS_LOG_FUNCTION (this << p);
2374  for (uint32_t id = 1; id < SRS_ENTRIES; ++id)
2375  {
2376  if (g_srsPeriodicity[id] == p)
2377  {
2379  return;
2380  }
2381  }
2382  // no match found
2383  std::ostringstream allowedValues;
2384  for (uint32_t id = 1; id < SRS_ENTRIES; ++id)
2385  {
2386  allowedValues << g_srsPeriodicity[id] << " ";
2387  }
2388  NS_FATAL_ERROR ("illecit SRS periodicity value " << p << ". Allowed values: " << allowedValues.str ());
2389 }
2390 
2391 uint32_t
2393 {
2394  NS_LOG_FUNCTION (this);
2396  NS_ASSERT (m_srsCurrentPeriodicityId < SRS_ENTRIES);
2397  return g_srsPeriodicity[m_srsCurrentPeriodicityId];
2398 }
2399 
2400 
2401 uint16_t
2403 {
2405  // SRS
2407  NS_ASSERT (m_srsCurrentPeriodicityId < SRS_ENTRIES);
2408  NS_LOG_DEBUG (this << " SRS p " << g_srsPeriodicity[m_srsCurrentPeriodicityId] << " set " << m_ueSrsConfigurationIndexSet.size ());
2409  if (m_ueSrsConfigurationIndexSet.size () >= g_srsPeriodicity[m_srsCurrentPeriodicityId])
2410  {
2411  NS_FATAL_ERROR ("too many UEs (" << m_ueSrsConfigurationIndexSet.size () + 1
2412  << ") for current SRS periodicity "
2413  << g_srsPeriodicity[m_srsCurrentPeriodicityId]
2414  << ", consider increasing the value of ns3::LteEnbRrc::SrsPeriodicity");
2415  }
2416 
2417  if (m_ueSrsConfigurationIndexSet.empty ())
2418  {
2419  // first entry
2422  }
2423  else
2424  {
2425  // find a CI from the available ones
2426  std::set<uint16_t>::reverse_iterator rit = m_ueSrsConfigurationIndexSet.rbegin ();
2427  NS_ASSERT (rit != m_ueSrsConfigurationIndexSet.rend ());
2428  NS_LOG_DEBUG (this << " lower bound " << (*rit) << " of " << g_srsCiHigh[m_srsCurrentPeriodicityId]);
2429  if ((*rit) < g_srsCiHigh[m_srsCurrentPeriodicityId])
2430  {
2431  // got it from the upper bound
2432  m_lastAllocatedConfigurationIndex = (*rit) + 1;
2434  }
2435  else
2436  {
2437  // look for released ones
2438  for (uint16_t srcCi = g_srsCiLow[m_srsCurrentPeriodicityId]; srcCi < g_srsCiHigh[m_srsCurrentPeriodicityId]; srcCi++)
2439  {
2440  std::set<uint16_t>::iterator it = m_ueSrsConfigurationIndexSet.find (srcCi);
2441  if (it == m_ueSrsConfigurationIndexSet.end ())
2442  {
2444  m_ueSrsConfigurationIndexSet.insert (srcCi);
2445  break;
2446  }
2447  }
2448  }
2449  }
2451 
2452 }
2453 
2454 
2455 void
2457 {
2458  NS_LOG_FUNCTION (this << srcCi);
2459  std::set<uint16_t>::iterator it = m_ueSrsConfigurationIndexSet.find (srcCi);
2460  NS_ASSERT_MSG (it != m_ueSrsConfigurationIndexSet.end (), "request to remove unkwown SRS CI " << srcCi);
2461  m_ueSrsConfigurationIndexSet.erase (it);
2462 }
2463 
2464 uint8_t
2466 {
2467  if (bearer.IsGbr ())
2468  {
2469  return 1;
2470  }
2471  else
2472  {
2473  return 2;
2474  }
2475 }
2476 
2477 uint8_t
2479 {
2480  return bearer.qci;
2481 }
2482 
2483 void
2485 {
2486  // NS_LOG_FUNCTION (this);
2487 
2488  /*
2489  * For simplicity, we use the same periodicity for all SIBs. Note that in real
2490  * systems the periodicy of each SIBs could be different.
2491  */
2493  si.haveSib2 = true;
2498 
2500  LteRrcSap::RachConfigCommon rachConfigCommon;
2502  rachConfigCommon.raSupervisionInfo.preambleTransMax = rc.preambleTransMax;
2504  si.sib2.radioResourceConfigCommon.rachConfigCommon = rachConfigCommon;
2505 
2508 }
2509 
2510 
2511 } // namespace ns3
2512 
virtual void AddNeighbourRelation(uint16_t cellId)=0
Add a new Neighbour Relation entry.
Callback< void, Ptr< Packet > > m_forwardUpCallback
Definition: lte-enb-rrc.h:1045
Ipv4Address transportLayerAddress
IP Address of the SGW, see 36.423 9.2.1.
static const uint8_t SRS_ENTRIES
Number of distinct SRS periodicity plus one.
virtual void SetMasterInformationBlock(LteRrcSap::MasterInformationBlock mib)=0
TracedCallback< uint64_t, uint16_t, uint16_t, State, State > m_stateTransitionTrace
The StateTransition trace source.
Definition: lte-enb-rrc.h:458
TracedCallback< uint64_t, uint16_t, uint16_t > m_handoverEndOkTrace
The HandoverEndOk trace source.
Definition: lte-enb-rrc.h:1245
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
The Srb1 attribute.
Definition: lte-enb-rrc.h:429
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:629
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:73
These service primitives of this part of the X2 SAP are provided by the X2 entity and issued by RRC e...
Definition: epc-x2-sap.h: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
AttributeValue implementation for Boolean.
Definition: boolean.h:34
Callback template class.
Definition: callback.h:978
void RecordDataRadioBearersToBeStarted()
Start all configured data radio bearers.
Definition: lte-enb-rrc.cc:420
virtual void DoDispose()
Destructor implementation.
Definition: lte-enb-rrc.cc:272
uint16_t m_dlBandwidth
Downlink transmission bandwidth configuration in number of Resource Blocks.
Definition: lte-enb-rrc.h:1099
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:781
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:318
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:744
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition: object-base.h:44
void DoNotifyLcConfigResult(uint16_t rnti, uint8_t lcid, bool success)
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
Interface to the FFR algorithm instance.
Definition: lte-enb-rrc.h:1070
virtual void SetEarfcn(uint16_t ulEarfcn, uint16_t dlEarfcn)=0
static TypeId GetTypeId(void)
Definition: lte-rlc.cc:184
void SetCellId(uint16_t m_cellId)
set the cell id of this eNB
LteFfrRrcSapUser * m_ffrRrcSapUser
Receive API calls from the FFR algorithm instance.
Definition: lte-enb-rrc.h:1068
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
The AdmitHandoverRequest attribute.
Definition: lte-enb-rrc.h:1168
std::vector< CellMeasurementResultItem > cellMeasurementResultList
Definition: epc-x2-sap.h:316
enum ns3::LteRrcSap::ReportConfigEutra::@75 reportQuantity
The quantities to be included in the measurement report, always assumed to be BOTH.
friend class EnbRrcMemberLteEnbCmacSapUser
Definition: lte-enb-rrc.h:512
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
Ptr< const AttributeAccessor > MakeEnumAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
Definition: enum.h:209
Ptr< const AttributeAccessor > MakeBooleanAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
Definition: boolean.h:81
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:58
void AddPacketTag(const Tag &tag) const
Add a packet tag.
Definition: packet.cc:836
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.
RSRP is used for the threshold.
Definition: lte-rrc-sap.h:314
enum ns3::LteRrcSap::ReportConfigEutra::@72 eventId
Choice of E-UTRA event triggered reporting criteria.
static TypeId GetTypeId(void)
uint16_t m_sourceCellId
Definition: lte-enb-rrc.h:461
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
The C-RNTI attribute.
Definition: lte-enb-rrc.h:434
std::list< SrbToAddMod > srbToAddModList
Definition: lte-rrc-sap.h:253
Hold a signed integer type.
Definition: integer.h:44
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:201
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:1103
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition: nstime.h:867
uint16_t GetNewSrsConfigurationIndex(void)
Allocate a new SRS configuration index for a new UE.
void SetTypeId(TypeId tid)
Set the TypeId of the Objects to be created by this factory.
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:766
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
Uplink transmission bandwidth configuration in number of Resource Blocks.
Definition: lte-enb-rrc.h:1101
uint8_t m_lastRrcTransactionIdentifier
Definition: lte-enb-rrc.h:441
uint16_t m_srsCurrentPeriodicityId
The SrsPeriodicity attribute.
Definition: lte-enb-rrc.h:1153
The LTE Radio Resource Control entity at the eNB.
Definition: lte-enb-rrc.h:509
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:244
uint16_t DoAllocateTemporaryCellRnti()
#define NS_FATAL_ERROR(msg)
Fatal error handling.
Definition: fatal-error.h:100
uint64_t m_imsi
International Mobile Subscriber Identity assigned to this UE.
Definition: lte-enb-rrc.h:439
virtual uint16_t AllocateTemporaryCellRnti()
request the allocation of a Temporary C-RNTI
Definition: lte-enb-rrc.cc:77
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:60
Time m_handoverLeavingTimeoutDuration
The HandoverLeavingTimeoutDuration attribute.
Definition: lte-enb-rrc.h:1219
uint64_t mbrDl
maximum bitrate in downlink
void SetBid(uint8_t bid)
Set the bearer id to the given value.
Event A2: Serving becomes worse than absolute threshold.
Definition: lte-rrc-sap.h:332
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:819
uint8_t GetBid(void) const
Time m_connectionRejectedTimeoutDuration
The ConnectionRejectedTimeoutDuration attribute.
Definition: lte-enb-rrc.h:1204
LteMacSapProvider * m_macSapProvider
Interface to the eNodeB MAC instance, to be used by RLC instances.
Definition: lte-enb-rrc.h:1078
LteHandoverManagementSapUser * GetLteHandoverManagementSapUser()
Get the Handover Management SAP offered by this RRC.
LteEnbRrcSapProvider * m_rrcSapProvider
Interface to receive messages from UE over the RRC protocol.
Definition: lte-enb-rrc.h:1075
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:89
State GetState() const
void SetImsi(uint64_t imsi)
Set the IMSI.
Definition: lte-enb-rrc.cc:325
void SetRnti(uint16_t rnti)
Definition: lte-rlc.cc:126
void SetLteMacSapProvider(LteMacSapProvider *s)
set the MAC SAP provider.
void SendUeContextRelease()
send the UE CONTEXT RELEASE X2 message to the source eNB, thus successfully terminating an X2 handove...
Definition: lte-enb-rrc.cc:721
RSRQ is used for the threshold.
Definition: lte-rrc-sap.h:315
LteRrcSap::RrcConnectionReconfiguration GetRrcConnectionReconfigurationForHandover()
Definition: lte-enb-rrc.cc:636
void SwitchToState(State s)
Switch the UeManager to the given state.
Time m_connectionSetupTimeoutDuration
The ConnectionSetupTimeoutDuration attribute.
Definition: lte-enb-rrc.h:1199
static const std::string g_ueManagerStateName[UeManager::NUM_STATES]
Map each of UE Manager states to its string representation.
Definition: lte-enb-rrc.cc:102
void RecvRrcConnectionReconfigurationCompleted(LteRrcSap::RrcConnectionReconfigurationCompleted msg)
Part of the RRC protocol. Implement the LteEnbRrcSapProvider::RecvRrcConnectionReconfigurationComplet...
Definition: lte-enb-rrc.cc:872
void ReleaseDataRadioBearer(uint8_t drbid)
Release a given radio bearer.
Definition: lte-enb-rrc.cc:452
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
Interface to receive messages from neighbour eNodeB over the X2 interface.
Definition: lte-enb-rrc.h:1048
uint8_t m_rsrqFilterCoefficient
The RsrqFilterCoefficient attribute.
Definition: lte-enb-rrc.h:1185
LteEnbRrcSapUser * m_rrcSapUser
Interface to send messages to UE over the RRC protocol.
Definition: lte-enb-rrc.h:1073
uint16_t m_dlEarfcn
Downlink E-UTRA Absolute Radio Frequency Channel Number.
Definition: lte-enb-rrc.h:1095
bool m_needPhyMacConfiguration
Definition: lte-enb-rrc.h:464
Ptr< LteEnbRrc > m_rrc
Pointer to the parent eNodeB RRC.
Definition: lte-enb-rrc.h:445
EpcEnbS1SapProvider * m_s1SapProvider
Interface to send messages to core network over the S1 protocol.
Definition: lte-enb-rrc.h:1081
LteRrcSap::SystemInformationBlockType1 m_sib1
The System Information Block Type 1 that is currently broadcasted over BCH.
Definition: lte-enb-rrc.h:1106
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
Create a TraceSourceAccessor which will control access to the underlying trace source.
Time m_connectionRequestTimeoutDuration
The ConnectionRequestTimeoutDuration attribute.
Definition: lte-enb-rrc.h:1192
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:439
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:58
LteHandoverManagementSapUser * m_handoverManagementSapUser
Receive API calls from the handover algorithm instance.
Definition: lte-enb-rrc.h:1058
Ptr< const AttributeAccessor > MakeIntegerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
Definition: integer.h:45
void DoCompleteSetupUe(uint16_t rnti, LteEnbRrcSapProvider::CompleteSetupUeParameters params)
Part of the RRC protocol. Forwarding LteEnbRrcSapProvider::CompleteSetupUe interface to UeManager::Co...
SystemInformationBlockType1 sourceSystemInformationBlockType1
Definition: lte-rrc-sap.h:552
TracedCallback< uint16_t, uint16_t > m_newUeContextTrace
The NewUeContext trace source.
Definition: lte-enb-rrc.h:1225
Service Access Point (SAP) offered by the MAC to the RRC See Femto Forum MAC Scheduler Interface Spec...
Template for the implementation of the LteFfrRrcSapUser as a member of an owner class of type C to wh...
LteEnbCmacSapUser * m_cmacSapUser
Receive API calls from the eNodeB MAC instance.
Definition: lte-enb-rrc.h:1053
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.
Event A5: PCell becomes worse than absolute threshold1 AND Neighbour becomes better than another abso...
Definition: lte-rrc-sap.h:335
bool m_admitRrcConnectionRequest
The AdmitRrcConnectionRequest attribute.
Definition: lte-enb-rrc.h:1173
int8_t m_qRxLevMin
The QRxLevMin attribute.
Definition: lte-enb-rrc.h:1163
uint16_t rnti
the C-RNTI identifying the UE
Definition: lte-pdcp-sap.h:79
LtePdcpSapUser * m_drbPdcpSapUser
Definition: lte-enb-rrc.h:449
uint8_t AddUeMeasReportConfig(LteRrcSap::ReportConfigEutra config)
Add a new UE measurement reporting configuration.
EventId m_connectionRejectedTimeout
The delay before a connection rejected timeout occurs.
Definition: lte-enb-rrc.h:484
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 ...
Reference Signal Received Quality.
Definition: lte-rrc-sap.h:363
Ptr< const AttributeAccessor > MakePointerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
Definition: pointer.h:210
Hold variables of type enum.
Definition: enum.h:54
LteRrcSap::RrcConnectionReconfiguration BuildRrcConnectionReconfiguration()
Ptr< LteSignalingRadioBearerInfo > m_srb0
The Srb0 attribute.
Definition: lte-enb-rrc.h:425
void DoRecvRrcConnectionRequest(uint16_t rnti, LteRrcSap::RrcConnectionRequest msg)
Part of the RRC protocol. Forwarding LteEnbRrcSapProvider::RecvRrcConnectionRequest interface to UeMa...
AttributeValue implementation for Time.
Definition: nstime.h:921
uint16_t m_ulEarfcn
Uplink E-UTRA Absolute Radio Frequency Channel Number.
Definition: lte-enb-rrc.h:1097
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
Create an Object instance of the configured TypeId.
TracedCallback< uint64_t, uint16_t, uint16_t > m_connectionEstablishedTrace
The ConnectionEstablished trace source.
Definition: lte-enb-rrc.h:1230
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:44
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:83
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
Event A4: Neighbour becomes better than absolute threshold.
Definition: lte-rrc-sap.h:334
Parameters of the SN STATUS TRANSFER message.
Definition: epc-x2-sap.h:273
PhysicalConfigDedicated physicalConfigDedicated
Definition: lte-rrc-sap.h:257
LteEnbCphySapProvider * m_cphySapProvider
Interface to the eNodeB PHY instance.
Definition: lte-enb-rrc.h:1088
std::set< uint8_t > m_ffrMeasIds
List of measurement identities which are intended for FFR purpose.
Definition: lte-enb-rrc.h:1124
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:161
void SendData(uint8_t bid, Ptr< Packet > p)
Send a data packet over the appropriate Data Radio Bearer.
Definition: lte-enb-rrc.cc:643
std::set< uint8_t > m_handoverMeasIds
List of measurement identities which are intended for handover purpose.
Definition: lte-enb-rrc.h:1120
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
Definition: log.h:252
enum ns3::LteRrcSap::SoundingRsUlConfigDedicated::@68 type
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:414
uint8_t Bid2Lcid(uint8_t bid)
uint16_t m_sourceX2apId
Definition: lte-enb-rrc.h:460
Parameters for [re]configuring the UE.
std::map< uint32_t, X2uTeidInfo > m_x2uTeidInfoMap
Definition: lte-enb-rrc.h:1133
TracedCallback< uint64_t, uint16_t, uint16_t, LteRrcSap::MeasurementReport > m_recvMeasurementReportTrace
The RecvMeasurementReport trace source.
Definition: lte-enb-rrc.h:1250
void SetRnti(uint16_t rnti)
Set the RNTI to the given value.
virtual ~UeManager(void)
Definition: lte-enb-rrc.cc:267
uint8_t m_rsrpFilterCoefficient
The RsrpFilterCoefficient attribute.
Definition: lte-enb-rrc.h:1179
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:331
void RemoveDataRadioBearerInfo(uint8_t drbid)
remove the LteDataRadioBearerInfo corresponding to a bearer being released
static TypeId GetTypeId(void)
Definition: lte-enb-rrc.cc:285
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:762
EpcX2SapProvider * m_x2SapProvider
Interface to send messages to neighbour eNodeB over the X2 interface.
Definition: lte-enb-rrc.h:1050
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Parameters of the RESOURCE STATUS UPDATE message.
Definition: epc-x2-sap.h:311
Hold objects of type Ptr.
Definition: pointer.h:36
virtual void SendHandoverRequestAck(HandoverRequestAckParams params)=0
LteRrcSap::RadioResourceConfigDedicated BuildRadioResourceConfigDedicated()
void SetLteRlcSapUser(LteRlcSapUser *s)
Definition: lte-rlc.cc:140
enum ns3::EpsBearer::Qci qci
State
The state of the UeManager at the eNB RRC.
Definition: lte-enb-rrc.h:73
EventId m_handoverLeavingTimeout
Time limit before a handover leaving timeout occurs.
Definition: lte-enb-rrc.h:498
Ptr< const AttributeChecker > MakeBooleanChecker(void)
Definition: boolean.cc:121
enum ns3::LteRrcSap::ThresholdEutra::@70 choice
uint8_t lcGroup
logical channel group
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:853
RadioResourceConfigDedicated radioResourceConfigDedicated
Definition: lte-rrc-sap.h:629
std::list< uint8_t > m_drbsToBeStarted
Definition: lte-enb-rrc.h:463
void DoReceivePdcpSdu(LtePdcpSapUser::ReceivePdcpSduParameters params)
static const uint16_t g_srsCiLow[SRS_ENTRIES]
The lower bound (inclusive) of the SRS configuration indices (ISRS) which use the corresponding SRS p...
TracedCallback< uint64_t, uint16_t, uint16_t, uint16_t > m_handoverStartTrace
The HandoverStart trace source.
Definition: lte-enb-rrc.h:1240
std::vector< EpcX2Sap::ErabToBeSetupItem > GetErabList()
Definition: lte-enb-rrc.cc:701
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:493
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.
Ptr< const AttributeAccessor > MakeTimeAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
Definition: nstime.h:922
Parameters for [re]configuring the UE.
Time m_systemInformationPeriodicity
The SystemInformationPeriodicity attribute.
Definition: lte-enb-rrc.h:1149
LteEnbRrcSapProvider * GetLteEnbRrcSapProvider()
RadioResourceConfigCommonSib radioResourceConfigCommon
Definition: lte-rrc-sap.h:536
static Time Now(void)
Return the current simulation virtual time.
Definition: simulator.cc:223
std::vector< ErabToBeSetupItem > bearers
Definition: epc-x2-sap.h:234
uint8_t m_defaultTransmissionMode
The DefaultTransmissionMode attribute.
Definition: lte-enb-rrc.h:1139
void DoRecvResourceStatusUpdate(EpcX2SapUser::ResourceStatusUpdateParams params)
void SetLcId(uint8_t lcId)
Definition: lte-rlc.cc:133
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...
RadioResourceConfigCommon radioResourceConfigCommon
Definition: lte-rrc-sap.h:504
uint64_t GetImsi(void) const
EnbRrcMemberLteEnbCmacSapUser(LteEnbRrc *rrc)
Definition: lte-enb-rrc.cc:71
void PrepareHandover(uint16_t cellId)
Start the handover preparation and send the handover request.
Definition: lte-enb-rrc.cc:526
CarrierBandwidthEutra carrierBandwidth
Definition: lte-rrc-sap.h:502
void DoSendReleaseDataRadioBearer(uint64_t imsi, uint16_t rnti, uint8_t bearerId)
This function acts as an interface to trigger Release indication messages towards eNB and EPC...
Definition: lte-enb-rrc.cc:483
uint8_t DoAddUeMeasReportConfigForHandover(LteRrcSap::ReportConfigEutra reportConfig)
uint16_t GetRnti(void) const
virtual void DoSendReleaseIndication(uint64_t imsi, uint16_t rnti, uint8_t bearerId)=0
Triggers epc-enb-application to send ERAB Release Indication message towards MME. ...
void RecvRrcConnectionReestablishmentComplete(LteRrcSap::RrcConnectionReestablishmentComplete msg)
Part of the RRC protocol. Implement the LteEnbRrcSapProvider::RecvRrcConnectionReestablishmentComplet...
Definition: lte-enb-rrc.cc:962
#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
Interface to receive messages from core network over the S1 protocol.
Definition: lte-enb-rrc.h:1083
std::set< uint16_t > m_ueSrsConfigurationIndexSet
Definition: lte-enb-rrc.h:1154
void SetSrsPeriodicity(uint32_t p)
uint16_t rnti
C-RNTI identifying the UE.
virtual void DoDispose(void)
Destructor implementation.
Reference Signal Received Power.
Definition: lte-rrc-sap.h:362
TypeId GetRlcType(EpsBearer bearer)
bool m_configured
True if ConfigureCell() has been completed.
Definition: lte-enb-rrc.h:1091
LogicalChannelConfig logicalChannelConfig
Definition: lte-rrc-sap.h:220
enum ns3::LteRrcSap::ReportConfigEutra::@74 triggerQuantity
The quantities used to evaluate the triggering condition for the event, see 3GPP TS 36...
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...
Ptr< const AttributeChecker > MakeEnumChecker(int v1, std::string n1, int v2, std::string n2, int v3, std::string n3, int v4, std::string n4, int v5, std::string n5, int v6, std::string n6, int v7, std::string n7, int v8, std::string n8, int v9, std::string n9, int v10, std::string n10, int v11, std::string n11, int v12, std::string n12, int v13, std::string n13, int v14, std::string n14, int v15, std::string n15, int v16, std::string n16, int v17, std::string n17, int v18, std::string n18, int v19, std::string n19, int v20, std::string n20, int v21, std::string n21, int v22, std::string n22)
Make an EnumChecker pre-configured with a set of allowed values by name.
Definition: enum.cc:184
#define NS_ABORT_IF(cond)
Abnormal program termination if a condition is true.
Definition: abort.h:77
Instantiate subclasses of ns3::Object.
Ipv4 addresses are stored in host order in this class.
Definition: ipv4-address.h:40
uint64_t gbrUl
guaranteed bitrate in uplink
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:50
LteAnrSapUser * m_anrSapUser
Receive API calls from the ANR instance.
Definition: lte-enb-rrc.h:1063
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
Time limit before a connection setup timeout occurs.
Definition: lte-enb-rrc.h:478
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:451
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:228
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:432
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]
Sounding Reference Symbol (SRS) periodicity (TSRS) in milliseconds.
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:937
bool RemovePacketTag(Tag &tag)
Remove a packet tag.
Definition: packet.cc:843
LteEnbCmacSapProvider * m_cmacSapProvider
Interface to the eNodeB MAC instance.
Definition: lte-enb-rrc.h:1055
LteRrcSap::PhysicalConfigDedicated m_physicalConfigDedicated
Definition: lte-enb-rrc.h:443
std::map< uint16_t, Ptr< UeManager > > m_ueMap
The UeMap attribute.
Definition: lte-enb-rrc.h:1111
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Definition: log.h:236
static const uint16_t g_srsCiHigh[SRS_ENTRIES]
The upper bound (inclusive) of the SRS configuration indices (ISRS) which use the corresponding SRS p...
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition: nstime.h:859
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:800
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:53
Service Access Point (SAP) offered by the MAC to the RLC See Femto Forum MAC Scheduler Interface Spec...
Definition: lte-mac-sap.h:36
std::map< uint8_t, Ptr< LteDataRadioBearerInfo > > m_drbMap
The DataRadioBearerMap attribute.
Definition: lte-enb-rrc.h:420
TracedCallback< uint64_t, uint16_t, uint16_t > m_connectionReconfigurationTrace
The ConnectionReconfiguration trace source.
Definition: lte-enb-rrc.h:1235
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
enum ns3::LteRrcSap::ReportConfigEutra::@73 purpose
uint8_t GetNewRrcTransactionIdentifier()
Both the RSRP and RSRQ quantities are to be included in the measurement report.
Definition: lte-rrc-sap.h:369
void DoRecvSnStatusTransfer(EpcX2SapUser::SnStatusTransferParams params)
LteEnbCphySapUser * GetLteEnbCphySapUser()
void ConnectionRejectedTimeout(uint16_t rnti)
Method triggered a while after sending RRC Connection Rejected.
Ptr< const AttributeAccessor > MakeObjectMapAccessor(U T::*memberVariable)
MakeAccessorHelper implementation for ObjectVector.
Definition: object-map.h:80
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
The HandoverJoiningTimeoutDuration attribute.
Definition: lte-enb-rrc.h:1213
LteRlcSapProvider * GetLteRlcSapProvider()
Definition: lte-rlc.cc:147
uint16_t m_lastAllocatedConfigurationIndex
Definition: lte-enb-rrc.h:1155
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
Interface to the handover algorithm instance.
Definition: lte-enb-rrc.h:1060
A base class which provides memory management and object aggregation.
Definition: object.h:87
std::set< uint8_t > m_anrMeasIds
List of measurement identities which are intended for ANR purpose.
Definition: lte-enb-rrc.h:1122
Container for 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
State m_state
The current UeManager state.
Definition: lte-enb-rrc.h:447
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)
Parameters of the UE DATA primitive.
Definition: epc-x2-sap.h:325
enum LteEpsBearerToRlcMapping_t m_epsBearerToRlcMapping
The EpsBearerToRlcMapping attribute.
Definition: lte-enb-rrc.h:1144
Ptr< T > GetObject(void) const
Get a pointer to the requested aggregated Object.
Definition: object.h:455
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
Definition: uinteger.h:45
std::vector< ErabsSubjectToStatusTransferItem > erabsSubjectToStatusTransferList
Definition: epc-x2-sap.h:279
Event A1: Serving becomes better than absolute threshold.
Definition: lte-rrc-sap.h:331
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:969
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:51
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:462
std::list< ReportConfigToAddMod > reportConfigToAddModList
Definition: lte-rrc-sap.h:465
TypeId SetParent(TypeId tid)
Definition: type-id.cc:631
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
Time limit before a connection request timeout occurs.
Definition: lte-enb-rrc.h:472
LteEnbCphySapUser * m_cphySapUser
Receive API calls from the eNodeB PHY instance.
Definition: lte-enb-rrc.h:1086
LteAnrSapProvider * m_anrSapProvider
Interface to the ANR instance.
Definition: lte-enb-rrc.h:1065
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:154
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:582
bool SendData(Ptr< Packet > p)
Enqueue an IP data packet on the proper bearer for downlink transmission.
EventId m_handoverJoiningTimeout
Time limit before a handover joining timeout occurs.
Definition: lte-enb-rrc.h:491
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:792
uint16_t m_cellId
Cell identifier. Must be unique across the simulation.
Definition: lte-enb-rrc.h:1093
virtual void DoInitialize()
Initialize() implementation.
Definition: lte-enb-rrc.cc:151
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:1117
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)