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

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

Issue 1343093003: Landing Recent QUIC changes until 9/2/2015 17:00 UTC. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge with TOT Created 5 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 unified diff | Download patch
« no previous file with comments | « net/quic/congestion_control/cubic.h ('k') | net/quic/congestion_control/tcp_cubic_sender.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/cubic.h" 5 #include "net/quic/congestion_control/cubic.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 #include <algorithm> 8 #include <algorithm>
9 #include <cmath> 9 #include <cmath>
10 10
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 last_update_time_ = QuicTime::Zero(); // Reset time. 72 last_update_time_ = QuicTime::Zero(); // Reset time.
73 last_congestion_window_ = 0; 73 last_congestion_window_ = 0;
74 last_max_congestion_window_ = 0; 74 last_max_congestion_window_ = 0;
75 acked_packets_count_ = 0; 75 acked_packets_count_ = 0;
76 estimated_tcp_congestion_window_ = 0; 76 estimated_tcp_congestion_window_ = 0;
77 origin_point_congestion_window_ = 0; 77 origin_point_congestion_window_ = 0;
78 time_to_origin_point_ = 0; 78 time_to_origin_point_ = 0;
79 last_target_congestion_window_ = 0; 79 last_target_congestion_window_ = 0;
80 } 80 }
81 81
82 void Cubic::OnApplicationLimited() {
83 // When sender is not using the available congestion window, the window does
84 // not grow. But to be RTT-independent, Cubic assumes that the sender has been
85 // using the entire window during the time since the beginning of the current
86 // "epoch" (the end of the last loss recovery period). Since
87 // application-limited periods break this assumption, we reset the epoch when
88 // in such a period. This reset effectively freezes congestion window growth
89 // through application-limited periods and allows Cubic growth to continue
90 // when the entire window is being used.
91 epoch_ = QuicTime::Zero();
92 }
93
82 QuicPacketCount Cubic::CongestionWindowAfterPacketLoss( 94 QuicPacketCount Cubic::CongestionWindowAfterPacketLoss(
83 QuicPacketCount current_congestion_window) { 95 QuicPacketCount current_congestion_window) {
84 if (current_congestion_window < last_max_congestion_window_) { 96 if (current_congestion_window < last_max_congestion_window_) {
85 // We never reached the old max, so assume we are competing with another 97 // We never reached the old max, so assume we are competing with another
86 // flow. Use our extra back off factor to allow the other flow to go up. 98 // flow. Use our extra back off factor to allow the other flow to go up.
87 last_max_congestion_window_ = 99 last_max_congestion_window_ =
88 static_cast<int>(kBetaLastMax * current_congestion_window); 100 static_cast<int>(kBetaLastMax * current_congestion_window);
89 } else { 101 } else {
90 last_max_congestion_window_ = current_congestion_window; 102 last_max_congestion_window_ = current_congestion_window;
91 } 103 }
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 168
157 // We have a new cubic congestion window. 169 // We have a new cubic congestion window.
158 last_target_congestion_window_ = target_congestion_window; 170 last_target_congestion_window_ = target_congestion_window;
159 171
160 // Compute target congestion_window based on cubic target and estimated TCP 172 // Compute target congestion_window based on cubic target and estimated TCP
161 // congestion_window, use highest (fastest). 173 // congestion_window, use highest (fastest).
162 if (target_congestion_window < estimated_tcp_congestion_window_) { 174 if (target_congestion_window < estimated_tcp_congestion_window_) {
163 target_congestion_window = estimated_tcp_congestion_window_; 175 target_congestion_window = estimated_tcp_congestion_window_;
164 } 176 }
165 177
166 DVLOG(1) << "Target congestion_window: " << target_congestion_window; 178 DVLOG(1) << "Final target congestion_window: " << target_congestion_window;
167 return target_congestion_window; 179 return target_congestion_window;
168 } 180 }
169 181
170 } // namespace net 182 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/congestion_control/cubic.h ('k') | net/quic/congestion_control/tcp_cubic_sender.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698