-
Notifications
You must be signed in to change notification settings - Fork 202
/
draft-ietf-quic-http.html
2337 lines (2243 loc) · 176 KB
/
draft-ietf-quic-http.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head profile="http://www.w3.org/2006/03/hcard http://dublincore.org/documents/2008/08/04/dc-html/">
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
<title>Hypertext Transfer Protocol Version 3 (HTTP/3)</title>
<style type="text/css">/*<![CDATA[*/
body {
font: 16px "Helvetica Neue","Open Sans",Helvetica,Calibri,sans-serif;
color: #333;
font-size-adjust: 0.5;
line-height: 24px;
margin: 75px auto;
max-width: 624px;
padding: 0 5px;
}
.title, .filename, h1, h2, h3, h4, h5 {
font: 16px "Roboto Condensed","Helvetica Neue","Open Sans",Helvetica,Calibri,sans-serif;
font-size-adjust: 0.5;
font-weight: bold;
color: #333;
line-height: 100%;
margin: 1.2em 0 0.3em;
}
.title, #rfc\.title h1 { font-size: 32px; }
h1, section h1, h2, section h2, section h3, nav h2 { font-size: 20px; }
h3, section h4, h4, section h5 { font-size: 16px; }
h1 a[href], h2 a[href], h3 a[href], h4 a[href] {
color: #333;
}
table {
margin-left: 0em;
border-collapse: collapse;
}
th {
text-align: left;
border-bottom: 2px solid #ddd;
}
td {
border-top: 1px solid #ddd;
vertical-align: top;
}
tr:nth-child(2n+1) > td,
tr:nth-child(2n+1) > th {
background-color: #f9f9f9;
}
td.reference {
max-width: 200px;
border-top: none;
padding-right: 1em;
}
.right {
text-align: right;
}
table.header, table#rfc\.headerblock {
width: 100%;
}
table.header td, table#rfc\.headerblock td {
border: none;
background-color: transparent;
color: black;
padding: 0;
}
.filename {
display: block;
color: rgb(119, 119, 119);
font-size: 20px;
font-weight: normal;
line-height: 100%;
margin: 10px 0 32px;
}
#rfc\.abstract+p, #rfc\.abstract+p code, #rfc\.abstract+p samp, #rfc\.abstract+p tt {
font-size: 20px;
line-height: 28px;
}
samp, tt, code, pre, span.tt {
font-size: 13.5px;
font-family: Consolas, monospace;
font-size-adjust: none;
}
pre {
background-color: #eee;
border: 1px solid #ddd;
overflow-x: auto;
padding: 5px;
margin: 5px;
}
.figure, caption {
font-style: italic;
margin: 0 1.5em;
text-align: left;
}
address {
margin: 16px 2px;
line-height: 20px;
}
.vcard {
font-style: normal;
}
.vcardline {
display: block;
}
.vcardline .fn, address b {
font-weight: normal;
}
.vcardline .hidden {
display: none;
}
dl {
margin-left: 1em;
}
dl.dl-horizontal: {
margin-left: 0;
}
dl > dt {
float: left;
margin-right: 1em;
}
dl.nohang > dt {
float: none;
}
dl > dd {
margin-bottom: .5em;
}
dl.compact > dd {
margin-bottom: 0em;
}
dl > dd > dl {
margin-top: 0.5em;
margin-bottom: 0em;
}
ul.empty {
list-style-type: none;
}
ul.empty li {
margin-top: .5em;
}
hr {
border: 0;
border-top: 1px solid #eee;
}
hr.noprint {
display: none;
}
a {
text-decoration: none;
}
a[href] {
color: #2a6496;
}
a[href]:hover {
background-color: #eee;
}
p, ol, ul, li {
padding: 0;
}
p {
margin: 0.5em 0;
}
ol, ul {
margin: 0.2em 0 0.2em 2em;
}
li {
margin: 0.2em 0;
}
address {
font-style: normal;
}
ul.toc ul {
margin: 0 0 0 2em;
}
ul.toc li {
list-style: none;
margin: 0;
}
@media screen and (min-width: 924px) {
body {
padding-right: 350px;
}
body>ul.toc, body>#rfc\.toc {
position: fixed;
bottom: 0;
right: 0;
right: calc(50vw - 500px);
width: 300px;
z-index: 1;
overflow: auto;
overscroll-behavior: contain;
}
body>#rfc\.toc {
top: 55px;
}
body>ul.toc {
top: 100px;
}
ul.toc {
margin: 0 0 0 4px;
font-size: 12px;
line-height: 20px;
}
ul.toc ul {
margin-left: 1.2em;
}
}
.github-fork-ribbon-wrapper {
display: none;
}
@media screen and (min-width: 800px) {
/* "Fork me on GitHub" CSS ribbon based on
* https://github.com/simonwhitaker/github-fork-ribbon-css
*/
.github-fork-ribbon {
position: absolute;
padding: 2px 0;
background-color: #a00;
background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.15));
box-shadow: 0 2px 3px 0 rgba(0, 0, 0, 0.5);
font: 700 12px "Helvetica Neue", Helvetica, Arial, sans-serif;
pointer-events: auto;
top: 38px;
right: -45px;
transform: rotate(45deg);
}
.github-fork-ribbon a[href],
.github-fork-ribbon a[href]:hover {
color: #fff;
background-color: transparent;
text-decoration: none;
text-shadow: 0 -1px rgba(0, 0, 0, 0.5);
text-align: center;
width: 190px;
line-height: 18px;
display: inline-block;
padding: 2px 0;
border: 1.5px dotted #fff;
border-color: rgba(255, 255, 255, 0.6);
}
.github-fork-ribbon-wrapper {
display: block;
width: 130px;
height: 130px;
position: absolute;
overflow: hidden;
top: 0; right: 0;
z-index: 2;
pointer-events: none;
}
}
@media screen and (min-width: 1000px) {
.github-fork-ribbon-wrapper {
position: fixed;
}
/*]]>*/</style>
<meta name="viewport" content="initial-scale=1.0">
<link href="#rfc.toc" rel="Contents">
<link href="#rfc.section.1" rel="Chapter" title="1 Introduction">
<link href="#rfc.section.1.1" rel="Chapter" title="1.1 Prior versions of HTTP">
<link href="#rfc.section.1.2" rel="Chapter" title="1.2 Delegation to QUIC">
<link href="#rfc.section.2" rel="Chapter" title="2 HTTP/3 Protocol Overview">
<link href="#rfc.section.2.1" rel="Chapter" title="2.1 Document Organization">
<link href="#rfc.section.2.2" rel="Chapter" title="2.2 Conventions and Terminology">
<link href="#rfc.section.3" rel="Chapter" title="3 Connection Setup and Management">
<link href="#rfc.section.3.1" rel="Chapter" title="3.1 Draft Version Identification">
<link href="#rfc.section.3.2" rel="Chapter" title="3.2 Discovering an HTTP/3 Endpoint">
<link href="#rfc.section.3.2.1" rel="Chapter" title="3.2.1 QUIC Version Hints">
<link href="#rfc.section.3.3" rel="Chapter" title="3.3 Connection Establishment">
<link href="#rfc.section.3.4" rel="Chapter" title="3.4 Connection Reuse">
<link href="#rfc.section.4" rel="Chapter" title="4 HTTP Request Lifecycle">
<link href="#rfc.section.4.1" rel="Chapter" title="4.1 HTTP Message Exchanges">
<link href="#rfc.section.4.1.1" rel="Chapter" title="4.1.1 Header Formatting and Compression">
<link href="#rfc.section.4.1.2" rel="Chapter" title="4.1.2 Request Cancellation and Rejection">
<link href="#rfc.section.4.1.3" rel="Chapter" title="4.1.3 Malformed Requests and Responses">
<link href="#rfc.section.4.2" rel="Chapter" title="4.2 The CONNECT Method">
<link href="#rfc.section.4.3" rel="Chapter" title="4.3 Prioritization">
<link href="#rfc.section.4.3.1" rel="Chapter" title="4.3.1 Placeholders">
<link href="#rfc.section.4.3.2" rel="Chapter" title="4.3.2 Priority Tree Maintenance">
<link href="#rfc.section.4.4" rel="Chapter" title="4.4 Server Push">
<link href="#rfc.section.5" rel="Chapter" title="5 Connection Closure">
<link href="#rfc.section.5.1" rel="Chapter" title="5.1 Idle Connections">
<link href="#rfc.section.5.2" rel="Chapter" title="5.2 Connection Shutdown">
<link href="#rfc.section.5.3" rel="Chapter" title="5.3 Immediate Application Closure">
<link href="#rfc.section.5.4" rel="Chapter" title="5.4 Transport Closure">
<link href="#rfc.section.6" rel="Chapter" title="6 Stream Mapping and Usage">
<link href="#rfc.section.6.1" rel="Chapter" title="6.1 Bidirectional Streams">
<link href="#rfc.section.6.2" rel="Chapter" title="6.2 Unidirectional Streams">
<link href="#rfc.section.6.2.1" rel="Chapter" title="6.2.1 Control Streams">
<link href="#rfc.section.6.2.2" rel="Chapter" title="6.2.2 Push Streams">
<link href="#rfc.section.6.2.3" rel="Chapter" title="6.2.3 Reserved Stream Types">
<link href="#rfc.section.7" rel="Chapter" title="7 HTTP Framing Layer">
<link href="#rfc.section.7.1" rel="Chapter" title="7.1 Frame Layout">
<link href="#rfc.section.7.2" rel="Chapter" title="7.2 Frame Definitions">
<link href="#rfc.section.7.2.1" rel="Chapter" title="7.2.1 DATA">
<link href="#rfc.section.7.2.2" rel="Chapter" title="7.2.2 HEADERS">
<link href="#rfc.section.7.2.3" rel="Chapter" title="7.2.3 PRIORITY">
<link href="#rfc.section.7.2.4" rel="Chapter" title="7.2.4 CANCEL_PUSH">
<link href="#rfc.section.7.2.5" rel="Chapter" title="7.2.5 SETTINGS">
<link href="#rfc.section.7.2.6" rel="Chapter" title="7.2.6 PUSH_PROMISE">
<link href="#rfc.section.7.2.7" rel="Chapter" title="7.2.7 GOAWAY">
<link href="#rfc.section.7.2.8" rel="Chapter" title="7.2.8 MAX_PUSH_ID">
<link href="#rfc.section.7.2.9" rel="Chapter" title="7.2.9 DUPLICATE_PUSH">
<link href="#rfc.section.7.2.10" rel="Chapter" title="7.2.10 Reserved Frame Types">
<link href="#rfc.section.8" rel="Chapter" title="8 Error Handling">
<link href="#rfc.section.8.1" rel="Chapter" title="8.1 HTTP/3 Error Codes">
<link href="#rfc.section.9" rel="Chapter" title="9 Extensions to HTTP/3">
<link href="#rfc.section.10" rel="Chapter" title="10 Security Considerations">
<link href="#rfc.section.11" rel="Chapter" title="11 IANA Considerations">
<link href="#rfc.section.11.1" rel="Chapter" title="11.1 Registration of HTTP/3 Identification String">
<link href="#rfc.section.11.2" rel="Chapter" title="11.2 Registration of QUIC Version Hint Alt-Svc Parameter">
<link href="#rfc.section.11.3" rel="Chapter" title="11.3 Frame Types">
<link href="#rfc.section.11.4" rel="Chapter" title="11.4 Settings Parameters">
<link href="#rfc.section.11.5" rel="Chapter" title="11.5 Error Codes">
<link href="#rfc.section.11.6" rel="Chapter" title="11.6 Stream Types">
<link href="#rfc.references" rel="Chapter" title="12 References">
<link href="#rfc.references.1" rel="Chapter" title="12.1 Normative References">
<link href="#rfc.references.2" rel="Chapter" title="12.2 Informative References">
<link href="#rfc.appendix.A" rel="Chapter" title="A Considerations for Transitioning from HTTP/2">
<link href="#rfc.appendix.A.1" rel="Chapter" title="A.1 Streams">
<link href="#rfc.appendix.A.2" rel="Chapter" title="A.2 HTTP Frame Types">
<link href="#rfc.appendix.A.2.1" rel="Chapter" title="A.2.1 Prioritization Differences">
<link href="#rfc.appendix.A.2.2" rel="Chapter" title="A.2.2 Header Compression Differences">
<link href="#rfc.appendix.A.2.3" rel="Chapter" title="A.2.3 Guidance for New Frame Type Definitions">
<link href="#rfc.appendix.A.2.4" rel="Chapter" title="A.2.4 Mapping Between HTTP/2 and HTTP/3 Frame Types">
<link href="#rfc.appendix.A.3" rel="Chapter" title="A.3 HTTP/2 SETTINGS Parameters">
<link href="#rfc.appendix.A.4" rel="Chapter" title="A.4 HTTP/2 Error Codes">
<link href="#rfc.appendix.B" rel="Chapter" title="B Change Log">
<link href="#rfc.appendix.B.1" rel="Chapter" title="B.1 Since draft-ietf-quic-http-20">
<link href="#rfc.appendix.B.2" rel="Chapter" title="B.2 Since draft-ietf-quic-http-19">
<link href="#rfc.appendix.B.3" rel="Chapter" title="B.3 Since draft-ietf-quic-http-18">
<link href="#rfc.appendix.B.4" rel="Chapter" title="B.4 Since draft-ietf-quic-http-17">
<link href="#rfc.appendix.B.5" rel="Chapter" title="B.5 Since draft-ietf-quic-http-16">
<link href="#rfc.appendix.B.6" rel="Chapter" title="B.6 Since draft-ietf-quic-http-15">
<link href="#rfc.appendix.B.7" rel="Chapter" title="B.7 Since draft-ietf-quic-http-14">
<link href="#rfc.appendix.B.8" rel="Chapter" title="B.8 Since draft-ietf-quic-http-13">
<link href="#rfc.appendix.B.9" rel="Chapter" title="B.9 Since draft-ietf-quic-http-12">
<link href="#rfc.appendix.B.10" rel="Chapter" title="B.10 Since draft-ietf-quic-http-11">
<link href="#rfc.appendix.B.11" rel="Chapter" title="B.11 Since draft-ietf-quic-http-10">
<link href="#rfc.appendix.B.12" rel="Chapter" title="B.12 Since draft-ietf-quic-http-09">
<link href="#rfc.appendix.B.13" rel="Chapter" title="B.13 Since draft-ietf-quic-http-08">
<link href="#rfc.appendix.B.14" rel="Chapter" title="B.14 Since draft-ietf-quic-http-07">
<link href="#rfc.appendix.B.15" rel="Chapter" title="B.15 Since draft-ietf-quic-http-06">
<link href="#rfc.appendix.B.16" rel="Chapter" title="B.16 Since draft-ietf-quic-http-05">
<link href="#rfc.appendix.B.17" rel="Chapter" title="B.17 Since draft-ietf-quic-http-04">
<link href="#rfc.appendix.B.18" rel="Chapter" title="B.18 Since draft-ietf-quic-http-03">
<link href="#rfc.appendix.B.19" rel="Chapter" title="B.19 Since draft-ietf-quic-http-02">
<link href="#rfc.appendix.B.20" rel="Chapter" title="B.20 Since draft-ietf-quic-http-01">
<link href="#rfc.appendix.B.21" rel="Chapter" title="B.21 Since draft-ietf-quic-http-00">
<link href="#rfc.appendix.B.22" rel="Chapter" title="B.22 Since draft-shade-quic-http2-mapping-00">
<link href="#rfc.acknowledgements" rel="Chapter">
<link href="#rfc.authors" rel="Chapter">
<meta name="generator" content="xml2rfc version 2.22.2 - https://tools.ietf.org/tools/xml2rfc" />
<link rel="schema.dct" href="http://purl.org/dc/terms/" />
<meta name="dct.creator" content="Bishop, M., Ed." />
<meta name="dct.identifier" content="urn:ietf:id:draft-ietf-quic-http-latest" />
<meta name="dct.issued" scheme="ISO8601" content="2019-07-08" />
<meta name="dct.abstract" content="The QUIC transport protocol has several features that are desirable in a transport for HTTP, such as stream multiplexing, per-stream flow control, and low-latency connection establishment. This document describes a mapping of HTTP semantics over QUIC. This document also identifies HTTP/2 features that are subsumed by QUIC, and describes how HTTP/2 extensions can be ported to HTTP/3." />
<meta name="description" content="The QUIC transport protocol has several features that are desirable in a transport for HTTP, such as stream multiplexing, per-stream flow control, and low-latency connection establishment. This document describes a mapping of HTTP semantics over QUIC. This document also identifies HTTP/2 features that are subsumed by QUIC, and describes how HTTP/2 extensions can be ported to HTTP/3." />
</head>
<body>
<table class="header">
<tbody>
<tr>
<td class="left">QUIC</td>
<td class="right">M. Bishop, Ed.</td>
</tr>
<tr>
<td class="left">Internet-Draft</td>
<td class="right">Akamai</td>
</tr>
<tr>
<td class="left">Intended status: Standards Track</td>
<td class="right">July 08, 2019</td>
</tr>
<tr>
<td class="left">Expires: January 9, 2020</td>
<td class="right"></td>
</tr>
</tbody>
</table>
<p class="title">Hypertext Transfer Protocol Version 3 (HTTP/3)<br />
<span class="filename">draft-ietf-quic-http-latest</span></p>
<h1 id="rfc.abstract"><a href="#rfc.abstract">Abstract</a></h1>
<p>The QUIC transport protocol has several features that are desirable in a transport for HTTP, such as stream multiplexing, per-stream flow control, and low-latency connection establishment. This document describes a mapping of HTTP semantics over QUIC. This document also identifies HTTP/2 features that are subsumed by QUIC, and describes how HTTP/2 extensions can be ported to HTTP/3.</p>
<h1><a>Note to Readers</a></h1>
<p>Discussion of this draft takes place on the QUIC working group mailing list (quic@ietf.org), which is archived at <a href="https://mailarchive.ietf.org/arch/search/?email_list=quic">https://mailarchive.ietf.org/arch/search/?email_list=quic</a>.</p>
<p>Working Group information can be found at <a href="https://github.com/quicwg">https://github.com/quicwg</a>; source code and issues list for this draft can be found at <a href="https://github.com/quicwg/base-drafts/labels/-http">https://github.com/quicwg/base-drafts/labels/-http</a>.</p>
<h1 id="rfc.status"><a href="#rfc.status">Status of This Memo</a></h1>
<p>This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.</p>
<p>Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is at https://datatracker.ietf.org/drafts/current/.</p>
<p>Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."</p>
<p>This Internet-Draft will expire on January 9, 2020.</p>
<h1 id="rfc.copyrightnotice"><a href="#rfc.copyrightnotice">Copyright Notice</a></h1>
<p>Copyright (c) 2019 IETF Trust and the persons identified as the document authors. All rights reserved.</p>
<p>This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License.</p>
<hr class="noprint" />
<h1 class="np" id="rfc.toc"><a href="#rfc.toc">Table of Contents</a></h1>
<ul class="toc">
<li>1. <a href="#rfc.section.1">Introduction</a>
</li>
<ul><li>1.1. <a href="#rfc.section.1.1">Prior versions of HTTP</a>
</li>
<li>1.2. <a href="#rfc.section.1.2">Delegation to QUIC</a>
</li>
</ul><li>2. <a href="#rfc.section.2">HTTP/3 Protocol Overview</a>
</li>
<ul><li>2.1. <a href="#rfc.section.2.1">Document Organization</a>
</li>
<li>2.2. <a href="#rfc.section.2.2">Conventions and Terminology</a>
</li>
</ul><li>3. <a href="#rfc.section.3">Connection Setup and Management</a>
</li>
<ul><li>3.1. <a href="#rfc.section.3.1">Draft Version Identification</a>
</li>
<li>3.2. <a href="#rfc.section.3.2">Discovering an HTTP/3 Endpoint</a>
</li>
<ul><li>3.2.1. <a href="#rfc.section.3.2.1">QUIC Version Hints</a>
</li>
</ul><li>3.3. <a href="#rfc.section.3.3">Connection Establishment</a>
</li>
<li>3.4. <a href="#rfc.section.3.4">Connection Reuse</a>
</li>
</ul><li>4. <a href="#rfc.section.4">HTTP Request Lifecycle</a>
</li>
<ul><li>4.1. <a href="#rfc.section.4.1">HTTP Message Exchanges</a>
</li>
<ul><li>4.1.1. <a href="#rfc.section.4.1.1">Header Formatting and Compression</a>
</li>
<li>4.1.2. <a href="#rfc.section.4.1.2">Request Cancellation and Rejection</a>
</li>
<li>4.1.3. <a href="#rfc.section.4.1.3">Malformed Requests and Responses</a>
</li>
</ul><li>4.2. <a href="#rfc.section.4.2">The CONNECT Method</a>
</li>
<li>4.3. <a href="#rfc.section.4.3">Prioritization</a>
</li>
<ul><li>4.3.1. <a href="#rfc.section.4.3.1">Placeholders</a>
</li>
<li>4.3.2. <a href="#rfc.section.4.3.2">Priority Tree Maintenance</a>
</li>
</ul><li>4.4. <a href="#rfc.section.4.4">Server Push</a>
</li>
</ul><li>5. <a href="#rfc.section.5">Connection Closure</a>
</li>
<ul><li>5.1. <a href="#rfc.section.5.1">Idle Connections</a>
</li>
<li>5.2. <a href="#rfc.section.5.2">Connection Shutdown</a>
</li>
<li>5.3. <a href="#rfc.section.5.3">Immediate Application Closure</a>
</li>
<li>5.4. <a href="#rfc.section.5.4">Transport Closure</a>
</li>
</ul><li>6. <a href="#rfc.section.6">Stream Mapping and Usage</a>
</li>
<ul><li>6.1. <a href="#rfc.section.6.1">Bidirectional Streams</a>
</li>
<li>6.2. <a href="#rfc.section.6.2">Unidirectional Streams</a>
</li>
<ul><li>6.2.1. <a href="#rfc.section.6.2.1">Control Streams</a>
</li>
<li>6.2.2. <a href="#rfc.section.6.2.2">Push Streams</a>
</li>
<li>6.2.3. <a href="#rfc.section.6.2.3">Reserved Stream Types</a>
</li>
</ul></ul><li>7. <a href="#rfc.section.7">HTTP Framing Layer</a>
</li>
<ul><li>7.1. <a href="#rfc.section.7.1">Frame Layout</a>
</li>
<li>7.2. <a href="#rfc.section.7.2">Frame Definitions</a>
</li>
<ul><li>7.2.1. <a href="#rfc.section.7.2.1">DATA</a>
</li>
<li>7.2.2. <a href="#rfc.section.7.2.2">HEADERS</a>
</li>
<li>7.2.3. <a href="#rfc.section.7.2.3">PRIORITY</a>
</li>
<li>7.2.4. <a href="#rfc.section.7.2.4">CANCEL_PUSH</a>
</li>
<li>7.2.5. <a href="#rfc.section.7.2.5">SETTINGS</a>
</li>
<li>7.2.6. <a href="#rfc.section.7.2.6">PUSH_PROMISE</a>
</li>
<li>7.2.7. <a href="#rfc.section.7.2.7">GOAWAY</a>
</li>
<li>7.2.8. <a href="#rfc.section.7.2.8">MAX_PUSH_ID</a>
</li>
<li>7.2.9. <a href="#rfc.section.7.2.9">DUPLICATE_PUSH</a>
</li>
<li>7.2.10. <a href="#rfc.section.7.2.10">Reserved Frame Types</a>
</li>
</ul></ul><li>8. <a href="#rfc.section.8">Error Handling</a>
</li>
<ul><li>8.1. <a href="#rfc.section.8.1">HTTP/3 Error Codes</a>
</li>
</ul><li>9. <a href="#rfc.section.9">Extensions to HTTP/3</a>
</li>
<li>10. <a href="#rfc.section.10">Security Considerations</a>
</li>
<li>11. <a href="#rfc.section.11">IANA Considerations</a>
</li>
<ul><li>11.1. <a href="#rfc.section.11.1">Registration of HTTP/3 Identification String</a>
</li>
<li>11.2. <a href="#rfc.section.11.2">Registration of QUIC Version Hint Alt-Svc Parameter</a>
</li>
<li>11.3. <a href="#rfc.section.11.3">Frame Types</a>
</li>
<li>11.4. <a href="#rfc.section.11.4">Settings Parameters</a>
</li>
<li>11.5. <a href="#rfc.section.11.5">Error Codes</a>
</li>
<li>11.6. <a href="#rfc.section.11.6">Stream Types</a>
</li>
</ul><li>12. <a href="#rfc.references">References</a>
</li>
<ul><li>12.1. <a href="#rfc.references.1">Normative References</a>
</li>
<li>12.2. <a href="#rfc.references.2">Informative References</a>
</li>
</ul><li>Appendix A. <a href="#rfc.appendix.A">Considerations for Transitioning from HTTP/2</a>
</li>
<ul><li>A.1. <a href="#rfc.appendix.A.1">Streams</a>
</li>
<li>A.2. <a href="#rfc.appendix.A.2">HTTP Frame Types</a>
</li>
<ul><li>A.2.1. <a href="#rfc.appendix.A.2.1">Prioritization Differences</a>
</li>
<li>A.2.2. <a href="#rfc.appendix.A.2.2">Header Compression Differences</a>
</li>
<li>A.2.3. <a href="#rfc.appendix.A.2.3">Guidance for New Frame Type Definitions</a>
</li>
<li>A.2.4. <a href="#rfc.appendix.A.2.4">Mapping Between HTTP/2 and HTTP/3 Frame Types</a>
</li>
</ul><li>A.3. <a href="#rfc.appendix.A.3">HTTP/2 SETTINGS Parameters</a>
</li>
<li>A.4. <a href="#rfc.appendix.A.4">HTTP/2 Error Codes</a>
</li>
</ul><li>Appendix B. <a href="#rfc.appendix.B">Change Log</a>
</li>
<ul><li>B.1. <a href="#rfc.appendix.B.1">Since draft-ietf-quic-http-20</a>
</li>
<li>B.2. <a href="#rfc.appendix.B.2">Since draft-ietf-quic-http-19</a>
</li>
<li>B.3. <a href="#rfc.appendix.B.3">Since draft-ietf-quic-http-18</a>
</li>
<li>B.4. <a href="#rfc.appendix.B.4">Since draft-ietf-quic-http-17</a>
</li>
<li>B.5. <a href="#rfc.appendix.B.5">Since draft-ietf-quic-http-16</a>
</li>
<li>B.6. <a href="#rfc.appendix.B.6">Since draft-ietf-quic-http-15</a>
</li>
<li>B.7. <a href="#rfc.appendix.B.7">Since draft-ietf-quic-http-14</a>
</li>
<li>B.8. <a href="#rfc.appendix.B.8">Since draft-ietf-quic-http-13</a>
</li>
<li>B.9. <a href="#rfc.appendix.B.9">Since draft-ietf-quic-http-12</a>
</li>
<li>B.10. <a href="#rfc.appendix.B.10">Since draft-ietf-quic-http-11</a>
</li>
<li>B.11. <a href="#rfc.appendix.B.11">Since draft-ietf-quic-http-10</a>
</li>
<li>B.12. <a href="#rfc.appendix.B.12">Since draft-ietf-quic-http-09</a>
</li>
<li>B.13. <a href="#rfc.appendix.B.13">Since draft-ietf-quic-http-08</a>
</li>
<li>B.14. <a href="#rfc.appendix.B.14">Since draft-ietf-quic-http-07</a>
</li>
<li>B.15. <a href="#rfc.appendix.B.15">Since draft-ietf-quic-http-06</a>
</li>
<li>B.16. <a href="#rfc.appendix.B.16">Since draft-ietf-quic-http-05</a>
</li>
<li>B.17. <a href="#rfc.appendix.B.17">Since draft-ietf-quic-http-04</a>
</li>
<li>B.18. <a href="#rfc.appendix.B.18">Since draft-ietf-quic-http-03</a>
</li>
<li>B.19. <a href="#rfc.appendix.B.19">Since draft-ietf-quic-http-02</a>
</li>
<li>B.20. <a href="#rfc.appendix.B.20">Since draft-ietf-quic-http-01</a>
</li>
<li>B.21. <a href="#rfc.appendix.B.21">Since draft-ietf-quic-http-00</a>
</li>
<li>B.22. <a href="#rfc.appendix.B.22">Since draft-shade-quic-http2-mapping-00</a>
</li>
</ul><li><a href="#rfc.acknowledgements">Acknowledgements</a>
</li>
<li><a href="#rfc.authors">Author's Address</a>
</li>
</ul>
<h1 id="rfc.section.1">
<a href="#rfc.section.1">1.</a> <a href="#introduction" id="introduction">Introduction</a>
</h1>
<p id="rfc.section.1.p.1">HTTP semantics are used for a broad range of services on the Internet. These semantics have commonly been used with two different TCP mappings, HTTP/1.1 and HTTP/2. HTTP/3 supports the same semantics over a new transport protocol, QUIC.</p>
<h2 id="rfc.section.1.1">
<a href="#rfc.section.1.1">1.1.</a> <a href="#prior-versions-of-http" id="prior-versions-of-http">Prior versions of HTTP</a>
</h2>
<p id="rfc.section.1.1.p.1">HTTP/1.1 is a TCP mapping which uses whitespace-delimited text fields to convey HTTP messages. While these exchanges are human-readable, using whitespace for message formatting leads to parsing difficulties and workarounds to be tolerant of variant behavior. Because each connection can transfer only a single HTTP request or response at a time in each direction, multiple parallel TCP connections are often used, reducing the ability of the congestion controller to accurately manage traffic between endpoints.</p>
<p id="rfc.section.1.1.p.2">HTTP/2 introduced a binary framing and multiplexing layer to improve latency without modifying the transport layer. However, because the parallel nature of HTTP/2’s multiplexing is not visible to TCP’s loss recovery mechanisms, a lost or reordered packet causes all active transactions to experience a stall regardless of whether that transaction was impacted by the lost packet.</p>
<h2 id="rfc.section.1.2">
<a href="#rfc.section.1.2">1.2.</a> <a href="#delegation-to-quic" id="delegation-to-quic">Delegation to QUIC</a>
</h2>
<p id="rfc.section.1.2.p.1">The QUIC transport protocol incorporates stream multiplexing and per-stream flow control, similar to that provided by the HTTP/2 framing layer. By providing reliability at the stream level and congestion control across the entire connection, it has the capability to improve the performance of HTTP compared to a TCP mapping. QUIC also incorporates TLS 1.3 at the transport layer, offering comparable security to running TLS over TCP, with the improved connection setup latency of TCP Fast Open <a href="#RFC7413" class="xref">[RFC7413]</a>}.</p>
<p id="rfc.section.1.2.p.2">This document defines a mapping of HTTP semantics over the QUIC transport protocol, drawing heavily on the design of HTTP/2. While delegating stream lifetime and flow control issues to QUIC, a similar binary framing is used on each stream. Some HTTP/2 features are subsumed by QUIC, while other features are implemented atop QUIC.</p>
<p id="rfc.section.1.2.p.3">QUIC is described in <a href="#QUIC-TRANSPORT" class="xref">[QUIC-TRANSPORT]</a>. For a full description of HTTP/2, see <a href="#HTTP2" class="xref">[HTTP2]</a>.</p>
<h1 id="rfc.section.2">
<a href="#rfc.section.2">2.</a> <a href="#http3-protocol-overview" id="http3-protocol-overview">HTTP/3 Protocol Overview</a>
</h1>
<p id="rfc.section.2.p.1">HTTP/3 provides a transport for HTTP semantics using the QUIC transport protocol and an internal framing layer similar to HTTP/2.</p>
<p id="rfc.section.2.p.2">Once a client knows that an HTTP/3 server exists at a certain endpoint, it opens a QUIC connection. QUIC provides protocol negotiation, stream-based multiplexing, and flow control. An HTTP/3 endpoint can be discovered using HTTP Alternative Services; this process is described in greater detail in <a href="#discovery" class="xref">Section 3.2</a>.</p>
<p id="rfc.section.2.p.3">Within each stream, the basic unit of HTTP/3 communication is a frame (<a href="#frames" class="xref">Section 7.2</a>). Each frame type serves a different purpose. For example, HEADERS and DATA frames form the basis of HTTP requests and responses (<a href="#request-response" class="xref">Section 4.1</a>). Other frame types like SETTINGS, PRIORITY, and GOAWAY are used to manage the overall connection and relationships between streams.</p>
<p id="rfc.section.2.p.4">Multiplexing of requests is performed using the QUIC stream abstraction, described in Section 2 of <a href="#QUIC-TRANSPORT" class="xref">[QUIC-TRANSPORT]</a>. Each request and response consumes a single QUIC stream. Streams are independent of each other, so one stream that is blocked or suffers packet loss does not prevent progress on other streams.</p>
<p id="rfc.section.2.p.5">Server push is an interaction mode introduced in HTTP/2 <a href="#HTTP2" class="xref">[HTTP2]</a> which permits a server to push a request-response exchange to a client in anticipation of the client making the indicated request. This trades off network usage against a potential latency gain. Several HTTP/3 frames are used to manage server push, such as PUSH_PROMISE, DUPLICATE_PUSH, MAX_PUSH_ID, and CANCEL_PUSH.</p>
<p id="rfc.section.2.p.6">As in HTTP/2, request and response headers are compressed for transmission. Because HPACK <a href="#HPACK" class="xref">[HPACK]</a> relies on in-order transmission of compressed header blocks (a guarantee not provided by QUIC), HTTP/3 replaces HPACK with QPACK <a href="#QPACK" class="xref">[QPACK]</a>. QPACK uses separate unidirectional streams to modify and track header table state, while header blocks refer to the state of the table without modifying it.</p>
<h2 id="rfc.section.2.1">
<a href="#rfc.section.2.1">2.1.</a> <a href="#document-organization" id="document-organization">Document Organization</a>
</h2>
<p id="rfc.section.2.1.p.1">The HTTP/3 specification is split into seven parts. The document begins with a detailed overview of the connection lifecycle and key concepts:</p>
<p></p>
<ul>
<li>Connection Setup and Management (<a href="#connection-setup" class="xref">Section 3</a>) covers how an HTTP/3 endpoint is discovered and a connection is established.</li>
<li>HTTP Request Lifecycle (<a href="#http-request-lifecycle" class="xref">Section 4</a>) describes how HTTP semantics are expressed using frames.</li>
<li>Connection Closure (<a href="#connection-closure" class="xref">Section 5</a>) describes how connections are terminated, either gracefully or abruptly.</li>
</ul>
<p id="rfc.section.2.1.p.3">The details of the wire protocol and interactions with the transport are described in subsequent sections:</p>
<p></p>
<ul>
<li>Stream Mapping and Usage (<a href="#stream-mapping" class="xref">Section 6</a>) describes the way QUIC streams are used.</li>
<li>HTTP Framing Layer (<a href="#http-framing-layer" class="xref">Section 7</a>) describes the frames used on most streams.</li>
<li>Error Handling (<a href="#errors" class="xref">Section 8</a>) describes how error conditions are handled and expressed, either on a particular stream or for the connection as a whole.</li>
</ul>
<p id="rfc.section.2.1.p.5">Additional resources are provided in the final sections:</p>
<p></p>
<ul>
<li>Extensions to HTTP/3 (<a href="#extensions" class="xref">Section 9</a>) describes how new capabilities can be added in future documents.</li>
<li>A more detailed comparison between HTTP/2 and HTTP/3 can be found in <a href="#h2-considerations" class="xref">Appendix A</a>.</li>
</ul>
<h2 id="rfc.section.2.2">
<a href="#rfc.section.2.2">2.2.</a> <a href="#conventions-and-terminology" id="conventions-and-terminology">Conventions and Terminology</a>
</h2>
<p id="rfc.section.2.2.p.1">The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “NOT RECOMMENDED”, “MAY”, and “OPTIONAL” in this document are to be interpreted as described in BCP 14 <a href="#RFC2119" class="xref">[RFC2119]</a> <a href="#RFC8174" class="xref">[RFC8174]</a> when, and only when, they appear in all capitals, as shown here.</p>
<p id="rfc.section.2.2.p.2">Field definitions are given in Augmented Backus-Naur Form (ABNF), as defined in <a href="#RFC5234" class="xref">[RFC5234]</a>.</p>
<p id="rfc.section.2.2.p.3">This document uses the variable-length integer encoding from <a href="#QUIC-TRANSPORT" class="xref">[QUIC-TRANSPORT]</a>.</p>
<p id="rfc.section.2.2.p.4">The following terms are used:</p>
<p></p>
<dl>
<dt>abort:</dt>
<dd style="margin-left: 8">An abrupt termination of a connection or stream, possibly due to an error condition.</dd>
<dt>client:</dt>
<dd style="margin-left: 8">The endpoint that initiates an HTTP/3 connection. Clients send HTTP requests and receive HTTP responses.</dd>
<dt>connection:</dt>
<dd style="margin-left: 8">A transport-layer connection between two endpoints, using QUIC as the transport protocol.</dd>
<dt>connection error:</dt>
<dd style="margin-left: 8">An error that affects the entire HTTP/3 connection.</dd>
<dt>endpoint:</dt>
<dd style="margin-left: 8">Either the client or server of the connection.</dd>
<dt>frame:</dt>
<dd style="margin-left: 8">The smallest unit of communication on a stream in HTTP/3, consisting of a header and a variable-length sequence of octets structured according to the frame type. Protocol elements called “frames” exist in both this document and <a href="#QUIC-TRANSPORT" class="xref">[QUIC-TRANSPORT]</a>. Where frames from <a href="#QUIC-TRANSPORT" class="xref">[QUIC-TRANSPORT]</a> are referenced, the frame name will be prefaced with “QUIC.” For example, “QUIC CONNECTION_CLOSE frames.” References without this preface refer to frames defined in <a href="#frames" class="xref">Section 7.2</a>.</dd>
<dt>peer:</dt>
<dd style="margin-left: 8">An endpoint. When discussing a particular endpoint, “peer” refers to the endpoint that is remote to the primary subject of discussion.</dd>
<dt>receiver:</dt>
<dd style="margin-left: 8">An endpoint that is receiving frames.</dd>
<dt>sender:</dt>
<dd style="margin-left: 8">An endpoint that is transmitting frames.</dd>
<dt>server:</dt>
<dd style="margin-left: 8">The endpoint that accepts an HTTP/3 connection. Servers receive HTTP requests and send HTTP responses.</dd>
<dt>stream:</dt>
<dd style="margin-left: 8">A bidirectional or unidirectional bytestream provided by the QUIC transport.</dd>
<dt>stream error:</dt>
<dd style="margin-left: 8">An error on the individual HTTP/3 stream.</dd>
</dl>
<p id="rfc.section.2.2.p.6">The term “payload body” is defined in Section 3.3 of <a href="#RFC7230" class="xref">[RFC7230]</a>.</p>
<p id="rfc.section.2.2.p.7">Finally, the terms “gateway”, “intermediary”, “proxy”, and “tunnel” are defined in Section 2.3 of <a href="#RFC7230" class="xref">[RFC7230]</a>. Intermediaries act as both client and server at different times.</p>
<h1 id="rfc.section.3">
<a href="#rfc.section.3">3.</a> <a href="#connection-setup" id="connection-setup">Connection Setup and Management</a>
</h1>
<h2 id="rfc.section.3.1">
<a href="#rfc.section.3.1">3.1.</a> <a href="#draft-version-identification" id="draft-version-identification">Draft Version Identification</a>
</h2>
<p></p>
<ul class="empty"><li>
<strong>RFC Editor’s Note:</strong> Please remove this section prior to publication of a final version of this document.</li></ul>
<p id="rfc.section.3.1.p.2">HTTP/3 uses the token “h3” to identify itself in ALPN and Alt-Svc. Only implementations of the final, published RFC can identify themselves as “h3”. Until such an RFC exists, implementations MUST NOT identify themselves using this string.</p>
<p id="rfc.section.3.1.p.3">Implementations of draft versions of the protocol MUST add the string “-“ and the corresponding draft number to the identifier. For example, draft-ietf-quic-http-01 is identified using the string “h3-01”.</p>
<p id="rfc.section.3.1.p.4">Non-compatible experiments that are based on these draft versions MUST append the string “-“ and an experiment name to the identifier. For example, an experimental implementation based on draft-ietf-quic-http-09 which reserves an extra stream for unsolicited transmission of 1980s pop music might identify itself as “h3-09-rickroll”. Note that any label MUST conform to the “token” syntax defined in Section 3.2.6 of <a href="#RFC7230" class="xref">[RFC7230]</a>. Experimenters are encouraged to coordinate their experiments on the quic@ietf.org mailing list.</p>
<h2 id="rfc.section.3.2">
<a href="#rfc.section.3.2">3.2.</a> <a href="#discovery" id="discovery">Discovering an HTTP/3 Endpoint</a>
</h2>
<p id="rfc.section.3.2.p.1">An HTTP origin advertises the availability of an equivalent HTTP/3 endpoint via the Alt-Svc HTTP response header field or the HTTP/2 ALTSVC frame (<a href="#ALTSVC" class="xref">[ALTSVC]</a>), using the ALPN token defined in <a href="#connection-establishment" class="xref">Section 3.3</a>.</p>
<p id="rfc.section.3.2.p.2">For example, an origin could indicate in an HTTP response that HTTP/3 was available on UDP port 50781 at the same hostname by including the following header field:</p>
<pre>
Alt-Svc: h3=":50781"
</pre>
<p id="rfc.section.3.2.p.3">On receipt of an Alt-Svc record indicating HTTP/3 support, a client MAY attempt to establish a QUIC connection to the indicated host and port and, if successful, send HTTP requests using the mapping described in this document.</p>
<p id="rfc.section.3.2.p.4">Connectivity problems (e.g. firewall blocking UDP) can result in QUIC connection establishment failure, in which case the client SHOULD continue using the existing connection or try another alternative endpoint offered by the origin.</p>
<p id="rfc.section.3.2.p.5">Servers MAY serve HTTP/3 on any UDP port, since an alternative always includes an explicit port.</p>
<h3 id="rfc.section.3.2.1">
<a href="#rfc.section.3.2.1">3.2.1.</a> <a href="#alt-svc-version-hint" id="alt-svc-version-hint">QUIC Version Hints</a>
</h3>
<p id="rfc.section.3.2.1.p.1">This document defines the “quic” parameter for Alt-Svc, which MAY be used to provide version-negotiation hints to HTTP/3 clients. QUIC versions are four-byte sequences with no additional constraints on format. Leading zeros SHOULD be omitted for brevity.</p>
<p id="rfc.section.3.2.1.p.2">Syntax:</p>
<pre>
quic = DQUOTE version-number [ "," version-number ] * DQUOTE
version-number = 1*8HEXDIG; hex-encoded QUIC version
</pre>
<p id="rfc.section.3.2.1.p.3">Where multiple versions are listed, the order of the values reflects the server’s preference (with the first value being the most preferred version). Reserved versions MAY be listed, but unreserved versions which are not supported by the alternative SHOULD NOT be present in the list. Origins MAY omit supported versions for any reason.</p>
<p id="rfc.section.3.2.1.p.4">Clients MUST ignore any included versions which they do not support. The “quic” parameter MUST NOT occur more than once; clients SHOULD process only the first occurrence.</p>
<p id="rfc.section.3.2.1.p.5">For example, suppose a server supported both version 0x00000001 and the version rendered in ASCII as “Q034”. If it also opted to include the reserved version (from Section 15 of <a href="#QUIC-TRANSPORT" class="xref">[QUIC-TRANSPORT]</a>) 0x1abadaba, it could specify the following header field:</p>
<pre>
Alt-Svc: h3=":49288";quic="1,1abadaba,51303334"
</pre>
<p id="rfc.section.3.2.1.p.6">A client acting on this header field would drop the reserved version (not supported), then attempt to connect to the alternative using the first version in the list which it does support, if any.</p>
<h2 id="rfc.section.3.3">
<a href="#rfc.section.3.3">3.3.</a> <a href="#connection-establishment" id="connection-establishment">Connection Establishment</a>
</h2>
<p id="rfc.section.3.3.p.1">HTTP/3 relies on QUIC as the underlying transport. The QUIC version being used MUST use TLS version 1.3 or greater as its handshake protocol. HTTP/3 clients MUST indicate the target domain name during the TLS handshake. This may be done using the Server Name Indication (SNI) <a href="#RFC6066" class="xref">[RFC6066]</a> extension to TLS or using some other mechanism.</p>
<p id="rfc.section.3.3.p.2">QUIC connections are established as described in <a href="#QUIC-TRANSPORT" class="xref">[QUIC-TRANSPORT]</a>. During connection establishment, HTTP/3 support is indicated by selecting the ALPN token “h3” in the TLS handshake. Support for other application-layer protocols MAY be offered in the same handshake.</p>
<p id="rfc.section.3.3.p.3">While connection-level options pertaining to the core QUIC protocol are set in the initial crypto handshake, HTTP/3-specific settings are conveyed in the SETTINGS frame. After the QUIC connection is established, a SETTINGS frame (<a href="#frame-settings" class="xref">Section 7.2.5</a>) MUST be sent by each endpoint as the initial frame of their respective HTTP control stream (see <a href="#control-streams" class="xref">Section 6.2.1</a>).</p>
<h2 id="rfc.section.3.4">
<a href="#rfc.section.3.4">3.4.</a> <a href="#connection-reuse" id="connection-reuse">Connection Reuse</a>
</h2>
<p id="rfc.section.3.4.p.1">Once a connection exists to a server endpoint, this connection MAY be reused for requests with multiple different URI authority components. The client MAY send any requests for which the client considers the server authoritative.</p>
<p id="rfc.section.3.4.p.2">An authoritative HTTP/3 endpoint is typically discovered because the client has received an Alt-Svc record from the request’s origin which nominates the endpoint as a valid HTTP Alternative Service for that origin. As required by <a href="#RFC7838" class="xref">[RFC7838]</a>, clients MUST check that the nominated server can present a valid certificate for the origin before considering it authoritative. Clients MUST NOT assume that an HTTP/3 endpoint is authoritative for other origins without an explicit signal.</p>
<p id="rfc.section.3.4.p.3">A server that does not wish clients to reuse connections for a particular origin can indicate that it is not authoritative for a request by sending a 421 (Misdirected Request) status code in response to the request (see Section 9.1.2 of <a href="#HTTP2" class="xref">[HTTP2]</a>).</p>
<p id="rfc.section.3.4.p.4">The considerations discussed in Section 9.1 of <a href="#HTTP2" class="xref">[HTTP2]</a> also apply to the management of HTTP/3 connections.</p>
<h1 id="rfc.section.4">
<a href="#rfc.section.4">4.</a> <a href="#http-request-lifecycle" id="http-request-lifecycle">HTTP Request Lifecycle</a>
</h1>
<h2 id="rfc.section.4.1">
<a href="#rfc.section.4.1">4.1.</a> <a href="#request-response" id="request-response">HTTP Message Exchanges</a>
</h2>
<p id="rfc.section.4.1.p.1">A client sends an HTTP request on a client-initiated bidirectional QUIC stream. A client MUST send only a single request on a given stream. A server sends zero or more non-final HTTP responses on the same stream as the request, followed by a single final HTTP response, as detailed below.</p>
<p id="rfc.section.4.1.p.2">An HTTP message (request or response) consists of:</p>
<p></p>
<ol>
<li>the message header (see <a href="#RFC7230" class="xref">[RFC7230]</a>, Section 3.2), sent as a single HEADERS frame (see <a href="#frame-headers" class="xref">Section 7.2.2</a>),</li>
<li>the payload body (see <a href="#RFC7230" class="xref">[RFC7230]</a>, Section 3.3), sent as a series of DATA frames (see <a href="#frame-data" class="xref">Section 7.2.1</a>),</li>
<li>optionally, one HEADERS frame containing the trailer-part, if present (see <a href="#RFC7230" class="xref">[RFC7230]</a>, Section 4.1.2).</li>
</ol>
<p id="rfc.section.4.1.p.4">A server MAY send one or more PUSH_PROMISE frames (see <a href="#frame-push-promise" class="xref">Section 7.2.6</a>) before, after, or interleaved with the frames of a response message. These PUSH_PROMISE frames are not part of the response; see <a href="#server-push" class="xref">Section 4.4</a> for more details.</p>
<p id="rfc.section.4.1.p.5">The HEADERS and PUSH_PROMISE frames might reference updates to the QPACK dynamic table. While these updates are not directly part of the message exchange, they must be received and processed before the message can be consumed. See <a href="#header-formatting" class="xref">Section 4.1.1</a> for more details.</p>
<p id="rfc.section.4.1.p.6">The “chunked” transfer encoding defined in Section 4.1 of <a href="#RFC7230" class="xref">[RFC7230]</a> MUST NOT be used.</p>
<p id="rfc.section.4.1.p.7">If a DATA frame is received before a HEADERS frame on a either a request or push stream, the recipient MUST respond with a connection error of type HTTP_UNEXPECTED_FRAME (<a href="#errors" class="xref">Section 8</a>).</p>
<p id="rfc.section.4.1.p.8">Trailing header fields are carried in an additional HEADERS frame following the body. Senders MUST send only one HEADERS frame in the trailers section; receivers MUST discard any subsequent HEADERS frames.</p>
<p id="rfc.section.4.1.p.9">A response MAY consist of multiple messages when and only when one or more informational responses (1xx; see <a href="#RFC7231" class="xref">[RFC7231]</a>, Section 6.2) precede a final response to the same request. Non-final responses do not contain a payload body or trailers.</p>
<p id="rfc.section.4.1.p.10">An HTTP request/response exchange fully consumes a bidirectional QUIC stream. After sending a request, a client MUST close the stream for sending. Unless using the CONNECT method (see <a href="#the-connect-method" class="xref">Section 4.2</a>), clients MUST NOT make stream closure dependent on receiving a response to their request. After sending a final response, the server MUST close the stream for sending. At this point, the QUIC stream is fully closed.</p>
<p id="rfc.section.4.1.p.11">When a stream is closed, this indicates the end of an HTTP message. Because some messages are large or unbounded, endpoints SHOULD begin processing partial HTTP messages once enough of the message has been received to make progress. If a client stream terminates without enough of the HTTP message to provide a complete response, the server SHOULD abort its response with the error code HTTP_INCOMPLETE_REQUEST.</p>
<p id="rfc.section.4.1.p.12">A server can send a complete response prior to the client sending an entire request if the response does not depend on any portion of the request that has not been sent and received. When this is true, a server MAY request that the client abort transmission of a request without error by triggering a QUIC STOP_SENDING frame with error code HTTP_EARLY_RESPONSE, sending a complete response, and cleanly closing its stream. Clients MUST NOT discard complete responses as a result of having their request terminated abruptly, though clients can always discard responses at their discretion for other reasons.</p>
<h3 id="rfc.section.4.1.1">
<a href="#rfc.section.4.1.1">4.1.1.</a> <a href="#header-formatting" id="header-formatting">Header Formatting and Compression</a>
</h3>
<p id="rfc.section.4.1.1.p.1">HTTP message headers carry information as a series of key-value pairs, called header fields. For a listing of registered HTTP header fields, see the “Message Header Field” registry maintained at <a href="https://www.iana.org/assignments/message-headers">https://www.iana.org/assignments/message-headers</a>.</p>
<p id="rfc.section.4.1.1.p.2">Just as in previous versions of HTTP, header field names are strings of ASCII characters that are compared in a case-insensitive fashion. Properties of HTTP header field names and values are discussed in more detail in Section 3.2 of <a href="#RFC7230" class="xref">[RFC7230]</a>, though the wire rendering in HTTP/3 differs. As in HTTP/2, header field names MUST be converted to lowercase prior to their encoding. A request or response containing uppercase header field names MUST be treated as malformed (<a href="#malformed" class="xref">Section 4.1.3</a>).</p>
<p id="rfc.section.4.1.1.p.3">As in HTTP/2, HTTP/3 uses special pseudo-header fields beginning with the ‘:’ character (ASCII 0x3a) to convey the target URI, the method of the request, and the status code for the response. These pseudo-header fields are defined in Section 8.1.2.3 and 8.1.2.4 of <a href="#HTTP2" class="xref">[HTTP2]</a>. Pseudo-header fields are not HTTP header fields. Endpoints MUST NOT generate pseudo-header fields other than those defined in <a href="#HTTP2" class="xref">[HTTP2]</a>. The restrictions on the use of pseudo-header fields in Section 8.1.2.1 of <a href="#HTTP2" class="xref">[HTTP2]</a> also apply to HTTP/3.</p>
<p id="rfc.section.4.1.1.p.4">HTTP/3 uses QPACK header compression as described in <a href="#QPACK" class="xref">[QPACK]</a>, a variation of HPACK which allows the flexibility to avoid header-compression-induced head-of-line blocking. See that document for additional details.</p>
<p id="rfc.section.4.1.1.p.5">An HTTP/3 implementation MAY impose a limit on the maximum size of the message header it will accept on an individual HTTP message. A server that receives a larger header field list than it is willing to handle can send an HTTP 431 (Request Header Fields Too Large) status code <a href="#RFC6585" class="xref">[RFC6585]</a>. A client can discard responses that it cannot process. The size of a header field list is calculated based on the uncompressed size of header fields, including the length of the name and value in bytes plus an overhead of 32 bytes for each header field.</p>
<p id="rfc.section.4.1.1.p.6">If an implementation wishes to advise its peer of this limit, it can be conveyed as a number of bytes in the <samp>SETTINGS_MAX_HEADER_LIST_SIZE</samp> parameter. An implementation which has received this parameter SHOULD NOT send an HTTP message header which exceeds the indicated size, as the peer will likely refuse to process it. However, because this limit is applied at each hop, messages below this limit are not guaranteed to be accepted.</p>
<h3 id="rfc.section.4.1.2">
<a href="#rfc.section.4.1.2">4.1.2.</a> <a href="#request-cancellation" id="request-cancellation">Request Cancellation and Rejection</a>
</h3>
<p id="rfc.section.4.1.2.p.1">Clients can cancel requests by aborting the stream (QUIC RESET_STREAM and/or STOP_SENDING frames, as appropriate) with an error code of HTTP_REQUEST_CANCELLED (<a href="#http-error-codes" class="xref">Section 8.1</a>). When the client cancels a response, it indicates that this response is no longer of interest. Implementations SHOULD cancel requests by aborting both directions of a stream.</p>
<p id="rfc.section.4.1.2.p.2">When the server rejects a request without performing any application processing, it SHOULD abort its response stream with the error code HTTP_REQUEST_REJECTED. In this context, “processed” means that some data from the stream was passed to some higher layer of software that might have taken some action as a result. The client can treat requests rejected by the server as though they had never been sent at all, thereby allowing them to be retried later on a new connection. Servers MUST NOT use the HTTP_REQUEST_REJECTED error code for requests which were partially or fully processed. When a server abandons a response after partial processing, it SHOULD abort its response stream with the error code HTTP_REQUEST_CANCELLED.</p>
<p id="rfc.section.4.1.2.p.3">When a client sends a STOP_SENDING with HTTP_REQUEST_CANCELLED, a server MAY send the error code HTTP_REQUEST_REJECTED in the corresponding RESET_STREAM if no processing was performed. Clients MUST NOT reset streams with the HTTP_REQUEST_REJECTED error code except in response to a QUIC STOP_SENDING frame that contains the same code.</p>
<p id="rfc.section.4.1.2.p.4">If a stream is cancelled after receiving a complete response, the client MAY ignore the cancellation and use the response. However, if a stream is cancelled after receiving a partial response, the response SHOULD NOT be used. Automatically retrying such requests is not possible, unless this is otherwise permitted (e.g., idempotent actions like GET, PUT, or DELETE).</p>
<h3 id="rfc.section.4.1.3">
<a href="#rfc.section.4.1.3">4.1.3.</a> <a href="#malformed" id="malformed">Malformed Requests and Responses</a>
</h3>
<p id="rfc.section.4.1.3.p.1">A malformed request or response is one that is an otherwise valid sequence of frames but is invalid due to the presence of extraneous frames, prohibited header fields, the absence of mandatory header fields, or the inclusion of uppercase header field names.</p>
<p id="rfc.section.4.1.3.p.2">A request or response that includes a payload body can include a <samp>content-length</samp> header field. A request or response is also malformed if the value of a content-length header field does not equal the sum of the DATA frame payload lengths that form the body. A response that is defined to have no payload, as described in Section 3.3.2 of <a href="#RFC7230" class="xref">[RFC7230]</a> can have a non-zero content-length header field, even though no content is included in DATA frames.</p>
<p id="rfc.section.4.1.3.p.3">Intermediaries that process HTTP requests or responses (i.e., any intermediary not acting as a tunnel) MUST NOT forward a malformed request or response. Malformed requests or responses that are detected MUST be treated as a stream error (<a href="#errors" class="xref">Section 8</a>) of type HTTP_GENERAL_PROTOCOL_ERROR.</p>
<p id="rfc.section.4.1.3.p.4">For malformed requests, a server MAY send an HTTP response prior to closing or resetting the stream. Clients MUST NOT accept a malformed response. Note that these requirements are intended to protect against several types of common attacks against HTTP; they are deliberately strict because being permissive can expose implementations to these vulnerabilities.</p>
<h2 id="rfc.section.4.2">
<a href="#rfc.section.4.2">4.2.</a> <a href="#the-connect-method" id="the-connect-method">The CONNECT Method</a>
</h2>
<p id="rfc.section.4.2.p.1">The pseudo-method CONNECT (<a href="#RFC7231" class="xref">[RFC7231]</a>, Section 4.3.6) is primarily used with HTTP proxies to establish a TLS session with an origin server for the purposes of interacting with “https” resources. In HTTP/1.x, CONNECT is used to convert an entire HTTP connection into a tunnel to a remote host. In HTTP/2, the CONNECT method is used to establish a tunnel over a single HTTP/2 stream to a remote host for similar purposes.</p>
<p id="rfc.section.4.2.p.2">A CONNECT request in HTTP/3 functions in the same manner as in HTTP/2. The request MUST be formatted as described in <a href="#HTTP2" class="xref">[HTTP2]</a>, Section 8.3. A CONNECT request that does not conform to these restrictions is malformed (see <a href="#malformed" class="xref">Section 4.1.3</a>). The request stream MUST NOT be closed at the end of the request.</p>
<p id="rfc.section.4.2.p.3">A proxy that supports CONNECT establishes a TCP connection (<a href="#RFC0793" class="xref">[RFC0793]</a>) to the server identified in the “:authority” pseudo-header field. Once this connection is successfully established, the proxy sends a HEADERS frame containing a 2xx series status code to the client, as defined in <a href="#RFC7231" class="xref">[RFC7231]</a>, Section 4.3.6.</p>
<p id="rfc.section.4.2.p.4">All DATA frames on the stream correspond to data sent or received on the TCP connection. Any DATA frame sent by the client is transmitted by the proxy to the TCP server; data received from the TCP server is packaged into DATA frames by the proxy. Note that the size and number of TCP segments is not guaranteed to map predictably to the size and number of HTTP DATA or QUIC STREAM frames.</p>
<p id="rfc.section.4.2.p.5">Once the CONNECT method has completed, only DATA frames are permitted to be sent on the stream. Extension frames MAY be used if specifically permitted by the definition of the extension. Receipt of any other frame type MUST be treated as a connection error of type HTTP_UNEXPECTED_FRAME.</p>
<p id="rfc.section.4.2.p.6">The TCP connection can be closed by either peer. When the client ends the request stream (that is, the receive stream at the proxy enters the “Data Recvd” state), the proxy will set the FIN bit on its connection to the TCP server. When the proxy receives a packet with the FIN bit set, it will terminate the send stream that it sends to the client. TCP connections which remain half-closed in a single direction are not invalid, but are often handled poorly by servers, so clients SHOULD NOT close a stream for sending while they still expect to receive data from the target of the CONNECT.</p>
<p id="rfc.section.4.2.p.7">A TCP connection error is signaled with QUIC RESET_STREAM frame. A proxy treats any error in the TCP connection, which includes receiving a TCP segment with the RST bit set, as a stream error of type HTTP_CONNECT_ERROR (<a href="#http-error-codes" class="xref">Section 8.1</a>). Correspondingly, if a proxy detects an error with the stream or the QUIC connection, it MUST close the TCP connection. If the underlying TCP implementation permits it, the proxy SHOULD send a TCP segment with the RST bit set.</p>
<h2 id="rfc.section.4.3">
<a href="#rfc.section.4.3">4.3.</a> <a href="#priority" id="priority">Prioritization</a>
</h2>
<p id="rfc.section.4.3.p.1">The purpose of prioritization is to allow a client to express how it would prefer the server to allocate resources when managing concurrent streams. Most importantly, priority can be used to select streams for transmitting frames when there is limited capacity for sending.</p>
<p id="rfc.section.4.3.p.2">HTTP/3 uses a priority scheme similar to that described in <a href="#RFC7540" class="xref">[RFC7540]</a>, Section 5.3. In this priority scheme, a given element can be designated as dependent upon another element. Each dependency is assigned a relative weight, a number that is used to determine the relative proportion of available resources that are assigned to streams dependent on the same stream. This information is expressed in the PRIORITY frame <a href="#frame-priority" class="xref">Section 7.2.3</a> which identifies the element and the dependency. The elements that can be prioritized are:</p>
<p></p>
<ul>
<li>Requests, identified by the ID of the request stream</li>
<li>Pushes, identified by the Push ID of the promised resource (<a href="#frame-push-promise" class="xref">Section 7.2.6</a>)</li>
<li>Placeholders, identified by a Placeholder ID</li>
</ul>
<p id="rfc.section.4.3.p.4">Taken together, the dependencies across all prioritized elements in a connection form a dependency tree. An element can depend on another element or on the root of the tree. The tree also contains an orphan placeholder. This placeholder cannot be reprioritized, and no resources should be allocated to descendants of the orphan placeholder if progress can be made on descendants of the root. The structure of the dependency tree changes as PRIORITY frames modify the dependency links between other prioritized elements.</p>
<p id="rfc.section.4.3.p.5">An exclusive flag allows for the insertion of a new level of dependencies. The exclusive flag causes the prioritized element to become the sole dependency of its parent, causing other dependencies to become dependent on the exclusive element.</p>
<p id="rfc.section.4.3.p.6">All dependent streams are allocated an integer weight between 1 and 256 (inclusive), derived by adding one to the weight expressed in the PRIORITY frame.</p>
<p id="rfc.section.4.3.p.7">Streams with the same parent SHOULD be allocated resources proportionally based on their weight. Thus, if stream B depends on stream A with weight 4, stream C depends on stream A with weight 12, and no progress can be made on stream A, stream B ideally receives one-third of the resources allocated to stream C.</p>
<p id="rfc.section.4.3.p.8">A reference to an element which is no longer in the tree is treated as a reference to the orphan placeholder. Due to reordering between streams, an element can also be prioritized which is not yet in the tree. Such elements are added to the tree with the requested priority. If a prioritized element depends on another element which is not yet in the tree, the requested parent is first added to the tree with the default priority.</p>
<p id="rfc.section.4.3.p.9">When a prioritized element is first created, it has a default initial weight of 16 and a default dependency. Requests and placeholders are dependent on the orphan placeholder; pushes are dependent on the client request on which the PUSH_PROMISE frame was sent.</p>
<p id="rfc.section.4.3.p.10">Priorities can be updated by sending a PRIORITY frame (see <a href="#frame-priority" class="xref">Section 7.2.3</a>) on the control stream.</p>
<h3 id="rfc.section.4.3.1">
<a href="#rfc.section.4.3.1">4.3.1.</a> <a href="#placeholders" id="placeholders">Placeholders</a>
</h3>
<p id="rfc.section.4.3.1.p.1">In HTTP/2, certain implementations used closed or unused streams as placeholders in describing the relative priority of requests. This created confusion as servers could not reliably identify which elements of the priority tree could be discarded safely. Clients could potentially reference closed streams long after the server had discarded state, leading to disparate views of the prioritization the client had attempted to express.</p>
<p id="rfc.section.4.3.1.p.2">In HTTP/3, a number of placeholders are explicitly permitted by the server using the <samp>SETTINGS_NUM_PLACEHOLDERS</samp> setting. Because the server commits to maintaining these placeholders in the prioritization tree, clients can use them with confidence that the server will not have discarded the state. Clients MUST NOT send the <samp>SETTINGS_NUM_PLACEHOLDERS</samp> setting; receipt of this setting by a server MUST be treated as a connection error of type <samp>HTTP_SETTINGS_ERROR</samp>.</p>
<p id="rfc.section.4.3.1.p.3">Client-controlled placeholders are identified by an ID between zero and one less than the number of placeholders the server has permitted. The orphan placeholder cannot be prioritized or referenced by the client.</p>
<p id="rfc.section.4.3.1.p.4">Like streams, client-controlled placeholders have priority information associated with them.</p>
<h3 id="rfc.section.4.3.2">
<a href="#rfc.section.4.3.2">4.3.2.</a> <a href="#priority-tree-maintenance" id="priority-tree-maintenance">Priority Tree Maintenance</a>
</h3>
<p id="rfc.section.4.3.2.p.1">Because placeholders will be used to “root” any persistent structure of the tree which the client cares about retaining, servers can aggressively prune inactive regions from the priority tree. For prioritization purposes, a node in the tree is considered “inactive” when the corresponding stream has been closed for at least two round-trip times (using any reasonable estimate available on the server). This delay helps mitigate race conditions where the server has pruned a node the client believed was still active and used as a Stream Dependency.</p>
<p id="rfc.section.4.3.2.p.2">Specifically, the server MAY at any time:</p>
<p></p>
<ul>
<li>Identify and discard branches of the tree containing only inactive nodes (i.e. a node with only other inactive nodes as descendants, along with those descendants)</li>
<li>Identify and condense interior regions of the tree containing only inactive nodes, allocating weight appropriately</li>
</ul>
<div id="rfc.figure.1"></div>
<div id="fig-pruning"></div>
<pre>
x x x
| | |
P P P
/ \ | |
I I ==> I ==> A
/ \ | |
A I A A
| |
A A
</pre>
<p class="figure">Figure 1: Example of Priority Tree Pruning</p>
<p id="rfc.section.4.3.2.p.4">In the example in <a href="#fig-pruning" class="xref">Figure 1</a>, <samp>P</samp> represents a Placeholder, <samp>A</samp> represents an active node, and <samp>I</samp> represents an inactive node. In the first step, the server discards two inactive branches (each a single node). In the second step, the server condenses an interior inactive node. Note that these transformations will result in no change in the resources allocated to a particular active stream.</p>
<p id="rfc.section.4.3.2.p.5">Clients SHOULD assume the server is actively performing such pruning and SHOULD NOT declare a dependency on a stream it knows to have been closed.</p>
<h2 id="rfc.section.4.4">
<a href="#rfc.section.4.4">4.4.</a> <a href="#server-push" id="server-push">Server Push</a>
</h2>
<p id="rfc.section.4.4.p.1">Server push is an interaction mode introduced in HTTP/2 <a href="#HTTP2" class="xref">[HTTP2]</a> which permits a server to push a request-response exchange to a client in anticipation of the client making the indicated request. This trades off network usage against a potential latency gain. HTTP/3 server push is similar to what is described in HTTP/2 <a href="#HTTP2" class="xref">[HTTP2]</a>, but uses different mechanisms.</p>
<p id="rfc.section.4.4.p.2">Each server push is identified by a unique Push ID. This Push ID is used in a single PUSH_PROMISE frame (see <a href="#frame-push-promise" class="xref">Section 7.2.6</a>) which carries the request headers, possibly included in one or more DUPLICATE_PUSH frames (see <a href="#frame-duplicate-push" class="xref">Section 7.2.9</a>), then included with the push stream which ultimately fulfills those promises.</p>
<p id="rfc.section.4.4.p.3">Server push is only enabled on a connection when a client sends a MAX_PUSH_ID frame (see <a href="#frame-max-push-id" class="xref">Section 7.2.8</a>). A server cannot use server push until it receives a MAX_PUSH_ID frame. A client sends additional MAX_PUSH_ID frames to control the number of pushes that a server can promise. A server SHOULD use Push IDs sequentially, starting at 0. A client MUST treat receipt of a push stream with a Push ID that is greater than the maximum Push ID as a connection error of type HTTP_ID_ERROR.</p>
<p id="rfc.section.4.4.p.4">The header of the request message is carried by a PUSH_PROMISE frame (see <a href="#frame-push-promise" class="xref">Section 7.2.6</a>) on the request stream which generated the push. This allows the server push to be associated with a client request. Promised requests MUST conform to the requirements in Section 8.2 of <a href="#HTTP2" class="xref">[HTTP2]</a>.</p>
<p id="rfc.section.4.4.p.5">The same server push can be associated with additional client requests using a DUPLICATE_PUSH frame (see <a href="#frame-duplicate-push" class="xref">Section 7.2.9</a>).</p>
<p id="rfc.section.4.4.p.6">Ordering of a PUSH_PROMISE or DUPLICATE_PUSH in relation to certain parts of the response is important. The server SHOULD send PUSH_PROMISE or DUPLICATE_PUSH frames prior to sending HEADERS or DATA frames that reference the promised responses. This reduces the chance that a client requests a resource that will be pushed by the server.</p>
<p id="rfc.section.4.4.p.7">When a server later fulfills a promise, the server push response is conveyed on a push stream (see <a href="#push-streams" class="xref">Section 6.2.2</a>). The push stream identifies the Push ID of the promise that it fulfills, then contains a response to the promised request using the same format described for responses in <a href="#request-response" class="xref">Section 4.1</a>.</p>
<p id="rfc.section.4.4.p.8">Due to reordering, DUPLICATE_PUSH frames or push stream data can arrive before the corresponding PUSH_PROMISE frame. When a client receives a DUPLICATE_PUSH frame for an as-yet-unknown Push ID, the request headers of the push are not immediately available. The client can either delay generating new requests for content referenced following the DUPLICATE_PUSH frame until the request headers become available, or can initiate requests for discovered resources and cancel the requests if the requested resource is already being pushed. When a client receives a new push stream with an as-yet-unknown Push ID, both the associated client request and the pushed request headers are unknown. The client can buffer the stream data in expectation of the matching PUSH_PROMISE. The client can use stream flow control (see section 4.1 of <a href="#QUIC-TRANSPORT" class="xref">[QUIC-TRANSPORT]</a>) to limit the amount of data a server may commit to the pushed stream.</p>
<p id="rfc.section.4.4.p.9">If a promised server push is not needed by the client, the client SHOULD send a CANCEL_PUSH frame. If the push stream is already open or opens after sending the CANCEL_PUSH frame, a QUIC STOP_SENDING frame with an error code of HTTP_REQUEST_CANCELLED can be used. This asks the server not to transfer additional data and indicates that it will be discarded upon receipt.</p>
<h1 id="rfc.section.5">
<a href="#rfc.section.5">5.</a> <a href="#connection-closure" id="connection-closure">Connection Closure</a>
</h1>
<p id="rfc.section.5.p.1">Once established, an HTTP/3 connection can be used for many requests and responses over time until the connection is closed. Connection closure can happen in any of several different ways.</p>
<h2 id="rfc.section.5.1">
<a href="#rfc.section.5.1">5.1.</a> <a href="#idle-connections" id="idle-connections">Idle Connections</a>
</h2>
<p id="rfc.section.5.1.p.1">Each QUIC endpoint declares an idle timeout during the handshake. If the connection remains idle (no packets received) for longer than this duration, the peer will assume that the connection has been closed. HTTP/3 implementations will need to open a new connection for new requests if the existing connection has been idle for longer than the server’s advertised idle timeout, and SHOULD do so if approaching the idle timeout.</p>
<p id="rfc.section.5.1.p.2">HTTP clients are expected to request that the transport keep connections open while there are responses outstanding for requests or server pushes, as described in Section 19.2 of <a href="#QUIC-TRANSPORT" class="xref">[QUIC-TRANSPORT]</a>. If the client is not expecting a response from the server, allowing an idle connection to time out is preferred over expending effort maintaining a connection that might not be needed. A gateway MAY maintain connections in anticipation of need rather than incur the latency cost of connection establishment to servers. Servers SHOULD NOT actively keep connections open.</p>
<h2 id="rfc.section.5.2">
<a href="#rfc.section.5.2">5.2.</a> <a href="#connection-shutdown" id="connection-shutdown">Connection Shutdown</a>
</h2>
<p id="rfc.section.5.2.p.1">Even when a connection is not idle, either endpoint can decide to stop using the connection and let the connection close gracefully. Since clients drive request generation, clients perform a connection shutdown by not sending additional requests on the connection; responses and pushed responses associated to previous requests will continue to completion. Servers perform the same function by communicating with clients.</p>
<p id="rfc.section.5.2.p.2">Servers initiate the shutdown of a connection by sending a GOAWAY frame (<a href="#frame-goaway" class="xref">Section 7.2.7</a>). The GOAWAY frame indicates that client-initiated requests on lower stream IDs were or might be processed in this connection, while requests on the indicated stream ID and greater were rejected. This enables client and server to agree on which requests were accepted prior to the connection shutdown. This identifier MAY be zero if no requests were processed. Servers SHOULD NOT increase the QUIC MAX_STREAMS limit after sending a GOAWAY frame.</p>
<p id="rfc.section.5.2.p.3">Clients MUST NOT send new requests on the connection after receiving GOAWAY; a new connection MAY be established to send additional requests.</p>
<p id="rfc.section.5.2.p.4">Some requests might already be in transit. If the client has already sent requests on streams with a Stream ID greater than or equal to that indicated in the GOAWAY frame, those requests will not be processed and MAY be retried by the client on a different connection. The client MAY cancel these requests. It is RECOMMENDED that the server explicitly reject such requests (see <a href="#request-cancellation" class="xref">Section 4.1.2</a>) in order to clean up transport state for the affected streams.</p>
<p id="rfc.section.5.2.p.5">Requests on Stream IDs less than the Stream ID in the GOAWAY frame might have been processed; their status cannot be known until a response is received, the stream is reset individually, or the connection terminates. Servers MAY reject individual requests on streams below the indicated ID if these requests were not processed.</p>
<p id="rfc.section.5.2.p.6">Servers SHOULD send a GOAWAY frame when the closing of a connection is known in advance, even if the advance notice is small, so that the remote peer can know whether a request has been partially processed or not. For example, if an HTTP client sends a POST at the same time that a server closes a QUIC connection, the client cannot know if the server started to process that POST request if the server does not send a GOAWAY frame to indicate what streams it might have acted on.</p>
<p id="rfc.section.5.2.p.7">A client that is unable to retry requests loses all requests that are in flight when the server closes the connection. A server MAY send multiple GOAWAY frames indicating different stream IDs, but MUST NOT increase the value they send in the last Stream ID, since clients might already have retried unprocessed requests on another connection. A server that is attempting to gracefully shut down a connection SHOULD send an initial GOAWAY frame with the last Stream ID set to the maximum value allowed by QUIC’s MAX_STREAMS and SHOULD NOT increase the MAX_STREAMS limit thereafter. This signals to the client that a shutdown is imminent and that initiating further requests is prohibited. After allowing time for any in-flight requests (at least one round-trip time), the server MAY send another GOAWAY frame with an updated last Stream ID. This ensures that a connection can be cleanly shut down without losing requests.</p>
<p id="rfc.section.5.2.p.8">Once all accepted requests have been processed, the server can permit the connection to become idle, or MAY initiate an immediate closure of the connection. An endpoint that completes a graceful shutdown SHOULD use the HTTP_NO_ERROR code when closing the connection.</p>
<p id="rfc.section.5.2.p.9">If a client has consumed all available bidirectional stream IDs with requests, the server need not send a GOAWAY frame, since the client is unable to make further requests.</p>
<h2 id="rfc.section.5.3">
<a href="#rfc.section.5.3">5.3.</a> <a href="#immediate-application-closure" id="immediate-application-closure">Immediate Application Closure</a>
</h2>
<p id="rfc.section.5.3.p.1">An HTTP/3 implementation can immediately close the QUIC connection at any time. This results in sending a QUIC CONNECTION_CLOSE frame to the peer; the error code in this frame indicates to the peer why the connection is being closed. See <a href="#errors" class="xref">Section 8</a> for error codes which can be used when closing a connection.</p>
<p id="rfc.section.5.3.p.2">Before closing the connection, a GOAWAY MAY be sent to allow the client to retry some requests. Including the GOAWAY frame in the same packet as the QUIC CONNECTION_CLOSE frame improves the chances of the frame being received by clients.</p>
<h2 id="rfc.section.5.4">
<a href="#rfc.section.5.4">5.4.</a> <a href="#transport-closure" id="transport-closure">Transport Closure</a>
</h2>
<p id="rfc.section.5.4.p.1">For various reasons, the QUIC transport could indicate to the application layer that the connection has terminated. This might be due to an explicit closure by the peer, a transport-level error, or a change in network topology which interrupts connectivity.</p>
<p id="rfc.section.5.4.p.2">If a connection terminates without a GOAWAY frame, clients MUST assume that any request which was sent, whether in whole or in part, might have been processed.</p>
<h1 id="rfc.section.6">
<a href="#rfc.section.6">6.</a> <a href="#stream-mapping" id="stream-mapping">Stream Mapping and Usage</a>
</h1>
<p id="rfc.section.6.p.1">A QUIC stream provides reliable in-order delivery of bytes, but makes no guarantees about order of delivery with regard to bytes on other streams. On the wire, data is framed into QUIC STREAM frames, but this framing is invisible to the HTTP framing layer. The transport layer buffers and orders received QUIC STREAM frames, exposing the data contained within as a reliable byte stream to the application. Although QUIC permits out-of-order delivery within a stream, HTTP/3 does not make use of this feature.</p>
<p id="rfc.section.6.p.2">QUIC streams can be either unidirectional, carrying data only from initiator to receiver, or bidirectional. Streams can be initiated by either the client or the server. For more detail on QUIC streams, see Section 2 of <a href="#QUIC-TRANSPORT" class="xref">[QUIC-TRANSPORT]</a>.</p>
<p id="rfc.section.6.p.3">When HTTP headers and data are sent over QUIC, the QUIC layer handles most of the stream management. HTTP does not need to do any separate multiplexing when using QUIC - data sent over a QUIC stream always maps to a particular HTTP transaction or connection context.</p>
<h2 id="rfc.section.6.1">
<a href="#rfc.section.6.1">6.1.</a> <a href="#bidirectional-streams" id="bidirectional-streams">Bidirectional Streams</a>
</h2>
<p id="rfc.section.6.1.p.1">All client-initiated bidirectional streams are used for HTTP requests and responses. A bidirectional stream ensures that the response can be readily correlated with the request. This means that the client’s first request occurs on QUIC stream 0, with subsequent requests on stream 4, 8, and so on. In order to permit these streams to open, an HTTP/3 client SHOULD send non-zero values for the QUIC transport parameters <samp>initial_max_stream_data_bidi_local</samp>. An HTTP/3 server SHOULD send non-zero values for the QUIC transport parameters <samp>initial_max_stream_data_bidi_remote</samp> and <samp>initial_max_bidi_streams</samp>. It is RECOMMENDED that <samp>initial_max_bidi_streams</samp> be no smaller than 100, so as to not unnecessarily limit parallelism.</p>
<p id="rfc.section.6.1.p.2">HTTP/3 does not use server-initiated bidirectional streams, though an extension could define a use for these streams. Clients MUST treat receipt of a server-initiated bidirectional stream as a connection error of type HTTP_STREAM_CREATION_ERROR unless such an extension has been negotiated.</p>
<h2 id="rfc.section.6.2">
<a href="#rfc.section.6.2">6.2.</a> <a href="#unidirectional-streams" id="unidirectional-streams">Unidirectional Streams</a>
</h2>
<p id="rfc.section.6.2.p.1">Unidirectional streams, in either direction, are used for a range of purposes. The purpose is indicated by a stream type, which is sent as a variable-length integer at the start of the stream. The format and structure of data that follows this integer is determined by the stream type.</p>
<div id="rfc.figure.2"></div>
<div id="fig-stream-header"></div>
<pre>
0 1 2 3
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Stream Type (i) ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
</pre>
<p class="figure">Figure 2: Unidirectional Stream Header</p>
<p id="rfc.section.6.2.p.2">Some stream types are reserved (<a href="#stream-grease" class="xref">Section 6.2.3</a>). Two stream types are defined in this document: control streams (<a href="#control-streams" class="xref">Section 6.2.1</a>) and push streams (<a href="#push-streams" class="xref">Section 6.2.2</a>). Other stream types can be defined by extensions to HTTP/3; see <a href="#extensions" class="xref">Section 9</a> for more details.</p>
<p id="rfc.section.6.2.p.3">The performance of HTTP/3 connections in the early phase of their lifetime is sensitive to the creation and exchange of data on unidirectional streams. Endpoints that set low values for the QUIC transport parameters <samp>initial_max_uni_streams</samp> and <samp>initial_max_stream_data_uni</samp> will increase the chance that the remote peer reaches the limit early and becomes blocked. In particular, the value chosen for <samp>initial_max_uni_streams</samp> should consider that remote peers may wish to exercise reserved stream behavior (<a href="#stream-grease" class="xref">Section 6.2.3</a>). To avoid blocking, both clients and servers MUST allow the peer to create at least one unidirectional stream for the HTTP control stream plus the number of unidirectional streams required by mandatory extensions (such as QPACK) by setting an appropriate value for the QUIC transport parameter <samp>initial_max_uni_streams</samp> (three being the minimum value required for the base HTTP/3 protocol and QPACK), and SHOULD use a value of 1,024 or greater for the QUIC transport parameter <samp>initial_max_stream_data_uni</samp>.</p>
<p id="rfc.section.6.2.p.4">Note that an endpoint is not required to grant additional credits to create more unidirectional streams if its peer consumes all the initial credits before creating the critical unidirectional streams. Endpoints SHOULD create the HTTP control stream as well as the unidirectional streams required by mandatory extensions (such as the QPACK encoder and decoder streams) first, and then create additional streams as allowed by their peer.</p>
<p id="rfc.section.6.2.p.5">If the stream header indicates a stream type which is not supported by the recipient, the remainder of the stream cannot be consumed as the semantics are unknown. Recipients of unknown stream types MAY trigger a QUIC STOP_SENDING frame with an error code of HTTP_STREAM_CREATION_ERROR, but MUST NOT consider such streams to be a connection error of any kind.</p>
<p id="rfc.section.6.2.p.6">Implementations MAY send stream types before knowing whether the peer supports them. However, stream types which could modify the state or semantics of existing protocol components, including QPACK or other extensions, MUST NOT be sent until the peer is known to support them.</p>
<p id="rfc.section.6.2.p.7">A sender can close or reset a unidirectional stream unless otherwise specified. A receiver MUST tolerate unidirectional streams being closed or reset prior to the reception of the unidirectional stream header.</p>
<h3 id="rfc.section.6.2.1">
<a href="#rfc.section.6.2.1">6.2.1.</a> <a href="#control-streams" id="control-streams">Control Streams</a>
</h3>
<p id="rfc.section.6.2.1.p.1">A control stream is indicated by a stream type of <samp>0x00</samp>. Data on this stream consists of HTTP/3 frames, as defined in <a href="#frames" class="xref">Section 7.2</a>.</p>
<p id="rfc.section.6.2.1.p.2">Each side MUST initiate a single control stream at the beginning of the connection and send its SETTINGS frame as the first frame on this stream. If the first frame of the control stream is any other frame type, this MUST be treated as a connection error of type HTTP_MISSING_SETTINGS. Only one control stream per peer is permitted; receipt of a second stream which claims to be a control stream MUST be treated as a connection error of type HTTP_STREAM_CREATION_ERROR. The sender MUST NOT close the control stream, and the receiver MUST NOT request that the sender close the control stream. If either control stream is closed at any point, this MUST be treated as a connection error of type HTTP_CLOSED_CRITICAL_STREAM.</p>
<p id="rfc.section.6.2.1.p.3">A pair of unidirectional streams is used rather than a single bidirectional stream. This allows either peer to send data as soon as it is able. Depending on whether 0-RTT is enabled on the connection, either client or server might be able to send stream data first after the cryptographic handshake completes.</p>
<h3 id="rfc.section.6.2.2">
<a href="#rfc.section.6.2.2">6.2.2.</a> <a href="#push-streams" id="push-streams">Push Streams</a>
</h3>
<p id="rfc.section.6.2.2.p.1">Server push is an optional feature introduced in HTTP/2 that allows a server to initiate a response before a request has been made. See <a href="#server-push" class="xref">Section 4.4</a> for more details.</p>
<p id="rfc.section.6.2.2.p.2">A push stream is indicated by a stream type of <samp>0x01</samp>, followed by the Push ID of the promise that it fulfills, encoded as a variable-length integer. The remaining data on this stream consists of HTTP/3 frames, as defined in <a href="#frames" class="xref">Section 7.2</a>, and fulfills a promised server push. Server push and Push IDs are described in <a href="#server-push" class="xref">Section 4.4</a>.</p>
<p id="rfc.section.6.2.2.p.3">Only servers can push; if a server receives a client-initiated push stream, this MUST be treated as a connection error of type HTTP_STREAM_CREATION_ERROR.</p>
<div id="rfc.figure.3"></div>
<div id="fig-push-stream-header"></div>
<pre>
0 1 2 3
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| 0x01 (i) ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Push ID (i) ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
</pre>
<p class="figure">Figure 3: Push Stream Header</p>
<p id="rfc.section.6.2.2.p.4">Each Push ID MUST only be used once in a push stream header. If a push stream header includes a Push ID that was used in another push stream header, the client MUST treat this as a connection error of type HTTP_ID_ERROR.</p>
<h3 id="rfc.section.6.2.3">
<a href="#rfc.section.6.2.3">6.2.3.</a> <a href="#stream-grease" id="stream-grease">Reserved Stream Types</a>
</h3>
<p id="rfc.section.6.2.3.p.1">Stream types of the format <samp>0x1f * N + 0x21</samp> for integer values of N are reserved to exercise the requirement that unknown types be ignored. These streams have no semantics, and can be sent when application-layer padding is desired. They MAY also be sent on connections where no data is currently being transferred. Endpoints MUST NOT consider these streams to have any meaning upon receipt.</p>
<p id="rfc.section.6.2.3.p.2">The payload and length of the stream are selected in any manner the implementation chooses.</p>
<h1 id="rfc.section.7">
<a href="#rfc.section.7">7.</a> <a href="#http-framing-layer" id="http-framing-layer">HTTP Framing Layer</a>
</h1>
<p id="rfc.section.7.p.1">HTTP frames are carried on QUIC streams, as described in <a href="#stream-mapping" class="xref">Section 6</a>. HTTP/3 defines three stream types: control stream, request stream, and push stream. This section describes HTTP/3 frame formats and the streams types on which they are permitted; see <a href="#stream-frame-mapping" class="xref">Table 1</a> for an overview. A comparison between HTTP/2 and HTTP/3 frames is provided in <a href="#h2-frames" class="xref">Appendix A.2</a>.</p>
<div id="rfc.table.1"></div>
<div id="stream-frame-mapping"></div>
<table cellpadding="3" cellspacing="0" class="tt full center">
<caption>HTTP/3 frames and stream type overview</caption>
<thead><tr>
<th class="left">Frame</th>
<th class="left">Control Stream</th>
<th class="left">Request Stream</th>
<th class="left">Push Stream</th>
<th class="left">Section</th>
</tr></thead>