public class OptimalMulticastDelayGenerator extends java.lang.Object implements FeedbackDelayGenerator
maxBackoffT is max interval for delay
C version:
<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)));
}
</code>
where UniformRand(x) is uniform distribution from 0..max
In this implementations calculation:
- the 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:
- K = 4 for situations where responses come from multiple places (i.e. for NAKs, multiple retransmitters)
- K = 6 for situations where responses come from single places (i.e. for NAKs, source only retransmit)
| 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, waitshouldFeedbackImmediatelypublic 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 FeedbackDelayGeneratorpublic double generateNewOptimalDelay()
gRtt.public double calculatedN()
public static double uniformRandom(double max)
max - of the random rangeCopyright © 2014 - 2016 Real Logic Ltd. All Rights Reserved.