|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
22 #include "ns3/tcp-westwood.h"
23 #include "ns3/simple-channel.h"
24 #include "ns3/rtt-estimator.h"
63 virtual void FinalChecks ();
64 virtual void ConfigureProperties ();
65 virtual void ConfigureEnvironment ();
74 m_afterRTOExpired (false),
75 m_segmentReceived (false)
83 TcpGeneralTest::ConfigureEnvironment ();
90 TcpGeneralTest::ConfigureProperties ();
112 "Second RTO expired");
114 "Ack state machine not in LOSS state after a loss");
132 "Ack state machine not in LOSS state after a loss");
137 "Ack state machine not in OPEN state after recovering "
150 "Ack state machine not in OPEN state after recovering "
167 "Retransmission has not been done");
198 virtual void SsThreshTrace (uint32_t oldValue, uint32_t newValue);
222 m_seqToDrop (seqToDrop),
223 m_minRtoTime (minRto)
231 TcpGeneralTest::ConfigureEnvironment ();
242 NS_LOG_DEBUG(
"TcpSsThreshRtoTest create sender socket");
254 for (uint32_t i = 0; i<3; ++i)
311 "Slow Start Threshold is incorrect");
360 m_senderSentSegments (0),
369 TcpGeneralTest::ConfigureEnvironment ();
389 for (uint32_t i = 0; i<7; ++i)
415 "SYN packet sent without respecting "
416 "ConnTimeout attribute");
423 "First packet has been correctly sent");
449 "RTO value differs from calculation");
455 "RTO value has changed unexpectedly");
482 "RTO has not doubled after an expiration");
488 "RTO goes beyond 60 second limit");
503 "Socket has not been closed after retrying data retransmissions");
518 std::list<TypeId> types;
519 types.insert (types.begin (), TcpNewReno::GetTypeId ());
520 types.insert (types.begin (), TcpWestwood::GetTypeId ());
522 for (std::list<TypeId>::iterator it = types.begin (); it != types.end (); ++it)
525 uint32_t seqToDrop = 25001;
531 AddTestCase (
new TcpSsThreshRtoTest ((*it), seqToDrop, minRto, (*it).GetName () +
" RTO ssthresh testing, set to half of BytesInFlight"), TestCase::QUICK);
a unique identifier for an interface.
uint32_t m_seqToDrop
the sequence number to drop
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
virtual void ConfigureProperties()
Change the configuration of the socket properties.
SocketWho
Used as parameter of methods, specifies on what node the caller is interested (e.g.
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
virtual void ConfigureEnvironment()
Change the configuration of the environment.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
virtual Ptr< ErrorModel > CreateReceiverErrorModel()
Create and return the error model to install in the receiver node.
TcpRtoTest(TypeId &congControl, const std::string &msg)
Constructor.
Testing the ssthresh behavior after the RTO expires.
Testing the moments after an RTO expiration.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
TcpSsThreshRtoTest(TypeId &congControl, uint32_t seqToDrop, Time minRto, const std::string &msg)
Constructor.
Time MicroSeconds(uint64_t value)
Construct a Time in the indicated unit.
uint32_t m_segmentSize
Segment size.
void SetAppPktCount(uint32_t pktCount)
Set app packet count.
static TcpSocketState::TcpCongState_t GetCongStateFrom(Ptr< const TcpSocketState > tcb)
Convenience function to retrieve the ACK state from a TCB.
virtual Ptr< ErrorModel > CreateReceiverErrorModel()
Create and return the error model to install in the receiver node.
Time GetConnTimeout(SocketWho who)
Get the retransmission time for the SYN segments.
void PktDropped(const Ipv4Header &ipH, const TcpHeader &tcpH, Ptr< const Packet > p)
Called when a packet has been dropped.
static TcpRtoTestSuite g_TcpRtoTestSuite
Static variable for test initialization.
void SetAttribute(std::string name, const AttributeValue &value)
Set a single attribute, raising fatal errors if unsuccessful.
Time GetVariation(void) const
Note that this is not a formal statistical variance; it has the the same units as the estimate.
Ptr< TcpSocketMsgBase > GetSenderSocket()
Get the pointer to a previously created sender socket.
virtual void ConfigureEnvironment()
Change the configuration of the environment.
TcpTimeRtoTest(TypeId &congControl, const std::string &msg)
Constructor.
void SetDropCallback(Callback< void, const Ipv4Header &, const TcpHeader &, Ptr< const Packet > > cb)
Set the drop callback.
virtual void AfterRTOExpired(const Ptr< const TcpSocketState > tcb, SocketWho who)
Rto has expired.
virtual Ptr< TcpSocketMsgBase > CreateSenderSocket(Ptr< Node > node)
Create and install the socket to install on the sender.
Smart pointer class similar to boost::intrusive_ptr.
virtual Ptr< TcpSocketMsgBase > CreateSenderSocket(Ptr< Node > node)
Create and install the socket to install on the sender.
virtual void BytesInFlightTrace(uint32_t oldValue, uint32_t newValue)
Bytes in flight changes.
virtual void ErrorClose(SocketWho who)
Socket closed with an error.
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
#define NS_TEST_ASSERT_MSG_EQ_TOL(actual, limit, tol, msg)
Test that actual and expected (limit) values are equal to plus or minus some tolerance and report and...
bool m_closed
True if the connection is closed.
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
void PktDropped(const Ipv4Header &ipH, const TcpHeader &tcpH, Ptr< const Packet > p)
Called when a packet has been dropped.
void SetAppPktInterval(Time pktInterval)
Interval between app-generated packet.
Time GetMinRto(SocketWho who)
Get the minimum RTO attribute.
virtual void BeforeRTOExpired(const Ptr< const TcpSocketState > tcb, SocketWho who)
Rto has expired.
Simulation virtual time values and global simulation resolution.
virtual void Tx(const Ptr< const Packet > p, const TcpHeader &h, SocketWho who)
Packet transmitted down to IP layer.
Testing the timing of RTO.
bool m_segmentReceived
True if segments have been received.
Time m_minRtoTime
the minimum RTO time
uint32_t m_bytesInFlight
Store the number of bytes in flight.
Callback< R, Ts... > MakeCallback(R(T::*memPtr)(Ts...), OBJ objPtr)
Build Callbacks for class method members which take varying numbers of arguments and potentially retu...
General infrastructure for TCP testing.
virtual void ConfigureEnvironment()
Change the configuration of the environment.
virtual void RcvAck(const Ptr< const TcpSocketState > tcb, const TcpHeader &h, SocketWho who)
Received ack.
virtual void FinalChecks()
Performs the (eventual) final checks through test asserts.
uint32_t m_ssThreshSocket
the ssThresh as computed by the socket
virtual void AfterRTOExpired(const Ptr< const TcpSocketState > tcb, SocketWho who)
Rto has expired.
NUMERIC_TYPE GetValue() const
Extracts the numeric value of the sequence number.
Time GetRto(SocketWho who)
Get the retransmission time.
#define NS_TEST_ASSERT_MSG_EQ(actual, limit, msg)
Test that an actual and expected (limit) value are equal and report and abort if not.
Time m_previousRTO
Previous RTO.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
@ UNIT
This test suite implements a Unit Test.
bool m_afterRTOExpired
True if RTO is expired.
Time Seconds(double value)
Construct a Time in the indicated unit.
TypeId m_congControlTypeId
Congestion control.
virtual void AfterRTOExpired(const Ptr< const TcpSocketState > tcb, SocketWho who)
Rto has expired.
AttributeValue implementation for Time.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
Time GetEstimate(void) const
gets the RTT estimate.
Hold an unsigned integer type.
virtual Ptr< TcpSocketMsgBase > CreateSenderSocket(Ptr< Node > node)
Create and install the socket to install on the sender.
uint32_t m_senderSentSegments
Number of segments sent.
virtual void SsThreshTrace(uint32_t oldValue, uint32_t newValue)
Slow start threshold changes.
uint32_t m_bytesInFlightBeforeRto
Store the number of bytes in flight before the RTO expiration.
void AddSeqToKill(const SequenceNumber32 &seq)
Add the sequence number to the list of segments to be killed.
virtual void ProcessedAck(const Ptr< const TcpSocketState > tcb, const TcpHeader &h, SocketWho who)
Processed ack.
void SetInitialSsThresh(SocketWho who, uint32_t initialSsThresh)
Forcefully set the initial ssthresh.
Time GetClockGranularity(SocketWho who)
Get the clock granularity attribute.
virtual void FinalChecks()
Performs the (eventual) final checks through test asserts.
Ptr< RttEstimator > GetRttEstimator(SocketWho who)
Get the Rtt estimator of the socket.
void SetPropagationDelay(Time propDelay)
Propagation delay of the bottleneck link.