Re: Some questions about Packet Number Encoding And Decoding
"Martin Thomson" <mt@lowentropy.net> Tue, 03 September 2019 05:08 UTC
Return-Path: <mt@lowentropy.net>
X-Original-To: quic@ietfa.amsl.com
Delivered-To: quic@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 2C28B120288 for <quic@ietfa.amsl.com>; Mon, 2 Sep 2019 22:08:33 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.701
X-Spam-Level:
X-Spam-Status: No, score=-2.701 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=lowentropy.net header.b=nJ8OEr/l; dkim=pass (2048-bit key) header.d=messagingengine.com header.b=A8D4JbMZ
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id JCZDYjuny8DM for <quic@ietfa.amsl.com>; Mon, 2 Sep 2019 22:08:31 -0700 (PDT)
Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 1946712081D for <quic@ietf.org>; Mon, 2 Sep 2019 22:08:31 -0700 (PDT)
Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id F194320F20 for <quic@ietf.org>; Tue, 3 Sep 2019 01:08:29 -0400 (EDT)
Received: from imap2 ([10.202.2.52]) by compute1.internal (MEProxy); Tue, 03 Sep 2019 01:08:29 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lowentropy.net; h=mime-version:message-id:in-reply-to:references:date:from:to :subject:content-type:content-transfer-encoding; s=fm3; bh=3aOsY ATlyDbGbteaNjOwwOK4QcJ8sbadFiT3D5EoyHQ=; b=nJ8OEr/lZKMQ4W16w20oa ZfJnHWGsqF8NmRssgi4+0S+rPeQ77G1zxgVS/r6BGQ0hhdorBEzGUoUeQFk7WZd1 RYTydQN7351nDJ5xhzovyAtZrOUSFnACbph10Sv3MWDHvRiqBOcDuS6c4pgWqtfC jVo6NNPXLKydzp8fBGSjcwrJPnCIku0a0WyXKEdezz2CbJhkwybDU/ytDp288FKk bIriom2N5h7AbaH4qeRAttlAhBXIymRD/F6BKLmNJ9YcZXY3iu+nd8y4iVHPzYCf rXpRTkyhqvGiTR35U8vWegyLRlJnduKxfhdany6FUP9vFFJbaX0EDw2nawSwjKHc Q==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=3aOsYATlyDbGbteaNjOwwOK4QcJ8sbadFiT3D5Eoy HQ=; b=A8D4JbMZ8bfFhYeZNQKVhOUZ0IaXx6psVzbchVcIL+iEwJ0aHf0PANmlE vnMV/EerLcJRF3O1MpKWh+aJxTCL1uoebuTAylZOrMrghKjoAAs0VdSgwI+TEs32 m8WC7BCnzEaKoe4ArOHBQX4l4rE16F52WhxM2AAvIyUdLvwrgG3q/ECMQehDDMZ5 m3fW1kxM8GInSJYt4fkqHkGsTU2x4NVITib3vwPKX91+16Qx2Gi8r6BJl1H4XWkA A0SzRJW+n482FiAqtVJ+ce3vnuPbHuxyfSPmH4aLjtwmnGpsuSDd6WbSvpECPVzU kMbKeVvxQ6dBC21DEXXD2/0gcyb9Q==
X-ME-Sender: <xms:TfVtXSnRTPf0UJz-aNvcN6eXdlRT2s3q6ucIc3zAu4o_W-ocOkjU6g>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddrudejuddgleduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefofgggkfgjfhffhffvufgtgfesth hqredtreerjeenucfhrhhomhepfdforghrthhinhcuvfhhohhmshhonhdfuceomhhtsehl ohifvghnthhrohhphidrnhgvtheqnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmtheslh hofigvnhhtrhhophihrdhnvghtnecuvehluhhsthgvrhfuihiivgeptd
X-ME-Proxy: <xmx:TfVtXWLRFnG8jiSBSuj4-zi4Ugy8YW3phHejpW0-omZRYJsWYQoYwg> <xmx:TfVtXTY8LLgUVixKiQKiF4TMFYfE6FCcTWrF7vDfFWkxlHracXc9bA> <xmx:TfVtXYbGSVcUaKWfrQSL3UZFxBiqMzSG86ODXeVh72WM9rF_ybST8A> <xmx:TfVtXYT3GgeRwfzjH7njemsUvzxCts_sYqvfcS39KaBDVYQD7US5uw>
Received: by mailuser.nyi.internal (Postfix, from userid 501) id 6B37FE00A3; Tue, 3 Sep 2019 01:08:29 -0400 (EDT)
X-Mailer: MessagingEngine.com Webmail Interface
User-Agent: Cyrus-JMAP/3.1.7-154-gfa7592a-fmstable-20190829v1
Mime-Version: 1.0
Message-Id: <021df368-7248-4e07-82bb-cbb85dc46f29@www.fastmail.com>
In-Reply-To: <2739D40F-AD57-4B98-8515-472D37113035@tencent.com>
References: <2739D40F-AD57-4B98-8515-472D37113035@tencent.com>
Date: Tue, 03 Sep 2019 15:08:08 +1000
From: Martin Thomson <mt@lowentropy.net>
To: quic@ietf.org
Subject: Re: Some questions about Packet Number Encoding And Decoding
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
Archived-At: <https://mailarchive.ietf.org/arch/msg/quic/X04FQyfRsl_BwO7Kkz5cpQ-XDY0>
X-BeenThere: quic@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Main mailing list of the IETF QUIC working group <quic.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/quic>, <mailto:quic-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/quic/>
List-Post: <mailto:quic@ietf.org>
List-Help: <mailto:quic-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/quic>, <mailto:quic-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 03 Sep 2019 05:08:40 -0000
On Tue, Sep 3, 2019, at 13:26, mikewczhou(周雯程) wrote: > 1. What's the purpose of Packet Number Encoding? to be safe or save > some bits space or something else? It's a space-saving measure only. > 1. How can an endpoint know to use a large enough packet number > encoding? For example, as example 1 said, an endpoint can send 16 bits > to send a number of 0xac5c02 if peer has received an acknowledgment for > packet 0xabe8bc, which means it will send 0x5c02. So in the early time > when it want to send 0x5c02 exactly(not 0xac5c02), How should it encode > packet number to avoid conflict with 0xac5c02 if the packet is delay so > much. That's in the draft: if you want to include enough bits to allow for reordering of all outstanding packets, then you need log2(this packet - earlier unacknowledged packet) + 2 bits. You can obviously get away with less if you expect less reordering, but the fewer bits you use, the greater the risk. Also note that you can't predict what you might send in future and sending too short a packet number can cause problems if you start sending a lot more packets. > 2. If an endpoint is not encoded packet number well, the peer will > recover it as a wrong packet number, what happens next? The packet number is used as an encryption/decryption nonce. So getting the value wrong will mean that the packet won't decrypt and it will be discarded. That will look like packet loss to you, but the receiver might do things like count the number of bad packets like this and could start to treat your IP address as a potential DoS attacker. For that, testing is your friend. If you are concerned about reordering and short numbers, add a few extra bits to the encoding. But it would need to be a fairly specialized application to need more than 16 bits. At the minimum packet size, that's a BDP of around 20 megabytes, with reordering of an entire round trip. That's possible, but not that likely.
- Some questions about Packet Number Encoding And D… mikewczhou (周雯程)
- Re: Some questions about Packet Number Encoding A… Martin Thomson