From 9155fc6a39e164693e35f6e3cd022e329dfd5124 Mon Sep 17 00:00:00 2001 From: Brian Swenson Date: Mon, 5 Nov 2012 14:07:02 -0500 Subject: [PATCH] bug 1509 RTTEstimator invalid values fix --- RELEASE_NOTES | 1 + src/internet/model/tcp-socket-base.cc | 11 ++++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/RELEASE_NOTES b/RELEASE_NOTES index 3ae80338e..095f527ab 100644 --- a/RELEASE_NOTES +++ b/RELEASE_NOTES @@ -35,6 +35,7 @@ Bugs fixed - bug 1493 - test.py --list should show the test type default tip - bug 1494 - test.py --constrain doesn't work - bug 1495 - test.py claims test passed when no test was run + - bug 1509 - rttEstimator returns invalid value in presence of errors Known issues ------------ diff --git a/src/internet/model/tcp-socket-base.cc b/src/internet/model/tcp-socket-base.cc index 6ceb60d2a..33afa7895 100644 --- a/src/internet/model/tcp-socket-base.cc +++ b/src/internet/model/tcp-socket-base.cc @@ -1982,7 +1982,16 @@ TcpSocketBase::EstimateRtt (const TcpHeader& tcpHeader) // Use m_rtt for the estimation. Note, RTT of duplicated acknowledgement // (which should be ignored) is handled by m_rtt. Once timestamp option // is implemented, this function would be more elaborated. - m_lastRtt = m_rtt->AckSeq (tcpHeader.GetAckNumber () ); + Time nextRtt = m_rtt->AckSeq (tcpHeader.GetAckNumber () ); + + //nextRtt will be zero for dup acks. Don't want to update lastRtt in that case + //but still needed to do list clearing that is done in AckSeq. + if(nextRtt != 0) + { + m_lastRtt = nextRtt; + NS_LOG_FUNCTION(this << m_lastRtt); + } + } // Called by the ReceivedAck() when new ACK received and by ProcessSynRcvd()