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

Unified Diff: net/quic/congestion_control/tcp_cubic_sender.cc

Issue 447093004: Land Recent QUIC Changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed indenation in QuicFramer.cc Created 6 years, 4 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
Index: net/quic/congestion_control/tcp_cubic_sender.cc
diff --git a/net/quic/congestion_control/tcp_cubic_sender.cc b/net/quic/congestion_control/tcp_cubic_sender.cc
index dd7e7aee5c31f7a98cb3a8a2ad82e4255dd63a86..d9677046678881d3f73b16c7c3c6c293ebd8396f 100644
--- a/net/quic/congestion_control/tcp_cubic_sender.cc
+++ b/net/quic/congestion_control/tcp_cubic_sender.cc
@@ -8,6 +8,7 @@
#include "base/metrics/histogram.h"
#include "net/quic/congestion_control/rtt_stats.h"
+#include "net/quic/crypto/crypto_protocol.h"
using std::max;
using std::min;
@@ -20,7 +21,6 @@ namespace {
// fast retransmission. The cwnd after a timeout is still 1.
const QuicTcpCongestionWindow kMinimumCongestionWindow = 2;
const QuicByteCount kMaxSegmentSize = kDefaultTCPMSS;
-const QuicByteCount kDefaultReceiveWindow = 64000;
const int64 kInitialCongestionWindow = 10;
const int kMaxBurstLength = 3;
}; // namespace
@@ -37,7 +37,7 @@ TcpCubicSender::TcpCubicSender(
stats_(stats),
reno_(reno),
congestion_window_count_(0),
- receive_window_(kDefaultReceiveWindow),
+ receive_window_(kDefaultSocketReceiveBuffer),
prr_out_(0),
prr_delivered_(0),
ack_count_since_loss_(0),
@@ -58,17 +58,31 @@ TcpCubicSender::~TcpCubicSender() {
}
void TcpCubicSender::SetFromConfig(const QuicConfig& config, bool is_server) {
- if (is_server && config.HasReceivedInitialCongestionWindow()) {
- // Set the initial window size.
- congestion_window_ = min(kMaxInitialWindow,
- config.ReceivedInitialCongestionWindow());
+ if (is_server) {
+ if (config.HasReceivedConnectionOptions() &&
+ ContainsQuicTag(config.ReceivedConnectionOptions(), kIW10)) {
+ // Initial window experiment. Ignore the initial congestion
+ // window suggested by the client and use the default ICWND of
+ // 10 instead.
+ congestion_window_ = kInitialCongestionWindow;
+ } else if (config.HasReceivedInitialCongestionWindow()) {
+ // Set the initial window size.
+ congestion_window_ = min(kMaxInitialWindow,
+ config.ReceivedInitialCongestionWindow());
+ }
+ }
+ if (config.HasReceivedSocketReceiveBuffer()) {
+ // Set the initial socket receive buffer size in bytes.
+ receive_window_ = config.ReceivedSocketReceiveBuffer();
}
}
void TcpCubicSender::OnIncomingQuicCongestionFeedbackFrame(
const QuicCongestionFeedbackFrame& feedback,
QuicTime feedback_receive_time) {
- receive_window_ = feedback.tcp.receive_window;
+ if (feedback.type == kTCP) {
+ receive_window_ = feedback.tcp.receive_window;
+ }
}
void TcpCubicSender::OnCongestionEvent(
« no previous file with comments | « net/quic/congestion_control/send_algorithm_simulator.cc ('k') | net/quic/congestion_control/tcp_cubic_sender_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698