Re: [quicwg/base-drafts] Limit RCID state (#3547)

martinduke <notifications@github.com> Wed, 01 April 2020 03:51 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 D75E63A08E2 for <quic-issues@ietfa.amsl.com>; Tue, 31 Mar 2020 20:51:18 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.2
X-Spam-Level:
X-Spam-Status: No, score=-1.2 tagged_above=-999 required=5 tests=[DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, MAILING_LIST_MULTI=-1, SPF_HELO_NONE=0.001, SPF_PASS=-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 GmgRiSl-j_W6 for <quic-issues@ietfa.amsl.com>; Tue, 31 Mar 2020 20:51:15 -0700 (PDT)
Received: from out-11.smtp.github.com (out-11.smtp.github.com [192.30.254.194]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 7A45D3A08E1 for <quic-issues@ietf.org>; Tue, 31 Mar 2020 20:51:15 -0700 (PDT)
Received: from github-lowworker-1dbcc59.ash1-iad.github.net (github-lowworker-1dbcc59.ash1-iad.github.net [10.56.105.54]) by smtp.github.com (Postfix) with ESMTP id 1FC4926162C for <quic-issues@ietf.org>; Tue, 31 Mar 2020 20:51:14 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=github.com; s=pf2014; t=1585713074; bh=z8c1cI54wDdaPgAoHlq2F2dG46dxxV4ejdGUlnr3lUQ=; h=Date:From:Reply-To:To:Cc:In-Reply-To:References:Subject:List-ID: List-Archive:List-Post:List-Unsubscribe:From; b=2XTG1c3myPu2QyHtdVUcEvMIt1MPx3KOeY5/9N4kp/8D/RloM0Vph0H264zztWj4h PoxjL9cP5gKXK9Zc9Wzm/rS9z2E15afpHhWXplHUwgnvcJgEZlH0/33E8XJcjDGOqj SJJzFpL8nDrILfQ/OwumG6rsF46gHl6qdtSQkdpo=
Date: Tue, 31 Mar 2020 20:51:13 -0700
From: martinduke <notifications@github.com>
Reply-To: quicwg/base-drafts <reply+AFTOJKYTU3VVSP72UHPALXF4R7YLDEVBNHHCGFYIAU@reply.github.com>
To: quicwg/base-drafts <base-drafts@noreply.github.com>
Cc: Subscribed <subscribed@noreply.github.com>
Message-ID: <quicwg/base-drafts/pull/3547/review/385248524@github.com>
In-Reply-To: <quicwg/base-drafts/pull/3547@github.com>
References: <quicwg/base-drafts/pull/3547@github.com>
Subject: Re: [quicwg/base-drafts] Limit RCID state (#3547)
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary="--==_mimepart_5e840fb1ce537_16ab3fc1fbecd96495448"; charset="UTF-8"
Content-Transfer-Encoding: 7bit
Precedence: list
X-GitHub-Sender: martinduke
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/H3_V9uKEiaFrI6XZg0rxxQeyzxI>
X-BeenThere: quic-issues@ietf.org
X-Mailman-Version: 2.1.29
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: Wed, 01 Apr 2020 03:51:19 -0000

@martinduke commented on this pull request.



> @@ -1069,6 +1069,15 @@ to cease using the connection IDs when requested can result in connection
 failures, as the issuing endpoint might be unable to continue using the
 connection IDs with the active connection.
 
+An endpoint SHOULD limit the number of outstanding RETIRE_CONNECTION_ID frames
+to bound the necessary state. In order to allow a peer to retire all previously
+issued connection IDs, the limit on the number of outstanding
+RETIRE_CONNECTION_IDs SHOULD be at least the active_connection_id_limit. An

@kazuho. I initially read "outstanding" as meaning "intended to retire", just like you, but further up in the thread @martinthomson said that's not what he meant. And anyway, I soon saw that that interpretation is equally easy to implement and more compliant with the existing spec.

First, assume the endpoint never retires a CID voluntarily. I just have to store the active CIDs. The retired CIDs require only two state variables:
- highest retire prior to (highest_rpt)
- lowest RCID seqnum unacked (lowest_rua)

Each packet records the highest seqnum retired because it always retires everything below that, as you'll see below.

`process_ncid():
    if (retire_prior_to <= highest_rpt)
        quit;
    if (retire_prior_to > lowest_rua + 100)
       abort;
    if (highest_rpt == lowest_rua)
        highest_rpt = retire_prior_to
        send_rcid_pkt()
    else
        highest_rpt = retire_prior_to

send_rcid_pkt():
    limit = MIN(highest_rpt, lowest_rua + 2 * active_cid_limit)
    for i = lowest_rua : limit
        send_rcid(i)
    pkt.max_seq_num = limit

process_ack(pkt):
    lowest_rua = MAX(lowest_rua, pkt.max_seq_num + 1) 
    if (lowest_rua < highest_rpt) 
        send_rcid_pkt()`

If I have a backlog of CIDs to retire, I will clear 2 * active_cid_limit of them each RTT assuming no losses. This number is essentially arbitrary but should definitely fit in a single packet. 100 is an arbitrarily large number just in case the client is being malicious. Again, you don't want it to be so small that unlucky packet losses cause a connection error, but beyond that any number is fine.

If we are retiring CIDs voluntarily, we'll have to keep some extra state. We can put them in a special data structure that send_rcid_pkt also checks, but will definitely be finite as it is controlled locally. If I retire them in sequence, nothing stops me from increasing highest_rpt even though I never received it in an NCID frame, and therefore using the mechanism above.

***

The nice thing about this design is that we are fully compliant with the draft-27 language in every way, except that the RCID frames are not always sent *immediately*. #3553 is a cleaner design but this one has essentially no impact on the peer at all if it's implementing -27.

-- 
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/3547#discussion_r401340815