Re: [alto] Info Resource Dirs, OPTIONS, 300 Multiple Choices and all that jazz ....

Richard Alimi <rich@velvetsea.net> Sat, 30 July 2011 15:03 UTC

Return-Path: <richard.alimi@gmail.com>
X-Original-To: alto@ietfa.amsl.com
Delivered-To: alto@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 74D6B21F8A69 for <alto@ietfa.amsl.com>; Sat, 30 Jul 2011 08:03:04 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.958
X-Spam-Level:
X-Spam-Status: No, score=-2.958 tagged_above=-999 required=5 tests=[AWL=0.019, BAYES_00=-2.599, FM_FORGED_GMAIL=0.622, RCVD_IN_DNSWL_LOW=-1]
Received: from mail.ietf.org ([64.170.98.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id GM00YAREL9Fd for <alto@ietfa.amsl.com>; Sat, 30 Jul 2011 08:03:03 -0700 (PDT)
Received: from mail-vx0-f172.google.com (mail-vx0-f172.google.com [209.85.220.172]) by ietfa.amsl.com (Postfix) with ESMTP id 8195721F87E2 for <alto@ietf.org>; Sat, 30 Jul 2011 08:03:03 -0700 (PDT)
Received: by vxi40 with SMTP id 40so4207337vxi.31 for <alto@ietf.org>; Sat, 30 Jul 2011 08:03:04 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=Exb04L3P2cHE6JUyxLK9Ehdi+tIaJ3222dp2/aaAWT0=; b=xbMr08uA5TAM1Rkk5rA/cKXD2VoCoMJ68eRy+/tb3awgOhSA9R2dueXKpiWT8thckI Y6FNDf5bL27bVLMszTz9mdeAEhHs9bikU6vWlRFWczViH3tNQQsGG9YpEyXgV0cJzv/4 YIboKb5+NUszX+NcpChz9IemvxvCgxvEtQH9o=
Received: by 10.52.95.3 with SMTP id dg3mr2328244vdb.191.1312038184177; Sat, 30 Jul 2011 08:03:04 -0700 (PDT)
MIME-Version: 1.0
Sender: richard.alimi@gmail.com
Received: by 10.52.109.162 with HTTP; Sat, 30 Jul 2011 08:02:44 -0700 (PDT)
In-Reply-To: <8B0A9FCBB9832F43971E38010638454F040D2C3923@SISPE7MB1.commscope.com>
References: <CA56EBEC.6368%w.roome@alcatel-lucent.com> <8B0A9FCBB9832F43971E38010638454F040D2C3923@SISPE7MB1.commscope.com>
From: Richard Alimi <rich@velvetsea.net>
Date: Sat, 30 Jul 2011 08:02:44 -0700
X-Google-Sender-Auth: N1yoeQTJy7huVbZn827ecwqqB8s
Message-ID: <CA+cvDaao+pYVkKivwm05t1Mb_BOvr2a0zu9RbB_ch+_cdPcuJQ@mail.gmail.com>
To: "Thomson, Martin" <Martin.Thomson@commscope.com>
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: quoted-printable
Cc: Bill Roome <w.roome@alcatel-lucent.com>, "alto@ietf.org" <alto@ietf.org>
Subject: Re: [alto] Info Resource Dirs, OPTIONS, 300 Multiple Choices and all that jazz ....
X-BeenThere: alto@ietf.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: "Application-Layer Traffic Optimization \(alto\) WG mailing list" <alto.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/alto>, <mailto:alto-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/alto>
List-Post: <mailto:alto@ietf.org>
List-Help: <mailto:alto-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/alto>, <mailto:alto-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sat, 30 Jul 2011 15:03:04 -0000

Hi Martin,

On Thu, Jul 28, 2011 at 8:09 AM, Thomson, Martin
<Martin.Thomson@commscope.com> wrote:
...
>
> That said...  The way the text is structured implies something more complicated than it needs to be.  That is, it implies that an entry MAY identify a resource in a way that is not sufficiently defined to actuate that resource.  That's bad.  It does the clients a disservice and ought not happen in anything other than an error condition.
>

I'll note that the original text was less perscriptive in that it did
not recommend that clients use OPTIONS before they actuate the
resource.  The new text was written in response to Ben's comment: " I
don't think POSTing to expect a 300 "multiple choices" response is
what folks should be doing"
(http://www.ietf.org/mail-archive/web/alto/current/msg01035.html).

Looking back, this was regarding a particular example of a POST. In
that case, I agree with him (and I suspect he was only responding to
this particular case and not in general; I'm sure he'll correct me if
I'm wrong).  However, for a GET, I would think that requesting via GET
and then handling a 300 if it comes back is the better way (removes a
round-trip in the common case).

> Structuring the description in a different way could alleviate the problem.
>
> 1. a directory identifies resources as completely as possible
> 2. error handling requires good client feedback:
>  (a) all resources provide responses to OPTIONS requests that identify their own capabilities
>  (b) resources provide appropriate HTTP responses so that clients can correct mistakes (405, 406, etc...)

In general this is fine, but note that (2a), AFAIK, is giving up the
ability to deploy an ALTO Server by dumping some static files on a
standard HTTP Server (unless http server implementations that I don't
know about do support serving a static file in response to OPTIONS).
That was appealing in its simplicity and particularly if we would like
to reduce the barriers to adoption from the provider side.  However,
the discussion regarding making other services mandatory may end up
removing this anyways.

In (1), what does that actually mean to server implementers code-wise?
 Reduce the degrees of freedom (media-types, accepts, cost modes, cost
types) for each resource entry as much as possible?  Otherwise it
seems like some warm and fuzzy guidance that is hard to translate into
actual code.  Something more explicit along the lines of what Bill
described (exactly 1 media-type, 0 or 1 accepts) might be better here.

I'll note that aside from what I mentioned above regarding OPTIONS, I
would have thought that (2) should already be handled in the draft's
text (maybe aside from the "correct mistakes" phrase).  If not, can
you (or someone) suggest improved text?

Rich

> --Martin
>
> On 2011-07-28 at 10:35:24, Bill Roome wrote:
>> Section 7.6.2, Encoding of Information Resource Directory:
>>
>>    "Each entry MUST indicate a URI that either directly provides the
>>    indicated Information Resource, or responds to a HTTP OPTIONS
>> request
>>    which provides an Information Resource Directory with entries of
>>    additional Information Resources.
>>
>>    "If an ALTO Client makes a GET or POST request to a URI that does
>> not
>>    directly provide an indicated Information Resource, the ALTO Server
>>    MUST either reply with an HTTP 300 status code ("Multiple Choices")
>>    and an Information Resource Directory in the HTTP response¹s entity
>>    body, or indicate an appropriate HTTP status code. Note that in
>>    general, it is preferred that ALTO Clients use HTTP OPTIONS requests
>>    to discover additional Information Resources."
>>
>> Here's my philosophy about protocol designs: client-server protocols
>> should be designed to simplify the client. If that pushes work onto
>> the server, tough! The goal is to simplify the client.
>>
>> So what's the problem with those paragraphs? Consider the first. That
>> says the server has two distinct choices. How can a client discover
>> WHICH choice the server made? "Try it and find out."
>>
>> Please! That's an insult to client implementors. That's a clear case
>> of designing to simplify the server, at the expense of the client.
>>
>> Furthermore, this means a client must use three techniques to get the
>> information from a info directory:
>>   * A GET request to the primary directory URI,
>>   * An OPTIONS request to a multiple-type URI, or
>>   * A "300 Multiple Choices" error response to a GET or POST.
>>
>>
>> So what's my suggestion?  Drop those two paragraphs completely.
>> Instead, allow the information resource directory to contain an entry
>> for ANOTHER resource directory, with additional services. The media-
>> type would be application/alto-directory+json, of course. Eg,
>>
>>     }, {
>>        "uri" : "http://custom.alto.example.con/extra-dictionary",
>>        "media-types" : [ "application/alto-directory+json" ]
>>     }, {
>>
>>
>> Then if a client wants to explore those services, it can do a GET on
>> that URI.
>>
>> And for those who think the original specification is necessary -- the
>> OPTIONS and 300 response and all that -- now that we've had a
>> bake-off, how many servers actually implemented those options? How
>> many clients supported them?
>>
>>       - Bill Roome
>>
>>
>> _______________________________________________
>> alto mailing list
>> alto@ietf.org
>> https://www.ietf.org/mailman/listinfo/alto
>
>
> _______________________________________________
> alto mailing list
> alto@ietf.org
> https://www.ietf.org/mailman/listinfo/alto
>