21 #include "ns3/tcp-westwood.h"
29 const std::string &msg)
31 0, 1, 500, typeId, 1500),
33 m_pktWasDropped (false),
34 m_seqToKill (seqToKill),
39 m_bytesRcvButNotAcked (0)
112 "Segment retransmitted too many times");
125 "Sequence number expected differs");
152 "SYN pkt has not 0 as initial sequence number."
153 "Probably, random sqn number has been implemented."
159 "ACK pkt has not 1 as sequence number."
160 "Probably, random sqn number has been implemented."
176 "ACKing something not considered");
220 "Not in OPEN state to respond to a loss");
222 "Dupack different than 0 but no loss detected");
227 "Dupack count differs");
233 "Not in OPEN state for processing dupack");
239 "Not in DISORDER state after receiving dupacks");
244 "Not in RECOVERY state after reaching retxthresh");
251 "Receiver not in OPEN state");
268 "Count of dupAck differs");
273 "DupAck less than ReTxThreshold but not "
274 "in DISORDER state");
279 "DupAck greater than ReTxThreshold but not "
280 "in RECOVERY or LOSS state");
294 "Different state than OPEN in the receiver");
318 "Invalid OPEN to RECOVERY state change");
324 "DISORDER to RECOVERY state change but not reached "
325 "the ReTxThreshold");
339 "Packet dropped but sequence number differs");
346 "Packet was not dropped at all");
348 "Segment was not retransmitted at all");
350 "Not all data have been transmitted");
360 std::list<TypeId> types;
364 for (std::list<TypeId>::iterator it = types.begin (); it != types.end (); ++it)
void FinalChecks()
Performs the (eventual) final checks through test asserts.
SequenceNumber32 m_sndNextExpSeq
Smart pointer class similar to boost::intrusive_ptr.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
Normal state, no dubious events.
uint32_t GetDelAckCount(SocketWho who)
Get the number of delayed ack (if present)
uint32_t GetSegSize(SocketWho who)
Get the segment size of the node specified.
CWND was reduced, we are fast-retransmitting.
In all the respects it is "Open", but requires a bit more attention.
NUMERIC_TYPE GetValue() const
Extracts the numeric value of the sequence number.
virtual void RTOExpired(const Ptr< const TcpSocketState > tcb, SocketWho who)
Rto has expired.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
uint32_t GetSize(void) const
Returns the the size in bytes of the packet (including the zero-filled initial payload).
void PktDropped(const Ipv4Header &ipH, const TcpHeader &tcpH)
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
This test suite implements a Unit Test.
static TcpSocketState::TcpCongState_t GetCongStateFrom(Ptr< const TcpSocketState > tcb)
Convenience function to retrieve the ACK state from a TCB.
virtual Ptr< ErrorModel > CreateSenderErrorModel()
Create and return the error model to install in the sender node.
virtual void RcvAck(const Ptr< const TcpSocketState > tcb, const TcpHeader &h, SocketWho who)
Received ack.
uint32_t m_bytesRcvButNotAcked
virtual void Tx(const Ptr< const Packet > p, const TcpHeader &h, SocketWho who)
Packet transmitted down to IP layer.
static TypeId GetTypeId(void)
Get the type ID.
void AddTestCase(TestCase *testCase, enum TestDuration duration)
Add an individual child TestCase to this test suite.
virtual Ptr< ErrorModel > CreateReceiverErrorModel()
Create and return the error model to install in the receiver node.
AttributeValue implementation for Time.
uint32_t GetDupAckCount(SocketWho who)
Get the number of dupack received.
SequenceNumber32 m_previousAck
Test the fast retransmission.
#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.
Callback< R > MakeCallback(R(T::*memPtr)(void), OBJ objPtr)
TcpFastRetrTest(TypeId congControl, uint32_t seqToKill, const std::string &msg)
SequenceNumber32 m_rcvNextExpAck
virtual void ProcessedAck(const Ptr< const TcpSocketState > tcb, const TcpHeader &h, SocketWho who)
Processed ack.
ns3::TcpFastRetrTestSuite g_TcpFastRetrTestSuite
TcpCongState_t
Definition of the Congestion state machine.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
virtual Ptr< TcpSocketMsgBase > CreateSenderSocket(Ptr< Node > node)
Create and install the socket to install on the sender.
virtual Ptr< TcpSocketMsgBase > CreateSenderSocket(Ptr< Node > node)
Create and install the socket to install on the sender.
static TypeId GetTypeId(void)
Get the type ID.
uint32_t GetReTxThreshold(SocketWho who)
Get the retransmission threshold.
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
SocketWho
Used as parameter of methods, specifies on what node the caller is interested (e.g.
General infrastructure for TCP testing.
Ptr< TcpSeqErrorModel > m_errorModel
uint32_t m_dupAckReceived
Time Seconds(double value)
Construct a Time in the indicated unit.
virtual void Rx(const Ptr< const Packet > p, const TcpHeader &h, SocketWho who)
Packet received from IP layer.
virtual void CongStateTrace(const TcpSocketState::TcpCongState_t oldValue, const TcpSocketState::TcpCongState_t newValue)
State on Ack state machine changes.
#define NS_TEST_ASSERT_MSG_GT_OR_EQ(actual, limit, msg)
Test that an actual value is greater than or equal to a limit and report and abort if not...
a unique identifier for an interface.
SequenceNumber< uint32_t, int32_t > SequenceNumber32
32 bit Sequence number.