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-module.h"
23#include "ns3/lte-common.h"
24#include "ns3/lte-enb-net-device.h"
25#include "ns3/lte-enb-phy.h"
26#include "ns3/lte-enb-rrc.h"
27#include "ns3/lte-helper.h"
28#include "ns3/lte-ue-net-device.h"
29#include "ns3/lte-ue-phy.h"
30#include "ns3/lte-ue-rrc.h"
31#include "ns3/mobility-helper.h"
32#include "ns3/packet-sink-helper.h"
33#include "ns3/point-to-point-epc-helper.h"
34#include "ns3/point-to-point-module.h"
35#include "ns3/pointer.h"
36#include "ns3/simulator.h"
37#include "ns3/string.h"
38#include "ns3/udp-client-server-helper.h"
69 "ns3::PfFfMacScheduler",
78 TestCase::Duration::QUICK);
81 "ns3::PfFfMacScheduler",
90 TestCase::Duration::QUICK);
93 "ns3::PssFfMacScheduler",
102 TestCase::Duration::QUICK);
105 "ns3::PssFfMacScheduler",
114 TestCase::Duration::QUICK);
117 "ns3::CqaFfMacScheduler",
126 TestCase::Duration::QUICK);
129 "ns3::CqaFfMacScheduler",
138 TestCase::Duration::QUICK);
141 "ns3::FdTbfqFfMacScheduler",
150 TestCase::Duration::QUICK);
153 "ns3::FdTbfqFfMacScheduler",
162 TestCase::Duration::QUICK);
165 "ns3::TdTbfqFfMacScheduler",
174 TestCase::Duration::QUICK);
177 "ns3::TdTbfqFfMacScheduler",
186 TestCase::Duration::QUICK);
213 "ns3::PfFfMacScheduler",
224 TestCase::Duration::QUICK);
227 "ns3::PfFfMacScheduler",
238 TestCase::Duration::QUICK);
241 "ns3::PssFfMacScheduler",
252 TestCase::Duration::QUICK);
255 "ns3::PssFfMacScheduler",
266 TestCase::Duration::QUICK);
269 "ns3::CqaFfMacScheduler",
280 TestCase::Duration::QUICK);
283 "ns3::CqaFfMacScheduler",
294 TestCase::Duration::QUICK);
297 "ns3::FdTbfqFfMacScheduler",
308 TestCase::Duration::QUICK);
311 "ns3::FdTbfqFfMacScheduler",
322 TestCase::Duration::QUICK);
325 "ns3::TdTbfqFfMacScheduler",
336 TestCase::Duration::QUICK);
339 "ns3::TdTbfqFfMacScheduler",
350 TestCase::Duration::QUICK);
353 TestCase::Duration::QUICK);
356 TestCase::Duration::QUICK);
359 TestCase::Duration::QUICK);
362 TestCase::Duration::QUICK);
365 TestCase::Duration::QUICK);
368 TestCase::Duration::QUICK);
370 TestCase::Duration::QUICK);
372 TestCase::Duration::QUICK);
375 TestCase::Duration::QUICK);
378 TestCase::Duration::QUICK);
381 TestCase::Duration::QUICK);
383 TestCase::Duration::QUICK);
385 TestCase::Duration::QUICK);
388 TestCase::Duration::QUICK);
391 TestCase::Duration::QUICK);
395 TestCase::Duration::QUICK);
398 TestCase::Duration::QUICK);
401 TestCase::Duration::QUICK);
403 "ns3::FdTbfqFfMacScheduler"),
404 TestCase::Duration::QUICK);
406 "ns3::TdTbfqFfMacScheduler"),
407 TestCase::Duration::QUICK);
410 "ns3::PfFfMacScheduler"),
411 TestCase::Duration::QUICK);
413 "ns3::PssFfMacScheduler"),
414 TestCase::Duration::QUICK);
416 "ns3::CqaFfMacScheduler"),
417 TestCase::Duration::QUICK);
419 "ns3::FdTbfqFfMacScheduler"),
420 TestCase::Duration::QUICK);
422 "ns3::TdTbfqFfMacScheduler"),
423 TestCase::Duration::QUICK);
449 uint16_t dlBandwidth,
450 uint16_t ulBandwidth,
455 m_dlBandwidth(dlBandwidth),
456 m_ulBandwidth(ulBandwidth),
458 m_usedMutedDlRbg(
false),
460 m_usedMutedUlRbg(
false)
514 uint16_t dlBandwidth,
515 uint16_t ulBandwidth,
516 uint8_t dlSubBandOffset,
518 uint8_t ulSubBandOffset,
524 m_dlSubBandOffset(dlSubBandOffset),
526 m_ulSubBandOffset(ulSubBandOffset),
549 lteHelper->SetFfrAlgorithmType(
"ns3::LteFrHardAlgorithm");
566 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
597 ->GetDownlinkSpectrumPhy()
615 ->GetUplinkSpectrumPhy()
641 uint16_t dlBandwidth,
642 uint16_t ulBandwidth,
643 uint16_t dlCommonSubBandwidth,
644 uint8_t dlEdgeSubBandOffset,
645 uint16_t dlEdgeSubBandwidth,
646 uint16_t ulCommonSubBandwidth,
647 uint8_t ulEdgeSubBandOffset,
648 uint16_t ulEdgeSubBandwidth,
653 m_dlCommonSubBandwidth(dlCommonSubBandwidth),
654 m_dlEdgeSubBandOffset(dlEdgeSubBandOffset),
655 m_dlEdgeSubBandwidth(dlEdgeSubBandwidth),
656 m_ulCommonSubBandwidth(ulCommonSubBandwidth),
657 m_ulEdgeSubBandOffset(ulEdgeSubBandOffset),
658 m_ulEdgeSubBandwidth(ulEdgeSubBandwidth)
680 lteHelper->SetFfrAlgorithmType(
"ns3::LteFrStrictAlgorithm");
682 lteHelper->SetFfrAlgorithmAttribute(
"DlCommonSubBandwidth",
684 lteHelper->SetFfrAlgorithmAttribute(
"DlEdgeSubBandOffset",
688 lteHelper->SetFfrAlgorithmAttribute(
"UlCommonSubBandwidth",
690 lteHelper->SetFfrAlgorithmAttribute(
"UlEdgeSubBandOffset",
703 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
735 ->GetDownlinkSpectrumPhy()
753 ->GetUplinkSpectrumPhy()
831 "Wrong Data Channel DL Power level");
881 "Wrong Data Channel UL Power level"
892 NS_LOG_DEBUG(
"Teleport UE to : (" << x <<
", " << y <<
", 0)");
904 NS_LOG_DEBUG(
"Teleport UE to : (" << x <<
", " << y <<
", 0)");
919 NS_LOG_DEBUG(
"Teleport UE to : (" << x <<
", " << y <<
", 0)");
1004 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
1019 lteHelper->SetFfrAlgorithmType(
"ns3::LteFrStrictAlgorithm");
1021 lteHelper->SetFfrAlgorithmAttribute(
"CenterPowerOffset",
1023 lteHelper->SetFfrAlgorithmAttribute(
"EdgePowerOffset",
1035 lteHelper->SetFfrAlgorithmType(
"ns3::LteFrNoOpAlgorithm");
1065 ->GetDownlinkSpectrumPhy()
1085 ->GetUplinkSpectrumPhy()
1223 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
1238 lteHelper->SetFfrAlgorithmType(
"ns3::LteFrSoftAlgorithm");
1241 lteHelper->SetFfrAlgorithmAttribute(
"CenterPowerOffset",
1243 lteHelper->SetFfrAlgorithmAttribute(
"EdgePowerOffset",
1252 lteHelper->SetFfrAlgorithmType(
"ns3::LteFrNoOpAlgorithm");
1281 ->GetDownlinkSpectrumPhy()
1301 ->GetUplinkSpectrumPhy()
1384 "Scheduler used DL RBG muted by FFR Algorithm");
1447 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
1462 lteHelper->SetFfrAlgorithmType(
"ns3::LteFfrSoftAlgorithm");
1465 lteHelper->SetFfrAlgorithmAttribute(
"CenterAreaPowerOffset",
1467 lteHelper->SetFfrAlgorithmAttribute(
"MediumAreaPowerOffset",
1469 lteHelper->SetFfrAlgorithmAttribute(
"EdgeAreaPowerOffset",
1481 lteHelper->SetFfrAlgorithmType(
"ns3::LteFrNoOpAlgorithm");
1510 ->GetDownlinkSpectrumPhy()
1530 ->GetUplinkSpectrumPhy()
1661 NS_LOG_INFO(
"Creating LteEnhancedFfrAreaTestCase");
1714 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
1733 lteHelper->SetFfrAlgorithmType(
"ns3::LteFfrEnhancedAlgorithm");
1737 lteHelper->SetFfrAlgorithmAttribute(
"CenterAreaPowerOffset",
1739 lteHelper->SetFfrAlgorithmAttribute(
"EdgeAreaPowerOffset",
1752 lteHelper->SetFfrAlgorithmType(
"ns3::LteFrNoOpAlgorithm");
1781 ->GetDownlinkSpectrumPhy()
1801 ->GetUplinkSpectrumPhy()
1938 NS_LOG_INFO(
"Creating LteDistributedFfrAreaTestCase");
1968 uint16_t bandwidth = 25;
1973 lteHelper->SetHandoverAlgorithmType(
"ns3::NoOpHandoverAlgorithm");
2032 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
2046 lteHelper->SetFfrAlgorithmType(
"ns3::LteFfrDistributedAlgorithm");
2051 lteHelper->SetFfrAlgorithmAttribute(
"CenterPowerOffset",
2053 lteHelper->SetFfrAlgorithmAttribute(
"EdgePowerOffset",
2153 serverApps.Start(startTime);
2154 clientApps.Start(startTime);
2162 ->GetDownlinkSpectrumPhy()
2182 ->GetUplinkSpectrumPhy()
2301 "Scheduler used DL RBG muted by FFR Algorithm");
Lte Distributed Ffr Area Test Case.
~LteDistributedFfrAreaTestCase() override
LteDistributedFfrAreaTestCase(std::string name, std::string schedulerType)
Constructor.
void DoRun() override
Implementation to actually run this TestCase.
Lte Enhanced Ffr Area Test Case.
void DoRun() override
Implementation to actually run this TestCase.
~LteEnhancedFfrAreaTestCase() override
LteEnhancedFfrAreaTestCase(std::string name, std::string schedulerType)
Constructor.
Test frequency reuse algorithm by teleporting UEs to different parts of area and checking if the freq...
Time m_teleportTime
the teleport time
LteFrAreaTestCase(std::string name, std::string schedulerType)
Constructor.
bool m_usedWrongUlRbg
used wrong UL RBG?
std::vector< bool > m_expectedDlRb
the expected DL per RB
void SimpleTeleportUe(uint32_t x, uint32_t y)
Simple teleport UE function.
uint16_t m_ulBandwidth
the UL bandwidth
uint16_t m_dlBandwidth
the DL bandwidth
std::vector< bool > m_expectedUlRb
expected UL per RB
void UlDataRxStart(Ptr< const SpectrumValue > spectrumValue)
UL data receive start function.
void TeleportUe2(Ptr< Node > ueNode, uint32_t x, uint32_t y, double expectedPower, std::vector< bool > expectedDlRb)
Teleport UE 2 function.
void DlDataRxStart(Ptr< const SpectrumValue > spectrumValue)
DL data receive start function.
double m_expectedUlPower
expected UL power
~LteFrAreaTestCase() override
std::string m_schedulerType
the scheduler type
void SetUlExpectedValues(double expectedPower, std::vector< bool > expectedDlRb)
Set UL expected values function.
double m_expectedDlPower
the expected DL power
void SetDlExpectedValues(double expectedPower, std::vector< bool > expectedDlRb)
Set DL expected values function.
bool m_usedWrongDlRbg
used wrong DL RBG?
void TeleportUe(uint32_t x, uint32_t y, double expectedPower, std::vector< bool > expectedDlRb)
Teleport UE function.
Ptr< MobilityModel > m_ueMobility
the UE mobility model
void DoRun() override
Implementation to actually run this TestCase.
Test frequency reuse algorithm.
void DlDataRxStart(Ptr< const SpectrumValue > spectrumValue)
DL data receive start function.
~LteFrTestCase() override
uint32_t m_userNum
the number of UE nodes
void UlDataRxStart(Ptr< const SpectrumValue > spectrumValue)
UL data receive start function.
void DoRun() override
Implementation to actually run this TestCase.
uint16_t m_dlBandwidth
the DL bandwidth
LteFrTestCase(std::string name, uint32_t userNum, uint16_t dlBandwidth, uint16_t ulBandwidth, std::vector< bool > availableDlRb, std::vector< bool > availableUlRb)
Constructor.
uint16_t m_ulBandwidth
the UL bandwidth
bool m_usedMutedDlRbg
used muted DL RBG?
std::vector< bool > m_availableDlRb
the available DL for each RB
std::vector< bool > m_availableUlRb
the available UL for each RB
bool m_usedMutedUlRbg
used muted UL RBG?
Test the fractional frequency reuse algorithms.
LteFrequencyReuseTestSuite()
TestSuite.
Test hard frequency reuse algorithm.
LteHardFrTestCase(std::string name, uint32_t userNum, std::string schedulerType, uint16_t dlBandwidth, uint16_t ulBandwidth, uint8_t dlSubBandOffset, uint16_t dlSubBandwidth, uint8_t ulSubBandOffset, uint16_t ulSubBandwidth, std::vector< bool > availableDlRb, std::vector< bool > availableUlRb)
Constructor.
uint8_t m_dlSubBandOffset
the DL subband offset
uint8_t m_ulSubBandwidth
UL subband offset.
uint8_t m_ulSubBandOffset
UL subband offset.
void DoRun() override
Implementation to actually run this TestCase.
uint8_t m_dlSubBandwidth
the DL subband width
~LteHardFrTestCase() override
std::string m_schedulerType
the scheduler type
Lte Soft Ffr Area Test Case.
void DoRun() override
Implementation to actually run this TestCase.
~LteSoftFfrAreaTestCase() override
LteSoftFfrAreaTestCase(std::string name, std::string schedulerType)
Constructor.
Lte Soft Fr Area Test Case.
void DoRun() override
Implementation to actually run this TestCase.
LteSoftFrAreaTestCase(std::string name, std::string schedulerType)
Constructor.
~LteSoftFrAreaTestCase() override
void DoRun() override
Implementation to actually run this TestCase.
LteStrictFrAreaTestCase(std::string name, std::string schedulerType)
Constructor.
~LteStrictFrAreaTestCase() override
Test strict frequency reuse algorithm.
uint16_t m_ulCommonSubBandwidth
UL common subbandwidth.
void DoRun() override
Implementation to actually run this TestCase.
uint16_t m_dlCommonSubBandwidth
DL common subbandwidth.
~LteStrictFrTestCase() override
uint8_t m_dlEdgeSubBandOffset
DL edge subband offset.
uint8_t m_ulEdgeSubBandOffset
UL edge subband offset.
std::string m_schedulerType
scheduler type
LteStrictFrTestCase(std::string name, uint32_t userNum, std::string schedulerType, uint16_t dlBandwidth, uint16_t ulBandwidth, uint16_t dlCommonSubBandwidth, uint8_t dlEdgeSubBandOffset, uint16_t dlEdgeSubBandwidth, uint16_t ulCommonSubBandwidth, uint8_t ulEdgeSubBandOffset, uint16_t ulEdgeSubBandwidth, std::vector< bool > availableDlRb, std::vector< bool > availableUlRb)
Constructor.
uint16_t m_dlEdgeSubBandwidth
DL edge subbandwidth.
uint16_t m_ulEdgeSubBandwidth
UL edge subbandwidth.
holds a vector of ns3::Application pointers.
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.
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.
a class to represent an Ipv4 address mask
Helper class that adds ns3::Ipv4StaticRouting objects.
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.
keep track of a set of node pointers.
void Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.
bool TraceConnectWithoutContext(std::string name, const CallbackBase &cb)
Connect a TraceSource to a Callback without a context.
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.
Smart pointer class similar to boost::intrusive_ptr.
static EventId Schedule(const Time &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
static void Destroy()
Execute the events scheduled with ScheduleDestroy().
static Time Now()
Return the current simulation virtual time.
static void Run()
Run the simulation.
static void Stop()
Tell the Simulator the calling event should be the last one executed.
void AddTestCase(TestCase *testCase, Duration duration=Duration::QUICK)
Add an individual child TestCase to this test suite.
Simulation virtual time values and global simulation resolution.
AttributeValue implementation for Time.
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 > 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 remotePortStart
start of the port number range of the remote host
uint16_t localPortStart
start of the port number range of the UE