| OLD | NEW |
| 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_bytes_sender.h" | 5 #include "net/quic/congestion_control/tcp_cubic_bytes_sender.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" |
| 11 #include "net/quic/crypto/crypto_protocol.h" | 11 #include "net/quic/crypto/crypto_protocol.h" |
| 12 #include "net/quic/proto/cached_network_parameters.pb.h" | 12 #include "net/quic/proto/cached_network_parameters.pb.h" |
| 13 #include "net/quic/quic_flags.h" | 13 #include "net/quic/quic_flags.h" |
| 14 | 14 |
| 15 using std::max; | 15 using std::max; |
| 16 using std::min; | 16 using std::min; |
| 17 | 17 |
| 18 namespace net { | 18 namespace net { |
| 19 | 19 |
| 20 namespace { | 20 namespace { |
| 21 // Constants based on TCP defaults. | 21 // Constants based on TCP defaults. |
| 22 // The minimum cwnd based on RFC 3782 (TCP NewReno) for cwnd reductions on a | 22 // The minimum cwnd based on RFC 3782 (TCP NewReno) for cwnd reductions on a |
| 23 // fast retransmission. | 23 // fast retransmission. |
| 24 const QuicByteCount kDefaultMinimumCongestionWindow = 2 * kDefaultTCPMSS; | 24 const QuicByteCount kDefaultMinimumCongestionWindow = 2 * kDefaultTCPMSS; |
| 25 const QuicByteCount kMaxBurstBytes = 3 * kDefaultTCPMSS; | 25 const QuicByteCount kMaxBurstBytes = 3 * kDefaultTCPMSS; |
| 26 const float kRenoBeta = 0.7f; // Reno backoff factor. | 26 const float kRenoBeta = 0.7f; // Reno backoff factor. |
| 27 const uint32 kDefaultNumConnections = 2; // N-connection emulation. | 27 const uint32_t kDefaultNumConnections = 2; // N-connection emulation. |
| 28 } // namespace | 28 } // namespace |
| 29 | 29 |
| 30 TcpCubicBytesSender::TcpCubicBytesSender( | 30 TcpCubicBytesSender::TcpCubicBytesSender( |
| 31 const QuicClock* clock, | 31 const QuicClock* clock, |
| 32 const RttStats* rtt_stats, | 32 const RttStats* rtt_stats, |
| 33 bool reno, | 33 bool reno, |
| 34 QuicPacketCount initial_tcp_congestion_window, | 34 QuicPacketCount initial_tcp_congestion_window, |
| 35 QuicPacketCount max_congestion_window, | 35 QuicPacketCount max_congestion_window, |
| 36 QuicConnectionStats* stats) | 36 QuicConnectionStats* stats) |
| 37 : cubic_(clock), | 37 : cubic_(clock), |
| (...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 363 largest_sent_packet_number_ = 0; | 363 largest_sent_packet_number_ = 0; |
| 364 largest_acked_packet_number_ = 0; | 364 largest_acked_packet_number_ = 0; |
| 365 largest_sent_at_last_cutback_ = 0; | 365 largest_sent_at_last_cutback_ = 0; |
| 366 congestion_window_ = initial_tcp_congestion_window_; | 366 congestion_window_ = initial_tcp_congestion_window_; |
| 367 max_congestion_window_ = initial_max_tcp_congestion_window_; | 367 max_congestion_window_ = initial_max_tcp_congestion_window_; |
| 368 slowstart_threshold_ = initial_max_tcp_congestion_window_; | 368 slowstart_threshold_ = initial_max_tcp_congestion_window_; |
| 369 last_cutback_exited_slowstart_ = false; | 369 last_cutback_exited_slowstart_ = false; |
| 370 } | 370 } |
| 371 | 371 |
| 372 } // namespace net | 372 } // namespace net |
| OLD | NEW |