23 #include "ns3/simulator.h"
25 #include "ns3/string.h"
26 #include "ns3/double.h"
28 #include "ns3/boolean.h"
29 #include "ns3/mobility-helper.h"
30 #include "ns3/lte-helper.h"
31 #include "ns3/ff-mac-scheduler.h"
33 #include "ns3/lte-enb-phy.h"
34 #include "ns3/lte-enb-net-device.h"
36 #include "ns3/lte-ue-phy.h"
37 #include "ns3/lte-ue-net-device.h"
38 #include <ns3/lte-enb-rrc.h>
43 #include <ns3/lte-common.h>
52 uint16_t rnti, uint16_t cellId,
double rsrp,
double rsrq,
bool servingCell)
70 :
TestSuite (
"lte-ue-measurements", SYSTEM)
106 m_rsrpDbmUeServingCell (rsrpDbmUe1),
107 m_rsrpDbmUeNeighborCell (rsrpDbmUe2),
108 m_rsrqDbUeServingCell (rsrqDbUe1),
109 m_rsrqDbUeNeighborCell (rsrqDbUe2)
111 NS_LOG_INFO (
"Test UE Measurements d1 = " << d1 <<
" m. and d2 = " << d2 <<
" m.");
128 lteHelper->SetAttribute (
"PathlossModel",
StringValue (
"ns3::FriisSpectrumPropagationLossModel"));
129 lteHelper->SetAttribute (
"UseIdealRrc",
BooleanValue (
false));
151 positionAlloc->Add (
Vector (0.0, 0.0, 0.0));
164 lteHelper->SetSchedulerType (
"ns3::RrFfMacScheduler");
166 enbDevs = lteHelper->InstallEnbDevice (enbNodes);
167 ueDevs1 = lteHelper->InstallUeDevice (ueNodes1);
168 ueDevs2 = lteHelper->InstallUeDevice (ueNodes2);
170 lteHelper->Attach (ueDevs1, enbDevs.
Get (0));
171 lteHelper->Attach (ueDevs2, enbDevs.
Get (1));
176 lteHelper->ActivateDataRadioBearer (ueDevs1, bearer);
177 lteHelper->ActivateDataRadioBearer (ueDevs2, bearer);
185 ue1Phy->GetDownlinkSpectrumPhy ()->AddDataSinrChunkProcessor (testDlSinr1);
189 enb1phy->GetUplinkSpectrumPhy ()->AddDataSinrChunkProcessor (testUlSinr1);
191 Config::Connect (
"/NodeList/2/DeviceList/0/LteUePhy/ReportUeMeasurements",
193 Config::Connect (
"/NodeList/0/DeviceList/0/LteEnbRrc/RecvMeasurementReport",
200 ue2Phy->GetDownlinkSpectrumPhy ()->AddDataSinrChunkProcessor (testDlSinr2);
204 enb1phy->GetUplinkSpectrumPhy ()->AddDataSinrChunkProcessor (testUlSinr2);
206 Config::Connect (
"/NodeList/3/DeviceList/0/LteUePhy/ReportUeMeasurements",
208 Config::Connect (
"/NodeList/1/DeviceList/0/LteEnbRrc/RecvMeasurementReport",
smart pointer class similar to boost::intrusive_ptr
double m_rsrpDbmUeServingCell
hold variables of type string
Ptr< NetDevice > Get(uint32_t i) const
Get the Ptr stored in this container at a given index.
#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...
Callback< R > MakeBoundCallback(R(*fnPtr)(TX), ARG a1)
void Connect(std::string path, const CallbackBase &cb)
NS_LOG_COMPONENT_DEFINE("LteUeMeasurementsTest")
double m_rsrqDbUeServingCell
void Install(Ptr< Node > node) const
"Layout" a single node according to the current position allocator type.
hold variables of type 'enum'
static LteUeMeasurementsTestSuite lteUeMeasurementsTestSuite
double m_rsrpDbmUeNeighborCell
holds a vector of ns3::NetDevice pointers
void RecvMeasurementReportCallback(LteUeMeasurementsTestCase *testcase, std::string path, uint64_t imsi, uint16_t rnti, uint16_t cellId, LteRrcSap::MeasurementReport meas)
void ReportUeMeasurements(uint16_t rnti, uint16_t cellId, double rsrp, double rsrq, bool servingCell)
static void Destroy(void)
void SetDefault(std::string name, const AttributeValue &value)
keep track of a set of node pointers.
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())
void AddTestCase(TestCase *testCase) NS_DEPRECATED
Add an individual child TestCase case to this TestCase.
LteUeMeasurementsTestSuite()
Helper class used to assign positions and mobility models to nodes.
static uint8_t Dbm2RsrpRange(double dbm)
LteUeMeasurementsTestCase(std::string name, double d1, double d2, double rsrpDbmUe1, double rsrpDbmUe2, double rsrqDbUe1, double rsrqDbUe2)
double m_rsrqDbUeNeighborCell
#define NS_LOG_DEBUG(msg)
std::string GetName(void) const
void Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.
virtual void DoRun(void)
Implementation to actually run this TestCase.
void RecvMeasurementReport(uint64_t imsi, uint16_t cellId, uint16_t rnti, LteRrcSap::MeasurementReport meas)
void SetPositionAllocator(Ptr< PositionAllocator > allocator)
static uint8_t Db2RsrqRange(double db)
Hold an floating point type.
virtual ~LteUeMeasurementsTestCase()
Ptr< T > GetObject(void) const
void LogComponentEnable(char const *name, enum LogLevel level)
#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 ReportUeMeasurementsCallback(LteUeMeasurementsTestCase *testcase, std::string path, uint16_t rnti, uint16_t cellId, double rsrp, double rsrq, bool servingCell)