A Discrete-Event Network Simulator
API
queue-discs-benchmark.cc
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2015 Universita' degli Studi di Napoli Federico II
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  * Authors: Pasquale Imputato <p.imputato@gmail.com>
19  * Stefano Avallone <stefano.avallone@unina.it>
20  */
21 
22 // This example serves as a benchmark for all the queue discs (with BQL enabled or not)
23 //
24 // Network topology
25 //
26 // 192.168.1.0 192.168.2.0
27 // n1 ------------------------------------ n2 ----------------------------------- n3
28 // point-to-point (access link) point-to-point (bottleneck link)
29 // 100 Mbps, 0.1 ms bandwidth [10 Mbps], delay [5 ms]
30 // qdiscs PfifoFast with capacity qdiscs queueDiscType in {PfifoFast, ARED, CoDel, FqCoDel, PIE} [PfifoFast]
31 // of 1000 packets with capacity of queueDiscSize packets [1000]
32 // netdevices queues with size of 100 packets netdevices queues with size of netdevicesQueueSize packets [100]
33 // without BQL bql BQL [false]
34 // *** fixed configuration ***
35 //
36 // Two TCP flows are generated: one from n1 to n3 and the other from n3 to n1.
37 // Additionally, n1 pings n3, so that the RTT can be measured.
38 //
39 // The output will consist of a number of ping Rtt such as:
40 //
41 // /NodeList/0/ApplicationList/2/$ns3::V4Ping/Rtt=111 ms
42 // /NodeList/0/ApplicationList/2/$ns3::V4Ping/Rtt=111 ms
43 // /NodeList/0/ApplicationList/2/$ns3::V4Ping/Rtt=110 ms
44 // /NodeList/0/ApplicationList/2/$ns3::V4Ping/Rtt=111 ms
45 // /NodeList/0/ApplicationList/2/$ns3::V4Ping/Rtt=111 ms
46 // /NodeList/0/ApplicationList/2/$ns3::V4Ping/Rtt=112 ms
47 // /NodeList/0/ApplicationList/2/$ns3::V4Ping/Rtt=111 ms
48 //
49 // The files output will consist of a trace file with bytes in queue and of a trace file for limits
50 // (when BQL is enabled) both for bottleneck NetDevice on n2, two files with upload and download
51 // goodput for flows configuration and a file with flow monitor stats.
52 //
53 // If you use an AQM as queue disc on the bottleneck netdevices, you can observe that the ping Rtt
54 // decrease. A further decrease can be observed when you enable BQL.
55 
56 #include "ns3/core-module.h"
57 #include "ns3/network-module.h"
58 #include "ns3/internet-module.h"
59 #include "ns3/point-to-point-module.h"
60 #include "ns3/applications-module.h"
61 #include "ns3/internet-apps-module.h"
62 #include "ns3/traffic-control-module.h"
63 #include "ns3/flow-monitor-module.h"
64 
65 using namespace ns3;
66 
67 NS_LOG_COMPONENT_DEFINE ("BenchmarkQueueDiscs");
68 
69 void
70 LimitsTrace (Ptr<OutputStreamWrapper> stream, uint32_t oldVal, uint32_t newVal)
71 {
72  *stream->GetStream () << Simulator::Now ().GetSeconds () << " " << newVal << std::endl;
73 }
74 
75 void
76 BytesInQueueTrace (Ptr<OutputStreamWrapper> stream, uint32_t oldVal, uint32_t newVal)
77 {
78  *stream->GetStream () << Simulator::Now ().GetSeconds () << " " << newVal << std::endl;
79 }
80 
81 static void
82 GoodputSampling (std::string fileName, ApplicationContainer app, Ptr<OutputStreamWrapper> stream, float period)
83 {
84  Simulator::Schedule (Seconds (period), &GoodputSampling, fileName, app, stream, period);
85  double goodput;
86  uint32_t totalPackets = DynamicCast<PacketSink> (app.Get (0))->GetTotalRx ();
87  goodput = totalPackets * 8 / (Simulator::Now ().GetSeconds () * 1024); // Kbit/s
88  *stream->GetStream () << Simulator::Now ().GetSeconds () << " " << goodput << std::endl;
89 }
90 
91 static void PingRtt (std::string context, Time rtt)
92 {
93  std::cout << context << "=" << rtt.GetMilliSeconds () << " ms" << std::endl;
94 }
95 
96 int main (int argc, char *argv[])
97 {
98  std::string bandwidth = "10Mbps";
99  std::string delay = "5ms";
100  std::string queueDiscType = "PfifoFast";
101  uint32_t queueDiscSize = 1000;
102  uint32_t netdevicesQueueSize = 100;
103  bool bql = false;
104 
105  std::string flowsDatarate = "20Mbps";
106  uint32_t flowsPacketsSize = 1000;
107 
108  float startTime = 0.1; // in s
109  float simDuration = 60;
110  float samplingPeriod = 1;
111 
113  cmd.AddValue ("bandwidth", "Bottleneck bandwidth", bandwidth);
114  cmd.AddValue ("delay", "Bottleneck delay", delay);
115  cmd.AddValue ("queueDiscType", "Bottleneck queue disc type in {PfifoFast, ARED, CoDel, FqCoDel, PIE}", queueDiscType);
116  cmd.AddValue ("queueDiscSize", "Bottleneck queue disc size in packets", queueDiscSize);
117  cmd.AddValue ("netdevicesQueueSize", "Bottleneck netdevices queue size in packets", netdevicesQueueSize);
118  cmd.AddValue ("bql", "Enable byte queue limits on bottleneck netdevices", bql);
119  cmd.AddValue ("flowsDatarate", "Upload and download flows datarate", flowsDatarate);
120  cmd.AddValue ("flowsPacketsSize", "Upload and download flows packets sizes", flowsPacketsSize);
121  cmd.AddValue ("startTime", "Simulation start time", startTime);
122  cmd.AddValue ("simDuration", "Simulation duration in seconds", simDuration);
123  cmd.AddValue ("samplingPeriod", "Goodput sampling period in seconds", samplingPeriod);
124  cmd.Parse (argc, argv);
125 
126  float stopTime = startTime + simDuration;
127 
128  // Create nodes
129  NodeContainer n1, n2, n3;
130  n1.Create (1);
131  n2.Create (1);
132  n3.Create (1);
133 
134  // Create and configure access link and bottleneck link
135  PointToPointHelper accessLink;
136  accessLink.SetDeviceAttribute ("DataRate", StringValue ("100Mbps"));
137  accessLink.SetChannelAttribute ("Delay", StringValue ("0.1ms"));
138 
139  PointToPointHelper bottleneckLink;
140  bottleneckLink.SetDeviceAttribute ("DataRate", StringValue (bandwidth));
141  bottleneckLink.SetChannelAttribute ("Delay", StringValue (delay));
142 
144  stack.InstallAll ();
145 
146  // Access link traffic control configuration
147  TrafficControlHelper tchPfifoFastAccess;
148  tchPfifoFastAccess.SetRootQueueDisc ("ns3::PfifoFastQueueDisc", "Limit", UintegerValue (1000));
149 
150  // Bottleneck link traffic control configuration
151  TrafficControlHelper tchBottleneck;
152 
153  if (queueDiscType.compare ("PfifoFast") == 0)
154  {
155  tchBottleneck.SetRootQueueDisc ("ns3::PfifoFastQueueDisc", "Limit", UintegerValue (queueDiscSize));
156  }
157  else if (queueDiscType.compare ("ARED") == 0)
158  {
159  tchBottleneck.SetRootQueueDisc ("ns3::RedQueueDisc");
160  Config::SetDefault ("ns3::RedQueueDisc::ARED", BooleanValue (true));
162  Config::SetDefault ("ns3::RedQueueDisc::QueueLimit", UintegerValue (queueDiscSize));
163  }
164  else if (queueDiscType.compare ("CoDel") == 0)
165  {
166  tchBottleneck.SetRootQueueDisc ("ns3::CoDelQueueDisc");
168  Config::SetDefault ("ns3::CoDelQueueDisc::MaxPackets", UintegerValue (queueDiscSize));
169  }
170  else if (queueDiscType.compare ("FqCoDel") == 0)
171  {
172  uint32_t handle = tchBottleneck.SetRootQueueDisc ("ns3::FqCoDelQueueDisc");
173  Config::SetDefault ("ns3::FqCoDelQueueDisc::PacketLimit", UintegerValue (queueDiscSize));
174  tchBottleneck.AddPacketFilter (handle, "ns3::FqCoDelIpv4PacketFilter");
175  tchBottleneck.AddPacketFilter (handle, "ns3::FqCoDelIpv6PacketFilter");
176  }
177  else if (queueDiscType.compare ("PIE") == 0)
178  {
179  tchBottleneck.SetRootQueueDisc ("ns3::PieQueueDisc");
181  Config::SetDefault ("ns3::PieQueueDisc::QueueLimit", UintegerValue (queueDiscSize));
182  }
183  else
184  {
185  NS_ABORT_MSG ("--queueDiscType not valid");
186  }
187 
188  if (bql)
189  {
190  tchBottleneck.SetQueueLimits ("ns3::DynamicQueueLimits");
191  }
192 
193  Config::SetDefault ("ns3::QueueBase::Mode", StringValue ("QUEUE_MODE_PACKETS"));
194  Config::SetDefault ("ns3::QueueBase::MaxPackets", UintegerValue (100));
195 
196  NetDeviceContainer devicesAccessLink = accessLink.Install (n1.Get (0), n2.Get (0));
197  tchPfifoFastAccess.Install (devicesAccessLink);
199  address.SetBase ("192.168.0.0", "255.255.255.0");
200  address.NewNetwork ();
201  Ipv4InterfaceContainer interfacesAccess = address.Assign (devicesAccessLink);
202 
203  Config::SetDefault ("ns3::QueueBase::MaxPackets", UintegerValue (netdevicesQueueSize));
204 
205  NetDeviceContainer devicesBottleneckLink = bottleneckLink.Install (n2.Get (0), n3.Get (0));
206  QueueDiscContainer qdiscs;
207  qdiscs = tchBottleneck.Install (devicesBottleneckLink);
208 
209  address.NewNetwork ();
210  Ipv4InterfaceContainer interfacesBottleneck = address.Assign (devicesBottleneckLink);
211 
212  Ptr<NetDeviceQueueInterface> interface = devicesBottleneckLink.Get (0)->GetObject<NetDeviceQueueInterface> ();
213  Ptr<NetDeviceQueue> queueInterface = interface->GetTxQueue (0);
214  Ptr<DynamicQueueLimits> queueLimits = StaticCast<DynamicQueueLimits> (queueInterface->GetQueueLimits ());
215 
216  AsciiTraceHelper ascii;
217  if (bql)
218  {
219  queueDiscType = queueDiscType + "-bql";
220  Ptr<OutputStreamWrapper> streamLimits = ascii.CreateFileStream (queueDiscType + "-limits.txt");
221  queueLimits->TraceConnectWithoutContext ("Limit",MakeBoundCallback (&LimitsTrace, streamLimits));
222  }
223  Ptr<Queue<Packet> > queue = StaticCast<PointToPointNetDevice> (devicesBottleneckLink.Get (0))->GetQueue ();
224  Ptr<OutputStreamWrapper> streamBytesInQueue = ascii.CreateFileStream (queueDiscType + "-bytesInQueue.txt");
225  queue->TraceConnectWithoutContext ("BytesInQueue",MakeBoundCallback (&BytesInQueueTrace, streamBytesInQueue));
226 
227  Ipv4InterfaceContainer n1Interface;
228  n1Interface.Add (interfacesAccess.Get (0));
229 
230  Ipv4InterfaceContainer n3Interface;
231  n3Interface.Add (interfacesBottleneck.Get (1));
232 
234 
235  Config::SetDefault ("ns3::TcpSocket::SegmentSize", UintegerValue (flowsPacketsSize));
236 
237  // Flows configuration
238  // Bidirectional TCP streams with ping like flent tcp_bidirectional test.
239  uint16_t port = 7;
240  ApplicationContainer uploadApp, downloadApp, sourceApps;
241  // Configure and install upload flow
242  Address addUp (InetSocketAddress (Ipv4Address::GetAny (), port));
243  PacketSinkHelper sinkHelperUp ("ns3::TcpSocketFactory", addUp);
244  sinkHelperUp.SetAttribute ("Protocol", TypeIdValue (TcpSocketFactory::GetTypeId ()));
245  uploadApp.Add (sinkHelperUp.Install (n3));
246 
247  InetSocketAddress socketAddressUp = InetSocketAddress (n3Interface.GetAddress (0), port);
248  OnOffHelper onOffHelperUp ("ns3::TcpSocketFactory", Address ());
249  onOffHelperUp.SetAttribute ("Remote", AddressValue (socketAddressUp));
250  onOffHelperUp.SetAttribute ("OnTime", StringValue ("ns3::ConstantRandomVariable[Constant=1]"));
251  onOffHelperUp.SetAttribute ("OffTime", StringValue ("ns3::ConstantRandomVariable[Constant=0]"));
252  onOffHelperUp.SetAttribute ("PacketSize", UintegerValue (flowsPacketsSize));
253  onOffHelperUp.SetAttribute ("DataRate", StringValue (flowsDatarate));
254  sourceApps.Add (onOffHelperUp.Install (n1));
255 
256  port = 8;
257  // Configure and install download flow
258  Address addDown (InetSocketAddress (Ipv4Address::GetAny (), port));
259  PacketSinkHelper sinkHelperDown ("ns3::TcpSocketFactory", addDown);
260  sinkHelperDown.SetAttribute ("Protocol", TypeIdValue (TcpSocketFactory::GetTypeId ()));
261  downloadApp.Add (sinkHelperDown.Install (n1));
262 
263  InetSocketAddress socketAddressDown = InetSocketAddress (n1Interface.GetAddress (0), port);
264  OnOffHelper onOffHelperDown ("ns3::TcpSocketFactory", Address ());
265  onOffHelperDown.SetAttribute ("Remote", AddressValue (socketAddressDown));
266  onOffHelperDown.SetAttribute ("OnTime", StringValue ("ns3::ConstantRandomVariable[Constant=1]"));
267  onOffHelperDown.SetAttribute ("OffTime", StringValue ("ns3::ConstantRandomVariable[Constant=0]"));
268  onOffHelperDown.SetAttribute ("PacketSize", UintegerValue (flowsPacketsSize));
269  onOffHelperDown.SetAttribute ("DataRate", StringValue (flowsDatarate));
270  sourceApps.Add (onOffHelperDown.Install (n3));
271 
272  // Configure and install ping
273  V4PingHelper ping = V4PingHelper (n3Interface.GetAddress (0));
274  ping.Install (n1);
275 
276  Config::Connect ("/NodeList/*/ApplicationList/*/$ns3::V4Ping/Rtt", MakeCallback (&PingRtt));
277 
278  uploadApp.Start (Seconds (0));
279  uploadApp.Stop (Seconds (stopTime));
280  downloadApp.Start (Seconds (0));
281  downloadApp.Stop (Seconds (stopTime));
282 
283  sourceApps.Start (Seconds (0 + 0.1));
284  sourceApps.Stop (Seconds (stopTime - 0.1));
285 
286  Ptr<OutputStreamWrapper> uploadGoodputStream = ascii.CreateFileStream (queueDiscType + "-upGoodput.txt");
287  Simulator::Schedule (Seconds (samplingPeriod), &GoodputSampling, queueDiscType + "-upGoodput.txt", uploadApp,
288  uploadGoodputStream, samplingPeriod);
289  Ptr<OutputStreamWrapper> downloadGoodputStream = ascii.CreateFileStream (queueDiscType + "-downGoodput.txt");
290  Simulator::Schedule (Seconds (samplingPeriod), &GoodputSampling, queueDiscType + "-downGoodput.txt", downloadApp,
291  downloadGoodputStream, samplingPeriod);
292 
293  // Flow monitor
294  Ptr<FlowMonitor> flowMonitor;
295  FlowMonitorHelper flowHelper;
296  flowMonitor = flowHelper.InstallAll();
297 
298  Simulator::Stop (Seconds (stopTime));
299  Simulator::Run ();
300 
301  flowMonitor->SerializeToXmlFile(queueDiscType + "-flowMonitor.xml", true, true);
302 
304  return 0;
305 }
holds a vector of ns3::Application pointers.
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:102
Manage ASCII trace files for device models.
Definition: trace-helper.h:161
an Inet address class
static Ipv4Address GetAny(void)
std::pair< Ptr< Ipv4 >, uint32_t > Get(uint32_t i) const
Get the std::pair of an Ptr and interface stored at the location specified by the index...
AttributeValue implementation for Boolean.
Definition: boolean.h:36
QueueDiscContainer Install(NetDeviceContainer c)
void BytesInQueueTrace(Ptr< OutputStreamWrapper > stream, uint32_t oldVal, uint32_t newVal)
#define NS_ABORT_MSG(msg)
Unconditional abnormal program termination with a message.
Definition: abort.h:50
holds a vector of std::pair of Ptr and interface index.
static void PopulateRoutingTables(void)
Build a routing database and initialize the routing tables of the nodes in the simulation.
Hold variables of type string.
Definition: string.h:41
Ptr< NetDevice > Get(uint32_t i) const
Get the Ptr stored in this container at a given index.
NetDeviceContainer Install(NodeContainer c)
void Add(ApplicationContainer other)
Append the contents of another ApplicationContainer to the end of this container. ...
void Add(const Ipv4InterfaceContainer &other)
Concatenate the entries in the other container with ours.
Callback< R > MakeBoundCallback(R(*fnPtr)(TX), ARG a1)
Make Callbacks with one bound argument.
Definition: callback.h:1686
static void Run(void)
Run the simulation.
Definition: simulator.cc:226
Use number of packets for maximum queue disc size.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:201
aggregate IP/TCP/UDP functionality to existing Nodes.
A helper to make it easier to instantiate an ns3::PacketSinkApplication on a set of nodes...
Build a set of PointToPointNetDevice objects.
ApplicationContainer Install(NodeContainer nodes) const
Install a Ping application on each Node in the provided NodeContainer.
void SetDeviceAttribute(std::string name, const AttributeValue &value)
Set an attribute value to be propagated to each NetDevice created by the helper.
void AddPacketFilter(uint16_t handle, std::string type, std::string n01="", const AttributeValue &v01=EmptyAttributeValue(), std::string n02="", const AttributeValue &v02=EmptyAttributeValue(), std::string n03="", const AttributeValue &v03=EmptyAttributeValue(), std::string n04="", const AttributeValue &v04=EmptyAttributeValue(), std::string n05="", const AttributeValue &v05=EmptyAttributeValue(), std::string n06="", const AttributeValue &v06=EmptyAttributeValue(), std::string n07="", const AttributeValue &v07=EmptyAttributeValue(), std::string n08="", const AttributeValue &v08=EmptyAttributeValue())
Helper function used to add a packet filter (of the given type and with the given attributes) to the ...
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
double stopTime
uint16_t port
Definition: dsdv-manet.cc:44
a polymophic address class
Definition: address.h:90
Holds a vector of ns3::QueueDisc pointers.
double GetSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
Definition: nstime.h:341
static void GoodputSampling(std::string fileName, ApplicationContainer app, Ptr< OutputStreamWrapper > stream, float period)
Hold variables of type enum.
Definition: enum.h:54
static EventId Schedule(Time const &delay, MEM mem_ptr, OBJ obj)
Schedule an event to expire after delay.
Definition: simulator.h:1375
static void PingRtt(std::string context, Time rtt)
void InstallAll(void) const
Aggregate IPv4, IPv6, UDP, and TCP stacks to all nodes in the simulation.
Hold an unsigned integer type.
Definition: uinteger.h:44
double startTime
holds a vector of ns3::NetDevice pointers
AttributeValue implementation for TypeId.
Definition: type-id.h:608
Callback< R > MakeCallback(R(T::*memPtr)(void), OBJ objPtr)
Definition: callback.h:1489
Build a set of QueueDisc objects.
void SetQueueLimits(std::string type, std::string n01="", const AttributeValue &v01=EmptyAttributeValue(), std::string n02="", const AttributeValue &v02=EmptyAttributeValue(), std::string n03="", const AttributeValue &v03=EmptyAttributeValue(), std::string n04="", const AttributeValue &v04=EmptyAttributeValue(), std::string n05="", const AttributeValue &v05=EmptyAttributeValue(), std::string n06="", const AttributeValue &v06=EmptyAttributeValue(), std::string n07="", const AttributeValue &v07=EmptyAttributeValue(), std::string n08="", const AttributeValue &v08=EmptyAttributeValue())
Helper function used to add a queue limits object to the transmission queues of the devices...
Network device transmission queue interface.
Ptr< FlowMonitor > InstallAll()
Enable flow monitoring on all nodes.
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:205
void Connect(std::string path, const CallbackBase &cb)
Definition: config.cc:843
static void Destroy(void)
Execute the events scheduled with ScheduleDestroy().
Definition: simulator.cc:190
static TypeId GetTypeId(void)
Get the type ID.
bool TraceConnectWithoutContext(std::string name, const CallbackBase &cb)
Connect a TraceSource to a Callback without a context.
Definition: object-base.cc:293
Every class exported by the ns3 library is enclosed in the ns3 namespace.
keep track of a set of node pointers.
Ptr< Application > Get(uint32_t i) const
Get the Ptr stored in this container at a given index.
uint16_t SetRootQueueDisc(std::string type, std::string n01="", const AttributeValue &v01=EmptyAttributeValue(), std::string n02="", const AttributeValue &v02=EmptyAttributeValue(), std::string n03="", const AttributeValue &v03=EmptyAttributeValue(), std::string n04="", const AttributeValue &v04=EmptyAttributeValue(), std::string n05="", const AttributeValue &v05=EmptyAttributeValue(), std::string n06="", const AttributeValue &v06=EmptyAttributeValue(), std::string n07="", const AttributeValue &v07=EmptyAttributeValue(), std::string n08="", const AttributeValue &v08=EmptyAttributeValue(), std::string n09="", const AttributeValue &v09=EmptyAttributeValue(), std::string n10="", const AttributeValue &v10=EmptyAttributeValue(), std::string n11="", const AttributeValue &v11=EmptyAttributeValue(), std::string n12="", const AttributeValue &v12=EmptyAttributeValue(), std::string n13="", const AttributeValue &v13=EmptyAttributeValue(), std::string n14="", const AttributeValue &v14=EmptyAttributeValue(), std::string n15="", const AttributeValue &v15=EmptyAttributeValue())
Helper function used to set a root queue disc of the given type and with the given attributes...
Helper to enable IP flow monitoring on a set of Nodes.
static Time Now(void)
Return the current simulation virtual time.
Definition: simulator.cc:249
tuple stack
Definition: first.py:34
void LimitsTrace(Ptr< OutputStreamWrapper > stream, uint32_t oldVal, uint32_t newVal)
void SetChannelAttribute(std::string name, const AttributeValue &value)
Set an attribute value to be propagated to each Channel created by the helper.
AttributeValue implementation for Address.
Definition: address.h:278
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...
void AddValue(const std::string &name, const std::string &help, T &value)
Add a program argument, assigning to POD.
Definition: command-line.h:498
static void Stop(void)
Tell the Simulator the calling event should be the last one executed.
Definition: simulator.cc:234
void SerializeToXmlFile(std::string fileName, bool enableHistograms, bool enableProbes)
Same as SerializeToXmlStream, but writes to a file instead.
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:993
void SetDefault(std::string name, const AttributeValue &value)
Definition: config.cc:782
Ipv4Address NewNetwork(void)
Increment the network number and reset the IP address counter to the base value provided in the SetBa...
Use number of packets for maximum queue disc size.
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.
void Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.
tuple address
Definition: first.py:37
int64_t GetMilliSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
Definition: nstime.h:345
Create a IPv4 ping application and associate it to a node.
Definition: v4ping-helper.h:37
std::ostream * GetStream(void)
Return a pointer to an ostream previously set in the wrapper.
Use number of packets for maximum queue disc size.
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