We use different methods and mediums for sending and receiving data in our daily life, like
There are three ways to calculate RTT:
Estimated RTT
Deviation in RTT
Time-out Interval
In computer communication networking, the 1.1ms
, the second packet takes 1.3ms
, and the third packet takes 0.98ms
so, each sample RTT varies. That is why estimated RTT is used, as it is the average of recent measurements, not just the current sample RTT.
Estimated RTT = (1- α) * Estimated RTT + α * Sample RTT
Where typically, the value of α = 0.125
.
For example, the sample RTT is 100ms
, we have to compute the estimated RTT using α = 0.125
, and we assume the value of the estimated RTT just before the sample RTT was 110ms
. So, by using the formula, we get:
Estimated RTT = (1-0.125) * 110ms + (0.125) * 100ms
Estimated RTT = (0.875) * 110ms + 12.5ms
Estimated RTT = 96.25ms + 12.5ms = 108.75ms
Hence, the required estimated RTT is 108.75ms
.
Deviation in RTT, also known as Dev-RTT is a measure that indicates how evenly the RTT is distributed during the measurement. It depends upon the previous estimated RTT and helps to find the retransmission time-out.
DevRTT = (1- β) * DevRTT + β * |Sample RTT - Estimated RTT|
Where typically, the value of β = 0.125.
For example, the sample RTT is 100ms
, we have to compute the DevRTT, and we assume the value of the estimated RTT is 108.75ms
and the previous DevRTT was 20ms
. So, by using the formula, we get:
Dev RTT = (1-0.125) * 20ms + (0.125) * |100ms - 108.75ms|
Dev RTT = (0.875) * 20ms + (0.125) * 8.75ms
Dev RTT = 17.5ms + 1.09ms = 18.59ms
Hence, the required DevRTT is 18.59ms
Time-out is longer than RTT, but as RTT varies, we need to add some margin i.e., safety margin, to it. The selection of a time-out value is essential because the longer the value of estimated RTT, the slower its performance. We will be facing long delays in this case. Similarly, in the case of a minimal value, the connection can be lost before the RTT completes or before the arrival of the response or acknowledgment. So for the safety, we use:
Time-out Interval = 4 * DevRTT + Estimated RTT
Where the DevRTT value is used for a safety margin.
So, using the above-computed values of DevRTT = 18.59ms
and Estimated RTT = 108.75ms
, we compute the time-out interval as:
Time-out Interval = 4 * 18.59ms + 108.75ms
Time-out Interval = 74.36ms + 108.75ms = 183.11ms
Hence, the required time-out interval is 183.11ms
.
We can see that the time-out interval is dependent on both DevRTT and estimated RTT. Also, DevRTT is dependent on estimated RTT. So, if we need to find DevRTT, we have to compute the estimated RTT first. To compute the time-out interval, we have to find both DevRTT and estimated RTT first.