Re: [quicwg/base-drafts] intial packet number should be 0. (#864)
ekr <notifications@github.com> Thu, 12 October 2017 21:10 UTC
Return-Path: <noreply@github.com>
X-Original-To: quic-issues@ietfa.amsl.com
Delivered-To: quic-issues@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id E8E781321DC for <quic-issues@ietfa.amsl.com>; Thu, 12 Oct 2017 14:10:43 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -9.799
X-Spam-Level:
X-Spam-Status: No, score=-9.799 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H2=-2.8, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=github.com
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 6lwd9fFwzwz6 for <quic-issues@ietfa.amsl.com>; Thu, 12 Oct 2017 14:10:42 -0700 (PDT)
Received: from github-smtp2a-ext-cp1-prd.iad.github.net (github-smtp2-ext5.iad.github.net [192.30.252.196]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 431F11320CF for <quic-issues@ietf.org>; Thu, 12 Oct 2017 14:10:42 -0700 (PDT)
Date: Thu, 12 Oct 2017 14:10:41 -0700
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=github.com; s=pf2014; t=1507842641; bh=hmMcvxnM4CrMXshpiWB9i27srcIhsd326upgy7ykhss=; h=From:Reply-To:To:Cc:In-Reply-To:References:Subject:List-ID: List-Archive:List-Post:List-Unsubscribe:From; b=sskGUGraX7sfPh2usPpHter2J7xVwlGWVp0ecpdYRC1yLWSvPKOa4zkNBkQV2WpCR OKZvjpK+hL3HDUACQ5irQNt65lWCDUdkSY5kIftG6vQqYVwcr7tXRh9fJvaXWn8Nv6 0/43SQM4OQzAGEcpVt0C5+D+xaKUrd28VsrMm42c=
From: ekr <notifications@github.com>
Reply-To: quicwg/base-drafts <reply+0166e4ab8950c10e738894a79f4773c804756abe118de30d92cf0000000115f79c5192a169ce0fcca8da@reply.github.com>
To: quicwg/base-drafts <base-drafts@noreply.github.com>
Cc: Subscribed <subscribed@noreply.github.com>
Message-ID: <quicwg/base-drafts/pull/864/c336270299@github.com>
In-Reply-To: <quicwg/base-drafts/pull/864@github.com>
References: <quicwg/base-drafts/pull/864@github.com>
Subject: Re: [quicwg/base-drafts] intial packet number should be 0. (#864)
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary="--==_mimepart_59dfda51924e1_666a3fa0adce4f2c8918d"; charset="UTF-8"
Content-Transfer-Encoding: 7bit
Precedence: list
X-GitHub-Sender: ekr
X-GitHub-Recipient: quic-issues
X-GitHub-Reason: subscribed
X-Auto-Response-Suppress: All
X-GitHub-Recipient-Address: quic-issues@ietf.org
Archived-At: <https://mailarchive.ietf.org/arch/msg/quic-issues/MJoaS0e-uBIgxo-24vVLMkSyruU>
X-BeenThere: quic-issues@ietf.org
X-Mailman-Version: 2.1.22
List-Id: Notification list for GitHub issues related to the QUIC WG <quic-issues.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/quic-issues>, <mailto:quic-issues-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/quic-issues/>
List-Post: <mailto:quic-issues@ietf.org>
List-Help: <mailto:quic-issues-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/quic-issues>, <mailto:quic-issues-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 12 Oct 2017 21:10:44 -0000
Note that if we are starting at 0, you can just use int64_t, tear the
connection down at 2^{63} and use -1 as a sentinel.
-Ekr
On Thu, Oct 12, 2017 at 2:07 PM, Ryan Hamilton <notifications@github.com>
wrote:
> I don't want to pile on, but please, 1 instead of 0. It's convenient in
> code to have a sentinel value for an invalid packet number and the obvious
> choices are 0 and MAX_INT64. 0 has the nice virtual of being obvious when
> printed in base10, whereas MAX_INT64 is just some random big number. In
> addition, 0 has the property of being less than valid packet number. So
> this allows you to write code like:
>
> if current_packet.packet_number > largest_received_packet_:
> UpdateNewLargestPacket()
>
> Without needing to explicitly handle the case where
> largest_received_packet_ is MAX_INT64.
>
> —
> You are receiving this because you are subscribed to this thread.
> Reply to this email directly, view it on GitHub
> <https://github.com/quicwg/base-drafts/pull/864#issuecomment-336268670>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/ABD1oa0iWapAm8k0B-jcRuD5pubyXcWOks5srn-ZgaJpZM4P3j83>
> .
>
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/quicwg/base-drafts/pull/864#issuecomment-336270299
- [quicwg/base-drafts] intial packet number should … Patrick McManus
- Re: [quicwg/base-drafts] intial packet number sho… MikkelFJ
- Re: [quicwg/base-drafts] intial packet number sho… Ryan Hamilton
- Re: [quicwg/base-drafts] intial packet number sho… ianswett
- Re: [quicwg/base-drafts] intial packet number sho… ekr
- Re: [quicwg/base-drafts] intial packet number sho… Nick Banks
- Re: [quicwg/base-drafts] intial packet number sho… Patrick McManus
- Re: [quicwg/base-drafts] intial packet number sho… Patrick McManus
- Re: [quicwg/base-drafts] intial packet number sho… Patrick McManus
- Re: [quicwg/base-drafts] intial packet number sho… Ryan Hamilton
- Re: [quicwg/base-drafts] intial packet number sho… Marten Seemann
- Re: [quicwg/base-drafts] intial packet number sho… Mike Bishop
- Re: [quicwg/base-drafts] intial packet number sho… Mike Bishop
- Re: [quicwg/base-drafts] intial packet number sho… janaiyengar