mirror of
https://github.com/facebookincubator/mvfst.git
synced 2025-11-10 21:22:20 +03:00
T45316552 [quic][state] Initial Rtt measurement on Connection Migration
Summary: On Connection Migation use the time taken from pathchallenge frame to path response frame as initial rtt. Reviewed By: JunqiWang Differential Revision: D18388324 fbshipit-source-id: ede10484c240ca44a4eab544504461c052143bad
This commit is contained in:
committed by
Facebook Github Bot
parent
0fced3e95c
commit
b62c11b841
@@ -8,6 +8,7 @@
|
||||
|
||||
#include "SimpleFrameFunctions.h"
|
||||
|
||||
#include <quic/QuicConstants.h>
|
||||
#include <quic/state/QuicStateFunctions.h>
|
||||
#include <quic/state/QuicStreamFunctions.h>
|
||||
|
||||
@@ -82,6 +83,8 @@ void updateSimpleFrameOnPacketSent(
|
||||
conn.outstandingPathValidation =
|
||||
std::move(conn.pendingEvents.pathChallenge);
|
||||
conn.pendingEvents.schedulePathValidationTimeout = true;
|
||||
// Start the clock to measure Rtt
|
||||
conn.pathChallengeStartTime = Clock::now();
|
||||
break;
|
||||
default: {
|
||||
auto& frames = conn.pendingEvents.frames;
|
||||
@@ -200,6 +203,13 @@ bool updateSimpleFrameOnPacketReceived(
|
||||
conn.outstandingPathValidation = folly::none;
|
||||
conn.pendingEvents.schedulePathValidationTimeout = false;
|
||||
conn.writableBytesLimit = folly::none;
|
||||
|
||||
// stop the clock to measure init rtt
|
||||
std::chrono::microseconds sampleRtt =
|
||||
std::chrono::duration_cast<std::chrono::microseconds>(
|
||||
Clock::now() - conn.pathChallengeStartTime);
|
||||
updateRtt(conn, sampleRtt, 0us);
|
||||
|
||||
return false;
|
||||
}
|
||||
case QuicSimpleFrame::Type::NewConnectionIdFrame_E: {
|
||||
|
||||
Reference in New Issue
Block a user