Re: [core] A question on handling of option parameters defined in HTTP

Yusuke DOI <yusuke.doi@toshiba.co.jp> Thu, 23 August 2012 07:21 UTC

Return-Path: <yusuke.doi@toshiba.co.jp>
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 6FA0C11E80C5 for <core@ietfa.amsl.com>; Thu, 23 Aug 2012 00:21:38 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -4.812
X-Spam-Level:
X-Spam-Status: No, score=-4.812 tagged_above=-999 required=5 tests=[AWL=-1.324, BAYES_00=-2.599, HELO_EQ_JP=1.244, HOST_EQ_JP=1.265, J_CHICKENPOX_74=0.6, RCVD_IN_DNSWL_MED=-4, UNPARSEABLE_RELAY=0.001]
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 PAyair2BF28O for <core@ietfa.amsl.com>; Thu, 23 Aug 2012 00:21:37 -0700 (PDT)
Received: from imx2.toshiba.co.jp (inet-tsb5.toshiba.co.jp [202.33.96.24]) by ietfa.amsl.com (Postfix) with ESMTP id 78F0C11E808A for <core@ietf.org>; Thu, 23 Aug 2012 00:21:37 -0700 (PDT)
Received: from arc1.toshiba.co.jp ([133.199.194.235]) by imx2.toshiba.co.jp with ESMTP id q7N7Latf019037 for <core@ietf.org>; Thu, 23 Aug 2012 16:21:36 +0900 (JST)
Received: (from root@localhost) by arc1.toshiba.co.jp id q7N7LZMR004888 for core@ietf.org; Thu, 23 Aug 2012 16:21:35 +0900 (JST)
Received: from unknown [133.199.192.144] by arc1.toshiba.co.jp with ESMTP id SAA04886; Thu, 23 Aug 2012 16:21:35 +0900
Received: from mx2.toshiba.co.jp (localhost [127.0.0.1]) by ovp2.toshiba.co.jp with ESMTP id q7N7LZxo002657 for <core@ietf.org>; Thu, 23 Aug 2012 16:21:35 +0900 (JST)
Received: from spiffy21.isl.rdc.toshiba.co.jp by toshiba.co.jp id q7N7LZkb014026; Thu, 23 Aug 2012 16:21:35 +0900 (JST)
Received: from [133.196.16.83] (ncg-dhcp83.isl.rdc.toshiba.co.jp [133.196.16.83]) by spiffy21.isl.rdc.toshiba.co.jp (Postfix) with ESMTPS id 79E4B97CE7; Thu, 23 Aug 2012 16:21:35 +0900 (JST)
Message-ID: <5035D9FE.4050602@toshiba.co.jp>
Date: Thu, 23 Aug 2012 16:21:34 +0900
From: Yusuke DOI <yusuke.doi@toshiba.co.jp>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:14.0) Gecko/20120713 Thunderbird/14.0
MIME-Version: 1.0
To: Bert Greevenbosch <Bert.Greevenbosch@huawei.com>, "core@ietf.org" <core@ietf.org>
References: <46A1DF3F04371240B504290A071B4DB62908135F@szxeml509-mbs> <502C6564.1060400@toshiba.co.jp> <CAB6izETPpUOFVW=6Y5o6Wc_nbX0P6-Dt+q9zLkHN4DrQNrVLFA@mail.gmail.com> <201208220448.q7M4mJct004238@toshiba.co.jp> <46A1DF3F04371240B504290A071B4DB6290BAE52@szxeml509-mbs>
In-Reply-To: <46A1DF3F04371240B504290A071B4DB6290BAE52@szxeml509-mbs>
Content-Type: text/plain; charset="ISO-8859-1"; format="flowed"
Content-Transfer-Encoding: 7bit
Subject: Re: [core] A question on handling of option parameters defined in HTTP
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, 23 Aug 2012 07:21:38 -0000

Hi Bert,

Thanks for your review.

> (1) In section 2.2, the server can accept any rate, whereas the client chose the rate 32500 and signals it through the content-type. How did the server indicate the acceptable rates to the client?

This (server-to-client node/resource capability notification) is beyond the scope of this document. In (only) HTTP, I guess no standard way is defined. The client may try to POST rate 32500 anyway to find it is acceptable or not. If an application uses DNS-SD, the TXT RR could be good place to describe server capability. In CoAP, I guess it could be done with the link format. I've heard Kerry is working on the issue (draft-lynn-core-discovery-mapping).

> (2) In the other direction, how can the client indicate acceptable parameters to the server?

Client can send Accept option with appropriate parameteras it sends GET request to the server.

> (3) What is the rationale behind the "oid" field? I understand that it is for indexing the option-parameters. Does that mean that a content-type "some/content-type;par1=8;par2=9" would have two "Option-Parameter" options, in which the one for par1 has "oidx=0" and par2 "oix=1"?

It's index of the option in the CoAP message.
A  CoAP message may have the following options:

CON GET
[0]Uri-Host: "example.org"
[1]Uri-Port: 15683
[2]Uri-Path: "example.exi"
[3]Accept: example-exi (is an imagenary content-type for an example application with schema-informed EXI encoding)
[4]Accept: example+json (same as above, with JSON)
[5]Option-Parameter1: 3,9,"5" (aid=9 means "level")
[6]Option-Parameter1: 4,2,"0.8"  (aid=2 means "version")

In the first Option-Parameter1, its oidx=3. This parameter is for the option with index [3]. This is
  Accept: example-exi;level=5
The second one is
  Accept: example+json;version=0.8

Since this index is fragile to option add/remove, this is not a proxy-safe option.

> (4) For the "value" field, I guess you propose to use a text string with the same content as the "value" field from RFC 2045?

I guess UTF-8 should be 'modern way'. I have no strong opinion on it. It could be RFC2045-style, UTF-8 string, and opaque octets.


(let me change the order of your question)
> (6) To avoid confusion with CoAP options, would it be helpful to rename "Option-Parameter" to "ContentType-Parameter"?

I agree.

At first, I have been thinking the parameter is also usable for other options. But while thinking through your review, I noticed it's confusing to have generic option parameters because the same semantics could be expressed in different manner in CoAP options. For example, content preference among multiple Accept-able content type is described by the order of options. It may be harmful to have "q" parameter (the same semantics in HTTP) to CoAP.

> (5) Why do you define 3 "Option-Parameter" options? What is the related implementation complexity, and how does having three separate options resolve it?

This is because I didn't want adding a parameter BEFORE its target.

The oidx of Option-Parameter points another option ('target') by the order in the packet. If I need to put parameter options before the target, I need to wait for the header building process to decide the oidx field.

However, as I agreed on (6), if this option only points to Content-Type and Accept header, a option number larger than Accept option is enough. Or, separate option for parameter of Content-Type and parameter of Accept could be a good idea because Content-Type does not need oidx.

Regards,

// Yusuke DOI <yusuke.doi@toshiba.co.jp> Corporate R&D Center, TOSHIBA Corp.

(2012-08-23 10:31), Bert Greevenbosch wrote:
> Hi Yuseke, all,
>
> I have reviewed your "draft-doi-core-parameter-option" document. I realise that this idea still needs to ripen, so I hope the following questions can help getting a clearer view on the proposed mechanism:
>
> (1) In section 2.2, the server can accept any rate, whereas the client chose the rate 32500 and signals it through the content-type. How did the server indicate the acceptable rates to the client?
>
> (2) In the other direction, how can the client indicate acceptable parameters to the server?
>
> (3) What is the rationale behind the "oid" field? I understand that it is for indexing the option-parameters. Does that mean that a content-type "some/content-type;par1=8;par2=9" would have two "Option-Parameter" options, in which the one for par1 has "oidx=0" and par2 "oix=1"?
>
> (4) For the "value" field, I guess you propose to use a text string with the same content as the "value" field from RFC 2045?
>
> (5) Why do you define 3 "Option-Parameter" options? What is the related implementation complexity, and how does having three separate options resolve it?
>
> (6) To avoid confusion with CoAP options, would it be helpful to rename "Option-Parameter" to "ContentType-Parameter"?
>
> I see value in content type parameters, especially as HTTP already supports a similar mechanism. So I look forward to discuss more about how this could be reflected by CoAP.
>
> Best regards,
> Bert
>
> ---
> Bert Greevenbosch M.Sc.
> Senior Research and Standardisation Engineer
>
> email: bert.greevenbosch@huawei.com
> telephone: +86-755-28978760
>
> HUAWEI TECHNOLOGIES CO.,LTD.
> Building F1 / Floor 8
> Huawei Industrial Base
> Bantian, Longgang District
> Shenzhen  518129
> P.R. China
>
> *******************************************************************************
> This email and its attachments contain confidential information from HUAWEI, which is intended only for the person or entity whose address is listed above. Any use of the information contained here in any way (including, but not limited to, total or partial disclosure, reproduction, or dissemination) by persons other than the intended recipient(s) is prohibited. If you receive this email in error, please notify the sender by phone or email immediately and delete it!
> ******************************************************************************
>
>