A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ns3::TcpGeneralTest Class Reference

General infrastructure for TCP testing. More...

#include "tcp-general-test.h"

+ Inheritance diagram for ns3::TcpGeneralTest:
+ Collaboration diagram for ns3::TcpGeneralTest:

Public Types

enum  SocketWho { SENDER , RECEIVER }
 Used as parameter of methods, specifies on what node the caller is interested (e.g. More...
 
- Public Types inherited from ns3::TestCase
enum  TestDuration { QUICK = 1 , EXTENSIVE = 2 , TAKES_FOREVER = 3 }
 How long the test takes to execute. More...
 

Public Member Functions

 TcpGeneralTest (const std::string &desc)
 TcpGeneralTest constructor.
 
 ~TcpGeneralTest () override
 
- Public Member Functions inherited from ns3::TestCase
 TestCase (const TestCase &)=delete
 
virtual ~TestCase ()
 Destructor.
 
std::string GetName () const
 
TestCaseoperator= (const TestCase &)=delete
 

Protected Member Functions

virtual void AfterRTOExpired (const Ptr< const TcpSocketState > tcb, SocketWho who)
 Rto has expired.
 
virtual void BeforeRTOExpired (const Ptr< const TcpSocketState > tcb, SocketWho who)
 Rto has expired.
 
virtual void BytesInFlightTrace (uint32_t oldValue, uint32_t newValue)
 Bytes in flight changes.
 
virtual void ConfigureEnvironment ()
 Change the configuration of the environment.
 
virtual void ConfigureProperties ()
 Change the configuration of the socket properties.
 
virtual void CongStateTrace (const TcpSocketState::TcpCongState_t oldValue, const TcpSocketState::TcpCongState_t newValue)
 State on Ack state machine changes.
 
virtual Ptr< SimpleChannelCreateChannel ()
 Create and return the channel installed between the two socket.
 
virtual Ptr< ErrorModelCreateReceiverErrorModel ()
 Create and return the error model to install in the receiver node.
 
virtual Ptr< TcpSocketMsgBaseCreateReceiverSocket (Ptr< Node > node)
 Create and install the socket to install on the receiver.
 
virtual Ptr< ErrorModelCreateSenderErrorModel ()
 Create and return the error model to install in the sender node.
 
virtual Ptr< TcpSocketMsgBaseCreateSenderSocket (Ptr< Node > node)
 Create and install the socket to install on the sender.
 
virtual Ptr< TcpSocketMsgBaseCreateSocket (Ptr< Node > node, TypeId socketType, TypeId congControl)
 Create a socket.
 
virtual Ptr< TcpSocketMsgBaseCreateSocket (Ptr< Node > node, TypeId socketType, TypeId congControl, TypeId recoveryAlgorithm)
 Create a socket.
 
virtual void CWndInflTrace (uint32_t oldValue, uint32_t newValue)
 Tracks the inflated congestion window changes.
 
virtual void CWndTrace (uint32_t oldValue, uint32_t newValue)
 Tracks the congestion window changes.
 
virtual void DataSent (uint32_t size, SocketWho who)
 Notifying application for sent data.
 
void DoConnect ()
 Scheduled at 0.0, SENDER starts the connection to RECEIVER.
 
void DoRun () override
 Execute the tcp test.
 
void DoTeardown () override
 Teardown the TCP test.
 
virtual void ErrorClose (SocketWho who)
 Socket closed with an error.
 
virtual void FinalChecks ()
 Performs the (eventual) final checks through test asserts.
 
Time GetClockGranularity (SocketWho who)
 Get the clock granularity attribute.
 
Time GetConnTimeout (SocketWho who)
 Get the retransmission time for the SYN segments.
 
uint32_t GetDelAckCount (SocketWho who)
 Get the number of delayed ack (if present)
 
Time GetDelAckTimeout (SocketWho who)
 Get the timeout of delayed ack (if present)
 
uint32_t GetDupAckCount (SocketWho who)
 Get the number of dupack received.
 
SequenceNumber32 GetHighestTxMark (SocketWho who)
 Get the highest tx mark of the node specified.
 
uint32_t GetInitialCwnd (SocketWho who)
 Get the initial congestion window.
 
uint32_t GetInitialSsThresh (SocketWho who)
 Get the initial slow start threshold.
 
Time GetMinRto (SocketWho who)
 Get the minimum RTO attribute.
 
uint32_t GetMtu () const
 Get the MTU of the environment.
 
EventId GetPersistentEvent (SocketWho who)
 Get the persistent event of the selected socket.
 
Time GetPersistentTimeout (SocketWho who)
 Get the persistent timeout of the selected socket.
 
uint32_t GetPktCount () const
 Get the number of application packets.
 
Time GetPktInterval () const
 Get the interval to wait for each packet sent down from application to TCP.
 
uint32_t GetPktSize () const
 Get the application packet size.
 
Time GetPropagationDelay () const
 Get the channel Propagation Delay.
 
Ptr< TcpSocketMsgBaseGetReceiverSocket ()
 Get the pointer to a previously created receiver socket.
 
uint32_t GetReTxThreshold (SocketWho who)
 Get the retransmission threshold.
 
Time GetRto (SocketWho who)
 Get the retransmission time.
 
Ptr< RttEstimatorGetRttEstimator (SocketWho who)
 Get the Rtt estimator of the socket.
 
uint32_t GetRWnd (SocketWho who)
 Get the rWnd of the selected socket.
 
Ptr< TcpRxBufferGetRxBuffer (SocketWho who)
 Get the Rx buffer from selected socket.
 
uint32_t GetSegSize (SocketWho who)
 Get the segment size of the node specified.
 
Ptr< TcpSocketMsgBaseGetSenderSocket ()
 Get the pointer to a previously created sender socket.
 
Time GetStartTime () const
 Get the data start time.
 
Ptr< TcpSocketStateGetTcb (SocketWho who)
 Get the TCB from selected socket.
 
TcpSocket::TcpStates_t GetTcpState (SocketWho who)
 Get the state of the TCP state machine.
 
Ptr< TcpTxBufferGetTxBuffer (SocketWho who)
 Get the Tx buffer from selected socket.
 
virtual void HighestTxSeqTrace (SequenceNumber32 oldValue, SequenceNumber32 newValue)
 Highest tx seq changes.
 
virtual void NextTxSeqTrace (SequenceNumber32 oldValue, SequenceNumber32 newValue)
 Next tx seq changes.
 
virtual void NormalClose (SocketWho who)
 Socket closed normally.
 
virtual void PhyDrop (SocketWho who)
 Link drop.
 
virtual void ProcessedAck (const Ptr< const TcpSocketState > tcb, const TcpHeader &h, SocketWho who)
 Processed ack.
 
virtual void QueueDrop (SocketWho who)
 Drop on the queue.
 
virtual void RateSampleUpdatedTrace (const TcpRateLinux::TcpRateSample &sample)
 Track the rate sample value of TcpRateLinux.
 
virtual void RateUpdatedTrace (const TcpRateLinux::TcpRateConnection &rate)
 Track the rate value of TcpRateLinux.
 
virtual void RcvAck (const Ptr< const TcpSocketState > tcb, const TcpHeader &h, SocketWho who)
 Received ack.
 
virtual void ReceivePacket (Ptr< Socket > socket)
 Packet received.
 
virtual void RtoTrace (Time oldValue, Time newValue)
 RTO changes.
 
virtual void RttTrace (Time oldTime, Time newTime)
 Rtt changes.
 
virtual void Rx (const Ptr< const Packet > p, const TcpHeader &h, SocketWho who)
 Packet received from IP layer.
 
void SendPacket (Ptr< Socket > socket, uint32_t pktSize, uint32_t pktCount, Time pktInterval)
 Send packets to other endpoint.
 
void SetAppPktCount (uint32_t pktCount)
 Set app packet count.
 
void SetAppPktInterval (Time pktInterval)
 Interval between app-generated packet.
 
void SetAppPktSize (uint32_t pktSize)
 Set app packet size.
 
void SetCongestionControl (TypeId congControl)
 Congestion control of the sender socket.
 
void SetDelAckMaxCount (SocketWho who, uint32_t count)
 Forcefully set the delayed acknowledgement count.
 
void SetInitialCwnd (SocketWho who, uint32_t initialCwnd)
 Forcefully set the initial cwnd.
 
void SetInitialSsThresh (SocketWho who, uint32_t initialSsThresh)
 Forcefully set the initial ssthresh.
 
void SetMTU (uint32_t mtu)
 MTU of the bottleneck link.
 
void SetPaceInitialWindow (SocketWho who, bool paceWindow)
 Enable or disable pacing of the initial window.
 
void SetPacingStatus (SocketWho who, bool pacing)
 Enable or disable pacing in the TCP socket.
 
void SetPropagationDelay (Time propDelay)
 Propagation delay of the bottleneck link.
 
void SetRcvBufSize (SocketWho who, uint32_t size)
 Forcefully set a defined size for rx buffer.
 
void SetRecoveryAlgorithm (TypeId recovery)
 recovery algorithm of the sender socket
 
void SetSegmentSize (SocketWho who, uint32_t segmentSize)
 Forcefully set the segment size.
 
void SetTransmitStart (Time startTime)
 Set the initial time at which the application sends the first data packet.
 
void SetUseEcn (SocketWho who, TcpSocketState::UseEcn_t useEcn)
 Forcefully set the ECN mode of use.
 
virtual void SsThreshTrace (uint32_t oldValue, uint32_t newValue)
 Slow start threshold changes.
 
virtual void Tx (const Ptr< const Packet > p, const TcpHeader &h, SocketWho who)
 Packet transmitted down to IP layer.
 
virtual void UpdatedRttHistory (const SequenceNumber32 &seq, uint32_t sz, bool isRetransmission, SocketWho who)
 Updated the Rtt history.
 
- Protected Member Functions inherited from ns3::TestCase
 TestCase (std::string name)
 Constructor.
 
void AddTestCase (TestCase *testCase, TestDuration duration=QUICK)
 Add an individual child TestCase to this test suite.
 
TestCaseGetParent () const
 Get the parent of this TestCase.
 
bool IsStatusFailure () const
 Check if any tests failed.
 
bool IsStatusSuccess () const
 Check if all tests passed.
 
void SetDataDir (std::string directory)
 Set the data directory where reference trace files can be found.
 
void ReportTestFailure (std::string cond, std::string actual, std::string limit, std::string message, std::string file, int32_t line)
 Log the failure of this TestCase.
 
bool MustAssertOnFailure () const
 Check if this run should assert on failure.
 
bool MustContinueOnFailure () const
 Check if this run should continue on failure.
 
std::string CreateDataDirFilename (std::string filename)
 Construct the full path to a file in the data directory.
 
std::string CreateTempDirFilename (std::string filename)
 Construct the full path to a file in a temporary directory.
 

Protected Attributes

TypeId m_congControlTypeId
 Congestion control.
 
TypeId m_recoveryTypeId
 Recovery.
 

Private Member Functions

void AfterRetransmitCb (const Ptr< const TcpSocketState > tcb, const Ptr< const TcpSocketBase > tcp)
 Invoked after a retransmit event.
 
void BeforeRetransmitCb (const Ptr< const TcpSocketState > tcb, const Ptr< const TcpSocketBase > tcp)
 Invoked before a retransmit event.
 
void DataSentCb (Ptr< Socket > socket, uint32_t size)
 Data sent Callback.
 
void ErrorCloseCb (Ptr< Socket > socket)
 Error Close Callback.
 
void ForkCb (Ptr< TcpSocketMsgBase > tcp)
 Fork Callback.
 
void HandleAccept (Ptr< Socket > socket, const Address &from)
 Handle an accept connection.
 
void NormalCloseCb (Ptr< Socket > socket)
 Normal Close Callback.
 
void PhyDropCb (std::string context, Ptr< const Packet > p)
 Drop at Phy layer Callback.
 
void ProcessedAckCb (Ptr< const Packet > p, const TcpHeader &h, Ptr< const TcpSocketBase > tcp)
 ACK processed Callback.
 
void QueueDropCb (std::string context, Ptr< const Packet > p)
 Queue Drop Callback.
 
void RcvAckCb (Ptr< const Packet > p, const TcpHeader &h, Ptr< const TcpSocketBase > tcp)
 Receive ACK Callback.
 
void RtoExpiredCb (const Ptr< const TcpSocketState > tcb, const Ptr< const TcpSocketBase > tcp)
 RTO expired Callback.
 
void RxPacketCb (const Ptr< const Packet > p, const TcpHeader &h, const Ptr< const TcpSocketBase > tcp)
 Rx packet Callback.
 
void TxPacketCb (const Ptr< const Packet > p, const TcpHeader &h, const Ptr< const TcpSocketBase > tcp)
 Tx packet Callback.
 
void UpdateRttHistoryCb (Ptr< const TcpSocketBase > tcp, const SequenceNumber32 &seq, uint32_t sz, bool isRetransmission)
 Update RTT with new data.
 

Private Attributes

Time m_interPacketInterval
 Time between sending application packet down to tcp socket.
 
uint32_t m_mtu
 MTU of the environment.
 
uint32_t m_pktCount
 Count of the application packet.
 
uint32_t m_pktSize
 Size of the application packet.
 
Time m_propagationDelay
 Propagation delay of the channel.
 
Ptr< TcpSocketMsgBasem_receiverSocket
 Pointer to receiver socket.
 
InetSocketAddress m_remoteAddr
 Remote peer address.
 
Ptr< TcpSocketMsgBasem_senderSocket
 Pointer to sender socket.
 
Time m_startTime
 Data transmission time.
 

Detailed Description

General infrastructure for TCP testing.

The class provides a simple setup for a connection testing. Implement or modify the virtual methods in order to install a specified channel, a specified socket and a specified error model on this simulation. Default values are a null error model, and as a channel a SimpleChannel with the propagation delay set through the constructor.

Check DoRun documentation for more information on the environment setup.

Apart from setting up the environment for testing, subclassing permits also to track and check what is happening inside the two connected sockets. Thanks to TcpSocketMsgBase, there are many information provided to children:

  • Tracing of states inside the state machines (TCP and ACK ones, through functions CongStateTrace and TcpStateTrace)
  • cWnd tracing (through CWndTrace)
  • Socket closing: error state, or normal state (NormalClose and ErrorClose)
  • Packet drop, inside queue or over the link (QueueDrop, PhyDrop)
  • Ack received (RcvAck) and Ack processed (ProcessedAck). The first is used to signal that an ACK has been received; after the processing of it, the Second is called
  • A packet is transmitted to IP layer or received from IP layer (Tx and Rx)
  • The RTO expires (RTOExpired)

The default version of such methods is empty; implement their behavior differently, based on what you want to test. Default is empty to avoid the need to implement useless pure virtual function.

If you need values from TcpSocketBase, thanks to the friend relationship between this class and TcpSocketBase itself you can get it. Remember that friendship isn't passed by inheritance, so the way to go is to write a Getters (like GetSegSize) and call it in the subclass.

See also
DoRun
TcpSocketMsgBase

Definition at line 254 of file tcp-general-test.h.

Member Enumeration Documentation

◆ SocketWho

Used as parameter of methods, specifies on what node the caller is interested (e.g.

GetSegSize).

Enumerator
SENDER 

Sender node.

RECEIVER 

Receiver node.

Definition at line 272 of file tcp-general-test.h.

Constructor & Destructor Documentation

◆ TcpGeneralTest()

TcpGeneralTest::TcpGeneralTest ( const std::string &  desc)

TcpGeneralTest constructor.

Please use the method ConfigureEnvironment () to configure other parameters than the test description.

Parameters
descdescription of the test

Definition at line 41 of file tcp-general-test.cc.

References NS_LOG_FUNCTION.

◆ ~TcpGeneralTest()

TcpGeneralTest::~TcpGeneralTest ( )
override

Definition at line 50 of file tcp-general-test.cc.

References NS_LOG_FUNCTION_NOARGS.

Member Function Documentation

◆ AfterRetransmitCb()

void TcpGeneralTest::AfterRetransmitCb ( const Ptr< const TcpSocketState tcb,
const Ptr< const TcpSocketBase tcp 
)
private

Invoked after a retransmit event.

Parameters
tcbTransmission control block.
tcpThe TCP socket.

Definition at line 421 of file tcp-general-test.cc.

References AfterRTOExpired(), m_receiverSocket, m_senderSocket, NS_FATAL_ERROR, RECEIVER, and SENDER.

Referenced by DoRun().

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

◆ AfterRTOExpired()

virtual void ns3::TcpGeneralTest::AfterRTOExpired ( const Ptr< const TcpSocketState tcb,
SocketWho  who 
)
inlineprotectedvirtual

Rto has expired.

Parameters
tcbTransmission control block
whowhere the RTO has expired (SENDER or RECEIVER)

Reimplemented in TcpFastRetrTest, TcpRtoTest, TcpSsThreshRtoTest, and TcpTimeRtoTest.

Definition at line 929 of file tcp-general-test.h.

Referenced by AfterRetransmitCb().

+ Here is the caller graph for this function:

◆ BeforeRetransmitCb()

void TcpGeneralTest::BeforeRetransmitCb ( const Ptr< const TcpSocketState tcb,
const Ptr< const TcpSocketBase tcp 
)
private

Invoked before a retransmit event.

Parameters
tcbTransmission control block.
tcpThe TCP socket.

Definition at line 439 of file tcp-general-test.cc.

References BeforeRTOExpired(), m_receiverSocket, m_senderSocket, NS_FATAL_ERROR, RECEIVER, and SENDER.

Referenced by DoRun().

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

◆ BeforeRTOExpired()

virtual void ns3::TcpGeneralTest::BeforeRTOExpired ( const Ptr< const TcpSocketState tcb,
SocketWho  who 
)
inlineprotectedvirtual

Rto has expired.

Parameters
tcbTransmission control block
whowhere the RTO has expired (SENDER or RECEIVER)

Reimplemented in TcpBytesInFlightTest, and TcpSsThreshRtoTest.

Definition at line 940 of file tcp-general-test.h.

Referenced by BeforeRetransmitCb().

+ Here is the caller graph for this function:

◆ BytesInFlightTrace()

virtual void ns3::TcpGeneralTest::BytesInFlightTrace ( uint32_t  oldValue,
uint32_t  newValue 
)
inlineprotectedvirtual

Bytes in flight changes.

This applies only for sender socket.

Parameters
oldValueold value
newValuenew value

Reimplemented in TcpBytesInFlightTest, TcpPacingTest, TcpRateLinuxWithSocketsTest, and TcpSsThreshRtoTest.

Definition at line 782 of file tcp-general-test.h.

Referenced by DoRun().

+ Here is the caller graph for this function:

◆ ConfigureEnvironment()

void TcpGeneralTest::ConfigureEnvironment ( )
protectedvirtual

Change the configuration of the environment.

Reimplemented in TcpAdvertisedWindowTest, TcpAdvWindowOnLossTest, TcpBytesInFlightTest, TcpNewRenoCongAvoidNormalTest, TcpDataSentCbTestCase, TcpDctcpCodePointsTest, TcpFastRetrTest, TcpLinuxRenoSSTest, TcpLinuxRenoCongAvoidTest, TcpLargeTransferLossTest, TcpPacingTest, TcpPktsAckedOpenTest, TcpRateLinuxWithSocketsTest, TcpRtoTest, TcpSsThreshRtoTest, TcpTimeRtoTest, TcpRttEstimationTest, TcpSlowStartNormalTest, and TcpZeroWindowTest.

Definition at line 105 of file tcp-general-test.cc.

References m_congControlTypeId, m_recoveryTypeId, ns3::MilliSeconds(), NS_LOG_FUNCTION, ns3::Seconds(), SetAppPktCount(), SetAppPktInterval(), SetAppPktSize(), SetCongestionControl(), SetMTU(), SetPropagationDelay(), SetRecoveryAlgorithm(), and SetTransmitStart().

Referenced by TcpAdvertisedWindowTest::ConfigureEnvironment(), TcpAdvWindowOnLossTest::ConfigureEnvironment(), TcpBytesInFlightTest::ConfigureEnvironment(), TcpNewRenoCongAvoidNormalTest::ConfigureEnvironment(), TcpDataSentCbTestCase::ConfigureEnvironment(), TcpDctcpCodePointsTest::ConfigureEnvironment(), TcpFastRetrTest::ConfigureEnvironment(), TcpLinuxRenoSSTest::ConfigureEnvironment(), TcpLinuxRenoCongAvoidTest::ConfigureEnvironment(), TcpLargeTransferLossTest::ConfigureEnvironment(), TcpPacingTest::ConfigureEnvironment(), TcpPktsAckedOpenTest::ConfigureEnvironment(), TcpRateLinuxWithSocketsTest::ConfigureEnvironment(), TcpRtoTest::ConfigureEnvironment(), TcpSsThreshRtoTest::ConfigureEnvironment(), TcpTimeRtoTest::ConfigureEnvironment(), TcpRttEstimationTest::ConfigureEnvironment(), TcpSlowStartNormalTest::ConfigureEnvironment(), TcpZeroWindowTest::ConfigureEnvironment(), and DoRun().

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

◆ ConfigureProperties()

◆ CongStateTrace()

virtual void ns3::TcpGeneralTest::CongStateTrace ( const TcpSocketState::TcpCongState_t  oldValue,
const TcpSocketState::TcpCongState_t  newValue 
)
inlineprotectedvirtual

State on Ack state machine changes.

Parameters
oldValueold value
newValuenew value

Reimplemented in TcpFastRetrTest, and TcpLargeTransferLossTest.

Definition at line 723 of file tcp-general-test.h.

Referenced by DoRun().

+ Here is the caller graph for this function:

◆ CreateChannel()

Ptr< SimpleChannel > TcpGeneralTest::CreateChannel ( )
protectedvirtual

Create and return the channel installed between the two socket.

Returns
A SimpleChannel subclass

Definition at line 281 of file tcp-general-test.cc.

References m_propagationDelay.

Referenced by DoRun().

+ Here is the caller graph for this function:

◆ CreateReceiverErrorModel()

Ptr< ErrorModel > TcpGeneralTest::CreateReceiverErrorModel ( )
protectedvirtual

Create and return the error model to install in the receiver node.

Returns
receiver error model

Reimplemented in TcpAdvertisedWindowTest, TcpAdvWindowOnLossTest, TcpBytesInFlightTest, ns3::TcpCloseWithLossTestCase, TcpFastRetrTest, TcpLargeTransferLossTest, TcpRateLinuxWithSocketsTest, TcpSsThreshRtoTest, TcpTimeRtoTest, and TcpRttEstimationWithLossTest.

Definition at line 332 of file tcp-general-test.cc.

Referenced by DoRun().

+ Here is the caller graph for this function:

◆ CreateReceiverSocket()

Ptr< TcpSocketMsgBase > TcpGeneralTest::CreateReceiverSocket ( Ptr< Node node)
protectedvirtual

◆ CreateSenderErrorModel()

Ptr< ErrorModel > TcpGeneralTest::CreateSenderErrorModel ( )
protectedvirtual

Create and return the error model to install in the sender node.

Returns
sender error model

Reimplemented in TcpFastRetrTest.

Definition at line 326 of file tcp-general-test.cc.

Referenced by DoRun().

+ Here is the caller graph for this function:

◆ CreateSenderSocket()

◆ CreateSocket() [1/2]

Ptr< TcpSocketMsgBase > TcpGeneralTest::CreateSocket ( Ptr< Node node,
TypeId  socketType,
TypeId  congControl 
)
protectedvirtual

Create a socket.

Parameters
nodeassociated node
socketTypeType of the TCP socket
congControlcongestion control
Returns
a pointer to the newer created socket

Definition at line 291 of file tcp-general-test.cc.

References CreateSocket(), and m_recoveryTypeId.

Referenced by CreateReceiverSocket(), TcpAdvertisedWindowTest::CreateReceiverSocket(), TcpAdvWindowOnLossTest::CreateReceiverSocket(), TcpDataSentCbTestCase::CreateReceiverSocket(), TcpDctcpCodePointsTest::CreateReceiverSocket(), TcpSlowStartAttackerTest::CreateReceiverSocket(), CreateSenderSocket(), TcpDctcpCodePointsTest::CreateSenderSocket(), ns3::TcpEcnTest::CreateSenderSocket(), and CreateSocket().

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

◆ CreateSocket() [2/2]

Ptr< TcpSocketMsgBase > TcpGeneralTest::CreateSocket ( Ptr< Node node,
TypeId  socketType,
TypeId  congControl,
TypeId  recoveryAlgorithm 
)
protectedvirtual

Create a socket.

Parameters
nodeassociated node
socketTypeType of the TCP socket
congControlcongestion control
recoveryAlgorithmrecovery algorithm
Returns
a pointer to the newer created socket

Definition at line 297 of file tcp-general-test.cc.

References ns3::ObjectFactory::Create(), ns3::RttMeanDeviation::GetTypeId(), and ns3::ObjectFactory::SetTypeId().

+ Here is the call graph for this function:

◆ CWndInflTrace()

virtual void ns3::TcpGeneralTest::CWndInflTrace ( uint32_t  oldValue,
uint32_t  newValue 
)
inlineprotectedvirtual

Tracks the inflated congestion window changes.

Parameters
oldValueold value
newValuenew value

Definition at line 744 of file tcp-general-test.h.

Referenced by DoRun().

+ Here is the caller graph for this function:

◆ CWndTrace()

virtual void ns3::TcpGeneralTest::CWndTrace ( uint32_t  oldValue,
uint32_t  newValue 
)
inlineprotectedvirtual

Tracks the congestion window changes.

Parameters
oldValueold value
newValuenew value

Reimplemented in TcpNewRenoCongAvoidNormalTest, ns3::TcpEcnTest, TcpLinuxRenoSSTest, TcpLinuxRenoCongAvoidTest, TcpPacingTest, and TcpSlowStartNormalTest.

Definition at line 734 of file tcp-general-test.h.

Referenced by DoRun().

+ Here is the caller graph for this function:

◆ DataSent()

virtual void ns3::TcpGeneralTest::DataSent ( uint32_t  size,
SocketWho  who 
)
inlineprotectedvirtual

Notifying application for sent data.

Parameters
sizethe amount of bytes transmitted
whowhere the RTO has expired (SENDER or RECEIVER)

Reimplemented in TcpDataSentCbTestCase.

Definition at line 965 of file tcp-general-test.h.

Referenced by DataSentCb().

+ Here is the caller graph for this function:

◆ DataSentCb()

void TcpGeneralTest::DataSentCb ( Ptr< Socket socket,
uint32_t  size 
)
private

Data sent Callback.

Parameters
socketThe socket.
sizeThe data size.

Definition at line 457 of file tcp-general-test.cc.

References DataSent(), m_receiverSocket, m_senderSocket, NS_FATAL_ERROR, RECEIVER, and SENDER.

Referenced by DoRun().

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

◆ DoConnect()

void TcpGeneralTest::DoConnect ( )
protected

Scheduled at 0.0, SENDER starts the connection to RECEIVER.

Definition at line 266 of file tcp-general-test.cc.

References m_remoteAddr, m_senderSocket, and NS_LOG_INFO.

Referenced by DoRun().

+ Here is the caller graph for this function:

◆ DoRun()

void TcpGeneralTest::DoRun ( )
overrideprotectedvirtual

Execute the tcp test.

As environment, two socket are connected through a SimpleChannel. Each device has an MTU of 1500 bytes, and the application starts to send packet at 10s of simulated time, through SendPacket.

If you need to change parameters of the environment, please inherit an implement the method ConfigureEnvironment (); that will be called at the beginning of this method. To configure Socket parameters (i.e. parameters that should be applied after socket have been created) use ConfigureProperties.

Please do not use any Config:: statements.

See also
ConfigureEnvironment

Implements ns3::TestCase.

Definition at line 130 of file tcp-general-test.cc.

References AfterRetransmitCb(), BeforeRetransmitCb(), BytesInFlightTrace(), ConfigureEnvironment(), ConfigureProperties(), CongStateTrace(), ns3::NodeContainer::Create(), CreateChannel(), CreateReceiverErrorModel(), CreateReceiverSocket(), CreateSenderErrorModel(), CreateSenderSocket(), CWndInflTrace(), CWndTrace(), DataSentCb(), DoConnect(), ns3::Packet::EnablePrinting(), ErrorCloseCb(), ForkCb(), ns3::NetDeviceContainer::Get(), ns3::NodeContainer::Get(), ns3::Ipv4InterfaceContainer::GetAddress(), ns3::Ipv4Address::GetAny(), ns3::Node::GetId(), HandleAccept(), HighestTxSeqTrace(), ns3::SimpleNetDeviceHelper::Install(), m_interPacketInterval, m_mtu, m_pktCount, m_pktSize, m_receiverSocket, m_remoteAddr, m_senderSocket, m_startTime, ns3::MakeCallback(), ns3::MakeNullCallback(), NextTxSeqTrace(), nodes, NormalCloseCb(), NS_LOG_INFO, PhyDropCb(), ProcessedAckCb(), QueueDropCb(), RateSampleUpdatedTrace(), RateUpdatedTrace(), RcvAckCb(), ReceivePacket(), RtoTrace(), RttTrace(), ns3::Simulator::Run(), RxPacketCb(), ns3::Simulator::Schedule(), ns3::Simulator::ScheduleWithContext(), ns3::Seconds(), SendPacket(), ns3::SimpleNetDeviceHelper::SetNetDevicePointToPointMode(), SsThreshTrace(), TxPacketCb(), and UpdateRttHistoryCb().

+ Here is the call graph for this function:

◆ DoTeardown()

void TcpGeneralTest::DoTeardown ( )
overrideprotectedvirtual

Teardown the TCP test.

Reimplemented from ns3::TestCase.

Reimplemented in TcpLinuxRenoSSTest, and TcpLinuxRenoCongAvoidTest.

Definition at line 96 of file tcp-general-test.cc.

References ns3::Simulator::Destroy(), FinalChecks(), and NS_LOG_INFO.

Referenced by TcpLinuxRenoSSTest::DoTeardown(), and TcpLinuxRenoCongAvoidTest::DoTeardown().

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

◆ ErrorClose()

virtual void ns3::TcpGeneralTest::ErrorClose ( SocketWho  who)
inlineprotectedvirtual

Socket closed with an error.

Parameters
whothe socket closed (SENDER or RECEIVER)
Todo:
indicate the error

Reimplemented in TcpTimeRtoTest.

Definition at line 854 of file tcp-general-test.h.

Referenced by ErrorCloseCb().

+ Here is the caller graph for this function:

◆ ErrorCloseCb()

void TcpGeneralTest::ErrorCloseCb ( Ptr< Socket socket)
private

Error Close Callback.

Parameters
socketThe socket.

Definition at line 474 of file tcp-general-test.cc.

References ErrorClose(), m_receiverSocket, m_senderSocket, NS_FATAL_ERROR, RECEIVER, and SENDER.

Referenced by DoRun(), and HandleAccept().

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

◆ FinalChecks()

virtual void ns3::TcpGeneralTest::FinalChecks ( )
inlineprotectedvirtual

Performs the (eventual) final checks through test asserts.

Reimplemented in TcpBytesInFlightTest, ns3::TcpCloseWithLossTestCase, TcpDataSentCbTestCase, TcpFastRetrTest, TcpLargeTransferLossTest, TcpPktsAckedOpenTest, TcpRateLinuxWithSocketsTest, TcpRtoTest, TcpTimeRtoTest, TcpRttEstimationTest, and TcpZeroWindowTest.

Definition at line 972 of file tcp-general-test.h.

Referenced by DoTeardown().

+ Here is the caller graph for this function:

◆ ForkCb()

void TcpGeneralTest::ForkCb ( Ptr< TcpSocketMsgBase tcp)
private

Fork Callback.

Parameters
tcpThe TCP socket.

Definition at line 579 of file tcp-general-test.cc.

References m_receiverSocket, and NS_LOG_FUNCTION.

Referenced by DoRun().

+ Here is the caller graph for this function:

◆ GetClockGranularity()

Time TcpGeneralTest::GetClockGranularity ( SocketWho  who)
protected

Get the clock granularity attribute.

Parameters
whonode to get the parameter from
Returns
clock granularity

Definition at line 780 of file tcp-general-test.cc.

References m_receiverSocket, m_senderSocket, NS_FATAL_ERROR, RECEIVER, and SENDER.

Referenced by TcpTimeRtoTest::Tx().

+ Here is the caller graph for this function:

◆ GetConnTimeout()

Time TcpGeneralTest::GetConnTimeout ( SocketWho  who)
protected

Get the retransmission time for the SYN segments.

Parameters
whonode to get the parameter from
Returns
SYN segments RTO time

Definition at line 746 of file tcp-general-test.cc.

References m_receiverSocket, m_senderSocket, NS_FATAL_ERROR, RECEIVER, and SENDER.

Referenced by TcpTimeRtoTest::Tx().

+ Here is the caller graph for this function:

◆ GetDelAckCount()

uint32_t TcpGeneralTest::GetDelAckCount ( SocketWho  who)
protected

Get the number of delayed ack (if present)

Parameters
whonode to get the parameter from
Returns
number of ack we will wait before sending an ACK

Definition at line 621 of file tcp-general-test.cc.

References m_receiverSocket, m_senderSocket, NS_FATAL_ERROR, RECEIVER, and SENDER.

Referenced by TcpFastRetrTest::Tx().

+ Here is the caller graph for this function:

◆ GetDelAckTimeout()

Time TcpGeneralTest::GetDelAckTimeout ( SocketWho  who)
protected

Get the timeout of delayed ack (if present)

Parameters
whonode to get the parameter from
Returns
time we will wait before sending an ACK

Definition at line 638 of file tcp-general-test.cc.

References m_receiverSocket, m_senderSocket, NS_FATAL_ERROR, RECEIVER, and SENDER.

◆ GetDupAckCount()

uint32_t TcpGeneralTest::GetDupAckCount ( SocketWho  who)
protected

Get the number of dupack received.

Parameters
whonode to get the parameter from
Returns
number of dupack

Definition at line 604 of file tcp-general-test.cc.

References m_receiverSocket, m_senderSocket, NS_FATAL_ERROR, RECEIVER, and SENDER.

Referenced by TcpFastRetrTest::CongStateTrace(), TcpFastRetrTest::ProcessedAck(), and TcpFastRetrTest::RcvAck().

+ Here is the caller graph for this function:

◆ GetHighestTxMark()

SequenceNumber32 TcpGeneralTest::GetHighestTxMark ( SocketWho  who)
protected

Get the highest tx mark of the node specified.

Parameters
whonode to get the parameter from
Returns
mark of the specified node

Definition at line 672 of file tcp-general-test.cc.

References GetTcb(), and ns3::TcpSocketState::m_highTxMark.

+ Here is the call graph for this function:

◆ GetInitialCwnd()

uint32_t TcpGeneralTest::GetInitialCwnd ( SocketWho  who)
protected

Get the initial congestion window.

Parameters
whonode to get the parameter from
Returns
initial cwnd

Definition at line 678 of file tcp-general-test.cc.

References m_receiverSocket, m_senderSocket, NS_FATAL_ERROR, RECEIVER, and SENDER.

◆ GetInitialSsThresh()

uint32_t TcpGeneralTest::GetInitialSsThresh ( SocketWho  who)
protected

Get the initial slow start threshold.

Parameters
whonode to get the parameter from
Returns
initial slow start threshold

Definition at line 695 of file tcp-general-test.cc.

References m_receiverSocket, m_senderSocket, NS_FATAL_ERROR, RECEIVER, and SENDER.

Referenced by TcpLinuxRenoSSTest::CWndTrace(), and TcpSlowStartNormalTest::CWndTrace().

+ Here is the caller graph for this function:

◆ GetMinRto()

Time TcpGeneralTest::GetMinRto ( SocketWho  who)
protected

Get the minimum RTO attribute.

Parameters
whonode to get the parameter from
Returns
minimum RTO time

Definition at line 729 of file tcp-general-test.cc.

References m_receiverSocket, m_senderSocket, NS_FATAL_ERROR, RECEIVER, and SENDER.

Referenced by TcpTimeRtoTest::Tx().

+ Here is the caller graph for this function:

◆ GetMtu()

uint32_t ns3::TcpGeneralTest::GetMtu ( ) const
inlineprotected

Get the MTU of the environment.

Returns
MTU of the environment

Definition at line 998 of file tcp-general-test.h.

References m_mtu.

◆ GetPersistentEvent()

EventId TcpGeneralTest::GetPersistentEvent ( SocketWho  who)
protected

Get the persistent event of the selected socket.

Parameters
whosocket where check the parameter
Returns
the persistent event in the selected socket

Definition at line 831 of file tcp-general-test.cc.

References m_receiverSocket, m_senderSocket, NS_FATAL_ERROR, RECEIVER, and SENDER.

Referenced by TcpZeroWindowTest::ProcessedAck().

+ Here is the caller graph for this function:

◆ GetPersistentTimeout()

Time TcpGeneralTest::GetPersistentTimeout ( SocketWho  who)
protected

Get the persistent timeout of the selected socket.

Parameters
whosocket where check the parameter
Returns
the persistent timeout in the selected socket

Definition at line 848 of file tcp-general-test.cc.

References m_receiverSocket, m_senderSocket, NS_FATAL_ERROR, RECEIVER, and SENDER.

◆ GetPktCount()

uint32_t ns3::TcpGeneralTest::GetPktCount ( ) const
inlineprotected

Get the number of application packets.

Returns
count of application packets to be generated

Definition at line 1016 of file tcp-general-test.h.

References m_pktCount.

Referenced by TcpDataSentCbTestCase::FinalChecks().

+ Here is the caller graph for this function:

◆ GetPktInterval()

Time ns3::TcpGeneralTest::GetPktInterval ( ) const
inlineprotected

Get the interval to wait for each packet sent down from application to TCP.

Returns
interval between packet

Definition at line 1026 of file tcp-general-test.h.

References m_interPacketInterval.

◆ GetPktSize()

uint32_t ns3::TcpGeneralTest::GetPktSize ( ) const
inlineprotected

Get the application packet size.

Returns
application packet size

Definition at line 1007 of file tcp-general-test.h.

References m_pktSize.

Referenced by TcpDataSentCbTestCase::FinalChecks().

+ Here is the caller graph for this function:

◆ GetPropagationDelay()

Time ns3::TcpGeneralTest::GetPropagationDelay ( ) const
inlineprotected

Get the channel Propagation Delay.

Returns
propagation delay of the channel

Definition at line 980 of file tcp-general-test.h.

References m_propagationDelay.

Referenced by TcpPacingTest::UpdateExpectedInterval().

+ Here is the caller graph for this function:

◆ GetReceiverSocket()

Ptr< TcpSocketMsgBase > ns3::TcpGeneralTest::GetReceiverSocket ( )
inlineprotected

Get the pointer to a previously created receiver socket.

Returns
ptr to receiver socket or 0

Definition at line 353 of file tcp-general-test.h.

References m_receiverSocket.

Referenced by ns3::TcpCloseWithLossTestCase::ConfigureProperties().

+ Here is the caller graph for this function:

◆ GetReTxThreshold()

uint32_t TcpGeneralTest::GetReTxThreshold ( SocketWho  who)
protected

Get the retransmission threshold.

Parameters
whonode to get the parameter from
Returns
retransmission threshold

Definition at line 587 of file tcp-general-test.cc.

References m_receiverSocket, m_senderSocket, NS_FATAL_ERROR, RECEIVER, and SENDER.

Referenced by TcpFastRetrTest::CongStateTrace(), TcpFastRetrTest::ProcessedAck(), and TcpFastRetrTest::RcvAck().

+ Here is the caller graph for this function:

◆ GetRto()

Time TcpGeneralTest::GetRto ( SocketWho  who)
protected

Get the retransmission time.

Parameters
whonode to get the parameter from
Returns
calculated RTO time

Definition at line 712 of file tcp-general-test.cc.

References m_receiverSocket, m_senderSocket, NS_FATAL_ERROR, RECEIVER, and SENDER.

Referenced by TcpTimeRtoTest::AfterRTOExpired(), and TcpTimeRtoTest::Tx().

+ Here is the caller graph for this function:

◆ GetRttEstimator()

Ptr< RttEstimator > TcpGeneralTest::GetRttEstimator ( SocketWho  who)
protected

Get the Rtt estimator of the socket.

Parameters
whonode to get the parameter from
Returns
Rtt estimator

Definition at line 763 of file tcp-general-test.cc.

References m_receiverSocket, m_senderSocket, NS_FATAL_ERROR, RECEIVER, and SENDER.

Referenced by TcpTimeRtoTest::Tx(), and TcpRttEstimationTest::Tx().

+ Here is the caller graph for this function:

◆ GetRWnd()

uint32_t TcpGeneralTest::GetRWnd ( SocketWho  who)
protected

Get the rWnd of the selected socket.

Parameters
whosocket where check the parameter
Returns
the received advertised window

Definition at line 814 of file tcp-general-test.cc.

References m_receiverSocket, m_senderSocket, NS_FATAL_ERROR, RECEIVER, and SENDER.

◆ GetRxBuffer()

Ptr< TcpRxBuffer > TcpGeneralTest::GetRxBuffer ( SocketWho  who)
protected

Get the Rx buffer from selected socket.

Parameters
whosocket where get the TCB
Returns
the rx buffer

Definition at line 882 of file tcp-general-test.cc.

References m_receiverSocket, m_senderSocket, NS_FATAL_ERROR, RECEIVER, and SENDER.

Referenced by WScalingTestCase::Tx().

+ Here is the caller graph for this function:

◆ GetSegSize()

uint32_t TcpGeneralTest::GetSegSize ( SocketWho  who)
protected

Get the segment size of the node specified.

Parameters
whonode to get the parameter from
Returns
segment size of the specified node

Definition at line 655 of file tcp-general-test.cc.

References m_receiverSocket, m_senderSocket, NS_FATAL_ERROR, RECEIVER, and SENDER.

Referenced by TcpNewRenoCongAvoidNormalTest::Check(), TcpLinuxRenoSSTest::CWndTrace(), TcpSlowStartNormalTest::CWndTrace(), TcpPktsAckedOpenTest::FinalChecks(), TcpBytesInFlightTest::Rx(), TcpFastRetrTest::Rx(), TcpSlowStartNormalTest::Rx(), TcpFastRetrTest::Tx(), and TcpSlowStartNormalTest::Tx().

+ Here is the caller graph for this function:

◆ GetSenderSocket()

Ptr< TcpSocketMsgBase > ns3::TcpGeneralTest::GetSenderSocket ( )
inlineprotected

Get the pointer to a previously created sender socket.

Returns
ptr to sender socket or 0

Definition at line 344 of file tcp-general-test.h.

References m_senderSocket.

Referenced by TcpSsThreshRtoTest::AfterRTOExpired(), TcpBytesInFlightTest::BeforeRTOExpired(), and ns3::TcpCloseWithLossTestCase::ConfigureProperties().

+ Here is the caller graph for this function:

◆ GetStartTime()

Time ns3::TcpGeneralTest::GetStartTime ( ) const
inlineprotected

Get the data start time.

Returns
start time of data packets

Definition at line 989 of file tcp-general-test.h.

References m_startTime.

◆ GetTcb()

Ptr< TcpSocketState > TcpGeneralTest::GetTcb ( SocketWho  who)
protected

Get the TCB from selected socket.

Parameters
whosocket where get the TCB
Returns
the transmission control block

Definition at line 865 of file tcp-general-test.cc.

References m_receiverSocket, m_senderSocket, NS_FATAL_ERROR, RECEIVER, and SENDER.

Referenced by GetHighestTxMark(), and TcpZeroWindowTest::Tx().

+ Here is the caller graph for this function:

◆ GetTcpState()

TcpSocket::TcpStates_t TcpGeneralTest::GetTcpState ( SocketWho  who)
protected

Get the state of the TCP state machine.

Parameters
whosocket where check the parameter
Returns
the state of the socket

Definition at line 797 of file tcp-general-test.cc.

References m_receiverSocket, m_senderSocket, NS_FATAL_ERROR, RECEIVER, and SENDER.

◆ GetTxBuffer()

Ptr< TcpTxBuffer > TcpGeneralTest::GetTxBuffer ( SocketWho  who)
protected

Get the Tx buffer from selected socket.

Parameters
whosocket where get the TCB
Returns
the tx buffer

Definition at line 899 of file tcp-general-test.cc.

References m_receiverSocket, m_senderSocket, NS_FATAL_ERROR, RECEIVER, and SENDER.

◆ HandleAccept()

void TcpGeneralTest::HandleAccept ( Ptr< Socket socket,
const Address from 
)
private

Handle an accept connection.

Parameters
socketThe socket.
fromThe sender.

Definition at line 273 of file tcp-general-test.cc.

References ErrorCloseCb(), ns3::MakeCallback(), NormalCloseCb(), and ReceivePacket().

Referenced by DoRun().

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

◆ HighestTxSeqTrace()

virtual void ns3::TcpGeneralTest::HighestTxSeqTrace ( SequenceNumber32  oldValue,
SequenceNumber32  newValue 
)
inlineprotectedvirtual

Highest tx seq changes.

This applies only for sender socket.

Parameters
oldValueold value
newValuenew value

Definition at line 820 of file tcp-general-test.h.

Referenced by DoRun().

+ Here is the caller graph for this function:

◆ NextTxSeqTrace()

virtual void ns3::TcpGeneralTest::NextTxSeqTrace ( SequenceNumber32  oldValue,
SequenceNumber32  newValue 
)
inlineprotectedvirtual

Next tx seq changes.

This applies only for sender socket.

Parameters
oldValueold value
newValuenew value

Definition at line 807 of file tcp-general-test.h.

Referenced by DoRun().

+ Here is the caller graph for this function:

◆ NormalClose()

virtual void ns3::TcpGeneralTest::NormalClose ( SocketWho  who)
inlineprotectedvirtual

Socket closed normally.

Parameters
whothe socket closed (SENDER or RECEIVER)

Reimplemented in ns3::TcpCloseWithLossTestCase, TcpNewRenoCongAvoidNormalTest, TcpPacingTest, and TcpZeroWindowTest.

Definition at line 845 of file tcp-general-test.h.

Referenced by NormalCloseCb().

+ Here is the caller graph for this function:

◆ NormalCloseCb()

void TcpGeneralTest::NormalCloseCb ( Ptr< Socket socket)
private

Normal Close Callback.

Parameters
socketThe socket.

Definition at line 384 of file tcp-general-test.cc.

References m_receiverSocket, m_senderSocket, NormalClose(), NS_FATAL_ERROR, RECEIVER, and SENDER.

Referenced by DoRun(), and HandleAccept().

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

◆ PhyDrop()

virtual void ns3::TcpGeneralTest::PhyDrop ( SocketWho  who)
inlineprotectedvirtual

Link drop.

Parameters
whowhere the drop occurred (SENDER or RECEIVER)

Reimplemented in TcpNewRenoCongAvoidNormalTest, TcpLinuxRenoSSTest, TcpLinuxRenoCongAvoidTest, TcpPacingTest, and TcpSlowStartNormalTest.

Definition at line 871 of file tcp-general-test.h.

Referenced by PhyDropCb().

+ Here is the caller graph for this function:

◆ PhyDropCb()

void TcpGeneralTest::PhyDropCb ( std::string  context,
Ptr< const Packet p 
)
private

Drop at Phy layer Callback.

Parameters
contextThe context.
pThe packet.

Definition at line 367 of file tcp-general-test.cc.

References NS_FATAL_ERROR, PhyDrop(), RECEIVER, and SENDER.

Referenced by DoRun().

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

◆ ProcessedAck()

virtual void ns3::TcpGeneralTest::ProcessedAck ( const Ptr< const TcpSocketState tcb,
const TcpHeader h,
SocketWho  who 
)
inlineprotectedvirtual

Processed ack.

Invoked after the processing of the ACK

Parameters
tcbTransmission Control Block
hthe header of segment
whothe socket which has processed the ACK (SENDER or RECEIVER)

Reimplemented in TcpFastRetrTest, TcpRtoTest, and TcpZeroWindowTest.

Definition at line 899 of file tcp-general-test.h.

Referenced by ProcessedAckCb().

+ Here is the caller graph for this function:

◆ ProcessedAckCb()

void TcpGeneralTest::ProcessedAckCb ( Ptr< const Packet p,
const TcpHeader h,
Ptr< const TcpSocketBase tcp 
)
private

ACK processed Callback.

Parameters
pThe packet.
hTCP header.
tcpThe TCP socket.

Definition at line 560 of file tcp-general-test.cc.

References m_receiverSocket, m_senderSocket, NS_FATAL_ERROR, ProcessedAck(), RECEIVER, and SENDER.

Referenced by DoRun().

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

◆ QueueDrop()

virtual void ns3::TcpGeneralTest::QueueDrop ( SocketWho  who)
inlineprotectedvirtual

Drop on the queue.

Parameters
whowhere the drop occurred (SENDER or RECEIVER)

Reimplemented in TcpNewRenoCongAvoidNormalTest, TcpLinuxRenoSSTest, TcpLinuxRenoCongAvoidTest, TcpPacingTest, and TcpSlowStartNormalTest.

Definition at line 863 of file tcp-general-test.h.

Referenced by QueueDropCb().

+ Here is the caller graph for this function:

◆ QueueDropCb()

void TcpGeneralTest::QueueDropCb ( std::string  context,
Ptr< const Packet p 
)
private

Queue Drop Callback.

Parameters
contextThe context.
pThe packet.

Definition at line 350 of file tcp-general-test.cc.

References NS_FATAL_ERROR, QueueDrop(), RECEIVER, and SENDER.

Referenced by DoRun().

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

◆ RateSampleUpdatedTrace()

virtual void ns3::TcpGeneralTest::RateSampleUpdatedTrace ( const TcpRateLinux::TcpRateSample sample)
inlineprotectedvirtual

Track the rate sample value of TcpRateLinux.

Parameters
sampleupdated value of TcpRateSample.

Definition at line 837 of file tcp-general-test.h.

Referenced by DoRun().

+ Here is the caller graph for this function:

◆ RateUpdatedTrace()

virtual void ns3::TcpGeneralTest::RateUpdatedTrace ( const TcpRateLinux::TcpRateConnection rate)
inlineprotectedvirtual

Track the rate value of TcpRateLinux.

Parameters
rateupdated value of TcpRate.

Definition at line 829 of file tcp-general-test.h.

Referenced by DoRun().

+ Here is the caller graph for this function:

◆ RcvAck()

virtual void ns3::TcpGeneralTest::RcvAck ( const Ptr< const TcpSocketState tcb,
const TcpHeader h,
SocketWho  who 
)
inlineprotectedvirtual

Received ack.

Invoked when an ACK is received (no processing is done yet)

Parameters
tcbTransmission Control Block
hthe header of segment
whothe socket which has received the ACK (SENDER or RECEIVER)

Reimplemented in TcpFastRetrTest, and TcpRtoTest.

Definition at line 884 of file tcp-general-test.h.

Referenced by RcvAckCb().

+ Here is the caller graph for this function:

◆ RcvAckCb()

void TcpGeneralTest::RcvAckCb ( Ptr< const Packet p,
const TcpHeader h,
Ptr< const TcpSocketBase tcp 
)
private

Receive ACK Callback.

Parameters
pThe packet.
hTCP header.
tcpThe TCP socket.

Definition at line 503 of file tcp-general-test.cc.

References m_receiverSocket, m_senderSocket, NS_FATAL_ERROR, RcvAck(), RECEIVER, and SENDER.

Referenced by DoRun().

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

◆ ReceivePacket()

void TcpGeneralTest::ReceivePacket ( Ptr< Socket socket)
protectedvirtual

Packet received.

The method processes the packet (application-layer)

Parameters
socketsocket which has received the packet

Definition at line 56 of file tcp-general-test.cc.

References NS_LOG_FUNCTION.

Referenced by DoRun(), and HandleAccept().

+ Here is the caller graph for this function:

◆ RtoExpiredCb()

void ns3::TcpGeneralTest::RtoExpiredCb ( const Ptr< const TcpSocketState tcb,
const Ptr< const TcpSocketBase tcp 
)
private

RTO expired Callback.

Parameters
tcbTransmission control block.
tcpThe TCP socket.

◆ RtoTrace()

virtual void ns3::TcpGeneralTest::RtoTrace ( Time  oldValue,
Time  newValue 
)
inlineprotectedvirtual

RTO changes.

This applies only for sender socket.

Parameters
oldValueold value
newValuenew value

Definition at line 795 of file tcp-general-test.h.

Referenced by DoRun().

+ Here is the caller graph for this function:

◆ RttTrace()

virtual void ns3::TcpGeneralTest::RttTrace ( Time  oldTime,
Time  newTime 
)
inlineprotectedvirtual

Rtt changes.

This applies only for sender socket.

Parameters
oldTimeold value
newTimenew value

Reimplemented in TcpPacingTest, and TcpRttEstimationTest.

Definition at line 757 of file tcp-general-test.h.

Referenced by DoRun().

+ Here is the caller graph for this function:

◆ Rx()

void TcpGeneralTest::Rx ( const Ptr< const Packet p,
const TcpHeader h,
SocketWho  who 
)
protectedvirtual

Packet received from IP layer.

Parameters
ppacket
hheader
whothe socket which has received the packet (SENDER or RECEIVER)

Reimplemented in TcpBytesInFlightTest, ns3::TcpCloseWithLossTestCase, TcpDctcpCodePointsTest, ns3::TcpEcnTest, TcpFastRetrTest, TcpLinuxRenoSSTest, TcpLinuxRenoCongAvoidTest, TcpLargeTransferLossTest, TcpPacingTest, TcpPktsAckedOpenTest, TcpRateLinuxWithSocketsTest, TcpRttEstimationTest, TcpSlowStartNormalTest, TimestampTestCase, and TcpZeroWindowTest.

Definition at line 497 of file tcp-general-test.cc.

References NS_LOG_FUNCTION.

Referenced by RxPacketCb().

+ Here is the caller graph for this function:

◆ RxPacketCb()

void TcpGeneralTest::RxPacketCb ( const Ptr< const Packet p,
const TcpHeader h,
const Ptr< const TcpSocketBase tcp 
)
private

Rx packet Callback.

Parameters
pThe packet.
hTCP header.
tcpThe TCP socket.

Definition at line 541 of file tcp-general-test.cc.

References m_receiverSocket, m_senderSocket, NS_FATAL_ERROR, RECEIVER, Rx(), and SENDER.

Referenced by DoRun().

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

◆ SendPacket()

void TcpGeneralTest::SendPacket ( Ptr< Socket socket,
uint32_t  pktSize,
uint32_t  pktCount,
Time  pktInterval 
)
protected

Send packets to other endpoint.

Parameters
socketSocket
pktSizesize of the packet
pktCountnumber of packets to send
pktIntervalinterval between packet (application-level)

Definition at line 72 of file tcp-general-test.cc.

References ns3::Time::GetSeconds(), NS_LOG_FUNCTION, pktSize, ns3::Simulator::Schedule(), and SendPacket().

Referenced by DoRun(), and SendPacket().

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

◆ SetAppPktCount()

◆ SetAppPktInterval()

void ns3::TcpGeneralTest::SetAppPktInterval ( Time  pktInterval)
inlineprotected

Interval between app-generated packet.

Parameters
pktIntervalinterval

Definition at line 663 of file tcp-general-test.h.

References m_interPacketInterval.

Referenced by ConfigureEnvironment(), TcpLargeTransferLossTest::ConfigureEnvironment(), TcpPacingTest::ConfigureEnvironment(), TcpSsThreshRtoTest::ConfigureEnvironment(), and ns3::TcpCloseWithLossTestCase::ConfigureProperties().

+ Here is the caller graph for this function:

◆ SetAppPktSize()

◆ SetCongestionControl()

void ns3::TcpGeneralTest::SetCongestionControl ( TypeId  congControl)
inlineprotected

Congestion control of the sender socket.

Parameters
congControltypeid of the congestion control algorithm

Definition at line 693 of file tcp-general-test.h.

References m_congControlTypeId.

Referenced by ConfigureEnvironment().

+ Here is the caller graph for this function:

◆ SetDelAckMaxCount()

void TcpGeneralTest::SetDelAckMaxCount ( SocketWho  who,
uint32_t  count 
)
protected

Forcefully set the delayed acknowledgement count.

Parameters
whosocket to force
countvalue of delayed ACKs

Definition at line 967 of file tcp-general-test.cc.

References m_receiverSocket, m_senderSocket, NS_FATAL_ERROR, RECEIVER, and SENDER.

Referenced by TcpLinuxRenoSSTest::ConfigureProperties(), TcpLinuxRenoCongAvoidTest::ConfigureProperties(), and TcpPacingTest::ConfigureProperties().

+ Here is the caller graph for this function:

◆ SetInitialCwnd()

void TcpGeneralTest::SetInitialCwnd ( SocketWho  who,
uint32_t  initialCwnd 
)
protected

Forcefully set the initial cwnd.

Parameters
whosocket to force
initialCwndsize of the initial cwnd (segments)

Definition at line 950 of file tcp-general-test.cc.

References m_receiverSocket, m_senderSocket, NS_FATAL_ERROR, RECEIVER, and SENDER.

Referenced by ConfigureProperties(), ns3::TcpCloseWithLossTestCase::ConfigureProperties(), TcpLinuxRenoSSTest::ConfigureProperties(), TcpLinuxRenoCongAvoidTest::ConfigureProperties(), TcpPacingTest::ConfigureProperties(), and TcpZeroWindowTest::ConfigureProperties().

+ Here is the caller graph for this function:

◆ SetInitialSsThresh()

void TcpGeneralTest::SetInitialSsThresh ( SocketWho  who,
uint32_t  initialSsThresh 
)
protected

Forcefully set the initial ssthresh.

Parameters
whosocket to force
initialSsThreshInitial slow start threshold (bytes)

Definition at line 1035 of file tcp-general-test.cc.

References m_receiverSocket, m_senderSocket, NS_FATAL_ERROR, RECEIVER, and SENDER.

Referenced by ConfigureProperties(), TcpNewRenoCongAvoidNormalTest::ConfigureProperties(), TcpFastRetrTest::ConfigureProperties(), TcpLinuxRenoCongAvoidTest::ConfigureProperties(), TcpPacingTest::ConfigureProperties(), TcpRtoTest::ConfigureProperties(), and TcpSlowStartNormalTest::ConfigureProperties().

+ Here is the caller graph for this function:

◆ SetMTU()

◆ SetPaceInitialWindow()

void TcpGeneralTest::SetPaceInitialWindow ( SocketWho  who,
bool  paceWindow 
)
protected

Enable or disable pacing of the initial window.

Parameters
whosocket
paceWindowBoolean to enable or disable pacing of initial window

Definition at line 1018 of file tcp-general-test.cc.

References m_receiverSocket, m_senderSocket, NS_FATAL_ERROR, RECEIVER, and SENDER.

Referenced by TcpPacingTest::ConfigureProperties().

+ Here is the caller graph for this function:

◆ SetPacingStatus()

void TcpGeneralTest::SetPacingStatus ( SocketWho  who,
bool  pacing 
)
protected

Enable or disable pacing in the TCP socket.

Parameters
whosocket
pacingBoolean to enable or disable pacing

Definition at line 1001 of file tcp-general-test.cc.

References m_receiverSocket, m_senderSocket, NS_FATAL_ERROR, RECEIVER, and SENDER.

Referenced by TcpPacingTest::ConfigureProperties().

+ Here is the caller graph for this function:

◆ SetPropagationDelay()

◆ SetRcvBufSize()

void TcpGeneralTest::SetRcvBufSize ( SocketWho  who,
uint32_t  size 
)
protected

Forcefully set a defined size for rx buffer.

Parameters
whosocket to force
sizesize of the rx buffer

Definition at line 916 of file tcp-general-test.cc.

References m_receiverSocket, m_senderSocket, NS_FATAL_ERROR, RECEIVER, and SENDER.

Referenced by TcpZeroWindowTest::IncreaseBufSize().

+ Here is the caller graph for this function:

◆ SetRecoveryAlgorithm()

void ns3::TcpGeneralTest::SetRecoveryAlgorithm ( TypeId  recovery)
inlineprotected

recovery algorithm of the sender socket

Parameters
recoverytypeid of the recovery algorithm

Definition at line 703 of file tcp-general-test.h.

References m_recoveryTypeId.

Referenced by ConfigureEnvironment().

+ Here is the caller graph for this function:

◆ SetSegmentSize()

◆ SetTransmitStart()

void ns3::TcpGeneralTest::SetTransmitStart ( Time  startTime)
inlineprotected

◆ SetUseEcn()

void TcpGeneralTest::SetUseEcn ( SocketWho  who,
TcpSocketState::UseEcn_t  useEcn 
)
protected

Forcefully set the ECN mode of use.

Parameters
whosocket to force
useEcnValue representing the mode of ECN usage requested

Definition at line 984 of file tcp-general-test.cc.

References m_receiverSocket, m_senderSocket, NS_FATAL_ERROR, RECEIVER, and SENDER.

Referenced by TcpDctcpCodePointsTest::ConfigureProperties(), and ns3::TcpEcnTest::ConfigureProperties().

+ Here is the caller graph for this function:

◆ SsThreshTrace()

virtual void ns3::TcpGeneralTest::SsThreshTrace ( uint32_t  oldValue,
uint32_t  newValue 
)
inlineprotectedvirtual

Slow start threshold changes.

This applies only for sender socket.

Parameters
oldValueold value
newValuenew value

Reimplemented in TcpSsThreshRtoTest.

Definition at line 769 of file tcp-general-test.h.

Referenced by DoRun().

+ Here is the caller graph for this function:

◆ Tx()

void TcpGeneralTest::Tx ( const Ptr< const Packet p,
const TcpHeader h,
SocketWho  who 
)
protectedvirtual

Packet transmitted down to IP layer.

Parameters
ppacket
hheader
whothe socket which has received the packet (SENDER or RECEIVER)

Reimplemented in TcpBytesInFlightTest, ns3::TcpCloseWithLossTestCase, TcpDctcpCodePointsTest, ns3::TcpEcnTest, TcpFastRetrTest, TcpLinuxRenoSSTest, TcpLinuxRenoCongAvoidTest, TcpLargeTransferLossTest, TcpPacingTest, TcpTimeRtoTest, TcpRttEstimationTest, SackPermittedTestCase, TcpSlowStartNormalTest, TimestampTestCase, WScalingTestCase, and TcpZeroWindowTest.

Definition at line 491 of file tcp-general-test.cc.

References NS_LOG_FUNCTION.

Referenced by TxPacketCb().

+ Here is the caller graph for this function:

◆ TxPacketCb()

void TcpGeneralTest::TxPacketCb ( const Ptr< const Packet p,
const TcpHeader h,
const Ptr< const TcpSocketBase tcp 
)
private

Tx packet Callback.

Parameters
pThe packet.
hTCP header.
tcpThe TCP socket.

Definition at line 522 of file tcp-general-test.cc.

References m_receiverSocket, m_senderSocket, NS_FATAL_ERROR, RECEIVER, SENDER, and Tx().

Referenced by DoRun().

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

◆ UpdatedRttHistory()

virtual void ns3::TcpGeneralTest::UpdatedRttHistory ( const SequenceNumber32 seq,
uint32_t  sz,
bool  isRetransmission,
SocketWho  who 
)
inlineprotectedvirtual

Updated the Rtt history.

Parameters
seqSequence inserted
szsize
isRetransmissionself-explanatory
whowhere the rtt history was updated

Reimplemented in TcpRttEstimationTest.

Definition at line 952 of file tcp-general-test.h.

Referenced by UpdateRttHistoryCb().

+ Here is the caller graph for this function:

◆ UpdateRttHistoryCb()

void TcpGeneralTest::UpdateRttHistoryCb ( Ptr< const TcpSocketBase tcp,
const SequenceNumber32 seq,
uint32_t  sz,
bool  isRetransmission 
)
private

Update RTT with new data.

Parameters
tcpThe TCP socket.
seqThe sequence number.
szThe segment size.
isRetransmissionTrue if packet is a retransmission.

Definition at line 401 of file tcp-general-test.cc.

References m_receiverSocket, m_senderSocket, NS_FATAL_ERROR, RECEIVER, SENDER, and UpdatedRttHistory().

Referenced by DoRun().

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

Member Data Documentation

◆ m_congControlTypeId

◆ m_interPacketInterval

Time ns3::TcpGeneralTest::m_interPacketInterval
private

Time between sending application packet down to tcp socket.

Definition at line 1044 of file tcp-general-test.h.

Referenced by DoRun(), GetPktInterval(), and SetAppPktInterval().

◆ m_mtu

uint32_t ns3::TcpGeneralTest::m_mtu
private

MTU of the environment.

Definition at line 1040 of file tcp-general-test.h.

Referenced by DoRun(), GetMtu(), and SetMTU().

◆ m_pktCount

uint32_t ns3::TcpGeneralTest::m_pktCount
private

Count of the application packet.

Definition at line 1043 of file tcp-general-test.h.

Referenced by DoRun(), GetPktCount(), and SetAppPktCount().

◆ m_pktSize

uint32_t ns3::TcpGeneralTest::m_pktSize
private

Size of the application packet.

Definition at line 1042 of file tcp-general-test.h.

Referenced by DoRun(), GetPktSize(), and SetAppPktSize().

◆ m_propagationDelay

Time ns3::TcpGeneralTest::m_propagationDelay
private

Propagation delay of the channel.

Definition at line 1037 of file tcp-general-test.h.

Referenced by CreateChannel(), GetPropagationDelay(), and SetPropagationDelay().

◆ m_receiverSocket

◆ m_recoveryTypeId

TypeId ns3::TcpGeneralTest::m_recoveryTypeId
protected

◆ m_remoteAddr

InetSocketAddress ns3::TcpGeneralTest::m_remoteAddr
private

Remote peer address.

Definition at line 1157 of file tcp-general-test.h.

Referenced by DoConnect(), and DoRun().

◆ m_senderSocket

◆ m_startTime

Time ns3::TcpGeneralTest::m_startTime
private

Data transmission time.

Definition at line 1039 of file tcp-general-test.h.

Referenced by DoRun(), GetStartTime(), and SetTransmitStart().


The documentation for this class was generated from the following files: