21#include <ns3/boolean.h>
22#include <ns3/double.h>
23#include <ns3/friis-spectrum-propagation-loss.h>
24#include <ns3/integer.h>
25#include <ns3/internet-stack-helper.h>
27#include <ns3/lte-enb-net-device.h>
28#include <ns3/lte-helper.h>
29#include <ns3/lte-ue-net-device.h>
30#include <ns3/lte-ue-rrc.h>
31#include <ns3/mobility-helper.h>
32#include <ns3/point-to-point-epc-helper.h>
33#include <ns3/simulator.h>
73 uint16_t sourceCellId,
75 uint16_t targetCellId);
81 void DoRun()
override;
99 m_useIdealRrc{useIdealRrc},
100 m_numberOfComponentCarriers{2},
101 m_hasUeHandoverStarted{false}
114 uint16_t sourceCellId,
116 uint16_t targetCellId)
134 auto lteHelper = CreateObject<LteHelper>();
135 lteHelper->SetAttribute(
"PathlossModel",
138 lteHelper->SetAttribute(
"NumberOfComponentCarriers",
142 lteHelper->SetHandoverAlgorithmType(
"ns3::A3RsrpHandoverAlgorithm");
143 lteHelper->SetHandoverAlgorithmAttribute(
"Hysteresis",
DoubleValue(1.5));
146 auto epcHelper = CreateObject<PointToPointEpcHelper>();
147 lteHelper->SetEpcHelper(epcHelper);
150 auto enbNode = CreateObject<Node>();
151 auto ueNode = CreateObject<Node>();
155 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
160 m_sourceEnbDev = DynamicCast<LteEnbNetDevice>(lteHelper->InstallEnbDevice(enbNode).Get(0));
161 auto ueDevs = lteHelper->InstallUeDevice(ueNode);
162 auto ueDev = DynamicCast<LteUeNetDevice>(ueDevs.Get(0));
170 Simulator::Schedule(
Seconds(0.5),
176 ueDev->GetRrc()->TraceConnectWithoutContext(
180 std::map<uint8_t, Ptr<ComponentCarrierUe>> ueCcMap = ueDev->GetCcMap();
181 ueDev->SetDlEarfcn(ueCcMap.at(0)->GetDlEarfcn());
187 Simulator::Destroy();
210 :
TestSuite{
"lte-secondary-cell-handover", SYSTEM}
Test measurement-based handover to secondary cell.
void UeHandoverStartCallback(uint64_t imsi, uint16_t sourceCellId, uint16_t rnti, uint16_t targetCellId)
Callback method indicating start of UE handover.
bool m_useIdealRrc
whether LTE is configured to use ideal RRC
Ptr< LteEnbNetDevice > m_sourceEnbDev
Source eNB device.
void ShutdownCell(uint32_t cellId)
Shutdown cellId by reducing its power to 1 dBm.
LteSecondaryCellHandoverTestCase(std::string name, bool useIdealRrc)
Creates an instance of the measurement-based secondary cell handover test case.
void DoRun() override
Run a simulation.
uint8_t m_numberOfComponentCarriers
Number of component carriers.
void DoTeardown() override
Verify that handover has occurred during the simulation.
bool m_hasUeHandoverStarted
true if UE started handover
LTE measurement-based handover to secondary cell test suite.
LteSecondaryCellHandoverTestSuite()
AttributeValue implementation for Boolean.
This class can be used to hold variables of floating point type such as 'double' or 'float'.
static TypeId GetTypeId()
Get the type ID.
aggregate IP/TCP/UDP functionality to existing Nodes.
void Install(std::string nodeName) const
Aggregate implementations of the ns3::Ipv4, ns3::Ipv6, ns3::Udp, and ns3::Tcp classes onto the provid...
Ptr< LteEnbPhy > GetPhy() const
uint16_t GetCellId() const
Helper class used to assign positions and mobility models to nodes.
holds a vector of ns3::NetDevice pointers
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
std::string GetName() const
AttributeValue implementation for Time.
AttributeValue implementation for TypeId.
Hold an unsigned integer type.
void SetDefault(std::string name, const AttributeValue &value)
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_TEST_ASSERT_MSG_EQ(actual, limit, msg)
Test that an actual and expected (limit) value are equal and report and abort if not.
Time Seconds(double value)
Construct a Time in the indicated unit.
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
static LteSecondaryCellHandoverTestSuite g_lteSecondaryCellHandoverTestSuiteInstance
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Callback< R, Args... > MakeCallback(R(T::*memPtr)(Args...), OBJ objPtr)
Build Callbacks for class method members which take varying numbers of arguments and potentially retu...