|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
19 #include "ns3/core-module.h"
20 #include "ns3/network-module.h"
21 #include "ns3/internet-module.h"
22 #include "ns3/point-to-point-module.h"
23 #include "ns3/packet-sink-helper.h"
24 #include "ns3/packet-sink.h"
25 #include "ns3/random-variable-stream.h"
26 #include "ns3/on-off-helper.h"
27 #include "ns3/brite-module.h"
41 virtual void DoRun (
void);
46 :
TestCase (
"Test that two brite topologies created with same seed value produce same graph (not an exact test)")
57 std::string confFile =
"src/brite/test/test.conf";
59 SeedManager::SetRun (1);
60 SeedManager::SetSeed (1);
64 SeedManager::SetRun (1);
65 SeedManager::SetSeed (1);
74 int numAsA = bthA.
GetNAs ();
75 int numAsB = bthB.
GetNAs ();
83 for (
unsigned int i = 0; i < bthA.
GetNAs (); ++i)
96 virtual void DoRun (
void);
101 :
TestCase (
"Test that packets can be send across a BRITE topology using UDP")
112 std::string confFile =
"src/brite/test/test.conf";
119 address.SetBase (
"10.0.0.0",
"255.255.255.0");
128 stack.Install (source);
147 p2pSourceDevices = p2p.
Install (source);
150 address.SetBase (
"10.1.0.0",
"255.255.0.0");
152 sourceInterfaces =
address.Assign (p2pSourceDevices);
154 address.SetBase (
"10.2.0.0",
"255.255.0.0");
156 sinkInterfaces =
address.Assign (p2pSinkDevices);
178 Ipv4GlobalRoutingHelper::PopulateRoutingTables ();
180 Simulator::Stop (
Seconds (10.0));
186 Simulator::Destroy ();
holds a vector of ns3::NetDevice pointers
AttributeValue implementation for DataRate.
Ptr< Application > Get(uint32_t i) const
Get the Ptr<Application> stored in this container at a given index.
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
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.
BriteTopologyStructureTestCase()
void SetDeviceAttribute(std::string name, const AttributeValue &value)
Set an attribute value to be propagated to each NetDevice created by the helper.
void SetChannelAttribute(std::string name, const AttributeValue &value)
Set an attribute value to be propagated to each Channel created by the helper.
uint32_t GetNEdgesTopology() const
Returns the number of edges created within the topology.
NetDeviceContainer Install(NodeContainer c)
uint32_t GetNNodesTopology() const
Returns the number of nodes created within the topology.
Interface with BRITE, the Boston university Representative Internet Topology gEnerator.
void Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.
uint32_t GetNAs(void) const
Returns the number of AS created in the topology.
uint32_t GetNLeafNodesForAs(uint32_t asNum)
Returns the number of router leaf nodes for a given AS.
void Add(NodeContainer other)
Append the contents of another NodeContainer to the end of this container.
Class for representing data rates.
a polymophic address class
BriteTestSuite g_briteTestSuite
A helper to make it easier to instantiate an ns3::OnOffApplication on a set of nodes.
holds a vector of std::pair of Ptr<Ipv4> and interface index.
Ptr< Node > Get(uint32_t i) const
Get the Ptr<Node> 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.
Hold variables of type string.
A helper to make it easier to instantiate an ns3::PacketSinkApplication on a set of nodes.
virtual void DoRun(void)
Implementation to actually run this TestCase.
ApplicationContainer Install(NodeContainer c) const
Install an ns3::OnOffApplication on each node of the input container configured with all the attribut...
uint32_t GetNNodesForAs(uint32_t asNum)
Returns the total number of nodes for a given AS.
#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.
@ UNIT
This test suite implements a Unit Test.
void Start(Time start)
Arrange for all of the Applications in this container to Start() at the Time given as a parameter.
void AssignIpv4Addresses(Ipv4AddressHelper &address)
Time Seconds(double value)
Construct a Time in the indicated unit.
holds a vector of ns3::Application pointers.
BriteTopologyFunctionTestCase()
Build a set of PointToPointNetDevice objects.
keep track of a set of node pointers.
Ipv4Address GetAddress(uint32_t i, uint32_t j=0) const
void BuildBriteTopology(InternetStackHelper &stack)
Create NS3 topology using information generated from BRITE.
virtual ~BriteTopologyFunctionTestCase()
aggregate IP/TCP/UDP functionality to existing Nodes.
void AssignStreams(int64_t streamNumber)
Assigns stream number to UniformRandomVariable used to generate brite seed file.
ApplicationContainer Install(NodeContainer c) const
Install an ns3::PacketSinkApplication on each node of the input container configured with all the att...
virtual void DoRun(void)
Implementation to actually run this TestCase.
Ptr< Node > GetNodeForAs(uint32_t asNum, uint32_t nodeNum)
Returns a given router node for a given AS.
virtual ~BriteTopologyStructureTestCase()