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 TCP cubic. | 5 // TCP cubic send side congestion algorithm, emulates the behavior of TCP cubic. |
6 | 6 |
7 #ifndef NET_QUIC_CONGESTION_CONTROL_TCP_CUBIC_SENDER_H_ | 7 #ifndef NET_QUIC_CONGESTION_CONTROL_TCP_CUBIC_SENDER_H_ |
8 #define NET_QUIC_CONGESTION_CONTROL_TCP_CUBIC_SENDER_H_ | 8 #define NET_QUIC_CONGESTION_CONTROL_TCP_CUBIC_SENDER_H_ |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
12 #include "net/base/net_export.h" | 12 #include "net/base/net_export.h" |
13 #include "net/quic/congestion_control/cubic.h" | 13 #include "net/quic/congestion_control/cubic.h" |
14 #include "net/quic/congestion_control/hybrid_slow_start.h" | 14 #include "net/quic/congestion_control/hybrid_slow_start.h" |
15 #include "net/quic/congestion_control/prr_sender.h" | 15 #include "net/quic/congestion_control/prr_sender.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/crypto/cached_network_parameters.h" | |
18 #include "net/quic/quic_bandwidth.h" | 17 #include "net/quic/quic_bandwidth.h" |
19 #include "net/quic/quic_connection_stats.h" | 18 #include "net/quic/quic_connection_stats.h" |
20 #include "net/quic/quic_protocol.h" | 19 #include "net/quic/quic_protocol.h" |
21 #include "net/quic/quic_time.h" | 20 #include "net/quic/quic_time.h" |
22 | 21 |
23 namespace net { | 22 namespace net { |
24 | 23 |
25 class RttStats; | 24 class RttStats; |
26 | 25 |
27 namespace test { | 26 namespace test { |
28 class TcpCubicSenderPeer; | 27 class TcpCubicSenderPeer; |
29 } // namespace test | 28 } // namespace test |
30 | 29 |
31 class NET_EXPORT_PRIVATE TcpCubicSender : public SendAlgorithmInterface { | 30 class NET_EXPORT_PRIVATE TcpCubicSender : public SendAlgorithmInterface { |
32 public: | 31 public: |
33 // Reno option and max_tcp_congestion_window are provided for testing. | 32 // Reno option and max_tcp_congestion_window are provided for testing. |
34 TcpCubicSender(const QuicClock* clock, | 33 TcpCubicSender(const QuicClock* clock, |
35 const RttStats* rtt_stats, | 34 const RttStats* rtt_stats, |
36 bool reno, | 35 bool reno, |
37 QuicPacketCount initial_tcp_congestion_window, | 36 QuicPacketCount initial_tcp_congestion_window, |
38 QuicPacketCount max_tcp_congestion_window, | 37 QuicPacketCount max_tcp_congestion_window, |
39 QuicConnectionStats* stats); | 38 QuicConnectionStats* stats); |
40 ~TcpCubicSender() override; | 39 ~TcpCubicSender() override; |
41 | 40 |
42 // Start implementation of SendAlgorithmInterface. | 41 // Start implementation of SendAlgorithmInterface. |
43 void SetFromConfig(const QuicConfig& config, | 42 void SetFromConfig(const QuicConfig& config, |
44 Perspective perspective, | 43 Perspective perspective) override; |
45 bool using_pacing) override; | |
46 bool ResumeConnectionState( | 44 bool ResumeConnectionState( |
47 const CachedNetworkParameters& cached_network_params, | 45 const CachedNetworkParameters& cached_network_params, |
48 bool max_bandwidth_resumption) override; | 46 bool max_bandwidth_resumption) override; |
49 void SetNumEmulatedConnections(int num_connections) override; | 47 void SetNumEmulatedConnections(int num_connections) override; |
50 void SetMaxCongestionWindow(QuicByteCount max_congestion_window) override; | 48 void SetMaxCongestionWindow(QuicByteCount max_congestion_window) override; |
51 void OnCongestionEvent(bool rtt_updated, | 49 void OnCongestionEvent(bool rtt_updated, |
52 QuicByteCount bytes_in_flight, | 50 QuicByteCount bytes_in_flight, |
53 const CongestionVector& acked_packets, | 51 const CongestionVector& acked_packets, |
54 const CongestionVector& lost_packets) override; | 52 const CongestionVector& lost_packets) override; |
55 bool OnPacketSent(QuicTime sent_time, | 53 bool OnPacketSent(QuicTime sent_time, |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 QuicPacketCount max_tcp_congestion_window_; | 129 QuicPacketCount max_tcp_congestion_window_; |
132 | 130 |
133 const QuicClock* clock_; | 131 const QuicClock* clock_; |
134 | 132 |
135 DISALLOW_COPY_AND_ASSIGN(TcpCubicSender); | 133 DISALLOW_COPY_AND_ASSIGN(TcpCubicSender); |
136 }; | 134 }; |
137 | 135 |
138 } // namespace net | 136 } // namespace net |
139 | 137 |
140 #endif // NET_QUIC_CONGESTION_CONTROL_TCP_CUBIC_SENDER_H_ | 138 #endif // NET_QUIC_CONGESTION_CONTROL_TCP_CUBIC_SENDER_H_ |
OLD | NEW |