A Discrete-Event Network Simulator
API
tcp-validation.cc File Reference
#include "ns3/applications-module.h"
#include "ns3/core-module.h"
#include "ns3/internet-apps-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 <fstream>
#include <iostream>
#include <string>
+ Include dependency graph for tcp-validation.cc:

Go to the source code of this file.

Functions

void ScheduleFirstDctcpTraceConnection (std::ofstream *ofStream)
 Schedule trace connection. More...
 
void ScheduleFirstPacketSinkConnection ()
 Schedule trace connection. More...
 
void ScheduleFirstTcpCwndTraceConnection (std::ofstream *ofStream)
 Schedule trace connection. More...
 
void ScheduleFirstTcpRttTraceConnection (std::ofstream *ofStream)
 Schedule trace connection. More...
 
void ScheduleSecondDctcpTraceConnection (std::ofstream *ofStream)
 Schedule trace connection. More...
 
void ScheduleSecondPacketSinkConnection ()
 Schedule trace connection. More...
 
void ScheduleSecondTcpCwndTraceConnection (std::ofstream *ofStream)
 Schedule trace connection. More...
 
void ScheduleSecondTcpRttTraceConnection (std::ofstream *ofStream)
 Schedule trace connection. More...
 
void TraceFirstCwnd (std::ofstream *ofStream, uint32_t oldCwnd, uint32_t newCwnd)
 Trace first congestion window. More...
 
void TraceFirstDctcp (std::ofstream *ofStream, uint32_t bytesMarked, uint32_t bytesAcked, double alpha)
 Trace first TcpDctcp. More...
 
void TraceFirstRtt (std::ofstream *ofStream, Time oldRtt, Time newRtt)
 Trace first RTT. More...
 
void TraceFirstRx (Ptr< const Packet > packet, const Address &address)
 Trace first Rx. More...
 
void TraceFirstThroughput (std::ofstream *ofStream, Time throughputInterval)
 Trace the first throughput. More...
 
void TraceMarksFrequency (std::ofstream *ofStream, Time marksSamplingInterval)
 Trace marks frequency. More...
 
void TracePingRtt (std::ofstream *ofStream, uint16_t, Time rtt)
 Trace ping RTT. More...
 
void TraceQueueDrop (std::ofstream *ofStream, Ptr< const QueueDiscItem > item)
 Trace queue drop. More...
 
void TraceQueueLength (std::ofstream *ofStream, DataRate queueLinkRate, uint32_t oldVal, uint32_t newVal)
 Trace queue length. More...
 
void TraceQueueMark (std::ofstream *ofStream, Ptr< const QueueDiscItem > item, const char *reason)
 Trace queue marks. More...
 
void TraceSecondCwnd (std::ofstream *ofStream, uint32_t oldCwnd, uint32_t newCwnd)
 Trace second congestion window. More...
 
void TraceSecondDctcp (std::ofstream *ofStream, uint32_t bytesMarked, uint32_t bytesAcked, double alpha)
 Trace second TcpDctcp. More...
 
void TraceSecondRtt (std::ofstream *ofStream, Time oldRtt, Time newRtt)
 Trace second RTT. More...
 
void TraceSecondRx (Ptr< const Packet > packet, const Address &address)
 Trace second Rx. More...
 
void TraceSecondThroughput (std::ofstream *ofStream, Time throughputInterval)
 Trace the second throughput. More...
 

Variables

uint32_t g_dropsObserved = 0
 Number of dropped packets observed. More...
 
uint32_t g_firstBytesReceived = 0
 First received packet size. More...
 
uint32_t g_marksObserved = 0
 Number of marked packets observed. More...
 
uint32_t g_secondBytesReceived = 0
 Second received packet size. More...
 
std::string g_validate = ""
 Empty string disables validation. More...
 
bool g_validationFailed = false
 True if validation failed. More...
 

Function Documentation

◆ ScheduleFirstDctcpTraceConnection()

void ScheduleFirstDctcpTraceConnection ( std::ofstream *  ofStream)

Schedule trace connection.

Parameters
ofStreamOutput filestream.

Definition at line 551 of file tcp-validation.cc.

References ns3::Config::ConnectWithoutContextFailSafe(), ns3::MakeBoundCallback(), and TraceFirstDctcp().

+ Here is the call graph for this function:

◆ ScheduleFirstPacketSinkConnection()

void ScheduleFirstPacketSinkConnection ( )

Schedule trace connection.

Definition at line 575 of file tcp-validation.cc.

References ns3::Config::ConnectWithoutContextFailSafe(), ns3::MakeCallback(), and TraceFirstRx().

+ Here is the call graph for this function:

◆ ScheduleFirstTcpCwndTraceConnection()

void ScheduleFirstTcpCwndTraceConnection ( std::ofstream *  ofStream)

Schedule trace connection.

Parameters
ofStreamOutput filestream.

Definition at line 526 of file tcp-validation.cc.

References ns3::Config::ConnectWithoutContextFailSafe(), ns3::MakeBoundCallback(), and TraceFirstCwnd().

+ Here is the call graph for this function:

◆ ScheduleFirstTcpRttTraceConnection()

void ScheduleFirstTcpRttTraceConnection ( std::ofstream *  ofStream)

Schedule trace connection.

Parameters
ofStreamOutput filestream.

Definition at line 539 of file tcp-validation.cc.

References ns3::Config::ConnectWithoutContextFailSafe(), ns3::MakeBoundCallback(), and TraceFirstRtt().

+ Here is the call graph for this function:

◆ ScheduleSecondDctcpTraceConnection()

void ScheduleSecondDctcpTraceConnection ( std::ofstream *  ofStream)

Schedule trace connection.

Parameters
ofStreamOutput filestream.

Definition at line 564 of file tcp-validation.cc.

References ns3::Config::ConnectWithoutContextFailSafe(), ns3::MakeBoundCallback(), and TraceSecondDctcp().

+ Here is the call graph for this function:

◆ ScheduleSecondPacketSinkConnection()

void ScheduleSecondPacketSinkConnection ( )

Schedule trace connection.

Definition at line 609 of file tcp-validation.cc.

References ns3::Config::ConnectWithoutContext(), ns3::MakeCallback(), and TraceSecondRx().

+ Here is the call graph for this function:

◆ ScheduleSecondTcpCwndTraceConnection()

void ScheduleSecondTcpCwndTraceConnection ( std::ofstream *  ofStream)

Schedule trace connection.

Parameters
ofStreamOutput filestream.

Definition at line 587 of file tcp-validation.cc.

References ns3::Config::ConnectWithoutContext(), ns3::MakeBoundCallback(), and TraceSecondCwnd().

+ Here is the call graph for this function:

◆ ScheduleSecondTcpRttTraceConnection()

void ScheduleSecondTcpRttTraceConnection ( std::ofstream *  ofStream)

Schedule trace connection.

Parameters
ofStreamOutput filestream.

Definition at line 599 of file tcp-validation.cc.

References ns3::Config::ConnectWithoutContext(), ns3::MakeBoundCallback(), and TraceSecondRtt().

+ Here is the call graph for this function:

◆ TraceFirstCwnd()

void TraceFirstCwnd ( std::ofstream *  ofStream,
uint32_t  oldCwnd,
uint32_t  newCwnd 
)

Trace first congestion window.

Parameters
ofStreamOutput filestream.
oldCwndOld value.
newCwndnew value.

Definition at line 180 of file tcp-validation.cc.

References g_validate, g_validationFailed, ns3::Time::GetSeconds(), ns3::Now(), ns3::Simulator::Now(), NS_LOG_WARN, and ns3::Time::S.

Referenced by ScheduleFirstTcpCwndTraceConnection().

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

◆ TraceFirstDctcp()

void TraceFirstDctcp ( std::ofstream *  ofStream,
uint32_t  bytesMarked,
uint32_t  bytesAcked,
double  alpha 
)

Trace first TcpDctcp.

Parameters
ofStreamOutput filestream.
bytesMarkedBytes marked.
bytesAckedBytes ACKed.
alphaAlpha.

Definition at line 226 of file tcp-validation.cc.

References g_validate, g_validationFailed, ns3::Time::GetSeconds(), ns3::Now(), ns3::Simulator::Now(), NS_LOG_WARN, and ns3::Time::S.

Referenced by ScheduleFirstDctcpTraceConnection().

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

◆ TraceFirstRtt()

void TraceFirstRtt ( std::ofstream *  ofStream,
Time  oldRtt,
Time  newRtt 
)

Trace first RTT.

Parameters
ofStreamOutput filestream.
oldRttOld value.
newRttNew value.

Definition at line 278 of file tcp-validation.cc.

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

Referenced by ScheduleFirstTcpRttTraceConnection().

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

◆ TraceFirstRx()

void TraceFirstRx ( Ptr< const Packet packet,
const Address address 
)

Trace first Rx.

Parameters
packetThe packet.
addressThe sender address.

Definition at line 362 of file tcp-validation.cc.

References g_firstBytesReceived, and ns3::Packet::GetSize().

Referenced by ScheduleFirstPacketSinkConnection().

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

◆ TraceFirstThroughput()

void TraceFirstThroughput ( std::ofstream *  ofStream,
Time  throughputInterval 
)

Trace the first throughput.

Parameters
ofStreamOutput filestream.
throughputIntervalThe throughput interval.

Definition at line 459 of file tcp-validation.cc.

References g_firstBytesReceived, g_validate, g_validationFailed, ns3::Time::GetSeconds(), ns3::Now(), ns3::Simulator::Now(), NS_LOG_WARN, ns3::Time::S, ns3::Simulator::Schedule(), and throughput.

+ Here is the call graph for this function:

◆ TraceMarksFrequency()

void TraceMarksFrequency ( std::ofstream *  ofStream,
Time  marksSamplingInterval 
)

Trace marks frequency.

Parameters
ofStreamOutput filestream.
marksSamplingIntervalThe mark sampling interval.

Definition at line 439 of file tcp-validation.cc.

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

+ Here is the call graph for this function:

◆ TracePingRtt()

void TracePingRtt ( std::ofstream *  ofStream,
uint16_t  ,
Time  rtt 
)

Trace ping RTT.

Parameters
ofStreamOutput filestream.
rttRTT value.

Definition at line 347 of file tcp-validation.cc.

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

+ Here is the call graph for this function:

◆ TraceQueueDrop()

void TraceQueueDrop ( std::ofstream *  ofStream,
Ptr< const QueueDiscItem item 
)

Trace queue drop.

Parameters
ofStreamOutput filestream.
itemThe dropped QueueDiscItem.

Definition at line 386 of file tcp-validation.cc.

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

+ Here is the call graph for this function:

◆ TraceQueueLength()

void TraceQueueLength ( std::ofstream *  ofStream,
DataRate  queueLinkRate,
uint32_t  oldVal,
uint32_t  newVal 
)

Trace queue length.

Parameters
ofStreamOutput filestream.
queueLinkRateQueue link rate.
oldValOld value.
newValNew value.

Definition at line 421 of file tcp-validation.cc.

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

+ Here is the call graph for this function:

◆ TraceQueueMark()

void TraceQueueMark ( std::ofstream *  ofStream,
Ptr< const QueueDiscItem item,
const char *  reason 
)

Trace queue marks.

Parameters
ofStreamOutput filestream.
itemThe marked QueueDiscItem.
reasonThe reason.

Definition at line 403 of file tcp-validation.cc.

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

+ Here is the call graph for this function:

◆ TraceSecondCwnd()

void TraceSecondCwnd ( std::ofstream *  ofStream,
uint32_t  oldCwnd,
uint32_t  newCwnd 
)

Trace second congestion window.

Parameters
ofStreamOutput filestream.
oldCwndOld value.
newCwndnew value.

Definition at line 295 of file tcp-validation.cc.

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

Referenced by ScheduleSecondTcpCwndTraceConnection().

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

◆ TraceSecondDctcp()

void TraceSecondDctcp ( std::ofstream *  ofStream,
uint32_t  bytesMarked,
uint32_t  bytesAcked,
double  alpha 
)

Trace second TcpDctcp.

Parameters
ofStreamOutput filestream.
bytesMarkedBytes marked.
bytesAckedBytes ACKed.
alphaAlpha.

Definition at line 332 of file tcp-validation.cc.

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

Referenced by ScheduleSecondDctcpTraceConnection().

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

◆ TraceSecondRtt()

void TraceSecondRtt ( std::ofstream *  ofStream,
Time  oldRtt,
Time  newRtt 
)

Trace second RTT.

Parameters
ofStreamOutput filestream.
oldRttOld value.
newRttNew value.

Definition at line 314 of file tcp-validation.cc.

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

Referenced by ScheduleSecondTcpRttTraceConnection().

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

◆ TraceSecondRx()

void TraceSecondRx ( Ptr< const Packet packet,
const Address address 
)

Trace second Rx.

Parameters
packetThe packet.
addressThe sender address.

Definition at line 374 of file tcp-validation.cc.

References g_secondBytesReceived, and ns3::Packet::GetSize().

Referenced by ScheduleSecondPacketSinkConnection().

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

◆ TraceSecondThroughput()

void TraceSecondThroughput ( std::ofstream *  ofStream,
Time  throughputInterval 
)

Trace the second throughput.

Parameters
ofStreamOutput filestream.
throughputIntervalThe throughput interval.

Definition at line 509 of file tcp-validation.cc.

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

+ Here is the call graph for this function:

Variable Documentation

◆ g_dropsObserved

uint32_t g_dropsObserved = 0

Number of dropped packets observed.

Definition at line 168 of file tcp-validation.cc.

Referenced by TraceQueueDrop().

◆ g_firstBytesReceived

uint32_t g_firstBytesReceived = 0

First received packet size.

Definition at line 165 of file tcp-validation.cc.

Referenced by TraceFirstRx(), and TraceFirstThroughput().

◆ g_marksObserved

uint32_t g_marksObserved = 0

Number of marked packets observed.

Definition at line 167 of file tcp-validation.cc.

Referenced by TraceMarksFrequency(), and TraceQueueMark().

◆ g_secondBytesReceived

uint32_t g_secondBytesReceived = 0

Second received packet size.

Definition at line 166 of file tcp-validation.cc.

Referenced by TraceSecondRx(), and TraceSecondThroughput().

◆ g_validate

◆ g_validationFailed

bool g_validationFailed = false

True if validation failed.

Definition at line 170 of file tcp-validation.cc.

Referenced by TraceFirstCwnd(), TraceFirstDctcp(), and TraceFirstThroughput().