A Discrete-Event Network Simulator
QKDNetSim v2.0 (NS-3 v3.41) @ (+)
API
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
tcp-large-transfer.cc File Reference
#include "ns3/applications-module.h"
#include "ns3/core-module.h"
#include "ns3/internet-module.h"
#include "ns3/ipv4-global-routing-helper.h"
#include "ns3/network-module.h"
#include "ns3/point-to-point-module.h"
#include <fstream>
#include <iostream>
#include <string>
+ Include dependency graph for tcp-large-transfer.cc:

Go to the source code of this file.

Functions

static void CwndTracer (uint32_t oldval, uint32_t newval)
 Congestion window tracker function. More...
 
void StartFlow (Ptr< Socket > localSocket, Ipv4Address servAddress, uint16_t servPort)
 Start a flow. More...
 
void WriteUntilBufferFull (Ptr< Socket > localSocket, uint32_t txSpace)
 Write to the buffer, filling it. More...
 

Variables

static uint32_t currentTxBytes = 0
 The actual number of sent bytes. More...
 
uint8_t data [writeSize]
 Data to be written. More...
 
static const uint32_t totalTxBytes = 2000000
 The number of bytes to send in this simulation. More...
 
static const uint32_t writeSize = 1040
 Write size. More...
 

Function Documentation

◆ CwndTracer()

static void CwndTracer ( uint32_t  oldval,
uint32_t  newval 
)
static

Congestion window tracker function.

Parameters
oldvalOld value.
newvalNew value.

Definition at line 87 of file tcp-large-transfer.cc.

References NS_LOG_INFO.

◆ StartFlow()

void StartFlow ( Ptr< Socket localSocket,
Ipv4Address  servAddress,
uint16_t  servPort 
)

Start a flow.

Parameters
localSocketThe local (sending) socket.
servAddressThe server address.
servPortThe server port.

Definition at line 210 of file tcp-large-transfer.cc.

References ns3::Socket::Connect(), ns3::Socket::GetTxAvailable(), ns3::MakeCallback(), ns3::Simulator::Now(), NS_LOG_LOGIC, ns3::Socket::SetSendCallback(), and WriteUntilBufferFull().

+ Here is the call graph for this function:

◆ WriteUntilBufferFull()

void WriteUntilBufferFull ( Ptr< Socket localSocket,
uint32_t  txSpace 
)

Write to the buffer, filling it.

Parameters
localSocketThe socket.
txSpaceThe number of bytes to write.

Definition at line 222 of file tcp-large-transfer.cc.

References ns3::Socket::Close(), currentTxBytes, data, ns3::Socket::GetTxAvailable(), min, ns3::Socket::Send(), totalTxBytes, and writeSize.

Referenced by StartFlow().

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

Variable Documentation

◆ currentTxBytes

uint32_t currentTxBytes = 0
static

The actual number of sent bytes.

Definition at line 49 of file tcp-large-transfer.cc.

Referenced by WriteUntilBufferFull().

◆ data

uint8_t data[writeSize]

Data to be written.

Definition at line 56 of file tcp-large-transfer.cc.

Referenced by WriteUntilBufferFull().

◆ totalTxBytes

const uint32_t totalTxBytes = 2000000
static

The number of bytes to send in this simulation.

Definition at line 47 of file tcp-large-transfer.cc.

Referenced by WriteUntilBufferFull().

◆ writeSize

const uint32_t writeSize = 1040
static

Write size.

Definition at line 54 of file tcp-large-transfer.cc.

Referenced by WriteUntilBufferFull().