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  .SetGroupName("Lte")
1348  .AddConstructor<LteEnbRrc> ()
1349  .AddAttribute ("UeMap", "List of UeManager by C-RNTI.",
1350  ObjectMapValue (),
1352  MakeObjectMapChecker<UeManager> ())
1353  .AddAttribute ("DefaultTransmissionMode",
1354  "The default UEs' transmission mode (0: SISO)",
1355  UintegerValue (0), // default tx-mode
1357  MakeUintegerChecker<uint8_t> ())
1358  .AddAttribute ("EpsBearerToRlcMapping",
1359  "Specify which type of RLC will be used for each type of EPS bearer. ",
1362  MakeEnumChecker (RLC_SM_ALWAYS, "RlcSmAlways",
1363  RLC_UM_ALWAYS, "RlcUmAlways",
1364  RLC_AM_ALWAYS, "RlcAmAlways",
1365  PER_BASED, "PacketErrorRateBased"))
1366  .AddAttribute ("SystemInformationPeriodicity",
1367  "The interval for sending system information (Time value)",
1368  TimeValue (MilliSeconds (80)),
1370  MakeTimeChecker ())
1371 
1372  // SRS related attributes
1373  .AddAttribute ("SrsPeriodicity",
1374  "The SRS periodicity in milliseconds",
1375  UintegerValue (40),
1378  MakeUintegerChecker<uint32_t> ())
1379 
1380  // Timeout related attributes
1381  .AddAttribute ("ConnectionRequestTimeoutDuration",
1382  "After a RA attempt, if no RRC CONNECTION REQUEST is "
1383  "received before this time, the UE context is destroyed. "
1384  "Must account for reception of RAR and transmission of "
1385  "RRC CONNECTION REQUEST over UL GRANT.",
1386  TimeValue (MilliSeconds (15)),
1388  MakeTimeChecker ())
1389  .AddAttribute ("ConnectionSetupTimeoutDuration",
1390  "After accepting connection request, if no RRC CONNECTION "
1391  "SETUP COMPLETE is received before this time, the UE "
1392  "context is destroyed. Must account for the UE's reception "
1393  "of RRC CONNECTION SETUP and transmission of RRC CONNECTION "
1394  "SETUP COMPLETE.",
1395  TimeValue (MilliSeconds (150)),
1397  MakeTimeChecker ())
1398  .AddAttribute ("ConnectionRejectedTimeoutDuration",
1399  "Time to wait between sending a RRC CONNECTION REJECT and "
1400  "destroying the UE context",
1401  TimeValue (MilliSeconds (30)),
1403  MakeTimeChecker ())
1404  .AddAttribute ("HandoverJoiningTimeoutDuration",
1405  "After accepting a handover request, if no RRC CONNECTION "
1406  "RECONFIGURATION COMPLETE is received before this time, the "
1407  "UE context is destroyed. Must account for reception of "
1408  "X2 HO REQ ACK by source eNB, transmission of the Handover "
1409  "Command, non-contention-based random access and reception "
1410  "of the RRC CONNECTION RECONFIGURATION COMPLETE message.",
1411  TimeValue (MilliSeconds (200)),
1413  MakeTimeChecker ())
1414  .AddAttribute ("HandoverLeavingTimeoutDuration",
1415  "After issuing a Handover Command, if neither RRC "
1416  "CONNECTION RE-ESTABLISHMENT nor X2 UE Context Release has "
1417  "been previously received, the UE context is destroyed.",
1418  TimeValue (MilliSeconds (500)),
1420  MakeTimeChecker ())
1421 
1422  // Cell selection related attribute
1423  .AddAttribute ("QRxLevMin",
1424  "One of information transmitted within the SIB1 message, "
1425  "indicating the required minimum RSRP level that any UE must "
1426  "receive from this cell before it is allowed to camp to this "
1427  "cell. The default value -70 corresponds to -140 dBm and is "
1428  "the lowest possible value as defined by Section 6.3.4 of "
1429  "3GPP TS 36.133. This restriction, however, only applies to "
1430  "initial cell selection and EPC-enabled simulation.",
1432  IntegerValue (-70),
1434  MakeIntegerChecker<int8_t> (-70, -22))
1435 
1436  // Handover related attributes
1437  .AddAttribute ("AdmitHandoverRequest",
1438  "Whether to admit an X2 handover request from another eNB",
1439  BooleanValue (true),
1441  MakeBooleanChecker ())
1442  .AddAttribute ("AdmitRrcConnectionRequest",
1443  "Whether to admit a connection request from a UE",
1444  BooleanValue (true),
1446  MakeBooleanChecker ())
1447 
1448  // UE measurements related attributes
1449  .AddAttribute ("RsrpFilterCoefficient",
1450  "Determines the strength of smoothing effect induced by "
1451  "layer 3 filtering of RSRP in all attached UE; "
1452  "if set to 0, no layer 3 filtering is applicable",
1453  // i.e. the variable k in 3GPP TS 36.331 section 5.5.3.2
1454  UintegerValue (4),
1456  MakeUintegerChecker<uint8_t> (0))
1457  .AddAttribute ("RsrqFilterCoefficient",
1458  "Determines the strength of smoothing effect induced by "
1459  "layer 3 filtering of RSRQ in all attached UE; "
1460  "if set to 0, no layer 3 filtering is applicable",
1461  // i.e. the variable k in 3GPP TS 36.331 section 5.5.3.2
1462  UintegerValue (4),
1464  MakeUintegerChecker<uint8_t> (0))
1465 
1466  // Trace sources
1467  .AddTraceSource ("NewUeContext",
1468  "Fired upon creation of a new UE context.",
1470  "ns3::LteEnbRrc::NewUeContextTracedCallback")
1471  .AddTraceSource ("ConnectionEstablished",
1472  "Fired upon successful RRC connection establishment.",
1474  "ns3::LteEnbRrc::ConnectionHandoverTracedCallback")
1475  .AddTraceSource ("ConnectionReconfiguration",
1476  "trace fired upon RRC connection reconfiguration",
1478  "ns3::LteEnbRrc::ConnectionHandoverTracedCallback")
1479  .AddTraceSource ("HandoverStart",
1480  "trace fired upon start of a handover procedure",
1482  "ns3::LteEnbRrc::HandoverStartTracedCallback")
1483  .AddTraceSource ("HandoverEndOk",
1484  "trace fired upon successful termination of a handover procedure",
1486  "ns3::LteEnbRrc::ConnectionHandoverTracedCallback")
1487  .AddTraceSource ("RecvMeasurementReport",
1488  "trace fired when measurement report is received",
1490  "ns3::LteEnbRrc::ReceiveReportTracedCallback")
1491  ;
1492  return tid;
1493 }
1494 
1495 void
1497 {
1498  NS_LOG_FUNCTION (this << s);
1499  m_x2SapProvider = s;
1500 }
1501 
1502 EpcX2SapUser*
1504 {
1505  NS_LOG_FUNCTION (this);
1506  return m_x2SapUser;
1507 }
1508 
1509 void
1511 {
1512  NS_LOG_FUNCTION (this << s);
1513  m_cmacSapProvider = s;
1514 }
1515 
1518 {
1519  NS_LOG_FUNCTION (this);
1520  return m_cmacSapUser;
1521 }
1522 
1523 void
1525 {
1526  NS_LOG_FUNCTION (this << s);
1528 }
1529 
1532 {
1533  NS_LOG_FUNCTION (this);
1535 }
1536 
1537 void
1539 {
1540  NS_LOG_FUNCTION (this << s);
1541  m_anrSapProvider = s;
1542 }
1543 
1546 {
1547  NS_LOG_FUNCTION (this);
1548  return m_anrSapUser;
1549 }
1550 
1551 void
1553 {
1554  NS_LOG_FUNCTION (this << s);
1555  m_ffrRrcSapProvider = s;
1556 }
1557 
1560 {
1561  NS_LOG_FUNCTION (this);
1562  return m_ffrRrcSapUser;
1563 }
1564 
1565 void
1567 {
1568  NS_LOG_FUNCTION (this << s);
1569  m_rrcSapUser = s;
1570 }
1571 
1574 {
1575  NS_LOG_FUNCTION (this);
1576  return m_rrcSapProvider;
1577 }
1578 
1579 void
1581 {
1582  NS_LOG_FUNCTION (this);
1583  m_macSapProvider = s;
1584 }
1585 
1586 void
1588 {
1589  m_s1SapProvider = s;
1590 }
1591 
1592 
1595 {
1596  return m_s1SapUser;
1597 }
1598 
1599 void
1601 {
1602  NS_LOG_FUNCTION (this << s);
1603  m_cphySapProvider = s;
1604 }
1605 
1608 {
1609  NS_LOG_FUNCTION (this);
1610  return m_cphySapUser;
1611 }
1612 
1613 bool
1614 LteEnbRrc::HasUeManager (uint16_t rnti) const
1615 {
1616  NS_LOG_FUNCTION (this << (uint32_t) rnti);
1617  std::map<uint16_t, Ptr<UeManager> >::const_iterator it = m_ueMap.find (rnti);
1618  return (it != m_ueMap.end ());
1619 }
1620 
1623 {
1624  NS_LOG_FUNCTION (this << (uint32_t) rnti);
1625  NS_ASSERT (0 != rnti);
1626  std::map<uint16_t, Ptr<UeManager> >::iterator it = m_ueMap.find (rnti);
1627  NS_ASSERT_MSG (it != m_ueMap.end (), "RNTI " << rnti << " not found in eNB with cellId " << m_cellId);
1628  return it->second;
1629 }
1630 
1631 uint8_t
1633 {
1634  NS_LOG_FUNCTION (this);
1635 
1636  // SANITY CHECK
1637 
1639  "Measurement identities and reporting configuration should not have different quantity");
1640 
1641  if (Simulator::Now () != Seconds (0))
1642  {
1643  NS_FATAL_ERROR ("AddUeMeasReportConfig may not be called after the simulation has run");
1644  }
1645 
1646  // INPUT VALIDATION
1647 
1648  switch (config.triggerQuantity)
1649  {
1653  {
1654  NS_FATAL_ERROR ("The given triggerQuantity (RSRP) does not match with the given threshold2.choice");
1655  }
1656 
1662  {
1663  NS_FATAL_ERROR ("The given triggerQuantity (RSRP) does not match with the given threshold1.choice");
1664  }
1665  break;
1666 
1670  {
1671  NS_FATAL_ERROR ("The given triggerQuantity (RSRQ) does not match with the given threshold2.choice");
1672  }
1673 
1679  {
1680  NS_FATAL_ERROR ("The given triggerQuantity (RSRQ) does not match with the given threshold1.choice");
1681  }
1682  break;
1683 
1684  default:
1685  NS_FATAL_ERROR ("unsupported triggerQuantity");
1686  break;
1687  }
1688 
1690  {
1691  NS_FATAL_ERROR ("Only REPORT_STRONGEST_CELLS purpose is supported");
1692  }
1693 
1695  {
1696  NS_LOG_WARN ("reportQuantity = BOTH will be used instead of the given reportQuantity");
1697  }
1698 
1699  uint8_t nextId = m_ueMeasConfig.reportConfigToAddModList.size () + 1;
1700 
1701  // create the reporting configuration
1702  LteRrcSap::ReportConfigToAddMod reportConfig;
1703  reportConfig.reportConfigId = nextId;
1704  reportConfig.reportConfigEutra = config;
1705 
1706  // create the measurement identity
1708  measId.measId = nextId;
1709  measId.measObjectId = 1;
1710  measId.reportConfigId = nextId;
1711 
1712  // add both to the list of UE measurement configuration
1713  m_ueMeasConfig.reportConfigToAddModList.push_back (reportConfig);
1714  m_ueMeasConfig.measIdToAddModList.push_back (measId);
1715 
1716  return nextId;
1717 }
1718 
1719 void
1720 LteEnbRrc::ConfigureCell (uint8_t ulBandwidth, uint8_t dlBandwidth,
1721  uint16_t ulEarfcn, uint16_t dlEarfcn, uint16_t cellId)
1722 {
1723  NS_LOG_FUNCTION (this << (uint16_t) ulBandwidth << (uint16_t) dlBandwidth
1724  << ulEarfcn << dlEarfcn << cellId);
1726  m_cmacSapProvider->ConfigureMac (ulBandwidth, dlBandwidth);
1727  m_cphySapProvider->SetBandwidth (ulBandwidth, dlBandwidth);
1728  m_cphySapProvider->SetEarfcn (ulEarfcn, dlEarfcn);
1729  m_dlEarfcn = dlEarfcn;
1730  m_ulEarfcn = ulEarfcn;
1731  m_dlBandwidth = dlBandwidth;
1732  m_ulBandwidth = ulBandwidth;
1733  m_cellId = cellId;
1734  m_cphySapProvider->SetCellId (cellId);
1735  m_ffrRrcSapProvider->SetCellId (cellId);
1736  m_ffrRrcSapProvider->SetBandwidth(ulBandwidth, dlBandwidth);
1737 
1738  /*
1739  * Initializing the list of UE measurement configuration (m_ueMeasConfig).
1740  * Only intra-frequency measurements are supported, so only one measurement
1741  * object is created.
1742  */
1743 
1744  LteRrcSap::MeasObjectToAddMod measObject;
1745  measObject.measObjectId = 1;
1746  measObject.measObjectEutra.carrierFreq = m_dlEarfcn;
1748  measObject.measObjectEutra.presenceAntennaPort1 = false;
1749  measObject.measObjectEutra.neighCellConfig = 0;
1750  measObject.measObjectEutra.offsetFreq = 0;
1751  measObject.measObjectEutra.haveCellForWhichToReportCGI = false;
1752 
1753  m_ueMeasConfig.measObjectToAddModList.push_back (measObject);
1758  m_ueMeasConfig.haveSmeasure = false;
1760 
1761  // Enabling MIB transmission
1763  mib.dlBandwidth = m_dlBandwidth;
1765 
1766  // Enabling SIB1 transmission with default values
1771  m_sib1.cellSelectionInfo.qQualMin = -34; // not used, set as minimum value
1772  m_sib1.cellSelectionInfo.qRxLevMin = m_qRxLevMin; // set as minimum value
1774 
1775  /*
1776  * Enabling transmission of other SIB. The first time System Information is
1777  * transmitted is arbitrarily assumed to be at +0.016s, and then it will be
1778  * regularly transmitted every 80 ms by default (set the
1779  * SystemInformationPeriodicity attribute to configure this).
1780  */
1782 
1783  m_configured = true;
1784 
1785 }
1786 
1787 
1788 void
1789 LteEnbRrc::SetCellId (uint16_t cellId)
1790 {
1791  m_cellId = cellId;
1792 
1793  // update SIB1 too
1796 }
1797 
1798 bool
1800 {
1801  NS_LOG_FUNCTION (this << packet);
1802 
1803  EpsBearerTag tag;
1804  bool found = packet->RemovePacketTag (tag);
1805  NS_ASSERT_MSG (found, "no EpsBearerTag found in packet to be sent");
1806  Ptr<UeManager> ueManager = GetUeManager (tag.GetRnti ());
1807  ueManager->SendData (tag.GetBid (), packet);
1808 
1809  return true;
1810 }
1811 
1812 void
1814 {
1815  m_forwardUpCallback = cb;
1816 }
1817 
1818 void
1820 {
1821  NS_LOG_FUNCTION (this << rnti);
1823  "ConnectionRequestTimeout in unexpected state " << ToString (GetUeManager (rnti)->GetState ()));
1824  RemoveUe (rnti);
1825 }
1826 
1827 void
1829 {
1830  NS_LOG_FUNCTION (this << rnti);
1831  NS_ASSERT_MSG (GetUeManager (rnti)->GetState () == UeManager::CONNECTION_SETUP,
1832  "ConnectionSetupTimeout in unexpected state " << ToString (GetUeManager (rnti)->GetState ()));
1833  RemoveUe (rnti);
1834 }
1835 
1836 void
1838 {
1839  NS_LOG_FUNCTION (this << rnti);
1841  "ConnectionRejectedTimeout in unexpected state " << ToString (GetUeManager (rnti)->GetState ()));
1842  RemoveUe (rnti);
1843 }
1844 
1845 void
1847 {
1848  NS_LOG_FUNCTION (this << rnti);
1849  NS_ASSERT_MSG (GetUeManager (rnti)->GetState () == UeManager::HANDOVER_JOINING,
1850  "HandoverJoiningTimeout in unexpected state " << ToString (GetUeManager (rnti)->GetState ()));
1851  RemoveUe (rnti);
1852 }
1853 
1854 void
1856 {
1857  NS_LOG_FUNCTION (this << rnti);
1858  NS_ASSERT_MSG (GetUeManager (rnti)->GetState () == UeManager::HANDOVER_LEAVING,
1859  "HandoverLeavingTimeout in unexpected state " << ToString (GetUeManager (rnti)->GetState ()));
1860  RemoveUe (rnti);
1861 }
1862 
1863 void
1864 LteEnbRrc::SendHandoverRequest (uint16_t rnti, uint16_t cellId)
1865 {
1866  NS_LOG_FUNCTION (this << rnti << cellId);
1867  NS_LOG_LOGIC ("Request to send HANDOVER REQUEST");
1869 
1870  Ptr<UeManager> ueManager = GetUeManager (rnti);
1871  ueManager->PrepareHandover (cellId);
1872 
1873 }
1874 
1875 void
1877 {
1878  NS_LOG_FUNCTION (this << rnti);
1879  GetUeManager (rnti)->CompleteSetupUe (params);
1880 }
1881 
1882 void
1884 {
1885  NS_LOG_FUNCTION (this << rnti);
1886  GetUeManager (rnti)->RecvRrcConnectionRequest (msg);
1887 }
1888 
1889 void
1891 {
1892  NS_LOG_FUNCTION (this << rnti);
1893  GetUeManager (rnti)->RecvRrcConnectionSetupCompleted (msg);
1894 }
1895 
1896 void
1898 {
1899  NS_LOG_FUNCTION (this << rnti);
1900  GetUeManager (rnti)->RecvRrcConnectionReconfigurationCompleted (msg);
1901 }
1902 
1903 void
1905 {
1906  NS_LOG_FUNCTION (this << rnti);
1907  GetUeManager (rnti)->RecvRrcConnectionReestablishmentRequest (msg);
1908 }
1909 
1910 void
1912 {
1913  NS_LOG_FUNCTION (this << rnti);
1914  GetUeManager (rnti)->RecvRrcConnectionReestablishmentComplete (msg);
1915 }
1916 
1917 void
1919 {
1920  NS_LOG_FUNCTION (this << rnti);
1921  GetUeManager (rnti)->RecvMeasurementReport (msg);
1922 }
1923 
1924 void
1926 {
1927  Ptr<UeManager> ueManager = GetUeManager (request.rnti);
1928  ueManager->SetupDataRadioBearer (request.bearer, request.bearerId, request.gtpTeid, request.transportLayerAddress);
1929 }
1930 
1931 void
1933 {
1934  Ptr<UeManager> ueManager = GetUeManager (params.rnti);
1935  ueManager->SendUeContextRelease ();
1936 }
1937 
1938 void
1940 {
1941  NS_LOG_FUNCTION (this);
1942 
1943  NS_LOG_LOGIC ("Recv X2 message: HANDOVER REQUEST");
1944 
1945  NS_LOG_LOGIC ("oldEnbUeX2apId = " << req.oldEnbUeX2apId);
1946  NS_LOG_LOGIC ("sourceCellId = " << req.sourceCellId);
1947  NS_LOG_LOGIC ("targetCellId = " << req.targetCellId);
1948  NS_LOG_LOGIC ("mmeUeS1apId = " << req.mmeUeS1apId);
1949 
1950  NS_ASSERT (req.targetCellId == m_cellId);
1951 
1952  if (m_admitHandoverRequest == false)
1953  {
1954  NS_LOG_INFO ("rejecting handover request from cellId " << req.sourceCellId);
1956  res.oldEnbUeX2apId = req.oldEnbUeX2apId;
1957  res.sourceCellId = req.sourceCellId;
1958  res.targetCellId = req.targetCellId;
1959  res.cause = 0;
1960  res.criticalityDiagnostics = 0;
1962  return;
1963  }
1964 
1965  uint16_t rnti = AddUe (UeManager::HANDOVER_JOINING);
1967  if (anrcrv.valid == false)
1968  {
1969  NS_LOG_INFO (this << " failed to allocate a preamble for non-contention based RA => cannot accept HO");
1970  RemoveUe (rnti);
1971  NS_FATAL_ERROR ("should trigger HO Preparation Failure, but it is not implemented");
1972  return;
1973  }
1974 
1975  Ptr<UeManager> ueManager = GetUeManager (rnti);
1976  ueManager->SetSource (req.sourceCellId, req.oldEnbUeX2apId);
1977  ueManager->SetImsi (req.mmeUeS1apId);
1978 
1980  ackParams.oldEnbUeX2apId = req.oldEnbUeX2apId;
1981  ackParams.newEnbUeX2apId = rnti;
1982  ackParams.sourceCellId = req.sourceCellId;
1983  ackParams.targetCellId = req.targetCellId;
1984 
1985  for (std::vector <EpcX2Sap::ErabToBeSetupItem>::iterator it = req.bearers.begin ();
1986  it != req.bearers.end ();
1987  ++it)
1988  {
1989  ueManager->SetupDataRadioBearer (it->erabLevelQosParameters, it->erabId, it->gtpTeid, it->transportLayerAddress);
1991  i.erabId = it->erabId;
1992  ackParams.admittedBearers.push_back (i);
1993  }
1994 
1995  LteRrcSap::RrcConnectionReconfiguration handoverCommand = ueManager->GetRrcConnectionReconfigurationForHandover ();
1996  handoverCommand.haveMobilityControlInfo = true;
1997  handoverCommand.mobilityControlInfo.targetPhysCellId = m_cellId;
1998  handoverCommand.mobilityControlInfo.haveCarrierFreq = true;
2001  handoverCommand.mobilityControlInfo.haveCarrierBandwidth = true;
2004  handoverCommand.mobilityControlInfo.newUeIdentity = rnti;
2005  handoverCommand.mobilityControlInfo.haveRachConfigDedicated = true;
2008 
2013 
2014  Ptr<Packet> encodedHandoverCommand = m_rrcSapUser->EncodeHandoverCommand (handoverCommand);
2015 
2016  ackParams.rrcContext = encodedHandoverCommand;
2017 
2018  NS_LOG_LOGIC ("Send X2 message: HANDOVER REQUEST ACK");
2019 
2020  NS_LOG_LOGIC ("oldEnbUeX2apId = " << ackParams.oldEnbUeX2apId);
2021  NS_LOG_LOGIC ("newEnbUeX2apId = " << ackParams.newEnbUeX2apId);
2022  NS_LOG_LOGIC ("sourceCellId = " << ackParams.sourceCellId);
2023  NS_LOG_LOGIC ("targetCellId = " << ackParams.targetCellId);
2024 
2026 }
2027 
2028 void
2030 {
2031  NS_LOG_FUNCTION (this);
2032 
2033  NS_LOG_LOGIC ("Recv X2 message: HANDOVER REQUEST ACK");
2034 
2035  NS_LOG_LOGIC ("oldEnbUeX2apId = " << params.oldEnbUeX2apId);
2036  NS_LOG_LOGIC ("newEnbUeX2apId = " << params.newEnbUeX2apId);
2037  NS_LOG_LOGIC ("sourceCellId = " << params.sourceCellId);
2038  NS_LOG_LOGIC ("targetCellId = " << params.targetCellId);
2039 
2040  uint16_t rnti = params.oldEnbUeX2apId;
2041  Ptr<UeManager> ueManager = GetUeManager (rnti);
2042  ueManager->RecvHandoverRequestAck (params);
2043 }
2044 
2045 void
2047 {
2048  NS_LOG_FUNCTION (this);
2049 
2050  NS_LOG_LOGIC ("Recv X2 message: HANDOVER PREPARATION FAILURE");
2051 
2052  NS_LOG_LOGIC ("oldEnbUeX2apId = " << params.oldEnbUeX2apId);
2053  NS_LOG_LOGIC ("sourceCellId = " << params.sourceCellId);
2054  NS_LOG_LOGIC ("targetCellId = " << params.targetCellId);
2055  NS_LOG_LOGIC ("cause = " << params.cause);
2056  NS_LOG_LOGIC ("criticalityDiagnostics = " << params.criticalityDiagnostics);
2057 
2058  uint16_t rnti = params.oldEnbUeX2apId;
2059  Ptr<UeManager> ueManager = GetUeManager (rnti);
2060  ueManager->RecvHandoverPreparationFailure (params.targetCellId);
2061 }
2062 
2063 void
2065 {
2066  NS_LOG_FUNCTION (this);
2067 
2068  NS_LOG_LOGIC ("Recv X2 message: SN STATUS TRANSFER");
2069 
2070  NS_LOG_LOGIC ("oldEnbUeX2apId = " << params.oldEnbUeX2apId);
2071  NS_LOG_LOGIC ("newEnbUeX2apId = " << params.newEnbUeX2apId);
2072  NS_LOG_LOGIC ("erabsSubjectToStatusTransferList size = " << params.erabsSubjectToStatusTransferList.size ());
2073 
2074  uint16_t rnti = params.newEnbUeX2apId;
2075  Ptr<UeManager> ueManager = GetUeManager (rnti);
2076  ueManager->RecvSnStatusTransfer (params);
2077 }
2078 
2079 void
2081 {
2082  NS_LOG_FUNCTION (this);
2083 
2084  NS_LOG_LOGIC ("Recv X2 message: UE CONTEXT RELEASE");
2085 
2086  NS_LOG_LOGIC ("oldEnbUeX2apId = " << params.oldEnbUeX2apId);
2087  NS_LOG_LOGIC ("newEnbUeX2apId = " << params.newEnbUeX2apId);
2088 
2089  uint16_t rnti = params.oldEnbUeX2apId;
2090  GetUeManager (rnti)->RecvUeContextRelease (params);
2091  RemoveUe (rnti);
2092 }
2093 
2094 void
2096 {
2097  NS_LOG_FUNCTION (this);
2098 
2099  NS_LOG_LOGIC ("Recv X2 message: LOAD INFORMATION");
2100 
2101  NS_LOG_LOGIC ("Number of cellInformationItems = " << params.cellInformationList.size ());
2102 
2104 }
2105 
2106 void
2108 {
2109  NS_LOG_FUNCTION (this);
2110 
2111  NS_LOG_LOGIC ("Recv X2 message: RESOURCE STATUS UPDATE");
2112 
2113  NS_LOG_LOGIC ("Number of cellMeasurementResultItems = " << params.cellMeasurementResultList.size ());
2114 
2115  NS_ASSERT ("Processing of RESOURCE STATUS UPDATE X2 message IS NOT IMPLEMENTED");
2116 }
2117 
2118 void
2120 {
2121  NS_LOG_FUNCTION (this);
2122 
2123  NS_LOG_LOGIC ("Recv UE DATA FORWARDING through X2 interface");
2124  NS_LOG_LOGIC ("sourceCellId = " << params.sourceCellId);
2125  NS_LOG_LOGIC ("targetCellId = " << params.targetCellId);
2126  NS_LOG_LOGIC ("gtpTeid = " << params.gtpTeid);
2127  NS_LOG_LOGIC ("ueData = " << params.ueData);
2128  NS_LOG_LOGIC ("ueData size = " << params.ueData->GetSize ());
2129 
2130  std::map<uint32_t, X2uTeidInfo>::iterator
2131  teidInfoIt = m_x2uTeidInfoMap.find (params.gtpTeid);
2132  if (teidInfoIt != m_x2uTeidInfoMap.end ())
2133  {
2134  GetUeManager (teidInfoIt->second.rnti)->SendData (teidInfoIt->second.drbid, params.ueData);
2135  }
2136  else
2137  {
2138  NS_FATAL_ERROR ("X2-U data received but no X2uTeidInfo found");
2139  }
2140 }
2141 
2142 
2143 uint16_t
2145 {
2146  NS_LOG_FUNCTION (this);
2148 }
2149 
2150 void
2152 {
2153  Ptr<UeManager> ueManager = GetUeManager (cmacParams.m_rnti);
2154  ueManager->CmacUeConfigUpdateInd (cmacParams);
2155 }
2156 
2157 void
2158 LteEnbRrc::DoNotifyLcConfigResult (uint16_t rnti, uint8_t lcid, bool success)
2159 {
2160  NS_LOG_FUNCTION (this << (uint32_t) rnti);
2161  NS_FATAL_ERROR ("not implemented");
2162 }
2163 
2164 
2165 uint8_t
2167 {
2168  NS_LOG_FUNCTION (this);
2169  uint8_t measId = AddUeMeasReportConfig (reportConfig);
2170  m_handoverMeasIds.insert (measId);
2171  return measId;
2172 }
2173 
2174 void
2175 LteEnbRrc::DoTriggerHandover (uint16_t rnti, uint16_t targetCellId)
2176 {
2177  NS_LOG_FUNCTION (this << rnti << targetCellId);
2178 
2179  bool isHandoverAllowed = true;
2180 
2181  if (m_anrSapProvider != 0)
2182  {
2183  // ensure that proper neighbour relationship exists between source and target cells
2184  bool noHo = m_anrSapProvider->GetNoHo (targetCellId);
2185  bool noX2 = m_anrSapProvider->GetNoX2 (targetCellId);
2186  NS_LOG_DEBUG (this << " cellId=" << m_cellId
2187  << " targetCellId=" << targetCellId
2188  << " NRT.NoHo=" << noHo << " NRT.NoX2=" << noX2);
2189 
2190  if (noHo || noX2)
2191  {
2192  isHandoverAllowed = false;
2193  NS_LOG_LOGIC (this << " handover to cell " << targetCellId
2194  << " is not allowed by ANR");
2195  }
2196  }
2197 
2198  Ptr<UeManager> ueManager = GetUeManager (rnti);
2199  NS_ASSERT_MSG (ueManager != 0, "Cannot find UE context with RNTI " << rnti);
2200 
2201  if (ueManager->GetState () != UeManager::CONNECTED_NORMALLY)
2202  {
2203  isHandoverAllowed = false;
2204  NS_LOG_LOGIC (this << " handover is not allowed because the UE"
2205  << " rnti=" << rnti << " is in "
2206  << ToString (ueManager->GetState ()) << " state");
2207  }
2208 
2209  if (isHandoverAllowed)
2210  {
2211  // initiate handover execution
2212  ueManager->PrepareHandover (targetCellId);
2213  }
2214 }
2215 
2216 uint8_t
2218 {
2219  NS_LOG_FUNCTION (this);
2220  uint8_t measId = AddUeMeasReportConfig (reportConfig);
2221  m_anrMeasIds.insert (measId);
2222  return measId;
2223 }
2224 
2225 uint8_t
2227 {
2228  NS_LOG_FUNCTION (this);
2229  uint8_t measId = AddUeMeasReportConfig (reportConfig);
2230  m_ffrMeasIds.insert (measId);
2231  return measId;
2232 }
2233 
2234 void
2236 {
2237  NS_LOG_FUNCTION (this);
2238  Ptr<UeManager> ueManager = GetUeManager (rnti);
2239  ueManager->SetPdschConfigDedicated (pdschConfigDedicated);
2240 }
2241 
2242 void
2244 {
2245  NS_LOG_FUNCTION (this);
2246 
2248 }
2249 
2250 uint16_t
2252 {
2253  NS_LOG_FUNCTION (this);
2254  bool found = false;
2255  uint16_t rnti;
2256  for (rnti = m_lastAllocatedRnti + 1;
2257  (rnti != m_lastAllocatedRnti - 1) && (!found);
2258  ++rnti)
2259  {
2260  if ((rnti != 0) && (m_ueMap.find (rnti) == m_ueMap.end ()))
2261  {
2262  found = true;
2263  break;
2264  }
2265  }
2266 
2267  NS_ASSERT_MSG (found, "no more RNTIs available (do you have more than 65535 UEs in a cell?)");
2268  m_lastAllocatedRnti = rnti;
2269  Ptr<UeManager> ueManager = CreateObject<UeManager> (this, rnti, state);
2270  m_ueMap.insert (std::pair<uint16_t, Ptr<UeManager> > (rnti, ueManager));
2271  ueManager->Initialize ();
2272  NS_LOG_DEBUG (this << " New UE RNTI " << rnti << " cellId " << m_cellId << " srs CI " << ueManager->GetSrsConfigurationIndex ());
2273  m_newUeContextTrace (m_cellId, rnti);
2274  return rnti;
2275 }
2276 
2277 void
2278 LteEnbRrc::RemoveUe (uint16_t rnti)
2279 {
2280  NS_LOG_FUNCTION (this << (uint32_t) rnti);
2281  std::map <uint16_t, Ptr<UeManager> >::iterator it = m_ueMap.find (rnti);
2282  NS_ASSERT_MSG (it != m_ueMap.end (), "request to remove UE info with unknown rnti " << rnti);
2283  uint16_t srsCi = (*it).second->GetSrsConfigurationIndex ();
2284  m_ueMap.erase (it);
2285  m_cmacSapProvider->RemoveUe (rnti);
2286  m_cphySapProvider->RemoveUe (rnti);
2287  if (m_s1SapProvider != 0)
2288  {
2290  }
2291  // need to do this after UeManager has been deleted
2292  RemoveSrsConfigurationIndex (srsCi);
2293 }
2294 
2295 TypeId
2297 {
2298  switch (m_epsBearerToRlcMapping)
2299  {
2300  case RLC_SM_ALWAYS:
2301  return LteRlcSm::GetTypeId ();
2302  break;
2303 
2304  case RLC_UM_ALWAYS:
2305  return LteRlcUm::GetTypeId ();
2306  break;
2307 
2308  case RLC_AM_ALWAYS:
2309  return LteRlcAm::GetTypeId ();
2310  break;
2311 
2312  case PER_BASED:
2313  if (bearer.GetPacketErrorLossRate () > 1.0e-5)
2314  {
2315  return LteRlcUm::GetTypeId ();
2316  }
2317  else
2318  {
2319  return LteRlcAm::GetTypeId ();
2320  }
2321  break;
2322 
2323  default:
2324  return LteRlcSm::GetTypeId ();
2325  break;
2326  }
2327 }
2328 
2329 
2330 void
2331 LteEnbRrc::AddX2Neighbour (uint16_t cellId)
2332 {
2333  NS_LOG_FUNCTION (this << cellId);
2334 
2335  if (m_anrSapProvider != 0)
2336  {
2338  }
2339 }
2340 
2341 void
2342 LteEnbRrc::SetCsgId (uint32_t csgId, bool csgIndication)
2343 {
2344  NS_LOG_FUNCTION (this << csgId << csgIndication);
2346  m_sib1.cellAccessRelatedInfo.csgIndication = csgIndication;
2348 }
2349 
2350 
2352 static const uint8_t SRS_ENTRIES = 9;
2357 static const uint16_t g_srsPeriodicity[SRS_ENTRIES] = {0, 2, 5, 10, 20, 40, 80, 160, 320};
2363 static const uint16_t g_srsCiLow[SRS_ENTRIES] = {0, 0, 2, 7, 17, 37, 77, 157, 317};
2369 static const uint16_t g_srsCiHigh[SRS_ENTRIES] = {0, 1, 6, 16, 36, 76, 156, 316, 636};
2370 
2371 void
2373 {
2374  NS_LOG_FUNCTION (this << p);
2375  for (uint32_t id = 1; id < SRS_ENTRIES; ++id)
2376  {
2377  if (g_srsPeriodicity[id] == p)
2378  {
2380  return;
2381  }
2382  }
2383  // no match found
2384  std::ostringstream allowedValues;
2385  for (uint32_t id = 1; id < SRS_ENTRIES; ++id)
2386  {
2387  allowedValues << g_srsPeriodicity[id] << " ";
2388  }
2389  NS_FATAL_ERROR ("illecit SRS periodicity value " << p << ". Allowed values: " << allowedValues.str ());
2390 }
2391 
2392 uint32_t
2394 {
2395  NS_LOG_FUNCTION (this);
2397  NS_ASSERT (m_srsCurrentPeriodicityId < SRS_ENTRIES);
2398  return g_srsPeriodicity[m_srsCurrentPeriodicityId];
2399 }
2400 
2401 
2402 uint16_t
2404 {
2406  // SRS
2408  NS_ASSERT (m_srsCurrentPeriodicityId < SRS_ENTRIES);
2409  NS_LOG_DEBUG (this << " SRS p " << g_srsPeriodicity[m_srsCurrentPeriodicityId] << " set " << m_ueSrsConfigurationIndexSet.size ());
2410  if (m_ueSrsConfigurationIndexSet.size () >= g_srsPeriodicity[m_srsCurrentPeriodicityId])
2411  {
2412  NS_FATAL_ERROR ("too many UEs (" << m_ueSrsConfigurationIndexSet.size () + 1
2413  << ") for current SRS periodicity "
2414  << g_srsPeriodicity[m_srsCurrentPeriodicityId]
2415  << ", consider increasing the value of ns3::LteEnbRrc::SrsPeriodicity");
2416  }
2417 
2418  if (m_ueSrsConfigurationIndexSet.empty ())
2419  {
2420  // first entry
2423  }
2424  else
2425  {
2426  // find a CI from the available ones
2427  std::set<uint16_t>::reverse_iterator rit = m_ueSrsConfigurationIndexSet.rbegin ();
2428  NS_ASSERT (rit != m_ueSrsConfigurationIndexSet.rend ());
2429  NS_LOG_DEBUG (this << " lower bound " << (*rit) << " of " << g_srsCiHigh[m_srsCurrentPeriodicityId]);
2430  if ((*rit) < g_srsCiHigh[m_srsCurrentPeriodicityId])
2431  {
2432  // got it from the upper bound
2433  m_lastAllocatedConfigurationIndex = (*rit) + 1;
2435  }
2436  else
2437  {
2438  // look for released ones
2439  for (uint16_t srcCi = g_srsCiLow[m_srsCurrentPeriodicityId]; srcCi < g_srsCiHigh[m_srsCurrentPeriodicityId]; srcCi++)
2440  {
2441  std::set<uint16_t>::iterator it = m_ueSrsConfigurationIndexSet.find (srcCi);
2442  if (it == m_ueSrsConfigurationIndexSet.end ())
2443  {
2445  m_ueSrsConfigurationIndexSet.insert (srcCi);
2446  break;
2447  }
2448  }
2449  }
2450  }
2452 
2453 }
2454 
2455 
2456 void
2458 {
2459  NS_LOG_FUNCTION (this << srcCi);
2460  std::set<uint16_t>::iterator it = m_ueSrsConfigurationIndexSet.find (srcCi);
2461  NS_ASSERT_MSG (it != m_ueSrsConfigurationIndexSet.end (), "request to remove unkwown SRS CI " << srcCi);
2462  m_ueSrsConfigurationIndexSet.erase (it);
2463 }
2464 
2465 uint8_t
2467 {
2468  if (bearer.IsGbr ())
2469  {
2470  return 1;
2471  }
2472  else
2473  {
2474  return 2;
2475  }
2476 }
2477 
2478 uint8_t
2480 {
2481  return bearer.qci;
2482 }
2483 
2484 void
2486 {
2487  // NS_LOG_FUNCTION (this);
2488 
2489  /*
2490  * For simplicity, we use the same periodicity for all SIBs. Note that in real
2491  * systems the periodicy of each SIBs could be different.
2492  */
2494  si.haveSib2 = true;
2499 
2501  LteRrcSap::RachConfigCommon rachConfigCommon;
2503  rachConfigCommon.raSupervisionInfo.preambleTransMax = rc.preambleTransMax;
2505  si.sib2.radioResourceConfigCommon.rachConfigCommon = rachConfigCommon;
2506 
2509 }
2510 
2511 
2512 } // namespace ns3
2513 
virtual void AddNeighbourRelation(uint16_t cellId)=0
Add a new Neighbour Relation entry.
Callback< void, Ptr< Packet > > m_forwardUpCallback
Definition: lte-enb-rrc.h:1046
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
Both the RSRP and RSRQ quantities are to be included in the measurement report.
Definition: lte-rrc-sap.h:369
TracedCallback< uint64_t, uint16_t, uint16_t > m_handoverEndOkTrace
The HandoverEndOk trace source.
Definition: lte-enb-rrc.h:1246
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:102
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:1176
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:1100
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
Ptr< T > GetObject(void) const
Get a pointer to the requested aggregated Object.
Definition: object.h:462
LteFfrRrcSapProvider * m_ffrRrcSapProvider
Interface to the FFR algorithm instance.
Definition: lte-enb-rrc.h:1071
virtual void SetEarfcn(uint16_t ulEarfcn, uint16_t dlEarfcn)=0
static TypeId GetTypeId(void)
Definition: lte-rlc.cc:185
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:1069
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:1169
std::vector< CellMeasurementResultItem > cellMeasurementResultList
Definition: epc-x2-sap.h:316
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
enum ns3::LteRrcSap::ReportConfigEutra::@73 triggerQuantity
The quantities used to evaluate the triggering condition for the event, see 3GPP TS 36...
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:824
Specifies criteria for triggering of an E-UTRA measurement reporting event.
Definition: lte-rrc-sap.h:321
void SetCsgId(uint32_t csgId, bool csgIndication)
Associate this RRC entity with a particular CSG information.
uint16_t GetSrsConfigurationIndex(void) const
uint8_t qci
QoS Class Identifier.
static TypeId GetTypeId(void)
uint16_t m_sourceCellId
Definition: lte-enb-rrc.h: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:67
uint16_t m_rnti
The C-RNTI attribute.
Definition: lte-enb-rrc.h:434
std::list< SrbToAddMod > srbToAddModList
Definition: lte-rrc-sap.h:253
Event A2: Serving becomes worse than absolute threshold.
Definition: lte-rrc-sap.h:332
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:1104
RSRP is used for the threshold.
Definition: lte-rrc-sap.h:314
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition: nstime.h:903
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:792
LteEnbCmacSapUser * GetLteEnbCmacSapUser()
Get the CMAC SAP offered by this RRC.
uint8_t m_transmissionMode
Transmission mode 1..7
enum ns3::LteRrcSap::ReportConfigEutra::@71 eventId
Choice of E-UTRA event triggered reporting criteria.
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:1102
uint8_t m_lastRrcTransactionIdentifier
Definition: lte-enb-rrc.h:441
Reference Signal Received Power.
Definition: lte-rrc-sap.h:362
uint16_t m_srsCurrentPeriodicityId
The SrsPeriodicity attribute.
Definition: lte-enb-rrc.h:1154
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)
Report a fatal error with a message and terminate.
Definition: fatal-error.h:162
uint64_t m_imsi
International Mobile Subscriber Identity assigned to this UE.
Definition: lte-enb-rrc.h: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
Time m_handoverLeavingTimeoutDuration
The HandoverLeavingTimeoutDuration attribute.
Definition: lte-enb-rrc.h:1220
uint64_t mbrDl
maximum bitrate in downlink
void SetBid(uint8_t bid)
Set the bearer id to the given value.
uint8_t GetBid(void) const
Time m_connectionRejectedTimeoutDuration
The ConnectionRejectedTimeoutDuration attribute.
Definition: lte-enb-rrc.h:1205
LteMacSapProvider * m_macSapProvider
Interface to the eNodeB MAC instance, to be used by RLC instances.
Definition: lte-enb-rrc.h:1079
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:1076
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:127
void SetLteMacSapProvider(LteMacSapProvider *s)
set the MAC SAP provider.
enum ns3::LteRrcSap::ThresholdEutra::@69 choice
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
LteRrcSap::RrcConnectionReconfiguration GetRrcConnectionReconfigurationForHandover()
Definition: lte-enb-rrc.cc:636
The attribute can be written at construction-time.
Definition: type-id.h:65
void SwitchToState(State s)
Switch the UeManager to the given state.
Time m_connectionSetupTimeoutDuration
The ConnectionSetupTimeoutDuration attribute.
Definition: lte-enb-rrc.h:1200
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:1049
Event A4: Neighbour becomes better than absolute threshold.
Definition: lte-rrc-sap.h:334
uint8_t m_rsrqFilterCoefficient
The RsrqFilterCoefficient attribute.
Definition: lte-enb-rrc.h:1186
LteEnbRrcSapUser * m_rrcSapUser
Interface to send messages to UE over the RRC protocol.
Definition: lte-enb-rrc.h:1074
uint16_t m_dlEarfcn
Downlink E-UTRA Absolute Radio Frequency Channel Number.
Definition: lte-enb-rrc.h:1096
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:1082
LteRrcSap::SystemInformationBlockType1 m_sib1
The System Information Block Type 1 that is currently broadcasted over BCH.
Definition: lte-enb-rrc.h:1107
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:1193
void SetForwardUpCallback(Callback< void, Ptr< Packet > > cb)
set the callback used to forward data packets up the stack
Ptr< const AttributeChecker > MakeTimeChecker(const Time min, const Time max)
Helper to make a Time checker with bounded range.
Definition: time.cc:446
void DoRecvRrcConnectionSetupCompleted(uint16_t rnti, LteRrcSap::RrcConnectionSetupCompleted msg)
Part of the RRC protocol. 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
LteHandoverManagementSapUser * m_handoverManagementSapUser
Receive API calls from the handover algorithm instance.
Definition: lte-enb-rrc.h:1059
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:1226
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:1054
Ptr< UeManager > GetUeManager(uint16_t rnti)
Parameters for LtePdcpSapUser::ReceivePdcpSdu.
Definition: lte-pdcp-sap.h:76
uint8_t lcId
logical channel identifier
This class contains the specification of EPS Bearers.
Definition: eps-bearer.h:71
uint16_t m_rnti
UE id within this cell.
bool m_admitRrcConnectionRequest
The AdmitRrcConnectionRequest attribute.
Definition: lte-enb-rrc.h:1174
int8_t m_qRxLevMin
The QRxLevMin attribute.
Definition: lte-enb-rrc.h:1164
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 ...
Ptr< const AttributeAccessor > MakePointerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
Definition: pointer.h:220
Hold variables of type enum.
Definition: enum.h:54
static EventId Schedule(Time const &delay, MEM mem_ptr, OBJ obj)
Schedule an event to expire after delay.
Definition: simulator.h:1238
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:957
uint16_t m_ulEarfcn
Uplink E-UTRA Absolute Radio Frequency Channel Number.
Definition: lte-enb-rrc.h:1098
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:1231
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.
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
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:1089
std::set< uint8_t > m_ffrMeasIds
List of measurement identities which are intended for FFR purpose.
Definition: lte-enb-rrc.h:1125
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:162
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:1121
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
Definition: log.h:252
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:1134
TracedCallback< uint64_t, uint16_t, uint16_t, LteRrcSap::MeasurementReport > m_recvMeasurementReportTrace
The RecvMeasurementReport trace source.
Definition: lte-enb-rrc.h:1251
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:1180
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:1051
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:141
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
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)
enum ns3::LteRrcSap::ReportConfigEutra::@72 purpose
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:1241
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:958
Parameters for [re]configuring the UE.
Time m_systemInformationPeriodicity
The SystemInformationPeriodicity attribute.
Definition: lte-enb-rrc.h:1150
LteEnbRrcSapProvider * GetLteEnbRrcSapProvider()
RadioResourceConfigCommonSib radioResourceConfigCommon
Definition: lte-rrc-sap.h:536
static Time Now(void)
Return the current simulation virtual time.
Definition: simulator.cc:224
std::vector< ErabToBeSetupItem > bearers
Definition: epc-x2-sap.h:234
uint8_t m_defaultTransmissionMode
The DefaultTransmissionMode attribute.
Definition: lte-enb-rrc.h:1140
void DoRecvResourceStatusUpdate(EpcX2SapUser::ResourceStatusUpdateParams params)
void SetLcId(uint8_t lcId)
Definition: lte-rlc.cc:134
Event A5: PCell becomes worse than absolute threshold1 AND Neighbour becomes better than another abso...
Definition: lte-rrc-sap.h:335
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:90
EpcEnbS1SapUser * m_s1SapUser
Interface to receive messages from core network over the S1 protocol.
Definition: lte-enb-rrc.h:1084
std::set< uint16_t > m_ueSrsConfigurationIndexSet
Definition: lte-enb-rrc.h:1155
void SetSrsPeriodicity(uint32_t p)
uint16_t rnti
C-RNTI identifying the UE.
virtual void DoDispose(void)
Destructor implementation.
TypeId GetRlcType(EpsBearer bearer)
bool m_configured
True if ConfigureCell() has been completed.
Definition: lte-enb-rrc.h:1092
LogicalChannelConfig logicalChannelConfig
Definition: lte-rrc-sap.h:220
uint64_t mbrUl
maximum bitrate in uplink
void HandoverJoiningTimeout(uint16_t rnti)
Method triggered when a UE is expected to join the cell for a handover but does not do so in a reason...
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
The attribute can be read.
Definition: type-id.h:63
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:1064
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:831
LteEnbCmacSapProvider * m_cmacSapProvider
Interface to the eNodeB MAC instance.
Definition: lte-enb-rrc.h:1056
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:1112
#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:895
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:1236
uint8_t GetLogicalChannelPriority(EpsBearer bearer)
uint8_t lcid
the logical channel id corresponding to the sending RLC instance
Definition: lte-pdcp-sap.h:80
bool valid
true if a valid RA config was allocated, false otherwise
uint8_t GetNewRrcTransactionIdentifier()
void DoRecvSnStatusTransfer(EpcX2SapUser::SnStatusTransferParams params)
RSRQ is used for the threshold.
Definition: lte-rrc-sap.h:315
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:1214
LteRlcSapProvider * GetLteRlcSapProvider()
Definition: lte-rlc.cc:148
enum ns3::LteRrcSap::ReportConfigEutra::@74 reportQuantity
The quantities to be included in the measurement report, always assumed to be BOTH.
uint16_t m_lastAllocatedConfigurationIndex
Definition: lte-enb-rrc.h:1156
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:1061
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:1123
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...
enum ns3::LteRrcSap::SoundingRsUlConfigDedicated::@67 type
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:1145
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
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:58
virtual bool GetNoX2(uint16_t cellId) const =0
Get the value of No X2 field of a neighbouring cell from the Neighbour Relation Table (NRT)...
uint16_t m_targetCellId
Definition: lte-enb-rrc.h:462
std::list< ReportConfigToAddMod > reportConfigToAddModList
Definition: lte-rrc-sap.h:465
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition: type-id.cc:904
uint8_t Bid2Drbid(uint8_t bid)
static TypeId GetTypeId(void)
Definition: lte-rlc-am.cc:88
void SetS1SapProvider(EpcEnbS1SapProvider *s)
Set the S1 SAP Provider.
uint8_t Lcid2Drbid(uint8_t lcid)
Event A1: Serving becomes better than absolute threshold.
Definition: lte-rrc-sap.h:331
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:1087
LteAnrSapProvider * m_anrSapProvider
Interface to the ANR instance.
Definition: lte-enb-rrc.h:1066
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:155
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
Reference Signal Received Quality.
Definition: lte-rrc-sap.h:363
uint16_t m_cellId
Cell identifier. Must be unique across the simulation.
Definition: lte-enb-rrc.h:1094
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:1118
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)