15#include "ns3/boolean.h"
16#include "ns3/callback.h"
17#include "ns3/config.h"
18#include "ns3/double.h"
20#include "ns3/ff-mac-scheduler.h"
21#include "ns3/internet-stack-helper.h"
22#include "ns3/ipv4-static-routing-helper.h"
23#include "ns3/ipv4-static-routing.h"
25#include "ns3/lte-common.h"
26#include "ns3/lte-enb-net-device.h"
27#include "ns3/lte-enb-phy.h"
28#include "ns3/lte-enb-rrc.h"
29#include "ns3/lte-helper.h"
30#include "ns3/lte-ue-net-device.h"
31#include "ns3/lte-ue-phy.h"
32#include "ns3/lte-ue-rrc.h"
33#include "ns3/mobility-helper.h"
34#include "ns3/packet-sink-helper.h"
35#include "ns3/point-to-point-epc-helper.h"
36#include "ns3/point-to-point-helper.h"
37#include "ns3/pointer.h"
38#include "ns3/simulator.h"
39#include "ns3/string.h"
40#include "ns3/udp-client-server-helper.h"
56 std::vector<bool> availableDlRb;
57 std::vector<bool> availableUlRb;
60 availableDlRb.push_back(
true);
61 availableUlRb.push_back(
true);
65 availableDlRb.push_back(
false);
66 availableUlRb.push_back(
false);
71 "ns3::PfFfMacScheduler",
83 "ns3::PfFfMacScheduler",
95 "ns3::PssFfMacScheduler",
107 "ns3::PssFfMacScheduler",
119 "ns3::CqaFfMacScheduler",
131 "ns3::CqaFfMacScheduler",
143 "ns3::FdTbfqFfMacScheduler",
155 "ns3::FdTbfqFfMacScheduler",
167 "ns3::TdTbfqFfMacScheduler",
179 "ns3::TdTbfqFfMacScheduler",
190 availableDlRb.clear();
191 availableUlRb.clear();
194 availableDlRb.push_back(
true);
195 availableUlRb.push_back(
true);
199 availableDlRb.push_back(
false);
200 availableUlRb.push_back(
false);
204 availableDlRb.push_back(
true);
205 availableUlRb.push_back(
true);
209 availableDlRb.push_back(
false);
210 availableUlRb.push_back(
false);
215 "ns3::PfFfMacScheduler",
229 "ns3::PfFfMacScheduler",
243 "ns3::PssFfMacScheduler",
257 "ns3::PssFfMacScheduler",
271 "ns3::CqaFfMacScheduler",
285 "ns3::CqaFfMacScheduler",
299 "ns3::FdTbfqFfMacScheduler",
313 "ns3::FdTbfqFfMacScheduler",
327 "ns3::TdTbfqFfMacScheduler",
341 "ns3::TdTbfqFfMacScheduler",
405 "ns3::FdTbfqFfMacScheduler"),
408 "ns3::TdTbfqFfMacScheduler"),
412 "ns3::PfFfMacScheduler"),
415 "ns3::PssFfMacScheduler"),
418 "ns3::CqaFfMacScheduler"),
421 "ns3::FdTbfqFfMacScheduler"),
424 "ns3::TdTbfqFfMacScheduler"),
451 uint16_t dlBandwidth,
452 uint16_t ulBandwidth,
453 std::vector<bool> availableDlRb,
454 std::vector<bool> availableUlRb)
475 for (
auto it = spectrumValue->ConstValuesBegin(); it != spectrumValue->ConstValuesEnd(); it++)
494 for (
auto it = spectrumValue->ConstValuesBegin(); it != spectrumValue->ConstValuesEnd(); it++)
515 std::string schedulerType,
516 uint16_t dlBandwidth,
517 uint16_t ulBandwidth,
518 uint8_t dlSubBandOffset,
519 uint16_t dlSubBandwidth,
520 uint8_t ulSubBandOffset,
521 uint16_t ulSubBandwidth,
522 std::vector<bool> availableDlRb,
523 std::vector<bool> availableUlRb)
524 :
LteFrTestCase(name, userNum, dlBandwidth, ulBandwidth, availableDlRb, availableUlRb),
551 lteHelper->SetFfrAlgorithmType(
"ns3::LteFrHardAlgorithm");
568 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
569 mobility.Install(allNodes);
575 enbDevs = lteHelper->InstallEnbDevice(enbNodes);
576 ueDevs = lteHelper->InstallUeDevice(ueNodes);
579 lteHelper->Attach(ueDevs, enbDevs.
Get(0));
593 lteHelper->ActivateDataRadioBearer(ueDevs, bearer);
599 ->GetDownlinkSpectrumPhy()
605 testDlSpectrumPhy->SetRxSpectrumModel(
607 dlChannel->AddRx(testDlSpectrumPhy);
609 testDlSpectrumPhy->TraceConnectWithoutContext(
617 ->GetUplinkSpectrumPhy()
622 testUlSpectrumPhy->SetRxSpectrumModel(
624 ulChannel->AddRx(testUlSpectrumPhy);
626 testUlSpectrumPhy->TraceConnectWithoutContext(
642 std::string schedulerType,
643 uint16_t dlBandwidth,
644 uint16_t ulBandwidth,
645 uint16_t dlCommonSubBandwidth,
646 uint8_t dlEdgeSubBandOffset,
647 uint16_t dlEdgeSubBandwidth,
648 uint16_t ulCommonSubBandwidth,
649 uint8_t ulEdgeSubBandOffset,
650 uint16_t ulEdgeSubBandwidth,
651 std::vector<bool> availableDlRb,
652 std::vector<bool> availableUlRb)
653 :
LteFrTestCase(name, userNum, dlBandwidth, ulBandwidth, availableDlRb, availableUlRb),
682 lteHelper->SetFfrAlgorithmType(
"ns3::LteFrStrictAlgorithm");
684 lteHelper->SetFfrAlgorithmAttribute(
"DlCommonSubBandwidth",
686 lteHelper->SetFfrAlgorithmAttribute(
"DlEdgeSubBandOffset",
690 lteHelper->SetFfrAlgorithmAttribute(
"UlCommonSubBandwidth",
692 lteHelper->SetFfrAlgorithmAttribute(
"UlEdgeSubBandOffset",
705 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
706 mobility.Install(allNodes);
712 enbDevs = lteHelper->InstallEnbDevice(enbNodes);
713 ueDevs = lteHelper->InstallUeDevice(ueNodes);
716 lteHelper->Attach(ueDevs, enbDevs.
Get(0));
731 lteHelper->ActivateDataRadioBearer(ueDevs, bearer);
737 ->GetDownlinkSpectrumPhy()
743 testDlSpectrumPhy->SetRxSpectrumModel(
745 dlChannel->AddRx(testDlSpectrumPhy);
747 testDlSpectrumPhy->TraceConnectWithoutContext(
755 ->GetUplinkSpectrumPhy()
760 testUlSpectrumPhy->SetRxSpectrumModel(
762 ulChannel->AddRx(testUlSpectrumPhy);
764 testUlSpectrumPhy->TraceConnectWithoutContext(
815 for (
auto it = spectrumValue->ConstValuesBegin(); it != spectrumValue->ConstValuesEnd(); it++)
833 "Wrong Data Channel DL Power level");
856 for (
auto it = spectrumValue->ConstValuesBegin(); it != spectrumValue->ConstValuesEnd(); it++)
865 NS_LOG_DEBUG(
"Total number of active RBs = " << numActiveRbs);
869 for (
auto it = spectrumValue->ConstValuesBegin(); it != spectrumValue->ConstValuesEnd(); it++)
871 double power = (*it) * (numActiveRbs * 180000);
883 "Wrong Data Channel UL Power level"
894 NS_LOG_DEBUG(
"Teleport UE to : (" <<
x <<
", " << y <<
", 0)");
902 double expectedPower,
903 std::vector<bool> expectedDlRb)
906 NS_LOG_DEBUG(
"Teleport UE to : (" <<
x <<
", " << y <<
", 0)");
917 double expectedPower,
918 std::vector<bool> expectedDlRb)
921 NS_LOG_DEBUG(
"Teleport UE to : (" <<
x <<
", " << y <<
", 0)");
924 ueMobility->SetPosition(Vector(
x, y, 0.0));
971 double eNbTxPower = 30;
1001 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
1002 positionAlloc->Add(Vector(1000, 0.0, 0.0));
1003 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
1004 positionAlloc->Add(Vector(1020, 0.0, 0.0));
1006 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
1007 mobility.SetPositionAllocator(positionAlloc);
1008 mobility.Install(allNodes);
1021 lteHelper->SetFfrAlgorithmType(
"ns3::LteFrStrictAlgorithm");
1022 lteHelper->SetFfrAlgorithmAttribute(
"RsrqThreshold",
UintegerValue(25));
1023 lteHelper->SetFfrAlgorithmAttribute(
"CenterPowerOffset",
1025 lteHelper->SetFfrAlgorithmAttribute(
"EdgePowerOffset",
1028 lteHelper->SetFfrAlgorithmAttribute(
"DlCommonSubBandwidth",
UintegerValue(6));
1029 lteHelper->SetFfrAlgorithmAttribute(
"DlEdgeSubBandOffset",
UintegerValue(6));
1030 lteHelper->SetFfrAlgorithmAttribute(
"DlEdgeSubBandwidth",
UintegerValue(6));
1032 lteHelper->SetFfrAlgorithmAttribute(
"UlCommonSubBandwidth",
UintegerValue(6));
1033 lteHelper->SetFfrAlgorithmAttribute(
"UlEdgeSubBandOffset",
UintegerValue(6));
1034 lteHelper->SetFfrAlgorithmAttribute(
"UlEdgeSubBandwidth",
UintegerValue(6));
1035 enbDevs.
Add(lteHelper->InstallEnbDevice(enbNodes.
Get(0)));
1037 lteHelper->SetFfrAlgorithmType(
"ns3::LteFrNoOpAlgorithm");
1038 enbDevs.
Add(lteHelper->InstallEnbDevice(enbNodes.
Get(1)));
1040 ueDevs1 = lteHelper->InstallUeDevice(ueNodes1);
1041 ueDevs2 = lteHelper->InstallUeDevice(ueNodes2);
1044 lteHelper->Attach(ueDevs1, enbDevs.
Get(0));
1045 lteHelper->Attach(ueDevs2, enbDevs.
Get(1));
1060 lteHelper->ActivateDataRadioBearer(ueDevs1, bearer);
1061 lteHelper->ActivateDataRadioBearer(ueDevs2, bearer);
1067 ->GetDownlinkSpectrumPhy()
1073 testDlSpectrumPhy->SetRxSpectrumModel(
1075 dlChannel->AddRx(testDlSpectrumPhy);
1077 testDlSpectrumPhy->SetCellId(1);
1079 testDlSpectrumPhy->TraceConnectWithoutContext(
1087 ->GetUplinkSpectrumPhy()
1092 testUlSpectrumPhy->SetRxSpectrumModel(
1094 ulChannel->AddRx(testUlSpectrumPhy);
1096 testUlSpectrumPhy->SetCellId(1);
1098 testUlSpectrumPhy->TraceConnectWithoutContext(
1102 std::vector<bool> expectedDlRbCenterArea;
1104 std::vector<bool> expectedUlRbCenterArea;
1108 expectedDlRbCenterArea[i] =
true;
1109 expectedUlRbCenterArea[i] =
true;
1112 std::vector<bool> expectedDlRbEdgeArea;
1114 std::vector<bool> expectedUlRbEdgeArea;
1118 expectedDlRbEdgeArea[i] =
true;
1119 expectedUlRbEdgeArea[i] =
true;
1128 expectedDlRbCenterArea);
1133 expectedUlRbCenterArea);
1141 expectedDlRbEdgeArea);
1146 expectedUlRbEdgeArea);
1154 expectedDlRbCenterArea);
1159 expectedUlRbCenterArea);
1190 double eNbTxPower = 30;
1220 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
1221 positionAlloc->Add(Vector(1000, 0.0, 0.0));
1222 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
1223 positionAlloc->Add(Vector(1020, 0.0, 0.0));
1225 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
1226 mobility.SetPositionAllocator(positionAlloc);
1227 mobility.Install(allNodes);
1240 lteHelper->SetFfrAlgorithmType(
"ns3::LteFrSoftAlgorithm");
1241 lteHelper->SetFfrAlgorithmAttribute(
"AllowCenterUeUseEdgeSubBand",
BooleanValue(
false));
1242 lteHelper->SetFfrAlgorithmAttribute(
"RsrqThreshold",
UintegerValue(25));
1243 lteHelper->SetFfrAlgorithmAttribute(
"CenterPowerOffset",
1245 lteHelper->SetFfrAlgorithmAttribute(
"EdgePowerOffset",
1248 lteHelper->SetFfrAlgorithmAttribute(
"DlEdgeSubBandOffset",
UintegerValue(8));
1249 lteHelper->SetFfrAlgorithmAttribute(
"DlEdgeSubBandwidth",
UintegerValue(8));
1250 lteHelper->SetFfrAlgorithmAttribute(
"UlEdgeSubBandOffset",
UintegerValue(8));
1251 lteHelper->SetFfrAlgorithmAttribute(
"UlEdgeSubBandwidth",
UintegerValue(8));
1252 enbDevs.
Add(lteHelper->InstallEnbDevice(enbNodes.
Get(0)));
1254 lteHelper->SetFfrAlgorithmType(
"ns3::LteFrNoOpAlgorithm");
1255 enbDevs.
Add(lteHelper->InstallEnbDevice(enbNodes.
Get(1)));
1257 ueDevs1 = lteHelper->InstallUeDevice(ueNodes1);
1258 ueDevs2 = lteHelper->InstallUeDevice(ueNodes2);
1261 lteHelper->Attach(ueDevs1, enbDevs.
Get(0));
1262 lteHelper->Attach(ueDevs2, enbDevs.
Get(1));
1276 lteHelper->ActivateDataRadioBearer(ueDevs1, bearer);
1277 lteHelper->ActivateDataRadioBearer(ueDevs2, bearer);
1283 ->GetDownlinkSpectrumPhy()
1289 testDlSpectrumPhy->SetRxSpectrumModel(
1291 dlChannel->AddRx(testDlSpectrumPhy);
1293 testDlSpectrumPhy->SetCellId(1);
1295 testDlSpectrumPhy->TraceConnectWithoutContext(
1303 ->GetUplinkSpectrumPhy()
1308 testUlSpectrumPhy->SetRxSpectrumModel(
1310 ulChannel->AddRx(testUlSpectrumPhy);
1312 testUlSpectrumPhy->SetCellId(1);
1314 testUlSpectrumPhy->TraceConnectWithoutContext(
1318 std::vector<bool> expectedDlRbCenterArea;
1320 std::vector<bool> expectedUlRbCenterArea;
1324 expectedDlRbCenterArea[i] =
true;
1325 expectedUlRbCenterArea[i] =
true;
1329 expectedDlRbCenterArea[i] =
true;
1332 std::vector<bool> expectedDlRbEdgeArea;
1334 std::vector<bool> expectedUlRbEdgeArea;
1338 expectedDlRbEdgeArea[i] =
true;
1339 expectedUlRbEdgeArea[i] =
true;
1348 expectedDlRbCenterArea);
1353 expectedUlRbCenterArea);
1361 expectedDlRbEdgeArea);
1366 expectedUlRbEdgeArea);
1374 expectedDlRbCenterArea);
1379 expectedUlRbCenterArea);
1386 "Scheduler used DL RBG muted by FFR Algorithm");
1414 double eNbTxPower = 30;
1444 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
1445 positionAlloc->Add(Vector(1000, 0.0, 0.0));
1446 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
1447 positionAlloc->Add(Vector(1020, 0.0, 0.0));
1449 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
1450 mobility.SetPositionAllocator(positionAlloc);
1451 mobility.Install(allNodes);
1464 lteHelper->SetFfrAlgorithmType(
"ns3::LteFfrSoftAlgorithm");
1465 lteHelper->SetFfrAlgorithmAttribute(
"CenterRsrqThreshold",
UintegerValue(28));
1466 lteHelper->SetFfrAlgorithmAttribute(
"EdgeRsrqThreshold",
UintegerValue(18));
1467 lteHelper->SetFfrAlgorithmAttribute(
"CenterAreaPowerOffset",
1469 lteHelper->SetFfrAlgorithmAttribute(
"MediumAreaPowerOffset",
1471 lteHelper->SetFfrAlgorithmAttribute(
"EdgeAreaPowerOffset",
1474 lteHelper->SetFfrAlgorithmAttribute(
"UlCommonSubBandwidth",
UintegerValue(6));
1475 lteHelper->SetFfrAlgorithmAttribute(
"DlCommonSubBandwidth",
UintegerValue(6));
1477 lteHelper->SetFfrAlgorithmAttribute(
"DlEdgeSubBandOffset",
UintegerValue(6));
1478 lteHelper->SetFfrAlgorithmAttribute(
"DlEdgeSubBandwidth",
UintegerValue(6));
1479 lteHelper->SetFfrAlgorithmAttribute(
"UlEdgeSubBandOffset",
UintegerValue(6));
1480 lteHelper->SetFfrAlgorithmAttribute(
"UlEdgeSubBandwidth",
UintegerValue(6));
1481 enbDevs.
Add(lteHelper->InstallEnbDevice(enbNodes.
Get(0)));
1483 lteHelper->SetFfrAlgorithmType(
"ns3::LteFrNoOpAlgorithm");
1484 enbDevs.
Add(lteHelper->InstallEnbDevice(enbNodes.
Get(1)));
1486 ueDevs1 = lteHelper->InstallUeDevice(ueNodes1);
1487 ueDevs2 = lteHelper->InstallUeDevice(ueNodes2);
1490 lteHelper->Attach(ueDevs1, enbDevs.
Get(0));
1491 lteHelper->Attach(ueDevs2, enbDevs.
Get(1));
1505 lteHelper->ActivateDataRadioBearer(ueDevs1, bearer);
1506 lteHelper->ActivateDataRadioBearer(ueDevs2, bearer);
1512 ->GetDownlinkSpectrumPhy()
1518 testDlSpectrumPhy->SetRxSpectrumModel(
1520 dlChannel->AddRx(testDlSpectrumPhy);
1522 testDlSpectrumPhy->SetCellId(1);
1524 testDlSpectrumPhy->TraceConnectWithoutContext(
1532 ->GetUplinkSpectrumPhy()
1537 testUlSpectrumPhy->SetRxSpectrumModel(
1539 ulChannel->AddRx(testUlSpectrumPhy);
1541 testUlSpectrumPhy->SetCellId(1);
1543 testUlSpectrumPhy->TraceConnectWithoutContext(
1547 double expectedDlPowerCenterArea = 0.5;
1548 std::vector<bool> expectedDlRbCenterArea;
1550 std::vector<bool> expectedUlRbCenterArea;
1554 expectedDlRbCenterArea[i] =
true;
1555 expectedUlRbCenterArea[i] =
true;
1559 expectedDlRbCenterArea[i] =
true;
1560 expectedUlRbCenterArea[i] =
true;
1563 double expectedDlPowerMiddleArea = 1.0;
1564 std::vector<bool> expectedDlRbMiddleArea;
1566 std::vector<bool> expectedUlRbMiddleArea;
1570 expectedDlRbMiddleArea[i] =
true;
1571 expectedUlRbMiddleArea[i] =
true;
1574 double expectedDlPowerEdgeArea = 2.0;
1575 std::vector<bool> expectedDlRbEdgeArea;
1577 std::vector<bool> expectedUlRbEdgeArea;
1581 expectedDlRbEdgeArea[i] =
true;
1582 expectedUlRbEdgeArea[i] =
true;
1590 expectedDlPowerCenterArea,
1591 expectedDlRbCenterArea);
1596 expectedUlRbCenterArea);
1603 expectedDlPowerMiddleArea,
1604 expectedDlRbMiddleArea);
1609 expectedUlRbMiddleArea);
1616 expectedDlPowerEdgeArea,
1617 expectedDlRbEdgeArea);
1622 expectedUlRbEdgeArea);
1629 expectedDlPowerMiddleArea,
1630 expectedDlRbMiddleArea);
1635 expectedUlRbMiddleArea);
1642 expectedDlPowerCenterArea,
1643 expectedDlRbCenterArea);
1648 expectedUlRbCenterArea);
1663 NS_LOG_INFO(
"Creating LteEnhancedFfrAreaTestCase");
1681 double eNbTxPower = 30;
1711 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
1712 positionAlloc->Add(Vector(1000, 0.0, 0.0));
1713 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
1714 positionAlloc->Add(Vector(1020, 0.0, 0.0));
1716 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
1717 mobility.SetPositionAllocator(positionAlloc);
1718 mobility.Install(allNodes);
1730 lteHelper->SetSchedulerAttribute(
"HarqEnabled",
BooleanValue(
true));
1735 lteHelper->SetFfrAlgorithmType(
"ns3::LteFfrEnhancedAlgorithm");
1736 lteHelper->SetFfrAlgorithmAttribute(
"RsrqThreshold",
UintegerValue(25));
1737 lteHelper->SetFfrAlgorithmAttribute(
"DlCqiThreshold",
UintegerValue(10));
1738 lteHelper->SetFfrAlgorithmAttribute(
"UlCqiThreshold",
UintegerValue(15));
1739 lteHelper->SetFfrAlgorithmAttribute(
"CenterAreaPowerOffset",
1741 lteHelper->SetFfrAlgorithmAttribute(
"EdgeAreaPowerOffset",
1744 lteHelper->SetFfrAlgorithmAttribute(
"UlSubBandOffset",
UintegerValue(0));
1745 lteHelper->SetFfrAlgorithmAttribute(
"UlReuse3SubBandwidth",
UintegerValue(4));
1746 lteHelper->SetFfrAlgorithmAttribute(
"UlReuse1SubBandwidth",
UintegerValue(4));
1748 lteHelper->SetFfrAlgorithmAttribute(
"DlSubBandOffset",
UintegerValue(0));
1749 lteHelper->SetFfrAlgorithmAttribute(
"DlReuse3SubBandwidth",
UintegerValue(4));
1750 lteHelper->SetFfrAlgorithmAttribute(
"DlReuse1SubBandwidth",
UintegerValue(4));
1752 enbDevs.
Add(lteHelper->InstallEnbDevice(enbNodes.
Get(0)));
1754 lteHelper->SetFfrAlgorithmType(
"ns3::LteFrNoOpAlgorithm");
1755 enbDevs.
Add(lteHelper->InstallEnbDevice(enbNodes.
Get(1)));
1757 ueDevs1 = lteHelper->InstallUeDevice(ueNodes1);
1758 ueDevs2 = lteHelper->InstallUeDevice(ueNodes2);
1761 lteHelper->Attach(ueDevs1, enbDevs.
Get(0));
1762 lteHelper->Attach(ueDevs2, enbDevs.
Get(1));
1776 lteHelper->ActivateDataRadioBearer(ueDevs1, bearer);
1777 lteHelper->ActivateDataRadioBearer(ueDevs2, bearer);
1783 ->GetDownlinkSpectrumPhy()
1789 testDlSpectrumPhy->SetRxSpectrumModel(
1791 dlChannel->AddRx(testDlSpectrumPhy);
1793 testDlSpectrumPhy->SetCellId(1);
1795 testDlSpectrumPhy->TraceConnectWithoutContext(
1803 ->GetUplinkSpectrumPhy()
1808 testUlSpectrumPhy->SetRxSpectrumModel(
1810 ulChannel->AddRx(testUlSpectrumPhy);
1812 testUlSpectrumPhy->SetCellId(1);
1814 testUlSpectrumPhy->TraceConnectWithoutContext(
1818 double expectedDlPowerCenterArea = 0.251189;
1819 std::vector<bool> expectedDlRbCenterArea;
1821 std::vector<bool> expectedUlRbCenterArea;
1825 expectedDlRbCenterArea[i] =
true;
1826 expectedUlRbCenterArea[i] =
true;
1830 expectedDlRbCenterArea[i] =
true;
1831 expectedUlRbCenterArea[i] =
true;
1835 expectedDlRbCenterArea[i] =
true;
1836 expectedUlRbCenterArea[i] =
true;
1839 double expectedDlPowerMiddleArea = 0.251189;
1840 std::vector<bool> expectedDlRbMiddleArea;
1842 std::vector<bool> expectedUlRbMiddleArea;
1846 expectedDlRbMiddleArea[i] =
true;
1847 expectedUlRbMiddleArea[i] =
true;
1850 double expectedDlPowerEdgeArea = 1.0;
1851 std::vector<bool> expectedDlRbEdgeArea;
1853 std::vector<bool> expectedUlRbEdgeArea;
1857 expectedDlRbEdgeArea[i] =
true;
1858 expectedUlRbEdgeArea[i] =
true;
1866 expectedDlPowerCenterArea,
1867 expectedDlRbCenterArea);
1872 expectedUlRbCenterArea);
1879 expectedDlPowerMiddleArea,
1880 expectedDlRbMiddleArea);
1885 expectedUlRbMiddleArea);
1892 expectedDlPowerEdgeArea,
1893 expectedDlRbEdgeArea);
1898 expectedUlRbEdgeArea);
1905 expectedDlPowerCenterArea,
1906 expectedDlRbCenterArea);
1911 expectedUlRbCenterArea);
1918 expectedDlPowerMiddleArea,
1919 expectedDlRbMiddleArea);
1924 expectedUlRbCenterArea);
1937 std::string schedulerType)
1940 NS_LOG_INFO(
"Creating LteDistributedFfrAreaTestCase");
1958 double eNbTxPower = 30;
1970 uint16_t bandwidth = 25;
1974 lteHelper->SetEpcHelper(epcHelper);
1975 lteHelper->SetHandoverAlgorithmType(
"ns3::NoOpHandoverAlgorithm");
1977 Ptr<Node> pgw = epcHelper->GetPgwNode();
1981 remoteHostContainer.
Create(1);
1984 internet.Install(remoteHostContainer);
1993 ipv4h.
SetBase(
"1.0.0.0",
"255.0.0.0");
2002 remoteHostStaticRouting->AddNetworkRouteTo(
Ipv4Address(
"7.0.0.0"),
Ipv4Mask(
"255.0.0.0"), 1);
2026 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
2027 positionAlloc->Add(Vector(1000, 0.0, 0.0));
2029 positionAlloc->Add(Vector(200, 0.0, 0.0));
2030 positionAlloc->Add(Vector(200, 0.0, 0.0));
2031 positionAlloc->Add(Vector(800, 0.0, 0.0));
2034 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
2035 mobility.SetPositionAllocator(positionAlloc);
2036 mobility.Install(allNodes);
2045 lteHelper->SetEnbDeviceAttribute(
"DlBandwidth",
UintegerValue(bandwidth));
2046 lteHelper->SetEnbDeviceAttribute(
"UlBandwidth",
UintegerValue(bandwidth));
2048 lteHelper->SetFfrAlgorithmType(
"ns3::LteFfrDistributedAlgorithm");
2050 lteHelper->SetFfrAlgorithmAttribute(
"RsrqThreshold",
UintegerValue(25));
2051 lteHelper->SetFfrAlgorithmAttribute(
"RsrpDifferenceThreshold",
UintegerValue(5));
2052 lteHelper->SetFfrAlgorithmAttribute(
"EdgeRbNum",
UintegerValue(6));
2053 lteHelper->SetFfrAlgorithmAttribute(
"CenterPowerOffset",
2055 lteHelper->SetFfrAlgorithmAttribute(
"EdgePowerOffset",
2058 enbDevs = lteHelper->InstallEnbDevice(enbNodes);
2059 ueDevs1 = lteHelper->InstallUeDevice(ueNodes1);
2060 ueDevs2 = lteHelper->InstallUeDevice(ueNodes2);
2063 ueLteDevs.
Add(ueDevs1);
2064 ueLteDevs.
Add(ueDevs2);
2067 lteHelper->AddX2Interface(enbNodes);
2070 internet.Install(ueNodes);
2080 ueStaticRouting->SetDefaultRoute(epcHelper->GetUeDefaultGatewayAddress(), 1);
2084 lteHelper->Attach(ueDevs1, enbDevs.
Get(0));
2085 lteHelper->Attach(ueDevs2, enbDevs.
Get(1));
2088 uint16_t dlPort = 10000;
2089 uint16_t ulPort = 20000;
2095 startTimeSeconds->SetAttribute(
"Min",
DoubleValue(0));
2096 startTimeSeconds->SetAttribute(
"Max",
DoubleValue(0.010));
2104 ueStaticRouting->SetDefaultRoute(epcHelper->GetUeDefaultGatewayAddress(), 1);
2118 clientApps.Add(dlClientHelper.
Install(remoteHost));
2121 serverApps.Add(dlPacketSinkHelper.
Install(ue));
2127 clientApps.Add(ulClientHelper.
Install(ue));
2130 serverApps.Add(ulPacketSinkHelper.
Install(remoteHost));
2152 lteHelper->ActivateDedicatedEpsBearer(ueLteDevs.
Get(
u), bearer, tft);
2154 Time startTime =
Seconds(startTimeSeconds->GetValue());
2155 serverApps.Start(startTime);
2156 clientApps.Start(startTime);
2164 ->GetDownlinkSpectrumPhy()
2170 testDlSpectrumPhy->SetRxSpectrumModel(
2172 dlChannel->AddRx(testDlSpectrumPhy);
2174 testDlSpectrumPhy->SetCellId(2);
2176 testDlSpectrumPhy->TraceConnectWithoutContext(
2184 ->GetUplinkSpectrumPhy()
2189 testUlSpectrumPhy->SetRxSpectrumModel(
2191 ulChannel->AddRx(testUlSpectrumPhy);
2193 testUlSpectrumPhy->SetCellId(2);
2195 testUlSpectrumPhy->TraceConnectWithoutContext(
2199 double expectedDlPowerCenterArea = 1.0;
2200 std::vector<bool> expectedDlRbCenterArea;
2202 std::vector<bool> expectedUlRbCenterArea;
2206 expectedDlRbCenterArea[i] =
true;
2207 expectedUlRbCenterArea[i] =
true;
2210 double expectedDlPowerEdgeArea = 2.0;
2211 std::vector<bool> expectedDlRbEdgeArea;
2213 std::vector<bool> expectedUlRbEdgeArea;
2217 expectedDlRbEdgeArea[i] =
true;
2218 expectedUlRbEdgeArea[i] =
true;
2221 std::vector<bool> expectedDlRbEdgeArea2;
2223 std::vector<bool> expectedUlRbEdgeArea2;
2227 expectedDlRbEdgeArea2[i] =
true;
2228 expectedUlRbEdgeArea2[i] =
true;
2236 expectedDlPowerCenterArea,
2237 expectedDlRbCenterArea);
2242 expectedUlRbCenterArea);
2249 expectedDlPowerEdgeArea,
2250 expectedDlRbEdgeArea);
2255 expectedUlRbEdgeArea);
2263 expectedDlPowerEdgeArea,
2264 expectedDlRbEdgeArea2);
2269 expectedUlRbEdgeArea2);
2277 expectedDlPowerEdgeArea,
2278 expectedDlRbEdgeArea);
2283 expectedUlRbEdgeArea);
2290 expectedDlPowerCenterArea,
2291 expectedDlRbCenterArea);
2296 expectedUlRbCenterArea);
2303 "Scheduler used DL RBG muted by FFR Algorithm");
cairo_uint64_t x
_cairo_uint_96by64_32x64_divrem:
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.
TestCase(const TestCase &)=delete
Caller graph was not generated because of its size.
TestSuite(std::string name, Type type=Type::UNIT)
Construct a new 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