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 // This class is a helper class to TcpCubicSender. | 5 // This class is a helper class to TcpCubicSender. |
6 // Slow start is the initial startup phase of TCP, it lasts until first packet | 6 // Slow start is the initial startup phase of TCP, it lasts until first packet |
7 // loss. This class implements hybrid slow start of the TCP cubic send side | 7 // loss. This class implements hybrid slow start of the TCP cubic send side |
8 // congestion algorithm. The key feaure of hybrid slow start is that it tries to | 8 // congestion algorithm. The key feaure of hybrid slow start is that it tries to |
9 // avoid running into the wall too hard during the slow start phase, which | 9 // avoid running into the wall too hard during the slow start phase, which |
10 // the traditional TCP implementation does. | 10 // the traditional TCP implementation does. |
(...skipping 28 matching lines...) Expand all Loading... |
39 | 39 |
40 // rtt: it the RTT for this ack packet. | 40 // rtt: it the RTT for this ack packet. |
41 // delay_min: is the lowest delay (RTT) we have seen during the session. | 41 // delay_min: is the lowest delay (RTT) we have seen during the session. |
42 void Update(QuicTime::Delta rtt, QuicTime::Delta delay_min); | 42 void Update(QuicTime::Delta rtt, QuicTime::Delta delay_min); |
43 | 43 |
44 // Returns true when we should exit slow start. | 44 // Returns true when we should exit slow start. |
45 bool Exit(); | 45 bool Exit(); |
46 | 46 |
47 bool started() { return started_; } | 47 bool started() { return started_; } |
48 | 48 |
| 49 QuicTime::Delta SmoothedRtt(); |
| 50 |
49 private: | 51 private: |
50 const QuicClock* clock_; | 52 const QuicClock* clock_; |
51 bool started_; | 53 bool started_; |
52 bool found_ack_train_; | 54 bool found_ack_train_; |
53 bool found_delay_; | 55 bool found_delay_; |
54 QuicTime round_start_; // Beginning of each slow start round. | 56 QuicTime round_start_; // Beginning of each slow start round. |
55 QuicPacketSequenceNumber end_sequence_number_; // End of slow start round. | 57 QuicPacketSequenceNumber end_sequence_number_; // End of slow start round. |
56 QuicTime last_time_; // Last time when the ACK spacing was close. | 58 QuicTime last_time_; // Last time when the ACK spacing was close. |
57 uint8 sample_count_; // Number of samples to decide current RTT. | 59 uint8 sample_count_; // Number of samples to decide current RTT. |
58 QuicTime::Delta current_rtt_; // The minimum rtt of current round. | 60 QuicTime::Delta current_rtt_; // The minimum rtt of current round. |
59 | 61 |
60 DISALLOW_COPY_AND_ASSIGN(HybridSlowStart); | 62 DISALLOW_COPY_AND_ASSIGN(HybridSlowStart); |
61 }; | 63 }; |
62 | 64 |
63 } // namespace net | 65 } // namespace net |
64 | 66 |
65 #endif // NET_QUIC_CONGESTION_CONTROL_HYBRID_SLOW_START_H_ | 67 #endif // NET_QUIC_CONGESTION_CONTROL_HYBRID_SLOW_START_H_ |
OLD | NEW |