20 #include "ns3/error-model.h"
68 const std::string& desc);
71 void ConfigureProperties()
override;
72 void ConfigureEnvironment()
override;
73 void FinalChecks()
override;
84 uint32_t m_received{0};
85 uint32_t m_lastSegment{0};
92 const std::string& desc)
94 m_firstLoss(firstLoss),
95 m_secondLoss(secondLoss),
96 m_lastSegment(lastSegment)
101 "Second segment number should be greater than first");
125 TcpGeneralTest::ConfigureEnvironment();
139 TcpGeneralTest::ConfigureProperties();
148 std::list<uint32_t> errorList;
151 rem->SetList(errorList);
173 "Did not observe expected number of sent packets");
195 TestCase::EXTENSIVE);
201 TestCase::EXTENSIVE);
Check rollover of sequence number and how that affects loss recovery.
void FinalChecks() override
Performs the (eventual) final checks through test asserts.
TcpLargeTransferLossTest(uint32_t firstLoss, uint32_t secondLoss, uint32_t lastSegment, const std::string &desc)
Constructor.
void Rx(const Ptr< const Packet > p, const TcpHeader &h, SocketWho who) override
Packet received from IP layer.
uint32_t m_sent
Number of segments sent.
std::list< int > m_expectedStates
Expected TCP states.
void ConfigureEnvironment() override
Change the configuration of the environment.
uint32_t m_firstLoss
First segment loss.
void Tx(const Ptr< const Packet > p, const TcpHeader &h, SocketWho who) override
Packet transmitted down to IP layer.
uint32_t m_secondLoss
Second segment loss.
void CongStateTrace(const TcpSocketState::TcpCongState_t oldValue, const TcpSocketState::TcpCongState_t newValue) override
uint32_t m_received
Number of segments received.
uint32_t m_lastSegment
Last received segment.
void ConfigureProperties() override
Change the configuration of the socket properties.
Ptr< ErrorModel > CreateReceiverErrorModel() override
Create and return the error model to install in the receiver node.
Test various packet losses.
General infrastructure for TCP testing.
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.
void SetAppPktSize(uint32_t pktSize)
Set app packet size.
void SetAppPktInterval(Time pktInterval)
Interval between app-generated packet.
void SetTransmitStart(Time startTime)
Set the initial time at which the application sends the first data packet.
void SetSegmentSize(SocketWho who, uint32_t segmentSize)
Forcefully set the segment size.
TcpCongState_t
Definition of the Congestion state machine.
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
@ UNIT
This test suite implements a Unit Test.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#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.
#define NS_TEST_ASSERT_MSG_GT(actual, limit, msg)
Test that an actual value is greater than a limit and report and abort if not.
Time MicroSeconds(uint64_t value)
Construct a Time in the indicated unit.
Time Seconds(double value)
Construct a Time in the indicated unit.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
static TcpLossTestSuite g_tcpLossTest
static var for test initialization