Add transport knob to turn off blackhole detection
Summary: Blackhole detection has quite a lot false positives, we want to have a way to run d6d without it.
MODIFY
quic/QuicConstants.h
quic/QuicConstants.h
@@ -115,6 +115,9 @@ constexpr uint64_t kDefaultQuicTransportKnobSpace = 0xfaceb001;
// Default knob id for transport knobs
constexpr uint64_t kDefaultQuicTransportKnobId = 1;
+// Default transport knob param id for disabling pmtu blackhole detection
+constexpr uint64_t kTransportKnobParamIdZeroBlackholeDetection = 0x8830;
+
enum class FrameType : uint64_t {
PADDING = 0x00,
PING = 0x01,

MODIFY
quic/d6d/QuicD6DStateFunctions.cpp
quic/d6d/QuicD6DStateFunctions.cpp
@@ -243,7 +243,7 @@ void detectPMTUBlackhole(
// less than base pmtu, then the loss is not caused by pmtu blackhole
if (d6d.state == D6DMachineState::DISABLED || packet.metadata.isD6DProbe ||
packet.metadata.encodedSize <= d6d.basePMTU ||
- conn.udpSendPacketLen <= d6d.basePMTU) {
+ conn.udpSendPacketLen <= d6d.basePMTU || d6d.noBlackholeDetection) {
return;
}

MODIFY
quic/server/QuicServerTransport.cpp
quic/server/QuicServerTransport.cpp
@@ -37,6 +37,7 @@ QuicServerTransport::QuicServerTransport(
// correctly.
// conn_->nextSequenceNum = folly::Random::secureRandom<PacketNum>();
setConnectionCallback(&cb);
+ registerAllTransportKnobParamHandlers();
}
QuicServerTransport::~QuicServerTransport() {
@@ -589,4 +590,17 @@ void QuicServerTransport::onTransportKnobs(Buf knobBlob) {
}
}
+void QuicServerTransport::registerAllTransportKnobParamHandlers() {
+ registerTransportKnobParamHandler(
+ kTransportKnobParamIdZeroBlackholeDetection,
+ [](QuicServerConnectionState* server_conn, uint64_t val) {
+ CHECK(server_conn);
+ if (static_cast<bool>(val)) {
+ server_conn->d6d.noBlackholeDetection = true;
+ LOG(INFO)
+ << "Knob param received, pmtu blackhole detection is turned off";
+ }
+ });
+}
+
} // namespace quic

MODIFY
quic/server/QuicServerTransport.h
quic/server/QuicServerTransport.h
@@ -150,6 +150,7 @@ class QuicServerTransport
void maybeIssueConnectionIds();
bool hasReadCipher() const;
void maybeStartD6DProbing();
+ void registerAllTransportKnobParamHandlers();
private:
RoutingCallback* routingCb_{nullptr};

MODIFY
quic/server/test/QuicServerTransportTest.cpp
quic/server/test/QuicServerTransportTest.cpp
@@ -4288,5 +4288,10 @@ TEST_F(QuicServerTransportTest, TestRegisterAndHandleTransportKnobParams) {
});
EXPECT_EQ(flag, 1);
}
+
+TEST_F(QuicServerTransportTest, TestRegisterPMTUZeroBlackholeDetection) {
+ server->handleKnobParams({{kTransportKnobParamIdZeroBlackholeDetection, 1}});
+ EXPECT_TRUE(server->getConn().d6d.noBlackholeDetection);
+}
} // namespace test
} // namespace quic

MODIFY
quic/state/StateData.h
quic/state/StateData.h
@@ -813,6 +813,9 @@ struct QuicConnectionStateBase : public folly::DelayedDestruction {
// Meta state
D6DMetaState meta;
+ // Turn off blackhole detection
+ bool noBlackholeDetection{false};
+
// D6D Machine State
D6DMachineState state{D6DMachineState::DISABLED};
};

Add transport knob to turn off blackhole detection

Summary: Blackhole detection has quite a lot false positives, we want to have a way to run d6d without it.

Reviewed By: mjoras

Differential Revision: D24584357

fbshipit-source-id: ab27655ec38d62fd6deffe41cb156de0c981cf6d