8#include "ns3/simulator.h"
9#include "ns3/tcp-tx-buffer.h"
31 void DoRun()
override;
105 txBuf->SetSegmentSize(1000);
106 txBuf->SetDupAckThresh(3);
110 for (uint8_t
i = 0;
i < 10; ++
i)
115 for (uint8_t
i = 0;
i < 10; ++
i)
119 "Lost is true, but it's not");
125 for (uint8_t
i = 0;
i < 10; ++
i)
129 "Lost is true, but it's not");
135 for (uint8_t
i = 0;
i < 10; ++
i)
139 "Lost is true, but it's not");
147 for (uint8_t
i = 1;
i < 10; ++
i)
151 "Lost is true, but it's not");
159 return std::numeric_limits<uint32_t>::max();
171 txBuf->SetSegmentSize(150);
172 txBuf->SetDupAckThresh(3);
180 "NextSeq should not be returned at the beginning");
185 "NextSeq should not be returned with no data");
191 "No NextSeq with data at beginning");
194 "Different NextSeq than expected at the beginning");
201 "No NextSeq with data while \"transmitting\"");
204 "Different NextSeq than expected while \"transmitting\"");
221 "No NextSeq with SACK block while \"transmitting\"");
224 "Different NextSeq than expected in limited transmit");
226 sack->ClearSackList();
237 "No NextSeq with SACK block for Fast Recovery");
240 sack->ClearSackList();
251 "No NextSeq with SACK block after recv dupacks in FR");
254 "Different NextSeq than expected after recv dupacks in FR");
256 sack->ClearSackList();
276 "No NextSeq with SACK block after receiving partial ACK");
279 "Different NextSeq than expected after receiving partial ACK ");
289 "No NextSeq with SACK block after recv dupacks after partial ack");
292 "Different NextSeq than expected after recv dupacks after partial ack");
294 sack->ClearSackList();
305 "No NextSeq with data while \"transmitting\"");
308 "Different NextSeq than expected while \"transmitting\"");
323 txBuf->SetSegmentSize(100);
331 "TxBuf miscalculates size");
334 "TxBuf miscalculates size of in flight segments");
340 "TxBuf miscalculates size");
343 "TxBuf miscalculates size of in flight segments");
348 "TxBuf miscalculates size");
351 "TxBuf miscalculates size of in flight segments");
362 "TxBuf miscalculates size");
365 "TxBuf miscalculates size of in flight segments");
375 "TxBuf miscalculates size");
378 "TxBuf miscalculates size of in flight segments");
384 "TxBuf miscalculates size");
387 "TxBuf miscalculates size of in flight segments");
400 txBuf.SetSegmentSize(2000);
405 txBuf.MarkHeadAsLost();
void TestTransmittedBlock()
Test the generation of a previously sent block.
void TestMergeItemsWhenGetTransmittedSegment()
Test the logic of merging items in GetTransmittedSegment() which is triggered by CopyFromSequence()
void DoRun() override
Implementation to actually run this TestCase.
void TestNewBlock()
Test the generation of an unsent block.
uint32_t GetRWnd() const
Callback to provide a value of receiver window.
void TestIsLost()
Test if a segment is really set as lost.
void TestNextSeg()
Test the generation of the "next" block.
TcpTxBufferTestCase()
Constructor.
void DoTeardown() override
Implementation to do any local setup required for this TestCase.
the TestSuite for the TcpTxBuffer test case
Smart pointer class similar to boost::intrusive_ptr.
static EventId Schedule(const Time &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
static void Destroy()
Execute the events scheduled with ScheduleDestroy().
static void Run()
Run the simulation.
std::pair< SequenceNumber32, SequenceNumber32 > SackBlock
SACK block definition.
void AddTestCase(TestCase *testCase, Duration duration=Duration::QUICK)
Add an individual child TestCase to this test suite.
static constexpr auto UNIT
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Ptr< T > Create(Ts &&... args)
Create class instances by constructors with varying numbers of arguments and return them by Ptr.
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.
Time Seconds(double value)
Construct a Time in the indicated unit.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Callback< R, Args... > MakeCallback(R(T::*memPtr)(Args...), OBJ objPtr)
Build Callbacks for class method members which take varying numbers of arguments and potentially retu...
static TcpTxBufferTestSuite g_tcpTxBufferTestSuite
Static variable for test initialization.