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... | |
~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. 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 | |
TestCase (const TestCase &)=delete | |
virtual | ~TestCase () |
Destructor. More... | |
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. More... | |
void | DoTeardown () override |
Called at the end of simulation and verifies that a handover has occurred in the simulation. More... | |
Private Attributes | |
uint8_t | m_gridSizeX |
X grid size. More... | |
uint8_t | m_gridSizeY |
Y grid size. More... | |
std::string | m_handoverAlgorithmType |
handover algorithm type More... | |
bool | m_hasHandoverOccurred |
has handover occurred? More... | |
uint16_t | m_sourceCellId |
source cell ID More... | |
Ptr< LteEnbNetDevice > | m_sourceEnbDev |
source ENB device More... | |
uint16_t | m_targetCellId |
target cell ID More... | |
Vector | m_uePosition |
UE positions. 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... | |
TestCase * | GetParent () 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... | |
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 63 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 145 of file test-lte-handover-target.cc.
References NS_FATAL_ERROR, and NS_LOG_INFO.
|
override |
Definition at line 179 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 205 of file test-lte-handover-target.cc.
References ns3::LteEnbNetDevice::GetCellId(), ns3::LteEnbNetDevice::GetPhy(), m_sourceCellId, m_sourceEnbDev, NS_ASSERT, NS_LOG_FUNCTION, NS_LOG_INFO, and third::phy.
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 220 of file test-lte-handover-target.cc.
References ns3::LteHelper::AddX2Interface(), ns3::Ipv4AddressHelper::Assign(), ns3::NoBackhaulEpcHelper::AssignUeIpv4Address(), ns3::LteHelper::Attach(), CellShutdownCallback(), ns3::Config::Connect(), ns3::NodeContainer::Create(), ns3::NetDeviceContainer::Get(), ns3::NodeContainer::Get(), ns3::LteEnbNetDevice::GetCellId(), ns3::NodeContainer::GetN(), ns3::TestCase::GetName(), ns3::Object::GetObject(), ns3::NoBackhaulEpcHelper::GetPgwNode(), ns3::Ipv4StaticRoutingHelper::GetStaticRouting(), ns3::NoBackhaulEpcHelper::GetUeDefaultGatewayAddress(), HandoverStartCallback(), ns3::PointToPointHelper::Install(), ns3::MobilityHelper::Install(), ns3::LteHelper::InstallEnbDevice(), ns3::LteHelper::InstallUeDevice(), nsclick-simple-lan::internet, 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::Seconds(), ns3::ObjectBase::SetAttribute(), ns3::Ipv4AddressHelper::SetBase(), ns3::PointToPointHelper::SetChannelAttribute(), ns3::Config::SetDefault(), ns3::PointToPointHelper::SetDeviceAttribute(), ns3::LteHelper::SetEpcHelper(), ns3::LteHelper::SetHandoverAlgorithmAttribute(), ns3::LteHelper::SetHandoverAlgorithmType(), ns3::MobilityHelper::SetMobilityModel(), and ns3::MobilityHelper::SetPositionAllocator().
|
overrideprivatevirtual |
Called at the end of simulation and verifies that a handover has occurred in the simulation.
Reimplemented from ns3::TestCase.
Definition at line 373 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 185 of file test-lte-handover-target.cc.
References ns3::Time::GetMilliSeconds(), m_hasHandoverOccurred, m_sourceCellId, m_targetCellId, ns3::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 138 of file test-lte-handover-target.cc.
Referenced by DoRun().
|
private |
has handover occurred?
Definition at line 141 of file test-lte-handover-target.cc.
Referenced by DoTeardown(), and HandoverStartCallback().
|
private |
source cell ID
Definition at line 136 of file test-lte-handover-target.cc.
Referenced by CellShutdownCallback(), DoRun(), and HandoverStartCallback().
|
private |
source ENB device
Definition at line 140 of file test-lte-handover-target.cc.
Referenced by CellShutdownCallback(), and DoRun().
|
private |
target cell ID
Definition at line 137 of file test-lte-handover-target.cc.
Referenced by HandoverStartCallback().
|
private |