Subject: [core] #176: Uri-Path and Uri-Query

From: "core issue tracker" <[email-masked]>
Date: Fri, 28 Oct 2011 13:35:37 -0000

#176: Uri-Path and Uri-Query

 This ticket is to move to a non-segmented Uri-Path and Uri-Query solution
 (as was in previous versions), just normalizing and then including the
 whole path or query string in the Uri-Path or -Query option, respectively.
 However, in order to overcome the 270 octet limit of a single option, we
 allow the concatenation of these options as is done in the Proxy-Uri
 option. This is a minor change for implementations, as many already just
 perform concatenation when processing these options.

 The ticket is in response to implementor feedback where interoperability
 problems have been common regarding segmentation, and the ETSI M2M
 standardization effort where a CoAP binding has been defined and the
 segmented model casuses problems with the ETSI standard as deep path
 structures together with query parameters are required.

 This would require the following technical changes to coap-07:

 Section 5.10.2:

 -  o  each Uri-Path Option specifies one segment of the absolute path to
 -     the resource, and
 +  o  the Uri-Path Option contains the absolute path to the resource, and

 -   o  each Uri-Query Option specifies one argument parameterizing the
 -      resource.
 +   o  the Uri-Query Option contains the query string of the resource.

 Section 6.4:

   8.  If the value of the <path> component of /url/ is empty or
       consists of a single slash character (U+002F SOLIDUS "/"), then
       move to the next step.

 -     Otherwise, for each segment in the <path> component, include a
 -     Uri-Path Option and let that option's value be the segment (not
 -     including the delimiting slash characters) after converting all
 -     percent-encodings ("%" followed by two hexadecimal digits) to the
 -     corresponding characters.

 +    Otherwise, the <path> component is included in a Uri-Path option
 +    after converting all percent-encodings ("%" followed by two
 hexadecimal
 +    digits) to the corresponding characters. In case the <path> doesn't
 fit
 +    within a single option, the Uri-Path Option MAY be included multiple
 +    times in a request such that the concatenation of the values results
 in
 +    the single <path>. All but the last instance of the Uri-Path Option
 MUST
 +    have a value with a length of 270 bytes, and the last instance MUST
 NOT be empty.

   9.
 -       If /url/ has a <query> component, then, for each argument in the
 -       <query> component, include a Uri-Query Option and let that
 -       option's value be the argument (not including the question mark
 -       and the delimiting ampersand characters) after converting all
 -       percent-encodings to the corresponding characters.

 +      If /url/ has a <query> component, then the <query> component is
 included
 +      in a Uri-Query option after converting all percent-encodings to the
 corresponding
 +      characters. In case the <query> doesn't fit
 +      within a single option, the Uri-Query Option MAY be included
 multiple
 +      times in a request such that the concatenation of the values
 results in
 +      the single <query>. All but the last instance of the Uri-Query
 Option MUST
 +      have a value with a length of 270 bytes, and the last instance MUST
 NOT be empty.

 Section 6.5:

      6.  Let /resource name/ be the empty string.
 - For each Uri-Path
 + For the first Uri-Path

      Option in the request, append a single character U+002F SOLIDUS
     (/) followed by the option's value to /resource name/

 + For any additional Uri-Path options, concatenate the value to /resource
 name/.

 -        Then converting any character that is not either in the
 -    "unreserved" set, "sub-delims" set, a U+003A COLON (:) or U+0040 -
 COMMERCIAL AT (@) character, to its percent-encoded form.

    8.
 -        For each
 +        For the first

 Uri-Query Option in the request, append a single
         character U+003F QUESTION MARK (?) (first option) or U+0026
         AMPERSAND (&) (subsequent options) followed by the option's
         value to /resource name/.

 + For any additional Uri-Query options, concatenate the value to /resource
 name/.

 +  New step 8a.

 + Then convert any character in /resource name/ that is not either in the
 + "unreserved" set, "sub-delims" set, a U+003A COLON (:) or U+0040 +
 COMMERCIAL AT (@) character, to its percent-encoded form.

-- 
----------------------------------+--------------------
 Reporter:  zach@…                |      Owner:  zach@…
     Type:  protocol enhancement  |     Status:  new
 Priority:  minor                 |  Milestone:
Component:  coap                  |    Version:
 Severity:  -                     |   Keywords:
----------------------------------+--------------------

Ticket URL: <http://trac.tools.ietf.org/wg/core/trac/ticket/176>
core <http://tools.ietf.org/core/>

---

From: Zach Shelby <[email-masked]>
Date: Fri, 28 Oct 2011 16:43:44 +0300

Hi,

I entered this as a ticket not to lose track of the changes needed. This text now includes all the changes I think would be necessary for this update. Please take a look if you can spot bugs or have improvement suggestions.

We should hear some more feedback on making this change before implementing it. So far I have heard decent support on the mailing list. Olaf brought up a possible normalization issue with Uri-Path, but I think that was a misunderstanding. I am just returning from the an ETSI M2M meeting and can confirm that the current -07 model is a broken for them, and the general expectation is that we will fix this. 

Please let us know your thoughts by Monday.

Thanks,
Zach 

-- 
Zach Shelby, Chief Nerd, Sensinode Ltd.
http://www.sensinode.com
http://zachshelby.org  - My blog "On the Internet of Things"
http://6lowpan.net - My book "6LoWPAN: The Wireless Embedded Internet"
Mobile: +358 40 7796297