Testing a handover algorithm, verifying that it selects the right target cell when more than one options available. More...
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 |
TestCase & | operator= (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< LteEnbNetDevice > | m_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. | |
TestCase * | GetParent () 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. | |
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.
Definition at line 52 of file test-lte-handover-target.cc.
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.
name | the name of the test case, to be displayed in the test result |
uePosition | the point in (x, y, z) coordinate where the UE will be placed in the simulation |
gridSizeX | number of eNodeBs in a row |
gridSizeY | number of eNodeBs in a column |
sourceCellId | the 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 |
targetCellId | the cell ID of the expected eNodeB where the UE will perform handover to after the "shutdown" of the source cell |
handoverAlgorithmType | the 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.
|
override |
Definition at line 168 of file test-lte-handover-target.cc.
References NS_LOG_FUNCTION.
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().
|
overrideprivatevirtual |
Run a simulation of a micro-cell network using the parameters provided to the constructor function.
Implements ns3::TestCase.
Definition at line 209 of file test-lte-handover-target.cc.
References ns3::Ipv4AddressHelper::Assign(), CellShutdownCallback(), ns3::Config::Connect(), ns3::NodeContainer::Create(), ns3::CreateObject(), ns3::Simulator::Destroy(), ns3::NetDeviceContainer::Get(), ns3::NodeContainer::Get(), ns3::NodeContainer::GetN(), ns3::TestCase::GetName(), ns3::Ipv4StaticRoutingHelper::GetStaticRouting(), HandoverStartCallback(), ns3::MobilityHelper::Install(), ns3::PointToPointHelper::Install(), m_gridSizeX, m_gridSizeY, m_handoverAlgorithmType, m_sourceCellId, m_sourceEnbDev, m_uePosition, ns3::MakeCallback(), ns3::MilliSeconds(), NS_ASSERT, NS_FATAL_ERROR, NS_LOG_INFO, ns3::Simulator::Run(), ns3::Simulator::Schedule(), ns3::Seconds(), ns3::Ipv4AddressHelper::SetBase(), ns3::PointToPointHelper::SetChannelAttribute(), ns3::Config::SetDefault(), ns3::PointToPointHelper::SetDeviceAttribute(), ns3::MobilityHelper::SetMobilityModel(), ns3::MobilityHelper::SetPositionAllocator(), and ns3::Simulator::Stop().
|
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.
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.
context | the context string |
imsi | the IMSI |
sourceCellId | the source cell ID |
rnti | the RNTI |
targetCellId | the 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().
|
private |
|
private |
|
private |
handover algorithm type
Definition at line 127 of file test-lte-handover-target.cc.
Referenced by DoRun().
|
private |
has handover occurred?
Definition at line 130 of file test-lte-handover-target.cc.
Referenced by DoTeardown(), and HandoverStartCallback().
|
private |
source cell ID
Definition at line 125 of file test-lte-handover-target.cc.
Referenced by CellShutdownCallback(), DoRun(), and HandoverStartCallback().
|
private |
source ENB device
Definition at line 129 of file test-lte-handover-target.cc.
Referenced by CellShutdownCallback(), and DoRun().
|
private |
target cell ID
Definition at line 126 of file test-lte-handover-target.cc.
Referenced by HandoverStartCallback().
|
private |