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 #ifndef NET_QUIC_QUIC_PROTOCOL_H_ | 5 #ifndef NET_QUIC_QUIC_PROTOCOL_H_ |
6 #define NET_QUIC_QUIC_PROTOCOL_H_ | 6 #define NET_QUIC_QUIC_PROTOCOL_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <limits> | 9 #include <limits> |
10 #include <list> | 10 #include <list> |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 | 74 |
75 // Maximum size of the CWND, in packets, for TCP congestion control algorithms. | 75 // Maximum size of the CWND, in packets, for TCP congestion control algorithms. |
76 const QuicPacketCount kMaxTcpCongestionWindow = 200; | 76 const QuicPacketCount kMaxTcpCongestionWindow = 200; |
77 | 77 |
78 // Default size of the socket receive buffer in bytes. | 78 // Default size of the socket receive buffer in bytes. |
79 const QuicByteCount kDefaultSocketReceiveBuffer = 256 * 1024; | 79 const QuicByteCount kDefaultSocketReceiveBuffer = 256 * 1024; |
80 // Minimum size of the socket receive buffer in bytes. | 80 // Minimum size of the socket receive buffer in bytes. |
81 // Smaller values are ignored. | 81 // Smaller values are ignored. |
82 const QuicByteCount kMinSocketReceiveBuffer = 16 * 1024; | 82 const QuicByteCount kMinSocketReceiveBuffer = 16 * 1024; |
83 | 83 |
| 84 // Fraction of the receive buffer that can be used for encrypted bytes. |
| 85 // Allows a 5% overhead for IP and UDP framing, as well as ack only packets. |
| 86 static const float kUsableRecieveBufferFraction = 0.95f; |
| 87 |
84 // Don't allow a client to suggest an RTT shorter than 10ms. | 88 // Don't allow a client to suggest an RTT shorter than 10ms. |
85 const uint32 kMinInitialRoundTripTimeUs = 10 * kNumMicrosPerMilli; | 89 const uint32 kMinInitialRoundTripTimeUs = 10 * kNumMicrosPerMilli; |
86 | 90 |
87 // Don't allow a client to suggest an RTT longer than 15 seconds. | 91 // Don't allow a client to suggest an RTT longer than 15 seconds. |
88 const uint32 kMaxInitialRoundTripTimeUs = 15 * kNumMicrosPerSecond; | 92 const uint32 kMaxInitialRoundTripTimeUs = 15 * kNumMicrosPerSecond; |
89 | 93 |
90 // Maximum number of open streams per connection. | 94 // Maximum number of open streams per connection. |
91 const size_t kDefaultMaxStreamsPerConnection = 100; | 95 const size_t kDefaultMaxStreamsPerConnection = 100; |
92 | 96 |
93 // Number of bytes reserved for public flags in the packet header. | 97 // Number of bytes reserved for public flags in the packet header. |
(...skipping 953 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1047 bool in_flight; | 1051 bool in_flight; |
1048 // True if the packet can never be acked, so it can be removed. | 1052 // True if the packet can never be acked, so it can be removed. |
1049 bool is_unackable; | 1053 bool is_unackable; |
1050 // True if the packet is an FEC packet. | 1054 // True if the packet is an FEC packet. |
1051 bool is_fec_packet; | 1055 bool is_fec_packet; |
1052 }; | 1056 }; |
1053 | 1057 |
1054 } // namespace net | 1058 } // namespace net |
1055 | 1059 |
1056 #endif // NET_QUIC_QUIC_PROTOCOL_H_ | 1060 #endif // NET_QUIC_QUIC_PROTOCOL_H_ |
OLD | NEW |