26#include "ns3/internet-module.h"
27#include "ns3/lte-helper.h"
28#include "ns3/mobility-helper.h"
29#include "ns3/packet-sink-helper.h"
30#include "ns3/point-to-point-epc-helper.h"
31#include "ns3/point-to-point-module.h"
32#include "ns3/udp-client-server-helper.h"
33#include <ns3/boolean.h>
34#include <ns3/callback.h>
35#include <ns3/config.h>
36#include <ns3/double.h>
38#include <ns3/ff-mac-scheduler.h>
40#include <ns3/lte-common.h>
41#include <ns3/lte-enb-net-device.h>
42#include <ns3/lte-enb-phy.h>
43#include <ns3/lte-enb-rrc.h>
44#include <ns3/lte-ue-net-device.h>
45#include <ns3/lte-ue-phy.h>
46#include <ns3/lte-ue-rrc.h>
47#include <ns3/pointer.h>
48#include <ns3/simulator.h>
49#include <ns3/string.h>
60 :
TestSuite(
"lte-frequency-reuse", SYSTEM)
65 std::vector<bool> availableDlRb;
66 std::vector<bool> availableUlRb;
69 availableDlRb.push_back(
true);
70 availableUlRb.push_back(
true);
74 availableDlRb.push_back(
false);
75 availableUlRb.push_back(
false);
80 "ns3::PfFfMacScheduler",
92 "ns3::PfFfMacScheduler",
104 "ns3::PssFfMacScheduler",
116 "ns3::PssFfMacScheduler",
128 "ns3::CqaFfMacScheduler",
140 "ns3::CqaFfMacScheduler",
152 "ns3::FdTbfqFfMacScheduler",
164 "ns3::FdTbfqFfMacScheduler",
176 "ns3::TdTbfqFfMacScheduler",
188 "ns3::TdTbfqFfMacScheduler",
199 availableDlRb.clear();
200 availableUlRb.clear();
203 availableDlRb.push_back(
true);
204 availableUlRb.push_back(
true);
208 availableDlRb.push_back(
false);
209 availableUlRb.push_back(
false);
213 availableDlRb.push_back(
true);
214 availableUlRb.push_back(
true);
218 availableDlRb.push_back(
false);
219 availableUlRb.push_back(
false);
224 "ns3::PfFfMacScheduler",
238 "ns3::PfFfMacScheduler",
252 "ns3::PssFfMacScheduler",
266 "ns3::PssFfMacScheduler",
280 "ns3::CqaFfMacScheduler",
294 "ns3::CqaFfMacScheduler",
308 "ns3::FdTbfqFfMacScheduler",
322 "ns3::FdTbfqFfMacScheduler",
336 "ns3::TdTbfqFfMacScheduler",
350 "ns3::TdTbfqFfMacScheduler",
414 "ns3::FdTbfqFfMacScheduler"),
417 "ns3::TdTbfqFfMacScheduler"),
421 "ns3::PfFfMacScheduler"),
424 "ns3::PssFfMacScheduler"),
427 "ns3::CqaFfMacScheduler"),
430 "ns3::FdTbfqFfMacScheduler"),
433 "ns3::TdTbfqFfMacScheduler"),
460 uint16_t dlBandwidth,
461 uint16_t ulBandwidth,
462 std::vector<bool> availableDlRb,
463 std::vector<bool> availableUlRb)
466 m_dlBandwidth(dlBandwidth),
467 m_ulBandwidth(ulBandwidth),
468 m_availableDlRb(availableDlRb),
469 m_usedMutedDlRbg(false),
470 m_availableUlRb(availableUlRb),
471 m_usedMutedUlRbg(false)
484 for (
auto it = spectrumValue->ConstValuesBegin(); it != spectrumValue->ConstValuesEnd(); it++)
503 for (
auto it = spectrumValue->ConstValuesBegin(); it != spectrumValue->ConstValuesEnd(); it++)
524 std::string schedulerType,
525 uint16_t dlBandwidth,
526 uint16_t ulBandwidth,
527 uint8_t dlSubBandOffset,
528 uint16_t dlSubBandwidth,
529 uint8_t ulSubBandOffset,
530 uint16_t ulSubBandwidth,
531 std::vector<bool> availableDlRb,
532 std::vector<bool> availableUlRb)
533 :
LteFrTestCase(name, userNum, dlBandwidth, ulBandwidth, availableDlRb, availableUlRb),
534 m_schedulerType(schedulerType),
535 m_dlSubBandOffset(dlSubBandOffset),
536 m_dlSubBandwidth(dlSubBandwidth),
537 m_ulSubBandOffset(ulSubBandOffset),
538 m_ulSubBandwidth(ulSubBandwidth)
560 lteHelper->SetFfrAlgorithmType(
"ns3::LteFrHardAlgorithm");
577 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
578 mobility.Install(allNodes);
584 enbDevs = lteHelper->InstallEnbDevice(enbNodes);
585 ueDevs = lteHelper->InstallUeDevice(ueNodes);
588 lteHelper->Attach(ueDevs, enbDevs.
Get(0));
602 lteHelper->ActivateDataRadioBearer(ueDevs, bearer);
608 ->GetDownlinkSpectrumPhy()
614 testDlSpectrumPhy->SetRxSpectrumModel(
616 dlChannel->AddRx(testDlSpectrumPhy);
618 testDlSpectrumPhy->TraceConnectWithoutContext(
626 ->GetUplinkSpectrumPhy()
631 testUlSpectrumPhy->SetRxSpectrumModel(
633 ulChannel->AddRx(testUlSpectrumPhy);
635 testUlSpectrumPhy->TraceConnectWithoutContext(
651 std::string schedulerType,
652 uint16_t dlBandwidth,
653 uint16_t ulBandwidth,
654 uint16_t dlCommonSubBandwidth,
655 uint8_t dlEdgeSubBandOffset,
656 uint16_t dlEdgeSubBandwidth,
657 uint16_t ulCommonSubBandwidth,
658 uint8_t ulEdgeSubBandOffset,
659 uint16_t ulEdgeSubBandwidth,
660 std::vector<bool> availableDlRb,
661 std::vector<bool> availableUlRb)
662 :
LteFrTestCase(name, userNum, dlBandwidth, ulBandwidth, availableDlRb, availableUlRb),
663 m_schedulerType(schedulerType),
664 m_dlCommonSubBandwidth(dlCommonSubBandwidth),
665 m_dlEdgeSubBandOffset(dlEdgeSubBandOffset),
666 m_dlEdgeSubBandwidth(dlEdgeSubBandwidth),
667 m_ulCommonSubBandwidth(ulCommonSubBandwidth),
668 m_ulEdgeSubBandOffset(ulEdgeSubBandOffset),
669 m_ulEdgeSubBandwidth(ulEdgeSubBandwidth)
691 lteHelper->SetFfrAlgorithmType(
"ns3::LteFrStrictAlgorithm");
693 lteHelper->SetFfrAlgorithmAttribute(
"DlCommonSubBandwidth",
695 lteHelper->SetFfrAlgorithmAttribute(
"DlEdgeSubBandOffset",
699 lteHelper->SetFfrAlgorithmAttribute(
"UlCommonSubBandwidth",
701 lteHelper->SetFfrAlgorithmAttribute(
"UlEdgeSubBandOffset",
714 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
715 mobility.Install(allNodes);
721 enbDevs = lteHelper->InstallEnbDevice(enbNodes);
722 ueDevs = lteHelper->InstallUeDevice(ueNodes);
725 lteHelper->Attach(ueDevs, enbDevs.
Get(0));
740 lteHelper->ActivateDataRadioBearer(ueDevs, bearer);
746 ->GetDownlinkSpectrumPhy()
752 testDlSpectrumPhy->SetRxSpectrumModel(
754 dlChannel->AddRx(testDlSpectrumPhy);
756 testDlSpectrumPhy->TraceConnectWithoutContext(
764 ->GetUplinkSpectrumPhy()
769 testUlSpectrumPhy->SetRxSpectrumModel(
771 ulChannel->AddRx(testUlSpectrumPhy);
773 testUlSpectrumPhy->TraceConnectWithoutContext(
801 m_schedulerType(schedulerType)
824 for (
auto it = spectrumValue->ConstValuesBegin(); it != spectrumValue->ConstValuesEnd(); it++)
842 "Wrong Data Channel DL Power level");
865 for (
auto it = spectrumValue->ConstValuesBegin(); it != spectrumValue->ConstValuesEnd(); it++)
874 NS_LOG_DEBUG(
"Total number of active RBs = " << numActiveRbs);
878 for (
auto it = spectrumValue->ConstValuesBegin(); it != spectrumValue->ConstValuesEnd(); it++)
880 double power = (*it) * (numActiveRbs * 180000);
892 "Wrong Data Channel UL Power level"
903 NS_LOG_DEBUG(
"Teleport UE to : (" << x <<
", " << y <<
", 0)");
911 double expectedPower,
912 std::vector<bool> expectedDlRb)
915 NS_LOG_DEBUG(
"Teleport UE to : (" << x <<
", " << y <<
", 0)");
926 double expectedPower,
927 std::vector<bool> expectedDlRb)
930 NS_LOG_DEBUG(
"Teleport UE to : (" << x <<
", " << y <<
", 0)");
933 ueMobility->SetPosition(Vector(x, y, 0.0));
980 double eNbTxPower = 30;
1010 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
1011 positionAlloc->Add(Vector(1000, 0.0, 0.0));
1012 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
1013 positionAlloc->Add(Vector(1020, 0.0, 0.0));
1015 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
1016 mobility.SetPositionAllocator(positionAlloc);
1017 mobility.Install(allNodes);
1030 lteHelper->SetFfrAlgorithmType(
"ns3::LteFrStrictAlgorithm");
1031 lteHelper->SetFfrAlgorithmAttribute(
"RsrqThreshold",
UintegerValue(25));
1032 lteHelper->SetFfrAlgorithmAttribute(
"CenterPowerOffset",
1034 lteHelper->SetFfrAlgorithmAttribute(
"EdgePowerOffset",
1037 lteHelper->SetFfrAlgorithmAttribute(
"DlCommonSubBandwidth",
UintegerValue(6));
1038 lteHelper->SetFfrAlgorithmAttribute(
"DlEdgeSubBandOffset",
UintegerValue(6));
1039 lteHelper->SetFfrAlgorithmAttribute(
"DlEdgeSubBandwidth",
UintegerValue(6));
1041 lteHelper->SetFfrAlgorithmAttribute(
"UlCommonSubBandwidth",
UintegerValue(6));
1042 lteHelper->SetFfrAlgorithmAttribute(
"UlEdgeSubBandOffset",
UintegerValue(6));
1043 lteHelper->SetFfrAlgorithmAttribute(
"UlEdgeSubBandwidth",
UintegerValue(6));
1044 enbDevs.
Add(lteHelper->InstallEnbDevice(enbNodes.
Get(0)));
1046 lteHelper->SetFfrAlgorithmType(
"ns3::LteFrNoOpAlgorithm");
1047 enbDevs.
Add(lteHelper->InstallEnbDevice(enbNodes.
Get(1)));
1049 ueDevs1 = lteHelper->InstallUeDevice(ueNodes1);
1050 ueDevs2 = lteHelper->InstallUeDevice(ueNodes2);
1053 lteHelper->Attach(ueDevs1, enbDevs.
Get(0));
1054 lteHelper->Attach(ueDevs2, enbDevs.
Get(1));
1069 lteHelper->ActivateDataRadioBearer(ueDevs1, bearer);
1070 lteHelper->ActivateDataRadioBearer(ueDevs2, bearer);
1076 ->GetDownlinkSpectrumPhy()
1082 testDlSpectrumPhy->SetRxSpectrumModel(
1084 dlChannel->AddRx(testDlSpectrumPhy);
1086 testDlSpectrumPhy->SetCellId(1);
1088 testDlSpectrumPhy->TraceConnectWithoutContext(
1096 ->GetUplinkSpectrumPhy()
1101 testUlSpectrumPhy->SetRxSpectrumModel(
1103 ulChannel->AddRx(testUlSpectrumPhy);
1105 testUlSpectrumPhy->SetCellId(1);
1107 testUlSpectrumPhy->TraceConnectWithoutContext(
1111 std::vector<bool> expectedDlRbCenterArea;
1113 std::vector<bool> expectedUlRbCenterArea;
1117 expectedDlRbCenterArea[i] =
true;
1118 expectedUlRbCenterArea[i] =
true;
1121 std::vector<bool> expectedDlRbEdgeArea;
1123 std::vector<bool> expectedUlRbEdgeArea;
1127 expectedDlRbEdgeArea[i] =
true;
1128 expectedUlRbEdgeArea[i] =
true;
1137 expectedDlRbCenterArea);
1142 expectedUlRbCenterArea);
1150 expectedDlRbEdgeArea);
1155 expectedUlRbEdgeArea);
1163 expectedDlRbCenterArea);
1168 expectedUlRbCenterArea);
1199 double eNbTxPower = 30;
1229 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
1230 positionAlloc->Add(Vector(1000, 0.0, 0.0));
1231 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
1232 positionAlloc->Add(Vector(1020, 0.0, 0.0));
1234 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
1235 mobility.SetPositionAllocator(positionAlloc);
1236 mobility.Install(allNodes);
1249 lteHelper->SetFfrAlgorithmType(
"ns3::LteFrSoftAlgorithm");
1250 lteHelper->SetFfrAlgorithmAttribute(
"AllowCenterUeUseEdgeSubBand",
BooleanValue(
false));
1251 lteHelper->SetFfrAlgorithmAttribute(
"RsrqThreshold",
UintegerValue(25));
1252 lteHelper->SetFfrAlgorithmAttribute(
"CenterPowerOffset",
1254 lteHelper->SetFfrAlgorithmAttribute(
"EdgePowerOffset",
1257 lteHelper->SetFfrAlgorithmAttribute(
"DlEdgeSubBandOffset",
UintegerValue(8));
1258 lteHelper->SetFfrAlgorithmAttribute(
"DlEdgeSubBandwidth",
UintegerValue(8));
1259 lteHelper->SetFfrAlgorithmAttribute(
"UlEdgeSubBandOffset",
UintegerValue(8));
1260 lteHelper->SetFfrAlgorithmAttribute(
"UlEdgeSubBandwidth",
UintegerValue(8));
1261 enbDevs.
Add(lteHelper->InstallEnbDevice(enbNodes.
Get(0)));
1263 lteHelper->SetFfrAlgorithmType(
"ns3::LteFrNoOpAlgorithm");
1264 enbDevs.
Add(lteHelper->InstallEnbDevice(enbNodes.
Get(1)));
1266 ueDevs1 = lteHelper->InstallUeDevice(ueNodes1);
1267 ueDevs2 = lteHelper->InstallUeDevice(ueNodes2);
1270 lteHelper->Attach(ueDevs1, enbDevs.
Get(0));
1271 lteHelper->Attach(ueDevs2, enbDevs.
Get(1));
1285 lteHelper->ActivateDataRadioBearer(ueDevs1, bearer);
1286 lteHelper->ActivateDataRadioBearer(ueDevs2, bearer);
1292 ->GetDownlinkSpectrumPhy()
1298 testDlSpectrumPhy->SetRxSpectrumModel(
1300 dlChannel->AddRx(testDlSpectrumPhy);
1302 testDlSpectrumPhy->SetCellId(1);
1304 testDlSpectrumPhy->TraceConnectWithoutContext(
1312 ->GetUplinkSpectrumPhy()
1317 testUlSpectrumPhy->SetRxSpectrumModel(
1319 ulChannel->AddRx(testUlSpectrumPhy);
1321 testUlSpectrumPhy->SetCellId(1);
1323 testUlSpectrumPhy->TraceConnectWithoutContext(
1327 std::vector<bool> expectedDlRbCenterArea;
1329 std::vector<bool> expectedUlRbCenterArea;
1333 expectedDlRbCenterArea[i] =
true;
1334 expectedUlRbCenterArea[i] =
true;
1338 expectedDlRbCenterArea[i] =
true;
1341 std::vector<bool> expectedDlRbEdgeArea;
1343 std::vector<bool> expectedUlRbEdgeArea;
1347 expectedDlRbEdgeArea[i] =
true;
1348 expectedUlRbEdgeArea[i] =
true;
1357 expectedDlRbCenterArea);
1362 expectedUlRbCenterArea);
1370 expectedDlRbEdgeArea);
1375 expectedUlRbEdgeArea);
1383 expectedDlRbCenterArea);
1388 expectedUlRbCenterArea);
1395 "Scheduler used DL RBG muted by FFR Algorithm");
1423 double eNbTxPower = 30;
1453 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
1454 positionAlloc->Add(Vector(1000, 0.0, 0.0));
1455 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
1456 positionAlloc->Add(Vector(1020, 0.0, 0.0));
1458 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
1459 mobility.SetPositionAllocator(positionAlloc);
1460 mobility.Install(allNodes);
1473 lteHelper->SetFfrAlgorithmType(
"ns3::LteFfrSoftAlgorithm");
1474 lteHelper->SetFfrAlgorithmAttribute(
"CenterRsrqThreshold",
UintegerValue(28));
1475 lteHelper->SetFfrAlgorithmAttribute(
"EdgeRsrqThreshold",
UintegerValue(18));
1476 lteHelper->SetFfrAlgorithmAttribute(
"CenterAreaPowerOffset",
1478 lteHelper->SetFfrAlgorithmAttribute(
"MediumAreaPowerOffset",
1480 lteHelper->SetFfrAlgorithmAttribute(
"EdgeAreaPowerOffset",
1483 lteHelper->SetFfrAlgorithmAttribute(
"UlCommonSubBandwidth",
UintegerValue(6));
1484 lteHelper->SetFfrAlgorithmAttribute(
"DlCommonSubBandwidth",
UintegerValue(6));
1486 lteHelper->SetFfrAlgorithmAttribute(
"DlEdgeSubBandOffset",
UintegerValue(6));
1487 lteHelper->SetFfrAlgorithmAttribute(
"DlEdgeSubBandwidth",
UintegerValue(6));
1488 lteHelper->SetFfrAlgorithmAttribute(
"UlEdgeSubBandOffset",
UintegerValue(6));
1489 lteHelper->SetFfrAlgorithmAttribute(
"UlEdgeSubBandwidth",
UintegerValue(6));
1490 enbDevs.
Add(lteHelper->InstallEnbDevice(enbNodes.
Get(0)));
1492 lteHelper->SetFfrAlgorithmType(
"ns3::LteFrNoOpAlgorithm");
1493 enbDevs.
Add(lteHelper->InstallEnbDevice(enbNodes.
Get(1)));
1495 ueDevs1 = lteHelper->InstallUeDevice(ueNodes1);
1496 ueDevs2 = lteHelper->InstallUeDevice(ueNodes2);
1499 lteHelper->Attach(ueDevs1, enbDevs.
Get(0));
1500 lteHelper->Attach(ueDevs2, enbDevs.
Get(1));
1514 lteHelper->ActivateDataRadioBearer(ueDevs1, bearer);
1515 lteHelper->ActivateDataRadioBearer(ueDevs2, bearer);
1521 ->GetDownlinkSpectrumPhy()
1527 testDlSpectrumPhy->SetRxSpectrumModel(
1529 dlChannel->AddRx(testDlSpectrumPhy);
1531 testDlSpectrumPhy->SetCellId(1);
1533 testDlSpectrumPhy->TraceConnectWithoutContext(
1541 ->GetUplinkSpectrumPhy()
1546 testUlSpectrumPhy->SetRxSpectrumModel(
1548 ulChannel->AddRx(testUlSpectrumPhy);
1550 testUlSpectrumPhy->SetCellId(1);
1552 testUlSpectrumPhy->TraceConnectWithoutContext(
1556 double expectedDlPowerCenterArea = 0.5;
1557 std::vector<bool> expectedDlRbCenterArea;
1559 std::vector<bool> expectedUlRbCenterArea;
1563 expectedDlRbCenterArea[i] =
true;
1564 expectedUlRbCenterArea[i] =
true;
1568 expectedDlRbCenterArea[i] =
true;
1569 expectedUlRbCenterArea[i] =
true;
1572 double expectedDlPowerMiddleArea = 1.0;
1573 std::vector<bool> expectedDlRbMiddleArea;
1575 std::vector<bool> expectedUlRbMiddleArea;
1579 expectedDlRbMiddleArea[i] =
true;
1580 expectedUlRbMiddleArea[i] =
true;
1583 double expectedDlPowerEdgeArea = 2.0;
1584 std::vector<bool> expectedDlRbEdgeArea;
1586 std::vector<bool> expectedUlRbEdgeArea;
1590 expectedDlRbEdgeArea[i] =
true;
1591 expectedUlRbEdgeArea[i] =
true;
1599 expectedDlPowerCenterArea,
1600 expectedDlRbCenterArea);
1605 expectedUlRbCenterArea);
1612 expectedDlPowerMiddleArea,
1613 expectedDlRbMiddleArea);
1618 expectedUlRbMiddleArea);
1625 expectedDlPowerEdgeArea,
1626 expectedDlRbEdgeArea);
1631 expectedUlRbEdgeArea);
1638 expectedDlPowerMiddleArea,
1639 expectedDlRbMiddleArea);
1644 expectedUlRbMiddleArea);
1651 expectedDlPowerCenterArea,
1652 expectedDlRbCenterArea);
1657 expectedUlRbCenterArea);
1672 NS_LOG_INFO(
"Creating LteEnhancedFfrAreaTestCase");
1690 double eNbTxPower = 30;
1720 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
1721 positionAlloc->Add(Vector(1000, 0.0, 0.0));
1722 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
1723 positionAlloc->Add(Vector(1020, 0.0, 0.0));
1725 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
1726 mobility.SetPositionAllocator(positionAlloc);
1727 mobility.Install(allNodes);
1739 lteHelper->SetSchedulerAttribute(
"HarqEnabled",
BooleanValue(
true));
1744 lteHelper->SetFfrAlgorithmType(
"ns3::LteFfrEnhancedAlgorithm");
1745 lteHelper->SetFfrAlgorithmAttribute(
"RsrqThreshold",
UintegerValue(25));
1746 lteHelper->SetFfrAlgorithmAttribute(
"DlCqiThreshold",
UintegerValue(10));
1747 lteHelper->SetFfrAlgorithmAttribute(
"UlCqiThreshold",
UintegerValue(15));
1748 lteHelper->SetFfrAlgorithmAttribute(
"CenterAreaPowerOffset",
1750 lteHelper->SetFfrAlgorithmAttribute(
"EdgeAreaPowerOffset",
1753 lteHelper->SetFfrAlgorithmAttribute(
"UlSubBandOffset",
UintegerValue(0));
1754 lteHelper->SetFfrAlgorithmAttribute(
"UlReuse3SubBandwidth",
UintegerValue(4));
1755 lteHelper->SetFfrAlgorithmAttribute(
"UlReuse1SubBandwidth",
UintegerValue(4));
1757 lteHelper->SetFfrAlgorithmAttribute(
"DlSubBandOffset",
UintegerValue(0));
1758 lteHelper->SetFfrAlgorithmAttribute(
"DlReuse3SubBandwidth",
UintegerValue(4));
1759 lteHelper->SetFfrAlgorithmAttribute(
"DlReuse1SubBandwidth",
UintegerValue(4));
1761 enbDevs.
Add(lteHelper->InstallEnbDevice(enbNodes.
Get(0)));
1763 lteHelper->SetFfrAlgorithmType(
"ns3::LteFrNoOpAlgorithm");
1764 enbDevs.
Add(lteHelper->InstallEnbDevice(enbNodes.
Get(1)));
1766 ueDevs1 = lteHelper->InstallUeDevice(ueNodes1);
1767 ueDevs2 = lteHelper->InstallUeDevice(ueNodes2);
1770 lteHelper->Attach(ueDevs1, enbDevs.
Get(0));
1771 lteHelper->Attach(ueDevs2, enbDevs.
Get(1));
1785 lteHelper->ActivateDataRadioBearer(ueDevs1, bearer);
1786 lteHelper->ActivateDataRadioBearer(ueDevs2, bearer);
1792 ->GetDownlinkSpectrumPhy()
1798 testDlSpectrumPhy->SetRxSpectrumModel(
1800 dlChannel->AddRx(testDlSpectrumPhy);
1802 testDlSpectrumPhy->SetCellId(1);
1804 testDlSpectrumPhy->TraceConnectWithoutContext(
1812 ->GetUplinkSpectrumPhy()
1817 testUlSpectrumPhy->SetRxSpectrumModel(
1819 ulChannel->AddRx(testUlSpectrumPhy);
1821 testUlSpectrumPhy->SetCellId(1);
1823 testUlSpectrumPhy->TraceConnectWithoutContext(
1827 double expectedDlPowerCenterArea = 0.251189;
1828 std::vector<bool> expectedDlRbCenterArea;
1830 std::vector<bool> expectedUlRbCenterArea;
1834 expectedDlRbCenterArea[i] =
true;
1835 expectedUlRbCenterArea[i] =
true;
1839 expectedDlRbCenterArea[i] =
true;
1840 expectedUlRbCenterArea[i] =
true;
1844 expectedDlRbCenterArea[i] =
true;
1845 expectedUlRbCenterArea[i] =
true;
1848 double expectedDlPowerMiddleArea = 0.251189;
1849 std::vector<bool> expectedDlRbMiddleArea;
1851 std::vector<bool> expectedUlRbMiddleArea;
1855 expectedDlRbMiddleArea[i] =
true;
1856 expectedUlRbMiddleArea[i] =
true;
1859 double expectedDlPowerEdgeArea = 1.0;
1860 std::vector<bool> expectedDlRbEdgeArea;
1862 std::vector<bool> expectedUlRbEdgeArea;
1866 expectedDlRbEdgeArea[i] =
true;
1867 expectedUlRbEdgeArea[i] =
true;
1875 expectedDlPowerCenterArea,
1876 expectedDlRbCenterArea);
1881 expectedUlRbCenterArea);
1888 expectedDlPowerMiddleArea,
1889 expectedDlRbMiddleArea);
1894 expectedUlRbMiddleArea);
1901 expectedDlPowerEdgeArea,
1902 expectedDlRbEdgeArea);
1907 expectedUlRbEdgeArea);
1914 expectedDlPowerCenterArea,
1915 expectedDlRbCenterArea);
1920 expectedUlRbCenterArea);
1927 expectedDlPowerMiddleArea,
1928 expectedDlRbMiddleArea);
1933 expectedUlRbCenterArea);
1946 std::string schedulerType)
1949 NS_LOG_INFO(
"Creating LteDistributedFfrAreaTestCase");
1967 double eNbTxPower = 30;
1979 uint16_t bandwidth = 25;
1983 lteHelper->SetEpcHelper(epcHelper);
1984 lteHelper->SetHandoverAlgorithmType(
"ns3::NoOpHandoverAlgorithm");
1986 Ptr<Node> pgw = epcHelper->GetPgwNode();
1990 remoteHostContainer.
Create(1);
1993 internet.Install(remoteHostContainer);
2002 ipv4h.
SetBase(
"1.0.0.0",
"255.0.0.0");
2011 remoteHostStaticRouting->AddNetworkRouteTo(
Ipv4Address(
"7.0.0.0"),
Ipv4Mask(
"255.0.0.0"), 1);
2035 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
2036 positionAlloc->Add(Vector(1000, 0.0, 0.0));
2038 positionAlloc->Add(Vector(200, 0.0, 0.0));
2039 positionAlloc->Add(Vector(200, 0.0, 0.0));
2040 positionAlloc->Add(Vector(800, 0.0, 0.0));
2043 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
2044 mobility.SetPositionAllocator(positionAlloc);
2045 mobility.Install(allNodes);
2054 lteHelper->SetEnbDeviceAttribute(
"DlBandwidth",
UintegerValue(bandwidth));
2055 lteHelper->SetEnbDeviceAttribute(
"UlBandwidth",
UintegerValue(bandwidth));
2057 lteHelper->SetFfrAlgorithmType(
"ns3::LteFfrDistributedAlgorithm");
2059 lteHelper->SetFfrAlgorithmAttribute(
"RsrqThreshold",
UintegerValue(25));
2060 lteHelper->SetFfrAlgorithmAttribute(
"RsrpDifferenceThreshold",
UintegerValue(5));
2061 lteHelper->SetFfrAlgorithmAttribute(
"EdgeRbNum",
UintegerValue(6));
2062 lteHelper->SetFfrAlgorithmAttribute(
"CenterPowerOffset",
2064 lteHelper->SetFfrAlgorithmAttribute(
"EdgePowerOffset",
2067 enbDevs = lteHelper->InstallEnbDevice(enbNodes);
2068 ueDevs1 = lteHelper->InstallUeDevice(ueNodes1);
2069 ueDevs2 = lteHelper->InstallUeDevice(ueNodes2);
2072 ueLteDevs.
Add(ueDevs1);
2073 ueLteDevs.
Add(ueDevs2);
2076 lteHelper->AddX2Interface(enbNodes);
2079 internet.Install(ueNodes);
2089 ueStaticRouting->SetDefaultRoute(epcHelper->GetUeDefaultGatewayAddress(), 1);
2093 lteHelper->Attach(ueDevs1, enbDevs.
Get(0));
2094 lteHelper->Attach(ueDevs2, enbDevs.
Get(1));
2097 uint16_t dlPort = 10000;
2098 uint16_t ulPort = 20000;
2104 startTimeSeconds->SetAttribute(
"Min",
DoubleValue(0));
2105 startTimeSeconds->SetAttribute(
"Max",
DoubleValue(0.010));
2113 ueStaticRouting->SetDefaultRoute(epcHelper->GetUeDefaultGatewayAddress(), 1);
2127 clientApps.Add(dlClientHelper.
Install(remoteHost));
2130 serverApps.Add(dlPacketSinkHelper.
Install(ue));
2136 clientApps.Add(ulClientHelper.
Install(ue));
2139 serverApps.Add(ulPacketSinkHelper.
Install(remoteHost));
2161 lteHelper->ActivateDedicatedEpsBearer(ueLteDevs.
Get(u), bearer, tft);
2163 Time startTime =
Seconds(startTimeSeconds->GetValue());
2164 serverApps.Start(startTime);
2165 clientApps.Start(startTime);
2173 ->GetDownlinkSpectrumPhy()
2179 testDlSpectrumPhy->SetRxSpectrumModel(
2181 dlChannel->AddRx(testDlSpectrumPhy);
2183 testDlSpectrumPhy->SetCellId(2);
2185 testDlSpectrumPhy->TraceConnectWithoutContext(
2193 ->GetUplinkSpectrumPhy()
2198 testUlSpectrumPhy->SetRxSpectrumModel(
2200 ulChannel->AddRx(testUlSpectrumPhy);
2202 testUlSpectrumPhy->SetCellId(2);
2204 testUlSpectrumPhy->TraceConnectWithoutContext(
2208 double expectedDlPowerCenterArea = 1.0;
2209 std::vector<bool> expectedDlRbCenterArea;
2211 std::vector<bool> expectedUlRbCenterArea;
2215 expectedDlRbCenterArea[i] =
true;
2216 expectedUlRbCenterArea[i] =
true;
2219 double expectedDlPowerEdgeArea = 2.0;
2220 std::vector<bool> expectedDlRbEdgeArea;
2222 std::vector<bool> expectedUlRbEdgeArea;
2226 expectedDlRbEdgeArea[i] =
true;
2227 expectedUlRbEdgeArea[i] =
true;
2230 std::vector<bool> expectedDlRbEdgeArea2;
2232 std::vector<bool> expectedUlRbEdgeArea2;
2236 expectedDlRbEdgeArea2[i] =
true;
2237 expectedUlRbEdgeArea2[i] =
true;
2245 expectedDlPowerCenterArea,
2246 expectedDlRbCenterArea);
2251 expectedUlRbCenterArea);
2258 expectedDlPowerEdgeArea,
2259 expectedDlRbEdgeArea);
2264 expectedUlRbEdgeArea);
2272 expectedDlPowerEdgeArea,
2273 expectedDlRbEdgeArea2);
2278 expectedUlRbEdgeArea2);
2286 expectedDlPowerEdgeArea,
2287 expectedDlRbEdgeArea);
2292 expectedUlRbEdgeArea);
2299 expectedDlPowerCenterArea,
2300 expectedDlRbCenterArea);
2305 expectedUlRbCenterArea);
2312 "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.
AttributeValue implementation for Boolean.
Class for representing data rates.
AttributeValue implementation for DataRate.
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.
void SetPosition(const Vector &position)
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.
ApplicationContainer Install(NodeContainer c) const
Install an ns3::PacketSinkApplication on each node of the input container configured with all the att...
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, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
Simulation virtual time values and global simulation resolution.
AttributeValue implementation for Time.
Create a client application which sends UDP packets carrying a 32bit sequence number and a 64 bit tim...
void SetAttribute(std::string name, const AttributeValue &value)
Record an attribute to be set in each Application after it is is created.
ApplicationContainer Install(NodeContainer c)
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.
#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 UlDataRxStartNofiticationArea(LteFrAreaTestCase *testcase, Ptr< const SpectrumValue > spectrumValue)
void DlDataRxStartNofiticationArea(LteFrAreaTestCase *testcase, Ptr< const SpectrumValue > spectrumValue)
void DlDataRxStartNofitication(LteFrTestCase *testcase, Ptr< const SpectrumValue > spectrumValue)
TestCase Data.
void UlDataRxStartNofitication(LteFrTestCase *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