A Discrete-Event Network Simulator
API
tcp-variants-comparison.cc
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2013 ResiliNets, ITTC, 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  * Authors: Justin P. Rohrer, Truc Anh N. Nguyen <annguyen@ittc.ku.edu>, Siddharth Gangadhar <siddharth@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  * “TCP Westwood(+) Protocol Implementation in ns-3”
32  * Siddharth Gangadhar, Trúc Anh Ngọc Nguyễn , Greeshma Umapathi, and James P.G. Sterbenz,
33  * ICST SIMUTools Workshop on ns-3 (WNS3), Cannes, France, March 2013
34  */
35 
36 #include <iostream>
37 #include <fstream>
38 #include <string>
39 
40 #include "ns3/core-module.h"
41 #include "ns3/network-module.h"
42 #include "ns3/internet-module.h"
43 #include "ns3/point-to-point-module.h"
44 #include "ns3/applications-module.h"
45 #include "ns3/error-model.h"
46 #include "ns3/tcp-header.h"
47 #include "ns3/udp-header.h"
48 #include "ns3/enum.h"
49 #include "ns3/event-id.h"
50 #include "ns3/flow-monitor-helper.h"
51 #include "ns3/ipv4-global-routing-helper.h"
52 #include "ns3/traffic-control-module.h"
53 
54 using namespace ns3;
55 
56 NS_LOG_COMPONENT_DEFINE ("TcpVariantsComparison");
57 
58 bool firstCwnd = true;
59 bool firstSshThr = true;
60 bool firstRtt = true;
61 bool firstRto = true;
69 uint32_t cWndValue;
70 uint32_t ssThreshValue;
71 
72 
73 static void
74 CwndTracer (uint32_t oldval, uint32_t newval)
75 {
76  if (firstCwnd)
77  {
78  *cWndStream->GetStream () << "0.0 " << oldval << std::endl;
79  firstCwnd = false;
80  }
81  *cWndStream->GetStream () << Simulator::Now ().GetSeconds () << " " << newval << std::endl;
82  cWndValue = newval;
83 
84  if (!firstSshThr)
85  {
86  *ssThreshStream->GetStream () << Simulator::Now ().GetSeconds () << " " << ssThreshValue << std::endl;
87  }
88 }
89 
90 static void
91 SsThreshTracer (uint32_t oldval, uint32_t newval)
92 {
93  if (firstSshThr)
94  {
95  *ssThreshStream->GetStream () << "0.0 " << oldval << std::endl;
96  firstSshThr = false;
97  }
98  *ssThreshStream->GetStream () << Simulator::Now ().GetSeconds () << " " << newval << std::endl;
99  ssThreshValue = newval;
100 
101  if (!firstCwnd)
102  {
103  *cWndStream->GetStream () << Simulator::Now ().GetSeconds () << " " << cWndValue << std::endl;
104  }
105 }
106 
107 static void
108 RttTracer (Time oldval, Time newval)
109 {
110  if (firstRtt)
111  {
112  *rttStream->GetStream () << "0.0 " << oldval.GetSeconds () << std::endl;
113  firstRtt = false;
114  }
115  *rttStream->GetStream () << Simulator::Now ().GetSeconds () << " " << newval.GetSeconds () << std::endl;
116 }
117 
118 static void
119 RtoTracer (Time oldval, Time newval)
120 {
121  if (firstRto)
122  {
123  *rtoStream->GetStream () << "0.0 " << oldval.GetSeconds () << std::endl;
124  firstRto = false;
125  }
126  *rtoStream->GetStream () << Simulator::Now ().GetSeconds () << " " << newval.GetSeconds () << std::endl;
127 }
128 
129 static void
131 {
132  *nextTxStream->GetStream () << Simulator::Now ().GetSeconds () << " " << nextTx << std::endl;
133 }
134 
135 static void
136 InFlightTracer (uint32_t old, uint32_t inFlight)
137 {
138  *inFlightStream->GetStream () << Simulator::Now ().GetSeconds () << " " << inFlight << std::endl;
139 }
140 
141 static void
143 {
144  *nextRxStream->GetStream () << Simulator::Now ().GetSeconds () << " " << nextRx << std::endl;
145 }
146 
147 static void
148 TraceCwnd (std::string cwnd_tr_file_name)
149 {
150  AsciiTraceHelper ascii;
151  cWndStream = ascii.CreateFileStream (cwnd_tr_file_name.c_str ());
152  Config::ConnectWithoutContext ("/NodeList/1/$ns3::TcpL4Protocol/SocketList/0/CongestionWindow", MakeCallback (&CwndTracer));
153 }
154 
155 static void
156 TraceSsThresh (std::string ssthresh_tr_file_name)
157 {
158  AsciiTraceHelper ascii;
159  ssThreshStream = ascii.CreateFileStream (ssthresh_tr_file_name.c_str ());
160  Config::ConnectWithoutContext ("/NodeList/1/$ns3::TcpL4Protocol/SocketList/0/SlowStartThreshold", MakeCallback (&SsThreshTracer));
161 }
162 
163 static void
164 TraceRtt (std::string rtt_tr_file_name)
165 {
166  AsciiTraceHelper ascii;
167  rttStream = ascii.CreateFileStream (rtt_tr_file_name.c_str ());
168  Config::ConnectWithoutContext ("/NodeList/1/$ns3::TcpL4Protocol/SocketList/0/RTT", MakeCallback (&RttTracer));
169 }
170 
171 static void
172 TraceRto (std::string rto_tr_file_name)
173 {
174  AsciiTraceHelper ascii;
175  rtoStream = ascii.CreateFileStream (rto_tr_file_name.c_str ());
176  Config::ConnectWithoutContext ("/NodeList/1/$ns3::TcpL4Protocol/SocketList/0/RTO", MakeCallback (&RtoTracer));
177 }
178 
179 static void
180 TraceNextTx (std::string &next_tx_seq_file_name)
181 {
182  AsciiTraceHelper ascii;
183  nextTxStream = ascii.CreateFileStream (next_tx_seq_file_name.c_str ());
184  Config::ConnectWithoutContext ("/NodeList/1/$ns3::TcpL4Protocol/SocketList/0/NextTxSequence", MakeCallback (&NextTxTracer));
185 }
186 
187 static void
188 TraceInFlight (std::string &in_flight_file_name)
189 {
190  AsciiTraceHelper ascii;
191  inFlightStream = ascii.CreateFileStream (in_flight_file_name.c_str ());
192  Config::ConnectWithoutContext ("/NodeList/1/$ns3::TcpL4Protocol/SocketList/0/BytesInFlight", MakeCallback (&InFlightTracer));
193 }
194 
195 
196 static void
197 TraceNextRx (std::string &next_rx_seq_file_name)
198 {
199  AsciiTraceHelper ascii;
200  nextRxStream = ascii.CreateFileStream (next_rx_seq_file_name.c_str ());
201  Config::ConnectWithoutContext ("/NodeList/2/$ns3::TcpL4Protocol/SocketList/1/RxBuffer/NextRxSequence", MakeCallback (&NextRxTracer));
202 }
203 
204 int main (int argc, char *argv[])
205 {
206  std::string transport_prot = "TcpWestwood";
207  double error_p = 0.0;
208  std::string bandwidth = "2Mbps";
209  std::string delay = "0.01ms";
210  std::string access_bandwidth = "10Mbps";
211  std::string access_delay = "45ms";
212  bool tracing = false;
213  std::string prefix_file_name = "TcpVariantsComparison";
214  double data_mbytes = 0;
215  uint32_t mtu_bytes = 400;
216  uint16_t num_flows = 1;
217  float duration = 100;
218  uint32_t run = 0;
219  bool flow_monitor = false;
220  bool pcap = false;
221  bool sack = true;
222  std::string queue_disc_type = "ns3::PfifoFastQueueDisc";
223 
224 
226  cmd.AddValue ("transport_prot", "Transport protocol to use: TcpNewReno, "
227  "TcpHybla, TcpHighSpeed, TcpHtcp, TcpVegas, TcpScalable, TcpVeno, "
228  "TcpBic, TcpYeah, TcpIllinois, TcpWestwood, TcpWestwoodPlus, TcpLedbat ", transport_prot);
229  cmd.AddValue ("error_p", "Packet error rate", error_p);
230  cmd.AddValue ("bandwidth", "Bottleneck bandwidth", bandwidth);
231  cmd.AddValue ("delay", "Bottleneck delay", delay);
232  cmd.AddValue ("access_bandwidth", "Access link bandwidth", access_bandwidth);
233  cmd.AddValue ("access_delay", "Access link delay", access_delay);
234  cmd.AddValue ("tracing", "Flag to enable/disable tracing", tracing);
235  cmd.AddValue ("prefix_name", "Prefix of output trace file", prefix_file_name);
236  cmd.AddValue ("data", "Number of Megabytes of data to transmit", data_mbytes);
237  cmd.AddValue ("mtu", "Size of IP packets to send in bytes", mtu_bytes);
238  cmd.AddValue ("num_flows", "Number of flows", num_flows);
239  cmd.AddValue ("duration", "Time to allow flows to run in seconds", duration);
240  cmd.AddValue ("run", "Run index (for setting repeatable seeds)", run);
241  cmd.AddValue ("flow_monitor", "Enable flow monitor", flow_monitor);
242  cmd.AddValue ("pcap_tracing", "Enable or disable PCAP tracing", pcap);
243  cmd.AddValue ("queue_disc_type", "Queue disc type for gateway (e.g. ns3::CoDelQueueDisc)", queue_disc_type);
244  cmd.AddValue ("sack", "Enable or disable SACK option", sack);
245  cmd.Parse (argc, argv);
246 
247  transport_prot = std::string ("ns3::") + transport_prot;
248 
250  SeedManager::SetRun (run);
251 
252  // User may find it convenient to enable logging
253  //LogComponentEnable("TcpVariantsComparison", LOG_LEVEL_ALL);
254  //LogComponentEnable("BulkSendApplication", LOG_LEVEL_INFO);
255  //LogComponentEnable("PfifoFastQueueDisc", LOG_LEVEL_ALL);
256 
257  // Calculate the ADU size
258  Header* temp_header = new Ipv4Header ();
259  uint32_t ip_header = temp_header->GetSerializedSize ();
260  NS_LOG_LOGIC ("IP Header size is: " << ip_header);
261  delete temp_header;
262  temp_header = new TcpHeader ();
263  uint32_t tcp_header = temp_header->GetSerializedSize ();
264  NS_LOG_LOGIC ("TCP Header size is: " << tcp_header);
265  delete temp_header;
266  uint32_t tcp_adu_size = mtu_bytes - 20 - (ip_header + tcp_header);
267  NS_LOG_LOGIC ("TCP ADU size is: " << tcp_adu_size);
268 
269  // Set the simulation start and stop time
270  float start_time = 0.1;
271  float stop_time = start_time + duration;
272 
273  // 4 MB of TCP buffer
274  Config::SetDefault ("ns3::TcpSocket::RcvBufSize", UintegerValue (1 << 21));
275  Config::SetDefault ("ns3::TcpSocket::SndBufSize", UintegerValue (1 << 21));
276  Config::SetDefault ("ns3::TcpSocketBase::Sack", BooleanValue (sack));
277 
278  // Select TCP variant
279  if (transport_prot.compare ("ns3::TcpWestwoodPlus") == 0)
280  {
281  // TcpWestwoodPlus is not an actual TypeId name; we need TcpWestwood here
282  Config::SetDefault ("ns3::TcpL4Protocol::SocketType", TypeIdValue (TcpWestwood::GetTypeId ()));
283  // the default protocol type in ns3::TcpWestwood is WESTWOOD
284  Config::SetDefault ("ns3::TcpWestwood::ProtocolType", EnumValue (TcpWestwood::WESTWOODPLUS));
285  }
286  else
287  {
288  TypeId tcpTid;
289  NS_ABORT_MSG_UNLESS (TypeId::LookupByNameFailSafe (transport_prot, &tcpTid), "TypeId " << transport_prot << " not found");
290  Config::SetDefault ("ns3::TcpL4Protocol::SocketType", TypeIdValue (TypeId::LookupByName (transport_prot)));
291  }
292 
293  // Create gateways, sources, and sinks
294  NodeContainer gateways;
295  gateways.Create (1);
296  NodeContainer sources;
297  sources.Create (num_flows);
298  NodeContainer sinks;
299  sinks.Create (num_flows);
300 
301  // Configure the error model
302  // Here we use RateErrorModel with packet error rate
303  Ptr<UniformRandomVariable> uv = CreateObject<UniformRandomVariable> ();
304  uv->SetStream (50);
305  RateErrorModel error_model;
306  error_model.SetRandomVariable (uv);
308  error_model.SetRate (error_p);
309 
310  PointToPointHelper UnReLink;
311  UnReLink.SetDeviceAttribute ("DataRate", StringValue (bandwidth));
312  UnReLink.SetChannelAttribute ("Delay", StringValue (delay));
313  UnReLink.SetDeviceAttribute ("ReceiveErrorModel", PointerValue (&error_model));
314 
315 
317  stack.InstallAll ();
318 
319  TrafficControlHelper tchPfifo;
320  tchPfifo.SetRootQueueDisc ("ns3::PfifoFastQueueDisc");
321 
322  TrafficControlHelper tchCoDel;
323  tchCoDel.SetRootQueueDisc ("ns3::CoDelQueueDisc");
324 
326  address.SetBase ("10.0.0.0", "255.255.255.0");
327 
328  // Configure the sources and sinks net devices
329  // and the channels between the sources/sinks and the gateways
330  PointToPointHelper LocalLink;
331  LocalLink.SetDeviceAttribute ("DataRate", StringValue (access_bandwidth));
332  LocalLink.SetChannelAttribute ("Delay", StringValue (access_delay));
333 
334  Ipv4InterfaceContainer sink_interfaces;
335 
336  DataRate access_b (access_bandwidth);
337  DataRate bottle_b (bandwidth);
338  Time access_d (access_delay);
339  Time bottle_d (delay);
340 
341  Config::SetDefault ("ns3::CoDelQueueDisc::Mode", EnumValue (CoDelQueueDisc::QUEUE_DISC_MODE_BYTES));
342 
343  uint32_t size = (std::min (access_b, bottle_b).GetBitRate () / 8) *
344  ((access_d + bottle_d) * 2).GetSeconds ();
345 
346  Config::SetDefault ("ns3::PfifoFastQueueDisc::Limit", UintegerValue (size / mtu_bytes));
347  Config::SetDefault ("ns3::CoDelQueueDisc::MaxBytes", UintegerValue (size));
348 
349  for (int i = 0; i < num_flows; i++)
350  {
352  devices = LocalLink.Install (sources.Get (i), gateways.Get (0));
353  tchPfifo.Install (devices);
354  address.NewNetwork ();
355  Ipv4InterfaceContainer interfaces = address.Assign (devices);
356 
357  devices = UnReLink.Install (gateways.Get (0), sinks.Get (i));
358  if (queue_disc_type.compare ("ns3::PfifoFastQueueDisc") == 0)
359  {
360  tchPfifo.Install (devices);
361  }
362  else if (queue_disc_type.compare ("ns3::CoDelQueueDisc") == 0)
363  {
364  tchCoDel.Install (devices);
365  }
366  else
367  {
368  NS_FATAL_ERROR ("Queue not recognized. Allowed values are ns3::CoDelQueueDisc or ns3::PfifoFastQueueDisc");
369  }
370  address.NewNetwork ();
371  interfaces = address.Assign (devices);
372  sink_interfaces.Add (interfaces.Get (1));
373  }
374 
375  NS_LOG_INFO ("Initialize Global Routing.");
377 
378  uint16_t port = 50000;
379  Address sinkLocalAddress (InetSocketAddress (Ipv4Address::GetAny (), port));
380  PacketSinkHelper sinkHelper ("ns3::TcpSocketFactory", sinkLocalAddress);
381 
382  for (uint16_t i = 0; i < sources.GetN (); i++)
383  {
384  AddressValue remoteAddress (InetSocketAddress (sink_interfaces.GetAddress (i, 0), port));
385  Config::SetDefault ("ns3::TcpSocket::SegmentSize", UintegerValue (tcp_adu_size));
386  BulkSendHelper ftp ("ns3::TcpSocketFactory", Address ());
387  ftp.SetAttribute ("Remote", remoteAddress);
388  ftp.SetAttribute ("SendSize", UintegerValue (tcp_adu_size));
389  ftp.SetAttribute ("MaxBytes", UintegerValue (int(data_mbytes * 1000000)));
390 
391  ApplicationContainer sourceApp = ftp.Install (sources.Get (i));
392  sourceApp.Start (Seconds (start_time * i));
393  sourceApp.Stop (Seconds (stop_time - 3));
394 
395  sinkHelper.SetAttribute ("Protocol", TypeIdValue (TcpSocketFactory::GetTypeId ()));
396  ApplicationContainer sinkApp = sinkHelper.Install (sinks);
397  sinkApp.Start (Seconds (start_time * i));
398  sinkApp.Stop (Seconds (stop_time));
399  }
400 
401  // Set up tracing if enabled
402  if (tracing)
403  {
404  std::ofstream ascii;
405  Ptr<OutputStreamWrapper> ascii_wrap;
406  ascii.open ((prefix_file_name + "-ascii").c_str ());
407  ascii_wrap = new OutputStreamWrapper ((prefix_file_name + "-ascii").c_str (),
408  std::ios::out);
409  stack.EnableAsciiIpv4All (ascii_wrap);
410 
411  Simulator::Schedule (Seconds (0.00001), &TraceCwnd, prefix_file_name + "-cwnd.data");
412  Simulator::Schedule (Seconds (0.00001), &TraceSsThresh, prefix_file_name + "-ssth.data");
413  Simulator::Schedule (Seconds (0.00001), &TraceRtt, prefix_file_name + "-rtt.data");
414  Simulator::Schedule (Seconds (0.00001), &TraceRto, prefix_file_name + "-rto.data");
415  Simulator::Schedule (Seconds (0.00001), &TraceNextTx, prefix_file_name + "-next-tx.data");
416  Simulator::Schedule (Seconds (0.00001), &TraceInFlight, prefix_file_name + "-inflight.data");
417  Simulator::Schedule (Seconds (0.1), &TraceNextRx, prefix_file_name + "-next-rx.data");
418  }
419 
420  if (pcap)
421  {
422  UnReLink.EnablePcapAll (prefix_file_name, true);
423  LocalLink.EnablePcapAll (prefix_file_name, true);
424  }
425 
426  // Flow monitor
427  FlowMonitorHelper flowHelper;
428  if (flow_monitor)
429  {
430  flowHelper.InstallAll ();
431  }
432 
433  Simulator::Stop (Seconds (stop_time));
434  Simulator::Run ();
435 
436  if (flow_monitor)
437  {
438  flowHelper.SerializeToXmlFile (prefix_file_name + ".flowmonitor", true, true);
439  }
440 
442  return 0;
443 }
Protocol header serialization and deserialization.
Definition: header.h:42
holds a vector of ns3::Application pointers.
Ptr< OutputStreamWrapper > nextTxStream
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)
void SetStream(int64_t stream)
Specifies the stream number for the RngStream.
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)
tuple devices
Definition: first.py:32
A helper to make it easier to instantiate an ns3::BulkSendApplication on a set of nodes...
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
#define min(a, b)
Definition: 80211b.c:44
Ptr< OutputStreamWrapper > nextRxStream
NetDeviceContainer Install(NodeContainer c)
static void TraceNextRx(std::string &next_rx_seq_file_name)
void Add(const Ipv4InterfaceContainer &other)
Concatenate the entries in the other container with ours.
uint32_t ssThreshValue
uint32_t cWndValue
static void Run(void)
Run the simulation.
Definition: simulator.cc:226
Ptr< OutputStreamWrapper > cWndStream
#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.
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
Definition: log.h:277
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
Definition: fatal-error.h:162
A helper to make it easier to instantiate an ns3::PacketSinkApplication on a set of nodes...
static bool LookupByNameFailSafe(std::string name, TypeId *tid)
Get a TypeId by name.
Definition: type-id.cc:831
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. ...
Build a set of PointToPointNetDevice objects.
void SetDeviceAttribute(std::string name, const AttributeValue &value)
Set an attribute value to be propagated to each NetDevice created by the helper.
void SerializeToXmlFile(std::string fileName, bool enableHistograms, bool enableProbes)
Same as SerializeToXmlStream, but writes to a file instead.
tuple cmd
Definition: second.py:35
static void SetRun(uint64_t run)
Set the run number of simulation.
uint16_t port
Definition: dsdv-manet.cc:44
a polymophic address class
Definition: address.h:90
uint32_t GetN(void) const
Get the number of Ptr stored in this container.
Class for representing data rates.
Definition: data-rate.h:88
Packet header for IPv4.
Definition: ipv4-header.h:33
double GetSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
Definition: nstime.h:341
Ptr< OutputStreamWrapper > rttStream
static void RttTracer(Time oldval, Time newval)
void EnablePcapAll(std::string prefix, bool promiscuous=false)
Enable pcap output on each device (which is of the appropriate type) in the set of all nodes created ...
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
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
void SetRate(double rate)
Definition: error-model.cc:208
tuple interfaces
Definition: first.py:41
holds a vector of ns3::NetDevice pointers
A class encapsulating an output stream.
static void InFlightTracer(uint32_t old, uint32_t inFlight)
AttributeValue implementation for TypeId.
Definition: type-id.h:608
Callback< R > MakeCallback(R(T::*memPtr)(void), OBJ objPtr)
Definition: callback.h:1489
void ConnectWithoutContext(std::string path, const CallbackBase &cb)
Definition: config.cc:832
Build a set of QueueDisc objects.
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 EnableAsciiIpv4All(std::string prefix)
Enable ascii trace output on all Ipv4 and interface pairs existing in the set of all nodes created in...
static void Destroy(void)
Execute the events scheduled with ScheduleDestroy().
Definition: simulator.cc:190
static void CwndTracer(uint32_t oldval, uint32_t newval)
static TypeId GetTypeId(void)
Get the type ID.
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
static void TraceSsThresh(std::string ssthresh_tr_file_name)
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...
virtual uint32_t GetSerializedSize(void) const =0
Header for the Transmission Control Protocol.
Definition: tcp-header.h:44
Ptr< OutputStreamWrapper > inFlightStream
static TypeId GetTypeId(void)
Get the type ID.
Definition: tcp-westwood.cc:47
Ptr< OutputStreamWrapper > rtoStream
Helper to enable IP flow monitoring on a set of Nodes.
bool firstSshThr
static Time Now(void)
Return the current simulation virtual time.
Definition: simulator.cc:249
static void NextRxTracer(SequenceNumber32 old, SequenceNumber32 nextRx)
tuple stack
Definition: first.py:34
NS_LOG_LOGIC("Net device "<< nd<< " is not bridged")
void SetChannelAttribute(std::string name, const AttributeValue &value)
Set an attribute value to be propagated to each Channel created by the helper.
static void SetSeed(uint32_t seed)
Set the seed.
static void TraceNextTx(std::string &next_tx_seq_file_name)
void SetUnit(enum ErrorUnit error_unit)
Definition: error-model.cc:194
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...
#define NS_ABORT_MSG_UNLESS(cond, msg)
Abnormal program termination if a condition is false, with a message.
Definition: abort.h:144
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
Use number of bytes for maximum queue disc size.
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
bool firstCwnd
void SetRandomVariable(Ptr< RandomVariableStream >)
Definition: error-model.cc:215
static void NextTxTracer(SequenceNumber32 old, SequenceNumber32 nextTx)
bool firstRtt
bool firstRto
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.
static void TraceRtt(std::string rtt_tr_file_name)
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
Determine which packets are errored corresponding to an underlying distribution, rate, and unit.
Definition: error-model.h:182
static void TraceInFlight(std::string &in_flight_file_name)
a unique identifier for an interface.
Definition: type-id.h:58
static void RtoTracer(Time oldval, Time newval)
static void TraceCwnd(std::string cwnd_tr_file_name)
static void SsThreshTracer(uint32_t oldval, uint32_t newval)
std::ostream * GetStream(void)
Return a pointer to an ostream previously set in the wrapper.
Ptr< OutputStreamWrapper > ssThreshStream
void SetBase(Ipv4Address network, Ipv4Mask mask, Ipv4Address base="0.0.0.1")
Set the base network number, network mask and base address.
static TypeId LookupByName(std::string name)
Get a TypeId by name.
Definition: type-id.cc:823
Ipv4Address GetAddress(uint32_t i, uint32_t j=0) const
static void TraceRto(std::string rto_tr_file_name)