A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
PrrRecoveryArithmeticTest Class Reference

PRR Recovery regression test for integer overflow and unsigned wrap. More...

Inheritance diagram for PrrRecoveryArithmeticTest:
Collaboration diagram for PrrRecoveryArithmeticTest:

Public Member Functions

 PrrRecoveryArithmeticTest (uint32_t segmentSize, uint32_t ssThresh, uint32_t bytesInFlight, uint32_t bytesSentInRecovery, uint32_t deliveredBytes, uint32_t expectedCWnd, const std::string &name)
 Constructor.
Public Member Functions inherited from ns3::TestCase
 TestCase (const TestCase &)=delete
 Caller graph was not generated because of its size.
virtual ~TestCase ()
 Destructor.
std::string GetName () const
TestCase & operator= (const TestCase &)=delete

Private Member Functions

void DoRun () override
 Implementation to actually run this TestCase.

Private Attributes

uint32_t m_bytesInFlight
 Bytes in flight at recovery entry.
uint32_t m_bytesSentInRecovery
 Bytes reported sent before the tested ACK.
uint32_t m_deliveredBytes
 Bytes delivered on the tested ACK.
uint32_t m_expectedCWnd
 Expected cwnd after the tested ACK.
uint32_t m_segmentSize
 Segment size.
uint32_t m_ssThresh
 Slow Start Threshold.

Additional Inherited Members

Public Types inherited from ns3::TestCase
enum class  Duration { QUICK = 1 , EXTENSIVE = 2 , TAKES_FOREVER = 3 }
 How long the test takes to execute. More...
Protected Member Functions inherited from ns3::TestCase
 TestCase (std::string name)
 Constructor.
void AddTestCase (TestCase *testCase, Duration duration=Duration::QUICK)
 Add an individual child TestCase to this test suite.
TestCase * GetParent () const
 Get the parent of this TestCase.
bool IsStatusFailure () const
 Check if any tests failed.
bool IsStatusSuccess () const
 Check if all tests passed.
void SetDataDir (std::string directory)
 Set the data directory where reference trace files can be found.
void ReportTestFailure (std::string cond, std::string actual, std::string limit, std::string message, std::string file, int32_t line)
 Log the failure of this TestCase.
bool MustAssertOnFailure () const
 Check if this run should assert on failure.
bool MustContinueOnFailure () const
 Check if this run should continue on failure.
std::string CreateDataDirFilename (std::string filename)
 Construct the full path to a file in the data directory.
std::string CreateTempDirFilename (std::string filename)
 Construct the full path to a file in a temporary directory.

Detailed Description

PRR Recovery regression test for integer overflow and unsigned wrap.

Regression tests for issue #1282. Calls TcpPrrRecovery::DoRecovery directly and checks the resulting cwnd * against a value computed with correct 64-bit / signed arithmetic. The two scenarios exercise the arithmetic defects fixed in tcp-prr-recovery.cc (MR !2807):

  • the proportional branch (inflight > ssThresh), where the product m_prrDelivered * m_ssThresh overflowed a 32-bit integer; and
  • the PRR-CRB branch (inflight <= ssThresh), where m_prrDelivered - m_prrOut wrapped when m_prrOut exceeded m_prrDelivered.

Definition at line 147 of file tcp-prr-recovery-test.cc.

Constructor & Destructor Documentation

◆ PrrRecoveryArithmeticTest()

PrrRecoveryArithmeticTest::PrrRecoveryArithmeticTest ( uint32_t segmentSize,
uint32_t ssThresh,
uint32_t bytesInFlight,
uint32_t bytesSentInRecovery,
uint32_t deliveredBytes,
uint32_t expectedCWnd,
const std::string & name )

Constructor.

Parameters
segmentSizeSegment size.
ssThreshSlow Start Threshold.
bytesInFlightBytes in flight at recovery entry (also the RecoverFS).
bytesSentInRecoveryBytes reported sent (via UpdateBytesSent) before the tested ACK.
deliveredBytesBytes delivered on the tested (non-dupack) acknowledgment.
expectedCWndExpected cwnd after the tested acknowledgment.
nameTest description.

Definition at line 179 of file tcp-prr-recovery-test.cc.

References ns3::TestCase::TestCase(), m_bytesInFlight, m_bytesSentInRecovery, m_deliveredBytes, m_expectedCWnd, m_segmentSize, m_ssThresh, and segmentSize.

Here is the call graph for this function:

Member Function Documentation

◆ DoRun()

void PrrRecoveryArithmeticTest::DoRun ( )
overrideprivatevirtual

Implementation to actually run this TestCase.

Subclasses should override this method to conduct their tests.

Implements ns3::TestCase.

Definition at line 197 of file tcp-prr-recovery-test.cc.

References ns3::CreateObject(), m_bytesInFlight, m_bytesSentInRecovery, m_deliveredBytes, m_expectedCWnd, m_segmentSize, m_ssThresh, and NS_TEST_ASSERT_MSG_EQ.

Here is the call graph for this function:

Member Data Documentation

◆ m_bytesInFlight

uint32_t PrrRecoveryArithmeticTest::m_bytesInFlight
private

Bytes in flight at recovery entry.

Definition at line 173 of file tcp-prr-recovery-test.cc.

Referenced by PrrRecoveryArithmeticTest(), and DoRun().

◆ m_bytesSentInRecovery

uint32_t PrrRecoveryArithmeticTest::m_bytesSentInRecovery
private

Bytes reported sent before the tested ACK.

Definition at line 174 of file tcp-prr-recovery-test.cc.

Referenced by PrrRecoveryArithmeticTest(), and DoRun().

◆ m_deliveredBytes

uint32_t PrrRecoveryArithmeticTest::m_deliveredBytes
private

Bytes delivered on the tested ACK.

Definition at line 175 of file tcp-prr-recovery-test.cc.

Referenced by PrrRecoveryArithmeticTest(), and DoRun().

◆ m_expectedCWnd

uint32_t PrrRecoveryArithmeticTest::m_expectedCWnd
private

Expected cwnd after the tested ACK.

Definition at line 176 of file tcp-prr-recovery-test.cc.

Referenced by PrrRecoveryArithmeticTest(), and DoRun().

◆ m_segmentSize

uint32_t PrrRecoveryArithmeticTest::m_segmentSize
private

Segment size.

Definition at line 171 of file tcp-prr-recovery-test.cc.

Referenced by PrrRecoveryArithmeticTest(), and DoRun().

◆ m_ssThresh

uint32_t PrrRecoveryArithmeticTest::m_ssThresh
private

Slow Start Threshold.

Definition at line 172 of file tcp-prr-recovery-test.cc.

Referenced by PrrRecoveryArithmeticTest(), and DoRun().


The documentation for this class was generated from the following file: