15#include "ns3/internet-module.h"
16#include "ns3/lte-helper.h"
17#include "ns3/mobility-helper.h"
18#include "ns3/packet-sink-helper.h"
19#include "ns3/point-to-point-epc-helper.h"
20#include "ns3/point-to-point-module.h"
21#include "ns3/udp-client-server-helper.h"
22#include <ns3/boolean.h>
23#include <ns3/callback.h>
24#include <ns3/config.h>
25#include <ns3/double.h>
27#include <ns3/ff-mac-scheduler.h>
29#include <ns3/lte-common.h>
30#include <ns3/lte-enb-net-device.h>
31#include <ns3/lte-enb-phy.h>
32#include <ns3/lte-enb-rrc.h>
33#include <ns3/lte-ue-net-device.h>
34#include <ns3/lte-ue-phy.h>
35#include <ns3/lte-ue-rrc.h>
36#include <ns3/pointer.h>
37#include <ns3/simulator.h>
38#include <ns3/string.h>
54 std::vector<bool> availableDlRb;
55 std::vector<bool> availableUlRb;
58 availableDlRb.push_back(
true);
59 availableUlRb.push_back(
true);
63 availableDlRb.push_back(
false);
64 availableUlRb.push_back(
false);
69 "ns3::PfFfMacScheduler",
78 TestCase::Duration::QUICK);
81 "ns3::PfFfMacScheduler",
90 TestCase::Duration::QUICK);
93 "ns3::PssFfMacScheduler",
102 TestCase::Duration::QUICK);
105 "ns3::PssFfMacScheduler",
114 TestCase::Duration::QUICK);
117 "ns3::CqaFfMacScheduler",
126 TestCase::Duration::QUICK);
129 "ns3::CqaFfMacScheduler",
138 TestCase::Duration::QUICK);
141 "ns3::FdTbfqFfMacScheduler",
150 TestCase::Duration::QUICK);
153 "ns3::FdTbfqFfMacScheduler",
162 TestCase::Duration::QUICK);
165 "ns3::TdTbfqFfMacScheduler",
174 TestCase::Duration::QUICK);
177 "ns3::TdTbfqFfMacScheduler",
186 TestCase::Duration::QUICK);
188 availableDlRb.clear();
189 availableUlRb.clear();
192 availableDlRb.push_back(
true);
193 availableUlRb.push_back(
true);
197 availableDlRb.push_back(
false);
198 availableUlRb.push_back(
false);
202 availableDlRb.push_back(
true);
203 availableUlRb.push_back(
true);
207 availableDlRb.push_back(
false);
208 availableUlRb.push_back(
false);
213 "ns3::PfFfMacScheduler",
224 TestCase::Duration::QUICK);
227 "ns3::PfFfMacScheduler",
238 TestCase::Duration::QUICK);
241 "ns3::PssFfMacScheduler",
252 TestCase::Duration::QUICK);
255 "ns3::PssFfMacScheduler",
266 TestCase::Duration::QUICK);
269 "ns3::CqaFfMacScheduler",
280 TestCase::Duration::QUICK);
283 "ns3::CqaFfMacScheduler",
294 TestCase::Duration::QUICK);
297 "ns3::FdTbfqFfMacScheduler",
308 TestCase::Duration::QUICK);
311 "ns3::FdTbfqFfMacScheduler",
322 TestCase::Duration::QUICK);
325 "ns3::TdTbfqFfMacScheduler",
336 TestCase::Duration::QUICK);
339 "ns3::TdTbfqFfMacScheduler",
350 TestCase::Duration::QUICK);
353 TestCase::Duration::QUICK);
356 TestCase::Duration::QUICK);
359 TestCase::Duration::QUICK);
362 TestCase::Duration::QUICK);
365 TestCase::Duration::QUICK);
368 TestCase::Duration::QUICK);
370 TestCase::Duration::QUICK);
372 TestCase::Duration::QUICK);
375 TestCase::Duration::QUICK);
378 TestCase::Duration::QUICK);
381 TestCase::Duration::QUICK);
383 TestCase::Duration::QUICK);
385 TestCase::Duration::QUICK);
388 TestCase::Duration::QUICK);
391 TestCase::Duration::QUICK);
395 TestCase::Duration::QUICK);
398 TestCase::Duration::QUICK);
401 TestCase::Duration::QUICK);
403 "ns3::FdTbfqFfMacScheduler"),
404 TestCase::Duration::QUICK);
406 "ns3::TdTbfqFfMacScheduler"),
407 TestCase::Duration::QUICK);
410 "ns3::PfFfMacScheduler"),
411 TestCase::Duration::QUICK);
413 "ns3::PssFfMacScheduler"),
414 TestCase::Duration::QUICK);
416 "ns3::CqaFfMacScheduler"),
417 TestCase::Duration::QUICK);
419 "ns3::FdTbfqFfMacScheduler"),
420 TestCase::Duration::QUICK);
422 "ns3::TdTbfqFfMacScheduler"),
423 TestCase::Duration::QUICK);
449 uint16_t dlBandwidth,
450 uint16_t ulBandwidth,
451 std::vector<bool> availableDlRb,
452 std::vector<bool> availableUlRb)
455 m_dlBandwidth(dlBandwidth),
456 m_ulBandwidth(ulBandwidth),
457 m_availableDlRb(availableDlRb),
458 m_usedMutedDlRbg(false),
459 m_availableUlRb(availableUlRb),
460 m_usedMutedUlRbg(false)
473 for (
auto it = spectrumValue->ConstValuesBegin(); it != spectrumValue->ConstValuesEnd(); it++)
492 for (
auto it = spectrumValue->ConstValuesBegin(); it != spectrumValue->ConstValuesEnd(); it++)
513 std::string schedulerType,
514 uint16_t dlBandwidth,
515 uint16_t ulBandwidth,
516 uint8_t dlSubBandOffset,
517 uint16_t dlSubBandwidth,
518 uint8_t ulSubBandOffset,
519 uint16_t ulSubBandwidth,
520 std::vector<bool> availableDlRb,
521 std::vector<bool> availableUlRb)
522 :
LteFrTestCase(name, userNum, dlBandwidth, ulBandwidth, availableDlRb, availableUlRb),
523 m_schedulerType(schedulerType),
524 m_dlSubBandOffset(dlSubBandOffset),
525 m_dlSubBandwidth(dlSubBandwidth),
526 m_ulSubBandOffset(ulSubBandOffset),
527 m_ulSubBandwidth(ulSubBandwidth)
549 lteHelper->SetFfrAlgorithmType(
"ns3::LteFrHardAlgorithm");
566 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
567 mobility.Install(allNodes);
573 enbDevs = lteHelper->InstallEnbDevice(enbNodes);
574 ueDevs = lteHelper->InstallUeDevice(ueNodes);
577 lteHelper->Attach(ueDevs, enbDevs.
Get(0));
591 lteHelper->ActivateDataRadioBearer(ueDevs, bearer);
597 ->GetDownlinkSpectrumPhy()
603 testDlSpectrumPhy->SetRxSpectrumModel(
605 dlChannel->AddRx(testDlSpectrumPhy);
607 testDlSpectrumPhy->TraceConnectWithoutContext(
615 ->GetUplinkSpectrumPhy()
620 testUlSpectrumPhy->SetRxSpectrumModel(
622 ulChannel->AddRx(testUlSpectrumPhy);
624 testUlSpectrumPhy->TraceConnectWithoutContext(
640 std::string schedulerType,
641 uint16_t dlBandwidth,
642 uint16_t ulBandwidth,
643 uint16_t dlCommonSubBandwidth,
644 uint8_t dlEdgeSubBandOffset,
645 uint16_t dlEdgeSubBandwidth,
646 uint16_t ulCommonSubBandwidth,
647 uint8_t ulEdgeSubBandOffset,
648 uint16_t ulEdgeSubBandwidth,
649 std::vector<bool> availableDlRb,
650 std::vector<bool> availableUlRb)
651 :
LteFrTestCase(name, userNum, dlBandwidth, ulBandwidth, availableDlRb, availableUlRb),
652 m_schedulerType(schedulerType),
653 m_dlCommonSubBandwidth(dlCommonSubBandwidth),
654 m_dlEdgeSubBandOffset(dlEdgeSubBandOffset),
655 m_dlEdgeSubBandwidth(dlEdgeSubBandwidth),
656 m_ulCommonSubBandwidth(ulCommonSubBandwidth),
657 m_ulEdgeSubBandOffset(ulEdgeSubBandOffset),
658 m_ulEdgeSubBandwidth(ulEdgeSubBandwidth)
680 lteHelper->SetFfrAlgorithmType(
"ns3::LteFrStrictAlgorithm");
682 lteHelper->SetFfrAlgorithmAttribute(
"DlCommonSubBandwidth",
684 lteHelper->SetFfrAlgorithmAttribute(
"DlEdgeSubBandOffset",
688 lteHelper->SetFfrAlgorithmAttribute(
"UlCommonSubBandwidth",
690 lteHelper->SetFfrAlgorithmAttribute(
"UlEdgeSubBandOffset",
703 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
704 mobility.Install(allNodes);
710 enbDevs = lteHelper->InstallEnbDevice(enbNodes);
711 ueDevs = lteHelper->InstallUeDevice(ueNodes);
714 lteHelper->Attach(ueDevs, enbDevs.
Get(0));
729 lteHelper->ActivateDataRadioBearer(ueDevs, bearer);
735 ->GetDownlinkSpectrumPhy()
741 testDlSpectrumPhy->SetRxSpectrumModel(
743 dlChannel->AddRx(testDlSpectrumPhy);
745 testDlSpectrumPhy->TraceConnectWithoutContext(
753 ->GetUplinkSpectrumPhy()
758 testUlSpectrumPhy->SetRxSpectrumModel(
760 ulChannel->AddRx(testUlSpectrumPhy);
762 testUlSpectrumPhy->TraceConnectWithoutContext(
790 m_schedulerType(schedulerType)
813 for (
auto it = spectrumValue->ConstValuesBegin(); it != spectrumValue->ConstValuesEnd(); it++)
831 "Wrong Data Channel DL Power level");
854 for (
auto it = spectrumValue->ConstValuesBegin(); it != spectrumValue->ConstValuesEnd(); it++)
863 NS_LOG_DEBUG(
"Total number of active RBs = " << numActiveRbs);
867 for (
auto it = spectrumValue->ConstValuesBegin(); it != spectrumValue->ConstValuesEnd(); it++)
869 double power = (*it) * (numActiveRbs * 180000);
881 "Wrong Data Channel UL Power level"
892 NS_LOG_DEBUG(
"Teleport UE to : (" << x <<
", " << y <<
", 0)");
900 double expectedPower,
901 std::vector<bool> expectedDlRb)
904 NS_LOG_DEBUG(
"Teleport UE to : (" << x <<
", " << y <<
", 0)");
915 double expectedPower,
916 std::vector<bool> expectedDlRb)
919 NS_LOG_DEBUG(
"Teleport UE to : (" << x <<
", " << y <<
", 0)");
922 ueMobility->SetPosition(Vector(x, y, 0.0));
969 double eNbTxPower = 30;
999 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
1000 positionAlloc->Add(Vector(1000, 0.0, 0.0));
1001 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
1002 positionAlloc->Add(Vector(1020, 0.0, 0.0));
1004 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
1005 mobility.SetPositionAllocator(positionAlloc);
1006 mobility.Install(allNodes);
1019 lteHelper->SetFfrAlgorithmType(
"ns3::LteFrStrictAlgorithm");
1020 lteHelper->SetFfrAlgorithmAttribute(
"RsrqThreshold",
UintegerValue(25));
1021 lteHelper->SetFfrAlgorithmAttribute(
"CenterPowerOffset",
1023 lteHelper->SetFfrAlgorithmAttribute(
"EdgePowerOffset",
1026 lteHelper->SetFfrAlgorithmAttribute(
"DlCommonSubBandwidth",
UintegerValue(6));
1027 lteHelper->SetFfrAlgorithmAttribute(
"DlEdgeSubBandOffset",
UintegerValue(6));
1028 lteHelper->SetFfrAlgorithmAttribute(
"DlEdgeSubBandwidth",
UintegerValue(6));
1030 lteHelper->SetFfrAlgorithmAttribute(
"UlCommonSubBandwidth",
UintegerValue(6));
1031 lteHelper->SetFfrAlgorithmAttribute(
"UlEdgeSubBandOffset",
UintegerValue(6));
1032 lteHelper->SetFfrAlgorithmAttribute(
"UlEdgeSubBandwidth",
UintegerValue(6));
1033 enbDevs.
Add(lteHelper->InstallEnbDevice(enbNodes.
Get(0)));
1035 lteHelper->SetFfrAlgorithmType(
"ns3::LteFrNoOpAlgorithm");
1036 enbDevs.
Add(lteHelper->InstallEnbDevice(enbNodes.
Get(1)));
1038 ueDevs1 = lteHelper->InstallUeDevice(ueNodes1);
1039 ueDevs2 = lteHelper->InstallUeDevice(ueNodes2);
1042 lteHelper->Attach(ueDevs1, enbDevs.
Get(0));
1043 lteHelper->Attach(ueDevs2, enbDevs.
Get(1));
1058 lteHelper->ActivateDataRadioBearer(ueDevs1, bearer);
1059 lteHelper->ActivateDataRadioBearer(ueDevs2, bearer);
1065 ->GetDownlinkSpectrumPhy()
1071 testDlSpectrumPhy->SetRxSpectrumModel(
1073 dlChannel->AddRx(testDlSpectrumPhy);
1075 testDlSpectrumPhy->SetCellId(1);
1077 testDlSpectrumPhy->TraceConnectWithoutContext(
1085 ->GetUplinkSpectrumPhy()
1090 testUlSpectrumPhy->SetRxSpectrumModel(
1092 ulChannel->AddRx(testUlSpectrumPhy);
1094 testUlSpectrumPhy->SetCellId(1);
1096 testUlSpectrumPhy->TraceConnectWithoutContext(
1100 std::vector<bool> expectedDlRbCenterArea;
1102 std::vector<bool> expectedUlRbCenterArea;
1106 expectedDlRbCenterArea[i] =
true;
1107 expectedUlRbCenterArea[i] =
true;
1110 std::vector<bool> expectedDlRbEdgeArea;
1112 std::vector<bool> expectedUlRbEdgeArea;
1116 expectedDlRbEdgeArea[i] =
true;
1117 expectedUlRbEdgeArea[i] =
true;
1126 expectedDlRbCenterArea);
1131 expectedUlRbCenterArea);
1139 expectedDlRbEdgeArea);
1144 expectedUlRbEdgeArea);
1152 expectedDlRbCenterArea);
1157 expectedUlRbCenterArea);
1188 double eNbTxPower = 30;
1218 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
1219 positionAlloc->Add(Vector(1000, 0.0, 0.0));
1220 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
1221 positionAlloc->Add(Vector(1020, 0.0, 0.0));
1223 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
1224 mobility.SetPositionAllocator(positionAlloc);
1225 mobility.Install(allNodes);
1238 lteHelper->SetFfrAlgorithmType(
"ns3::LteFrSoftAlgorithm");
1239 lteHelper->SetFfrAlgorithmAttribute(
"AllowCenterUeUseEdgeSubBand",
BooleanValue(
false));
1240 lteHelper->SetFfrAlgorithmAttribute(
"RsrqThreshold",
UintegerValue(25));
1241 lteHelper->SetFfrAlgorithmAttribute(
"CenterPowerOffset",
1243 lteHelper->SetFfrAlgorithmAttribute(
"EdgePowerOffset",
1246 lteHelper->SetFfrAlgorithmAttribute(
"DlEdgeSubBandOffset",
UintegerValue(8));
1247 lteHelper->SetFfrAlgorithmAttribute(
"DlEdgeSubBandwidth",
UintegerValue(8));
1248 lteHelper->SetFfrAlgorithmAttribute(
"UlEdgeSubBandOffset",
UintegerValue(8));
1249 lteHelper->SetFfrAlgorithmAttribute(
"UlEdgeSubBandwidth",
UintegerValue(8));
1250 enbDevs.
Add(lteHelper->InstallEnbDevice(enbNodes.
Get(0)));
1252 lteHelper->SetFfrAlgorithmType(
"ns3::LteFrNoOpAlgorithm");
1253 enbDevs.
Add(lteHelper->InstallEnbDevice(enbNodes.
Get(1)));
1255 ueDevs1 = lteHelper->InstallUeDevice(ueNodes1);
1256 ueDevs2 = lteHelper->InstallUeDevice(ueNodes2);
1259 lteHelper->Attach(ueDevs1, enbDevs.
Get(0));
1260 lteHelper->Attach(ueDevs2, enbDevs.
Get(1));
1274 lteHelper->ActivateDataRadioBearer(ueDevs1, bearer);
1275 lteHelper->ActivateDataRadioBearer(ueDevs2, bearer);
1281 ->GetDownlinkSpectrumPhy()
1287 testDlSpectrumPhy->SetRxSpectrumModel(
1289 dlChannel->AddRx(testDlSpectrumPhy);
1291 testDlSpectrumPhy->SetCellId(1);
1293 testDlSpectrumPhy->TraceConnectWithoutContext(
1301 ->GetUplinkSpectrumPhy()
1306 testUlSpectrumPhy->SetRxSpectrumModel(
1308 ulChannel->AddRx(testUlSpectrumPhy);
1310 testUlSpectrumPhy->SetCellId(1);
1312 testUlSpectrumPhy->TraceConnectWithoutContext(
1316 std::vector<bool> expectedDlRbCenterArea;
1318 std::vector<bool> expectedUlRbCenterArea;
1322 expectedDlRbCenterArea[i] =
true;
1323 expectedUlRbCenterArea[i] =
true;
1327 expectedDlRbCenterArea[i] =
true;
1330 std::vector<bool> expectedDlRbEdgeArea;
1332 std::vector<bool> expectedUlRbEdgeArea;
1336 expectedDlRbEdgeArea[i] =
true;
1337 expectedUlRbEdgeArea[i] =
true;
1346 expectedDlRbCenterArea);
1351 expectedUlRbCenterArea);
1359 expectedDlRbEdgeArea);
1364 expectedUlRbEdgeArea);
1372 expectedDlRbCenterArea);
1377 expectedUlRbCenterArea);
1384 "Scheduler used DL RBG muted by FFR Algorithm");
1412 double eNbTxPower = 30;
1442 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
1443 positionAlloc->Add(Vector(1000, 0.0, 0.0));
1444 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
1445 positionAlloc->Add(Vector(1020, 0.0, 0.0));
1447 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
1448 mobility.SetPositionAllocator(positionAlloc);
1449 mobility.Install(allNodes);
1462 lteHelper->SetFfrAlgorithmType(
"ns3::LteFfrSoftAlgorithm");
1463 lteHelper->SetFfrAlgorithmAttribute(
"CenterRsrqThreshold",
UintegerValue(28));
1464 lteHelper->SetFfrAlgorithmAttribute(
"EdgeRsrqThreshold",
UintegerValue(18));
1465 lteHelper->SetFfrAlgorithmAttribute(
"CenterAreaPowerOffset",
1467 lteHelper->SetFfrAlgorithmAttribute(
"MediumAreaPowerOffset",
1469 lteHelper->SetFfrAlgorithmAttribute(
"EdgeAreaPowerOffset",
1472 lteHelper->SetFfrAlgorithmAttribute(
"UlCommonSubBandwidth",
UintegerValue(6));
1473 lteHelper->SetFfrAlgorithmAttribute(
"DlCommonSubBandwidth",
UintegerValue(6));
1475 lteHelper->SetFfrAlgorithmAttribute(
"DlEdgeSubBandOffset",
UintegerValue(6));
1476 lteHelper->SetFfrAlgorithmAttribute(
"DlEdgeSubBandwidth",
UintegerValue(6));
1477 lteHelper->SetFfrAlgorithmAttribute(
"UlEdgeSubBandOffset",
UintegerValue(6));
1478 lteHelper->SetFfrAlgorithmAttribute(
"UlEdgeSubBandwidth",
UintegerValue(6));
1479 enbDevs.
Add(lteHelper->InstallEnbDevice(enbNodes.
Get(0)));
1481 lteHelper->SetFfrAlgorithmType(
"ns3::LteFrNoOpAlgorithm");
1482 enbDevs.
Add(lteHelper->InstallEnbDevice(enbNodes.
Get(1)));
1484 ueDevs1 = lteHelper->InstallUeDevice(ueNodes1);
1485 ueDevs2 = lteHelper->InstallUeDevice(ueNodes2);
1488 lteHelper->Attach(ueDevs1, enbDevs.
Get(0));
1489 lteHelper->Attach(ueDevs2, enbDevs.
Get(1));
1503 lteHelper->ActivateDataRadioBearer(ueDevs1, bearer);
1504 lteHelper->ActivateDataRadioBearer(ueDevs2, bearer);
1510 ->GetDownlinkSpectrumPhy()
1516 testDlSpectrumPhy->SetRxSpectrumModel(
1518 dlChannel->AddRx(testDlSpectrumPhy);
1520 testDlSpectrumPhy->SetCellId(1);
1522 testDlSpectrumPhy->TraceConnectWithoutContext(
1530 ->GetUplinkSpectrumPhy()
1535 testUlSpectrumPhy->SetRxSpectrumModel(
1537 ulChannel->AddRx(testUlSpectrumPhy);
1539 testUlSpectrumPhy->SetCellId(1);
1541 testUlSpectrumPhy->TraceConnectWithoutContext(
1545 double expectedDlPowerCenterArea = 0.5;
1546 std::vector<bool> expectedDlRbCenterArea;
1548 std::vector<bool> expectedUlRbCenterArea;
1552 expectedDlRbCenterArea[i] =
true;
1553 expectedUlRbCenterArea[i] =
true;
1557 expectedDlRbCenterArea[i] =
true;
1558 expectedUlRbCenterArea[i] =
true;
1561 double expectedDlPowerMiddleArea = 1.0;
1562 std::vector<bool> expectedDlRbMiddleArea;
1564 std::vector<bool> expectedUlRbMiddleArea;
1568 expectedDlRbMiddleArea[i] =
true;
1569 expectedUlRbMiddleArea[i] =
true;
1572 double expectedDlPowerEdgeArea = 2.0;
1573 std::vector<bool> expectedDlRbEdgeArea;
1575 std::vector<bool> expectedUlRbEdgeArea;
1579 expectedDlRbEdgeArea[i] =
true;
1580 expectedUlRbEdgeArea[i] =
true;
1588 expectedDlPowerCenterArea,
1589 expectedDlRbCenterArea);
1594 expectedUlRbCenterArea);
1601 expectedDlPowerMiddleArea,
1602 expectedDlRbMiddleArea);
1607 expectedUlRbMiddleArea);
1614 expectedDlPowerEdgeArea,
1615 expectedDlRbEdgeArea);
1620 expectedUlRbEdgeArea);
1627 expectedDlPowerMiddleArea,
1628 expectedDlRbMiddleArea);
1633 expectedUlRbMiddleArea);
1640 expectedDlPowerCenterArea,
1641 expectedDlRbCenterArea);
1646 expectedUlRbCenterArea);
1661 NS_LOG_INFO(
"Creating LteEnhancedFfrAreaTestCase");
1679 double eNbTxPower = 30;
1709 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
1710 positionAlloc->Add(Vector(1000, 0.0, 0.0));
1711 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
1712 positionAlloc->Add(Vector(1020, 0.0, 0.0));
1714 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
1715 mobility.SetPositionAllocator(positionAlloc);
1716 mobility.Install(allNodes);
1728 lteHelper->SetSchedulerAttribute(
"HarqEnabled",
BooleanValue(
true));
1733 lteHelper->SetFfrAlgorithmType(
"ns3::LteFfrEnhancedAlgorithm");
1734 lteHelper->SetFfrAlgorithmAttribute(
"RsrqThreshold",
UintegerValue(25));
1735 lteHelper->SetFfrAlgorithmAttribute(
"DlCqiThreshold",
UintegerValue(10));
1736 lteHelper->SetFfrAlgorithmAttribute(
"UlCqiThreshold",
UintegerValue(15));
1737 lteHelper->SetFfrAlgorithmAttribute(
"CenterAreaPowerOffset",
1739 lteHelper->SetFfrAlgorithmAttribute(
"EdgeAreaPowerOffset",
1742 lteHelper->SetFfrAlgorithmAttribute(
"UlSubBandOffset",
UintegerValue(0));
1743 lteHelper->SetFfrAlgorithmAttribute(
"UlReuse3SubBandwidth",
UintegerValue(4));
1744 lteHelper->SetFfrAlgorithmAttribute(
"UlReuse1SubBandwidth",
UintegerValue(4));
1746 lteHelper->SetFfrAlgorithmAttribute(
"DlSubBandOffset",
UintegerValue(0));
1747 lteHelper->SetFfrAlgorithmAttribute(
"DlReuse3SubBandwidth",
UintegerValue(4));
1748 lteHelper->SetFfrAlgorithmAttribute(
"DlReuse1SubBandwidth",
UintegerValue(4));
1750 enbDevs.
Add(lteHelper->InstallEnbDevice(enbNodes.
Get(0)));
1752 lteHelper->SetFfrAlgorithmType(
"ns3::LteFrNoOpAlgorithm");
1753 enbDevs.
Add(lteHelper->InstallEnbDevice(enbNodes.
Get(1)));
1755 ueDevs1 = lteHelper->InstallUeDevice(ueNodes1);
1756 ueDevs2 = lteHelper->InstallUeDevice(ueNodes2);
1759 lteHelper->Attach(ueDevs1, enbDevs.
Get(0));
1760 lteHelper->Attach(ueDevs2, enbDevs.
Get(1));
1774 lteHelper->ActivateDataRadioBearer(ueDevs1, bearer);
1775 lteHelper->ActivateDataRadioBearer(ueDevs2, bearer);
1781 ->GetDownlinkSpectrumPhy()
1787 testDlSpectrumPhy->SetRxSpectrumModel(
1789 dlChannel->AddRx(testDlSpectrumPhy);
1791 testDlSpectrumPhy->SetCellId(1);
1793 testDlSpectrumPhy->TraceConnectWithoutContext(
1801 ->GetUplinkSpectrumPhy()
1806 testUlSpectrumPhy->SetRxSpectrumModel(
1808 ulChannel->AddRx(testUlSpectrumPhy);
1810 testUlSpectrumPhy->SetCellId(1);
1812 testUlSpectrumPhy->TraceConnectWithoutContext(
1816 double expectedDlPowerCenterArea = 0.251189;
1817 std::vector<bool> expectedDlRbCenterArea;
1819 std::vector<bool> expectedUlRbCenterArea;
1823 expectedDlRbCenterArea[i] =
true;
1824 expectedUlRbCenterArea[i] =
true;
1828 expectedDlRbCenterArea[i] =
true;
1829 expectedUlRbCenterArea[i] =
true;
1833 expectedDlRbCenterArea[i] =
true;
1834 expectedUlRbCenterArea[i] =
true;
1837 double expectedDlPowerMiddleArea = 0.251189;
1838 std::vector<bool> expectedDlRbMiddleArea;
1840 std::vector<bool> expectedUlRbMiddleArea;
1844 expectedDlRbMiddleArea[i] =
true;
1845 expectedUlRbMiddleArea[i] =
true;
1848 double expectedDlPowerEdgeArea = 1.0;
1849 std::vector<bool> expectedDlRbEdgeArea;
1851 std::vector<bool> expectedUlRbEdgeArea;
1855 expectedDlRbEdgeArea[i] =
true;
1856 expectedUlRbEdgeArea[i] =
true;
1864 expectedDlPowerCenterArea,
1865 expectedDlRbCenterArea);
1870 expectedUlRbCenterArea);
1877 expectedDlPowerMiddleArea,
1878 expectedDlRbMiddleArea);
1883 expectedUlRbMiddleArea);
1890 expectedDlPowerEdgeArea,
1891 expectedDlRbEdgeArea);
1896 expectedUlRbEdgeArea);
1903 expectedDlPowerCenterArea,
1904 expectedDlRbCenterArea);
1909 expectedUlRbCenterArea);
1916 expectedDlPowerMiddleArea,
1917 expectedDlRbMiddleArea);
1922 expectedUlRbCenterArea);
1935 std::string schedulerType)
1938 NS_LOG_INFO(
"Creating LteDistributedFfrAreaTestCase");
1956 double eNbTxPower = 30;
1968 uint16_t bandwidth = 25;
1972 lteHelper->SetEpcHelper(epcHelper);
1973 lteHelper->SetHandoverAlgorithmType(
"ns3::NoOpHandoverAlgorithm");
1975 Ptr<Node> pgw = epcHelper->GetPgwNode();
1979 remoteHostContainer.
Create(1);
1982 internet.Install(remoteHostContainer);
1991 ipv4h.
SetBase(
"1.0.0.0",
"255.0.0.0");
2000 remoteHostStaticRouting->AddNetworkRouteTo(
Ipv4Address(
"7.0.0.0"),
Ipv4Mask(
"255.0.0.0"), 1);
2024 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
2025 positionAlloc->Add(Vector(1000, 0.0, 0.0));
2027 positionAlloc->Add(Vector(200, 0.0, 0.0));
2028 positionAlloc->Add(Vector(200, 0.0, 0.0));
2029 positionAlloc->Add(Vector(800, 0.0, 0.0));
2032 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
2033 mobility.SetPositionAllocator(positionAlloc);
2034 mobility.Install(allNodes);
2043 lteHelper->SetEnbDeviceAttribute(
"DlBandwidth",
UintegerValue(bandwidth));
2044 lteHelper->SetEnbDeviceAttribute(
"UlBandwidth",
UintegerValue(bandwidth));
2046 lteHelper->SetFfrAlgorithmType(
"ns3::LteFfrDistributedAlgorithm");
2048 lteHelper->SetFfrAlgorithmAttribute(
"RsrqThreshold",
UintegerValue(25));
2049 lteHelper->SetFfrAlgorithmAttribute(
"RsrpDifferenceThreshold",
UintegerValue(5));
2050 lteHelper->SetFfrAlgorithmAttribute(
"EdgeRbNum",
UintegerValue(6));
2051 lteHelper->SetFfrAlgorithmAttribute(
"CenterPowerOffset",
2053 lteHelper->SetFfrAlgorithmAttribute(
"EdgePowerOffset",
2056 enbDevs = lteHelper->InstallEnbDevice(enbNodes);
2057 ueDevs1 = lteHelper->InstallUeDevice(ueNodes1);
2058 ueDevs2 = lteHelper->InstallUeDevice(ueNodes2);
2061 ueLteDevs.
Add(ueDevs1);
2062 ueLteDevs.
Add(ueDevs2);
2065 lteHelper->AddX2Interface(enbNodes);
2068 internet.Install(ueNodes);
2078 ueStaticRouting->SetDefaultRoute(epcHelper->GetUeDefaultGatewayAddress(), 1);
2082 lteHelper->Attach(ueDevs1, enbDevs.
Get(0));
2083 lteHelper->Attach(ueDevs2, enbDevs.
Get(1));
2086 uint16_t dlPort = 10000;
2087 uint16_t ulPort = 20000;
2093 startTimeSeconds->SetAttribute(
"Min",
DoubleValue(0));
2094 startTimeSeconds->SetAttribute(
"Max",
DoubleValue(0.010));
2102 ueStaticRouting->SetDefaultRoute(epcHelper->GetUeDefaultGatewayAddress(), 1);
2116 clientApps.Add(dlClientHelper.
Install(remoteHost));
2119 serverApps.Add(dlPacketSinkHelper.
Install(ue));
2125 clientApps.Add(ulClientHelper.
Install(ue));
2128 serverApps.Add(ulPacketSinkHelper.
Install(remoteHost));
2150 lteHelper->ActivateDedicatedEpsBearer(ueLteDevs.
Get(u), bearer, tft);
2152 Time startTime =
Seconds(startTimeSeconds->GetValue());
2153 serverApps.Start(startTime);
2154 clientApps.Start(startTime);
2162 ->GetDownlinkSpectrumPhy()
2168 testDlSpectrumPhy->SetRxSpectrumModel(
2170 dlChannel->AddRx(testDlSpectrumPhy);
2172 testDlSpectrumPhy->SetCellId(2);
2174 testDlSpectrumPhy->TraceConnectWithoutContext(
2182 ->GetUplinkSpectrumPhy()
2187 testUlSpectrumPhy->SetRxSpectrumModel(
2189 ulChannel->AddRx(testUlSpectrumPhy);
2191 testUlSpectrumPhy->SetCellId(2);
2193 testUlSpectrumPhy->TraceConnectWithoutContext(
2197 double expectedDlPowerCenterArea = 1.0;
2198 std::vector<bool> expectedDlRbCenterArea;
2200 std::vector<bool> expectedUlRbCenterArea;
2204 expectedDlRbCenterArea[i] =
true;
2205 expectedUlRbCenterArea[i] =
true;
2208 double expectedDlPowerEdgeArea = 2.0;
2209 std::vector<bool> expectedDlRbEdgeArea;
2211 std::vector<bool> expectedUlRbEdgeArea;
2215 expectedDlRbEdgeArea[i] =
true;
2216 expectedUlRbEdgeArea[i] =
true;
2219 std::vector<bool> expectedDlRbEdgeArea2;
2221 std::vector<bool> expectedUlRbEdgeArea2;
2225 expectedDlRbEdgeArea2[i] =
true;
2226 expectedUlRbEdgeArea2[i] =
true;
2234 expectedDlPowerCenterArea,
2235 expectedDlRbCenterArea);
2240 expectedUlRbCenterArea);
2247 expectedDlPowerEdgeArea,
2248 expectedDlRbEdgeArea);
2253 expectedUlRbEdgeArea);
2261 expectedDlPowerEdgeArea,
2262 expectedDlRbEdgeArea2);
2267 expectedUlRbEdgeArea2);
2275 expectedDlPowerEdgeArea,
2276 expectedDlRbEdgeArea);
2281 expectedUlRbEdgeArea);
2288 expectedDlPowerCenterArea,
2289 expectedDlRbCenterArea);
2294 expectedUlRbCenterArea);
2301 "Scheduler used DL RBG muted by FFR Algorithm");
Lte Distributed Ffr Area Test Case.
~LteDistributedFfrAreaTestCase() override
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() override
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
~LteFrAreaTestCase() override
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.
~LteFrTestCase() override
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.
LteFrequencyReuseTestSuite()
TestSuite.
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
~LteHardFrTestCase() override
std::string m_schedulerType
the scheduler type
Lte Soft Ffr Area Test Case.
void DoRun() override
Implementation to actually run this TestCase.
~LteSoftFfrAreaTestCase() override
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.
~LteSoftFrAreaTestCase() override
void DoRun() override
Implementation to actually run this TestCase.
LteStrictFrAreaTestCase(std::string name, std::string schedulerType)
Constructor.
~LteStrictFrAreaTestCase() override
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.
~LteStrictFrTestCase() override
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.
This class can be used to hold variables of floating point type such as 'double' or 'float'.
This class contains the specification of EPS Bearers.
@ GBR_CONV_VOICE
GBR Conversational Voice.
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.
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.
A helper to make it easier to instantiate an ns3::PacketSinkApplication on a set of nodes.
Build a set of PointToPointNetDevice objects.
void SetDeviceAttribute(std::string name, const AttributeValue &value)
Set an attribute value to be propagated to each NetDevice created by the helper.
void SetChannelAttribute(std::string name, const AttributeValue &value)
Set an attribute value to be propagated to each Channel created by the helper.
NetDeviceContainer Install(NodeContainer c)
Smart pointer class similar to boost::intrusive_ptr.
static EventId Schedule(const Time &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
static void Destroy()
Execute the events scheduled with ScheduleDestroy().
static Time Now()
Return the current simulation virtual time.
static void Run()
Run the simulation.
static void Stop()
Tell the Simulator the calling event should be the last one executed.
void AddTestCase(TestCase *testCase, Duration duration=Duration::QUICK)
Add an individual child TestCase to this test suite.
Simulation virtual time values and global simulation resolution.
Create a client application which sends UDP packets carrying a 32bit sequence number and a 64 bit tim...
Hold an unsigned integer type.
void Reset()
Reset the initial value of every attribute as well as the value of every global to what they were bef...
void SetDefault(std::string name, const AttributeValue &value)
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
#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.
static LteFrequencyReuseTestSuite lteFrequencyReuseTestSuite
Static variable for test initialization.
auto MakeBoundCallback(R(*fnPtr)(Args...), BArgs &&... bargs)
Make Callbacks with varying number of bound arguments.
Ptr< T > CreateObject(Args &&... args)
Create an object by type, with varying number of constructor parameters.
Ptr< T > Create(Ts &&... args)
Create class instances by constructors with varying numbers of arguments and return them by Ptr.
#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.
#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...
Time Seconds(double value)
Construct a Time in the indicated unit.
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
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.
uint16_t localPortEnd
end of the port number range of the UE
uint16_t remotePortEnd
end of the port number range of the remote host
uint16_t remotePortStart
start of the port number range of the remote host
uint16_t localPortStart
start of the port number range of the UE