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/integer.h>
33 #include "ns3/mobility-helper.h"
34 #include "ns3/lte-helper.h"
36 #include <ns3/ff-mac-scheduler.h>
37 #include <ns3/lte-enb-net-device.h>
38 #include <ns3/lte-enb-phy.h>
39 #include <ns3/lte-enb-rrc.h>
40 #include <ns3/lte-ue-net-device.h>
41 #include <ns3/lte-ue-phy.h>
42 #include <ns3/lte-ue-rrc.h>
45 #include <ns3/lte-common.h>
48 #include <ns3/lte-rrc-sap.h>
59 :
TestSuite (
"lte-uplink-power-control", SYSTEM)
63 NS_LOG_INFO (
"Creating LteUplinkPowerControlTestSuite");
77 uint16_t cellId, uint16_t rnti,
double txPower)
84 uint16_t cellId, uint16_t rnti,
double txPower)
91 uint16_t cellId, uint16_t rnti,
double txPower)
99 NS_LOG_INFO (
"Creating LteUplinkPowerControlTestCase");
108 double expectedPuschTxPower,
double expectedPucchTxPower,
double expectedSrsTxPower)
111 NS_LOG_DEBUG (
"Teleport UE to : (" << x <<
", " << y <<
", 0)");
123 double expectedPuschTxPower,
double expectedPucchTxPower,
double expectedSrsTxPower)
140 NS_LOG_DEBUG (
"PuschTxPower : CellId: " << cellId <<
" RNTI: " << rnti <<
" PuschTxPower: " << txPower);
153 NS_LOG_DEBUG (
"PucchTxPower : CellId: " << cellId <<
" RNTI: " << rnti <<
" PuschTxPower: " << txPower);
167 NS_LOG_DEBUG (
"SrsTxPower : CellId: " << cellId <<
" RNTI: " << rnti <<
" PuschTxPower: " << txPower);
185 NS_LOG_INFO (
"Creating LteUplinkPowerControlTestCase");
198 double eNbTxPower = 30;
210 uint8_t bandwidth = 25;
228 positionAlloc->
Add (Vector (0.0, 0.0, 0.0));
229 positionAlloc->
Add (Vector (d1, 0.0, 0.0));
253 m_ueUpc->TraceConnectWithoutContext (
"ReportPucchTxPower",
255 m_ueUpc->TraceConnectWithoutContext (
"ReportSrsTxPower",
259 lteHelper->
Attach (ueDevs, enbDevs.
Get (0));
289 Simulator::Stop (
Seconds (1.200));
292 Simulator::Destroy ();
298 NS_LOG_INFO (
"Creating LteUplinkClosedLoopPowerControlAbsoluteModeTestCase");
311 double eNbTxPower = 30;
324 uint8_t bandwidth = 25;
342 positionAlloc->
Add (Vector (0.0, 0.0, 0.0));
343 positionAlloc->
Add (Vector (d1, 0.0, 0.0));
367 m_ueUpc->TraceConnectWithoutContext (
"ReportPucchTxPower",
369 m_ueUpc->TraceConnectWithoutContext (
"ReportSrsTxPower",
373 lteHelper->
Attach (ueDevs, enbDevs.
Get (0));
381 enbDevs.
Get (0)->GetAttribute (
"LteFfrAlgorithm", tmp);
402 Simulator::Stop (
Seconds (1.000));
405 Simulator::Destroy ();
411 NS_LOG_INFO (
"Creating LteUplinkClosedLoopPowerControlAccumulatedModeTestCase");
424 double eNbTxPower = 30;
437 uint8_t bandwidth = 25;
455 positionAlloc->
Add (Vector (0.0, 0.0, 0.0));
456 positionAlloc->
Add (Vector (d1, 0.0, 0.0));
480 m_ueUpc->TraceConnectWithoutContext (
"ReportPucchTxPower",
482 m_ueUpc->TraceConnectWithoutContext (
"ReportSrsTxPower",
486 lteHelper->
Attach (ueDevs, enbDevs.
Get (0));
494 enbDevs.
Get (0)->GetAttribute (
"LteFfrAlgorithm", tmp);
523 Simulator::Stop (
Seconds (1.200));
526 Simulator::Destroy ();
#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.
void PucchTxPowerTrace(uint16_t cellId, uint16_t rnti, double txPower)
Ptr< NetDevice > Get(uint32_t i) const
Get the Ptr stored in this container at a given index.
void SetTpc(uint32_t tpc, uint32_t num, bool acculumatedMode)
Callback< R > MakeBoundCallback(R(*fnPtr)(TX), ARG a1)
Make Callbacks with one bound argument.
virtual ~LteUplinkClosedLoopPowerControlAbsoluteModeTestCase()
Ptr< Object > GetObject(void) const
Get the Object referenced by the PointerValue.
void SrsTxPowerTrace(uint16_t cellId, uint16_t rnti, double txPower)
Hold a signed integer type.
void Attach(NetDeviceContainer ueDevices)
Enables automatic attachment of a set of UE devices to a suitable cell using Idle mode initial cell s...
Ptr< LteUePowerControl > m_ueUpc
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
double m_expectedSrsTxPower
void TeleportUe(uint32_t x, uint32_t y, double expectedPuschTxPower, double expectedPucchTxPower, double expectedSrsTxPower)
void ActivateDataRadioBearer(NetDeviceContainer ueDevices, EpsBearer bearer)
Activate a Data Radio Bearer on a given UE devices (for LTE-only simulation).
double m_expectedPuschTxPower
virtual ~LteUplinkOpenLoopPowerControlTestCase()
void SetFfrAlgorithmType(std::string type)
Set the type of FFR algorithm to be used by eNodeB devices.
void SetSchedulerType(std::string type)
Set the type of scheduler to be used by eNodeB devices.
LteUplinkClosedLoopPowerControlAbsoluteModeTestCase(std::string name)
Keep track of the current position and velocity of an object.
This class contains the specification of EPS Bearers.
void Install(Ptr< Node > node) const
"Layout" a single node according to the current position allocator type.
void AddTestCase(TestCase *testCase, enum TestDuration duration)
Add an individual child TestCase to this test suite.
Hold an unsigned integer type.
void PuschTxPowerNofitication(LteUplinkPowerControlTestCase *testcase, uint16_t cellId, uint16_t rnti, double txPower)
TestCase Data.
holds a vector of ns3::NetDevice pointers
double m_expectedPucchTxPower
Ptr< LteUePowerControl > GetUplinkPowerControl() const
#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...
Ptr< LteFfrSimple > m_ffrSimple
void PuschTxPowerTrace(uint16_t cellId, uint16_t rnti, double txPower)
virtual ~LteUplinkClosedLoopPowerControlAccumulatedModeTestCase()
bool TraceConnectWithoutContext(std::string name, const CallbackBase &cb)
Connect a TraceSource to a Callback without a context.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
keep track of a set of node pointers.
Hold objects of type Ptr.
LteUplinkClosedLoopPowerControlAccumulatedModeTestCase(std::string name)
void SetMobilityModel(std::string type, std::string n1="", const AttributeValue &v1=EmptyAttributeValue(), std::string n2="", const AttributeValue &v2=EmptyAttributeValue(), std::string n3="", const AttributeValue &v3=EmptyAttributeValue(), std::string n4="", const AttributeValue &v4=EmptyAttributeValue(), std::string n5="", const AttributeValue &v5=EmptyAttributeValue(), std::string n6="", const AttributeValue &v6=EmptyAttributeValue(), std::string n7="", const AttributeValue &v7=EmptyAttributeValue(), std::string n8="", const AttributeValue &v8=EmptyAttributeValue(), std::string n9="", const AttributeValue &v9=EmptyAttributeValue())
virtual void DoRun(void)
Implementation to actually run this TestCase.
Test 1.1 Uplink Power Control.
void SetPosition(const Vector &position)
void Reset(void)
Reset the initial value of every attribute as well as the value of every global to what they were bef...
NetDeviceContainer InstallUeDevice(NodeContainer c)
Create a set of UE devices.
Helper class used to assign positions and mobility models to nodes.
Ptr< Node > Get(uint32_t i) const
Get the Ptr stored in this container at a given index.
virtual ~LteUplinkPowerControlTestCase()
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Time Seconds(double value)
Construct a Time in the indicated unit.
void SetDefault(std::string name, const AttributeValue &value)
Ptr< MobilityModel > m_ueMobility
void Add(Vector v)
Add a position to the list of positions.
virtual void DoRun(void)
Implementation to actually run this TestCase.
void SetTpcConfiguration(uint32_t tpc, uint32_t tpcNum, double expectedPuschTxPower, double expectedPucchTxPower, double expectedSrsTxPower)
Time Now(void)
create an ns3::Time instance which contains the current simulation time.
virtual void DoRun(void)
Implementation to actually run this TestCase.
void Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.
void SetPositionAllocator(Ptr< PositionAllocator > allocator)
Set the position allocator which will be used to allocate the initial position of every node initiali...
void SrsTxPowerNofitication(LteUplinkPowerControlTestCase *testcase, uint16_t cellId, uint16_t rnti, double txPower)
static LteUplinkPowerControlTestSuite lteUplinkPowerControlTestSuite
This class can be used to hold variables of floating point type such as 'double' or 'float'...
Ptr< T > GetObject(void) const
Get a pointer to the requested aggregated Object.
LteUplinkOpenLoopPowerControlTestCase(std::string name)
virtual void DoRun(void)
Implementation to actually run this TestCase.
void PucchTxPowerNofitication(LteUplinkPowerControlTestCase *testcase, uint16_t cellId, uint16_t rnti, double txPower)
void SetEnbDeviceAttribute(std::string n, const AttributeValue &v)
Set an attribute for the eNodeB devices (LteEnbNetDevice) to be created.
LteUplinkPowerControlTestSuite()
TestSuite.
The LteUeNetDevice class implements the UE net device.
LteUplinkPowerControlTestCase(std::string name)