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 // The pure virtual class for send side congestion control algorithm. | 5 // The pure virtual class for send side congestion control algorithm. |
6 | 6 |
7 #ifndef NET_QUIC_CONGESTION_CONTROL_SEND_ALGORITHM_INTERFACE_H_ | 7 #ifndef NET_QUIC_CONGESTION_CONTROL_SEND_ALGORITHM_INTERFACE_H_ |
8 #define NET_QUIC_CONGESTION_CONTROL_SEND_ALGORITHM_INTERFACE_H_ | 8 #define NET_QUIC_CONGESTION_CONTROL_SEND_ALGORITHM_INTERFACE_H_ |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 20 matching lines...) Expand all Loading... |
31 | 31 |
32 static SendAlgorithmInterface* Create(const QuicClock* clock, | 32 static SendAlgorithmInterface* Create(const QuicClock* clock, |
33 const RttStats* rtt_stats, | 33 const RttStats* rtt_stats, |
34 CongestionControlType type, | 34 CongestionControlType type, |
35 QuicConnectionStats* stats); | 35 QuicConnectionStats* stats); |
36 | 36 |
37 virtual ~SendAlgorithmInterface() {} | 37 virtual ~SendAlgorithmInterface() {} |
38 | 38 |
39 virtual void SetFromConfig(const QuicConfig& config, bool is_server) = 0; | 39 virtual void SetFromConfig(const QuicConfig& config, bool is_server) = 0; |
40 | 40 |
| 41 // Sets the number of connections to emulate when doing congestion control, |
| 42 // particularly for congestion avoidance. Can be set any time. |
| 43 virtual void SetNumEmulatedConnections(int num_connections) = 0; |
| 44 |
41 // Called when we receive congestion feedback from remote peer. | 45 // Called when we receive congestion feedback from remote peer. |
42 virtual void OnIncomingQuicCongestionFeedbackFrame( | 46 virtual void OnIncomingQuicCongestionFeedbackFrame( |
43 const QuicCongestionFeedbackFrame& feedback, | 47 const QuicCongestionFeedbackFrame& feedback, |
44 QuicTime feedback_receive_time) = 0; | 48 QuicTime feedback_receive_time) = 0; |
45 | 49 |
46 // Indicates an update to the congestion state, caused either by an incoming | 50 // Indicates an update to the congestion state, caused either by an incoming |
47 // ack or loss event timeout. |rtt_updated| indicates whether a new | 51 // ack or loss event timeout. |rtt_updated| indicates whether a new |
48 // latest_rtt sample has been taken, |byte_in_flight| the bytes in flight | 52 // latest_rtt sample has been taken, |byte_in_flight| the bytes in flight |
49 // prior to the congestion event. |acked_packets| and |lost_packets| are | 53 // prior to the congestion event. |acked_packets| and |lost_packets| are |
50 // any packets considered acked or lost as a result of the congestion event. | 54 // any packets considered acked or lost as a result of the congestion event. |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 // aka ssthresh. Some send algorithms do not define a slow start | 110 // aka ssthresh. Some send algorithms do not define a slow start |
107 // threshold and will return 0. | 111 // threshold and will return 0. |
108 virtual QuicByteCount GetSlowStartThreshold() const = 0; | 112 virtual QuicByteCount GetSlowStartThreshold() const = 0; |
109 | 113 |
110 virtual CongestionControlType GetCongestionControlType() const = 0; | 114 virtual CongestionControlType GetCongestionControlType() const = 0; |
111 }; | 115 }; |
112 | 116 |
113 } // namespace net | 117 } // namespace net |
114 | 118 |
115 #endif // NET_QUIC_CONGESTION_CONTROL_SEND_ALGORITHM_INTERFACE_H_ | 119 #endif // NET_QUIC_CONGESTION_CONTROL_SEND_ALGORITHM_INTERFACE_H_ |
OLD | NEW |