@@ -96,36 +96,37 @@ reintroduced by HPACK when the loss includes a HEADERS frame.
96
96
# # Avoiding Head-of-Line Blocking in HTTP/QUIC {#overview-hol-avoidance}
97
97
98
98
Because QUIC does not guarantee order between data on different streams, a
99
- reference might be received on a request stream to an entry which is not yet in
100
- the dynamic table. References are called "vulnerable" when they refer to entries
101
- whose receipt has not been confirmed by the peer, because loss or reordering can
102
- keep the reference from being immediately usable. If the reference cannot be
103
- immediately processed on receipt, the stream is considered "blocked."
104
-
105
- The decoder can signal that it is willing to process vulnerable references by
106
- setting SETTINGS_QPACK_BLOCKED_STREAMS to a non-zero value. In this case, the
107
- encoder can choose on a per-header-block basis whether to favor higher
108
- compression ratio (by permitting vulnerable references) or HoL resilience (by
109
- avoiding them).
110
-
111
- An encoder MUST NOT have header blocks which contain vulnerable references
112
- outstanding on more streams than the value of SETTINGS_QPACK_BLOCKED_STREAMS at
113
- any time. Note that the decoder's count of streams which are actually blocked
114
- will be less than or equal to the encoder's count of references which are
115
- vulnerable (potentially blocking). If the decoder encounters more blocked
99
+ header block might reference an entry in the dynamic table that has not yet been
100
+ received.
101
+
102
+ Each header block contains a Largest Reference (see {{absolute-index}}) which
103
+ identifies the table state necessary for decoding. If the greatest absolute
104
+ index in the dynamic table is less than the value of the Largest Reference, the
105
+ stream is considered "blocked." While blocked, header field data MUST remain in
106
+ the blocked stream's flow control window. When the Largest Reference is zero,
107
+ the frame contains no references to the dynamic table and can always be
108
+ processed immediately.
109
+
110
+ A decoder can permit the possibility of blocked streams by setting
111
+ SETTINGS_QPACK_BLOCKED_STREAMS to a non-zero value. This setting specifies an
112
+ upper bound on the number of streams which can be blocked.
113
+
114
+ An encoder can decide whether to risk having a stream become blocked. If
115
+ permitted by the value of SETTINGS_QPACK_BLOCKED_STREAMS, compression efficiency
116
+ can be improved by referencing dynamic table entries that are still in transit,
117
+ but if there is loss or reordering the stream can become blocked at the decoder.
118
+ An encoder avoids the rist of blocking by only referencing dynamic table entries
119
+ which have been acknowledged, but this means using literals. Since literals make
120
+ the header block larger, this can result in the encoder becoming blocked on
121
+ congestion or flow control limits.
122
+
123
+ An encoder MUST limit the number of streams which could become blocked to the
124
+ value of SETTINGS_QPACK_BLOCKED_STREAMS at all times. Note that the decoder's
125
+ count of streams which are actually blocked will be at most the encoder's count
126
+ of streams which could become blocked. If the decoder encounters more blocked
116
127
streams than it promised to support, it SHOULD treat this as a stream error of
117
128
type HTTP_QPACK_DECOMPRESSION_FAILED.
118
129
119
- The header block contains a Base Index (see {{absolute-index}}) which is used to
120
- correctly index entries, regardless of reordering in the transport (see
121
- {{indexing}}), and a Largest Reference which identifies the table state
122
- necessary for decoding. The stream for a header is considered blocked by the
123
- decoder and cannot be processed until the greatest absolute index in the dynamic
124
- table is at least the value of the Largest Reference. While blocked, header
125
- field data MUST remain in the blocked stream's flow control window. When the
126
- Largest Reference is zero, the frame contains no references to the dynamic table
127
- and can always be processed immediately.
128
-
129
130
# Wire Format
130
131
131
132
QPACK instructions occur in three locations, each of which uses a separate
@@ -558,10 +559,10 @@ have outstanding (unacknowledged) references.
558
559
559
560
An encoder MUST ensure that a header block which references a dynamic table
560
561
entry is not received by the decoder after the referenced entry has already been
561
- evicted, and MUST ensure that the decoder will not suffer head-of-line blocking
562
- if the decoder has not opted to receive vulnerable references . Even if the
563
- decoder is willing to process blocking references , the encoder might choose to
564
- avoid them in certain cases.
562
+ evicted. An encoder also respects the limit set by the decoder on the number of
563
+ streams that are allowed to become blocked . Even if the decoder is willing to
564
+ tolerate blocked streams , the encoder might choose to avoid them in certain
565
+ cases.
565
566
566
567
In order to enable this, the encoder will need to track outstanding
567
568
(unacknowledged) header blocks and table updates using feedback received from
0 commit comments