A Discrete-Event Network Simulator
API
manet-routing-compare.cc
Go to the documentation of this file.
1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2011 University of Kansas
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Author: Justin Rohrer <rohrej@ittc.ku.edu>
19  *
20  * James P.G. Sterbenz <jpgs@ittc.ku.edu>, director
21  * ResiliNets Research Group http://wiki.ittc.ku.edu/resilinets
22  * Information and Telecommunication Technology Center (ITTC)
23  * and Department of Electrical Engineering and Computer Science
24  * The University of Kansas Lawrence, KS USA.
25  *
26  * Work supported in part by NSF FIND (Future Internet Design) Program
27  * under grant CNS-0626918 (Postmodern Internet Architecture),
28  * NSF grant CNS-1050226 (Multilayer Network Resilience Analysis and Experimentation on GENI),
29  * US Department of Defense (DoD), and ITTC at The University of Kansas.
30  */
31 
32 /*
33  * This example program allows one to run ns-3 DSDV, AODV, or OLSR under
34  * a typical random waypoint mobility model.
35  *
36  * By default, the simulation runs for 200 simulated seconds, of which
37  * the first 50 are used for start-up time. The number of nodes is 50.
38  * Nodes move according to RandomWaypointMobilityModel with a speed of
39  * 20 m/s and no pause time within a 300x1500 m region. The WiFi is
40  * in ad hoc mode with a 2 Mb/s rate (802.11b) and a Friis loss model.
41  * The transmit power is set to 7.5 dBm.
42  *
43  * It is possible to change the mobility and density of the network by
44  * directly modifying the speed and the number of nodes. It is also
45  * possible to change the characteristics of the network by changing
46  * the transmit power (as power increases, the impact of mobility
47  * decreases and the effective density increases).
48  *
49  * By default, OLSR is used, but specifying a value of 2 for the protocol
50  * will cause AODV to be used, and specifying a value of 3 will cause
51  * DSDV to be used.
52  *
53  * By default, there are 10 source/sink data pairs sending UDP data
54  * at an application rate of 2.048 Kb/s each. This is typically done
55  * at a rate of 4 64-byte packets per second. Application data is
56  * started at a random time between 50 and 51 seconds and continues
57  * to the end of the simulation.
58  *
59  * The program outputs a few items:
60  * - packet receptions are notified to stdout such as:
61  * <timestamp> <node-id> received one packet from <src-address>
62  * - each second, the data reception statistics are tabulated and output
63  * to a comma-separated value (csv) file
64  * - some tracing and flow monitor configuration that used to work is
65  * left commented inline in the program
66  */
67 
68 #include <fstream>
69 #include <iostream>
70 #include "ns3/core-module.h"
71 #include "ns3/network-module.h"
72 #include "ns3/internet-module.h"
73 #include "ns3/mobility-module.h"
74 #include "ns3/wifi-module.h"
75 #include "ns3/aodv-module.h"
76 #include "ns3/olsr-module.h"
77 #include "ns3/dsdv-module.h"
78 #include "ns3/dsr-module.h"
79 #include "ns3/applications-module.h"
80 
81 using namespace ns3;
82 using namespace dsr;
83 
84 NS_LOG_COMPONENT_DEFINE ("manet-routing-compare");
85 
87 {
88 public:
90  void Run (int nSinks, double txp, std::string CSVfileName);
91  //static void SetMACParam (ns3::NetDeviceContainer & devices,
92  // int slotDistance);
93  std::string CommandSetup (int argc, char **argv);
94 
95 private:
97  void ReceivePacket (Ptr<Socket> socket);
98  void CheckThroughput ();
99 
100  uint32_t port;
101  uint32_t bytesTotal;
102  uint32_t packetsReceived;
103 
104  std::string m_CSVfileName;
105  int m_nSinks;
106  std::string m_protocolName;
107  double m_txp;
109  uint32_t m_protocol;
110 };
111 
113  : port (9),
114  bytesTotal (0),
115  packetsReceived (0),
116  m_CSVfileName ("manet-routing.output.csv"),
117  m_traceMobility (false),
118  m_protocol (2) // AODV
119 {
120 }
121 
122 static inline std::string
124 {
125  SocketAddressTag tag;
126  bool found;
127  found = packet->PeekPacketTag (tag);
128  std::ostringstream oss;
129 
130  oss << Simulator::Now ().GetSeconds () << " " << socket->GetNode ()->GetId ();
131 
132  if (found)
133  {
134  InetSocketAddress addr = InetSocketAddress::ConvertFrom (tag.GetAddress ());
135  oss << " received one packet from " << addr.GetIpv4 ();
136  }
137  else
138  {
139  oss << " received one packet!";
140  }
141  return oss.str ();
142 }
143 
144 void
146 {
147  Ptr<Packet> packet;
148  while ((packet = socket->Recv ()))
149  {
150  bytesTotal += packet->GetSize ();
151  packetsReceived += 1;
152  NS_LOG_UNCOND (PrintReceivedPacket (socket, packet));
153  }
154 }
155 
156 void
158 {
159  double kbs = (bytesTotal * 8.0) / 1000;
160  bytesTotal = 0;
161 
162  std::ofstream out (m_CSVfileName.c_str (), std::ios::app);
163 
164  out << (Simulator::Now ()).GetSeconds () << ","
165  << kbs << ","
166  << packetsReceived << ","
167  << m_nSinks << ","
168  << m_protocolName << ","
169  << m_txp << ""
170  << std::endl;
171 
172  out.close ();
173  packetsReceived = 0;
174  Simulator::Schedule (Seconds (1.0), &RoutingExperiment::CheckThroughput, this);
175 }
176 
179 {
180  TypeId tid = TypeId::LookupByName ("ns3::UdpSocketFactory");
181  Ptr<Socket> sink = Socket::CreateSocket (node, tid);
182  InetSocketAddress local = InetSocketAddress (addr, port);
183  sink->Bind (local);
185 
186  return sink;
187 }
188 
189 std::string
190 RoutingExperiment::CommandSetup (int argc, char **argv)
191 {
193  cmd.AddValue ("CSVfileName", "The name of the CSV output file name", m_CSVfileName);
194  cmd.AddValue ("traceMobility", "Enable mobility tracing", m_traceMobility);
195  cmd.AddValue ("protocol", "1=OLSR;2=AODV;3=DSDV;4=DSR", m_protocol);
196  cmd.Parse (argc, argv);
197  return m_CSVfileName;
198 }
199 
200 int
201 main (int argc, char *argv[])
202 {
204  std::string CSVfileName = experiment.CommandSetup (argc,argv);
205 
206  //blank out the last output file and write the column headers
207  std::ofstream out (CSVfileName.c_str ());
208  out << "SimulationSecond," <<
209  "ReceiveRate," <<
210  "PacketsReceived," <<
211  "NumberOfSinks," <<
212  "RoutingProtocol," <<
213  "TransmissionPower" <<
214  std::endl;
215  out.close ();
216 
217  int nSinks = 10;
218  double txp = 7.5;
219 
220  experiment.Run (nSinks, txp, CSVfileName);
221 }
222 
223 void
224 RoutingExperiment::Run (int nSinks, double txp, std::string CSVfileName)
225 {
226  Packet::EnablePrinting ();
227  m_nSinks = nSinks;
228  m_txp = txp;
229  m_CSVfileName = CSVfileName;
230 
231  int nWifis = 50;
232 
233  double TotalTime = 200.0;
234  std::string rate ("2048bps");
235  std::string phyMode ("DsssRate11Mbps");
236  std::string tr_name ("manet-routing-compare");
237  int nodeSpeed = 20; //in m/s
238  int nodePause = 0; //in s
239  m_protocolName = "protocol";
240 
241  Config::SetDefault ("ns3::OnOffApplication::PacketSize",StringValue ("64"));
242  Config::SetDefault ("ns3::OnOffApplication::DataRate", StringValue (rate));
243 
244  //Set Non-unicastMode rate to unicast mode
245  Config::SetDefault ("ns3::WifiRemoteStationManager::NonUnicastMode",StringValue (phyMode));
246 
247  NodeContainer adhocNodes;
248  adhocNodes.Create (nWifis);
249 
250  // setting up wifi phy and channel using helpers
253 
254  YansWifiPhyHelper wifiPhy = YansWifiPhyHelper::Default ();
255  YansWifiChannelHelper wifiChannel;
256  wifiChannel.SetPropagationDelay ("ns3::ConstantSpeedPropagationDelayModel");
257  wifiChannel.AddPropagationLoss ("ns3::FriisPropagationLossModel");
258  wifiPhy.SetChannel (wifiChannel.Create ());
259 
260  // Add a mac and disable rate control
261  WifiMacHelper wifiMac;
262  wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager",
263  "DataMode",StringValue (phyMode),
264  "ControlMode",StringValue (phyMode));
265 
266  wifiPhy.Set ("TxPowerStart",DoubleValue (txp));
267  wifiPhy.Set ("TxPowerEnd", DoubleValue (txp));
268 
269  wifiMac.SetType ("ns3::AdhocWifiMac");
270  NetDeviceContainer adhocDevices = wifi.Install (wifiPhy, wifiMac, adhocNodes);
271 
272  MobilityHelper mobilityAdhoc;
273  int64_t streamIndex = 0; // used to get consistent mobility across scenarios
274 
275  ObjectFactory pos;
276  pos.SetTypeId ("ns3::RandomRectanglePositionAllocator");
277  pos.Set ("X", StringValue ("ns3::UniformRandomVariable[Min=0.0|Max=300.0]"));
278  pos.Set ("Y", StringValue ("ns3::UniformRandomVariable[Min=0.0|Max=1500.0]"));
279 
280  Ptr<PositionAllocator> taPositionAlloc = pos.Create ()->GetObject<PositionAllocator> ();
281  streamIndex += taPositionAlloc->AssignStreams (streamIndex);
282 
283  std::stringstream ssSpeed;
284  ssSpeed << "ns3::UniformRandomVariable[Min=0.0|Max=" << nodeSpeed << "]";
285  std::stringstream ssPause;
286  ssPause << "ns3::ConstantRandomVariable[Constant=" << nodePause << "]";
287  mobilityAdhoc.SetMobilityModel ("ns3::RandomWaypointMobilityModel",
288  "Speed", StringValue (ssSpeed.str ()),
289  "Pause", StringValue (ssPause.str ()),
290  "PositionAllocator", PointerValue (taPositionAlloc));
291  mobilityAdhoc.SetPositionAllocator (taPositionAlloc);
292  mobilityAdhoc.Install (adhocNodes);
293  streamIndex += mobilityAdhoc.AssignStreams (adhocNodes, streamIndex);
294 
295  AodvHelper aodv;
297  DsdvHelper dsdv;
298  DsrHelper dsr;
299  DsrMainHelper dsrMain;
301  InternetStackHelper internet;
302 
303  switch (m_protocol)
304  {
305  case 1:
306  list.Add (olsr, 100);
307  m_protocolName = "OLSR";
308  break;
309  case 2:
310  list.Add (aodv, 100);
311  m_protocolName = "AODV";
312  break;
313  case 3:
314  list.Add (dsdv, 100);
315  m_protocolName = "DSDV";
316  break;
317  case 4:
318  m_protocolName = "DSR";
319  break;
320  default:
321  NS_FATAL_ERROR ("No such protocol:" << m_protocol);
322  }
323 
324  if (m_protocol < 4)
325  {
326  internet.SetRoutingHelper (list);
327  internet.Install (adhocNodes);
328  }
329  else if (m_protocol == 4)
330  {
331  internet.Install (adhocNodes);
332  dsrMain.Install (dsr, adhocNodes);
333  }
334 
335  NS_LOG_INFO ("assigning ip address");
336 
337  Ipv4AddressHelper addressAdhoc;
338  addressAdhoc.SetBase ("10.1.1.0", "255.255.255.0");
339  Ipv4InterfaceContainer adhocInterfaces;
340  adhocInterfaces = addressAdhoc.Assign (adhocDevices);
341 
342  OnOffHelper onoff1 ("ns3::UdpSocketFactory",Address ());
343  onoff1.SetAttribute ("OnTime", StringValue ("ns3::ConstantRandomVariable[Constant=1.0]"));
344  onoff1.SetAttribute ("OffTime", StringValue ("ns3::ConstantRandomVariable[Constant=0.0]"));
345 
346  for (int i = 0; i < nSinks; i++)
347  {
348  Ptr<Socket> sink = SetupPacketReceive (adhocInterfaces.GetAddress (i), adhocNodes.Get (i));
349 
350  AddressValue remoteAddress (InetSocketAddress (adhocInterfaces.GetAddress (i), port));
351  onoff1.SetAttribute ("Remote", remoteAddress);
352 
353  Ptr<UniformRandomVariable> var = CreateObject<UniformRandomVariable> ();
354  ApplicationContainer temp = onoff1.Install (adhocNodes.Get (i + nSinks));
355  temp.Start (Seconds (var->GetValue (100.0,101.0)));
356  temp.Stop (Seconds (TotalTime));
357  }
358 
359  std::stringstream ss;
360  ss << nWifis;
361  std::string nodes = ss.str ();
362 
363  std::stringstream ss2;
364  ss2 << nodeSpeed;
365  std::string sNodeSpeed = ss2.str ();
366 
367  std::stringstream ss3;
368  ss3 << nodePause;
369  std::string sNodePause = ss3.str ();
370 
371  std::stringstream ss4;
372  ss4 << rate;
373  std::string sRate = ss4.str ();
374 
375  //NS_LOG_INFO ("Configure Tracing.");
376  //tr_name = tr_name + "_" + m_protocolName +"_" + nodes + "nodes_" + sNodeSpeed + "speed_" + sNodePause + "pause_" + sRate + "rate";
377 
378  //AsciiTraceHelper ascii;
379  //Ptr<OutputStreamWrapper> osw = ascii.CreateFileStream ( (tr_name + ".tr").c_str());
380  //wifiPhy.EnableAsciiAll (osw);
381  AsciiTraceHelper ascii;
382  MobilityHelper::EnableAsciiAll (ascii.CreateFileStream (tr_name + ".mob"));
383 
384  //Ptr<FlowMonitor> flowmon;
385  //FlowMonitorHelper flowmonHelper;
386  //flowmon = flowmonHelper.InstallAll ();
387 
388 
389  NS_LOG_INFO ("Run Simulation.");
390 
391  CheckThroughput ();
392 
393  Simulator::Stop (Seconds (TotalTime));
394  Simulator::Run ();
395 
396  //flowmon->SerializeToXmlFile ((tr_name + ".flowmon").c_str(), false, false);
397 
398  Simulator::Destroy ();
399 }
400 
void AddPropagationLoss(std::string name, std::string n0="", const AttributeValue &v0=EmptyAttributeValue(), std::string n1="", const AttributeValue &v1=EmptyAttributeValue(), std::string n2="", const AttributeValue &v2=EmptyAttributeValue(), std::string n3="", const AttributeValue &v3=EmptyAttributeValue(), std::string n4="", const AttributeValue &v4=EmptyAttributeValue(), std::string n5="", const AttributeValue &v5=EmptyAttributeValue(), std::string n6="", const AttributeValue &v6=EmptyAttributeValue(), std::string n7="", const AttributeValue &v7=EmptyAttributeValue())
Ptr< PacketSink > sink
Definition: wifi-tcp.cc:47
holds a vector of ns3::Application pointers.
void experiment(bool enableCtsRts)
Run single 10 seconds experiment with enabled or disabled RTS/CTS mechanism.
Manage ASCII trace files for device models.
Definition: trace-helper.h:155
an Inet address class
Ipv4Address GetIpv4(void) const
holds a vector of std::pair of Ptr and interface index.
Ptr< YansWifiChannel > Create(void) const
void SetRemoteStationManager(std::string type, std::string n0="", const AttributeValue &v0=EmptyAttributeValue(), std::string n1="", const AttributeValue &v1=EmptyAttributeValue(), std::string n2="", const AttributeValue &v2=EmptyAttributeValue(), std::string n3="", const AttributeValue &v3=EmptyAttributeValue(), std::string n4="", const AttributeValue &v4=EmptyAttributeValue(), std::string n5="", const AttributeValue &v5=EmptyAttributeValue(), std::string n6="", const AttributeValue &v6=EmptyAttributeValue(), std::string n7="", const AttributeValue &v7=EmptyAttributeValue())
Definition: wifi-helper.cc:71
Ptr< T > GetObject(void) const
Get a pointer to the requested aggregated Object.
Definition: object.h:455
Hold variables of type string.
Definition: string.h:41
Make it easy to create and manage PHY objects for the yans model.
std::string CommandSetup(int argc, char **argv)
Helper class that adds DSR routing to nodes.
void ReceivePacket(Ptr< Socket > socket)
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:201
void SetTypeId(TypeId tid)
Set the TypeId of the Objects to be created by this factory.
aggregate IP/TCP/UDP functionality to existing Nodes.
Helper class that adds OLSR routing to nodes.
Definition: olsr-helper.h:40
uint32_t GetSize(void) const
Returns the the size in bytes of the packet (including the zero-filled initial payload).
Definition: packet.h:786
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
Definition: log.h:244
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
Definition: fatal-error.h:145
void ReceivePacket(Ptr< Socket > socket)
Ptr< OutputStreamWrapper > CreateFileStream(std::string filename, std::ios::openmode filemode=std::ios::out)
Create and initialize an output stream object we'll use to write the traced bits. ...
int64_t AssignStreams(NodeContainer c, int64_t stream)
Assign a fixed random variable stream number to the random variables used by the mobility models (inc...
void Set(std::string name, const AttributeValue &v)
helps to create WifiNetDevice objects
Definition: wifi-helper.h:76
A helper to make it easier to instantiate an ns3::OnOffApplication on a set of nodes.
Definition: on-off-helper.h:42
tuple cmd
Definition: second.py:35
virtual NetDeviceContainer Install(const WifiPhyHelper &phy, const WifiMacHelper &mac, NodeContainer c) const
Definition: wifi-helper.cc:100
uint16_t port
Definition: dsdv-manet.cc:44
a polymophic address class
Definition: address.h:90
tuple nodes
Definition: first.py:25
void SetChannel(Ptr< YansWifiChannel > channel)
double GetSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
Definition: nstime.h:341
bool PeekPacketTag(Tag &tag) const
Search a matching tag and call Tag::Deserialize if it is found.
Definition: packet.cc:846
void Install(Ptr< Node > node) const
"Layout" a single node according to the current position allocator type.
static std::string PrintReceivedPacket(Ptr< Socket > socket, Ptr< Packet > packet)
Ptr< Object > Create(void) const
Create an Object instance of the configured TypeId.
holds a vector of ns3::NetDevice pointers
virtual void SetStandard(enum WifiPhyStandard standard)
Definition: wifi-helper.cc:94
This class implements a tag that carries an address of a packet across the socket interface...
Definition: socket.h:1005
Callback< R > MakeCallback(R(T::*memPtr)(void), OBJ objPtr)
Definition: callback.h:1480
void SetRecvCallback(Callback< void, Ptr< Socket > >)
Notify application when new data is available to be read.
Definition: socket.cc:128
void Start(Time start)
Arrange for all of the Applications in this container to Start() at the Time given as a parameter...
Parse command-line arguments.
Definition: command-line.h:201
#define list
Ptr< Socket > SetupPacketReceive(Ptr< Node > node)
Ptr< Socket > SetupPacketReceive(Ipv4Address addr, Ptr< Node > node)
virtual int Bind(const Address &address)=0
Allocate a local endpoint for this socket.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
keep track of a set of node pointers.
Hold objects of type Ptr.
Definition: pointer.h:36
virtual Ptr< Packet > Recv(uint32_t maxSize, uint32_t flags)=0
Read data from the socket.
DSSS PHY (Clause 15) and HR/DSSS PHY (Clause 18)
void SetMobilityModel(std::string type, std::string n1="", const AttributeValue &v1=EmptyAttributeValue(), std::string n2="", const AttributeValue &v2=EmptyAttributeValue(), std::string n3="", const AttributeValue &v3=EmptyAttributeValue(), std::string n4="", const AttributeValue &v4=EmptyAttributeValue(), std::string n5="", const AttributeValue &v5=EmptyAttributeValue(), std::string n6="", const AttributeValue &v6=EmptyAttributeValue(), std::string n7="", const AttributeValue &v7=EmptyAttributeValue(), std::string n8="", const AttributeValue &v8=EmptyAttributeValue(), std::string n9="", const AttributeValue &v9=EmptyAttributeValue())
double GetValue(double min, double max)
Get the next random value, as a double in the specified range .
void Install(std::string nodeName) const
Aggregate implementations of the ns3::Ipv4, ns3::Ipv6, ns3::Udp, and ns3::Tcp classes onto the provid...
#define NS_LOG_UNCOND(msg)
Output the requested message unconditionaly.
void Run(int nSinks, double txp, std::string CSVfileName)
void Set(std::string name, const AttributeValue &value)
Set an attribute to be set during construction.
manage and create wifi channel objects for the yans model.
create MAC layers for a ns3::WifiNetDevice.
Definition: olsr.py:1
void Add(const Ipv4RoutingHelper &routing, int16_t priority)
virtual void SetType(std::string type, std::string n0="", const AttributeValue &v0=EmptyAttributeValue(), std::string n1="", const AttributeValue &v1=EmptyAttributeValue(), std::string n2="", const AttributeValue &v2=EmptyAttributeValue(), std::string n3="", const AttributeValue &v3=EmptyAttributeValue(), std::string n4="", const AttributeValue &v4=EmptyAttributeValue(), std::string n5="", const AttributeValue &v5=EmptyAttributeValue(), std::string n6="", const AttributeValue &v6=EmptyAttributeValue(), std::string n7="", const AttributeValue &v7=EmptyAttributeValue(), std::string n8="", const AttributeValue &v8=EmptyAttributeValue(), std::string n9="", const AttributeValue &v9=EmptyAttributeValue(), std::string n10="", const AttributeValue &v10=EmptyAttributeValue())
Helper class used to assign positions and mobility models to nodes.
Instantiate subclasses of ns3::Object.
Ipv4 addresses are stored in host order in this class.
Definition: ipv4-address.h:40
AttributeValue implementation for Address.
Definition: address.h:278
Ipv4InterfaceContainer Assign(const NetDeviceContainer &c)
Assign IP addresses to the net devices specified in the container based on the current network prefix...
uint32_t GetId(void) const
Definition: node.cc:107
virtual Ptr< Node > GetNode(void) const =0
Return the node this socket is associated with.
void AddValue(const std::string &name, const std::string &help, T &value)
Add a program argument, assigning to POD.
Definition: command-line.h:491
Address GetAddress(void) const
Get the tag's address.
Definition: socket.cc:562
Ptr< Node > Get(uint32_t i) const
Get the Ptr stored in this container at a given index.
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition: nstime.h:895
void SetDefault(std::string name, const AttributeValue &value)
Definition: config.cc:774
Helper class that adds ns3::Ipv4ListRouting objects.
void Parse(int argc, char *argv[])
Parse the program arguments.
A helper class to make life easier while doing simple IPv4 address assignment in scripts.
Time Now(void)
create an ns3::Time instance which contains the current simulation time.
Definition: simulator.cc:330
tuple wifi
Definition: third.py:89
void Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.
Helper class that adds AODV routing to nodes.
Definition: aodv-helper.h:35
void SetPropagationDelay(std::string name, std::string n0="", const AttributeValue &v0=EmptyAttributeValue(), std::string n1="", const AttributeValue &v1=EmptyAttributeValue(), std::string n2="", const AttributeValue &v2=EmptyAttributeValue(), std::string n3="", const AttributeValue &v3=EmptyAttributeValue(), std::string n4="", const AttributeValue &v4=EmptyAttributeValue(), std::string n5="", const AttributeValue &v5=EmptyAttributeValue(), std::string n6="", const AttributeValue &v6=EmptyAttributeValue(), std::string n7="", const AttributeValue &v7=EmptyAttributeValue())
void SetPositionAllocator(Ptr< PositionAllocator > allocator)
Set the position allocator which will be used to allocate the initial position of every node initiali...
This class can be used to hold variables of floating point type such as 'double' or 'float'...
Definition: double.h:41
Helper class that adds DSDV routing to nodes.
Definition: dsdv-helper.h:45
void Install(DsrHelper &dsrHelper, NodeContainer nodes)
ApplicationContainer Install(NodeContainer c) const
Install an ns3::OnOffApplication on each node of the input container configured with all the attribut...
a unique identifier for an interface.
Definition: type-id.h:58
void SetRoutingHelper(const Ipv4RoutingHelper &routing)
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.
Ipv4Address GetAddress(uint32_t i, uint32_t j=0) const
Allocate a set of positions.
virtual int64_t AssignStreams(int64_t stream)=0
Assign a fixed random variable stream number to the random variables used by this model...