Status CoRE LINKS

Author: Jaime Jiménez

Tentative Timeline

Comments on v06

Remaining Comments on v07

Editorial


Summary draft-ietf-core-links-json-07

Representing CoRE Formats in JSON and CBOR

The draft defines a format for representing and translating Web links RFC5988 from CoRE link format RFC6690 to JSON (generic in use) and CBOR (used in the constrained space over CoAP)

Both formats are defined on their respective RFCs: JavaScript Object Notation (JSON) RFC7159 and Concise Binary Object Representation (CBOR) RFC7049.

A link-format document is a collection of web links link-value, each of which is a collection of attributes link-param applied to a URI-Reference. The Information Model mapping is straightforward for the collection of links and attributes, requiring CBOR an extra mapping to the encoded values, its CDDL being:

                                   +           +
links = [* link]                   |           |
link = {                           |  JSON     |
  href: tstr    ; resource URI     |           |
  * label => tstr / true           |           |
}                                  |           |
href =1                            +           |
label = tstr / &(                              | CBOR
  rel: 2,        anchor: 3,                    |
  rev: 4,    hreflang: 5,   media: 6,          |
  title: 7,  type: 8,       rt: 9,             |
  if: 10,    sz: 11,        ct: 12,            |
  obs: 13,                                     |
)                                              +

There is one example of mapping, answer to the following request to the CoAP Server:

REQ: GET /.well-known/core?anchor=/sensors/temp

Response form in CoRE Link Format:

</sensors>;ct=40;title="Sensor Index",
</sensors/temp>;rt="temperature-c";if="sensor",
</sensors/light>;rt="light-lux";if="sensor",
<http://www.example.com/sensors/t123>;anchor="/sensors/temp"
;rel="describedby",
</t>;anchor="/sensors/temp";rel="alternate"

Same response in JSON:

"[{"href":"/sensors","ct":"40","title":"Sensor
 Index"},{"href":"/sensors/temp","rt":"temperature-
 c","if":"sensor"},{"href":"/sensors/light","rt":"light-
 lux","if":"sensor"},{"href":"http://www.example.com/sensors/
 t123","anchor":"/sensors/
 temp","rel":"describedby"},{"href":"/t","anchor":"/sensors/
 temp","rel":"alternate"}]"

Same response in CBOR diagnostic format, in which there is a substitution of the common attribute names:

[{1: "/sensors", 12: "40", 7: "Sensor Index"},
 {1: "/sensors/temp", 9: "temperature-c", 10: "sensor"},
 {1: "/sensors/light", 9: "light-lux", 10: "sensor"},
 {1: "http://www.example.com/sensors/t123", 3: "/sensors/temp",
  2: "describedby"},
 {1: "/t", 3: "/sensors/temp", 2: "alternate"}]

The full example of hexadecimal CBOR is found in Section 2.4.2.

Sizewise the results are definitely more compact:

Notation Binary Size % to Link Format
Link Format no 257 bytes ——–
JSON no 321 bytes > 25 %
CBOR yes 203 bytes < 21 %

Shepherd Writeup

Summary

Document Shepherd: Jaime Jiménez, jaime.jimenez@ericsson.com Area Director: Alexey Melnikov, aamelnikov@fastmail.fm

JavaScript Object Notation, JSON (RFC7159) is a text-based data format which is popular for Web based data exchange. Concise Binary Object Representation, CBOR (RFC7049) is a binary data format which has been optimized for data exchange for the Internet of Things (IoT). For many IoT scenarios, CBOR formats will be preferred since it can help decrease transmission payload sizes as well as implementation code sizes compared to other data formats.

Web Linking (RFC5988) provides a way to represent links between Web resources as well as the relations expressed by them and attributes of such a link. In constrained networks, a collection of Web links can be exchanged in the CoRE link format (RFC6690). Outside of constrained environments, it may be useful to represent these collections of Web links in JSON, and similarly, inside constrained environments, in CBOR. This specification defines a common format for this.

The document is intended for Standards Track.

Review and Consensus

The document has gone through multiple expert reviews and has been discussed on multiple IETF meetings. Before the last IETF the WGLC was completed.

Intellectual Property

Each author has stated that they do not have direct, personal knowledge of any IPR related to this document. I am not aware of any IPR discussion about this document on the CoRE WG.

Other Points

IMO the title should probably be: Representing CoRE link-format in JSON and CBOR. A previous version included other formats, the present one doesn’t.

Checklist