public class OptimalMulticastDelayGenerator extends 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 implementation's 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)
Create new feedback delay generator based on estimates.
|
| Modifier and Type | Method and Description |
|---|---|
long |
generateDelay()
Generate a new delay value
|
double |
generateNewOptimalDelay()
Generate a new randomized delay value in the units of
maxBackoffT}. |
boolean |
shouldFeedbackImmediately()
Should feedback be immediately sent?
|
String |
toString() |
static double |
uniformRandom(double max)
Return uniform random value in the range 0 to max.
|
public OptimalMulticastDelayGenerator(double maxBackoffT,
double groupSize)
maxBackoffT - of the delay intervalgroupSize - estimatepublic long generateDelay()
generateDelay in interface FeedbackDelayGeneratorpublic boolean shouldFeedbackImmediately()
shouldFeedbackImmediately in interface FeedbackDelayGeneratorpublic double generateNewOptimalDelay()
maxBackoffT}.maxBackoffT.public static double uniformRandom(double max)
max - of the random rangeCopyright © 2014-2023 Real Logic Limited. All Rights Reserved.