Landing recent QUIC changes until 10:22 AM, Nov 20, 2017 UTC-8


Flip recent QUIC flags

https://chromium-review.googlesource.com/c/chromium/src/+/780809



Make some QuicConnection interfaces public.

Turn on ACK decimation (ACKD, AKDU) for QUIC to backend which doesn't run any production traffic yet.

Merge internal change: 175889473

https://chromium-review.googlesource.com/c/780583/



Add smoothed rtt to QUIC metrics reported through Quartc.

//gfe/quic/quartc reports the rtt alongside bandwidth estimate.  Quartc
connection periodically scrapes QUIC stats and reports them to the brain.  The
brain adds QUIC stats to the Quartc metrics structure, which is exported through
the api.  The Quartc brain also shares QUIC's rtt stat through the
NetworkBrainMessage.

Changes the Metrics structure returned by the Quartc API to split out QUIC
metrics as described in this doc:

https://docs.google.com/document/d/11ltkz_-hGGpx0PcteR61zptrBDZ3tMvAWjrqj-XRnNo/edit#

This is the first bit of metrics improvement.  Fields for media streams will be
added next to "quic" as described there.

n/a (only changes code used for Quartc)

TAG_CHANGE_OK=quartc has not been deployed
WANT_LGTM=kirpichov

Merge internal change: 175600126

[email protected]

https: //chromium-review.googlesource.com/c/780268/
Change-Id: I94ae180bd21ac5da93621c63d2ee2265d820addf
Reviewed-on: https://chromium-review.googlesource.com/780811
Reviewed-by: Ryan Hamilton <[email protected]>
Commit-Queue: Yixin Wang <[email protected]>
Cr-Commit-Position: refs/heads/master@{#518298}
diff --git a/net/quic/core/quic_connection.h b/net/quic/core/quic_connection.h
index f7a11d5..87fdbc1 100644
--- a/net/quic/core/quic_connection.h
+++ b/net/quic/core/quic_connection.h
@@ -725,6 +725,13 @@
     fill_up_link_during_probing_ = new_value;
   }
 
+  // If |defer| is true, configures the connection to defer sending packets in
+  // response to an ACK to the SendAlarm. If |defer| is false, packets may be
+  // sent immediately after receiving an ACK.
+  void set_defer_send_in_response_to_packets(bool defer) {
+    defer_send_in_response_to_packets_ = defer;
+  }
+
  protected:
   // Calls cancel() on all the alarms owned by this connection.
   void CancelAllAlarms();
@@ -755,13 +762,6 @@
     per_packet_options_ = options;
   }
 
-  // If |defer| is true, configures the connection to defer sending packets in
-  // response to an ACK to the SendAlarm. If |defer| is false, packets may be
-  // sent immediately after receiving an ACK.
-  void set_defer_send_in_response_to_packets(bool defer) {
-    defer_send_in_response_to_packets_ = defer;
-  }
-
   PeerAddressChangeType active_peer_migration_type() {
     return active_peer_migration_type_;
   }
diff --git a/net/quic/core/quic_flags_list.h b/net/quic/core/quic_flags_list.h
index b901d6e..ed8079c6 100644
--- a/net/quic/core/quic_flags_list.h
+++ b/net/quic/core/quic_flags_list.h
@@ -101,7 +101,7 @@
 
 // Adds a QuicPacketNumberQueue that is based on a deque and does not support
 // costly AddRange arguments.
-QUIC_FLAG(bool, FLAGS_quic_reloadable_flag_quic_frames_deque3, false)
+QUIC_FLAG(bool, FLAGS_quic_reloadable_flag_quic_frames_deque3, true)
 
 // If true, enable QUIC v42.
 QUIC_FLAG(bool, FLAGS_quic_enable_version_42, false)
@@ -158,7 +158,7 @@
 
 // If true, allow a new BBR connection option to use a slower STARTUP once loss
 // occurs
-QUIC_FLAG(bool, FLAGS_quic_reloadable_flag_quic_bbr_slower_startup, false)
+QUIC_FLAG(bool, FLAGS_quic_reloadable_flag_quic_bbr_slower_startup, true)
 
 // Deprecate QuicAckFrame.largest_observed since it is redundant.
 QUIC_FLAG(bool,
@@ -167,7 +167,7 @@
 
 // Fully drain the queue in QUIC BBR at least once per cycle(8 rounds) when
 // activated by the BBR3 connection option.
-QUIC_FLAG(bool, FLAGS_quic_reloadable_flag_quic_bbr_fully_drain_queue, false)
+QUIC_FLAG(bool, FLAGS_quic_reloadable_flag_quic_bbr_fully_drain_queue, true)
 
 // When true, allows connection options to be sent to completely disable packet
 // conservation in QUIC BBR STARTUP or make it more aggressive.
diff --git a/net/quic/quartc/quartc_session.cc b/net/quic/quartc/quartc_session.cc
index 8d761c4..a4c74d2 100644
--- a/net/quic/quartc/quartc_session.cc
+++ b/net/quic/quartc/quartc_session.cc
@@ -209,8 +209,9 @@
 QuartcSessionStats QuartcSession::GetStats() {
   QuartcSessionStats stats;
   const QuicConnectionStats& connection_stats = connection_->GetStats();
-  stats.bandwidth_estimate_bits_per_second =
-      connection_stats.estimated_bandwidth.ToBitsPerSecond();
+  stats.bandwidth_estimate = connection_stats.estimated_bandwidth;
+  stats.smoothed_rtt =
+      QuicTime::Delta::FromMicroseconds(connection_stats.srtt_us);
   return stats;
 }
 
diff --git a/net/quic/quartc/quartc_session_interface.h b/net/quic/quartc/quartc_session_interface.h
index 69aa9a8..536079a 100644
--- a/net/quic/quartc/quartc_session_interface.h
+++ b/net/quic/quartc/quartc_session_interface.h
@@ -9,7 +9,9 @@
 #include <stdint.h>
 #include <string>
 
+#include "net/quic/core/quic_bandwidth.h"
 #include "net/quic/core/quic_error_codes.h"
+#include "net/quic/core/quic_time.h"
 #include "net/quic/core/quic_types.h"
 #include "net/quic/platform/api/quic_export.h"
 #include "net/quic/quartc/quartc_stream_interface.h"
@@ -19,7 +21,10 @@
 // Structure holding stats exported by a QuartcSession.
 struct QUIC_EXPORT_PRIVATE QuartcSessionStats {
   // Bandwidth estimate in bits per second.
-  int64_t bandwidth_estimate_bits_per_second;
+  QuicBandwidth bandwidth_estimate = QuicBandwidth::Zero();
+
+  // Smoothed round-trip time.
+  QuicTime::Delta smoothed_rtt = QuicTime::Delta::Zero();
 };
 
 // Given a PacketTransport, provides a way to send and receive separate streams
diff --git a/net/quic/quartc/quartc_session_test.cc b/net/quic/quartc/quartc_session_test.cc
index d2cdcc6..9e82001 100644
--- a/net/quic/quartc/quartc_session_test.cc
+++ b/net/quic/quartc/quartc_session_test.cc
@@ -657,7 +657,8 @@
   ASSERT_TRUE(server_peer_->IsCryptoHandshakeConfirmed());
 
   QuartcSessionStats stats = server_peer_->GetStats();
-  EXPECT_GT(stats.bandwidth_estimate_bits_per_second, 0);
+  EXPECT_GT(stats.bandwidth_estimate, QuicBandwidth::Zero());
+  EXPECT_GT(stats.smoothed_rtt, QuicTime::Delta::Zero());
 }
 
 TEST_F(QuartcSessionTest, CloseConnection) {