This documentation is not the Latest Release.
A Discrete-Event Network Simulator
API
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, uint32_t pktSize=500, uint32_t pktCount=10, const Time &pktInterval=Seconds(0.01), const Time &propagationDelay=Seconds(0.5), const Time &startTime=Seconds(10), uint32_t initialSlowStartThresh=0xffff, uint32_t initialCwnd=1, uint32_t segmentSize=500, TypeId congestionControl=TcpNewReno::GetTypeId(), uint32_t mtu=1500)
 TcpGeneralTest constructor. More...
 
 ~TcpGeneralTest ()
 
- Public Member Functions inherited from ns3::TestCase
virtual ~TestCase ()
 Destructor. More...
 
std::string GetName (void) const
 

Protected Member Functions

virtual void CongStateTrace (const TcpSocketState::TcpCongState_t oldValue, const TcpSocketState::TcpCongState_t newValue)
 State on Ack state machine changes. More...
 
virtual Ptr< SimpleChannelCreateChannel ()
 Create and return the channel installed between the two socket. More...
 
virtual Ptr< ErrorModelCreateReceiverErrorModel ()
 Create and return the error model to install in the receiver node. More...
 
virtual Ptr< TcpSocketMsgBaseCreateReceiverSocket (Ptr< Node > node)
 Create and install the socket to install on the receiver. More...
 
virtual Ptr< ErrorModelCreateSenderErrorModel ()
 Create and return the error model to install in the sender node. More...
 
virtual Ptr< TcpSocketMsgBaseCreateSenderSocket (Ptr< Node > node)
 Create and install the socket to install on the sender. More...
 
virtual Ptr< TcpSocketMsgBaseCreateSocket (Ptr< Node > node, TypeId socketType, TypeId congControl)
 Create a socket. More...
 
virtual void CWndTrace (uint32_t oldValue, uint32_t newValue)
 Congestion window changes. More...
 
void DoConnect ()
 Scheduled at 0.0, SENDER starts the connection to RECEIVER. More...
 
virtual void DoRun (void)
 Execute the tcp test. More...
 
virtual void DoTeardown (void)
 Teardown the TCP test. More...
 
virtual void ErrorClose (SocketWho who)
 Socket closed with an error. More...
 
virtual void FinalChecks ()
 Performs the (eventual) final checks through test asserts. More...
 
Time GetClockGranularity (SocketWho who)
 Get the clock granularity attribute. More...
 
Time GetConnTimeout (SocketWho who)
 Get the retransmission time for the SYN segments. More...
 
uint32_t GetDelAckCount (SocketWho who)
 Get the number of delayed ack (if present) More...
 
Time GetDelAckTimeout (SocketWho who)
 Get the timeout of delayed ack (if present) More...
 
uint32_t GetDupAckCount (SocketWho who)
 Get the number of dupack received. More...
 
uint32_t GetInitialCwnd () const
 Get the initial congestion window. More...
 
uint32_t GetInitialSsThresh () const
 Get the initial slow start threshold. More...
 
Time GetMinRto (SocketWho who)
 Get the minimun RTO attribute. More...
 
uint32_t GetMtu () const
 Get the MTU of the environment. More...
 
EventId GetPersistentEvent (SocketWho who)
 Get the persistent event of the selected socket. More...
 
Time GetPersistentTimeout (SocketWho who)
 Get the persistent timeout of the selected socket. More...
 
uint32_t GetPktCount () const
 Get the number of application packets. More...
 
Time GetPktInterval () const
 Get the interval to wait for each packet sent down from application to TCP. More...
 
uint32_t GetPktSize () const
 Get the application packet size. More...
 
Time GetPropagationDelay () const
 Get the channel Propagation Delay. More...
 
Ptr< TcpSocketMsgBaseGetReceiverSocket ()
 Get the pointer to a previously created receiver socket. More...
 
uint32_t GetReTxThreshold (SocketWho who)
 Get the retransmission threshold. More...
 
Time GetRto (SocketWho who)
 Get the retransmission time. More...
 
Ptr< RttEstimatorGetRttEstimator (SocketWho who)
 Get the Rtt estimator of the socket. More...
 
uint32_t GetRWnd (SocketWho who)
 Get the rWnd of the selected socket. More...
 
uint32_t GetSegSize (SocketWho who)
 Get the segment size of the node specified. More...
 
Ptr< TcpSocketMsgBaseGetSenderSocket ()
 Get the pointer to a previously created sender socket. More...
 
Time GetStartTime () const
 Get the data start time. More...
 
Ptr< TcpSocketStateGetTcb (SocketWho who)
 Get the TCB from selected socket. More...
 
TcpSocket::TcpStates_t GetTcpState (SocketWho who)
 Get the state of the TCP state machine. More...
 
virtual void NormalClose (SocketWho who)
 Socket closed normally. More...
 
virtual void PhyDrop (SocketWho who)
 Link drop. More...
 
virtual void ProcessedAck (const Ptr< const TcpSocketState > tcb, const TcpHeader &h, SocketWho who)
 Processed ack. More...
 
virtual void QueueDrop (SocketWho who)
 Drop on the queue. More...
 
virtual void RcvAck (const Ptr< const TcpSocketState > tcb, const TcpHeader &h, SocketWho who)
 Received ack. More...
 
virtual void ReceivePacket (Ptr< Socket > socket)
 Packet received. More...
 
virtual void RTOExpired (const Ptr< const TcpSocketState > tcb, SocketWho who)
 Rto has expired. More...
 
virtual void Rx (const Ptr< const Packet > p, const TcpHeader &h, SocketWho who)
 Packet received from IP layer. More...
 
void SendPacket (Ptr< Socket > socket, uint32_t pktSize, uint32_t pktCount, Time pktInterval)
 Send packets to other endpoint. More...
 
void SetRcvBufSize (SocketWho who, uint32_t size)
 Forcefully set a defined size for rx buffer. More...
 
virtual void Tx (const Ptr< const Packet > p, const TcpHeader &h, SocketWho who)
 Packet transmitted down to IP layer. More...
 
- Protected Member Functions inherited from ns3::TestCase
 TestCase (std::string name)
 Constructor. More...
 
void AddTestCase (TestCase *testCase, enum TestDuration duration)
 Add an individual child TestCase to this test suite. More...
 
TestCaseGetParent () const
 Get the parent of this TestCsse. More...
 
bool IsStatusFailure (void) const
 Check if any tests failed. More...
 
bool IsStatusSuccess (void) const
 Check if all tests passed. More...
 
void SetDataDir (std::string directory)
 Set the data directory where reference trace files can be found. More...
 
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. More...
 
bool MustAssertOnFailure (void) const
 Check if this run should assert on failure. More...
 
bool MustContinueOnFailure (void) const
 Check if this run should continue on failure. More...
 
std::string CreateDataDirFilename (std::string filename)
 Construct the full path to a file in the data directory. More...
 
std::string CreateTempDirFilename (std::string filename)
 Construct the full path to a file in a temporary directory. More...
 

Protected Attributes

TypeId m_congControlTypeId
 Congestion control. More...
 

Private Member Functions

void ErrorCloseCb (Ptr< Socket > socket)
 
void ForkCb (Ptr< TcpSocketMsgBase > tcp)
 
void HandleAccept (Ptr< Socket > socket, const Address &from)
 
void NormalCloseCb (Ptr< Socket > socket)
 
void PhyDropCb (std::string context, Ptr< const Packet > p)
 
void ProcessedAckCb (Ptr< const Packet > p, const TcpHeader &h, Ptr< const TcpSocketBase > tcp)
 
void QueueDropCb (std::string context, Ptr< const Packet > p)
 
void RcvAckCb (Ptr< const Packet > p, const TcpHeader &h, Ptr< const TcpSocketBase > tcp)
 
void RtoExpiredCb (const Ptr< const TcpSocketState > tcb, const Ptr< const TcpSocketBase > tcp)
 
void RxPacketCb (const Ptr< const Packet > p, const TcpHeader &h, const Ptr< const TcpSocketBase > tcp)
 
void TxPacketCb (const Ptr< const Packet > p, const TcpHeader &h, const Ptr< const TcpSocketBase > tcp)
 

Private Attributes

uint32_t m_initialCwnd
 Initial congestion window. More...
 
uint32_t m_initialSlowStartThresh
 Initial slow start threshold. More...
 
Time m_interPacketInterval
 Time between sending application packet. More...
 
uint32_t m_mtu
 MTU of the environment. More...
 
uint32_t m_pktCount
 Count of the application packet. More...
 
uint32_t m_pktSize
 Size of the application packet. More...
 
Time m_propagationDelay
 Propagation delay of the channel. More...
 
Ptr< TcpSocketMsgBasem_receiverSocket
 Pointer to receiver socket. More...
 
InetSocketAddress m_remoteAddr
 
uint32_t m_segmentSize
 Segment size. More...
 
Ptr< TcpSocketMsgBasem_senderSocket
 Pointer to sender socket. More...
 
Time m_startTime
 Data transmission time. More...
 

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 197 of file tcp-general-test.h.

Member Enumeration Documentation

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 228 of file tcp-general-test.h.

Constructor & Destructor Documentation

ns3::TcpGeneralTest::TcpGeneralTest ( const std::string &  desc,
uint32_t  pktSize = 500,
uint32_t  pktCount = 10,
const Time pktInterval = Seconds (0.01),
const Time propagationDelay = Seconds (0.5),
const Time startTime = Seconds (10),
uint32_t  initialSlowStartThresh = 0xffff,
uint32_t  initialCwnd = 1,
uint32_t  segmentSize = 500,
TypeId  congestionControl = TcpNewReno::GetTypeId (),
uint32_t  mtu = 1500 
)

TcpGeneralTest constructor.

Parameters
pktSizeapplication packet size
pktCountcount of application packet to generate
pktInterval(application) interval between each generated packet
propagationDelaypropagation delay of the channel
startTimetime of the first application-generated packet
mtuMTU of the environment
descdescription of the test

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

References NS_LOG_FUNCTION.

ns3::TcpGeneralTest::~TcpGeneralTest ( )

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

References NS_LOG_FUNCTION_NOARGS.

Member Function Documentation

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 ns3::TcpFastRetrTest.

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

Referenced by DoRun().

+ Here is the caller graph for this function:

Ptr< SimpleChannel > ns3::TcpGeneralTest::CreateChannel ( )
protectedvirtual

Create and return the channel installed between the two socket.

Returns
A SimpleChannel subclass

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

References m_propagationDelay.

Referenced by DoRun().

+ Here is the caller graph for this function:

Ptr< ErrorModel > ns3::TcpGeneralTest::CreateReceiverErrorModel ( )
protectedvirtual

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

Returns
receiver error model

Reimplemented in ns3::TcpTimeRtoTest, and ns3::TcpFastRetrTest.

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

Referenced by DoRun().

+ Here is the caller graph for this function:

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

Create and install the socket to install on the receiver.

Parameters
nodereceiver node pointer
Returns
the socket to be installed in the receiver

Reimplemented in ns3::TcpSlowStartAttackerTest, ns3::WScalingTestCase, ns3::TimestampTestCase, and ns3::TcpZeroWindowTest.

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

References CreateSocket(), ns3::TcpSocketMsgBase::GetTypeId(), and m_congControlTypeId.

Referenced by ns3::TcpZeroWindowTest::CreateReceiverSocket(), ns3::TimestampTestCase::CreateReceiverSocket(), ns3::WScalingTestCase::CreateReceiverSocket(), and DoRun().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Ptr< ErrorModel > ns3::TcpGeneralTest::CreateSenderErrorModel ( )
protectedvirtual

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

Returns
sender error model

Reimplemented in ns3::TcpFastRetrTest.

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

Referenced by DoRun().

+ Here is the caller graph for this function:

Ptr< TcpSocketMsgBase > ns3::TcpGeneralTest::CreateSenderSocket ( Ptr< Node node)
protectedvirtual

Create and install the socket to install on the sender.

Parameters
nodesender node pointer
Returns
the socket to be installed in the sender

Reimplemented in ns3::TcpTimeRtoTest, ns3::WScalingTestCase, ns3::TcpFastRetrTest, ns3::TcpRtoTest, and ns3::TimestampTestCase.

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

References CreateSocket(), ns3::TcpSocketMsgBase::GetTypeId(), and m_congControlTypeId.

Referenced by ns3::TcpRtoTest::CreateSenderSocket(), ns3::TimestampTestCase::CreateSenderSocket(), ns3::TcpFastRetrTest::CreateSenderSocket(), ns3::WScalingTestCase::CreateSenderSocket(), ns3::TcpTimeRtoTest::CreateSenderSocket(), and DoRun().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Create a socket.

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

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

References ns3::ObjectFactory::Create(), ns3::Object::GetObject(), ns3::RttMeanDeviation::GetTypeId(), m_initialCwnd, m_initialSlowStartThresh, m_segmentSize, ns3::ObjectBase::SetAttribute(), and ns3::ObjectFactory::SetTypeId().

Referenced by ns3::TcpSlowStartAttackerTest::CreateReceiverSocket(), CreateReceiverSocket(), and CreateSenderSocket().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Congestion window changes.

Parameters
oldValueold value
newValuenew value

Reimplemented in ns3::TcpNewRenoCongAvoidNormalTest, and ns3::TcpSlowStartNormalTest.

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

Referenced by DoRun().

+ Here is the caller graph for this function:

void ns3::TcpGeneralTest::DoConnect ( void  )
protected

Scheduled at 0.0, SENDER starts the connection to RECEIVER.

Definition at line 205 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:

void ns3::TcpGeneralTest::DoRun ( void  )
protectedvirtual

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.

Implements ns3::TestCase.

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

References ns3::Ipv4AddressHelper::Assign(), third::channel, CongStateTrace(), ns3::NodeContainer::Create(), CreateChannel(), CreateReceiverErrorModel(), CreateReceiverSocket(), CreateSenderErrorModel(), CreateSenderSocket(), CWndTrace(), DoConnect(), ns3::Packet::EnablePrinting(), ErrorCloseCb(), ForkCb(), ns3::NetDeviceContainer::Get(), ns3::NodeContainer::Get(), ns3::Ipv4InterfaceContainer::GetAddress(), ns3::Ipv4Address::GetAny(), ns3::Node::GetId(), HandleAccept(), ns3::InternetStackHelper::Install(), ns3::SimpleNetDeviceHelper::Install(), m_interPacketInterval, m_mtu, m_pktCount, m_pktSize, m_receiverSocket, m_remoteAddr, m_senderSocket, m_startTime, ns3::MakeCallback(), ns3::MakeNullCallback(), first::nodes, NormalCloseCb(), NS_LOG_INFO, PhyDropCb(), ProcessedAckCb(), QueueDropCb(), RcvAckCb(), ReceivePacket(), RtoExpiredCb(), ns3::Simulator::Run(), RxPacketCb(), ns3::Simulator::Schedule(), ns3::Simulator::ScheduleWithContext(), ns3::Seconds(), SendPacket(), ns3::Ipv4AddressHelper::SetBase(), ns3::SimpleNetDeviceHelper::SetNetDevicePointToPointMode(), and TxPacketCb().

+ Here is the call graph for this function:

void ns3::TcpGeneralTest::DoTeardown ( void  )
protectedvirtual

Teardown the TCP test.

Reimplemented from ns3::TestCase.

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

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

+ Here is the call graph for this function:

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 ns3::TcpTimeRtoTest.

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

Referenced by ErrorCloseCb().

+ Here is the caller graph for this function:

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

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

References ErrorClose(), ns3::Socket::GetNode(), 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:

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

Performs the (eventual) final checks through test asserts.

Reimplemented in ns3::TcpTimeRtoTest, ns3::TcpFastRetrTest, ns3::TcpRtoTest, and ns3::TcpZeroWindowTest.

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

Referenced by DoTeardown().

+ Here is the caller graph for this function:

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

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

References m_receiverSocket, and NS_LOG_FUNCTION.

Referenced by DoRun().

+ Here is the caller graph for this function:

Time ns3::TcpGeneralTest::GetClockGranularity ( SocketWho  who)
protected

Get the clock granularity attribute.

Parameters
whonode to get the parameter from
Returns
clock granularity

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

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

Referenced by ns3::TcpTimeRtoTest::Tx().

+ Here is the caller graph for this function:

Time ns3::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 581 of file tcp-general-test.cc.

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

Referenced by ns3::TcpTimeRtoTest::Tx().

+ Here is the caller graph for this function:

uint32_t ns3::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 496 of file tcp-general-test.cc.

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

Referenced by ns3::TcpFastRetrTest::Tx().

+ Here is the caller graph for this function:

Time ns3::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 513 of file tcp-general-test.cc.

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

uint32_t ns3::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 479 of file tcp-general-test.cc.

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

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

+ Here is the caller graph for this function:

uint32_t ns3::TcpGeneralTest::GetInitialCwnd ( void  ) const
inlineprotected

Get the initial congestion window.

Returns
initial cwnd

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

References m_initialCwnd.

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

Get the initial slow start threshold.

Returns
initial slow start threshold

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

References m_initialSlowStartThresh.

Referenced by ns3::TcpSlowStartNormalTest::CWndTrace().

+ Here is the caller graph for this function:

Time ns3::TcpGeneralTest::GetMinRto ( SocketWho  who)
protected

Get the minimun RTO attribute.

Parameters
whonode to get the parameter from
Returns
minimum RTO time

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

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

Referenced by ns3::TcpTimeRtoTest::Tx().

+ Here is the caller graph for this function:

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

Get the MTU of the environment.

Returns
MTU of the environment

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

References m_mtu.

EventId ns3::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 668 of file tcp-general-test.cc.

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

Referenced by ns3::TcpZeroWindowTest::ProcessedAck().

+ Here is the caller graph for this function:

Time ns3::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 686 of file tcp-general-test.cc.

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

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

Get the number of application packets.

Returns
count of application packets to be generated

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

References m_pktCount.

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 629 of file tcp-general-test.h.

References m_interPacketInterval.

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

Get the application packet size.

Returns
application packet size

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

References m_pktSize.

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

Get the channel Propagation Delay.

Returns
propagation delay of the channel

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

References m_propagationDelay.

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 293 of file tcp-general-test.h.

References m_receiverSocket.

uint32_t ns3::TcpGeneralTest::GetReTxThreshold ( SocketWho  who)
protected

Get the retransmission threshold.

Parameters
whonode to get the parameter from
Returns
retransmission threshold

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

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

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

+ Here is the caller graph for this function:

Time ns3::TcpGeneralTest::GetRto ( SocketWho  who)
protected

Get the retransmission time.

Parameters
whonode to get the parameter from
Returns
calculated RTO time

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

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

Referenced by ns3::TcpTimeRtoTest::RTOExpired(), and ns3::TcpTimeRtoTest::Tx().

+ Here is the caller graph for this function:

Ptr< RttEstimator > ns3::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 598 of file tcp-general-test.cc.

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

Referenced by ns3::TcpTimeRtoTest::Tx().

+ Here is the caller graph for this function:

uint32_t ns3::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 650 of file tcp-general-test.cc.

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

uint32_t ns3::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 530 of file tcp-general-test.cc.

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

Referenced by ns3::TcpNewRenoCongAvoidNormalTest::Check(), ns3::TcpSlowStartNormalTest::CWndTrace(), ns3::TcpSlowStartNormalTest::Rx(), ns3::TcpFastRetrTest::Rx(), ns3::TcpSlowStartNormalTest::Tx(), and ns3::TcpFastRetrTest::Tx().

+ Here is the caller graph for this function:

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 284 of file tcp-general-test.h.

References m_senderSocket.

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

Get the data start time.

Returns
start time of data packets

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

References m_startTime.

Ptr< TcpSocketState > ns3::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 704 of file tcp-general-test.cc.

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

Referenced by ns3::TcpZeroWindowTest::Tx().

+ Here is the caller graph for this function:

TcpSocket::TcpStates_t ns3::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 632 of file tcp-general-test.cc.

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

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

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

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

Referenced by DoRun().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Socket closed normally.

Parameters
whothe socket closed (SENDER or RECEIVER)

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

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

Referenced by NormalCloseCb().

+ Here is the caller graph for this function:

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

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

References ns3::Socket::GetNode(), 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:

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

Link drop.

Parameters
whowhere the drop occurred (SENDER or RECEIVER)

Reimplemented in ns3::TcpNewRenoCongAvoidNormalTest.

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

Referenced by PhyDropCb().

+ Here is the caller graph for this function:

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

Definition at line 301 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:

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 ns3::TcpFastRetrTest, ns3::TcpRtoTest, and ns3::TcpZeroWindowTest.

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

Referenced by ProcessedAckCb().

+ Here is the caller graph for this function:

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

Definition at line 436 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:

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

Drop on the queue.

Parameters
whowhere the drop occurred (SENDER or RECEIVER)

Reimplemented in ns3::TcpNewRenoCongAvoidNormalTest.

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

Referenced by QueueDropCb().

+ Here is the caller graph for this function:

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

Definition at line 284 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:

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 ns3::TcpFastRetrTest, and ns3::TcpRtoTest.

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

Referenced by RcvAckCb().

+ Here is the caller graph for this function:

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

Definition at line 382 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:

void ns3::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 65 of file tcp-general-test.cc.

References ns3::Packet::GetSize(), NS_LOG_FUNCTION, and ns3::Socket::RecvFrom().

Referenced by DoRun(), and HandleAccept().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

virtual void ns3::TcpGeneralTest::RTOExpired ( 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 ns3::TcpTimeRtoTest, ns3::TcpFastRetrTest, and ns3::TcpRtoTest.

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

Referenced by RtoExpiredCb().

+ Here is the caller graph for this function:

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

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

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

Referenced by DoRun().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::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 ns3::TcpFastRetrTest, ns3::TcpSlowStartNormalTest, ns3::TimestampTestCase, and ns3::TcpZeroWindowTest.

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

References NS_LOG_FUNCTION.

Referenced by RxPacketCb().

+ Here is the caller graph for this function:

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

Definition at line 418 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:

void ns3::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 81 of file tcp-general-test.cc.

References ns3::Socket::Close(), ns3::Time::GetSeconds(), NS_LOG_FUNCTION, ns3::Simulator::Schedule(), and ns3::Socket::Send().

Referenced by DoRun().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::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 722 of file tcp-general-test.cc.

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

Referenced by ns3::TcpZeroWindowTest::IncreaseBufSize().

+ Here is the caller graph for this function:

void ns3::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 ns3::TcpTimeRtoTest, ns3::TcpFastRetrTest, ns3::TcpSlowStartNormalTest, ns3::WScalingTestCase, ns3::TimestampTestCase, and ns3::TcpZeroWindowTest.

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

References NS_LOG_FUNCTION.

Referenced by TxPacketCb().

+ Here is the caller graph for this function:

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

Definition at line 400 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:

Member Data Documentation

TypeId ns3::TcpGeneralTest::m_congControlTypeId
protected
uint32_t ns3::TcpGeneralTest::m_initialCwnd
private

Initial congestion window.

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

Referenced by CreateSocket(), and GetInitialCwnd().

uint32_t ns3::TcpGeneralTest::m_initialSlowStartThresh
private

Initial slow start threshold.

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

Referenced by CreateSocket(), and GetInitialSsThresh().

Time ns3::TcpGeneralTest::m_interPacketInterval
private

Time between sending application packet.

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

Referenced by DoRun(), and GetPktInterval().

uint32_t ns3::TcpGeneralTest::m_mtu
private

MTU of the environment.

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

Referenced by DoRun(), and GetMtu().

uint32_t ns3::TcpGeneralTest::m_pktCount
private

Count of the application packet.

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

Referenced by DoRun(), and GetPktCount().

uint32_t ns3::TcpGeneralTest::m_pktSize
private

Size of the application packet.

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

Referenced by DoRun(), and GetPktSize().

Time ns3::TcpGeneralTest::m_propagationDelay
private

Propagation delay of the channel.

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

Referenced by CreateChannel(), and GetPropagationDelay().

InetSocketAddress ns3::TcpGeneralTest::m_remoteAddr
private

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

Referenced by DoConnect(), and DoRun().

uint32_t ns3::TcpGeneralTest::m_segmentSize
private

Segment size.

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

Referenced by CreateSocket().

Time ns3::TcpGeneralTest::m_startTime
private

Data transmission time.

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

Referenced by DoRun(), and GetStartTime().


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