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

martinduke <> Wed, 01 April 2020 03:51 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id D75E63A08E2 for <>; Tue, 31 Mar 2020 20:51:18 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -1.2
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: (amavisd-new); dkim=pass (1024-bit key)
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id GmgRiSl-j_W6 for <>; Tue, 31 Mar 2020 20:51:15 -0700 (PDT)
Received: from ( []) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by (Postfix) with ESMTPS id 7A45D3A08E1 for <>; Tue, 31 Mar 2020 20:51:15 -0700 (PDT)
Received: from ( []) by (Postfix) with ESMTP id 1FC4926162C for <>; Tue, 31 Mar 2020 20:51:14 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; 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 <>
Reply-To: quicwg/base-drafts <>
To: quicwg/base-drafts <>
Cc: Subscribed <>
Message-ID: <quicwg/base-drafts/pull/3547/review/>
In-Reply-To: <quicwg/base-drafts/pull/>
References: <quicwg/base-drafts/pull/>
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
Archived-At: <>
X-Mailman-Version: 2.1.29
List-Id: Notification list for GitHub issues related to the QUIC WG <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-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.

    if (retire_prior_to <= highest_rpt)
    if (retire_prior_to > lowest_rua + 100)
    if (highest_rpt == lowest_rua)
        highest_rpt = retire_prior_to
        highest_rpt = retire_prior_to

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

    lowest_rua = MAX(lowest_rua, pkt.max_seq_num + 1) 
    if (lowest_rua < highest_rpt) 

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: