Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(434)

Unified Diff: net/quic/core/congestion_control/cubic.cc

Issue 2351963005: Limit QUIC's Cubic CWND increases to 1/2 the bytes acked when in (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/core/congestion_control/cubic.h ('k') | net/quic/core/congestion_control/cubic_bytes.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/core/congestion_control/cubic.cc
diff --git a/net/quic/core/congestion_control/cubic.cc b/net/quic/core/congestion_control/cubic.cc
index fc596c973f924fa567dcf1d2f77fc033db0beb9e..89a347e7e8edd6edf05fcd0f08a17bd459e84148 100644
--- a/net/quic/core/congestion_control/cubic.cc
+++ b/net/quic/core/congestion_control/cubic.cc
@@ -14,6 +14,7 @@
#include "net/quic/core/quic_time.h"
using std::max;
+using std::min;
namespace net {
@@ -74,6 +75,7 @@ void Cubic::Reset() {
last_congestion_window_ = 0;
last_max_congestion_window_ = 0;
acked_packets_count_ = 0;
+ epoch_packets_count_ = 0;
estimated_tcp_congestion_window_ = 0;
origin_point_congestion_window_ = 0;
time_to_origin_point_ = 0;
@@ -104,6 +106,7 @@ QuicPacketCount Cubic::CongestionWindowAfterAck(
QuicPacketCount current_congestion_window,
QuicTime::Delta delay_min) {
acked_packets_count_ += 1; // Packets acked.
+ epoch_packets_count_ += 1;
QuicTime current_time = clock_->ApproximateNow();
// Cubic is "independent" of RTT, the update is limited by the time elapsed.
@@ -119,6 +122,7 @@ QuicPacketCount Cubic::CongestionWindowAfterAck(
// First ACK after a loss event.
epoch_ = current_time; // Start of epoch.
acked_packets_count_ = 1; // Reset count.
+ epoch_packets_count_ = 1;
// Reset estimated_tcp_congestion_window_ to be in sync with cubic.
estimated_tcp_congestion_window_ = current_congestion_window;
if (last_max_congestion_window_ <= current_congestion_window) {
@@ -146,6 +150,14 @@ QuicPacketCount Cubic::CongestionWindowAfterAck(
QuicPacketCount target_congestion_window =
origin_point_congestion_window_ - delta_congestion_window;
+ if (FLAGS_quic_limit_cubic_cwnd_increase) {
+ // Limit the CWND increase to half the acked packets rounded up to the
+ // nearest packet.
+ target_congestion_window =
+ min(target_congestion_window,
+ current_congestion_window + (epoch_packets_count_ + 1) / 2);
+ }
+
DCHECK_LT(0u, estimated_tcp_congestion_window_);
// With dynamic beta/alpha based on number of active streams, it is possible
// for the required_ack_count to become much lower than acked_packets_count_
@@ -160,6 +172,7 @@ QuicPacketCount Cubic::CongestionWindowAfterAck(
acked_packets_count_ -= required_ack_count;
estimated_tcp_congestion_window_++;
}
+ epoch_packets_count_ = 0;
// We have a new cubic congestion window.
last_target_congestion_window_ = target_congestion_window;
« no previous file with comments | « net/quic/core/congestion_control/cubic.h ('k') | net/quic/core/congestion_control/cubic_bytes.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698