| 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 17 matching lines...) Expand all Loading... |
| 28 } // namespace test | 28 } // namespace test |
| 29 | 29 |
| 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 ~TcpCubicSender() override; |
| 39 | 39 |
| 40 // Start implementation of SendAlgorithmInterface. | 40 // Start implementation of SendAlgorithmInterface. |
| 41 virtual void SetFromConfig(const QuicConfig& config, bool is_server) override; | 41 void SetFromConfig(const QuicConfig& config, bool is_server) override; |
| 42 virtual void SetNumEmulatedConnections(int num_connections) override; | 42 void SetNumEmulatedConnections(int num_connections) override; |
| 43 virtual void OnIncomingQuicCongestionFeedbackFrame( | 43 void OnIncomingQuicCongestionFeedbackFrame( |
| 44 const QuicCongestionFeedbackFrame& feedback, | 44 const QuicCongestionFeedbackFrame& feedback, |
| 45 QuicTime feedback_receive_time) override; | 45 QuicTime feedback_receive_time) override; |
| 46 virtual void OnCongestionEvent(bool rtt_updated, | 46 void OnCongestionEvent(bool rtt_updated, |
| 47 QuicByteCount bytes_in_flight, | 47 QuicByteCount bytes_in_flight, |
| 48 const CongestionVector& acked_packets, | 48 const CongestionVector& acked_packets, |
| 49 const CongestionVector& lost_packets) override; | 49 const CongestionVector& lost_packets) override; |
| 50 virtual bool OnPacketSent(QuicTime sent_time, | 50 bool OnPacketSent(QuicTime sent_time, |
| 51 QuicByteCount bytes_in_flight, | 51 QuicByteCount bytes_in_flight, |
| 52 QuicPacketSequenceNumber sequence_number, | 52 QuicPacketSequenceNumber sequence_number, |
| 53 QuicByteCount bytes, | 53 QuicByteCount bytes, |
| 54 HasRetransmittableData is_retransmittable) override; | 54 HasRetransmittableData is_retransmittable) override; |
| 55 virtual void OnRetransmissionTimeout(bool packets_retransmitted) override; | 55 void OnRetransmissionTimeout(bool packets_retransmitted) override; |
| 56 virtual void RevertRetransmissionTimeout() override; | 56 void RevertRetransmissionTimeout() override; |
| 57 virtual QuicTime::Delta TimeUntilSend( | 57 QuicTime::Delta TimeUntilSend( |
| 58 QuicTime now, | 58 QuicTime now, |
| 59 QuicByteCount bytes_in_flight, | 59 QuicByteCount bytes_in_flight, |
| 60 HasRetransmittableData has_retransmittable_data) const override; | 60 HasRetransmittableData has_retransmittable_data) const override; |
| 61 virtual QuicBandwidth PacingRate() const override; | 61 QuicBandwidth PacingRate() const override; |
| 62 virtual QuicBandwidth BandwidthEstimate() const override; | 62 QuicBandwidth BandwidthEstimate() const override; |
| 63 virtual bool HasReliableBandwidthEstimate() const override; | 63 bool HasReliableBandwidthEstimate() const override; |
| 64 virtual QuicTime::Delta RetransmissionDelay() const override; | 64 QuicTime::Delta RetransmissionDelay() const override; |
| 65 virtual QuicByteCount GetCongestionWindow() const override; | 65 QuicByteCount GetCongestionWindow() const override; |
| 66 virtual bool InSlowStart() const override; | 66 bool InSlowStart() const override; |
| 67 virtual bool InRecovery() const override; | 67 bool InRecovery() const override; |
| 68 virtual QuicByteCount GetSlowStartThreshold() const override; | 68 QuicByteCount GetSlowStartThreshold() const override; |
| 69 virtual CongestionControlType GetCongestionControlType() const override; | 69 CongestionControlType GetCongestionControlType() const override; |
| 70 // End implementation of SendAlgorithmInterface. | 70 // End implementation of SendAlgorithmInterface. |
| 71 | 71 |
| 72 private: | 72 private: |
| 73 friend class test::TcpCubicSenderPeer; | 73 friend class test::TcpCubicSenderPeer; |
| 74 | 74 |
| 75 // TODO(ianswett): Remove these and migrate to OnCongestionEvent. | 75 // TODO(ianswett): Remove these and migrate to OnCongestionEvent. |
| 76 void OnPacketAcked(QuicPacketSequenceNumber acked_sequence_number, | 76 void OnPacketAcked(QuicPacketSequenceNumber acked_sequence_number, |
| 77 QuicByteCount acked_bytes, | 77 QuicByteCount acked_bytes, |
| 78 QuicByteCount bytes_in_flight); | 78 QuicByteCount bytes_in_flight); |
| 79 void OnPacketLost(QuicPacketSequenceNumber largest_loss, | 79 void OnPacketLost(QuicPacketSequenceNumber largest_loss, |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 | 141 |
| 142 // Maximum number of outstanding packets for tcp. | 142 // Maximum number of outstanding packets for tcp. |
| 143 QuicTcpCongestionWindow max_tcp_congestion_window_; | 143 QuicTcpCongestionWindow max_tcp_congestion_window_; |
| 144 | 144 |
| 145 DISALLOW_COPY_AND_ASSIGN(TcpCubicSender); | 145 DISALLOW_COPY_AND_ASSIGN(TcpCubicSender); |
| 146 }; | 146 }; |
| 147 | 147 |
| 148 } // namespace net | 148 } // namespace net |
| 149 | 149 |
| 150 #endif // NET_QUIC_CONGESTION_CONTROL_TCP_CUBIC_SENDER_H_ | 150 #endif // NET_QUIC_CONGESTION_CONTROL_TCP_CUBIC_SENDER_H_ |
| OLD | NEW |