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

Testing a handover algorithm, verifying that it selects the right target cell when more than one options available. More...

+ Inheritance diagram for LteHandoverTargetTestCase:
+ Collaboration diagram for LteHandoverTargetTestCase:

Public Member Functions

 LteHandoverTargetTestCase (std::string name, Vector uePosition, uint8_t gridSizeX, uint8_t gridSizeY, uint16_t sourceCellId, uint16_t targetCellId, std::string handoverAlgorithmType)
 Construct a new test case and providing input parameters for the simulation.
 
 ~LteHandoverTargetTestCase () override
 
void CellShutdownCallback ()
 A trigger that can be scheduled to "shutdown" the cell pointed by m_sourceCellId by reducing its power to 1 dB.
 
void HandoverStartCallback (std::string context, uint64_t imsi, uint16_t sourceCellId, uint16_t rnti, uint16_t targetCellId)
 Triggers when an eNodeB starts a handover and then verifies that the handover has the right source and target cells.
 
- 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
 Run a simulation of a micro-cell network using the parameters provided to the constructor function.
 
void DoTeardown () override
 Called at the end of simulation and verifies that a handover has occurred in the simulation.
 

Private Attributes

uint8_t m_gridSizeX
 X grid size.
 
uint8_t m_gridSizeY
 Y grid size.
 
std::string m_handoverAlgorithmType
 handover algorithm type
 
bool m_hasHandoverOccurred
 has handover occurred?
 
uint16_t m_sourceCellId
 source cell ID
 
Ptr< LteEnbNetDevicem_sourceEnbDev
 source ENB device
 
uint16_t m_targetCellId
 target cell ID
 
Vector m_uePosition
 UE positions.
 

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 a handover algorithm, verifying that it selects the right target cell when more than one options available.

Part of the lte-handover-target test suite.

The test case will run a 1-second LTE-EPC simulation using the parameters provided to the constructor function.

See also
ns3::LteHandoverTargetTestCase

Definition at line 52 of file test-lte-handover-target.cc.

Constructor & Destructor Documentation

◆ LteHandoverTargetTestCase()

LteHandoverTargetTestCase::LteHandoverTargetTestCase ( std::string name,
Vector uePosition,
uint8_t gridSizeX,
uint8_t gridSizeY,
uint16_t sourceCellId,
uint16_t targetCellId,
std::string handoverAlgorithmType )

Construct a new test case and providing input parameters for the simulation.

Parameters
namethe name of the test case, to be displayed in the test result
uePositionthe point in (x, y, z) coordinate where the UE will be placed in the simulation
gridSizeXnumber of eNodeBs in a row
gridSizeYnumber of eNodeBs in a column
sourceCellIdthe cell ID of the eNodeB which the UE will be initially attached to in the beginning of simulation, and also the eNodeB which will "shutdown" in the middle of simulation
targetCellIdthe cell ID of the expected eNodeB where the UE will perform handover to after the "shutdown" of the source cell
handoverAlgorithmTypethe type of handover algorithm to be used in all eNodeBs

Definition at line 134 of file test-lte-handover-target.cc.

References NS_FATAL_ERROR, and NS_LOG_INFO.

◆ ~LteHandoverTargetTestCase()

LteHandoverTargetTestCase::~LteHandoverTargetTestCase ( )
override

Definition at line 168 of file test-lte-handover-target.cc.

References NS_LOG_FUNCTION.

Member Function Documentation

◆ CellShutdownCallback()

void LteHandoverTargetTestCase::CellShutdownCallback ( )

A trigger that can be scheduled to "shutdown" the cell pointed by m_sourceCellId by reducing its power to 1 dB.

Definition at line 194 of file test-lte-handover-target.cc.

References m_sourceCellId, m_sourceEnbDev, NS_ASSERT, NS_LOG_FUNCTION, and NS_LOG_INFO.

Referenced by DoRun().

+ Here is the caller graph for this function:

◆ DoRun()

◆ DoTeardown()

void LteHandoverTargetTestCase::DoTeardown ( )
overrideprivatevirtual

Called at the end of simulation and verifies that a handover has occurred in the simulation.

Reimplemented from ns3::TestCase.

Definition at line 362 of file test-lte-handover-target.cc.

References m_hasHandoverOccurred, NS_LOG_FUNCTION, and NS_TEST_ASSERT_MSG_EQ.

◆ HandoverStartCallback()

void LteHandoverTargetTestCase::HandoverStartCallback ( std::string context,
uint64_t imsi,
uint16_t sourceCellId,
uint16_t rnti,
uint16_t targetCellId )

Triggers when an eNodeB starts a handover and then verifies that the handover has the right source and target cells.

The trigger is set up beforehand by connecting to the LteEnbRrc::HandoverStart trace source.

Parameters
contextthe context string
imsithe IMSI
sourceCellIdthe source cell ID
rntithe RNTI
targetCellIdthe target cell ID

Definition at line 174 of file test-lte-handover-target.cc.

References ns3::Time::GetMilliSeconds(), m_hasHandoverOccurred, m_sourceCellId, m_targetCellId, ns3::Simulator::Now(), NS_LOG_FUNCTION, NS_TEST_ASSERT_MSG_EQ, and NS_TEST_ASSERT_MSG_GT.

Referenced by DoRun().

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

Member Data Documentation

◆ m_gridSizeX

uint8_t LteHandoverTargetTestCase::m_gridSizeX
private

X grid size.

Definition at line 123 of file test-lte-handover-target.cc.

Referenced by DoRun().

◆ m_gridSizeY

uint8_t LteHandoverTargetTestCase::m_gridSizeY
private

Y grid size.

Definition at line 124 of file test-lte-handover-target.cc.

Referenced by DoRun().

◆ m_handoverAlgorithmType

std::string LteHandoverTargetTestCase::m_handoverAlgorithmType
private

handover algorithm type

Definition at line 127 of file test-lte-handover-target.cc.

Referenced by DoRun().

◆ m_hasHandoverOccurred

bool LteHandoverTargetTestCase::m_hasHandoverOccurred
private

has handover occurred?

Definition at line 130 of file test-lte-handover-target.cc.

Referenced by DoTeardown(), and HandoverStartCallback().

◆ m_sourceCellId

uint16_t LteHandoverTargetTestCase::m_sourceCellId
private

source cell ID

Definition at line 125 of file test-lte-handover-target.cc.

Referenced by CellShutdownCallback(), DoRun(), and HandoverStartCallback().

◆ m_sourceEnbDev

Ptr<LteEnbNetDevice> LteHandoverTargetTestCase::m_sourceEnbDev
private

source ENB device

Definition at line 129 of file test-lte-handover-target.cc.

Referenced by CellShutdownCallback(), and DoRun().

◆ m_targetCellId

uint16_t LteHandoverTargetTestCase::m_targetCellId
private

target cell ID

Definition at line 126 of file test-lte-handover-target.cc.

Referenced by HandoverStartCallback().

◆ m_uePosition

Vector LteHandoverTargetTestCase::m_uePosition
private

UE positions.

Definition at line 122 of file test-lte-handover-target.cc.

Referenced by DoRun().


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