A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
lte-test-radio-link-failure.cc
Go to the documentation of this file.
1/*
2 * Copyright (c) 2018 Fraunhofer ESK
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Vignesh Babu <ns3-dev@esk.fraunhofer.de>
7 *
8 * Modified by:
9 * Zoraze Ali <zoraze.ali@cttc.es> (included both RRC protocol, two
10 * eNB scenario and UE jump away
11 * logic)
12 */
13
15
16#include "ns3/core-module.h"
17#include "ns3/internet-module.h"
18#include "ns3/lte-module.h"
19#include "ns3/mobility-module.h"
20#include "ns3/network-module.h"
21#include "ns3/packet-sink-helper.h"
22#include "ns3/point-to-point-module.h"
23#include "ns3/udp-client-server-helper.h"
24
25#include <iomanip>
26#include <iostream>
27#include <stdio.h>
28#include <vector>
29
30using namespace ns3;
31
32NS_LOG_COMPONENT_DEFINE("LteRadioLinkFailureTest");
33
34/*
35 * Test Suite
36 */
38 : TestSuite("lte-radio-link-failure", Type::SYSTEM)
39{
40 std::vector<Vector> uePositionList;
41 std::vector<Vector> enbPositionList;
42 std::vector<Time> checkConnectedList;
43 Vector ueJumpAwayPosition;
44
45 uePositionList.emplace_back(10, 0, 0);
46 enbPositionList.emplace_back(0, 0, 0);
47 ueJumpAwayPosition = Vector(7000.0, 0.0, 0.0);
48 // check before jumping
49 checkConnectedList.push_back(Seconds(0.3));
50 // check connection after jumping but before T310 timer expiration.
51 // This is to make sure that UE stays in connected mode
52 // before the expiration of T310 timer.
53 checkConnectedList.push_back(Seconds(1));
54
55 // One eNB: Ideal RRC PROTOCOL
56 //
58 1,
59 Seconds(2),
60 true,
61 uePositionList,
62 enbPositionList,
63 ueJumpAwayPosition,
64 checkConnectedList),
65 TestCase::Duration::QUICK);
66
67 // One eNB: Real RRC PROTOCOL
69 1,
70 Seconds(2),
71 false,
72 uePositionList,
73 enbPositionList,
74 ueJumpAwayPosition,
75 checkConnectedList),
76 TestCase::Duration::QUICK);
77
78 // Two eNBs: Ideal RRC PROTOCOL
79
80 // We place the second eNB close to the position where the UE will jump
81 enbPositionList.emplace_back(7020, 0, 0);
82
84 1,
85 Seconds(2),
86 true,
87 uePositionList,
88 enbPositionList,
89 ueJumpAwayPosition,
90 checkConnectedList),
91 TestCase::Duration::QUICK);
92
93 // Two eNBs: Ideal RRC PROTOCOL
95 1,
96 Seconds(2),
97 false,
98 uePositionList,
99 enbPositionList,
100 ueJumpAwayPosition,
101 checkConnectedList),
102 TestCase::Duration::QUICK);
103
104} // end of LteRadioLinkFailureTestSuite::LteRadioLinkFailureTestSuite ()
105
106/**
107 * \ingroup lte-test
108 * Static variable for test initialization
109 */
111
112/*
113 * Test Case
114 */
115
116std::string
118{
119 std::ostringstream oss;
120 std::string rrcProtocol;
121 if (isIdealRrc)
122 {
123 rrcProtocol = "RRC Ideal";
124 }
125 else
126 {
127 rrcProtocol = "RRC Real";
128 }
129 oss << numEnbs << " eNBs, " << numUes << " UEs, " << rrcProtocol << " Protocol";
130 return oss.str();
131}
132
134 uint32_t numUes,
135 Time simTime,
136 bool isIdealRrc,
137 std::vector<Vector> uePositionList,
138 std::vector<Vector> enbPositionList,
139 Vector ueJumpAwayPosition,
140 std::vector<Time> checkConnectedList)
141 : TestCase(BuildNameString(numEnbs, numUes, isIdealRrc)),
142 m_numEnbs(numEnbs),
143 m_numUes(numUes),
144 m_simTime(simTime),
145 m_isIdealRrc(isIdealRrc),
146 m_uePositionList(uePositionList),
147 m_enbPositionList(enbPositionList),
148 m_checkConnectedList(checkConnectedList),
149 m_ueJumpAwayPosition(ueJumpAwayPosition)
150{
151 NS_LOG_FUNCTION(this << GetName());
156}
157
162
163void
165{
166 // LogLevel logLevel = (LogLevel) (LOG_PREFIX_FUNC | LOG_PREFIX_TIME | LOG_LEVEL_ALL);
167 // LogComponentEnable ("LteUeRrc", logLevel);
168 // LogComponentEnable ("LteEnbRrc", logLevel);
169 // LogComponentEnable ("LteRadioLinkFailureTest", logLevel);
170
171 Config::SetDefault("ns3::MacStatsCalculator::DlOutputFilename",
172 StringValue(CreateTempDirFilename("DlMacStats.txt")));
173 Config::SetDefault("ns3::MacStatsCalculator::UlOutputFilename",
174 StringValue(CreateTempDirFilename("UlMacStats.txt")));
175 Config::SetDefault("ns3::RadioBearerStatsCalculator::DlRlcOutputFilename",
176 StringValue(CreateTempDirFilename("DlRlcStats.txt")));
177 Config::SetDefault("ns3::RadioBearerStatsCalculator::UlRlcOutputFilename",
178 StringValue(CreateTempDirFilename("UlRlcStats.txt")));
179 Config::SetDefault("ns3::RadioBearerStatsCalculator::DlPdcpOutputFilename",
180 StringValue(CreateTempDirFilename("DlPdcpStats.txt")));
181 Config::SetDefault("ns3::RadioBearerStatsCalculator::UlPdcpOutputFilename",
182 StringValue(CreateTempDirFilename("UlPdcpStats.txt")));
183 Config::SetDefault("ns3::PhyStatsCalculator::DlRsrpSinrFilename",
184 StringValue(CreateTempDirFilename("DlRsrpSinrStats.txt")));
185 Config::SetDefault("ns3::PhyStatsCalculator::UlSinrFilename",
186 StringValue(CreateTempDirFilename("UlSinrStats.txt")));
187 Config::SetDefault("ns3::PhyStatsCalculator::UlInterferenceFilename",
188 StringValue(CreateTempDirFilename("UlInterferenceStats.txt")));
189 Config::SetDefault("ns3::PhyRxStatsCalculator::DlRxOutputFilename",
190 StringValue(CreateTempDirFilename("DlRxPhyStats.txt")));
191 Config::SetDefault("ns3::PhyRxStatsCalculator::UlRxOutputFilename",
192 StringValue(CreateTempDirFilename("UlRxPhyStats.txt")));
193 Config::SetDefault("ns3::PhyTxStatsCalculator::DlTxOutputFilename",
194 StringValue(CreateTempDirFilename("DlTxPhyStats.txt")));
195 Config::SetDefault("ns3::PhyTxStatsCalculator::UlTxOutputFilename",
196 StringValue(CreateTempDirFilename("UlTxPhyStats.txt")));
197
198 NS_LOG_FUNCTION(this << GetName());
199 uint16_t numBearersPerUe = 1;
200 Time simTime = m_simTime;
201 double eNodeB_txPower = 43;
202
203 Config::SetDefault("ns3::LteHelper::UseIdealRrc", BooleanValue(m_isIdealRrc));
204
207 lteHelper->SetEpcHelper(epcHelper);
208
209 lteHelper->SetPathlossModelType(TypeId::LookupByName("ns3::LogDistancePropagationLossModel"));
210 lteHelper->SetPathlossModelAttribute("Exponent", DoubleValue(3.9));
211 lteHelper->SetPathlossModelAttribute("ReferenceLoss",
212 DoubleValue(38.57)); // ref. loss in dB at 1m for 2.025GHz
213 lteHelper->SetPathlossModelAttribute("ReferenceDistance", DoubleValue(1));
214
215 //----power related (equal for all base stations)----
216 Config::SetDefault("ns3::LteEnbPhy::TxPower", DoubleValue(eNodeB_txPower));
217 Config::SetDefault("ns3::LteUePhy::TxPower", DoubleValue(23));
218 Config::SetDefault("ns3::LteUePhy::NoiseFigure", DoubleValue(7));
219 Config::SetDefault("ns3::LteEnbPhy::NoiseFigure", DoubleValue(2));
220 Config::SetDefault("ns3::LteUePhy::EnableUplinkPowerControl", BooleanValue(true));
221 Config::SetDefault("ns3::LteUePowerControl::ClosedLoop", BooleanValue(true));
222 Config::SetDefault("ns3::LteUePowerControl::AccumulationEnabled", BooleanValue(true));
223
224 //----frequency related----
225 lteHelper->SetEnbDeviceAttribute("DlEarfcn", UintegerValue(100)); // 2120MHz
226 lteHelper->SetEnbDeviceAttribute("UlEarfcn", UintegerValue(18100)); // 1930MHz
227 lteHelper->SetEnbDeviceAttribute("DlBandwidth", UintegerValue(25)); // 5MHz
228 lteHelper->SetEnbDeviceAttribute("UlBandwidth", UintegerValue(25)); // 5MHz
229
230 //----others----
231 lteHelper->SetSchedulerType("ns3::PfFfMacScheduler");
232 Config::SetDefault("ns3::LteAmc::AmcModel", EnumValue(LteAmc::PiroEW2010));
233 Config::SetDefault("ns3::LteAmc::Ber", DoubleValue(0.01));
234 Config::SetDefault("ns3::PfFfMacScheduler::HarqEnabled", BooleanValue(true));
235
236 // Radio link failure detection parameters
237 Config::SetDefault("ns3::LteUeRrc::N310", UintegerValue(1));
238 Config::SetDefault("ns3::LteUeRrc::N311", UintegerValue(1));
239 Config::SetDefault("ns3::LteUeRrc::T310", TimeValue(Seconds(1)));
240
241 // Create the internet
242 Ptr<Node> pgw = epcHelper->GetPgwNode();
243 // Create a single RemoteHost0x18ab460
244 NodeContainer remoteHostContainer;
245 remoteHostContainer.Create(1);
246 Ptr<Node> remoteHost = remoteHostContainer.Get(0);
247 InternetStackHelper internet;
248 internet.Install(remoteHostContainer);
250 p2ph.SetDeviceAttribute("DataRate", DataRateValue(DataRate("100Gb/s")));
251 p2ph.SetDeviceAttribute("Mtu", UintegerValue(1500));
252 p2ph.SetChannelAttribute("Delay", TimeValue(Seconds(0.010)));
253 NetDeviceContainer internetDevices = p2ph.Install(pgw, remoteHost);
254 Ipv4AddressHelper ipv4h;
255 ipv4h.SetBase("1.0.0.0", "255.0.0.0");
256 Ipv4InterfaceContainer internetIpIfaces = ipv4h.Assign(internetDevices);
257 Ipv4Address remoteHostAddr = internetIpIfaces.GetAddress(1);
258 Ipv4StaticRoutingHelper ipv4RoutingHelper;
259 Ptr<Ipv4StaticRouting> remoteHostStaticRouting =
260 ipv4RoutingHelper.GetStaticRouting(remoteHost->GetObject<Ipv4>());
261 remoteHostStaticRouting->AddNetworkRouteTo(Ipv4Address("7.0.0.0"), Ipv4Mask("255.0.0.0"), 1);
262
263 // Create Nodes: eNodeB and UE
264 NodeContainer enbNodes;
265 NodeContainer ueNodes;
266 enbNodes.Create(m_numEnbs);
267 ueNodes.Create(m_numUes);
268
269 // Mobility
271
272 for (auto enbPosIt = m_enbPositionList.begin(); enbPosIt != m_enbPositionList.end(); ++enbPosIt)
273 {
274 positionAllocEnb->Add(*enbPosIt);
275 }
276 MobilityHelper mobility;
277 mobility.SetMobilityModel("ns3::ConstantPositionMobilityModel");
278 mobility.SetPositionAllocator(positionAllocEnb);
279 mobility.Install(enbNodes);
280
282
283 for (auto uePosIt = m_uePositionList.begin(); uePosIt != m_uePositionList.end(); ++uePosIt)
284 {
285 positionAllocUe->Add(*uePosIt);
286 }
287
288 mobility.SetPositionAllocator(positionAllocUe);
289 mobility.SetMobilityModel("ns3::ConstantPositionMobilityModel");
290 mobility.Install(ueNodes);
291 m_ueMobility = ueNodes.Get(0)->GetObject<MobilityModel>();
292
293 // Install LTE Devices in eNB and UEs
294 NetDeviceContainer enbDevs;
295 NetDeviceContainer ueDevs;
296
297 int64_t randomStream = 1;
298 enbDevs = lteHelper->InstallEnbDevice(enbNodes);
299 randomStream += lteHelper->AssignStreams(enbDevs, randomStream);
300 ueDevs = lteHelper->InstallUeDevice(ueNodes);
301 randomStream += lteHelper->AssignStreams(ueDevs, randomStream);
302
303 // Install the IP stack on the UEs
304 internet.Install(ueNodes);
305 Ipv4InterfaceContainer ueIpIfaces;
306 ueIpIfaces = epcHelper->AssignUeIpv4Address(NetDeviceContainer(ueDevs));
307
308 // Attach a UE to a eNB
309 lteHelper->Attach(ueDevs);
310
311 // Install and start applications on UEs and remote host
312 uint16_t dlPort = 10000;
313 uint16_t ulPort = 20000;
314
315 DataRateValue dataRateValue = DataRate("18.6Mbps");
316 uint64_t bitRate = dataRateValue.Get().GetBitRate();
317 uint32_t packetSize = 1024; // bytes
318 NS_LOG_DEBUG("bit rate " << bitRate);
319 double interPacketInterval = static_cast<double>(packetSize * 8) / bitRate;
320 Time udpInterval = Seconds(interPacketInterval);
321
322 NS_LOG_DEBUG("UDP will use application interval " << udpInterval.As(Time::S));
323
324 for (uint32_t u = 0; u < m_numUes; ++u)
325 {
326 Ptr<Node> ue = ueNodes.Get(u);
327 // Set the default gateway for the UE
328 Ptr<Ipv4StaticRouting> ueStaticRouting =
329 ipv4RoutingHelper.GetStaticRouting(ue->GetObject<Ipv4>());
330 ueStaticRouting->SetDefaultRoute(epcHelper->GetUeDefaultGatewayAddress(), 1);
331
332 for (uint32_t b = 0; b < numBearersPerUe; ++b)
333 {
334 ApplicationContainer ulClientApps;
335 ApplicationContainer ulServerApps;
336 ApplicationContainer dlClientApps;
337 ApplicationContainer dlServerApps;
338
339 ++dlPort;
340 ++ulPort;
341
342 NS_LOG_LOGIC("installing UDP DL app for UE " << u + 1);
343 UdpClientHelper dlClientHelper(ueIpIfaces.GetAddress(u), dlPort);
344 dlClientHelper.SetAttribute("Interval", TimeValue(udpInterval));
345 dlClientHelper.SetAttribute("MaxPackets", UintegerValue(1000000));
346 dlClientApps.Add(dlClientHelper.Install(remoteHost));
347
348 PacketSinkHelper dlPacketSinkHelper("ns3::UdpSocketFactory",
350 dlServerApps.Add(dlPacketSinkHelper.Install(ue));
351
352 NS_LOG_LOGIC("installing UDP UL app for UE " << u + 1);
353 UdpClientHelper ulClientHelper(remoteHostAddr, ulPort);
354 ulClientHelper.SetAttribute("Interval", TimeValue(udpInterval));
355 ulClientHelper.SetAttribute("MaxPackets", UintegerValue(1000000));
356 ulClientApps.Add(ulClientHelper.Install(ue));
357
358 PacketSinkHelper ulPacketSinkHelper("ns3::UdpSocketFactory",
360 ulServerApps.Add(ulPacketSinkHelper.Install(remoteHost));
361
364 dlpf.localPortStart = dlPort;
365 dlpf.localPortEnd = dlPort;
366 tft->Add(dlpf);
368 ulpf.remotePortStart = ulPort;
369 ulpf.remotePortEnd = ulPort;
370 tft->Add(ulpf);
372 lteHelper->ActivateDedicatedEpsBearer(ueDevs.Get(u), bearer, tft);
373
374 dlServerApps.Start(Seconds(0.27));
375 dlClientApps.Start(Seconds(0.27));
376 ulServerApps.Start(Seconds(0.27));
377 ulClientApps.Start(Seconds(0.27));
378
379 } // end for b
380 }
381
382 lteHelper->EnableTraces();
383
384 for (uint32_t u = 0; u < m_numUes; ++u)
385 {
388 this,
389 ueDevs.Get(u),
390 enbDevs);
391 }
392
395 this,
397
398 // connect custom trace sinks
400 "/NodeList/*/DeviceList/*/LteEnbRrc/ConnectionEstablished",
403 "/NodeList/*/DeviceList/*/LteUeRrc/ConnectionEstablished",
405 Config::Connect("/NodeList/*/DeviceList/*/LteUeRrc/StateTransition",
408 "/NodeList/*/DeviceList/*/LteEnbRrc/NotifyConnectionRelease",
410 Config::Connect("/NodeList/*/DeviceList/*/LteUeRrc/PhySyncDetection",
412 Config::Connect("/NodeList/*/DeviceList/*/LteUeRrc/RadioLinkFailure",
414
415 Simulator::Stop(simTime);
416
418 for (uint32_t u = 0; u < m_numUes; ++u)
419 {
422 true,
423 "Error, UE transitions to idle state for other than radio link failure");
424 CheckIdle(ueDevs.Get(u), enbDevs);
425 }
427} // end of void LteRadioLinkFailureTestCase::DoRun ()
428
429void
431{
432 NS_LOG_FUNCTION(this);
433 // move to a far away location so that transmission errors occur
434
435 m_ueMobility->SetPosition(UeJumpAwayPosition);
436}
437
438void
440{
441 NS_LOG_FUNCTION(ueDevice);
442
443 Ptr<LteUeNetDevice> ueLteDevice = ueDevice->GetObject<LteUeNetDevice>();
444 Ptr<LteUeRrc> ueRrc = ueLteDevice->GetRrc();
445 NS_TEST_ASSERT_MSG_EQ(ueRrc->GetState(), LteUeRrc::CONNECTED_NORMALLY, "Wrong LteUeRrc state!");
446 uint16_t cellId = ueRrc->GetCellId();
447
448 Ptr<LteEnbNetDevice> enbLteDevice;
449
450 for (auto enbDevIt = enbDevices.Begin(); enbDevIt != enbDevices.End(); ++enbDevIt)
451 {
452 if (((*enbDevIt)->GetObject<LteEnbNetDevice>())->HasCellId(cellId))
453 {
454 enbLteDevice = (*enbDevIt)->GetObject<LteEnbNetDevice>();
455 }
456 }
457
458 NS_TEST_ASSERT_MSG_NE(enbLteDevice, nullptr, "LTE eNB device not found");
459 Ptr<LteEnbRrc> enbRrc = enbLteDevice->GetRrc();
460 uint16_t rnti = ueRrc->GetRnti();
461 Ptr<UeManager> ueManager = enbRrc->GetUeManager(rnti);
462 NS_TEST_ASSERT_MSG_NE(ueManager, nullptr, "RNTI " << rnti << " not found in eNB");
463
464 UeManager::State ueManagerState = ueManager->GetState();
465 NS_TEST_ASSERT_MSG_EQ(ueManagerState, UeManager::CONNECTED_NORMALLY, "Wrong UeManager state!");
466 NS_ASSERT_MSG(ueManagerState == UeManager::CONNECTED_NORMALLY, "Wrong UeManager state!");
467
468 uint16_t ueCellId = ueRrc->GetCellId();
469 uint16_t enbCellId = enbLteDevice->GetCellId();
470 uint8_t ueDlBandwidth = ueRrc->GetDlBandwidth();
471 uint8_t enbDlBandwidth = enbLteDevice->GetDlBandwidth();
472 uint8_t ueUlBandwidth = ueRrc->GetUlBandwidth();
473 uint8_t enbUlBandwidth = enbLteDevice->GetUlBandwidth();
474 uint8_t ueDlEarfcn = ueRrc->GetDlEarfcn();
475 uint8_t enbDlEarfcn = enbLteDevice->GetDlEarfcn();
476 uint8_t ueUlEarfcn = ueRrc->GetUlEarfcn();
477 uint8_t enbUlEarfcn = enbLteDevice->GetUlEarfcn();
478 uint64_t ueImsi = ueLteDevice->GetImsi();
479 uint64_t enbImsi = ueManager->GetImsi();
480
481 NS_TEST_ASSERT_MSG_EQ(ueImsi, enbImsi, "inconsistent IMSI");
482 NS_TEST_ASSERT_MSG_EQ(ueCellId, enbCellId, "inconsistent CellId");
483 NS_TEST_ASSERT_MSG_EQ(ueDlBandwidth, enbDlBandwidth, "inconsistent DlBandwidth");
484 NS_TEST_ASSERT_MSG_EQ(ueUlBandwidth, enbUlBandwidth, "inconsistent UlBandwidth");
485 NS_TEST_ASSERT_MSG_EQ(ueDlEarfcn, enbDlEarfcn, "inconsistent DlEarfcn");
486 NS_TEST_ASSERT_MSG_EQ(ueUlEarfcn, enbUlEarfcn, "inconsistent UlEarfcn");
487
488 ObjectMapValue enbDataRadioBearerMapValue;
489 ueManager->GetAttribute("DataRadioBearerMap", enbDataRadioBearerMapValue);
490 NS_TEST_ASSERT_MSG_EQ(enbDataRadioBearerMapValue.GetN(), 1 + 1, "wrong num bearers at eNB");
491
492 ObjectMapValue ueDataRadioBearerMapValue;
493 ueRrc->GetAttribute("DataRadioBearerMap", ueDataRadioBearerMapValue);
494 NS_TEST_ASSERT_MSG_EQ(ueDataRadioBearerMapValue.GetN(), 1 + 1, "wrong num bearers at UE");
495
496 auto enbBearerIt = enbDataRadioBearerMapValue.Begin();
497 auto ueBearerIt = ueDataRadioBearerMapValue.Begin();
498 while (enbBearerIt != enbDataRadioBearerMapValue.End() &&
499 ueBearerIt != ueDataRadioBearerMapValue.End())
500 {
501 Ptr<LteDataRadioBearerInfo> enbDrbInfo =
502 enbBearerIt->second->GetObject<LteDataRadioBearerInfo>();
504 ueBearerIt->second->GetObject<LteDataRadioBearerInfo>();
505 NS_TEST_ASSERT_MSG_EQ((uint32_t)enbDrbInfo->m_epsBearerIdentity,
506 (uint32_t)ueDrbInfo->m_epsBearerIdentity,
507 "epsBearerIdentity differs");
508 NS_TEST_ASSERT_MSG_EQ((uint32_t)enbDrbInfo->m_drbIdentity,
509 (uint32_t)ueDrbInfo->m_drbIdentity,
510 "drbIdentity differs");
511 NS_TEST_ASSERT_MSG_EQ((uint32_t)enbDrbInfo->m_logicalChannelIdentity,
512 (uint32_t)ueDrbInfo->m_logicalChannelIdentity,
513 "logicalChannelIdentity differs");
514
515 ++enbBearerIt;
516 ++ueBearerIt;
517 }
518 NS_ASSERT_MSG(enbBearerIt == enbDataRadioBearerMapValue.End(), "too many bearers at eNB");
519 NS_ASSERT_MSG(ueBearerIt == ueDataRadioBearerMapValue.End(), "too many bearers at UE");
520}
521
522void
524{
525 NS_LOG_FUNCTION(ueDevice);
526
527 Ptr<LteUeNetDevice> ueLteDevice = ueDevice->GetObject<LteUeNetDevice>();
528 Ptr<LteUeRrc> ueRrc = ueLteDevice->GetRrc();
529 uint16_t rnti = ueRrc->GetRnti();
530 uint32_t numEnbDevices = enbDevices.GetN();
531 bool ueManagerFound = false;
532
533 switch (numEnbDevices)
534 {
535 // 1 eNB
536 case 1:
537 NS_TEST_ASSERT_MSG_EQ(ueRrc->GetState(),
539 "Wrong LteUeRrc state!");
540 ueManagerFound = CheckUeExistAtEnb(rnti, enbDevices.Get(0));
541 NS_TEST_ASSERT_MSG_EQ(ueManagerFound,
542 false,
543 "Unexpected RNTI with value " << rnti << " found in eNB");
544 break;
545 // 2 eNBs
546 case 2:
547 NS_TEST_ASSERT_MSG_EQ(ueRrc->GetState(),
549 "Wrong LteUeRrc state!");
550 ueManagerFound = CheckUeExistAtEnb(rnti, enbDevices.Get(1));
551 NS_TEST_ASSERT_MSG_EQ(ueManagerFound,
552 true,
553 "RNTI " << rnti << " is not attached to the eNB");
554 break;
555 default:
556 NS_FATAL_ERROR("The RRC state of the UE in more then 2 eNB scenario is not defined. "
557 "Consider creating more cases");
558 break;
559 }
560}
561
562bool
564{
565 NS_LOG_FUNCTION(this << rnti);
566 Ptr<LteEnbNetDevice> enbLteDevice = DynamicCast<LteEnbNetDevice>(enbDevice);
567 NS_ABORT_MSG_IF(!enbLteDevice, "LTE eNB device not found");
568 Ptr<LteEnbRrc> enbRrc = enbLteDevice->GetRrc();
569 bool ueManagerFound = enbRrc->HasUeManager(rnti);
570 return ueManagerFound;
571}
572
573void
575 uint64_t imsi,
576 uint16_t cellId,
577 uint16_t rnti,
578 LteUeRrc::State oldState,
579 LteUeRrc::State newState)
580{
581 NS_LOG_FUNCTION(this << imsi << cellId << rnti << oldState << newState);
582 m_lastState = newState;
583}
584
585void
587 uint64_t imsi,
588 uint16_t cellId,
589 uint16_t rnti)
590{
591 NS_LOG_FUNCTION(this << imsi << cellId << rnti);
592}
593
594void
596 uint64_t imsi,
597 uint16_t cellId,
598 uint16_t rnti)
599{
600 NS_LOG_FUNCTION(this << imsi << cellId << rnti);
602 0,
603 "radio link failure detection should start only in RRC CONNECTED state");
605 0,
606 "radio link failure detection should start only in RRC CONNECTED state");
607}
608
609void
611 uint64_t imsi,
612 uint16_t cellId,
613 uint16_t rnti)
614{
615 NS_LOG_FUNCTION(this << imsi << cellId << rnti);
616}
617
618void
620 uint64_t imsi,
621 uint16_t rnti,
622 uint16_t cellId,
623 std::string type,
624 uint8_t count)
625{
626 NS_LOG_FUNCTION(this << imsi << cellId << rnti);
627 if (type == "Notify out of sync")
628 {
630 }
631 else if (type == "Notify in sync")
632 {
634 }
635}
636
637void
639 uint64_t imsi,
640 uint16_t cellId,
641 uint16_t rnti)
642{
643 NS_LOG_FUNCTION(this << imsi << cellId << rnti);
644 NS_LOG_DEBUG("RLF at " << Simulator::Now());
646 // The value of N310 is hard coded to the default value 1
649 1,
650 "wrong number of out-of-sync indications detected, check configured value for N310");
651 // The value of N311 is hard coded to the default value 1
654 1,
655 "wrong number of out-of-sync indications detected, check configured value for N311");
656 // Reset the counter for the next RRC connection establishment.
658}
holds a vector of ns3::Application pointers.
void Start(Time start) const
Start all of the Applications in this container at the start time given as a parameter.
void Add(ApplicationContainer other)
Append the contents of another ApplicationContainer to the end of this container.
ApplicationContainer Install(NodeContainer c)
Install an application on each node of the input container configured with all the attributes set wit...
void SetAttribute(const std::string &name, const AttributeValue &value)
Helper function used to set the underlying application attributes.
Class for representing data rates.
Definition data-rate.h:78
uint64_t GetBitRate() const
Get the underlying bitrate.
Definition data-rate.cc:234
DataRate Get() const
Definition data-rate.cc:20
This class can be used to hold variables of floating point type such as 'double' or 'float'.
Definition double.h:31
Hold variables of type enum.
Definition enum.h:52
This class contains the specification of EPS Bearers.
Definition eps-bearer.h:80
@ NGBR_IMS
Non-GBR IMS Signalling.
Definition eps-bearer.h:109
an Inet address class
aggregate IP/TCP/UDP functionality to existing Nodes.
A helper class to make life easier while doing simple IPv4 address assignment in scripts.
void SetBase(Ipv4Address network, Ipv4Mask mask, Ipv4Address base="0.0.0.1")
Set the base network number, network mask and base address.
Ipv4InterfaceContainer Assign(const NetDeviceContainer &c)
Assign IP addresses to the net devices specified in the container based on the current network prefix...
Ipv4 addresses are stored in host order in this class.
static Ipv4Address GetAny()
Access to the IPv4 forwarding table, interfaces, and configuration.
Definition ipv4.h:69
holds a vector of std::pair of Ptr<Ipv4> and interface index.
Ipv4Address GetAddress(uint32_t i, uint32_t j=0) const
a class to represent an Ipv4 address mask
Helper class that adds ns3::Ipv4StaticRouting objects.
Ptr< Ipv4StaticRouting > GetStaticRouting(Ptr< Ipv4 > ipv4) const
Try and find the static routing protocol as either the main routing protocol or in the list of routin...
store information on active data radio bearer instance
The eNodeB device implementation.
The LteUeNetDevice class implements the UE net device.
State
The states of the UE RRC entity.
Definition lte-ue-rrc.h:88
Helper class used to assign positions and mobility models to nodes.
Keep track of the current position and velocity of an object.
holds a vector of ns3::NetDevice pointers
uint32_t GetN() const
Get the number of Ptr<NetDevice> stored in this container.
Iterator Begin() const
Get an iterator which refers to the first NetDevice in the container.
Iterator End() const
Get an iterator which indicates past-the-last NetDevice in the container.
Ptr< NetDevice > Get(uint32_t i) const
Get the Ptr<NetDevice> stored in this container at a given index.
keep track of a set of node pointers.
void Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.
Ptr< Node > Get(uint32_t i) const
Get the Ptr<Node> stored in this container at a given index.
Ptr< T > GetObject() const
Get a pointer to the requested aggregated Object.
Definition object.h:511
Container for a set of ns3::Object pointers.
std::size_t GetN() const
Get the number of Objects.
Iterator End() const
Get an iterator to the past-the-end Object.
Iterator Begin() const
Get an iterator to the first Object.
A helper to make it easier to instantiate an ns3::PacketSinkApplication on a set of nodes.
Build a set of PointToPointNetDevice objects.
void SetDeviceAttribute(std::string name, const AttributeValue &value)
Set an attribute value to be propagated to each NetDevice created by the helper.
void SetChannelAttribute(std::string name, const AttributeValue &value)
Set an attribute value to be propagated to each Channel created by the helper.
NetDeviceContainer Install(NodeContainer c)
Smart pointer class similar to boost::intrusive_ptr.
static EventId Schedule(const Time &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
Definition simulator.h:560
static void Destroy()
Execute the events scheduled with ScheduleDestroy().
Definition simulator.cc:131
static Time Now()
Return the current simulation virtual time.
Definition simulator.cc:197
static void Run()
Run the simulation.
Definition simulator.cc:167
static void Stop()
Tell the Simulator the calling event should be the last one executed.
Definition simulator.cc:175
Hold variables of type string.
Definition string.h:45
encapsulates test code
Definition test.h:1050
void AddTestCase(TestCase *testCase, Duration duration=Duration::QUICK)
Add an individual child TestCase to this test suite.
Definition test.cc:292
std::string CreateTempDirFilename(std::string filename)
Construct the full path to a file in a temporary directory.
Definition test.cc:432
std::string GetName() const
Definition test.cc:367
A suite of tests to run.
Definition test.h:1267
Type
Type of test.
Definition test.h:1274
Simulation virtual time values and global simulation resolution.
Definition nstime.h:94
TimeWithUnit As(const Unit unit=Time::AUTO) const
Attach a unit to a Time, to facilitate output in a specific unit.
Definition time.cc:404
@ S
second
Definition nstime.h:105
static TypeId LookupByName(std::string name)
Get a TypeId by name.
Definition type-id.cc:872
Create a client application which sends UDP packets carrying a 32bit sequence number and a 64 bit tim...
State
The state of the UeManager at the eNB RRC.
Definition lte-enb-rrc.h:67
Hold an unsigned integer type.
Definition uinteger.h:34
#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:75
void SetDefault(std::string name, const AttributeValue &value)
Definition config.cc:883
void Connect(std::string path, const CallbackBase &cb)
Definition config.cc:967
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
#define NS_ABORT_MSG_IF(cond, msg)
Abnormal program termination if a condition is true, with a message.
Definition abort.h:97
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition log.h:191
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Definition log.h:257
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
Definition log.h:271
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
static LteRadioLinkFailureTestSuite g_lteRadioLinkFailureTestSuite
Static variable for test initialization.
Ptr< T > CreateObject(Args &&... args)
Create an object by type, with varying number of constructor parameters.
Definition object.h:619
Ptr< T > Create(Ts &&... args)
Create class instances by constructors with varying numbers of arguments and return them by Ptr.
Definition ptr.h:436
#define NS_TEST_ASSERT_MSG_LT(actual, limit, msg)
Test that an actual value is less than a limit and report and abort if not.
Definition test.h:699
#define NS_TEST_ASSERT_MSG_EQ(actual, limit, msg)
Test that an actual and expected (limit) value are equal and report and abort if not.
Definition test.h:134
#define NS_TEST_ASSERT_MSG_NE(actual, limit, msg)
Test that an actual and expected (limit) value are not equal and report and abort if not.
Definition test.h:554
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition nstime.h:1308
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Callback< R, Args... > MakeCallback(R(T::*memPtr)(Args...), OBJ objPtr)
Build Callbacks for class method members which take varying numbers of arguments and potentially retu...
Definition callback.h:684
Ptr< T1 > DynamicCast(const Ptr< T2 > &p)
Cast a Ptr.
Definition ptr.h:580
Implement the data structure representing a TrafficFlowTemplate Packet Filter.
Definition epc-tft.h:60
uint16_t localPortEnd
end of the port number range of the UE
Definition epc-tft.h:121
uint16_t remotePortEnd
end of the port number range of the remote host
Definition epc-tft.h:119
uint16_t remotePortStart
start of the port number range of the remote host
Definition epc-tft.h:118
uint16_t localPortStart
start of the port number range of the UE
Definition epc-tft.h:120
static const uint32_t packetSize
Packet size generated at the AP.