|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
24 #include "ns3/abort.h"
25 #include "ns3/config.h"
26 #include "ns3/string.h"
27 #include "ns3/uinteger.h"
28 #include "ns3/inet-socket-address.h"
29 #include "ns3/internet-stack-helper.h"
30 #include "ns3/ipv4-address-helper.h"
31 #include "ns3/udp-client-server-helper.h"
32 #include "ns3/udp-echo-helper.h"
33 #include "ns3/simple-net-device.h"
34 #include "ns3/simple-channel.h"
36 #include "ns3/simulator.h"
59 virtual void DoRun (
void);
64 :
TestCase (
"Test that all the udp packets generated by an udpClient application are correctly received by an udpServer application")
83 n.Get (0)->AddDevice (txDev);
84 n.Get (1)->AddDevice (rxDev);
94 ipv4.
SetBase (
"10.1.1.0",
"255.255.255.0");
103 uint32_t MaxPacketSize = 1024;
105 uint32_t maxPacketCount = 10;
115 Simulator::Destroy ();
133 virtual void DoRun (
void);
138 :
TestCase (
"Test that all the udp packets generated by an udpTraceClient application are correctly received by an udpServer application")
157 n.Get (0)->AddDevice (txDev);
158 n.Get (1)->AddDevice (rxDev);
167 ipv4.
SetBase (
"10.1.1.0",
"255.255.255.0");
170 uint16_t
port = 4000;
176 uint32_t MaxPacketSize = 1400 - 28;
184 Simulator::Destroy ();
202 virtual void DoRun (
void);
207 :
TestCase (
"Test that all the PacketLossCounter class checks loss correctly in different cases")
219 for (uint32_t i = 0; i < 64; i++)
226 for (uint32_t i = 65; i < 128; i++)
232 for (uint32_t i = 134; i < 200; i++)
247 for (uint32_t i = 205; i < 250; i++)
259 for (uint32_t i = 256; i < 300; i++)
277 virtual void DoRun (
void);
282 :
TestCase (
"Test that the UdpEchoClient::SetFill class sets packet size (bug 1378)")
300 nodes.Get (0)->AddDevice (txDev);
301 nodes.Get (1)->AddDevice (rxDev);
311 ipv4.
SetBase (
"10.1.1.0",
"255.255.255.0");
314 uint16_t
port = 5000;
328 for (i = 0; i < 64; i++)
338 Simulator::Destroy ();
holds a vector of ns3::NetDevice pointers
void SetAttribute(std::string name, const AttributeValue &value)
Record an attribute to be set in each Application after it is is created.
Ptr< UdpServer > GetServer(void)
Return the last created server.
Create a client application which sends UDP packets carrying a 32bit sequence number and a 64 bit tim...
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
virtual void DoRun(void)
Implementation to actually run this TestCase.
virtual void DoRun(void)
Implementation to actually run this TestCase.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void Stop(Time stop)
Arrange for all of the Applications in this container to Stop() at the Time given as a parameter.
A helper class to make life easier while doing simple IPv4 address assignment in scripts.
UdpTraceClientServerTestCase()
Create an application which sends a UDP packet and waits for an echo of this packet.
virtual ~UdpEchoClientSetFillTestCase()
void SetChannel(Ptr< SimpleChannel > channel)
Attach a channel to this net device.
Create UdpTraceClient application which sends UDP packets based on a trace file of an MPEG4 stream.
Test that all the PacketLossCounter class checks loss correctly in different cases.
PacketLossCounterTestCase()
Create a server application which waits for input UDP packets and uses the information carried into t...
void NotifyReceived(uint32_t seq)
Record a successfully received packet.
void SetBase(Ipv4Address network, Ipv4Mask mask, Ipv4Address base="0.0.0.1")
Set the base network number, network mask and base address.
Smart pointer class similar to boost::intrusive_ptr.
ApplicationContainer Install(NodeContainer c)
UdpEchoClientSetFillTestCase()
void Install(std::string nodeName) const
Aggregate implementations of the ns3::Ipv4, ns3::Ipv6, ns3::Udp, and ns3::Tcp classes onto the provid...
holds a vector of std::pair of Ptr<Ipv4> and interface index.
Test that all the UDP packets generated by an UdpClient application are correctly received by an UdpS...
Simulation virtual time values and global simulation resolution.
virtual ~UdpTraceClientServerTestCase()
void SetAttribute(std::string name, const AttributeValue &value)
Record an attribute to be set in each Application after it is is created.
Test that all the udp packets generated by an udpTraceClient application are correctly received by an...
UdpClientServerTestCase()
virtual ~UdpClientServerTestCase()
#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.
UdpClientServerTestSuite()
static UdpClientServerTestSuite udpClientServerTestSuite
Static variable for test initialization.
void Start(Time start)
Arrange for all of the Applications in this container to Start() at the Time given as a parameter.
Time Seconds(double value)
Construct a Time in the indicated unit.
Ipv4InterfaceContainer Assign(const NetDeviceContainer &c)
Assign IP addresses to the net devices specified in the container based on the current network prefix...
holds a vector of ns3::Application pointers.
ApplicationContainer Install(NodeContainer c)
AttributeValue implementation for Time.
ApplicationContainer Install(NodeContainer c)
Create one UDP server application on each of the Nodes in the NodeContainer.
virtual void DoRun(void)
Implementation to actually run this TestCase.
keep track of a set of node pointers.
A class to count the number of lost packets.
Ipv4Address GetAddress(uint32_t i, uint32_t j=0) const
Hold an unsigned integer type.
Create a server application which waits for input UDP packets and sends them back to the original sen...
uint32_t GetLost(void) const
Get the number of lost packets.
aggregate IP/TCP/UDP functionality to existing Nodes.
void Add(NetDeviceContainer other)
Append the contents of another NetDeviceContainer to the end of this container.
virtual void DoRun(void)
Implementation to actually run this TestCase.
UDP client and server TestSuite.
virtual ~PacketLossCounterTestCase()