Re: [core] draft-groupcomm-proxy: reverse proxies & URI embedding

Esko Dijk <esko.dijk@iotconsultancy.nl> Tue, 14 June 2022 19:51 UTC

Return-Path: <esko.dijk@iotconsultancy.nl>
X-Original-To: core@ietfa.amsl.com
Delivered-To: core@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 186F9C15AAD7 for <core@ietfa.amsl.com>; Tue, 14 Jun 2022 12:51:27 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.109
X-Spam-Level:
X-Spam-Status: No, score=-2.109 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_BLOCKED=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=iotconsultancy.nl
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 ODmvA06V5nEc for <core@ietfa.amsl.com>; Tue, 14 Jun 2022 12:51:23 -0700 (PDT)
Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-ve1eur03on070b.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe09::70b]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id D56EDC15AAD1 for <core@ietf.org>; Tue, 14 Jun 2022 12:49:27 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dvZDAu3mqFbmaTpTiaP9SDLYE1V5PC6BJ56VWN2Mt7v3CB24SY17fstua4BSY/hg1lQC3bxU5QMen3izDvvMi9RL6ZHYEkyjRANfGWWIbmeWj1soKIiResipViH8upXC2lRaSYa5eNQEB8t0iJh8xoc5Dpdeh38pr2lJLDqozevabpAS3riyqHspP1j/LwHBTnSrxaeKnGHAkmgDDgYigBb45My7sO+IR70qeA9oGBB+mjzgig+reHma4iwanHN7Y5J+68Ttm+m0CqmAUQU9Y6CCqnnC0Cf5G1RRk2fJR/3LQbK/jAxT2GrdRFTXxxDCbkGoLwxV6mXCZzQTforzYw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=SYmMD6qWGeB2lWZUO83VSMj6YBAeAxlwgpGhl+KG4LE=; b=ff9gV+FoH5Yjvp+oGKkXmeZdnz0rELqG8pVu4EZNJ85FMUrCoIte6xHgPrRmceK9RFcP0A6QzPHiyrVpQzUeDZ2aafsSUV2JLbQrIGYETMNhBGKcCsK8wjNSDMRBZRvGubOkgYF9GoVYQSYPY9Tw0oHxw4xTZhyvcVin384sU65ElIQ8u/URt63ETOmF16PTERrxJ9gPXDAdTz6Jbd60c66TTq3aPoSsyp4NRhw408a8rTOgKOftwy7kwnXmxG4tX5YrN0cgjOt4ag2puLmP2Zo/9tiAG7u+V5pSIovEO7huWeyY4uFxudfMSlyYBDNuBK+Y9ZLAAgCMFYPkjLhqcA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=iotconsultancy.nl; dmarc=pass action=none header.from=iotconsultancy.nl; dkim=pass header.d=iotconsultancy.nl; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iotconsultancy.nl; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=SYmMD6qWGeB2lWZUO83VSMj6YBAeAxlwgpGhl+KG4LE=; b=Xfcew7T+NvC2+afquN6TkNtsr6qO0DbFGK9/tfG87JhteqKAStdcw7EHQCNyvzXXgO3dusGDQOJk7Za/R53WLKTa4zsXjI2mgXDDML9357AuMajxMVVCBB1DQff8uD+LDiQPTqJ5A/uPDVA8yerATVxjaKXON9qVAMJ0AOyxoJY=
Received: from GV1P190MB1970.EURP190.PROD.OUTLOOK.COM (2603:10a6:150:56::7) by DB9P190MB1452.EURP190.PROD.OUTLOOK.COM (2603:10a6:10:248::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.14; Tue, 14 Jun 2022 19:49:22 +0000
Received: from GV1P190MB1970.EURP190.PROD.OUTLOOK.COM ([fe80::e571:2ce9:6902:47ab]) by GV1P190MB1970.EURP190.PROD.OUTLOOK.COM ([fe80::e571:2ce9:6902:47ab%9]) with mapi id 15.20.5332.020; Tue, 14 Jun 2022 19:49:22 +0000
From: Esko Dijk <esko.dijk@iotconsultancy.nl>
To: Christian Amsüss <christian@amsuess.com>
CC: core <core@ietf.org>, Marco Tiloca <marco.tiloca@ri.se>
Thread-Topic: draft-groupcomm-proxy: reverse proxies & URI embedding
Thread-Index: AQHYf/QBKroSyKpVR/SCpmaLj7oB5K1PTv+g
Date: Tue, 14 Jun 2022 19:49:22 +0000
Message-ID: <GV1P190MB19704A7240C4E55226B1EAD3FDAA9@GV1P190MB1970.EURP190.PROD.OUTLOOK.COM>
References: <DU0P190MB1978DB0C5606C328D620EC38FDAA9@DU0P190MB1978.EURP190.PROD.OUTLOOK.COM> <DU0P190MB19784C8ED1D37EDBF4E0E7E0FDDE9@DU0P190MB1978.EURP190.PROD.OUTLOOK.COM> <YqiPSmE9oVGmM/3S@hephaistos.amsuess.com>
In-Reply-To: <YqiPSmE9oVGmM/3S@hephaistos.amsuess.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=iotconsultancy.nl;
x-ms-publictraffictype: Email
x-ms-office365-filtering-correlation-id: 908009d2-2c7d-4d44-ed6b-08da4e3efa87
x-ms-traffictypediagnostic: DB9P190MB1452:EE_
x-microsoft-antispam-prvs: <DB9P190MB1452D5BFAA44476A7F7850D8FDAA9@DB9P190MB1452.EURP190.PROD.OUTLOOK.COM>
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: 5jJwDqu07f1Z8TYc5oVtvCnq5em2LSi7zVFHJ3UpeymiwSa8yIh+VgTy5++nVKtztsB6Upa4w2Ayugrn77SWRE+Z5ME+KTaKk885OMPpNxJFuZhn07dTRUUglOoSZ2kP5Jcs89e3f4ZLrm5KGlkbPgABMWIZ3tWtlXkItkpksndAGhvk2n+op2/y02DTIZ5uWLQT7t8ASymkEcsiDOovvjFVHmPk9FVud9Qna73zCeDHRlcpsKCkuuEl1UkhX3vv4AqjWxEXGRAR+d49pDXjC0bylSa33vZrbvOklKxHQUbyiXJ4AffuBXGTbCCE+itoOelA+TTIbi1qNFkWMVUz8gpkhDt97760kLe90ghAx/+uky70d+I99ZIKiCNZQM5jVCYe87YFXq3b1egX/CvBhoRnTJqdwWGt6D3N89e21z+dID2dscNfIbLWfyQKgzlMFXmcxQkJuMKmZr8tuQqDGVzGh2o4+tj5usFNqhAGQyE/n7RZ+sOC4uRVoqUG24Dm2tSp1EfAq0KH24Y0fpytgH36iiBtkZRGHc1ilbn8Gb6TnZKlSKvfvekD0zQ1ir7nqdQYSRKkxYX8inc8idwysFIOXxm5S3w1asVKEfUECERgJSA4oy6p8n/+IeH2O0uWdTKkb0q1HR7fXa9xDJjhzOgoULwrAVrRVPmH8KHQbczcFg0Hm41//FXAhYCNbLhOSzsATKqvXBB6ICet35334A5UjugvVcgZqx0v9F2YU/nr3ffEqOTs90II5OHDsJf/uOaqw/8lzI0gv5mQVHclynijDQG2uweKMWWo0FkpYms=
x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:GV1P190MB1970.EURP190.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(13230016)(136003)(366004)(39830400003)(346002)(396003)(186003)(83380400001)(316002)(38100700002)(9686003)(41300700001)(66574015)(6506007)(7696005)(54906003)(53546011)(6916009)(508600001)(55016003)(2906002)(8936002)(66946007)(66556008)(52536014)(66476007)(64756008)(8676002)(4326008)(122000001)(66446008)(38070700005)(33656002)(71200400001)(5660300002)(76116006)(86362001)(44832011)(966005); DIR:OUT; SFP:1102;
x-ms-exchange-antispam-messagedata-chunkcount: 2
x-ms-exchange-antispam-messagedata-0: F7MgbJbGpOEOQ8ppMbEFsQ+TYz5VVI25k14GS89f/zQUOf75kfQMx29snE3MbmVD3XQxbKu4QNbTQh09VGwr9bAVDllQtRVVQV6qcLTW0hkJ/fxEXKETwXByIlU/Hoql8LUHZ8qv64gyBR4M56qFOsbIiR5YcXCesJzdb2xiD4iFSuwGm6l/vKOs9QkNmTlmhcuKsMDgxz+x7SXxXMW9nwbXPMv+BEL34BJw99WxSPeZvvA841y0wNZhTvJIsj8YBDMx7g+rx3yns+FSIcXFbSQ23fA4gwFk5C1z8gK7yLF5zkxcv1KZqfpPxUstfZbm+3FwY4nsklg2QltjgRFMYDBBxn5Or/nWbnHfgQXQHR4MqGqqri/P8EiqmgUki3B7lTaTNa0B8CpvCgz8wTPWWqy3OQ7Tt3StdLvGhsL1wTJNYODTshYsk5YUVRfTLQWD/t/z/KvuY5urA3Py8B/Ll/NiilGz+bGnDvXcoXImDUbyDtAmvFJhqskNe62Iaf14g3l6QUlO3Y/peZO11k75BZcfgh4PdqgSHQfBRtDj0gtjzXMPqogUjB83W5uYB4JTaG/4HYUYFkSFkHPtaQZGNWdlA4ZG7N60aUwxPC00mn0bHbbDXifHq3L4JvXRjkjexr3xG9fJJDnwnE/6X15artUk7KbUsSwwZ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Z2nemnCOA2TKoXw9/p5sed5TDyaiP/6EClkJ10utnI9iscmtUBuj5m/b
x-ms-exchange-antispam-messagedata-1: Y1mg9dD8vmOuVUV9muEOuiJa0hNHcgO1knM=
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-OriginatorOrg: iotconsultancy.nl
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: GV1P190MB1970.EURP190.PROD.OUTLOOK.COM
X-MS-Exchange-CrossTenant-Network-Message-Id: 908009d2-2c7d-4d44-ed6b-08da4e3efa87
X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Jun 2022 19:49:22.3872 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 58bbf628-15d2-46bc-820b-863b6774d44b
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: nlprRjfK/jUfab08hMadCS1Y49hfp+BCoerM8IfvUokA4So+25qDIEbl1+JNsmJW4Z/XJ97/qpvk2fGuHe/HOHU96FbrTm6RIdQbOjU+KBQ=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9P190MB1452
Archived-At: <https://mailarchive.ietf.org/arch/msg/core/mmFn9ntRmWPDjbynIki839B1z9w>
Subject: Re: [core] draft-groupcomm-proxy: reverse proxies & URI embedding
X-BeenThere: core@ietf.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: "Constrained RESTful Environments \(CoRE\) Working Group list" <core.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/core>, <mailto:core-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/core/>
List-Post: <mailto:core@ietf.org>
List-Help: <mailto:core-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/core>, <mailto:core-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 14 Jun 2022 19:51:27 -0000

Hi Christian,

Thanks for the clarifying notes on the proposal - that's indeed what I intended. So I'll try to integrate this view into the draft!

Regards
Esko

-----Original Message-----
From: Christian Amsüss <christian@amsuess.com> 
Sent: Tuesday, June 14, 2022 15:38
To: Esko Dijk <esko.dijk@iotconsultancy.nl>
Cc: core <core@ietf.org>; Marco Tiloca <marco.tiloca@ri.se>
Subject: Re: draft-groupcomm-proxy: reverse proxies & URI embedding

Hello Esko,

(going with the second mail first because that's quick to answer, and
may suffice):

>   1.  Forward Proxy
>      *   Client MUST include Multicast-Timeout option in its CoAP request.
>      *   Client includes the usual CoAP options to construct the proxy URI, using Proxy-Uri or Proxy-Scheme etc.
>      *   Proxy constructs the group communication request URI based on above options.
>   2.  Reverse Proxy
>      *   Client MUST include Multicast-Timeout option in its CoAP request.
>      *   By the above option it follows that the client is aware of accessing a proxy and that its code is prepared to correctly handle multiple CoAP responses to 1 request.
>      *   Client includes the usual CoAP option to access a resource on the server/proxy, i.e. Uri-Path, Uri-Query and in rare cases Uri-Host/Uri-Port.
>      *   The reverse proxy has its own, custom, logic of constructing the groupcomm request URI i.e. deciding which resource leads to which groupcomm request.

I agree with the proposal, noting that

* I understand "client is aware of accessing a proxy" to roughly mean
  "is aware that this behaves like a multicast proxy request" (but
  doesn't necessarily need to do anything else about this being a
  proxy), and

* I understand the MUST as "MUST in order to gain multicast forwarding".

  If the option is absent, the proxy may exhibit a configured unicast
  behavior, or refuse proxying, eg. with 4.00 Bad Request,
  Content-Format: application/consise-problem-details+cbor, payload
  {'multicast-resource': 10} indicating a realistic timeout value)



That probably suffices; the rest is merely arguing for why I see it that
way.


On Thu, Jun 02, 2022 at 09:26:10AM +0000, Esko Dijk wrote:
> During last interim we discussed some potential issues in the use of a
> reverse proxy for group communications, see
> https://datatracker.ietf.org/doc/html/draft-tiloca-core-groupcomm-proxy-06#appendix-A.1
> . This example is based on URI mapping as used for RFC 8075 for a HTTP
> client that wants to access a CoAP resource.

I think that's only appropriate for an HC proxy: HTTP clients generally
don't accept non-HTTP URIs even if they could just forward them into an
HTTP proxy whose `request-line` ABNF formally accepts non-HTTP URIs.
CoAP was specifically designed not to have that limitation, and thus
doesn't need that workaround.

> So I recall from the discussion that necessarily the client has to be
> aware that it is talking to a ‘group communication’ proxy , to apply
> the right token processing and expiry. And the best way to guarantee
> that is by requiring the client to include the Multicast-Timeout
> option. Is that correct?

Yes.

I recommend taking a mindset in which this is not about "proxy" but
about the address having the "is a multicast destination" property
(which is implicit in IP when using a multicast address in UDP, and
explicitly indicated in basically-unicast situations by
Multicast-Timeout) -- but given that the main user of this option is
proxies, it might be easier writing to just talk of proxies.

An example of using this in a non-proxy environment is when there is
name based virtual hosting, and a server could respond to `GET
coap://ip-address/.well-known/core Multicast-Timeout:1` with the WKCs of
all its virtual hosting servers, each with a Response-Forwarding option
indicating the adequate host name -- I doubt anyone would want to
implement it that way, but if you like to have a mental example of how a
multicast requests works in a non-proxy situation, there it is.

> Now the next question is, if this CoAP client is aware of the proxy
> and must anyhow include the Multicast-Timeout option so it already has
> dedicated code to do that, why doesn’t this client then use the
> standard Forward Proxy functionality of CoAP?  There’s no need anymore
> to embed for example the CoAP URI into the URI path as in the example
> A.1 , because the client could just use a Proxy-URI option which would
> make the proxy a “Forward Proxy” instead of a reverse proxy. Any views
> on this?

I think that's because both

* a URI is easier to transport (say, in a QR code) than a URI with the
  information about which proxy to use (even if it's only a bit of
  information that says to send it to wherever the name resolves), and

* the forward proxy a client uses is more a matter of system
  configuration, whereas the URI to go to is user guided. An application
  may allow "untrusted sources" to set the URI to derefernce, but not to
  set the proxy to use.

Note that due to the Multicast-Timeout property being elective, a client
can just be prepared to receive multicast addresses without any further
indication. An application could thus have an input field "entry points"
that accepts any number of URIs, some of which may be multicast, and
just send a Multicast-Timeout if there is doubt anywhere that something
could maybe respond thusly.

> If this argument holds then we could just remove any reverse
> proxy examples and say the client has to invoke the standard CoAP
> proxy methods in its request.

I'd welcome the examples going away -- after all, this is a corner case.
If the text manages to describe all relevant properties of the options
in a sufficiently generic way, a two-line statement about the options
working the same way when the client expects that multicast-like
responses can be returned from a request that does not carry a proxy
option.

BR
c

-- 
To use raw power is to make yourself infinitely vulnerable to greater powers.
  -- Bene Gesserit axiom