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. More... | |
virtual | ~LteHandoverTargetTestCase () |
void | CellShutdownCallback () |
A trigger that can be scheduled to "shutdown" the cell pointed by m_sourceCellId by reducing its power to 1 dB. More... | |
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. More... | |
Public Member Functions inherited from ns3::TestCase | |
virtual | ~TestCase () |
Destructor. More... | |
Private Member Functions | |
virtual void | DoRun () |
Run a simulation of a micro-cell network using the parameters provided to the constructor function. More... | |
virtual void | DoTeardown () |
Called at the end of simulation and verifies that a handover has occurred in the simulation. More... | |
Private Attributes | |
uint8_t | m_gridSizeX |
uint8_t | m_gridSizeY |
std::string | m_handoverAlgorithmType |
bool | m_hasHandoverOccurred |
uint16_t | m_sourceCellId |
Ptr< LteEnbNetDevice > | m_sourceEnbDev |
uint16_t | m_targetCellId |
Vector | m_uePosition |
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) | |
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 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 67 of file test-lte-handover-target.cc.
ns3::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 139 of file test-lte-handover-target.cc.
References NS_FATAL_ERROR, and NS_LOG_INFO.
|
virtual |
Definition at line 171 of file test-lte-handover-target.cc.
References NS_LOG_FUNCTION.
void ns3::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 196 of file test-lte-handover-target.cc.
References m_sourceCellId, m_sourceEnbDev, NS_ASSERT, NS_LOG_FUNCTION, and NS_LOG_INFO.
Referenced by DoRun().
|
privatevirtual |
Run a simulation of a micro-cell network using the parameters provided to the constructor function.
Implements ns3::TestCase.
Definition at line 212 of file test-lte-handover-target.cc.
References ns3::Ipv4AddressHelper::Assign(), CellShutdownCallback(), ns3::Config::Connect(), ns3::NodeContainer::Create(), ns3::Simulator::Destroy(), ns3::NetDeviceContainer::Get(), ns3::NodeContainer::Get(), ns3::NodeContainer::GetN(), ns3::TestCase::GetName(), ns3::Object::GetObject(), ns3::Ipv4StaticRoutingHelper::GetStaticRouting(), HandoverStartCallback(), ns3::PointToPointHelper::Install(), ns3::InternetStackHelper::Install(), ns3::MobilityHelper::Install(), m_gridSizeX, m_gridSizeY, m_handoverAlgorithmType, m_sourceCellId, m_sourceEnbDev, m_uePosition, ns3::MakeCallback(), NS_ASSERT, NS_FATAL_ERROR, NS_LOG_INFO, ns3::Simulator::Run(), ns3::Simulator::Schedule(), ns3::Ipv4AddressHelper::SetBase(), ns3::PointToPointHelper::SetChannelAttribute(), ns3::Config::SetDefault(), ns3::PointToPointHelper::SetDeviceAttribute(), ns3::MobilityHelper::SetMobilityModel(), ns3::MobilityHelper::SetPositionAllocator(), and ns3::Simulator::Stop().
|
privatevirtual |
Called at the end of simulation and verifies that a handover has occurred in the simulation.
Reimplemented from ns3::TestCase.
Definition at line 365 of file test-lte-handover-target.cc.
References m_hasHandoverOccurred, NS_LOG_FUNCTION, and NS_TEST_ASSERT_MSG_EQ.
void ns3::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.
Definition at line 178 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 |
Definition at line 127 of file test-lte-handover-target.cc.
Referenced by DoRun().
|
private |
Definition at line 128 of file test-lte-handover-target.cc.
Referenced by DoRun().
|
private |
Definition at line 131 of file test-lte-handover-target.cc.
Referenced by DoRun().
|
private |
Definition at line 134 of file test-lte-handover-target.cc.
Referenced by DoTeardown(), and HandoverStartCallback().
|
private |
Definition at line 129 of file test-lte-handover-target.cc.
Referenced by CellShutdownCallback(), DoRun(), and HandoverStartCallback().
|
private |
Definition at line 133 of file test-lte-handover-target.cc.
Referenced by CellShutdownCallback(), and DoRun().
|
private |
Definition at line 130 of file test-lte-handover-target.cc.
Referenced by HandoverStartCallback().
|
private |
Definition at line 126 of file test-lte-handover-target.cc.
Referenced by DoRun().