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

Testing UE measurements in LTE with simulation of 2 eNodeB and 1 UE in a handover configuration. More...

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

+ Inheritance diagram for LteUeMeasurementsHandoverTestCase:
+ Collaboration diagram for LteUeMeasurementsHandoverTestCase:

Public Member Functions

 LteUeMeasurementsHandoverTestCase (std::string name, std::list< LteRrcSap::ReportConfigEutra > sourceConfigList, std::list< LteRrcSap::ReportConfigEutra > targetConfigList, std::vector< Time > expectedTime, std::vector< uint8_t > expectedRsrp, Time duration)
 Constructor.
 
 ~LteUeMeasurementsHandoverTestCase () override
 
void RecvMeasurementReportCallback (std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti, LteRrcSap::MeasurementReport report)
 Triggers when either one of the eNodeBs 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.
 

Private Attributes

Time m_duration
 Duration of simulation.
 
std::vector< uint8_t > m_expectedRsrp
 The list of expected values of RSRP (in 3GPP range unit) from the measurement reports received.
 
std::set< uint8_t > m_expectedSourceCellMeasId
 The list of measurement identities being tested in the source cell.
 
std::set< uint8_t > m_expectedTargetCellMeasId
 The list of measurement identities being tested in the target cell.
 
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.
 
std::list< LteRrcSap::ReportConfigEutram_sourceConfigList
 The list of active report triggering configuration for the source eNodeB.
 
std::list< LteRrcSap::ReportConfigEutram_targetConfigList
 The list of active report triggering configuration for the target eNodeB.
 

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 2 eNodeB and 1 UE in a handover configuration.

The simulation will run for the specified duration, while the handover command will be issued exactly at the middle of simulation. Handover test covers four different scenarios: switch from event A1 to event A2, from event A2 to event A1, from event A3 to event A4, from event A4 to event A3, from event A2 to event A3, from event A3 to event A2, from event A4 to event A5, from event A5 to event A4. Additionally, it tests different handover threshold configurations, A2 threshold difference, A3 offset difference, A4 and A5 threshold difference. Finally, different handover is tested for different time-to-trigger (TTT) configurations.

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

Constructor & Destructor Documentation

◆ LteUeMeasurementsHandoverTestCase()

LteUeMeasurementsHandoverTestCase::LteUeMeasurementsHandoverTestCase ( std::string name,
std::list< LteRrcSap::ReportConfigEutra > sourceConfigList,
std::list< LteRrcSap::ReportConfigEutra > targetConfigList,
std::vector< Time > expectedTime,
std::vector< uint8_t > expectedRsrp,
Time duration )

Constructor.

Parameters
namethe reference name
sourceConfigListstd::list<LteRrcSap::ReportConfigEutra>
targetConfigListstd::list<LteRrcSap::ReportConfigEutra>
expectedTimethe expected time
expectedRsrpthe expected RSRP
durationthe duration

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

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

◆ ~LteUeMeasurementsHandoverTestCase()

LteUeMeasurementsHandoverTestCase::~LteUeMeasurementsHandoverTestCase ( )
override

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

References NS_LOG_FUNCTION.

Member Function Documentation

◆ DoRun()

void LteUeMeasurementsHandoverTestCase::DoRun ( )
overrideprivatevirtual

◆ DoTeardown()

void LteUeMeasurementsHandoverTestCase::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 2456 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 LteUeMeasurementsHandoverTestCase::RecvMeasurementReportCallback ( std::string context,
uint64_t imsi,
uint16_t cellId,
uint16_t rnti,
LteRrcSap::MeasurementReport report )

Triggers when either one of the eNodeBs 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 2468 of file lte-test-ue-measurements.cc.

References ns3::Time::GetMilliSeconds(), ns3::LteRrcSap::MeasResults::haveMeasResultNeighCells, m_expectedRsrp, m_expectedSourceCellMeasId, m_expectedTargetCellMeasId, 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_FATAL_ERROR, 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:

Member Data Documentation

◆ m_duration

Time LteUeMeasurementsHandoverTestCase::m_duration
private

Duration of simulation.

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

Referenced by DoRun().

◆ m_expectedRsrp

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

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

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

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

◆ m_expectedSourceCellMeasId

std::set<uint8_t> LteUeMeasurementsHandoverTestCase::m_expectedSourceCellMeasId
private

The list of measurement identities being tested in the source cell.

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

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

Referenced by DoRun(), and RecvMeasurementReportCallback().

◆ m_expectedTargetCellMeasId

std::set<uint8_t> LteUeMeasurementsHandoverTestCase::m_expectedTargetCellMeasId
private

The list of measurement identities being tested in the target cell.

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

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

Referenced by DoRun(), and RecvMeasurementReportCallback().

◆ m_expectedTime

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

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

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

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

◆ m_itExpectedRsrp

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

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

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

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

◆ m_itExpectedTime

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

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

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

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

◆ m_sourceConfigList

std::list<LteRrcSap::ReportConfigEutra> LteUeMeasurementsHandoverTestCase::m_sourceConfigList
private

The list of active report triggering configuration for the source eNodeB.

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

Referenced by DoRun().

◆ m_targetConfigList

std::list<LteRrcSap::ReportConfigEutra> LteUeMeasurementsHandoverTestCase::m_targetConfigList
private

The list of active report triggering configuration for the target eNodeB.

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

Referenced by DoRun().


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