| 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 612 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 682 ReceivedPacketInfo received_info; | 684 ReceivedPacketInfo received_info; |
| 683 }; | 685 }; |
| 684 | 686 |
| 685 // 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, |
| 686 // kTCP MUST be supported by all QUIC implementations to guarantee 100% | 688 // kTCP MUST be supported by all QUIC implementations to guarantee 100% |
| 687 // compatibility. | 689 // compatibility. |
| 688 enum CongestionFeedbackType { | 690 enum CongestionFeedbackType { |
| 689 kTCP, // Used to mimic TCP. | 691 kTCP, // Used to mimic TCP. |
| 690 kInterArrival, // Use additional inter arrival information. | 692 kInterArrival, // Use additional inter arrival information. |
| 691 kFixRate, // Provided for testing. | 693 kFixRate, // Provided for testing. |
| 694 kTCPBBR, // BBR implementation based on TCP congestion feedback. |
| 692 }; | 695 }; |
| 693 | 696 |
| 694 enum LossDetectionType { | 697 enum LossDetectionType { |
| 695 kNack, // Used to mimic TCP's loss detection. | 698 kNack, // Used to mimic TCP's loss detection. |
| 696 kTime, // Time based loss detection. | 699 kTime, // Time based loss detection. |
| 697 }; | 700 }; |
| 698 | 701 |
| 699 struct NET_EXPORT_PRIVATE CongestionFeedbackMessageTCP { | 702 struct NET_EXPORT_PRIVATE CongestionFeedbackMessageTCP { |
| 700 CongestionFeedbackMessageTCP(); | 703 CongestionFeedbackMessageTCP(); |
| 701 | 704 |
| (...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1071 WriteStatus status; | 1074 WriteStatus status; |
| 1072 union { | 1075 union { |
| 1073 int bytes_written; // only valid when status is OK | 1076 int bytes_written; // only valid when status is OK |
| 1074 int error_code; // only valid when status is ERROR | 1077 int error_code; // only valid when status is ERROR |
| 1075 }; | 1078 }; |
| 1076 }; | 1079 }; |
| 1077 | 1080 |
| 1078 } // namespace net | 1081 } // namespace net |
| 1079 | 1082 |
| 1080 #endif // NET_QUIC_QUIC_PROTOCOL_H_ | 1083 #endif // NET_QUIC_QUIC_PROTOCOL_H_ |
| OLD | NEW |