A smoothing algorithm for round trip time (RTT) measurements is provided
to a network device to effectively deal with variations or other
potential anomalies that may occur in RTT measurements. The algorithm
involves: first determining what should be considered a very high or a
very small value for a RTT sample. If a new RTT sample is in an
acceptable range, then the network device performs a relatively basic
smoothing. If the new RTT sample is much higher than a current RTT value,
then the network device ignores the value of this RTT sample a few times.
If the network device still detects this large value after ignoring that
value for some time, then the network device factors this value into the
current RTT value using an additive increase. Similarly, if the value of
the new RTT sample is much lower than current RTT value, the network
device ignores the value of the new RTT sample a few times. If the
network device still sees this small/low value after ignoring that value
for sometime, then the network device factors this value into the current
RTT value using a multiplicative decrease. An effective RTT value
results, which can be used singly or in combination with other metrics to
load balance network traffic.