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

Side by Side Diff: net/quic/congestion_control/tcp_cubic_sender_bytes.cc

Issue 1814873002: Use byte conservation instead of packet conservation in QUIC's Slow Start Large Recovery experiment… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@116904472
Patch Set: Created 4 years, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/quic/congestion_control/tcp_cubic_sender_bytes.h" 5 #include "net/quic/congestion_control/tcp_cubic_sender_bytes.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "net/quic/congestion_control/prr_sender.h" 9 #include "net/quic/congestion_control/prr_sender.h"
10 #include "net/quic/congestion_control/rtt_stats.h" 10 #include "net/quic/congestion_control/rtt_stats.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 void TcpCubicSenderBytes::SetMaxCongestionWindow( 74 void TcpCubicSenderBytes::SetMaxCongestionWindow(
75 QuicByteCount max_congestion_window) { 75 QuicByteCount max_congestion_window) {
76 max_congestion_window_ = max_congestion_window; 76 max_congestion_window_ = max_congestion_window;
77 } 77 }
78 78
79 void TcpCubicSenderBytes::ExitSlowstart() { 79 void TcpCubicSenderBytes::ExitSlowstart() {
80 slowstart_threshold_ = congestion_window_; 80 slowstart_threshold_ = congestion_window_;
81 } 81 }
82 82
83 void TcpCubicSenderBytes::OnPacketLost(QuicPacketNumber packet_number, 83 void TcpCubicSenderBytes::OnPacketLost(QuicPacketNumber packet_number,
84 QuicByteCount lost_bytes,
84 QuicByteCount bytes_in_flight) { 85 QuicByteCount bytes_in_flight) {
85 // TCP NewReno (RFC6582) says that once a loss occurs, any losses in packets 86 // TCP NewReno (RFC6582) says that once a loss occurs, any losses in packets
86 // already sent should be treated as a single loss event, since it's expected. 87 // already sent should be treated as a single loss event, since it's expected.
87 if (packet_number <= largest_sent_at_last_cutback_) { 88 if (packet_number <= largest_sent_at_last_cutback_) {
88 if (last_cutback_exited_slowstart_) { 89 if (last_cutback_exited_slowstart_) {
89 ++stats_->slowstart_packets_lost; 90 ++stats_->slowstart_packets_lost;
91 stats_->slowstart_bytes_lost += lost_bytes;
90 if (slow_start_large_reduction_) { 92 if (slow_start_large_reduction_) {
91 // Reduce congestion window by 1 MSS for every loss. 93 // Reduce congestion window by lost_bytes for every loss.
92 congestion_window_ = 94 congestion_window_ =
93 max(congestion_window_ - kDefaultTCPMSS, min_congestion_window_); 95 max(congestion_window_ - lost_bytes, min_congestion_window_);
94 slowstart_threshold_ = congestion_window_; 96 slowstart_threshold_ = congestion_window_;
95 } 97 }
96 } 98 }
97 DVLOG(1) << "Ignoring loss for largest_missing:" << packet_number 99 DVLOG(1) << "Ignoring loss for largest_missing:" << packet_number
98 << " because it was sent prior to the last CWND cutback."; 100 << " because it was sent prior to the last CWND cutback.";
99 return; 101 return;
100 } 102 }
101 ++stats_->tcp_loss_events; 103 ++stats_->tcp_loss_events;
102 last_cutback_exited_slowstart_ = InSlowStart(); 104 last_cutback_exited_slowstart_ = InSlowStart();
103 if (InSlowStart()) { 105 if (InSlowStart()) {
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 congestion_window_ = initial_tcp_congestion_window_; 200 congestion_window_ = initial_tcp_congestion_window_;
199 max_congestion_window_ = initial_max_tcp_congestion_window_; 201 max_congestion_window_ = initial_max_tcp_congestion_window_;
200 slowstart_threshold_ = initial_max_tcp_congestion_window_; 202 slowstart_threshold_ = initial_max_tcp_congestion_window_;
201 } 203 }
202 204
203 CongestionControlType TcpCubicSenderBytes::GetCongestionControlType() const { 205 CongestionControlType TcpCubicSenderBytes::GetCongestionControlType() const {
204 return reno_ ? kRenoBytes : kCubicBytes; 206 return reno_ ? kRenoBytes : kCubicBytes;
205 } 207 }
206 208
207 } // namespace net 209 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/congestion_control/tcp_cubic_sender_bytes.h ('k') | net/quic/congestion_control/tcp_cubic_sender_bytes_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698