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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 | 103 |
104 // This is the default network timeout a for connection till the crypto | 104 // This is the default network timeout a for connection till the crypto |
105 // handshake succeeds and the negotiated timeout from the handshake is received. | 105 // handshake succeeds and the negotiated timeout from the handshake is received. |
106 const int64 kDefaultInitialTimeoutSecs = 120; // 2 mins. | 106 const int64 kDefaultInitialTimeoutSecs = 120; // 2 mins. |
107 const int64 kDefaultTimeoutSecs = 60 * 10; // 10 minutes. | 107 const int64 kDefaultTimeoutSecs = 60 * 10; // 10 minutes. |
108 const int64 kDefaultMaxTimeForCryptoHandshakeSecs = 5; // 5 secs. | 108 const int64 kDefaultMaxTimeForCryptoHandshakeSecs = 5; // 5 secs. |
109 | 109 |
110 // Default ping timeout. | 110 // Default ping timeout. |
111 const int64 kPingTimeoutSecs = 15; // 15 secs. | 111 const int64 kPingTimeoutSecs = 15; // 15 secs. |
112 | 112 |
113 // Default max packets in an FEC group. | |
114 const size_t kMaxPacketsPerFecGroup = 10; | |
115 | |
116 // We define an unsigned 16-bit floating point value, inspired by IEEE floats | 113 // We define an unsigned 16-bit floating point value, inspired by IEEE floats |
117 // (http://en.wikipedia.org/wiki/Half_precision_floating-point_format), | 114 // (http://en.wikipedia.org/wiki/Half_precision_floating-point_format), |
118 // with 5-bit exponent (bias 1), 11-bit mantissa (effective 12 with hidden | 115 // with 5-bit exponent (bias 1), 11-bit mantissa (effective 12 with hidden |
119 // bit) and denormals, but without signs, transfinites or fractions. Wire format | 116 // bit) and denormals, but without signs, transfinites or fractions. Wire format |
120 // 16 bits (little-endian byte order) are split into exponent (high 5) and | 117 // 16 bits (little-endian byte order) are split into exponent (high 5) and |
121 // mantissa (low 11) and decoded as: | 118 // mantissa (low 11) and decoded as: |
122 // uint64 value; | 119 // uint64 value; |
123 // if (exponent == 0) value = mantissa; | 120 // if (exponent == 0) value = mantissa; |
124 // else value = (mantissa | 1 << 11) << (exponent - 1) | 121 // else value = (mantissa | 1 << 11) << (exponent - 1) |
125 const int kUFloat16ExponentBits = 5; | 122 const int kUFloat16ExponentBits = 5; |
(...skipping 585 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
711 ReceivedPacketInfo received_info; | 708 ReceivedPacketInfo received_info; |
712 }; | 709 }; |
713 | 710 |
714 // Defines for all types of congestion feedback that will be negotiated in QUIC, | 711 // Defines for all types of congestion feedback that will be negotiated in QUIC, |
715 // kTCP MUST be supported by all QUIC implementations to guarantee 100% | 712 // kTCP MUST be supported by all QUIC implementations to guarantee 100% |
716 // compatibility. | 713 // compatibility. |
717 enum CongestionFeedbackType { | 714 enum CongestionFeedbackType { |
718 kTCP, // Used to mimic TCP. | 715 kTCP, // Used to mimic TCP. |
719 kInterArrival, // Use additional inter arrival information. | 716 kInterArrival, // Use additional inter arrival information. |
720 kFixRate, // Provided for testing. | 717 kFixRate, // Provided for testing. |
721 kTCPBBR, // BBR implementation based on TCP congestion feedback. | 718 }; |
| 719 |
| 720 // Defines for all types of congestion control algorithms that can be used in |
| 721 // QUIC. Note that this is separate from the congestion feedback type - |
| 722 // some congestion control algorithms may use the same feedback type |
| 723 // (Reno and Cubic are the classic example for that). |
| 724 enum CongestionControlType { |
| 725 kCubic, |
| 726 kReno, |
| 727 kFixRateCongestionControl, // Provided for testing. |
| 728 kBBR, |
722 }; | 729 }; |
723 | 730 |
724 enum LossDetectionType { | 731 enum LossDetectionType { |
725 kNack, // Used to mimic TCP's loss detection. | 732 kNack, // Used to mimic TCP's loss detection. |
726 kTime, // Time based loss detection. | 733 kTime, // Time based loss detection. |
727 }; | 734 }; |
728 | 735 |
729 struct NET_EXPORT_PRIVATE CongestionFeedbackMessageTCP { | 736 struct NET_EXPORT_PRIVATE CongestionFeedbackMessageTCP { |
730 CongestionFeedbackMessageTCP(); | 737 CongestionFeedbackMessageTCP(); |
731 | 738 |
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1067 // Stores the sequence numbers of all transmissions of this packet. | 1074 // Stores the sequence numbers of all transmissions of this packet. |
1068 // Can never be null. | 1075 // Can never be null. |
1069 SequenceNumberSet* all_transmissions; | 1076 SequenceNumberSet* all_transmissions; |
1070 // In flight packets have not been abandoned or lost. | 1077 // In flight packets have not been abandoned or lost. |
1071 bool in_flight; | 1078 bool in_flight; |
1072 }; | 1079 }; |
1073 | 1080 |
1074 } // namespace net | 1081 } // namespace net |
1075 | 1082 |
1076 #endif // NET_QUIC_QUIC_PROTOCOL_H_ | 1083 #endif // NET_QUIC_QUIC_PROTOCOL_H_ |
OLD | NEW |