|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
22 #include <ns3/simulator.h>
24 #include <ns3/callback.h>
25 #include <ns3/config.h>
26 #include <ns3/string.h>
27 #include <ns3/double.h>
29 #include <ns3/boolean.h>
30 #include <ns3/pointer.h>
31 #include "ns3/ff-mac-scheduler.h"
32 #include "ns3/mobility-helper.h"
33 #include "ns3/lte-helper.h"
36 #include "ns3/lte-rrc-sap.h"
37 #include <ns3/lte-ue-net-device.h>
38 #include <ns3/lte-ue-mac.h>
54 uint32_t frameNo, uint32_t subframeNo, uint16_t rnti,
55 uint8_t mcs, uint16_t sizeTb, uint8_t ccId)
57 testcase->
UlScheduling (frameNo, subframeNo, rnti, mcs, sizeTb);
69 uint32_t frameNo, uint32_t subframeNo, uint16_t rnti,
70 uint8_t mcs, uint16_t sizeTb, uint8_t componentCarrierId)
72 testcase->
UlScheduling (frameNo, subframeNo, rnti, mcs, sizeTb);
81 :
TestSuite (
"lte-cqi-generation", SYSTEM)
91 LteRrcSap::PdschConfigDedicated::dB0, LteRrcSap::PdschConfigDedicated::dB0, 4, 2), TestCase::QUICK);
93 LteRrcSap::PdschConfigDedicated::dB0, LteRrcSap::PdschConfigDedicated::dB_3, 8, 2), TestCase::QUICK);
95 LteRrcSap::PdschConfigDedicated::dB0, LteRrcSap::PdschConfigDedicated::dB_6, 10, 2), TestCase::QUICK);
97 LteRrcSap::PdschConfigDedicated::dB1, LteRrcSap::PdschConfigDedicated::dB_6, 12, 2), TestCase::QUICK);
99 LteRrcSap::PdschConfigDedicated::dB2, LteRrcSap::PdschConfigDedicated::dB_6, 14, 2), TestCase::QUICK);
101 LteRrcSap::PdschConfigDedicated::dB3, LteRrcSap::PdschConfigDedicated::dB_6, 14, 2), TestCase::QUICK);
103 LteRrcSap::PdschConfigDedicated::dB3, LteRrcSap::PdschConfigDedicated::dB0, 8, 2), TestCase::QUICK);
110 uint16_t dlMcs, uint16_t ulMcs)
111 :
TestCase (
"Downlink Power Control: " + name),
136 uint8_t mcs, uint16_t sizeTb)
180 positionAlloc->
Add (Vector (0.0, 0.0, 0.0));
181 positionAlloc->
Add (Vector (1000, 0.0, 0.0));
182 positionAlloc->
Add (Vector (500.0, 0.0, 0.0));
183 positionAlloc->
Add (Vector (500, 0.0, 0.0));
185 mobility.SetMobilityModel (
"ns3::ConstantPositionMobilityModel");
186 mobility.SetPositionAllocator (positionAlloc);
214 lteHelper->
Attach (ueDevs1, enbDevs.
Get (0));
215 lteHelper->
Attach (ueDevs2, enbDevs.
Get (1));
223 Config::Connect (
"/NodeList/0/DeviceList/0/ComponentCarrierMap/*/LteEnbMac/DlScheduling",
226 Config::Connect (
"/NodeList/0/DeviceList/0/ComponentCarrierMap/*/LteEnbMac/UlScheduling",
229 Config::Connect (
"/NodeList/1/DeviceList/0/ComponentCarrierMap/*/LteEnbMac/DlScheduling",
232 Config::Connect (
"/NodeList/1/DeviceList/0/ComponentCarrierMap/*/LteEnbMac/UlScheduling",
235 Simulator::Stop (
Seconds (1.100));
238 Simulator::Destroy ();
242 uint8_t cell0Pa, uint8_t cell1Pa, uint16_t dlMcs, uint16_t ulMcs)
243 :
TestCase (
"Downlink Power Control: " + name),
269 uint8_t mcs, uint16_t sizeTb)
315 positionAlloc->
Add (Vector (0.0, 0.0, 0.0));
316 positionAlloc->
Add (Vector (1000, 0.0, 0.0));
317 positionAlloc->
Add (Vector (500.0, 0.0, 0.0));
318 positionAlloc->
Add (Vector (500, 0.0, 0.0));
319 positionAlloc->
Add (Vector (1050, 0.0, 0.0));
321 mobility.SetMobilityModel (
"ns3::ConstantPositionMobilityModel");
322 mobility.SetPositionAllocator (positionAlloc);
345 lteUeDev = DynamicCast<LteUeNetDevice> (ueDevs1.
Get(0));
346 lteUeMac = lteUeDev->
GetMac();
348 lteUeDev = DynamicCast<LteUeNetDevice> (ueDevs2.
Get(0));
349 lteUeMac = lteUeDev->
GetMac();
351 lteUeDev = DynamicCast<LteUeNetDevice> (ueDevs2.
Get(1));
352 lteUeMac = lteUeDev->
GetMac();
356 lteHelper->
Attach (ueDevs1, enbDevs.
Get (0));
357 lteHelper->
Attach (ueDevs2, enbDevs.
Get (1));
383 Config::Connect (
"/NodeList/0/DeviceList/0/ComponentCarrierMap/*/LteEnbMac/DlScheduling",
386 Config::Connect (
"/NodeList/0/DeviceList/0/ComponentCarrierMap/*/LteEnbMac/UlScheduling",
389 Simulator::Stop (
Seconds (1.100));
392 Simulator::Destroy ();
holds a vector of ns3::NetDevice pointers
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
static LteCqiGenerationTestSuite lteCqiGenerationTestSuite
void SetPdschConfigDedicated(LteRrcSap::PdschConfigDedicated pdschConfigDedicated)
Set PDSCH config dedicated function.
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
void Add(Vector v)
Add a position to the list of positions.
virtual ~LteCqiGenerationDlPowerControlTestCase()
AttributeValue implementation for Boolean.
LteCqiGenerationTestCase(std::string name, bool usePdcchForCqiGeneration, uint16_t dlMcs, uint16_t ulMcs)
Constructor.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
NetDeviceContainer InstallEnbDevice(NodeContainer c)
Create a set of eNodeB devices.
virtual void DoRun(void)
Implementation to actually run this TestCase.
int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model.
NetDeviceContainer InstallUeDevice(NodeContainer c)
Create a set of UE devices.
Lte Cqi Generation Test Suite.
void UlScheduling(uint32_t frameNo, uint32_t subframeNo, uint16_t rnti, uint8_t mcs, uint16_t sizeTb)
UL Scheduling function.
Ptr< LteUeMac > GetMac(void) const
Get the MAC.
void DlScheduling(DlSchedulingCallbackInfo dlInfo)
DL Scheduling function.
uint16_t m_ulMcs
the UL MCS
void Reset(void)
Reset the initial value of every attribute as well as the value of every global to what they were bef...
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)
Hold objects of type Ptr<T>.
uint8_t m_cell1Pa
cell #1 PA
void Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.
Hold variables of type enum.
void LteTestDlSchedulingCallback2(LteCqiGenerationDlPowerControlTestCase *testcase, std::string path, DlSchedulingCallbackInfo dlInfo)
virtual void DoRun(void)
Implementation to actually run this TestCase.
PdschConfigDedicated structure.
void LteTestDlSchedulingCallback(LteCqiGenerationTestCase *testcase, std::string path, DlSchedulingCallbackInfo dlInfo)
Time Now(void)
create an ns3::Time instance which contains the current simulation time.
LteCqiGenerationDlPowerControlTestCase(std::string name, uint8_t cell0Pa, uint8_t cell1Pa, uint16_t dlMcs, uint16_t ulMcs)
Constructor.
void UlScheduling(uint32_t frameNo, uint32_t subframeNo, uint16_t rnti, uint8_t mcs, uint16_t sizeTb)
UL Scheduling function.
void GetAttribute(std::string name, AttributeValue &value) const
Get the value of an attribute, raising fatal errors if unsuccessful.
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
uint16_t m_dlMcs
the DL MCS
uint8_t m_cell0Pa
cell #0 PA
Ptr< Node > Get(uint32_t i) const
Get the Ptr<Node> stored in this container at a given index.
void SetFfrAlgorithmAttribute(std::string n, const AttributeValue &v)
Set an attribute for the FFR algorithm to be created.
void ChangePdschConfigDedicated(bool change)
Callback function that is used to be connected to trace ChangePdschConfigDedicated.
uint16_t m_ulMcs
the UL MCS
LteCqiGenerationTestSuite()
TestSuite.
uint16_t m_dlMcs
the DL MCS
#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.
void Connect(std::string path, const CallbackBase &cb)
This class contains the specification of EPS Bearers.
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)
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
void SetSchedulerAttribute(std::string n, const AttributeValue &v)
Set an attribute for the scheduler to be created.
Time Seconds(double value)
Construct a Time in the indicated unit.
Callback< R > MakeBoundCallback(R(*fnPtr)(TX), ARG a1)
Make Callbacks with one bound argument.
void SetFfrAlgorithmType(std::string type)
Set the type of FFR algorithm to be used by eNodeB devices.
keep track of a set of node pointers.
bool m_usePdschForCqiGeneration
use PDCCH for CQI generation
void Attach(NetDeviceContainer ueDevices)
Enables automatic attachment of a set of UE devices to a suitable cell using Idle mode initial cell s...
DlSchedulingCallbackInfo structure.
Ptr< Object > GetObject(void) const
Get the Object referenced by the PointerValue.
Hold an unsigned integer type.
void SetDefault(std::string name, const AttributeValue &value)
void SetSchedulerType(std::string type)
Set the type of scheduler to be used by eNodeB devices.
This test is very similar to LteCqiGenerationTestCase.
Ptr< NetDevice > Get(uint32_t i) const
Get the Ptr<NetDevice> stored in this container at a given index.
void DlScheduling(DlSchedulingCallbackInfo dlInfo)
DL Scheduling function.
void Add(NetDeviceContainer other)
Append the contents of another NetDeviceContainer to the end of this container.
Helper class used to assign positions and mobility models to nodes.
This is the test case for testing different configuration of CQI generation.
void ActivateDataRadioBearer(NetDeviceContainer ueDevices, EpsBearer bearer)
Activate a Data Radio Bearer on a given UE devices (for LTE-only simulation).
virtual ~LteCqiGenerationTestCase()