A Discrete-Event Network Simulator
API
tcp-variants-comparison.cc File Reference
#include <iostream>
#include <fstream>
#include <string>
#include "ns3/core-module.h"
#include "ns3/network-module.h"
#include "ns3/internet-module.h"
#include "ns3/point-to-point-module.h"
#include "ns3/applications-module.h"
#include "ns3/error-model.h"
#include "ns3/tcp-header.h"
#include "ns3/udp-header.h"
#include "ns3/enum.h"
#include "ns3/event-id.h"
#include "ns3/flow-monitor-helper.h"
#include "ns3/ipv4-global-routing-helper.h"
#include "ns3/traffic-control-module.h"
+ Include dependency graph for tcp-variants-comparison.cc:

Go to the source code of this file.

Functions

static void CwndTracer (std::string context, uint32_t oldval, uint32_t newval)
 
static uint32_t GetNodeIdFromContext (std::string context)
 
static void InFlightTracer (std::string context, uint32_t old, uint32_t inFlight)
 
static void NextRxTracer (std::string context, SequenceNumber32 old, SequenceNumber32 nextRx)
 
static void NextTxTracer (std::string context, SequenceNumber32 old, SequenceNumber32 nextTx)
 
static void RtoTracer (std::string context, Time oldval, Time newval)
 
static void RttTracer (std::string context, Time oldval, Time newval)
 
static void SsThreshTracer (std::string context, uint32_t oldval, uint32_t newval)
 
static void TraceCwnd (std::string cwnd_tr_file_name, uint32_t nodeId)
 
static void TraceInFlight (std::string &in_flight_file_name, uint32_t nodeId)
 
static void TraceNextRx (std::string &next_rx_seq_file_name, uint32_t nodeId)
 
static void TraceNextTx (std::string &next_tx_seq_file_name, uint32_t nodeId)
 
static void TraceRto (std::string rto_tr_file_name, uint32_t nodeId)
 
static void TraceRtt (std::string rtt_tr_file_name, uint32_t nodeId)
 
static void TraceSsThresh (std::string ssthresh_tr_file_name, uint32_t nodeId)
 

Variables

static std::map< uint32_t, Ptr< OutputStreamWrapper > > cWndStream
 
static std::map< uint32_t, uint32_tcWndValue
 
static std::map< uint32_t, bool > firstCwnd
 
static std::map< uint32_t, bool > firstRto
 
static std::map< uint32_t, bool > firstRtt
 
static std::map< uint32_t, bool > firstSshThr
 
static std::map< uint32_t, Ptr< OutputStreamWrapper > > inFlightStream
 
static std::map< uint32_t, Ptr< OutputStreamWrapper > > nextRxStream
 
static std::map< uint32_t, Ptr< OutputStreamWrapper > > nextTxStream
 
static std::map< uint32_t, Ptr< OutputStreamWrapper > > rtoStream
 
static std::map< uint32_t, Ptr< OutputStreamWrapper > > rttStream
 
static std::map< uint32_t, Ptr< OutputStreamWrapper > > ssThreshStream
 
static std::map< uint32_t, uint32_tssThreshValue
 

Detailed Description

Usage

$ ./ns3 run "tcp-variants-comparison [Program Options]"

Program Options

--transport_prot
Transport protocol to use: TcpNewReno, TcpLinuxReno, TcpHybla, TcpHighSpeed, TcpHtcp, TcpVegas, TcpScalable, TcpVeno, TcpBic, TcpYeah, TcpIllinois, TcpWestwood, TcpWestwoodPlus, TcpLedbat, TcpLp, TcpDctcp, TcpCubic, TcpBbr [TcpWestwood]
--error_p
Packet error rate [0]
--bandwidth
Bottleneck bandwidth [2Mbps]
--delay
Bottleneck delay [0.01ms]
--access_bandwidth
Access link bandwidth [10Mbps]
--access_delay
Access link delay [45ms]
--tracing
Flag to enable/disable tracing [false]
--prefix_name
Prefix of output trace file [TcpVariantsComparison]
--data
Number of Megabytes of data to transmit [0]
--mtu
Size of IP packets to send in bytes [400]
--num_flows
Number of flows [1]
--duration
Time to allow flows to run in seconds [100]
--run
Run index (for setting repeatable seeds) [0]
--flow_monitor
Enable flow monitor [false]
--pcap_tracing
Enable or disable PCAP tracing [false]
--queue_disc_type
Queue disc type for gateway (e.g. ns3::CoDelQueueDisc) [ns3::PfifoFastQueueDisc]
--sack
Enable or disable SACK option [true]
--recovery
Recovery algorithm type to use (e.g., ns3::TcpPrrRecovery [ns3::TcpClassicRecovery]

Definition in file tcp-variants-comparison.cc.

Function Documentation

◆ CwndTracer()

static void CwndTracer ( std::string  context,
uint32_t  oldval,
uint32_t  newval 
)
static

Definition at line 81 of file tcp-variants-comparison.cc.

References cWndStream, cWndValue, firstCwnd, firstSshThr, GetNodeIdFromContext(), ns3::Time::GetSeconds(), ns3::Now(), ssThreshStream, and ssThreshValue.

Referenced by TraceCwnd().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetNodeIdFromContext()

static uint32_t GetNodeIdFromContext ( std::string  context)
static

Definition at line 73 of file tcp-variants-comparison.cc.

Referenced by CwndTracer(), InFlightTracer(), NextRxTracer(), NextTxTracer(), RtoTracer(), RttTracer(), and SsThreshTracer().

+ Here is the caller graph for this function:

◆ InFlightTracer()

static void InFlightTracer ( std::string  context,
uint32_t  old,
uint32_t  inFlight 
)
static

Definition at line 154 of file tcp-variants-comparison.cc.

References GetNodeIdFromContext(), ns3::Time::GetSeconds(), inFlightStream, and ns3::Now().

Referenced by TraceInFlight().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ NextRxTracer()

static void NextRxTracer ( std::string  context,
SequenceNumber32  old,
SequenceNumber32  nextRx 
)
static

Definition at line 162 of file tcp-variants-comparison.cc.

References GetNodeIdFromContext(), ns3::Time::GetSeconds(), nextRxStream, and ns3::Now().

Referenced by TraceNextRx().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ NextTxTracer()

static void NextTxTracer ( std::string  context,
SequenceNumber32  old,
SequenceNumber32  nextTx 
)
static

Definition at line 146 of file tcp-variants-comparison.cc.

References GetNodeIdFromContext(), ns3::Time::GetSeconds(), nextTxStream, and ns3::Now().

Referenced by TraceNextTx().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ RtoTracer()

static void RtoTracer ( std::string  context,
Time  oldval,
Time  newval 
)
static

Definition at line 133 of file tcp-variants-comparison.cc.

References firstRto, GetNodeIdFromContext(), ns3::Time::GetSeconds(), ns3::Now(), and rtoStream.

Referenced by TraceRto().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ RttTracer()

static void RttTracer ( std::string  context,
Time  oldval,
Time  newval 
)
static

Definition at line 120 of file tcp-variants-comparison.cc.

References firstRtt, GetNodeIdFromContext(), ns3::Time::GetSeconds(), ns3::Now(), and rttStream.

Referenced by TraceRtt().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SsThreshTracer()

static void SsThreshTracer ( std::string  context,
uint32_t  oldval,
uint32_t  newval 
)
static

Definition at line 101 of file tcp-variants-comparison.cc.

References cWndStream, cWndValue, firstCwnd, firstSshThr, GetNodeIdFromContext(), ns3::Time::GetSeconds(), ns3::Now(), ssThreshStream, and ssThreshValue.

Referenced by TraceSsThresh().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ TraceCwnd()

static void TraceCwnd ( std::string  cwnd_tr_file_name,
uint32_t  nodeId 
)
static

Definition at line 170 of file tcp-variants-comparison.cc.

References ns3::Config::Connect(), ns3::AsciiTraceHelper::CreateFileStream(), cWndStream, CwndTracer(), and ns3::MakeCallback().

+ Here is the call graph for this function:

◆ TraceInFlight()

static void TraceInFlight ( std::string &  in_flight_file_name,
uint32_t  nodeId 
)
static

Definition at line 215 of file tcp-variants-comparison.cc.

References ns3::Config::Connect(), ns3::AsciiTraceHelper::CreateFileStream(), inFlightStream, InFlightTracer(), and ns3::MakeCallback().

+ Here is the call graph for this function:

◆ TraceNextRx()

static void TraceNextRx ( std::string &  next_rx_seq_file_name,
uint32_t  nodeId 
)
static

Definition at line 224 of file tcp-variants-comparison.cc.

References ns3::Config::Connect(), ns3::AsciiTraceHelper::CreateFileStream(), ns3::MakeCallback(), nextRxStream, and NextRxTracer().

+ Here is the call graph for this function:

◆ TraceNextTx()

static void TraceNextTx ( std::string &  next_tx_seq_file_name,
uint32_t  nodeId 
)
static

Definition at line 206 of file tcp-variants-comparison.cc.

References ns3::Config::Connect(), ns3::AsciiTraceHelper::CreateFileStream(), ns3::MakeCallback(), nextTxStream, and NextTxTracer().

+ Here is the call graph for this function:

◆ TraceRto()

static void TraceRto ( std::string  rto_tr_file_name,
uint32_t  nodeId 
)
static

Definition at line 197 of file tcp-variants-comparison.cc.

References ns3::Config::Connect(), ns3::AsciiTraceHelper::CreateFileStream(), ns3::MakeCallback(), rtoStream, and RtoTracer().

+ Here is the call graph for this function:

◆ TraceRtt()

static void TraceRtt ( std::string  rtt_tr_file_name,
uint32_t  nodeId 
)
static

Definition at line 188 of file tcp-variants-comparison.cc.

References ns3::Config::Connect(), ns3::AsciiTraceHelper::CreateFileStream(), ns3::MakeCallback(), rttStream, and RttTracer().

+ Here is the call graph for this function:

◆ TraceSsThresh()

static void TraceSsThresh ( std::string  ssthresh_tr_file_name,
uint32_t  nodeId 
)
static

Definition at line 179 of file tcp-variants-comparison.cc.

References ns3::Config::Connect(), ns3::AsciiTraceHelper::CreateFileStream(), ns3::MakeCallback(), ssThreshStream, and SsThreshTracer().

+ Here is the call graph for this function:

Variable Documentation

◆ cWndStream

std::map<uint32_t, Ptr<OutputStreamWrapper> > cWndStream
static

Definition at line 62 of file tcp-variants-comparison.cc.

Referenced by CwndTracer(), SsThreshTracer(), and TraceCwnd().

◆ cWndValue

std::map<uint32_t, uint32_t> cWndValue
static

Definition at line 69 of file tcp-variants-comparison.cc.

Referenced by CwndTracer(), and SsThreshTracer().

◆ firstCwnd

std::map<uint32_t, bool> firstCwnd
static

Definition at line 58 of file tcp-variants-comparison.cc.

Referenced by CwndTracer(), and SsThreshTracer().

◆ firstRto

std::map<uint32_t, bool> firstRto
static

Definition at line 61 of file tcp-variants-comparison.cc.

Referenced by RtoTracer().

◆ firstRtt

std::map<uint32_t, bool> firstRtt
static

Definition at line 60 of file tcp-variants-comparison.cc.

Referenced by RttTracer().

◆ firstSshThr

std::map<uint32_t, bool> firstSshThr
static

Definition at line 59 of file tcp-variants-comparison.cc.

Referenced by CwndTracer(), and SsThreshTracer().

◆ inFlightStream

std::map<uint32_t, Ptr<OutputStreamWrapper> > inFlightStream
static

Definition at line 68 of file tcp-variants-comparison.cc.

Referenced by InFlightTracer(), and TraceInFlight().

◆ nextRxStream

std::map<uint32_t, Ptr<OutputStreamWrapper> > nextRxStream
static

Definition at line 67 of file tcp-variants-comparison.cc.

Referenced by NextRxTracer(), and TraceNextRx().

◆ nextTxStream

std::map<uint32_t, Ptr<OutputStreamWrapper> > nextTxStream
static

Definition at line 66 of file tcp-variants-comparison.cc.

Referenced by NextTxTracer(), and TraceNextTx().

◆ rtoStream

std::map<uint32_t, Ptr<OutputStreamWrapper> > rtoStream
static

Definition at line 65 of file tcp-variants-comparison.cc.

Referenced by RtoTracer(), and TraceRto().

◆ rttStream

std::map<uint32_t, Ptr<OutputStreamWrapper> > rttStream
static

Definition at line 64 of file tcp-variants-comparison.cc.

Referenced by RttTracer(), and TraceRtt().

◆ ssThreshStream

std::map<uint32_t, Ptr<OutputStreamWrapper> > ssThreshStream
static

Definition at line 63 of file tcp-variants-comparison.cc.

Referenced by CwndTracer(), SsThreshTracer(), and TraceSsThresh().

◆ ssThreshValue

std::map<uint32_t, uint32_t> ssThreshValue
static

Definition at line 70 of file tcp-variants-comparison.cc.

Referenced by CwndTracer(), and SsThreshTracer().