22 #include "ns3/simulator.h" 24 #include "ns3/string.h" 25 #include "ns3/double.h" 27 #include "ns3/boolean.h" 28 #include "ns3/mobility-helper.h" 29 #include "ns3/lte-helper.h" 30 #include "ns3/ff-mac-scheduler.h" 32 #include "ns3/lte-enb-phy.h" 33 #include "ns3/lte-enb-net-device.h" 35 #include "ns3/lte-ue-phy.h" 36 #include "ns3/lte-ue-net-device.h" 38 #include <ns3/lte-chunk-processor.h> 56 uint32_t frameNo, uint32_t subframeNo, uint16_t rnti,
57 uint8_t mcs, uint16_t sizeTb, uint8_t ccId)
59 testcase->
UlScheduling (frameNo, subframeNo, rnti, mcs, sizeTb);
75 AddTestCase (
new LteInterferenceTestCase (
"d1=3000, d2=6000", 3000.000000, 6000.000000, 3.844681, 1.714583, 0.761558, 0.389662, 6, 4), TestCase::QUICK);
76 AddTestCase (
new LteInterferenceTestCase (
"d1=50, d2=50", 50.000000, 50.000000, 0.999997, 0.999907, 0.239828, 0.239808, 2, 2), TestCase::QUICK);
77 AddTestCase (
new LteInterferenceTestCase (
"d1=50, d2=100", 50.000000, 100.000000, 3.999955, 3.998520, 0.785259, 0.785042, 6, 6), TestCase::QUICK);
78 AddTestCase (
new LteInterferenceTestCase (
"d1=50, d2=200", 50.000000, 200.000000, 15.999282, 15.976339, 1.961072, 1.959533, 14, 14), TestCase::QUICK);
79 AddTestCase (
new LteInterferenceTestCase (
"d1=50, d2=500", 50.000000, 500.000000, 99.971953, 99.082845, 4.254003, 4.241793, 22, 22), TestCase::QUICK);
80 AddTestCase (
new LteInterferenceTestCase (
"d1=50, d2=1000", 50.000000, 1000.000000, 399.551632, 385.718468, 6.194952, 6.144825, 28, 28), TestCase::QUICK);
81 AddTestCase (
new LteInterferenceTestCase (
"d1=50, d2=10000", 50.000000, 10000.000000, 35964.181431, 8505.970614, 12.667381, 10.588084, 28, 28), TestCase::QUICK);
82 AddTestCase (
new LteInterferenceTestCase (
"d1=50, d2=100000", 50.000000, 100000.000000, 327284.773828, 10774.181090, 15.853097, 10.928917, 28, 28), TestCase::QUICK);
83 AddTestCase (
new LteInterferenceTestCase (
"d1=50, d2=1000000", 50.000000, 1000000.000000, 356132.574152, 10802.988445, 15.974963, 10.932767, 28, 28), TestCase::QUICK);
84 AddTestCase (
new LteInterferenceTestCase (
"d1=4500, d2=12600", 4500.000000, 12600.000000, 6.654462, 1.139831, 1.139781, 0.270399, 8, 2), TestCase::QUICK);
85 AddTestCase (
new LteInterferenceTestCase (
"d1=5400, d2=12600", 5400.000000, 12600.000000, 4.621154, 0.791549, 0.876368, 0.193019, 6, 0), TestCase::QUICK);
101 m_expectedDlSinrDb (10 *
std::log10 (dlSinr)),
102 m_expectedUlSinrDb (10 *
std::log10 (ulSinr)),
147 positionAlloc->
Add (Vector (0.0, 0.0, 0.0));
149 positionAlloc->
Add (Vector (0.0,
m_d1, 0.0));
150 positionAlloc->
Add (Vector (
m_d2, 0.0, 0.0));
152 mobility.SetMobilityModel (
"ns3::ConstantPositionMobilityModel");
153 mobility.SetPositionAllocator (positionAlloc);
166 lteHelper->
Attach (ueDevs1, enbDevs.
Get (0));
167 lteHelper->
Attach (ueDevs2, enbDevs.
Get (1));
182 testDlSinr1->AddCallback (
MakeCallback (&LteSpectrumValueCatcher::ReportValue, &dlSinr1Catcher));
188 testUlSinr1->AddCallback (
MakeCallback (&LteSpectrumValueCatcher::ReportValue, &ulSinr1Catcher));
191 Config::Connect (
"/NodeList/0/DeviceList/0/ComponentCarrierMap/*/LteEnbMac/DlScheduling",
194 Config::Connect (
"/NodeList/0/DeviceList/0/ComponentCarrierMap/*/LteEnbMac/UlScheduling",
203 testDlSinr2->AddCallback (
MakeCallback (&LteSpectrumValueCatcher::ReportValue, &dlSinr2Catcher));
209 testUlSinr2->AddCallback (
MakeCallback (&LteSpectrumValueCatcher::ReportValue, &ulSinr2Catcher));
212 Config::Connect (
"/NodeList/1/DeviceList/0/ComponentCarrierMap/*/LteEnbMac/DlScheduling",
215 Config::Connect (
"/NodeList/1/DeviceList/0/ComponentCarrierMap/*/LteEnbMac/UlScheduling",
219 Simulator::Stop (
Seconds (0.100));
224 double dlSinr1Db = 10.0 * std::log10 (dlSinr1Catcher.GetValue ()->operator[] (0));
227 double dlSinr2Db = 10.0 * std::log10 (dlSinr2Catcher.GetValue ()->operator[] (0));
232 double ulSinr1Db = 10.0 * std::log10 (ulSinr1Catcher.GetValue ()->operator[] (0));
235 double ulSinr2Db = 10.0 * std::log10 (ulSinr2Catcher.GetValue ()->operator[] (0));
239 Simulator::Destroy ();
257 uint8_t mcs, uint16_t sizeTb)
259 NS_LOG_FUNCTION (frameNo << subframeNo << rnti << (uint32_t) mcs << sizeTb);
virtual void DoRun(void)
Implementation to actually run this TestCase.
Ptr< NetDevice > Get(uint32_t i) const
Get the Ptr<NetDevice> stored in this container at a given index.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
AttributeValue implementation for Boolean.
NetDeviceContainer InstallEnbDevice(NodeContainer c)
Create a set of eNodeB devices.
Hold variables of type string.
static LteInterferenceTestSuite lteLinkAdaptationWithInterferenceTestSuite
uint32_t frameNo
frame number
Callback< R > MakeBoundCallback(R(*fnPtr)(TX), ARG a1)
Make Callbacks with one bound argument.
void DlScheduling(DlSchedulingCallbackInfo dlInfo)
DL scheduling function.
void Attach(NetDeviceContainer ueDevices)
Enables automatic attachment of a set of UE devices to a suitable cell using Idle mode initial cell s...
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
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)
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
Ptr< LteSpectrumPhy > GetUplinkSpectrumPhy()
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
void ActivateDataRadioBearer(NetDeviceContainer ueDevices, EpsBearer bearer)
Activate a Data Radio Bearer on a given UE devices (for LTE-only simulation).
void SetSchedulerType(std::string type)
Set the type of scheduler to be used by eNodeB devices.
double m_d1
distance between UE and ENB
This class contains the specification of EPS Bearers.
Hold variables of type enum.
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
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 SetSchedulerAttribute(std::string n, const AttributeValue &v)
Set an attribute for the scheduler to be created.
#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.
holds a vector of ns3::NetDevice pointers
Callback< R > MakeCallback(R(T::*memPtr)(void), OBJ objPtr)
A sink to be plugged to the callback of LteChunkProcessor allowing to save and later retrieve the lat...
uint32_t subframeNo
subframe number
Ptr< LteSpectrumPhy > GetDownlinkSpectrumPhy()
#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...
void Connect(std::string path, const CallbackBase &cb)
Ptr< T > GetObject(void) const
Get a pointer to the requested aggregated Object.
uint16_t m_dlMcs
the DL MCS
Every class exported by the ns3 library is enclosed in the ns3 namespace.
keep track of a set of node pointers.
double m_expectedDlSinrDb
expected DL SINR in dB
double m_d2
distance between UE and other ENB
Test that SINR calculation and MCS selection works fine in a multi-cell interference scenario...
NetDeviceContainer InstallUeDevice(NodeContainer c)
Create a set of UE devices.
Helper class used to assign positions and mobility models to nodes.
std::string GetName(void) const
uint16_t m_ulMcs
the UL MCS
Time Seconds(double value)
Construct a Time in the indicated unit.
void SetDefault(std::string name, const AttributeValue &value)
LteInterferenceTestSuite()
TestSuite.
void Add(Vector v)
Add a position to the list of positions.
Test suite for interference test.
void LteTestDlSchedulingCallback(LteInterferenceTestCase *testcase, std::string path, DlSchedulingCallbackInfo dlInfo)
Time Now(void)
create an ns3::Time instance which contains the current simulation time.
void Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.
DlSchedulingCallbackInfo structure.
LteInterferenceTestCase(std::string name, double d1, double d2, double dlSinr, double ulSinr, double dlSe, double ulSe, uint16_t dlMcs, uint16_t ulMcs)
Constructor.
This class can be used to hold variables of floating point type such as 'double' or 'float'...
void SetAttribute(std::string name, const AttributeValue &value)
Set a single attribute, raising fatal errors if unsuccessful.
The eNodeB device implementation.
virtual ~LteInterferenceTestCase()
The LtePhy models the physical layer of LTE.
The LteUeNetDevice class implements the UE net device.