mirror of
https://github.com/facebookincubator/mvfst.git
synced 2025-11-24 04:01:07 +03:00
Cache Ack Rx timestamps transport settings in PSK cache for 0-rtt
Summary: Ack Rx timestamps are currently disabled on 0-rtt connections, which is enabled on mvfst for all non-video connections. This is because the timestamp config is negotiated with transport settings during handshake which doesn't happen on a new 0-rtt connection (resumption). Solution: Store the peer's rx timestamp config in PSKCache on the client. On 0-rtt resumption of the connection, this peer config is restored and used to send Rx timestamps (if enabled). Note that if the server had changed its timestamp config during this period (through configerator) then the server needs to reject this 0-rtt connection and start anew. Server code changes to support this will be in a followup diff. With this client diff though, server will drop the Rx timestamps if its own config is suddenly disabled (this is a waste of network resource). Reviewed By: jbeshay Differential Revision: D58572572 fbshipit-source-id: d95720c177ac4bc8dcbe40362f19b279b3f8e708
This commit is contained in:
committed by
Facebook GitHub Bot
parent
21b003b6a2
commit
17b8763bd0
@@ -33,6 +33,9 @@ constexpr auto initialMaxStreamDataUni = kDefaultStreamFlowControlWindow + 5;
|
||||
constexpr auto initialMaxStreamsBidi = kDefaultMaxStreamsBidirectional + 6;
|
||||
constexpr auto initialMaxStreamsUni = kDefaultMaxStreamsUnidirectional + 7;
|
||||
constexpr auto knobFrameSupport = true;
|
||||
constexpr auto ackReceiveTimestampsEnabled = true;
|
||||
constexpr auto maxReceiveTimestampsPerAck = 10;
|
||||
constexpr auto ackReceiveTimestampsExponent = 0;
|
||||
const CachedServerTransportParameters kParams{
|
||||
std::chrono::milliseconds(idleTimeout).count(),
|
||||
maxRecvPacketSize,
|
||||
@@ -42,7 +45,10 @@ const CachedServerTransportParameters kParams{
|
||||
initialMaxStreamDataUni,
|
||||
initialMaxStreamsBidi,
|
||||
initialMaxStreamsUni,
|
||||
knobFrameSupport};
|
||||
knobFrameSupport,
|
||||
ackReceiveTimestampsEnabled,
|
||||
maxReceiveTimestampsPerAck,
|
||||
ackReceiveTimestampsExponent};
|
||||
} // namespace
|
||||
|
||||
class ClientStateMachineTest : public Test {
|
||||
@@ -73,6 +79,8 @@ TEST_F(ClientStateMachineTest, TestUpdateTransportParamsNotIgnorePathMTU) {
|
||||
TEST_F(ClientStateMachineTest, TestUpdateTransportParamsFromCachedEarlyParams) {
|
||||
client_->transportSettings.canIgnorePathMTU = true;
|
||||
client_->peerAdvertisedKnobFrameSupport = false;
|
||||
client_->maybePeerAckReceiveTimestampsConfig.assign(
|
||||
{.maxReceiveTimestampsPerAck = 10, .receiveTimestampsExponent = 0});
|
||||
|
||||
updateTransportParamsFromCachedEarlyParams(*client_, kParams);
|
||||
EXPECT_EQ(client_->peerIdleTimeout, idleTimeout);
|
||||
@@ -88,6 +96,15 @@ TEST_F(ClientStateMachineTest, TestUpdateTransportParamsFromCachedEarlyParams) {
|
||||
client_->flowControlState.peerAdvertisedInitialMaxStreamOffsetUni,
|
||||
initialMaxStreamDataUni);
|
||||
EXPECT_EQ(client_->peerAdvertisedKnobFrameSupport, knobFrameSupport);
|
||||
ASSERT_TRUE(client_->maybePeerAckReceiveTimestampsConfig.has_value());
|
||||
EXPECT_EQ(
|
||||
client_->maybePeerAckReceiveTimestampsConfig.value()
|
||||
.maxReceiveTimestampsPerAck,
|
||||
maxReceiveTimestampsPerAck);
|
||||
EXPECT_EQ(
|
||||
client_->maybePeerAckReceiveTimestampsConfig.value()
|
||||
.receiveTimestampsExponent,
|
||||
ackReceiveTimestampsExponent);
|
||||
|
||||
for (unsigned long i = 0; i < initialMaxStreamsBidi; i++) {
|
||||
EXPECT_TRUE(
|
||||
|
||||
Reference in New Issue
Block a user