10#include <ns3/boolean.h>
11#include <ns3/double.h>
12#include <ns3/friis-spectrum-propagation-loss.h>
13#include <ns3/integer.h>
14#include <ns3/internet-stack-helper.h>
16#include <ns3/lte-enb-net-device.h>
17#include <ns3/lte-helper.h>
18#include <ns3/lte-ue-net-device.h>
19#include <ns3/lte-ue-rrc.h>
20#include <ns3/mobility-helper.h>
21#include <ns3/point-to-point-epc-helper.h>
22#include <ns3/simulator.h>
61 uint16_t sourceCellId,
63 uint16_t targetCellId);
69 void DoRun()
override;
87 m_useIdealRrc{useIdealRrc},
88 m_numberOfComponentCarriers{2},
89 m_hasUeHandoverStarted{false}
102 uint16_t sourceCellId,
104 uint16_t targetCellId)
123 lteHelper->SetAttribute(
"PathlossModel",
126 lteHelper->SetAttribute(
"NumberOfComponentCarriers",
130 lteHelper->SetHandoverAlgorithmType(
"ns3::A3RsrpHandoverAlgorithm");
131 lteHelper->SetHandoverAlgorithmAttribute(
"Hysteresis",
DoubleValue(1.5));
135 lteHelper->SetEpcHelper(epcHelper);
143 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
144 mobility.Install(enbNode);
145 mobility.Install(ueNode);
149 auto ueDevs = lteHelper->InstallUeDevice(ueNode);
154 internet.Install(ueNode);
164 ueDev->GetRrc()->TraceConnectWithoutContext(
168 std::map<uint8_t, Ptr<ComponentCarrierUe>> ueCcMap = ueDev->GetCcMap();
169 ueDev->SetDlEarfcn(ueCcMap.at(0)->GetDlEarfcn());
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()
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.
Helper class used to assign positions and mobility models to nodes.
holds a vector of ns3::NetDevice pointers
Smart pointer class similar to boost::intrusive_ptr.
static EventId Schedule(const Time &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
static void Destroy()
Execute the events scheduled with ScheduleDestroy().
static void Run()
Run the simulation.
static void Stop()
Tell the Simulator the calling event should be the last one executed.
void AddTestCase(TestCase *testCase, Duration duration=Duration::QUICK)
Add an individual child TestCase to this test suite.
std::string GetName() const
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 ",...
static LteSecondaryCellHandoverTestSuite g_lteSecondaryCellHandoverTestSuiteInstance
Static variable for test initialization.
Ptr< T > CreateObject(Args &&... args)
Create an object by type, with varying number of constructor parameters.
#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.
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...
Ptr< T1 > DynamicCast(const Ptr< T2 > &p)
Cast a Ptr.