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 | 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 () | |
Public Member Functions inherited from ns3::TestCase | |
TestCase (const TestCase &)=delete | |
virtual | ~TestCase () |
Destructor. More... | |
std::string | GetName (void) const |
TestCase & | operator= (const TestCase &)=delete |
Protected Member Functions | |
virtual void | AfterRTOExpired ([[maybe_unused]] const Ptr< const TcpSocketState > tcb, [[maybe_unused]] SocketWho who) |
Rto has expired. More... | |
virtual void | BeforeRTOExpired ([[maybe_unused]] const Ptr< const TcpSocketState > tcb, [[maybe_unused]] SocketWho who) |
Rto has expired. More... | |
virtual void | BytesInFlightTrace ([[maybe_unused]] uint32_t oldValue, [[maybe_unused]] uint32_t newValue) |
Bytes in flight changes. More... | |
virtual void | ConfigureEnvironment (void) |
Change the configuration of the environment. More... | |
virtual void | ConfigureProperties (void) |
Change the configuration of the socket properties. More... | |
virtual void | CongStateTrace ([[maybe_unused]] const TcpSocketState::TcpCongState_t oldValue, [[maybe_unused]] 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 Ptr< TcpSocketMsgBase > | CreateSocket (Ptr< Node > node, TypeId socketType, TypeId congControl, TypeId recoveryAlgorithm) |
Create a socket. More... | |
virtual void | CWndInflTrace ([[maybe_unused]] uint32_t oldValue, [[maybe_unused]] uint32_t newValue) |
Tracks the inflated congestion window changes. More... | |
virtual void | CWndTrace ([[maybe_unused]] uint32_t oldValue, [[maybe_unused]] uint32_t newValue) |
Tracks the congestion window changes. More... | |
virtual void | DataSent ([[maybe_unused]] uint32_t size, [[maybe_unused]] 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 ([[maybe_unused]] 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 minimum 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... | |
Ptr< TcpTxBuffer > | GetTxBuffer (SocketWho who) |
Get the Tx buffer from selected socket. More... | |
virtual void | HighestTxSeqTrace ([[maybe_unused]] SequenceNumber32 oldValue, [[maybe_unused]] SequenceNumber32 newValue) |
Highest tx seq changes. More... | |
virtual void | NextTxSeqTrace ([[maybe_unused]] SequenceNumber32 oldValue, [[maybe_unused]] SequenceNumber32 newValue) |
Next tx seq changes. More... | |
virtual void | NormalClose ([[maybe_unused]] SocketWho who) |
Socket closed normally. More... | |
virtual void | PhyDrop ([[maybe_unused]] SocketWho who) |
Link drop. More... | |
virtual void | ProcessedAck ([[maybe_unused]] const Ptr< const TcpSocketState > tcb, [[maybe_unused]] const TcpHeader &h, [[maybe_unused]] SocketWho who) |
Processed ack. More... | |
virtual void | QueueDrop ([[maybe_unused]] SocketWho who) |
Drop on the queue. More... | |
virtual void | RateSampleUpdatedTrace ([[maybe_unused]] const TcpRateLinux::TcpRateSample &sample) |
Track the rate sample value of TcpRateLinux. More... | |
virtual void | RateUpdatedTrace ([[maybe_unused]] const TcpRateLinux::TcpRateConnection &rate) |
Track the rate value of TcpRateLinux. More... | |
virtual void | RcvAck ([[maybe_unused]] const Ptr< const TcpSocketState > tcb, [[maybe_unused]] const TcpHeader &h, [[maybe_unused]] SocketWho who) |
Received ack. More... | |
virtual void | ReceivePacket (Ptr< Socket > socket) |
Packet received. More... | |
virtual void | RtoTrace ([[maybe_unused]] Time oldValue, [[maybe_unused]] Time newValue) |
RTO changes. More... | |
virtual void | RttTrace ([[maybe_unused]] Time oldTime, [[maybe_unused]] 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 | SetDelAckMaxCount (SocketWho who, uint32_t count) |
Forcefully set the delayed acknowledgement count. 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 ssthresh. More... | |
void | SetMTU (uint32_t mtu) |
MTU of the bottleneck link. More... | |
void | SetPaceInitialWindow (SocketWho who, bool paceWindow) |
Enable or disable pacing of the initial window. More... | |
void | SetPacingStatus (SocketWho who, bool pacing) |
Enable or disable pacing in the TCP socket. 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 | SetRecoveryAlgorithm (TypeId recovery) |
recovery algorithm of the sender socket 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... | |
void | SetUseEcn (SocketWho who, TcpSocketState::UseEcn_t useEcn) |
Forcefully set the ECN mode of use. More... | |
virtual void | SsThreshTrace ([[maybe_unused]] uint32_t oldValue, [[maybe_unused]] 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 ([[maybe_unused]] const SequenceNumber32 &seq, [[maybe_unused]] uint32_t sz, [[maybe_unused]] bool isRetransmission, [[maybe_unused]] SocketWho who) |
Updated the Rtt history. More... | |
Protected Member Functions inherited from ns3::TestCase | |
TestCase (std::string name) | |
Constructor. More... | |
void | AddTestCase (TestCase *testCase, TestDuration duration=QUICK) |
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... | |
TypeId | m_recoveryTypeId |
Recovery. More... | |
Private Member Functions | |
void | AfterRetransmitCb (const Ptr< const TcpSocketState > tcb, const Ptr< const TcpSocketBase > tcp) |
Invoked after a retransmit event. More... | |
void | BeforeRetransmitCb (const Ptr< const TcpSocketState > tcb, const Ptr< const TcpSocketBase > tcp) |
Invoked before a retransmit event. More... | |
void | DataSentCb (Ptr< Socket > socket, uint32_t size) |
Data sent Callback. More... | |
void | ErrorCloseCb (Ptr< Socket > socket) |
Error Close Callback. More... | |
void | ForkCb (Ptr< TcpSocketMsgBase > tcp) |
Fork Callback. More... | |
void | HandleAccept (Ptr< Socket > socket, const Address &from) |
Handle an accept connection. More... | |
void | NormalCloseCb (Ptr< Socket > socket) |
Normal Close Callback. More... | |
void | PhyDropCb (std::string context, Ptr< const Packet > p) |
Drop at Phy layer Callback. More... | |
void | ProcessedAckCb (Ptr< const Packet > p, const TcpHeader &h, Ptr< const TcpSocketBase > tcp) |
ACK processed Callback. More... | |
void | QueueDropCb (std::string context, Ptr< const Packet > p) |
Queue Drop Callback. More... | |
void | RcvAckCb (Ptr< const Packet > p, const TcpHeader &h, Ptr< const TcpSocketBase > tcp) |
Receive ACK Callback. More... | |
void | RtoExpiredCb (const Ptr< const TcpSocketState > tcb, const Ptr< const TcpSocketBase > tcp) |
RTO expired Callback. More... | |
void | RxPacketCb (const Ptr< const Packet > p, const TcpHeader &h, const Ptr< const TcpSocketBase > tcp) |
Rx packet Callback. More... | |
void | TxPacketCb (const Ptr< const Packet > p, const TcpHeader &h, const Ptr< const TcpSocketBase > tcp) |
Tx packet Callback. More... | |
void | UpdateRttHistoryCb (Ptr< const TcpSocketBase > tcp, const SequenceNumber32 &seq, uint32_t sz, bool isRetransmission) |
Update RTT with new data. More... | |
Private Attributes | |
Time | m_interPacketInterval |
Time between sending application packet down to tcp socket. 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 |
Remote peer address. More... | |
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 256 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 274 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 42 of file tcp-general-test.cc.
References NS_LOG_FUNCTION.
TcpGeneralTest::~TcpGeneralTest | ( | ) |
Definition at line 51 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 406 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) |
Definition at line 908 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 424 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) |
Definition at line 919 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 |
Definition at line 760 of file tcp-general-test.h.
Referenced by DoRun().
|
protectedvirtual |
Change the configuration of the environment.
Reimplemented in TcpLargeTransferLossTest, TcpZeroWindowTest, TcpSlowStartNormalTest, TcpRttEstimationTest, TcpTimeRtoTest, TcpSsThreshRtoTest, TcpRtoTest, TcpRateLinuxWithSocketsTest, TcpPktsAckedOpenTest, TcpPacingTest, TcpLinuxRenoCongAvoidTest, TcpLinuxRenoSSTest, TcpFastRetrTest, TcpDctcpCodePointsTest, TcpDataSentCbTestCase, TcpNewRenoCongAvoidNormalTest, TcpBytesInFlightTest, TcpAdvWindowOnLossTest, and TcpAdvertisedWindowTest.
Definition at line 100 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 TcpDataSentCbTestCase::ConfigureEnvironment(), and DoRun().
|
protectedvirtual |
Change the configuration of the socket properties.
Reimplemented in TcpLargeTransferLossTest, TcpZeroWindowTest, TcpSlowStartNormalTest, TcpRtoTest, TcpPacingTest, TcpLinuxRenoCongAvoidTest, TcpLinuxRenoSSTest, TcpFastRetrTest, ns3::TcpEcnTest, TcpDctcpCodePointsTest, TcpNewRenoCongAvoidNormalTest, and ns3::TcpCloseWithLossTestCase.
Definition at line 115 of file tcp-general-test.cc.
References NS_LOG_FUNCTION, RECEIVER, SENDER, SetInitialCwnd(), SetInitialSsThresh(), SetSegmentSize(), and python-unit-tests::UINT32_MAX.
Referenced by ns3::TcpCloseWithLossTestCase::ConfigureProperties(), ns3::TcpEcnTest::ConfigureProperties(), and DoRun().
|
inlineprotectedvirtual |
State on Ack state machine changes.
oldValue | old value |
newValue | new value |
Definition at line 699 of file tcp-general-test.h.
Referenced by DoRun().
|
protectedvirtual |
Create and return the channel installed between the two socket.
Definition at line 268 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 TcpRttEstimationWithLossTest, TcpTimeRtoTest, TcpSsThreshRtoTest, TcpRateLinuxWithSocketsTest, TcpLargeTransferLossTest, TcpFastRetrTest, ns3::TcpCloseWithLossTestCase, TcpBytesInFlightTest, TcpAdvWindowOnLossTest, and TcpAdvertisedWindowTest.
Definition at line 318 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 TcpZeroWindowTest, WScalingTestCase, TimestampTestCase, TcpSlowStartAttackerTest, SackPermittedTestCase, TcpRttEstimationTest, TcpDctcpCodePointsTest, TcpDataSentCbTestCase, TcpAdvWindowOnLossTest, and TcpAdvertisedWindowTest.
Definition at line 330 of file tcp-general-test.cc.
References CreateSocket(), ns3::TcpSocketMsgBase::GetTypeId(), m_congControlTypeId, and m_recoveryTypeId.
Referenced by DoRun().
|
protectedvirtual |
Create and return the error model to install in the sender node.
Reimplemented in TcpFastRetrTest.
Definition at line 312 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 WScalingTestCase, TimestampTestCase, SackPermittedTestCase, TcpRttEstimationTest, TcpTimeRtoTest, TcpSsThreshRtoTest, TcpRtoTest, TcpRateLinuxWithSocketsTest, TcpPktsAckedOpenTest, TcpFastRetrTest, ns3::TcpEcnTest, TcpDctcpCodePointsTest, and TcpAdvWindowOnLossTest.
Definition at line 324 of file tcp-general-test.cc.
References CreateSocket(), ns3::TcpSocketMsgBase::GetTypeId(), m_congControlTypeId, and m_recoveryTypeId.
Referenced by ns3::TcpEcnTest::CreateSenderSocket(), and DoRun().
|
protectedvirtual |
Create a socket.
node | associated node |
socketType | Type of the TCP socket |
congControl | congestion control |
Definition at line 278 of file tcp-general-test.cc.
References m_recoveryTypeId.
Referenced by TcpAdvertisedWindowTest::CreateReceiverSocket(), TcpAdvWindowOnLossTest::CreateReceiverSocket(), CreateReceiverSocket(), TcpSlowStartAttackerTest::CreateReceiverSocket(), TcpDctcpCodePointsTest::CreateSenderSocket(), ns3::TcpEcnTest::CreateSenderSocket(), and CreateSenderSocket().
|
protectedvirtual |
Create a socket.
node | associated node |
socketType | Type of the TCP socket |
congControl | congestion control |
recoveryAlgorithm | recovery algorithm |
Definition at line 285 of file tcp-general-test.cc.
References ns3::ObjectFactory::Create(), ns3::Object::GetObject(), ns3::RttMeanDeviation::GetTypeId(), and ns3::ObjectFactory::SetTypeId().
|
inlineprotectedvirtual |
Tracks the inflated congestion window changes.
oldValue | old value |
newValue | new value |
Definition at line 721 of file tcp-general-test.h.
Referenced by DoRun().
|
inlineprotectedvirtual |
Tracks the congestion window changes.
oldValue | old value |
newValue | new value |
Definition at line 710 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) |
Definition at line 944 of file tcp-general-test.h.
Referenced by DataSentCb().
Data sent Callback.
socket | The socket. |
size | The data size. |
Definition at line 442 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 251 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 125 of file tcp-general-test.cc.
References AfterRetransmitCb(), ns3::Ipv4AddressHelper::Assign(), BeforeRetransmitCb(), BytesInFlightTrace(), third::channel, ConfigureEnvironment(), ConfigureProperties(), CongStateTrace(), CreateChannel(), CreateReceiverErrorModel(), CreateReceiverSocket(), CreateSenderErrorModel(), CreateSenderSocket(), CWndInflTrace(), CWndTrace(), DataSentCb(), DoConnect(), ns3::Packet::EnablePrinting(), ErrorCloseCb(), ForkCb(), ns3::NetDeviceContainer::Get(), ns3::Ipv4InterfaceContainer::GetAddress(), ns3::Ipv4Address::GetAny(), HandleAccept(), HighestTxSeqTrace(), 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(), NextTxSeqTrace(), first::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::Ipv4AddressHelper::SetBase(), ns3::SimpleNetDeviceHelper::SetNetDevicePointToPointMode(), SsThreshTrace(), TxPacketCb(), and UpdateRttHistoryCb().
|
protectedvirtual |
Teardown the TCP test.
Reimplemented from ns3::TestCase.
Reimplemented in TcpLinuxRenoCongAvoidTest, and TcpLinuxRenoSSTest.
Definition at line 91 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) |
Definition at line 833 of file tcp-general-test.h.
Referenced by ErrorCloseCb().
Error Close Callback.
socket | The socket. |
Definition at line 459 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 TcpLargeTransferLossTest, TcpZeroWindowTest, TcpRttEstimationTest, TcpTimeRtoTest, TcpRtoTest, TcpRateLinuxWithSocketsTest, TcpPktsAckedOpenTest, TcpFastRetrTest, TcpDataSentCbTestCase, ns3::TcpCloseWithLossTestCase, and TcpBytesInFlightTest.
Definition at line 952 of file tcp-general-test.h.
Referenced by DoTeardown().
|
private |
Fork Callback.
tcp | The TCP socket. |
Definition at line 560 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 761 of file tcp-general-test.cc.
References 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 727 of file tcp-general-test.cc.
References m_receiverSocket, m_senderSocket, NS_FATAL_ERROR, RECEIVER, and SENDER.
Referenced by TcpTimeRtoTest::Tx().
|
protected |
Get the number of delayed ack (if present)
who | node to get the parameter from |
Definition at line 602 of file tcp-general-test.cc.
References 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 619 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 585 of file tcp-general-test.cc.
References m_receiverSocket, m_senderSocket, NS_FATAL_ERROR, RECEIVER, and SENDER.
Referenced by TcpFastRetrTest::CongStateTrace(), TcpFastRetrTest::ProcessedAck(), and TcpFastRetrTest::RcvAck().
|
protected |
Get the highest tx mark of the node specified.
who | node to get the parameter from |
Definition at line 653 of file tcp-general-test.cc.
References GetTcb(), and ns3::TcpSocketState::m_highTxMark.
|
protected |
Get the initial congestion window.
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.
|
protected |
Get the initial slow start threshold.
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 TcpLinuxRenoSSTest::CWndTrace(), and TcpSlowStartNormalTest::CWndTrace().
Get the minimum RTO 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 TcpTimeRtoTest::Tx().
|
inlineprotected |
Get the MTU of the environment.
Definition at line 978 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 814 of file tcp-general-test.cc.
References 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 832 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 996 of file tcp-general-test.h.
References m_pktCount.
|
inlineprotected |
Get the interval to wait for each packet sent down from application to TCP.
Definition at line 1006 of file tcp-general-test.h.
References m_interPacketInterval.
|
inlineprotected |
Get the application packet size.
Definition at line 987 of file tcp-general-test.h.
References m_pktSize.
|
inlineprotected |
Get the channel Propagation Delay.
Definition at line 960 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 352 of file tcp-general-test.h.
References m_receiverSocket.
Referenced by ns3::TcpCloseWithLossTestCase::ConfigureProperties().
|
protected |
Get the retransmission threshold.
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.
Referenced by TcpFastRetrTest::CongStateTrace(), TcpFastRetrTest::ProcessedAck(), and TcpFastRetrTest::RcvAck().
Get the retransmission time.
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 TcpTimeRtoTest::AfterRTOExpired(), and TcpTimeRtoTest::Tx().
|
protected |
Get the Rtt estimator of the socket.
who | node to get the parameter from |
Definition at line 744 of file tcp-general-test.cc.
References m_receiverSocket, m_senderSocket, NS_FATAL_ERROR, RECEIVER, and SENDER.
Referenced by TcpTimeRtoTest::Tx(), and TcpRttEstimationTest::Tx().
|
protected |
Get the rWnd of the selected socket.
who | socket where check the parameter |
Definition at line 796 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 868 of file tcp-general-test.cc.
References m_receiverSocket, m_senderSocket, NS_FATAL_ERROR, RECEIVER, and SENDER.
Referenced by WScalingTestCase::Tx().
|
protected |
Get the segment size of the node specified.
who | node to get the parameter from |
Definition at line 636 of file tcp-general-test.cc.
References m_receiverSocket, m_senderSocket, NS_FATAL_ERROR, RECEIVER, and SENDER.
Referenced by TcpNewRenoCongAvoidNormalTest::Check(), TcpLinuxRenoSSTest::CWndTrace(), TcpSlowStartNormalTest::CWndTrace(), TcpPktsAckedOpenTest::FinalChecks(), TcpBytesInFlightTest::Rx(), TcpFastRetrTest::Rx(), TcpSlowStartNormalTest::Rx(), TcpFastRetrTest::Tx(), and TcpSlowStartNormalTest::Tx().
|
inlineprotected |
Get the pointer to a previously created sender socket.
Definition at line 343 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 969 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 850 of file tcp-general-test.cc.
References 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 778 of file tcp-general-test.cc.
References 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 886 of file tcp-general-test.cc.
References m_receiverSocket, m_senderSocket, NS_FATAL_ERROR, RECEIVER, and SENDER.
Handle an accept connection.
socket | The socket. |
from | The sender. |
Definition at line 258 of file tcp-general-test.cc.
References ErrorCloseCb(), ns3::MakeCallback(), NormalCloseCb(), ReceivePacket(), ns3::Socket::SetCloseCallbacks(), and ns3::Socket::SetRecvCallback().
Referenced by DoRun().
|
inlineprotectedvirtual |
Highest tx seq changes.
This applies only for sender socket.
oldValue | old value |
newValue | new value |
Definition at line 799 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 786 of file tcp-general-test.h.
Referenced by DoRun().
|
inlineprotectedvirtual |
Socket closed normally.
who | the socket closed (SENDER or RECEIVER) |
Definition at line 824 of file tcp-general-test.h.
Referenced by NormalCloseCb().
Normal Close Callback.
socket | The socket. |
Definition at line 370 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) |
Definition at line 850 of file tcp-general-test.h.
Referenced by PhyDropCb().
Drop at Phy layer Callback.
context | The context. |
p | The packet. |
Definition at line 353 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) |
Definition at line 878 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 542 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) |
Definition at line 842 of file tcp-general-test.h.
Referenced by QueueDropCb().
context | The context. |
p | The packet. |
Definition at line 336 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 816 of file tcp-general-test.h.
Referenced by DoRun().
|
inlineprotectedvirtual |
Track the rate value of TcpRateLinux.
rate | updated value of TcpRate. |
Definition at line 808 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) |
Definition at line 863 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 488 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 57 of file tcp-general-test.cc.
References ns3::Packet::GetSize(), NS_LOG_FUNCTION, and ns3::Socket::RecvFrom().
Referenced by DoRun(), and HandleAccept().
|
private |
RTO expired Callback.
tcb | Transmission control block. |
tcp | The TCP socket. |
|
inlineprotectedvirtual |
RTO changes.
This applies only for sender socket.
oldValue | old value |
newValue | new value |
Definition at line 773 of file tcp-general-test.h.
Referenced by DoRun().
|
inlineprotectedvirtual |
Rtt changes.
This applies only for sender socket.
oldTime | old value |
newTime | new value |
Definition at line 734 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 TcpZeroWindowTest, TimestampTestCase, TcpSlowStartNormalTest, TcpRttEstimationTest, TcpRateLinuxWithSocketsTest, TcpPktsAckedOpenTest, TcpPacingTest, TcpLargeTransferLossTest, TcpLinuxRenoCongAvoidTest, TcpLinuxRenoSSTest, TcpFastRetrTest, ns3::TcpEcnTest, TcpDctcpCodePointsTest, ns3::TcpCloseWithLossTestCase, and TcpBytesInFlightTest.
Definition at line 482 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 524 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 73 of file tcp-general-test.cc.
References ns3::Socket::Close(), ns3::Time::GetSeconds(), NS_LOG_FUNCTION, pktSize, 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 650 of file tcp-general-test.h.
References m_pktCount.
Referenced by TcpAdvertisedWindowTest::ConfigureEnvironment(), TcpAdvWindowOnLossTest::ConfigureEnvironment(), TcpBytesInFlightTest::ConfigureEnvironment(), TcpNewRenoCongAvoidNormalTest::ConfigureEnvironment(), TcpFastRetrTest::ConfigureEnvironment(), TcpLinuxRenoSSTest::ConfigureEnvironment(), TcpLinuxRenoCongAvoidTest::ConfigureEnvironment(), TcpPacingTest::ConfigureEnvironment(), TcpPktsAckedOpenTest::ConfigureEnvironment(), TcpRateLinuxWithSocketsTest::ConfigureEnvironment(), TcpRtoTest::ConfigureEnvironment(), TcpSsThreshRtoTest::ConfigureEnvironment(), TcpTimeRtoTest::ConfigureEnvironment(), TcpRttEstimationTest::ConfigureEnvironment(), TcpSlowStartNormalTest::ConfigureEnvironment(), TcpZeroWindowTest::ConfigureEnvironment(), ConfigureEnvironment(), TcpLargeTransferLossTest::ConfigureEnvironment(), and ns3::TcpCloseWithLossTestCase::ConfigureProperties().
|
inlineprotected |
Interval between app-generated packet.
pktInterval | interval |
Definition at line 657 of file tcp-general-test.h.
References m_interPacketInterval.
Referenced by TcpPacingTest::ConfigureEnvironment(), TcpSsThreshRtoTest::ConfigureEnvironment(), ConfigureEnvironment(), TcpLargeTransferLossTest::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 641 of file tcp-general-test.h.
References m_pktSize, and pktSize.
Referenced by TcpAdvertisedWindowTest::ConfigureEnvironment(), TcpAdvWindowOnLossTest::ConfigureEnvironment(), TcpNewRenoCongAvoidNormalTest::ConfigureEnvironment(), TcpLinuxRenoSSTest::ConfigureEnvironment(), TcpLinuxRenoCongAvoidTest::ConfigureEnvironment(), TcpPacingTest::ConfigureEnvironment(), TcpSlowStartNormalTest::ConfigureEnvironment(), ConfigureEnvironment(), TcpLargeTransferLossTest::ConfigureEnvironment(), and ns3::TcpCloseWithLossTestCase::ConfigureProperties().
|
inlineprotected |
Congestion control of the sender socket.
congControl | typeid of the congestion control algorithm |
Definition at line 678 of file tcp-general-test.h.
References m_congControlTypeId.
Referenced by ConfigureEnvironment().
|
protected |
Forcefully set the delayed acknowledgement count.
who | socket to force |
count | value of delayed ACKs |
Definition at line 954 of file tcp-general-test.cc.
References m_receiverSocket, m_senderSocket, NS_FATAL_ERROR, RECEIVER, and SENDER.
Referenced by TcpLinuxRenoSSTest::ConfigureProperties(), TcpLinuxRenoCongAvoidTest::ConfigureProperties(), and TcpPacingTest::ConfigureProperties().
|
protected |
Forcefully set the initial cwnd.
who | socket to force |
initialCwnd | size of the initial cwnd (segments) |
Definition at line 938 of file tcp-general-test.cc.
References m_receiverSocket, m_senderSocket, NS_FATAL_ERROR, RECEIVER, and SENDER.
Referenced by ns3::TcpCloseWithLossTestCase::ConfigureProperties(), TcpLinuxRenoSSTest::ConfigureProperties(), TcpLinuxRenoCongAvoidTest::ConfigureProperties(), TcpPacingTest::ConfigureProperties(), TcpZeroWindowTest::ConfigureProperties(), and ConfigureProperties().
|
protected |
Forcefully set the initial ssthresh.
who | socket to force |
initialSsThresh | Initial slow start threshold (bytes) |
Definition at line 1021 of file tcp-general-test.cc.
References m_receiverSocket, m_senderSocket, NS_FATAL_ERROR, RECEIVER, and SENDER.
Referenced by TcpNewRenoCongAvoidNormalTest::ConfigureProperties(), TcpFastRetrTest::ConfigureProperties(), TcpLinuxRenoCongAvoidTest::ConfigureProperties(), TcpPacingTest::ConfigureProperties(), TcpRtoTest::ConfigureProperties(), TcpSlowStartNormalTest::ConfigureProperties(), and ConfigureProperties().
|
inlineprotected |
MTU of the bottleneck link.
mtu | MTU |
Definition at line 692 of file tcp-general-test.h.
References m_mtu.
Referenced by TcpNewRenoCongAvoidNormalTest::ConfigureEnvironment(), TcpLinuxRenoCongAvoidTest::ConfigureEnvironment(), TcpPacingTest::ConfigureEnvironment(), TcpPktsAckedOpenTest::ConfigureEnvironment(), TcpRttEstimationTest::ConfigureEnvironment(), TcpZeroWindowTest::ConfigureEnvironment(), 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 1004 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 987 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 664 of file tcp-general-test.h.
References m_propagationDelay.
Referenced by TcpAdvertisedWindowTest::ConfigureEnvironment(), TcpAdvWindowOnLossTest::ConfigureEnvironment(), TcpBytesInFlightTest::ConfigureEnvironment(), TcpLinuxRenoSSTest::ConfigureEnvironment(), TcpPacingTest::ConfigureEnvironment(), TcpRateLinuxWithSocketsTest::ConfigureEnvironment(), TcpSsThreshRtoTest::ConfigureEnvironment(), TcpRttEstimationTest::ConfigureEnvironment(), TcpZeroWindowTest::ConfigureEnvironment(), ConfigureEnvironment(), and TcpLargeTransferLossTest::ConfigureEnvironment().
|
protected |
Forcefully set a defined size for rx buffer.
who | socket to force |
size | size of the rx buffer |
Definition at line 904 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 685 of file tcp-general-test.h.
References m_recoveryTypeId.
Referenced by ConfigureEnvironment().
|
protected |
Forcefully set the segment size.
who | socket to force |
segmentSize | segmentSize |
Definition at line 921 of file tcp-general-test.cc.
References m_receiverSocket, m_senderSocket, NS_FATAL_ERROR, RECEIVER, segmentSize, and SENDER.
Referenced by ns3::TcpCloseWithLossTestCase::ConfigureProperties(), TcpNewRenoCongAvoidNormalTest::ConfigureProperties(), TcpLinuxRenoSSTest::ConfigureProperties(), TcpLinuxRenoCongAvoidTest::ConfigureProperties(), TcpPacingTest::ConfigureProperties(), TcpSlowStartNormalTest::ConfigureProperties(), ConfigureProperties(), and TcpLargeTransferLossTest::ConfigureProperties().
|
inlineprotected |
Set the initial time at which the application sends the first data packet.
startTime | start time |
Definition at line 671 of file tcp-general-test.h.
References m_startTime, and startTime.
Referenced by TcpAdvertisedWindowTest::ConfigureEnvironment(), TcpAdvWindowOnLossTest::ConfigureEnvironment(), TcpBytesInFlightTest::ConfigureEnvironment(), TcpPacingTest::ConfigureEnvironment(), TcpRateLinuxWithSocketsTest::ConfigureEnvironment(), TcpRttEstimationTest::ConfigureEnvironment(), TcpZeroWindowTest::ConfigureEnvironment(), ConfigureEnvironment(), and TcpLargeTransferLossTest::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 970 of file tcp-general-test.cc.
References m_receiverSocket, m_senderSocket, NS_FATAL_ERROR, RECEIVER, and SENDER.
Referenced by TcpDctcpCodePointsTest::ConfigureProperties(), and ns3::TcpEcnTest::ConfigureProperties().
|
inlineprotectedvirtual |
Slow start threshold changes.
This applies only for sender socket.
oldValue | old value |
newValue | new value |
Definition at line 747 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 TcpZeroWindowTest, WScalingTestCase, TimestampTestCase, TcpSlowStartNormalTest, SackPermittedTestCase, TcpRttEstimationTest, TcpTimeRtoTest, TcpPacingTest, TcpLargeTransferLossTest, TcpLinuxRenoCongAvoidTest, TcpLinuxRenoSSTest, TcpFastRetrTest, ns3::TcpEcnTest, TcpDctcpCodePointsTest, ns3::TcpCloseWithLossTestCase, and TcpBytesInFlightTest.
Definition at line 476 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 506 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 |
Definition at line 931 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 387 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 1011 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(), TcpAdvertisedWindowTest::CreateReceiverSocket(), TcpAdvWindowOnLossTest::CreateReceiverSocket(), CreateReceiverSocket(), TcpSlowStartAttackerTest::CreateReceiverSocket(), ns3::TcpEcnTest::CreateSenderSocket(), CreateSenderSocket(), and SetCongestionControl().
|
private |
Time between sending application packet down to tcp socket.
Definition at line 1024 of file tcp-general-test.h.
Referenced by DoRun(), GetPktInterval(), and SetAppPktInterval().
|
private |
MTU of the environment.
Definition at line 1020 of file tcp-general-test.h.
|
private |
Count of the application packet.
Definition at line 1023 of file tcp-general-test.h.
Referenced by DoRun(), GetPktCount(), and SetAppPktCount().
|
private |
Size of the application packet.
Definition at line 1022 of file tcp-general-test.h.
Referenced by DoRun(), GetPktSize(), and SetAppPktSize().
|
private |
Propagation delay of the channel.
Definition at line 1017 of file tcp-general-test.h.
Referenced by CreateChannel(), GetPropagationDelay(), and SetPropagationDelay().
|
private |
Pointer to receiver socket.
Definition at line 1027 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 1012 of file tcp-general-test.h.
Referenced by ConfigureEnvironment(), CreateReceiverSocket(), CreateSenderSocket(), CreateSocket(), and SetRecoveryAlgorithm().
|
private |
Remote peer address.
Definition at line 1137 of file tcp-general-test.h.
Referenced by DoConnect(), and DoRun().
|
private |
Pointer to sender socket.
Definition at line 1026 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 1019 of file tcp-general-test.h.
Referenced by DoRun(), GetStartTime(), and SetTransmitStart().