13#include "ns3/rtt-estimator.h"
48 bool isRetransmission,
123 "rtt is 0 (and should be different from zero)");
127 "Default Estimate for the RTT");
143 bool isRetransmission,
159 "Incorrectly flagging seq as retransmission");
201 std::vector<uint32_t> toDrop);
213 std::vector<uint32_t> toDrop)
244 TestCase::Duration::QUICK);
246 TestCase::Duration::QUICK);
248 TestCase::Duration::QUICK);
250 TestCase::Duration::QUICK);
252 std::vector<uint32_t> toDrop;
253 toDrop.push_back(501);
256 " some data, with retr",
260 TestCase::Duration::QUICK);
262 " some data, with retr",
266 TestCase::Duration::QUICK);
268 toDrop.push_back(501);
270 " some data, with retr",
274 TestCase::Duration::QUICK);
276 " some data, with retr",
280 TestCase::Duration::QUICK);
282 toDrop.push_back(54001);
283 toDrop.push_back(58001);
284 toDrop.push_back(58501);
285 toDrop.push_back(60001);
286 toDrop.push_back(68501);
288 " a lot of data, with retr",
292 TestCase::Duration::QUICK);
294 " a lot of data, with retr",
298 TestCase::Duration::QUICK);
TcpRttEstimationTest(const std::string &desc, bool enableTs, uint32_t pktCount)
Constructor.
bool m_enableTs
Enable TimeStamp option.
SequenceNumber32 m_highestTxSeq
Highest sequence number sent.
void ConfigureEnvironment() override
Change the configuration of the environment.
uint32_t m_pktCount
Packet counter.
void UpdatedRttHistory(const SequenceNumber32 &seq, uint32_t sz, bool isRetransmission, SocketWho who) override
Updated the Rtt history.
bool m_rttChanged
True if RTT has changed.
Ptr< TcpSocketMsgBase > CreateSenderSocket(Ptr< Node > node) override
Create and install the socket to install on the sender.
void Rx(const Ptr< const Packet > p, const TcpHeader &h, SocketWho who) override
Packet received from IP layer.
void FinalChecks() override
Performs the (eventual) final checks through test asserts.
void RttTrace(Time oldTime, Time newTime) override
Rtt changes.
void Tx(const Ptr< const Packet > p, const TcpHeader &h, SocketWho who) override
Packet transmitted down to IP layer.
Ptr< TcpSocketMsgBase > CreateReceiverSocket(Ptr< Node > node) override
Create and install the socket to install on the receiver.
uint32_t m_dataCount
Data counter.
TCP RTT estimation TestSuite.
TcpRttEstimationTestSuite()
Check Rtt calculations with packet losses.
Ptr< ErrorModel > CreateReceiverErrorModel() override
Create and return the error model to install in the receiver node.
TcpRttEstimationWithLossTest(const std::string &desc, bool enableTs, uint32_t pktCount, std::vector< uint32_t > toDrop)
Constructor.
std::vector< uint32_t > m_toDrop
Packets to drop.
Smart pointer class similar to boost::intrusive_ptr.
General infrastructure for TCP testing.
Ptr< RttEstimator > GetRttEstimator(SocketWho who)
Get the Rtt estimator of the socket.
virtual Ptr< TcpSocketMsgBase > CreateSenderSocket(Ptr< Node > node)
Create and install the socket to install on the sender.
void SetPropagationDelay(Time propDelay)
Propagation delay of the bottleneck link.
void SetAppPktCount(uint32_t pktCount)
Set app packet count.
SocketWho
Used as parameter of methods, specifies on what node the caller is interested (e.g.
virtual Ptr< TcpSocketMsgBase > CreateReceiverSocket(Ptr< Node > node)
Create and install the socket to install on the receiver.
void SetMTU(uint32_t mtu)
MTU of the bottleneck link.
virtual void ConfigureEnvironment()
Change the configuration of the environment.
void SetTransmitStart(Time startTime)
Set the initial time at which the application sends the first data packet.
void AddTestCase(TestCase *testCase, Duration duration=Duration::QUICK)
Add an individual child TestCase to this test suite.
static constexpr auto UNIT
Simulation virtual time values and global simulation resolution.
double GetSeconds() const
Get an approximation of the time stored in this instance in the indicated unit.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Ptr< T > CreateObject(Args &&... args)
Create an object by type, with varying number of constructor parameters.
SequenceNumber< uint32_t, int32_t > SequenceNumber32
32 bit Sequence number.
#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.
#define NS_TEST_ASSERT_MSG_NE(actual, limit, msg)
Test that an actual and expected (limit) value are not equal and report and abort if not.
Time Seconds(double value)
Construct a Time in the indicated unit.
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
static TcpRttEstimationTestSuite g_tcpRttEstimationTestSuite
Static variable for test initialization.