12#include "ns3/boolean.h"
13#include "ns3/double.h"
14#include "ns3/ff-mac-scheduler.h"
16#include "ns3/lte-enb-net-device.h"
17#include "ns3/lte-enb-phy.h"
18#include "ns3/lte-helper.h"
19#include "ns3/lte-ue-net-device.h"
20#include "ns3/lte-ue-phy.h"
21#include "ns3/mobility-helper.h"
22#include "ns3/simulator.h"
23#include "ns3/string.h"
25#include <ns3/lte-chunk-processor.h>
49 testcase->
UlScheduling(frameNo, subframeNo, rnti, mcs, sizeTb);
76 TestCase::Duration::QUICK);
86 TestCase::Duration::QUICK);
96 TestCase::Duration::QUICK);
106 TestCase::Duration::QUICK);
116 TestCase::Duration::QUICK);
126 TestCase::Duration::QUICK);
136 TestCase::Duration::QUICK);
146 TestCase::Duration::QUICK);
156 TestCase::Duration::QUICK);
166 TestCase::Duration::QUICK);
176 TestCase::Duration::QUICK);
201 m_expectedDlSinrDb(10 *
std::log10(dlSinr)),
202 m_expectedUlSinrDb(10 *
std::log10(ulSinr)),
222 lteHelper->SetAttribute(
"PathlossModel",
StringValue(
"ns3::FriisSpectrumPropagationLossModel"));
223 lteHelper->SetAttribute(
"UseIdealRrc",
BooleanValue(
false));
224 lteHelper->SetAttribute(
"UsePdschForCqiGeneration",
BooleanValue(
true));
247 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
248 positionAlloc->Add(Vector(
m_d2,
m_d1, 0.0));
249 positionAlloc->Add(Vector(0.0,
m_d1, 0.0));
250 positionAlloc->Add(Vector(
m_d2, 0.0, 0.0));
252 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
253 mobility.SetPositionAllocator(positionAlloc);
254 mobility.Install(allNodes);
260 lteHelper->SetSchedulerType(
"ns3::RrFfMacScheduler");
262 enbDevs = lteHelper->InstallEnbDevice(enbNodes);
263 ueDevs1 = lteHelper->InstallUeDevice(ueNodes1);
264 ueDevs2 = lteHelper->InstallUeDevice(ueNodes2);
266 lteHelper->Attach(ueDevs1, enbDevs.
Get(0));
267 lteHelper->Attach(ueDevs2, enbDevs.
Get(1));
272 lteHelper->ActivateDataRadioBearer(ueDevs1, bearer);
273 lteHelper->ActivateDataRadioBearer(ueDevs2, bearer);
283 ue1Phy->GetDownlinkSpectrumPhy()->AddDataSinrChunkProcessor(testDlSinr1);
290 enb1phy->GetUplinkSpectrumPhy()->AddDataSinrChunkProcessor(testUlSinr1);
292 Config::Connect(
"/NodeList/0/DeviceList/0/ComponentCarrierMap/*/LteEnbMac/DlScheduling",
295 Config::Connect(
"/NodeList/0/DeviceList/0/ComponentCarrierMap/*/LteEnbMac/UlScheduling",
304 ue2Phy->GetDownlinkSpectrumPhy()->AddDataSinrChunkProcessor(testDlSinr2);
311 enb1phy->GetUplinkSpectrumPhy()->AddDataSinrChunkProcessor(testUlSinr2);
313 Config::Connect(
"/NodeList/1/DeviceList/0/ComponentCarrierMap/*/LteEnbMac/DlScheduling",
316 Config::Connect(
"/NodeList/1/DeviceList/0/ComponentCarrierMap/*/LteEnbMac/UlScheduling",
325 double dlSinr1Db = 10.0 * std::log10(dlSinr1Catcher.
GetValue()->operator[](0));
329 "Wrong SINR in DL! (eNB1 --> UE1)");
331 double dlSinr2Db = 10.0 * std::log10(dlSinr2Catcher.
GetValue()->operator[](0));
335 "Wrong SINR in DL! (eNB2 --> UE2)");
339 double ulSinr1Db = 10.0 * std::log10(ulSinr1Catcher.
GetValue()->operator[](0));
343 "Wrong SINR in UL! (UE1 --> eNB1)");
345 double ulSinr2Db = 10.0 * std::log10(ulSinr2Catcher.
GetValue()->operator[](0));
349 "Wrong SINR in UL! (UE2 --> eNB2)");
Test that SINR calculation and MCS selection works fine in a multi-cell interference scenario.
LteInterferenceTestCase(std::string name, double d1, double d2, double dlSinr, double ulSinr, double dlSe, double ulSe, uint16_t dlMcs, uint16_t ulMcs)
Constructor.
~LteInterferenceTestCase() override
void DoRun() override
Implementation to actually run this TestCase.
double m_expectedDlSinrDb
expected DL SINR in dB
uint16_t m_dlMcs
the DL MCS
void UlScheduling(uint32_t frameNo, uint32_t subframeNo, uint16_t rnti, uint8_t mcs, uint16_t sizeTb)
UL scheduling function.
double m_expectedUlSinrDb
expected UL SINR in dB
void DlScheduling(DlSchedulingCallbackInfo dlInfo)
DL scheduling function.
double m_d2
distance between UE and other ENB
uint16_t m_ulMcs
the UL MCS
double m_d1
distance between UE and ENB
Test suite for interference test.
LteInterferenceTestSuite()
TestSuite.
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
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< 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 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.
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
void SetDefault(std::string name, const AttributeValue &value)
void Connect(std::string path, const CallbackBase &cb)
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#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 LteInterferenceTestSuite lteLinkAdaptationWithInterferenceTestSuite
Static variable for test initialization.
auto MakeBoundCallback(R(*fnPtr)(Args...), BArgs &&... bargs)
Make Callbacks with varying number of bound arguments.
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(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 LteTestUlSchedulingCallback(CarrierAggregationTestCase *testcase, std::string path, uint32_t frameNo, uint32_t subframeNo, uint16_t rnti, uint8_t mcs, uint16_t sizeTb, uint8_t ccId)
void LteTestDlSchedulingCallback(CarrierAggregationTestCase *testcase, std::string path, DlSchedulingCallbackInfo dlInfo)
void LteTestDlSchedulingCallback(LteInterferenceTestCase *testcase, std::string path, DlSchedulingCallbackInfo dlInfo)
void LteTestUlSchedulingCallback(LteInterferenceTestCase *testcase, std::string path, uint32_t frameNo, uint32_t subframeNo, uint16_t rnti, uint8_t mcs, uint16_t sizeTb, uint8_t ccId)
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...
DlSchedulingCallbackInfo structure.
uint32_t subframeNo
subframe number
uint32_t frameNo
frame number