OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "net/quic/congestion_control/tcp_loss_algorithm.h" | 5 #include "net/quic/congestion_control/tcp_loss_algorithm.h" |
6 | 6 |
7 #include "net/quic/congestion_control/rtt_stats.h" | 7 #include "net/quic/congestion_control/rtt_stats.h" |
8 #include "net/quic/quic_protocol.h" | 8 #include "net/quic/quic_protocol.h" |
9 | 9 |
10 namespace net { | 10 namespace net { |
11 | 11 |
12 namespace { | 12 namespace { |
13 | |
14 // TCP retransmits after 3 nacks. | |
15 static const size_t kNumberOfNacksBeforeRetransmission = 3; | |
16 | |
17 // How many RTTs the algorithm waits before determining a packet is lost due | 13 // How many RTTs the algorithm waits before determining a packet is lost due |
18 // to early retransmission. | 14 // to early retransmission. |
19 static const double kEarlyRetransmitLossDelayMultiplier = 1.25; | 15 static const double kEarlyRetransmitLossDelayMultiplier = 1.25; |
20 | |
21 } | 16 } |
22 | 17 |
23 TCPLossAlgorithm::TCPLossAlgorithm() | 18 TCPLossAlgorithm::TCPLossAlgorithm() |
24 : loss_detection_timeout_(QuicTime::Zero()) { } | 19 : loss_detection_timeout_(QuicTime::Zero()) { } |
25 | 20 |
26 LossDetectionType TCPLossAlgorithm::GetLossDetectionType() const { | 21 LossDetectionType TCPLossAlgorithm::GetLossDetectionType() const { |
27 return kNack; | 22 return kNack; |
28 } | 23 } |
29 | 24 |
30 // Uses nack counts to decide when packets are lost. | 25 // Uses nack counts to decide when packets are lost. |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 } | 68 } |
74 | 69 |
75 return lost_packets; | 70 return lost_packets; |
76 } | 71 } |
77 | 72 |
78 QuicTime TCPLossAlgorithm::GetLossTimeout() const { | 73 QuicTime TCPLossAlgorithm::GetLossTimeout() const { |
79 return loss_detection_timeout_; | 74 return loss_detection_timeout_; |
80 } | 75 } |
81 | 76 |
82 } // namespace net | 77 } // namespace net |
OLD | NEW |