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 15 matching lines...) Expand all Loading... |
26 namespace test { | 26 namespace test { |
27 class TcpCubicSenderPeer; | 27 class TcpCubicSenderPeer; |
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 bool reno, | 34 bool reno, |
35 QuicTcpCongestionWindow max_tcp_congestion_window); | 35 QuicTcpCongestionWindow max_tcp_congestion_window); |
36 virtual ~TcpCubicSender(); | 36 virtual ~TcpCubicSender() OVERRIDE; |
37 | 37 |
38 // Start implementation of SendAlgorithmInterface. | 38 // Start implementation of SendAlgorithmInterface. |
39 virtual void SetFromConfig(const QuicConfig& config, bool is_server) OVERRIDE; | 39 virtual void SetFromConfig(const QuicConfig& config, bool is_server) OVERRIDE; |
40 virtual void SetMaxPacketSize(QuicByteCount max_packet_size) OVERRIDE; | 40 virtual void SetMaxPacketSize(QuicByteCount max_packet_size) OVERRIDE; |
41 virtual void OnIncomingQuicCongestionFeedbackFrame( | 41 virtual void OnIncomingQuicCongestionFeedbackFrame( |
42 const QuicCongestionFeedbackFrame& feedback, | 42 const QuicCongestionFeedbackFrame& feedback, |
43 QuicTime feedback_receive_time, | 43 QuicTime feedback_receive_time, |
44 const SentPacketsMap& sent_packets) OVERRIDE; | 44 const SentPacketsMap& sent_packets) OVERRIDE; |
45 virtual void OnPacketAcked(QuicPacketSequenceNumber acked_sequence_number, | 45 virtual void OnPacketAcked(QuicPacketSequenceNumber acked_sequence_number, |
46 QuicByteCount acked_bytes, | 46 QuicByteCount acked_bytes, |
47 QuicTime::Delta rtt) OVERRIDE; | 47 QuicTime::Delta rtt) OVERRIDE; |
48 virtual void OnPacketLost(QuicPacketSequenceNumber largest_loss, | 48 virtual void OnPacketLost(QuicPacketSequenceNumber largest_loss, |
49 QuicTime ack_receive_time) OVERRIDE; | 49 QuicTime ack_receive_time) OVERRIDE; |
50 virtual bool OnPacketSent(QuicTime sent_time, | 50 virtual bool OnPacketSent(QuicTime sent_time, |
51 QuicPacketSequenceNumber sequence_number, | 51 QuicPacketSequenceNumber sequence_number, |
52 QuicByteCount bytes, | 52 QuicByteCount bytes, |
53 TransmissionType transmission_type, | 53 TransmissionType transmission_type, |
54 HasRetransmittableData is_retransmittable) OVERRIDE; | 54 HasRetransmittableData is_retransmittable) OVERRIDE; |
55 virtual void OnRetransmissionTimeout() OVERRIDE; | 55 virtual void OnRetransmissionTimeout(bool packets_retransmitted) OVERRIDE; |
56 virtual void OnPacketAbandoned(QuicPacketSequenceNumber sequence_number, | 56 virtual void OnPacketAbandoned(QuicPacketSequenceNumber sequence_number, |
57 QuicByteCount abandoned_bytes) OVERRIDE; | 57 QuicByteCount abandoned_bytes) OVERRIDE; |
58 virtual QuicTime::Delta TimeUntilSend( | 58 virtual QuicTime::Delta TimeUntilSend( |
59 QuicTime now, | 59 QuicTime now, |
60 TransmissionType transmission_type, | 60 TransmissionType transmission_type, |
61 HasRetransmittableData has_retransmittable_data, | 61 HasRetransmittableData has_retransmittable_data, |
62 IsHandshake handshake) OVERRIDE; | 62 IsHandshake handshake) OVERRIDE; |
63 virtual QuicBandwidth BandwidthEstimate() const OVERRIDE; | 63 virtual QuicBandwidth BandwidthEstimate() const OVERRIDE; |
64 virtual QuicTime::Delta SmoothedRtt() const OVERRIDE; | 64 virtual QuicTime::Delta SmoothedRtt() const OVERRIDE; |
65 virtual QuicTime::Delta RetransmissionDelay() const OVERRIDE; | 65 virtual QuicTime::Delta RetransmissionDelay() const OVERRIDE; |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 // Approximation of standard deviation, the error is roughly 1.25 times | 127 // Approximation of standard deviation, the error is roughly 1.25 times |
128 // larger than the standard deviation, for a normally distributed signal. | 128 // larger than the standard deviation, for a normally distributed signal. |
129 QuicTime::Delta mean_deviation_; | 129 QuicTime::Delta mean_deviation_; |
130 | 130 |
131 DISALLOW_COPY_AND_ASSIGN(TcpCubicSender); | 131 DISALLOW_COPY_AND_ASSIGN(TcpCubicSender); |
132 }; | 132 }; |
133 | 133 |
134 } // namespace net | 134 } // namespace net |
135 | 135 |
136 #endif // NET_QUIC_CONGESTION_CONTROL_TCP_CUBIC_SENDER_H_ | 136 #endif // NET_QUIC_CONGESTION_CONTROL_TCP_CUBIC_SENDER_H_ |
OLD | NEW |