Re: [core] Call for reviews of draft-castellani-core-http-mapping

Klaus Hartke <hartke@tzi.org> Thu, 11 April 2013 19:46 UTC

Return-Path: <hartke@tzi.org>
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 A781C21F8D94 for <core@ietfa.amsl.com>; Thu, 11 Apr 2013 12:46:52 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -5.627
X-Spam-Level:
X-Spam-Status: No, score=-5.627 tagged_above=-999 required=5 tests=[BAYES_00=-2.599, FM_FORGED_GMAIL=0.622, HELO_EQ_DE=0.35, RCVD_IN_DNSWL_MED=-4]
Received: from mail.ietf.org ([12.22.58.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id x5Omx1C+IT4d for <core@ietfa.amsl.com>; Thu, 11 Apr 2013 12:46:51 -0700 (PDT)
Received: from informatik.uni-bremen.de (mailhost.informatik.uni-bremen.de [IPv6:2001:638:708:30c9::12]) by ietfa.amsl.com (Postfix) with ESMTP id DF0EA21F8D8E for <core@ietf.org>; Thu, 11 Apr 2013 12:46:50 -0700 (PDT)
X-Virus-Scanned: amavisd-new at informatik.uni-bremen.de
Received: from smtp-fb3.informatik.uni-bremen.de (smtp-fb3.informatik.uni-bremen.de [134.102.224.120]) by informatik.uni-bremen.de (8.14.4/8.14.4) with ESMTP id r3BJkmSu001232 for <core@ietf.org>; Thu, 11 Apr 2013 21:46:48 +0200 (CEST)
Received: from mail-vc0-f177.google.com (mail-vc0-f177.google.com [209.85.220.177]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by smtp-fb3.informatik.uni-bremen.de (Postfix) with ESMTPSA id DA6373BAE for <core@ietf.org>; Thu, 11 Apr 2013 21:46:47 +0200 (CEST)
Received: by mail-vc0-f177.google.com with SMTP id hr11so1620260vcb.36 for <core@ietf.org>; Thu, 11 Apr 2013 12:46:46 -0700 (PDT)
X-Received: by 10.220.104.68 with SMTP id n4mr6198770vco.37.1365709606719; Thu, 11 Apr 2013 12:46:46 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.52.187.134 with HTTP; Thu, 11 Apr 2013 12:46:06 -0700 (PDT)
In-Reply-To: <031DD135F9160444ABBE3B0C36CED618BFEA84@011-DB3MPN2-082.MGDPHG.emi.philips.com>
References: <0C9867A6-AED5-4063-88AE-E9D1C6CDE75E@tzi.org> <d5a79ad7412cfca4e5ac41c2be4e11e4@xs4all.nl> <031DD135F9160444ABBE3B0C36CED618BFEA84@011-DB3MPN2-082.MGDPHG.emi.philips.com>
From: Klaus Hartke <hartke@tzi.org>
Date: Thu, 11 Apr 2013 22:46:06 +0300
Message-ID: <CAAzbHvbRoitn6v_oFZna2LMkA9t7XCGE7M-=JN+Xwhc=q0SKGg@mail.gmail.com>
To: "core@ietf.org" <core@ietf.org>
Content-Type: text/plain; charset="ISO-8859-1"
Subject: Re: [core] Call for reviews of draft-castellani-core-http-mapping
X-BeenThere: core@ietf.org
X-Mailman-Version: 2.1.12
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: <http://www.ietf.org/mail-archive/web/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: Thu, 11 Apr 2013 19:46:52 -0000

Esko Dijk wrote:
> I propose to define the forward/reverse proxy in such a way that the "client awareness" does not play a role anymore

Client awareness is pretty much what distinguishes a forward proxy
from a reverse proxy.


Assume a client retrieves a representation of a resource and this
representation contains a link. Then there are the following cases:

* The client uses the information in the URI to connect to a server.
The server at that address is the authoritative source for
representations of the resource identified by the URI, so it returns a
response directly.

     -> "Origin server".

* The client uses the information in the URI to connect to a server.
However, the server is _not_ the authoritative source for
representations of the resource identified by the URI. Instead, it has
been configured to obtain the representation from an unrelated third
party. Which third party it connects to can come from local
configuration or be embedded in the URI. From the perspective of the
client, the response looks and feels exactly as a response from an
origin server, though.

     -> "Reverse proxy". It is an unilateral decision of the server to
obtain the representation from a third party.

* The client does _not_ use the information in the URI. Instead, it
has been configured to connect to an unrelated third party. The client
requests this third party to obtain the representation of the resource
identified by the URI, well aware that this third party not the
authoritative source for the representation.

     -> "Forward proxy". It is an unilateral decision of the client to
request a third party to obtain the representation and not to connect
to the server specified in the URI.


The protocol between client--proxy and proxy--origin-server do not
have to be the same. For example, a client can make an HTTP request to
a reverse proxy and the reverse proxy makes a CoAP request to the
origin server.

http://coap.me/ is a good example of an HTTP/CoAP cross-protocol
reverse proxy. It embeds the information which CoAP server to connect
to in the http:// URI, and rewrites all links in representations
obtained from CoAP servers to http:// URIs, so you can use a simple
web browser to browse CoAP servers.

The protocol between client--forward-proxy is often a bit different
than between client--origin-server and client--reverse-proxy. For
example, when a client makes a CoAP request to a forward proxy, the
URI is transmitted in the Proxy-Uri Option and not in the Uri-*
Options. Similarly, when a client makes an HTTP request to a forward
proxy, the entire URI is transmitted in the request line and not in
the Host header field.

Unfortunately, in case of a HTTP/CoAP cross-protocol forward proxy, we
cannot simply put a coap:// URI in the HTTP request line. So we need a
different protocol that both the client and the forward-proxy agree on
to encode this request. One way is to let the client translate the
coap:// URI to an http:// URI in a standardized way, and the forward
proxy translates the http:// URI back to the original coap:// URI.


The line between reverse proxy and forward proxy seems to blur when we
embed coap:// URIs in http:// URIs in the reverse proxy case, and
translate coap:// URIs to http:// URIs in the forward proxy case. But
it doesn't.

- Does the client have an http:// URI and does the HTTP server make
the unilateral decision to make a CoAP request (based on an embedded
coap:// URI in the http:// URI, opaque to the client)? Reverse proxy.

- Does the client have a coap:// URI and does it make the unilateral
decision to perform an HTTP request (with the coap:// URI translated
to a http:// URI according to some standardized scheme)? Forward
proxy.


Just my 2 cents.

Klaus