A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
lte-test-frequency-reuse.cc
Go to the documentation of this file.
1/*
2 * Copyright (c) 2014 Piotr Gawlowicz
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Piotr Gawlowicz <gawlowicz.p@gmail.com>
7 *
8 */
9
11
12#include "lte-ffr-simple.h"
14
15#include "ns3/boolean.h"
16#include "ns3/callback.h"
17#include "ns3/config.h"
18#include "ns3/double.h"
19#include "ns3/enum.h"
20#include "ns3/ff-mac-scheduler.h"
21#include "ns3/internet-stack-helper.h"
22#include "ns3/ipv4-static-routing-helper.h"
23#include "ns3/ipv4-static-routing.h"
24#include "ns3/log.h"
25#include "ns3/lte-common.h"
26#include "ns3/lte-enb-net-device.h"
27#include "ns3/lte-enb-phy.h"
28#include "ns3/lte-enb-rrc.h"
29#include "ns3/lte-helper.h"
30#include "ns3/lte-ue-net-device.h"
31#include "ns3/lte-ue-phy.h"
32#include "ns3/lte-ue-rrc.h"
33#include "ns3/mobility-helper.h"
34#include "ns3/packet-sink-helper.h"
35#include "ns3/point-to-point-epc-helper.h"
36#include "ns3/point-to-point-helper.h"
37#include "ns3/pointer.h"
38#include "ns3/simulator.h"
39#include "ns3/string.h"
40#include "ns3/udp-client-server-helper.h"
41
42using namespace ns3;
43
44NS_LOG_COMPONENT_DEFINE("LteFrequencyReuseTest");
45
46/**
47 * TestSuite
48 */
49
51 : TestSuite("lte-frequency-reuse", Type::SYSTEM)
52{
53 // LogLevel logLevel = (LogLevel)(LOG_PREFIX_FUNC | LOG_PREFIX_TIME | LOG_LEVEL_DEBUG);
54 // LogComponentEnable ("LteFrequencyReuseTest", logLevel);
55
56 std::vector<bool> availableDlRb;
57 std::vector<bool> availableUlRb;
58 for (uint32_t i = 0; i < 12; i++)
59 {
60 availableDlRb.push_back(true);
61 availableUlRb.push_back(true);
62 }
63 for (uint32_t i = 12; i < 25; i++)
64 {
65 availableDlRb.push_back(false);
66 availableUlRb.push_back(false);
67 }
68
69 AddTestCase(new LteHardFrTestCase("DownlinkHardFrPf1",
70 1,
71 "ns3::PfFfMacScheduler",
72 25,
73 25,
74 0,
75 12,
76 0,
77 12,
78 availableDlRb,
79 availableUlRb),
81 AddTestCase(new LteHardFrTestCase("DownlinkHardFrPf2",
82 5,
83 "ns3::PfFfMacScheduler",
84 25,
85 25,
86 0,
87 12,
88 0,
89 12,
90 availableDlRb,
91 availableUlRb),
93 AddTestCase(new LteHardFrTestCase("DownlinkHardFrPss1",
94 1,
95 "ns3::PssFfMacScheduler",
96 25,
97 25,
98 0,
99 12,
100 0,
101 12,
102 availableDlRb,
103 availableUlRb),
105 AddTestCase(new LteHardFrTestCase("DownlinkHardFrPss2",
106 5,
107 "ns3::PssFfMacScheduler",
108 25,
109 25,
110 0,
111 12,
112 0,
113 12,
114 availableDlRb,
115 availableUlRb),
117 AddTestCase(new LteHardFrTestCase("DownlinkHardFrCqa1",
118 1,
119 "ns3::CqaFfMacScheduler",
120 25,
121 25,
122 0,
123 12,
124 0,
125 12,
126 availableDlRb,
127 availableUlRb),
129 AddTestCase(new LteHardFrTestCase("DownlinkHardFrCqa2",
130 5,
131 "ns3::CqaFfMacScheduler",
132 25,
133 25,
134 0,
135 12,
136 0,
137 12,
138 availableDlRb,
139 availableUlRb),
141 AddTestCase(new LteHardFrTestCase("DownlinkHardFrFdTbfq1",
142 1,
143 "ns3::FdTbfqFfMacScheduler",
144 25,
145 25,
146 0,
147 12,
148 0,
149 12,
150 availableDlRb,
151 availableUlRb),
153 AddTestCase(new LteHardFrTestCase("DownlinkHardFrFdTbfq2",
154 5,
155 "ns3::FdTbfqFfMacScheduler",
156 25,
157 25,
158 0,
159 12,
160 0,
161 12,
162 availableDlRb,
163 availableUlRb),
165 AddTestCase(new LteHardFrTestCase("DownlinkHardFrTdTbfq1",
166 1,
167 "ns3::TdTbfqFfMacScheduler",
168 25,
169 25,
170 0,
171 12,
172 0,
173 12,
174 availableDlRb,
175 availableUlRb),
177 AddTestCase(new LteHardFrTestCase("DownlinkHardFrTdTbfq2",
178 5,
179 "ns3::TdTbfqFfMacScheduler",
180 25,
181 25,
182 0,
183 12,
184 0,
185 12,
186 availableDlRb,
187 availableUlRb),
189
190 availableDlRb.clear();
191 availableUlRb.clear();
192 for (uint32_t i = 0; i < 6; i++)
193 {
194 availableDlRb.push_back(true);
195 availableUlRb.push_back(true);
196 }
197 for (uint32_t i = 6; i < 12; i++)
198 {
199 availableDlRb.push_back(false);
200 availableUlRb.push_back(false);
201 }
202 for (uint32_t i = 12; i < 18; i++)
203 {
204 availableDlRb.push_back(true);
205 availableUlRb.push_back(true);
206 }
207 for (uint32_t i = 18; i < 25; i++)
208 {
209 availableDlRb.push_back(false);
210 availableUlRb.push_back(false);
211 }
212
213 AddTestCase(new LteStrictFrTestCase("DownlinkStrictFrPf1",
214 1,
215 "ns3::PfFfMacScheduler",
216 25,
217 25,
218 6,
219 6,
220 6,
221 6,
222 6,
223 6,
224 availableDlRb,
225 availableUlRb),
227 AddTestCase(new LteStrictFrTestCase("DownlinkStrictFrPf2",
228 5,
229 "ns3::PfFfMacScheduler",
230 25,
231 25,
232 6,
233 6,
234 6,
235 6,
236 6,
237 6,
238 availableDlRb,
239 availableUlRb),
241 AddTestCase(new LteStrictFrTestCase("DownlinkStrictFrPss1",
242 1,
243 "ns3::PssFfMacScheduler",
244 25,
245 25,
246 6,
247 6,
248 6,
249 6,
250 6,
251 6,
252 availableDlRb,
253 availableUlRb),
255 AddTestCase(new LteStrictFrTestCase("DownlinkStrictFrPss2",
256 5,
257 "ns3::PssFfMacScheduler",
258 25,
259 25,
260 6,
261 6,
262 6,
263 6,
264 6,
265 6,
266 availableDlRb,
267 availableUlRb),
269 AddTestCase(new LteStrictFrTestCase("DownlinkStrictFrCqa1",
270 1,
271 "ns3::CqaFfMacScheduler",
272 25,
273 25,
274 6,
275 6,
276 6,
277 6,
278 6,
279 6,
280 availableDlRb,
281 availableUlRb),
283 AddTestCase(new LteStrictFrTestCase("DownlinkStrictFrCqa2",
284 5,
285 "ns3::CqaFfMacScheduler",
286 25,
287 25,
288 6,
289 6,
290 6,
291 6,
292 6,
293 6,
294 availableDlRb,
295 availableUlRb),
297 AddTestCase(new LteStrictFrTestCase("DownlinkStrictFrCqaFdTbfq1",
298 1,
299 "ns3::FdTbfqFfMacScheduler",
300 25,
301 25,
302 6,
303 6,
304 6,
305 6,
306 6,
307 6,
308 availableDlRb,
309 availableUlRb),
311 AddTestCase(new LteStrictFrTestCase("DownlinkStrictFrCqaFdTbfq2",
312 5,
313 "ns3::FdTbfqFfMacScheduler",
314 25,
315 25,
316 6,
317 6,
318 6,
319 6,
320 6,
321 6,
322 availableDlRb,
323 availableUlRb),
325 AddTestCase(new LteStrictFrTestCase("DownlinkStrictFrCqaTdTbfq1",
326 1,
327 "ns3::TdTbfqFfMacScheduler",
328 25,
329 25,
330 6,
331 6,
332 6,
333 6,
334 6,
335 6,
336 availableDlRb,
337 availableUlRb),
339 AddTestCase(new LteStrictFrTestCase("DownlinkStrictFrCqaTdTbfq2",
340 5,
341 "ns3::TdTbfqFfMacScheduler",
342 25,
343 25,
344 6,
345 6,
346 6,
347 6,
348 6,
349 6,
350 availableDlRb,
351 availableUlRb),
353
354 AddTestCase(new LteStrictFrAreaTestCase("LteStrictFrAreaTestCasePf1", "ns3::PfFfMacScheduler"),
357 new LteStrictFrAreaTestCase("LteStrictFrAreaTestCasePss1", "ns3::PssFfMacScheduler"),
360 new LteStrictFrAreaTestCase("LteStrictFrAreaTestCaseCqa1", "ns3::CqaFfMacScheduler"),
363 new LteStrictFrAreaTestCase("LteStrictFrAreaTestCaseFdTbfq1", "ns3::FdTbfqFfMacScheduler"),
366 new LteStrictFrAreaTestCase("LteStrictFrAreaTestCaseTdTbfq1", "ns3::TdTbfqFfMacScheduler"),
368
369 AddTestCase(new LteSoftFrAreaTestCase("LteSoftFrAreaTestCasePf1", "ns3::PfFfMacScheduler"),
371 AddTestCase(new LteSoftFrAreaTestCase("LteSoftFrAreaTestCasePss1", "ns3::PssFfMacScheduler"),
373 AddTestCase(new LteSoftFrAreaTestCase("LteSoftFrAreaTestCaseCqa1", "ns3::CqaFfMacScheduler"),
376 new LteSoftFrAreaTestCase("LteSoftFrAreaTestCaseFdTbfq1", "ns3::FdTbfqFfMacScheduler"),
379 new LteSoftFrAreaTestCase("LteSoftFrAreaTestCaseTdTbfq1", "ns3::TdTbfqFfMacScheduler"),
381
382 AddTestCase(new LteSoftFfrAreaTestCase("LteSoftFfrAreaTestCasePf1", "ns3::PfFfMacScheduler"),
384 AddTestCase(new LteSoftFfrAreaTestCase("LteSoftFfrAreaTestCasePss1", "ns3::PssFfMacScheduler"),
386 AddTestCase(new LteSoftFfrAreaTestCase("LteSoftFfrAreaTestCaseCqa1", "ns3::CqaFfMacScheduler"),
389 new LteSoftFfrAreaTestCase("LteSoftFfrAreaTestCaseFdTbfq1", "ns3::FdTbfqFfMacScheduler"),
392 new LteSoftFfrAreaTestCase("LteSoftFfrAreaTestCaseTdTbfq1", "ns3::TdTbfqFfMacScheduler"),
394
396 new LteEnhancedFfrAreaTestCase("LteEnhancedFfrAreaTestCasePf1", "ns3::PfFfMacScheduler"),
399 new LteEnhancedFfrAreaTestCase("LteEnhancedFfrAreaTestCasePss1", "ns3::PssFfMacScheduler"),
402 new LteEnhancedFfrAreaTestCase("LteEnhancedFfrAreaTestCaseCqa1", "ns3::CqaFfMacScheduler"),
404 AddTestCase(new LteEnhancedFfrAreaTestCase("LteEnhancedFfrAreaTestCaseFdTbfq1",
405 "ns3::FdTbfqFfMacScheduler"),
407 AddTestCase(new LteEnhancedFfrAreaTestCase("LteEnhancedFfrAreaTestCaseTdTbfq1",
408 "ns3::TdTbfqFfMacScheduler"),
410
411 AddTestCase(new LteDistributedFfrAreaTestCase("LteDistributedFfrAreaTestCasePf1",
412 "ns3::PfFfMacScheduler"),
414 AddTestCase(new LteDistributedFfrAreaTestCase("LteDistributedFfrAreaTestCasePss1",
415 "ns3::PssFfMacScheduler"),
417 AddTestCase(new LteDistributedFfrAreaTestCase("LteDistributedFfrAreaTestCaseCqa1",
418 "ns3::CqaFfMacScheduler"),
420 AddTestCase(new LteDistributedFfrAreaTestCase("LteDistributedFfrAreaTestCaseFdTbfq1",
421 "ns3::FdTbfqFfMacScheduler"),
423 AddTestCase(new LteDistributedFfrAreaTestCase("LteDistributedFfrAreaTestCaseTdTbfq1",
424 "ns3::TdTbfqFfMacScheduler"),
426}
427
428/**
429 * @ingroup lte-test
430 * Static variable for test initialization
431 */
433
434/**
435 * TestCase Data
436 */
437void
439{
440 testcase->DlDataRxStart(spectrumValue);
441}
442
443void
445{
446 testcase->UlDataRxStart(spectrumValue);
447}
448
450 uint32_t userNum,
451 uint16_t dlBandwidth,
452 uint16_t ulBandwidth,
453 std::vector<bool> availableDlRb,
454 std::vector<bool> availableUlRb)
455 : TestCase("Test: " + name),
456 m_userNum(userNum),
457 m_dlBandwidth(dlBandwidth),
458 m_ulBandwidth(ulBandwidth),
459 m_availableDlRb(availableDlRb),
460 m_usedMutedDlRbg(false),
461 m_availableUlRb(availableUlRb),
462 m_usedMutedUlRbg(false)
463{
464}
465
469
470void
472{
473 NS_LOG_DEBUG("DL DATA Power allocation :");
474 uint32_t i = 0;
475 for (auto it = spectrumValue->ConstValuesBegin(); it != spectrumValue->ConstValuesEnd(); it++)
476 {
477 double power = (*it) * (m_dlBandwidth * 180000);
478 NS_LOG_DEBUG("RB " << i << " POWER: "
479 << " " << power << " isAvailable: " << m_availableDlRb[i]);
480
481 if (!m_availableDlRb[i] && power > 0)
482 {
483 m_usedMutedDlRbg = true;
484 }
485 i++;
486 }
487}
488
489void
491{
492 NS_LOG_DEBUG("UL DATA Power allocation :");
493 uint32_t i = 0;
494 for (auto it = spectrumValue->ConstValuesBegin(); it != spectrumValue->ConstValuesEnd(); it++)
495 {
496 double power = (*it) * (m_ulBandwidth * 180000);
497 NS_LOG_DEBUG("RB " << i << " POWER: "
498 << " " << power << " isAvailable: " << m_availableUlRb[i]);
499
500 if (!m_availableUlRb[i] && power > 0)
501 {
502 m_usedMutedUlRbg = true;
503 }
504 i++;
505 }
506}
507
508void
512
514 uint32_t userNum,
515 std::string schedulerType,
516 uint16_t dlBandwidth,
517 uint16_t ulBandwidth,
518 uint8_t dlSubBandOffset,
519 uint16_t dlSubBandwidth,
520 uint8_t ulSubBandOffset,
521 uint16_t ulSubBandwidth,
522 std::vector<bool> availableDlRb,
523 std::vector<bool> availableUlRb)
524 : LteFrTestCase(name, userNum, dlBandwidth, ulBandwidth, availableDlRb, availableUlRb),
525 m_schedulerType(schedulerType),
526 m_dlSubBandOffset(dlSubBandOffset),
527 m_dlSubBandwidth(dlSubBandwidth),
528 m_ulSubBandOffset(ulSubBandOffset),
529 m_ulSubBandwidth(ulSubBandwidth)
530{
531 NS_LOG_INFO("Creating LteDownlinkFrTestCase");
532}
533
537
538void
540{
541 NS_LOG_DEBUG("LteFrTestCase");
542
544 Config::SetDefault("ns3::LteHelper::UseIdealRrc", BooleanValue(false));
545
546 /**
547 * Simulation Topology
548 */
549
551 lteHelper->SetFfrAlgorithmType("ns3::LteFrHardAlgorithm");
552
553 lteHelper->SetFfrAlgorithmAttribute("DlSubBandOffset", UintegerValue(m_dlSubBandOffset));
554 lteHelper->SetFfrAlgorithmAttribute("DlSubBandwidth", UintegerValue(m_dlSubBandwidth));
555
556 lteHelper->SetFfrAlgorithmAttribute("UlSubBandOffset", UintegerValue(m_ulSubBandOffset));
557 lteHelper->SetFfrAlgorithmAttribute("UlSubBandwidth", UintegerValue(m_ulSubBandwidth));
558
559 // Create Nodes: eNodeB and UE
560 NodeContainer enbNodes;
561 NodeContainer ueNodes;
562 enbNodes.Create(1);
563 ueNodes.Create(m_userNum);
564 NodeContainer allNodes = NodeContainer(enbNodes, ueNodes);
565
566 // Install Mobility Model
567 MobilityHelper mobility;
568 mobility.SetMobilityModel("ns3::ConstantPositionMobilityModel");
569 mobility.Install(allNodes);
570
571 // Create Devices and install them in the Nodes (eNB and UE)
572 NetDeviceContainer enbDevs;
573 NetDeviceContainer ueDevs;
574 lteHelper->SetSchedulerType(m_schedulerType);
575 enbDevs = lteHelper->InstallEnbDevice(enbNodes);
576 ueDevs = lteHelper->InstallUeDevice(ueNodes);
577
578 // Attach a UE to a eNB
579 lteHelper->Attach(ueDevs, enbDevs.Get(0));
580
581 // Activate the default EPS bearer
582 // Since this test includes the Token Bank Fair Queue Scheduler
583 //(ns3::FdTbfqFfMacScheduler) we have to treat the default
584 // bearer as the dedicated bearer with QoS.
586 qos.mbrUl = 1e6;
587 qos.mbrDl = 1e6;
588 qos.gbrUl = 1e4;
589 qos.gbrDl = 1e4;
590
592 EpsBearer bearer(q, qos);
593 lteHelper->ActivateDataRadioBearer(ueDevs, bearer);
594
595 // Test SpectrumPhy to get signals form DL channel
596 Ptr<LteSpectrumPhy> enbDlSpectrumPhy = enbDevs.Get(0)
597 ->GetObject<LteEnbNetDevice>()
598 ->GetPhy()
599 ->GetDownlinkSpectrumPhy()
601 Ptr<SpectrumChannel> dlChannel = enbDlSpectrumPhy->GetChannel();
602
604 Ptr<LteEnbNetDevice> eNbDev = enbDevs.Get(0)->GetObject<LteEnbNetDevice>();
605 testDlSpectrumPhy->SetRxSpectrumModel(
607 dlChannel->AddRx(testDlSpectrumPhy);
608
609 testDlSpectrumPhy->TraceConnectWithoutContext(
610 "RxStart",
612
613 // Test SpectrumPhy to get signals form UL channel
614 Ptr<LteSpectrumPhy> ueUlSpectrumPhy = ueDevs.Get(0)
615 ->GetObject<LteUeNetDevice>()
616 ->GetPhy()
617 ->GetUplinkSpectrumPhy()
619 Ptr<SpectrumChannel> ulChannel = ueUlSpectrumPhy->GetChannel();
620
622 testUlSpectrumPhy->SetRxSpectrumModel(
624 ulChannel->AddRx(testUlSpectrumPhy);
625
626 testUlSpectrumPhy->TraceConnectWithoutContext(
627 "RxStart",
629
630 Simulator::Stop(Seconds(0.500));
632
633 NS_TEST_ASSERT_MSG_EQ(m_usedMutedDlRbg, false, "Scheduler used DL RBG muted by FFR Algorithm");
634
635 NS_TEST_ASSERT_MSG_EQ(m_usedMutedUlRbg, false, "Scheduler used UL RBG muted by FFR Algorithm");
636
638}
639
641 uint32_t userNum,
642 std::string schedulerType,
643 uint16_t dlBandwidth,
644 uint16_t ulBandwidth,
645 uint16_t dlCommonSubBandwidth,
646 uint8_t dlEdgeSubBandOffset,
647 uint16_t dlEdgeSubBandwidth,
648 uint16_t ulCommonSubBandwidth,
649 uint8_t ulEdgeSubBandOffset,
650 uint16_t ulEdgeSubBandwidth,
651 std::vector<bool> availableDlRb,
652 std::vector<bool> availableUlRb)
653 : LteFrTestCase(name, userNum, dlBandwidth, ulBandwidth, availableDlRb, availableUlRb),
654 m_schedulerType(schedulerType),
655 m_dlCommonSubBandwidth(dlCommonSubBandwidth),
656 m_dlEdgeSubBandOffset(dlEdgeSubBandOffset),
657 m_dlEdgeSubBandwidth(dlEdgeSubBandwidth),
658 m_ulCommonSubBandwidth(ulCommonSubBandwidth),
659 m_ulEdgeSubBandOffset(ulEdgeSubBandOffset),
660 m_ulEdgeSubBandwidth(ulEdgeSubBandwidth)
661{
662 NS_LOG_INFO("Creating LteFrTestCase");
663}
664
668
669void
671{
672 NS_LOG_DEBUG("LteFrTestCase");
673
675 Config::SetDefault("ns3::LteHelper::UseIdealRrc", BooleanValue(false));
676
677 /**
678 * Simulation Topology
679 */
680
682 lteHelper->SetFfrAlgorithmType("ns3::LteFrStrictAlgorithm");
683
684 lteHelper->SetFfrAlgorithmAttribute("DlCommonSubBandwidth",
686 lteHelper->SetFfrAlgorithmAttribute("DlEdgeSubBandOffset",
688 lteHelper->SetFfrAlgorithmAttribute("DlEdgeSubBandwidth", UintegerValue(m_dlEdgeSubBandwidth));
689
690 lteHelper->SetFfrAlgorithmAttribute("UlCommonSubBandwidth",
692 lteHelper->SetFfrAlgorithmAttribute("UlEdgeSubBandOffset",
694 lteHelper->SetFfrAlgorithmAttribute("UlEdgeSubBandwidth", UintegerValue(m_ulEdgeSubBandwidth));
695
696 // Create Nodes: eNodeB and UE
697 NodeContainer enbNodes;
698 NodeContainer ueNodes;
699 enbNodes.Create(1);
700 ueNodes.Create(m_userNum);
701 NodeContainer allNodes = NodeContainer(enbNodes, ueNodes);
702
703 // Install Mobility Model
704 MobilityHelper mobility;
705 mobility.SetMobilityModel("ns3::ConstantPositionMobilityModel");
706 mobility.Install(allNodes);
707
708 // Create Devices and install them in the Nodes (eNB and UE)
709 NetDeviceContainer enbDevs;
710 NetDeviceContainer ueDevs;
711 lteHelper->SetSchedulerType(m_schedulerType);
712 enbDevs = lteHelper->InstallEnbDevice(enbNodes);
713 ueDevs = lteHelper->InstallUeDevice(ueNodes);
714
715 // Attach a UE to a eNB
716 lteHelper->Attach(ueDevs, enbDevs.Get(0));
717
718 // Activate the default EPS bearer
719 // Since this test includes the Token Bank Fair Queue Scheduler
720 //(ns3::FdTbfqFfMacScheduler) we have to treat the default
721 // bearer as the dedicated bearer with QoS.
722
724 qos.mbrUl = 1e6;
725 qos.mbrDl = 1e6;
726 qos.gbrUl = 1e4;
727 qos.gbrDl = 1e4;
728
730 EpsBearer bearer(q, qos);
731 lteHelper->ActivateDataRadioBearer(ueDevs, bearer);
732
733 // Test SpectrumPhy to get signals form DL channel
734 Ptr<LteSpectrumPhy> enbDlSpectrumPhy = enbDevs.Get(0)
735 ->GetObject<LteEnbNetDevice>()
736 ->GetPhy()
737 ->GetDownlinkSpectrumPhy()
739 Ptr<SpectrumChannel> dlChannel = enbDlSpectrumPhy->GetChannel();
740
742 Ptr<LteEnbNetDevice> eNbDev = enbDevs.Get(0)->GetObject<LteEnbNetDevice>();
743 testDlSpectrumPhy->SetRxSpectrumModel(
745 dlChannel->AddRx(testDlSpectrumPhy);
746
747 testDlSpectrumPhy->TraceConnectWithoutContext(
748 "RxStart",
750
751 // Test SpectrumPhy to get signals form UL channel
752 Ptr<LteSpectrumPhy> ueUlSpectrumPhy = ueDevs.Get(0)
753 ->GetObject<LteUeNetDevice>()
754 ->GetPhy()
755 ->GetUplinkSpectrumPhy()
757 Ptr<SpectrumChannel> ulChannel = ueUlSpectrumPhy->GetChannel();
758
760 testUlSpectrumPhy->SetRxSpectrumModel(
762 ulChannel->AddRx(testUlSpectrumPhy);
763
764 testUlSpectrumPhy->TraceConnectWithoutContext(
765 "RxStart",
767
768 Simulator::Stop(Seconds(0.500));
770
771 NS_TEST_ASSERT_MSG_EQ(m_usedMutedDlRbg, false, "Scheduler used DL RBG muted by FFR Algorithm");
772
773 NS_TEST_ASSERT_MSG_EQ(m_usedMutedUlRbg, false, "Scheduler used UL RBG muted by FFR Algorithm");
774
776}
777
778void
780{
781 testcase->DlDataRxStart(spectrumValue);
782}
783
784void
786{
787 testcase->UlDataRxStart(spectrumValue);
788}
789
790LteFrAreaTestCase::LteFrAreaTestCase(std::string name, std::string schedulerType)
791 : TestCase("Test: " + name),
792 m_schedulerType(schedulerType)
793{
794 m_dlBandwidth = 25;
795 m_ulBandwidth = 25;
796 m_usedWrongDlRbg = false;
797 m_usedWrongUlRbg = false;
798}
799
803
804void
806{
807 // need time to report new UE measurements, and wait because of filtering
809 {
810 return;
811 }
812
813 NS_LOG_DEBUG("DL DATA Power allocation :");
814 uint32_t i = 0;
815 for (auto it = spectrumValue->ConstValuesBegin(); it != spectrumValue->ConstValuesEnd(); it++)
816 {
817 double power = (*it) * (m_dlBandwidth * 180000);
818 NS_LOG_DEBUG("RB " << i << " POWER: "
819 << " " << power);
820 NS_LOG_DEBUG("RB " << i << " POWER: "
821 << " " << power << " Available: " << m_expectedDlRb[i]
822 << " Expected Power: " << m_expectedDlPower);
823
824 if (!m_expectedDlRb[i] && power > 0)
825 {
826 m_usedWrongDlRbg = true;
827 }
828 else if (m_expectedDlRb[i] && power > 0)
829 {
832 0.1,
833 "Wrong Data Channel DL Power level");
834 }
835 i++;
836 }
837}
838
839void
841{
842 // need time to report new UE measurements, and wait because of filtering
844 {
845 return;
846 }
847
848 NS_LOG_DEBUG("UL DATA Power allocation :");
849 uint32_t i = 0;
850 uint32_t numActiveRbs = 0;
851
852 // At the moment I could not find a better way to find total number
853 // of active RBs. This method is independent of the bandwidth
854 // configuration done in a test scenario, thus, it requires
855 // minimum change to the script.
856 for (auto it = spectrumValue->ConstValuesBegin(); it != spectrumValue->ConstValuesEnd(); it++)
857 {
858 // Count the RB as active if it is part of
859 // the expected UL RBs and has Power Spectral Density (PSD) > 0
860 if (m_expectedUlRb[numActiveRbs] && (*it) > 0)
861 {
862 numActiveRbs++;
863 }
864 }
865 NS_LOG_DEBUG("Total number of active RBs = " << numActiveRbs);
866
867 // The uplink power control and the uplink PSD
868 // calculation only consider active resource blocks.
869 for (auto it = spectrumValue->ConstValuesBegin(); it != spectrumValue->ConstValuesEnd(); it++)
870 {
871 double power = (*it) * (numActiveRbs * 180000);
872 NS_LOG_DEBUG("RB " << i << " POWER: " << power
873 << " expectedUlPower: " << m_expectedUlPower);
874 if (!m_expectedUlRb[i] && power > 0)
875 {
876 m_usedWrongUlRbg = true;
877 }
878 else if (m_expectedUlRb[i] && power > 0)
879 {
882 0.01,
883 "Wrong Data Channel UL Power level"
884 << Simulator::Now().As(Time::S));
885 }
886 i++;
887 }
888}
889
890void
892{
893 NS_LOG_FUNCTION(this);
894 NS_LOG_DEBUG("Teleport UE to : (" << x << ", " << y << ", 0)");
896 m_ueMobility->SetPosition(Vector(x, y, 0.0));
897}
898
899void
901 uint32_t y,
902 double expectedPower,
903 std::vector<bool> expectedDlRb)
904{
905 NS_LOG_FUNCTION(this);
906 NS_LOG_DEBUG("Teleport UE to : (" << x << ", " << y << ", 0)");
908 m_ueMobility->SetPosition(Vector(x, y, 0.0));
909 m_expectedDlPower = expectedPower;
910 m_expectedDlRb = expectedDlRb;
911}
912
913void
915 uint32_t x,
916 uint32_t y,
917 double expectedPower,
918 std::vector<bool> expectedDlRb)
919{
920 NS_LOG_FUNCTION(this);
921 NS_LOG_DEBUG("Teleport UE to : (" << x << ", " << y << ", 0)");
922
923 Ptr<MobilityModel> ueMobility = ueNode->GetObject<MobilityModel>();
924 ueMobility->SetPosition(Vector(x, y, 0.0));
926 m_expectedDlPower = expectedPower;
927 m_expectedDlRb = expectedDlRb;
928}
929
930void
931LteFrAreaTestCase::SetDlExpectedValues(double expectedDlPower, std::vector<bool> expectedDlRb)
932{
933 NS_LOG_FUNCTION(this);
934 m_expectedDlPower = expectedDlPower;
935 m_expectedDlRb = expectedDlRb;
936}
937
938void
939LteFrAreaTestCase::SetUlExpectedValues(double expectedUlPower, std::vector<bool> expectedUlRb)
940{
941 NS_LOG_FUNCTION(this);
942 m_expectedUlPower = expectedUlPower;
943 m_expectedUlRb = expectedUlRb;
944}
945
946void
950
951LteStrictFrAreaTestCase::LteStrictFrAreaTestCase(std::string name, std::string schedulerType)
952 : LteFrAreaTestCase(name, schedulerType)
953{
954 NS_LOG_INFO("Creating LteFrTestCase");
955}
956
960
961void
963{
964 NS_LOG_DEBUG("LteStrictFrAreaTestCase");
965
967 Config::SetDefault("ns3::LteHelper::UseIdealRrc", BooleanValue(true));
968 Config::SetDefault("ns3::LteSpectrumPhy::CtrlErrorModelEnabled", BooleanValue(false));
969 Config::SetDefault("ns3::LteSpectrumPhy::DataErrorModelEnabled", BooleanValue(false));
970
971 double eNbTxPower = 30;
972 Config::SetDefault("ns3::LteEnbPhy::TxPower", DoubleValue(eNbTxPower));
973 Config::SetDefault("ns3::LteUePhy::TxPower", DoubleValue(10.0));
974 Config::SetDefault("ns3::LteUePhy::EnableUplinkPowerControl", BooleanValue(true));
975
976 Config::SetDefault("ns3::LteUePowerControl::ClosedLoop", BooleanValue(true));
977 Config::SetDefault("ns3::LteUePowerControl::AccumulationEnabled", BooleanValue(false));
978
980
981 // Create Nodes: eNodeB and UE
982 NodeContainer enbNodes;
983 NodeContainer ueNodes1;
984 NodeContainer ueNodes2;
985 enbNodes.Create(2);
986 ueNodes1.Create(1);
987 ueNodes2.Create(1);
988 NodeContainer allNodes = NodeContainer(enbNodes, ueNodes1, ueNodes2);
989
990 /*
991 * The topology is the following:
992 *
993 * eNB1 UE1 eNB2
994 * | | |
995 * x ------------ x ------------------------ x ------------ x----UE2
996 * 200 m 600 m 200 m 20 m
997 *
998 */
999
1001 positionAlloc->Add(Vector(0.0, 0.0, 0.0)); // eNB1
1002 positionAlloc->Add(Vector(1000, 0.0, 0.0)); // eNB2
1003 positionAlloc->Add(Vector(0.0, 0.0, 0.0)); // UE1
1004 positionAlloc->Add(Vector(1020, 0.0, 0.0)); // UE2
1005 MobilityHelper mobility;
1006 mobility.SetMobilityModel("ns3::ConstantPositionMobilityModel");
1007 mobility.SetPositionAllocator(positionAlloc);
1008 mobility.Install(allNodes);
1009 m_ueMobility = ueNodes1.Get(0)->GetObject<MobilityModel>();
1010
1011 // Disable layer-3 filtering
1012 Config::SetDefault("ns3::LteEnbRrc::RsrpFilterCoefficient", UintegerValue(0));
1013 Config::SetDefault("ns3::LteEnbRrc::RsrqFilterCoefficient", UintegerValue(0));
1014
1015 // Create Devices and install them in the Nodes (eNB and UE)
1016 NetDeviceContainer enbDevs;
1017 NetDeviceContainer ueDevs1;
1018 NetDeviceContainer ueDevs2;
1019 lteHelper->SetSchedulerType(m_schedulerType);
1020
1021 lteHelper->SetFfrAlgorithmType("ns3::LteFrStrictAlgorithm");
1022 lteHelper->SetFfrAlgorithmAttribute("RsrqThreshold", UintegerValue(25));
1023 lteHelper->SetFfrAlgorithmAttribute("CenterPowerOffset",
1025 lteHelper->SetFfrAlgorithmAttribute("EdgePowerOffset",
1027
1028 lteHelper->SetFfrAlgorithmAttribute("DlCommonSubBandwidth", UintegerValue(6));
1029 lteHelper->SetFfrAlgorithmAttribute("DlEdgeSubBandOffset", UintegerValue(6));
1030 lteHelper->SetFfrAlgorithmAttribute("DlEdgeSubBandwidth", UintegerValue(6));
1031
1032 lteHelper->SetFfrAlgorithmAttribute("UlCommonSubBandwidth", UintegerValue(6));
1033 lteHelper->SetFfrAlgorithmAttribute("UlEdgeSubBandOffset", UintegerValue(6));
1034 lteHelper->SetFfrAlgorithmAttribute("UlEdgeSubBandwidth", UintegerValue(6));
1035 enbDevs.Add(lteHelper->InstallEnbDevice(enbNodes.Get(0)));
1036
1037 lteHelper->SetFfrAlgorithmType("ns3::LteFrNoOpAlgorithm");
1038 enbDevs.Add(lteHelper->InstallEnbDevice(enbNodes.Get(1)));
1039
1040 ueDevs1 = lteHelper->InstallUeDevice(ueNodes1);
1041 ueDevs2 = lteHelper->InstallUeDevice(ueNodes2);
1042
1043 // Attach a UE to a eNB
1044 lteHelper->Attach(ueDevs1, enbDevs.Get(0));
1045 lteHelper->Attach(ueDevs2, enbDevs.Get(1));
1046
1047 // Activate the default EPS bearer
1048 // Since this test includes the Token Bank Fair Queue Scheduler
1049 //(ns3::FdTbfqFfMacScheduler) we have to treat the default
1050 // bearer as the dedicated bearer with QoS.
1052 qos.mbrUl = 1e6;
1053 qos.mbrDl = 1e6;
1054 qos.gbrUl = 1e4;
1055 qos.gbrDl = 1e4;
1056
1058 EpsBearer bearer(q, qos);
1059
1060 lteHelper->ActivateDataRadioBearer(ueDevs1, bearer);
1061 lteHelper->ActivateDataRadioBearer(ueDevs2, bearer);
1062
1063 // Test SpectrumPhy to get signals form DL channel
1064 Ptr<LteSpectrumPhy> enbDlSpectrumPhy = enbDevs.Get(0)
1065 ->GetObject<LteEnbNetDevice>()
1066 ->GetPhy()
1067 ->GetDownlinkSpectrumPhy()
1069 Ptr<SpectrumChannel> dlChannel = enbDlSpectrumPhy->GetChannel();
1070
1072 Ptr<LteEnbNetDevice> eNbDev = enbDevs.Get(0)->GetObject<LteEnbNetDevice>();
1073 testDlSpectrumPhy->SetRxSpectrumModel(
1075 dlChannel->AddRx(testDlSpectrumPhy);
1076
1077 testDlSpectrumPhy->SetCellId(1);
1078
1079 testDlSpectrumPhy->TraceConnectWithoutContext(
1080 "RxStart",
1082
1083 // Test SpectrumPhy to get signals form UL channel
1084 Ptr<LteSpectrumPhy> ueUlSpectrumPhy = ueDevs1.Get(0)
1085 ->GetObject<LteUeNetDevice>()
1086 ->GetPhy()
1087 ->GetUplinkSpectrumPhy()
1089 Ptr<SpectrumChannel> ulChannel = ueUlSpectrumPhy->GetChannel();
1090
1092 testUlSpectrumPhy->SetRxSpectrumModel(
1094 ulChannel->AddRx(testUlSpectrumPhy);
1095
1096 testUlSpectrumPhy->SetCellId(1);
1097
1098 testUlSpectrumPhy->TraceConnectWithoutContext(
1099 "RxStart",
1101
1102 std::vector<bool> expectedDlRbCenterArea;
1103 expectedDlRbCenterArea.resize(m_dlBandwidth, false);
1104 std::vector<bool> expectedUlRbCenterArea;
1105 expectedUlRbCenterArea.resize(m_ulBandwidth, false);
1106 for (uint32_t i = 0; i < 6; i++)
1107 {
1108 expectedDlRbCenterArea[i] = true;
1109 expectedUlRbCenterArea[i] = true;
1110 }
1111
1112 std::vector<bool> expectedDlRbEdgeArea;
1113 expectedDlRbEdgeArea.resize(m_dlBandwidth, false);
1114 std::vector<bool> expectedUlRbEdgeArea;
1115 expectedUlRbEdgeArea.resize(m_ulBandwidth, false);
1116 for (uint32_t i = 12; i < 18; i++)
1117 {
1118 expectedDlRbEdgeArea[i] = true;
1119 expectedUlRbEdgeArea[i] = true;
1120 }
1121
1124 this,
1125 200,
1126 0,
1127 1,
1128 expectedDlRbCenterArea);
1131 this,
1132 0.0150543,
1133 expectedUlRbCenterArea);
1134
1137 this,
1138 800,
1139 0,
1140 2,
1141 expectedDlRbEdgeArea);
1144 this,
1145 0.199526,
1146 expectedUlRbEdgeArea);
1147
1150 this,
1151 200,
1152 0,
1153 1,
1154 expectedDlRbCenterArea);
1157 this,
1158 0.0150543,
1159 expectedUlRbCenterArea);
1160
1161 Simulator::Stop(Seconds(1.500));
1163
1164 NS_TEST_ASSERT_MSG_EQ(m_usedWrongDlRbg, false, "Scheduler used DL RB muted by FFR Algorithm");
1165 NS_TEST_ASSERT_MSG_EQ(m_usedWrongUlRbg, false, "Scheduler used UL RB muted by FFR Algorithm");
1166
1168}
1169
1170LteSoftFrAreaTestCase::LteSoftFrAreaTestCase(std::string name, std::string schedulerType)
1171 : LteFrAreaTestCase(name, schedulerType)
1172{
1173 NS_LOG_INFO("Creating LteSoftFrAreaTestCase");
1174}
1175
1179
1180void
1182{
1183 NS_LOG_DEBUG("LteSoftFrAreaTestCase");
1184
1185 Config::Reset();
1186 Config::SetDefault("ns3::LteHelper::UseIdealRrc", BooleanValue(true));
1187 Config::SetDefault("ns3::LteSpectrumPhy::CtrlErrorModelEnabled", BooleanValue(false));
1188 Config::SetDefault("ns3::LteSpectrumPhy::DataErrorModelEnabled", BooleanValue(false));
1189
1190 double eNbTxPower = 30;
1191 Config::SetDefault("ns3::LteEnbPhy::TxPower", DoubleValue(eNbTxPower));
1192 Config::SetDefault("ns3::LteUePhy::TxPower", DoubleValue(10.0));
1193 Config::SetDefault("ns3::LteUePhy::EnableUplinkPowerControl", BooleanValue(true));
1194
1195 Config::SetDefault("ns3::LteUePowerControl::ClosedLoop", BooleanValue(true));
1196 Config::SetDefault("ns3::LteUePowerControl::AccumulationEnabled", BooleanValue(false));
1197
1199
1200 // Create Nodes: eNodeB and UE
1201 NodeContainer enbNodes;
1202 NodeContainer ueNodes1;
1203 NodeContainer ueNodes2;
1204 enbNodes.Create(2);
1205 ueNodes1.Create(1);
1206 ueNodes2.Create(1);
1207 NodeContainer allNodes = NodeContainer(enbNodes, ueNodes1, ueNodes2);
1208
1209 /*
1210 * The topology is the following:
1211 *
1212 * eNB1 UE1 eNB2
1213 * | | |
1214 * x ------------ x ------------------------ x ------------ x----UE2
1215 * 200 m 600 m 200 m 20 m
1216 *
1217 */
1218
1220 positionAlloc->Add(Vector(0.0, 0.0, 0.0)); // eNB1
1221 positionAlloc->Add(Vector(1000, 0.0, 0.0)); // eNB2
1222 positionAlloc->Add(Vector(0.0, 0.0, 0.0)); // UE1
1223 positionAlloc->Add(Vector(1020, 0.0, 0.0)); // UE2
1224 MobilityHelper mobility;
1225 mobility.SetMobilityModel("ns3::ConstantPositionMobilityModel");
1226 mobility.SetPositionAllocator(positionAlloc);
1227 mobility.Install(allNodes);
1228 m_ueMobility = ueNodes1.Get(0)->GetObject<MobilityModel>();
1229
1230 // Disable layer-3 filtering
1231 Config::SetDefault("ns3::LteEnbRrc::RsrpFilterCoefficient", UintegerValue(0));
1232 Config::SetDefault("ns3::LteEnbRrc::RsrqFilterCoefficient", UintegerValue(0));
1233
1234 // Create Devices and install them in the Nodes (eNB and UE)
1235 NetDeviceContainer enbDevs;
1236 NetDeviceContainer ueDevs1;
1237 NetDeviceContainer ueDevs2;
1238 lteHelper->SetSchedulerType(m_schedulerType);
1239
1240 lteHelper->SetFfrAlgorithmType("ns3::LteFrSoftAlgorithm");
1241 lteHelper->SetFfrAlgorithmAttribute("AllowCenterUeUseEdgeSubBand", BooleanValue(false));
1242 lteHelper->SetFfrAlgorithmAttribute("RsrqThreshold", UintegerValue(25));
1243 lteHelper->SetFfrAlgorithmAttribute("CenterPowerOffset",
1245 lteHelper->SetFfrAlgorithmAttribute("EdgePowerOffset",
1247
1248 lteHelper->SetFfrAlgorithmAttribute("DlEdgeSubBandOffset", UintegerValue(8));
1249 lteHelper->SetFfrAlgorithmAttribute("DlEdgeSubBandwidth", UintegerValue(8));
1250 lteHelper->SetFfrAlgorithmAttribute("UlEdgeSubBandOffset", UintegerValue(8));
1251 lteHelper->SetFfrAlgorithmAttribute("UlEdgeSubBandwidth", UintegerValue(8));
1252 enbDevs.Add(lteHelper->InstallEnbDevice(enbNodes.Get(0)));
1253
1254 lteHelper->SetFfrAlgorithmType("ns3::LteFrNoOpAlgorithm");
1255 enbDevs.Add(lteHelper->InstallEnbDevice(enbNodes.Get(1)));
1256
1257 ueDevs1 = lteHelper->InstallUeDevice(ueNodes1);
1258 ueDevs2 = lteHelper->InstallUeDevice(ueNodes2);
1259
1260 // Attach a UE to a eNB
1261 lteHelper->Attach(ueDevs1, enbDevs.Get(0));
1262 lteHelper->Attach(ueDevs2, enbDevs.Get(1));
1263
1264 // Activate the default EPS bearer
1265 // Since this test includes the Token Bank Fair Queue Scheduler
1266 //(ns3::FdTbfqFfMacScheduler) we have to treat the default
1267 // bearer as the dedicated bearer with QoS.
1269 qos.mbrUl = 1e6;
1270 qos.mbrDl = 1e6;
1271 qos.gbrUl = 1e4;
1272 qos.gbrDl = 1e4;
1273
1275 EpsBearer bearer(q, qos);
1276 lteHelper->ActivateDataRadioBearer(ueDevs1, bearer);
1277 lteHelper->ActivateDataRadioBearer(ueDevs2, bearer);
1278
1279 // Test SpectrumPhy to get signals form DL channel
1280 Ptr<LteSpectrumPhy> enbDlSpectrumPhy = enbDevs.Get(0)
1281 ->GetObject<LteEnbNetDevice>()
1282 ->GetPhy()
1283 ->GetDownlinkSpectrumPhy()
1285 Ptr<SpectrumChannel> dlChannel = enbDlSpectrumPhy->GetChannel();
1286
1288 Ptr<LteEnbNetDevice> eNbDev = enbDevs.Get(0)->GetObject<LteEnbNetDevice>();
1289 testDlSpectrumPhy->SetRxSpectrumModel(
1291 dlChannel->AddRx(testDlSpectrumPhy);
1292
1293 testDlSpectrumPhy->SetCellId(1);
1294
1295 testDlSpectrumPhy->TraceConnectWithoutContext(
1296 "RxStart",
1298
1299 // Test SpectrumPhy to get signals form UL channel
1300 Ptr<LteSpectrumPhy> ueUlSpectrumPhy = ueDevs1.Get(0)
1301 ->GetObject<LteUeNetDevice>()
1302 ->GetPhy()
1303 ->GetUplinkSpectrumPhy()
1305 Ptr<SpectrumChannel> ulChannel = ueUlSpectrumPhy->GetChannel();
1306
1308 testUlSpectrumPhy->SetRxSpectrumModel(
1310 ulChannel->AddRx(testUlSpectrumPhy);
1311
1312 testUlSpectrumPhy->SetCellId(1);
1313
1314 testUlSpectrumPhy->TraceConnectWithoutContext(
1315 "RxStart",
1317
1318 std::vector<bool> expectedDlRbCenterArea;
1319 expectedDlRbCenterArea.resize(m_dlBandwidth, false);
1320 std::vector<bool> expectedUlRbCenterArea;
1321 expectedUlRbCenterArea.resize(m_ulBandwidth, false);
1322 for (uint32_t i = 0; i < 8; i++)
1323 {
1324 expectedDlRbCenterArea[i] = true;
1325 expectedUlRbCenterArea[i] = true;
1326 }
1327 for (uint32_t i = 16; i < 25; i++)
1328 {
1329 expectedDlRbCenterArea[i] = true;
1330 }
1331
1332 std::vector<bool> expectedDlRbEdgeArea;
1333 expectedDlRbEdgeArea.resize(m_dlBandwidth, false);
1334 std::vector<bool> expectedUlRbEdgeArea;
1335 expectedUlRbEdgeArea.resize(m_ulBandwidth, false);
1336 for (uint32_t i = 8; i < 16; i++)
1337 {
1338 expectedDlRbEdgeArea[i] = true;
1339 expectedUlRbEdgeArea[i] = true;
1340 }
1341
1344 this,
1345 200,
1346 0,
1347 1,
1348 expectedDlRbCenterArea);
1351 this,
1352 0.0150543,
1353 expectedUlRbCenterArea);
1354
1357 this,
1358 800,
1359 0,
1360 2,
1361 expectedDlRbEdgeArea);
1364 this,
1365 0.199526,
1366 expectedUlRbEdgeArea);
1367
1370 this,
1371 200,
1372 0,
1373 1,
1374 expectedDlRbCenterArea);
1377 this,
1378 0.0150543,
1379 expectedUlRbCenterArea);
1380
1381 Simulator::Stop(Seconds(1.500));
1383
1384#if 0
1386 "Scheduler used DL RBG muted by FFR Algorithm");
1387
1388#endif
1389 NS_TEST_ASSERT_MSG_EQ(m_usedWrongUlRbg, false, "Scheduler used UL RB muted by FFR Algorithm");
1390
1392}
1393
1394LteSoftFfrAreaTestCase::LteSoftFfrAreaTestCase(std::string name, std::string schedulerType)
1395 : LteFrAreaTestCase(name, schedulerType)
1396{
1397 NS_LOG_INFO("Creating LteSoftFfrAreaTestCase");
1398}
1399
1403
1404void
1406{
1407 NS_LOG_DEBUG("LteSoftFfrAreaTestCase");
1408
1409 Config::Reset();
1410 Config::SetDefault("ns3::LteHelper::UseIdealRrc", BooleanValue(true));
1411 Config::SetDefault("ns3::LteSpectrumPhy::CtrlErrorModelEnabled", BooleanValue(false));
1412 Config::SetDefault("ns3::LteSpectrumPhy::DataErrorModelEnabled", BooleanValue(false));
1413
1414 double eNbTxPower = 30;
1415 Config::SetDefault("ns3::LteEnbPhy::TxPower", DoubleValue(eNbTxPower));
1416 Config::SetDefault("ns3::LteUePhy::TxPower", DoubleValue(10.0));
1417 Config::SetDefault("ns3::LteUePhy::EnableUplinkPowerControl", BooleanValue(true));
1418
1419 Config::SetDefault("ns3::LteUePowerControl::ClosedLoop", BooleanValue(true));
1420 Config::SetDefault("ns3::LteUePowerControl::AccumulationEnabled", BooleanValue(false));
1421
1423
1424 // Create Nodes: eNodeB and UE
1425 NodeContainer enbNodes;
1426 NodeContainer ueNodes1;
1427 NodeContainer ueNodes2;
1428 enbNodes.Create(2);
1429 ueNodes1.Create(1);
1430 ueNodes2.Create(1);
1431 NodeContainer allNodes = NodeContainer(enbNodes, ueNodes1, ueNodes2);
1432
1433 /*
1434 * The topology is the following:
1435 *
1436 * eNB1 UE1 eNB2
1437 * | | |
1438 * x ------------ x ------------------------ x ------------ x----UE2
1439 * 200 m 600 m 200 m 20 m
1440 *
1441 */
1442
1444 positionAlloc->Add(Vector(0.0, 0.0, 0.0)); // eNB1
1445 positionAlloc->Add(Vector(1000, 0.0, 0.0)); // eNB2
1446 positionAlloc->Add(Vector(0.0, 0.0, 0.0)); // UE1
1447 positionAlloc->Add(Vector(1020, 0.0, 0.0)); // UE2
1448 MobilityHelper mobility;
1449 mobility.SetMobilityModel("ns3::ConstantPositionMobilityModel");
1450 mobility.SetPositionAllocator(positionAlloc);
1451 mobility.Install(allNodes);
1452 m_ueMobility = ueNodes1.Get(0)->GetObject<MobilityModel>();
1453
1454 // Disable layer-3 filtering
1455 Config::SetDefault("ns3::LteEnbRrc::RsrpFilterCoefficient", UintegerValue(0));
1456 Config::SetDefault("ns3::LteEnbRrc::RsrqFilterCoefficient", UintegerValue(0));
1457
1458 // Create Devices and install them in the Nodes (eNB and UE)
1459 NetDeviceContainer enbDevs;
1460 NetDeviceContainer ueDevs1;
1461 NetDeviceContainer ueDevs2;
1462 lteHelper->SetSchedulerType(m_schedulerType);
1463
1464 lteHelper->SetFfrAlgorithmType("ns3::LteFfrSoftAlgorithm");
1465 lteHelper->SetFfrAlgorithmAttribute("CenterRsrqThreshold", UintegerValue(28));
1466 lteHelper->SetFfrAlgorithmAttribute("EdgeRsrqThreshold", UintegerValue(18));
1467 lteHelper->SetFfrAlgorithmAttribute("CenterAreaPowerOffset",
1469 lteHelper->SetFfrAlgorithmAttribute("MediumAreaPowerOffset",
1471 lteHelper->SetFfrAlgorithmAttribute("EdgeAreaPowerOffset",
1473
1474 lteHelper->SetFfrAlgorithmAttribute("UlCommonSubBandwidth", UintegerValue(6));
1475 lteHelper->SetFfrAlgorithmAttribute("DlCommonSubBandwidth", UintegerValue(6));
1476
1477 lteHelper->SetFfrAlgorithmAttribute("DlEdgeSubBandOffset", UintegerValue(6));
1478 lteHelper->SetFfrAlgorithmAttribute("DlEdgeSubBandwidth", UintegerValue(6));
1479 lteHelper->SetFfrAlgorithmAttribute("UlEdgeSubBandOffset", UintegerValue(6));
1480 lteHelper->SetFfrAlgorithmAttribute("UlEdgeSubBandwidth", UintegerValue(6));
1481 enbDevs.Add(lteHelper->InstallEnbDevice(enbNodes.Get(0)));
1482
1483 lteHelper->SetFfrAlgorithmType("ns3::LteFrNoOpAlgorithm");
1484 enbDevs.Add(lteHelper->InstallEnbDevice(enbNodes.Get(1)));
1485
1486 ueDevs1 = lteHelper->InstallUeDevice(ueNodes1);
1487 ueDevs2 = lteHelper->InstallUeDevice(ueNodes2);
1488
1489 // Attach a UE to a eNB
1490 lteHelper->Attach(ueDevs1, enbDevs.Get(0));
1491 lteHelper->Attach(ueDevs2, enbDevs.Get(1));
1492
1493 // Activate the default EPS bearer
1494 // Since this test includes the Token Bank Fair Queue Scheduler
1495 //(ns3::FdTbfqFfMacScheduler) we have to treat the default
1496 // bearer as the dedicated bearer with QoS.
1498 qos.mbrUl = 1e6;
1499 qos.mbrDl = 1e6;
1500 qos.gbrUl = 1e4;
1501 qos.gbrDl = 1e4;
1502
1504 EpsBearer bearer(q, qos);
1505 lteHelper->ActivateDataRadioBearer(ueDevs1, bearer);
1506 lteHelper->ActivateDataRadioBearer(ueDevs2, bearer);
1507
1508 // Test SpectrumPhy to get signals form DL channel
1509 Ptr<LteSpectrumPhy> enbDlSpectrumPhy = enbDevs.Get(0)
1510 ->GetObject<LteEnbNetDevice>()
1511 ->GetPhy()
1512 ->GetDownlinkSpectrumPhy()
1514 Ptr<SpectrumChannel> dlChannel = enbDlSpectrumPhy->GetChannel();
1515
1517 Ptr<LteEnbNetDevice> eNbDev = enbDevs.Get(0)->GetObject<LteEnbNetDevice>();
1518 testDlSpectrumPhy->SetRxSpectrumModel(
1520 dlChannel->AddRx(testDlSpectrumPhy);
1521
1522 testDlSpectrumPhy->SetCellId(1);
1523
1524 testDlSpectrumPhy->TraceConnectWithoutContext(
1525 "RxStart",
1527
1528 // Test SpectrumPhy to get signals form UL channel
1529 Ptr<LteSpectrumPhy> ueUlSpectrumPhy = ueDevs1.Get(0)
1530 ->GetObject<LteUeNetDevice>()
1531 ->GetPhy()
1532 ->GetUplinkSpectrumPhy()
1534 Ptr<SpectrumChannel> ulChannel = ueUlSpectrumPhy->GetChannel();
1535
1537 testUlSpectrumPhy->SetRxSpectrumModel(
1539 ulChannel->AddRx(testUlSpectrumPhy);
1540
1541 testUlSpectrumPhy->SetCellId(1);
1542
1543 testUlSpectrumPhy->TraceConnectWithoutContext(
1544 "RxStart",
1546
1547 double expectedDlPowerCenterArea = 0.5;
1548 std::vector<bool> expectedDlRbCenterArea;
1549 expectedDlRbCenterArea.resize(m_dlBandwidth, false);
1550 std::vector<bool> expectedUlRbCenterArea;
1551 expectedUlRbCenterArea.resize(m_ulBandwidth, false);
1552 for (uint32_t i = 6; i < 12; i++)
1553 {
1554 expectedDlRbCenterArea[i] = true;
1555 expectedUlRbCenterArea[i] = true;
1556 }
1557 for (uint32_t i = 18; i < 25; i++)
1558 {
1559 expectedDlRbCenterArea[i] = true;
1560 expectedUlRbCenterArea[i] = true;
1561 }
1562
1563 double expectedDlPowerMiddleArea = 1.0;
1564 std::vector<bool> expectedDlRbMiddleArea;
1565 expectedDlRbMiddleArea.resize(m_dlBandwidth, false);
1566 std::vector<bool> expectedUlRbMiddleArea;
1567 expectedUlRbMiddleArea.resize(m_ulBandwidth, false);
1568 for (uint32_t i = 0; i < 6; i++)
1569 {
1570 expectedDlRbMiddleArea[i] = true;
1571 expectedUlRbMiddleArea[i] = true;
1572 }
1573
1574 double expectedDlPowerEdgeArea = 2.0;
1575 std::vector<bool> expectedDlRbEdgeArea;
1576 expectedDlRbEdgeArea.resize(m_dlBandwidth, false);
1577 std::vector<bool> expectedUlRbEdgeArea;
1578 expectedUlRbEdgeArea.resize(m_ulBandwidth, false);
1579 for (uint32_t i = 12; i < 18; i++)
1580 {
1581 expectedDlRbEdgeArea[i] = true;
1582 expectedUlRbEdgeArea[i] = true;
1583 }
1584
1587 this,
1588 200,
1589 0,
1590 expectedDlPowerCenterArea,
1591 expectedDlRbCenterArea);
1594 this,
1595 0.0150543,
1596 expectedUlRbCenterArea);
1597
1600 this,
1601 600,
1602 0,
1603 expectedDlPowerMiddleArea,
1604 expectedDlRbMiddleArea);
1607 this,
1608 0.135489,
1609 expectedUlRbMiddleArea);
1610
1613 this,
1614 800,
1615 0,
1616 expectedDlPowerEdgeArea,
1617 expectedDlRbEdgeArea);
1620 this,
1621 0.199526,
1622 expectedUlRbEdgeArea);
1623
1626 this,
1627 600,
1628 0,
1629 expectedDlPowerMiddleArea,
1630 expectedDlRbMiddleArea);
1633 this,
1634 0.135489,
1635 expectedUlRbMiddleArea);
1636
1639 this,
1640 200,
1641 0,
1642 expectedDlPowerCenterArea,
1643 expectedDlRbCenterArea);
1646 this,
1647 0.0150543,
1648 expectedUlRbCenterArea);
1649
1650 Simulator::Stop(Seconds(2.500));
1652
1653 NS_TEST_ASSERT_MSG_EQ(m_usedWrongDlRbg, false, "Scheduler used DL RBG muted by FFR Algorithm");
1654
1655 NS_TEST_ASSERT_MSG_EQ(m_usedWrongUlRbg, false, "Scheduler used UL RB muted by FFR Algorithm");
1656
1658}
1659
1660LteEnhancedFfrAreaTestCase::LteEnhancedFfrAreaTestCase(std::string name, std::string schedulerType)
1661 : LteFrAreaTestCase(name, schedulerType)
1662{
1663 NS_LOG_INFO("Creating LteEnhancedFfrAreaTestCase");
1664}
1665
1669
1670void
1672{
1673 NS_LOG_DEBUG("LteEnhancedFfrAreaTestCase");
1674
1675 Config::Reset();
1676 Config::SetDefault("ns3::LteHelper::UseIdealRrc", BooleanValue(true));
1677 Config::SetDefault("ns3::LteHelper::UsePdschForCqiGeneration", BooleanValue(true));
1678 Config::SetDefault("ns3::LteSpectrumPhy::CtrlErrorModelEnabled", BooleanValue(false));
1679 Config::SetDefault("ns3::LteSpectrumPhy::DataErrorModelEnabled", BooleanValue(false));
1680
1681 double eNbTxPower = 30;
1682 Config::SetDefault("ns3::LteEnbPhy::TxPower", DoubleValue(eNbTxPower));
1683 Config::SetDefault("ns3::LteUePhy::TxPower", DoubleValue(10.0));
1684 Config::SetDefault("ns3::LteUePhy::EnableUplinkPowerControl", BooleanValue(true));
1685
1686 Config::SetDefault("ns3::LteUePowerControl::ClosedLoop", BooleanValue(true));
1687 Config::SetDefault("ns3::LteUePowerControl::AccumulationEnabled", BooleanValue(false));
1688
1690
1691 // Create Nodes: eNodeB and UE
1692 NodeContainer enbNodes;
1693 NodeContainer ueNodes1;
1694 NodeContainer ueNodes2;
1695 enbNodes.Create(2);
1696 ueNodes1.Create(1);
1697 ueNodes2.Create(1);
1698 NodeContainer allNodes = NodeContainer(enbNodes, ueNodes1, ueNodes2);
1699
1700 /*
1701 * The topology is the following:
1702 *
1703 * eNB1 UE1 eNB2
1704 * | | |
1705 * x ------------ x ------------------------ x ------------ x----UE2
1706 * 200 m 600 m 200 m 20 m
1707 *
1708 */
1709
1711 positionAlloc->Add(Vector(0.0, 0.0, 0.0)); // eNB1
1712 positionAlloc->Add(Vector(1000, 0.0, 0.0)); // eNB2
1713 positionAlloc->Add(Vector(0.0, 0.0, 0.0)); // UE1
1714 positionAlloc->Add(Vector(1020, 0.0, 0.0)); // UE2
1715 MobilityHelper mobility;
1716 mobility.SetMobilityModel("ns3::ConstantPositionMobilityModel");
1717 mobility.SetPositionAllocator(positionAlloc);
1718 mobility.Install(allNodes);
1719 m_ueMobility = ueNodes1.Get(0)->GetObject<MobilityModel>();
1720
1721 // Disable layer-3 filtering
1722 Config::SetDefault("ns3::LteEnbRrc::RsrpFilterCoefficient", UintegerValue(0));
1723 Config::SetDefault("ns3::LteEnbRrc::RsrqFilterCoefficient", UintegerValue(0));
1724
1725 // Create Devices and install them in the Nodes (eNB and UE)
1726 NetDeviceContainer enbDevs;
1727 NetDeviceContainer ueDevs1;
1728 NetDeviceContainer ueDevs2;
1729 lteHelper->SetSchedulerType(m_schedulerType);
1730 lteHelper->SetSchedulerAttribute("HarqEnabled", BooleanValue(true));
1731
1732 lteHelper->SetEnbDeviceAttribute("DlBandwidth", UintegerValue(m_dlBandwidth));
1733 lteHelper->SetEnbDeviceAttribute("UlBandwidth", UintegerValue(m_ulBandwidth));
1734
1735 lteHelper->SetFfrAlgorithmType("ns3::LteFfrEnhancedAlgorithm");
1736 lteHelper->SetFfrAlgorithmAttribute("RsrqThreshold", UintegerValue(25));
1737 lteHelper->SetFfrAlgorithmAttribute("DlCqiThreshold", UintegerValue(10));
1738 lteHelper->SetFfrAlgorithmAttribute("UlCqiThreshold", UintegerValue(15));
1739 lteHelper->SetFfrAlgorithmAttribute("CenterAreaPowerOffset",
1741 lteHelper->SetFfrAlgorithmAttribute("EdgeAreaPowerOffset",
1743
1744 lteHelper->SetFfrAlgorithmAttribute("UlSubBandOffset", UintegerValue(0));
1745 lteHelper->SetFfrAlgorithmAttribute("UlReuse3SubBandwidth", UintegerValue(4));
1746 lteHelper->SetFfrAlgorithmAttribute("UlReuse1SubBandwidth", UintegerValue(4));
1747
1748 lteHelper->SetFfrAlgorithmAttribute("DlSubBandOffset", UintegerValue(0));
1749 lteHelper->SetFfrAlgorithmAttribute("DlReuse3SubBandwidth", UintegerValue(4));
1750 lteHelper->SetFfrAlgorithmAttribute("DlReuse1SubBandwidth", UintegerValue(4));
1751
1752 enbDevs.Add(lteHelper->InstallEnbDevice(enbNodes.Get(0)));
1753
1754 lteHelper->SetFfrAlgorithmType("ns3::LteFrNoOpAlgorithm");
1755 enbDevs.Add(lteHelper->InstallEnbDevice(enbNodes.Get(1)));
1756
1757 ueDevs1 = lteHelper->InstallUeDevice(ueNodes1);
1758 ueDevs2 = lteHelper->InstallUeDevice(ueNodes2);
1759
1760 // Attach a UE to a eNB
1761 lteHelper->Attach(ueDevs1, enbDevs.Get(0));
1762 lteHelper->Attach(ueDevs2, enbDevs.Get(1));
1763
1764 // Activate the default EPS bearer
1765 // Since this test includes the Token Bank Fair Queue Scheduler
1766 //(ns3::FdTbfqFfMacScheduler) we have to treat the default
1767 // bearer as the dedicated bearer with QoS.
1769 qos.mbrUl = 1e6;
1770 qos.mbrDl = 1e6;
1771 qos.gbrUl = 1e4;
1772 qos.gbrDl = 1e4;
1773
1775 EpsBearer bearer(q, qos);
1776 lteHelper->ActivateDataRadioBearer(ueDevs1, bearer);
1777 lteHelper->ActivateDataRadioBearer(ueDevs2, bearer);
1778
1779 // Test SpectrumPhy to get signals form DL channel
1780 Ptr<LteSpectrumPhy> enbDlSpectrumPhy = enbDevs.Get(0)
1781 ->GetObject<LteEnbNetDevice>()
1782 ->GetPhy()
1783 ->GetDownlinkSpectrumPhy()
1785 Ptr<SpectrumChannel> dlChannel = enbDlSpectrumPhy->GetChannel();
1786
1788 Ptr<LteEnbNetDevice> eNbDev = enbDevs.Get(0)->GetObject<LteEnbNetDevice>();
1789 testDlSpectrumPhy->SetRxSpectrumModel(
1791 dlChannel->AddRx(testDlSpectrumPhy);
1792
1793 testDlSpectrumPhy->SetCellId(1);
1794
1795 testDlSpectrumPhy->TraceConnectWithoutContext(
1796 "RxStart",
1798
1799 // Test SpectrumPhy to get signals form UL channel
1800 Ptr<LteSpectrumPhy> ueUlSpectrumPhy = ueDevs1.Get(0)
1801 ->GetObject<LteUeNetDevice>()
1802 ->GetPhy()
1803 ->GetUplinkSpectrumPhy()
1805 Ptr<SpectrumChannel> ulChannel = ueUlSpectrumPhy->GetChannel();
1806
1808 testUlSpectrumPhy->SetRxSpectrumModel(
1810 ulChannel->AddRx(testUlSpectrumPhy);
1811
1812 testUlSpectrumPhy->SetCellId(1);
1813
1814 testUlSpectrumPhy->TraceConnectWithoutContext(
1815 "RxStart",
1817
1818 double expectedDlPowerCenterArea = 0.251189;
1819 std::vector<bool> expectedDlRbCenterArea;
1820 expectedDlRbCenterArea.resize(m_dlBandwidth, false);
1821 std::vector<bool> expectedUlRbCenterArea;
1822 expectedUlRbCenterArea.resize(m_ulBandwidth, false);
1823 for (uint32_t i = 0; i < 8; i++)
1824 {
1825 expectedDlRbCenterArea[i] = true;
1826 expectedUlRbCenterArea[i] = true;
1827 }
1828 for (uint32_t i = 12; i < 16; i++)
1829 {
1830 expectedDlRbCenterArea[i] = true;
1831 expectedUlRbCenterArea[i] = true;
1832 }
1833 for (uint32_t i = 20; i < 24; i++)
1834 {
1835 expectedDlRbCenterArea[i] = true;
1836 expectedUlRbCenterArea[i] = true;
1837 }
1838
1839 double expectedDlPowerMiddleArea = 0.251189;
1840 std::vector<bool> expectedDlRbMiddleArea;
1841 expectedDlRbMiddleArea.resize(m_dlBandwidth, false);
1842 std::vector<bool> expectedUlRbMiddleArea;
1843 expectedUlRbMiddleArea.resize(m_ulBandwidth, false);
1844 for (uint32_t i = 4; i < 8; i++)
1845 {
1846 expectedDlRbMiddleArea[i] = true;
1847 expectedUlRbMiddleArea[i] = true;
1848 }
1849
1850 double expectedDlPowerEdgeArea = 1.0;
1851 std::vector<bool> expectedDlRbEdgeArea;
1852 expectedDlRbEdgeArea.resize(m_dlBandwidth, false);
1853 std::vector<bool> expectedUlRbEdgeArea;
1854 expectedUlRbEdgeArea.resize(m_ulBandwidth, false);
1855 for (uint32_t i = 0; i < 4; i++)
1856 {
1857 expectedDlRbEdgeArea[i] = true;
1858 expectedUlRbEdgeArea[i] = true;
1859 }
1860
1863 this,
1864 100,
1865 0,
1866 expectedDlPowerCenterArea,
1867 expectedDlRbCenterArea);
1870 this,
1871 0.00250905,
1872 expectedUlRbCenterArea);
1873
1876 this,
1877 300,
1878 0,
1879 expectedDlPowerMiddleArea,
1880 expectedDlRbMiddleArea);
1883 this,
1884 0.0225815,
1885 expectedUlRbMiddleArea);
1886
1889 this,
1890 600,
1891 0,
1892 expectedDlPowerEdgeArea,
1893 expectedDlRbEdgeArea);
1896 this,
1897 0.0903259,
1898 expectedUlRbEdgeArea);
1899
1902 this,
1903 100,
1904 0,
1905 expectedDlPowerCenterArea,
1906 expectedDlRbCenterArea);
1909 this,
1910 0.00250905,
1911 expectedUlRbCenterArea);
1912
1915 this,
1916 300,
1917 0,
1918 expectedDlPowerMiddleArea,
1919 expectedDlRbMiddleArea);
1922 this,
1923 0.0225815,
1924 expectedUlRbCenterArea);
1925
1926 Simulator::Stop(Seconds(2.500));
1928
1929 NS_TEST_ASSERT_MSG_EQ(m_usedWrongDlRbg, false, "Scheduler used DL RBG muted by FFR Algorithm");
1930
1931 NS_TEST_ASSERT_MSG_EQ(m_usedWrongUlRbg, false, "Scheduler used UL RB muted by FFR Algorithm");
1932
1934}
1935
1937 std::string schedulerType)
1938 : LteFrAreaTestCase(name, schedulerType)
1939{
1940 NS_LOG_INFO("Creating LteDistributedFfrAreaTestCase");
1941}
1942
1946
1947void
1949{
1950 NS_LOG_DEBUG("LteDistributedFfrAreaTestCase");
1951
1952 Config::Reset();
1953 Config::SetDefault("ns3::LteHelper::UseIdealRrc", BooleanValue(true));
1954 Config::SetDefault("ns3::LteHelper::UsePdschForCqiGeneration", BooleanValue(true));
1955 Config::SetDefault("ns3::LteSpectrumPhy::CtrlErrorModelEnabled", BooleanValue(false));
1956 Config::SetDefault("ns3::LteSpectrumPhy::DataErrorModelEnabled", BooleanValue(false));
1957
1958 double eNbTxPower = 30;
1959 Config::SetDefault("ns3::LteEnbPhy::TxPower", DoubleValue(eNbTxPower));
1960 Config::SetDefault("ns3::LteUePhy::TxPower", DoubleValue(10.0));
1961 Config::SetDefault("ns3::LteUePhy::EnableUplinkPowerControl", BooleanValue(true));
1962
1963 Config::SetDefault("ns3::LteUePowerControl::ClosedLoop", BooleanValue(true));
1964 Config::SetDefault("ns3::LteUePowerControl::AccumulationEnabled", BooleanValue(false));
1965
1966 // Disable layer-3 filtering
1967 Config::SetDefault("ns3::LteEnbRrc::RsrpFilterCoefficient", UintegerValue(0));
1968 Config::SetDefault("ns3::LteEnbRrc::RsrqFilterCoefficient", UintegerValue(0));
1969
1970 uint16_t bandwidth = 25;
1971
1974 lteHelper->SetEpcHelper(epcHelper);
1975 lteHelper->SetHandoverAlgorithmType("ns3::NoOpHandoverAlgorithm"); // disable automatic handover
1976
1977 Ptr<Node> pgw = epcHelper->GetPgwNode();
1978
1979 // Create a single RemoteHost
1980 NodeContainer remoteHostContainer;
1981 remoteHostContainer.Create(1);
1982 Ptr<Node> remoteHost = remoteHostContainer.Get(0);
1983 InternetStackHelper internet;
1984 internet.Install(remoteHostContainer);
1985
1986 // Create the Internet
1987 PointToPointHelper p2ph;
1988 p2ph.SetDeviceAttribute("DataRate", DataRateValue(DataRate("100Gb/s")));
1989 p2ph.SetDeviceAttribute("Mtu", UintegerValue(1500));
1990 p2ph.SetChannelAttribute("Delay", TimeValue(Seconds(0.010)));
1991 NetDeviceContainer internetDevices = p2ph.Install(pgw, remoteHost);
1992 Ipv4AddressHelper ipv4h;
1993 ipv4h.SetBase("1.0.0.0", "255.0.0.0");
1994 Ipv4InterfaceContainer internetIpIfaces = ipv4h.Assign(internetDevices);
1995 Ipv4Address remoteHostAddr = internetIpIfaces.GetAddress(1);
1996
1997 // Routing of the Internet Host (towards the LTE network)
1998 Ipv4StaticRoutingHelper ipv4RoutingHelper;
1999 Ptr<Ipv4StaticRouting> remoteHostStaticRouting =
2000 ipv4RoutingHelper.GetStaticRouting(remoteHost->GetObject<Ipv4>());
2001 // interface 0 is localhost, 1 is the p2p device
2002 remoteHostStaticRouting->AddNetworkRouteTo(Ipv4Address("7.0.0.0"), Ipv4Mask("255.0.0.0"), 1);
2003
2004 // Create Nodes: eNodeB and UE
2005 NodeContainer enbNodes;
2006 NodeContainer ueNodes1;
2007 NodeContainer ueNodes2;
2008 enbNodes.Create(2);
2009 ueNodes1.Create(2);
2010 ueNodes2.Create(1);
2011 NodeContainer ueNodes = NodeContainer(ueNodes1, ueNodes2);
2012 NodeContainer allNodes = NodeContainer(enbNodes, ueNodes1, ueNodes2);
2013
2014 /*
2015 * The topology is the following:
2016 *
2017 * eNB1 UE1 UE2 eNB2
2018 * | | | |
2019 * x ------------ x ------------------------ x ------------ x
2020 * 200 m 600 m 200 m
2021 *
2022 */
2023
2024 // Install Mobility Model
2026 positionAlloc->Add(Vector(0.0, 0.0, 0.0)); // eNB1
2027 positionAlloc->Add(Vector(1000, 0.0, 0.0)); // eNB2
2028
2029 positionAlloc->Add(Vector(200, 0.0, 0.0)); // UE1
2030 positionAlloc->Add(Vector(200, 0.0, 0.0)); // UE1
2031 positionAlloc->Add(Vector(800, 0.0, 0.0)); // UE2
2032
2033 MobilityHelper mobility;
2034 mobility.SetMobilityModel("ns3::ConstantPositionMobilityModel");
2035 mobility.SetPositionAllocator(positionAlloc);
2036 mobility.Install(allNodes);
2037 m_ueMobility = ueNodes2.Get(0)->GetObject<MobilityModel>();
2038
2039 // Create Devices and install them in the Nodes (eNB and UE)
2040 NetDeviceContainer enbDevs;
2041 NetDeviceContainer ueDevs1;
2042 NetDeviceContainer ueDevs2;
2043 lteHelper->SetSchedulerType(m_schedulerType);
2044
2045 lteHelper->SetEnbDeviceAttribute("DlBandwidth", UintegerValue(bandwidth));
2046 lteHelper->SetEnbDeviceAttribute("UlBandwidth", UintegerValue(bandwidth));
2047
2048 lteHelper->SetFfrAlgorithmType("ns3::LteFfrDistributedAlgorithm");
2049 lteHelper->SetFfrAlgorithmAttribute("CalculationInterval", TimeValue(MilliSeconds(10)));
2050 lteHelper->SetFfrAlgorithmAttribute("RsrqThreshold", UintegerValue(25));
2051 lteHelper->SetFfrAlgorithmAttribute("RsrpDifferenceThreshold", UintegerValue(5));
2052 lteHelper->SetFfrAlgorithmAttribute("EdgeRbNum", UintegerValue(6));
2053 lteHelper->SetFfrAlgorithmAttribute("CenterPowerOffset",
2055 lteHelper->SetFfrAlgorithmAttribute("EdgePowerOffset",
2057
2058 enbDevs = lteHelper->InstallEnbDevice(enbNodes);
2059 ueDevs1 = lteHelper->InstallUeDevice(ueNodes1);
2060 ueDevs2 = lteHelper->InstallUeDevice(ueNodes2);
2061
2062 NetDeviceContainer ueLteDevs;
2063 ueLteDevs.Add(ueDevs1);
2064 ueLteDevs.Add(ueDevs2);
2065
2066 // Add X2 interface
2067 lteHelper->AddX2Interface(enbNodes);
2068
2069 // Install the IP stack on the UEs
2070 internet.Install(ueNodes);
2071 Ipv4InterfaceContainer ueIpIfaces;
2072 ueIpIfaces = epcHelper->AssignUeIpv4Address(NetDeviceContainer(ueLteDevs));
2073 // Assign IP address to UEs, and install applications
2074 for (uint32_t u = 0; u < ueNodes.GetN(); ++u)
2075 {
2076 Ptr<Node> ueNode = ueNodes.Get(u);
2077 // Set the default gateway for the UE
2078 Ptr<Ipv4StaticRouting> ueStaticRouting =
2079 ipv4RoutingHelper.GetStaticRouting(ueNode->GetObject<Ipv4>());
2080 ueStaticRouting->SetDefaultRoute(epcHelper->GetUeDefaultGatewayAddress(), 1);
2081 }
2082
2083 // Attach a UE to a eNB
2084 lteHelper->Attach(ueDevs1, enbDevs.Get(0));
2085 lteHelper->Attach(ueDevs2, enbDevs.Get(1));
2086
2087 // Install and start applications on UEs and remote host
2088 uint16_t dlPort = 10000;
2089 uint16_t ulPort = 20000;
2090
2091 // randomize a bit start times to avoid simulation artifacts
2092 // (e.g., buffer overflows due to packet transmissions happening
2093 // exactly at the same time)
2095 startTimeSeconds->SetAttribute("Min", DoubleValue(0));
2096 startTimeSeconds->SetAttribute("Max", DoubleValue(0.010));
2097
2098 for (uint32_t u = 0; u < ueNodes.GetN(); ++u)
2099 {
2100 Ptr<Node> ue = ueNodes.Get(u);
2101 // Set the default gateway for the UE
2102 Ptr<Ipv4StaticRouting> ueStaticRouting =
2103 ipv4RoutingHelper.GetStaticRouting(ue->GetObject<Ipv4>());
2104 ueStaticRouting->SetDefaultRoute(epcHelper->GetUeDefaultGatewayAddress(), 1);
2105
2106 for (uint32_t b = 0; b < 1; ++b)
2107 {
2108 ++dlPort;
2109 ++ulPort;
2110
2111 ApplicationContainer clientApps;
2112 ApplicationContainer serverApps;
2113
2114 NS_LOG_LOGIC("installing UDP DL app for UE " << u);
2115 UdpClientHelper dlClientHelper(ueIpIfaces.GetAddress(u), dlPort);
2116 dlClientHelper.SetAttribute("MaxPackets", UintegerValue(1000000));
2117 dlClientHelper.SetAttribute("Interval", TimeValue(MilliSeconds(1)));
2118 clientApps.Add(dlClientHelper.Install(remoteHost));
2119 PacketSinkHelper dlPacketSinkHelper("ns3::UdpSocketFactory",
2121 serverApps.Add(dlPacketSinkHelper.Install(ue));
2122
2123 NS_LOG_LOGIC("installing UDP UL app for UE " << u);
2124 UdpClientHelper ulClientHelper(remoteHostAddr, ulPort);
2125 ulClientHelper.SetAttribute("MaxPackets", UintegerValue(1000000));
2126 ulClientHelper.SetAttribute("Interval", TimeValue(MilliSeconds(1)));
2127 clientApps.Add(ulClientHelper.Install(ue));
2128 PacketSinkHelper ulPacketSinkHelper("ns3::UdpSocketFactory",
2130 serverApps.Add(ulPacketSinkHelper.Install(remoteHost));
2131
2134 dlpf.localPortStart = dlPort;
2135 dlpf.localPortEnd = dlPort;
2136 tft->Add(dlpf);
2138 ulpf.remotePortStart = ulPort;
2139 ulpf.remotePortEnd = ulPort;
2140 tft->Add(ulpf);
2141 // Since this test includes the Token Bank Fair Queue Scheduler
2142 //(ns3::FdTbfqFfMacScheduler) we have to use GBR bearer with
2143 // certain QoS.
2145 qos.mbrUl = 1e6;
2146 qos.mbrDl = 1e6;
2147 qos.gbrUl = 1e4;
2148 qos.gbrDl = 1e4;
2149
2151 EpsBearer bearer(q, qos);
2152 lteHelper->ActivateDedicatedEpsBearer(ueLteDevs.Get(u), bearer, tft);
2153
2154 Time startTime = Seconds(startTimeSeconds->GetValue());
2155 serverApps.Start(startTime);
2156 clientApps.Start(startTime);
2157 }
2158 }
2159
2160 // Test SpectrumPhy to get signals form DL channel
2161 Ptr<LteSpectrumPhy> enbDlSpectrumPhy = enbDevs.Get(0)
2162 ->GetObject<LteEnbNetDevice>()
2163 ->GetPhy()
2164 ->GetDownlinkSpectrumPhy()
2166 Ptr<SpectrumChannel> dlChannel = enbDlSpectrumPhy->GetChannel();
2167
2169 Ptr<LteEnbNetDevice> eNbDev = enbDevs.Get(0)->GetObject<LteEnbNetDevice>();
2170 testDlSpectrumPhy->SetRxSpectrumModel(
2172 dlChannel->AddRx(testDlSpectrumPhy);
2173
2174 testDlSpectrumPhy->SetCellId(2);
2175
2176 testDlSpectrumPhy->TraceConnectWithoutContext(
2177 "RxStart",
2179
2180 // Test SpectrumPhy to get signals form UL channel
2181 Ptr<LteSpectrumPhy> ueUlSpectrumPhy = ueDevs1.Get(0)
2182 ->GetObject<LteUeNetDevice>()
2183 ->GetPhy()
2184 ->GetUplinkSpectrumPhy()
2186 Ptr<SpectrumChannel> ulChannel = ueUlSpectrumPhy->GetChannel();
2187
2189 testUlSpectrumPhy->SetRxSpectrumModel(
2191 ulChannel->AddRx(testUlSpectrumPhy);
2192
2193 testUlSpectrumPhy->SetCellId(2);
2194
2195 testUlSpectrumPhy->TraceConnectWithoutContext(
2196 "RxStart",
2198
2199 double expectedDlPowerCenterArea = 1.0;
2200 std::vector<bool> expectedDlRbCenterArea;
2201 expectedDlRbCenterArea.resize(m_dlBandwidth, false);
2202 std::vector<bool> expectedUlRbCenterArea;
2203 expectedUlRbCenterArea.resize(m_ulBandwidth, false);
2204 for (uint32_t i = 0; i < m_dlBandwidth; i++)
2205 {
2206 expectedDlRbCenterArea[i] = true;
2207 expectedUlRbCenterArea[i] = true;
2208 }
2209
2210 double expectedDlPowerEdgeArea = 2.0;
2211 std::vector<bool> expectedDlRbEdgeArea;
2212 expectedDlRbEdgeArea.resize(m_dlBandwidth, false);
2213 std::vector<bool> expectedUlRbEdgeArea;
2214 expectedUlRbEdgeArea.resize(m_ulBandwidth, false);
2215 for (uint32_t i = 0; i < 6; i++)
2216 {
2217 expectedDlRbEdgeArea[i] = true;
2218 expectedUlRbEdgeArea[i] = true;
2219 }
2220
2221 std::vector<bool> expectedDlRbEdgeArea2;
2222 expectedDlRbEdgeArea2.resize(m_dlBandwidth, false);
2223 std::vector<bool> expectedUlRbEdgeArea2;
2224 expectedUlRbEdgeArea2.resize(m_dlBandwidth, false);
2225 for (uint32_t i = 6; i < 12; i++)
2226 {
2227 expectedDlRbEdgeArea2[i] = true;
2228 expectedUlRbEdgeArea2[i] = true;
2229 }
2230
2233 this,
2234 800,
2235 0,
2236 expectedDlPowerCenterArea,
2237 expectedDlRbCenterArea);
2240 this,
2241 0.0225815,
2242 expectedUlRbCenterArea);
2243
2246 this,
2247 400,
2248 0,
2249 expectedDlPowerEdgeArea,
2250 expectedDlRbEdgeArea);
2253 this,
2254 0.135489,
2255 expectedUlRbEdgeArea);
2256
2259 this,
2260 ueNodes1.Get(0),
2261 600,
2262 0,
2263 expectedDlPowerEdgeArea,
2264 expectedDlRbEdgeArea2);
2267 this,
2268 0.135489,
2269 expectedUlRbEdgeArea2);
2270
2273 this,
2274 ueNodes1.Get(0),
2275 200,
2276 0,
2277 expectedDlPowerEdgeArea,
2278 expectedDlRbEdgeArea);
2281 this,
2282 0.135489,
2283 expectedUlRbEdgeArea);
2284
2287 this,
2288 800,
2289 0,
2290 expectedDlPowerCenterArea,
2291 expectedDlRbCenterArea);
2294 this,
2295 0.0225815,
2296 expectedUlRbCenterArea);
2297
2298 Simulator::Stop(Seconds(2.500));
2300
2301#if 0
2303 "Scheduler used DL RBG muted by FFR Algorithm");
2304#endif
2305
2306 NS_TEST_ASSERT_MSG_EQ(m_usedWrongUlRbg, false, "Scheduler used UL RB muted by FFR Algorithm");
2307
2309}
cairo_uint64_t x
_cairo_uint_96by64_32x64_divrem:
uint32_t q
uint32_t u
Lte Distributed Ffr Area Test Case.
LteDistributedFfrAreaTestCase(std::string name, std::string schedulerType)
Constructor.
void DoRun() override
Implementation to actually run this TestCase.
Lte Enhanced Ffr Area Test Case.
void DoRun() override
Implementation to actually run this TestCase.
LteEnhancedFfrAreaTestCase(std::string name, std::string schedulerType)
Constructor.
Test frequency reuse algorithm by teleporting UEs to different parts of area and checking if the freq...
Time m_teleportTime
the teleport time
LteFrAreaTestCase(std::string name, std::string schedulerType)
Constructor.
bool m_usedWrongUlRbg
used wrong UL RBG?
std::vector< bool > m_expectedDlRb
the expected DL per RB
void SimpleTeleportUe(uint32_t x, uint32_t y)
Simple teleport UE function.
uint16_t m_ulBandwidth
the UL bandwidth
uint16_t m_dlBandwidth
the DL bandwidth
std::vector< bool > m_expectedUlRb
expected UL per RB
void UlDataRxStart(Ptr< const SpectrumValue > spectrumValue)
UL data receive start function.
void TeleportUe2(Ptr< Node > ueNode, uint32_t x, uint32_t y, double expectedPower, std::vector< bool > expectedDlRb)
Teleport UE 2 function.
void DlDataRxStart(Ptr< const SpectrumValue > spectrumValue)
DL data receive start function.
double m_expectedUlPower
expected UL power
std::string m_schedulerType
the scheduler type
void SetUlExpectedValues(double expectedPower, std::vector< bool > expectedDlRb)
Set UL expected values function.
double m_expectedDlPower
the expected DL power
void SetDlExpectedValues(double expectedPower, std::vector< bool > expectedDlRb)
Set DL expected values function.
bool m_usedWrongDlRbg
used wrong DL RBG?
void TeleportUe(uint32_t x, uint32_t y, double expectedPower, std::vector< bool > expectedDlRb)
Teleport UE function.
Ptr< MobilityModel > m_ueMobility
the UE mobility model
void DoRun() override
Implementation to actually run this TestCase.
Test frequency reuse algorithm.
void DlDataRxStart(Ptr< const SpectrumValue > spectrumValue)
DL data receive start function.
uint32_t m_userNum
the number of UE nodes
void UlDataRxStart(Ptr< const SpectrumValue > spectrumValue)
UL data receive start function.
void DoRun() override
Implementation to actually run this TestCase.
uint16_t m_dlBandwidth
the DL bandwidth
LteFrTestCase(std::string name, uint32_t userNum, uint16_t dlBandwidth, uint16_t ulBandwidth, std::vector< bool > availableDlRb, std::vector< bool > availableUlRb)
Constructor.
uint16_t m_ulBandwidth
the UL bandwidth
bool m_usedMutedDlRbg
used muted DL RBG?
std::vector< bool > m_availableDlRb
the available DL for each RB
std::vector< bool > m_availableUlRb
the available UL for each RB
bool m_usedMutedUlRbg
used muted UL RBG?
Test the fractional frequency reuse algorithms.
Test hard frequency reuse algorithm.
LteHardFrTestCase(std::string name, uint32_t userNum, std::string schedulerType, uint16_t dlBandwidth, uint16_t ulBandwidth, uint8_t dlSubBandOffset, uint16_t dlSubBandwidth, uint8_t ulSubBandOffset, uint16_t ulSubBandwidth, std::vector< bool > availableDlRb, std::vector< bool > availableUlRb)
Constructor.
uint8_t m_dlSubBandOffset
the DL subband offset
uint8_t m_ulSubBandwidth
UL subband offset.
uint8_t m_ulSubBandOffset
UL subband offset.
void DoRun() override
Implementation to actually run this TestCase.
uint8_t m_dlSubBandwidth
the DL subband width
std::string m_schedulerType
the scheduler type
Lte Soft Ffr Area Test Case.
void DoRun() override
Implementation to actually run this TestCase.
LteSoftFfrAreaTestCase(std::string name, std::string schedulerType)
Constructor.
Lte Soft Fr Area Test Case.
void DoRun() override
Implementation to actually run this TestCase.
LteSoftFrAreaTestCase(std::string name, std::string schedulerType)
Constructor.
void DoRun() override
Implementation to actually run this TestCase.
LteStrictFrAreaTestCase(std::string name, std::string schedulerType)
Constructor.
Test strict frequency reuse algorithm.
uint16_t m_ulCommonSubBandwidth
UL common subbandwidth.
void DoRun() override
Implementation to actually run this TestCase.
uint16_t m_dlCommonSubBandwidth
DL common subbandwidth.
uint8_t m_dlEdgeSubBandOffset
DL edge subband offset.
uint8_t m_ulEdgeSubBandOffset
UL edge subband offset.
std::string m_schedulerType
scheduler type
LteStrictFrTestCase(std::string name, uint32_t userNum, std::string schedulerType, uint16_t dlBandwidth, uint16_t ulBandwidth, uint16_t dlCommonSubBandwidth, uint8_t dlEdgeSubBandOffset, uint16_t dlEdgeSubBandwidth, uint16_t ulCommonSubBandwidth, uint8_t ulEdgeSubBandOffset, uint16_t ulEdgeSubBandwidth, std::vector< bool > availableDlRb, std::vector< bool > availableUlRb)
Constructor.
uint16_t m_dlEdgeSubBandwidth
DL edge subbandwidth.
uint16_t m_ulEdgeSubBandwidth
UL edge subbandwidth.
holds a vector of ns3::Application pointers.
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
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
@ GBR_CONV_VOICE
GBR Conversational Voice.
Definition eps-bearer.h:96
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...
The eNodeB device implementation.
The LteSpectrumPhy models the physical layer of LTE.
static Ptr< SpectrumModel > GetSpectrumModel(uint32_t earfcn, uint16_t bandwidth)
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.
holds a vector of ns3::NetDevice pointers
void Add(NetDeviceContainer other)
Append the contents of another NetDeviceContainer to the end of this 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.
uint32_t GetN() const
Get the number of Ptr<Node> stored in this container.
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:518
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.
Definition ptr.h:70
static EventId Schedule(const Time &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
Definition simulator.h:580
static void Destroy()
Execute the events scheduled with ScheduleDestroy().
Definition simulator.cc:125
static Time Now()
Return the current simulation virtual time.
Definition simulator.cc:191
static void Run()
Run the simulation.
Definition simulator.cc:161
static void Stop()
Tell the Simulator the calling event should be the last one executed.
Definition simulator.cc:169
void AddTestCase(TestCase *testCase, Duration duration=Duration::QUICK)
Add an individual child TestCase to this test suite.
Definition test.cc:296
@ QUICK
Fast test.
Definition test.h:1057
TestCase(const TestCase &)=delete
Caller graph was not generated because of its size.
Type
Type of test.
Definition test.h:1271
TestSuite(std::string name, Type type=Type::UNIT)
Construct a new test suite.
Definition test.cc:494
Simulation virtual time values and global simulation resolution.
Definition nstime.h:95
@ S
second
Definition nstime.h:106
Create a client application which sends UDP packets carrying a 32bit sequence number and a 64 bit tim...
Hold an unsigned integer type.
Definition uinteger.h:34
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:851
void SetDefault(std::string name, const AttributeValue &value)
Definition config.cc:886
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition log.h:201
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Definition log.h:267
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
Definition log.h:281
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
Definition log.h:274
static LteFrequencyReuseTestSuite lteFrequencyReuseTestSuite
Static variable for test initialization.
auto MakeBoundCallback(R(*fnPtr)(Args...), BArgs &&... bargs)
Make Callbacks with varying number of bound arguments.
Definition callback.h:753
Ptr< T > CreateObject(Args &&... args)
Create an object by type, with varying number of constructor parameters.
Definition object.h:627
Ptr< T > Create(Ts &&... args)
Create class instances by constructors with varying numbers of arguments and return them by Ptr.
Definition ptr.h:492
#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:133
#define NS_TEST_ASSERT_MSG_EQ_TOL(actual, limit, tol, msg)
Test that actual and expected (limit) values are equal to plus or minus some tolerance and report and...
Definition test.h:326
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition nstime.h:1313
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition nstime.h:1330
void UlDataRxStartNotificationArea(LteFrAreaTestCase *testcase, Ptr< const SpectrumValue > spectrumValue)
void UlDataRxStartNotification(LteFrTestCase *testcase, Ptr< const SpectrumValue > spectrumValue)
void DlDataRxStartNotification(LteFrTestCase *testcase, Ptr< const SpectrumValue > spectrumValue)
TestCase Data.
void DlDataRxStartNotificationArea(LteFrAreaTestCase *testcase, Ptr< const SpectrumValue > spectrumValue)
Every class exported by the ns3 library is enclosed in the ns3 namespace.
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
3GPP TS 36.413 9.2.1.18 GBR QoS Information
Definition eps-bearer.h:25
uint64_t gbrDl
Guaranteed Bit Rate (bit/s) in downlink.
Definition eps-bearer.h:31
uint64_t gbrUl
Guaranteed Bit Rate (bit/s) in uplink.
Definition eps-bearer.h:32
uint64_t mbrDl
Maximum Bit Rate (bit/s) in downlink.
Definition eps-bearer.h:33
uint64_t mbrUl
Maximum Bit Rate (bit/s) in uplink.
Definition eps-bearer.h:34