| 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 behaviour of | 5 // TCP cubic send side congestion algorithm, emulates the behaviour 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 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 13 #include "net/base/net_export.h" | 13 #include "net/base/net_export.h" |
| 14 #include "net/quic/congestion_control/cubic.h" | 14 #include "net/quic/congestion_control/cubic.h" |
| 15 #include "net/quic/congestion_control/hybrid_slow_start.h" | 15 #include "net/quic/congestion_control/hybrid_slow_start.h" |
| 16 #include "net/quic/congestion_control/send_algorithm_interface.h" | 16 #include "net/quic/congestion_control/send_algorithm_interface.h" |
| 17 #include "net/quic/quic_bandwidth.h" | 17 #include "net/quic/quic_bandwidth.h" |
| 18 #include "net/quic/quic_clock.h" | |
| 19 #include "net/quic/quic_protocol.h" | 18 #include "net/quic/quic_protocol.h" |
| 20 #include "net/quic/quic_time.h" | 19 #include "net/quic/quic_time.h" |
| 21 | 20 |
| 22 namespace net { | 21 namespace net { |
| 23 | 22 |
| 24 namespace test { | 23 namespace test { |
| 25 class TcpCubicSenderPeer; | 24 class TcpCubicSenderPeer; |
| 26 } // namespace test | 25 } // namespace test |
| 27 | 26 |
| 28 class NET_EXPORT_PRIVATE TcpCubicSender : public SendAlgorithmInterface { | 27 class NET_EXPORT_PRIVATE TcpCubicSender : public SendAlgorithmInterface { |
| 29 public: | 28 public: |
| 30 // Reno option provided for testing. | 29 // Reno option provided for testing. |
| 31 TcpCubicSender(const QuicClock* clock, bool reno); | 30 TcpCubicSender(const QuicClock* clock, bool reno); |
| 32 | 31 |
| 33 // Start implementation of SendAlgorithmInterface. | 32 // Start implementation of SendAlgorithmInterface. |
| 34 virtual void OnIncomingQuicCongestionFeedbackFrame( | 33 virtual void OnIncomingQuicCongestionFeedbackFrame( |
| 35 const QuicCongestionFeedbackFrame& feedback, | 34 const QuicCongestionFeedbackFrame& feedback, |
| 35 QuicTime feedback_receive_time, |
| 36 QuicBandwidth sent_bandwidth, |
| 36 const SentPacketsMap& sent_packets) OVERRIDE; | 37 const SentPacketsMap& sent_packets) OVERRIDE; |
| 37 virtual void OnIncomingAck(QuicPacketSequenceNumber acked_sequence_number, | 38 virtual void OnIncomingAck(QuicPacketSequenceNumber acked_sequence_number, |
| 38 QuicByteCount acked_bytes, | 39 QuicByteCount acked_bytes, |
| 39 QuicTime::Delta rtt) OVERRIDE; | 40 QuicTime::Delta rtt) OVERRIDE; |
| 40 virtual void OnIncomingLoss(int number_of_lost_packets) OVERRIDE; | 41 virtual void OnIncomingLoss(QuicTime ack_receive_time) OVERRIDE; |
| 41 virtual void SentPacket(QuicPacketSequenceNumber sequence_number, | 42 virtual void SentPacket(QuicTime sent_time, |
| 43 QuicPacketSequenceNumber sequence_number, |
| 42 QuicByteCount bytes, | 44 QuicByteCount bytes, |
| 43 bool is_retransmission) OVERRIDE; | 45 bool is_retransmission) OVERRIDE; |
| 44 virtual QuicTime::Delta TimeUntilSend(bool is_retransmission) OVERRIDE; | 46 virtual QuicTime::Delta TimeUntilSend(QuicTime now, |
| 47 bool is_retransmission) OVERRIDE; |
| 45 virtual QuicBandwidth BandwidthEstimate() OVERRIDE; | 48 virtual QuicBandwidth BandwidthEstimate() OVERRIDE; |
| 46 // End implementation of SendAlgorithmInterface. | 49 // End implementation of SendAlgorithmInterface. |
| 47 | 50 |
| 48 private: | 51 private: |
| 49 friend class test::TcpCubicSenderPeer; | 52 friend class test::TcpCubicSenderPeer; |
| 50 | 53 |
| 51 QuicByteCount AvailableCongestionWindow(); | 54 QuicByteCount AvailableCongestionWindow(); |
| 52 QuicByteCount CongestionWindow(); | 55 QuicByteCount CongestionWindow(); |
| 53 void Reset(); | 56 void Reset(); |
| 54 void AckAccounting(QuicTime::Delta rtt); | 57 void AckAccounting(QuicTime::Delta rtt); |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 | 89 |
| 87 // Min RTT during this session. | 90 // Min RTT during this session. |
| 88 QuicTime::Delta delay_min_; | 91 QuicTime::Delta delay_min_; |
| 89 | 92 |
| 90 DISALLOW_COPY_AND_ASSIGN(TcpCubicSender); | 93 DISALLOW_COPY_AND_ASSIGN(TcpCubicSender); |
| 91 }; | 94 }; |
| 92 | 95 |
| 93 } // namespace net | 96 } // namespace net |
| 94 | 97 |
| 95 #endif // NET_QUIC_CONGESTION_CONTROL_TCP_CUBIC_SENDER_H_ | 98 #endif // NET_QUIC_CONGESTION_CONTROL_TCP_CUBIC_SENDER_H_ |
| OLD | NEW |