A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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;
66 uint32_t cWndValue;
67 uint32_t ssThreshValue;
68 
69 
70 static void
71 CwndTracer (uint32_t oldval, uint32_t newval)
72 {
73  if (firstCwnd)
74  {
75  *cWndStream->GetStream () << "0.0 " << oldval << std::endl;
76  firstCwnd = false;
77  }
78  *cWndStream->GetStream () << Simulator::Now ().GetSeconds () << " " << newval << std::endl;
79  cWndValue = newval;
80 
81  if (!firstSshThr)
82  {
83  *ssThreshStream->GetStream () << Simulator::Now ().GetSeconds () << " " << ssThreshValue << std::endl;
84  }
85 }
86 
87 static void
88 SsThreshTracer (uint32_t oldval, uint32_t newval)
89 {
90  if (firstSshThr)
91  {
92  *ssThreshStream->GetStream () << "0.0 " << oldval << std::endl;
93  firstSshThr = false;
94  }
95  *ssThreshStream->GetStream () << Simulator::Now ().GetSeconds () << " " << newval << std::endl;
96  ssThreshValue = newval;
97 
98  if (!firstCwnd)
99  {
100  *cWndStream->GetStream () << Simulator::Now ().GetSeconds () << " " << cWndValue << std::endl;
101  }
102 }
103 
104 static void
105 RttTracer (Time oldval, Time newval)
106 {
107  if (firstRtt)
108  {
109  *rttStream->GetStream () << "0.0 " << oldval.GetSeconds () << std::endl;
110  firstRtt = false;
111  }
112  *rttStream->GetStream () << Simulator::Now ().GetSeconds () << " " << newval.GetSeconds () << std::endl;
113 }
114 
115 static void
116 RtoTracer (Time oldval, Time newval)
117 {
118  if (firstRto)
119  {
120  *rtoStream->GetStream () << "0.0 " << oldval.GetSeconds () << std::endl;
121  firstRto = false;
122  }
123  *rtoStream->GetStream () << Simulator::Now ().GetSeconds () << " " << newval.GetSeconds () << std::endl;
124 }
125 
126 
127 static void
128 TraceCwnd (std::string cwnd_tr_file_name)
129 {
130  AsciiTraceHelper ascii;
131  cWndStream = ascii.CreateFileStream (cwnd_tr_file_name.c_str ());
132  Config::ConnectWithoutContext ("/NodeList/1/$ns3::TcpL4Protocol/SocketList/0/CongestionWindow", MakeCallback (&CwndTracer));
133 }
134 
135 static void
136 TraceSsThresh (std::string ssthresh_tr_file_name)
137 {
138  AsciiTraceHelper ascii;
139  ssThreshStream = ascii.CreateFileStream (ssthresh_tr_file_name.c_str ());
140  Config::ConnectWithoutContext ("/NodeList/1/$ns3::TcpL4Protocol/SocketList/0/SlowStartThreshold", MakeCallback (&SsThreshTracer));
141 }
142 
143 static void
144 TraceRtt (std::string rtt_tr_file_name)
145 {
146  AsciiTraceHelper ascii;
147  rttStream = ascii.CreateFileStream (rtt_tr_file_name.c_str ());
148  Config::ConnectWithoutContext ("/NodeList/1/$ns3::TcpL4Protocol/SocketList/0/RTT", MakeCallback (&RttTracer));
149 }
150 
151 static void
152 TraceRto (std::string rto_tr_file_name)
153 {
154  AsciiTraceHelper ascii;
155  rtoStream = ascii.CreateFileStream (rto_tr_file_name.c_str ());
156  Config::ConnectWithoutContext ("/NodeList/1/$ns3::TcpL4Protocol/SocketList/0/RTO", MakeCallback (&RtoTracer));
157 }
158 
159 int main (int argc, char *argv[])
160 {
161  std::string transport_prot = "TcpWestwood";
162  double error_p = 0.0;
163  std::string bandwidth = "2Mbps";
164  std::string delay = "0.01ms";
165  std::string access_bandwidth = "10Mbps";
166  std::string access_delay = "45ms";
167  bool tracing = false;
168  std::string prefix_file_name = "TcpVariantsComparison";
169  double data_mbytes = 0;
170  uint32_t mtu_bytes = 400;
171  uint16_t num_flows = 1;
172  float duration = 100;
173  uint32_t run = 0;
174  bool flow_monitor = false;
175  bool pcap = false;
176  std::string queue_disc_type = "ns3::PfifoFastQueueDisc";
177 
178 
180  cmd.AddValue ("transport_prot", "Transport protocol to use: TcpNewReno, "
181  "TcpHybla, TcpHighSpeed, TcpVegas, TcpScalable, TcpVeno, "
182  "TcpBic, TcpYeah, TcpIllinois, TcpWestwood, TcpWestwoodPlus ", transport_prot);
183  cmd.AddValue ("error_p", "Packet error rate", error_p);
184  cmd.AddValue ("bandwidth", "Bottleneck bandwidth", bandwidth);
185  cmd.AddValue ("delay", "Bottleneck delay", delay);
186  cmd.AddValue ("access_bandwidth", "Access link bandwidth", access_bandwidth);
187  cmd.AddValue ("access_delay", "Access link delay", access_delay);
188  cmd.AddValue ("tracing", "Flag to enable/disable tracing", tracing);
189  cmd.AddValue ("prefix_name", "Prefix of output trace file", prefix_file_name);
190  cmd.AddValue ("data", "Number of Megabytes of data to transmit", data_mbytes);
191  cmd.AddValue ("mtu", "Size of IP packets to send in bytes", mtu_bytes);
192  cmd.AddValue ("num_flows", "Number of flows", num_flows);
193  cmd.AddValue ("duration", "Time to allow flows to run in seconds", duration);
194  cmd.AddValue ("run", "Run index (for setting repeatable seeds)", run);
195  cmd.AddValue ("flow_monitor", "Enable flow monitor", flow_monitor);
196  cmd.AddValue ("pcap_tracing", "Enable or disable PCAP tracing", pcap);
197  cmd.AddValue ("queue_disc_type", "Queue disc type for gateway (e.g. ns3::CoDelQueueDisc)", queue_disc_type);
198  cmd.Parse (argc, argv);
199 
201  SeedManager::SetRun (run);
202 
203  // User may find it convenient to enable logging
204  //LogComponentEnable("TcpVariantsComparison", LOG_LEVEL_ALL);
205  //LogComponentEnable("BulkSendApplication", LOG_LEVEL_INFO);
206  //LogComponentEnable("PfifoFastQueueDisc", LOG_LEVEL_ALL);
207 
208  // Calculate the ADU size
209  Header* temp_header = new Ipv4Header ();
210  uint32_t ip_header = temp_header->GetSerializedSize ();
211  NS_LOG_LOGIC ("IP Header size is: " << ip_header);
212  delete temp_header;
213  temp_header = new TcpHeader ();
214  uint32_t tcp_header = temp_header->GetSerializedSize ();
215  NS_LOG_LOGIC ("TCP Header size is: " << tcp_header);
216  delete temp_header;
217  uint32_t tcp_adu_size = mtu_bytes - 20 - (ip_header + tcp_header);
218  NS_LOG_LOGIC ("TCP ADU size is: " << tcp_adu_size);
219 
220  // Set the simulation start and stop time
221  float start_time = 0.1;
222  float stop_time = start_time + duration;
223 
224  // 4 MB of TCP buffer
225  Config::SetDefault ("ns3::TcpSocket::RcvBufSize", UintegerValue (1 << 21));
226  Config::SetDefault ("ns3::TcpSocket::SndBufSize", UintegerValue (1 << 21));
227 
228  // Select TCP variant
229  if (transport_prot.compare ("TcpNewReno") == 0)
230  {
231  Config::SetDefault ("ns3::TcpL4Protocol::SocketType", TypeIdValue (TcpNewReno::GetTypeId ()));
232  }
233  else if (transport_prot.compare ("TcpHybla") == 0)
234  {
235  Config::SetDefault ("ns3::TcpL4Protocol::SocketType", TypeIdValue (TcpHybla::GetTypeId ()));
236  }
237  else if (transport_prot.compare ("TcpHighSpeed") == 0)
238  {
239  Config::SetDefault ("ns3::TcpL4Protocol::SocketType", TypeIdValue (TcpHighSpeed::GetTypeId ()));
240  }
241  else if (transport_prot.compare ("TcpVegas") == 0)
242  {
243  Config::SetDefault ("ns3::TcpL4Protocol::SocketType", TypeIdValue (TcpVegas::GetTypeId ()));
244  }
245  else if (transport_prot.compare ("TcpScalable") == 0)
246  {
247  Config::SetDefault ("ns3::TcpL4Protocol::SocketType", TypeIdValue (TcpScalable::GetTypeId ()));
248  }
249  else if (transport_prot.compare ("TcpVeno") == 0)
250  {
251  Config::SetDefault ("ns3::TcpL4Protocol::SocketType", TypeIdValue (TcpVeno::GetTypeId ()));
252  }
253  else if (transport_prot.compare ("TcpBic") == 0)
254  {
255  Config::SetDefault ("ns3::TcpL4Protocol::SocketType", TypeIdValue (TcpBic::GetTypeId ()));
256  }
257  else if (transport_prot.compare ("TcpYeah") == 0)
258  {
259  Config::SetDefault ("ns3::TcpL4Protocol::SocketType", TypeIdValue (TcpYeah::GetTypeId ()));
260  }
261  else if (transport_prot.compare ("TcpIllinois") == 0)
262  {
263  Config::SetDefault ("ns3::TcpL4Protocol::SocketType", TypeIdValue (TcpIllinois::GetTypeId ()));
264  }
265  else if (transport_prot.compare ("TcpWestwood") == 0)
266  { // the default protocol type in ns3::TcpWestwood is WESTWOOD
267  Config::SetDefault ("ns3::TcpL4Protocol::SocketType", TypeIdValue (TcpWestwood::GetTypeId ()));
268  Config::SetDefault ("ns3::TcpWestwood::FilterType", EnumValue (TcpWestwood::TUSTIN));
269  }
270  else if (transport_prot.compare ("TcpWestwoodPlus") == 0)
271  {
272  Config::SetDefault ("ns3::TcpL4Protocol::SocketType", TypeIdValue (TcpWestwood::GetTypeId ()));
273  Config::SetDefault ("ns3::TcpWestwood::ProtocolType", EnumValue (TcpWestwood::WESTWOODPLUS));
274  Config::SetDefault ("ns3::TcpWestwood::FilterType", EnumValue (TcpWestwood::TUSTIN));
275  }
276  else
277  {
278  NS_LOG_DEBUG ("Invalid TCP version");
279  exit (1);
280  }
281 
282  // Create gateways, sources, and sinks
283  NodeContainer gateways;
284  gateways.Create (1);
285  NodeContainer sources;
286  sources.Create (num_flows);
287  NodeContainer sinks;
288  sinks.Create (num_flows);
289 
290  // Configure the error model
291  // Here we use RateErrorModel with packet error rate
292  Ptr<UniformRandomVariable> uv = CreateObject<UniformRandomVariable> ();
293  uv->SetStream (50);
294  RateErrorModel error_model;
295  error_model.SetRandomVariable (uv);
297  error_model.SetRate (error_p);
298 
299  PointToPointHelper UnReLink;
300  UnReLink.SetDeviceAttribute ("DataRate", StringValue (bandwidth));
301  UnReLink.SetChannelAttribute ("Delay", StringValue (delay));
302  UnReLink.SetDeviceAttribute ("ReceiveErrorModel", PointerValue (&error_model));
303 
304 
306  stack.InstallAll ();
307 
308  TrafficControlHelper tchPfifo;
309  uint32_t handle = tchPfifo.SetRootQueueDisc ("ns3::PfifoFastQueueDisc");
310  tchPfifo.AddPacketFilter (handle, "ns3::PfifoFastIpv4PacketFilter");
311 
312  TrafficControlHelper tchCoDel;
313  tchCoDel.SetRootQueueDisc ("ns3::CoDelQueueDisc");
314 
316  address.SetBase ("10.0.0.0", "255.255.255.0");
317 
318  // Configure the sources and sinks net devices
319  // and the channels between the sources/sinks and the gateways
320  PointToPointHelper LocalLink;
321  LocalLink.SetDeviceAttribute ("DataRate", StringValue (access_bandwidth));
322  LocalLink.SetChannelAttribute ("Delay", StringValue (access_delay));
323 
324  Ipv4InterfaceContainer sink_interfaces;
325 
326  DataRate access_b (access_bandwidth);
327  DataRate bottle_b (bandwidth);
328  Time access_d (access_delay);
329  Time bottle_d (delay);
330 
331  Config::SetDefault ("ns3::CoDelQueueDisc::Mode", EnumValue (Queue::QUEUE_MODE_BYTES));
332 
333  uint32_t size = (std::min (access_b, bottle_b).GetBitRate () / 8) *
334  ((access_d + bottle_d) * 2).GetSeconds ();
335 
336  Config::SetDefault ("ns3::PfifoFastQueueDisc::Limit", UintegerValue (size / mtu_bytes));
337  Config::SetDefault ("ns3::CoDelQueueDisc::MaxBytes", UintegerValue (size));
338 
339  for (int i = 0; i < num_flows; i++)
340  {
342  devices = LocalLink.Install (sources.Get (i), gateways.Get (0));
343  tchPfifo.Install (devices);
344  address.NewNetwork ();
345  Ipv4InterfaceContainer interfaces = address.Assign (devices);
346 
347  devices = UnReLink.Install (gateways.Get (0), sinks.Get (i));
348  if (queue_disc_type.compare ("ns3::PfifoFastQueueDisc") == 0)
349  {
350  tchPfifo.Install (devices);
351  }
352  else if (queue_disc_type.compare ("ns3::CoDelQueueDisc") == 0)
353  {
354  tchCoDel.Install (devices);
355  }
356  else
357  {
358  NS_FATAL_ERROR ("Queue not recognized. Allowed values are ns3::CoDelQueueDisc or ns3::PfifoFastQueueDisc");
359  }
360  address.NewNetwork ();
361  interfaces = address.Assign (devices);
362  sink_interfaces.Add (interfaces.Get (1));
363  }
364 
365  NS_LOG_INFO ("Initialize Global Routing.");
367 
368  uint16_t port = 50000;
369  Address sinkLocalAddress (InetSocketAddress (Ipv4Address::GetAny (), port));
370  PacketSinkHelper sinkHelper ("ns3::TcpSocketFactory", sinkLocalAddress);
371 
372  for (uint16_t i = 0; i < sources.GetN (); i++)
373  {
374  AddressValue remoteAddress (InetSocketAddress (sink_interfaces.GetAddress (i, 0), port));
375 
376  if (transport_prot.compare ("TcpNewReno") == 0
377  || transport_prot.compare ("TcpWestwood") == 0
378  || transport_prot.compare ("TcpWestwoodPlus") == 0
379  || transport_prot.compare ("TcpHybla") == 0
380  || transport_prot.compare ("TcpHighSpeed") == 0
381  || transport_prot.compare ("TcpVegas") == 0
382  || transport_prot.compare ("TcpVeno") == 0
383  || transport_prot.compare ("TcpBic") == 0
384  || transport_prot.compare ("TcpScalable") == 0
385  || transport_prot.compare ("TcpYeah") == 0
386  || transport_prot.compare ("TcpIllinois") == 0)
387  {
388  Config::SetDefault ("ns3::TcpSocket::SegmentSize", UintegerValue (tcp_adu_size));
389  BulkSendHelper ftp ("ns3::TcpSocketFactory", Address ());
390  ftp.SetAttribute ("Remote", remoteAddress);
391  ftp.SetAttribute ("SendSize", UintegerValue (tcp_adu_size));
392  ftp.SetAttribute ("MaxBytes", UintegerValue (int(data_mbytes * 1000000)));
393 
394  ApplicationContainer sourceApp = ftp.Install (sources.Get (i));
395  sourceApp.Start (Seconds (start_time * i));
396  sourceApp.Stop (Seconds (stop_time - 3));
397 
398  sinkHelper.SetAttribute ("Protocol", TypeIdValue (TcpSocketFactory::GetTypeId ()));
399  ApplicationContainer sinkApp = sinkHelper.Install (sinks);
400  sinkApp.Start (Seconds (start_time * i));
401  sinkApp.Stop (Seconds (stop_time));
402  }
403  else
404  {
405  NS_LOG_DEBUG ("Invalid transport protocol " << transport_prot << " specified");
406  exit (1);
407  }
408  }
409 
410  // Set up tracing if enabled
411  if (tracing)
412  {
413  std::ofstream ascii;
414  Ptr<OutputStreamWrapper> ascii_wrap;
415  ascii.open ((prefix_file_name + "-ascii").c_str ());
416  ascii_wrap = new OutputStreamWrapper ((prefix_file_name + "-ascii").c_str (),
417  std::ios::out);
418  stack.EnableAsciiIpv4All (ascii_wrap);
419 
420  Simulator::Schedule (Seconds (0.00001), &TraceCwnd, prefix_file_name + "-cwnd.data");
421  Simulator::Schedule (Seconds (0.00001), &TraceSsThresh, prefix_file_name + "-ssth.data");
422  Simulator::Schedule (Seconds (0.00001), &TraceRtt, prefix_file_name + "-rtt.data");
423  Simulator::Schedule (Seconds (0.00001), &TraceRto, prefix_file_name + "-rto.data");
424  }
425 
426  if (pcap)
427  {
428  UnReLink.EnablePcapAll (prefix_file_name, true);
429  LocalLink.EnablePcapAll (prefix_file_name, true);
430  }
431 
432  // Flow monitor
433  FlowMonitorHelper flowHelper;
434  if (flow_monitor)
435  {
436  flowHelper.InstallAll ();
437  }
438 
439  Simulator::Stop (Seconds (stop_time));
440  Simulator::Run ();
441 
442  if (flow_monitor)
443  {
444  flowHelper.SerializeToXmlFile (prefix_file_name + ".flowmonitor", true, true);
445  }
446 
448  return 0;
449 }
Protocol header serialization and deserialization.
Definition: header.h:42
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:156
an Inet address class
static Ipv4Address GetAny(void)
void SetStream(int64_t stream)
Specifies the stream number for this RNG stream.
std::pair< Ptr< Ipv4 >, uint32_t > Get(uint32_t i) const
Get the std::pair of an Ptr<Ipv4> and interface stored at the location specified by the index...
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<Ipv4> 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
NetDeviceContainer Install(NodeContainer c)
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:200
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.
static TypeId GetTypeId(void)
Get the type ID.
Definition: tcp-scalable.cc:40
#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:162
A helper to make it easier to instantiate an ns3::PacketSinkApplication on a set of nodes...
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 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 ...
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 TypeId GetTypeId(void)
Get the type ID.
Definition: tcp-bic.cc:29
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<Node> stored in this container.
Class for representing data rates.
Definition: data-rate.h:88
Packet header for IPv4.
Definition: ipv4-header.h:31
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)
static TypeId GetTypeId(void)
Get the type ID.
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:1221
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.
AttributeValue implementation for TypeId.
Definition: type-id.h:548
Callback< R > MakeCallback(R(T::*memPtr)(void), OBJ objPtr)
Definition: callback.h:1489
void ConnectWithoutContext(std::string path, const CallbackBase &cb)
Definition: config.cc:824
Build a set of QueueDisc objects.
static TypeId GetTypeId(void)
Get the type ID.
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:201
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
Definition: log.h:252
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:164
static void CwndTracer(uint32_t oldval, uint32_t newval)
static TypeId GetTypeId(void)
Get the type ID.
static TypeId GetTypeId(void)
Get the type ID.
Definition: tcp-vegas.cc:37
Use number of bytes for maximum queue size.
Definition: queue.h:133
keep track of a set of node pointers.
Hold objects of type Ptr<T>.
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
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:223
tuple stack
Definition: first.py:34
static TypeId GetTypeId(void)
Get the type ID.
Definition: tcp-veno.cc:37
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.
void SetUnit(enum ErrorUnit error_unit)
Definition: error-model.cc:194
AttributeValue implementation for Address.
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...
static TypeId GetTypeId(void)
Get the type ID.
Definition: tcp-hybla.cc:30
void AddValue(const std::string &name, const std::string &help, T &value)
Add a program argument, assigning to POD.
Definition: command-line.h:491
static void Stop(void)
Tell the Simulator the calling event should be the last one executed.
Definition: simulator.cc:208
Ptr< Node > Get(uint32_t i) const
Get the Ptr<Node> stored in this container at a given index.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Definition: log.h:236
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
bool firstCwnd
void SetRandomVariable(Ptr< RandomVariableStream >)
Definition: error-model.cc:215
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)
static TypeId GetTypeId(void)
Get the type ID.
Definition: tcp-yeah.cc:38
static TypeId GetTypeId(void)
Get the type ID.
Definition: tcp-illinois.cc:39
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 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.
Ipv4Address GetAddress(uint32_t i, uint32_t j=0) const
static void TraceRto(std::string rto_tr_file_name)