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 |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 QuicByteCount GetCongestionWindow() const override; | 63 QuicByteCount GetCongestionWindow() const override; |
64 bool InSlowStart() const override; | 64 bool InSlowStart() const override; |
65 bool InRecovery() const override; | 65 bool InRecovery() const override; |
66 QuicByteCount GetSlowStartThreshold() const override; | 66 QuicByteCount GetSlowStartThreshold() const override; |
67 CongestionControlType GetCongestionControlType() const override; | 67 CongestionControlType GetCongestionControlType() const override; |
68 // End implementation of SendAlgorithmInterface. | 68 // End implementation of SendAlgorithmInterface. |
69 | 69 |
70 private: | 70 private: |
71 friend class test::TcpCubicSenderPeer; | 71 friend class test::TcpCubicSenderPeer; |
72 | 72 |
| 73 // Compute the TCP Reno beta based on the current number of connections. |
| 74 float RenoBeta() const; |
| 75 |
73 // TODO(ianswett): Remove these and migrate to OnCongestionEvent. | 76 // TODO(ianswett): Remove these and migrate to OnCongestionEvent. |
74 void OnPacketAcked(QuicPacketSequenceNumber acked_sequence_number, | 77 void OnPacketAcked(QuicPacketSequenceNumber acked_sequence_number, |
75 QuicByteCount acked_bytes, | 78 QuicByteCount acked_bytes, |
76 QuicByteCount bytes_in_flight); | 79 QuicByteCount bytes_in_flight); |
77 void OnPacketLost(QuicPacketSequenceNumber largest_loss, | 80 void OnPacketLost(QuicPacketSequenceNumber largest_loss, |
78 QuicByteCount bytes_in_flight); | 81 QuicByteCount bytes_in_flight); |
79 | 82 |
80 void MaybeIncreaseCwnd(QuicPacketSequenceNumber acked_sequence_number, | 83 void MaybeIncreaseCwnd(QuicPacketSequenceNumber acked_sequence_number, |
81 QuicByteCount bytes_in_flight); | 84 QuicByteCount bytes_in_flight); |
82 bool IsCwndLimited(QuicByteCount bytes_in_flight) const; | 85 bool IsCwndLimited(QuicByteCount bytes_in_flight) const; |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 | 126 |
124 // Maximum number of outstanding packets for tcp. | 127 // Maximum number of outstanding packets for tcp. |
125 QuicPacketCount max_tcp_congestion_window_; | 128 QuicPacketCount max_tcp_congestion_window_; |
126 | 129 |
127 DISALLOW_COPY_AND_ASSIGN(TcpCubicSender); | 130 DISALLOW_COPY_AND_ASSIGN(TcpCubicSender); |
128 }; | 131 }; |
129 | 132 |
130 } // namespace net | 133 } // namespace net |
131 | 134 |
132 #endif // NET_QUIC_CONGESTION_CONTROL_TCP_CUBIC_SENDER_H_ | 135 #endif // NET_QUIC_CONGESTION_CONTROL_TCP_CUBIC_SENDER_H_ |
OLD | NEW |