Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QPACK: add examples #4093

Merged
merged 4 commits into from Sep 23, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
73 changes: 57 additions & 16 deletions draft-ietf-quic-qpack.md
Expand Up @@ -1555,22 +1555,30 @@ the smallest number of bytes.
# Encoding and Decoding Examples

The following examples represent a series of exchanges between an encoder and a
afrind marked this conversation as resolved.
Show resolved Hide resolved
decoder. The state of the encoder's dyanmic table is shown, along with its
decoder. The exchanges are designed to exercise most QPACK instructions, and
highlight potentially common patterns and their impact on dynamic table state.
The encoder sends three encoded field sections containing one field line each,
as wells as two speculative inserts that are not referenced.

The state of the encoder's dynamic table is shown, along with its
current size. Each entry is shown with the Absolute Index of the entry (Abs),
the current number of outstanding encoded field sections with references to that
entry (Ref), along with the name and value. Entries above the 'acknowledged'
line have been acknowledged by the decoder.

## Literal Field Line With Name Reference

The encoder sends an encoded field section containing a literal representation
of a field with a static name reference.

~~~
Data | Interpretation
| Encoder's Dynamic Table

Stream: 0
0000 | Required Insert Count = 0, Base = 0
510b 2f69 6e64 6578 | :path=/index.html
2e68 746d 6c
510b 2f69 6e64 6578 | Literal Field Line with Name Reference
2e68 746d 6c | (:path=/index.html)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might help if you include the numeric values included in each of these descriptions. In this case, it's (static table 1).


Abs Ref Name Value
^-- acknowledged --^
Expand All @@ -1579,10 +1587,15 @@ Stream: 0

## Dynamic Table

The encoder sets the dynamic table capacity, inserts a header with a dynamic
name reference, then sends a potentially blocking, encoded field section
referencing this new entry. The decoder acknowledges processing the encoded
field section.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
field section.
field section, which transitively acknowledges the encoder instructions up to the Required Insert Count.

Or something like that.


~~~
Stream: Encoder
3f8b | Set Table Capacity=170
01c0 0c77 7777 2e69 | Insert with static name reference
3f8b | Set Dynamic Table Capacity=170
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I read this as extending to the next byte.

Suggested change
3f8b | Set Dynamic Table Capacity=170
3f8b01 | Set Dynamic Table Capacity=170

01c0 0c77 7777 2e69 | Insert With Name Reference (static table)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
01c0 0c77 7777 2e69 | Insert With Name Reference (static table)
c00c 7777 772e 6965 | Insert With Name Reference (static table 0)

6574 662e 6f72 67 | (:authortiy=www.ietf.org)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
6574 662e 6f72 67 | (:authortiy=www.ietf.org)
7466 2e6f 7267 | (:authority=www.ietf.org)


Abs Ref Name Value
Expand All @@ -1592,7 +1605,9 @@ Stream: Encoder

Stream: 4
0280 | Required Insert Count = 1, Base = 0
10 | Indexed field line with post-base index
10 | Indexed Field Line With Post-Base Index
| Absolute Index=1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one is useful to break down (RIC + delta_base + 0 = 1). Shame that we have such small numbers involved here.

| (:authority=www.ietf.org)

Abs Ref Name Value
^-- acknowledged --^
Expand All @@ -1610,10 +1625,14 @@ Stream: Decoder

## Speculative Insert

The encoder inserts a header into the dynamic table without a name reference.
The decoder acknowledges receipt of the entry. The encoder does not send
any encoded field sections.

~~~
Stream: Encoder
4a63 7573 746f 6d2d | Insert without name reference
6b65 790c 6375 7374 | (custom-key=custom-value)
4a63 7573 746f 6d2d | Insert Without Name Reference
6b65 790c 6375 7374 | (custom-key=custom-value)
6f6d 2d76 616c 7565 |

Abs Ref Name Value
Expand All @@ -1623,7 +1642,7 @@ Stream: Encoder
Size=108

Stream: Decoder
01 | Insert count increment (1)
01 | Insert Count Increment (1)

Abs Ref Name Value
1 0 :authority www.ietf.org
Expand All @@ -1633,11 +1652,16 @@ Stream: Decoder

~~~

## Duplicate Instruction
## Duplicate Instruction, Stream Cancellation

The encoder duplicates an existing entry in the dynamic table, then sends an
encoded field section referencing the duplicated entry. The decoder notifies
the encoder that the encoded field section was not processed by sending a stream
cancellation.

~~~
Stream: Encoder
01 | Duplicate (relative index=1)
01 | Duplicate (Relative Index=1)

Abs Ref Name Value
1 0 :authority www.ietf.org
Expand All @@ -1648,27 +1672,44 @@ Stream: Encoder

Stream: 8
0400 | Required Insert Count = 3, Base = 3
80 | Indexed field line
80 | Indexed Field Line
| Absolute Index=3
| (:authority=www.ietf.org)

Abs Ref Name Value
1 0 :authority www.ietf.org
2 0 custom-key custom-value
^-- acknowledged --^
3 1 :authority www.ietf.org
Size=162

Stream: Decoder
48 | Stream Cancellation (Stream=8)

Abs Ref Name Value
1 0 :authority www.ietf.org
2 0 custom-key custom-value
^-- acknowledged --^
3 0 :authority www.ietf.org
Size=162

~~~

## Dyanmic Table Insert causes eviction
## Dynamic Table Insert, Eviction

The encoder inserts another header into the dynamic table, which evicts the
oldest entry. The encoder does not send any encoded field sections.

~~~
Stream: Encoder
810d 6375 7374 6f6d | Insert with dynamic table name reference
2d76 616c 7565 32 | (custom-key=custom-value2)
810d 6375 7374 6f6d | Insert With Name Reference (dynamic table)
2d76 616c 7565 32 | Absolute Index=2
| (custom-key=custom-value2)

Abs Ref Name Value
2 0 custom-key custom-value
^-- acknowledged --^
3 1 :authority www.ietf.org
3 0 :authority www.ietf.org
4 0 custom-key custom-value2
Size=163
~~~
Expand Down