A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
test-lte-x2-handover.cc
Go to the documentation of this file.
1/*
2 * Copyright (c) 2012 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Nicola Baldo <nbaldo@cttc.es>
7 */
8
9#include "ns3/core-module.h"
10#include "ns3/internet-module.h"
11#include "ns3/lte-module.h"
12#include "ns3/mobility-module.h"
13#include "ns3/network-module.h"
14#include "ns3/packet-sink-helper.h"
15#include "ns3/packet-sink.h"
16#include "ns3/point-to-point-module.h"
17#include "ns3/udp-client-server-helper.h"
18
19using namespace ns3;
20
21NS_LOG_COMPONENT_DEFINE("LteX2HandoverTest");
22
23/**
24 * @ingroup lte-test
25 *
26 * @brief HandoverEvent structure
27 */
29{
30 Time startTime; ///< start time
31 uint32_t ueDeviceIndex; ///< UE device index
32 uint32_t sourceEnbDeviceIndex; ///< source ENB device index
33 uint32_t targetEnbDeviceIndex; ///< target ENB device index
34};
35
36/**
37 * @ingroup lte-test
38 *
39 * @brief Test X2 Handover. In this test is used NoOpHandoverAlgorithm and
40 * the request for handover is generated manually, and it is not based on measurements.
41 */
43{
44 public:
45 /**
46 *
47 *
48 * @param nUes number of UEs in the test
49 * @param nDedicatedBearers number of bearers to be activated per UE
50 * @param handoverEventList
51 * @param handoverEventListName
52 * @param schedulerType the scheduler type
53 * @param admitHo
54 * @param useIdealRrc true if the ideal RRC should be used
55 */
58 std::list<HandoverEvent> handoverEventList,
59 std::string handoverEventListName,
60 std::string schedulerType,
61 bool admitHo,
62 bool useIdealRrc);
63
64 private:
65 /**
66 * Build name string
67 * @param nUes number of UEs in the test
68 * @param nDedicatedBearers number of bearers to be activated per UE
69 * @param handoverEventListName
70 * @param schedulerType the scheduler type
71 * @param admitHo
72 * @param useIdealRrc true if the ideal RRC should be used
73 * @returns the name string
74 */
75 static std::string BuildNameString(uint32_t nUes,
77 std::string handoverEventListName,
78 std::string schedulerType,
79 bool admitHo,
80 bool useIdealRrc);
81 void DoRun() override;
82 /**
83 * Check connected function
84 * @param ueDevice the UE device
85 * @param enbDevice the ENB device
86 */
88
89 /**
90 * Teleport UE between both eNBs of the test
91 * @param ueNode the UE node
92 */
94
95 /**
96 * Teleport UE near the target eNB of the handover
97 * @param ueNode the UE node
98 * @param enbNode the target eNB node
99 */
101
102 uint32_t m_nUes; ///< number of UEs in the test
103 uint32_t m_nDedicatedBearers; ///< number of UEs in the test
104 std::list<HandoverEvent> m_handoverEventList; ///< handover event list
105 std::string m_handoverEventListName; ///< handover event list name
106 bool m_epc; ///< whether to use EPC
107 std::string m_schedulerType; ///< scheduler type
108 bool m_admitHo; ///< whether to admit the handover request
109 bool m_useIdealRrc; ///< whether to use the ideal RRC
112
113 /**
114 * @ingroup lte-test
115 *
116 * @brief BearerData structure
117 */
119 {
120 uint32_t bid; ///< BID
123 uint32_t dlOldTotalRx; ///< DL old total receive
124 uint32_t ulOldTotalRx; ///< UL old total receive
125 };
126
127 /**
128 * @ingroup lte-test
129 *
130 * @brief UeData structure
131 */
132 struct UeData
133 {
134 uint32_t id; ///< ID
135 std::list<BearerData> bearerDataList; ///< bearer ID list
136 };
137
138 /**
139 * @brief Save stats after handover function
140 * @param ueIndex the index of the UE
141 */
143 /**
144 * @brief Check stats a while after handover function
145 * @param ueIndex the index of the UE
146 */
148
149 std::vector<UeData> m_ueDataVector; ///< UE data vector
150
151 const Time m_maxHoDuration; ///< maximum HO duration
152 const Time m_statsDuration; ///< stats duration
153 const Time m_udpClientInterval; ///< UDP client interval
154 const uint32_t m_udpClientPktSize; ///< UDP client packet size
155};
156
157std::string
160 std::string handoverEventListName,
161 std::string schedulerType,
162 bool admitHo,
163 bool useIdealRrc)
164{
165 std::ostringstream oss;
166 oss << " nUes=" << nUes << " nDedicatedBearers=" << nDedicatedBearers << " " << schedulerType
167 << " admitHo=" << admitHo << " hoList: " << handoverEventListName;
168 if (useIdealRrc)
169 {
170 oss << ", ideal RRC";
171 }
172 else
173 {
174 oss << ", real RRC";
175 }
176 return oss.str();
177}
178
181 std::list<HandoverEvent> handoverEventList,
182 std::string handoverEventListName,
183 std::string schedulerType,
184 bool admitHo,
185 bool useIdealRrc)
186 : TestCase(BuildNameString(nUes,
190 admitHo,
191 useIdealRrc)),
192 m_nUes(nUes),
193 m_nDedicatedBearers(nDedicatedBearers),
194 m_handoverEventList(handoverEventList),
195 m_handoverEventListName(handoverEventListName),
196 m_epc(true),
197 m_schedulerType(schedulerType),
198 m_admitHo(admitHo),
199 m_useIdealRrc(useIdealRrc),
200 m_maxHoDuration(Seconds(0.1)),
201 m_statsDuration(Seconds(0.1)),
202 m_udpClientInterval(Seconds(0.01)),
203 m_udpClientPktSize(100)
204
205{
206}
207
208void
210{
215 m_admitHo,
217
221 // This test is sensitive to random variable stream assignments
224 Config::SetDefault("ns3::UdpClient::Interval", TimeValue(m_udpClientInterval));
225 Config::SetDefault("ns3::UdpClient::MaxPackets", UintegerValue(1000000));
226 Config::SetDefault("ns3::UdpClient::PacketSize", UintegerValue(m_udpClientPktSize));
227
228 // Disable Uplink Power Control
229 Config::SetDefault("ns3::LteUePhy::EnableUplinkPowerControl", BooleanValue(false));
230
231 int64_t stream = 1;
232
234 m_lteHelper->SetAttribute("PathlossModel",
235 StringValue("ns3::FriisSpectrumPropagationLossModel"));
236 m_lteHelper->SetSchedulerType(m_schedulerType);
237 m_lteHelper->SetHandoverAlgorithmType(
238 "ns3::NoOpHandoverAlgorithm"); // disable automatic handover
239 m_lteHelper->SetAttribute("UseIdealRrc", BooleanValue(m_useIdealRrc));
240
242 enbNodes.Create(2);
245
246 if (m_epc)
247 {
249 m_lteHelper->SetEpcHelper(m_epcHelper);
250 }
251
253 positionAlloc->Add(Vector(-3000, 0, 0)); // enb0
254 positionAlloc->Add(Vector(3000, 0, 0)); // enb1
255 for (uint32_t i = 0; i < m_nUes; i++)
256 {
257 positionAlloc->Add(Vector(-3000, 100, 0));
258 }
259 MobilityHelper mobility;
260 mobility.SetPositionAllocator(positionAlloc);
261 mobility.SetMobilityModel("ns3::ConstantPositionMobilityModel");
262 mobility.Install(enbNodes);
263 mobility.Install(ueNodes);
264
266 enbDevices = m_lteHelper->InstallEnbDevice(enbNodes);
267 stream += m_lteHelper->AssignStreams(enbDevices, stream);
268 for (auto it = enbDevices.Begin(); it != enbDevices.End(); ++it)
269 {
270 Ptr<LteEnbRrc> enbRrc = (*it)->GetObject<LteEnbNetDevice>()->GetRrc();
271 enbRrc->SetAttribute("AdmitHandoverRequest", BooleanValue(m_admitHo));
272 }
273
275 ueDevices = m_lteHelper->InstallUeDevice(ueNodes);
276 stream += m_lteHelper->AssignStreams(ueDevices, stream);
277
282 if (m_epc)
283 {
284 // Create a single RemoteHost
288 InternetStackHelper internet;
289 internet.Install(remoteHostContainer);
290
291 // Create the Internet
293 p2ph.SetDeviceAttribute("DataRate", DataRateValue(DataRate("100Gb/s")));
294 p2ph.SetDeviceAttribute("Mtu", UintegerValue(1500));
295 p2ph.SetChannelAttribute("Delay", TimeValue(Seconds(0.010)));
296 Ptr<Node> pgw = m_epcHelper->GetPgwNode();
299 ipv4h.SetBase("1.0.0.0", "255.0.0.0");
301 // in this container, interface 0 is the pgw, 1 is the remoteHost
303
306 ipv4RoutingHelper.GetStaticRouting(remoteHost->GetObject<Ipv4>());
307 remoteHostStaticRouting->AddNetworkRouteTo(Ipv4Address("7.0.0.0"),
308 Ipv4Mask("255.0.0.0"),
309 1);
310
311 // Install the IP stack on the UEs
312 internet.Install(ueNodes);
313 ueIpIfaces = m_epcHelper->AssignUeIpv4Address(NetDeviceContainer(ueDevices));
314 }
315
316 // attachment (needs to be done after IP stack configuration)
317 // all UEs attached to eNB 0 at the beginning
318 m_lteHelper->Attach(ueDevices, enbDevices.Get(0));
319
320 if (m_epc)
321 {
322 // always true: bool epcDl = true;
323 // always true: bool epcUl = true;
324 // the rest of this block is copied from lena-dual-stripe
325
326 // Install and start applications on UEs and remote host
327 uint16_t dlPort = 10000;
328 uint16_t ulPort = 20000;
329
330 // randomize a bit start times to avoid simulation artifacts
331 // (e.g., buffer overflows due to packet transmissions happening
332 // exactly at the same time)
334 startTimeSeconds->SetAttribute("Min", DoubleValue(0));
335 startTimeSeconds->SetAttribute("Max", DoubleValue(0.010));
336 startTimeSeconds->SetStream(stream++);
337
338 for (uint32_t u = 0; u < ueNodes.GetN(); ++u)
339 {
340 Ptr<Node> ue = ueNodes.Get(u);
341 // Set the default gateway for the UE
343 ipv4RoutingHelper.GetStaticRouting(ue->GetObject<Ipv4>());
344 ueStaticRouting->SetDefaultRoute(m_epcHelper->GetUeDefaultGatewayAddress(), 1);
345
346 UeData ueData;
347
348 for (uint32_t b = 0; b < m_nDedicatedBearers; ++b)
349 {
350 ++dlPort;
351 ++ulPort;
352
353 ApplicationContainer clientApps;
354 ApplicationContainer serverApps;
356
357 // always true: if (epcDl)
358 {
360 clientApps.Add(dlClientHelper.Install(remoteHost));
362 "ns3::UdpSocketFactory",
365 bearerData.dlSink = sinkContainer.Get(0)->GetObject<PacketSink>();
366 serverApps.Add(sinkContainer);
367 }
368 // always true: if (epcUl)
369 {
371 clientApps.Add(ulClientHelper.Install(ue));
373 "ns3::UdpSocketFactory",
376 bearerData.ulSink = sinkContainer.Get(0)->GetObject<PacketSink>();
377 serverApps.Add(sinkContainer);
378 }
379
381 // always true: if (epcDl)
382 {
385 dlpf.localPortEnd = dlPort;
386 tft->Add(dlpf);
387 }
388 // always true: if (epcUl)
389 {
392 ulpf.remotePortEnd = ulPort;
393 tft->Add(ulpf);
394 }
395
396 // always true: if (epcDl || epcUl)
397 {
399 m_lteHelper->ActivateDedicatedEpsBearer(ueDevices.Get(u), bearer, tft);
400 }
401 double d = startTimeSeconds->GetValue();
402 Time startTime = Seconds(d);
403 serverApps.Start(startTime);
404 clientApps.Start(startTime);
405
406 ueData.bearerDataList.push_back(bearerData);
407
408 } // end for b
409
410 m_ueDataVector.push_back(ueData);
411 }
412 }
413 else // (epc == false)
414 {
415 // for radio bearer activation purposes, consider together home UEs and macro UEs
416 for (uint32_t u = 0; u < ueDevices.GetN(); ++u)
417 {
419 for (uint32_t b = 0; b < m_nDedicatedBearers; ++b)
420 {
422 EpsBearer bearer(q);
423 m_lteHelper->ActivateDataRadioBearer(ueDev, bearer);
424 }
425 }
426 }
427
428 m_lteHelper->AddX2Interface(enbNodes);
429
430 // check initial RRC connection
432 for (auto it = ueDevices.Begin(); it != ueDevices.End(); ++it)
433 {
436 this,
437 *it,
438 enbDevices.Get(0));
439 }
440
441 // schedule handover events and corresponding checks
442
444 for (auto hoEventIt = m_handoverEventList.begin(); hoEventIt != m_handoverEventList.end();
445 ++hoEventIt)
446 {
447 // Teleport the UE between both eNBs just before the handover starts
450 this,
451 ueNodes.Get(hoEventIt->ueDeviceIndex));
452
455 this,
456 ueDevices.Get(hoEventIt->ueDeviceIndex),
457 enbDevices.Get(hoEventIt->sourceEnbDeviceIndex));
458
459 m_lteHelper->HandoverRequest(hoEventIt->startTime,
460 ueDevices.Get(hoEventIt->ueDeviceIndex),
461 enbDevices.Get(hoEventIt->sourceEnbDeviceIndex),
462 enbDevices.Get(hoEventIt->targetEnbDeviceIndex));
463
464 // Once the handover is finished, teleport the UE near the target eNB
467 this,
468 ueNodes.Get(hoEventIt->ueDeviceIndex),
469 enbNodes.Get(m_admitHo ? hoEventIt->targetEnbDeviceIndex
470 : hoEventIt->sourceEnbDeviceIndex));
471
475 this,
476 ueDevices.Get(hoEventIt->ueDeviceIndex),
477 enbDevices.Get(m_admitHo ? hoEventIt->targetEnbDeviceIndex
478 : hoEventIt->sourceEnbDeviceIndex));
481 this,
482 hoEventIt->ueDeviceIndex);
483
487 this,
488 hoEventIt->ueDeviceIndex);
490 {
492 }
493 }
494
495 // m_lteHelper->EnableRlcTraces ();
496 // m_lteHelper->EnablePdcpTraces();
497
499
501
503
504 // Undo changes to default settings
506 // Restore the previous settings of RngSeed and RngRun
509}
510
511void
513{
515 Ptr<LteUeRrc> ueRrc = ueLteDevice->GetRrc();
516 NS_TEST_ASSERT_MSG_EQ(ueRrc->GetState(), LteUeRrc::CONNECTED_NORMALLY, "Wrong LteUeRrc state!");
517
520 uint16_t rnti = ueRrc->GetRnti();
521 Ptr<UeManager> ueManager = enbRrc->GetUeManager(rnti);
522 NS_TEST_ASSERT_MSG_NE(ueManager, nullptr, "RNTI " << rnti << " not found in eNB");
523
526 NS_ASSERT_MSG(ueManagerState == UeManager::CONNECTED_NORMALLY, "Wrong UeManager state!");
527
528 uint16_t ueCellId = ueRrc->GetCellId();
529 uint16_t enbCellId = enbLteDevice->GetCellId();
530 uint8_t ueDlBandwidth = ueRrc->GetDlBandwidth();
531 uint8_t enbDlBandwidth = enbLteDevice->GetDlBandwidth();
532 uint8_t ueUlBandwidth = ueRrc->GetUlBandwidth();
533 uint8_t enbUlBandwidth = enbLteDevice->GetUlBandwidth();
534 uint8_t ueDlEarfcn = ueRrc->GetDlEarfcn();
535 uint8_t enbDlEarfcn = enbLteDevice->GetDlEarfcn();
536 uint8_t ueUlEarfcn = ueRrc->GetUlEarfcn();
537 uint8_t enbUlEarfcn = enbLteDevice->GetUlEarfcn();
538 uint64_t ueImsi = ueLteDevice->GetImsi();
539 uint64_t enbImsi = ueManager->GetImsi();
540
541 NS_TEST_ASSERT_MSG_EQ(ueImsi, enbImsi, "inconsistent IMSI");
542 NS_TEST_ASSERT_MSG_EQ(ueCellId, enbCellId, "inconsistent CellId");
543 NS_TEST_ASSERT_MSG_EQ(ueDlBandwidth, enbDlBandwidth, "inconsistent DlBandwidth");
544 NS_TEST_ASSERT_MSG_EQ(ueUlBandwidth, enbUlBandwidth, "inconsistent UlBandwidth");
545 NS_TEST_ASSERT_MSG_EQ(ueDlEarfcn, enbDlEarfcn, "inconsistent DlEarfcn");
546 NS_TEST_ASSERT_MSG_EQ(ueUlEarfcn, enbUlEarfcn, "inconsistent UlEarfcn");
547
549 ueManager->GetAttribute("DataRadioBearerMap", enbDataRadioBearerMapValue);
552 "wrong num bearers at eNB");
553
555 ueRrc->GetAttribute("DataRadioBearerMap", ueDataRadioBearerMapValue);
558 "wrong num bearers at UE");
559
562 while (enbBearerIt != enbDataRadioBearerMapValue.End() &&
564 {
566 enbBearerIt->second->GetObject<LteDataRadioBearerInfo>();
568 ueBearerIt->second->GetObject<LteDataRadioBearerInfo>();
569 // NS_TEST_ASSERT_MSG_EQ (enbDrbInfo->m_epsBearer, ueDrbInfo->m_epsBearer, "epsBearer
570 // differs");
571 NS_TEST_ASSERT_MSG_EQ((uint32_t)enbDrbInfo->m_epsBearerIdentity,
572 (uint32_t)ueDrbInfo->m_epsBearerIdentity,
573 "epsBearerIdentity differs");
575 (uint32_t)ueDrbInfo->m_drbIdentity,
576 "drbIdentity differs");
577 // NS_TEST_ASSERT_MSG_EQ (enbDrbInfo->m_rlcConfig, ueDrbInfo->m_rlcConfig, "rlcConfig
578 // differs");
579 NS_TEST_ASSERT_MSG_EQ((uint32_t)enbDrbInfo->m_logicalChannelIdentity,
580 (uint32_t)ueDrbInfo->m_logicalChannelIdentity,
581 "logicalChannelIdentity differs");
582 // NS_TEST_ASSERT_MSG_EQ (enbDrbInfo->m_logicalChannelConfig,
583 // ueDrbInfo->m_logicalChannelConfig, "logicalChannelConfig differs");
584
585 ++enbBearerIt;
586 ++ueBearerIt;
587 }
588 NS_ASSERT_MSG(enbBearerIt == enbDataRadioBearerMapValue.End(), "too many bearers at eNB");
589 NS_ASSERT_MSG(ueBearerIt == ueDataRadioBearerMapValue.End(), "too many bearers at UE");
590}
591
592void
598
599void
608
609void
611{
612 for (auto it = m_ueDataVector.at(ueIndex).bearerDataList.begin();
613 it != m_ueDataVector.at(ueIndex).bearerDataList.end();
614 ++it)
615 {
616 it->dlOldTotalRx = it->dlSink->GetTotalRx();
617 it->ulOldTotalRx = it->ulSink->GetTotalRx();
618 }
619}
620
621void
623{
624 uint32_t b = 1;
625 for (auto it = m_ueDataVector.at(ueIndex).bearerDataList.begin();
626 it != m_ueDataVector.at(ueIndex).bearerDataList.end();
627 ++it)
628 {
629 uint32_t dlRx = it->dlSink->GetTotalRx() - it->dlOldTotalRx;
630 uint32_t ulRx = it->ulSink->GetTotalRx() - it->ulOldTotalRx;
633
636 "too few RX bytes in DL, ue=" << ueIndex << ", b=" << b);
639 "too few RX bytes in UL, ue=" << ueIndex << ", b=" << b);
640 ++b;
641 }
642}
643
644/**
645 * @ingroup lte-test
646 *
647 * @brief LTE X2 Handover Test Suite.
648 *
649 * In this test suite, we use NoOpHandoverAlgorithm, i.e. "handover algorithm which does nothing"
650 * is used and handover is triggered manually. The automatic handover algorithms (A2A4, A3Rsrp)
651 * are not tested.
652 *
653 * The tests are designed to check that eNB-buffered data received while a handover is in progress
654 * is not lost but successfully forwarded. But the test suite doesn't test for possible loss of
655 * RLC-buffered data because "lossless" handover is not implemented, and there are other application
656 * send patterns (outside of the range tested here) that may incur losses.
657 */
659{
660 public:
662};
663
665 : TestSuite("lte-x2-handover", Type::SYSTEM)
666{
667 // in the following:
668 // fwd means handover from enb 0 to enb 1
669 // bwd means handover from enb 1 to enb 0
670
673 ue1fwd.ueDeviceIndex = 0;
674 ue1fwd.sourceEnbDeviceIndex = 0;
675 ue1fwd.targetEnbDeviceIndex = 1;
676
679 ue1bwd.ueDeviceIndex = 0;
680 ue1bwd.sourceEnbDeviceIndex = 1;
681 ue1bwd.targetEnbDeviceIndex = 0;
682
685 ue1fwdagain.ueDeviceIndex = 0;
686 ue1fwdagain.sourceEnbDeviceIndex = 0;
687 ue1fwdagain.targetEnbDeviceIndex = 1;
688
691 ue2fwd.ueDeviceIndex = 1;
692 ue2fwd.sourceEnbDeviceIndex = 0;
693 ue2fwd.targetEnbDeviceIndex = 1;
694
697 ue2bwd.ueDeviceIndex = 1;
698 ue2bwd.sourceEnbDeviceIndex = 1;
699 ue2bwd.targetEnbDeviceIndex = 0;
700
701 std::string handoverEventList0name("none");
702 std::list<HandoverEvent> handoverEventList0;
703
704 std::string handoverEventList1name("1 fwd");
705 const std::list<HandoverEvent> handoverEventList1{
706 ue1fwd,
707 };
708
709 std::string handoverEventList2name("1 fwd & bwd");
710 const std::list<HandoverEvent> handoverEventList2{
711 ue1fwd,
712 ue1bwd,
713 };
714
715 std::string handoverEventList3name("1 fwd & bwd & fwd");
716 const std::list<HandoverEvent> handoverEventList3{
717 ue1fwd,
718 ue1bwd,
720 };
721
722 std::string handoverEventList4name("1+2 fwd");
723 const std::list<HandoverEvent> handoverEventList4{
724 ue1fwd,
725 ue2fwd,
726 };
727
728 std::string handoverEventList5name("1+2 fwd & bwd");
729 const std::list<HandoverEvent> handoverEventList5{
730 ue1fwd,
731 ue1bwd,
732 ue2fwd,
733 ue2bwd,
734 };
735
736 // std::string handoverEventList6name("2 fwd");
737 // const std::list<HandoverEvent> handoverEventList6{
738 // ue2fwd,
739 // };
740
741 // std::string handoverEventList7name("2 fwd & bwd");
742 // const std::list<HandoverEvent> handoverEventList7{
743 // ue2fwd,
744 // ue2bwd,
745 // };
746
747 std::vector<std::string> schedulers{
748 "ns3::RrFfMacScheduler",
749 "ns3::PfFfMacScheduler",
750 };
751
752 for (auto schedIt = schedulers.begin(); schedIt != schedulers.end(); ++schedIt)
753 {
754 for (auto useIdealRrc : {true, false})
755 {
756 // nUes, nDBearers, helist, name, sched, admitHo, idealRrc
758 0,
761 *schedIt,
762 true,
764 TestCase::Duration::EXTENSIVE);
766 0,
769 *schedIt,
770 true,
772 TestCase::Duration::EXTENSIVE);
774 5,
777 *schedIt,
778 true,
780 TestCase::Duration::EXTENSIVE);
782 5,
785 *schedIt,
786 true,
788 TestCase::Duration::EXTENSIVE);
790 0,
793 *schedIt,
794 true,
796 TestCase::Duration::EXTENSIVE);
798 1,
801 *schedIt,
802 true,
804 TestCase::Duration::EXTENSIVE);
806 2,
809 *schedIt,
810 true,
812 TestCase::Duration::EXTENSIVE);
814 0,
817 *schedIt,
818 false,
820 TestCase::Duration::EXTENSIVE);
822 1,
825 *schedIt,
826 false,
828 TestCase::Duration::EXTENSIVE);
830 2,
833 *schedIt,
834 false,
836 TestCase::Duration::EXTENSIVE);
838 0,
841 *schedIt,
842 true,
844 TestCase::Duration::EXTENSIVE);
846 1,
849 *schedIt,
850 true,
852 TestCase::Duration::EXTENSIVE);
854 2,
857 *schedIt,
858 true,
860 TestCase::Duration::EXTENSIVE);
862 0,
865 *schedIt,
866 false,
868 TestCase::Duration::EXTENSIVE);
870 1,
873 *schedIt,
874 false,
876 TestCase::Duration::EXTENSIVE);
878 2,
881 *schedIt,
882 false,
884 TestCase::Duration::EXTENSIVE);
886 0,
889 *schedIt,
890 true,
892 TestCase::Duration::EXTENSIVE);
894 1,
897 *schedIt,
898 true,
900 TestCase::Duration::EXTENSIVE);
902 2,
905 *schedIt,
906 true,
908 TestCase::Duration::EXTENSIVE);
910 0,
913 *schedIt,
914 true,
916 TestCase::Duration::EXTENSIVE);
918 1,
921 *schedIt,
922 true,
924 TestCase::Duration::EXTENSIVE);
926 2,
929 *schedIt,
930 true,
932 TestCase::Duration::EXTENSIVE);
934 0,
937 *schedIt,
938 true,
940 TestCase::Duration::EXTENSIVE);
942 1,
945 *schedIt,
946 true,
948 TestCase::Duration::EXTENSIVE);
950 2,
953 *schedIt,
954 true,
956 TestCase::Duration::QUICK);
958 0,
961 *schedIt,
962 true,
964 TestCase::Duration::EXTENSIVE);
966 1,
969 *schedIt,
970 true,
972 TestCase::Duration::EXTENSIVE);
974 2,
977 *schedIt,
978 true,
980 TestCase::Duration::EXTENSIVE);
982 0,
985 *schedIt,
986 true,
988 TestCase::Duration::EXTENSIVE);
990 1,
993 *schedIt,
994 true,
996 TestCase::Duration::EXTENSIVE);
998 2,
1001 *schedIt,
1002 true,
1003 useIdealRrc),
1004 TestCase::Duration::EXTENSIVE);
1006 0,
1009 *schedIt,
1010 true,
1011 useIdealRrc),
1012 TestCase::Duration::EXTENSIVE);
1014 1,
1017 *schedIt,
1018 true,
1019 useIdealRrc),
1020 TestCase::Duration::EXTENSIVE);
1022 2,
1025 *schedIt,
1026 true,
1027 useIdealRrc),
1028 TestCase::Duration::EXTENSIVE);
1030 0,
1033 *schedIt,
1034 true,
1035 useIdealRrc),
1036 TestCase::Duration::EXTENSIVE);
1038 1,
1041 *schedIt,
1042 true,
1043 useIdealRrc),
1044 TestCase::Duration::EXTENSIVE);
1046 2,
1049 *schedIt,
1050 true,
1051 useIdealRrc),
1052 TestCase::Duration::EXTENSIVE);
1054 0,
1057 *schedIt,
1058 true,
1059 useIdealRrc),
1060 TestCase::Duration::EXTENSIVE);
1062 1,
1065 *schedIt,
1066 true,
1067 useIdealRrc),
1068 TestCase::Duration::EXTENSIVE);
1070 2,
1073 *schedIt,
1074 true,
1075 useIdealRrc),
1076 TestCase::Duration::QUICK);
1077 }
1078 }
1079}
1080
1081/**
1082 * @ingroup lte-test
1083 * Static variable for test initialization
1084 */
static std::string BuildNameString(uint32_t nUes, uint32_t nDedicatedBearers, std::string handoverEventListName, std::string schedulerType, bool admitHo, bool useIdealRrc)
Build name string.
void DoRun() override
Implementation to actually run this TestCase.
Ptr< PointToPointEpcHelper > m_epcHelper
EPC helper.
uint32_t m_nUes
number of UEs in the test
std::string m_handoverEventListName
handover event list name
std::string m_schedulerType
scheduler type
const uint32_t m_udpClientPktSize
UDP client packet size.
bool m_useIdealRrc
whether to use the ideal RRC
const Time m_statsDuration
stats duration
std::vector< UeData > m_ueDataVector
UE data vector.
void CheckConnected(Ptr< NetDevice > ueDevice, Ptr< NetDevice > enbDevice)
Check connected function.
LteX2HandoverTestCase(uint32_t nUes, uint32_t nDedicatedBearers, std::list< HandoverEvent > handoverEventList, std::string handoverEventListName, std::string schedulerType, bool admitHo, bool useIdealRrc)
void TeleportUeNearTargetEnb(Ptr< Node > ueNode, Ptr< Node > enbNode)
Teleport UE near the target eNB of the handover.
bool m_admitHo
whether to admit the handover request
bool m_epc
whether to use EPC
void SaveStatsAfterHandover(uint32_t ueIndex)
Save stats after handover function.
const Time m_maxHoDuration
maximum HO duration
std::list< HandoverEvent > m_handoverEventList
handover event list
void CheckStatsAWhileAfterHandover(uint32_t ueIndex)
Check stats a while after handover function.
uint32_t m_nDedicatedBearers
number of UEs in the test
const Time m_udpClientInterval
UDP client interval.
void TeleportUeToMiddle(Ptr< Node > ueNode)
Teleport UE between both eNBs of the test.
Ptr< LteHelper > m_lteHelper
LTE helper.
LTE X2 Handover Test Suite.
holds a vector of ns3::Application pointers.
Ptr< Application > Get(uint32_t i) const
Get the Ptr<Application> stored in this container at a given index.
AttributeValue implementation for Boolean.
Definition boolean.h:26
Class for representing data rates.
Definition data-rate.h:78
AttributeValue implementation for DataRate.
Definition data-rate.h:285
This class can be used to hold variables of floating point type such as 'double' or 'float'.
Definition double.h:31
This class contains the specification of EPS Bearers.
Definition eps-bearer.h:80
Qci
QoS Class Indicator.
Definition eps-bearer.h:95
@ NGBR_VIDEO_TCP_DEFAULT
Non-GBR TCP-based Video (Buffered Streaming, e.g., www, e-mail...)
Definition eps-bearer.h:115
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.
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.
store information on active data radio bearer instance
The eNodeB device implementation.
The LteUeNetDevice class implements the UE net device.
Helper class used to assign positions and mobility models to nodes.
Keep track of the current position and velocity of an object.
Vector GetPosition() const
void SetPosition(const Vector &position)
holds a vector of ns3::NetDevice pointers
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.
Container for a set of ns3::Object pointers.
A helper to make it easier to instantiate an ns3::PacketSinkApplication on a set of nodes.
Receive and consume traffic generated to an IP address and port.
Definition packet-sink.h:62
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.
Smart pointer class similar to boost::intrusive_ptr.
Definition ptr.h:66
static void SetRun(uint64_t run)
Set the run number of simulation.
static void SetSeed(uint32_t seed)
Set the seed.
static uint64_t GetRun()
Get the current run number.
static uint32_t GetSeed()
Get the current seed value which will be used by all subsequently instantiated RandomVariableStream o...
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 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
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
AttributeValue implementation for Time.
Definition nstime.h:1431
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
Time stopTime
#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 Reset()
Reset the initial value of every attribute as well as the value of every global to what they were bef...
Definition config.cc:848
void SetDefault(std::string name, const AttributeValue &value)
Definition config.cc:883
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition log.h:191
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
static LteX2HandoverTestSuite g_lteX2HandoverTestSuiteInstance
Static variable for test initialization.
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_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:1344
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition nstime.h:1356
Every class exported by the ns3 library is enclosed in the ns3 namespace.
HandoverEvent structure.
uint32_t ueDeviceIndex
UE device index.
Time startTime
start time
uint32_t targetEnbDeviceIndex
target ENB device index
uint32_t sourceEnbDeviceIndex
source ENB device index
uint32_t dlOldTotalRx
DL old total receive.
uint32_t ulOldTotalRx
UL old total receive.
std::list< BearerData > bearerDataList
bearer ID list
Implement the data structure representing a TrafficFlowTemplate Packet Filter.
Definition epc-tft.h:60
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