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", "MaxSize", StringValue ("1000p"));
149 
150  // Bottleneck link traffic control configuration
151  TrafficControlHelper tchBottleneck;
152 
153  if (queueDiscType.compare ("PfifoFast") == 0)
154  {
155  tchBottleneck.SetRootQueueDisc ("ns3::PfifoFastQueueDisc", "MaxSize",
156  QueueSizeValue (QueueSize (QueueSizeUnit::PACKETS, queueDiscSize)));
157  }
158  else if (queueDiscType.compare ("ARED") == 0)
159  {
160  tchBottleneck.SetRootQueueDisc ("ns3::RedQueueDisc");
161  Config::SetDefault ("ns3::RedQueueDisc::ARED", BooleanValue (true));
162  Config::SetDefault ("ns3::RedQueueDisc::MaxSize",
163  QueueSizeValue (QueueSize (QueueSizeUnit::PACKETS, queueDiscSize)));
164  }
165  else if (queueDiscType.compare ("CoDel") == 0)
166  {
167  tchBottleneck.SetRootQueueDisc ("ns3::CoDelQueueDisc");
168  Config::SetDefault ("ns3::CoDelQueueDisc::MaxSize",
169  QueueSizeValue (QueueSize (QueueSizeUnit::PACKETS, queueDiscSize)));
170  }
171  else if (queueDiscType.compare ("FqCoDel") == 0)
172  {
173  uint32_t handle = tchBottleneck.SetRootQueueDisc ("ns3::FqCoDelQueueDisc");
174  Config::SetDefault ("ns3::FqCoDelQueueDisc::MaxSize",
175  QueueSizeValue (QueueSize (QueueSizeUnit::PACKETS, queueDiscSize)));
176  tchBottleneck.AddPacketFilter (handle, "ns3::FqCoDelIpv4PacketFilter");
177  tchBottleneck.AddPacketFilter (handle, "ns3::FqCoDelIpv6PacketFilter");
178  }
179  else if (queueDiscType.compare ("PIE") == 0)
180  {
181  tchBottleneck.SetRootQueueDisc ("ns3::PieQueueDisc");
182  Config::SetDefault ("ns3::PieQueueDisc::MaxSize",
183  QueueSizeValue (QueueSize (QueueSizeUnit::PACKETS, queueDiscSize)));
184  }
185  else
186  {
187  NS_ABORT_MSG ("--queueDiscType not valid");
188  }
189 
190  if (bql)
191  {
192  tchBottleneck.SetQueueLimits ("ns3::DynamicQueueLimits");
193  }
194 
195  Config::SetDefault ("ns3::QueueBase::MaxSize", StringValue ("100p"));
196 
197  NetDeviceContainer devicesAccessLink = accessLink.Install (n1.Get (0), n2.Get (0));
198  tchPfifoFastAccess.Install (devicesAccessLink);
200  address.SetBase ("192.168.0.0", "255.255.255.0");
201  address.NewNetwork ();
202  Ipv4InterfaceContainer interfacesAccess = address.Assign (devicesAccessLink);
203 
204  Config::SetDefault ("ns3::QueueBase::MaxSize", StringValue (std::to_string (netdevicesQueueSize) + "p"));
205 
206  NetDeviceContainer devicesBottleneckLink = bottleneckLink.Install (n2.Get (0), n3.Get (0));
207  QueueDiscContainer qdiscs;
208  qdiscs = tchBottleneck.Install (devicesBottleneckLink);
209 
210  address.NewNetwork ();
211  Ipv4InterfaceContainer interfacesBottleneck = address.Assign (devicesBottleneckLink);
212 
213  Ptr<NetDeviceQueueInterface> interface = devicesBottleneckLink.Get (0)->GetObject<NetDeviceQueueInterface> ();
214  Ptr<NetDeviceQueue> queueInterface = interface->GetTxQueue (0);
215  Ptr<DynamicQueueLimits> queueLimits = StaticCast<DynamicQueueLimits> (queueInterface->GetQueueLimits ());
216 
217  AsciiTraceHelper ascii;
218  if (bql)
219  {
220  queueDiscType = queueDiscType + "-bql";
221  Ptr<OutputStreamWrapper> streamLimits = ascii.CreateFileStream (queueDiscType + "-limits.txt");
222  queueLimits->TraceConnectWithoutContext ("Limit",MakeBoundCallback (&LimitsTrace, streamLimits));
223  }
224  Ptr<Queue<Packet> > queue = StaticCast<PointToPointNetDevice> (devicesBottleneckLink.Get (0))->GetQueue ();
225  Ptr<OutputStreamWrapper> streamBytesInQueue = ascii.CreateFileStream (queueDiscType + "-bytesInQueue.txt");
226  queue->TraceConnectWithoutContext ("BytesInQueue",MakeBoundCallback (&BytesInQueueTrace, streamBytesInQueue));
227 
228  Ipv4InterfaceContainer n1Interface;
229  n1Interface.Add (interfacesAccess.Get (0));
230 
231  Ipv4InterfaceContainer n3Interface;
232  n3Interface.Add (interfacesBottleneck.Get (1));
233 
235 
236  Config::SetDefault ("ns3::TcpSocket::SegmentSize", UintegerValue (flowsPacketsSize));
237 
238  // Flows configuration
239  // Bidirectional TCP streams with ping like flent tcp_bidirectional test.
240  uint16_t port = 7;
241  ApplicationContainer uploadApp, downloadApp, sourceApps;
242  // Configure and install upload flow
243  Address addUp (InetSocketAddress (Ipv4Address::GetAny (), port));
244  PacketSinkHelper sinkHelperUp ("ns3::TcpSocketFactory", addUp);
245  sinkHelperUp.SetAttribute ("Protocol", TypeIdValue (TcpSocketFactory::GetTypeId ()));
246  uploadApp.Add (sinkHelperUp.Install (n3));
247 
248  InetSocketAddress socketAddressUp = InetSocketAddress (n3Interface.GetAddress (0), port);
249  OnOffHelper onOffHelperUp ("ns3::TcpSocketFactory", Address ());
250  onOffHelperUp.SetAttribute ("Remote", AddressValue (socketAddressUp));
251  onOffHelperUp.SetAttribute ("OnTime", StringValue ("ns3::ConstantRandomVariable[Constant=1]"));
252  onOffHelperUp.SetAttribute ("OffTime", StringValue ("ns3::ConstantRandomVariable[Constant=0]"));
253  onOffHelperUp.SetAttribute ("PacketSize", UintegerValue (flowsPacketsSize));
254  onOffHelperUp.SetAttribute ("DataRate", StringValue (flowsDatarate));
255  sourceApps.Add (onOffHelperUp.Install (n1));
256 
257  port = 8;
258  // Configure and install download flow
259  Address addDown (InetSocketAddress (Ipv4Address::GetAny (), port));
260  PacketSinkHelper sinkHelperDown ("ns3::TcpSocketFactory", addDown);
261  sinkHelperDown.SetAttribute ("Protocol", TypeIdValue (TcpSocketFactory::GetTypeId ()));
262  downloadApp.Add (sinkHelperDown.Install (n1));
263 
264  InetSocketAddress socketAddressDown = InetSocketAddress (n1Interface.GetAddress (0), port);
265  OnOffHelper onOffHelperDown ("ns3::TcpSocketFactory", Address ());
266  onOffHelperDown.SetAttribute ("Remote", AddressValue (socketAddressDown));
267  onOffHelperDown.SetAttribute ("OnTime", StringValue ("ns3::ConstantRandomVariable[Constant=1]"));
268  onOffHelperDown.SetAttribute ("OffTime", StringValue ("ns3::ConstantRandomVariable[Constant=0]"));
269  onOffHelperDown.SetAttribute ("PacketSize", UintegerValue (flowsPacketsSize));
270  onOffHelperDown.SetAttribute ("DataRate", StringValue (flowsDatarate));
271  sourceApps.Add (onOffHelperDown.Install (n3));
272 
273  // Configure and install ping
274  V4PingHelper ping = V4PingHelper (n3Interface.GetAddress (0));
275  ping.Install (n1);
276 
277  Config::Connect ("/NodeList/*/ApplicationList/*/$ns3::V4Ping/Rtt", MakeCallback (&PingRtt));
278 
279  uploadApp.Start (Seconds (0));
280  uploadApp.Stop (Seconds (stopTime));
281  downloadApp.Start (Seconds (0));
282  downloadApp.Stop (Seconds (stopTime));
283 
284  sourceApps.Start (Seconds (0 + 0.1));
285  sourceApps.Stop (Seconds (stopTime - 0.1));
286 
287  Ptr<OutputStreamWrapper> uploadGoodputStream = ascii.CreateFileStream (queueDiscType + "-upGoodput.txt");
288  Simulator::Schedule (Seconds (samplingPeriod), &GoodputSampling, queueDiscType + "-upGoodput.txt", uploadApp,
289  uploadGoodputStream, samplingPeriod);
290  Ptr<OutputStreamWrapper> downloadGoodputStream = ascii.CreateFileStream (queueDiscType + "-downGoodput.txt");
291  Simulator::Schedule (Seconds (samplingPeriod), &GoodputSampling, queueDiscType + "-downGoodput.txt", downloadApp,
292  downloadGoodputStream, samplingPeriod);
293 
294  // Flow monitor
295  Ptr<FlowMonitor> flowMonitor;
296  FlowMonitorHelper flowHelper;
297  flowMonitor = flowHelper.InstallAll();
298 
299  Simulator::Stop (Seconds (stopTime));
300  Simulator::Run ();
301 
302  flowMonitor->SerializeToXmlFile(queueDiscType + "-flowMonitor.xml", true, true);
303 
305  return 0;
306 }
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)
Class for representing queue sizes.
Definition: queue-size.h:94
#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
#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:355
static void GoodputSampling(std::string fileName, ApplicationContainer app, Ptr< OutputStreamWrapper > stream, float period)
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
Use number of packets for queue size.
Definition: queue-size.h:44
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:1007
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...
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:359
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.
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