21 #include "ns3/nstime.h" 23 #include "ns3/traced-callback.h" 24 #include "ns3/node-container.h" 25 #include "ns3/application-container.h" 26 #include "ns3/simple-net-device-helper.h" 27 #include "ns3/string.h" 28 #include "ns3/uinteger.h" 29 #include "ns3/boolean.h" 30 #include "ns3/internet-stack-helper.h" 31 #include "ns3/ipv4-address.h" 32 #include "ns3/inet-socket-address.h" 33 #include "ns3/ipv4-address-helper.h" 34 #include "ns3/ipv4-interface-container.h" 35 #include "ns3/bulk-send-application.h" 36 #include "ns3/bulk-send-helper.h" 37 #include "ns3/packet-sink.h" 38 #include "ns3/packet-sink-helper.h" 49 virtual void DoRun (
void);
53 uint64_t m_received {0};
57 :
TestCase (
"Check a basic 300KB transfer")
81 Ptr<Node> receiver = CreateObject<Node> ();
93 ipv4.
SetBase (
"10.1.1.0",
"255.255.255.0");
115 Simulator::Destroy ();
131 virtual void DoRun (
void);
143 :
TestCase (
"Check a 300KB transfer with SeqTsSize header enabled")
176 Ptr<Node> sender = CreateObject<Node> ();
177 Ptr<Node> receiver = CreateObject<Node> ();
180 nodes.Add (receiver);
189 ipv4.
SetBase (
"10.1.1.0",
"255.255.255.0");
213 Simulator::Destroy ();
226 :
TestSuite (
"bulk-send-application", UNIT)
holds a vector of ns3::Application pointers.
Simulation virtual time values and global simulation resolution.
virtual void DoRun(void)
Implementation to actually run this TestCase.
virtual ~BulkSendSeqTsSizeTestCase()
AttributeValue implementation for Boolean.
A helper to make it easier to instantiate an ns3::BulkSendApplication on a set of nodes...
holds a vector of std::pair of Ptr<Ipv4> and interface index.
virtual void DoRun(void)
Implementation to actually run this TestCase.
uint32_t GetSize(void) const
Returns the the size in bytes of the packet (including the zero-filled initial payload).
Hold variables of type string.
void ReceiveRx(Ptr< const Packet > p, const Address &from, const Address &to, const SeqTsSizeHeader &header)
BulkSendSeqTsSizeTestCase()
void SetChannelAttribute(std::string n1, const AttributeValue &v1)
ApplicationContainer Install(NodeContainer c) const
Install an ns3::PacketSinkApplication on each node of the input container configured with all the att...
aggregate IP/TCP/UDP functionality to existing Nodes.
ApplicationContainer Install(NodeContainer c) const
Install an ns3::BulkSendApplication on each node of the input container configured with all the attri...
A helper to make it easier to instantiate an ns3::PacketSinkApplication on a set of nodes...
a polymophic address class
void SendTx(Ptr< const Packet > p, const Address &from, const Address &to, const SeqTsSizeHeader &header)
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
Ipv4Address GetAddress(uint32_t i, uint32_t j=0) const
Hold an unsigned integer type.
#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.
virtual ~BulkSendBasicTestCase()
holds a vector of ns3::NetDevice pointers
void SetDeviceAttribute(std::string n1, const AttributeValue &v1)
void Start(Time start)
Arrange for all of the Applications in this container to Start() at the Time given as a parameter...
void SendTx(Ptr< const Packet > p)
bool TraceConnectWithoutContext(std::string name, const CallbackBase &cb)
Connect a TraceSource to a Callback without a context.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
keep track of a set of node pointers.
void ReceiveRx(Ptr< const Packet > p, const Address &addr)
void Install(std::string nodeName) const
Aggregate implementations of the ns3::Ipv4, ns3::Ipv6, ns3::Udp, and ns3::Tcp classes onto the provid...
void Stop(Time stop)
Arrange for all of the Applications in this container to Stop() at the Time given as a parameter...
Ipv4InterfaceContainer Assign(const NetDeviceContainer &c)
Assign IP addresses to the net devices specified in the container based on the current network prefix...
Time Seconds(double value)
Construct a Time in the indicated unit.
static BulkSendTestSuite g_bulkSendTestSuite
A helper class to make life easier while doing simple IPv4 address assignment in scripts.
void SetAttribute(std::string name, const AttributeValue &value)
Helper function used to set the underlying application attributes, not the socket attributes...
build a set of SimpleNetDevice objects
NetDeviceContainer Install(Ptr< Node > node) const
This method creates an ns3::SimpleChannel with the attributes configured by SimpleNetDeviceHelper::Se...
#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...
Callback< R, Ts... > MakeCallback(R(T::*memPtr)(Ts...), OBJ objPtr)
Build Callbacks for class method members which take varying numbers of arguments and potentially retu...
Ptr< Application > Get(uint32_t i) const
Get the Ptr<Application> stored in this container at a given index.
void SetAttribute(std::string name, const AttributeValue &value)
Helper function used to set the underlying application attributes.
void SetBase(Ipv4Address network, Ipv4Mask mask, Ipv4Address base="0.0.0.1")
Set the base network number, network mask and base address.