9#include "ns3/application-container.h"
10#include "ns3/boolean.h"
11#include "ns3/config.h"
12#include "ns3/constant-velocity-mobility-model.h"
13#include "ns3/data-rate.h"
14#include "ns3/double.h"
15#include "ns3/epc-tft.h"
16#include "ns3/eps-bearer.h"
17#include "ns3/inet-socket-address.h"
18#include "ns3/internet-stack-helper.h"
19#include "ns3/ipv4-address-helper.h"
20#include "ns3/ipv4-interface-container.h"
21#include "ns3/ipv4-static-routing-helper.h"
22#include "ns3/ipv4-static-routing.h"
23#include "ns3/lte-helper.h"
24#include "ns3/mobility-helper.h"
25#include "ns3/net-device-container.h"
26#include "ns3/node-container.h"
27#include "ns3/nstime.h"
28#include "ns3/packet-sink-helper.h"
29#include "ns3/point-to-point-epc-helper.h"
30#include "ns3/point-to-point-helper.h"
31#include "ns3/position-allocator.h"
32#include "ns3/rng-seed-manager.h"
33#include "ns3/simulator.h"
35#include "ns3/udp-client-server-helper.h"
36#include "ns3/uinteger.h"
67 void DoRun()
override;
71 :
TestCase(
"Handover does not abort on spectrum-model mismatch (issue #447)")
86 const double simTime = 5.0;
87 const uint16_t numberOfUes = 30;
88 const uint16_t numberOfCells = 5;
89 const double speed = 16.0;
102 lteHelper->SetEpcHelper(epcHelper);
104 lteHelper->SetSchedulerType(
"ns3::PfFfMacScheduler");
105 lteHelper->SetHandoverAlgorithmType(
"ns3::A3RsrpHandoverAlgorithm");
106 lteHelper->SetHandoverAlgorithmAttribute(
"Hysteresis",
DoubleValue(3.0));
112 remoteHostContainer.
Create(1);
115 internet.Install(remoteHostContainer);
122 ipv4h.
SetBase(
"1.0.0.0",
"255.0.0.0");
128 remoteHostStaticRouting->AddNetworkRouteTo(
Ipv4Address(
"7.0.0.0"),
Ipv4Mask(
"255.0.0.0"), 1);
132 enbNodes.
Create(numberOfCells);
134 enbPosition->Add(Vector(500, 0, 0));
135 enbPosition->Add(Vector(10, 0, 0));
136 enbPosition->Add(Vector(30, 0, 0));
137 enbPosition->Add(Vector(50, 0, 0));
138 enbPosition->Add(Vector(70, 0, 0));
146 enbDevs.
Add(lteHelper->InstallEnbDevice(enbNodes.
Get(0)));
148 for (uint16_t j = 1; j < numberOfCells; j++)
150 enbDevs.
Add(lteHelper->InstallEnbDevice(enbNodes.
Get(j)));
155 ueNodes.
Create(numberOfUes);
159 for (uint16_t i = 0; i < numberOfUes; i++)
163 Vector(speed, 0, 0));
166 internet.Install(ueNodes);
169 for (uint16_t i = 0; i < numberOfUes; i++)
171 lteHelper->Attach(ueDevs.
Get(i));
179 startTime->SetAttribute(
"Max",
DoubleValue(0.010));
180 uint16_t dlPort = 10000;
181 uint16_t ulPort = 20000;
182 for (uint16_t
u = 0;
u < numberOfUes; ++
u)
187 ueStaticRouting->SetDefaultRoute(epcHelper->GetUeDefaultGatewayAddress(), 1);
218 lteHelper->ActivateDedicatedEpsBearer(ueDevs.
Get(
u), bearer, tft);
221 dlApps.
Start(appStart);
222 ulApps.
Start(appStart);
225 lteHelper->AddX2Interface(enbNodes);
234 "Simulation did not run to completion");
Regression test for Issue 447: a UE handing over between cells must not abort with the spectrum-model...
LteHandoverSpectrumModelTestCase()
void DoRun() override
Implementation to actually run this TestCase.
~LteHandoverSpectrumModelTestCase() override
Test suite for the handover spectrum-model regression test.
LteHandoverSpectrumModelTestSuite()
holds a vector of ns3::Application pointers.
void Start(Time start) const
Start all of the Applications in this container at the start time given as a parameter.
void Add(ApplicationContainer other)
Append the contents of another ApplicationContainer to the end of this container.
ApplicationContainer Install(NodeContainer c)
Install an application on each node of the input container configured with all the attributes set wit...
void SetAttribute(const std::string &name, const AttributeValue &value)
Helper function used to set the underlying application attributes.
Mobility model for which the current speed does not change once it has been set and until it is set a...
Class for representing data rates.
This class can be used to hold variables of floating point type such as 'double' or 'float'.
This class contains the specification of EPS Bearers.
@ NGBR_IMS
Non-GBR IMS Signalling.
aggregate IP/TCP/UDP functionality to existing Nodes.
A helper class to make life easier while doing simple IPv4 address assignment in scripts.
void SetBase(Ipv4Address network, Ipv4Mask mask, Ipv4Address base="0.0.0.1")
Set the base network number, network mask and base address.
Ipv4InterfaceContainer Assign(const NetDeviceContainer &c)
Assign IP addresses to the net devices specified in the container based on the current network prefix...
Ipv4 addresses are stored in host order in this class.
static Ipv4Address GetAny()
Access to the IPv4 forwarding table, interfaces, and configuration.
holds a vector of std::pair of Ptr<Ipv4> and interface index.
Ipv4Address GetAddress(uint32_t i, uint32_t j=0) const
a class to represent an Ipv4 address mask
Helper class that adds ns3::Ipv4StaticRouting objects.
Ptr< Ipv4StaticRouting > GetStaticRouting(Ptr< Ipv4 > ipv4) const
Try and find the static routing protocol as either the main routing protocol or in the list of routin...
Helper class used to assign positions and mobility models to nodes.
void Install(Ptr< Node > node) const
"Layout" a single node according to the current position allocator type.
void SetMobilityModel(std::string type, Ts &&... args)
void SetPositionAllocator(Ptr< PositionAllocator > allocator)
Set the position allocator which will be used to allocate the initial position of every node initiali...
Keep track of the current position and velocity of an object.
holds a vector of ns3::NetDevice pointers
void Add(NetDeviceContainer other)
Append the contents of another NetDeviceContainer to the end of this container.
Ptr< NetDevice > Get(uint32_t i) const
Get the Ptr<NetDevice> stored in this container at a given index.
keep track of a set of node pointers.
void Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.
Ptr< Node > Get(uint32_t i) const
Get the Ptr<Node> stored in this container at a given index.
Ptr< T > GetObject() const
Get a pointer to the requested aggregated Object.
A helper to make it easier to instantiate an ns3::PacketSinkApplication on a set of nodes.
Build a set of PointToPointNetDevice objects.
void SetDeviceAttribute(std::string name, const AttributeValue &value)
Set an attribute value to be propagated to each NetDevice created by the helper.
void SetChannelAttribute(std::string name, const AttributeValue &value)
Set an attribute value to be propagated to each Channel created by the helper.
NetDeviceContainer Install(NodeContainer c)
Smart pointer class similar to boost::intrusive_ptr.
static void SetRun(uint64_t run)
Set the run number of simulation.
static void SetSeed(uint32_t seed)
Set the seed.
static void Destroy()
Execute the events scheduled with ScheduleDestroy().
static Time Now()
Return the current simulation virtual time.
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.
@ EXTENSIVE
Medium length test.
TestCase(const TestCase &)=delete
Caller graph was not generated because of its size.
TestSuite(std::string name, Type type=Type::UNIT)
Construct a new test suite.
Simulation virtual time values and global simulation resolution.
static TypeId LookupByName(std::string name)
Get a TypeId by name.
Create a client application which sends UDP packets carrying a 32bit sequence number and a 64 bit tim...
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.
Ptr< T > CreateObject(Args &&... args)
Create an object by type, with varying number of constructor parameters.
Ptr< T > Create(Ts &&... args)
Create class instances by constructors with varying numbers of arguments and return them by Ptr.
#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.
Implement the data structure representing a TrafficFlowTemplate Packet Filter.
uint16_t localPortEnd
end of the port number range of the UE
uint16_t remotePortEnd
end of the port number range of the remote host
uint16_t remotePortStart
start of the port number range of the remote host
uint16_t localPortStart
start of the port number range of the UE
static LteHandoverSpectrumModelTestSuite g_lteHandoverSpectrumModelTestSuite
Static variable for test initialization.