Skip to content

Commit 83087ce

Browse files
committed
Merge remote-tracking branch 'origin/master' into improve-goaway
2 parents 1871147 + dad0768 commit 83087ce

File tree

3 files changed

+557
-421
lines changed

3 files changed

+557
-421
lines changed

draft-ietf-quic-http.md

Lines changed: 104 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ stand_alone: yes
1212
pi: [toc, sortrefs, symrefs, docmapping]
1313

1414
author:
15-
-
15+
-
1616
ins: M. Bishop
1717
name: Mike Bishop
18-
org: Microsoft
19-
email: Michael.Bishop@microsoft.com
18+
org: Akamai
19+
email: mbishop@evequefou.be
2020
role: editor
2121

2222
normative:
@@ -85,6 +85,9 @@ defined in {{!RFC2119}}.
8585
Field definitions are given in Augmented Backus-Naur Form (ABNF), as defined in
8686
{{!RFC5234}}.
8787

88+
This document uses the variable-length integer encoding from
89+
{{QUIC-TRANSPORT}}.
90+
8891

8992
# QUIC Advertisement
9093

@@ -355,21 +358,21 @@ allows a server to fulfill promises in the order that best suits its needs.
355358
The server push response is conveyed on a push stream. A push stream is a
356359
server-initiated stream. A push stream includes a header (see
357360
{{fig-push-stream-header}}) that identifies the PUSH_PROMISE that it fulfills.
358-
This header consists of a 32-bit Push ID, which identifies a server push (see
359-
{{frame-push-promise}}).
361+
This header consists of a Push ID, encoded as a variable-length integer. The
362+
Push ID identifies a server push (see {{frame-push-promise}}).
360363

361364
~~~~~
362365
0 1 2 3
363366
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
364367
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
365-
| Push ID (32) |
368+
| Push ID (i) |
366369
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
367370
~~~~~
368371
{: #fig-push-stream-header title="Push Stream Header"}
369372

370-
A push stream always starts with a 32-bit Push ID. A client MUST treat
371-
receiving a push stream that contains fewer than 4 octets as a connection error
372-
of type HTTP_MALFORMED_PUSH.
373+
A push stream always starts with a Push ID. A client MUST treat receiving a
374+
push stream that contains a truncated variable-length integer as a connection
375+
error of type HTTP_MALFORMED_PUSH.
373376

374377
A server SHOULD use Push IDs sequentially, starting at 0. A client uses the
375378
MAX_PUSH_ID frame ({{frame-max-push-id}}) to limit the number of pushes that a
@@ -408,13 +411,30 @@ All frames have the following format:
408411
0 1 2 3
409412
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
410413
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
411-
| Length (16) | Type (8) | Flags (8) |
414+
| Length (i) ...
412415
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
413-
| Frame Payload (*) ...
416+
| Type (8) | Flags (8) | Frame Payload (*) ...
414417
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
415418
~~~~~~~~~~
416419
{: #fig-frame title="HTTP/QUIC frame format"}
417420

421+
A frame includes the following fields:
422+
423+
Length:
424+
: A variable-length integer that describes the length of the Frame Payload.
425+
This length does not include the frame header.
426+
427+
Type:
428+
: An 8-bit type for the frame.
429+
430+
Flags:
431+
: An 8-bit field containing flags. The Type field determines the semantics of
432+
flags.
433+
434+
Frame Payload:
435+
: A payload, the semantics of which are determined by the Type field.
436+
437+
418438
## Frame Definitions {#frames}
419439

420440
### DATA {#frame-data}
@@ -434,25 +454,13 @@ with a payload length of zero, the recipient MUST respond with a stream error
434454

435455
### HEADERS {#frame-headers}
436456

437-
The HEADERS frame (type=0x1) is used to carry part of a header set, compressed
438-
using HPACK {{header-compression}}.
439-
440-
One flag is defined:
441-
442-
End Header Block (0x4):
443-
: This frame concludes a header block.
457+
The HEADERS frame (type=0x1) is used to carry a header block, compressed using
458+
HPACK {{header-compression}}.
444459

445-
A HEADERS frame with any other flags set MUST be treated as a connection error
446-
of type HTTP_MALFORMED_HEADERS.
460+
No flags are defined for the HEADERS frame.
447461

448-
The next frame on the same stream after a HEADERS frame without the EHB flag set
449-
MUST be another HEADERS frame. A receiver MUST treat the receipt of any other
450-
type of frame as a stream error of type HTTP_INTERRUPTED_HEADERS. (Note that
451-
QUIC can intersperse data from other streams between frames, or even during
452-
transmission of frames, so multiplexing is not blocked by this requirement.)
453-
454-
A full header block is contained in a sequence of zero or more HEADERS frames
455-
without EHB set, followed by a HEADERS frame with EHB set.
462+
A HEADERS frame with any flags set MUST be treated as a connection error of type
463+
HTTP_MALFORMED_HEADERS.
456464

457465

458466
### PRIORITY {#frame-priority}
@@ -485,9 +493,9 @@ The flags defined are:
485493
0 1 2 3
486494
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
487495
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
488-
| Prioritized Request ID (32) |
496+
| Prioritized Request ID (i) |
489497
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
490-
| Stream Dependency ID (32) |
498+
| Stream Dependency ID (i) |
491499
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
492500
| Weight (8) |
493501
+-+-+-+-+-+-+-+-+
@@ -497,24 +505,24 @@ The flags defined are:
497505
The PRIORITY frame payload has the following fields:
498506

499507
Prioritized Request ID:
500-
: A 32-bit identifier for a request. This contains the stream ID of a request
501-
stream when the PUSH_PRIORITIZED flag is clear, or a Push ID when the
502-
PUSH_PRIORITIZED flag is set.
508+
: A variable-length integer that identifies a request. This contains
509+
the Stream ID of a request stream when the PUSH_PRIORITIZED flag is clear,
510+
or a Push ID when the PUSH_PRIORITIZED flag is set.
503511

504512
Stream Dependency ID:
505-
: A 32-bit stream identifier for a dependent request. This contains the
506-
stream ID of a request stream when the PUSH_DEPENDENT flag is clear, or a
507-
Push ID when the PUSH_DEPENDENT flag is set. A request stream ID of 0
508-
indicates a dependency on the root stream. For details of dependencies,
509-
see {{priority}} and {{!RFC7540}}, Section 5.3.
513+
: A variable-length integer that identifies a dependent request. This
514+
contains the Stream ID of a request stream when the PUSH_DEPENDENT flag is
515+
clear, or a Push ID when the PUSH_DEPENDENT flag is set. A request Stream
516+
ID of 0 indicates a dependency on the root stream. For details of
517+
dependencies, see {{priority}} and {{!RFC7540}}, Section 5.3.
510518

511519
Weight:
512520
: An unsigned 8-bit integer representing a priority weight for the stream (see
513521
{{!RFC7540}}, Section 5.3). Add one to the value to obtain a weight between
514522
1 and 256.
515523

516-
A PRIORITY frame identifies a request to priotize, and a request upon which that
517-
request is dependent. A Prioritized Request ID or Stream Dependency ID
524+
A PRIORITY frame identifies a request to prioritize, and a request upon which
525+
that request is dependent. A Prioritized Request ID or Stream Dependency ID
518526
identifies a client-initiated request using the corresponding stream ID when the
519527
corresponding PUSH_PRIORITIZED or PUSH_DEPENDENT flag is not set. Setting the
520528
PUSH_PRIORITIZED or PUSH_DEPENDENT flag causes the Prioritized Request ID or
@@ -534,15 +542,18 @@ HTTP_MALFORMED_PRIORITY error, unless it references stream ID 0. A PRIORITY
534542
that sets a PUSH_PRIORITIZED or PUSH_DEPENDENT flag, but then references a
535543
non-existent Push ID MUST be treated as a HTTP_MALFORMED_PRIORITY error.
536544

537-
The length of a PRIORITY frame is 9 octets. A PRIORITY frame with any other
538-
length MUST be treated as a connection error of type HTTP_MALFORMED_PRIORITY.
545+
A PRIORITY frame MUST contain only the identified fields. A PRIORITY frame that
546+
contains more or fewer fields, or a PRIORITY frame that includes a truncated
547+
integer encoding MUST be treated as a connection error of type
548+
HTTP_MALFORMED_PRIORITY.
539549

540550

541551
### CANCEL_PUSH {#frame-cancel-push}
542552

543553
The CANCEL_PUSH frame (type=0x3) is used to request cancellation of server push
544554
prior to the push stream being created. The CANCEL_PUSH frame identifies a
545-
server push request by Push ID (see {{frame-push-promise}}).
555+
server push request by Push ID (see {{frame-push-promise}}) using a
556+
variable-length integer.
546557

547558
When a server receives this frame, it aborts sending the response for the
548559
identified server push. If the server has not yet started to send the server
@@ -563,14 +574,16 @@ type HTTP_WRONG_STREAM.
563574

564575
The CANCEL_PUSH frame has no defined flags.
565576

566-
The CANCEL_PUSH frame carries a 32-bit Push ID that identifies the server push
567-
that is being cancelled (see {{frame-push-promise}}).
577+
The CANCEL_PUSH frame carries a Push ID encoded as a variable-length integer.
578+
The Push ID identifies the server push that is being cancelled (see
579+
{{frame-push-promise}}).
568580

569581
If the client receives a CANCEL_PUSH frame, that frame might identify a Push ID
570582
that has not yet been mentioned by a PUSH_PROMISE frame.
571583

572-
A server MUST treat a CANCEL_PUSH frame payload that is other than 4 octets in
573-
length as a connection error of type HTTP_MALFORMED_CANCEL_PUSH.
584+
A server MUST treat a CANCEL_PUSH frame payload does not contain exactly one
585+
variable-length integer as a connection error of type
586+
HTTP_MALFORMED_CANCEL_PUSH.
574587

575588

576589
### SETTINGS {#frame-settings}
@@ -605,7 +618,7 @@ value.
605618
0 1 2 3
606619
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
607620
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
608-
| Identifier (16) | Length (16) |
621+
| Identifier (16) | Length (i) ...
609622
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
610623
| Contents (?) ...
611624
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
@@ -638,20 +651,17 @@ HTTP_MALFORMED_SETTINGS.
638651

639652
#### Integer encoding
640653

641-
Settings which are integers are transmitted in network byte order. Leading
642-
zero octets are permitted, but implementations SHOULD use only as many bytes as
643-
are needed to represent the value. An integer MUST NOT be represented in more
644-
bytes than would be used to transfer the maximum permitted value.
654+
Settings which are integers use the QUIC variable-length integer encoding.
645655

646656
#### Defined SETTINGS Parameters {#settings-parameters}
647657

648658
The following settings are defined in HTTP/QUIC:
649659

650660
SETTINGS_HEADER_TABLE_SIZE (0x1):
651-
: An integer with a maximum value of 2^32 - 1. This value MUST be zero.
661+
: An integer with a maximum value of 2^30 - 1. This value MUST be zero.
652662

653663
SETTINGS_MAX_HEADER_LIST_SIZE (0x6):
654-
: An integer with a maximum value of 2^32 - 1
664+
: An integer with a maximum value of 2^30 - 1
655665

656666
#### Usage in 0-RTT
657667

@@ -691,7 +701,7 @@ server to client, as in HTTP/2. The PUSH_PROMISE frame defines no flags.
691701
0 1 2 3
692702
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
693703
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
694-
| Push ID (32) |
704+
| Push ID (i) ...
695705
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
696706
| Header Block (*) ...
697707
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
@@ -701,9 +711,9 @@ server to client, as in HTTP/2. The PUSH_PROMISE frame defines no flags.
701711
The payload consists of:
702712

703713
Push ID:
704-
: A 32-bit identifier for the server push request. A push ID is used in push
705-
stream header ({{server-push}}), CANCEL_PUSH frames ({{frame-cancel-push}}),
706-
and PRIORITY frames ({{frame-priority}}).
714+
: A variable-length integer that identifies the server push request. A push ID
715+
is used in push stream header ({{server-push}}), CANCEL_PUSH frames
716+
({{frame-cancel-push}}), and PRIORITY frames ({{frame-priority}}).
707717

708718
Header Block:
709719
: HPACK-compressed request headers for the promised response.
@@ -742,10 +752,12 @@ while still finishing processing of previously received requests. This enables
742752
administrative actions, like server maintenance. GOAWAY by itself does not
743753
close a connection.
744754

745-
The GOAWAY frame does not define any flags, and the payload is a QUIC stream
746-
identifier. The GOAWAY frame applies to the connection, not a specific stream.
747-
A client MUST treat a GOAWAY frame on a stream other than the control stream
748-
as a connection error ({{errors}}) of type HTTP_WRONG_STREAM.
755+
The GOAWAY frame does not define any flags, and the payload is a QUIC Stream ID
756+
encoded as a variable-length integer.
757+
758+
The GOAWAY frame applies to the connection, not a specific stream. A client
759+
MUST treat a GOAWAY frame on a stream other than the control stream as a
760+
connection error ({{errors}}) of type HTTP_WRONG_STREAM.
749761

750762
Clients do not need to send GOAWAY to initiate a graceful shutdown; they simply
751763
stop making new requests. A server MUST treat receipt of a GOAWAY frame as a
@@ -856,14 +868,15 @@ sending a MAX_PUSH_ID frame as the server fulfills or cancels server pushes.
856868

857869
The MAX_PUSH_ID frame has no defined flags.
858870

859-
The MAX_PUSH_ID frame carries a 32-bit Push ID that identifies the maximum value
860-
for a Push ID that the server can use (see {{frame-push-promise}}). A
861-
MAX_PUSH_ID frame cannot reduce the maximum Push ID; receipt of a MAX_PUSH_ID
862-
that contains a smaller value than previously received MUST be treated as a
863-
connection error of type HTTP_MALFORMED_MAX_PUSH_ID.
871+
The MAX_PUSH_ID frame carries a single variable-length integer that identifies
872+
the maximum value for a Push ID that the server can use (see
873+
{{frame-push-promise}}). A MAX_PUSH_ID frame cannot reduce the maximum Push ID;
874+
receipt of a MAX_PUSH_ID that contains a smaller value than previously received
875+
MUST be treated as a connection error of type HTTP_MALFORMED_MAX_PUSH_ID.
864876

865-
A server MUST treat a MAX_PUSH_ID frame payload that is other than 4 octets in
866-
length as a connection error of type HTTP_MALFORMED_MAX_PUSH_ID.
877+
A server MUST treat a MAX_PUSH_ID frame payload that does not contain a single
878+
variable-length integer as a connection error of type
879+
HTTP_MALFORMED_MAX_PUSH_ID.
867880

868881

869882
# Connection Management
@@ -984,6 +997,13 @@ applicable to both protocols at once.
984997

985998
These departures are noted in this section.
986999

1000+
## Streams {#h2-streams}
1001+
1002+
HTTP/QUIC permits use of a larger number of streams (2^62-1) then HTTP/2. The
1003+
considerations about exhaustion of stream identifier space apply, though the
1004+
space is significantly larger such that it is likely that other limits in QUIC
1005+
are reached first, such as the limit on the connection flow control window.
1006+
9871007
## HTTP Frame Types {#h2-frames}
9881008

9891009
Many framing concepts from HTTP/2 can be elided away on QUIC, because the
@@ -1017,7 +1037,13 @@ HEADERS frames. To achieve in-order delivery of priority changes in HTTP/QUIC,
10171037
PRIORITY frames are sent on the control stream and the PRIORITY section is
10181038
removed from the HEADERS frame.
10191039

1020-
Other than this issue, frame type HTTP/2 extensions are typically portable to
1040+
Frame type definitions in HTTP/QUIC often use the QUIC variable-length integer
1041+
encoding. In particular, Stream IDs use this encoding, which allow for a larger
1042+
range of possible values than the encoding used in HTTP/2. Redefinition of the
1043+
encoding of extension frame types might be necessary if the encoding includes a
1044+
Stream ID.
1045+
1046+
Other than these issues, frame type HTTP/2 extensions are typically portable to
10211047
QUIC simply by replacing Stream 0 in HTTP/2 with Stream 1 in HTTP/QUIC.
10221048
HTTP/QUIC extensions will not assume ordering, but would not be harmed by
10231049
ordering, and would be portable to HTTP/2 in the same manner.
@@ -1354,14 +1380,21 @@ The entries in the following table are registered by this document.
13541380

13551381
The original authors of this specification were Robbie Shade and Mike Warres.
13561382

1383+
A substantial portion of Mike's contribution was supported by Microsoft during
1384+
his employment there.
1385+
13571386
# Change Log
13581387

13591388
> **RFC Editor's Note:** Please remove this section prior to publication of a
13601389
> final version of this document.
13611390

1391+
## Since draft-ietf-quic-http-07
1392+
1393+
- Changes for integer encodings in QUIC (#595,#905)
1394+
13621395
## Since draft-ietf-quic-http-06
13631396

1364-
Nothing yet.
1397+
- Track changes in QUIC error code usage (#485)
13651398

13661399
## Since draft-ietf-quic-http-05
13671400

0 commit comments

Comments
 (0)