[Ppm] Batch selection and use cases for DAP

Christopher Patton <cpatton@cloudflare.com> Wed, 29 June 2022 23:22 UTC

Return-Path: <cpatton@cloudflare.com>
X-Original-To: ppm@ietfa.amsl.com
Delivered-To: ppm@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id A9407C157B33 for <ppm@ietfa.amsl.com>; Wed, 29 Jun 2022 16:22:05 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -7.106
X-Spam-Level:
X-Spam-Status: No, score=-7.106 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIMWL_WL_MED=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_HI=-5, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, URIBL_BLOCKED=0.001, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=cloudflare.com
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id X4psDmLfr7dZ for <ppm@ietfa.amsl.com>; Wed, 29 Jun 2022 16:22:01 -0700 (PDT)
Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com [IPv6:2a00:1450:4864:20::136]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 44555C14F742 for <ppm@ietf.org>; Wed, 29 Jun 2022 16:22:01 -0700 (PDT)
Received: by mail-lf1-x136.google.com with SMTP id j21so30701007lfe.1 for <ppm@ietf.org>; Wed, 29 Jun 2022 16:22:01 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cloudflare.com; s=google; h=mime-version:from:date:message-id:subject:to; bh=cNUcLQgkyTGe0w0JG7wd43no4hVjJ67EW4hzrEyBAHo=; b=N4YwRIe6SxxcxlmGafYIGOpHCZiSWDnkmrrzXrutPOnwPyBcOTOdcMkQzbPvBfcCTD 5MGzHzNaHXrZAW6iR7YjWHJjQ1HKD8hOqaqP0W5B/DQUzsgmWaUCz8MBNfTGhv0q9EZq wj7liYfun/nwdGdAP5ymij8whlPUmBZFO3/P8=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=cNUcLQgkyTGe0w0JG7wd43no4hVjJ67EW4hzrEyBAHo=; b=3d3+G4IvehFBaRgOL8+7LArSvUrzQ2BKUkGYNKOE1kp9IytVZQ7mQb95Q6JA1nYKHR j/om6cY17XBlde/YyGSLPKej/NCFLH951q6IyJMlhaRQqJ5p6YKTrH9Hfjf0891rRa45 ANqB/ven//Zi3zzgdlgOZG1zk24meUB6lx1z+av7LWHkjWhi1lyMRkecENkWLCTMFIJ0 gTSHlTEaB3lGoQCMnYU57QmeIaDIkrGCoGGdYX4hCg7qQKUxzd88Nk77ZGOmrfvOnWH9 JxegiRNYUREVJL4Du1+B/KRtPMlk5HiUZ3a+IYEyYIqrW2QFChFS0ZKgOuG1R5QrXjS+ Wx1A==
X-Gm-Message-State: AJIora/6t47sOtPCqRog2HtKumK2xBAVGQ8dxcvTGQwssBrdVz+KvloS cnr/K5vf+ChEhvcBV9L2CXLMuSOjJptM6lSwhwArOBQa1HTeAg==
X-Google-Smtp-Source: AGRyM1tc777em+BcebtI+RsgWd/q2pbEs4cGBDvkfoA2zM7Se0EWmVox/ukgF10XsphUxrwPLMlr/3Y98Fbh48RVCQs=
X-Received: by 2002:a05:6512:10d0:b0:47f:7eb9:6685 with SMTP id k16-20020a05651210d000b0047f7eb96685mr3383305lfg.622.1656544918315; Wed, 29 Jun 2022 16:21:58 -0700 (PDT)
MIME-Version: 1.0
From: Christopher Patton <cpatton@cloudflare.com>
Date: Wed, 29 Jun 2022 16:21:47 -0700
Message-ID: <CAG2Zi212sWmk3Piuu4Q0YE+wcqhgObx9F7r=SJV5d3Xqy8tFkQ@mail.gmail.com>
To: ppm <ppm@ietf.org>
Content-Type: multipart/alternative; boundary="000000000000697d1205e29e6b23"
Archived-At: <https://mailarchive.ietf.org/arch/msg/ppm/NKPIIm5HvZ1p8EkS3tmwj6DBXDs>
Subject: [Ppm] Batch selection and use cases for DAP
X-BeenThere: ppm@ietf.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: Privacy Preserving Measurement technologies <ppm.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/ppm>, <mailto:ppm-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/ppm/>
List-Post: <mailto:ppm@ietf.org>
List-Help: <mailto:ppm-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/ppm>, <mailto:ppm-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 29 Jun 2022 23:22:05 -0000

Hi all,

The current version of DAP prescribes a particular method of sorting
reports into batches for aggregation. There are a couple of GitHub issues
that describe use cases for which this method is not well-suited.
First-class support for these use cases would require protocol changes.
While considering if/how to change it, I think it would be helpful to take
a step back and ask ourselves if there are any additional use cases to
consider.

First, a quick recap of how batches are currently defined:
* Reports are generated by Clients and uploaded to the Leader. Each
`Report` has a timestamp.
* In its collect request (i.e., HTTP request with an `CollectReq`), the
Collector specifies a "batch interval", which defines the start and end
time for reports that will be aggregated.
* Upon receiving this request from the Collector, the Leader picks a batch
of reports with timestamps that fall in the batch interval.
* The leader and Helper aggregate the batch. (Aggregation manifests as a
sequence of `AggregateInitializeReq` / `AggregateContinueReq` flows,
followed by a single `AggregateShareReq` in order to get the Helper's
aggregate share for the entire batch.)

Observe that the batch itself is chosen by the Leader; the Collector merely
specifies criteria for reports that are "valid" for that batch -- namely,
that the report timestamp falls in the batch interval. Other criteria for
selecting batches are possible, as I'll explain below.

Use case #1
The current "batch selector" is well-suited for telemetry use cases where
DAP is used to aggregate long-running time-series data. (For those familiar
with Prometheus (https://prometheus.io), think of a dashboard you would
build to monitor how long it takes browsers to download and render a page
of your website.) However it has some limitations that make other use cases
much more difficult.

Use case #2
As EKR points out in issue183 (
https://github.com/ietf-wg-ppm/draft-ietf-ppm-dap/issues/183), it would
also be useful to be able to "filter" aggregate results based on metadata
associated with reports. For example, one might need to break down results
by user agent, geographical region, software version, etc. Supporting this
functionality requires a different "batch selector", one that also accounts
for additional dimensions along which batches can be sliced.

Use case #3
In issue273 (https://github.com/ietf-wg-ppm/draft-ietf-ppm-dap/issues/273),
Shan Wang points to an altogether different (and, arguably, much simpler)
batch selection criterion: Instead of sorting reports into batch intervals,
we may simply want to ensure that batches are pairwise disjoint. Moreover,
our application might require that each batch is exactly the same size (or
at least within some small threshold).

Today, DAP only has first-class support for #1. Use cases #2 and #3 can
kind of be implemented, but it would be painful. For my part, I would be in
favor of adding protocol mechanisms in order to provide first-class support
for additional use cases that are likely to be common. As a straw man,
consider the following revised `CollectReq`:

```
+ enum {
+   reserved(0),
+   interval(1), // For use case #1
+   interval-metadata(2), // Use case #2
+   fixed(3), // Use case #3
+ } BatchSelector;

struct {
  TaskID task_id;
- Interval batch_interval;
+ BatchSelector batch_selector;
+ select (batch_selector) {
+   case interval:
+      Interval batch_interval;
+   case interval-metadata:
+      Interval batch_interval;
+      opaque metadata<0..2^8-1>; // "User-Agent", etc.
+   case fixed:
+      uint64 batch_id;
+ };
  opaque agg_param<0..2^16-1>; // VDAF aggregation parameter
} CollectReq;
```

What this expresses is that the "batch interval" has been replaced by one
of several "batch selectors", each designed to support a different (set of)
use case(s). Each has some associated parameters used by the Leader to
guide report selection. For example, the `fixed` selector encodes the
"batch ID", as defined in issue273. It seems to me that something like this
could work. Things to consider:
* Both Aggregators need to be able to enforce that the batch meets the
criteria specified by the Collector.
* There are implications for storage requirements for the Aggregators.
* There is also issue issue195 (
https://github.com/ietf-wg-ppm/draft-ietf-ppm-dap/issues/195) in which
Chris Wood points out some privacy implications regarding the flexibility
afforded to the Collector in choosing the batch selection criteria. (This
issue needs to be addressed in any case.)

Anyway ... thoughts? Specifically:
(a) Is there a use case we're missing here?
(b) What do you think of making changes to the protocol in order to support
additional use cases?

Cheers,
Chris P.