The RTO calculation was missing a factor 4 multiplication of the
RTT variance, which caused it to set the RTO to a much lower value than
specified by RFC 6298. This would result in more retranmissions and a
lower throughput.
if(!utcp->srtt) {
utcp->srtt = rtt;
utcp->rttvar = rtt / 2;
- utcp->rto = rtt + max(2 * rtt, CLOCK_GRANULARITY);
} else {
utcp->rttvar = (utcp->rttvar * 3 + absdiff(utcp->srtt, rtt)) / 4;
utcp->srtt = (utcp->srtt * 7 + rtt) / 8;
- utcp->rto = utcp->srtt + max(utcp->rttvar, CLOCK_GRANULARITY);
}
+ utcp->rto = utcp->srtt + max(4 * utcp->rttvar, CLOCK_GRANULARITY);
+
if(utcp->rto > MAX_RTO) {
utcp->rto = MAX_RTO;
}