mirror of
https://github.com/facebookincubator/mvfst.git
synced 2025-08-06 22:22:38 +03:00
Introduce D6DProbeScheduler
Summary: According to the spec v21 (https://tools.ietf.org/id/draft-ietf-tsvwg-datagram-plpmtud-21.html#name-sending-quic-probe-packets), d6d probe should only contain a PING followed by many PADDING frames. As a first step, we fully comply with the spec. Future optimizations: - We can potentially put loss data in the probe packet to perform retransmission. This might make the probe packet more useful by increasing goodput. Reviewed By: mjoras Differential Revision: D22557962 fbshipit-source-id: 9a6584bc46aeb29981c4e2c4121ded127a7f2f06
This commit is contained in:
committed by
Facebook GitHub Bot
parent
251d76b2aa
commit
23f817100a
@@ -24,6 +24,8 @@
|
||||
using namespace quic;
|
||||
using namespace testing;
|
||||
|
||||
enum PacketBuilderType { Regular, Inplace };
|
||||
|
||||
namespace {
|
||||
|
||||
PacketNum addInitialOutstandingPacket(QuicConnectionStateBase& conn) {
|
||||
@@ -79,7 +81,7 @@ PacketNum addOutstandingPacket(QuicConnectionStateBase& conn) {
|
||||
namespace quic {
|
||||
namespace test {
|
||||
|
||||
class QuicPacketSchedulerTest : public Test {
|
||||
class QuicPacketSchedulerTest : public TestWithParam<PacketBuilderType> {
|
||||
public:
|
||||
QuicVersion version{QuicVersion::MVFST};
|
||||
};
|
||||
@@ -462,6 +464,51 @@ TEST_F(QuicPacketSchedulerTest, CloningSchedulerTest) {
|
||||
EXPECT_EQ(packetNum, result.packetEvent->packetNumber);
|
||||
}
|
||||
|
||||
TEST_P(QuicPacketSchedulerTest, D6DProbeSchedulerTest) {
|
||||
QuicClientConnectionState conn(
|
||||
FizzClientQuicHandshakeContext::Builder().build());
|
||||
uint64_t cipherOverhead = 2;
|
||||
uint32_t probeSize = 1450;
|
||||
auto connId = getTestConnectionId();
|
||||
D6DProbeScheduler d6dProbeScheduler(
|
||||
conn, "d6d probe", cipherOverhead, probeSize);
|
||||
EXPECT_TRUE(d6dProbeScheduler.hasData());
|
||||
|
||||
ShortHeader shortHeader(
|
||||
ProtectionType::KeyPhaseZero,
|
||||
connId,
|
||||
getNextPacketNum(conn, PacketNumberSpace::AppData));
|
||||
auto param = GetParam();
|
||||
size_t packetSize = 0;
|
||||
if (param == PacketBuilderType::Regular) {
|
||||
RegularQuicPacketBuilder builder(
|
||||
conn.udpSendPacketLen,
|
||||
std::move(shortHeader),
|
||||
conn.ackStates.appDataAckState.largestAckedByPeer.value_or(0));
|
||||
auto result = d6dProbeScheduler.scheduleFramesForPacket(
|
||||
std::move(builder), kDefaultUDPSendPacketLen);
|
||||
ASSERT_TRUE(result.packet.has_value());
|
||||
packetSize = result.packet->header->computeChainDataLength() +
|
||||
result.packet->body->computeChainDataLength() + cipherOverhead;
|
||||
} else {
|
||||
// Just enough to build the probe
|
||||
auto simpleBufAccessor = std::make_unique<SimpleBufAccessor>(probeSize);
|
||||
InplaceQuicPacketBuilder builder(
|
||||
*simpleBufAccessor,
|
||||
conn.udpSendPacketLen,
|
||||
std::move(shortHeader),
|
||||
conn.ackStates.appDataAckState.largestAckedByPeer.value_or(0));
|
||||
auto result = d6dProbeScheduler.scheduleFramesForPacket(
|
||||
std::move(builder), kDefaultUDPSendPacketLen);
|
||||
ASSERT_TRUE(result.packet.has_value());
|
||||
packetSize = result.packet->header->computeChainDataLength() +
|
||||
result.packet->body->computeChainDataLength() + cipherOverhead;
|
||||
}
|
||||
|
||||
EXPECT_FALSE(d6dProbeScheduler.hasData());
|
||||
EXPECT_EQ(packetSize, probeSize);
|
||||
}
|
||||
|
||||
TEST_F(QuicPacketSchedulerTest, WriteOnlyOutstandingPacketsTest) {
|
||||
QuicClientConnectionState conn(
|
||||
FizzClientQuicHandshakeContext::Builder().build());
|
||||
@@ -1387,5 +1434,10 @@ TEST_F(
|
||||
EXPECT_EQ(buf->length(), 0);
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
QuicPacketSchedulerTests,
|
||||
QuicPacketSchedulerTest,
|
||||
Values(PacketBuilderType::Regular, PacketBuilderType::Inplace));
|
||||
|
||||
} // namespace test
|
||||
} // namespace quic
|
||||
|
Reference in New Issue
Block a user