Re: Submitted new I-D: Cache Digests for HTTP/2

Alex Rousskov <rousskov@measurement-factory.com> Fri, 08 January 2016 18:39 UTC

Return-Path: <ietf-http-wg-request+bounce-httpbisa-archive-bis2juki=lists.ie@listhub.w3.org>
X-Original-To: ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com
Delivered-To: ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id DA5DB1B2AF6 for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Fri, 8 Jan 2016 10:39:20 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -6.912
X-Spam-Level:
X-Spam-Status: No, score=-6.912 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01] autolearn=ham
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 yycPhhs0XyCQ for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Fri, 8 Jan 2016 10:39:16 -0800 (PST)
Received: from frink.w3.org (frink.w3.org [128.30.52.56]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id EA6E71B2AEC for <httpbisa-archive-bis2Juki@lists.ietf.org>; Fri, 8 Jan 2016 10:39:15 -0800 (PST)
Received: from lists by frink.w3.org with local (Exim 4.80) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1aHbrk-0003LI-MW for ietf-http-wg-dist@listhub.w3.org; Fri, 08 Jan 2016 18:34:24 +0000
Resent-Date: Fri, 08 Jan 2016 18:34:24 +0000
Resent-Message-Id: <E1aHbrk-0003LI-MW@frink.w3.org>
Received: from maggie.w3.org ([128.30.52.39]) by frink.w3.org with esmtps (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from <rousskov@measurement-factory.com>) id 1aHbrg-0003Kb-Fj for ietf-http-wg@listhub.w3.org; Fri, 08 Jan 2016 18:34:20 +0000
Received: from mail.measurement-factory.com ([104.237.131.42]) by maggie.w3.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from <rousskov@measurement-factory.com>) id 1aHbrc-0007tm-JL for ietf-http-wg@w3.org; Fri, 08 Jan 2016 18:34:19 +0000
Received: from [65.102.233.169] (unknown [65.102.233.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.measurement-factory.com (Postfix) with ESMTPSA id BCB15E069; Fri, 8 Jan 2016 18:33:50 +0000 (UTC)
To: ietf-http-wg@w3.org
References: <CANatvzyLsrbY4d1Vnq3tSSvt_Tf44sYx0gM-dAWw4d97pz3Mgw@mail.gmail.com>
From: Alex Rousskov <rousskov@measurement-factory.com>
X-Enigmail-Draft-Status: N1110
Cc: Kazuho Oku <kazuhooku@gmail.com>
Message-ID: <56900101.1050506@measurement-factory.com>
Date: Fri, 08 Jan 2016 11:33:37 -0700
User-Agent: Mozilla/5.0 (X11; Linux i686; rv:38.0) Gecko/20100101 Thunderbird/38.4.0
MIME-Version: 1.0
In-Reply-To: <CANatvzyLsrbY4d1Vnq3tSSvt_Tf44sYx0gM-dAWw4d97pz3Mgw@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Received-SPF: pass client-ip=104.237.131.42; envelope-from=rousskov@measurement-factory.com; helo=mail.measurement-factory.com
X-W3C-Hub-Spam-Status: No, score=-5.4
X-W3C-Hub-Spam-Report: AWL=-1.499, BAYES_00=-1.9, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, W3C_AA=-1, W3C_WL=-1
X-W3C-Scan-Sig: maggie.w3.org 1aHbrc-0007tm-JL b4c31493191c572472a0972f2110f120
X-Original-To: ietf-http-wg@w3.org
Subject: Re: Submitted new I-D: Cache Digests for HTTP/2
Archived-At: <http://www.w3.org/mid/56900101.1050506@measurement-factory.com>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/30865
X-Loop: ietf-http-wg@w3.org
Resent-Sender: ietf-http-wg-request@w3.org
Precedence: list
List-Id: <ietf-http-wg.w3.org>
List-Help: <http://www.w3.org/Mail/>
List-Post: <mailto:ietf-http-wg@w3.org>
List-Unsubscribe: <mailto:ietf-http-wg-request@w3.org?subject=unsubscribe>

On 01/08/2016 12:17 AM, Kazuho Oku wrote:

> Yesterday, Mark and I have submitted a new draft named "Cache Digests
> for HTTP/2."
> https://datatracker.ietf.org/doc/draft-kazuho-h2-cache-digest/
> 
> The draft proposes a new HTTP/2 frame named CACHE_DIGEST that conveys
> client's cache state so that a server can determine what should be
> pushed to the client.

> Please let us know how you think about the proposal.


If possible, I recommend removing Draft language that makes (or appears
to make) your feature specific to optimizing push traffic to user
agents. Cache digests are useful for many things. Optimizing push
traffic to user agents is just one use case. For example, Squid proxies
already use Cache Digests (based on Bloom Filters) to optimize
cache-to-cache communication in caching hierarchies [1,2].

  [1] http://www.squid-cache.org/CacheDigest/cache-digest-v5.txt
  [2] http://wiki.squid-cache.org/SquidFaq/CacheDigests

I suspect it is possible to define the new CACHE_DIGEST frame without
adding artificial restrictions on its use. Let the agents sending and
receiving that frame decide what use is appropriate between them while
following some general guidelines.


Since there are already two cache digests formats (based on Bloom
filters and based on Golumb-coded sets), we should expect a third one.
Have you considered allocating the first few response octets to specify
the digest format?


> A CACHE_DIGEST frame can be sent from a client to a server on any
>    stream in the "open" state, and conveys a digest of the contents of
>    the cache associated with that stream

Perhaps I am missing some important HTTP/2-derived limits here, but the
"cache associated with a stream" sounds too vague because HTTP caches
are often not associated with specific streams. Did you mean something
like "the cache portion containing shared-origin URIs?"


>    servers ought not
>    expect frequent updates; instead, if they wish to continue to utilise
>    the digest, they will need update it with responses sent to that
>    client on the connection.

Perhaps I am missing some important HTTP/2 caveats here, but how would
an origin server identify "that client" when the "connection" is coming
from a proxy and multiplexes responses to many user agents?



>        1.  Convert "URL" to an ASCII string by percent-encoding as
>            appropriate [RFC3986].

There are many ways to percent-encode the same URI. This step must
define a single way for doing so. Besides case insensitive parts and the
decision of what characters to [un]escape, please do not forget about
trailing slashes, URI fragments, and other optional parts. This is
critical for interoperation!


>    MUST choose a parameter, "P",
>    that indicates the probability of a false positive it is willing to
>    tolerate

For clarity, please detail what you mean by a "false positive" in this
context. It may also be useful to mention whether the digesting
algorithm may create false negatives.


> 7.  Write log base 2 of "N" and "P" to "digest" as octets.

The wording is ambiguous: Store log2(N) and then store log2(P)? Store
log2(N&P)? Store log2(N) and then store P? I suspect it is the latter
and recommend splitting step #7 into two steps, one step per number.

BTW, why note store the actual value of N?


> 7.  Write log base 2 of "N" and "P" to "digest" as octets.
...
> 8.  Write "R" to "digest" as binary, using log2(P) bits.

It is not clear how a number should be written/encoded. Different
programming languages and different systems store/represent numbers
differently, so I would expect the Draft to specify encoding precisely.
Sorry if I missed that detail.


The draft appears to be missing a section documenting how the digest
recipient can test whether the digest contains a given URI.


Please consider an additional Security Consideration: Origin servers are
expected to store digests so that the stored digests can be consulted
when pushing traffic. Most origin servers will store digests in RAM. A
malicious client may send a huge digest as a form of a DoS attack on a
naive server that does not validate digest sizes. Malicious client(s)
may send many small digests as a form of a (D)DoS attack on a naive
server that do not control the total size of stored digests.


Thank you,

Alex.