27#include "ns3/boolean.h"
28#include "ns3/double.h"
29#include "ns3/ff-mac-scheduler.h"
31#include "ns3/lte-enb-net-device.h"
32#include "ns3/lte-enb-phy.h"
33#include "ns3/lte-helper.h"
34#include "ns3/lte-spectrum-value-helper.h"
35#include "ns3/lte-ue-net-device.h"
36#include "ns3/lte-ue-phy.h"
37#include "ns3/mobility-helper.h"
38#include "ns3/simulator.h"
39#include "ns3/spectrum-value.h"
40#include "ns3/string.h"
42#include <ns3/lte-chunk-processor.h>
43#include <ns3/pointer.h>
54 :
TestSuite(
"lte-interference-fr", SYSTEM)
135 m_expectedDlSinrDb(10 *
std::log10(dlSinr))
181 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
182 positionAlloc->Add(Vector(
m_d2,
m_d1, 0.0));
183 positionAlloc->Add(Vector(0.0,
m_d1, 0.0));
184 positionAlloc->Add(Vector(
m_d2, 0.0, 0.0));
186 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
187 mobility.SetPositionAllocator(positionAlloc);
212 lteHelper->
Attach(ueDevs1, enbDevs.
Get(0));
213 lteHelper->
Attach(ueDevs2, enbDevs.
Get(1));
228 testDlSinr1->AddCallback(
MakeCallback(&LteSpectrumValueCatcher::ReportValue, &dlSinr1Catcher));
229 ue1Phy->GetDownlinkSpectrumPhy()->AddDataSinrChunkProcessor(testDlSinr1);
235 testUlSinr1->AddCallback(
MakeCallback(&LteSpectrumValueCatcher::ReportValue, &ulSinr1Catcher));
236 enb1phy->GetUplinkSpectrumPhy()->AddDataSinrChunkProcessor(testUlSinr1);
243 testDlSinr2->AddCallback(
MakeCallback(&LteSpectrumValueCatcher::ReportValue, &dlSinr2Catcher));
244 ue2Phy->GetDownlinkSpectrumPhy()->AddDataSinrChunkProcessor(testDlSinr2);
250 testUlSinr2->AddCallback(
MakeCallback(&LteSpectrumValueCatcher::ReportValue, &ulSinr2Catcher));
251 enb1phy->GetUplinkSpectrumPhy()->AddDataSinrChunkProcessor(testUlSinr2);
254 Simulator::Stop(
Seconds(0.200));
259 double dlSinr1 = dlSinr1Catcher.
GetValue()->operator[](i);
260 double dlSinr1Db = 10.0 * std::log10(dlSinr1);
264 "Wrong SINR in DL! (eNB1 --> UE1)");
266 double dlSinr2 = dlSinr2Catcher.
GetValue()->operator[](i);
272 double dlSinr1 = dlSinr1Catcher.
GetValue()->operator[](i);
275 double dlSinr2 = dlSinr2Catcher.
GetValue()->operator[](i);
276 double dlSinr2Db = 10.0 * std::log10(dlSinr2);
280 "Wrong SINR in DL! (eNB2 --> UE2)");
294 Simulator::Destroy();
308 m_commonDlSinrDb(10 *
std::log10(commonDlSinr)),
309 m_edgeDlSinrDb(10 *
std::log10(edgeDlSinr)),
310 m_rspqThreshold(rspqThreshold)
361 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
362 positionAlloc->Add(Vector(
m_d2,
m_d1, 0.0));
364 positionAlloc->Add(Vector(0.0,
m_d1, 0.0));
365 positionAlloc->Add(Vector(0.5 *
m_d2, 0.0, 0.0));
367 positionAlloc->Add(Vector(
m_d2, 0.0, 0.0));
368 positionAlloc->Add(Vector(0.5 *
m_d2,
m_d1, 0.0));
371 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
372 mobility.SetPositionAllocator(positionAlloc);
399 lteHelper->
Attach(ueDevs1, enbDevs.
Get(0));
400 lteHelper->
Attach(ueDevs2, enbDevs.
Get(1));
415 testDlSinr1->AddCallback(
MakeCallback(&LteSpectrumValueCatcher::ReportValue, &dlSinr1Catcher));
416 ue1Phy->GetDownlinkSpectrumPhy()->AddDataSinrChunkProcessor(testDlSinr1);
422 testUlSinr1->AddCallback(
MakeCallback(&LteSpectrumValueCatcher::ReportValue, &ulSinr1Catcher));
423 enb1phy->GetUplinkSpectrumPhy()->AddDataSinrChunkProcessor(testUlSinr1);
430 testDlSinr2->AddCallback(
MakeCallback(&LteSpectrumValueCatcher::ReportValue, &dlSinr2Catcher));
431 ue2Phy->GetDownlinkSpectrumPhy()->AddDataSinrChunkProcessor(testDlSinr2);
437 testUlSinr2->AddCallback(
MakeCallback(&LteSpectrumValueCatcher::ReportValue, &ulSinr2Catcher));
438 enb1phy->GetUplinkSpectrumPhy()->AddDataSinrChunkProcessor(testUlSinr2);
441 Simulator::Stop(
Seconds(2.000));
446 double dlSinr1 = dlSinr1Catcher.
GetValue()->operator[](i);
447 double dlSinr1Db = 10.0 * std::log10(dlSinr1);
451 "Wrong SINR in DL! (eNB1 --> UE1)");
453 double dlSinr2 = dlSinr2Catcher.
GetValue()->operator[](i);
454 double dlSinr2Db = 10.0 * std::log10(dlSinr2);
458 "Wrong SINR in DL! (eNB2 --> UE2)");
463 double dlSinr1 = dlSinr1Catcher.
GetValue()->operator[](i);
464 double dlSinr1Db = 10.0 * std::log10(dlSinr1);
468 "Wrong SINR in DL! (eNB1 --> UE1)");
470 double dlSinr2 = dlSinr2Catcher.
GetValue()->operator[](i);
476 double dlSinr1 = dlSinr1Catcher.
GetValue()->operator[](i);
479 double dlSinr2 = dlSinr2Catcher.
GetValue()->operator[](i);
480 double dlSinr2Db = 10.0 * std::log10(dlSinr2);
484 "Wrong SINR in DL! (eNB2 --> UE2)");
498 Simulator::Destroy();
Test suite for the interference test when using different frequency reuse algorithms....
LteInterferenceFrTestSuite()
TestSuite.
Lte interference test when using hard frequency reuse algorithm.
double m_expectedDlSinrDb
expected DL SINR in dB
void DoRun() override
Implementation to actually run this TestCase.
double m_d2
distance between UE and other ENB
double m_d1
distance between UE and ENB
LteInterferenceHardFrTestCase(std::string name, double d1, double d2, double dlSinr, double ulSinr)
Constructor.
~LteInterferenceHardFrTestCase() override
Lte interference test when using strict frequency reuse algorithm.
double m_d1
distance between UE and ENB
uint32_t m_rspqThreshold
RSPQ threshold.
void DoRun() override
Implementation to actually run this TestCase.
double m_commonDlSinrDb
expected common DL SINR in dB
double m_edgeDlSinrDb
expected edge DL SINR in dB
LteInterferenceStrictFrTestCase(std::string name, double d1, double d2, double commonDlSinr, double commonUlSinr, double edgeDlSinr, double edgeUlSinr, uint32_t rspqThreshold)
Constructor.
double m_d2
distance between UE and other ENB
~LteInterferenceStrictFrTestCase() override
AttributeValue implementation for Boolean.
This class can be used to hold variables of floating point type such as 'double' or 'float'.
Hold variables of type enum.
This class contains the specification of EPS Bearers.
The eNodeB device implementation.
void SetFfrAlgorithmType(std::string type)
Set the type of FFR algorithm to be used by eNodeB devices.
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 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 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.
The LtePhy models the physical layer of LTE.
A sink to be plugged to the callback of LteChunkProcessor allowing to save and later retrieve the lat...
Ptr< SpectrumValue > GetValue()
The LteUeNetDevice class implements the UE net device.
Helper class used to assign positions and mobility models to nodes.
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.
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() const
Get a pointer to the requested aggregated Object.
Hold variables of type string.
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
std::string GetName() const
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_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
#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.
static LteInterferenceFrTestSuite LteInterferenceFrTestSuite
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Callback< R, Args... > MakeCallback(R(T::*memPtr)(Args...), OBJ objPtr)
Build Callbacks for class method members which take varying numbers of arguments and potentially retu...