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 <map> | 10 #include <map> |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 // additional 8 bytes. This is a total overhead of 48 bytes. Ethernet's | 57 // additional 8 bytes. This is a total overhead of 48 bytes. Ethernet's |
58 // max packet size is 1500 bytes, 1500 - 48 = 1452. | 58 // max packet size is 1500 bytes, 1500 - 48 = 1452. |
59 const QuicByteCount kMaxPacketSize = 1452; | 59 const QuicByteCount kMaxPacketSize = 1452; |
60 // Default maximum packet size used in Linux TCP implementations. | 60 // Default maximum packet size used in Linux TCP implementations. |
61 const QuicByteCount kDefaultTCPMSS = 1460; | 61 const QuicByteCount kDefaultTCPMSS = 1460; |
62 | 62 |
63 // Maximum size of the initial congestion window in packets. | 63 // Maximum size of the initial congestion window in packets. |
64 const size_t kDefaultInitialWindow = 10; | 64 const size_t kDefaultInitialWindow = 10; |
65 const uint32 kMaxInitialWindow = 100; | 65 const uint32 kMaxInitialWindow = 100; |
66 | 66 |
67 // Default size of initial flow control window. | 67 // Default size of initial flow control window, for both stream and session. |
68 const uint32 kDefaultFlowControlSendWindow = 16 * 1024; // 16 KB | 68 const uint32 kDefaultFlowControlSendWindow = 16 * 1024; // 16 KB |
69 | 69 |
70 // Maximum size of the congestion window, in packets, for TCP congestion control | 70 // Maximum size of the congestion window, in packets, for TCP congestion control |
71 // algorithms. | 71 // algorithms. |
72 const size_t kMaxTcpCongestionWindow = 200; | 72 const size_t kMaxTcpCongestionWindow = 200; |
73 | 73 |
74 // Don't allow a client to suggest an RTT longer than 15 seconds. | 74 // Don't allow a client to suggest an RTT longer than 15 seconds. |
75 const uint32 kMaxInitialRoundTripTimeUs = 15 * kNumMicrosPerSecond; | 75 const uint32 kMaxInitialRoundTripTimeUs = 15 * kNumMicrosPerSecond; |
76 | 76 |
77 // Maximum number of open streams per connection. | 77 // Maximum number of open streams per connection. |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 // helper methods QuicVersionToQuicTag, QuicTagToQuicVersion, and | 272 // helper methods QuicVersionToQuicTag, QuicTagToQuicVersion, and |
273 // QuicVersionToString. | 273 // QuicVersionToString. |
274 enum QuicVersion { | 274 enum QuicVersion { |
275 // Special case to indicate unknown/unsupported QUIC version. | 275 // Special case to indicate unknown/unsupported QUIC version. |
276 QUIC_VERSION_UNSUPPORTED = 0, | 276 QUIC_VERSION_UNSUPPORTED = 0, |
277 | 277 |
278 QUIC_VERSION_15 = 15, | 278 QUIC_VERSION_15 = 15, |
279 QUIC_VERSION_16 = 16, | 279 QUIC_VERSION_16 = 16, |
280 QUIC_VERSION_17 = 17, | 280 QUIC_VERSION_17 = 17, |
281 QUIC_VERSION_18 = 18, | 281 QUIC_VERSION_18 = 18, |
282 QUIC_VERSION_19 = 19, // Current version. | 282 QUIC_VERSION_19 = 19, |
| 283 QUIC_VERSION_20 = 20, // Current version. |
283 }; | 284 }; |
284 | 285 |
285 // This vector contains QUIC versions which we currently support. | 286 // This vector contains QUIC versions which we currently support. |
286 // This should be ordered such that the highest supported version is the first | 287 // This should be ordered such that the highest supported version is the first |
287 // element, with subsequent elements in descending order (versions can be | 288 // element, with subsequent elements in descending order (versions can be |
288 // skipped as necessary). | 289 // skipped as necessary). |
289 // | 290 // |
290 // IMPORTANT: if you are addding to this list, follow the instructions at | 291 // IMPORTANT: if you are addding to this list, follow the instructions at |
291 // http://sites/quic/adding-and-removing-versions | 292 // http://sites/quic/adding-and-removing-versions |
292 static const QuicVersion kSupportedQuicVersions[] = {QUIC_VERSION_19, | 293 static const QuicVersion kSupportedQuicVersions[] = {QUIC_VERSION_20, |
| 294 QUIC_VERSION_19, |
293 QUIC_VERSION_18, | 295 QUIC_VERSION_18, |
294 QUIC_VERSION_17, | 296 QUIC_VERSION_17, |
295 QUIC_VERSION_16, | 297 QUIC_VERSION_16, |
296 QUIC_VERSION_15}; | 298 QUIC_VERSION_15}; |
297 | 299 |
298 typedef std::vector<QuicVersion> QuicVersionVector; | 300 typedef std::vector<QuicVersion> QuicVersionVector; |
299 | 301 |
300 // Returns a vector of QUIC versions in kSupportedQuicVersions. | 302 // Returns a vector of QUIC versions in kSupportedQuicVersions. |
301 NET_EXPORT_PRIVATE QuicVersionVector QuicSupportedVersions(); | 303 NET_EXPORT_PRIVATE QuicVersionVector QuicSupportedVersions(); |
302 | 304 |
(...skipping 758 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1061 // Stores the sequence numbers of all transmissions of this packet. | 1063 // Stores the sequence numbers of all transmissions of this packet. |
1062 // Can never be null. | 1064 // Can never be null. |
1063 SequenceNumberSet* all_transmissions; | 1065 SequenceNumberSet* all_transmissions; |
1064 // In flight packets have not been abandoned or lost. | 1066 // In flight packets have not been abandoned or lost. |
1065 bool in_flight; | 1067 bool in_flight; |
1066 }; | 1068 }; |
1067 | 1069 |
1068 } // namespace net | 1070 } // namespace net |
1069 | 1071 |
1070 #endif // NET_QUIC_QUIC_PROTOCOL_H_ | 1072 #endif // NET_QUIC_QUIC_PROTOCOL_H_ |
OLD | NEW |