[e2e] An alternative algorithm of calculating RTO

jaglee at peoplemail.com.cn jaglee at peoplemail.com.cn
Sun Jun 2 03:39:39 PDT 2002


The algorithm in a nutshell:
(1) Calculate mean measured round-trip time and measured round-trip time variation: Suppose mrtt[0], mrtt[1], ...,  mrtt[N-1] are the measured round trip time of the N most recently acknowledged packets without re-sending,

let mmrtt <- (mrtt[0] + mrtt[1] + ... + mrtt[N-1]) / N;
and 
mrttvar <-  (abs(mrtt[0] - mmrtt) + abs(mrtt[1] - mmrtt) + ... + abs(mrtt[N-1) - mmrtt) / N;

Maximum value of N can be aribitually chosen. It should not be less than 8 nor  greater than 32.

(2) Calculate calibrating factors:
 if (abs(mmrtt[i] - mmrtt)) < gama1 * mrttvar)
      cf[i] <- CF1;
else if(abs(mmrtt[i] - mmrtt)) < gama2 * mrttvar)
      cf[i] <- CF2;
else
     c[i] <- 0;

where i = 0, 1, ..., N-1; gama1 = 1, gama2 = 3, CF1 = 4 and CF2 = 1.

(3) Calculate calibrated mean round-trip time and calibrated round-trip time variation: cmrtt <- (c[0]*mmrtt[0] + c[1] * mmrtt[1] + ... + c[N-1]*mmrtt[N-1]) / (c[0] + c[1] + ... + c[N-1]); crttvar <- (c[0] * (mrtt[0] - mmrtt) + c[1] * (mrtt[1] - mmrtt) + ... + c[N-1] * (mrtt[N-1] - mmrtt));

(4)  Similar to RFC2988:
(4-1) RTO <- 3 seconds, if no round-trip time measurement has been made;
(4-2)  RTO <- cmrtt + max(G, K * crttvar);
(4-3) "Whenever RTO is computed, if it is less than 1 second then the RTO SHOULD be rounded up to 1 second."
(4-4) "A maximum value MAY be placed on RTO provided it is at least 60 seconds."

It can be argued that cmrtt and crttvar reflect the current network state more accurately than srtt and rttvar(in RFC2988). Not just calculation of RTO may take advantage of it.

If implemented all with integer operation and run on a modern high-frequency CPU with level-1 cache, the overhead of calculating cmrtt and crttvar my be trival.

------------------------------------------------------------------
ÈËÃñÍø¡¶Õþ²ßÐÅÏ¢¡·ÍøÉÏÊÕ·ÑÔÓÖ¾
»¶Ó­Ôì·Ã£ºhttp://zcxx.people.com.cn




More information about the end2end-interest mailing list