@@ -355,7 +355,7 @@ earlier.
355
355
+ Connection ID +
356
356
| |
357
357
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
358
- | Packet Number / Proof |
358
+ | Packet Number |
359
359
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
360
360
| Version |
361
361
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
@@ -370,27 +370,35 @@ inefficient, long headers MAY be used for 1-RTT packets. The long form allows
370
370
for special packets, such as the version negotiation and the public reset
371
371
packets to be represented in this uniform fixed-length packet format.
372
372
373
- The first octet (octet 0) contains the following fields.
373
+ The Flags field (octet 0) contains the following version-independent fields.
374
374
* Bit 0 (0x80): HEADER_FORM, set to 1 for long headers.
375
375
* Bits 1-7: Packet Type, indicating one of 128 packet types. The following types
376
376
are currently defined.
377
377
* 01: Version Negotiation packet (see {{version-negotiation-packet}}.)
378
378
* 02: Public Reset packet (see {{public-reset-packet}}.)
379
379
* 03: Client Cleartext packet (see {{cleartext-packet}}.)
380
- * 04: Server Cleartext packet indicating successful handshake (see
381
- {{cleartext-packet}}.)
380
+ * 04: Server Cleartext End-of-Handshake packet (see {{cleartext-packet}}.)
382
381
* 05: Other Server Cleartext packet (see {{cleartext-packet}}.)
383
382
* 06: 0-RTT Encrypted packet (see {{encrypted-packet}}.)
384
383
* 07: 1-RTT Encrypted packet with key phase 0 (see {{encrypted-packet}}.)
385
384
* 08: 1-RTT Encrypted packet with key phase 1 (see {{encrypted-packet}}.)
386
385
387
- The remainder of the packet layout is the same regardless of type, but the
388
- semantics of the fields are specific to each type (see corresponding sections
389
- for type-specific semantics.)
386
+ A long-header packet has the following version-independent fields :
387
+ * Octets 1-9: Connection ID
388
+ * Octets 10-14: Packet Number
389
+ * Octets 15-19: Version
390
390
391
- Connection ID considerations are discussed in {{connection-id}}. Each packet is
392
- assigned a packet number by the sender, as described further in
393
- {{packet-number}}.
391
+ The remainder of the long-header packet is defined to be specific to a version.
392
+ In this version, the rest of the packet contains :
393
+ * Octets 20+: Payload
394
+
395
+ The packet layout is the same for all long-header packet types, but the
396
+ semantics of the fields are specific to each packet type. Type-specific
397
+ semantics are described in {{version-negotiation-packet}},
398
+ {{public-reset-packet}}, {{cleartext-packet}}, and {{encrypted-packet}}.
399
+
400
+ Connection ID considerations are discussed in {{connection-id}} and packet
401
+ number considerations in {{packet-number}}.
394
402
395
403
# # Short Header
396
404
@@ -434,15 +442,15 @@ this version, it contains:
434
442
* Remainder of this packet: Encrypted Payload (see {{encrypted-payload}}.)
435
443
436
444
437
- # # Version Negotiation Packet {version-negotiation-packet}
445
+ # # Version Negotiation Packet {# version-negotiation-packet}
438
446
439
447
A Version Negotiation packet is sent by only the server and is a response to a
440
448
client packet of an unsupported version. It uses a long header and contains :
441
449
442
450
* Octet 0: 0x81 (Flags indicating long header and Version Negotiation packet
443
451
type)
444
452
* Octets 1-8: Connection ID (echoed)
445
- * Octets 9-12: Proof (first 4 octets of client-selected connection ID )
453
+ * Octets 9-12: Packet Number (echoed )
446
454
* Octets 13-16: Version (echoed)
447
455
* Octets 17+: Payload (version list, containing 0 or more acceptable versions)
448
456
@@ -538,15 +546,15 @@ Details to be added.
538
546
# # Cleartext Packets {#cleartext-packet}
539
547
540
548
Cleartext packets are sent during the handshake prior to key negotiation. A
541
- client Cleartext packet contains :
549
+ Client Cleartext packet contains :
542
550
543
551
* Octet 0: 0x83 (Flags indicating long header and client Cleartext packet type)
544
552
* Octets 1-8: Connection ID (randomly chosen)
545
553
* Octets 9-12: Packet number (low 4 octets, starts at a random 31-bit value)
546
554
* Octets 13-16: Version
547
555
* Octets 17+: Payload
548
556
549
- A server Cleartext packet indicating a successful handshake contains :
557
+ A Server Cleartext End-of-Handshake packet contains :
550
558
551
559
* Octet 0: 0x84 (Flags indicating Long header and appropriate server Cleartext
552
560
packet type)
@@ -555,7 +563,7 @@ A server Cleartext packet indicating a successful handshake contains:
555
563
* Octets 13-16: Version (echoed)
556
564
* Octets 17+: Payload
557
565
558
- Other server Cleartext packets contain :
566
+ Other Server Cleartext packets contain :
559
567
560
568
* Octet 0: 0x85 (Flags indicating Long header and appropriate server Cleartext
561
569
packet type)
@@ -564,15 +572,15 @@ Other server Cleartext packets contain:
564
572
* Octets 13-16: Version (echoed)
565
573
* Octets 17+: Payload
566
574
567
-
568
575
The client MUST choose a random value and use it as the Connection ID until the
569
- server replies with a server-selected Connection ID. The client's Connection ID
570
- is a suggestion to the server, as described further in {{connection-id}}. A
571
- server may respond to a client Cleartext packet with one of the two server
572
- Cleartext packets, using the server-selected Connection ID on only the final
573
- Cleartext packet that indicates successful handshake completion .
576
+ server replies with a server-selected Connection ID. Server-selected Connection
577
+ IDs are used after a successful handshake, cleanly distinguishing packets that
578
+ use them from packets using client-selected Connection IDs. All packets
579
+ including and following a Server Cleartext End-of-Handshake packet use a
580
+ server-selected Connection ID, as described in {{connection-id}} .
574
581
575
582
The payload of Cleartext packets contains frames, as described in {{frames}}.
583
+ (TODO : Add hash before frames.)
576
584
577
585
# # Encrypted Packets {#encrypted-packet}
578
586
0 commit comments