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 // TCP cubic send side congestion algorithm, emulates the behavior of | 5 // TCP cubic send side congestion algorithm, emulates the behavior of |
6 // TCP cubic. | 6 // TCP cubic. |
7 | 7 |
8 #ifndef NET_QUIC_CONGESTION_CONTROL_TCP_CUBIC_SENDER_H_ | 8 #ifndef NET_QUIC_CONGESTION_CONTROL_TCP_CUBIC_SENDER_H_ |
9 #define NET_QUIC_CONGESTION_CONTROL_TCP_CUBIC_SENDER_H_ | 9 #define NET_QUIC_CONGESTION_CONTROL_TCP_CUBIC_SENDER_H_ |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
13 #include "net/base/net_export.h" | 13 #include "net/base/net_export.h" |
14 #include "net/quic/congestion_control/cubic.h" | 14 #include "net/quic/congestion_control/cubic.h" |
15 #include "net/quic/congestion_control/hybrid_slow_start.h" | 15 #include "net/quic/congestion_control/hybrid_slow_start.h" |
16 #include "net/quic/congestion_control/send_algorithm_interface.h" | 16 #include "net/quic/congestion_control/send_algorithm_interface.h" |
17 #include "net/quic/quic_bandwidth.h" | 17 #include "net/quic/quic_bandwidth.h" |
| 18 #include "net/quic/quic_connection_stats.h" |
18 #include "net/quic/quic_protocol.h" | 19 #include "net/quic/quic_protocol.h" |
19 #include "net/quic/quic_time.h" | 20 #include "net/quic/quic_time.h" |
20 | 21 |
21 namespace net { | 22 namespace net { |
22 | 23 |
23 // Default maximum packet size used in Linux TCP implementations. | 24 // Default maximum packet size used in Linux TCP implementations. |
24 const QuicByteCount kDefaultTCPMSS = 1460; | 25 const QuicByteCount kDefaultTCPMSS = 1460; |
25 | 26 |
26 namespace test { | 27 namespace test { |
27 class TcpCubicSenderPeer; | 28 class TcpCubicSenderPeer; |
28 } // namespace test | 29 } // namespace test |
29 | 30 |
30 class NET_EXPORT_PRIVATE TcpCubicSender : public SendAlgorithmInterface { | 31 class NET_EXPORT_PRIVATE TcpCubicSender : public SendAlgorithmInterface { |
31 public: | 32 public: |
32 // Reno option and max_tcp_congestion_window are provided for testing. | 33 // Reno option and max_tcp_congestion_window are provided for testing. |
33 TcpCubicSender(const QuicClock* clock, | 34 TcpCubicSender(const QuicClock* clock, |
34 bool reno, | 35 bool reno, |
35 QuicTcpCongestionWindow max_tcp_congestion_window); | 36 QuicTcpCongestionWindow max_tcp_congestion_window, |
| 37 QuicConnectionStats* stats); |
36 virtual ~TcpCubicSender(); | 38 virtual ~TcpCubicSender(); |
37 | 39 |
38 // Start implementation of SendAlgorithmInterface. | 40 // Start implementation of SendAlgorithmInterface. |
39 virtual void SetFromConfig(const QuicConfig& config, bool is_server) OVERRIDE; | 41 virtual void SetFromConfig(const QuicConfig& config, bool is_server) OVERRIDE; |
40 virtual void OnIncomingQuicCongestionFeedbackFrame( | 42 virtual void OnIncomingQuicCongestionFeedbackFrame( |
41 const QuicCongestionFeedbackFrame& feedback, | 43 const QuicCongestionFeedbackFrame& feedback, |
42 QuicTime feedback_receive_time) OVERRIDE; | 44 QuicTime feedback_receive_time) OVERRIDE; |
43 virtual void OnPacketAcked(QuicPacketSequenceNumber acked_sequence_number, | 45 virtual void OnPacketAcked(QuicPacketSequenceNumber acked_sequence_number, |
44 QuicByteCount acked_bytes) OVERRIDE; | 46 QuicByteCount acked_bytes) OVERRIDE; |
45 virtual void OnPacketLost(QuicPacketSequenceNumber largest_loss, | 47 virtual void OnPacketLost(QuicPacketSequenceNumber largest_loss, |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 // Approximation of standard deviation, the error is roughly 1.25 times | 132 // Approximation of standard deviation, the error is roughly 1.25 times |
131 // larger than the standard deviation, for a normally distributed signal. | 133 // larger than the standard deviation, for a normally distributed signal. |
132 QuicTime::Delta mean_deviation_; | 134 QuicTime::Delta mean_deviation_; |
133 | 135 |
134 DISALLOW_COPY_AND_ASSIGN(TcpCubicSender); | 136 DISALLOW_COPY_AND_ASSIGN(TcpCubicSender); |
135 }; | 137 }; |
136 | 138 |
137 } // namespace net | 139 } // namespace net |
138 | 140 |
139 #endif // NET_QUIC_CONGESTION_CONTROL_TCP_CUBIC_SENDER_H_ | 141 #endif // NET_QUIC_CONGESTION_CONTROL_TCP_CUBIC_SENDER_H_ |
OLD | NEW |