Commit bf8555b2 authored by Baptiste Jonglez's avatar Baptiste Jonglez Committed by Juliusz Chroboczek

Switch to TCP conventions for the RTT decay factor

parent fe538cc4
......@@ -342,9 +342,9 @@ otherwise.
.TP
.BI rtt\-exponential\-decay " decay"
This specifies the decay factor for the exponential moving average of
RTT samples, in units of 1/256. Must be between 1 and 256, inclusive.
Higher values discard old samples faster. The default is
.BR 42 .
RTT samples, in units of 1/256. Must be between 0 and 255, inclusive.
Lower values discard old samples faster. The default is
.BR 214 .
.TP
.BI rtt\-min " rtt"
This specifies the minimum RTT, in milliseconds, starting from which
......
......@@ -307,7 +307,7 @@ interface_up(struct interface *ifp, int up)
ifp->rtt_exponential_decay =
IF_CONF(ifp, rtt_exponential_decay) > 0 ?
IF_CONF(ifp, rtt_exponential_decay) : 42;
IF_CONF(ifp, rtt_exponential_decay) : 214;
ifp->rtt_min =
IF_CONF(ifp, rtt_min) > 0 ?
......
......@@ -618,8 +618,8 @@ parse_packet(const unsigned char *from, struct interface *ifp,
old_rttcost = neighbour_rttcost(neigh);
if (valid_rtt(neigh)) {
/* Running exponential average. */
smoothed_rtt = (ifp->rtt_exponential_decay * rtt
+ (256 - ifp->rtt_exponential_decay) * neigh->rtt);
smoothed_rtt = ((256 - ifp->rtt_exponential_decay) * rtt
+ ifp->rtt_exponential_decay * neigh->rtt);
/* Rounding (up or down) to get closer to the sample. */
neigh->rtt = (neigh->rtt >= rtt) ? smoothed_rtt / 256 :
(smoothed_rtt + 255) / 256;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment