From c8972c657252968e17af09ccd1121c14b3290fb8 Mon Sep 17 00:00:00 2001 From: Martin Thomson Date: Fri, 10 Feb 2017 17:00:26 +1100 Subject: [PATCH] Random initial packet number --- draft-ietf-quic-transport.md | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/draft-ietf-quic-transport.md b/draft-ietf-quic-transport.md index b6a5dc6848..b7105b18a5 100644 --- a/draft-ietf-quic-transport.md +++ b/draft-ietf-quic-transport.md @@ -475,8 +475,8 @@ The fields in a Regular packet past the Common Header are the following: * Packet Number: The lower 8, 16, 32, or 48 bits of the packet number, based on the PACKET_NUMBER_SIZE flag. Each Regular packet is assigned a packet number - by the sender. The first packet sent by an endpoint MUST have a packet number - of 1. + by the sender. The first packet number is randomized (see + {{initial-packet-number}}. * Encrypted Payload: The remainder of a Regular packet is both authenticated and encrypted once packet protection keys are available. {{QUIC-TLS}} describes @@ -535,6 +535,17 @@ at any point in the connection. In other words, (TODO: Clarify how packet number size can change mid-connection.) + +### Initial Packet Number + +The initial value for packet number MUST be a 31-bit random number. That is, +the value is selected from an uniform random distribution between 0 and 2^31-1. + +The first set of packets sent by an endpoint MUST include the low 32-bits of the +packet number. Once any packet has been acknowledged, subsequent packets can +use a shorter packet number encoding. + + ### Frames and Frame Types {#frames} A Regular packet MUST contain at least one frame, and MAY contain multiple @@ -1384,9 +1395,7 @@ bundle any set of frames in a packet. All QUIC packets MUST contain a packet number and MAY contain one or more frames ({{frames}}). Packet numbers MUST be unique within a connection and MUST NOT be reused within the same connection. Packet numbers MUST be assigned to packets in a strictly monotonically -increasing order. The initial packet number used, at both the client and the -server, MUST be 0. That is, the first packet in both directions of the -connection MUST have a packet number of 0. +increasing order. A sender SHOULD minimize per-packet bandwidth and computational costs by bundling as many frames as possible within a QUIC packet. A sender MAY wait for