diff --git a/src/internet/model/tcp-ledbat.cc b/src/internet/model/tcp-ledbat.cc index 1c9377121..69d51128a 100644 --- a/src/internet/model/tcp-ledbat.cc +++ b/src/internet/model/tcp-ledbat.cc @@ -61,7 +61,7 @@ TcpLedbat::GetTypeId (void) MakeEnumAccessor (&TcpLedbat::SetDoSs), MakeEnumChecker (DO_SLOWSTART, "yes", DO_NOT_SLOWSTART, "no")) - .AddAttribute ("MIN_CWND", + .AddAttribute ("MinCwnd", "Minimum cWnd for Ledbat", UintegerValue (2), MakeUintegerAccessor (&TcpLedbat::m_minCwnd), diff --git a/src/internet/test/tcp-ledbat-test.cc b/src/internet/test/tcp-ledbat-test.cc index e7978b214..7ba59404f 100644 --- a/src/internet/test/tcp-ledbat-test.cc +++ b/src/internet/test/tcp-ledbat-test.cc @@ -278,6 +278,7 @@ TcpLedbatDecrementTest::DoRun () void TcpLedbatDecrementTest::ExecuteTest () { + UintegerValue minCwnd; m_state = CreateObject (); m_state->m_cWnd = m_cWnd; m_state->m_ssThresh = m_ssThresh; @@ -288,6 +289,7 @@ TcpLedbatDecrementTest::ExecuteTest () Ptr cong = CreateObject (); cong->SetAttribute ("SSParam", StringValue ("no")); cong->SetAttribute ("NoiseFilterLen", UintegerValue (1)); + cong->GetAttribute ("MinCwnd", minCwnd); m_state->m_rcvTimestampValue = 2; m_state->m_rcvTimestampEchoReply = 1; @@ -300,6 +302,7 @@ TcpLedbatDecrementTest::ExecuteTest () cong->IncreaseWindow (m_state, m_segmentsAcked); m_cWnd = m_cWnd - ((0.98 * m_segmentsAcked * m_segmentSize * m_segmentSize) / m_cWnd); + m_cWnd = std::max (m_cWnd, static_cast (m_segmentSize * minCwnd.Get ())); NS_TEST_ASSERT_MSG_EQ (m_state->m_cWnd.Get (), m_cWnd, "cWnd has not updated correctly");