Commit c589c129 authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Revert "Switch to TCP conventions for the RTT decay factor"

This reverts commit bf8555b2.
parent f514cadd
......@@ -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 0 and 255, inclusive.
Lower values discard old samples faster. The default is
.BR 214 .
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 .
.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) : 214;
IF_CONF(ifp, rtt_exponential_decay) : 42;
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 = ((256 - ifp->rtt_exponential_decay) * rtt
+ ifp->rtt_exponential_decay * neigh->rtt);
smoothed_rtt = (ifp->rtt_exponential_decay * rtt
+ (256 - 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