25 #include "ns3/lte-helper.h"
26 #include "ns3/mobility-helper.h"
27 #include <ns3/boolean.h>
28 #include <ns3/callback.h>
29 #include <ns3/config.h>
30 #include <ns3/double.h>
32 #include <ns3/ff-mac-scheduler.h>
33 #include <ns3/integer.h>
35 #include <ns3/lte-common.h>
36 #include <ns3/lte-enb-net-device.h>
37 #include <ns3/lte-enb-phy.h>
38 #include <ns3/lte-enb-rrc.h>
39 #include <ns3/lte-rrc-sap.h>
40 #include <ns3/lte-ue-net-device.h>
41 #include <ns3/lte-ue-phy.h>
42 #include <ns3/lte-ue-rrc.h>
43 #include <ns3/pointer.h>
44 #include <ns3/simulator.h>
45 #include <ns3/string.h>
56 :
TestSuite(
"lte-uplink-power-control", SYSTEM)
60 NS_LOG_INFO(
"Creating LteUplinkPowerControlTestSuite");
67 "ClosedLoopAccumulatedModeTest1"),
110 NS_LOG_INFO(
"Creating LteUplinkPowerControlTestCase");
120 double expectedPuschTxPower,
121 double expectedPucchTxPower,
122 double expectedSrsTxPower)
125 NS_LOG_DEBUG(
"Teleport UE to : (" <<
x <<
", " << y <<
", 0)");
138 double expectedPuschTxPower,
139 double expectedPucchTxPower,
140 double expectedSrsTxPower)
157 NS_LOG_DEBUG(
"PuschTxPower : CellId: " << cellId <<
" RNTI: " << rnti
158 <<
" PuschTxPower: " << txPower);
171 NS_LOG_DEBUG(
"PucchTxPower : CellId: " << cellId <<
" RNTI: " << rnti
172 <<
" PuschTxPower: " << txPower);
186 NS_LOG_DEBUG(
"SrsTxPower : CellId: " << cellId <<
" RNTI: " << rnti
187 <<
" PuschTxPower: " << txPower);
204 NS_LOG_INFO(
"Creating LteUplinkPowerControlTestCase");
217 double eNbTxPower = 30;
229 uint16_t bandwidth = 25;
247 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
248 positionAlloc->Add(Vector(d1, 0.0, 0.0));
251 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
252 mobility.SetPositionAllocator(positionAlloc);
269 m_ueUpc = uePhy->GetUplinkPowerControl();
279 lteHelper->
Attach(ueDevs, enbDevs.
Get(0));
375 Simulator::Stop(
Seconds(1.200));
378 Simulator::Destroy();
385 NS_LOG_INFO(
"Creating LteUplinkClosedLoopPowerControlAbsoluteModeTestCase");
399 double eNbTxPower = 30;
412 uint16_t bandwidth = 25;
430 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
431 positionAlloc->Add(Vector(d1, 0.0, 0.0));
434 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
435 mobility.SetPositionAllocator(positionAlloc);
452 m_ueUpc = uePhy->GetUplinkPowerControl();
462 lteHelper->
Attach(ueDevs, enbDevs.
Get(0));
470 enbDevs.
Get(0)->GetAttribute(
"LteFfrAlgorithm", tmp);
539 Simulator::Stop(
Seconds(1.000));
542 Simulator::Destroy();
549 NS_LOG_INFO(
"Creating LteUplinkClosedLoopPowerControlAccumulatedModeTestCase");
563 double eNbTxPower = 30;
576 uint16_t bandwidth = 25;
594 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
595 positionAlloc->Add(Vector(d1, 0.0, 0.0));
598 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
599 mobility.SetPositionAllocator(positionAlloc);
616 m_ueUpc = uePhy->GetUplinkPowerControl();
626 lteHelper->
Attach(ueDevs, enbDevs.
Get(0));
634 enbDevs.
Get(0)->GetAttribute(
"LteFfrAlgorithm", tmp);
735 Simulator::Stop(
Seconds(1.200));
738 Simulator::Destroy();
Lte Uplink Closed Loop Power Control Absolute Mode Test Case.
void DoRun() override
Implementation to actually run this TestCase.
~LteUplinkClosedLoopPowerControlAbsoluteModeTestCase() override
LteUplinkClosedLoopPowerControlAbsoluteModeTestCase(std::string name)
Constructor.
Lte Uplink Closed Loop Power Control Accumulated Mode Test Case.
LteUplinkClosedLoopPowerControlAccumulatedModeTestCase(std::string name)
Constructor.
void DoRun() override
Implementation to actually run this TestCase.
~LteUplinkClosedLoopPowerControlAccumulatedModeTestCase() override
Lte Uplink Open Loop Power Control Test Case.
~LteUplinkOpenLoopPowerControlTestCase() override
LteUplinkOpenLoopPowerControlTestCase(std::string name)
Constructor.
void DoRun() override
Implementation to actually run this TestCase.
Lte Uplink Power Control Test Case.
Ptr< MobilityModel > m_ueMobility
UE mobility model.
bool m_accumulatedMode
indicates whether accumulated mode is being used
void SrsTxPowerTrace(uint16_t cellId, uint16_t rnti, double txPower)
SRS transmit power trace funcction.
void PucchTxPowerTrace(uint16_t cellId, uint16_t rnti, double txPower)
PUCCH transmit power trace funcction.
void SetTpcConfiguration(uint32_t tpc, uint32_t tpcNum, double expectedPuschTxPower, double expectedPucchTxPower, double expectedSrsTxPower)
Set TPC configuration funcction.
void TeleportUe(uint32_t x, uint32_t y, double expectedPuschTxPower, double expectedPucchTxPower, double expectedSrsTxPower)
Teleport UE funcction.
double m_expectedPucchTxPower
expected PUCCH transmit power
void PuschTxPowerTrace(uint16_t cellId, uint16_t rnti, double txPower)
PUSCH transmit power trace funcction.
Ptr< LteFfrSimple > m_ffrSimple
FFR simple.
LteUplinkPowerControlTestCase(std::string name)
Constructor.
void DoRun() override
Implementation to actually run this TestCase.
~LteUplinkPowerControlTestCase() override
Time m_teleportTime
teleport time
double m_expectedSrsTxPower
expected SRS transmit power
double m_expectedPuschTxPower
expected PUSCH transmit power
Ptr< LteUePowerControl > m_ueUpc
UE power control.
Test 1.1 Uplink Power Control.
LteUplinkPowerControlTestSuite()
TestSuite.
This class can be used to hold variables of floating point type such as 'double' or 'float'.
This class contains the specification of EPS Bearers.
Hold a signed integer type.
void SetTpc(uint32_t tpc, uint32_t num, bool accumulatedMode)
Set transmission power control.
void SetFfrAlgorithmType(std::string type)
Set the type of FFR algorithm to be used by eNodeB devices.
NetDeviceContainer InstallEnbDevice(NodeContainer c)
Create a set of eNodeB devices.
void SetSchedulerType(std::string type)
Set the type of scheduler to be used by eNodeB devices.
void Attach(NetDeviceContainer ueDevices)
Enables automatic attachment of a set of UE devices to a suitable cell using Idle mode initial cell s...
void SetEnbDeviceAttribute(std::string n, const AttributeValue &v)
Set an attribute for the eNodeB devices (LteEnbNetDevice) to be created.
void ActivateDataRadioBearer(NetDeviceContainer ueDevices, EpsBearer bearer)
Activate a Data Radio Bearer on a given UE devices (for LTE-only simulation).
NetDeviceContainer InstallUeDevice(NodeContainer c)
Create a set of UE devices.
The LteUeNetDevice class implements the UE net device.
Ptr< LteUePhy > GetPhy() const
Get the Phy.
Helper class used to assign positions and mobility models to nodes.
Keep track of the current position and velocity of an object.
void SetPosition(const Vector &position)
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< Node > Get(uint32_t i) const
Get the Ptr<Node> stored in this container at a given index.
bool TraceConnectWithoutContext(std::string name, const CallbackBase &cb)
Connect a TraceSource to a Callback without a context.
Ptr< T > GetObject() const
Get a pointer to the requested aggregated Object.
Hold objects of type Ptr<T>.
Ptr< Object > GetObject() const
Get the Object referenced by the PointerValue.
void AddTestCase(TestCase *testCase, TestDuration 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)
#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_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 LteUplinkPowerControlTestSuite lteUplinkPowerControlTestSuite
Static variable for test initialization.
auto MakeBoundCallback(R(*fnPtr)(Args...), BArgs &&... bargs)
Make Callbacks with varying number of bound arguments.
Time Now()
create an ns3::Time instance which contains the current simulation time.
#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 SrsTxPowerNotification(LteUplinkPowerControlTestCase *testcase, uint16_t cellId, uint16_t rnti, double txPower)
void PucchTxPowerNotification(LteUplinkPowerControlTestCase *testcase, uint16_t cellId, uint16_t rnti, double txPower)
void PuschTxPowerNotification(LteUplinkPowerControlTestCase *testcase, uint16_t cellId, uint16_t rnti, double txPower)
TestCase Data.
Every class exported by the ns3 library is enclosed in the ns3 namespace.