| 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 // The pure virtual class for send side congestion control algorithm. | 5 // The pure virtual class for send side congestion control algorithm. |
| 6 | 6 |
| 7 #ifndef NET_QUIC_CONGESTION_CONTROL_SEND_ALGORITHM_INTERFACE_H_ | 7 #ifndef NET_QUIC_CONGESTION_CONTROL_SEND_ALGORITHM_INTERFACE_H_ |
| 8 #define NET_QUIC_CONGESTION_CONTROL_SEND_ALGORITHM_INTERFACE_H_ | 8 #define NET_QUIC_CONGESTION_CONTROL_SEND_ALGORITHM_INTERFACE_H_ |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 const SentPacketsMap& sent_packets) = 0; | 48 const SentPacketsMap& sent_packets) = 0; |
| 49 | 49 |
| 50 // Called for each received ACK, with sequence number from remote peer. | 50 // Called for each received ACK, with sequence number from remote peer. |
| 51 virtual void OnIncomingAck(QuicPacketSequenceNumber acked_sequence_number, | 51 virtual void OnIncomingAck(QuicPacketSequenceNumber acked_sequence_number, |
| 52 QuicByteCount acked_bytes, | 52 QuicByteCount acked_bytes, |
| 53 QuicTime::Delta rtt) = 0; | 53 QuicTime::Delta rtt) = 0; |
| 54 | 54 |
| 55 virtual void OnIncomingLoss(QuicTime ack_receive_time) = 0; | 55 virtual void OnIncomingLoss(QuicTime ack_receive_time) = 0; |
| 56 | 56 |
| 57 // Inform that we sent x bytes to the wire, and if that was a retransmission. | 57 // Inform that we sent x bytes to the wire, and if that was a retransmission. |
| 58 // Returns true if the packet should be tracked by the congestion manager, |
| 59 // false otherwise. This is used by implementations such as tcp_cubic_sender |
| 60 // that do not count outgoing ACK packets against the congestion window. |
| 58 // Note: this function must be called for every packet sent to the wire. | 61 // Note: this function must be called for every packet sent to the wire. |
| 59 virtual void SentPacket(QuicTime sent_time, | 62 virtual bool SentPacket(QuicTime sent_time, |
| 60 QuicPacketSequenceNumber sequence_number, | 63 QuicPacketSequenceNumber sequence_number, |
| 61 QuicByteCount bytes, | 64 QuicByteCount bytes, |
| 62 Retransmission is_retransmission) = 0; | 65 Retransmission is_retransmission, |
| 66 HasRetransmittableData is_retransmittable) = 0; |
| 63 | 67 |
| 64 // Called when a packet is timed out. | 68 // Called when a packet is timed out. |
| 65 virtual void AbandoningPacket(QuicPacketSequenceNumber sequence_number, | 69 virtual void AbandoningPacket(QuicPacketSequenceNumber sequence_number, |
| 66 QuicByteCount abandoned_bytes) = 0; | 70 QuicByteCount abandoned_bytes) = 0; |
| 67 | 71 |
| 68 // Calculate the time until we can send the next packet. | 72 // Calculate the time until we can send the next packet. |
| 69 virtual QuicTime::Delta TimeUntilSend( | 73 virtual QuicTime::Delta TimeUntilSend( |
| 70 QuicTime now, | 74 QuicTime now, |
| 71 Retransmission is_retransmission, | 75 Retransmission is_retransmission, |
| 72 HasRetransmittableData has_retransmittable_data, | 76 HasRetransmittableData has_retransmittable_data, |
| 73 IsHandshake handshake) = 0; | 77 IsHandshake handshake) = 0; |
| 74 | 78 |
| 75 // What's the current estimated bandwidth in bytes per second. | 79 // What's the current estimated bandwidth in bytes per second. |
| 76 // Returns 0 when it does not have an estimate. | 80 // Returns 0 when it does not have an estimate. |
| 77 virtual QuicBandwidth BandwidthEstimate() = 0; | 81 virtual QuicBandwidth BandwidthEstimate() = 0; |
| 78 | 82 |
| 79 // TODO(satyamshekhar): Monitor MinRtt. | 83 // TODO(satyamshekhar): Monitor MinRtt. |
| 80 virtual QuicTime::Delta SmoothedRtt() = 0; | 84 virtual QuicTime::Delta SmoothedRtt() = 0; |
| 81 | 85 |
| 82 // Get the send algorithm specific retransmission delay, called RTO in TCP, | 86 // Get the send algorithm specific retransmission delay, called RTO in TCP, |
| 83 // Note 1: the caller is responsible for sanity checking this value. | 87 // Note 1: the caller is responsible for sanity checking this value. |
| 84 // Note 2: this will return zero if we don't have enough data for an estimate. | 88 // Note 2: this will return zero if we don't have enough data for an estimate. |
| 85 virtual QuicTime::Delta RetransmissionDelay() = 0; | 89 virtual QuicTime::Delta RetransmissionDelay() = 0; |
| 86 }; | 90 }; |
| 87 | 91 |
| 88 } // namespace net | 92 } // namespace net |
| 89 | 93 |
| 90 #endif // NET_QUIC_CONGESTION_CONTROL_SEND_ALGORITHM_INTERFACE_H_ | 94 #endif // NET_QUIC_CONGESTION_CONTROL_SEND_ALGORITHM_INTERFACE_H_ |
| OLD | NEW |