22#include "ns3/boolean.h"
23#include "ns3/config.h"
24#include "ns3/csma-helper.h"
25#include "ns3/epc-enb-application.h"
26#include "ns3/eps-bearer.h"
27#include "ns3/inet-socket-address.h"
28#include "ns3/internet-stack-helper.h"
29#include "ns3/ipv4-address-helper.h"
31#include "ns3/packet-sink-helper.h"
32#include "ns3/packet-sink.h"
33#include "ns3/point-to-point-epc-helper.h"
34#include "ns3/point-to-point-helper.h"
35#include "ns3/simulator.h"
37#include "ns3/udp-echo-helper.h"
38#include "ns3/uinteger.h"
39#include <ns3/ipv4-static-routing-helper.h>
40#include <ns3/ipv4-static-routing.h>
82 std::vector<UeDlTestData>
ues;
103 void DoRun()
override;
130 remoteHostContainer.
Create(1);
133 internet.Install(remoteHostContainer);
140 ipv4h.
SetBase(
"1.0.0.0",
"255.0.0.0");
141 ipv4h.
Assign(internetDevices);
149 remoteHostStaticRouting->AddNetworkRouteTo(
Ipv4Address(
"7.0.0.0"),
154 uint16_t cellIdCounter = 0;
155 uint64_t imsiCounter = 0;
157 for (std::vector<EnbDlTestData>::iterator enbit =
m_enbDlTestData.begin();
168 uint16_t cellId = ++cellIdCounter;
171 ues.
Create(enbit->ues.size());
184 std::vector<uint16_t> cellIds;
185 cellIds.push_back(cellId);
186 epcHelper->AddEnb(enb, enbDevice, cellIds);
192 enb->AggregateObject(rrc);
193 rrc->SetS1SapProvider(enbApp->GetS1SapProvider());
194 enbApp->SetS1SapUser(rrc->GetS1SapUser());
198 internet.Install(ues);
214 uint16_t
port = 1234;
224 client.SetAttribute(
"MaxPackets",
UintegerValue(enbit->ues[u].numPkts));
225 client.SetAttribute(
"Interval",
TimeValue(interPacketInterval));
226 client.SetAttribute(
"PacketSize",
UintegerValue(enbit->ues[u].pktSize));
227 apps = client.Install(remoteHost);
230 enbit->ues[u].clientApp = apps.
Get(0);
232 uint64_t imsi = ++imsiCounter;
233 epcHelper->AddUe(ueLteDevice, imsi);
234 epcHelper->ActivateEpsBearer(ueLteDevice,
240 enbApp->GetS1SapProvider(),
248 for (std::vector<EnbDlTestData>::iterator enbit =
m_enbDlTestData.begin();
252 for (std::vector<UeDlTestData>::iterator ueit = enbit->ues.begin(); ueit < enbit->ues.end();
256 (ueit->numPkts) * (ueit->pktSize),
257 "wrong total received bytes");
277 std::vector<EnbDlTestData> v1;
280 e1.
ues.push_back(f1);
284 std::vector<EnbDlTestData> v2;
287 e2.
ues.push_back(f2_1);
289 e2.
ues.push_back(f2_2);
293 std::vector<EnbDlTestData> v3;
300 e3.
ues.push_back(f3_1);
302 e3.
ues.push_back(f3_2);
304 e3.
ues.push_back(f3_2);
305 std::vector<EnbDlTestData> v4;
311 std::vector<EnbDlTestData> v5;
314 e5.
ues.push_back(f5);
318 std::vector<EnbDlTestData> v6;
321 e6.
ues.push_back(f6);
325 std::vector<EnbDlTestData> v7;
328 e7.
ues.push_back(f7);
332 std::vector<EnbDlTestData> v8;
335 e8.
ues.push_back(f8);
std::vector< EnbDlTestData > m_enbDlTestData
ENB DL test data.
EpcS1uDlTestCase(std::string name, std::vector< EnbDlTestData > v)
Constructor.
void DoRun() override
Implementation to actually run this TestCase.
~EpcS1uDlTestCase() override
Test that the S1-U interface implementation works correctly.
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.
Ptr< Application > Get(uint32_t i) const
Get the Ptr<Application> stored in this container at a given index.
void Stop(Time stop) const
Arrange for all of the Applications in this container to Stop() at the Time given as a parameter.
AttributeValue implementation for Boolean.
build a set of CsmaNetDevice objects
NetDeviceContainer Install(Ptr< Node > node) const
This method creates an ns3::CsmaChannel with the attributes configured by CsmaHelper::SetChannelAttri...
Class for representing data rates.
AttributeValue implementation for DataRate.
This application is installed inside eNBs and provides the bridge functionality for user data plane p...
virtual void InitialUeMessage(uint64_t imsi, uint16_t rnti)=0
Initial UE message.
static Ptr< EpcTft > Default()
creates a TFT matching any traffic
This class contains the specification of EPS Bearers.
@ NGBR_VIDEO_TCP_DEFAULT
Non-GBR TCP-based Video (Buffered Streaming, e.g., www, e-mail...)
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...
holds a vector of ns3::NetDevice pointers
uint32_t GetN() const
Get the number of Ptr<NetDevice> stored in 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.
uint32_t GetN() const
Get the number of Ptr<Node> stored in this container.
void Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.
void Add(const NodeContainer &nc)
Append the contents of another NodeContainer to the end of this container.
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.
Receive and consume traffic generated to an IP address and port.
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.
NetDeviceContainer Install(NodeContainer c)
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.
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
Simulation virtual time values and global simulation resolution.
AttributeValue implementation for Time.
Create an application which sends a UDP packet and waits for an echo of this packet.
Hold an unsigned integer type.
EpcS1uDlTestSuite g_epcS1uDlTestSuiteInstance
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
void SetDefault(std::string name, const AttributeValue &value)
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#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.
Custom structure for testing eNodeB downlink data, contains the list of data structures for UEs.
std::vector< UeDlTestData > ues
list of data structure for different UEs
Custom structure for testing UE downlink data.
uint32_t pktSize
packet size
UeDlTestData(uint32_t n, uint32_t s)
Constructor.
uint32_t numPkts
number of packets
Ptr< Application > clientApp
Client application.
Ptr< PacketSink > serverApp
Server application.
uint32_t pktSize
packet size used for the simulation (in bytes)