1
0
mirror of https://github.com/facebookincubator/mvfst.git synced 2025-08-06 22:22:38 +03:00

Introduce PMTU as a variable

Summary:
First step towards d6d. Semantically we need to separate the old `udpSendPacketLen` into `peerMaxPacketSize` as well as `currPMTU`. The former is directly tied to the peer's max_packet_size transport parameter whereas the second is controlled by d6d. To get the actual udp mss, call `conn_->getUdpSendPacketLen()`, which will use the minimum of the two if d6d is enabled, otherwise it will fallback to use `peerMaxPacketSize` only.

During processClientInitialParams and processServerInitialParams, we no longer need to check whether `canIgnorePathMTU` is set because that logic is moved to `setUdpSendPacketLen`. If d6d is enabled, we set both `peerMaxPacketSize` and `currPMTU` to `packetSize` because receiving an initial packet of size x indicates both that the peer accepts x-sized packet and that the PMTU is at least x.

Many call sites and tests are changed.

Faebook:
For now, d6d is considered enabled if `canIgnorePathMTU==false` and `turnoffPMTUD==true`. Down the road, from semantic & practical POV at least one of them should be renamed to something like `enableD6D`, since enabling d6d implies turning off PMTUD and that we should not ignore PMTU. We can keep one for the sake of testing.

Reviewed By: mjoras

Differential Revision: D22049806

fbshipit-source-id: 7a9b30b7e2519c132101509be56a9e63b803dc93
This commit is contained in:
Xiaoting Tang
2020-08-17 16:14:22 -07:00
committed by Facebook GitHub Bot
parent 5e92f96dd1
commit 4762cfb927
20 changed files with 99 additions and 57 deletions

View File

@@ -1087,7 +1087,7 @@ TEST_F(QuicTransportFunctionsTest, TestUpdateConnectionConnWindowUpdate) {
TEST_F(QuicTransportFunctionsTest, WriteQuicDataToSocketWithCC) {
auto conn = createConn();
conn->udpSendPacketLen = 30;
updateUdpSendPacketLen(*conn, 30);
auto mockCongestionController =
std::make_unique<NiceMock<MockCongestionController>>();
auto rawCongestionController = mockCongestionController.get();
@@ -1162,7 +1162,7 @@ TEST_F(QuicTransportFunctionsTest, WriteQuicDataToSocketLimitTest) {
std::make_unique<NiceMock<MockCongestionController>>();
auto rawCongestionController = mockCongestionController.get();
conn->congestionController = std::move(mockCongestionController);
conn->udpSendPacketLen = aead->getCipherOverhead() + 50;
updateUdpSendPacketLen(*conn, aead->getCipherOverhead() + 50);
EventBase evb;
auto socket =
@@ -2124,7 +2124,7 @@ TEST_F(QuicTransportFunctionsTest, WriteLimitBytRttFraction) {
TEST_F(QuicTransportFunctionsTest, CongestionControlWritableBytesRoundUp) {
auto conn = createConn();
conn->udpSendPacketLen = 2000;
updateUdpSendPacketLen(*conn, 2000);
auto mockCongestionController =
std::make_unique<NiceMock<MockCongestionController>>();
auto rawCongestionController = mockCongestionController.get();
@@ -2217,7 +2217,7 @@ TEST_F(QuicTransportFunctionsTest, HandshakeConfirmedDropCipher) {
TEST_F(QuicTransportFunctionsTest, ProbeWriteNewFunctionalFrames) {
auto conn = createConn();
conn->udpSendPacketLen = 1200;
updateUdpSendPacketLen(*conn, 1200);
EventBase evb;
auto sock = std::make_unique<NiceMock<folly::test::MockAsyncUDPSocket>>(&evb);
auto rawSocket = sock.get();