mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-16 08:40:11 +02:00
add some comments to help understand the RTT calculation
This commit is contained in:
parent
b6bdcadd33
commit
e3e8219c11
1 changed files with 10 additions and 1 deletions
|
@ -313,7 +313,16 @@ void Connection::processNAK(std::unique_ptr<ControlPacket> controlPacket) {
|
|||
}
|
||||
|
||||
void Connection::updateRTT(int rtt) {
|
||||
// this updates the RTT using exponential weighted moving average
|
||||
// This updates the RTT using exponential weighted moving average
|
||||
// This is the Jacobson's forumla for RTT estimation
|
||||
// http://www.mathcs.emory.edu/~cheung/Courses/455/Syllabus/7-transport/Jacobson-88.pdf
|
||||
|
||||
// Estimated RTT = (1 - x)(estimatedRTT) + (x)(sampleRTT)
|
||||
// (where x = 0.125 via Jacobson)
|
||||
|
||||
// Deviation = (1 - x)(deviation) + x |sampleRTT - estimatedRTT|
|
||||
// (where x = 0.25 via Jacobson)
|
||||
|
||||
_rttVariance = (_rttVariance * 3 + abs(rtt - _rtt)) >> 2;
|
||||
_rtt = (_rtt * 7 + rtt) >> 3;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue