A Discrete-Event Network Simulator
API
LteCellSelectionTestCase Class Reference

Testing the initial cell selection procedure by UE at IDLE state in the beginning of simulation. More...

#include "lte-test-cell-selection.h"

+ Inheritance diagram for LteCellSelectionTestCase:
+ Collaboration diagram for LteCellSelectionTestCase:

Classes

struct  UeSetup_t
 A set of input parameters for setting up a UE in the simulation. More...
 

Public Member Functions

 LteCellSelectionTestCase (std::string name, bool isEpcMode, bool isIdealRrc, double interSiteDistance, std::vector< UeSetup_t > ueSetupList, int64_t rngRun)
 Creates an instance of the initial cell selection test case. More...
 
virtual ~LteCellSelectionTestCase ()
 
- Public Member Functions inherited from ns3::TestCase
virtual ~TestCase ()
 Destructor. More...
 
std::string GetName (void) const
 

Private Member Functions

void CheckPoint (Ptr< LteUeNetDevice > ueDev, uint16_t expectedCellId1, uint16_t expectedCellId2)
 Verifies if the given UE is attached to either of the given two cells and in a CONNECTED_NORMALLY state. More...
 
void ConnectionEstablishedCallback (std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti)
 
virtual void DoRun ()
 Setup the simulation according to the configuration set by the class constructor, run it, and verify the result. More...
 
void InitialCellSelectionEndErrorCallback (std::string context, uint64_t imsi, uint16_t cellId)
 
void InitialCellSelectionEndOkCallback (std::string context, uint64_t imsi, uint16_t cellId)
 
void StateTransitionCallback (std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti, LteUeRrc::State oldState, LteUeRrc::State newState)
 

Private Attributes

double m_interSiteDistance
 
bool m_isEpcMode
 
bool m_isIdealRrc
 
std::vector< LteUeRrc::Statem_lastState
 The current UE RRC state. More...
 
int64_t m_rngRun
 
std::vector< UeSetup_tm_ueSetupList
 

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, enum TestDuration duration)
 Add an individual child TestCase to this test suite. More...
 
TestCaseGetParent () const
 Get the parent of this TestCsse. More...
 
bool IsStatusFailure (void) const
 Check if any tests failed. More...
 
bool IsStatusSuccess (void) 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 (void) const
 Check if this run should assert on failure. More...
 
bool MustContinueOnFailure (void) 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 initial cell selection procedure by UE at IDLE state in the beginning of simulation.

Definition at line 61 of file lte-test-cell-selection.h.

Constructor & Destructor Documentation

LteCellSelectionTestCase::LteCellSelectionTestCase ( std::string  name,
bool  isEpcMode,
bool  isIdealRrc,
double  interSiteDistance,
std::vector< UeSetup_t ueSetupList,
int64_t  rngRun 
)

Creates an instance of the initial cell selection test case.

Parameters
namename of this test
isEpcModeset to true for setting up simulation with EPC enabled
isIdealRrcif true, simulation uses Ideal RRC protocol, otherwise simulation uses Real RRC protocol
interSiteDistancethe distance between eNodeB in meters
ueSetupLista list of UE configuration to be installed in the simulation
rngRunthe number of run to be used by the random number generator

Definition at line 130 of file lte-test-cell-selection.cc.

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

+ Here is the call graph for this function:

LteCellSelectionTestCase::~LteCellSelectionTestCase ( )
virtual

Definition at line 146 of file lte-test-cell-selection.cc.

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

+ Here is the call graph for this function:

Member Function Documentation

void LteCellSelectionTestCase::CheckPoint ( Ptr< LteUeNetDevice ueDev,
uint16_t  expectedCellId1,
uint16_t  expectedCellId2 
)
private

Verifies if the given UE is attached to either of the given two cells and in a CONNECTED_NORMALLY state.

Definition at line 361 of file lte-test-cell-selection.cc.

References ns3::LteUeNetDevice::GetImsi(), ns3::LteUeNetDevice::GetRrc(), m_lastState, 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:

void LteCellSelectionTestCase::ConnectionEstablishedCallback ( std::string  context,
uint64_t  imsi,
uint16_t  cellId,
uint16_t  rnti 
)
private

Definition at line 422 of file lte-test-cell-selection.cc.

References NS_LOG_FUNCTION.

Referenced by DoRun().

+ Here is the caller graph for this function:

void LteCellSelectionTestCase::DoRun ( void  )
privatevirtual

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

Implements ns3::TestCase.

Definition at line 153 of file lte-test-cell-selection.cc.

References ns3::ListPositionAllocator::Add(), ns3::NetDeviceContainer::Add(), ns3::Ipv4StaticRouting::AddNetworkRouteTo(), ns3::Ipv4AddressHelper::Assign(), ns3::LteHelper::AssignStreams(), ns3::PointToPointEpcHelper::AssignUeIpv4Address(), ns3::LteHelper::Attach(), ns3::NetDeviceContainer::Begin(), ns3::NodeContainer::Begin(), CheckPoint(), ns3::Config::Connect(), ConnectionEstablishedCallback(), ns3::NodeContainer::Create(), ns3::NetDeviceContainer::End(), ns3::NodeContainer::End(), ns3::NetDeviceContainer::Get(), ns3::NodeContainer::Get(), ns3::NetDeviceContainer::GetN(), ns3::NodeContainer::GetN(), ns3::TestCase::GetName(), ns3::Object::GetObject(), ns3::PointToPointEpcHelper::GetPgwNode(), ns3::Ipv4StaticRoutingHelper::GetStaticRouting(), ns3::PointToPointEpcHelper::GetUeDefaultGatewayAddress(), InitialCellSelectionEndErrorCallback(), InitialCellSelectionEndOkCallback(), ns3::PointToPointHelper::Install(), ns3::InternetStackHelper::Install(), ns3::MobilityHelper::Install(), ns3::LteHelper::InstallEnbDevice(), ns3::LteHelper::InstallUeDevice(), m_interSiteDistance, m_isEpcMode, m_isIdealRrc, m_rngRun, m_ueSetupList, ns3::MakeCallback(), ns3::MilliSeconds(), third::mobility, NS_ASSERT, NS_FATAL_ERROR, NS_LOG_FUNCTION, NS_LOG_INFO, ns3::Seconds(), ns3::ObjectBase::SetAttribute(), ns3::Ipv4AddressHelper::SetBase(), ns3::PointToPointHelper::SetChannelAttribute(), ns3::Ipv4StaticRouting::SetDefaultRoute(), ns3::PointToPointHelper::SetDeviceAttribute(), ns3::LteHelper::SetEnbDeviceAttribute(), ns3::LteHelper::SetEpcHelper(), ns3::Config::SetGlobal(), ns3::MobilityHelper::SetMobilityModel(), ns3::MobilityHelper::SetPositionAllocator(), ns3::LteHelper::SetUeDeviceAttribute(), and StateTransitionCallback().

+ Here is the call graph for this function:

void LteCellSelectionTestCase::InitialCellSelectionEndErrorCallback ( std::string  context,
uint64_t  imsi,
uint16_t  cellId 
)
private

Definition at line 414 of file lte-test-cell-selection.cc.

References NS_LOG_FUNCTION.

Referenced by DoRun().

+ Here is the caller graph for this function:

void LteCellSelectionTestCase::InitialCellSelectionEndOkCallback ( std::string  context,
uint64_t  imsi,
uint16_t  cellId 
)
private

Definition at line 406 of file lte-test-cell-selection.cc.

References NS_LOG_FUNCTION.

Referenced by DoRun().

+ Here is the caller graph for this function:

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

Definition at line 396 of file lte-test-cell-selection.cc.

References m_lastState, and NS_LOG_FUNCTION.

Referenced by DoRun().

+ Here is the caller graph for this function:

Member Data Documentation

double LteCellSelectionTestCase::m_interSiteDistance
private

Definition at line 122 of file lte-test-cell-selection.h.

Referenced by DoRun().

bool LteCellSelectionTestCase::m_isEpcMode
private

Definition at line 120 of file lte-test-cell-selection.h.

Referenced by DoRun().

bool LteCellSelectionTestCase::m_isIdealRrc
private

Definition at line 121 of file lte-test-cell-selection.h.

Referenced by DoRun().

std::vector<LteUeRrc::State> LteCellSelectionTestCase::m_lastState
private

The current UE RRC state.

Definition at line 127 of file lte-test-cell-selection.h.

Referenced by CheckPoint(), LteCellSelectionTestCase(), and StateTransitionCallback().

int64_t LteCellSelectionTestCase::m_rngRun
private

Definition at line 124 of file lte-test-cell-selection.h.

Referenced by DoRun().

std::vector<UeSetup_t> LteCellSelectionTestCase::m_ueSetupList
private

Definition at line 123 of file lte-test-cell-selection.h.

Referenced by DoRun(), and LteCellSelectionTestCase().


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