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

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

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

+ Inheritance diagram for LteUeMeasurementsPiecewiseTestCase3:
+ Collaboration diagram for LteUeMeasurementsPiecewiseTestCase3:

Public Member Functions

 LteUeMeasurementsPiecewiseTestCase3 (std::string name, LteRrcSap::ReportConfigEutra config, std::vector< Time > expectedTime)
 Constructor.
 
 ~LteUeMeasurementsPiecewiseTestCase3 () 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 TeleportEnbNear ()
 Teleport the eNb near function.
 

Private Attributes

LteRrcSap::ReportConfigEutra m_config
 The active report triggering configuration.
 
Ptr< MobilityModelm_enbMobility
 the mobility model
 
uint8_t m_expectedMeasId
 The measurement identity being tested.
 
std::vector< Timem_expectedTime
 The list of expected time when measurement reports are received by eNodeB.
 
std::vector< Time >::iterator m_itExpectedTime
 Pointer to the element of m_expectedTime which is expected to occur next in the simulation.
 

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 3 eNodeB and 1 UE in piecewise configuration and 240 ms report interval.

This test is to cover a corner case using event A4, which is not covered by LteUeMeasurementsPiecewiseTestCase1 and LteUeMeasurementsPiecewiseTestCase2. In this case, we test that the UE measurements at eNB are arriving 240 ms apart. Please note, the scenario simulated is engineered to specifically test the corner case in which whenever a new neighbour fulfils the entry condition for event A4, the UE RRC calls VarMeasReportListAdd method to include the new cell id in cellsTriggeredList, and then it schedules the SendMeasurementReport for periodic reporting. However, if the UE has already started the periodic reporting, scheduling the SendMeasurementReport method again causes following buggy behaviors:

  1. It generates an intermediate measurement event, which then leads to parallel intermediate measurement reports from a UE to its eNB.
  2. The old EvenId is overwritten by the new EventId stored in VarMeasReportList. This makes us lose control over the old EventId and it is impossible to cancel its events later on.

These buggy behaviors generated an issue reported in https://gitlab.com/nsnam/ns-3-dev/-/issues/224, where a UE try to send measurement reports after the RLF, even though all the measurement events are properly cancelled upon detecting RLF.

The correct behaviour should be that if a UE has already started the periodic reporting, and once a new neighbour fulfils the entry condition, we just need to add its cell id in cellsTriggeredList, without scheduling a new periodic event.

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

Constructor & Destructor Documentation

◆ LteUeMeasurementsPiecewiseTestCase3()

LteUeMeasurementsPiecewiseTestCase3::LteUeMeasurementsPiecewiseTestCase3 ( std::string name,
LteRrcSap::ReportConfigEutra config,
std::vector< Time > expectedTime )

Constructor.

Parameters
namethe reference name
configLteRrcSap::ReportConfigEutra
expectedTimethe expected time

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

References m_expectedMeasId, m_expectedTime, m_itExpectedTime, and NS_LOG_INFO.

◆ ~LteUeMeasurementsPiecewiseTestCase3()

LteUeMeasurementsPiecewiseTestCase3::~LteUeMeasurementsPiecewiseTestCase3 ( )
override

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

References NS_LOG_FUNCTION.

Member Function Documentation

◆ DoRun()

void LteUeMeasurementsPiecewiseTestCase3::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 1750 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_enbMobility, m_expectedMeasId, 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(), and TeleportEnbNear().

+ Here is the call graph for this function:

◆ DoTeardown()

void LteUeMeasurementsPiecewiseTestCase3::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 1844 of file lte-test-ue-measurements.cc.

References m_expectedTime, m_itExpectedTime, NS_LOG_FUNCTION, and NS_TEST_ASSERT_MSG_EQ.

◆ RecvMeasurementReportCallback()

void LteUeMeasurementsPiecewiseTestCase3::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 1855 of file lte-test-ue-measurements.cc.

References ns3::Time::GetMilliSeconds(), ns3::LteRrcSap::MeasResults::haveMeasResultNeighCells, m_expectedMeasId, m_expectedTime, 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(), and ns3::LteRrcSap::MeasResultPCell::rsrqResult.

Referenced by DoRun().

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

◆ TeleportEnbNear()

void LteUeMeasurementsPiecewiseTestCase3::TeleportEnbNear ( )
private

Teleport the eNb near function.

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

References m_enbMobility, and NS_LOG_FUNCTION.

Referenced by DoRun().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_config

LteRrcSap::ReportConfigEutra LteUeMeasurementsPiecewiseTestCase3::m_config
private

The active report triggering configuration.

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

Referenced by DoRun().

◆ m_enbMobility

Ptr<MobilityModel> LteUeMeasurementsPiecewiseTestCase3::m_enbMobility
private

the mobility model

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

Referenced by DoRun(), and TeleportEnbNear().

◆ m_expectedMeasId

uint8_t LteUeMeasurementsPiecewiseTestCase3::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 511 of file lte-test-ue-measurements.h.

Referenced by LteUeMeasurementsPiecewiseTestCase3(), DoRun(), and RecvMeasurementReportCallback().

◆ m_expectedTime

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

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

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

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

◆ m_itExpectedTime

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

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

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

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


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