public class OptimalMulticastDelayGenerator extends java.lang.Object implements FeedbackDelayGenerator
Generates delay based on Optimal Multicast Feedback
http://tools.ietf.org/html/rfc5401#page-13
maxBackoffT
is max interval for delay
C version of the code:
double RandomBackoff(double maxBackoffT, double groupSize)
{
double lambda = log(groupSize) + 1;
double x = UniformRand(lambda / maxBackoffT) + lambda / (maxBackoffT * (exp(lambda) - 1));
return ((maxBackoffT / lambda) * log(x * (exp(lambda) - 1) * (maxBackoffT / lambda)));
}
where UniformRand(x)
is uniform distribution from 0..max
In this implementations calculation:
groupSize
is a constant (could be configurable as system property)maxBackoffT
is a constant (could be configurable as system property)GRTT
is a constant (could be configurable as a system property)
N
(the expected number of feedback messages per RTT) is:
N = exp(1.2 * L / (2 * maxBackoffT / GRTT))
Assumptions:
maxBackoffT = K * GRTT (K >= 1)
Recommended K
:
Constructor and Description |
---|
OptimalMulticastDelayGenerator(double maxBackoffT,
double groupSize,
double gRtt)
Create new feedback delay generator based on estimates.
|
Modifier and Type | Method and Description |
---|---|
double |
calculatedN()
Return the estimated number of feedback messages per RTT.
|
long |
generateDelay()
Generate a new delay value
|
double |
generateNewOptimalDelay()
Generate a new randomized delay value in the units of backoff and
gRtt . |
static double |
uniformRandom(double max)
Return uniform random value in the range 0..max
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
shouldFeedbackImmediately
public OptimalMulticastDelayGenerator(double maxBackoffT, double groupSize, double gRtt)
maxBackoffT
and gRtt
must be expressed in the same units.
maxBackoffT
- of the delay intervalgroupSize
- estimategRtt
- estimatepublic long generateDelay()
generateDelay
in interface FeedbackDelayGenerator
public double generateNewOptimalDelay()
gRtt
.public double calculatedN()
public static double uniformRandom(double max)
max
- of the random rangeCopyright © 2014-2018 Real Logic Ltd. All Rights Reserved.