A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
LteUeMeasurementsPiecewiseTestCase1 Class Reference

Testing UE measurements in LTE with simulation of 1 eNodeB and 1 UE in piecewise configuration and 120 ms report interval. More...

#include "lte-test-ue-measurements.h"

+ Inheritance diagram for LteUeMeasurementsPiecewiseTestCase1:
+ Collaboration diagram for LteUeMeasurementsPiecewiseTestCase1:

Public Member Functions

 LteUeMeasurementsPiecewiseTestCase1 (std::string name, LteRrcSap::ReportConfigEutra config, std::vector< Time > expectedTime, std::vector< uint8_t > expectedRsrp)
 Constructor.
 
 ~LteUeMeasurementsPiecewiseTestCase1 () override
 
void RecvMeasurementReportCallback (std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti, LteRrcSap::MeasurementReport report)
 Triggers when eNodeB receives measurement report from UE, then perform verification on it.
 
- Public Member Functions inherited from ns3::TestCase
 TestCase (const TestCase &)=delete
 
virtual ~TestCase ()
 Destructor.
 
std::string GetName () const
 
TestCaseoperator= (const TestCase &)=delete
 

Private Member Functions

void DoRun () override
 Setup the simulation with the intended UE measurement reporting configuration, run it, and connect the RecvMeasurementReportCallback function to the LteUeRrc::RecvMeasurementReport trace source.
 
void DoTeardown () override
 Runs at the end of the simulation, verifying that all expected measurement reports have been examined.
 
void TeleportFar ()
 Teleport far function.
 
void TeleportNear ()
 Teleport near function.
 
void TeleportVeryFar ()
 Teleport far function.
 
void TeleportVeryNear ()
 Teleport very near function.
 

Private Attributes

LteRrcSap::ReportConfigEutra m_config
 The active report triggering configuration.
 
uint8_t m_expectedMeasId
 The measurement identity being tested.
 
std::vector< uint8_t > m_expectedRsrp
 The list of expected values of RSRP (in 3GPP range unit) from the measurement reports received.
 
std::vector< Timem_expectedTime
 The list of expected time when measurement reports are received by eNodeB.
 
std::vector< uint8_t >::iterator m_itExpectedRsrp
 Pointer to the element of m_expectedRsrp which is expected to occur next in the simulation.
 
std::vector< Time >::iterator m_itExpectedTime
 Pointer to the element of m_expectedTime which is expected to occur next in the simulation.
 
Ptr< MobilityModelm_ueMobility
 the mobility model
 

Additional Inherited Members

- Public Types inherited from ns3::TestCase
enum class  Duration { QUICK = 1 , EXTENSIVE = 2 , TAKES_FOREVER = 3 }
 How long the test takes to execute. More...
 
- Static Public Attributes inherited from ns3::TestCase
static constexpr auto QUICK = Duration::QUICK
 Deprecated test duration simple enums.
 
static constexpr auto EXTENSIVE = Duration::EXTENSIVE
 
static constexpr auto TAKES_FOREVER = Duration::TAKES_FOREVER
 
- Protected Member Functions inherited from ns3::TestCase
 TestCase (std::string name)
 Constructor.
 
void AddTestCase (TestCase *testCase, Duration duration=Duration::QUICK)
 Add an individual child TestCase to this test suite.
 
TestCaseGetParent () const
 Get the parent of this TestCase.
 
bool IsStatusFailure () const
 Check if any tests failed.
 
bool IsStatusSuccess () const
 Check if all tests passed.
 
void SetDataDir (std::string directory)
 Set the data directory where reference trace files can be found.
 
void ReportTestFailure (std::string cond, std::string actual, std::string limit, std::string message, std::string file, int32_t line)
 Log the failure of this TestCase.
 
bool MustAssertOnFailure () const
 Check if this run should assert on failure.
 
bool MustContinueOnFailure () const
 Check if this run should continue on failure.
 
std::string CreateDataDirFilename (std::string filename)
 Construct the full path to a file in the data directory.
 
std::string CreateTempDirFilename (std::string filename)
 Construct the full path to a file in a temporary directory.
 

Detailed Description

Testing UE measurements in LTE with simulation of 1 eNodeB and 1 UE in piecewise configuration and 120 ms report interval.

During the simulation the placement of UE is being changed several times. Four different cases are considered: UE is very near to eNodeB, UE is near to eNodeB, UE is far from eNodeB and UE is very far from eNodeB. Test checks if the measurements correspond to the real conditions of the UE, i.e. when the signal from serving cell becomes weak, the measurements should also start to correspond to the new channel conditions. Additionally, it is checked if UE detects some neighboring signal, if it does the test fails because there is no neighbor in this configuration. Also, test checks if the reporting occurs at intervals that it should according to the measurements configuration. If it occurs in some different time stamp the test will fail.

Definition at line 145 of file lte-test-ue-measurements.h.

Constructor & Destructor Documentation

◆ LteUeMeasurementsPiecewiseTestCase1()

LteUeMeasurementsPiecewiseTestCase1::LteUeMeasurementsPiecewiseTestCase1 ( std::string name,
LteRrcSap::ReportConfigEutra config,
std::vector< Time > expectedTime,
std::vector< uint8_t > expectedRsrp )

Constructor.

Parameters
namethe reference name
configLteRrcSap::ReportConfigEutra
expectedTimethe expected time
expectedRsrpthe expected RSRP

Definition at line 699 of file lte-test-ue-measurements.cc.

References m_expectedRsrp, m_expectedTime, m_itExpectedRsrp, m_itExpectedTime, NS_FATAL_ERROR, and NS_LOG_INFO.

◆ ~LteUeMeasurementsPiecewiseTestCase1()

LteUeMeasurementsPiecewiseTestCase1::~LteUeMeasurementsPiecewiseTestCase1 ( )
override

Definition at line 723 of file lte-test-ue-measurements.cc.

References NS_LOG_FUNCTION.

Member Function Documentation

◆ DoRun()

void LteUeMeasurementsPiecewiseTestCase1::DoRun ( )
overrideprivatevirtual

Setup the simulation with the intended UE measurement reporting configuration, run it, and connect the RecvMeasurementReportCallback function to the LteUeRrc::RecvMeasurementReport trace source.

Implements ns3::TestCase.

Definition at line 729 of file lte-test-ue-measurements.cc.

References ns3::Config::Connect(), ns3::NodeContainer::Create(), ns3::CreateObject(), ns3::Simulator::Destroy(), ns3::EpsBearer::GBR_CONV_VOICE, ns3::NetDeviceContainer::Get(), ns3::NodeContainer::Get(), ns3::TestCase::GetName(), ns3::Object::GetObject(), m_config, m_expectedMeasId, m_ueMobility, ns3::MakeCallback(), ns3::MilliSeconds(), NS_LOG_INFO, ns3::FfMacScheduler::PUSCH_UL_CQI, RecvMeasurementReportCallback(), ns3::Simulator::Run(), ns3::Simulator::Schedule(), ns3::Seconds(), ns3::Config::SetDefault(), ns3::Simulator::Stop(), TeleportFar(), TeleportNear(), TeleportVeryFar(), and TeleportVeryNear().

+ Here is the call graph for this function:

◆ DoTeardown()

void LteUeMeasurementsPiecewiseTestCase1::DoTeardown ( )
overrideprivatevirtual

Runs at the end of the simulation, verifying that all expected measurement reports have been examined.

Reimplemented from ns3::TestCase.

Definition at line 843 of file lte-test-ue-measurements.cc.

References m_expectedRsrp, m_expectedTime, m_itExpectedRsrp, m_itExpectedTime, NS_ASSERT, NS_LOG_FUNCTION, NS_TEST_ASSERT_MSG_EQ, and ns3::Time::S.

◆ RecvMeasurementReportCallback()

void LteUeMeasurementsPiecewiseTestCase1::RecvMeasurementReportCallback ( std::string context,
uint64_t imsi,
uint16_t cellId,
uint16_t rnti,
LteRrcSap::MeasurementReport report )

Triggers when eNodeB receives measurement report from UE, then perform verification on it.

The trigger is set up beforehand by connecting to the LteUeRrc::RecvMeasurementReport trace source.

Verification consists of checking whether the report carries the right value of RSRP or not, and whether it occurs at the expected time or not.

Parameters
contextthe context
imsithe IMSI
cellIdthe cell ID
rntithe RNTI
reportLteRrcSap::MeasurementReport

Definition at line 855 of file lte-test-ue-measurements.cc.

References ns3::Time::GetMilliSeconds(), ns3::LteRrcSap::MeasResults::haveMeasResultNeighCells, m_expectedMeasId, m_expectedRsrp, m_expectedTime, m_itExpectedRsrp, m_itExpectedTime, ns3::LteRrcSap::MeasResults::measId, ns3::LteRrcSap::MeasResults::measResultListEutra, ns3::LteRrcSap::MeasResults::measResultPCell, ns3::LteRrcSap::MeasurementReport::measResults, ns3::Simulator::Now(), NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_TEST_ASSERT_MSG_EQ, ns3::EutranMeasurementMapping::RsrpRange2Dbm(), ns3::LteRrcSap::MeasResultPCell::rsrpResult, ns3::EutranMeasurementMapping::RsrqRange2Db(), ns3::LteRrcSap::MeasResultPCell::rsrqResult, and ns3::Time::S.

Referenced by DoRun().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ TeleportFar()

void LteUeMeasurementsPiecewiseTestCase1::TeleportFar ( )
private

Teleport far function.

Definition at line 928 of file lte-test-ue-measurements.cc.

References m_ueMobility, and NS_LOG_FUNCTION.

Referenced by DoRun().

+ Here is the caller graph for this function:

◆ TeleportNear()

void LteUeMeasurementsPiecewiseTestCase1::TeleportNear ( )
private

Teleport near function.

Definition at line 921 of file lte-test-ue-measurements.cc.

References m_ueMobility, and NS_LOG_FUNCTION.

Referenced by DoRun().

+ Here is the caller graph for this function:

◆ TeleportVeryFar()

void LteUeMeasurementsPiecewiseTestCase1::TeleportVeryFar ( )
private

Teleport far function.

Definition at line 935 of file lte-test-ue-measurements.cc.

References m_ueMobility, and NS_LOG_FUNCTION.

Referenced by DoRun().

+ Here is the caller graph for this function:

◆ TeleportVeryNear()

void LteUeMeasurementsPiecewiseTestCase1::TeleportVeryNear ( )
private

Teleport very near function.

Definition at line 914 of file lte-test-ue-measurements.cc.

References m_ueMobility, and NS_LOG_FUNCTION.

Referenced by DoRun().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_config

LteRrcSap::ReportConfigEutra LteUeMeasurementsPiecewiseTestCase1::m_config
private

The active report triggering configuration.

Definition at line 212 of file lte-test-ue-measurements.h.

Referenced by DoRun().

◆ m_expectedMeasId

uint8_t LteUeMeasurementsPiecewiseTestCase1::m_expectedMeasId
private

The measurement identity being tested.

Measurement reports with different measurement identity (e.g. from handover algorithm) will be ignored.

Definition at line 243 of file lte-test-ue-measurements.h.

Referenced by DoRun(), and RecvMeasurementReportCallback().

◆ m_expectedRsrp

std::vector<uint8_t> LteUeMeasurementsPiecewiseTestCase1::m_expectedRsrp
private

The list of expected values of RSRP (in 3GPP range unit) from the measurement reports received.

Definition at line 224 of file lte-test-ue-measurements.h.

Referenced by LteUeMeasurementsPiecewiseTestCase1(), DoTeardown(), and RecvMeasurementReportCallback().

◆ m_expectedTime

std::vector<Time> LteUeMeasurementsPiecewiseTestCase1::m_expectedTime
private

The list of expected time when measurement reports are received by eNodeB.

Definition at line 218 of file lte-test-ue-measurements.h.

Referenced by LteUeMeasurementsPiecewiseTestCase1(), DoTeardown(), and RecvMeasurementReportCallback().

◆ m_itExpectedRsrp

std::vector<uint8_t>::iterator LteUeMeasurementsPiecewiseTestCase1::m_itExpectedRsrp
private

Pointer to the element of m_expectedRsrp which is expected to occur next in the simulation.

Definition at line 236 of file lte-test-ue-measurements.h.

Referenced by LteUeMeasurementsPiecewiseTestCase1(), DoTeardown(), and RecvMeasurementReportCallback().

◆ m_itExpectedTime

std::vector<Time>::iterator LteUeMeasurementsPiecewiseTestCase1::m_itExpectedTime
private

Pointer to the element of m_expectedTime which is expected to occur next in the simulation.

Definition at line 230 of file lte-test-ue-measurements.h.

Referenced by LteUeMeasurementsPiecewiseTestCase1(), DoTeardown(), and RecvMeasurementReportCallback().

◆ m_ueMobility

Ptr<MobilityModel> LteUeMeasurementsPiecewiseTestCase1::m_ueMobility
private

the mobility model

Definition at line 245 of file lte-test-ue-measurements.h.

Referenced by DoRun(), TeleportFar(), TeleportNear(), TeleportVeryFar(), and TeleportVeryNear().


The documentation for this class was generated from the following files: