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)
139 m_expectedDlSinrDb(10 *
std::log10(dlSinr))
163 lteHelper->SetFfrAlgorithmType(
"ns3::LteFrHardAlgorithm");
165 lteHelper->SetAttribute(
"PathlossModel",
StringValue(
"ns3::FriisSpectrumPropagationLossModel"));
185 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
186 positionAlloc->Add(Vector(
m_d2,
m_d1, 0.0));
187 positionAlloc->Add(Vector(0.0,
m_d1, 0.0));
188 positionAlloc->Add(Vector(
m_d2, 0.0, 0.0));
190 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
191 mobility.SetPositionAllocator(positionAlloc);
192 mobility.Install(allNodes);
198 lteHelper->SetSchedulerType(
"ns3::PfFfMacScheduler");
201 lteHelper->SetFfrAlgorithmAttribute(
"DlSubBandOffset",
UintegerValue(0));
202 lteHelper->SetFfrAlgorithmAttribute(
"DlSubBandwidth",
UintegerValue(12));
203 lteHelper->SetFfrAlgorithmAttribute(
"UlSubBandOffset",
UintegerValue(0));
204 lteHelper->SetFfrAlgorithmAttribute(
"UlSubBandwidth",
UintegerValue(25));
205 enbDevs.
Add(lteHelper->InstallEnbDevice(enbNodes.
Get(0)));
207 lteHelper->SetFfrAlgorithmAttribute(
"DlSubBandOffset",
UintegerValue(12));
208 lteHelper->SetFfrAlgorithmAttribute(
"DlSubBandwidth",
UintegerValue(12));
209 lteHelper->SetFfrAlgorithmAttribute(
"UlSubBandOffset",
UintegerValue(0));
210 lteHelper->SetFfrAlgorithmAttribute(
"UlSubBandwidth",
UintegerValue(25));
211 enbDevs.
Add(lteHelper->InstallEnbDevice(enbNodes.
Get(1)));
213 ueDevs1 = lteHelper->InstallUeDevice(ueNodes1);
214 ueDevs2 = lteHelper->InstallUeDevice(ueNodes2);
216 lteHelper->Attach(ueDevs1, enbDevs.
Get(0));
217 lteHelper->Attach(ueDevs2, enbDevs.
Get(1));
222 lteHelper->ActivateDataRadioBearer(ueDevs1, bearer);
223 lteHelper->ActivateDataRadioBearer(ueDevs2, bearer);
233 ue1Phy->GetDownlinkSpectrumPhy()->AddDataSinrChunkProcessor(testDlSinr1);
240 enb1phy->GetUplinkSpectrumPhy()->AddDataSinrChunkProcessor(testUlSinr1);
248 ue2Phy->GetDownlinkSpectrumPhy()->AddDataSinrChunkProcessor(testDlSinr2);
255 enb1phy->GetUplinkSpectrumPhy()->AddDataSinrChunkProcessor(testUlSinr2);
263 double dlSinr1 = dlSinr1Catcher.
GetValue()->operator[](i);
264 double dlSinr1Db = 10.0 * std::log10(dlSinr1);
268 "Wrong SINR in DL! (eNB1 --> UE1)");
270 double dlSinr2 = dlSinr2Catcher.
GetValue()->operator[](i);
276 double dlSinr1 = dlSinr1Catcher.
GetValue()->operator[](i);
279 double dlSinr2 = dlSinr2Catcher.
GetValue()->operator[](i);
280 double dlSinr2Db = 10.0 * std::log10(dlSinr2);
284 "Wrong SINR in DL! (eNB2 --> UE2)");
312 m_commonDlSinrDb(10 *
std::log10(commonDlSinr)),
313 m_edgeDlSinrDb(10 *
std::log10(edgeDlSinr)),
314 m_rspqThreshold(rspqThreshold)
338 lteHelper->SetFfrAlgorithmType(
"ns3::LteFrStrictAlgorithm");
340 lteHelper->SetFfrAlgorithmAttribute(
"CenterPowerOffset",
342 lteHelper->SetFfrAlgorithmAttribute(
"EdgePowerOffset",
345 lteHelper->SetAttribute(
"PathlossModel",
StringValue(
"ns3::FriisSpectrumPropagationLossModel"));
365 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
366 positionAlloc->Add(Vector(
m_d2,
m_d1, 0.0));
368 positionAlloc->Add(Vector(0.0,
m_d1, 0.0));
369 positionAlloc->Add(Vector(0.5 *
m_d2, 0.0, 0.0));
371 positionAlloc->Add(Vector(
m_d2, 0.0, 0.0));
372 positionAlloc->Add(Vector(0.5 *
m_d2,
m_d1, 0.0));
375 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
376 mobility.SetPositionAllocator(positionAlloc);
377 mobility.Install(allNodes);
383 lteHelper->SetSchedulerType(
"ns3::PfFfMacScheduler");
386 lteHelper->SetFfrAlgorithmAttribute(
"DlCommonSubBandwidth",
UintegerValue(12));
387 lteHelper->SetFfrAlgorithmAttribute(
"DlEdgeSubBandOffset",
UintegerValue(0));
388 lteHelper->SetFfrAlgorithmAttribute(
"DlEdgeSubBandwidth",
UintegerValue(6));
389 lteHelper->SetFfrAlgorithmAttribute(
"UlCommonSubBandwidth",
UintegerValue(25));
390 lteHelper->SetFfrAlgorithmAttribute(
"UlEdgeSubBandOffset",
UintegerValue(0));
391 lteHelper->SetFfrAlgorithmAttribute(
"UlEdgeSubBandwidth",
UintegerValue(0));
393 enbDevs.
Add(lteHelper->InstallEnbDevice(enbNodes.
Get(0)));
395 lteHelper->SetFfrAlgorithmAttribute(
"DlCommonSubBandwidth",
UintegerValue(12));
396 lteHelper->SetFfrAlgorithmAttribute(
"DlEdgeSubBandOffset",
UintegerValue(6));
397 lteHelper->SetFfrAlgorithmAttribute(
"DlEdgeSubBandwidth",
UintegerValue(6));
398 enbDevs.
Add(lteHelper->InstallEnbDevice(enbNodes.
Get(1)));
400 ueDevs1 = lteHelper->InstallUeDevice(ueNodes1);
401 ueDevs2 = lteHelper->InstallUeDevice(ueNodes2);
403 lteHelper->Attach(ueDevs1, enbDevs.
Get(0));
404 lteHelper->Attach(ueDevs2, enbDevs.
Get(1));
409 lteHelper->ActivateDataRadioBearer(ueDevs1, bearer);
410 lteHelper->ActivateDataRadioBearer(ueDevs2, bearer);
420 ue1Phy->GetDownlinkSpectrumPhy()->AddDataSinrChunkProcessor(testDlSinr1);
427 enb1phy->GetUplinkSpectrumPhy()->AddDataSinrChunkProcessor(testUlSinr1);
435 ue2Phy->GetDownlinkSpectrumPhy()->AddDataSinrChunkProcessor(testDlSinr2);
442 enb1phy->GetUplinkSpectrumPhy()->AddDataSinrChunkProcessor(testUlSinr2);
450 double dlSinr1 = dlSinr1Catcher.
GetValue()->operator[](i);
451 double dlSinr1Db = 10.0 * std::log10(dlSinr1);
455 "Wrong SINR in DL! (eNB1 --> UE1)");
457 double dlSinr2 = dlSinr2Catcher.
GetValue()->operator[](i);
458 double dlSinr2Db = 10.0 * std::log10(dlSinr2);
462 "Wrong SINR in DL! (eNB2 --> UE2)");
467 double dlSinr1 = dlSinr1Catcher.
GetValue()->operator[](i);
468 double dlSinr1Db = 10.0 * std::log10(dlSinr1);
472 "Wrong SINR in DL! (eNB1 --> UE1)");
474 double dlSinr2 = dlSinr2Catcher.
GetValue()->operator[](i);
480 double dlSinr1 = dlSinr1Catcher.
GetValue()->operator[](i);
483 double dlSinr2 = dlSinr2Catcher.
GetValue()->operator[](i);
484 double dlSinr2Db = 10.0 * std::log10(dlSinr2);
488 "Wrong SINR in DL! (eNB2 --> UE2)");
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.
@ GBR_CONV_VOICE
GBR Conversational Voice.
The eNodeB device implementation.
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()
void ReportValue(const SpectrumValue &value)
function to be plugged to LteChunkProcessor::AddCallback ()
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.
Ptr< T > GetObject() const
Get a pointer to the requested aggregated Object.
Smart pointer class similar to boost::intrusive_ptr.
static void Destroy()
Execute the events scheduled with ScheduleDestroy().
static void Run()
Run the simulation.
static void Stop()
Tell the Simulator the calling event should be the last one executed.
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.
static LteInterferenceFrTestSuite LteInterferenceFrTestSuite
Static variable for test initialization.
#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.
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...