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... | |
Public Types inherited from ns3::TestCase | |
enum class | Duration { 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 |
TestCase & | operator= (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< SimpleChannel > | CreateChannel () |
Create and return the channel installed between the two socket. | |
virtual Ptr< ErrorModel > | CreateReceiverErrorModel () |
Create and return the error model to install in the receiver node. | |
virtual Ptr< TcpSocketMsgBase > | CreateReceiverSocket (Ptr< Node > node) |
Create and install the socket to install on the receiver. | |
virtual Ptr< ErrorModel > | CreateSenderErrorModel () |
Create and return the error model to install in the sender node. | |
virtual Ptr< TcpSocketMsgBase > | CreateSenderSocket (Ptr< Node > node) |
Create and install the socket to install on the sender. | |
virtual Ptr< TcpSocketMsgBase > | CreateSocket (Ptr< Node > node, TypeId socketType, TypeId congControl) |
Create a socket. | |
virtual Ptr< TcpSocketMsgBase > | CreateSocket (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< TcpSocketMsgBase > | GetReceiverSocket () |
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< RttEstimator > | GetRttEstimator (SocketWho who) |
Get the Rtt estimator of the socket. | |
uint32_t | GetRWnd (SocketWho who) |
Get the rWnd of the selected socket. | |
Ptr< TcpRxBuffer > | GetRxBuffer (SocketWho who) |
Get the Rx buffer from selected socket. | |
uint32_t | GetSegSize (SocketWho who) |
Get the segment size of the node specified. | |
Ptr< TcpSocketMsgBase > | GetSenderSocket () |
Get the pointer to a previously created sender socket. | |
Time | GetStartTime () const |
Get the data start time. | |
Ptr< TcpSocketState > | GetTcb (SocketWho who) |
Get the TCB from selected socket. | |
TcpSocket::TcpStates_t | GetTcpState (SocketWho who) |
Get the state of the TCP state machine. | |
Ptr< TcpTxBuffer > | GetTxBuffer (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, Duration duration=Duration::QUICK) |
Add an individual child TestCase to this test suite. | |
TestCase * | GetParent () 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< TcpSocketMsgBase > | m_receiverSocket |
Pointer to receiver socket. | |
InetSocketAddress | m_remoteAddr |
Remote peer address. | |
Ptr< TcpSocketMsgBase > | m_senderSocket |
Pointer to sender socket. | |
Time | m_startTime |
Data transmission time. | |
Additional Inherited Members | |
Static Public Attributes inherited from ns3::TestCase | |
static constexpr auto | QUICK = Duration::QUICK |
Deprecated test duration simple enums. | |
static constexpr auto | EXTENSIVE = Duration::EXTENSIVE |
static constexpr auto | TAKES_FOREVER = Duration::TAKES_FOREVER |
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 243 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 261 of file tcp-general-test.h.
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 30 of file tcp-general-test.cc.
References NS_LOG_FUNCTION.
|
override |
Definition at line 39 of file tcp-general-test.cc.
References NS_LOG_FUNCTION_NOARGS.
|
private |
Invoked after a retransmit event.
tcb | Transmission control block. |
tcp | The TCP socket. |
Definition at line 410 of file tcp-general-test.cc.
References AfterRTOExpired(), m_receiverSocket, m_senderSocket, NS_FATAL_ERROR, RECEIVER, and SENDER.
Referenced by DoRun().
|
inlineprotectedvirtual |
Rto has expired.
tcb | Transmission control block |
who | where the RTO has expired (SENDER or RECEIVER) |
Reimplemented in TcpFastRetrTest, TcpRtoTest, TcpSsThreshRtoTest, and TcpTimeRtoTest.
Definition at line 918 of file tcp-general-test.h.
Referenced by AfterRetransmitCb().
|
private |
Invoked before a retransmit event.
tcb | Transmission control block. |
tcp | The TCP socket. |
Definition at line 428 of file tcp-general-test.cc.
References BeforeRTOExpired(), m_receiverSocket, m_senderSocket, NS_FATAL_ERROR, RECEIVER, and SENDER.
Referenced by DoRun().
|
inlineprotectedvirtual |
Rto has expired.
tcb | Transmission control block |
who | where the RTO has expired (SENDER or RECEIVER) |
Reimplemented in TcpBytesInFlightTest, and TcpSsThreshRtoTest.
Definition at line 929 of file tcp-general-test.h.
Referenced by BeforeRetransmitCb().
|
inlineprotectedvirtual |
Bytes in flight changes.
This applies only for sender socket.
oldValue | old value |
newValue | new value |
Reimplemented in TcpBytesInFlightTest, TcpPacingTest, TcpRateLinuxWithSocketsTest, and TcpSsThreshRtoTest.
Definition at line 771 of file tcp-general-test.h.
Referenced by DoRun().
|
protectedvirtual |
Change the configuration of the environment.
Reimplemented in TcpAdvertisedWindowTest, TcpAdvWindowOnLossTest, TcpBytesInFlightTest, TcpDataSentCbTestCase, TcpDctcpCodePointsTest, TcpFastRetrTest, TcpLargeTransferLossTest, TcpLinuxRenoCongAvoidTest, TcpLinuxRenoSSTest, TcpNewRenoCongAvoidNormalTest, TcpPacingTest, TcpPktsAckedOpenTest, TcpRateLinuxWithSocketsTest, TcpRtoTest, TcpRttEstimationTest, TcpSlowStartNormalTest, TcpSsThreshRtoTest, TcpTimeRtoTest, and TcpZeroWindowTest.
Definition at line 94 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(), TcpDataSentCbTestCase::ConfigureEnvironment(), TcpDctcpCodePointsTest::ConfigureEnvironment(), TcpFastRetrTest::ConfigureEnvironment(), TcpLargeTransferLossTest::ConfigureEnvironment(), TcpLinuxRenoCongAvoidTest::ConfigureEnvironment(), TcpLinuxRenoSSTest::ConfigureEnvironment(), TcpNewRenoCongAvoidNormalTest::ConfigureEnvironment(), TcpPacingTest::ConfigureEnvironment(), TcpPktsAckedOpenTest::ConfigureEnvironment(), TcpRateLinuxWithSocketsTest::ConfigureEnvironment(), TcpRtoTest::ConfigureEnvironment(), TcpRttEstimationTest::ConfigureEnvironment(), TcpSlowStartNormalTest::ConfigureEnvironment(), TcpSsThreshRtoTest::ConfigureEnvironment(), TcpTimeRtoTest::ConfigureEnvironment(), TcpZeroWindowTest::ConfigureEnvironment(), and DoRun().
|
protectedvirtual |
Change the configuration of the socket properties.
Reimplemented in ns3::TcpCloseWithLossTestCase, ns3::TcpEcnTest, TcpDctcpCodePointsTest, TcpFastRetrTest, TcpLargeTransferLossTest, TcpLinuxRenoCongAvoidTest, TcpLinuxRenoSSTest, TcpNewRenoCongAvoidNormalTest, TcpPacingTest, TcpRtoTest, TcpSlowStartNormalTest, and TcpZeroWindowTest.
Definition at line 109 of file tcp-general-test.cc.
References NS_LOG_FUNCTION, RECEIVER, SENDER, SetInitialCwnd(), SetInitialSsThresh(), and SetSegmentSize().
Referenced by ns3::TcpCloseWithLossTestCase::ConfigureProperties(), ns3::TcpEcnTest::ConfigureProperties(), TcpDctcpCodePointsTest::ConfigureProperties(), TcpFastRetrTest::ConfigureProperties(), TcpLargeTransferLossTest::ConfigureProperties(), TcpLinuxRenoCongAvoidTest::ConfigureProperties(), TcpLinuxRenoSSTest::ConfigureProperties(), TcpNewRenoCongAvoidNormalTest::ConfigureProperties(), TcpPacingTest::ConfigureProperties(), TcpRtoTest::ConfigureProperties(), TcpSlowStartNormalTest::ConfigureProperties(), TcpZeroWindowTest::ConfigureProperties(), and DoRun().
|
inlineprotectedvirtual |
State on Ack state machine changes.
oldValue | old value |
newValue | new value |
Reimplemented in TcpFastRetrTest, and TcpLargeTransferLossTest.
Definition at line 712 of file tcp-general-test.h.
Referenced by DoRun().
|
protectedvirtual |
Create and return the channel installed between the two socket.
Definition at line 270 of file tcp-general-test.cc.
References ns3::CreateObject(), and m_propagationDelay.
Referenced by DoRun().
|
protectedvirtual |
Create and return the error model to install in the receiver node.
Reimplemented in ns3::TcpCloseWithLossTestCase, TcpAdvertisedWindowTest, TcpAdvWindowOnLossTest, TcpBytesInFlightTest, TcpFastRetrTest, TcpLargeTransferLossTest, TcpRateLinuxWithSocketsTest, TcpRttEstimationWithLossTest, TcpSsThreshRtoTest, and TcpTimeRtoTest.
Definition at line 321 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 SackPermittedTestCase, TcpAdvertisedWindowTest, TcpAdvWindowOnLossTest, TcpDataSentCbTestCase, TcpDctcpCodePointsTest, TcpRttEstimationTest, TcpSlowStartAttackerTest, TcpZeroWindowTest, TimestampTestCase, and WScalingTestCase.
Definition at line 333 of file tcp-general-test.cc.
References CreateSocket(), ns3::TcpSocketMsgBase::GetTypeId(), m_congControlTypeId, and m_recoveryTypeId.
Referenced by SackPermittedTestCase::CreateReceiverSocket(), TcpDctcpCodePointsTest::CreateReceiverSocket(), TcpRttEstimationTest::CreateReceiverSocket(), TcpZeroWindowTest::CreateReceiverSocket(), TimestampTestCase::CreateReceiverSocket(), WScalingTestCase::CreateReceiverSocket(), and DoRun().
|
protectedvirtual |
Create and return the error model to install in the sender node.
Reimplemented in TcpFastRetrTest.
Definition at line 315 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::TcpEcnTest, SackPermittedTestCase, TcpAdvWindowOnLossTest, TcpDctcpCodePointsTest, TcpFastRetrTest, TcpPktsAckedOpenTest, TcpRateLinuxWithSocketsTest, TcpRtoTest, TcpRttEstimationTest, TcpSsThreshRtoTest, TcpTimeRtoTest, TimestampTestCase, and WScalingTestCase.
Definition at line 327 of file tcp-general-test.cc.
References CreateSocket(), ns3::TcpSocketMsgBase::GetTypeId(), m_congControlTypeId, and m_recoveryTypeId.
Referenced by ns3::TcpEcnTest::CreateSenderSocket(), SackPermittedTestCase::CreateSenderSocket(), TcpAdvWindowOnLossTest::CreateSenderSocket(), TcpDctcpCodePointsTest::CreateSenderSocket(), TcpFastRetrTest::CreateSenderSocket(), TcpPktsAckedOpenTest::CreateSenderSocket(), TcpRateLinuxWithSocketsTest::CreateSenderSocket(), TcpRtoTest::CreateSenderSocket(), TcpRttEstimationTest::CreateSenderSocket(), TcpSsThreshRtoTest::CreateSenderSocket(), TcpTimeRtoTest::CreateSenderSocket(), TimestampTestCase::CreateSenderSocket(), WScalingTestCase::CreateSenderSocket(), and DoRun().
|
protectedvirtual |
Create a socket.
node | associated node |
socketType | Type of the TCP socket |
congControl | congestion control |
Definition at line 280 of file tcp-general-test.cc.
References CreateSocket(), and m_recoveryTypeId.
Referenced by CreateReceiverSocket(), TcpAdvertisedWindowTest::CreateReceiverSocket(), TcpAdvWindowOnLossTest::CreateReceiverSocket(), TcpDataSentCbTestCase::CreateReceiverSocket(), TcpDctcpCodePointsTest::CreateReceiverSocket(), TcpSlowStartAttackerTest::CreateReceiverSocket(), ns3::TcpEcnTest::CreateSenderSocket(), CreateSenderSocket(), TcpDctcpCodePointsTest::CreateSenderSocket(), and CreateSocket().
|
protectedvirtual |
Create a socket.
node | associated node |
socketType | Type of the TCP socket |
congControl | congestion control |
recoveryAlgorithm | recovery algorithm |
Definition at line 286 of file tcp-general-test.cc.
References ns3::ObjectFactory::Create(), ns3::DynamicCast(), ns3::RttMeanDeviation::GetTypeId(), and ns3::ObjectFactory::SetTypeId().
|
inlineprotectedvirtual |
Tracks the inflated congestion window changes.
oldValue | old value |
newValue | new value |
Definition at line 733 of file tcp-general-test.h.
Referenced by DoRun().
|
inlineprotectedvirtual |
Tracks the congestion window changes.
oldValue | old value |
newValue | new value |
Reimplemented in ns3::TcpEcnTest, TcpLinuxRenoCongAvoidTest, TcpLinuxRenoSSTest, TcpNewRenoCongAvoidNormalTest, TcpPacingTest, and TcpSlowStartNormalTest.
Definition at line 723 of file tcp-general-test.h.
Referenced by DoRun().
Notifying application for sent data.
size | the amount of bytes transmitted |
who | where the RTO has expired (SENDER or RECEIVER) |
Reimplemented in TcpDataSentCbTestCase.
Definition at line 954 of file tcp-general-test.h.
Referenced by DataSentCb().
Data sent Callback.
socket | The socket. |
size | The data size. |
Definition at line 446 of file tcp-general-test.cc.
References DataSent(), 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 255 of file tcp-general-test.cc.
References m_remoteAddr, m_senderSocket, and NS_LOG_INFO.
Referenced by 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.
Implements ns3::TestCase.
Definition at line 119 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::DynamicCast(), 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().
|
overrideprotectedvirtual |
Teardown the TCP test.
Reimplemented from ns3::TestCase.
Reimplemented in TcpLinuxRenoCongAvoidTest, and TcpLinuxRenoSSTest.
Definition at line 85 of file tcp-general-test.cc.
References ns3::Simulator::Destroy(), FinalChecks(), and NS_LOG_INFO.
Referenced by TcpLinuxRenoCongAvoidTest::DoTeardown(), and TcpLinuxRenoSSTest::DoTeardown().
|
inlineprotectedvirtual |
Socket closed with an error.
who | the socket closed (SENDER or RECEIVER) |
Reimplemented in TcpTimeRtoTest.
Definition at line 843 of file tcp-general-test.h.
Referenced by ErrorCloseCb().
Error Close Callback.
socket | The socket. |
Definition at line 463 of file tcp-general-test.cc.
References ErrorClose(), 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::TcpCloseWithLossTestCase, TcpBytesInFlightTest, TcpDataSentCbTestCase, TcpFastRetrTest, TcpLargeTransferLossTest, TcpPktsAckedOpenTest, TcpRateLinuxWithSocketsTest, TcpRtoTest, TcpRttEstimationTest, TcpTimeRtoTest, and TcpZeroWindowTest.
Definition at line 961 of file tcp-general-test.h.
Referenced by DoTeardown().
|
private |
Fork Callback.
tcp | The TCP socket. |
Definition at line 568 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 769 of file tcp-general-test.cc.
References ns3::DynamicCast(), m_receiverSocket, m_senderSocket, NS_FATAL_ERROR, RECEIVER, and SENDER.
Referenced by TcpTimeRtoTest::Tx().
Get the retransmission time for the SYN segments.
who | node to get the parameter from |
Definition at line 735 of file tcp-general-test.cc.
References ns3::DynamicCast(), m_receiverSocket, m_senderSocket, NS_FATAL_ERROR, RECEIVER, and SENDER.
Referenced by TcpTimeRtoTest::Tx().
Get the number of delayed ack (if present)
who | node to get the parameter from |
Definition at line 610 of file tcp-general-test.cc.
References ns3::DynamicCast(), m_receiverSocket, m_senderSocket, NS_FATAL_ERROR, RECEIVER, and SENDER.
Referenced by TcpFastRetrTest::Tx().
Get the timeout of delayed ack (if present)
who | node to get the parameter from |
Definition at line 627 of file tcp-general-test.cc.
References ns3::DynamicCast(), m_receiverSocket, m_senderSocket, NS_FATAL_ERROR, RECEIVER, and SENDER.
Get the number of dupack received.
who | node to get the parameter from |
Definition at line 593 of file tcp-general-test.cc.
References ns3::DynamicCast(), m_receiverSocket, m_senderSocket, NS_FATAL_ERROR, RECEIVER, and SENDER.
Referenced by TcpFastRetrTest::CongStateTrace(), TcpFastRetrTest::ProcessedAck(), and TcpFastRetrTest::RcvAck().
|
protected |
Get the highest tx mark of the node specified.
who | node to get the parameter from |
Definition at line 661 of file tcp-general-test.cc.
References GetTcb().
Get the initial congestion window.
who | node to get the parameter from |
Definition at line 667 of file tcp-general-test.cc.
References ns3::DynamicCast(), m_receiverSocket, m_senderSocket, NS_FATAL_ERROR, RECEIVER, and SENDER.
Get the initial slow start threshold.
who | node to get the parameter from |
Definition at line 684 of file tcp-general-test.cc.
References ns3::DynamicCast(), m_receiverSocket, m_senderSocket, NS_FATAL_ERROR, RECEIVER, and SENDER.
Referenced by TcpLinuxRenoSSTest::CWndTrace(), and TcpSlowStartNormalTest::CWndTrace().
Get the minimum RTO attribute.
who | node to get the parameter from |
Definition at line 718 of file tcp-general-test.cc.
References ns3::DynamicCast(), m_receiverSocket, m_senderSocket, NS_FATAL_ERROR, RECEIVER, and SENDER.
Referenced by TcpTimeRtoTest::Tx().
|
inlineprotected |
Get the MTU of the environment.
Definition at line 987 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 820 of file tcp-general-test.cc.
References ns3::DynamicCast(), m_receiverSocket, m_senderSocket, NS_FATAL_ERROR, RECEIVER, and SENDER.
Referenced by TcpZeroWindowTest::ProcessedAck().
Get the persistent timeout of the selected socket.
who | socket where check the parameter |
Definition at line 837 of file tcp-general-test.cc.
References ns3::DynamicCast(), m_receiverSocket, m_senderSocket, NS_FATAL_ERROR, RECEIVER, and SENDER.
|
inlineprotected |
Get the number of application packets.
Definition at line 1005 of file tcp-general-test.h.
References m_pktCount.
Referenced by TcpDataSentCbTestCase::FinalChecks().
|
inlineprotected |
Get the interval to wait for each packet sent down from application to TCP.
Definition at line 1015 of file tcp-general-test.h.
References m_interPacketInterval.
|
inlineprotected |
Get the application packet size.
Definition at line 996 of file tcp-general-test.h.
References m_pktSize.
Referenced by TcpDataSentCbTestCase::FinalChecks().
|
inlineprotected |
Get the channel Propagation Delay.
Definition at line 969 of file tcp-general-test.h.
References m_propagationDelay.
Referenced by TcpPacingTest::UpdateExpectedInterval().
|
inlineprotected |
Get the pointer to a previously created receiver socket.
Definition at line 342 of file tcp-general-test.h.
References m_receiverSocket.
Referenced by ns3::TcpCloseWithLossTestCase::ConfigureProperties().
Get the retransmission threshold.
who | node to get the parameter from |
Definition at line 576 of file tcp-general-test.cc.
References ns3::DynamicCast(), m_receiverSocket, m_senderSocket, NS_FATAL_ERROR, RECEIVER, and SENDER.
Referenced by TcpFastRetrTest::CongStateTrace(), TcpFastRetrTest::ProcessedAck(), and TcpFastRetrTest::RcvAck().
Get the retransmission time.
who | node to get the parameter from |
Definition at line 701 of file tcp-general-test.cc.
References ns3::DynamicCast(), m_receiverSocket, m_senderSocket, NS_FATAL_ERROR, RECEIVER, and SENDER.
Referenced by TcpTimeRtoTest::AfterRTOExpired(), and TcpTimeRtoTest::Tx().
|
protected |
Get the Rtt estimator of the socket.
who | node to get the parameter from |
Definition at line 752 of file tcp-general-test.cc.
References ns3::DynamicCast(), m_receiverSocket, m_senderSocket, NS_FATAL_ERROR, RECEIVER, and SENDER.
Referenced by TcpRttEstimationTest::Tx(), and TcpTimeRtoTest::Tx().
Get the rWnd of the selected socket.
who | socket where check the parameter |
Definition at line 803 of file tcp-general-test.cc.
References ns3::DynamicCast(), 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 871 of file tcp-general-test.cc.
References ns3::DynamicCast(), m_receiverSocket, m_senderSocket, NS_FATAL_ERROR, RECEIVER, and SENDER.
Referenced by WScalingTestCase::Tx().
Get the segment size of the node specified.
who | node to get the parameter from |
Definition at line 644 of file tcp-general-test.cc.
References ns3::DynamicCast(), 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().
|
inlineprotected |
Get the pointer to a previously created sender socket.
Definition at line 333 of file tcp-general-test.h.
References m_senderSocket.
Referenced by TcpSsThreshRtoTest::AfterRTOExpired(), TcpBytesInFlightTest::BeforeRTOExpired(), and ns3::TcpCloseWithLossTestCase::ConfigureProperties().
|
inlineprotected |
Get the data start time.
Definition at line 978 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 854 of file tcp-general-test.cc.
References ns3::DynamicCast(), m_receiverSocket, m_senderSocket, NS_FATAL_ERROR, RECEIVER, and SENDER.
Referenced by GetHighestTxMark(), and TcpZeroWindowTest::Tx().
|
protected |
Get the state of the TCP state machine.
who | socket where check the parameter |
Definition at line 786 of file tcp-general-test.cc.
References ns3::DynamicCast(), m_receiverSocket, m_senderSocket, NS_FATAL_ERROR, RECEIVER, and SENDER.
|
protected |
Get the Tx buffer from selected socket.
who | socket where get the TCB |
Definition at line 888 of file tcp-general-test.cc.
References ns3::DynamicCast(), m_receiverSocket, m_senderSocket, NS_FATAL_ERROR, RECEIVER, and SENDER.
Handle an accept connection.
socket | The socket. |
from | The sender. |
Definition at line 262 of file tcp-general-test.cc.
References ErrorCloseCb(), ns3::MakeCallback(), NormalCloseCb(), and ReceivePacket().
Referenced by DoRun().
|
inlineprotectedvirtual |
Highest tx seq changes.
This applies only for sender socket.
oldValue | old value |
newValue | new value |
Definition at line 809 of file tcp-general-test.h.
Referenced by DoRun().
|
inlineprotectedvirtual |
Next tx seq changes.
This applies only for sender socket.
oldValue | old value |
newValue | new value |
Definition at line 796 of file tcp-general-test.h.
Referenced by DoRun().
|
inlineprotectedvirtual |
Socket closed normally.
who | the socket closed (SENDER or RECEIVER) |
Reimplemented in ns3::TcpCloseWithLossTestCase, TcpNewRenoCongAvoidNormalTest, TcpPacingTest, and TcpZeroWindowTest.
Definition at line 834 of file tcp-general-test.h.
Referenced by NormalCloseCb().
Normal Close Callback.
socket | The socket. |
Definition at line 373 of file tcp-general-test.cc.
References 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 TcpLinuxRenoCongAvoidTest, TcpLinuxRenoSSTest, TcpNewRenoCongAvoidNormalTest, TcpPacingTest, and TcpSlowStartNormalTest.
Definition at line 860 of file tcp-general-test.h.
Referenced by PhyDropCb().
Drop at Phy layer Callback.
context | The context. |
p | The packet. |
Definition at line 356 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 TcpFastRetrTest, TcpRtoTest, and TcpZeroWindowTest.
Definition at line 888 of file tcp-general-test.h.
Referenced by ProcessedAckCb().
|
private |
ACK processed Callback.
p | The packet. |
h | TCP header. |
tcp | The TCP socket. |
Definition at line 549 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 TcpLinuxRenoCongAvoidTest, TcpLinuxRenoSSTest, TcpNewRenoCongAvoidNormalTest, TcpPacingTest, and TcpSlowStartNormalTest.
Definition at line 852 of file tcp-general-test.h.
Referenced by QueueDropCb().
context | The context. |
p | The packet. |
Definition at line 339 of file tcp-general-test.cc.
References NS_FATAL_ERROR, QueueDrop(), RECEIVER, and SENDER.
Referenced by DoRun().
|
inlineprotectedvirtual |
Track the rate sample value of TcpRateLinux.
sample | updated value of TcpRateSample. |
Definition at line 826 of file tcp-general-test.h.
Referenced by DoRun().
|
inlineprotectedvirtual |
Track the rate value of TcpRateLinux.
rate | updated value of TcpRate. |
Definition at line 818 of file tcp-general-test.h.
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 TcpFastRetrTest, and TcpRtoTest.
Definition at line 873 of file tcp-general-test.h.
Referenced by RcvAckCb().
|
private |
Receive ACK Callback.
p | The packet. |
h | TCP header. |
tcp | The TCP socket. |
Definition at line 492 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 45 of file tcp-general-test.cc.
References NS_LOG_FUNCTION.
Referenced by DoRun(), and HandleAccept().
|
private |
RTO expired Callback.
tcb | Transmission control block. |
tcp | The TCP socket. |
RTO changes.
This applies only for sender socket.
oldValue | old value |
newValue | new value |
Definition at line 784 of file tcp-general-test.h.
Referenced by DoRun().
Rtt changes.
This applies only for sender socket.
oldTime | old value |
newTime | new value |
Reimplemented in TcpPacingTest, and TcpRttEstimationTest.
Definition at line 746 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::TcpCloseWithLossTestCase, ns3::TcpEcnTest, TcpBytesInFlightTest, TcpDctcpCodePointsTest, TcpFastRetrTest, TcpLargeTransferLossTest, TcpLinuxRenoCongAvoidTest, TcpLinuxRenoSSTest, TcpPacingTest, TcpPktsAckedOpenTest, TcpRateLinuxWithSocketsTest, TcpRttEstimationTest, TcpSlowStartNormalTest, TcpZeroWindowTest, and TimestampTestCase.
Definition at line 486 of file tcp-general-test.cc.
References NS_LOG_FUNCTION.
Referenced by RxPacketCb().
|
private |
Rx packet Callback.
p | The packet. |
h | TCP header. |
tcp | The TCP socket. |
Definition at line 530 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 61 of file tcp-general-test.cc.
References ns3::Create(), ns3::Time::GetSeconds(), NS_LOG_FUNCTION, pktSize, ns3::Simulator::Schedule(), and SendPacket().
Referenced by DoRun(), and SendPacket().
|
inlineprotected |
Set app packet count.
The application will generate this count of packets.
pktCount | count of packets to generate |
Definition at line 642 of file tcp-general-test.h.
References m_pktCount.
Referenced by ConfigureEnvironment(), TcpAdvertisedWindowTest::ConfigureEnvironment(), TcpAdvWindowOnLossTest::ConfigureEnvironment(), TcpBytesInFlightTest::ConfigureEnvironment(), TcpDataSentCbTestCase::ConfigureEnvironment(), TcpFastRetrTest::ConfigureEnvironment(), TcpLargeTransferLossTest::ConfigureEnvironment(), TcpLinuxRenoCongAvoidTest::ConfigureEnvironment(), TcpLinuxRenoSSTest::ConfigureEnvironment(), TcpNewRenoCongAvoidNormalTest::ConfigureEnvironment(), TcpPacingTest::ConfigureEnvironment(), TcpPktsAckedOpenTest::ConfigureEnvironment(), TcpRateLinuxWithSocketsTest::ConfigureEnvironment(), TcpRtoTest::ConfigureEnvironment(), TcpRttEstimationTest::ConfigureEnvironment(), TcpSlowStartNormalTest::ConfigureEnvironment(), TcpSsThreshRtoTest::ConfigureEnvironment(), TcpTimeRtoTest::ConfigureEnvironment(), TcpZeroWindowTest::ConfigureEnvironment(), and ns3::TcpCloseWithLossTestCase::ConfigureProperties().
|
inlineprotected |
Interval between app-generated packet.
pktInterval | interval |
Definition at line 652 of file tcp-general-test.h.
References m_interPacketInterval.
Referenced by ConfigureEnvironment(), TcpLargeTransferLossTest::ConfigureEnvironment(), TcpPacingTest::ConfigureEnvironment(), TcpSsThreshRtoTest::ConfigureEnvironment(), and ns3::TcpCloseWithLossTestCase::ConfigureProperties().
|
inlineprotected |
Set app packet size.
The application will generate packet of this size.
pktSize | size of the packet |
Definition at line 630 of file tcp-general-test.h.
References m_pktSize, and pktSize.
Referenced by ConfigureEnvironment(), TcpAdvertisedWindowTest::ConfigureEnvironment(), TcpAdvWindowOnLossTest::ConfigureEnvironment(), TcpDataSentCbTestCase::ConfigureEnvironment(), TcpLargeTransferLossTest::ConfigureEnvironment(), TcpLinuxRenoCongAvoidTest::ConfigureEnvironment(), TcpLinuxRenoSSTest::ConfigureEnvironment(), TcpNewRenoCongAvoidNormalTest::ConfigureEnvironment(), TcpPacingTest::ConfigureEnvironment(), TcpSlowStartNormalTest::ConfigureEnvironment(), and ns3::TcpCloseWithLossTestCase::ConfigureProperties().
|
inlineprotected |
Congestion control of the sender socket.
congControl | typeid of the congestion control algorithm |
Definition at line 682 of file tcp-general-test.h.
References m_congControlTypeId.
Referenced by ConfigureEnvironment().
Forcefully set the delayed acknowledgement count.
who | socket to force |
count | value of delayed ACKs |
Definition at line 956 of file tcp-general-test.cc.
References m_receiverSocket, m_senderSocket, NS_FATAL_ERROR, RECEIVER, and SENDER.
Referenced by TcpLinuxRenoCongAvoidTest::ConfigureProperties(), TcpLinuxRenoSSTest::ConfigureProperties(), and TcpPacingTest::ConfigureProperties().
Forcefully set the initial cwnd.
who | socket to force |
initialCwnd | size of the initial cwnd (segments) |
Definition at line 939 of file tcp-general-test.cc.
References m_receiverSocket, m_senderSocket, NS_FATAL_ERROR, RECEIVER, and SENDER.
Referenced by ns3::TcpCloseWithLossTestCase::ConfigureProperties(), ConfigureProperties(), TcpLinuxRenoCongAvoidTest::ConfigureProperties(), TcpLinuxRenoSSTest::ConfigureProperties(), TcpPacingTest::ConfigureProperties(), and TcpZeroWindowTest::ConfigureProperties().
Forcefully set the initial ssthresh.
who | socket to force |
initialSsThresh | Initial slow start threshold (bytes) |
Definition at line 1024 of file tcp-general-test.cc.
References m_receiverSocket, m_senderSocket, NS_FATAL_ERROR, RECEIVER, and SENDER.
Referenced by ConfigureProperties(), TcpFastRetrTest::ConfigureProperties(), TcpLinuxRenoCongAvoidTest::ConfigureProperties(), TcpNewRenoCongAvoidNormalTest::ConfigureProperties(), TcpPacingTest::ConfigureProperties(), TcpRtoTest::ConfigureProperties(), and TcpSlowStartNormalTest::ConfigureProperties().
|
inlineprotected |
MTU of the bottleneck link.
mtu | MTU |
Definition at line 702 of file tcp-general-test.h.
References m_mtu.
Referenced by ConfigureEnvironment(), TcpLinuxRenoCongAvoidTest::ConfigureEnvironment(), TcpNewRenoCongAvoidNormalTest::ConfigureEnvironment(), TcpPacingTest::ConfigureEnvironment(), TcpPktsAckedOpenTest::ConfigureEnvironment(), TcpRttEstimationTest::ConfigureEnvironment(), TcpZeroWindowTest::ConfigureEnvironment(), and ns3::TcpCloseWithLossTestCase::ConfigureProperties().
|
protected |
Enable or disable pacing of the initial window.
who | socket |
paceWindow | Boolean to enable or disable pacing of initial window |
Definition at line 1007 of file tcp-general-test.cc.
References m_receiverSocket, m_senderSocket, NS_FATAL_ERROR, RECEIVER, and SENDER.
Referenced by TcpPacingTest::ConfigureProperties().
|
protected |
Enable or disable pacing in the TCP socket.
who | socket |
pacing | Boolean to enable or disable pacing |
Definition at line 990 of file tcp-general-test.cc.
References m_receiverSocket, m_senderSocket, NS_FATAL_ERROR, RECEIVER, and SENDER.
Referenced by TcpPacingTest::ConfigureProperties().
|
inlineprotected |
Propagation delay of the bottleneck link.
propDelay | propagation delay |
Definition at line 662 of file tcp-general-test.h.
References m_propagationDelay.
Referenced by ConfigureEnvironment(), TcpAdvertisedWindowTest::ConfigureEnvironment(), TcpAdvWindowOnLossTest::ConfigureEnvironment(), TcpBytesInFlightTest::ConfigureEnvironment(), TcpLargeTransferLossTest::ConfigureEnvironment(), TcpLinuxRenoSSTest::ConfigureEnvironment(), TcpPacingTest::ConfigureEnvironment(), TcpRateLinuxWithSocketsTest::ConfigureEnvironment(), TcpRttEstimationTest::ConfigureEnvironment(), TcpSsThreshRtoTest::ConfigureEnvironment(), and TcpZeroWindowTest::ConfigureEnvironment().
Forcefully set a defined size for rx buffer.
who | socket to force |
size | size of the rx buffer |
Definition at line 905 of file tcp-general-test.cc.
References m_receiverSocket, m_senderSocket, NS_FATAL_ERROR, RECEIVER, and SENDER.
Referenced by TcpZeroWindowTest::IncreaseBufSize().
|
inlineprotected |
recovery algorithm of the sender socket
recovery | typeid of the recovery algorithm |
Definition at line 692 of file tcp-general-test.h.
References m_recoveryTypeId.
Referenced by ConfigureEnvironment().
Forcefully set the segment size.
who | socket to force |
segmentSize | segmentSize |
Definition at line 922 of file tcp-general-test.cc.
References m_receiverSocket, m_senderSocket, NS_FATAL_ERROR, RECEIVER, segmentSize, and SENDER.
Referenced by ns3::TcpCloseWithLossTestCase::ConfigureProperties(), ConfigureProperties(), TcpLargeTransferLossTest::ConfigureProperties(), TcpLinuxRenoCongAvoidTest::ConfigureProperties(), TcpLinuxRenoSSTest::ConfigureProperties(), TcpNewRenoCongAvoidNormalTest::ConfigureProperties(), TcpPacingTest::ConfigureProperties(), and TcpSlowStartNormalTest::ConfigureProperties().
|
inlineprotected |
Set the initial time at which the application sends the first data packet.
startTime | start time |
Definition at line 672 of file tcp-general-test.h.
References m_startTime.
Referenced by ConfigureEnvironment(), TcpAdvertisedWindowTest::ConfigureEnvironment(), TcpAdvWindowOnLossTest::ConfigureEnvironment(), TcpBytesInFlightTest::ConfigureEnvironment(), TcpLargeTransferLossTest::ConfigureEnvironment(), TcpPacingTest::ConfigureEnvironment(), TcpRateLinuxWithSocketsTest::ConfigureEnvironment(), TcpRttEstimationTest::ConfigureEnvironment(), and TcpZeroWindowTest::ConfigureEnvironment().
|
protected |
Forcefully set the ECN mode of use.
who | socket to force |
useEcn | Value representing the mode of ECN usage requested |
Definition at line 973 of file tcp-general-test.cc.
References m_receiverSocket, m_senderSocket, NS_FATAL_ERROR, RECEIVER, and SENDER.
Referenced by ns3::TcpEcnTest::ConfigureProperties(), and TcpDctcpCodePointsTest::ConfigureProperties().
|
inlineprotectedvirtual |
Slow start threshold changes.
This applies only for sender socket.
oldValue | old value |
newValue | new value |
Reimplemented in TcpSsThreshRtoTest.
Definition at line 758 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::TcpCloseWithLossTestCase, ns3::TcpEcnTest, SackPermittedTestCase, TcpBytesInFlightTest, TcpDctcpCodePointsTest, TcpFastRetrTest, TcpLargeTransferLossTest, TcpLinuxRenoCongAvoidTest, TcpLinuxRenoSSTest, TcpPacingTest, TcpRttEstimationTest, TcpSlowStartNormalTest, TcpTimeRtoTest, TcpZeroWindowTest, TimestampTestCase, and WScalingTestCase.
Definition at line 480 of file tcp-general-test.cc.
References NS_LOG_FUNCTION.
Referenced by TxPacketCb().
|
private |
Tx packet Callback.
p | The packet. |
h | TCP header. |
tcp | The TCP socket. |
Definition at line 511 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 TcpRttEstimationTest.
Definition at line 941 of file tcp-general-test.h.
Referenced by UpdateRttHistoryCb().
|
private |
Update RTT with new data.
tcp | The TCP socket. |
seq | The sequence number. |
sz | The segment size. |
isRetransmission | True if packet is a retransmission. |
Definition at line 390 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 1020 of file tcp-general-test.h.
Referenced by TcpFastRetrTest::TcpFastRetrTest(), TcpLinuxRenoCongAvoidTest::TcpLinuxRenoCongAvoidTest(), TcpLinuxRenoSSTest::TcpLinuxRenoSSTest(), TcpNewRenoCongAvoidNormalTest::TcpNewRenoCongAvoidNormalTest(), TcpPacingTest::TcpPacingTest(), TcpRtoTest::TcpRtoTest(), TcpSlowStartNormalTest::TcpSlowStartNormalTest(), TcpSsThreshRtoTest::TcpSsThreshRtoTest(), TcpTimeRtoTest::TcpTimeRtoTest(), ConfigureEnvironment(), CreateReceiverSocket(), TcpAdvertisedWindowTest::CreateReceiverSocket(), TcpAdvWindowOnLossTest::CreateReceiverSocket(), TcpDataSentCbTestCase::CreateReceiverSocket(), TcpSlowStartAttackerTest::CreateReceiverSocket(), ns3::TcpEcnTest::CreateSenderSocket(), CreateSenderSocket(), and SetCongestionControl().
|
private |
Time between sending application packet down to tcp socket.
Definition at line 1033 of file tcp-general-test.h.
Referenced by DoRun(), GetPktInterval(), and SetAppPktInterval().
|
private |
MTU of the environment.
Definition at line 1029 of file tcp-general-test.h.
|
private |
Count of the application packet.
Definition at line 1032 of file tcp-general-test.h.
Referenced by DoRun(), GetPktCount(), and SetAppPktCount().
|
private |
Size of the application packet.
Definition at line 1031 of file tcp-general-test.h.
Referenced by DoRun(), GetPktSize(), and SetAppPktSize().
|
private |
Propagation delay of the channel.
Definition at line 1026 of file tcp-general-test.h.
Referenced by CreateChannel(), GetPropagationDelay(), and SetPropagationDelay().
|
private |
Pointer to receiver socket.
Definition at line 1036 of file tcp-general-test.h.
Referenced by AfterRetransmitCb(), BeforeRetransmitCb(), DataSentCb(), DoRun(), ErrorCloseCb(), ForkCb(), GetClockGranularity(), GetConnTimeout(), GetDelAckCount(), GetDelAckTimeout(), GetDupAckCount(), GetInitialCwnd(), GetInitialSsThresh(), GetMinRto(), GetPersistentEvent(), GetPersistentTimeout(), GetReceiverSocket(), GetReTxThreshold(), GetRto(), GetRttEstimator(), GetRWnd(), GetRxBuffer(), GetSegSize(), GetTcb(), GetTcpState(), GetTxBuffer(), NormalCloseCb(), ProcessedAckCb(), RcvAckCb(), RxPacketCb(), SetDelAckMaxCount(), SetInitialCwnd(), SetInitialSsThresh(), SetPaceInitialWindow(), SetPacingStatus(), SetRcvBufSize(), SetSegmentSize(), SetUseEcn(), TxPacketCb(), and UpdateRttHistoryCb().
|
protected |
Recovery.
Definition at line 1021 of file tcp-general-test.h.
Referenced by ConfigureEnvironment(), CreateReceiverSocket(), CreateSenderSocket(), CreateSocket(), and SetRecoveryAlgorithm().
|
private |
Remote peer address.
Definition at line 1146 of file tcp-general-test.h.
Referenced by DoConnect(), and DoRun().
|
private |
Pointer to sender socket.
Definition at line 1035 of file tcp-general-test.h.
Referenced by AfterRetransmitCb(), BeforeRetransmitCb(), DataSentCb(), DoConnect(), DoRun(), ErrorCloseCb(), GetClockGranularity(), GetConnTimeout(), GetDelAckCount(), GetDelAckTimeout(), GetDupAckCount(), GetInitialCwnd(), GetInitialSsThresh(), GetMinRto(), GetPersistentEvent(), GetPersistentTimeout(), GetReTxThreshold(), GetRto(), GetRttEstimator(), GetRWnd(), GetRxBuffer(), GetSegSize(), GetSenderSocket(), GetTcb(), GetTcpState(), GetTxBuffer(), NormalCloseCb(), ProcessedAckCb(), RcvAckCb(), RxPacketCb(), SetDelAckMaxCount(), SetInitialCwnd(), SetInitialSsThresh(), SetPaceInitialWindow(), SetPacingStatus(), SetRcvBufSize(), SetSegmentSize(), SetUseEcn(), TxPacketCb(), and UpdateRttHistoryCb().
|
private |
Data transmission time.
Definition at line 1028 of file tcp-general-test.h.
Referenced by DoRun(), GetStartTime(), and SetTransmitStart().