| 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 typedef uint32 QuicPriority; | 50 typedef uint32 QuicPriority; |
| 51 | 51 |
| 52 // TODO(rch): Consider Quic specific names for these constants. | 52 // TODO(rch): Consider Quic specific names for these constants. |
| 53 // Default and initial maximum size in bytes of a QUIC packet. | 53 // Default and initial maximum size in bytes of a QUIC packet. |
| 54 const QuicByteCount kDefaultMaxPacketSize = 1200; | 54 const QuicByteCount kDefaultMaxPacketSize = 1200; |
| 55 // The maximum packet size of any QUIC packet, based on ethernet's max size, | 55 // The maximum packet size of any QUIC packet, based on ethernet's max size, |
| 56 // minus the IP and UDP headers. IPv6 has a 40 byte header, UPD adds an | 56 // minus the IP and UDP headers. IPv6 has a 40 byte header, UPD adds an |
| 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. |
| 61 const QuicByteCount kDefaultTCPMSS = 1460; |
| 60 | 62 |
| 61 // Maximum size of the initial congestion window in packets. | 63 // Maximum size of the initial congestion window in packets. |
| 62 const size_t kDefaultInitialWindow = 10; | 64 const size_t kDefaultInitialWindow = 10; |
| 63 const uint32 kMaxInitialWindow = 100; | 65 const uint32 kMaxInitialWindow = 100; |
| 64 | 66 |
| 65 // Default size of initial flow control window. | 67 // Default size of initial flow control window. |
| 66 const uint32 kDefaultFlowControlSendWindow = 16 * 1024; // 16 KB | 68 const uint32 kDefaultFlowControlSendWindow = 16 * 1024; // 16 KB |
| 67 | 69 |
| 68 // 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 |
| 69 // algorithms. | 71 // algorithms. |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 QUIC_VERSION_19 = 19, // Current version. | 270 QUIC_VERSION_19 = 19, // Current version. |
| 269 }; | 271 }; |
| 270 | 272 |
| 271 // This vector contains QUIC versions which we currently support. | 273 // This vector contains QUIC versions which we currently support. |
| 272 // This should be ordered such that the highest supported version is the first | 274 // This should be ordered such that the highest supported version is the first |
| 273 // element, with subsequent elements in descending order (versions can be | 275 // element, with subsequent elements in descending order (versions can be |
| 274 // skipped as necessary). | 276 // skipped as necessary). |
| 275 // | 277 // |
| 276 // IMPORTANT: if you are addding to this list, follow the instructions at | 278 // IMPORTANT: if you are addding to this list, follow the instructions at |
| 277 // http://sites/quic/adding-and-removing-versions | 279 // http://sites/quic/adding-and-removing-versions |
| 278 static const QuicVersion kSupportedQuicVersions[] = {QUIC_VERSION_18, | 280 static const QuicVersion kSupportedQuicVersions[] = {QUIC_VERSION_19, |
| 281 QUIC_VERSION_18, |
| 279 QUIC_VERSION_17, | 282 QUIC_VERSION_17, |
| 280 QUIC_VERSION_16, | 283 QUIC_VERSION_16, |
| 281 QUIC_VERSION_15}; | 284 QUIC_VERSION_15}; |
| 282 | 285 |
| 283 typedef std::vector<QuicVersion> QuicVersionVector; | 286 typedef std::vector<QuicVersion> QuicVersionVector; |
| 284 | 287 |
| 285 // Returns a vector of QUIC versions in kSupportedQuicVersions. | 288 // Returns a vector of QUIC versions in kSupportedQuicVersions. |
| 286 NET_EXPORT_PRIVATE QuicVersionVector QuicSupportedVersions(); | 289 NET_EXPORT_PRIVATE QuicVersionVector QuicSupportedVersions(); |
| 287 | 290 |
| 288 // QuicTag is written to and read from the wire, but we prefer to use | 291 // QuicTag is written to and read from the wire, but we prefer to use |
| (...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 681 ReceivedPacketInfo received_info; | 684 ReceivedPacketInfo received_info; |
| 682 }; | 685 }; |
| 683 | 686 |
| 684 // Defines for all types of congestion feedback that will be negotiated in QUIC, | 687 // Defines for all types of congestion feedback that will be negotiated in QUIC, |
| 685 // kTCP MUST be supported by all QUIC implementations to guarantee 100% | 688 // kTCP MUST be supported by all QUIC implementations to guarantee 100% |
| 686 // compatibility. | 689 // compatibility. |
| 687 enum CongestionFeedbackType { | 690 enum CongestionFeedbackType { |
| 688 kTCP, // Used to mimic TCP. | 691 kTCP, // Used to mimic TCP. |
| 689 kInterArrival, // Use additional inter arrival information. | 692 kInterArrival, // Use additional inter arrival information. |
| 690 kFixRate, // Provided for testing. | 693 kFixRate, // Provided for testing. |
| 694 kTCPBBR, // BBR implementation based on TCP congestion feedback. |
| 691 }; | 695 }; |
| 692 | 696 |
| 693 enum LossDetectionType { | 697 enum LossDetectionType { |
| 694 kNack, // Used to mimic TCP's loss detection. | 698 kNack, // Used to mimic TCP's loss detection. |
| 695 kTime, // Time based loss detection. | 699 kTime, // Time based loss detection. |
| 696 }; | 700 }; |
| 697 | 701 |
| 698 struct NET_EXPORT_PRIVATE CongestionFeedbackMessageTCP { | 702 struct NET_EXPORT_PRIVATE CongestionFeedbackMessageTCP { |
| 699 CongestionFeedbackMessageTCP(); | 703 CongestionFeedbackMessageTCP(); |
| 700 | 704 |
| (...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1070 WriteStatus status; | 1074 WriteStatus status; |
| 1071 union { | 1075 union { |
| 1072 int bytes_written; // only valid when status is OK | 1076 int bytes_written; // only valid when status is OK |
| 1073 int error_code; // only valid when status is ERROR | 1077 int error_code; // only valid when status is ERROR |
| 1074 }; | 1078 }; |
| 1075 }; | 1079 }; |
| 1076 | 1080 |
| 1077 } // namespace net | 1081 } // namespace net |
| 1078 | 1082 |
| 1079 #endif // NET_QUIC_QUIC_PROTOCOL_H_ | 1083 #endif // NET_QUIC_QUIC_PROTOCOL_H_ |
| OLD | NEW |