A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
tcp-ecn-example.cc File Reference
#include "ns3/applications-module.h"
#include "ns3/core-module.h"
#include "ns3/flow-monitor-module.h"
#include "ns3/internet-module.h"
#include "ns3/network-module.h"
#include "ns3/point-to-point-module.h"
#include "ns3/traffic-control-module.h"
#include <filesystem>
+ Include dependency graph for tcp-ecn-example.cc:

Go to the source code of this file.

Functions

void CheckQueueSize (Ptr< QueueDisc > qd)
 Checks the queue size of the queue discipline.
 
static void CwndTracer (Ptr< OutputStreamWrapper > stream, uint32_t oldval, uint32_t newval)
 Writes the cWnd to the output stream.
 
void TraceCwnd (uint32_t nodeId, uint32_t socketId)
 Traces the congestion window of the socket.
 
static void TraceThroughput (Ptr< FlowMonitor > monitor)
 Traces the throughput of the flow monitor.
 

Variables

std::string dir
 The directory where the output files will be stored.
 
uint32_t prev = 0
 Previous transmitted bytes.
 
Time prevTime
 Previous time for throughput calculation.
 
std::ofstream queueSize
 The stream where the queue size will be stored.
 
std::ofstream throughput
 The stream where the throughput will be stored.
 

Detailed Description

Usage

$ ./ns3 run "tcp-ecn-example [Program Options]"

Program Options

--tcpTypeId
Transport protocol to use: TcpNewReno,TcpCubic, TcpLinuxReno [TcpCubic]
--delAckCount
Delayed ACK count [2]
--enablePcap
Enable/Disable pcap file generation [false]
--useEcn
Enable/Disable ECN [true]
--useAbe
Enable/Disable ABE [false]
--stopTime
Stop time for applications / simulation time will be stopTime + 1 [+1.66667min]

Definition in file tcp-ecn-example.cc.

Function Documentation

◆ CheckQueueSize()

void CheckQueueSize ( Ptr< QueueDisc > qd)

Checks the queue size of the queue discipline.

Parameters
qdThe queue discipline to check.

Definition at line 97 of file tcp-ecn-example.cc.

References CheckQueueSize(), ns3::Time::GetSeconds(), ns3::Simulator::Now(), queueSize, ns3::Simulator::Schedule(), and ns3::Seconds().

+ Here is the call graph for this function:

◆ CwndTracer()

static void CwndTracer ( Ptr< OutputStreamWrapper > stream,
uint32_t oldval,
uint32_t newval )
static

Writes the cWnd to the output stream.

Parameters
streamThe output stream to write to.
oldvalThe old congestion window value.
newvalThe new congestion window value.

Definition at line 111 of file tcp-ecn-example.cc.

References ns3::Time::GetSeconds(), and ns3::Simulator::Now().

+ Here is the call graph for this function:

◆ TraceCwnd()

void TraceCwnd ( uint32_t nodeId,
uint32_t socketId )

Traces the congestion window of the socket.

Parameters
nodeIdThe node ID of the socket.
socketIdThe socket ID of the socket.

Definition at line 122 of file tcp-ecn-example.cc.

References ns3::Config::ConnectWithoutContext(), ns3::AsciiTraceHelper::CreateFileStream(), CwndTracer(), dir, and ns3::MakeBoundCallback().

+ Here is the call graph for this function:

◆ TraceThroughput()

static void TraceThroughput ( Ptr< FlowMonitor > monitor)
static

Traces the throughput of the flow monitor.

Parameters
monitorThe flow monitor to trace.

Definition at line 73 of file tcp-ecn-example.cc.

References ns3::Time::GetSeconds(), ns3::Now(), prev, prevTime, ns3::Simulator::Schedule(), ns3::Seconds(), throughput, TraceThroughput(), and ns3::Time::US.

+ Here is the call graph for this function:

Variable Documentation

◆ dir

std::string dir

The directory where the output files will be stored.

Definition at line 61 of file tcp-ecn-example.cc.

◆ prev

uint32_t prev = 0

Previous transmitted bytes.

Definition at line 65 of file tcp-ecn-example.cc.

◆ prevTime

Time prevTime

Previous time for throughput calculation.

Definition at line 66 of file tcp-ecn-example.cc.

◆ queueSize

std::ofstream queueSize

The stream where the queue size will be stored.

Definition at line 63 of file tcp-ecn-example.cc.

◆ throughput

std::ofstream throughput

The stream where the throughput will be stored.

Definition at line 62 of file tcp-ecn-example.cc.