8#include "ns3/application-container.h"
9#include "ns3/boolean.h"
10#include "ns3/bulk-send-application.h"
11#include "ns3/bulk-send-helper.h"
12#include "ns3/inet-socket-address.h"
13#include "ns3/internet-stack-helper.h"
14#include "ns3/ipv4-address-helper.h"
15#include "ns3/ipv4-address.h"
16#include "ns3/ipv4-interface-container.h"
17#include "ns3/node-container.h"
19#include "ns3/nstime.h"
20#include "ns3/packet-sink-helper.h"
21#include "ns3/packet-sink.h"
22#include "ns3/simple-net-device-helper.h"
23#include "ns3/string.h"
25#include "ns3/traced-callback.h"
26#include "ns3/uinteger.h"
43 void DoRun()
override;
60 :
TestCase(
"Check a basic 300KB transfer")
94 internet.Install(
nodes);
96 ipv4.SetBase(
"10.1.1.0",
"255.255.255.0");
138 void DoRun()
override;
170 :
TestCase(
"Check a 300KB transfer with SeqTsSize header enabled")
220 internet.Install(
nodes);
222 ipv4.SetBase(
"10.1.1.0",
"255.255.255.0");
241 source->TraceConnectWithoutContext(
"TxWithSeqTsSize",
243 sink->TraceConnectWithoutContext(
"RxWithSeqTsSize",
static BulkSendTestSuite g_bulkSendTestSuite
Static variable for test initialization.
Basic test, checks that the right quantity of packets are sent and received.
void DoRun() override
Implementation to actually run this TestCase.
uint64_t m_sent
number of bytes sent
void ReceiveRx(Ptr< const Packet > p, const Address &addr)
Record a packet successfully received.
uint64_t m_received
number of bytes received
void SendTx(Ptr< const Packet > p)
Record a packet successfully sent.
~BulkSendBasicTestCase() override
This test checks that the sequence number is sent and received in sequence despite the sending applic...
Time m_lastTxTs
Last recorded timestamp on Tx.
void ReceiveRx(Ptr< const Packet > p, const Address &from, const Address &to, const SeqTsSizeHeader &header)
Record a packet successfully received.
Time m_lastRxTs
Last recorded timestamp on Rx.
uint64_t m_seqRxCounter
Counter for Sequences on Rx.
BulkSendSeqTsSizeTestCase()
uint64_t m_seqTxCounter
Counter for Sequences on Tx.
~BulkSendSeqTsSizeTestCase() override
uint64_t m_sent
number of bytes sent
void SendTx(Ptr< const Packet > p, const Address &from, const Address &to, const SeqTsSizeHeader &header)
Record a packet successfully sent.
void DoRun() override
Implementation to actually run this TestCase.
uint64_t m_received
number of bytes received
a polymophic address class
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.
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.
AttributeValue implementation for Boolean.
A helper to make it easier to instantiate an ns3::BulkSendApplication on a set of nodes.
aggregate IP/TCP/UDP functionality to existing Nodes.
A helper class to make life easier while doing simple IPv4 address assignment in scripts.
static Ipv4Address GetAny()
holds a vector of std::pair of Ptr<Ipv4> and interface index.
Ipv4Address GetAddress(uint32_t i, uint32_t j=0) const
holds a vector of ns3::NetDevice pointers
keep track of a set of node pointers.
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.
A helper to make it easier to instantiate an ns3::PacketSinkApplication on a set of nodes.
Smart pointer class similar to boost::intrusive_ptr.
build a set of SimpleNetDevice objects
void SetChannelAttribute(std::string n1, const AttributeValue &v1)
void SetDeviceAttribute(std::string n1, const AttributeValue &v1)
NetDeviceContainer Install(Ptr< Node > node) const
This method creates an ns3::SimpleChannel with the attributes configured by SimpleNetDeviceHelper::Se...
static void Destroy()
Execute the events scheduled with ScheduleDestroy().
static void Run()
Run the simulation.
Hold variables of type string.
void AddTestCase(TestCase *testCase, Duration duration=Duration::QUICK)
Add an individual child TestCase to this test suite.
Simulation virtual time values and global simulation resolution.
Hold an unsigned integer type.
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.
#define NS_TEST_ASSERT_MSG_GT_OR_EQ(actual, limit, msg)
Test that an actual value is greater than or equal to a limit and report and abort if not.
Time Seconds(double 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.
Ptr< PacketSink > sink
Pointer to the packet sink application.