Subject: [quicwg/base-drafts] The calc with rttvar. (#753)

From: scw00 <[email-masked]>
Date: Wed, 30 Aug 2017 13:52:19 +0000 (UTC)

Hello

It seems we use RFC6298. But RFC used the absolutely value with rttvar.

```
   (2.3) When a subsequent RTT measurement R' is made, a host MUST set

            RTTVAR <- (1 - beta) * RTTVAR + beta * |SRTT - R'|
            SRTT <- (1 - alpha) * SRTT + alpha * R'

```

```   
OnAckReceived(ack):
     largest_acked_packet = ack.largest_acked
     // If the largest acked is newly acked, update the RTT.
     if (sent_packets[ack.largest_acked]):
       latest_rtt = now - sent_packets[ack.largest_acked].time
       if (latest_rtt > ack.ack_delay):
         latest_rtt -= ack.delay
       UpdateRtt(latest_rtt)
     // Find all newly acked packets.
     for acked_packet in DetermineNewlyAckedPackets():
       OnPacketAcked(acked_packet.packet_number)

     DetectLostPackets(ack.largest_acked_packet)
     SetLossDetectionAlarm()

   UpdateRtt(latest_rtt):
     // Based on {{?RFC6298}}.
     if (smoothed_rtt == 0):
       smoothed_rtt = latest_rtt
       rttvar = latest_rtt / 2
     else:
       rttvar = 3/4 * rttvar + 1/4 * (smoothed_rtt - latest_rtt)
       smoothed_rtt = 7/8 * smoothed_rtt + 1/8 * latest_rtt

```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/quicwg/base-drafts/issues/753

---

From: Martin Thomson <[email-masked]>
Date: Wed, 30 Aug 2017 18:29:57 -0700

This seems like a simple error that @ianswett should be able to confirm.  (Tip: I would use `abs(x)` rather than `|x|`; it's more verbose and intent is clearer.)

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/quicwg/base-drafts/issues/753#issuecomment-326163508