A Discrete-Event Network Simulator
API
LteRadioLinkFailureTestCase Class Reference

Testing the cell reselection procedure by UE at IDLE state. More...

#include "lte-test-radio-link-failure.h"

+ Inheritance diagram for LteRadioLinkFailureTestCase:
+ Collaboration diagram for LteRadioLinkFailureTestCase:

Public Member Functions

 LteRadioLinkFailureTestCase (uint32_t numEnbs, uint32_t numUes, Time simTime, bool isIdealRrc, std::vector< Vector > uePositionList, std::vector< Vector > enbPositionList, Vector ueJumpAwayPosition, std::vector< Time > checkConnectedList)
 Creates an instance of the radio link failure test case. More...
 
 ~LteRadioLinkFailureTestCase () override
 
- Public Member Functions inherited from ns3::TestCase
 TestCase (const TestCase &)=delete
 
virtual ~TestCase ()
 Destructor. More...
 
std::string GetName () const
 
TestCaseoperator= (const TestCase &)=delete
 

Private Member Functions

std::string BuildNameString (uint32_t numEnbs, uint32_t numUes, bool isIdealRrc)
 Builds the test name string based on provided parameter values. More...
 
void CheckConnected (Ptr< NetDevice > ueDevice, NetDeviceContainer enbDevices)
 Check connected function. More...
 
void CheckIdle (Ptr< NetDevice > ueDevice, NetDeviceContainer enbDevices)
 Check if the UE is in idle state. More...
 
bool CheckUeExistAtEnb (uint16_t rnti, Ptr< NetDevice > enbDevice)
 Check if the UE exist at the eNB. More...
 
void ConnectionEstablishedEnbCallback (std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti)
 Connection established at eNodeB callback function. More...
 
void ConnectionEstablishedUeCallback (std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti)
 Connection established at UE callback function. More...
 
void ConnectionReleaseAtEnbCallback (std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti)
 This callback function is executed when UE context is removed at eNodeB. More...
 
void DoRun () override
 Setup the simulation according to the configuration set by the class constructor, run it, and verify the result. More...
 
void JumpAway (Vector UeJumpAwayPositionList)
 Jump away function. More...
 
void PhySyncDetectionCallback (std::string context, uint64_t imsi, uint16_t rnti, uint16_t cellId, std::string type, uint8_t count)
 This callback function is executed when UE RRC receives an in-sync or out-of-sync indication. More...
 
void RadioLinkFailureCallback (std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti)
 This callback function is executed when radio link failure is detected. More...
 
void UeStateTransitionCallback (std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti, LteUeRrc::State oldState, LteUeRrc::State newState)
 State transition callback function. More...
 

Private Attributes

std::vector< Timem_checkConnectedList
 the time at which UEs should have an active RRC connection More...
 
std::vector< Vector > m_enbPositionList
 Position of the eNodeBs. More...
 
bool m_isIdealRrc
 whether the LTE is configured to use ideal RRC More...
 
LteUeRrc::State m_lastState
 The current UE RRC state. More...
 
uint32_t m_numEnbs
 number of eNodeBs More...
 
uint32_t m_numOfInSyncIndications
 number of in-sync indications detected More...
 
uint32_t m_numOfOutOfSyncIndications
 number of out-of-sync indications detected More...
 
uint32_t m_numUes
 number of UEs More...
 
bool m_radioLinkFailureDetected
 true if radio link fails More...
 
Time m_simTime
 simulation time More...
 
Vector m_ueJumpAwayPosition
 Position where the UE(s) would jump. More...
 
Ptr< MobilityModelm_ueMobility
 UE mobility model. More...
 
std::vector< Vector > m_uePositionList
 Position of the UEs. More...
 

Additional Inherited Members

- Public Types inherited from ns3::TestCase
enum  TestDuration { QUICK = 1 , EXTENSIVE = 2 , TAKES_FOREVER = 3 }
 How long the test takes to execute. More...
 
- Protected Member Functions inherited from ns3::TestCase
 TestCase (std::string name)
 Constructor. More...
 
void AddTestCase (TestCase *testCase, TestDuration duration=QUICK)
 Add an individual child TestCase to this test suite. More...
 
TestCaseGetParent () const
 Get the parent of this TestCase. More...
 
bool IsStatusFailure () const
 Check if any tests failed. More...
 
bool IsStatusSuccess () const
 Check if all tests passed. More...
 
void SetDataDir (std::string directory)
 Set the data directory where reference trace files can be found. More...
 
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. More...
 
bool MustAssertOnFailure () const
 Check if this run should assert on failure. More...
 
bool MustContinueOnFailure () const
 Check if this run should continue on failure. More...
 
std::string CreateDataDirFilename (std::string filename)
 Construct the full path to a file in the data directory. More...
 
std::string CreateTempDirFilename (std::string filename)
 Construct the full path to a file in a temporary directory. More...
 

Detailed Description

Testing the cell reselection procedure by UE at IDLE state.

Definition at line 58 of file lte-test-radio-link-failure.h.

Constructor & Destructor Documentation

◆ LteRadioLinkFailureTestCase()

LteRadioLinkFailureTestCase::LteRadioLinkFailureTestCase ( uint32_t  numEnbs,
uint32_t  numUes,
Time  simTime,
bool  isIdealRrc,
std::vector< Vector >  uePositionList,
std::vector< Vector >  enbPositionList,
Vector  ueJumpAwayPosition,
std::vector< Time checkConnectedList 
)

Creates an instance of the radio link failure test case.

Parameters
numEnbsnumber of eNodeBs
numUesnumber of UEs
simTimethe simulation time
isIdealRrcif true, simulation uses Ideal RRC protocol, otherwise simulation uses Real RRC protocol
uePositionListPosition of the UEs
enbPositionListPosition of the eNodeBs
ueJumpAwayPositionVector holding the UE jump away coordinates
checkConnectedListthe time at which UEs should have an active RRC connection

Definition at line 144 of file lte-test-radio-link-failure.cc.

References ns3::TestCase::GetName(), m_lastState, m_numOfInSyncIndications, m_numOfOutOfSyncIndications, m_radioLinkFailureDetected, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ ~LteRadioLinkFailureTestCase()

LteRadioLinkFailureTestCase::~LteRadioLinkFailureTestCase ( )
override

Definition at line 169 of file lte-test-radio-link-failure.cc.

References ns3::TestCase::GetName(), and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

Member Function Documentation

◆ BuildNameString()

std::string LteRadioLinkFailureTestCase::BuildNameString ( uint32_t  numEnbs,
uint32_t  numUes,
bool  isIdealRrc 
)
private

Builds the test name string based on provided parameter values.

Parameters
numEnbsthe number of eNB nodes
numUesthe number of UE nodes
isIdealRrcTrue if the Ideal RRC protocol is used
Returns
the name string

Definition at line 128 of file lte-test-radio-link-failure.cc.

◆ CheckConnected()

◆ CheckIdle()

void LteRadioLinkFailureTestCase::CheckIdle ( Ptr< NetDevice ueDevice,
NetDeviceContainer  enbDevices 
)
private

Check if the UE is in idle state.

Parameters
ueDevicethe UE device
enbDevicesthe ENB devices

Definition at line 534 of file lte-test-radio-link-failure.cc.

References CheckUeExistAtEnb(), ns3::NetDeviceContainer::Get(), ns3::NetDeviceContainer::GetN(), NS_FATAL_ERROR, NS_LOG_FUNCTION, and NS_TEST_ASSERT_MSG_EQ.

Referenced by DoRun().

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

◆ CheckUeExistAtEnb()

bool LteRadioLinkFailureTestCase::CheckUeExistAtEnb ( uint16_t  rnti,
Ptr< NetDevice enbDevice 
)
private

Check if the UE exist at the eNB.

Parameters
rntithe RNTI of the UE
enbDevicethe eNB device
Returns
true if the UE exist at the eNB, otherwise false

Definition at line 574 of file lte-test-radio-link-failure.cc.

References ns3::LteEnbNetDevice::GetRrc(), NS_ABORT_MSG_IF, and NS_LOG_FUNCTION.

Referenced by CheckIdle().

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

◆ ConnectionEstablishedEnbCallback()

void LteRadioLinkFailureTestCase::ConnectionEstablishedEnbCallback ( std::string  context,
uint64_t  imsi,
uint16_t  cellId,
uint16_t  rnti 
)
private

Connection established at eNodeB callback function.

Parameters
contextthe context string
imsithe IMSI
cellIdthe cell ID
rntithe RNTI

Definition at line 597 of file lte-test-radio-link-failure.cc.

References NS_LOG_FUNCTION.

Referenced by DoRun().

+ Here is the caller graph for this function:

◆ ConnectionEstablishedUeCallback()

void LteRadioLinkFailureTestCase::ConnectionEstablishedUeCallback ( std::string  context,
uint64_t  imsi,
uint16_t  cellId,
uint16_t  rnti 
)
private

Connection established at UE callback function.

Parameters
contextthe context string
imsithe IMSI
cellIdthe cell ID
rntithe RNTI

Definition at line 606 of file lte-test-radio-link-failure.cc.

References m_numOfInSyncIndications, m_numOfOutOfSyncIndications, NS_LOG_FUNCTION, and NS_TEST_ASSERT_MSG_EQ.

Referenced by DoRun().

+ Here is the caller graph for this function:

◆ ConnectionReleaseAtEnbCallback()

void LteRadioLinkFailureTestCase::ConnectionReleaseAtEnbCallback ( std::string  context,
uint64_t  imsi,
uint16_t  cellId,
uint16_t  rnti 
)
private

This callback function is executed when UE context is removed at eNodeB.

Parameters
contextthe context string
imsithe IMSI
cellIdthe cell ID
rntithe RNTI

Definition at line 621 of file lte-test-radio-link-failure.cc.

References NS_LOG_FUNCTION.

Referenced by DoRun().

+ Here is the caller graph for this function:

◆ DoRun()

void LteRadioLinkFailureTestCase::DoRun ( void  )
overrideprivatevirtual

Setup the simulation according to the configuration set by the class constructor, run it, and verify the result.

Implements ns3::TestCase.

Definition at line 175 of file lte-test-radio-link-failure.cc.

References ns3::LteHelper::ActivateDedicatedEpsBearer(), ns3::ApplicationContainer::Add(), ns3::Time::As(), ns3::Ipv4AddressHelper::Assign(), ns3::LteHelper::AssignStreams(), ns3::NoBackhaulEpcHelper::AssignUeIpv4Address(), ns3::LteHelper::Attach(), CheckConnected(), CheckIdle(), ns3::Config::Connect(), ConnectionEstablishedEnbCallback(), ConnectionEstablishedUeCallback(), ConnectionReleaseAtEnbCallback(), ns3::NodeContainer::Create(), ns3::TestCase::CreateTempDirFilename(), ns3::LteHelper::EnableTraces(), ns3::NetDeviceContainer::Get(), ns3::NodeContainer::Get(), ns3::Ipv4InterfaceContainer::GetAddress(), ns3::TestCase::GetName(), ns3::Object::GetObject(), ns3::NoBackhaulEpcHelper::GetPgwNode(), ns3::Ipv4StaticRoutingHelper::GetStaticRouting(), ns3::NoBackhaulEpcHelper::GetUeDefaultGatewayAddress(), ns3::UdpClientHelper::Install(), ns3::PointToPointHelper::Install(), ns3::PacketSinkHelper::Install(), ns3::LteHelper::InstallEnbDevice(), ns3::LteHelper::InstallUeDevice(), nsclick-simple-lan::internet, JumpAway(), ns3::EpcTft::PacketFilter::localPortEnd, ns3::EpcTft::PacketFilter::localPortStart, m_checkConnectedList, m_enbPositionList, m_isIdealRrc, m_numEnbs, m_numUes, m_radioLinkFailureDetected, m_simTime, m_ueJumpAwayPosition, m_ueMobility, m_uePositionList, ns3::MakeCallback(), third::mobility, NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_LOGIC, NS_TEST_ASSERT_MSG_EQ, packetSize, PhySyncDetectionCallback(), RadioLinkFailureCallback(), ns3::EpcTft::PacketFilter::remotePortEnd, ns3::EpcTft::PacketFilter::remotePortStart, ns3::Seconds(), ns3::UdpClientHelper::SetAttribute(), ns3::Ipv4AddressHelper::SetBase(), ns3::PointToPointHelper::SetChannelAttribute(), ns3::Config::SetDefault(), ns3::PointToPointHelper::SetDeviceAttribute(), ns3::LteHelper::SetEnbDeviceAttribute(), ns3::LteHelper::SetEpcHelper(), ns3::LteHelper::SetPathlossModelAttribute(), ns3::LteHelper::SetPathlossModelType(), ns3::LteHelper::SetSchedulerType(), ns3::ApplicationContainer::Start(), and UeStateTransitionCallback().

+ Here is the call graph for this function:

◆ JumpAway()

void LteRadioLinkFailureTestCase::JumpAway ( Vector  UeJumpAwayPositionList)
private

Jump away function.

Parameters
UeJumpAwayPositionListA list of positions where UE would jump

Definition at line 441 of file lte-test-radio-link-failure.cc.

References m_ueMobility, NS_LOG_FUNCTION, and ns3::MobilityModel::SetPosition().

Referenced by DoRun().

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

◆ PhySyncDetectionCallback()

void LteRadioLinkFailureTestCase::PhySyncDetectionCallback ( std::string  context,
uint64_t  imsi,
uint16_t  rnti,
uint16_t  cellId,
std::string  type,
uint8_t  count 
)
private

This callback function is executed when UE RRC receives an in-sync or out-of-sync indication.

Parameters
contextthe context string
imsithe IMSI
rntithe RNTI
cellIdthe cell ID
typein-sync or out-of-sync indication
countthe number of in-sync or out-of-sync indications

Definition at line 630 of file lte-test-radio-link-failure.cc.

References m_numOfInSyncIndications, m_numOfOutOfSyncIndications, NS_LOG_FUNCTION, and check-style-clang-format::type.

Referenced by DoRun().

+ Here is the caller graph for this function:

◆ RadioLinkFailureCallback()

void LteRadioLinkFailureTestCase::RadioLinkFailureCallback ( std::string  context,
uint64_t  imsi,
uint16_t  cellId,
uint16_t  rnti 
)
private

This callback function is executed when radio link failure is detected.

Parameters
contextthe context string
imsithe IMSI
rntithe RNTI
cellIdthe cell ID

Definition at line 649 of file lte-test-radio-link-failure.cc.

References m_numOfInSyncIndications, m_numOfOutOfSyncIndications, m_radioLinkFailureDetected, ns3::Now(), NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_TEST_ASSERT_MSG_EQ, and NS_TEST_ASSERT_MSG_LT.

Referenced by DoRun().

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

◆ UeStateTransitionCallback()

void LteRadioLinkFailureTestCase::UeStateTransitionCallback ( std::string  context,
uint64_t  imsi,
uint16_t  cellId,
uint16_t  rnti,
LteUeRrc::State  oldState,
LteUeRrc::State  newState 
)
private

State transition callback function.

Parameters
contextthe context string
imsithe IMSI
cellIdthe cell ID
rntithe RNTI
oldStatethe old state
newStatethe new state

Definition at line 585 of file lte-test-radio-link-failure.cc.

References m_lastState, and NS_LOG_FUNCTION.

Referenced by DoRun().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_checkConnectedList

std::vector<Time> LteRadioLinkFailureTestCase::m_checkConnectedList
private

the time at which UEs should have an active RRC connection

Definition at line 217 of file lte-test-radio-link-failure.h.

Referenced by DoRun().

◆ m_enbPositionList

std::vector<Vector> LteRadioLinkFailureTestCase::m_enbPositionList
private

Position of the eNodeBs.

Definition at line 215 of file lte-test-radio-link-failure.h.

Referenced by DoRun().

◆ m_isIdealRrc

bool LteRadioLinkFailureTestCase::m_isIdealRrc
private

whether the LTE is configured to use ideal RRC

Definition at line 213 of file lte-test-radio-link-failure.h.

Referenced by DoRun().

◆ m_lastState

LteUeRrc::State LteRadioLinkFailureTestCase::m_lastState
private

The current UE RRC state.

Definition at line 221 of file lte-test-radio-link-failure.h.

Referenced by LteRadioLinkFailureTestCase(), and UeStateTransitionCallback().

◆ m_numEnbs

uint32_t LteRadioLinkFailureTestCase::m_numEnbs
private

number of eNodeBs

Definition at line 210 of file lte-test-radio-link-failure.h.

Referenced by DoRun().

◆ m_numOfInSyncIndications

uint32_t LteRadioLinkFailureTestCase::m_numOfInSyncIndications
private

◆ m_numOfOutOfSyncIndications

uint32_t LteRadioLinkFailureTestCase::m_numOfOutOfSyncIndications
private

number of out-of-sync indications detected

Definition at line 225 of file lte-test-radio-link-failure.h.

Referenced by LteRadioLinkFailureTestCase(), ConnectionEstablishedUeCallback(), PhySyncDetectionCallback(), and RadioLinkFailureCallback().

◆ m_numUes

uint32_t LteRadioLinkFailureTestCase::m_numUes
private

number of UEs

Definition at line 211 of file lte-test-radio-link-failure.h.

Referenced by DoRun().

◆ m_radioLinkFailureDetected

bool LteRadioLinkFailureTestCase::m_radioLinkFailureDetected
private

true if radio link fails

Definition at line 223 of file lte-test-radio-link-failure.h.

Referenced by LteRadioLinkFailureTestCase(), DoRun(), and RadioLinkFailureCallback().

◆ m_simTime

Time LteRadioLinkFailureTestCase::m_simTime
private

simulation time

Definition at line 212 of file lte-test-radio-link-failure.h.

Referenced by DoRun().

◆ m_ueJumpAwayPosition

Vector LteRadioLinkFailureTestCase::m_ueJumpAwayPosition
private

Position where the UE(s) would jump.

Definition at line 218 of file lte-test-radio-link-failure.h.

Referenced by DoRun().

◆ m_ueMobility

Ptr<MobilityModel> LteRadioLinkFailureTestCase::m_ueMobility
private

UE mobility model.

Definition at line 226 of file lte-test-radio-link-failure.h.

Referenced by DoRun(), and JumpAway().

◆ m_uePositionList

std::vector<Vector> LteRadioLinkFailureTestCase::m_uePositionList
private

Position of the UEs.

Definition at line 214 of file lte-test-radio-link-failure.h.

Referenced by DoRun().


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