26#include "ns3/applications-module.h"
27#include "ns3/internet-module.h"
28#include "ns3/lte-helper.h"
29#include "ns3/mobility-helper.h"
30#include "ns3/point-to-point-epc-helper.h"
31#include "ns3/point-to-point-module.h"
32#include <ns3/boolean.h>
33#include <ns3/callback.h>
34#include <ns3/config.h>
35#include <ns3/double.h>
37#include <ns3/ff-mac-scheduler.h>
39#include <ns3/lte-common.h>
40#include <ns3/lte-enb-net-device.h>
41#include <ns3/lte-enb-phy.h>
42#include <ns3/lte-enb-rrc.h>
43#include <ns3/lte-ue-net-device.h>
44#include <ns3/lte-ue-phy.h>
45#include <ns3/lte-ue-rrc.h>
46#include <ns3/pointer.h>
47#include <ns3/simulator.h>
48#include <ns3/string.h>
59 :
TestSuite(
"lte-frequency-reuse", SYSTEM)
64 std::vector<bool> availableDlRb;
65 std::vector<bool> availableUlRb;
68 availableDlRb.push_back(
true);
69 availableUlRb.push_back(
true);
73 availableDlRb.push_back(
false);
74 availableUlRb.push_back(
false);
79 "ns3::PfFfMacScheduler",
91 "ns3::PfFfMacScheduler",
103 "ns3::PssFfMacScheduler",
115 "ns3::PssFfMacScheduler",
127 "ns3::CqaFfMacScheduler",
139 "ns3::CqaFfMacScheduler",
151 "ns3::FdTbfqFfMacScheduler",
163 "ns3::FdTbfqFfMacScheduler",
175 "ns3::TdTbfqFfMacScheduler",
187 "ns3::TdTbfqFfMacScheduler",
198 availableDlRb.clear();
199 availableUlRb.clear();
202 availableDlRb.push_back(
true);
203 availableUlRb.push_back(
true);
207 availableDlRb.push_back(
false);
208 availableUlRb.push_back(
false);
212 availableDlRb.push_back(
true);
213 availableUlRb.push_back(
true);
217 availableDlRb.push_back(
false);
218 availableUlRb.push_back(
false);
223 "ns3::PfFfMacScheduler",
237 "ns3::PfFfMacScheduler",
251 "ns3::PssFfMacScheduler",
265 "ns3::PssFfMacScheduler",
279 "ns3::CqaFfMacScheduler",
293 "ns3::CqaFfMacScheduler",
307 "ns3::FdTbfqFfMacScheduler",
321 "ns3::FdTbfqFfMacScheduler",
335 "ns3::TdTbfqFfMacScheduler",
349 "ns3::TdTbfqFfMacScheduler",
413 "ns3::FdTbfqFfMacScheduler"),
416 "ns3::TdTbfqFfMacScheduler"),
420 "ns3::PfFfMacScheduler"),
423 "ns3::PssFfMacScheduler"),
426 "ns3::CqaFfMacScheduler"),
429 "ns3::FdTbfqFfMacScheduler"),
432 "ns3::TdTbfqFfMacScheduler"),
459 uint16_t dlBandwidth,
460 uint16_t ulBandwidth,
461 std::vector<bool> availableDlRb,
462 std::vector<bool> availableUlRb)
465 m_dlBandwidth(dlBandwidth),
466 m_ulBandwidth(ulBandwidth),
467 m_availableDlRb(availableDlRb),
468 m_usedMutedDlRbg(false),
469 m_availableUlRb(availableUlRb),
470 m_usedMutedUlRbg(false)
482 Values::const_iterator it;
484 for (it = spectrumValue->ConstValuesBegin(); it != spectrumValue->ConstValuesEnd(); it++)
502 Values::const_iterator it;
504 for (it = spectrumValue->ConstValuesBegin(); it != spectrumValue->ConstValuesEnd(); it++)
525 std::string schedulerType,
526 uint16_t dlBandwidth,
527 uint16_t ulBandwidth,
528 uint8_t dlSubBandOffset,
529 uint16_t dlSubBandwidth,
530 uint8_t ulSubBandOffset,
531 uint16_t ulSubBandwidth,
532 std::vector<bool> availableDlRb,
533 std::vector<bool> availableUlRb)
534 :
LteFrTestCase(name, userNum, dlBandwidth, ulBandwidth, availableDlRb, availableUlRb),
535 m_schedulerType(schedulerType),
536 m_dlSubBandOffset(dlSubBandOffset),
537 m_dlSubBandwidth(dlSubBandwidth),
538 m_ulSubBandOffset(ulSubBandOffset),
539 m_ulSubBandwidth(ulSubBandwidth)
561 lteHelper->SetFfrAlgorithmType(
"ns3::LteFrHardAlgorithm");
578 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
579 mobility.Install(allNodes);
585 enbDevs = lteHelper->InstallEnbDevice(enbNodes);
586 ueDevs = lteHelper->InstallUeDevice(ueNodes);
589 lteHelper->Attach(ueDevs, enbDevs.
Get(0));
603 lteHelper->ActivateDataRadioBearer(ueDevs, bearer);
609 ->GetDownlinkSpectrumPhy()
615 testDlSpectrumPhy->SetRxSpectrumModel(
617 dlChannel->AddRx(testDlSpectrumPhy);
619 testDlSpectrumPhy->TraceConnectWithoutContext(
627 ->GetUplinkSpectrumPhy()
632 testUlSpectrumPhy->SetRxSpectrumModel(
634 ulChannel->AddRx(testUlSpectrumPhy);
636 testUlSpectrumPhy->TraceConnectWithoutContext(
652 std::string schedulerType,
653 uint16_t dlBandwidth,
654 uint16_t ulBandwidth,
655 uint16_t dlCommonSubBandwidth,
656 uint8_t dlEdgeSubBandOffset,
657 uint16_t dlEdgeSubBandwidth,
658 uint16_t ulCommonSubBandwidth,
659 uint8_t ulEdgeSubBandOffset,
660 uint16_t ulEdgeSubBandwidth,
661 std::vector<bool> availableDlRb,
662 std::vector<bool> availableUlRb)
663 :
LteFrTestCase(name, userNum, dlBandwidth, ulBandwidth, availableDlRb, availableUlRb),
664 m_schedulerType(schedulerType),
665 m_dlCommonSubBandwidth(dlCommonSubBandwidth),
666 m_dlEdgeSubBandOffset(dlEdgeSubBandOffset),
667 m_dlEdgeSubBandwidth(dlEdgeSubBandwidth),
668 m_ulCommonSubBandwidth(ulCommonSubBandwidth),
669 m_ulEdgeSubBandOffset(ulEdgeSubBandOffset),
670 m_ulEdgeSubBandwidth(ulEdgeSubBandwidth)
692 lteHelper->SetFfrAlgorithmType(
"ns3::LteFrStrictAlgorithm");
694 lteHelper->SetFfrAlgorithmAttribute(
"DlCommonSubBandwidth",
696 lteHelper->SetFfrAlgorithmAttribute(
"DlEdgeSubBandOffset",
700 lteHelper->SetFfrAlgorithmAttribute(
"UlCommonSubBandwidth",
702 lteHelper->SetFfrAlgorithmAttribute(
"UlEdgeSubBandOffset",
715 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
716 mobility.Install(allNodes);
722 enbDevs = lteHelper->InstallEnbDevice(enbNodes);
723 ueDevs = lteHelper->InstallUeDevice(ueNodes);
726 lteHelper->Attach(ueDevs, enbDevs.
Get(0));
741 lteHelper->ActivateDataRadioBearer(ueDevs, bearer);
747 ->GetDownlinkSpectrumPhy()
753 testDlSpectrumPhy->SetRxSpectrumModel(
755 dlChannel->AddRx(testDlSpectrumPhy);
757 testDlSpectrumPhy->TraceConnectWithoutContext(
765 ->GetUplinkSpectrumPhy()
770 testUlSpectrumPhy->SetRxSpectrumModel(
772 ulChannel->AddRx(testUlSpectrumPhy);
774 testUlSpectrumPhy->TraceConnectWithoutContext(
802 m_schedulerType(schedulerType)
824 Values::const_iterator it;
826 for (it = spectrumValue->ConstValuesBegin(); it != spectrumValue->ConstValuesEnd(); it++)
844 "Wrong Data Channel DL Power level");
860 Values::const_iterator it;
868 for (it = spectrumValue->ConstValuesBegin(); it != spectrumValue->ConstValuesEnd(); it++)
877 NS_LOG_DEBUG(
"Total number of active RBs = " << numActiveRbs);
881 for (it = spectrumValue->ConstValuesBegin(); it != spectrumValue->ConstValuesEnd(); it++)
883 double power = (*it) * (numActiveRbs * 180000);
895 "Wrong Data Channel UL Power level"
906 NS_LOG_DEBUG(
"Teleport UE to : (" << x <<
", " << y <<
", 0)");
914 double expectedPower,
915 std::vector<bool> expectedDlRb)
918 NS_LOG_DEBUG(
"Teleport UE to : (" << x <<
", " << y <<
", 0)");
929 double expectedPower,
930 std::vector<bool> expectedDlRb)
933 NS_LOG_DEBUG(
"Teleport UE to : (" << x <<
", " << y <<
", 0)");
936 ueMobility->SetPosition(Vector(x, y, 0.0));
983 double eNbTxPower = 30;
1013 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
1014 positionAlloc->Add(Vector(1000, 0.0, 0.0));
1015 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
1016 positionAlloc->Add(Vector(1020, 0.0, 0.0));
1018 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
1019 mobility.SetPositionAllocator(positionAlloc);
1020 mobility.Install(allNodes);
1033 lteHelper->SetFfrAlgorithmType(
"ns3::LteFrStrictAlgorithm");
1034 lteHelper->SetFfrAlgorithmAttribute(
"RsrqThreshold",
UintegerValue(25));
1035 lteHelper->SetFfrAlgorithmAttribute(
"CenterPowerOffset",
1037 lteHelper->SetFfrAlgorithmAttribute(
"EdgePowerOffset",
1040 lteHelper->SetFfrAlgorithmAttribute(
"DlCommonSubBandwidth",
UintegerValue(6));
1041 lteHelper->SetFfrAlgorithmAttribute(
"DlEdgeSubBandOffset",
UintegerValue(6));
1042 lteHelper->SetFfrAlgorithmAttribute(
"DlEdgeSubBandwidth",
UintegerValue(6));
1044 lteHelper->SetFfrAlgorithmAttribute(
"UlCommonSubBandwidth",
UintegerValue(6));
1045 lteHelper->SetFfrAlgorithmAttribute(
"UlEdgeSubBandOffset",
UintegerValue(6));
1046 lteHelper->SetFfrAlgorithmAttribute(
"UlEdgeSubBandwidth",
UintegerValue(6));
1047 enbDevs.
Add(lteHelper->InstallEnbDevice(enbNodes.
Get(0)));
1049 lteHelper->SetFfrAlgorithmType(
"ns3::LteFrNoOpAlgorithm");
1050 enbDevs.
Add(lteHelper->InstallEnbDevice(enbNodes.
Get(1)));
1052 ueDevs1 = lteHelper->InstallUeDevice(ueNodes1);
1053 ueDevs2 = lteHelper->InstallUeDevice(ueNodes2);
1056 lteHelper->Attach(ueDevs1, enbDevs.
Get(0));
1057 lteHelper->Attach(ueDevs2, enbDevs.
Get(1));
1072 lteHelper->ActivateDataRadioBearer(ueDevs1, bearer);
1073 lteHelper->ActivateDataRadioBearer(ueDevs2, bearer);
1079 ->GetDownlinkSpectrumPhy()
1085 testDlSpectrumPhy->SetRxSpectrumModel(
1087 dlChannel->AddRx(testDlSpectrumPhy);
1089 testDlSpectrumPhy->SetCellId(1);
1091 testDlSpectrumPhy->TraceConnectWithoutContext(
1099 ->GetUplinkSpectrumPhy()
1104 testUlSpectrumPhy->SetRxSpectrumModel(
1106 ulChannel->AddRx(testUlSpectrumPhy);
1108 testUlSpectrumPhy->SetCellId(1);
1110 testUlSpectrumPhy->TraceConnectWithoutContext(
1114 std::vector<bool> expectedDlRbCenterArea;
1116 std::vector<bool> expectedUlRbCenterArea;
1120 expectedDlRbCenterArea[i] =
true;
1121 expectedUlRbCenterArea[i] =
true;
1124 std::vector<bool> expectedDlRbEdgeArea;
1126 std::vector<bool> expectedUlRbEdgeArea;
1130 expectedDlRbEdgeArea[i] =
true;
1131 expectedUlRbEdgeArea[i] =
true;
1140 expectedDlRbCenterArea);
1145 expectedUlRbCenterArea);
1153 expectedDlRbEdgeArea);
1158 expectedUlRbEdgeArea);
1166 expectedDlRbCenterArea);
1171 expectedUlRbCenterArea);
1202 double eNbTxPower = 30;
1232 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
1233 positionAlloc->Add(Vector(1000, 0.0, 0.0));
1234 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
1235 positionAlloc->Add(Vector(1020, 0.0, 0.0));
1237 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
1238 mobility.SetPositionAllocator(positionAlloc);
1239 mobility.Install(allNodes);
1252 lteHelper->SetFfrAlgorithmType(
"ns3::LteFrSoftAlgorithm");
1253 lteHelper->SetFfrAlgorithmAttribute(
"AllowCenterUeUseEdgeSubBand",
BooleanValue(
false));
1254 lteHelper->SetFfrAlgorithmAttribute(
"RsrqThreshold",
UintegerValue(25));
1255 lteHelper->SetFfrAlgorithmAttribute(
"CenterPowerOffset",
1257 lteHelper->SetFfrAlgorithmAttribute(
"EdgePowerOffset",
1260 lteHelper->SetFfrAlgorithmAttribute(
"DlEdgeSubBandOffset",
UintegerValue(8));
1261 lteHelper->SetFfrAlgorithmAttribute(
"DlEdgeSubBandwidth",
UintegerValue(8));
1262 lteHelper->SetFfrAlgorithmAttribute(
"UlEdgeSubBandOffset",
UintegerValue(8));
1263 lteHelper->SetFfrAlgorithmAttribute(
"UlEdgeSubBandwidth",
UintegerValue(8));
1264 enbDevs.
Add(lteHelper->InstallEnbDevice(enbNodes.
Get(0)));
1266 lteHelper->SetFfrAlgorithmType(
"ns3::LteFrNoOpAlgorithm");
1267 enbDevs.
Add(lteHelper->InstallEnbDevice(enbNodes.
Get(1)));
1269 ueDevs1 = lteHelper->InstallUeDevice(ueNodes1);
1270 ueDevs2 = lteHelper->InstallUeDevice(ueNodes2);
1273 lteHelper->Attach(ueDevs1, enbDevs.
Get(0));
1274 lteHelper->Attach(ueDevs2, enbDevs.
Get(1));
1288 lteHelper->ActivateDataRadioBearer(ueDevs1, bearer);
1289 lteHelper->ActivateDataRadioBearer(ueDevs2, bearer);
1295 ->GetDownlinkSpectrumPhy()
1301 testDlSpectrumPhy->SetRxSpectrumModel(
1303 dlChannel->AddRx(testDlSpectrumPhy);
1305 testDlSpectrumPhy->SetCellId(1);
1307 testDlSpectrumPhy->TraceConnectWithoutContext(
1315 ->GetUplinkSpectrumPhy()
1320 testUlSpectrumPhy->SetRxSpectrumModel(
1322 ulChannel->AddRx(testUlSpectrumPhy);
1324 testUlSpectrumPhy->SetCellId(1);
1326 testUlSpectrumPhy->TraceConnectWithoutContext(
1330 std::vector<bool> expectedDlRbCenterArea;
1332 std::vector<bool> expectedUlRbCenterArea;
1336 expectedDlRbCenterArea[i] =
true;
1337 expectedUlRbCenterArea[i] =
true;
1341 expectedDlRbCenterArea[i] =
true;
1344 std::vector<bool> expectedDlRbEdgeArea;
1346 std::vector<bool> expectedUlRbEdgeArea;
1350 expectedDlRbEdgeArea[i] =
true;
1351 expectedUlRbEdgeArea[i] =
true;
1360 expectedDlRbCenterArea);
1365 expectedUlRbCenterArea);
1373 expectedDlRbEdgeArea);
1378 expectedUlRbEdgeArea);
1386 expectedDlRbCenterArea);
1391 expectedUlRbCenterArea);
1398 "Scheduler used DL RBG muted by FFR Algorithm");
1426 double eNbTxPower = 30;
1456 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
1457 positionAlloc->Add(Vector(1000, 0.0, 0.0));
1458 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
1459 positionAlloc->Add(Vector(1020, 0.0, 0.0));
1461 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
1462 mobility.SetPositionAllocator(positionAlloc);
1463 mobility.Install(allNodes);
1476 lteHelper->SetFfrAlgorithmType(
"ns3::LteFfrSoftAlgorithm");
1477 lteHelper->SetFfrAlgorithmAttribute(
"CenterRsrqThreshold",
UintegerValue(28));
1478 lteHelper->SetFfrAlgorithmAttribute(
"EdgeRsrqThreshold",
UintegerValue(18));
1479 lteHelper->SetFfrAlgorithmAttribute(
"CenterAreaPowerOffset",
1481 lteHelper->SetFfrAlgorithmAttribute(
"MediumAreaPowerOffset",
1483 lteHelper->SetFfrAlgorithmAttribute(
"EdgeAreaPowerOffset",
1486 lteHelper->SetFfrAlgorithmAttribute(
"UlCommonSubBandwidth",
UintegerValue(6));
1487 lteHelper->SetFfrAlgorithmAttribute(
"DlCommonSubBandwidth",
UintegerValue(6));
1489 lteHelper->SetFfrAlgorithmAttribute(
"DlEdgeSubBandOffset",
UintegerValue(6));
1490 lteHelper->SetFfrAlgorithmAttribute(
"DlEdgeSubBandwidth",
UintegerValue(6));
1491 lteHelper->SetFfrAlgorithmAttribute(
"UlEdgeSubBandOffset",
UintegerValue(6));
1492 lteHelper->SetFfrAlgorithmAttribute(
"UlEdgeSubBandwidth",
UintegerValue(6));
1493 enbDevs.
Add(lteHelper->InstallEnbDevice(enbNodes.
Get(0)));
1495 lteHelper->SetFfrAlgorithmType(
"ns3::LteFrNoOpAlgorithm");
1496 enbDevs.
Add(lteHelper->InstallEnbDevice(enbNodes.
Get(1)));
1498 ueDevs1 = lteHelper->InstallUeDevice(ueNodes1);
1499 ueDevs2 = lteHelper->InstallUeDevice(ueNodes2);
1502 lteHelper->Attach(ueDevs1, enbDevs.
Get(0));
1503 lteHelper->Attach(ueDevs2, enbDevs.
Get(1));
1517 lteHelper->ActivateDataRadioBearer(ueDevs1, bearer);
1518 lteHelper->ActivateDataRadioBearer(ueDevs2, bearer);
1524 ->GetDownlinkSpectrumPhy()
1530 testDlSpectrumPhy->SetRxSpectrumModel(
1532 dlChannel->AddRx(testDlSpectrumPhy);
1534 testDlSpectrumPhy->SetCellId(1);
1536 testDlSpectrumPhy->TraceConnectWithoutContext(
1544 ->GetUplinkSpectrumPhy()
1549 testUlSpectrumPhy->SetRxSpectrumModel(
1551 ulChannel->AddRx(testUlSpectrumPhy);
1553 testUlSpectrumPhy->SetCellId(1);
1555 testUlSpectrumPhy->TraceConnectWithoutContext(
1559 double expectedDlPowerCenterArea = 0.5;
1560 std::vector<bool> expectedDlRbCenterArea;
1562 std::vector<bool> expectedUlRbCenterArea;
1566 expectedDlRbCenterArea[i] =
true;
1567 expectedUlRbCenterArea[i] =
true;
1571 expectedDlRbCenterArea[i] =
true;
1572 expectedUlRbCenterArea[i] =
true;
1575 double expectedDlPowerMiddleArea = 1.0;
1576 std::vector<bool> expectedDlRbMiddleArea;
1578 std::vector<bool> expectedUlRbMiddleArea;
1582 expectedDlRbMiddleArea[i] =
true;
1583 expectedUlRbMiddleArea[i] =
true;
1586 double expectedDlPowerEdgeArea = 2.0;
1587 std::vector<bool> expectedDlRbEdgeArea;
1589 std::vector<bool> expectedUlRbEdgeArea;
1593 expectedDlRbEdgeArea[i] =
true;
1594 expectedUlRbEdgeArea[i] =
true;
1602 expectedDlPowerCenterArea,
1603 expectedDlRbCenterArea);
1608 expectedUlRbCenterArea);
1615 expectedDlPowerMiddleArea,
1616 expectedDlRbMiddleArea);
1621 expectedUlRbMiddleArea);
1628 expectedDlPowerEdgeArea,
1629 expectedDlRbEdgeArea);
1634 expectedUlRbEdgeArea);
1641 expectedDlPowerMiddleArea,
1642 expectedDlRbMiddleArea);
1647 expectedUlRbMiddleArea);
1654 expectedDlPowerCenterArea,
1655 expectedDlRbCenterArea);
1660 expectedUlRbCenterArea);
1675 NS_LOG_INFO(
"Creating LteEnhancedFfrAreaTestCase");
1693 double eNbTxPower = 30;
1723 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
1724 positionAlloc->Add(Vector(1000, 0.0, 0.0));
1725 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
1726 positionAlloc->Add(Vector(1020, 0.0, 0.0));
1728 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
1729 mobility.SetPositionAllocator(positionAlloc);
1730 mobility.Install(allNodes);
1742 lteHelper->SetSchedulerAttribute(
"HarqEnabled",
BooleanValue(
true));
1747 lteHelper->SetFfrAlgorithmType(
"ns3::LteFfrEnhancedAlgorithm");
1748 lteHelper->SetFfrAlgorithmAttribute(
"RsrqThreshold",
UintegerValue(25));
1749 lteHelper->SetFfrAlgorithmAttribute(
"DlCqiThreshold",
UintegerValue(10));
1750 lteHelper->SetFfrAlgorithmAttribute(
"UlCqiThreshold",
UintegerValue(15));
1751 lteHelper->SetFfrAlgorithmAttribute(
"CenterAreaPowerOffset",
1753 lteHelper->SetFfrAlgorithmAttribute(
"EdgeAreaPowerOffset",
1756 lteHelper->SetFfrAlgorithmAttribute(
"UlSubBandOffset",
UintegerValue(0));
1757 lteHelper->SetFfrAlgorithmAttribute(
"UlReuse3SubBandwidth",
UintegerValue(4));
1758 lteHelper->SetFfrAlgorithmAttribute(
"UlReuse1SubBandwidth",
UintegerValue(4));
1760 lteHelper->SetFfrAlgorithmAttribute(
"DlSubBandOffset",
UintegerValue(0));
1761 lteHelper->SetFfrAlgorithmAttribute(
"DlReuse3SubBandwidth",
UintegerValue(4));
1762 lteHelper->SetFfrAlgorithmAttribute(
"DlReuse1SubBandwidth",
UintegerValue(4));
1764 enbDevs.
Add(lteHelper->InstallEnbDevice(enbNodes.
Get(0)));
1766 lteHelper->SetFfrAlgorithmType(
"ns3::LteFrNoOpAlgorithm");
1767 enbDevs.
Add(lteHelper->InstallEnbDevice(enbNodes.
Get(1)));
1769 ueDevs1 = lteHelper->InstallUeDevice(ueNodes1);
1770 ueDevs2 = lteHelper->InstallUeDevice(ueNodes2);
1773 lteHelper->Attach(ueDevs1, enbDevs.
Get(0));
1774 lteHelper->Attach(ueDevs2, enbDevs.
Get(1));
1788 lteHelper->ActivateDataRadioBearer(ueDevs1, bearer);
1789 lteHelper->ActivateDataRadioBearer(ueDevs2, bearer);
1795 ->GetDownlinkSpectrumPhy()
1801 testDlSpectrumPhy->SetRxSpectrumModel(
1803 dlChannel->AddRx(testDlSpectrumPhy);
1805 testDlSpectrumPhy->SetCellId(1);
1807 testDlSpectrumPhy->TraceConnectWithoutContext(
1815 ->GetUplinkSpectrumPhy()
1820 testUlSpectrumPhy->SetRxSpectrumModel(
1822 ulChannel->AddRx(testUlSpectrumPhy);
1824 testUlSpectrumPhy->SetCellId(1);
1826 testUlSpectrumPhy->TraceConnectWithoutContext(
1830 double expectedDlPowerCenterArea = 0.251189;
1831 std::vector<bool> expectedDlRbCenterArea;
1833 std::vector<bool> expectedUlRbCenterArea;
1837 expectedDlRbCenterArea[i] =
true;
1838 expectedUlRbCenterArea[i] =
true;
1842 expectedDlRbCenterArea[i] =
true;
1843 expectedUlRbCenterArea[i] =
true;
1847 expectedDlRbCenterArea[i] =
true;
1848 expectedUlRbCenterArea[i] =
true;
1851 double expectedDlPowerMiddleArea = 0.251189;
1852 std::vector<bool> expectedDlRbMiddleArea;
1854 std::vector<bool> expectedUlRbMiddleArea;
1858 expectedDlRbMiddleArea[i] =
true;
1859 expectedUlRbMiddleArea[i] =
true;
1862 double expectedDlPowerEdgeArea = 1.0;
1863 std::vector<bool> expectedDlRbEdgeArea;
1865 std::vector<bool> expectedUlRbEdgeArea;
1869 expectedDlRbEdgeArea[i] =
true;
1870 expectedUlRbEdgeArea[i] =
true;
1878 expectedDlPowerCenterArea,
1879 expectedDlRbCenterArea);
1884 expectedUlRbCenterArea);
1891 expectedDlPowerMiddleArea,
1892 expectedDlRbMiddleArea);
1897 expectedUlRbMiddleArea);
1904 expectedDlPowerEdgeArea,
1905 expectedDlRbEdgeArea);
1910 expectedUlRbEdgeArea);
1917 expectedDlPowerCenterArea,
1918 expectedDlRbCenterArea);
1923 expectedUlRbCenterArea);
1930 expectedDlPowerMiddleArea,
1931 expectedDlRbMiddleArea);
1936 expectedUlRbCenterArea);
1949 std::string schedulerType)
1952 NS_LOG_INFO(
"Creating LteDistributedFfrAreaTestCase");
1970 double eNbTxPower = 30;
1982 uint16_t bandwidth = 25;
1986 lteHelper->SetEpcHelper(epcHelper);
1987 lteHelper->SetHandoverAlgorithmType(
"ns3::NoOpHandoverAlgorithm");
1989 Ptr<Node> pgw = epcHelper->GetPgwNode();
1993 remoteHostContainer.
Create(1);
1996 internet.Install(remoteHostContainer);
2005 ipv4h.
SetBase(
"1.0.0.0",
"255.0.0.0");
2014 remoteHostStaticRouting->AddNetworkRouteTo(
Ipv4Address(
"7.0.0.0"),
Ipv4Mask(
"255.0.0.0"), 1);
2038 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
2039 positionAlloc->Add(Vector(1000, 0.0, 0.0));
2041 positionAlloc->Add(Vector(200, 0.0, 0.0));
2042 positionAlloc->Add(Vector(200, 0.0, 0.0));
2043 positionAlloc->Add(Vector(800, 0.0, 0.0));
2046 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
2047 mobility.SetPositionAllocator(positionAlloc);
2048 mobility.Install(allNodes);
2057 lteHelper->SetEnbDeviceAttribute(
"DlBandwidth",
UintegerValue(bandwidth));
2058 lteHelper->SetEnbDeviceAttribute(
"UlBandwidth",
UintegerValue(bandwidth));
2060 lteHelper->SetFfrAlgorithmType(
"ns3::LteFfrDistributedAlgorithm");
2062 lteHelper->SetFfrAlgorithmAttribute(
"RsrqThreshold",
UintegerValue(25));
2063 lteHelper->SetFfrAlgorithmAttribute(
"RsrpDifferenceThreshold",
UintegerValue(5));
2064 lteHelper->SetFfrAlgorithmAttribute(
"EdgeRbNum",
UintegerValue(6));
2065 lteHelper->SetFfrAlgorithmAttribute(
"CenterPowerOffset",
2067 lteHelper->SetFfrAlgorithmAttribute(
"EdgePowerOffset",
2070 enbDevs = lteHelper->InstallEnbDevice(enbNodes);
2071 ueDevs1 = lteHelper->InstallUeDevice(ueNodes1);
2072 ueDevs2 = lteHelper->InstallUeDevice(ueNodes2);
2075 ueLteDevs.
Add(ueDevs1);
2076 ueLteDevs.
Add(ueDevs2);
2079 lteHelper->AddX2Interface(enbNodes);
2082 internet.Install(ueNodes);
2092 ueStaticRouting->SetDefaultRoute(epcHelper->GetUeDefaultGatewayAddress(), 1);
2096 lteHelper->Attach(ueDevs1, enbDevs.
Get(0));
2097 lteHelper->Attach(ueDevs2, enbDevs.
Get(1));
2100 uint16_t dlPort = 10000;
2101 uint16_t ulPort = 20000;
2107 startTimeSeconds->SetAttribute(
"Min",
DoubleValue(0));
2108 startTimeSeconds->SetAttribute(
"Max",
DoubleValue(0.010));
2116 ueStaticRouting->SetDefaultRoute(epcHelper->GetUeDefaultGatewayAddress(), 1);
2130 clientApps.Add(dlClientHelper.
Install(remoteHost));
2133 serverApps.Add(dlPacketSinkHelper.
Install(ue));
2139 clientApps.Add(ulClientHelper.
Install(ue));
2142 serverApps.Add(ulPacketSinkHelper.
Install(remoteHost));
2164 lteHelper->ActivateDedicatedEpsBearer(ueLteDevs.
Get(u), bearer, tft);
2166 Time startTime =
Seconds(startTimeSeconds->GetValue());
2167 serverApps.Start(startTime);
2168 clientApps.Start(startTime);
2176 ->GetDownlinkSpectrumPhy()
2182 testDlSpectrumPhy->SetRxSpectrumModel(
2184 dlChannel->AddRx(testDlSpectrumPhy);
2186 testDlSpectrumPhy->SetCellId(2);
2188 testDlSpectrumPhy->TraceConnectWithoutContext(
2196 ->GetUplinkSpectrumPhy()
2201 testUlSpectrumPhy->SetRxSpectrumModel(
2203 ulChannel->AddRx(testUlSpectrumPhy);
2205 testUlSpectrumPhy->SetCellId(2);
2207 testUlSpectrumPhy->TraceConnectWithoutContext(
2211 double expectedDlPowerCenterArea = 1.0;
2212 std::vector<bool> expectedDlRbCenterArea;
2214 std::vector<bool> expectedUlRbCenterArea;
2218 expectedDlRbCenterArea[i] =
true;
2219 expectedUlRbCenterArea[i] =
true;
2222 double expectedDlPowerEdgeArea = 2.0;
2223 std::vector<bool> expectedDlRbEdgeArea;
2225 std::vector<bool> expectedUlRbEdgeArea;
2229 expectedDlRbEdgeArea[i] =
true;
2230 expectedUlRbEdgeArea[i] =
true;
2233 std::vector<bool> expectedDlRbEdgeArea2;
2235 std::vector<bool> expectedUlRbEdgeArea2;
2239 expectedDlRbEdgeArea2[i] =
true;
2240 expectedUlRbEdgeArea2[i] =
true;
2248 expectedDlPowerCenterArea,
2249 expectedDlRbCenterArea);
2254 expectedUlRbCenterArea);
2261 expectedDlPowerEdgeArea,
2262 expectedDlRbEdgeArea);
2267 expectedUlRbEdgeArea);
2275 expectedDlPowerEdgeArea,
2276 expectedDlRbEdgeArea2);
2281 expectedUlRbEdgeArea2);
2289 expectedDlPowerEdgeArea,
2290 expectedDlRbEdgeArea);
2295 expectedUlRbEdgeArea);
2302 expectedDlPowerCenterArea,
2303 expectedDlRbCenterArea);
2308 expectedUlRbCenterArea);
2315 "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