General infrastructure for TCP testing. More...
#include "tcp-general-test.h"
Public Types | |
enum | SocketWho { SENDER, RECEIVER } |
Used as parameter of methods, specifies on what node the caller is interested (e.g. More... | |
![]() | |
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. More... | |
~TcpGeneralTest () | |
![]() | |
virtual | ~TestCase () |
Destructor. More... | |
std::string | GetName (void) const |
Protected Member Functions | |
virtual void | BytesInFlightTrace (uint32_t oldValue, uint32_t newValue) |
Bytes in flight changes. More... | |
virtual void | ConfigureEnvironment (void) |
Change the configuration of the evironment. More... | |
virtual void | ConfigureProperties (void) |
Change the configuration of the socket properties. More... | |
virtual void | CongStateTrace (const TcpSocketState::TcpCongState_t oldValue, const TcpSocketState::TcpCongState_t newValue) |
State on Ack state machine changes. More... | |
virtual Ptr< SimpleChannel > | CreateChannel () |
Create and return the channel installed between the two socket. More... | |
virtual Ptr< ErrorModel > | CreateReceiverErrorModel () |
Create and return the error model to install in the receiver node. More... | |
virtual Ptr< TcpSocketMsgBase > | CreateReceiverSocket (Ptr< Node > node) |
Create and install the socket to install on the receiver. More... | |
virtual Ptr< ErrorModel > | CreateSenderErrorModel () |
Create and return the error model to install in the sender node. More... | |
virtual Ptr< TcpSocketMsgBase > | CreateSenderSocket (Ptr< Node > node) |
Create and install the socket to install on the sender. More... | |
virtual Ptr< TcpSocketMsgBase > | CreateSocket (Ptr< Node > node, TypeId socketType, TypeId congControl) |
Create a socket. More... | |
virtual void | CWndTrace (uint32_t oldValue, uint32_t newValue) |
Congestion window changes. More... | |
virtual void | DataSent (uint32_t size, SocketWho who) |
Notifying application for sent data. 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... | |
SequenceNumber32 | GetHighestTxMark (SocketWho who) |
Get the highest tx mark of the node specified. More... | |
uint32_t | GetInitialCwnd (SocketWho who) |
Get the initial congestion window. More... | |
uint32_t | GetInitialSsThresh (SocketWho who) |
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< TcpSocketMsgBase > | GetReceiverSocket () |
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< RttEstimator > | GetRttEstimator (SocketWho who) |
Get the Rtt estimator of the socket. More... | |
uint32_t | GetRWnd (SocketWho who) |
Get the rWnd of the selected socket. More... | |
Ptr< TcpRxBuffer > | GetRxBuffer (SocketWho who) |
Get the Rx buffer from selected socket. More... | |
uint32_t | GetSegSize (SocketWho who) |
Get the segment size of the node specified. More... | |
Ptr< TcpSocketMsgBase > | GetSenderSocket () |
Get the pointer to a previously created sender socket. More... | |
Time | GetStartTime () const |
Get the data start time. More... | |
Ptr< TcpSocketState > | GetTcb (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 | RttTrace (Time oldTime, Time newTime) |
Rtt changes. 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 | SetAppPktCount (uint32_t pktCount) |
Set app packet count. More... | |
void | SetAppPktInterval (Time pktInterval) |
Interval between app-generated packet. More... | |
void | SetAppPktSize (uint32_t pktSize) |
Set app packet size. More... | |
void | SetCongestionControl (TypeId congControl) |
Congestion control of the sender socket. More... | |
void | SetInitialCwnd (SocketWho who, uint32_t initialCwnd) |
Forcefully set the initial cwnd. More... | |
void | SetInitialSsThresh (SocketWho who, uint32_t initialSsThresh) |
Forcefully set the initial ssth. More... | |
void | SetMTU (uint32_t mtu) |
MTU of the bottleneck link. More... | |
void | SetPropagationDelay (Time propDelay) |
Propagation delay of the bottleneck link. More... | |
void | SetRcvBufSize (SocketWho who, uint32_t size) |
Forcefully set a defined size for rx buffer. More... | |
void | SetSegmentSize (SocketWho who, uint32_t segmentSize) |
Forcefully set the segment size. More... | |
void | SetTransmitStart (Time startTime) |
Set the initial time at which the application sends the first data packet. More... | |
virtual void | SsThreshTrace (uint32_t oldValue, uint32_t newValue) |
Slow start threshold changes. More... | |
virtual void | Tx (const Ptr< const Packet > p, const TcpHeader &h, SocketWho who) |
Packet transmitted down to IP layer. More... | |
virtual void | UpdatedRttHistory (const SequenceNumber32 &seq, uint32_t sz, bool isRetransmission, SocketWho who) |
Updated the Rtt history. More... | |
![]() | |
TestCase (std::string name) | |
Constructor. More... | |
void | AddTestCase (TestCase *testCase, enum TestDuration duration) |
Add an individual child TestCase to this test suite. More... | |
TestCase * | GetParent () 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 | DataSentCb (Ptr< Socket > socket, uint32_t size) |
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) |
void | UpdateRttHistoryCb (Ptr< const TcpSocketBase > tcp, const SequenceNumber32 &seq, uint32_t sz, bool isRetransmission) |
Private Attributes | |
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< TcpSocketMsgBase > | m_receiverSocket |
Pointer to receiver socket. More... | |
InetSocketAddress | m_remoteAddr |
Ptr< TcpSocketMsgBase > | m_senderSocket |
Pointer to sender socket. More... | |
Time | m_startTime |
Data transmission time. More... | |
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:
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.
Definition at line 211 of file tcp-general-test.h.
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 229 of file tcp-general-test.h.
ns3::TcpGeneralTest::TcpGeneralTest | ( | const std::string & | desc | ) |
TcpGeneralTest constructor.
Please use the method ConfigureEnvironment () to configure other parameters than the test description.
desc | description of the test |
Definition at line 36 of file tcp-general-test.cc.
References NS_LOG_FUNCTION.
ns3::TcpGeneralTest::~TcpGeneralTest | ( | ) |
Definition at line 44 of file tcp-general-test.cc.
References NS_LOG_FUNCTION_NOARGS.
|
inlineprotectedvirtual |
Bytes in flight changes.
This applies only for sender socket.
oldValue | old value |
newValue | new value |
Reimplemented in ns3::TcpBytesInFlightTest.
Definition at line 640 of file tcp-general-test.h.
Referenced by DoRun().
|
protectedvirtual |
Change the configuration of the evironment.
Reimplemented in ns3::TcpDataSentCbTestCase, ns3::TcpTimeRtoTest, ns3::TcpNewRenoCongAvoidNormalTest, ns3::TcpFastRetrTest, ns3::TcpPktsAckedOpenTest, ns3::TcpSlowStartNormalTest, ns3::TcpRttEstimationTest, ns3::TcpBytesInFlightTest, ns3::TcpRtoTest, and ns3::TcpZeroWindowTest.
Definition at line 93 of file tcp-general-test.cc.
References m_congControlTypeId, ns3::MilliSeconds(), NS_LOG_FUNCTION, ns3::Seconds(), SetAppPktCount(), SetAppPktInterval(), SetAppPktSize(), SetCongestionControl(), SetMTU(), SetPropagationDelay(), and SetTransmitStart().
Referenced by ns3::TcpZeroWindowTest::ConfigureEnvironment(), ns3::TcpBytesInFlightTest::ConfigureEnvironment(), ns3::TcpRtoTest::ConfigureEnvironment(), ns3::TcpRttEstimationTest::ConfigureEnvironment(), ns3::TcpSlowStartNormalTest::ConfigureEnvironment(), ns3::TcpPktsAckedOpenTest::ConfigureEnvironment(), ns3::TcpNewRenoCongAvoidNormalTest::ConfigureEnvironment(), ns3::TcpFastRetrTest::ConfigureEnvironment(), ns3::TcpTimeRtoTest::ConfigureEnvironment(), ns3::TcpDataSentCbTestCase::ConfigureEnvironment(), and DoRun().
|
protectedvirtual |
Change the configuration of the socket properties.
Reimplemented in ns3::TcpNewRenoCongAvoidNormalTest, ns3::TcpFastRetrTest, ns3::TcpSlowStartNormalTest, ns3::TcpRtoTest, and ns3::TcpZeroWindowTest.
Definition at line 107 of file tcp-general-test.cc.
References NS_LOG_FUNCTION, RECEIVER, SENDER, SetInitialCwnd(), SetInitialSsThresh(), and SetSegmentSize().
Referenced by ns3::TcpZeroWindowTest::ConfigureProperties(), ns3::TcpRtoTest::ConfigureProperties(), ns3::TcpSlowStartNormalTest::ConfigureProperties(), ns3::TcpFastRetrTest::ConfigureProperties(), ns3::TcpNewRenoCongAvoidNormalTest::ConfigureProperties(), and DoRun().
|
inlineprotectedvirtual |
State on Ack state machine changes.
oldValue | old value |
newValue | new value |
Reimplemented in ns3::TcpFastRetrTest.
Definition at line 592 of file tcp-general-test.h.
Referenced by DoRun().
|
protectedvirtual |
Create and return the channel installed between the two socket.
Definition at line 245 of file tcp-general-test.cc.
References m_propagationDelay.
Referenced by DoRun().
|
protectedvirtual |
Create and return the error model to install in the receiver node.
Reimplemented in ns3::TcpRttEstimationWithLossTest, ns3::TcpTimeRtoTest, ns3::TcpBytesInFlightTest, and ns3::TcpFastRetrTest.
Definition at line 285 of file tcp-general-test.cc.
Referenced by DoRun().
|
protectedvirtual |
Create and install the socket to install on the receiver.
node | receiver node pointer |
Reimplemented in ns3::TcpDataSentCbTestCase, ns3::TcpSlowStartAttackerTest, ns3::WScalingTestCase, ns3::TcpRttEstimationTest, ns3::TimestampTestCase, and ns3::TcpZeroWindowTest.
Definition at line 297 of file tcp-general-test.cc.
References CreateSocket(), ns3::TcpSocketMsgBase::GetTypeId(), and m_congControlTypeId.
Referenced by ns3::TcpZeroWindowTest::CreateReceiverSocket(), ns3::TimestampTestCase::CreateReceiverSocket(), ns3::TcpRttEstimationTest::CreateReceiverSocket(), ns3::WScalingTestCase::CreateReceiverSocket(), and DoRun().
|
protectedvirtual |
Create and return the error model to install in the sender node.
Reimplemented in ns3::TcpFastRetrTest.
Definition at line 279 of file tcp-general-test.cc.
Referenced by DoRun().
|
protectedvirtual |
Create and install the socket to install on the sender.
node | sender node pointer |
Reimplemented in ns3::TcpTimeRtoTest, ns3::TcpPktsAckedOpenTest, ns3::WScalingTestCase, ns3::TcpFastRetrTest, ns3::TcpRttEstimationTest, ns3::TcpRtoTest, and ns3::TimestampTestCase.
Definition at line 291 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::TcpRttEstimationTest::CreateSenderSocket(), ns3::WScalingTestCase::CreateSenderSocket(), ns3::TcpPktsAckedOpenTest::CreateSenderSocket(), ns3::TcpTimeRtoTest::CreateSenderSocket(), and DoRun().
|
protectedvirtual |
Create a socket.
node | associated node |
congControl | congestion control |
Definition at line 255 of file tcp-general-test.cc.
References ns3::ObjectFactory::Create(), ns3::Object::GetObject(), ns3::RttMeanDeviation::GetTypeId(), and ns3::ObjectFactory::SetTypeId().
Referenced by ns3::TcpSlowStartAttackerTest::CreateReceiverSocket(), ns3::TcpDataSentCbTestCase::CreateReceiverSocket(), CreateReceiverSocket(), and CreateSenderSocket().
|
inlineprotectedvirtual |
Congestion window changes.
oldValue | old value |
newValue | new value |
Reimplemented in ns3::TcpNewRenoCongAvoidNormalTest, and ns3::TcpSlowStartNormalTest.
Definition at line 603 of file tcp-general-test.h.
Referenced by DoRun().
|
inlineprotectedvirtual |
Notifying application for sent data.
size | the amount of bytes transmitted |
who | where the RTO has expired (SENDER or RECEIVER) |
Reimplemented in ns3::TcpDataSentCbTestCase.
Definition at line 752 of file tcp-general-test.h.
Referenced by DataSentCb().
Definition at line 391 of file tcp-general-test.cc.
References DataSent(), ns3::Socket::GetNode(), m_receiverSocket, m_senderSocket, NS_FATAL_ERROR, RECEIVER, and SENDER.
Referenced by DoRun().
|
protected |
Scheduled at 0.0, SENDER starts the connection to RECEIVER.
Definition at line 228 of file tcp-general-test.cc.
References m_remoteAddr, m_senderSocket, and NS_LOG_INFO.
Referenced by DoRun().
|
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.
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.
Implements ns3::TestCase.
Definition at line 117 of file tcp-general-test.cc.
References ns3::Ipv4AddressHelper::Assign(), BytesInFlightTrace(), third::channel, ConfigureEnvironment(), ConfigureProperties(), CongStateTrace(), ns3::NodeContainer::Create(), CreateChannel(), CreateReceiverErrorModel(), CreateReceiverSocket(), CreateSenderErrorModel(), CreateSenderSocket(), CWndTrace(), DataSentCb(), DoConnect(), ns3::Packet::EnablePrinting(), ErrorCloseCb(), ForkCb(), ns3::NetDeviceContainer::Get(), ns3::NodeContainer::Get(), ns3::Ipv4InterfaceContainer::GetAddress(), ns3::Ipv4Address::GetAny(), ns3::Node::GetId(), HandleAccept(), ns3::SimpleNetDeviceHelper::Install(), ns3::InternetStackHelper::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(), RttTrace(), ns3::Simulator::Run(), RxPacketCb(), ns3::Simulator::Schedule(), ns3::Simulator::ScheduleWithContext(), ns3::Seconds(), SendPacket(), ns3::Ipv4AddressHelper::SetBase(), ns3::SimpleNetDeviceHelper::SetNetDevicePointToPointMode(), SsThreshTrace(), TxPacketCb(), and UpdateRttHistoryCb().
|
protectedvirtual |
Teardown the TCP test.
Reimplemented from ns3::TestCase.
Definition at line 84 of file tcp-general-test.cc.
References ns3::Simulator::Destroy(), FinalChecks(), and NS_LOG_INFO.
|
inlineprotectedvirtual |
Socket closed with an error.
who | the socket closed (SENDER or RECEIVER) |
Reimplemented in ns3::TcpTimeRtoTest.
Definition at line 657 of file tcp-general-test.h.
Referenced by ErrorCloseCb().
Definition at line 408 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().
|
inlineprotectedvirtual |
Performs the (eventual) final checks through test asserts.
Reimplemented in ns3::TcpDataSentCbTestCase, ns3::TcpTimeRtoTest, ns3::TcpFastRetrTest, ns3::TcpPktsAckedOpenTest, ns3::TcpBytesInFlightTest, ns3::TcpRttEstimationTest, ns3::TcpRtoTest, and ns3::TcpZeroWindowTest.
Definition at line 760 of file tcp-general-test.h.
Referenced by DoTeardown().
|
private |
Definition at line 509 of file tcp-general-test.cc.
References m_receiverSocket, and NS_LOG_FUNCTION.
Referenced by DoRun().
Get the clock granularity attribute.
who | node to get the parameter from |
Definition at line 710 of file tcp-general-test.cc.
References m_receiverSocket, m_senderSocket, NS_FATAL_ERROR, RECEIVER, and SENDER.
Referenced by ns3::TcpTimeRtoTest::Tx().
Get the retransmission time for the SYN segments.
who | node to get the parameter from |
Definition at line 676 of file tcp-general-test.cc.
References m_receiverSocket, m_senderSocket, NS_FATAL_ERROR, RECEIVER, and SENDER.
Referenced by ns3::TcpTimeRtoTest::Tx().
|
protected |
Get the number of delayed ack (if present)
who | node to get the parameter from |
Definition at line 551 of file tcp-general-test.cc.
References m_receiverSocket, m_senderSocket, NS_FATAL_ERROR, RECEIVER, and SENDER.
Referenced by ns3::TcpFastRetrTest::Tx().
Get the timeout of delayed ack (if present)
who | node to get the parameter from |
Definition at line 568 of file tcp-general-test.cc.
References m_receiverSocket, m_senderSocket, NS_FATAL_ERROR, RECEIVER, and SENDER.
|
protected |
Get the number of dupack received.
who | node to get the parameter from |
Definition at line 534 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().
|
protected |
Get the highest tx mark of the node specified.
who | node to get the parameter from |
Definition at line 602 of file tcp-general-test.cc.
References GetTcb().
|
protected |
Get the initial congestion window.
Definition at line 608 of file tcp-general-test.cc.
References m_receiverSocket, m_senderSocket, NS_FATAL_ERROR, RECEIVER, and SENDER.
|
protected |
Get the initial slow start threshold.
Definition at line 625 of file tcp-general-test.cc.
References m_receiverSocket, m_senderSocket, NS_FATAL_ERROR, RECEIVER, and SENDER.
Referenced by ns3::TcpSlowStartNormalTest::CWndTrace().
Get the minimun RTO attribute.
who | node to get the parameter from |
Definition at line 659 of file tcp-general-test.cc.
References m_receiverSocket, m_senderSocket, NS_FATAL_ERROR, RECEIVER, and SENDER.
Referenced by ns3::TcpTimeRtoTest::Tx().
|
inlineprotected |
Get the MTU of the environment.
Definition at line 786 of file tcp-general-test.h.
References m_mtu.
Get the persistent event of the selected socket.
who | socket where check the parameter |
Definition at line 763 of file tcp-general-test.cc.
References m_receiverSocket, m_senderSocket, NS_FATAL_ERROR, RECEIVER, and SENDER.
Referenced by ns3::TcpZeroWindowTest::ProcessedAck().
Get the persistent timeout of the selected socket.
who | socket where check the parameter |
Definition at line 781 of file tcp-general-test.cc.
References m_receiverSocket, m_senderSocket, NS_FATAL_ERROR, RECEIVER, and SENDER.
|
inlineprotected |
Get the number of application packets.
Definition at line 804 of file tcp-general-test.h.
References m_pktCount.
Referenced by ns3::TcpDataSentCbTestCase::FinalChecks().
|
inlineprotected |
Get the interval to wait for each packet sent down from application to TCP.
Definition at line 814 of file tcp-general-test.h.
References m_interPacketInterval.
|
inlineprotected |
Get the application packet size.
Definition at line 795 of file tcp-general-test.h.
References m_pktSize.
Referenced by ns3::TcpDataSentCbTestCase::FinalChecks().
|
inlineprotected |
Get the channel Propagation Delay.
Definition at line 768 of file tcp-general-test.h.
References m_propagationDelay.
|
inlineprotected |
Get the pointer to a previously created receiver socket.
Definition at line 294 of file tcp-general-test.h.
References m_receiverSocket.
|
protected |
Get the retransmission threshold.
who | node to get the parameter from |
Definition at line 517 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().
Get the retransmission time.
who | node to get the parameter from |
Definition at line 642 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().
|
protected |
Get the Rtt estimator of the socket.
who | node to get the parameter from |
Definition at line 693 of file tcp-general-test.cc.
References m_receiverSocket, m_senderSocket, NS_FATAL_ERROR, RECEIVER, and SENDER.
Referenced by ns3::TcpRttEstimationTest::Tx(), and ns3::TcpTimeRtoTest::Tx().
|
protected |
Get the rWnd of the selected socket.
who | socket where check the parameter |
Definition at line 745 of file tcp-general-test.cc.
References m_receiverSocket, m_senderSocket, NS_FATAL_ERROR, RECEIVER, and SENDER.
|
protected |
Get the Rx buffer from selected socket.
who | socket where get the TCB |
Definition at line 817 of file tcp-general-test.cc.
References m_receiverSocket, m_senderSocket, NS_FATAL_ERROR, RECEIVER, and SENDER.
Referenced by ns3::WScalingTestCase::Tx().
|
protected |
Get the segment size of the node specified.
who | node to get the parameter from |
Definition at line 585 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::TcpPktsAckedOpenTest::FinalChecks(), ns3::TcpBytesInFlightTest::Rx(), ns3::TcpSlowStartNormalTest::Rx(), ns3::TcpFastRetrTest::Rx(), ns3::TcpSlowStartNormalTest::Tx(), and ns3::TcpFastRetrTest::Tx().
|
inlineprotected |
Get the pointer to a previously created sender socket.
Definition at line 285 of file tcp-general-test.h.
References m_senderSocket.
|
inlineprotected |
Get the data start time.
Definition at line 777 of file tcp-general-test.h.
References m_startTime.
|
protected |
Get the TCB from selected socket.
who | socket where get the TCB |
Definition at line 799 of file tcp-general-test.cc.
References m_receiverSocket, m_senderSocket, NS_FATAL_ERROR, RECEIVER, and SENDER.
Referenced by GetHighestTxMark(), and ns3::TcpZeroWindowTest::Tx().
|
protected |
Get the state of the TCP state machine.
who | socket where check the parameter |
Definition at line 727 of file tcp-general-test.cc.
References m_receiverSocket, m_senderSocket, NS_FATAL_ERROR, RECEIVER, and SENDER.
Definition at line 235 of file tcp-general-test.cc.
References ErrorCloseCb(), ns3::MakeCallback(), NormalCloseCb(), ReceivePacket(), ns3::Socket::SetCloseCallbacks(), and ns3::Socket::SetRecvCallback().
Referenced by DoRun().
|
inlineprotectedvirtual |
Socket closed normally.
who | the socket closed (SENDER or RECEIVER) |
Reimplemented in ns3::TcpNewRenoCongAvoidNormalTest, and ns3::TcpZeroWindowTest.
Definition at line 648 of file tcp-general-test.h.
Referenced by NormalCloseCb().
Definition at line 337 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().
|
inlineprotectedvirtual |
Link drop.
who | where the drop occurred (SENDER or RECEIVER) |
Reimplemented in ns3::TcpNewRenoCongAvoidNormalTest, and ns3::TcpSlowStartNormalTest.
Definition at line 674 of file tcp-general-test.h.
Referenced by PhyDropCb().
Definition at line 320 of file tcp-general-test.cc.
References NS_FATAL_ERROR, PhyDrop(), RECEIVER, and SENDER.
Referenced by DoRun().
|
inlineprotectedvirtual |
Processed ack.
Invoked after the processing of the ACK
tcb | Transmission Control Block |
h | the header of segment |
who | the socket which has processed the ACK (SENDER or RECEIVER) |
Reimplemented in ns3::TcpFastRetrTest, ns3::TcpRtoTest, and ns3::TcpZeroWindowTest.
Definition at line 701 of file tcp-general-test.h.
Referenced by ProcessedAckCb().
|
private |
Definition at line 491 of file tcp-general-test.cc.
References m_receiverSocket, m_senderSocket, NS_FATAL_ERROR, ProcessedAck(), RECEIVER, and SENDER.
Referenced by DoRun().
|
inlineprotectedvirtual |
Drop on the queue.
who | where the drop occurred (SENDER or RECEIVER) |
Reimplemented in ns3::TcpNewRenoCongAvoidNormalTest, and ns3::TcpSlowStartNormalTest.
Definition at line 666 of file tcp-general-test.h.
Referenced by QueueDropCb().
Definition at line 303 of file tcp-general-test.cc.
References NS_FATAL_ERROR, QueueDrop(), RECEIVER, and SENDER.
Referenced by DoRun().
|
inlineprotectedvirtual |
Received ack.
Invoked when an ACK is received (no processing is done yet)
tcb | Transmission Control Block |
h | the header of segment |
who | the socket which has received the ACK (SENDER or RECEIVER) |
Reimplemented in ns3::TcpFastRetrTest, and ns3::TcpRtoTest.
Definition at line 687 of file tcp-general-test.h.
Referenced by RcvAckCb().
|
private |
Definition at line 437 of file tcp-general-test.cc.
References m_receiverSocket, m_senderSocket, NS_FATAL_ERROR, RcvAck(), RECEIVER, and SENDER.
Referenced by DoRun().
Packet received.
The method processes the packet (application-layer)
socket | socket which has received the packet |
Definition at line 50 of file tcp-general-test.cc.
References ns3::Packet::GetSize(), NS_LOG_FUNCTION, and ns3::Socket::RecvFrom().
Referenced by DoRun(), and HandleAccept().
|
inlineprotectedvirtual |
Rto has expired.
tcb | Transmission control block |
who | where the RTO has expired (SENDER or RECEIVER) |
Reimplemented in ns3::TcpTimeRtoTest, ns3::TcpFastRetrTest, and ns3::TcpRtoTest.
Definition at line 730 of file tcp-general-test.h.
Referenced by RtoExpiredCb().
|
private |
Definition at line 373 of file tcp-general-test.cc.
References m_receiverSocket, m_senderSocket, NS_FATAL_ERROR, RECEIVER, RTOExpired(), and SENDER.
Referenced by DoRun().
Rtt changes.
This applies only for sender socket.
oldValue | old value |
newValue | new value |
Reimplemented in ns3::TcpRttEstimationTest.
Definition at line 615 of file tcp-general-test.h.
Referenced by DoRun().
|
protectedvirtual |
Packet received from IP layer.
p | packet |
h | header |
who | the socket which has received the packet (SENDER or RECEIVER) |
Reimplemented in ns3::TcpFastRetrTest, ns3::TcpPktsAckedOpenTest, ns3::TcpSlowStartNormalTest, ns3::TcpBytesInFlightTest, ns3::TcpRttEstimationTest, ns3::TimestampTestCase, and ns3::TcpZeroWindowTest.
Definition at line 431 of file tcp-general-test.cc.
References NS_LOG_FUNCTION.
Referenced by RxPacketCb().
|
private |
Definition at line 473 of file tcp-general-test.cc.
References m_receiverSocket, m_senderSocket, NS_FATAL_ERROR, RECEIVER, Rx(), and SENDER.
Referenced by DoRun().
|
protected |
Send packets to other endpoint.
socket | Socket |
pktSize | size of the packet |
pktCount | number of packets to send |
pktInterval | interval between packet (application-level) |
Definition at line 66 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().
|
inlineprotected |
Set app packet count.
The application will generate this count of packets.
pktCount | count of packets to generate |
Definition at line 550 of file tcp-general-test.h.
References m_pktCount.
Referenced by ns3::TcpZeroWindowTest::ConfigureEnvironment(), ns3::TcpBytesInFlightTest::ConfigureEnvironment(), ns3::TcpRtoTest::ConfigureEnvironment(), ns3::TcpRttEstimationTest::ConfigureEnvironment(), ns3::TcpSlowStartNormalTest::ConfigureEnvironment(), ns3::TcpPktsAckedOpenTest::ConfigureEnvironment(), ns3::TcpNewRenoCongAvoidNormalTest::ConfigureEnvironment(), ns3::TcpFastRetrTest::ConfigureEnvironment(), ns3::TcpTimeRtoTest::ConfigureEnvironment(), ns3::TcpDataSentCbTestCase::ConfigureEnvironment(), and ConfigureEnvironment().
|
inlineprotected |
Interval between app-generated packet.
pktInterval | interval |
Definition at line 557 of file tcp-general-test.h.
References m_interPacketInterval.
Referenced by ConfigureEnvironment().
|
inlineprotected |
Set app packet size.
The application will generate packet of this size.
pktSize | size of the packet |
Definition at line 541 of file tcp-general-test.h.
References m_pktSize.
Referenced by ns3::TcpSlowStartNormalTest::ConfigureEnvironment(), ns3::TcpNewRenoCongAvoidNormalTest::ConfigureEnvironment(), ns3::TcpDataSentCbTestCase::ConfigureEnvironment(), and ConfigureEnvironment().
|
inlineprotected |
Congestion control of the sender socket.
congControl | typeid of the congestion control algorithm |
Definition at line 578 of file tcp-general-test.h.
References m_congControlTypeId.
Referenced by ConfigureEnvironment().
|
protected |
Forcefully set the initial cwnd.
who | socket to force |
initialCwnd | size of the initial cwnd |
Definition at line 869 of file tcp-general-test.cc.
References m_receiverSocket, m_senderSocket, NS_FATAL_ERROR, RECEIVER, and SENDER.
Referenced by ns3::TcpZeroWindowTest::ConfigureProperties(), and ConfigureProperties().
|
protected |
Forcefully set the initial ssth.
who | socket to force |
initialSsThresh | size of the initial ssth |
Definition at line 886 of file tcp-general-test.cc.
References m_receiverSocket, m_senderSocket, NS_FATAL_ERROR, RECEIVER, and SENDER.
Referenced by ns3::TcpRtoTest::ConfigureProperties(), ns3::TcpSlowStartNormalTest::ConfigureProperties(), ns3::TcpFastRetrTest::ConfigureProperties(), ns3::TcpNewRenoCongAvoidNormalTest::ConfigureProperties(), and ConfigureProperties().
|
inlineprotected |
MTU of the bottleneck link.
mtu | MTU |
Definition at line 585 of file tcp-general-test.h.
References m_mtu.
Referenced by ns3::TcpZeroWindowTest::ConfigureEnvironment(), ns3::TcpRttEstimationTest::ConfigureEnvironment(), ns3::TcpPktsAckedOpenTest::ConfigureEnvironment(), ns3::TcpNewRenoCongAvoidNormalTest::ConfigureEnvironment(), and ConfigureEnvironment().
|
inlineprotected |
Propagation delay of the bottleneck link.
propDelay | propagation delay |
Definition at line 564 of file tcp-general-test.h.
References m_propagationDelay.
Referenced by ns3::TcpZeroWindowTest::ConfigureEnvironment(), ns3::TcpBytesInFlightTest::ConfigureEnvironment(), ns3::TcpRttEstimationTest::ConfigureEnvironment(), and ConfigureEnvironment().
|
protected |
Forcefully set a defined size for rx buffer.
who | socket to force |
size | size of the rx buffer |
Definition at line 835 of file tcp-general-test.cc.
References m_receiverSocket, m_senderSocket, NS_FATAL_ERROR, RECEIVER, and SENDER.
Referenced by ns3::TcpZeroWindowTest::IncreaseBufSize().
|
protected |
Forcefully set the segment size.
who | socket to force |
segmentSize | segmentSize |
Definition at line 852 of file tcp-general-test.cc.
References m_receiverSocket, m_senderSocket, NS_FATAL_ERROR, RECEIVER, and SENDER.
Referenced by ns3::TcpSlowStartNormalTest::ConfigureProperties(), ns3::TcpNewRenoCongAvoidNormalTest::ConfigureProperties(), and ConfigureProperties().
|
inlineprotected |
Set the initial time at which the application sends the first data packet.
startTime | start time |
Definition at line 571 of file tcp-general-test.h.
References m_startTime, and startTime.
Referenced by ns3::TcpZeroWindowTest::ConfigureEnvironment(), ns3::TcpBytesInFlightTest::ConfigureEnvironment(), ns3::TcpRttEstimationTest::ConfigureEnvironment(), and ConfigureEnvironment().
|
inlineprotectedvirtual |
Slow start threshold changes.
This applies only for sender socket.
oldValue | old value |
newValue | new value |
Definition at line 628 of file tcp-general-test.h.
Referenced by DoRun().
|
protectedvirtual |
Packet transmitted down to IP layer.
p | packet |
h | header |
who | the socket which has received the packet (SENDER or RECEIVER) |
Reimplemented in ns3::TcpTimeRtoTest, ns3::TcpFastRetrTest, ns3::TcpSlowStartNormalTest, ns3::WScalingTestCase, ns3::TcpBytesInFlightTest, ns3::TcpRttEstimationTest, ns3::TimestampTestCase, and ns3::TcpZeroWindowTest.
Definition at line 425 of file tcp-general-test.cc.
References NS_LOG_FUNCTION.
Referenced by TxPacketCb().
|
private |
Definition at line 455 of file tcp-general-test.cc.
References m_receiverSocket, m_senderSocket, NS_FATAL_ERROR, RECEIVER, SENDER, and Tx().
Referenced by DoRun().
|
inlineprotectedvirtual |
Updated the Rtt history.
seq | Sequence inserted |
sz | size |
isRetransmission | self-explanatory |
who | where the rtt history was updated |
Reimplemented in ns3::TcpRttEstimationTest.
Definition at line 741 of file tcp-general-test.h.
Referenced by UpdateRttHistoryCb().
|
private |
Definition at line 354 of file tcp-general-test.cc.
References m_receiverSocket, m_senderSocket, NS_FATAL_ERROR, RECEIVER, SENDER, and UpdatedRttHistory().
Referenced by DoRun().
|
protected |
Congestion control.
Definition at line 819 of file tcp-general-test.h.
Referenced by ConfigureEnvironment(), ns3::TcpSlowStartAttackerTest::CreateReceiverSocket(), ns3::TcpDataSentCbTestCase::CreateReceiverSocket(), CreateReceiverSocket(), CreateSenderSocket(), SetCongestionControl(), ns3::TcpFastRetrTest::TcpFastRetrTest(), ns3::TcpNewRenoCongAvoidNormalTest::TcpNewRenoCongAvoidNormalTest(), ns3::TcpRtoTest::TcpRtoTest(), ns3::TcpSlowStartNormalTest::TcpSlowStartNormalTest(), and ns3::TcpTimeRtoTest::TcpTimeRtoTest().
|
private |
Time between sending application packet.
Definition at line 831 of file tcp-general-test.h.
Referenced by DoRun(), GetPktInterval(), and SetAppPktInterval().
|
private |
MTU of the environment.
Definition at line 827 of file tcp-general-test.h.
|
private |
Count of the application packet.
Definition at line 830 of file tcp-general-test.h.
Referenced by DoRun(), GetPktCount(), and SetAppPktCount().
|
private |
Size of the application packet.
Definition at line 829 of file tcp-general-test.h.
Referenced by DoRun(), GetPktSize(), and SetAppPktSize().
|
private |
Propagation delay of the channel.
Definition at line 824 of file tcp-general-test.h.
Referenced by CreateChannel(), GetPropagationDelay(), and SetPropagationDelay().
|
private |
Pointer to receiver socket.
Definition at line 835 of file tcp-general-test.h.
Referenced by DataSentCb(), DoRun(), ErrorCloseCb(), ForkCb(), GetClockGranularity(), GetConnTimeout(), GetDelAckCount(), GetDelAckTimeout(), GetDupAckCount(), GetInitialCwnd(), GetInitialSsThresh(), GetMinRto(), GetPersistentEvent(), GetPersistentTimeout(), GetReceiverSocket(), GetReTxThreshold(), GetRto(), GetRttEstimator(), GetRWnd(), GetRxBuffer(), GetSegSize(), GetTcb(), GetTcpState(), NormalCloseCb(), ProcessedAckCb(), RcvAckCb(), RtoExpiredCb(), RxPacketCb(), SetInitialCwnd(), SetInitialSsThresh(), SetRcvBufSize(), SetSegmentSize(), TxPacketCb(), and UpdateRttHistoryCb().
|
private |
Definition at line 859 of file tcp-general-test.h.
Referenced by DoConnect(), and DoRun().
|
private |
Pointer to sender socket.
Definition at line 834 of file tcp-general-test.h.
Referenced by DataSentCb(), DoConnect(), DoRun(), ErrorCloseCb(), GetClockGranularity(), GetConnTimeout(), GetDelAckCount(), GetDelAckTimeout(), GetDupAckCount(), GetInitialCwnd(), GetInitialSsThresh(), GetMinRto(), GetPersistentEvent(), GetPersistentTimeout(), GetReTxThreshold(), GetRto(), GetRttEstimator(), GetRWnd(), GetRxBuffer(), GetSegSize(), GetSenderSocket(), GetTcb(), GetTcpState(), NormalCloseCb(), ProcessedAckCb(), RcvAckCb(), RtoExpiredCb(), RxPacketCb(), SetInitialCwnd(), SetInitialSsThresh(), SetRcvBufSize(), SetSegmentSize(), TxPacketCb(), and UpdateRttHistoryCb().
|
private |
Data transmission time.
Definition at line 826 of file tcp-general-test.h.
Referenced by DoRun(), GetStartTime(), and SetTransmitStart().