Re: QPACK proposal: wrap absolute index values

Dmitri Tikhonov <dtikhonov@litespeedtech.com> Mon, 06 August 2018 12:19 UTC

Return-Path: <dtikhonov@litespeedtech.com>
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 4B1101294D7 for <quic@ietfa.amsl.com>; Mon, 6 Aug 2018 05:19:56 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.911
X-Spam-Level:
X-Spam-Status: No, score=-1.911 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, T_DKIMWL_WL_MED=-0.01] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=litespeedtech-com.20150623.gappssmtp.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 FmlWkbD6fQ-u for <quic@ietfa.amsl.com>; Mon, 6 Aug 2018 05:19:54 -0700 (PDT)
Received: from mail-qt0-x22b.google.com (mail-qt0-x22b.google.com [IPv6:2607:f8b0:400d:c0d::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id A3D6D130DC3 for <quic@ietf.org>; Mon, 6 Aug 2018 05:19:54 -0700 (PDT)
Received: by mail-qt0-x22b.google.com with SMTP id y5-v6so13422855qti.12 for <quic@ietf.org>; Mon, 06 Aug 2018 05:19:54 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=litespeedtech-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to:user-agent; bh=67eI+xGW0k3S2qV/lKvgZjLD2MekFLDphO0kbdk8rTU=; b=robdJMazzg2zXMTFc12QSHvEDECBDD7cjFzyav+aCppJi3O7a9LmtIhSqKCFsSgbiL s3THpyHQ5VUxsZmLCIIGD5pDk5ZDfnJwG4iSXZdzVqO/T2EsgsDVvy2DOKtL2K5nOMPk 8xbKKIdHF+YQaIVHFxP40PB9zuk10uTTAHqrvx5RWK//7wVVqm8jKYwOee9PdZYsmgg4 ypRyhaH1ohMFIMCD60R2iPUQYoA53PnaNMNrPSCRUYQ1viSVC/Bh5BQofOo2Wk25mWwm BE8QRLRU4gKpEH7AOBw8QoTvNsvm/Q/VerX+fY1xj2aat5Ynno3jSpE7XgDLOdbo555g MMqA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to:user-agent; bh=67eI+xGW0k3S2qV/lKvgZjLD2MekFLDphO0kbdk8rTU=; b=t06wwVqoROk8yEAYUMGRowsv4WgymfFtBqerHMgggQ1cT/Np36d7seOnVmatbksrjV 0rSIyd/387MmaCftxx3GCuvxaEwFuCe9C8vFEgCrbbTyZp3isCV2sFQsvCJyhOFfeyvh cL3n8d3yp0eX1xoC/prJU5uluCF/x5eQWyK89c8h/mWgU98masV01ZBWU/5vnLRlDT1Z AyX2clayndr8Br9v22u7lbdO4ZLsryoXOAdhr32lzhs6kYFQ+aCy0Q3dMVvAsBSzBtuh dBdESZg1PqL7MTdg2Zc06EmM+YAD14LerEYOeoWr+AppYPUXTGglOLyiN0mxnAwBtG5h dVPg==
X-Gm-Message-State: AOUpUlGyIvaN0I5UoVgGBb0KdvJZi7W5MQgJlHQncDWuIWEMdFXpsa6e WGuPquTwGEz+frUqBlZgWxiO1A==
X-Google-Smtp-Source: AAOMgpcxpOBUiJ45z4NxpgwI8nZStMaxhnqnt+phFH3rBB+oQ2Yp/ach1m0qhZjLGUrGfYN4tAwzlQ==
X-Received: by 2002:a0c:bc8a:: with SMTP id l10-v6mr12809216qvg.130.1533557993800; Mon, 06 Aug 2018 05:19:53 -0700 (PDT)
Received: from ubuntu-dmitri (ool-44c1d219.dyn.optonline.net. [68.193.210.25]) by smtp.gmail.com with ESMTPSA id w39-v6sm616942qtk.74.2018.08.06.05.19.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Aug 2018 05:19:53 -0700 (PDT)
Date: Mon, 6 Aug 2018 08:19:48 -0400
From: Dmitri Tikhonov <dtikhonov@litespeedtech.com>
To: Martin Thomson <martin.thomson@gmail.com>
Cc: QUIC WG <quic@ietf.org>
Subject: Re: QPACK proposal: wrap absolute index values
Message-ID: <20180806121947.GA31889@ubuntu-dmitri>
Mail-Followup-To: Martin Thomson <martin.thomson@gmail.com>, QUIC WG <quic@ietf.org>
References: <20180805154649.GA14245@ubuntu-dmitri> <CABkgnnV2Ugu6O_6Q8grjhQiqavUe6P8FVP_BNRuNqtzVXTbOgw@mail.gmail.com> <20180806043610.GC25402@ubuntu-dmitri> <20180806044626.GD25402@ubuntu-dmitri> <CABkgnnWA8ZzrKzjZ-hQ1Qk3yOtgtcmwNuFwkJEP3DnqqqnCkBA@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <CABkgnnWA8ZzrKzjZ-hQ1Qk3yOtgtcmwNuFwkJEP3DnqqqnCkBA@mail.gmail.com>
User-Agent: Mutt/1.5.24 (2015-08-30)
Archived-At: <https://mailarchive.ietf.org/arch/msg/quic/SPtixSX78mrvSJLoQis-4acntsM>
X-BeenThere: quic@ietf.org
X-Mailman-Version: 2.1.27
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: Mon, 06 Aug 2018 12:19:56 -0000

On Mon, Aug 06, 2018 at 04:52:34PM +1000, Martin Thomson wrote:
> On Mon, Aug 6, 2018 at 2:46 PM Dmitri Tikhonov
> <dtikhonov@litespeedtech.com> wrote:
> >       bool
> >       isHeaderBlocked (unsigned LargestRef)
> 
> Thanks for sharing code.  Note that I'm not just interested in whether
> I'm blocked, but for how many table updates I should block for, but I
> can use this function (repeatedly if necessary) to make that
> determination, I guess.

Well, that's just pseudo-code, you know.  I'd never CamelCase real
code!

> It took me ages to understand this code.  Are you expecting all the
> arithmetic for CurMax to be modulo MaxEntries*2 ?  Because if that is
> the case, then this makes sense.  Without that stipulation, I really
> struggled.

Yes, all the arithmetic for the absolute index is modulo MaxEntries * 2.

> 2. You can't receive a header block with a largest reference that is
> more than MaxEntries new.  This doesn't hold because we don't cap the
> amount that a header block can be blocked by.

This is true -- my assertion about the future horizon is incorrect.
Somehow I assumed that the mirror argument about the encoder worked,
but it does not.  For example, nothing prevents the encoder from
pumping the table full of speculative updates, maybe even a few times
over, before ever using it.

> Now, it's arguably a
> reasonable restriction, because it takes multiple round trips to reach
> a state where that header block can be used, but we don't currently
> prevent someone from doing something like that.
> 
> Now, it's reasonable to assume that you can't have more than
> MaxEntries worth of updates in flight, which means that in one round
> trip, this will never happen.  But we don't say that you can't
> reference dynamic table entries that are far in the future.  For this
> to work, we would have to prohibit that.  Maybe we should, because
> referencing entries that can't be sent is a footgun, just as
> referencing entries that have not yet been sent is a footgun (it can
> deadlock flow control if you do that).

Yes, for the proposed mechanism to work, we'd have to mandate that the
encoder not create new entries past some limit, which is a function of
the known decoder state (based on TSS or Header Acks) and MaxEntries.

Thanks for identifying this flaw.  The change is larger than I was
hoping it would be.  It's still worth it.

  - Dmitri.