OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #ifndef NET_QUIC_QUIC_SENT_PACKET_MANAGER_H_ | 5 #ifndef NET_QUIC_QUIC_SENT_PACKET_MANAGER_H_ |
6 #define NET_QUIC_QUIC_SENT_PACKET_MANAGER_H_ | 6 #define NET_QUIC_QUIC_SENT_PACKET_MANAGER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <utility> | 10 #include <utility> |
(...skipping 30 matching lines...) Expand all Loading... |
41 class NET_EXPORT_PRIVATE QuicSentPacketManager { | 41 class NET_EXPORT_PRIVATE QuicSentPacketManager { |
42 public: | 42 public: |
43 // Interface which gets callbacks from the QuicSentPacketManager at | 43 // Interface which gets callbacks from the QuicSentPacketManager at |
44 // interesting points. Implementations must not mutate the state of | 44 // interesting points. Implementations must not mutate the state of |
45 // the packet manager or connection as a result of these callbacks. | 45 // the packet manager or connection as a result of these callbacks. |
46 class NET_EXPORT_PRIVATE DebugDelegate { | 46 class NET_EXPORT_PRIVATE DebugDelegate { |
47 public: | 47 public: |
48 virtual ~DebugDelegate() {} | 48 virtual ~DebugDelegate() {} |
49 | 49 |
50 // Called when a spurious retransmission is detected. | 50 // Called when a spurious retransmission is detected. |
51 virtual void OnSpuriousPacketRetransmition( | 51 virtual void OnSpuriousPacketRetransmission( |
52 TransmissionType transmission_type, | 52 TransmissionType transmission_type, |
53 QuicByteCount byte_size) {} | 53 QuicByteCount byte_size) {} |
54 | 54 |
55 virtual void OnIncomingAck( | 55 virtual void OnIncomingAck( |
56 const QuicAckFrame& ack_frame, | 56 const QuicAckFrame& ack_frame, |
57 QuicTime ack_receive_time, | 57 QuicTime ack_receive_time, |
58 QuicPacketSequenceNumber largest_observed, | 58 QuicPacketSequenceNumber largest_observed, |
59 bool rtt_updated, | 59 bool rtt_updated, |
60 QuicPacketSequenceNumber least_unacked_sent_packet) {} | 60 QuicPacketSequenceNumber least_unacked_sent_packet) {} |
61 }; | 61 }; |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 // congestion window has been recently reduced, of if non-full packets are | 210 // congestion window has been recently reduced, of if non-full packets are |
211 // sent. | 211 // sent. |
212 QuicPacketCount EstimateMaxPacketsInFlight( | 212 QuicPacketCount EstimateMaxPacketsInFlight( |
213 QuicByteCount max_packet_length) const; | 213 QuicByteCount max_packet_length) const; |
214 | 214 |
215 // Returns the size of the slow start congestion window in nume of 1460 byte | 215 // Returns the size of the slow start congestion window in nume of 1460 byte |
216 // TCP segments, aka ssthresh. Some send algorithms do not define a slow | 216 // TCP segments, aka ssthresh. Some send algorithms do not define a slow |
217 // start threshold and will return 0. | 217 // start threshold and will return 0. |
218 QuicPacketCount GetSlowStartThresholdInTcpMss() const; | 218 QuicPacketCount GetSlowStartThresholdInTcpMss() const; |
219 | 219 |
| 220 // Called by the connection every time it receives a serialized packet. |
| 221 void OnSerializedPacket(const SerializedPacket& serialized_packet); |
| 222 |
220 // Enables pacing if it has not already been enabled. | 223 // Enables pacing if it has not already been enabled. |
221 void EnablePacing(); | 224 void EnablePacing(); |
222 | 225 |
223 bool using_pacing() const { return using_pacing_; } | 226 bool using_pacing() const { return using_pacing_; } |
224 | 227 |
225 void set_debug_delegate(DebugDelegate* debug_delegate) { | 228 void set_debug_delegate(DebugDelegate* debug_delegate) { |
226 debug_delegate_ = debug_delegate; | 229 debug_delegate_ = debug_delegate; |
227 } | 230 } |
228 | 231 |
229 QuicPacketSequenceNumber largest_observed() const { | 232 QuicPacketSequenceNumber largest_observed() const { |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 | 283 |
281 // Process the incoming ack looking for newly ack'd data packets. | 284 // Process the incoming ack looking for newly ack'd data packets. |
282 void HandleAckForSentPackets(const QuicAckFrame& ack_frame); | 285 void HandleAckForSentPackets(const QuicAckFrame& ack_frame); |
283 | 286 |
284 // Returns the current retransmission mode. | 287 // Returns the current retransmission mode. |
285 RetransmissionTimeoutMode GetRetransmissionMode() const; | 288 RetransmissionTimeoutMode GetRetransmissionMode() const; |
286 | 289 |
287 // Retransmits all crypto stream packets. | 290 // Retransmits all crypto stream packets. |
288 void RetransmitCryptoPackets(); | 291 void RetransmitCryptoPackets(); |
289 | 292 |
| 293 // Retransmits two packets for an RTO and removes any non-retransmittable |
| 294 // packets from flight. |
| 295 void RetransmitRtoPackets(); |
| 296 |
290 // Retransmits all the packets and abandons by invoking a full RTO. | 297 // Retransmits all the packets and abandons by invoking a full RTO. |
291 void RetransmitAllPackets(); | 298 void RetransmitAllPackets(); |
292 | 299 |
293 // Returns the timer for retransmitting crypto handshake packets. | 300 // Returns the timer for retransmitting crypto handshake packets. |
294 const QuicTime::Delta GetCryptoRetransmissionDelay() const; | 301 const QuicTime::Delta GetCryptoRetransmissionDelay() const; |
295 | 302 |
296 // Returns the timer for a new tail loss probe. | 303 // Returns the timer for a new tail loss probe. |
297 const QuicTime::Delta GetTailLossProbeDelay() const; | 304 const QuicTime::Delta GetTailLossProbeDelay() const; |
298 | 305 |
299 // Returns the retransmission timeout, after which a full RTO occurs. | 306 // Returns the retransmission timeout, after which a full RTO occurs. |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
383 | 390 |
384 // Tracks the first RTO packet. If any packet before that packet gets acked, | 391 // Tracks the first RTO packet. If any packet before that packet gets acked, |
385 // it indicates the RTO was spurious and should be reversed(F-RTO). | 392 // it indicates the RTO was spurious and should be reversed(F-RTO). |
386 QuicPacketSequenceNumber first_rto_transmission_; | 393 QuicPacketSequenceNumber first_rto_transmission_; |
387 // Number of times the RTO timer has fired in a row without receiving an ack. | 394 // Number of times the RTO timer has fired in a row without receiving an ack. |
388 size_t consecutive_rto_count_; | 395 size_t consecutive_rto_count_; |
389 // Number of times the tail loss probe has been sent. | 396 // Number of times the tail loss probe has been sent. |
390 size_t consecutive_tlp_count_; | 397 size_t consecutive_tlp_count_; |
391 // Number of times the crypto handshake has been retransmitted. | 398 // Number of times the crypto handshake has been retransmitted. |
392 size_t consecutive_crypto_retransmission_count_; | 399 size_t consecutive_crypto_retransmission_count_; |
393 // Number of pending transmissions of TLP or crypto packets. | 400 // Number of pending transmissions of TLP, RTO, or crypto packets. |
394 size_t pending_timer_transmission_count_; | 401 size_t pending_timer_transmission_count_; |
395 // Maximum number of tail loss probes to send before firing an RTO. | 402 // Maximum number of tail loss probes to send before firing an RTO. |
396 size_t max_tail_loss_probes_; | 403 size_t max_tail_loss_probes_; |
397 bool using_pacing_; | 404 bool using_pacing_; |
398 | 405 |
399 // Vectors packets acked and lost as a result of the last congestion event. | 406 // Vectors packets acked and lost as a result of the last congestion event. |
400 SendAlgorithmInterface::CongestionVector packets_acked_; | 407 SendAlgorithmInterface::CongestionVector packets_acked_; |
401 SendAlgorithmInterface::CongestionVector packets_lost_; | 408 SendAlgorithmInterface::CongestionVector packets_lost_; |
402 | 409 |
403 // Set to true after the crypto handshake has successfully completed. After | 410 // Set to true after the crypto handshake has successfully completed. After |
404 // this is true we no longer use HANDSHAKE_MODE, and further frames sent on | 411 // this is true we no longer use HANDSHAKE_MODE, and further frames sent on |
405 // the crypto stream (i.e. SCUP messages) are treated like normal | 412 // the crypto stream (i.e. SCUP messages) are treated like normal |
406 // retransmittable frames. | 413 // retransmittable frames. |
407 bool handshake_confirmed_; | 414 bool handshake_confirmed_; |
408 | 415 |
409 // Records bandwidth from server to client in normal operation, over periods | 416 // Records bandwidth from server to client in normal operation, over periods |
410 // of time with no loss events. | 417 // of time with no loss events. |
411 QuicSustainedBandwidthRecorder sustained_bandwidth_recorder_; | 418 QuicSustainedBandwidthRecorder sustained_bandwidth_recorder_; |
412 | 419 |
413 DISALLOW_COPY_AND_ASSIGN(QuicSentPacketManager); | 420 DISALLOW_COPY_AND_ASSIGN(QuicSentPacketManager); |
414 }; | 421 }; |
415 | 422 |
416 } // namespace net | 423 } // namespace net |
417 | 424 |
418 #endif // NET_QUIC_QUIC_SENT_PACKET_MANAGER_H_ | 425 #endif // NET_QUIC_QUIC_SENT_PACKET_MANAGER_H_ |
OLD | NEW |