blob: 64d0c234ca3493b0ec608c73bfb4001aa4cdfc87 [file] [log] [blame]
[email protected]8b37a092012-10-18 21:53:491// 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
3// found in the LICENSE file.
4
5#ifndef NET_QUIC_QUIC_PROTOCOL_H_
6#define NET_QUIC_QUIC_PROTOCOL_H_
7
[email protected]e537f742012-12-07 15:33:538#include <stddef.h>
[email protected]8b37a092012-10-18 21:53:499#include <limits>
rtenneti4b06ae72014-08-26 03:43:4310#include <list>
[email protected]a674b4c2012-12-05 03:44:3011#include <map>
[email protected]5640d0a2012-10-22 18:17:0212#include <ostream>
[email protected]e537f742012-12-07 15:33:5313#include <set>
14#include <string>
[email protected]8b37a092012-10-18 21:53:4915#include <utility>
16#include <vector>
17
18#include "base/basictypes.h"
[email protected]14c1c232013-06-11 17:52:4419#include "base/containers/hash_tables.h"
[email protected]8b37a092012-10-18 21:53:4920#include "base/logging.h"
[email protected]d069c11a2013-04-13 00:01:5521#include "base/strings/string_piece.h"
[email protected]165e0752012-11-16 07:49:4422#include "net/base/int128.h"
[email protected]79d13dcb2014-02-05 07:23:1323#include "net/base/ip_endpoint.h"
[email protected]8b37a092012-10-18 21:53:4924#include "net/base/net_export.h"
[email protected]5dafdb62013-11-14 01:24:2625#include "net/quic/iovector.h"
[email protected]fee17f72013-02-03 07:47:4126#include "net/quic/quic_bandwidth.h"
[email protected]2a960e02012-11-11 14:48:1027#include "net/quic/quic_time.h"
[email protected]8b37a092012-10-18 21:53:4928
29namespace net {
30
[email protected]97cf3022013-09-05 14:30:1631class QuicAckNotifier;
[email protected]8b37a092012-10-18 21:53:4932class QuicPacket;
[email protected]b064310782013-05-30 21:12:1733struct QuicPacketHeader;
[email protected]8b37a092012-10-18 21:53:4934
[email protected]3aa9ca72014-02-27 19:39:4335typedef uint64 QuicConnectionId;
[email protected]8b37a092012-10-18 21:53:4936typedef uint32 QuicStreamId;
37typedef uint64 QuicStreamOffset;
38typedef uint64 QuicPacketSequenceNumber;
[email protected]c995c572013-01-18 05:43:2039typedef QuicPacketSequenceNumber QuicFecGroupNumber;
[email protected]86a318d2013-01-23 21:16:0440typedef uint64 QuicPublicResetNonceProof;
[email protected]9db443912013-02-25 05:27:0341typedef uint8 QuicPacketEntropyHash;
[email protected]c244c5a12013-05-07 20:55:0442typedef uint32 QuicHeaderId;
[email protected]2532de12013-05-09 12:29:3343// QuicTag is the type of a tag in the wire protocol.
44typedef uint32 QuicTag;
45typedef std::vector<QuicTag> QuicTagVector;
[email protected]79d13dcb2014-02-05 07:23:1346typedef std::map<QuicTag, std::string> QuicTagValueMap;
[email protected]497bfb22014-01-08 01:28:0347// TODO(rtenneti): Didn't use SpdyPriority because SpdyPriority is uint8 and
48// QuicPriority is uint32. Use SpdyPriority when we change the QUIC_VERSION.
[email protected]8edeb8d2013-08-28 06:11:4349typedef uint32 QuicPriority;
[email protected]cff7b7b2013-01-11 08:49:0750
[email protected]8b37a092012-10-18 21:53:4951// TODO(rch): Consider Quic specific names for these constants.
[email protected]8e01c062013-10-31 07:35:3152// Default and initial maximum size in bytes of a QUIC packet.
[email protected]310d37b2014-08-02 06:15:3753const QuicByteCount kDefaultMaxPacketSize = 1350;
[email protected]8e01c062013-10-31 07:35:3154// The maximum packet size of any QUIC packet, based on ethernet's max size,
[email protected]41fb6372013-12-10 05:26:4055// minus the IP and UDP headers. IPv6 has a 40 byte header, UPD adds an
56// additional 8 bytes. This is a total overhead of 48 bytes. Ethernet's
57// max packet size is 1500 bytes, 1500 - 48 = 1452.
58const QuicByteCount kMaxPacketSize = 1452;
[email protected]ce7bb1412014-05-17 15:51:3359// Default maximum packet size used in Linux TCP implementations.
60const QuicByteCount kDefaultTCPMSS = 1460;
[email protected]8e01c062013-10-31 07:35:3161
62// Maximum size of the initial congestion window in packets.
63const size_t kDefaultInitialWindow = 10;
[email protected]2d43c40122014-04-21 14:51:2764const uint32 kMaxInitialWindow = 100;
[email protected]8e01c062013-10-31 07:35:3165
[email protected]7d561352014-06-20 09:09:2166// Default size of initial flow control window, for both stream and session.
[email protected]9bb57c72014-03-31 20:36:0467const uint32 kDefaultFlowControlSendWindow = 16 * 1024; // 16 KB
68
[email protected]0ac0c5b2013-11-20 05:55:5869// Maximum size of the congestion window, in packets, for TCP congestion control
70// algorithms.
71const size_t kMaxTcpCongestionWindow = 200;
72
rtenneti23186682014-10-30 01:49:3373// Default size of the socket receive buffer in bytes.
[email protected]648f81142014-08-15 21:38:4674const QuicByteCount kDefaultSocketReceiveBuffer = 256 * 1024;
rtenneti23186682014-10-30 01:49:3375// Minimum size of the socket receive buffer in bytes.
76// Smaller values are ignored.
77const QuicByteCount kMinSocketReceiveBuffer = 16 * 1024;
[email protected]a97b3182014-08-08 08:10:1878
[email protected]8e01c062013-10-31 07:35:3179// Don't allow a client to suggest an RTT longer than 15 seconds.
[email protected]2d43c40122014-04-21 14:51:2780const uint32 kMaxInitialRoundTripTimeUs = 15 * kNumMicrosPerSecond;
[email protected]8b37a092012-10-18 21:53:4981
82// Maximum number of open streams per connection.
83const size_t kDefaultMaxStreamsPerConnection = 100;
84
[email protected]af806e62013-05-22 14:47:5085// Number of bytes reserved for public flags in the packet header.
86const size_t kPublicFlagsSize = 1;
[email protected]5351cc4b2013-03-03 07:22:4187// Number of bytes reserved for version number in the packet header.
88const size_t kQuicVersionSize = 4;
[email protected]c995c572013-01-18 05:43:2089// Number of bytes reserved for private flags in the packet header.
90const size_t kPrivateFlagsSize = 1;
91// Number of bytes reserved for FEC group in the packet header.
92const size_t kFecGroupSize = 1;
[email protected]5351cc4b2013-03-03 07:22:4193
94// Signifies that the QuicPacket will contain version of the protocol.
95const bool kIncludeVersion = true;
[email protected]c995c572013-01-18 05:43:2096
[email protected]5351cc4b2013-03-03 07:22:4197// Index of the first byte in a QUIC packet which is used in hash calculation.
98const size_t kStartOfHashData = 0;
[email protected]8b37a092012-10-18 21:53:4999
100// Limit on the delta between stream IDs.
[email protected]c5cc9bd2014-03-31 23:17:14101const QuicStreamId kMaxStreamIdDelta = 200;
[email protected]c244c5a12013-05-07 20:55:04102// Limit on the delta between header IDs.
[email protected]c5cc9bd2014-03-31 23:17:14103const QuicHeaderId kMaxHeaderIdDelta = 200;
[email protected]8b37a092012-10-18 21:53:49104
105// Reserved ID for the crypto stream.
[email protected]8b37a092012-10-18 21:53:49106const QuicStreamId kCryptoStreamId = 1;
107
[email protected]4d640792013-12-18 22:21:08108// Reserved ID for the headers stream.
109const QuicStreamId kHeadersStreamId = 3;
110
[email protected]648f81142014-08-15 21:38:46111// Maximum delayed ack time, in ms.
pkastingacec86f2014-10-14 23:08:55112const int64 kMaxDelayedAckTimeMs = 25;
[email protected]648f81142014-08-15 21:38:46113
rtennetib5512bb2014-09-29 19:17:15114// The timeout before the handshake succeeds.
115const int64 kInitialIdleTimeoutSecs = 5;
116// The default idle timeout.
117const int64 kDefaultIdleTimeoutSecs = 30;
rtenneti31e9fd62014-09-16 05:22:15118// The maximum idle timeout that can be negotiated.
119const int64 kMaximumIdleTimeoutSecs = 60 * 10; // 10 minutes.
120// The default timeout for a connection until the crypto handshake succeeds.
rtennetib5512bb2014-09-29 19:17:15121const int64 kMaxTimeForCryptoHandshakeSecs = 10; // 10 secs.
[email protected]8b37a092012-10-18 21:53:49122
rtenneti93bce7ece2014-10-13 22:38:41123// Default limit on the number of undecryptable packets the connection buffers
124// before the CHLO/SHLO arrive.
125const size_t kDefaultMaxUndecryptablePackets = 10;
126
[email protected]525948df2014-04-21 06:26:58127// Default ping timeout.
128const int64 kPingTimeoutSecs = 15; // 15 secs.
129
[email protected]ca4e0d92014-08-22 16:33:22130// Minimum number of RTTs between Server Config Updates (SCUP) sent to client.
131const int kMinIntervalBetweenServerConfigUpdatesRTTs = 10;
132
133// Minimum time between Server Config Updates (SCUP) sent to client.
134const int kMinIntervalBetweenServerConfigUpdatesMs = 1000;
135
rtenneti33da8ab2014-11-04 04:17:00136// Minimum number of packets between Server Config Updates (SCUP).
137const int kMinPacketsBetweenServerConfigUpdates = 100;
138
rtennetib5512bb2014-09-29 19:17:15139// The number of open streams that a server will accept is set to be slightly
140// larger than the negotiated limit. Immediately closing the connection if the
141// client opens slightly too many streams is not ideal: the client may have sent
142// a FIN that was lost, and simultaneously opened a new stream. The number of
143// streams a server accepts is a fixed increment over the negotiated limit, or a
144// percentage increase, whichever is larger.
rtenneti31e9fd62014-09-16 05:22:15145const float kMaxStreamsMultiplier = 1.1f;
rtennetib5512bb2014-09-29 19:17:15146const int kMaxStreamsMinimumIncrement = 10;
rtenneti31e9fd62014-09-16 05:22:15147
[email protected]b007e632013-10-28 08:39:25148// We define an unsigned 16-bit floating point value, inspired by IEEE floats
149// (http://en.wikipedia.org/wiki/Half_precision_floating-point_format),
150// with 5-bit exponent (bias 1), 11-bit mantissa (effective 12 with hidden
151// bit) and denormals, but without signs, transfinites or fractions. Wire format
152// 16 bits (little-endian byte order) are split into exponent (high 5) and
153// mantissa (low 11) and decoded as:
154// uint64 value;
155// if (exponent == 0) value = mantissa;
156// else value = (mantissa | 1 << 11) << (exponent - 1)
157const int kUFloat16ExponentBits = 5;
158const int kUFloat16MaxExponent = (1 << kUFloat16ExponentBits) - 2; // 30
159const int kUFloat16MantissaBits = 16 - kUFloat16ExponentBits; // 11
160const int kUFloat16MantissaEffectiveBits = kUFloat16MantissaBits + 1; // 12
161const uint64 kUFloat16MaxValue = // 0x3FFC0000000
162 ((GG_UINT64_C(1) << kUFloat16MantissaEffectiveBits) - 1) <<
163 kUFloat16MaxExponent;
164
[email protected]c67a82cb2013-09-24 02:53:21165enum TransmissionType {
[email protected]2532de12013-05-09 12:29:33166 NOT_RETRANSMISSION,
[email protected]b9475b582014-03-20 20:04:33167 FIRST_TRANSMISSION_TYPE = NOT_RETRANSMISSION,
168 HANDSHAKE_RETRANSMISSION, // Retransmits due to handshake timeouts.
rtenneti31e9fd62014-09-16 05:22:15169 ALL_UNACKED_RETRANSMISSION, // Retransmits all unacked packets.
170 ALL_INITIAL_RETRANSMISSION, // Retransmits all initially encrypted packets.
[email protected]b9475b582014-03-20 20:04:33171 LOSS_RETRANSMISSION, // Retransmits due to loss detection.
172 RTO_RETRANSMISSION, // Retransmits due to retransmit time out.
173 TLP_RETRANSMISSION, // Tail loss probes.
174 LAST_TRANSMISSION_TYPE = TLP_RETRANSMISSION,
[email protected]74bda142013-03-31 02:49:11175};
176
177enum HasRetransmittableData {
[email protected]2532de12013-05-09 12:29:33178 NO_RETRANSMITTABLE_DATA,
179 HAS_RETRANSMITTABLE_DATA,
[email protected]74bda142013-03-31 02:49:11180};
181
[email protected]575cce62013-08-03 02:06:43182enum IsHandshake {
183 NOT_HANDSHAKE,
184 IS_HANDSHAKE
185};
186
[email protected]bbb10072014-06-13 07:41:59187// Indicates FEC protection level for data being written.
188enum FecProtection {
189 MUST_FEC_PROTECT, // Callee must FEC protect this data.
[email protected]a5b98172014-06-18 07:01:59190 MAY_FEC_PROTECT // Callee does not have to but may FEC protect this data.
191};
192
[email protected]bc356fe2014-06-19 11:14:14193// Indicates FEC policy.
[email protected]a5b98172014-06-18 07:01:59194enum FecPolicy {
195 FEC_PROTECT_ALWAYS, // All data in the stream should be FEC protected.
196 FEC_PROTECT_OPTIONAL // Data in the stream does not need FEC protection.
[email protected]bbb10072014-06-13 07:41:59197};
198
[email protected]be24ab22012-10-22 03:01:52199enum QuicFrameType {
[email protected]6ae6e342014-02-06 02:21:42200 // Regular frame types. The values set here cannot change without the
201 // introduction of a new QUIC version.
[email protected]c995c572013-01-18 05:43:20202 PADDING_FRAME = 0,
[email protected]6ae6e342014-02-06 02:21:42203 RST_STREAM_FRAME = 1,
204 CONNECTION_CLOSE_FRAME = 2,
205 GOAWAY_FRAME = 3,
206 WINDOW_UPDATE_FRAME = 4,
207 BLOCKED_FRAME = 5,
[email protected]93dd91f2014-02-27 00:09:03208 STOP_WAITING_FRAME = 6,
[email protected]d8c522112014-04-23 09:23:25209 PING_FRAME = 7,
[email protected]6ae6e342014-02-06 02:21:42210
211 // STREAM, ACK, and CONGESTION_FEEDBACK frames are special frames. They are
212 // encoded differently on the wire and their values do not need to be stable.
[email protected]97cf3022013-09-05 14:30:16213 STREAM_FRAME,
214 ACK_FRAME,
215 CONGESTION_FEEDBACK_FRAME,
[email protected]be24ab22012-10-22 03:01:52216 NUM_FRAME_TYPES
[email protected]8b37a092012-10-18 21:53:49217};
218
[email protected]3aa9ca72014-02-27 19:39:43219enum QuicConnectionIdLength {
220 PACKET_0BYTE_CONNECTION_ID = 0,
221 PACKET_1BYTE_CONNECTION_ID = 1,
222 PACKET_4BYTE_CONNECTION_ID = 4,
223 PACKET_8BYTE_CONNECTION_ID = 8
[email protected]b064310782013-05-30 21:12:17224};
225
226enum InFecGroup {
227 NOT_IN_FEC_GROUP,
228 IN_FEC_GROUP,
229};
230
[email protected]25c31dc2013-06-05 17:56:04231enum QuicSequenceNumberLength {
232 PACKET_1BYTE_SEQUENCE_NUMBER = 1,
233 PACKET_2BYTE_SEQUENCE_NUMBER = 2,
234 PACKET_4BYTE_SEQUENCE_NUMBER = 4,
235 PACKET_6BYTE_SEQUENCE_NUMBER = 6
236};
237
[email protected]8e01c062013-10-31 07:35:31238// Used to indicate a QuicSequenceNumberLength using two flag bits.
239enum QuicSequenceNumberLengthFlags {
240 PACKET_FLAGS_1BYTE_SEQUENCE = 0, // 00
241 PACKET_FLAGS_2BYTE_SEQUENCE = 1, // 01
242 PACKET_FLAGS_4BYTE_SEQUENCE = 1 << 1, // 10
243 PACKET_FLAGS_6BYTE_SEQUENCE = 1 << 1 | 1, // 11
244};
245
[email protected]f62262b2013-07-05 20:57:30246// The public flags are specified in one byte.
[email protected]c995c572013-01-18 05:43:20247enum QuicPacketPublicFlags {
248 PACKET_PUBLIC_FLAGS_NONE = 0,
[email protected]f62262b2013-07-05 20:57:30249
250 // Bit 0: Does the packet header contains version info?
251 PACKET_PUBLIC_FLAGS_VERSION = 1 << 0,
252
253 // Bit 1: Is this packet a public reset packet?
254 PACKET_PUBLIC_FLAGS_RST = 1 << 1,
255
[email protected]3aa9ca72014-02-27 19:39:43256 // Bits 2 and 3 specify the length of the ConnectionId as follows:
[email protected]f62262b2013-07-05 20:57:30257 // ----00--: 0 bytes
258 // ----01--: 1 byte
259 // ----10--: 4 bytes
260 // ----11--: 8 bytes
[email protected]3aa9ca72014-02-27 19:39:43261 PACKET_PUBLIC_FLAGS_0BYTE_CONNECTION_ID = 0,
262 PACKET_PUBLIC_FLAGS_1BYTE_CONNECTION_ID = 1 << 2,
263 PACKET_PUBLIC_FLAGS_4BYTE_CONNECTION_ID = 1 << 3,
264 PACKET_PUBLIC_FLAGS_8BYTE_CONNECTION_ID = 1 << 3 | 1 << 2,
[email protected]f62262b2013-07-05 20:57:30265
266 // Bits 4 and 5 describe the packet sequence number length as follows:
267 // --00----: 1 byte
268 // --01----: 2 bytes
269 // --10----: 4 bytes
270 // --11----: 6 bytes
[email protected]8e01c062013-10-31 07:35:31271 PACKET_PUBLIC_FLAGS_1BYTE_SEQUENCE = PACKET_FLAGS_1BYTE_SEQUENCE << 4,
272 PACKET_PUBLIC_FLAGS_2BYTE_SEQUENCE = PACKET_FLAGS_2BYTE_SEQUENCE << 4,
273 PACKET_PUBLIC_FLAGS_4BYTE_SEQUENCE = PACKET_FLAGS_4BYTE_SEQUENCE << 4,
274 PACKET_PUBLIC_FLAGS_6BYTE_SEQUENCE = PACKET_FLAGS_6BYTE_SEQUENCE << 4,
[email protected]f62262b2013-07-05 20:57:30275
276 // All bits set (bits 6 and 7 are not currently used): 00111111
277 PACKET_PUBLIC_FLAGS_MAX = (1 << 6) - 1
[email protected]c995c572013-01-18 05:43:20278};
[email protected]8b37a092012-10-18 21:53:49279
[email protected]f62262b2013-07-05 20:57:30280// The private flags are specified in one byte.
[email protected]c995c572013-01-18 05:43:20281enum QuicPacketPrivateFlags {
282 PACKET_PRIVATE_FLAGS_NONE = 0,
[email protected]f62262b2013-07-05 20:57:30283
284 // Bit 0: Does this packet contain an entropy bit?
[email protected]b064310782013-05-30 21:12:17285 PACKET_PRIVATE_FLAGS_ENTROPY = 1 << 0,
[email protected]f62262b2013-07-05 20:57:30286
287 // Bit 1: Payload is part of an FEC group?
288 PACKET_PRIVATE_FLAGS_FEC_GROUP = 1 << 1,
289
290 // Bit 2: Payload is FEC as opposed to frames?
291 PACKET_PRIVATE_FLAGS_FEC = 1 << 2,
292
293 // All bits set (bits 3-7 are not currently used): 00000111
294 PACKET_PRIVATE_FLAGS_MAX = (1 << 3) - 1
[email protected]c995c572013-01-18 05:43:20295};
296
[email protected]48878092013-07-26 14:51:56297// The available versions of QUIC. Guaranteed that the integer value of the enum
298// will match the version number.
299// When adding a new version to this enum you should add it to
[email protected]8bbfaeb72013-08-09 06:38:26300// kSupportedQuicVersions (if appropriate), and also add a new case to the
301// helper methods QuicVersionToQuicTag, QuicTagToQuicVersion, and
302// QuicVersionToString.
[email protected]48878092013-07-26 14:51:56303enum QuicVersion {
304 // Special case to indicate unknown/unsupported QUIC version.
305 QUIC_VERSION_UNSUPPORTED = 0,
306
[email protected]7afc2ebe2014-07-18 16:06:23307 QUIC_VERSION_19 = 19, // Connection level flow control.
[email protected]0c6b10ad2014-07-02 19:47:00308 QUIC_VERSION_21 = 21, // Headers/crypto streams are flow controlled.
[email protected]9693157b2014-08-08 11:13:49309 QUIC_VERSION_22 = 22, // Send Server Config Update messages on crypto stream.
rtenneti4b06ae72014-08-26 03:43:43310 QUIC_VERSION_23 = 23, // Timestamp in the ack frame.
[email protected]48878092013-07-26 14:51:56311};
312
313// This vector contains QUIC versions which we currently support.
314// This should be ordered such that the highest supported version is the first
315// element, with subsequent elements in descending order (versions can be
316// skipped as necessary).
[email protected]31ae854842013-11-27 00:05:46317//
[email protected]310d37b2014-08-02 06:15:37318// IMPORTANT: if you are adding to this list, follow the instructions at
[email protected]31ae854842013-11-27 00:05:46319// http://sites/quic/adding-and-removing-versions
rtenneti4b06ae72014-08-26 03:43:43320static const QuicVersion kSupportedQuicVersions[] = {QUIC_VERSION_23,
321 QUIC_VERSION_22,
rtenneti6afc6f42014-10-21 02:15:15322 QUIC_VERSION_19};
[email protected]48878092013-07-26 14:51:56323
324typedef std::vector<QuicVersion> QuicVersionVector;
325
[email protected]b007e632013-10-28 08:39:25326// Returns a vector of QUIC versions in kSupportedQuicVersions.
327NET_EXPORT_PRIVATE QuicVersionVector QuicSupportedVersions();
[email protected]ea2ab47b2013-08-13 00:44:11328
[email protected]48878092013-07-26 14:51:56329// QuicTag is written to and read from the wire, but we prefer to use
330// the more readable QuicVersion at other levels.
331// Helper function which translates from a QuicVersion to a QuicTag. Returns 0
332// if QuicVersion is unsupported.
333NET_EXPORT_PRIVATE QuicTag QuicVersionToQuicTag(const QuicVersion version);
334
335// Returns appropriate QuicVersion from a QuicTag.
336// Returns QUIC_VERSION_UNSUPPORTED if version_tag cannot be understood.
337NET_EXPORT_PRIVATE QuicVersion QuicTagToQuicVersion(const QuicTag version_tag);
338
339// Helper function which translates from a QuicVersion to a string.
340// Returns strings corresponding to enum names (e.g. QUIC_VERSION_6).
341NET_EXPORT_PRIVATE std::string QuicVersionToString(const QuicVersion version);
342
343// Returns comma separated list of string representations of QuicVersion enum
[email protected]b007e632013-10-28 08:39:25344// values in the supplied |versions| vector.
345NET_EXPORT_PRIVATE std::string QuicVersionVectorToString(
346 const QuicVersionVector& versions);
[email protected]48878092013-07-26 14:51:56347
348// Version and Crypto tags are written to the wire with a big-endian
349// representation of the name of the tag. For example
350// the client hello tag (CHLO) will be written as the
351// following 4 bytes: 'C' 'H' 'L' 'O'. Since it is
352// stored in memory as a little endian uint32, we need
353// to reverse the order of the bytes.
354
355// MakeQuicTag returns a value given the four bytes. For example:
356// MakeQuicTag('C', 'H', 'L', 'O');
357NET_EXPORT_PRIVATE QuicTag MakeQuicTag(char a, char b, char c, char d);
358
[email protected]9cda5fd2014-06-03 10:20:28359// Returns true if the tag vector contains the specified tag.
[email protected]cc1aa272014-06-30 19:48:22360NET_EXPORT_PRIVATE bool ContainsQuicTag(const QuicTagVector& tag_vector,
361 QuicTag tag);
[email protected]9cda5fd2014-06-03 10:20:28362
[email protected]b064310782013-05-30 21:12:17363// Size in bytes of the data or fec packet header.
[email protected]79d13dcb2014-02-05 07:23:13364NET_EXPORT_PRIVATE size_t GetPacketHeaderSize(const QuicPacketHeader& header);
[email protected]b064310782013-05-30 21:12:17365
[email protected]25c31dc2013-06-05 17:56:04366NET_EXPORT_PRIVATE size_t GetPacketHeaderSize(
[email protected]3aa9ca72014-02-27 19:39:43367 QuicConnectionIdLength connection_id_length,
[email protected]25c31dc2013-06-05 17:56:04368 bool include_version,
369 QuicSequenceNumberLength sequence_number_length,
370 InFecGroup is_in_fec_group);
[email protected]b064310782013-05-30 21:12:17371
[email protected]b064310782013-05-30 21:12:17372// Index of the first byte in a QUIC packet of FEC protected data.
[email protected]25c31dc2013-06-05 17:56:04373NET_EXPORT_PRIVATE size_t GetStartOfFecProtectedData(
[email protected]3aa9ca72014-02-27 19:39:43374 QuicConnectionIdLength connection_id_length,
[email protected]25c31dc2013-06-05 17:56:04375 bool include_version,
376 QuicSequenceNumberLength sequence_number_length);
[email protected]b064310782013-05-30 21:12:17377// Index of the first byte in a QUIC packet of encrypted data.
[email protected]25c31dc2013-06-05 17:56:04378NET_EXPORT_PRIVATE size_t GetStartOfEncryptedData(
[email protected]3aa9ca72014-02-27 19:39:43379 QuicConnectionIdLength connection_id_length,
[email protected]25c31dc2013-06-05 17:56:04380 bool include_version,
381 QuicSequenceNumberLength sequence_number_length);
[email protected]b064310782013-05-30 21:12:17382
[email protected]74bda142013-03-31 02:49:11383enum QuicRstStreamErrorCode {
384 QUIC_STREAM_NO_ERROR = 0,
[email protected]8b37a092012-10-18 21:53:49385
[email protected]24e5bc52013-09-18 15:36:58386 // There was some error which halted stream processing.
387 QUIC_ERROR_PROCESSING_STREAM,
[email protected]8b37a092012-10-18 21:53:49388 // We got two fin or reset offsets which did not match.
389 QUIC_MULTIPLE_TERMINATION_OFFSETS,
390 // We got bad payload and can not respond to it at the protocol level.
391 QUIC_BAD_APPLICATION_PAYLOAD,
[email protected]74bda142013-03-31 02:49:11392 // Stream closed due to connection error. No reset frame is sent when this
393 // happens.
394 QUIC_STREAM_CONNECTION_ERROR,
395 // GoAway frame sent. No more stream can be created.
396 QUIC_STREAM_PEER_GOING_AWAY,
[email protected]06ff5152013-08-29 01:03:05397 // The stream has been cancelled.
398 QUIC_STREAM_CANCELLED,
[email protected]51cc1342014-04-18 23:44:37399 // Sending a RST to allow for proper flow control accounting.
400 QUIC_RST_FLOW_CONTROL_ACCOUNTING,
[email protected]8b37a092012-10-18 21:53:49401
[email protected]74bda142013-03-31 02:49:11402 // No error. Used as bound while iterating.
403 QUIC_STREAM_LAST_ERROR,
404};
[email protected]8b37a092012-10-18 21:53:49405
[email protected]51cc1342014-04-18 23:44:37406// Because receiving an unknown QuicRstStreamErrorCode results in connection
407// teardown, we use this to make sure any errors predating a given version are
408// downgraded to the most appropriate existing error.
409NET_EXPORT_PRIVATE QuicRstStreamErrorCode AdjustErrorForVersion(
410 QuicRstStreamErrorCode error_code,
411 QuicVersion version);
412
[email protected]89264042013-08-21 07:35:24413// These values must remain stable as they are uploaded to UMA histograms.
414// To add a new error code, use the current value of QUIC_LAST_ERROR and
415// increment QUIC_LAST_ERROR.
[email protected]74bda142013-03-31 02:49:11416enum QuicErrorCode {
417 QUIC_NO_ERROR = 0,
418
419 // Connection has reached an invalid state.
[email protected]89264042013-08-21 07:35:24420 QUIC_INTERNAL_ERROR = 1,
[email protected]74bda142013-03-31 02:49:11421 // There were data frames after the a fin or reset.
[email protected]89264042013-08-21 07:35:24422 QUIC_STREAM_DATA_AFTER_TERMINATION = 2,
[email protected]8b37a092012-10-18 21:53:49423 // Control frame is malformed.
[email protected]89264042013-08-21 07:35:24424 QUIC_INVALID_PACKET_HEADER = 3,
[email protected]be24ab22012-10-22 03:01:52425 // Frame data is malformed.
[email protected]89264042013-08-21 07:35:24426 QUIC_INVALID_FRAME_DATA = 4,
427 // The packet contained no payload.
428 QUIC_MISSING_PAYLOAD = 48,
[email protected]8b37a092012-10-18 21:53:49429 // FEC data is malformed.
[email protected]89264042013-08-21 07:35:24430 QUIC_INVALID_FEC_DATA = 5,
431 // STREAM frame data is malformed.
432 QUIC_INVALID_STREAM_DATA = 46,
[email protected]42a3eba2014-04-30 10:52:55433 // STREAM frame data is not encrypted.
434 QUIC_UNENCRYPTED_STREAM_DATA = 61,
[email protected]89264042013-08-21 07:35:24435 // RST_STREAM frame data is malformed.
436 QUIC_INVALID_RST_STREAM_DATA = 6,
437 // CONNECTION_CLOSE frame data is malformed.
438 QUIC_INVALID_CONNECTION_CLOSE_DATA = 7,
439 // GOAWAY frame data is malformed.
440 QUIC_INVALID_GOAWAY_DATA = 8,
[email protected]6ae6e342014-02-06 02:21:42441 // WINDOW_UPDATE frame data is malformed.
442 QUIC_INVALID_WINDOW_UPDATE_DATA = 57,
443 // BLOCKED frame data is malformed.
444 QUIC_INVALID_BLOCKED_DATA = 58,
[email protected]93dd91f2014-02-27 00:09:03445 // STOP_WAITING frame data is malformed.
446 QUIC_INVALID_STOP_WAITING_DATA = 60,
[email protected]89264042013-08-21 07:35:24447 // ACK frame data is malformed.
448 QUIC_INVALID_ACK_DATA = 9,
449 // CONGESTION_FEEDBACK frame data is malformed.
450 QUIC_INVALID_CONGESTION_FEEDBACK_DATA = 47,
[email protected]14e8106c2013-03-14 16:25:33451 // Version negotiation packet is malformed.
[email protected]89264042013-08-21 07:35:24452 QUIC_INVALID_VERSION_NEGOTIATION_PACKET = 10,
[email protected]899951652013-05-16 12:52:39453 // Public RST packet is malformed.
[email protected]89264042013-08-21 07:35:24454 QUIC_INVALID_PUBLIC_RST_PACKET = 11,
[email protected]8b37a092012-10-18 21:53:49455 // There was an error decrypting.
[email protected]89264042013-08-21 07:35:24456 QUIC_DECRYPTION_FAILURE = 12,
[email protected]8b37a092012-10-18 21:53:49457 // There was an error encrypting.
[email protected]89264042013-08-21 07:35:24458 QUIC_ENCRYPTION_FAILURE = 13,
[email protected]8b37a092012-10-18 21:53:49459 // The packet exceeded kMaxPacketSize.
[email protected]89264042013-08-21 07:35:24460 QUIC_PACKET_TOO_LARGE = 14,
[email protected]8b37a092012-10-18 21:53:49461 // Data was sent for a stream which did not exist.
[email protected]89264042013-08-21 07:35:24462 QUIC_PACKET_FOR_NONEXISTENT_STREAM = 15,
[email protected]9db443912013-02-25 05:27:03463 // The peer is going away. May be a client or server.
[email protected]89264042013-08-21 07:35:24464 QUIC_PEER_GOING_AWAY = 16,
[email protected]8b37a092012-10-18 21:53:49465 // A stream ID was invalid.
[email protected]89264042013-08-21 07:35:24466 QUIC_INVALID_STREAM_ID = 17,
[email protected]24e5bc52013-09-18 15:36:58467 // A priority was invalid.
468 QUIC_INVALID_PRIORITY = 49,
[email protected]8b37a092012-10-18 21:53:49469 // Too many streams already open.
[email protected]89264042013-08-21 07:35:24470 QUIC_TOO_MANY_OPEN_STREAMS = 18,
[email protected]9693157b2014-08-08 11:13:49471 // The peer must send a FIN/RST for each stream, and has not been doing so.
472 QUIC_TOO_MANY_UNFINISHED_STREAMS = 66,
[email protected]86a318d2013-01-23 21:16:04473 // Received public reset for this connection.
[email protected]89264042013-08-21 07:35:24474 QUIC_PUBLIC_RESET = 19,
[email protected]c244c5a12013-05-07 20:55:04475 // Invalid protocol version.
[email protected]89264042013-08-21 07:35:24476 QUIC_INVALID_VERSION = 20,
[email protected]92bf17c2014-03-03 21:14:03477
478 // deprecated: QUIC_STREAM_RST_BEFORE_HEADERS_DECOMPRESSED = 21
479
[email protected]c244c5a12013-05-07 20:55:04480 // The Header ID for a stream was too far from the previous.
[email protected]89264042013-08-21 07:35:24481 QUIC_INVALID_HEADER_ID = 22,
[email protected]899951652013-05-16 12:52:39482 // Negotiable parameter received during handshake had invalid value.
[email protected]89264042013-08-21 07:35:24483 QUIC_INVALID_NEGOTIATED_VALUE = 23,
[email protected]899951652013-05-16 12:52:39484 // There was an error decompressing data.
[email protected]89264042013-08-21 07:35:24485 QUIC_DECOMPRESSION_FAILURE = 24,
[email protected]8b37a092012-10-18 21:53:49486 // We hit our prenegotiated (or default) timeout
[email protected]89264042013-08-21 07:35:24487 QUIC_CONNECTION_TIMED_OUT = 25,
rtenneti31e9fd62014-09-16 05:22:15488 // We hit our overall connection timeout
489 QUIC_CONNECTION_OVERALL_TIMED_OUT = 67,
[email protected]899951652013-05-16 12:52:39490 // There was an error encountered migrating addresses
[email protected]89264042013-08-21 07:35:24491 QUIC_ERROR_MIGRATING_ADDRESS = 26,
[email protected]1505a512013-09-04 22:59:35492 // There was an error while writing to the socket.
[email protected]89264042013-08-21 07:35:24493 QUIC_PACKET_WRITE_ERROR = 27,
[email protected]1505a512013-09-04 22:59:35494 // There was an error while reading from the socket.
495 QUIC_PACKET_READ_ERROR = 51,
[email protected]24e5bc52013-09-18 15:36:58496 // We received a STREAM_FRAME with no data and no fin flag set.
497 QUIC_INVALID_STREAM_FRAME = 50,
[email protected]4d640792013-12-18 22:21:08498 // We received invalid data on the headers stream.
499 QUIC_INVALID_HEADERS_STREAM_DATA = 56,
[email protected]730b35d72014-06-05 03:23:22500 // The peer received too much data, violating flow control.
501 QUIC_FLOW_CONTROL_RECEIVED_TOO_MUCH_DATA = 59,
502 // The peer sent too much data, violating flow control.
503 QUIC_FLOW_CONTROL_SENT_TOO_MUCH_DATA = 63,
504 // The peer received an invalid flow control window.
505 QUIC_FLOW_CONTROL_INVALID_WINDOW = 64,
[email protected]71c84e592014-05-28 23:39:29506 // The connection has been IP pooled into an existing connection.
507 QUIC_CONNECTION_IP_POOLED = 62,
rtenneti23186682014-10-30 01:49:33508 // The connection has too many outstanding sent packets.
509 QUIC_TOO_MANY_OUTSTANDING_SENT_PACKETS = 68,
510 // The connection has too many outstanding received packets.
511 QUIC_TOO_MANY_OUTSTANDING_RECEIVED_PACKETS = 69,
[email protected]8b37a092012-10-18 21:53:49512
513 // Crypto errors.
514
[email protected]1354bf62013-05-23 23:17:18515 // Hanshake failed.
[email protected]89264042013-08-21 07:35:24516 QUIC_HANDSHAKE_FAILED = 28,
[email protected]8b37a092012-10-18 21:53:49517 // Handshake message contained out of order tags.
[email protected]89264042013-08-21 07:35:24518 QUIC_CRYPTO_TAGS_OUT_OF_ORDER = 29,
[email protected]701bc892013-01-17 04:51:54519 // Handshake message contained too many entries.
[email protected]89264042013-08-21 07:35:24520 QUIC_CRYPTO_TOO_MANY_ENTRIES = 30,
[email protected]8b37a092012-10-18 21:53:49521 // Handshake message contained an invalid value length.
[email protected]89264042013-08-21 07:35:24522 QUIC_CRYPTO_INVALID_VALUE_LENGTH = 31,
[email protected]8b37a092012-10-18 21:53:49523 // A crypto message was received after the handshake was complete.
[email protected]89264042013-08-21 07:35:24524 QUIC_CRYPTO_MESSAGE_AFTER_HANDSHAKE_COMPLETE = 32,
[email protected]d3d15bf2013-01-30 02:51:54525 // A crypto message was received with an illegal message tag.
[email protected]89264042013-08-21 07:35:24526 QUIC_INVALID_CRYPTO_MESSAGE_TYPE = 33,
[email protected]d3d15bf2013-01-30 02:51:54527 // A crypto message was received with an illegal parameter.
[email protected]89264042013-08-21 07:35:24528 QUIC_INVALID_CRYPTO_MESSAGE_PARAMETER = 34,
[email protected]752fbe52013-10-14 08:35:32529 // An invalid channel id signature was supplied.
530 QUIC_INVALID_CHANNEL_ID_SIGNATURE = 52,
[email protected]d3d15bf2013-01-30 02:51:54531 // A crypto message was received with a mandatory parameter missing.
[email protected]89264042013-08-21 07:35:24532 QUIC_CRYPTO_MESSAGE_PARAMETER_NOT_FOUND = 35,
[email protected]d3d15bf2013-01-30 02:51:54533 // A crypto message was received with a parameter that has no overlap
534 // with the local parameter.
[email protected]89264042013-08-21 07:35:24535 QUIC_CRYPTO_MESSAGE_PARAMETER_NO_OVERLAP = 36,
[email protected]ed3fc15d2013-03-08 18:37:44536 // A crypto message was received that contained a parameter with too few
537 // values.
[email protected]89264042013-08-21 07:35:24538 QUIC_CRYPTO_MESSAGE_INDEX_NOT_FOUND = 37,
[email protected]ccc66e8a2013-03-26 08:26:14539 // An internal error occured in crypto processing.
[email protected]89264042013-08-21 07:35:24540 QUIC_CRYPTO_INTERNAL_ERROR = 38,
[email protected]ccc66e8a2013-03-26 08:26:14541 // A crypto handshake message specified an unsupported version.
[email protected]89264042013-08-21 07:35:24542 QUIC_CRYPTO_VERSION_NOT_SUPPORTED = 39,
[email protected]ccc66e8a2013-03-26 08:26:14543 // There was no intersection between the crypto primitives supported by the
544 // peer and ourselves.
[email protected]89264042013-08-21 07:35:24545 QUIC_CRYPTO_NO_SUPPORT = 40,
[email protected]ef95114d2013-04-17 17:57:01546 // The server rejected our client hello messages too many times.
[email protected]89264042013-08-21 07:35:24547 QUIC_CRYPTO_TOO_MANY_REJECTS = 41,
[email protected]a57e0272013-04-26 07:31:47548 // The client rejected the server's certificate chain or signature.
[email protected]89264042013-08-21 07:35:24549 QUIC_PROOF_INVALID = 42,
[email protected]8ba81212013-05-03 13:11:48550 // A crypto message was received with a duplicate tag.
[email protected]89264042013-08-21 07:35:24551 QUIC_CRYPTO_DUPLICATE_TAG = 43,
[email protected]2532de12013-05-09 12:29:33552 // A crypto message was received with the wrong encryption level (i.e. it
553 // should have been encrypted but was not.)
[email protected]89264042013-08-21 07:35:24554 QUIC_CRYPTO_ENCRYPTION_LEVEL_INCORRECT = 44,
[email protected]2532de12013-05-09 12:29:33555 // The server config for a server has expired.
[email protected]89264042013-08-21 07:35:24556 QUIC_CRYPTO_SERVER_CONFIG_EXPIRED = 45,
[email protected]752fbe52013-10-14 08:35:32557 // We failed to setup the symmetric keys for a connection.
558 QUIC_CRYPTO_SYMMETRIC_KEY_SETUP_FAILED = 53,
[email protected]691f45a982013-11-19 10:52:04559 // A handshake message arrived, but we are still validating the
560 // previous handshake message.
561 QUIC_CRYPTO_MESSAGE_WHILE_VALIDATING_CLIENT_HELLO = 54,
[email protected]ccb34212014-07-18 09:27:50562 // A server config update arrived before the handshake is complete.
563 QUIC_CRYPTO_UPDATE_BEFORE_HANDSHAKE_COMPLETE = 65,
[email protected]d89f1862013-11-26 21:21:27564 // This connection involved a version negotiation which appears to have been
565 // tampered with.
566 QUIC_VERSION_NEGOTIATION_MISMATCH = 55,
[email protected]ccc66e8a2013-03-26 08:26:14567
[email protected]74bda142013-03-31 02:49:11568 // No error. Used as bound while iterating.
rtenneti23186682014-10-30 01:49:33569 QUIC_LAST_ERROR = 70,
[email protected]8b37a092012-10-18 21:53:49570};
571
[email protected]c995c572013-01-18 05:43:20572struct NET_EXPORT_PRIVATE QuicPacketPublicHeader {
[email protected]14e8106c2013-03-14 16:25:33573 QuicPacketPublicHeader();
574 explicit QuicPacketPublicHeader(const QuicPacketPublicHeader& other);
575 ~QuicPacketPublicHeader();
576
[email protected]3aa9ca72014-02-27 19:39:43577 // Universal header. All QuicPacket headers will have a connection_id and
578 // public flags.
579 QuicConnectionId connection_id;
580 QuicConnectionIdLength connection_id_length;
[email protected]9db443912013-02-25 05:27:03581 bool reset_flag;
582 bool version_flag;
[email protected]25c31dc2013-06-05 17:56:04583 QuicSequenceNumberLength sequence_number_length;
[email protected]48878092013-07-26 14:51:56584 QuicVersionVector versions;
[email protected]c995c572013-01-18 05:43:20585};
586
587// Header for Data or FEC packets.
[email protected]74bda142013-03-31 02:49:11588struct NET_EXPORT_PRIVATE QuicPacketHeader {
589 QuicPacketHeader();
590 explicit QuicPacketHeader(const QuicPacketPublicHeader& header);
[email protected]9db443912013-02-25 05:27:03591
592 NET_EXPORT_PRIVATE friend std::ostream& operator<<(
593 std::ostream& os, const QuicPacketHeader& s);
594
[email protected]c995c572013-01-18 05:43:20595 QuicPacketPublicHeader public_header;
[email protected]9db443912013-02-25 05:27:03596 bool fec_flag;
[email protected]9db443912013-02-25 05:27:03597 bool entropy_flag;
598 QuicPacketEntropyHash entropy_hash;
[email protected]8b37a092012-10-18 21:53:49599 QuicPacketSequenceNumber packet_sequence_number;
[email protected]b064310782013-05-30 21:12:17600 InFecGroup is_in_fec_group;
[email protected]8b37a092012-10-18 21:53:49601 QuicFecGroupNumber fec_group;
602};
603
[email protected]74bda142013-03-31 02:49:11604struct NET_EXPORT_PRIVATE QuicPublicResetPacket {
[email protected]6ae6e342014-02-06 02:21:42605 QuicPublicResetPacket();
606 explicit QuicPublicResetPacket(const QuicPacketPublicHeader& header);
607
[email protected]86a318d2013-01-23 21:16:04608 QuicPacketPublicHeader public_header;
[email protected]86a318d2013-01-23 21:16:04609 QuicPublicResetNonceProof nonce_proof;
[email protected]300ccd52014-01-25 08:00:19610 QuicPacketSequenceNumber rejected_sequence_number;
[email protected]79d13dcb2014-02-05 07:23:13611 IPEndPoint client_address;
[email protected]86a318d2013-01-23 21:16:04612};
613
[email protected]14e8106c2013-03-14 16:25:33614enum QuicVersionNegotiationState {
615 START_NEGOTIATION = 0,
[email protected]ec640112013-08-09 03:56:18616 // Server-side this implies we've sent a version negotiation packet and are
617 // waiting on the client to select a compatible version. Client-side this
618 // implies we've gotten a version negotiation packet, are retransmitting the
619 // initial packets with a supported version and are waiting for our first
620 // packet from the server.
621 NEGOTIATION_IN_PROGRESS,
622 // This indicates this endpoint has received a packet from the peer with a
623 // version this endpoint supports. Version negotiation is complete, and the
624 // version number will no longer be sent with future packets.
[email protected]14e8106c2013-03-14 16:25:33625 NEGOTIATED_VERSION
626};
627
628typedef QuicPacketPublicHeader QuicVersionNegotiationPacket;
629
[email protected]c995c572013-01-18 05:43:20630// A padding frame contains no payload.
631struct NET_EXPORT_PRIVATE QuicPaddingFrame {
632};
633
[email protected]d8c522112014-04-23 09:23:25634// A ping frame contains no payload, though it is retransmittable,
635// and ACK'd just like other normal frames.
636struct NET_EXPORT_PRIVATE QuicPingFrame {
637};
638
[email protected]be24ab22012-10-22 03:01:52639struct NET_EXPORT_PRIVATE QuicStreamFrame {
640 QuicStreamFrame();
[email protected]5dafdb62013-11-14 01:24:26641 QuicStreamFrame(const QuicStreamFrame& frame);
[email protected]be24ab22012-10-22 03:01:52642 QuicStreamFrame(QuicStreamId stream_id,
[email protected]a5061242012-10-23 23:29:37643 bool fin,
[email protected]701bc892013-01-17 04:51:54644 QuicStreamOffset offset,
[email protected]5dafdb62013-11-14 01:24:26645 IOVector data);
646
[email protected]c5e1aca2014-01-30 04:03:04647 NET_EXPORT_PRIVATE friend std::ostream& operator<<(
648 std::ostream& os, const QuicStreamFrame& s);
649
[email protected]5dafdb62013-11-14 01:24:26650 // Returns a copy of the IOVector |data| as a heap-allocated string.
651 // Caller must take ownership of the returned string.
652 std::string* GetDataAsString() const;
[email protected]8b37a092012-10-18 21:53:49653
654 QuicStreamId stream_id;
655 bool fin;
[email protected]701bc892013-01-17 04:51:54656 QuicStreamOffset offset; // Location of this data in the stream.
[email protected]5dafdb62013-11-14 01:24:26657 IOVector data;
[email protected]97cf3022013-09-05 14:30:16658
659 // If this is set, then when this packet is ACKed the AckNotifier will be
660 // informed.
661 QuicAckNotifier* notifier;
[email protected]8b37a092012-10-18 21:53:49662};
663
[email protected]e537f742012-12-07 15:33:53664// TODO(ianswett): Re-evaluate the trade-offs of hash_set vs set when framing
665// is finalized.
[email protected]9db443912013-02-25 05:27:03666typedef std::set<QuicPacketSequenceNumber> SequenceNumberSet;
rtennetidd4bf8f2014-09-03 00:45:16667typedef std::list<QuicPacketSequenceNumber> SequenceNumberList;
rtenneti4b06ae72014-08-26 03:43:43668
mostynbdc40b80612014-09-10 03:45:42669typedef std::list<
670 std::pair<QuicPacketSequenceNumber, QuicTime> > PacketTimeList;
[email protected]044ac2b2012-11-13 21:41:06671
[email protected]310d37b2014-08-02 06:15:37672struct NET_EXPORT_PRIVATE QuicStopWaitingFrame {
673 QuicStopWaitingFrame();
674 ~QuicStopWaitingFrame();
[email protected]6ae6e342014-02-06 02:21:42675
[email protected]26f3f8e2012-12-13 21:07:19676 NET_EXPORT_PRIVATE friend std::ostream& operator<<(
[email protected]310d37b2014-08-02 06:15:37677 std::ostream& os, const QuicStopWaitingFrame& s);
678 // Entropy hash of all packets up to, but not including, the least unacked
679 // packet.
680 QuicPacketEntropyHash entropy_hash;
681 // The lowest packet we've sent which is unacked, and we expect an ack for.
682 QuicPacketSequenceNumber least_unacked;
683};
684
685struct NET_EXPORT_PRIVATE QuicAckFrame {
686 QuicAckFrame();
687 ~QuicAckFrame();
688
689 NET_EXPORT_PRIVATE friend std::ostream& operator<<(
690 std::ostream& os, const QuicAckFrame& s);
[email protected]a674b4c2012-12-05 03:44:30691
[email protected]9db443912013-02-25 05:27:03692 // Entropy hash of all packets up to largest observed not including missing
693 // packets.
694 QuicPacketEntropyHash entropy_hash;
[email protected]e537f742012-12-07 15:33:53695
[email protected]48697d8a2013-01-15 19:42:24696 // The highest packet sequence number we've observed from the peer.
697 //
698 // In general, this should be the largest packet number we've received. In
699 // the case of truncated acks, we may have to advertise a lower "upper bound"
700 // than largest received, to avoid implicitly acking missing packets that
701 // don't fit in the missing packet list due to size limitations. In this
702 // case, largest_observed may be a packet which is also in the missing packets
703 // list.
704 QuicPacketSequenceNumber largest_observed;
[email protected]a674b4c2012-12-05 03:44:30705
[email protected]14e8106c2013-03-14 16:25:33706 // Time elapsed since largest_observed was received until this Ack frame was
707 // sent.
708 QuicTime::Delta delta_time_largest_observed;
709
[email protected]9db443912013-02-25 05:27:03710 // TODO(satyamshekhar): Can be optimized using an interval set like data
711 // structure.
[email protected]e537f742012-12-07 15:33:53712 // The set of packets which we're expecting and have not received.
[email protected]9db443912013-02-25 05:27:03713 SequenceNumberSet missing_packets;
[email protected]8e01c062013-10-31 07:35:31714
715 // Whether the ack had to be truncated when sent.
716 bool is_truncated;
[email protected]bdf2d432014-02-09 10:45:41717
718 // Packets which have been revived via FEC.
719 // All of these must also be in missing_packets.
720 SequenceNumberSet revived_packets;
rtenneti4b06ae72014-08-26 03:43:43721
722 // List of <sequence_number, time> for when packets arrived.
723 PacketTimeList received_packet_times;
[email protected]8b37a092012-10-18 21:53:49724};
725
[email protected]9db443912013-02-25 05:27:03726// True if the sequence number is greater than largest_observed or is listed
727// as missing.
728// Always returns false for sequence numbers less than least_unacked.
729bool NET_EXPORT_PRIVATE IsAwaitingPacket(
[email protected]310d37b2014-08-02 06:15:37730 const QuicAckFrame& ack_frame,
[email protected]9db443912013-02-25 05:27:03731 QuicPacketSequenceNumber sequence_number);
732
733// Inserts missing packets between [lower, higher).
734void NET_EXPORT_PRIVATE InsertMissingPacketsBetween(
[email protected]310d37b2014-08-02 06:15:37735 QuicAckFrame* ack_frame,
[email protected]9db443912013-02-25 05:27:03736 QuicPacketSequenceNumber lower,
737 QuicPacketSequenceNumber higher);
738
[email protected]8b37a092012-10-18 21:53:49739// Defines for all types of congestion feedback that will be negotiated in QUIC,
[email protected]f62262b2013-07-05 20:57:30740// kTCP MUST be supported by all QUIC implementations to guarantee 100%
[email protected]8b37a092012-10-18 21:53:49741// compatibility.
rtenneti4b06ae72014-08-26 03:43:43742// TODO(cyr): Remove this when removing QUIC_VERSION_22.
[email protected]8b37a092012-10-18 21:53:49743enum CongestionFeedbackType {
[email protected]8b37a092012-10-18 21:53:49744 kTCP, // Used to mimic TCP.
[email protected]a692ad9d2014-07-18 21:35:24745};
746
747// Defines for all types of congestion control algorithms that can be used in
748// QUIC. Note that this is separate from the congestion feedback type -
749// some congestion control algorithms may use the same feedback type
750// (Reno and Cubic are the classic example for that).
751enum CongestionControlType {
752 kCubic,
753 kReno,
[email protected]a692ad9d2014-07-18 21:35:24754 kBBR,
[email protected]8b37a092012-10-18 21:53:49755};
756
[email protected]c5cc9bd2014-03-31 23:17:14757enum LossDetectionType {
758 kNack, // Used to mimic TCP's loss detection.
759 kTime, // Time based loss detection.
760};
761
rtenneti4b06ae72014-08-26 03:43:43762// TODO(cyr): Remove this when removing QUIC_VERSION_22.
[email protected]8b37a092012-10-18 21:53:49763struct NET_EXPORT_PRIVATE CongestionFeedbackMessageTCP {
[email protected]6ae6e342014-02-06 02:21:42764 CongestionFeedbackMessageTCP();
765
[email protected]fee17f72013-02-03 07:47:41766 QuicByteCount receive_window;
[email protected]8b37a092012-10-18 21:53:49767};
768
rtenneti4b06ae72014-08-26 03:43:43769// TODO(cyr): Remove this when removing QUIC_VERSION_22.
[email protected]26f3f8e2012-12-13 21:07:19770struct NET_EXPORT_PRIVATE QuicCongestionFeedbackFrame {
[email protected]7884ecad2012-12-14 22:55:15771 QuicCongestionFeedbackFrame();
772 ~QuicCongestionFeedbackFrame();
773
[email protected]26f3f8e2012-12-13 21:07:19774 NET_EXPORT_PRIVATE friend std::ostream& operator<<(
775 std::ostream& os, const QuicCongestionFeedbackFrame& c);
776
[email protected]7884ecad2012-12-14 22:55:15777 CongestionFeedbackType type;
[email protected]a97b3182014-08-08 08:10:18778 // This should really be a union, but since the timestamp struct
[email protected]7884ecad2012-12-14 22:55:15779 // is non-trivial, C++ prohibits it.
780 CongestionFeedbackMessageTCP tcp;
[email protected]8b37a092012-10-18 21:53:49781};
782
[email protected]be24ab22012-10-22 03:01:52783struct NET_EXPORT_PRIVATE QuicRstStreamFrame {
[email protected]6ae6e342014-02-06 02:21:42784 QuicRstStreamFrame();
785 QuicRstStreamFrame(QuicStreamId stream_id,
786 QuicRstStreamErrorCode error_code,
787 QuicStreamOffset bytes_written);
[email protected]8b37a092012-10-18 21:53:49788
[email protected]c5e1aca2014-01-30 04:03:04789 NET_EXPORT_PRIVATE friend std::ostream& operator<<(
790 std::ostream& os, const QuicRstStreamFrame& r);
791
[email protected]8b37a092012-10-18 21:53:49792 QuicStreamId stream_id;
[email protected]74bda142013-03-31 02:49:11793 QuicRstStreamErrorCode error_code;
[email protected]431bb4fd2012-10-19 17:46:09794 std::string error_details;
[email protected]6ae6e342014-02-06 02:21:42795
796 // Used to update flow control windows. On termination of a stream, both
797 // endpoints must inform the peer of the number of bytes they have sent on
798 // that stream. This can be done through normal termination (data packet with
799 // FIN) or through a RST.
800 QuicStreamOffset byte_offset;
[email protected]8b37a092012-10-18 21:53:49801};
802
[email protected]be24ab22012-10-22 03:01:52803struct NET_EXPORT_PRIVATE QuicConnectionCloseFrame {
[email protected]6ae6e342014-02-06 02:21:42804 QuicConnectionCloseFrame();
805
[email protected]c5e1aca2014-01-30 04:03:04806 NET_EXPORT_PRIVATE friend std::ostream& operator<<(
807 std::ostream& os, const QuicConnectionCloseFrame& c);
808
[email protected]431bb4fd2012-10-19 17:46:09809 QuicErrorCode error_code;
[email protected]431bb4fd2012-10-19 17:46:09810 std::string error_details;
[email protected]8b37a092012-10-18 21:53:49811};
812
[email protected]9db443912013-02-25 05:27:03813struct NET_EXPORT_PRIVATE QuicGoAwayFrame {
[email protected]6ae6e342014-02-06 02:21:42814 QuicGoAwayFrame();
[email protected]9db443912013-02-25 05:27:03815 QuicGoAwayFrame(QuicErrorCode error_code,
816 QuicStreamId last_good_stream_id,
817 const std::string& reason);
818
[email protected]c5e1aca2014-01-30 04:03:04819 NET_EXPORT_PRIVATE friend std::ostream& operator<<(
820 std::ostream& os, const QuicGoAwayFrame& g);
821
[email protected]9db443912013-02-25 05:27:03822 QuicErrorCode error_code;
823 QuicStreamId last_good_stream_id;
824 std::string reason_phrase;
825};
826
[email protected]6ae6e342014-02-06 02:21:42827// Flow control updates per-stream and at the connection levoel.
828// Based on SPDY's WINDOW_UPDATE frame, but uses an absolute byte offset rather
829// than a window delta.
830// TODO(rjshade): A possible future optimization is to make stream_id and
831// byte_offset variable length, similar to stream frames.
832struct NET_EXPORT_PRIVATE QuicWindowUpdateFrame {
833 QuicWindowUpdateFrame() {}
834 QuicWindowUpdateFrame(QuicStreamId stream_id, QuicStreamOffset byte_offset);
835
836 NET_EXPORT_PRIVATE friend std::ostream& operator<<(
837 std::ostream& os, const QuicWindowUpdateFrame& w);
838
839 // The stream this frame applies to. 0 is a special case meaning the overall
840 // connection rather than a specific stream.
841 QuicStreamId stream_id;
842
843 // Byte offset in the stream or connection. The receiver of this frame must
844 // not send data which would result in this offset being exceeded.
845 QuicStreamOffset byte_offset;
846};
847
848// The BLOCKED frame is used to indicate to the remote endpoint that this
849// endpoint believes itself to be flow-control blocked but otherwise ready to
850// send data. The BLOCKED frame is purely advisory and optional.
851// Based on SPDY's BLOCKED frame (undocumented as of 2014-01-28).
852struct NET_EXPORT_PRIVATE QuicBlockedFrame {
853 QuicBlockedFrame() {}
854 explicit QuicBlockedFrame(QuicStreamId stream_id);
855
856 NET_EXPORT_PRIVATE friend std::ostream& operator<<(
857 std::ostream& os, const QuicBlockedFrame& b);
858
859 // The stream this frame applies to. 0 is a special case meaning the overall
860 // connection rather than a specific stream.
861 QuicStreamId stream_id;
862};
863
[email protected]8ba81212013-05-03 13:11:48864// EncryptionLevel enumerates the stages of encryption that a QUIC connection
865// progresses through. When retransmitting a packet, the encryption level needs
866// to be specified so that it is retransmitted at a level which the peer can
867// understand.
868enum EncryptionLevel {
869 ENCRYPTION_NONE = 0,
870 ENCRYPTION_INITIAL = 1,
871 ENCRYPTION_FORWARD_SECURE = 2,
872
873 NUM_ENCRYPTION_LEVELS,
874};
875
[email protected]be24ab22012-10-22 03:01:52876struct NET_EXPORT_PRIVATE QuicFrame {
[email protected]6ae6e342014-02-06 02:21:42877 QuicFrame();
878 explicit QuicFrame(QuicPaddingFrame* padding_frame);
879 explicit QuicFrame(QuicStreamFrame* stream_frame);
880 explicit QuicFrame(QuicAckFrame* frame);
rtenneti4b06ae72014-08-26 03:43:43881
882 // TODO(cyr): Remove this when removing QUIC_VERSION_22.
[email protected]6ae6e342014-02-06 02:21:42883 explicit QuicFrame(QuicCongestionFeedbackFrame* frame);
rtenneti4b06ae72014-08-26 03:43:43884
[email protected]6ae6e342014-02-06 02:21:42885 explicit QuicFrame(QuicRstStreamFrame* frame);
886 explicit QuicFrame(QuicConnectionCloseFrame* frame);
[email protected]93dd91f2014-02-27 00:09:03887 explicit QuicFrame(QuicStopWaitingFrame* frame);
[email protected]d8c522112014-04-23 09:23:25888 explicit QuicFrame(QuicPingFrame* frame);
[email protected]6ae6e342014-02-06 02:21:42889 explicit QuicFrame(QuicGoAwayFrame* frame);
890 explicit QuicFrame(QuicWindowUpdateFrame* frame);
891 explicit QuicFrame(QuicBlockedFrame* frame);
[email protected]8b37a092012-10-18 21:53:49892
[email protected]c5e1aca2014-01-30 04:03:04893 NET_EXPORT_PRIVATE friend std::ostream& operator<<(
894 std::ostream& os, const QuicFrame& frame);
895
[email protected]be24ab22012-10-22 03:01:52896 QuicFrameType type;
[email protected]8b37a092012-10-18 21:53:49897 union {
[email protected]c995c572013-01-18 05:43:20898 QuicPaddingFrame* padding_frame;
[email protected]be24ab22012-10-22 03:01:52899 QuicStreamFrame* stream_frame;
900 QuicAckFrame* ack_frame;
rtenneti4b06ae72014-08-26 03:43:43901
902 // TODO(cyr): Remove this when removing QUIC_VERSION_22.
[email protected]26f3f8e2012-12-13 21:07:19903 QuicCongestionFeedbackFrame* congestion_feedback_frame;
[email protected]93dd91f2014-02-27 00:09:03904 QuicStopWaitingFrame* stop_waiting_frame;
rtenneti4b06ae72014-08-26 03:43:43905
[email protected]d8c522112014-04-23 09:23:25906 QuicPingFrame* ping_frame;
[email protected]be24ab22012-10-22 03:01:52907 QuicRstStreamFrame* rst_stream_frame;
908 QuicConnectionCloseFrame* connection_close_frame;
[email protected]9db443912013-02-25 05:27:03909 QuicGoAwayFrame* goaway_frame;
[email protected]6ae6e342014-02-06 02:21:42910 QuicWindowUpdateFrame* window_update_frame;
911 QuicBlockedFrame* blocked_frame;
[email protected]8b37a092012-10-18 21:53:49912 };
913};
914
[email protected]be24ab22012-10-22 03:01:52915typedef std::vector<QuicFrame> QuicFrames;
[email protected]8b37a092012-10-18 21:53:49916
917struct NET_EXPORT_PRIVATE QuicFecData {
918 QuicFecData();
[email protected]a5061242012-10-23 23:29:37919
[email protected]c995c572013-01-18 05:43:20920 // The FEC group number is also the sequence number of the first
921 // FEC protected packet. The last protected packet's sequence number will
922 // be one less than the sequence number of the FEC packet.
[email protected]8b37a092012-10-18 21:53:49923 QuicFecGroupNumber fec_group;
[email protected]8b37a092012-10-18 21:53:49924 base::StringPiece redundancy;
[email protected]8b37a092012-10-18 21:53:49925};
926
[email protected]8b37a092012-10-18 21:53:49927class NET_EXPORT_PRIVATE QuicData {
928 public:
[email protected]6ae6e342014-02-06 02:21:42929 QuicData(const char* buffer, size_t length);
930 QuicData(char* buffer, size_t length, bool owns_buffer);
[email protected]8b37a092012-10-18 21:53:49931 virtual ~QuicData();
932
933 base::StringPiece AsStringPiece() const {
934 return base::StringPiece(data(), length());
935 }
936
937 const char* data() const { return buffer_; }
938 size_t length() const { return length_; }
939
940 private:
941 const char* buffer_;
942 size_t length_;
943 bool owns_buffer_;
944
945 DISALLOW_COPY_AND_ASSIGN(QuicData);
946};
947
948class NET_EXPORT_PRIVATE QuicPacket : public QuicData {
949 public:
[email protected]25c31dc2013-06-05 17:56:04950 static QuicPacket* NewDataPacket(
951 char* buffer,
952 size_t length,
953 bool owns_buffer,
[email protected]3aa9ca72014-02-27 19:39:43954 QuicConnectionIdLength connection_id_length,
[email protected]25c31dc2013-06-05 17:56:04955 bool includes_version,
956 QuicSequenceNumberLength sequence_number_length) {
[email protected]3aa9ca72014-02-27 19:39:43957 return new QuicPacket(buffer, length, owns_buffer, connection_id_length,
[email protected]25c31dc2013-06-05 17:56:04958 includes_version, sequence_number_length, false);
[email protected]c995c572013-01-18 05:43:20959 }
960
[email protected]25c31dc2013-06-05 17:56:04961 static QuicPacket* NewFecPacket(
962 char* buffer,
963 size_t length,
964 bool owns_buffer,
[email protected]3aa9ca72014-02-27 19:39:43965 QuicConnectionIdLength connection_id_length,
[email protected]25c31dc2013-06-05 17:56:04966 bool includes_version,
967 QuicSequenceNumberLength sequence_number_length) {
[email protected]3aa9ca72014-02-27 19:39:43968 return new QuicPacket(buffer, length, owns_buffer, connection_id_length,
[email protected]25c31dc2013-06-05 17:56:04969 includes_version, sequence_number_length, true);
[email protected]c995c572013-01-18 05:43:20970 }
[email protected]8b37a092012-10-18 21:53:49971
[email protected]5351cc4b2013-03-03 07:22:41972 base::StringPiece FecProtectedData() const;
973 base::StringPiece AssociatedData() const;
974 base::StringPiece BeforePlaintext() const;
975 base::StringPiece Plaintext() const;
[email protected]082b65b2012-11-10 19:11:31976
[email protected]c995c572013-01-18 05:43:20977 bool is_fec_packet() const { return is_fec_packet_; }
[email protected]082b65b2012-11-10 19:11:31978
[email protected]8b37a092012-10-18 21:53:49979 char* mutable_data() { return buffer_; }
980
981 private:
[email protected]5351cc4b2013-03-03 07:22:41982 QuicPacket(char* buffer,
983 size_t length,
984 bool owns_buffer,
[email protected]3aa9ca72014-02-27 19:39:43985 QuicConnectionIdLength connection_id_length,
[email protected]5351cc4b2013-03-03 07:22:41986 bool includes_version,
[email protected]25c31dc2013-06-05 17:56:04987 QuicSequenceNumberLength sequence_number_length,
[email protected]6ae6e342014-02-06 02:21:42988 bool is_fec_packet);
[email protected]c995c572013-01-18 05:43:20989
[email protected]8b37a092012-10-18 21:53:49990 char* buffer_;
[email protected]c995c572013-01-18 05:43:20991 const bool is_fec_packet_;
[email protected]3aa9ca72014-02-27 19:39:43992 const QuicConnectionIdLength connection_id_length_;
[email protected]5351cc4b2013-03-03 07:22:41993 const bool includes_version_;
[email protected]25c31dc2013-06-05 17:56:04994 const QuicSequenceNumberLength sequence_number_length_;
[email protected]8b37a092012-10-18 21:53:49995
[email protected]2e740db2012-10-20 19:35:19996 DISALLOW_COPY_AND_ASSIGN(QuicPacket);
[email protected]8b37a092012-10-18 21:53:49997};
998
999class NET_EXPORT_PRIVATE QuicEncryptedPacket : public QuicData {
1000 public:
[email protected]6ae6e342014-02-06 02:21:421001 QuicEncryptedPacket(const char* buffer, size_t length);
1002 QuicEncryptedPacket(char* buffer, size_t length, bool owns_buffer);
[email protected]8b37a092012-10-18 21:53:491003
[email protected]ec86d5462013-11-17 16:04:491004 // Clones the packet into a new packet which owns the buffer.
1005 QuicEncryptedPacket* Clone() const;
1006
[email protected]c1b32c62013-01-20 02:49:101007 // By default, gtest prints the raw bytes of an object. The bool data
1008 // member (in the base class QuicData) causes this object to have padding
1009 // bytes, which causes the default gtest object printer to read
1010 // uninitialize memory. So we need to teach gtest how to print this object.
1011 NET_EXPORT_PRIVATE friend std::ostream& operator<<(
1012 std::ostream& os, const QuicEncryptedPacket& s);
1013
[email protected]2e740db2012-10-20 19:35:191014 private:
1015 DISALLOW_COPY_AND_ASSIGN(QuicEncryptedPacket);
[email protected]8b37a092012-10-18 21:53:491016};
1017
[email protected]9db443912013-02-25 05:27:031018class NET_EXPORT_PRIVATE RetransmittableFrames {
1019 public:
1020 RetransmittableFrames();
1021 ~RetransmittableFrames();
1022
1023 // Allocates a local copy of the referenced StringPiece has QuicStreamFrame
1024 // use it.
1025 // Takes ownership of |stream_frame|.
1026 const QuicFrame& AddStreamFrame(QuicStreamFrame* stream_frame);
1027 // Takes ownership of the frame inside |frame|.
1028 const QuicFrame& AddNonStreamFrame(const QuicFrame& frame);
1029 const QuicFrames& frames() const { return frames_; }
1030
[email protected]672631c2014-08-16 06:11:451031 IsHandshake HasCryptoHandshake() const {
1032 return has_crypto_handshake_;
1033 }
[email protected]2115d33ba2014-01-02 21:53:521034
[email protected]8ba81212013-05-03 13:11:481035 void set_encryption_level(EncryptionLevel level);
1036 EncryptionLevel encryption_level() const {
1037 return encryption_level_;
1038 }
1039
[email protected]9db443912013-02-25 05:27:031040 private:
1041 QuicFrames frames_;
[email protected]8ba81212013-05-03 13:11:481042 EncryptionLevel encryption_level_;
[email protected]672631c2014-08-16 06:11:451043 IsHandshake has_crypto_handshake_;
[email protected]9db443912013-02-25 05:27:031044 // Data referenced by the StringPiece of a QuicStreamFrame.
1045 std::vector<std::string*> stream_data_;
1046
1047 DISALLOW_COPY_AND_ASSIGN(RetransmittableFrames);
1048};
1049
1050struct NET_EXPORT_PRIVATE SerializedPacket {
1051 SerializedPacket(QuicPacketSequenceNumber sequence_number,
[email protected]ea825e02013-08-21 18:12:451052 QuicSequenceNumberLength sequence_number_length,
[email protected]9db443912013-02-25 05:27:031053 QuicPacket* packet,
1054 QuicPacketEntropyHash entropy_hash,
[email protected]97cf3022013-09-05 14:30:161055 RetransmittableFrames* retransmittable_frames);
1056 ~SerializedPacket();
[email protected]9db443912013-02-25 05:27:031057
1058 QuicPacketSequenceNumber sequence_number;
[email protected]ea825e02013-08-21 18:12:451059 QuicSequenceNumberLength sequence_number_length;
[email protected]9db443912013-02-25 05:27:031060 QuicPacket* packet;
1061 QuicPacketEntropyHash entropy_hash;
1062 RetransmittableFrames* retransmittable_frames;
[email protected]97cf3022013-09-05 14:30:161063
1064 // If set, these will be called when this packet is ACKed by the peer.
1065 std::set<QuicAckNotifier*> notifiers;
[email protected]9db443912013-02-25 05:27:031066};
1067
[email protected]77b5d50b2014-05-07 22:48:481068struct NET_EXPORT_PRIVATE TransmissionInfo {
1069 // Used by STL when assigning into a map.
1070 TransmissionInfo();
1071
1072 // Constructs a Transmission with a new all_tranmissions set
1073 // containing |sequence_number|.
1074 TransmissionInfo(RetransmittableFrames* retransmittable_frames,
[email protected]77b5d50b2014-05-07 22:48:481075 QuicSequenceNumberLength sequence_number_length,
[email protected]730b35d72014-06-05 03:23:221076 TransmissionType transmission_type,
rtenneti08b014382014-10-29 14:03:191077 QuicTime sent_time);
[email protected]77b5d50b2014-05-07 22:48:481078
1079 RetransmittableFrames* retransmittable_frames;
1080 QuicSequenceNumberLength sequence_number_length;
1081 // Zero when the packet is serialized, non-zero once it's sent.
1082 QuicTime sent_time;
1083 // Zero when the packet is serialized, non-zero once it's sent.
1084 QuicByteCount bytes_sent;
1085 size_t nack_count;
[email protected]730b35d72014-06-05 03:23:221086 // Reason why this packet was transmitted.
1087 TransmissionType transmission_type;
[email protected]77b5d50b2014-05-07 22:48:481088 // Stores the sequence numbers of all transmissions of this packet.
rtennetibe635732014-10-02 22:51:421089 // Must always be nullptr or have multiple elements.
rtennetidd4bf8f2014-09-03 00:45:161090 SequenceNumberList* all_transmissions;
[email protected]aa7e4ef2014-05-28 03:53:151091 // In flight packets have not been abandoned or lost.
1092 bool in_flight;
rtenneti31e9fd62014-09-16 05:22:151093 // True if the packet can never be acked, so it can be removed.
1094 bool is_unackable;
[email protected]77b5d50b2014-05-07 22:48:481095};
1096
[email protected]8b37a092012-10-18 21:53:491097} // namespace net
1098
1099#endif // NET_QUIC_QUIC_PROTOCOL_H_