OLD | NEW |
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/tcp_cubic_sender.h" | 5 #include "net/quic/congestion_control/tcp_cubic_sender.h" |
6 | 6 |
| 7 namespace net { |
| 8 |
7 namespace { | 9 namespace { |
8 // Constants based on TCP defaults. | 10 // Constants based on TCP defaults. |
9 const int64 kHybridStartLowWindow = 16; | 11 const int64 kHybridStartLowWindow = 16; |
10 const net::QuicByteCount kMaxSegmentSize = net::kMaxPacketSize; | 12 const QuicByteCount kMaxSegmentSize = kMaxPacketSize; |
11 const net::QuicByteCount kDefaultReceiveWindow = 64000; | 13 const QuicByteCount kDefaultReceiveWindow = 64000; |
12 const int64 kInitialCongestionWindow = 10; | 14 const int64 kInitialCongestionWindow = 10; |
13 const int64 kMaxCongestionWindow = 10000; | 15 const int64 kMaxCongestionWindow = 10000; |
14 const int kMaxBurstLength = 3; | 16 const int kMaxBurstLength = 3; |
15 }; | 17 }; |
16 | 18 |
17 namespace net { | |
18 | |
19 TcpCubicSender::TcpCubicSender(const QuicClock* clock, bool reno) | 19 TcpCubicSender::TcpCubicSender(const QuicClock* clock, bool reno) |
20 : hybrid_slow_start_(clock), | 20 : hybrid_slow_start_(clock), |
21 cubic_(clock), | 21 cubic_(clock), |
22 reno_(reno), | 22 reno_(reno), |
23 congestion_window_count_(0), | 23 congestion_window_count_(0), |
24 receiver_congestion_window_(kDefaultReceiveWindow), | 24 receiver_congestion_window_(kDefaultReceiveWindow), |
25 last_received_accumulated_number_of_lost_packets_(0), | 25 last_received_accumulated_number_of_lost_packets_(0), |
26 bytes_in_flight_(0), | 26 bytes_in_flight_(0), |
27 update_end_sequence_number_(true), | 27 update_end_sequence_number_(true), |
28 end_sequence_number_(0), | 28 end_sequence_number_(0), |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 hybrid_slow_start_.Reset(end_sequence_number_); | 209 hybrid_slow_start_.Reset(end_sequence_number_); |
210 } | 210 } |
211 hybrid_slow_start_.Update(rtt, delay_min_); | 211 hybrid_slow_start_.Update(rtt, delay_min_); |
212 if (hybrid_slow_start_.Exit()) { | 212 if (hybrid_slow_start_.Exit()) { |
213 slowstart_threshold_ = congestion_window_; | 213 slowstart_threshold_ = congestion_window_; |
214 } | 214 } |
215 } | 215 } |
216 } | 216 } |
217 | 217 |
218 } // namespace net | 218 } // namespace net |
OLD | NEW |