| 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 19 matching lines...) Expand all Loading... |
| 30 class NET_EXPORT_PRIVATE TcpCubicSender : public SendAlgorithmInterface { | 30 class NET_EXPORT_PRIVATE TcpCubicSender : public SendAlgorithmInterface { |
| 31 public: | 31 public: |
| 32 // Reno option and max_tcp_congestion_window are provided for testing. | 32 // Reno option and max_tcp_congestion_window are provided for testing. |
| 33 TcpCubicSender(const QuicClock* clock, | 33 TcpCubicSender(const QuicClock* clock, |
| 34 const RttStats* rtt_stats, | 34 const RttStats* rtt_stats, |
| 35 bool reno, | 35 bool reno, |
| 36 QuicTcpCongestionWindow max_tcp_congestion_window, | 36 QuicTcpCongestionWindow max_tcp_congestion_window, |
| 37 QuicConnectionStats* stats); | 37 QuicConnectionStats* stats); |
| 38 virtual ~TcpCubicSender(); | 38 virtual ~TcpCubicSender(); |
| 39 | 39 |
| 40 bool InSlowStart() const; | |
| 41 | |
| 42 // Start implementation of SendAlgorithmInterface. | 40 // Start implementation of SendAlgorithmInterface. |
| 43 virtual void SetFromConfig(const QuicConfig& config, bool is_server) OVERRIDE; | 41 virtual void SetFromConfig(const QuicConfig& config, bool is_server) OVERRIDE; |
| 44 virtual void OnIncomingQuicCongestionFeedbackFrame( | 42 virtual void OnIncomingQuicCongestionFeedbackFrame( |
| 45 const QuicCongestionFeedbackFrame& feedback, | 43 const QuicCongestionFeedbackFrame& feedback, |
| 46 QuicTime feedback_receive_time) OVERRIDE; | 44 QuicTime feedback_receive_time) OVERRIDE; |
| 47 virtual void OnCongestionEvent(bool rtt_updated, | 45 virtual void OnCongestionEvent(bool rtt_updated, |
| 48 QuicByteCount bytes_in_flight, | 46 QuicByteCount bytes_in_flight, |
| 49 const CongestionMap& acked_packets, | 47 const CongestionMap& acked_packets, |
| 50 const CongestionMap& lost_packets) OVERRIDE; | 48 const CongestionMap& lost_packets) OVERRIDE; |
| 51 virtual bool OnPacketSent(QuicTime sent_time, | 49 virtual bool OnPacketSent(QuicTime sent_time, |
| 52 QuicByteCount bytes_in_flight, | 50 QuicByteCount bytes_in_flight, |
| 53 QuicPacketSequenceNumber sequence_number, | 51 QuicPacketSequenceNumber sequence_number, |
| 54 QuicByteCount bytes, | 52 QuicByteCount bytes, |
| 55 HasRetransmittableData is_retransmittable) OVERRIDE; | 53 HasRetransmittableData is_retransmittable) OVERRIDE; |
| 56 virtual void OnRetransmissionTimeout(bool packets_retransmitted) OVERRIDE; | 54 virtual void OnRetransmissionTimeout(bool packets_retransmitted) OVERRIDE; |
| 57 virtual void RevertRetransmissionTimeout() OVERRIDE; | 55 virtual void RevertRetransmissionTimeout() OVERRIDE; |
| 58 virtual QuicTime::Delta TimeUntilSend( | 56 virtual QuicTime::Delta TimeUntilSend( |
| 59 QuicTime now, | 57 QuicTime now, |
| 60 QuicByteCount bytes_in_flight, | 58 QuicByteCount bytes_in_flight, |
| 61 HasRetransmittableData has_retransmittable_data) const OVERRIDE; | 59 HasRetransmittableData has_retransmittable_data) const OVERRIDE; |
| 62 virtual QuicBandwidth BandwidthEstimate() const OVERRIDE; | 60 virtual QuicBandwidth BandwidthEstimate() const OVERRIDE; |
| 63 virtual bool HasReliableBandwidthEstimate() const OVERRIDE; | 61 virtual bool HasReliableBandwidthEstimate() const OVERRIDE; |
| 64 virtual QuicTime::Delta RetransmissionDelay() const OVERRIDE; | 62 virtual QuicTime::Delta RetransmissionDelay() const OVERRIDE; |
| 65 virtual QuicByteCount GetCongestionWindow() const OVERRIDE; | 63 virtual QuicByteCount GetCongestionWindow() const OVERRIDE; |
| 64 virtual bool InSlowStart() const OVERRIDE; |
| 66 virtual QuicByteCount GetSlowStartThreshold() const OVERRIDE; | 65 virtual QuicByteCount GetSlowStartThreshold() const OVERRIDE; |
| 67 // End implementation of SendAlgorithmInterface. | 66 // End implementation of SendAlgorithmInterface. |
| 68 | 67 |
| 69 private: | 68 private: |
| 70 friend class test::TcpCubicSenderPeer; | 69 friend class test::TcpCubicSenderPeer; |
| 71 | 70 |
| 72 // TODO(ianswett): Remove these and migrate to OnCongestionEvent. | 71 // TODO(ianswett): Remove these and migrate to OnCongestionEvent. |
| 73 void OnPacketAcked(QuicPacketSequenceNumber acked_sequence_number, | 72 void OnPacketAcked(QuicPacketSequenceNumber acked_sequence_number, |
| 74 QuicByteCount acked_bytes, | 73 QuicByteCount acked_bytes, |
| 75 QuicByteCount bytes_in_flight); | 74 QuicByteCount bytes_in_flight); |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 | 135 |
| 137 // Maximum number of outstanding packets for tcp. | 136 // Maximum number of outstanding packets for tcp. |
| 138 QuicTcpCongestionWindow max_tcp_congestion_window_; | 137 QuicTcpCongestionWindow max_tcp_congestion_window_; |
| 139 | 138 |
| 140 DISALLOW_COPY_AND_ASSIGN(TcpCubicSender); | 139 DISALLOW_COPY_AND_ASSIGN(TcpCubicSender); |
| 141 }; | 140 }; |
| 142 | 141 |
| 143 } // namespace net | 142 } // namespace net |
| 144 | 143 |
| 145 #endif // NET_QUIC_CONGESTION_CONTROL_TCP_CUBIC_SENDER_H_ | 144 #endif // NET_QUIC_CONGESTION_CONTROL_TCP_CUBIC_SENDER_H_ |
| OLD | NEW |