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

Regression test for Issue 1012. More...

Inheritance diagram for TcpDctcpLossSsThreshTest:
Collaboration diagram for TcpDctcpLossSsThreshTest:

Public Member Functions

 TcpDctcpLossSsThreshTest (uint32_t cWnd, uint32_t segmentSize, uint32_t bytesInFlight, 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 passed to GetSsThresh.
uint32_t m_cWnd
 Congestion window at loss time.
uint32_t m_segmentSize
 Segment size.

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

Regression test for Issue 1012.

Issue 1012: "DcTcp behaves incorrectly with non-ECN routers".

RFC 8257 Section 3.5 ("Handling of Packet Loss") mandates that a DCTCP sender MUST react to a loss episode (loss inferred, not signalled by ECN) in the same way a conventional TCP would, i.e. it MUST reduce cwnd and ssthresh as RFC 5681 does (roughly halving them based on BytesInFlight).

Without ECN-marking routers, m_alpha decays toward 0 (because m_ackedBytesEcn stays 0), so the alpha-based reduction alone would leave ssthresh at approximately m_cWnd on a packet loss.

This test exercises GetSsThresh directly on a crafted TcpSocketState with alpha == 0 (the non-ECN steady state) and asserts the RFC 5681 behaviour.

Definition at line 38 of file tcp-dctcp-loss-test-suite.cc.

Constructor & Destructor Documentation

◆ TcpDctcpLossSsThreshTest()

TcpDctcpLossSsThreshTest::TcpDctcpLossSsThreshTest ( uint32_t cWnd,
uint32_t segmentSize,
uint32_t bytesInFlight,
const std::string & name )

Constructor.

Parameters
cWndCongestion window (bytes) at the time of the loss event.
segmentSizeSegment size in bytes.
bytesInFlightBytes in flight reported to GetSsThresh.
nameName of the test.

Definition at line 62 of file tcp-dctcp-loss-test-suite.cc.

References ns3::TestCase::TestCase(), m_bytesInFlight, m_cWnd, m_segmentSize, and segmentSize.

Here is the call graph for this function:

Member Function Documentation

◆ DoRun()

void TcpDctcpLossSsThreshTest::DoRun ( )
overrideprivatevirtual

Implementation to actually run this TestCase.

Subclasses should override this method to conduct their tests.

Implements ns3::TestCase.

Definition at line 74 of file tcp-dctcp-loss-test-suite.cc.

References ns3::TcpSocketState::CA_LOSS, ns3::CreateObject(), m_bytesInFlight, m_cWnd, m_segmentSize, NS_LOG_INFO, and NS_TEST_ASSERT_MSG_EQ_TOL.

Here is the call graph for this function:

Member Data Documentation

◆ m_bytesInFlight

uint32_t TcpDctcpLossSsThreshTest::m_bytesInFlight
private

Bytes in flight passed to GetSsThresh.

Definition at line 59 of file tcp-dctcp-loss-test-suite.cc.

Referenced by TcpDctcpLossSsThreshTest(), and DoRun().

◆ m_cWnd

uint32_t TcpDctcpLossSsThreshTest::m_cWnd
private

Congestion window at loss time.

Definition at line 57 of file tcp-dctcp-loss-test-suite.cc.

Referenced by TcpDctcpLossSsThreshTest(), and DoRun().

◆ m_segmentSize

uint32_t TcpDctcpLossSsThreshTest::m_segmentSize
private

Segment size.

Definition at line 58 of file tcp-dctcp-loss-test-suite.cc.

Referenced by TcpDctcpLossSsThreshTest(), and DoRun().


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