Skip to content

Main content

QUIC Packet Number Truncated Window Tool

Reconstruct the QUIC full packet number nearest an explicit expected value using RFC 9000 Appendix A.3.

Loading tool…

Description

Combine the expected packet number's high bits with the truncated low bits.

QUIC uses compact fields and truncated packet numbers. Their interpretation depends on the unprotected header bits and connection state; decoding a number does not authenticate a packet.

Combine the expected packet number's high bits with the truncated low bits.

When to use this tool

Use QUIC Packet Number Truncated Window when you need one QUIC field interpretation from already available bytes or state.

How to use the tool and how it works

  1. Enter expected, truncated, bits. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. Read packetNumber. Use the output convention below.

Combine the expected packet number's high bits with the truncated low bits. Move the candidate one window up when candidate + half-window is at most expected and the result stays below 2^62, or one window down when candidate exceeds expected + half-window and subtraction is possible.1

Input fieldMeaning and unitsAccepted input
expectedExpectedRequired. Text; maximum UTF-16 length 8192. Integer syntax: optional + or - and 1-128 decimal digits; leading zeros accepted. Apply the sign restriction above.
truncatedTruncatedRequired. Safe integer; minimum 0.
bitsBitsRequired. Safe integer.
Output fieldInterpretationReturned shape
packetNumberPacket NumberRequired. Text; maximum UTF-16 length 8192.
json
{
  "input": {
    "expected": "256",
    "truncated": 1,
    "bits": 8
  },
  "output": {
    "packetNumber": "257"
  }
}

Limitations and assumptions

  • Expected is a nonnegative decimal integer below 2^62; truncation widths are 8, 16, 24, or 32 bits. This reconstruction does not authenticate the packet or infer expected.
  • Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
  • Numeric calculations use binary floating point unless exact decimal-integer arithmetic is explicitly stated. No hidden measurement tolerance or decimal rounding is added; nonfinite or out-of-contract results are rejected. Numeric signed-zero results are exported as zero.

Alternative or Complementary methods

Use a complete QUIC implementation to remove header protection, track packet state, and authenticate payloads.

References

  1. Calculation and input contract: network/quic-packet-number-truncated-window — tool.io

Similar or alternative tools