public class RTOEstimator
extends java.lang.Object
Note that the time units are the simulator clock ticks, instead of actual time units, such as seconds.
The sending time of a segment is recorded as Segment.timestamp
in the TCP header (similar to the timestamp option in
the Options field of an actual TCP header)
and returned by the corresponding acknowledgment packet.
Segment.timestamp
is set to -1
if the segment is
a retransmitted segment, and no RTT estimation is performed
for retransmitted segments.
SampleRTT = current_time - timestamp; EstimatedRTT[new] = (1 - alpha)*EstimatedRTT[old] + alpha*SampleRTT; Delta = |SampleRTT - EstimatedRTT[old]|; DeviationRTT[new] = (1 - beta)*DeviationRTT[old] + beta*Delta;The above should be computed using alpha=1/8 and beta=1/4.
SampleRTT = current_time - timestamp; EstimatedRTT[new] = SampleRTT; DeviationRTT[new] = SampleRTT/2;The retransmission timer base is always computed as:
TimeoutInterval[new] = EstimatedRTT[new] + max{ G, K*DeviationRTT[new] }.where G is the system clock granularity (in seconds), and K is usually set to
4
.Modifier and Type | Field and Description |
---|---|
(package private) static int |
alphaShift
Binary exponent of "alpha" weight for updating of
the estimated RTT
estimatedRTT . |
protected int |
backoff
Current RTO timer backoff value (unitless number).
|
(package private) static int |
betaShift
Binary exponent of "beta" weight for updating of
the RTT deviation
devRTT . |
protected int |
deviationRTT_init
Initial value of RTT deviation (in simulator clock ticks)
(multiplied by "beta"
betaShift ) |
protected int |
devRTT
Current estimated RTT deviation (shifted by
betaShift ) |
protected int |
estimatedRTT
Current estimated RTT value (in simulator clock ticks)
(shifted by alphaShift ) |
protected int |
estimatedRTT_init
Initial value of estimated RTT (in simulator clock ticks)
(multiplied by "alpha"
alphaShift ) |
protected double |
maxTimeoutInterval
Maximum value of a RTO timeout (in seconds).
|
(package private) static int |
stdDevMultShift
Binary exponent of deviation multiple used for
computing
timeoutInterval . |
protected double |
tickDuration
Simulator clock tick duration (in seconds) for all the RTT variables.
|
protected double |
timeoutInterval
Current RTO timer value (in simulator clock ticks).
|
protected double |
timeoutInterval_init
Initial value of base RTO timer (in simulator clock ticks).
|
Constructor and Description |
---|
RTOEstimator(double tick_)
Default constructor calls the other constructor
with the initial values of the input parameters:
estimatedRTT_init , deviationRTT_init ,
timeoutInterval_init , and maxTimeoutInterval ,all given in real time units (seconds) for user convenience. |
RTOEstimator(double tick_,
double estimRTT_init_,
double deviatRTT_init_,
double baseRTT_init_,
double maxRTO_)
The constructor initializes the variables for
the retransmit timer.
Note: The input parameters are given in real time units (seconds) for user convenience, and are converted in the constructor to the simulator clock ticks. |
Modifier and Type | Method and Description |
---|---|
protected double |
getTimeoutInterval()
Returns the RTO timeout value (in simulator clock ticks)
by multiplying the base value and the current backoff value. |
protected void |
timerBackoff()
Backs off the RXT timer backoff, as specified in [RFC-6298].
|
protected void |
updateRTT(double currentTime_,
double timestamp_)
Updates RTT estimations and recalculates Retransmission timer (RTO) base.
|
static final int alphaShift
estimatedRTT
.
That is, 2^3 = 8 = 1/alpha.protected transient int backoff
static final int betaShift
devRTT
.
That is, 2^2 = 4 = 1/beta.protected int deviationRTT_init
betaShift
)protected transient int devRTT
betaShift
)protected transient int estimatedRTT
alphaShift
)protected int estimatedRTT_init
alphaShift
)protected double maxTimeoutInterval
RTOEstimator(double,double,double,double,double)
.static final int stdDevMultShift
timeoutInterval
.
This is the K
multiplier, usually set as
K = 4 = 2^2
.protected double tickDuration
Receiver.delayedACKtimer
, etc.,
are decremented by 1 every timer the fast or slow timer expires.
Only Receiver.delayedACKtimer
is expressed in terms of the fast
timer ticks, and all other TCP timers are expressed in terms of the
slow timer ticks. Unfortunately, because of coarse granularity of our time simulation,
currently we do not implement these timers.
A good discussion of TCP timers is available in
Tweaking TCP's Timers.protected transient double timeoutInterval
protected double timeoutInterval_init
public RTOEstimator(double tick_)
estimatedRTT_init
, deviationRTT_init
,
timeoutInterval_init
, and maxTimeoutInterval
,tick_
- time unit for RTT variables.public RTOEstimator(double tick_, double estimRTT_init_, double deviatRTT_init_, double baseRTT_init_, double maxRTO_)
tick_
- time unit for RTT variables.estimRTT_init_
- initial value of estimated RTT.deviatRTT_init_
- initial value of RTT deviation.baseRTT_init_
- initial value of TimeoutInterval.maxRTO_
- the maximum value of retransmission timeout.protected double getTimeoutInterval()
protected void timerBackoff()
protected void updateRTT(double currentTime_, double timestamp_)
timestamp_
in header (carried as part of
the Options field in a real TCP/IP header).
The timestamp_
equal -1
signifies a
retransmitted segment, so no RTT estimation updating is done for
such a segment.
The algorithm is:
EstimatedRTT[new] = 7/8×EstimatedRTT[old] + 1/8×SampleRTT; Delta = |SampleRTT - EstimatedRTT[old]|; DeviationRTT[new] = 3/4×DeviationRTT[old] + 1/4×Delta;When the first RTT measurement is made, the host must set:
EstimatedRTT[new] = SampleRTT; DeviationRTT[new] = SampleRTT/2;The retransmission timer base is always:
TimeoutInterval[new] = EstimatedRTT[new] + 4×DeviationRTT[new].
currentTime_
- the current reference time.timestamp_
- the time when this acknowledged segment was originally sent.