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 25 matching lines...) Expand all Loading... |
36 virtual ~TcpCubicSender(); | 36 virtual ~TcpCubicSender(); |
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) OVERRIDE; |
47 QuicTime::Delta rtt) OVERRIDE; | |
48 virtual void OnPacketLost(QuicPacketSequenceNumber largest_loss, | 47 virtual void OnPacketLost(QuicPacketSequenceNumber largest_loss, |
49 QuicTime ack_receive_time) OVERRIDE; | 48 QuicTime ack_receive_time) OVERRIDE; |
50 virtual bool OnPacketSent(QuicTime sent_time, | 49 virtual bool OnPacketSent(QuicTime sent_time, |
51 QuicPacketSequenceNumber sequence_number, | 50 QuicPacketSequenceNumber sequence_number, |
52 QuicByteCount bytes, | 51 QuicByteCount bytes, |
53 TransmissionType transmission_type, | 52 TransmissionType transmission_type, |
54 HasRetransmittableData is_retransmittable) OVERRIDE; | 53 HasRetransmittableData is_retransmittable) OVERRIDE; |
55 virtual void OnRetransmissionTimeout(bool packets_retransmitted) OVERRIDE; | 54 virtual void OnRetransmissionTimeout(bool packets_retransmitted) OVERRIDE; |
56 virtual void OnPacketAbandoned(QuicPacketSequenceNumber sequence_number, | 55 virtual void OnPacketAbandoned(QuicPacketSequenceNumber sequence_number, |
57 QuicByteCount abandoned_bytes) OVERRIDE; | 56 QuicByteCount abandoned_bytes) OVERRIDE; |
58 virtual QuicTime::Delta TimeUntilSend( | 57 virtual QuicTime::Delta TimeUntilSend( |
59 QuicTime now, | 58 QuicTime now, |
60 TransmissionType transmission_type, | 59 TransmissionType transmission_type, |
61 HasRetransmittableData has_retransmittable_data, | 60 HasRetransmittableData has_retransmittable_data, |
62 IsHandshake handshake) OVERRIDE; | 61 IsHandshake handshake) OVERRIDE; |
63 virtual QuicBandwidth BandwidthEstimate() const OVERRIDE; | 62 virtual QuicBandwidth BandwidthEstimate() const OVERRIDE; |
| 63 virtual void UpdateRtt(QuicTime::Delta rtt_sample) 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; |
66 virtual QuicByteCount GetCongestionWindow() const OVERRIDE; | 66 virtual QuicByteCount GetCongestionWindow() const OVERRIDE; |
67 // End implementation of SendAlgorithmInterface. | 67 // End implementation of SendAlgorithmInterface. |
68 | 68 |
69 private: | 69 private: |
70 friend class test::TcpCubicSenderPeer; | 70 friend class test::TcpCubicSenderPeer; |
71 | 71 |
72 QuicByteCount AvailableSendWindow(); | 72 QuicByteCount AvailableSendWindow(); |
73 QuicByteCount SendWindow(); | 73 QuicByteCount SendWindow(); |
74 void Reset(); | 74 void Reset(); |
75 void AckAccounting(QuicTime::Delta rtt); | |
76 void CongestionAvoidance(QuicPacketSequenceNumber ack); | 75 void CongestionAvoidance(QuicPacketSequenceNumber ack); |
77 bool IsCwndLimited() const; | 76 bool IsCwndLimited() const; |
78 void OnTimeOut(); | 77 void OnTimeOut(); |
79 | 78 |
80 HybridSlowStart hybrid_slow_start_; | 79 HybridSlowStart hybrid_slow_start_; |
81 Cubic cubic_; | 80 Cubic cubic_; |
82 | 81 |
83 // Reno provided for testing. | 82 // Reno provided for testing. |
84 const bool reno_; | 83 const bool reno_; |
85 | 84 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 // Approximation of standard deviation, the error is roughly 1.25 times | 126 // Approximation of standard deviation, the error is roughly 1.25 times |
128 // larger than the standard deviation, for a normally distributed signal. | 127 // larger than the standard deviation, for a normally distributed signal. |
129 QuicTime::Delta mean_deviation_; | 128 QuicTime::Delta mean_deviation_; |
130 | 129 |
131 DISALLOW_COPY_AND_ASSIGN(TcpCubicSender); | 130 DISALLOW_COPY_AND_ASSIGN(TcpCubicSender); |
132 }; | 131 }; |
133 | 132 |
134 } // namespace net | 133 } // namespace net |
135 | 134 |
136 #endif // NET_QUIC_CONGESTION_CONTROL_TCP_CUBIC_SENDER_H_ | 135 #endif // NET_QUIC_CONGESTION_CONTROL_TCP_CUBIC_SENDER_H_ |
OLD | NEW |