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

Describe inputs to the packet number algorithm #4309

Merged
merged 1 commit into from Oct 29, 2020
Merged
Changes from all commits
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
9 changes: 8 additions & 1 deletion draft-ietf-quic-transport.md
Expand Up @@ -7413,9 +7413,16 @@ The initial contents of this registry are shown in {{iana-error-table}}.

# Sample Packet Number Decoding Algorithm {#sample-packet-number-decoding}

The pseudo-code in {{alg-decode-pn}} shows how an implementation can decode
The pseudo-code in {{alg-decode-pn}} includes an example algorithm for decoding
packet numbers after header protection has been removed.

The DecodePacketNumber function takes three arguments:

* largest_pn is the largest packet number that has been successfully
processed in the current packet number space.
* truncated_pn is the value of the Packet Number field.
* pn_nbits is the number of bits in the Packet Number field (8, 16, 24, or 32).

~~~
DecodePacketNumber(largest_pn, truncated_pn, pn_nbits):
expected_pn = largest_pn + 1
Expand Down