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 #include "net/quic/quic_sent_packet_manager.h" | 5 #include "net/quic/quic_sent_packet_manager.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
9 #include "net/quic/congestion_control/pacing_sender.h" | 9 #include "net/quic/congestion_control/pacing_sender.h" |
10 #include "net/quic/quic_ack_notifier_manager.h" | 10 #include "net/quic/quic_ack_notifier_manager.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 static const int kHistoryPeriodMs = 5000; | 37 static const int kHistoryPeriodMs = 5000; |
38 | 38 |
39 static const int kDefaultRetransmissionTimeMs = 500; | 39 static const int kDefaultRetransmissionTimeMs = 500; |
40 // TCP RFC calls for 1 second RTO however Linux differs from this default and | 40 // TCP RFC calls for 1 second RTO however Linux differs from this default and |
41 // define the minimum RTO to 200ms, we will use the same until we have data to | 41 // define the minimum RTO to 200ms, we will use the same until we have data to |
42 // support a higher or lower value. | 42 // support a higher or lower value. |
43 static const int kMinRetransmissionTimeMs = 200; | 43 static const int kMinRetransmissionTimeMs = 200; |
44 static const int kMaxRetransmissionTimeMs = 60000; | 44 static const int kMaxRetransmissionTimeMs = 60000; |
45 static const size_t kMaxRetransmissions = 10; | 45 static const size_t kMaxRetransmissions = 10; |
46 | 46 |
47 // We want to make sure if we get a nack packet which triggers several | 47 // We only retransmit 2 packets per ack. |
48 // retransmissions, we don't queue up too many packets. 10 is TCP's default | 48 static const size_t kMaxRetransmissionsPerAck = 2; |
49 // initial congestion window(RFC 6928). | |
50 static const size_t kMaxRetransmissionsPerAck = kDefaultInitialWindow; | |
51 | 49 |
52 // TCP retransmits after 3 nacks. | 50 // TCP retransmits after 3 nacks. |
53 static const size_t kNumberOfNacksBeforeRetransmission = 3; | 51 static const size_t kNumberOfNacksBeforeRetransmission = 3; |
54 | 52 |
55 COMPILE_ASSERT(kHistoryPeriodMs >= kBitrateSmoothingPeriodMs, | 53 COMPILE_ASSERT(kHistoryPeriodMs >= kBitrateSmoothingPeriodMs, |
56 history_must_be_longer_or_equal_to_the_smoothing_period); | 54 history_must_be_longer_or_equal_to_the_smoothing_period); |
57 } // namespace | 55 } // namespace |
58 | 56 |
59 #define ENDPOINT (is_server_ ? "Server: " : " Client: ") | 57 #define ENDPOINT (is_server_ ? "Server: " : " Client: ") |
60 | 58 |
(...skipping 709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
770 return; | 768 return; |
771 } | 769 } |
772 | 770 |
773 using_pacing_ = true; | 771 using_pacing_ = true; |
774 send_algorithm_.reset( | 772 send_algorithm_.reset( |
775 new PacingSender(send_algorithm_.release(), | 773 new PacingSender(send_algorithm_.release(), |
776 QuicTime::Delta::FromMicroseconds(1))); | 774 QuicTime::Delta::FromMicroseconds(1))); |
777 } | 775 } |
778 | 776 |
779 } // namespace net | 777 } // namespace net |
OLD | NEW |