Deprecate gfe2_reloadable_flag_quic_simplify_received_packet_manager_ack &
gfe2_reloadable_flag_quic_remove_unused_ack_options.
PiperOrigin-RevId: 330594392
Change-Id: Id628288b713fef6af670363523941d504c2f12ed
diff --git a/quic/core/uber_received_packet_manager_test.cc b/quic/core/uber_received_packet_manager_test.cc
index 1b5a196..d4815a2 100644
--- a/quic/core/uber_received_packet_manager_test.cc
+++ b/quic/core/uber_received_packet_manager_test.cc
@@ -18,20 +18,6 @@
class UberReceivedPacketManagerPeer {
public:
- static void SetAckMode(UberReceivedPacketManager* manager, AckMode ack_mode) {
- for (auto& received_packet_manager : manager->received_packet_managers_) {
- received_packet_manager.ack_mode_ = ack_mode;
- }
- }
-
- static void SetFastAckAfterQuiescence(UberReceivedPacketManager* manager,
- bool fast_ack_after_quiescence) {
- for (auto& received_packet_manager : manager->received_packet_managers_) {
- received_packet_manager.fast_ack_after_quiescence_ =
- fast_ack_after_quiescence;
- }
- }
-
static void SetAckDecimationDelay(UberReceivedPacketManager* manager,
float ack_decimation_delay) {
for (auto& received_packet_manager : manager->received_packet_managers_) {
@@ -99,7 +85,7 @@
manager_->MaybeUpdateAckTimeout(
should_last_packet_instigate_acks, decrypted_packet_level,
QuicPacketNumber(last_received_packet_number), clock_.ApproximateNow(),
- clock_.ApproximateNow(), &rtt_stats_);
+ &rtt_stats_);
}
void CheckAckTimeout(QuicTime time) {
@@ -315,8 +301,6 @@
TEST_F(UberReceivedPacketManagerTest, AckDecimationReducesAcks) {
EXPECT_FALSE(HasPendingAck());
- UberReceivedPacketManagerPeer::SetAckMode(manager_.get(),
- ACK_DECIMATION_WITH_REORDERING);
// Start ack decimation from 10th packet.
manager_->set_min_received_before_ack_decimation(10);
@@ -348,42 +332,6 @@
CheckAckTimeout(clock_.ApproximateNow());
}
-TEST_F(UberReceivedPacketManagerTest, SendDelayedAfterQuiescence) {
- if (GetQuicReloadableFlag(quic_remove_unused_ack_options)) {
- return;
- }
- EXPECT_FALSE(HasPendingAck());
- UberReceivedPacketManagerPeer::SetFastAckAfterQuiescence(manager_.get(),
- true);
- // The beginning of the connection counts as quiescence.
- QuicTime ack_time =
- clock_.ApproximateNow() + QuicTime::Delta::FromMilliseconds(1);
-
- RecordPacketReceipt(1, clock_.ApproximateNow());
- MaybeUpdateAckTimeout(kInstigateAck, 1);
- CheckAckTimeout(ack_time);
- // Simulate delayed ack alarm firing.
- clock_.AdvanceTime(QuicTime::Delta::FromMilliseconds(1));
- CheckAckTimeout(clock_.ApproximateNow());
-
- // Process another packet immediately after sending the ack and expect the
- // ack timeout to be set delayed ack time in the future.
- ack_time = clock_.ApproximateNow() + kDelayedAckTime;
- RecordPacketReceipt(2, clock_.ApproximateNow());
- MaybeUpdateAckTimeout(kInstigateAck, 2);
- CheckAckTimeout(ack_time);
- // Simulate delayed ack alarm firing.
- clock_.AdvanceTime(kDelayedAckTime);
- CheckAckTimeout(clock_.ApproximateNow());
-
- // Wait 1 second and enesure the ack timeout is set to 1ms in the future.
- clock_.AdvanceTime(QuicTime::Delta::FromSeconds(1));
- ack_time = clock_.ApproximateNow() + QuicTime::Delta::FromMilliseconds(1);
- RecordPacketReceipt(3, clock_.ApproximateNow());
- MaybeUpdateAckTimeout(kInstigateAck, 3);
- CheckAckTimeout(ack_time);
-}
-
TEST_F(UberReceivedPacketManagerTest, SendDelayedMaxAckDelay) {
EXPECT_FALSE(HasPendingAck());
QuicTime::Delta max_ack_delay = QuicTime::Delta::FromMilliseconds(100);
@@ -400,7 +348,6 @@
TEST_F(UberReceivedPacketManagerTest, SendDelayedAckDecimation) {
EXPECT_FALSE(HasPendingAck());
- UberReceivedPacketManagerPeer::SetAckMode(manager_.get(), ACK_DECIMATION);
// The ack time should be based on min_rtt * 1/4, since it's less than the
// default delayed ack time.
QuicTime ack_time = clock_.ApproximateNow() + kMinRttMs * 0.25;
@@ -431,76 +378,6 @@
}
TEST_F(UberReceivedPacketManagerTest,
- SendDelayedAckAckDecimationAfterQuiescence) {
- if (GetQuicReloadableFlag(quic_remove_unused_ack_options)) {
- return;
- }
- EXPECT_FALSE(HasPendingAck());
- UberReceivedPacketManagerPeer::SetAckMode(manager_.get(), ACK_DECIMATION);
- UberReceivedPacketManagerPeer::SetFastAckAfterQuiescence(manager_.get(),
- true);
- // The beginning of the connection counts as quiescence.
- QuicTime ack_time =
- clock_.ApproximateNow() + QuicTime::Delta::FromMilliseconds(1);
- RecordPacketReceipt(1, clock_.ApproximateNow());
- MaybeUpdateAckTimeout(kInstigateAck, 1);
- CheckAckTimeout(ack_time);
- // Simulate delayed ack alarm firing.
- clock_.AdvanceTime(QuicTime::Delta::FromMilliseconds(1));
- CheckAckTimeout(clock_.ApproximateNow());
-
- // Process another packet immedately after sending the ack and expect the
- // ack timeout to be set delayed ack time in the future.
- ack_time = clock_.ApproximateNow() + kDelayedAckTime;
- RecordPacketReceipt(2, clock_.ApproximateNow());
- MaybeUpdateAckTimeout(kInstigateAck, 2);
- CheckAckTimeout(ack_time);
- // Simulate delayed ack alarm firing.
- clock_.AdvanceTime(kDelayedAckTime);
- CheckAckTimeout(clock_.ApproximateNow());
-
- // Wait 1 second and enesure the ack timeout is set to 1ms in the future.
- clock_.AdvanceTime(QuicTime::Delta::FromSeconds(1));
- ack_time = clock_.ApproximateNow() + QuicTime::Delta::FromMilliseconds(1);
- RecordPacketReceipt(3, clock_.ApproximateNow());
- MaybeUpdateAckTimeout(kInstigateAck, 3);
- CheckAckTimeout(ack_time);
- // Process enough packets to get into ack decimation behavior.
- // The ack time should be based on min_rtt/4, since it's less than the
- // default delayed ack time.
- ack_time = clock_.ApproximateNow() + kMinRttMs * 0.25;
- uint64_t kFirstDecimatedPacket = 101;
- for (uint64_t i = 4; i < kFirstDecimatedPacket; ++i) {
- RecordPacketReceipt(i, clock_.ApproximateNow());
- MaybeUpdateAckTimeout(kInstigateAck, i);
- if (i % 2 == 0) {
- // Ack every 2 packets by default.
- CheckAckTimeout(clock_.ApproximateNow());
- } else {
- CheckAckTimeout(clock_.ApproximateNow() + kDelayedAckTime);
- }
- }
- EXPECT_FALSE(HasPendingAck());
- RecordPacketReceipt(kFirstDecimatedPacket, clock_.ApproximateNow());
- MaybeUpdateAckTimeout(kInstigateAck, kFirstDecimatedPacket);
- CheckAckTimeout(ack_time);
-
- // The 10th received packet causes an ack to be sent.
- for (uint64_t i = 1; i < 10; ++i) {
- RecordPacketReceipt(kFirstDecimatedPacket + i, clock_.ApproximateNow());
- MaybeUpdateAckTimeout(kInstigateAck, kFirstDecimatedPacket + i);
- }
- CheckAckTimeout(clock_.ApproximateNow());
-
- // Wait 1 second and enesure the ack timeout is set to 1ms in the future.
- clock_.AdvanceTime(QuicTime::Delta::FromSeconds(1));
- ack_time = clock_.ApproximateNow() + QuicTime::Delta::FromMilliseconds(1);
- RecordPacketReceipt(kFirstDecimatedPacket + 10, clock_.ApproximateNow());
- MaybeUpdateAckTimeout(kInstigateAck, kFirstDecimatedPacket + 10);
- CheckAckTimeout(ack_time);
-}
-
-TEST_F(UberReceivedPacketManagerTest,
SendDelayedAckDecimationUnlimitedAggregation) {
EXPECT_FALSE(HasPendingAck());
QuicConfig config;
@@ -543,7 +420,6 @@
TEST_F(UberReceivedPacketManagerTest, SendDelayedAckDecimationEighthRtt) {
EXPECT_FALSE(HasPendingAck());
- UberReceivedPacketManagerPeer::SetAckMode(manager_.get(), ACK_DECIMATION);
UberReceivedPacketManagerPeer::SetAckDecimationDelay(manager_.get(), 0.125);
// The ack time should be based on min_rtt/8, since it's less than the
@@ -575,190 +451,6 @@
CheckAckTimeout(clock_.ApproximateNow());
}
-TEST_F(UberReceivedPacketManagerTest, SendDelayedAckDecimationWithReordering) {
- if (GetQuicReloadableFlag(quic_remove_unused_ack_options)) {
- return;
- }
- EXPECT_FALSE(HasPendingAck());
- UberReceivedPacketManagerPeer::SetAckMode(manager_.get(),
- ACK_DECIMATION_WITH_REORDERING);
-
- // The ack time should be based on min_rtt/4, since it's less than the
- // default delayed ack time.
- QuicTime ack_time = clock_.ApproximateNow() + kMinRttMs * 0.25;
- // Process all the packets in order so there aren't missing packets.
- uint64_t kFirstDecimatedPacket = 101;
- for (uint64_t i = 1; i < kFirstDecimatedPacket; ++i) {
- RecordPacketReceipt(i, clock_.ApproximateNow());
- MaybeUpdateAckTimeout(kInstigateAck, i);
- if (i % 2 == 0) {
- // Ack every 2 packets by default.
- CheckAckTimeout(clock_.ApproximateNow());
- } else {
- CheckAckTimeout(clock_.ApproximateNow() + kDelayedAckTime);
- }
- }
-
- // Receive one packet out of order and then the rest in order.
- // The loop leaves a one packet gap between acks sent to simulate some loss.
- for (int j = 0; j < 3; ++j) {
- // Process packet 10 first and ensure the timeout is one eighth min_rtt.
- RecordPacketReceipt(kFirstDecimatedPacket + 9 + (j * 11),
- clock_.ApproximateNow());
- MaybeUpdateAckTimeout(kInstigateAck, kFirstDecimatedPacket + 9 + (j * 11));
- ack_time = clock_.ApproximateNow() + QuicTime::Delta::FromMilliseconds(5);
- CheckAckTimeout(ack_time);
-
- // The 10th received packet causes an ack to be sent.
- for (int i = 0; i < 9; ++i) {
- RecordPacketReceipt(kFirstDecimatedPacket + i + (j * 11),
- clock_.ApproximateNow());
- MaybeUpdateAckTimeout(kInstigateAck,
- kFirstDecimatedPacket + i + (j * 11));
- }
- CheckAckTimeout(clock_.ApproximateNow());
- }
-}
-
-TEST_F(UberReceivedPacketManagerTest,
- SendDelayedAckDecimationWithLargeReordering) {
- if (GetQuicReloadableFlag(quic_remove_unused_ack_options)) {
- return;
- }
- EXPECT_FALSE(HasPendingAck());
- UberReceivedPacketManagerPeer::SetAckMode(manager_.get(),
- ACK_DECIMATION_WITH_REORDERING);
- // The ack time should be based on min_rtt/4, since it's less than the
- // default delayed ack time.
- QuicTime ack_time = clock_.ApproximateNow() + kMinRttMs * 0.25;
-
- // Process all the packets in order so there aren't missing packets.
- uint64_t kFirstDecimatedPacket = 101;
- for (uint64_t i = 1; i < kFirstDecimatedPacket; ++i) {
- RecordPacketReceipt(i, clock_.ApproximateNow());
- MaybeUpdateAckTimeout(kInstigateAck, i);
- if (i % 2 == 0) {
- // Ack every 2 packets by default.
- CheckAckTimeout(clock_.ApproximateNow());
- } else {
- CheckAckTimeout(clock_.ApproximateNow() + kDelayedAckTime);
- }
- }
-
- RecordPacketReceipt(kFirstDecimatedPacket, clock_.ApproximateNow());
- MaybeUpdateAckTimeout(kInstigateAck, kFirstDecimatedPacket);
- CheckAckTimeout(ack_time);
-
- RecordPacketReceipt(kFirstDecimatedPacket + 19, clock_.ApproximateNow());
- MaybeUpdateAckTimeout(kInstigateAck, kFirstDecimatedPacket + 19);
- ack_time = clock_.ApproximateNow() + kMinRttMs * 0.125;
- CheckAckTimeout(ack_time);
-
- // The 10th received packet causes an ack to be sent.
- for (int i = 1; i < 9; ++i) {
- RecordPacketReceipt(kFirstDecimatedPacket + i, clock_.ApproximateNow());
- MaybeUpdateAckTimeout(kInstigateAck, kFirstDecimatedPacket + i);
- }
- CheckAckTimeout(clock_.ApproximateNow());
-
- // The next packet received in order will cause an immediate ack, because it
- // fills a hole.
- RecordPacketReceipt(kFirstDecimatedPacket + 10, clock_.ApproximateNow());
- MaybeUpdateAckTimeout(kInstigateAck, kFirstDecimatedPacket + 10);
- CheckAckTimeout(clock_.ApproximateNow());
-}
-
-TEST_F(UberReceivedPacketManagerTest,
- SendDelayedAckDecimationWithReorderingEighthRtt) {
- if (GetQuicReloadableFlag(quic_remove_unused_ack_options)) {
- return;
- }
- EXPECT_FALSE(HasPendingAck());
- UberReceivedPacketManagerPeer::SetAckMode(manager_.get(),
- ACK_DECIMATION_WITH_REORDERING);
- UberReceivedPacketManagerPeer::SetAckDecimationDelay(manager_.get(), 0.125);
- // The ack time should be based on min_rtt/8, since it's less than the
- // default delayed ack time.
- QuicTime ack_time = clock_.ApproximateNow() + kMinRttMs * 0.125;
-
- // Process all the packets in order so there aren't missing packets.
- uint64_t kFirstDecimatedPacket = 101;
- for (uint64_t i = 1; i < kFirstDecimatedPacket; ++i) {
- RecordPacketReceipt(i, clock_.ApproximateNow());
- MaybeUpdateAckTimeout(kInstigateAck, i);
- if (i % 2 == 0) {
- // Ack every 2 packets by default.
- CheckAckTimeout(clock_.ApproximateNow());
- } else {
- CheckAckTimeout(clock_.ApproximateNow() + kDelayedAckTime);
- }
- }
-
- RecordPacketReceipt(kFirstDecimatedPacket, clock_.ApproximateNow());
- MaybeUpdateAckTimeout(kInstigateAck, kFirstDecimatedPacket);
- CheckAckTimeout(ack_time);
-
- // Process packet 10 first and ensure the timeout is one eighth min_rtt.
- RecordPacketReceipt(kFirstDecimatedPacket + 9, clock_.ApproximateNow());
- MaybeUpdateAckTimeout(kInstigateAck, kFirstDecimatedPacket + 9);
- CheckAckTimeout(ack_time);
-
- // The 10th received packet causes an ack to be sent.
- for (int i = 1; i < 9; ++i) {
- RecordPacketReceipt(kFirstDecimatedPacket + i, clock_.ApproximateNow());
- MaybeUpdateAckTimeout(kInstigateAck + i, kFirstDecimatedPacket);
- }
- CheckAckTimeout(clock_.ApproximateNow());
-}
-
-TEST_F(UberReceivedPacketManagerTest,
- SendDelayedAckDecimationWithLargeReorderingEighthRtt) {
- if (GetQuicReloadableFlag(quic_remove_unused_ack_options)) {
- return;
- }
- EXPECT_FALSE(HasPendingAck());
- UberReceivedPacketManagerPeer::SetAckMode(manager_.get(),
- ACK_DECIMATION_WITH_REORDERING);
- UberReceivedPacketManagerPeer::SetAckDecimationDelay(manager_.get(), 0.125);
-
- // The ack time should be based on min_rtt/8, since it's less than the
- // default delayed ack time.
- QuicTime ack_time = clock_.ApproximateNow() + kMinRttMs * 0.125;
- // Process all the packets in order so there aren't missing packets.
- uint64_t kFirstDecimatedPacket = 101;
- for (uint64_t i = 1; i < kFirstDecimatedPacket; ++i) {
- RecordPacketReceipt(i, clock_.ApproximateNow());
- MaybeUpdateAckTimeout(kInstigateAck, i);
- if (i % 2 == 0) {
- // Ack every 2 packets by default.
- CheckAckTimeout(clock_.ApproximateNow());
- } else {
- CheckAckTimeout(clock_.ApproximateNow() + kDelayedAckTime);
- }
- }
-
- RecordPacketReceipt(kFirstDecimatedPacket, clock_.ApproximateNow());
- MaybeUpdateAckTimeout(kInstigateAck, kFirstDecimatedPacket);
- CheckAckTimeout(ack_time);
-
- RecordPacketReceipt(kFirstDecimatedPacket + 19, clock_.ApproximateNow());
- MaybeUpdateAckTimeout(kInstigateAck, kFirstDecimatedPacket + 19);
- CheckAckTimeout(ack_time);
-
- // The 10th received packet causes an ack to be sent.
- for (int i = 1; i < 9; ++i) {
- RecordPacketReceipt(kFirstDecimatedPacket + i, clock_.ApproximateNow());
- MaybeUpdateAckTimeout(kInstigateAck, kFirstDecimatedPacket + i);
- }
- CheckAckTimeout(clock_.ApproximateNow());
-
- // The next packet received in order will cause an immediate ack, because it
- // fills a hole.
- RecordPacketReceipt(kFirstDecimatedPacket + 10, clock_.ApproximateNow());
- MaybeUpdateAckTimeout(kInstigateAck, kFirstDecimatedPacket + 10);
- CheckAckTimeout(clock_.ApproximateNow());
-}
-
TEST_F(UberReceivedPacketManagerTest,
DontWaitForPacketsBeforeMultiplePacketNumberSpaces) {
manager_->EnableMultiplePacketNumberSpacesSupport();