Regression test for Issue 1012. More...
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. | |
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.
| TcpDctcpLossSsThreshTest::TcpDctcpLossSsThreshTest | ( | uint32_t | cWnd, |
| uint32_t | segmentSize, | ||
| uint32_t | bytesInFlight, | ||
| const std::string & | name ) |
Constructor.
| cWnd | Congestion window (bytes) at the time of the loss event. |
| segmentSize | Segment size in bytes. |
| bytesInFlight | Bytes in flight reported to GetSsThresh. |
| name | Name 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.
|
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.
|
private |
Bytes in flight passed to GetSsThresh.
Definition at line 59 of file tcp-dctcp-loss-test-suite.cc.
Referenced by TcpDctcpLossSsThreshTest(), and DoRun().
|
private |
Congestion window at loss time.
Definition at line 57 of file tcp-dctcp-loss-test-suite.cc.
Referenced by TcpDctcpLossSsThreshTest(), and DoRun().
|
private |
Segment size.
Definition at line 58 of file tcp-dctcp-loss-test-suite.cc.
Referenced by TcpDctcpLossSsThreshTest(), and DoRun().