24 #include <ns3/nstime.h>
25 #include <ns3/callback.h>
26 #include <ns3/config.h>
27 #include <ns3/boolean.h>
28 #include <ns3/simulator.h>
30 #include <ns3/node-container.h>
31 #include <ns3/net-device-container.h>
32 #include <ns3/ipv4-interface-container.h>
34 #include <ns3/lte-helper.h>
35 #include <ns3/epc-helper.h>
36 #include <ns3/internet-stack-helper.h>
37 #include <ns3/point-to-point-helper.h>
38 #include <ns3/ipv4-address-helper.h>
39 #include <ns3/ipv4-static-routing-helper.h>
40 #include <ns3/mobility-helper.h>
42 #include <ns3/data-rate.h>
43 #include <ns3/ipv4-static-routing.h>
44 #include <ns3/position-allocator.h>
60 Time delayThreshold,
Time simulationDuration)
61 :
TestCase (
"Verifying that the time needed for handover is under a specified threshold"),
71 virtual void DoRun (
void);
74 uint16_t cellid, uint16_t rnti, uint16_t targetCellId);
76 uint16_t cellid, uint16_t rnti);
78 uint16_t cellid, uint16_t rnti, uint16_t targetCellId);
80 uint16_t cellid, uint16_t rnti);
100 lteHelper->SetEpcHelper (epcHelper);
108 inetStackHelper.
Install (remoteHosts);
119 remoteHosts.
Get (0));
122 addrHelper.
SetBase (
"10.1.1.0",
"255.255.255.0");
124 inetIfs = addrHelper.
Assign (inetDevs);
131 remoteHostRouting->AddNetworkRouteTo (
Ipv4Address (
"7.0.0.0"),
151 posAlloc->Add (
Vector (0, 0, 0));
152 posAlloc->Add (
Vector (1000, 0, 0));
153 posAlloc->Add (
Vector (500, 0, 0));
158 mobilityHelper.
Install (enbNodes);
159 mobilityHelper.
Install (ueNodes);
165 enbDevs = lteHelper->InstallEnbDevice (enbNodes);
166 ueDevs = lteHelper->InstallUeDevice (ueNodes);
170 inetStackHelper.
Install(ueNodes);
172 ueIfs = epcHelper->AssignUeIpv4Address (ueDevs);
178 ueStaticRouting->SetDefaultRoute (epcHelper->GetUeDefaultGatewayAddress (),
195 lteHelper->AddX2Interface (enbNodes);
196 lteHelper->Attach (ueDevs.
Get(0), enbDevs.
Get(0));
211 uint64_t imsi, uint16_t cellid, uint16_t rnti, uint16_t targetCellId)
219 uint64_t imsi, uint16_t cellid, uint16_t rnti)
226 "UE handover delay is higher than the allowed threshold "
234 uint64_t imsi, uint16_t cellid, uint16_t rnti, uint16_t targetCellId)
242 uint64_t imsi, uint16_t cellid, uint16_t rnti)
249 "eNodeB handover delay is higher than the allowed threshold "
272 for (
Time handoverTime = Seconds (0.100); handoverTime < Seconds (0.110);
273 handoverTime += Seconds (0.001))
283 for (
Time handoverTime = Seconds (0.100); handoverTime < Seconds (0.110);
284 handoverTime += Seconds (0.001))
keep track of time values and allow control of global simulation resolution
smart pointer class similar to boost::intrusive_ptr
#define NS_LOG_FUNCTION(parameters)
This test suite implements a System Test.
LteHandoverDelayTestCase(bool useIdealRrc, Time handoverTime, Time delayThreshold, Time simulationDuration)
holds a vector of std::pair of Ptr and interface index.
Ptr< NetDevice > Get(uint32_t i) const
Get the Ptr stored in this container at a given index.
NetDeviceContainer Install(NodeContainer c)
a class to represent an Ipv4 address mask
#define NS_ASSERT(condition)
void EnbHandoverStartCallback(std::string context, uint64_t imsi, uint16_t cellid, uint16_t rnti, uint16_t targetCellId)
aggregate IP/TCP/UDP functionality to existing Nodes.
Build a set of PointToPointNetDevice objects.
void Connect(std::string path, const CallbackBase &cb)
void SetDeviceAttribute(std::string name, const AttributeValue &value)
Class for representing data rates.
double GetSeconds(void) const
void Install(Ptr< Node > node) const
"Layout" a single node according to the current position allocator type.
hold objects of type ns3::Time
Hold an unsigned integer type.
NS_LOG_COMPONENT_DEFINE("LteHandoverDelayTest")
holds a vector of ns3::NetDevice pointers
Callback< R > MakeCallback(R(T::*memPtr)(void), OBJ objPtr)
void UeHandoverEndOkCallback(std::string context, uint64_t imsi, uint16_t cellid, uint16_t rnti)
static void Destroy(void)
Access to the Ipv4 forwarding table, interfaces, and configuration.
void UeHandoverStartCallback(std::string context, uint64_t imsi, uint16_t cellid, uint16_t rnti, uint16_t targetCellId)
keep track of a set of node pointers.
ns3::LteHandoverDelayTestSuite g_lteHandoverDelayTestSuite
void SetMobilityModel(std::string type, std::string n1="", const AttributeValue &v1=EmptyAttributeValue(), std::string n2="", const AttributeValue &v2=EmptyAttributeValue(), std::string n3="", const AttributeValue &v3=EmptyAttributeValue(), std::string n4="", const AttributeValue &v4=EmptyAttributeValue(), std::string n5="", const AttributeValue &v5=EmptyAttributeValue(), std::string n6="", const AttributeValue &v6=EmptyAttributeValue(), std::string n7="", const AttributeValue &v7=EmptyAttributeValue(), std::string n8="", const AttributeValue &v8=EmptyAttributeValue(), std::string n9="", const AttributeValue &v9=EmptyAttributeValue())
virtual void DoRun(void)
Implementation to actually run this TestCase.
void Install(std::string nodeName) const
void EnbHandoverEndOkCallback(std::string context, uint64_t imsi, uint16_t cellid, uint16_t rnti)
void AddTestCase(TestCase *testCase) NS_DEPRECATED
Add an individual child TestCase case to this TestCase.
Time m_simulationDuration
void SetChannelAttribute(std::string name, const AttributeValue &value)
Helper class used to assign positions and mobility models to nodes.
Ipv4 addresses are stored in host order in this class.
Ipv4InterfaceContainer Assign(const NetDeviceContainer &c)
Assign IP addresses to the net devices specified in the container based on the current network prefix...
Ptr< Ipv4StaticRouting > GetStaticRouting(Ptr< Ipv4 > ipv4) const
Helper class that adds ns3::Ipv4StaticRouting objects.
hold objects of type ns3::DataRate
Ptr< Node > Get(uint32_t i) const
Get the Ptr stored in this container at a given index.
#define NS_LOG_DEBUG(msg)
#define NS_TEST_ASSERT_MSG_LT(actual, limit, msg)
Test that an actual value is less than a limit and report and abort if not.
A helper class to make life easier while doing simple IPv4 address assignment in scripts.
void Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.
void SetPositionAllocator(Ptr< PositionAllocator > allocator)
Ptr< T > GetObject(void) const
void SetBase(Ipv4Address network, Ipv4Mask mask, Ipv4Address base="0.0.0.1")
Set the base network number, network mask and base address.
LteHandoverDelayTestSuite()