Testing UE measurements in LTE with simulation of 2 eNodeB and 1 UE in a handover configuration. More...
#include <lte-test-ue-measurements.h>
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) | |
virtual | ~LteUeMeasurementsHandoverTestCase () |
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. More... | |
![]() | |
virtual | ~TestCase () |
Destructor. More... | |
Private Member Functions | |
virtual void | DoRun () |
Setup the simulation with the intended UE measurement reporting configuration, run it, and connect the RecvMeasurementReportCallback function to the LteUeRrc::RecvMeasurementReport trace source. More... | |
virtual void | DoTeardown () |
Runs at the end of the simulation, verifying that all expected measurement reports have been examined. More... | |
Private Attributes | |
Time | m_duration |
Duration of simulation. More... | |
std::vector< uint8_t > | m_expectedRsrp |
The list of expected values of RSRP (in 3GPP range unit) from the measurement reports received. More... | |
std::set< uint8_t > | m_expectedSourceCellMeasId |
The list of measurement identities being tested in the source cell. More... | |
std::set< uint8_t > | m_expectedTargetCellMeasId |
The list of measurement identities being tested in the target cell. More... | |
std::vector< Time > | m_expectedTime |
The list of expected time when measurement reports are received by eNodeB. More... | |
std::vector< uint8_t >::iterator | m_itExpectedRsrp |
Pointer to the element of m_expectedRsrp which is expected to occur next in the simulation. More... | |
std::vector< Time >::iterator | m_itExpectedTime |
Pointer to the element of m_expectedTime which is expected to occur next in the simulation. More... | |
std::list < LteRrcSap::ReportConfigEutra > | m_sourceConfigList |
The list of active report triggering configuration for the source eNodeB. More... | |
std::list < LteRrcSap::ReportConfigEutra > | m_targetConfigList |
The list of active report triggering configuration for the target eNodeB. More... | |
Additional Inherited Members | |
![]() | |
enum | TestDuration { QUICK = 1, EXTENSIVE = 2, TAKES_FOREVER = 3 } |
How long the test takes to execute. More... | |
![]() | |
TestCase (std::string name) | |
void | AddTestCase (TestCase *testCase) NS_DEPRECATED |
Add an individual child TestCase case to this TestCase. More... | |
void | AddTestCase (TestCase *testCase, enum TestDuration duration) |
Add an individual child TestCase to this test suite. More... | |
std::string | CreateDataDirFilename (std::string filename) |
std::string | CreateTempDirFilename (std::string filename) |
bool | GetErrorStatus (void) const NS_DEPRECATED |
std::string | GetName (void) const |
bool | IsStatusFailure (void) const |
bool | IsStatusSuccess (void) const |
bool | MustAssertOnFailure (void) const |
bool | MustContinueOnFailure (void) const |
void | ReportTestFailure (std::string cond, std::string actual, std::string limit, std::string message, std::string file, int32_t line) |
void | SetDataDir (std::string directory) |
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.
Definition at line 308 of file lte-test-ue-measurements.h.
ns3::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 | ||
) |
Definition at line 1665 of file lte-test-ue-measurements.cc.
References m_expectedRsrp, m_expectedTime, m_itExpectedRsrp, m_itExpectedTime, NS_FATAL_ERROR, and NS_LOG_INFO.
|
virtual |
Definition at line 1692 of file lte-test-ue-measurements.cc.
References NS_LOG_FUNCTION.
|
privatevirtual |
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 1698 of file lte-test-ue-measurements.cc.
References ns3::Ipv4AddressHelper::Assign(), ns3::Config::Connect(), ns3::NodeContainer::Create(), ns3::Simulator::Destroy(), ns3::NetDeviceContainer::Get(), ns3::NodeContainer::Get(), ns3::Time::GetMilliSeconds(), ns3::NodeContainer::GetN(), ns3::TestCase::GetName(), ns3::Object::GetObject(), ns3::Ipv4StaticRoutingHelper::GetStaticRouting(), ns3::PointToPointHelper::Install(), ns3::InternetStackHelper::Install(), ns3::MobilityHelper::Install(), m_duration, m_expectedSourceCellMeasId, m_expectedTargetCellMeasId, m_sourceConfigList, m_targetConfigList, ns3::MakeCallback(), NS_LOG_INFO, RecvMeasurementReportCallback(), ns3::Simulator::Run(), ns3::Ipv4AddressHelper::SetBase(), ns3::PointToPointHelper::SetChannelAttribute(), ns3::Config::SetDefault(), ns3::PointToPointHelper::SetDeviceAttribute(), ns3::MobilityHelper::SetMobilityModel(), ns3::MobilityHelper::SetPositionAllocator(), and ns3::Simulator::Stop().
|
privatevirtual |
Runs at the end of the simulation, verifying that all expected measurement reports have been examined.
Reimplemented from ns3::TestCase.
Definition at line 1835 of file lte-test-ue-measurements.cc.
References m_expectedRsrp, m_expectedTime, m_itExpectedRsrp, m_itExpectedTime, NS_ASSERT, NS_LOG_FUNCTION, and NS_TEST_ASSERT_MSG_EQ.
void ns3::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.
Definition at line 1846 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::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::MeasResults::rsrpResult, ns3::EutranMeasurementMapping::RsrqRange2Db(), and ns3::LteRrcSap::MeasResults::rsrqResult.
Referenced by DoRun().
|
private |
Duration of simulation.
Definition at line 388 of file lte-test-ue-measurements.h.
Referenced by DoRun().
|
private |
The list of expected values of RSRP (in 3GPP range unit) from the measurement reports received.
Definition at line 371 of file lte-test-ue-measurements.h.
Referenced by DoTeardown(), LteUeMeasurementsHandoverTestCase(), and RecvMeasurementReportCallback().
|
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 395 of file lte-test-ue-measurements.h.
Referenced by DoRun(), and RecvMeasurementReportCallback().
|
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 402 of file lte-test-ue-measurements.h.
Referenced by DoRun(), and RecvMeasurementReportCallback().
|
private |
The list of expected time when measurement reports are received by eNodeB.
Definition at line 365 of file lte-test-ue-measurements.h.
Referenced by DoTeardown(), LteUeMeasurementsHandoverTestCase(), and RecvMeasurementReportCallback().
|
private |
Pointer to the element of m_expectedRsrp
which is expected to occur next in the simulation.
Definition at line 383 of file lte-test-ue-measurements.h.
Referenced by DoTeardown(), LteUeMeasurementsHandoverTestCase(), and RecvMeasurementReportCallback().
|
private |
Pointer to the element of m_expectedTime
which is expected to occur next in the simulation.
Definition at line 377 of file lte-test-ue-measurements.h.
Referenced by DoTeardown(), LteUeMeasurementsHandoverTestCase(), and RecvMeasurementReportCallback().
|
private |
The list of active report triggering configuration for the source eNodeB.
Definition at line 353 of file lte-test-ue-measurements.h.
Referenced by DoRun().
|
private |
The list of active report triggering configuration for the target eNodeB.
Definition at line 359 of file lte-test-ue-measurements.h.
Referenced by DoRun().