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_BASE_H_ | 7 #ifndef NET_QUIC_CONGESTION_CONTROL_TCP_CUBIC_SENDER_BASE_H_ |
8 #define NET_QUIC_CONGESTION_CONTROL_TCP_CUBIC_SENDER_BASE_H_ | 8 #define NET_QUIC_CONGESTION_CONTROL_TCP_CUBIC_SENDER_BASE_H_ |
9 | 9 |
10 #include <stdint.h> | 10 #include <stdint.h> |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 QuicByteCount bytes_in_flight, | 49 QuicByteCount bytes_in_flight, |
50 const CongestionVector& acked_packets, | 50 const CongestionVector& acked_packets, |
51 const CongestionVector& lost_packets) override; | 51 const CongestionVector& lost_packets) override; |
52 bool OnPacketSent(QuicTime sent_time, | 52 bool OnPacketSent(QuicTime sent_time, |
53 QuicByteCount bytes_in_flight, | 53 QuicByteCount bytes_in_flight, |
54 QuicPacketNumber packet_number, | 54 QuicPacketNumber packet_number, |
55 QuicByteCount bytes, | 55 QuicByteCount bytes, |
56 HasRetransmittableData is_retransmittable) override; | 56 HasRetransmittableData is_retransmittable) override; |
57 void OnRetransmissionTimeout(bool packets_retransmitted) override; | 57 void OnRetransmissionTimeout(bool packets_retransmitted) override; |
58 void OnConnectionMigration() override; | 58 void OnConnectionMigration() override; |
59 QuicTime::Delta TimeUntilSend( | 59 QuicTime::Delta TimeUntilSend(QuicTime now, |
60 QuicTime now, | 60 QuicByteCount bytes_in_flight) const override; |
61 QuicByteCount bytes_in_flight, | |
62 HasRetransmittableData has_retransmittable_data) const override; | |
63 QuicBandwidth PacingRate() const override; | 61 QuicBandwidth PacingRate() const override; |
64 QuicBandwidth BandwidthEstimate() const override; | 62 QuicBandwidth BandwidthEstimate() const override; |
65 QuicTime::Delta RetransmissionDelay() const override; | 63 QuicTime::Delta RetransmissionDelay() const override; |
66 bool InSlowStart() const override; | 64 bool InSlowStart() const override; |
67 bool InRecovery() const override; | 65 bool InRecovery() const override; |
68 | 66 |
69 protected: | 67 protected: |
70 // Called when resuming a previous bandwidth. | 68 // Called when resuming a previous bandwidth. |
71 virtual void SetCongestionWindowFromBandwidthAndRtt(QuicBandwidth bandwidth, | 69 virtual void SetCongestionWindowFromBandwidthAndRtt(QuicBandwidth bandwidth, |
72 QuicTime::Delta rtt) = 0; | 70 QuicTime::Delta rtt) = 0; |
73 | 71 |
74 // Called when initializing the congestion window. | 72 // Called when initializing the congestion window. |
75 virtual void SetCongestionWindowInPackets( | 73 virtual void SetCongestionWindowInPackets( |
76 QuicPacketCount congestion_window) = 0; | 74 QuicPacketCount congestion_window) = 0; |
77 | 75 |
78 // Called when initializing the minimum congestion window. | 76 // Called when initializing the minimum congestion window. |
79 virtual void SetMinCongestionWindowInPackets( | 77 virtual void SetMinCongestionWindowInPackets( |
80 QuicPacketCount congestion_window) = 0; | 78 QuicPacketCount congestion_window) = 0; |
81 | 79 |
82 // Called when slow start is exited to set SSTHRESH. | 80 // Called when slow start is exited to set SSTHRESH. |
83 virtual void ExitSlowstart() = 0; | 81 virtual void ExitSlowstart() = 0; |
84 | 82 |
85 // Called when a packet is lost. | 83 // Called when a packet is lost. |
86 virtual void OnPacketLost(QuicPacketNumber largest_loss, | 84 virtual void OnPacketLost(QuicPacketNumber largest_loss, |
| 85 QuicByteCount lost_bytes, |
87 QuicByteCount bytes_in_flight) = 0; | 86 QuicByteCount bytes_in_flight) = 0; |
88 | 87 |
89 // Called when a packet has been acked to possibly increase the congestion | 88 // Called when a packet has been acked to possibly increase the congestion |
90 // window. | 89 // window. |
91 virtual void MaybeIncreaseCwnd(QuicPacketNumber acked_packet_number, | 90 virtual void MaybeIncreaseCwnd(QuicPacketNumber acked_packet_number, |
92 QuicByteCount acked_bytes, | 91 QuicByteCount acked_bytes, |
93 QuicByteCount bytes_in_flight) = 0; | 92 QuicByteCount bytes_in_flight) = 0; |
94 | 93 |
95 // Called when a retransmission has occured which resulted in packets | 94 // Called when a retransmission has occured which resulted in packets |
96 // being retransmitted. | 95 // being retransmitted. |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 // When true, exit slow start with large cutback of congestion window. | 140 // When true, exit slow start with large cutback of congestion window. |
142 bool slow_start_large_reduction_; | 141 bool slow_start_large_reduction_; |
143 | 142 |
144 private: | 143 private: |
145 DISALLOW_COPY_AND_ASSIGN(TcpCubicSenderBase); | 144 DISALLOW_COPY_AND_ASSIGN(TcpCubicSenderBase); |
146 }; | 145 }; |
147 | 146 |
148 } // namespace net | 147 } // namespace net |
149 | 148 |
150 #endif // NET_QUIC_CONGESTION_CONTROL_TCP_CUBIC_SENDER_BASE_H_ | 149 #endif // NET_QUIC_CONGESTION_CONTROL_TCP_CUBIC_SENDER_BASE_H_ |
OLD | NEW |