From da88b361fc3c17d18345227283b895b465db6c25 Mon Sep 17 00:00:00 2001 From: Mike Bishop Date: Tue, 3 Nov 2020 18:27:34 -0500 Subject: [PATCH] Restore the comment in the original text --- draft-ietf-quic-transport.md | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/draft-ietf-quic-transport.md b/draft-ietf-quic-transport.md index 9519cc287c..7aba3832d3 100644 --- a/draft-ietf-quic-transport.md +++ b/draft-ietf-quic-transport.md @@ -4430,9 +4430,12 @@ sent. A peer receiving the packet will then correctly decode the packet number, unless the packet is delayed in transit such that it arrives after many higher-numbered packets have been received. An endpoint SHOULD use a large enough packet number encoding to allow the packet number to be recovered even if -the packet arrives after packets that are sent afterwards. Pseudo-code and -examples for packet number encoding can be found in -{{sample-packet-number-encoding}}. +the packet arrives after packets that are sent afterwards. + +As a result, the size of the packet number encoding is at least one bit more +than the base-2 logarithm of the number of contiguous unacknowledged packet +numbers, including the new packet. Pseudo-code and examples for packet number +encoding can be found in {{sample-packet-number-encoding}}. At a receiver, protection of the packet number is removed prior to recovering the full packet number. The full packet number is then reconstructed based on @@ -7492,8 +7495,8 @@ EncodePacketNumber(full_pn, largest_acked): min_bits = log(num_unacked, 2) + 1 num_bytes = ceil(min_bits / 8) - // Encode the integer value and truncate to the - // num_bytes least-significant bytes. + // Encode the integer value and truncate to + // the num_bytes least-significant bytes. return encode(full_pn, num_bytes) ~~~ {: #alg-encode-pn title="Sample Packet Number Encoding Algorithm"}