@@ -71,25 +71,26 @@ balance between resilience against head-of-line blocking and optimal compression
71
71
ratio. The design goals are to closely approach the compression ratio of HPACK
72
72
with substantially less head-of-line blocking under the same loss conditions.
73
73
74
- # # Header Tables
74
+ # Header Tables
75
75
76
76
Like HPACK, QPACK uses two tables for associating header fields to indexes. The
77
77
static table (see {{table-static}}) is predefined and contains common header
78
78
fields (some of them with an empty value). The dynamic table (see
79
79
{{table-dynamic}}) built up over the course of the connection and can be used by
80
80
the encoder to index header fields repeated in the encoded header lists.
81
81
82
- These two tables are indexed in a different manner than in HPACK; see
83
- {{indexing}} for more details.
82
+ Unlike in HPACK, entries in the QPACK static and dynamic tables are addressed
83
+ separately. The following sections describe how entries in each table is
84
+ addressed.
84
85
85
- # ## Static Table {#table-static}
86
+ # # Static Table {#table-static}
86
87
87
- The static table consists of a predefined static list of header fields. Its
88
- entries are defined in Appendix A of {{!RFC7541}}. Note that because HPACK did
89
- not use zero-based references, there is no value at index zero of the static
90
- table.
88
+ The static table consists of a predefined static list of header fields, each of
89
+ which has a fixed index over time. Its entries are defined in Appendix A of
90
+ {{!RFC7541}}. Note that because HPACK did not use zero-based references, there
91
+ is no value at index zero of the static table.
91
92
92
- # ## Dynamic Table {#table-dynamic}
93
+ # # Dynamic Table {#table-dynamic}
93
94
94
95
The dynamic table consists of a list of header fields maintained in first-in,
95
96
first-out order. The dynamic table is initially empty. Entries are added by
@@ -131,16 +132,16 @@ the dynamic table is less than or equal to the maximum size.
131
132
This mechanism can be used to completely clear entries from the dynamic table by
132
133
setting a maximum size of 0, which can subsequently be restored.
133
134
134
- # ## Indexing
135
+ # ## Absolute and Relative Indexing {#indexing}
135
136
136
- Entries in the QPACK static and dynamic tables are addressed separately.
137
+ Each entry possesses both an absolute index which is fixed for the lifetime of
138
+ that entry and a relative index which changes over time based on the context of
139
+ the reference. The first entry inserted has an absolute index of "1"; indices
140
+ increase sequentially with each insertion.
137
141
138
- While entries in the static table have the same indices at all times, entries
139
- are inserted into the dynamic table over time. Each entry possesses both an
140
- absolute index which is fixed for the lifetime of that entry and a relative
141
- index which changes over time based on the context of the reference. The first
142
- entry inserted has an absolute index of "1"; indices increase sequentially with
143
- each insertion.
142
+ The relative index begins at zero and increases in the opposite direction from
143
+ the absolute index. Determining which entry has a relative index of "0" depends
144
+ on the context of the reference.
144
145
145
146
On the control stream, a relative index of "0" always refers to the most
146
147
recently inserted value in the dynamic table. Note that this means the
@@ -165,9 +166,9 @@ d = count of entries dropped
165
166
Because frames from request streams can be delivered out of order with
166
167
instructions on the control stream, relative indices are relative to the Base
167
168
Index at the beginning of the header block (see {{absolute-index}}). The Base
168
- Index is the absolute index of the entry which has the relative index of zero
169
- when interpreting the frame. The relative indices of entries do not change
170
- while interpreting headers on a request or push stream.
169
+ Index is an absolute index. When interpreting the rest of the frame, the entry
170
+ identified by Base Index has a relative index of zero. The relative indices of
171
+ entries do not change while interpreting headers on a request or push stream.
171
172
172
173
~~~~~ drawing
173
174
Base Index
@@ -184,9 +185,14 @@ d = count of entries dropped
184
185
~~~~~
185
186
{: title="Example Dynamic Table Indexing - Request Stream"}
186
187
187
- Entries with an absolute index greater than a frame's Base Index can be
188
- referenced using specific Post-Base instructions. The relative indices of
189
- Post-Base references count up from Base Index.
188
+ # ## Post-Base Indexing
189
+
190
+ A header block on the request stream can reference entries added after the entry
191
+ identified by the Base Index. This allows an encoder to process a header block
192
+ in a single pass and include references to entries added while processing this
193
+ (or other) header blocks. Newly added entries are referenced using Post-Base
194
+ instructions. Indices for Post-Base instructions increase in the same direction
195
+ as absolute indices, but the zero value is one higher than the Base Index.
190
196
191
197
~~~~~ drawing
192
198
Base Index
0 commit comments