14#include "ns3/lte-helper.h"
15#include "ns3/mobility-helper.h"
16#include <ns3/boolean.h>
17#include <ns3/callback.h>
18#include <ns3/config.h>
19#include <ns3/double.h>
21#include <ns3/ff-mac-scheduler.h>
22#include <ns3/integer.h>
24#include <ns3/lte-common.h>
25#include <ns3/lte-enb-net-device.h>
26#include <ns3/lte-enb-phy.h>
27#include <ns3/lte-enb-rrc.h>
28#include <ns3/lte-rrc-sap.h>
29#include <ns3/lte-ue-net-device.h>
30#include <ns3/lte-ue-phy.h>
31#include <ns3/lte-ue-rrc.h>
32#include <ns3/pointer.h>
33#include <ns3/simulator.h>
34#include <ns3/string.h>
49 NS_LOG_INFO(
"Creating LteUplinkPowerControlTestSuite");
52 TestCase::Duration::QUICK);
55 TestCase::Duration::QUICK);
57 "ClosedLoopAccumulatedModeTest1"),
58 TestCase::Duration::QUICK);
100 NS_LOG_INFO(
"Creating LteUplinkPowerControlTestCase");
110 double expectedPuschTxPower,
111 double expectedPucchTxPower,
112 double expectedSrsTxPower)
115 NS_LOG_DEBUG(
"Teleport UE to : (" << x <<
", " << y <<
", 0)");
128 double expectedPuschTxPower,
129 double expectedPucchTxPower,
130 double expectedSrsTxPower)
147 NS_LOG_DEBUG(
"PuschTxPower : CellId: " << cellId <<
" RNTI: " << rnti
148 <<
" PuschTxPower: " << txPower);
161 NS_LOG_DEBUG(
"PucchTxPower : CellId: " << cellId <<
" RNTI: " << rnti
162 <<
" PuschTxPower: " << txPower);
176 NS_LOG_DEBUG(
"SrsTxPower : CellId: " << cellId <<
" RNTI: " << rnti
177 <<
" PuschTxPower: " << txPower);
194 NS_LOG_INFO(
"Creating LteUplinkPowerControlTestCase");
207 double eNbTxPower = 30;
219 uint16_t bandwidth = 25;
237 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
238 positionAlloc->Add(Vector(d1, 0.0, 0.0));
241 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
242 mobility.SetPositionAllocator(positionAlloc);
243 mobility.Install(allNodes);
249 lteHelper->SetSchedulerType(
"ns3::PfFfMacScheduler");
251 lteHelper->SetEnbDeviceAttribute(
"DlBandwidth",
UintegerValue(bandwidth));
252 lteHelper->SetEnbDeviceAttribute(
"UlBandwidth",
UintegerValue(bandwidth));
254 enbDevs = lteHelper->InstallEnbDevice(enbNodes);
255 ueDevs = lteHelper->InstallUeDevice(ueNodes);
259 m_ueUpc = uePhy->GetUplinkPowerControl();
261 m_ueUpc->TraceConnectWithoutContext(
"ReportPuschTxPower",
263 m_ueUpc->TraceConnectWithoutContext(
"ReportPucchTxPower",
265 m_ueUpc->TraceConnectWithoutContext(
"ReportSrsTxPower",
269 lteHelper->Attach(ueDevs, enbDevs.
Get(0));
274 lteHelper->ActivateDataRadioBearer(ueDevs, bearer);
375 NS_LOG_INFO(
"Creating LteUplinkClosedLoopPowerControlAbsoluteModeTestCase");
389 double eNbTxPower = 30;
400 lteHelper->SetFfrAlgorithmType(
"ns3::LteFfrSimple");
402 uint16_t bandwidth = 25;
420 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
421 positionAlloc->Add(Vector(d1, 0.0, 0.0));
424 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
425 mobility.SetPositionAllocator(positionAlloc);
426 mobility.Install(allNodes);
432 lteHelper->SetSchedulerType(
"ns3::PfFfMacScheduler");
434 lteHelper->SetEnbDeviceAttribute(
"DlBandwidth",
UintegerValue(bandwidth));
435 lteHelper->SetEnbDeviceAttribute(
"UlBandwidth",
UintegerValue(bandwidth));
437 enbDevs = lteHelper->InstallEnbDevice(enbNodes);
438 ueDevs = lteHelper->InstallUeDevice(ueNodes);
442 m_ueUpc = uePhy->GetUplinkPowerControl();
444 m_ueUpc->TraceConnectWithoutContext(
"ReportPuschTxPower",
446 m_ueUpc->TraceConnectWithoutContext(
"ReportPucchTxPower",
448 m_ueUpc->TraceConnectWithoutContext(
"ReportSrsTxPower",
452 lteHelper->Attach(ueDevs, enbDevs.
Get(0));
457 lteHelper->ActivateDataRadioBearer(ueDevs, bearer);
460 enbDevs.
Get(0)->GetAttribute(
"LteFfrAlgorithm", tmp);
539 NS_LOG_INFO(
"Creating LteUplinkClosedLoopPowerControlAccumulatedModeTestCase");
553 double eNbTxPower = 30;
564 lteHelper->SetFfrAlgorithmType(
"ns3::LteFfrSimple");
566 uint16_t bandwidth = 25;
584 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
585 positionAlloc->Add(Vector(d1, 0.0, 0.0));
588 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
589 mobility.SetPositionAllocator(positionAlloc);
590 mobility.Install(allNodes);
596 lteHelper->SetSchedulerType(
"ns3::PfFfMacScheduler");
598 lteHelper->SetEnbDeviceAttribute(
"DlBandwidth",
UintegerValue(bandwidth));
599 lteHelper->SetEnbDeviceAttribute(
"UlBandwidth",
UintegerValue(bandwidth));
601 enbDevs = lteHelper->InstallEnbDevice(enbNodes);
602 ueDevs = lteHelper->InstallUeDevice(ueNodes);
606 m_ueUpc = uePhy->GetUplinkPowerControl();
608 m_ueUpc->TraceConnectWithoutContext(
"ReportPuschTxPower",
610 m_ueUpc->TraceConnectWithoutContext(
"ReportPucchTxPower",
612 m_ueUpc->TraceConnectWithoutContext(
"ReportSrsTxPower",
616 lteHelper->Attach(ueDevs, enbDevs.
Get(0));
621 lteHelper->ActivateDataRadioBearer(ueDevs, bearer);
624 enbDevs.
Get(0)->GetAttribute(
"LteFfrAlgorithm", tmp);
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.
@ GBR_CONV_VOICE
GBR Conversational Voice.
Hold a signed integer type.
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.
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.
Ptr< T > GetObject() const
Get a pointer to the requested aggregated Object.
AttributeValue implementation for Pointer.
Ptr< Object > GetObject() const
Get the Object referenced by the PointerValue.
Smart pointer class similar to boost::intrusive_ptr.
static EventId Schedule(const Time &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
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)
#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.
Ptr< T > CreateObject(Args &&... args)
Create an object by type, with varying number of constructor parameters.
#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.
Ptr< T1 > DynamicCast(const Ptr< T2 > &p)
Cast a Ptr.