22 #include <ns3/simulator.h>
24 #include <ns3/callback.h>
25 #include <ns3/config.h>
26 #include <ns3/string.h>
27 #include <ns3/double.h>
29 #include <ns3/boolean.h>
30 #include <ns3/pointer.h>
32 #include "ns3/mobility-helper.h"
33 #include "ns3/lte-helper.h"
34 #include "ns3/point-to-point-epc-helper.h"
35 #include "ns3/internet-module.h"
36 #include "ns3/point-to-point-module.h"
37 #include "ns3/applications-module.h"
39 #include <ns3/ff-mac-scheduler.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>
49 #include <ns3/lte-common.h>
63 :
TestSuite (
"lte-frequency-reuse", SYSTEM)
68 std::vector<bool> availableDlRb;
69 std::vector<bool> availableUlRb;
70 for (uint32_t i = 0; i < 12; i++)
72 availableDlRb.push_back (
true);
73 availableUlRb.push_back (
true);
75 for (uint32_t i = 12; i < 25; i++)
77 availableDlRb.push_back (
false);
78 availableUlRb.push_back (
false);
81 AddTestCase (
new LteHardFrTestCase (
"DownlinkHardFrPf1", 1,
"ns3::PfFfMacScheduler", 25, 25, 0, 12, 0, 12, availableDlRb, availableUlRb), TestCase::QUICK);
82 AddTestCase (
new LteHardFrTestCase (
"DownlinkHardFrPf2", 5,
"ns3::PfFfMacScheduler", 25, 25, 0, 12, 0, 12, availableDlRb, availableUlRb), TestCase::QUICK);
83 AddTestCase (
new LteHardFrTestCase (
"DownlinkHardFrPss1", 1,
"ns3::PssFfMacScheduler", 25, 25, 0, 12, 0, 12, availableDlRb, availableUlRb), TestCase::QUICK);
84 AddTestCase (
new LteHardFrTestCase (
"DownlinkHardFrPss2", 5,
"ns3::PssFfMacScheduler", 25, 25, 0, 12, 0, 12, availableDlRb, availableUlRb), TestCase::QUICK);
85 AddTestCase (
new LteHardFrTestCase (
"DownlinkHardFrCqa1", 1,
"ns3::CqaFfMacScheduler", 25, 25, 0, 12, 0, 12, availableDlRb, availableUlRb), TestCase::QUICK);
86 AddTestCase (
new LteHardFrTestCase (
"DownlinkHardFrCqa2", 5,
"ns3::CqaFfMacScheduler", 25, 25, 0, 12, 0, 12, availableDlRb, availableUlRb), TestCase::QUICK);
87 AddTestCase (
new LteHardFrTestCase (
"DownlinkHardFrFdTbfq1", 1,
"ns3::FdTbfqFfMacScheduler", 25, 25, 0, 12, 0, 12, availableDlRb, availableUlRb), TestCase::QUICK);
88 AddTestCase (
new LteHardFrTestCase (
"DownlinkHardFrFdTbfq2", 5,
"ns3::FdTbfqFfMacScheduler", 25, 25, 0, 12, 0, 12, availableDlRb, availableUlRb), TestCase::QUICK);
89 AddTestCase (
new LteHardFrTestCase (
"DownlinkHardFrTdTbfq1", 1,
"ns3::TdTbfqFfMacScheduler", 25, 25, 0, 12, 0, 12, availableDlRb, availableUlRb), TestCase::QUICK);
90 AddTestCase (
new LteHardFrTestCase (
"DownlinkHardFrTdTbfq2", 5,
"ns3::TdTbfqFfMacScheduler", 25, 25, 0, 12, 0, 12, availableDlRb, availableUlRb), TestCase::QUICK);
92 availableDlRb.clear ();
93 availableUlRb.clear ();
94 for (uint32_t i = 0; i < 6; i++)
96 availableDlRb.push_back (
true);
97 availableUlRb.push_back (
true);
99 for (uint32_t i = 6; i < 12; i++)
101 availableDlRb.push_back (
false);
102 availableUlRb.push_back (
false);
104 for (uint32_t i = 12; i < 18; i++)
106 availableDlRb.push_back (
true);
107 availableUlRb.push_back (
true);
109 for (uint32_t i = 18; i < 25; i++)
111 availableDlRb.push_back (
false);
112 availableUlRb.push_back (
false);
115 AddTestCase (
new LteStrictFrTestCase (
"DownlinkStrictFrPf1", 1,
"ns3::PfFfMacScheduler", 25, 25, 6, 6, 6, 6, 6, 6, availableDlRb, availableUlRb), TestCase::QUICK);
116 AddTestCase (
new LteStrictFrTestCase (
"DownlinkStrictFrPf2", 5,
"ns3::PfFfMacScheduler", 25, 25, 6, 6, 6, 6, 6, 6, availableDlRb, availableUlRb), TestCase::QUICK);
117 AddTestCase (
new LteStrictFrTestCase (
"DownlinkStrictFrPss1", 1,
"ns3::PssFfMacScheduler", 25, 25, 6, 6, 6, 6, 6, 6, availableDlRb, availableUlRb), TestCase::QUICK);
118 AddTestCase (
new LteStrictFrTestCase (
"DownlinkStrictFrPss2", 5,
"ns3::PssFfMacScheduler", 25, 25, 6, 6, 6, 6, 6, 6, availableDlRb, availableUlRb), TestCase::QUICK);
119 AddTestCase (
new LteStrictFrTestCase (
"DownlinkStrictFrCqa1", 1,
"ns3::CqaFfMacScheduler", 25, 25, 6, 6, 6, 6, 6, 6, availableDlRb, availableUlRb), TestCase::QUICK);
120 AddTestCase (
new LteStrictFrTestCase (
"DownlinkStrictFrCqa2", 5,
"ns3::CqaFfMacScheduler", 25, 25, 6, 6, 6, 6, 6, 6, availableDlRb, availableUlRb), TestCase::QUICK);
121 AddTestCase (
new LteStrictFrTestCase (
"DownlinkStrictFrCqaFdTbfq1", 1,
"ns3::FdTbfqFfMacScheduler", 25, 25, 6, 6, 6, 6, 6, 6, availableDlRb, availableUlRb), TestCase::QUICK);
122 AddTestCase (
new LteStrictFrTestCase (
"DownlinkStrictFrCqaFdTbfq2", 5,
"ns3::FdTbfqFfMacScheduler", 25, 25, 6, 6, 6, 6, 6, 6, availableDlRb, availableUlRb), TestCase::QUICK);
123 AddTestCase (
new LteStrictFrTestCase (
"DownlinkStrictFrCqaTdTbfq1", 1,
"ns3::TdTbfqFfMacScheduler", 25, 25, 6, 6, 6, 6, 6, 6, availableDlRb, availableUlRb), TestCase::QUICK);
124 AddTestCase (
new LteStrictFrTestCase (
"DownlinkStrictFrCqaTdTbfq2", 5,
"ns3::TdTbfqFfMacScheduler", 25, 25, 6, 6, 6, 6, 6, 6, availableDlRb, availableUlRb), TestCase::QUICK);
178 uint32_t userNum,uint16_t dlBandwidth,uint16_t ulBandwidth,
179 std::vector<bool> availableDlRb, std::vector<bool> availableUlRb)
182 m_dlBandwidth (dlBandwidth),
183 m_ulBandwidth (ulBandwidth),
184 m_availableDlRb (availableDlRb),
185 m_usedMutedDlRbg (false),
186 m_availableUlRb (availableUlRb),
187 m_usedMutedUlRbg (false)
199 Values::const_iterator it;
201 for (it = spectrumValue->ConstValuesBegin (); it != spectrumValue->ConstValuesEnd (); it++)
218 Values::const_iterator it;
220 for (it = spectrumValue->ConstValuesBegin (); it != spectrumValue->ConstValuesEnd (); it++)
240 std::string schedulerType,
241 uint16_t dlBandwidth, uint16_t ulBandwidth,
242 uint8_t dlSubBandOffset, uint16_t dlSubBandwidth,
243 uint8_t ulSubBandOffset, uint16_t ulSubBandwidth,
244 std::vector<bool> availableDlRb, std::vector<bool> availableUlRb)
245 :
LteFrTestCase (name, userNum, dlBandwidth, ulBandwidth, availableDlRb, availableUlRb),
246 m_schedulerType (schedulerType),
247 m_dlSubBandOffset (dlSubBandOffset),
248 m_dlSubBandwidth (dlSubBandwidth),
249 m_ulSubBandOffset (ulSubBandOffset),
250 m_ulSubBandwidth (ulSubBandwidth)
289 mobility.SetMobilityModel (
"ns3::ConstantPositionMobilityModel");
300 lteHelper->
Attach (ueDevs, enbDevs.
Get (0));
322 testDlSpectrumPhy->SetRxSpectrumModel (LteSpectrumValueHelper::GetSpectrumModel (eNbDev->
GetDlEarfcn (),
m_dlBandwidth));
323 dlChannel->AddRx (testDlSpectrumPhy);
325 testDlSpectrumPhy->TraceConnectWithoutContext (
"RxStart",
333 testUlSpectrumPhy->SetRxSpectrumModel (LteSpectrumValueHelper::GetSpectrumModel (eNbDev->
GetUlEarfcn (),
m_ulBandwidth));
334 ulChannel->AddRx (testUlSpectrumPhy);
336 testUlSpectrumPhy->TraceConnectWithoutContext (
"RxStart",
339 Simulator::Stop (
Seconds (0.500));
343 "Scheduler used DL RBG muted by FFR Algorithm");
346 "Scheduler used UL RBG muted by FFR Algorithm");
348 Simulator::Destroy ();
354 std::string schedulerType,
355 uint16_t dlBandwidth, uint16_t ulBandwidth,
356 uint16_t dlCommonSubBandwidth, uint8_t dlEdgeSubBandOffset, uint16_t dlEdgeSubBandwidth,
357 uint16_t ulCommonSubBandwidth, uint8_t ulEdgeSubBandOffset, uint16_t ulEdgeSubBandwidth,
358 std::vector<bool> availableDlRb, std::vector<bool> availableUlRb)
359 :
LteFrTestCase (name, userNum, dlBandwidth, ulBandwidth, availableDlRb, availableUlRb),
360 m_schedulerType (schedulerType),
361 m_dlCommonSubBandwidth (dlCommonSubBandwidth),
362 m_dlEdgeSubBandOffset (dlEdgeSubBandOffset),
363 m_dlEdgeSubBandwidth (dlEdgeSubBandwidth),
364 m_ulCommonSubBandwidth (ulCommonSubBandwidth),
365 m_ulEdgeSubBandOffset (ulEdgeSubBandOffset),
366 m_ulEdgeSubBandwidth (ulEdgeSubBandwidth)
406 mobility.SetMobilityModel (
"ns3::ConstantPositionMobilityModel");
417 lteHelper->
Attach (ueDevs, enbDevs.
Get (0));
440 testDlSpectrumPhy->SetRxSpectrumModel (LteSpectrumValueHelper::GetSpectrumModel (eNbDev->
GetDlEarfcn (),
m_dlBandwidth));
441 dlChannel->AddRx (testDlSpectrumPhy);
443 testDlSpectrumPhy->TraceConnectWithoutContext (
"RxStart",
451 testUlSpectrumPhy->SetRxSpectrumModel (LteSpectrumValueHelper::GetSpectrumModel (eNbDev->
GetUlEarfcn (),
m_ulBandwidth));
452 ulChannel->AddRx (testUlSpectrumPhy);
454 testUlSpectrumPhy->TraceConnectWithoutContext (
"RxStart",
457 Simulator::Stop (
Seconds (0.500));
461 "Scheduler used DL RBG muted by FFR Algorithm");
464 "Scheduler used UL RBG muted by FFR Algorithm");
466 Simulator::Destroy ();
485 m_schedulerType (schedulerType)
505 Values::const_iterator it;
507 for (it = spectrumValue->ConstValuesBegin (); it != spectrumValue->ConstValuesEnd (); it++)
510 NS_LOG_DEBUG (
"RB " << i <<
" POWER: " <<
" " << power);
521 "Wrong Data Channel DL Power level");
537 Values::const_iterator it;
539 uint32_t numActiveRbs = 0;
545 for (it = spectrumValue->ConstValuesBegin (); it != spectrumValue->ConstValuesEnd (); it++)
554 NS_LOG_DEBUG (
"Total number of active RBs = " << numActiveRbs);
558 for (it = spectrumValue->ConstValuesBegin (); it != spectrumValue->ConstValuesEnd (); it++)
560 double power = (*it) * (numActiveRbs * 180000);
569 "Wrong Data Channel UL Power level" <<
Simulator::Now ().As (Time::S));
579 NS_LOG_DEBUG (
"Teleport UE to : (" <<
x <<
", " << y <<
", 0)");
586 std::vector<bool> expectedDlRb)
589 NS_LOG_DEBUG (
"Teleport UE to : (" <<
x <<
", " << y <<
", 0)");
598 std::vector<bool> expectedDlRb)
601 NS_LOG_DEBUG (
"Teleport UE to : (" <<
x <<
", " << y <<
", 0)");
649 double eNbTxPower = 30;
679 positionAlloc->Add (Vector (0.0, 0.0, 0.0));
680 positionAlloc->Add (Vector (1000, 0.0, 0.0));
681 positionAlloc->Add (Vector (0.0, 0.0, 0.0));
682 positionAlloc->Add (Vector (1020, 0.0, 0.0));
684 mobility.SetMobilityModel (
"ns3::ConstantPositionMobilityModel");
685 mobility.SetPositionAllocator (positionAlloc);
724 lteHelper->
Attach (ueDevs1, enbDevs.
Get (0));
725 lteHelper->
Attach (ueDevs2, enbDevs.
Get (1));
749 testDlSpectrumPhy->SetRxSpectrumModel (LteSpectrumValueHelper::GetSpectrumModel (eNbDev->
GetDlEarfcn (),
m_dlBandwidth));
750 dlChannel->AddRx (testDlSpectrumPhy);
752 testDlSpectrumPhy->SetCellId (1);
754 testDlSpectrumPhy->TraceConnectWithoutContext (
"RxStart",
762 testUlSpectrumPhy->SetRxSpectrumModel (LteSpectrumValueHelper::GetSpectrumModel (eNbDev->
GetUlEarfcn (),
m_ulBandwidth));
763 ulChannel->AddRx (testUlSpectrumPhy);
765 testUlSpectrumPhy->SetCellId (1);
767 testUlSpectrumPhy->TraceConnectWithoutContext (
"RxStart",
770 std::vector<bool> expectedDlRbCenterArea;
772 std::vector<bool> expectedUlRbCenterArea;
774 for (uint32_t i = 0; i < 6; i++)
776 expectedDlRbCenterArea[i] =
true;
777 expectedUlRbCenterArea[i] =
true;
780 std::vector<bool> expectedDlRbEdgeArea;
782 std::vector<bool> expectedUlRbEdgeArea;
784 for (uint32_t i = 12; i < 18; i++)
786 expectedDlRbEdgeArea[i] =
true;
787 expectedUlRbEdgeArea[i] =
true;
805 Simulator::Stop (
Seconds (1.500));
809 "Scheduler used DL RB muted by FFR Algorithm");
811 "Scheduler used UL RB muted by FFR Algorithm");
813 Simulator::Destroy ();
835 double eNbTxPower = 30;
865 positionAlloc->Add (Vector (0.0, 0.0, 0.0));
866 positionAlloc->Add (Vector (1000, 0.0, 0.0));
867 positionAlloc->Add (Vector (0.0, 0.0, 0.0));
868 positionAlloc->Add (Vector (1020, 0.0, 0.0));
870 mobility.SetMobilityModel (
"ns3::ConstantPositionMobilityModel");
871 mobility.SetPositionAllocator (positionAlloc);
908 lteHelper->
Attach (ueDevs1, enbDevs.
Get (0));
909 lteHelper->
Attach (ueDevs2, enbDevs.
Get (1));
932 testDlSpectrumPhy->SetRxSpectrumModel (LteSpectrumValueHelper::GetSpectrumModel (eNbDev->
GetDlEarfcn (),
m_dlBandwidth));
933 dlChannel->AddRx (testDlSpectrumPhy);
935 testDlSpectrumPhy->SetCellId (1);
937 testDlSpectrumPhy->TraceConnectWithoutContext (
"RxStart",
945 testUlSpectrumPhy->SetRxSpectrumModel (LteSpectrumValueHelper::GetSpectrumModel (eNbDev->
GetUlEarfcn (),
m_ulBandwidth));
946 ulChannel->AddRx (testUlSpectrumPhy);
948 testUlSpectrumPhy->SetCellId (1);
950 testUlSpectrumPhy->TraceConnectWithoutContext (
"RxStart",
954 std::vector<bool> expectedDlRbCenterArea;
956 std::vector<bool> expectedUlRbCenterArea;
958 for (uint32_t i = 0; i < 8; i++)
960 expectedDlRbCenterArea[i] =
true;
961 expectedUlRbCenterArea[i] =
true;
963 for (uint32_t i = 16; i < 25; i++)
965 expectedDlRbCenterArea[i] =
true;
968 std::vector<bool> expectedDlRbEdgeArea;
970 std::vector<bool> expectedUlRbEdgeArea;
972 for (uint32_t i = 8; i < 16; i++)
974 expectedDlRbEdgeArea[i] =
true;
975 expectedUlRbEdgeArea[i] =
true;
993 Simulator::Stop (
Seconds (1.500));
998 "Scheduler used DL RBG muted by FFR Algorithm");
1002 "Scheduler used UL RB muted by FFR Algorithm");
1004 Simulator::Destroy ();
1026 double eNbTxPower = 30;
1056 positionAlloc->Add (Vector (0.0, 0.0, 0.0));
1057 positionAlloc->Add (Vector (1000, 0.0, 0.0));
1058 positionAlloc->Add (Vector (0.0, 0.0, 0.0));
1059 positionAlloc->Add (Vector (1020, 0.0, 0.0));
1061 mobility.SetMobilityModel (
"ns3::ConstantPositionMobilityModel");
1062 mobility.SetPositionAllocator (positionAlloc);
1104 lteHelper->
Attach (ueDevs1, enbDevs.
Get (0));
1105 lteHelper->
Attach (ueDevs2, enbDevs.
Get (1));
1128 testDlSpectrumPhy->SetRxSpectrumModel (LteSpectrumValueHelper::GetSpectrumModel (eNbDev->
GetDlEarfcn (),
m_dlBandwidth));
1129 dlChannel->AddRx (testDlSpectrumPhy);
1131 testDlSpectrumPhy->SetCellId (1);
1133 testDlSpectrumPhy->TraceConnectWithoutContext (
"RxStart",
1141 testUlSpectrumPhy->SetRxSpectrumModel (LteSpectrumValueHelper::GetSpectrumModel (eNbDev->
GetUlEarfcn (),
m_ulBandwidth));
1142 ulChannel->AddRx (testUlSpectrumPhy);
1144 testUlSpectrumPhy->SetCellId (1);
1146 testUlSpectrumPhy->TraceConnectWithoutContext (
"RxStart",
1149 double expectedDlPowerCenterArea = 0.5;
1150 std::vector<bool> expectedDlRbCenterArea;
1152 std::vector<bool> expectedUlRbCenterArea;
1154 for (uint32_t i = 6; i < 12; i++)
1156 expectedDlRbCenterArea[i] =
true;
1157 expectedUlRbCenterArea[i] =
true;
1159 for (uint32_t i = 18; i < 25; i++)
1161 expectedDlRbCenterArea[i] =
true;
1162 expectedUlRbCenterArea[i] =
true;
1165 double expectedDlPowerMiddleArea = 1.0;
1166 std::vector<bool> expectedDlRbMiddleArea;
1168 std::vector<bool> expectedUlRbMiddleArea;
1170 for (uint32_t i = 0; i < 6; i++)
1172 expectedDlRbMiddleArea[i] =
true;
1173 expectedUlRbMiddleArea[i] =
true;
1176 double expectedDlPowerEdgeArea = 2.0;
1177 std::vector<bool> expectedDlRbEdgeArea;
1179 std::vector<bool> expectedUlRbEdgeArea;
1181 for (uint32_t i = 12; i < 18; i++)
1183 expectedDlRbEdgeArea[i] =
true;
1184 expectedUlRbEdgeArea[i] =
true;
1189 expectedDlPowerCenterArea, expectedDlRbCenterArea );
1195 expectedDlPowerMiddleArea, expectedDlRbMiddleArea );
1201 expectedDlPowerEdgeArea, expectedDlRbEdgeArea );
1207 expectedDlPowerMiddleArea, expectedDlRbMiddleArea );
1213 expectedDlPowerCenterArea, expectedDlRbCenterArea );
1217 Simulator::Stop (
Seconds (2.500));
1221 "Scheduler used DL RBG muted by FFR Algorithm");
1224 "Scheduler used UL RB muted by FFR Algorithm");
1226 Simulator::Destroy ();
1233 NS_LOG_INFO (
"Creating LteEnhancedFfrAreaTestCase");
1250 double eNbTxPower = 30;
1281 positionAlloc->Add (Vector (0.0, 0.0, 0.0));
1282 positionAlloc->Add (Vector (1000, 0.0, 0.0));
1283 positionAlloc->Add (Vector (0.0, 0.0, 0.0));
1284 positionAlloc->Add (Vector (1020, 0.0, 0.0));
1286 mobility.SetMobilityModel (
"ns3::ConstantPositionMobilityModel");
1287 mobility.SetPositionAllocator (positionAlloc);
1333 lteHelper->
Attach (ueDevs1, enbDevs.
Get (0));
1334 lteHelper->
Attach (ueDevs2, enbDevs.
Get (1));
1357 testDlSpectrumPhy->SetRxSpectrumModel (LteSpectrumValueHelper::GetSpectrumModel (eNbDev->
GetDlEarfcn (),
m_dlBandwidth));
1358 dlChannel->AddRx (testDlSpectrumPhy);
1360 testDlSpectrumPhy->SetCellId (1);
1362 testDlSpectrumPhy->TraceConnectWithoutContext (
"RxStart",
1370 testUlSpectrumPhy->SetRxSpectrumModel (LteSpectrumValueHelper::GetSpectrumModel (eNbDev->
GetUlEarfcn (),
m_ulBandwidth));
1371 ulChannel->AddRx (testUlSpectrumPhy);
1373 testUlSpectrumPhy->SetCellId (1);
1375 testUlSpectrumPhy->TraceConnectWithoutContext (
"RxStart",
1378 double expectedDlPowerCenterArea = 0.251189;
1379 std::vector<bool> expectedDlRbCenterArea;
1381 std::vector<bool> expectedUlRbCenterArea;
1383 for (uint32_t i = 0; i < 8; i++)
1385 expectedDlRbCenterArea[i] =
true;
1386 expectedUlRbCenterArea[i] =
true;
1388 for (uint32_t i = 12; i < 16; i++)
1390 expectedDlRbCenterArea[i] =
true;
1391 expectedUlRbCenterArea[i] =
true;
1393 for (uint32_t i = 20; i < 24; i++)
1395 expectedDlRbCenterArea[i] =
true;
1396 expectedUlRbCenterArea[i] =
true;
1399 double expectedDlPowerMiddleArea = 0.251189;
1400 std::vector<bool> expectedDlRbMiddleArea;
1402 std::vector<bool> expectedUlRbMiddleArea;
1404 for (uint32_t i = 4; i < 8; i++)
1406 expectedDlRbMiddleArea[i] =
true;
1407 expectedUlRbMiddleArea[i] =
true;
1410 double expectedDlPowerEdgeArea = 1.0;
1411 std::vector<bool> expectedDlRbEdgeArea;
1413 std::vector<bool> expectedUlRbEdgeArea;
1415 for (uint32_t i = 0; i < 4; i++)
1417 expectedDlRbEdgeArea[i] =
true;
1418 expectedUlRbEdgeArea[i] =
true;
1423 expectedDlPowerCenterArea, expectedDlRbCenterArea );
1429 expectedDlPowerMiddleArea, expectedDlRbMiddleArea );
1435 expectedDlPowerEdgeArea, expectedDlRbEdgeArea );
1441 expectedDlPowerCenterArea, expectedDlRbCenterArea );
1447 expectedDlPowerMiddleArea, expectedDlRbMiddleArea );
1451 Simulator::Stop (
Seconds (2.500));
1455 "Scheduler used DL RBG muted by FFR Algorithm");
1458 "Scheduler used UL RB muted by FFR Algorithm");
1460 Simulator::Destroy ();
1467 NS_LOG_INFO (
"Creating LteDistributedFfrAreaTestCase");
1484 double eNbTxPower = 30;
1498 uint16_t bandwidth = 25;
1509 remoteHostContainer.
Create (1);
1512 internet.
Install (remoteHostContainer);
1521 ipv4h.
SetBase (
"1.0.0.0",
"255.0.0.0");
1529 remoteHostStaticRouting->AddNetworkRouteTo (
Ipv4Address (
"7.0.0.0"),
Ipv4Mask (
"255.0.0.0"), 1);
1553 positionAlloc->Add (Vector (0.0, 0.0, 0.0));
1554 positionAlloc->Add (Vector (1000, 0.0, 0.0));
1556 positionAlloc->Add (Vector (200, 0.0, 0.0));
1557 positionAlloc->Add (Vector (200, 0.0, 0.0));
1558 positionAlloc->Add (Vector (800, 0.0, 0.0));
1561 mobility.SetMobilityModel (
"ns3::ConstantPositionMobilityModel");
1562 mobility.SetPositionAllocator (positionAlloc);
1590 ueLteDevs.
Add (ueDevs1);
1591 ueLteDevs.
Add (ueDevs2);
1601 for (uint32_t u = 0; u < ueNodes.
GetN (); ++u)
1610 lteHelper->
Attach (ueDevs1, enbDevs.
Get (0));
1611 lteHelper->
Attach (ueDevs2, enbDevs.
Get (1));
1615 uint16_t dlPort = 10000;
1616 uint16_t ulPort = 20000;
1625 for (uint32_t u = 0; u < ueNodes.
GetN (); ++u)
1632 for (uint32_t b = 0; b < 1; ++b)
1692 testDlSpectrumPhy->SetRxSpectrumModel (LteSpectrumValueHelper::GetSpectrumModel (eNbDev->
GetDlEarfcn (),
m_dlBandwidth));
1693 dlChannel->AddRx (testDlSpectrumPhy);
1695 testDlSpectrumPhy->SetCellId (2);
1697 testDlSpectrumPhy->TraceConnectWithoutContext (
"RxStart",
1705 testUlSpectrumPhy->SetRxSpectrumModel (LteSpectrumValueHelper::GetSpectrumModel (eNbDev->
GetUlEarfcn (),
m_ulBandwidth));
1706 ulChannel->AddRx (testUlSpectrumPhy);
1708 testUlSpectrumPhy->SetCellId (2);
1710 testUlSpectrumPhy->TraceConnectWithoutContext (
"RxStart",
1713 double expectedDlPowerCenterArea = 1.0;
1714 std::vector<bool> expectedDlRbCenterArea;
1716 std::vector<bool> expectedUlRbCenterArea;
1720 expectedDlRbCenterArea[i] =
true;
1721 expectedUlRbCenterArea[i] =
true;
1724 double expectedDlPowerEdgeArea = 2.0;
1725 std::vector<bool> expectedDlRbEdgeArea;
1727 std::vector<bool> expectedUlRbEdgeArea;
1729 for (uint32_t i = 0; i < 6; i++)
1731 expectedDlRbEdgeArea[i] =
true;
1732 expectedUlRbEdgeArea[i] =
true;
1735 std::vector<bool> expectedDlRbEdgeArea2;
1737 std::vector<bool> expectedUlRbEdgeArea2;
1739 for (uint32_t i = 6; i < 12; i++)
1741 expectedDlRbEdgeArea2[i] =
true;
1742 expectedUlRbEdgeArea2[i] =
true;
1748 expectedDlPowerCenterArea, expectedDlRbCenterArea );
1754 expectedDlPowerEdgeArea, expectedDlRbEdgeArea );
1760 expectedDlPowerEdgeArea, expectedDlRbEdgeArea2 );
1766 expectedDlPowerEdgeArea, expectedDlRbEdgeArea );
1772 expectedDlPowerCenterArea, expectedDlRbCenterArea );
1776 Simulator::Stop (
Seconds (2.500));
1781 "Scheduler used DL RBG muted by FFR Algorithm");
1785 "Scheduler used UL RB muted by FFR Algorithm");
1787 Simulator::Destroy ();
Lte Distributed Ffr Area Test Case.
virtual void DoRun(void)
Implementation to actually run this TestCase.
virtual ~LteDistributedFfrAreaTestCase()
LteDistributedFfrAreaTestCase(std::string name, std::string schedulerType)
Constructor.
Lte Enhanced Ffr Area Test Case.
virtual ~LteEnhancedFfrAreaTestCase()
virtual void DoRun(void)
Implementation to actually run this TestCase.
LteEnhancedFfrAreaTestCase(std::string name, std::string schedulerType)
Constructor.
Test frequency reuse algorithm by teleporing UEs to different parts of area and checking if the frequ...
Time m_teleportTime
the telport 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.
virtual void DoRun(void)
Implementation to actually run this TestCase.
virtual ~LteFrAreaTestCase()
uint16_t m_ulBandwidth
the UL bandwidth
uint16_t m_dlBandwidth
the DL bandwidth
std::vector< bool > m_expectedUlRb
expected UL per RB
void UlDataRxStart(Ptr< const SpectrumValue > spectrumValue)
UL data receive start function.
void TeleportUe2(Ptr< Node > ueNode, uint32_t x, uint32_t y, double expectedPower, std::vector< bool > expectedDlRb)
Teleport UE 2 function.
void DlDataRxStart(Ptr< const SpectrumValue > spectrumValue)
DL data receive start function.
double m_expectedUlPower
expected UL power
std::string m_schedulerType
the scheduler type
void SetUlExpectedValues(double expectedPower, std::vector< bool > expectedDlRb)
Set UL expected values function.
double m_expectedDlPower
the expected DL power
void SetDlExpectedValues(double expectedPower, std::vector< bool > expectedDlRb)
Set DL expected values function.
bool m_usedWrongDlRbg
used wrong DL RBG?
void TeleportUe(uint32_t x, uint32_t y, double expectedPower, std::vector< bool > expectedDlRb)
Teleport UE function.
Ptr< MobilityModel > m_ueMobility
the UE mobility model
Test frequency reuse algorithm.
void DlDataRxStart(Ptr< const SpectrumValue > spectrumValue)
DL data receive start function.
uint32_t m_userNum
the number of UE nodes
void UlDataRxStart(Ptr< const SpectrumValue > spectrumValue)
UL data receive start function.
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
virtual void DoRun(void)
Implementation to actually run this TestCase.
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.
uint8_t m_dlSubBandwidth
the DL subband width
virtual void DoRun(void)
Implementation to actually run this TestCase.
virtual ~LteHardFrTestCase()
std::string m_schedulerType
the scheduler type
Lte Soft Ffr Area Test Case.
virtual void DoRun(void)
Implementation to actually run this TestCase.
virtual ~LteSoftFfrAreaTestCase()
LteSoftFfrAreaTestCase(std::string name, std::string schedulerType)
Constructor.
Lte Soft Fr Area Test Case.
virtual ~LteSoftFrAreaTestCase()
LteSoftFrAreaTestCase(std::string name, std::string schedulerType)
Constructor.
virtual void DoRun(void)
Implementation to actually run this TestCase.
virtual ~LteStrictFrAreaTestCase()
virtual void DoRun(void)
Implementation to actually run this TestCase.
LteStrictFrAreaTestCase(std::string name, std::string schedulerType)
Constructor.
Test stric frequency reuse algorithm.
virtual ~LteStrictFrTestCase()
uint16_t m_ulCommonSubBandwidth
UL common subbandwidth.
uint16_t m_dlCommonSubBandwidth
DL common subbandwidth.
uint8_t m_dlEdgeSubBandOffset
DL edge subband offset.
uint8_t m_ulEdgeSubBandOffset
UL edge subband offset.
std::string m_schedulerType
scheduler type
LteStrictFrTestCase(std::string name, uint32_t userNum, std::string schedulerType, uint16_t dlBandwidth, uint16_t ulBandwidth, uint16_t dlCommonSubBandwidth, uint8_t dlEdgeSubBandOffset, uint16_t dlEdgeSubBandwidth, uint16_t ulCommonSubBandwidth, uint8_t ulEdgeSubBandOffset, uint16_t ulEdgeSubBandwidth, std::vector< bool > availableDlRb, std::vector< bool > availableUlRb)
Constructor.
uint16_t m_dlEdgeSubBandwidth
DL edge subbandwidth.
uint16_t m_ulEdgeSubBandwidth
UL edge subbandwidth.
virtual void DoRun(void)
Implementation to actually run this TestCase.
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.
aggregate IP/TCP/UDP functionality to existing Nodes.
void Install(std::string nodeName) const
Aggregate implementations of the ns3::Ipv4, ns3::Ipv6, ns3::Udp, and ns3::Tcp classes onto the provid...
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.
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.
uint32_t GetUlEarfcn() const
uint32_t GetDlEarfcn() const
void SetFfrAlgorithmType(std::string type)
Set the type of FFR algorithm to be used by eNodeB devices.
void SetEpcHelper(Ptr< EpcHelper > h)
Set the EpcHelper to be used to setup the EPC network in conjunction with the setup of the LTE radio ...
void SetSchedulerAttribute(std::string n, const AttributeValue &v)
Set an attribute for the scheduler to be created.
NetDeviceContainer InstallEnbDevice(NodeContainer c)
Create a set of eNodeB devices.
void SetHandoverAlgorithmType(std::string type)
Set the type of handover algorithm to be used by eNodeB devices.
void SetFfrAlgorithmAttribute(std::string n, const AttributeValue &v)
Set an attribute for the FFR algorithm to be created.
void SetSchedulerType(std::string type)
Set the type of scheduler to be used by eNodeB devices.
void Attach(NetDeviceContainer ueDevices)
Enables automatic attachment of a set of UE devices to a suitable cell using Idle mode initial cell s...
void SetEnbDeviceAttribute(std::string n, const AttributeValue &v)
Set an attribute for the eNodeB devices (LteEnbNetDevice) to be created.
void ActivateDataRadioBearer(NetDeviceContainer ueDevices, EpsBearer bearer)
Activate a Data Radio Bearer on a given UE devices (for LTE-only simulation).
NetDeviceContainer InstallUeDevice(NodeContainer c)
Create a set of UE devices.
void AddX2Interface(NodeContainer enbNodes)
Create an X2 interface between all the eNBs in a given set.
uint8_t ActivateDedicatedEpsBearer(NetDeviceContainer ueDevices, EpsBearer bearer, Ptr< EpcTft > tft)
Activate a dedicated EPS bearer on a given set of UE devices.
The LteSpectrumPhy models the physical layer of LTE.
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.
virtual Ipv4Address GetUeDefaultGatewayAddress()
virtual Ptr< Node > GetPgwNode() const
Get the PGW node.
virtual Ipv4InterfaceContainer AssignUeIpv4Address(NetDeviceContainer ueDevices)
Assign IPv4 addresses to UE devices.
keep track of a set of node pointers.
uint32_t GetN(void) 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.
void SetAttribute(std::string name, const AttributeValue &value)
Set a single attribute, raising fatal errors if unsuccessful.
Ptr< T > GetObject(void) 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.
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(void)
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.
Callback< R > MakeBoundCallback(R(*fnPtr)(TX), ARG a1)
Make Callbacks with one bound argument.
Time Now(void)
create an ns3::Time instance which contains the current simulation time.
#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)
static LteFrequencyReuseTestSuite lteFrequencyReuseTestSuite
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.
list x
Random number samples.
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