6#include "ns3/brite-module.h"
7#include "ns3/core-module.h"
8#include "ns3/internet-module.h"
9#include "ns3/network-module.h"
10#include "ns3/on-off-helper.h"
11#include "ns3/packet-sink-helper.h"
12#include "ns3/packet-sink.h"
13#include "ns3/point-to-point-module.h"
14#include "ns3/random-variable-stream.h"
38 void DoRun()
override;
42 :
TestCase(
"Test that two brite topologies created with same seed value produce same graph "
43 "(not an exact test)")
54 std::string confFile =
"src/brite/test/test.conf";
59 bthA.AssignStreams(1);
64 bthB.AssignStreams(1);
68 bthA.BuildBriteTopology(stack);
69 bthB.BuildBriteTopology(stack);
78 bthB.GetNNodesTopology(),
79 "Total number of nodes for each topology should be equal");
81 bthB.GetNEdgesTopology(),
82 "Total number of edges for each topology should be equal");
84 for (
unsigned int i = 0;
i <
bthA.GetNAs(); ++
i)
87 bthB.GetNLeafNodesForAs(
i),
88 "Total number of leaf nodes different for AS " <<
i);
106 void DoRun()
override;
110 :
TestCase(
"Test that packets can be send across a BRITE topology using UDP")
121 std::string confFile =
"src/brite/test/test.conf";
128 address.SetBase(
"10.0.0.0",
"255.255.255.0");
130 bth.BuildBriteTopology(stack);
131 bth.AssignIpv4Addresses(address);
150 p2p.SetDeviceAttribute(
"DataRate",
StringValue(
"5Mbps"));
151 p2p.SetChannelAttribute(
"Delay",
StringValue(
"2ms"));
159 address.SetBase(
"10.1.0.0",
"255.255.0.0");
163 address.SetBase(
"10.2.0.0",
"255.255.0.0");
171 onOff.SetAttribute(
"OnTime",
StringValue(
"ns3::ConstantRandomVariable[Constant=1]"));
172 onOff.SetAttribute(
"OffTime",
StringValue(
"ns3::ConstantRandomVariable[Constant=0]"));
static BriteTestSuite g_briteTestSuite
Static variable for test initialization.
BRITE topology function Test.
void DoRun() override
Implementation to actually run this TestCase.
~BriteTopologyFunctionTestCase() override
BriteTopologyFunctionTestCase()
BRITE topology structure Test.
void DoRun() override
Implementation to actually run this TestCase.
BriteTopologyStructureTestCase()
~BriteTopologyStructureTestCase() override
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.
Interface with BRITE, the Boston university Representative Internet Topology gEnerator.
Class for representing data rates.
AttributeValue implementation for DataRate.
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()
static void PopulateRoutingTables()
Build a routing database and initialize the routing tables of the nodes in the simulation.
holds a vector of std::pair of Ptr<Ipv4> and interface index.
holds a vector of ns3::NetDevice pointers
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.
A helper to make it easier to instantiate an ns3::OnOffApplication on a set of nodes.
A helper to make it easier to instantiate an ns3::PacketSinkApplication on a set of nodes.
Build a set of PointToPointNetDevice objects.
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 void Run()
Run the simulation.
static void Stop()
Tell the Simulator the calling event should be the last one executed.
Hold variables of type string.
void AddTestCase(TestCase *testCase, Duration duration=Duration::QUICK)
Add an individual child TestCase to this test suite.
static constexpr auto UNIT
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.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Ptr< PacketSink > sink
Pointer to the packet sink application.