1
0
mirror of https://github.com/facebookincubator/mvfst.git synced 2025-11-09 10:00:57 +03:00

Set ExperimentalCongestion As Default

Summary: - Set the experimental persistent congestion logic (D30117835 (2caf2ff49d)) as the default implementation.

Reviewed By: mjoras, lnicco

Differential Revision: D31347778

fbshipit-source-id: ab74359896f8f57cf4d8c3065de4c658f65b9769
This commit is contained in:
Hani Damlaj
2021-10-06 11:32:31 -07:00
committed by Facebook GitHub Bot
parent a7776d9d9e
commit a0d81894b5
6 changed files with 26 additions and 85 deletions

View File

@@ -19,11 +19,11 @@ std::chrono::microseconds calculatePTO(const QuicConnectionStateBase& conn) {
conn.lossState.maxAckDelay;
}
bool isPersistentCongestionExperimental(
bool isPersistentCongestion(
folly::Optional<std::chrono::microseconds> pto,
TimePoint lostPeriodStart,
TimePoint lostPeriodEnd,
const CongestionController::AckEvent& ack) {
const CongestionController::AckEvent& ack) noexcept {
if (!pto.has_value()) {
return false;
}
@@ -44,18 +44,6 @@ bool isPersistentCongestionExperimental(
return it == ack.ackedPackets.cend();
}
bool isPersistentCongestion(
const QuicConnectionStateBase& conn,
TimePoint lostPeriodStart,
TimePoint lostPeriodEnd) noexcept {
if (conn.lossState.srtt == 0us) {
return false;
}
auto pto = calculatePTO(conn);
return (lostPeriodEnd - lostPeriodStart) >=
pto * kPersistentCongestionThreshold;
}
void onPTOAlarm(QuicConnectionStateBase& conn) {
VLOG(10) << __func__ << " " << conn;
QUIC_STATS(conn.statsCallback, onPTO);

View File

@@ -39,15 +39,10 @@ std::chrono::microseconds calculatePTO(const QuicConnectionStateBase& conn);
*
*/
bool isPersistentCongestion(
const QuicConnectionStateBase& conn,
TimePoint lostPeriodStart,
TimePoint lostPeriodEnd) noexcept;
bool isPersistentCongestionExperimental(
folly::Optional<std::chrono::microseconds> pto,
TimePoint lostPeriodStart,
TimePoint lostPeriodEnd,
const CongestionController::AckEvent& ack);
const CongestionController::AckEvent& ack) noexcept;
inline std::ostream& operator<<(
std::ostream& os,
@@ -378,12 +373,6 @@ void onLossDetectionAlarm(
lossTimeAndSpace.second);
if (conn.congestionController && lossEvent) {
DCHECK(lossEvent->largestLostSentTime && lossEvent->smallestLostSentTime);
if (!conn.transportSettings.experimentalPersistentCongestion) {
lossEvent->persistentCongestion = isPersistentCongestion(
conn,
*lossEvent->smallestLostSentTime,
*lossEvent->largestLostSentTime);
}
conn.congestionController->onPacketAckOrLoss(
folly::none, std::move(lossEvent));
}

View File

@@ -1831,30 +1831,6 @@ TEST_P(QuicLossFunctionsTest, CappedShiftNoCrash) {
}
TEST_F(QuicLossFunctionsTest, PersistentCongestion) {
auto conn = createConn();
auto currentTime = Clock::now();
conn->lossState.srtt = 1s;
EXPECT_TRUE(isPersistentCongestion(*conn, currentTime - 10s, currentTime));
EXPECT_TRUE(isPersistentCongestion(*conn, currentTime - 3s, currentTime));
EXPECT_TRUE(isPersistentCongestion(
*conn, currentTime - (1s * kPersistentCongestionThreshold), currentTime));
EXPECT_FALSE(isPersistentCongestion(
*conn,
currentTime - (1s * kPersistentCongestionThreshold) + 1us,
currentTime));
EXPECT_FALSE(isPersistentCongestion(*conn, currentTime - 2s, currentTime));
EXPECT_FALSE(isPersistentCongestion(*conn, currentTime - 100ms, currentTime));
conn->lossState.rttvar = 2s;
conn->lossState.maxAckDelay = 5s;
EXPECT_TRUE(isPersistentCongestion(*conn, currentTime - 42s, currentTime));
EXPECT_TRUE(isPersistentCongestion(*conn, currentTime - 43s, currentTime));
EXPECT_FALSE(
isPersistentCongestion(*conn, currentTime - 42s + 1ms, currentTime));
EXPECT_FALSE(isPersistentCongestion(*conn, currentTime - 100us, currentTime));
}
TEST_F(QuicLossFunctionsTest, ExperimentalPersistentCongestion) {
// Test cases copied over from PersistentCongestion above.
auto conn = createConn();
auto currentTime = Clock::now();
@@ -1862,40 +1838,38 @@ TEST_F(QuicLossFunctionsTest, ExperimentalPersistentCongestion) {
CongestionController::AckEvent ack;
EXPECT_TRUE(isPersistentCongestionExperimental(
EXPECT_TRUE(isPersistentCongestion(
calculatePTO(*conn), currentTime - 10s, currentTime, ack));
EXPECT_TRUE(isPersistentCongestionExperimental(
EXPECT_TRUE(isPersistentCongestion(
calculatePTO(*conn), currentTime - 3s, currentTime, ack));
EXPECT_TRUE(isPersistentCongestionExperimental(
EXPECT_TRUE(isPersistentCongestion(
calculatePTO(*conn),
currentTime - (1s * kPersistentCongestionThreshold),
currentTime,
ack));
EXPECT_FALSE(isPersistentCongestionExperimental(
EXPECT_FALSE(isPersistentCongestion(
calculatePTO(*conn),
currentTime - (1s * kPersistentCongestionThreshold) + 1us,
currentTime,
ack));
EXPECT_FALSE(isPersistentCongestionExperimental(
EXPECT_FALSE(isPersistentCongestion(
calculatePTO(*conn), currentTime - 2s, currentTime, ack));
EXPECT_FALSE(isPersistentCongestionExperimental(
EXPECT_FALSE(isPersistentCongestion(
calculatePTO(*conn), currentTime - 100ms, currentTime, ack));
conn->lossState.rttvar = 2s;
conn->lossState.maxAckDelay = 5s;
EXPECT_TRUE(isPersistentCongestionExperimental(
EXPECT_TRUE(isPersistentCongestion(
calculatePTO(*conn), currentTime - 42s, currentTime, ack));
EXPECT_TRUE(isPersistentCongestionExperimental(
EXPECT_TRUE(isPersistentCongestion(
calculatePTO(*conn), currentTime - 43s, currentTime, ack));
EXPECT_FALSE(isPersistentCongestionExperimental(
EXPECT_FALSE(isPersistentCongestion(
calculatePTO(*conn), currentTime - 42s + 1ms, currentTime, ack));
EXPECT_FALSE(isPersistentCongestionExperimental(
EXPECT_FALSE(isPersistentCongestion(
calculatePTO(*conn), currentTime - 100us, currentTime, ack));
}
TEST_F(
QuicLossFunctionsTest,
ExperimentalPersistentCongestionAckOutsideWindow) {
TEST_F(QuicLossFunctionsTest, PersistentCongestionAckOutsideWindow) {
auto conn = createConn();
auto currentTime = Clock::now();
conn->lossState.srtt = 1s;
@@ -1907,11 +1881,11 @@ TEST_F(
.setSentTime(currentTime + 12s)
.build());
EXPECT_TRUE(isPersistentCongestionExperimental(
EXPECT_TRUE(isPersistentCongestion(
calculatePTO(*conn), currentTime + 1s, currentTime + 8s, ack));
}
TEST_F(QuicLossFunctionsTest, ExperimentalPersistentCongestionAckInsideWindow) {
TEST_F(QuicLossFunctionsTest, PersistentCongestionAckInsideWindow) {
auto conn = createConn();
auto currentTime = Clock::now();
conn->lossState.srtt = 1s;
@@ -1923,11 +1897,11 @@ TEST_F(QuicLossFunctionsTest, ExperimentalPersistentCongestionAckInsideWindow) {
.setSentTime(currentTime + 4s)
.build());
EXPECT_FALSE(isPersistentCongestionExperimental(
EXPECT_FALSE(isPersistentCongestion(
calculatePTO(*conn), currentTime + 1s, currentTime + 8s, ack));
}
TEST_F(QuicLossFunctionsTest, ExperimentalPersistentCongestionNoPTO) {
TEST_F(QuicLossFunctionsTest, PersistentCongestionNoPTO) {
auto conn = createConn();
auto currentTime = Clock::now();
@@ -1938,7 +1912,7 @@ TEST_F(QuicLossFunctionsTest, ExperimentalPersistentCongestionNoPTO) {
.setSentTime(currentTime + 12s)
.build());
EXPECT_FALSE(isPersistentCongestionExperimental(
EXPECT_FALSE(isPersistentCongestion(
folly::none, currentTime + 1s, currentTime + 8s, ack));
}

View File

@@ -90,9 +90,7 @@ void recoverOrResetCongestionAndRttState(
}
}
void setExperimentalSettings(QuicServerConnectionState& conn) {
conn.transportSettings.experimentalPersistentCongestion = true;
}
void setExperimentalSettings(QuicServerConnectionState& /*conn*/) {}
} // namespace
void processClientInitialParams(

View File

@@ -265,18 +265,12 @@ void processAckFrame(
// contiguous lost block and determine if that block is larger than the
// congestion period. Alternatively we could consider every lost block
// and check if any of them constitute persistent congestion.
lossEvent->persistentCongestion =
conn.transportSettings.experimentalPersistentCongestion
? isPersistentCongestionExperimental(
lossEvent->persistentCongestion = isPersistentCongestion(
conn.lossState.srtt == 0s ? folly::none
: folly::Optional(calculatePTO(conn)),
*lossEvent->smallestLostSentTime,
*lossEvent->largestLostSentTime,
ack)
: isPersistentCongestion(
conn,
*lossEvent->smallestLostSentTime,
*lossEvent->largestLostSentTime);
ack);
if (lossEvent->persistentCongestion) {
QUIC_STATS(conn.statsCallback, onPersistentCongestion);
}

View File

@@ -268,8 +268,6 @@ struct TransportSettings {
// Whether or not to opportunistically retransmit 0RTT when the handshake
// completes.
bool earlyRetransmit0Rtt{false};
// Experimental persistent congestion flag
bool experimentalPersistentCongestion{false};
// Whether to use JumpStarter as the CongestionControllerFactory
bool useJumpStart{false};
};