From f5c0605aab22303670187373df4e671abbcfa914 Mon Sep 17 00:00:00 2001 From: Tom Henderson Date: Wed, 30 May 2012 10:38:47 -0700 Subject: [PATCH] bug 1399: TCP not backing off retransmissions properly --- src/aodv/test/tcp-chain-test-0-0.pcap | Bin 40218 -> 36360 bytes src/aodv/test/tcp-chain-test-9-0.pcap | Bin 20784 -> 18354 bytes src/internet/model/rtt-estimator.cc | 28 +++++++++----------------- 3 files changed, 10 insertions(+), 18 deletions(-) diff --git a/src/aodv/test/tcp-chain-test-0-0.pcap b/src/aodv/test/tcp-chain-test-0-0.pcap index 3e74461a8522d1baf30a8b39b19c1661728abf8c..fdd863644b3a81d9786c7477fea4072c097f245e 100644 GIT binary patch delta 27 jcmbQWi>YG{(+0NA$vk~Zn>9Lvm?k$&aM--7+m8tVnu`kV delta 282 zcmeB}!!&Cb(+0Lq=AyGKli%yeZ`SAxVq*S&fn~BFmpD5U0|P_i6_&|{74n;Rb^9?* z%43<#)~O`Gz_e-=Gf<9$!Igo@fkAe%fSkzYd)-=K1y$V+0uRs?OvqfeiDL#M&;aI7 z&$&Q02?(I7kwZ3wx%@R3+yxKcae-VQ@Bv)|lA%UldBKJ%psJCF8#=k5jg{#KFWgYY RKfGW=8JJPLB0m{wC;+JzOsW6? diff --git a/src/aodv/test/tcp-chain-test-9-0.pcap b/src/aodv/test/tcp-chain-test-9-0.pcap index d214a163702a422ef6eb22bd120f35e297d7a3e4..174490484da8bdab1aedd0ded28f71a87cce6522 100644 GIT binary patch delta 30 mcmdn6h;dUth7FDU@e91M*B delta 310 zcmdng&$wX`64_HMue{jiT5(r>K$S`Oy2u?2G zlbC$YL1^*}cPVxzpcWQZZn%AU9NZxL1O!lxlY<(k$HZI*Q~`3t86fS*r@)VDx)98C z<_=DvIvZ(b7a=~l>FY%Kz@{spnl6tpeIHN-$aEetK9Cm$3Q&y~h8uqZs9>RrH~_nm BPF?^2 diff --git a/src/internet/model/rtt-estimator.cc b/src/internet/model/rtt-estimator.cc index bcf0f2b3e..d67012344 100644 --- a/src/internet/model/rtt-estimator.cc +++ b/src/internet/model/rtt-estimator.cc @@ -279,25 +279,17 @@ void RttMeanDeviation::Measurement (Time m) Time RttMeanDeviation::RetransmitTimeout () { NS_LOG_FUNCTION (this); - // If not enough samples, just return 2 times estimate - //if (nSamples < 2) return est * 2; - Time retval (Seconds (0)); - double var = m_variance.ToDouble (Time::S); - NS_LOG_DEBUG ("RetransmitTimeout: var " << var << " est " << m_currentEstimatedRtt.ToDouble (Time::S) << " multiplier " << m_multiplier); - if (var < (m_currentEstimatedRtt.ToDouble (Time::S) / 4.0) ) + NS_LOG_DEBUG ("RetransmitTimeout: var " << m_variance.GetSeconds () << " est " << m_currentEstimatedRtt.GetSeconds () << " multiplier " << m_multiplier); + // RTO = srtt + 4* rttvar + int64_t temp = m_currentEstimatedRtt.ToInteger (Time::MS) + 4 * m_variance.ToInteger (Time::MS); + if (temp < m_minRto.ToInteger (Time::MS)) { - for (uint16_t i = 0; i < 2* m_multiplier; i++) - { - retval += m_currentEstimatedRtt; - } - } - else - { - int64_t temp = m_currentEstimatedRtt.ToInteger (Time::S) + 4 * m_variance.ToInteger (Time::S); - retval = Time::FromInteger (temp, Time::S); - } - NS_LOG_DEBUG ("RetransmitTimeout: return " << (retval > m_minRto ? retval.GetSeconds () : m_minRto.GetSeconds ())); - return (retval > m_minRto ? retval : m_minRto); // return maximum + temp = m_minRto.ToInteger (Time::MS); + } + temp = temp * m_multiplier; // Apply backoff + Time retval = Time::FromInteger (temp, Time::MS); + NS_LOG_DEBUG ("RetransmitTimeout: return " << retval.GetSeconds ()); + return (retval); } Ptr RttMeanDeviation::Copy () const