16#include "ns3/boolean.h" 
   17#include "ns3/double.h" 
   19#include "ns3/ff-mac-scheduler.h" 
   21#include "ns3/lte-chunk-processor.h" 
   22#include "ns3/lte-enb-net-device.h" 
   23#include "ns3/lte-enb-phy.h" 
   24#include "ns3/lte-helper.h" 
   25#include "ns3/lte-spectrum-value-helper.h" 
   26#include "ns3/lte-ue-net-device.h" 
   27#include "ns3/lte-ue-phy.h" 
   28#include "ns3/mobility-helper.h" 
   29#include "ns3/pointer.h" 
   30#include "ns3/simulator.h" 
   31#include "ns3/spectrum-value.h" 
   32#include "ns3/string.h" 
   53                TestCase::Duration::QUICK);
 
   59                TestCase::Duration::QUICK);
 
   65                TestCase::Duration::QUICK);
 
   71                TestCase::Duration::QUICK);
 
   81                TestCase::Duration::QUICK);
 
   90                TestCase::Duration::QUICK);
 
   99                TestCase::Duration::QUICK);
 
  108                TestCase::Duration::QUICK);
 
 
  128      m_expectedDlSinrDb(10 * 
std::log10(dlSinr))
 
 
  152    lteHelper->SetFfrAlgorithmType(
"ns3::LteFrHardAlgorithm");
 
  154    lteHelper->SetAttribute(
"PathlossModel", 
StringValue(
"ns3::FriisSpectrumPropagationLossModel"));
 
  174    positionAlloc->Add(Vector(0.0, 0.0, 0.0));   
 
  175    positionAlloc->Add(Vector(
m_d2, 
m_d1, 0.0)); 
 
  176    positionAlloc->Add(Vector(0.0, 
m_d1, 0.0));  
 
  177    positionAlloc->Add(Vector(
m_d2, 0.0, 0.0));  
 
  179    mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
 
  180    mobility.SetPositionAllocator(positionAlloc);
 
  181    mobility.Install(allNodes);
 
  187    lteHelper->SetSchedulerType(
"ns3::PfFfMacScheduler");
 
  190    lteHelper->SetFfrAlgorithmAttribute(
"DlSubBandOffset", 
UintegerValue(0));
 
  191    lteHelper->SetFfrAlgorithmAttribute(
"DlSubBandwidth", 
UintegerValue(12));
 
  192    lteHelper->SetFfrAlgorithmAttribute(
"UlSubBandOffset", 
UintegerValue(0));
 
  193    lteHelper->SetFfrAlgorithmAttribute(
"UlSubBandwidth", 
UintegerValue(25));
 
  194    enbDevs.
Add(lteHelper->InstallEnbDevice(enbNodes.
Get(0)));
 
  196    lteHelper->SetFfrAlgorithmAttribute(
"DlSubBandOffset", 
UintegerValue(12));
 
  197    lteHelper->SetFfrAlgorithmAttribute(
"DlSubBandwidth", 
UintegerValue(12));
 
  198    lteHelper->SetFfrAlgorithmAttribute(
"UlSubBandOffset", 
UintegerValue(0));
 
  199    lteHelper->SetFfrAlgorithmAttribute(
"UlSubBandwidth", 
UintegerValue(25));
 
  200    enbDevs.
Add(lteHelper->InstallEnbDevice(enbNodes.
Get(1)));
 
  202    ueDevs1 = lteHelper->InstallUeDevice(ueNodes1);
 
  203    ueDevs2 = lteHelper->InstallUeDevice(ueNodes2);
 
  205    lteHelper->Attach(ueDevs1, enbDevs.
Get(0));
 
  206    lteHelper->Attach(ueDevs2, enbDevs.
Get(1));
 
  211    lteHelper->ActivateDataRadioBearer(ueDevs1, bearer);
 
  212    lteHelper->ActivateDataRadioBearer(ueDevs2, bearer);
 
  222    ue1Phy->GetDownlinkSpectrumPhy()->AddDataSinrChunkProcessor(testDlSinr1);
 
  229    enb1phy->GetUplinkSpectrumPhy()->AddDataSinrChunkProcessor(testUlSinr1);
 
  237    ue2Phy->GetDownlinkSpectrumPhy()->AddDataSinrChunkProcessor(testDlSinr2);
 
  244    enb1phy->GetUplinkSpectrumPhy()->AddDataSinrChunkProcessor(testUlSinr2);
 
  252        double dlSinr1 = dlSinr1Catcher.
GetValue()->operator[](i);
 
  253        double dlSinr1Db = 10.0 * std::log10(dlSinr1);
 
  257                                  "Wrong SINR in DL! (eNB1 --> UE1)");
 
  259        double dlSinr2 = dlSinr2Catcher.
GetValue()->operator[](i);
 
  265        double dlSinr1 = dlSinr1Catcher.
GetValue()->operator[](i);
 
  268        double dlSinr2 = dlSinr2Catcher.
GetValue()->operator[](i);
 
  269        double dlSinr2Db = 10.0 * std::log10(dlSinr2);
 
  273                                  "Wrong SINR in DL! (eNB2 --> UE2)");
 
 
  301      m_commonDlSinrDb(10 * 
std::log10(commonDlSinr)),
 
  302      m_edgeDlSinrDb(10 * 
std::log10(edgeDlSinr)),
 
  303      m_rspqThreshold(rspqThreshold)
 
 
  327    lteHelper->SetFfrAlgorithmType(
"ns3::LteFrStrictAlgorithm");
 
  329    lteHelper->SetFfrAlgorithmAttribute(
"CenterPowerOffset",
 
  331    lteHelper->SetFfrAlgorithmAttribute(
"EdgePowerOffset",
 
  334    lteHelper->SetAttribute(
"PathlossModel", 
StringValue(
"ns3::FriisSpectrumPropagationLossModel"));
 
  354    positionAlloc->Add(Vector(0.0, 0.0, 0.0));   
 
  355    positionAlloc->Add(Vector(
m_d2, 
m_d1, 0.0)); 
 
  357    positionAlloc->Add(Vector(0.0, 
m_d1, 0.0));       
 
  358    positionAlloc->Add(Vector(0.5 * 
m_d2, 0.0, 0.0)); 
 
  360    positionAlloc->Add(Vector(
m_d2, 0.0, 0.0));        
 
  361    positionAlloc->Add(Vector(0.5 * 
m_d2, 
m_d1, 0.0)); 
 
  364    mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
 
  365    mobility.SetPositionAllocator(positionAlloc);
 
  366    mobility.Install(allNodes);
 
  372    lteHelper->SetSchedulerType(
"ns3::PfFfMacScheduler");
 
  375    lteHelper->SetFfrAlgorithmAttribute(
"DlCommonSubBandwidth", 
UintegerValue(12));
 
  376    lteHelper->SetFfrAlgorithmAttribute(
"DlEdgeSubBandOffset", 
UintegerValue(0));
 
  377    lteHelper->SetFfrAlgorithmAttribute(
"DlEdgeSubBandwidth", 
UintegerValue(6));
 
  378    lteHelper->SetFfrAlgorithmAttribute(
"UlCommonSubBandwidth", 
UintegerValue(25));
 
  379    lteHelper->SetFfrAlgorithmAttribute(
"UlEdgeSubBandOffset", 
UintegerValue(0));
 
  380    lteHelper->SetFfrAlgorithmAttribute(
"UlEdgeSubBandwidth", 
UintegerValue(0));
 
  382    enbDevs.
Add(lteHelper->InstallEnbDevice(enbNodes.
Get(0)));
 
  384    lteHelper->SetFfrAlgorithmAttribute(
"DlCommonSubBandwidth", 
UintegerValue(12));
 
  385    lteHelper->SetFfrAlgorithmAttribute(
"DlEdgeSubBandOffset", 
UintegerValue(6));
 
  386    lteHelper->SetFfrAlgorithmAttribute(
"DlEdgeSubBandwidth", 
UintegerValue(6));
 
  387    enbDevs.
Add(lteHelper->InstallEnbDevice(enbNodes.
Get(1)));
 
  389    ueDevs1 = lteHelper->InstallUeDevice(ueNodes1);
 
  390    ueDevs2 = lteHelper->InstallUeDevice(ueNodes2);
 
  392    lteHelper->Attach(ueDevs1, enbDevs.
Get(0));
 
  393    lteHelper->Attach(ueDevs2, enbDevs.
Get(1));
 
  398    lteHelper->ActivateDataRadioBearer(ueDevs1, bearer);
 
  399    lteHelper->ActivateDataRadioBearer(ueDevs2, bearer);
 
  409    ue1Phy->GetDownlinkSpectrumPhy()->AddDataSinrChunkProcessor(testDlSinr1);
 
  416    enb1phy->GetUplinkSpectrumPhy()->AddDataSinrChunkProcessor(testUlSinr1);
 
  424    ue2Phy->GetDownlinkSpectrumPhy()->AddDataSinrChunkProcessor(testDlSinr2);
 
  431    enb1phy->GetUplinkSpectrumPhy()->AddDataSinrChunkProcessor(testUlSinr2);
 
  439        double dlSinr1 = dlSinr1Catcher.
GetValue()->operator[](i);
 
  440        double dlSinr1Db = 10.0 * std::log10(dlSinr1);
 
  444                                  "Wrong SINR in DL! (eNB1 --> UE1)");
 
  446        double dlSinr2 = dlSinr2Catcher.
GetValue()->operator[](i);
 
  447        double dlSinr2Db = 10.0 * std::log10(dlSinr2);
 
  451                                  "Wrong SINR in DL! (eNB2 --> UE2)");
 
  456        double dlSinr1 = dlSinr1Catcher.
GetValue()->operator[](i);
 
  457        double dlSinr1Db = 10.0 * std::log10(dlSinr1);
 
  461                                  "Wrong SINR in DL! (eNB1 --> UE1)");
 
  463        double dlSinr2 = dlSinr2Catcher.
GetValue()->operator[](i);
 
  469        double dlSinr1 = dlSinr1Catcher.
GetValue()->operator[](i);
 
  472        double dlSinr2 = dlSinr2Catcher.
GetValue()->operator[](i);
 
  473        double dlSinr2Db = 10.0 * std::log10(dlSinr2);
 
  477                                  "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, Duration duration=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.
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_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...