14#include "ns3/ff-mac-scheduler.h"
15#include "ns3/lte-helper.h"
16#include "ns3/lte-rrc-sap.h"
17#include "ns3/mobility-helper.h"
18#include <ns3/boolean.h>
19#include <ns3/callback.h>
20#include <ns3/config.h>
21#include <ns3/double.h>
24#include <ns3/lte-ue-mac.h>
25#include <ns3/lte-ue-net-device.h>
26#include <ns3/pointer.h>
27#include <ns3/simulator.h>
28#include <ns3/string.h>
52 testcase->
UlScheduling(frameNo, subframeNo, rnti, mcs, sizeTb);
71 uint8_t componentCarrierId)
73 testcase->
UlScheduling(frameNo, subframeNo, rnti, mcs, sizeTb);
88 TestCase::Duration::QUICK);
90 TestCase::Duration::QUICK);
97 TestCase::Duration::QUICK);
103 TestCase::Duration::QUICK);
109 TestCase::Duration::QUICK);
115 TestCase::Duration::QUICK);
121 TestCase::Duration::QUICK);
127 TestCase::Duration::QUICK);
133 TestCase::Duration::QUICK);
143 bool usePdcchForCqiGeneration,
146 :
TestCase(
"Downlink Power Control: " + name),
221 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
222 positionAlloc->Add(Vector(1000, 0.0, 0.0));
223 positionAlloc->Add(Vector(500.0, 0.0, 0.0));
224 positionAlloc->Add(Vector(500, 0.0, 0.0));
226 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
227 mobility.SetPositionAllocator(positionAlloc);
228 mobility.Install(allNodes);
234 lteHelper->SetSchedulerType(
"ns3::PfFfMacScheduler");
237 lteHelper->SetFfrAlgorithmType(
"ns3::LteFrHardAlgorithm");
239 lteHelper->SetFfrAlgorithmAttribute(
"DlSubBandOffset",
UintegerValue(0));
240 lteHelper->SetFfrAlgorithmAttribute(
"DlSubBandwidth",
UintegerValue(12));
241 lteHelper->SetFfrAlgorithmAttribute(
"UlSubBandOffset",
UintegerValue(0));
242 lteHelper->SetFfrAlgorithmAttribute(
"UlSubBandwidth",
UintegerValue(25));
243 enbDevs.
Add(lteHelper->InstallEnbDevice(enbNodes.
Get(0)));
245 lteHelper->SetFfrAlgorithmAttribute(
"DlSubBandOffset",
UintegerValue(12));
246 lteHelper->SetFfrAlgorithmAttribute(
"DlSubBandwidth",
UintegerValue(12));
247 lteHelper->SetFfrAlgorithmAttribute(
"UlSubBandOffset",
UintegerValue(0));
248 lteHelper->SetFfrAlgorithmAttribute(
"UlSubBandwidth",
UintegerValue(25));
249 enbDevs.
Add(lteHelper->InstallEnbDevice(enbNodes.
Get(1)));
251 ueDevs1 = lteHelper->InstallUeDevice(ueNodes1);
252 ueDevs2 = lteHelper->InstallUeDevice(ueNodes2);
255 lteHelper->Attach(ueDevs1, enbDevs.
Get(0));
256 lteHelper->Attach(ueDevs2, enbDevs.
Get(1));
261 lteHelper->ActivateDataRadioBearer(ueDevs1, bearer);
262 lteHelper->ActivateDataRadioBearer(ueDevs2, bearer);
264 Config::Connect(
"/NodeList/0/DeviceList/0/ComponentCarrierMap/*/LteEnbMac/DlScheduling",
267 Config::Connect(
"/NodeList/0/DeviceList/0/ComponentCarrierMap/*/LteEnbMac/UlScheduling",
270 Config::Connect(
"/NodeList/1/DeviceList/0/ComponentCarrierMap/*/LteEnbMac/DlScheduling",
273 Config::Connect(
"/NodeList/1/DeviceList/0/ComponentCarrierMap/*/LteEnbMac/UlScheduling",
287 :
TestCase(
"Downlink Power Control: " + name),
341 lteHelper->SetFfrAlgorithmType(
"ns3::LteFfrSimple");
364 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
365 positionAlloc->Add(Vector(1000, 0.0, 0.0));
366 positionAlloc->Add(Vector(500.0, 0.0, 0.0));
367 positionAlloc->Add(Vector(500, 0.0, 0.0));
368 positionAlloc->Add(Vector(1050, 0.0, 0.0));
370 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
371 mobility.SetPositionAllocator(positionAlloc);
372 mobility.Install(allNodes);
378 lteHelper->SetSchedulerType(
"ns3::PfFfMacScheduler");
387 enbDevs = lteHelper->InstallEnbDevice(enbNodes);
388 ueDevs1 = lteHelper->InstallUeDevice(ueNodes1);
389 ueDevs2 = lteHelper->InstallUeDevice(ueNodes2);
395 lteUeMac = lteUeDev->GetMac();
396 lteUeMac->AssignStreams(1);
398 lteUeMac = lteUeDev->GetMac();
399 lteUeMac->AssignStreams(1);
401 lteUeMac = lteUeDev->GetMac();
402 lteUeMac->AssignStreams(2);
405 lteHelper->Attach(ueDevs1, enbDevs.
Get(0));
406 lteHelper->Attach(ueDevs2, enbDevs.
Get(1));
411 lteHelper->ActivateDataRadioBearer(ueDevs1, bearer);
412 lteHelper->ActivateDataRadioBearer(ueDevs2, bearer);
415 enbDevs.
Get(0)->GetAttribute(
"LteFfrAlgorithm", tmp);
417 simpleFfrAlgorithmEnb0->ChangePdschConfigDedicated(
true);
421 simpleFfrAlgorithmEnb0->SetPdschConfigDedicated(pdschConfigDedicatedEnb0);
423 enbDevs.
Get(1)->GetAttribute(
"LteFfrAlgorithm", tmp);
425 simpleFfrAlgorithmEnb1->ChangePdschConfigDedicated(
true);
429 simpleFfrAlgorithmEnb1->SetPdschConfigDedicated(pdschConfigDedicatedEnb1);
431 Config::Connect(
"/NodeList/0/DeviceList/0/ComponentCarrierMap/*/LteEnbMac/DlScheduling",
434 Config::Connect(
"/NodeList/0/DeviceList/0/ComponentCarrierMap/*/LteEnbMac/UlScheduling",
This test is very similar to LteCqiGenerationTestCase.
void DoRun() override
Implementation to actually run this TestCase.
uint8_t m_cell0Pa
cell #0 PA
void DlScheduling(DlSchedulingCallbackInfo dlInfo)
DL Scheduling function.
LteCqiGenerationDlPowerControlTestCase(std::string name, uint8_t cell0Pa, uint8_t cell1Pa, uint16_t dlMcs, uint16_t ulMcs)
Constructor.
~LteCqiGenerationDlPowerControlTestCase() override
uint16_t m_ulMcs
the UL MCS
void UlScheduling(uint32_t frameNo, uint32_t subframeNo, uint16_t rnti, uint8_t mcs, uint16_t sizeTb)
UL Scheduling function.
uint16_t m_dlMcs
the DL MCS
uint8_t m_cell1Pa
cell #1 PA
This is the test case for testing different configuration of CQI generation.
void UlScheduling(uint32_t frameNo, uint32_t subframeNo, uint16_t rnti, uint8_t mcs, uint16_t sizeTb)
UL Scheduling function.
~LteCqiGenerationTestCase() override
void DoRun() override
Implementation to actually run this TestCase.
uint16_t m_ulMcs
the UL MCS
bool m_usePdschForCqiGeneration
use PDCCH for CQI generation
void DlScheduling(DlSchedulingCallbackInfo dlInfo)
DL Scheduling function.
uint16_t m_dlMcs
the DL MCS
LteCqiGenerationTestCase(std::string name, bool usePdcchForCqiGeneration, uint16_t dlMcs, uint16_t ulMcs)
Constructor.
Lte Cqi Generation Test Suite.
LteCqiGenerationTestSuite()
TestSuite.
Hold variables of type enum.
This class contains the specification of EPS Bearers.
@ GBR_CONV_VOICE
GBR Conversational Voice.
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.
AttributeValue implementation for Pointer.
Ptr< Object > GetObject() const
Get the Object referenced by the PointerValue.
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.
void AddTestCase(TestCase *testCase, Duration duration=Duration::QUICK)
Add an individual child TestCase to this test suite.
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)
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_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 LteCqiGenerationTestSuite lteCqiGenerationTestSuite
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.
#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.
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 LteTestUlSchedulingCallback(LteCqiGenerationTestCase *testcase, std::string path, uint32_t frameNo, uint32_t subframeNo, uint16_t rnti, uint8_t mcs, uint16_t sizeTb, uint8_t ccId)
void LteTestUlSchedulingCallback2(LteCqiGenerationDlPowerControlTestCase *testcase, std::string path, uint32_t frameNo, uint32_t subframeNo, uint16_t rnti, uint8_t mcs, uint16_t sizeTb, uint8_t componentCarrierId)
void LteTestDlSchedulingCallback2(LteCqiGenerationDlPowerControlTestCase *testcase, std::string path, DlSchedulingCallbackInfo dlInfo)
void LteTestDlSchedulingCallback(LteCqiGenerationTestCase *testcase, std::string path, DlSchedulingCallbackInfo dlInfo)
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Ptr< T1 > DynamicCast(const Ptr< T2 > &p)
Cast a Ptr.
DlSchedulingCallbackInfo structure.
PdschConfigDedicated structure.