--- 1/draft-ietf-core-dynlink-11.txt 2021-01-12 07:13:48.504103297 -0800 +++ 2/draft-ietf-core-dynlink-12.txt 2021-01-12 07:13:48.556104613 -0800 @@ -1,27 +1,28 @@ CoRE Working Group M. Koster Internet-Draft SmartThings Intended status: Informational B. Silverajan, Ed. -Expires: January 14, 2021 Tampere University - July 13, 2020 +Expires: July 16, 2021 Tampere University + January 12, 2021 Dynamic Resource Linking for Constrained RESTful Environments - draft-ietf-core-dynlink-11 + draft-ietf-core-dynlink-12 Abstract This specification defines Link Bindings, which provide dynamic linking of state updates between resources, either on an endpoint or between endpoints, for systems using CoAP (RFC7252). This - specification also defines Conditional Notification Attributes that - work with Link Bindings or with CoAP Observe (RFC7641). + specification also defines Conditional Notification and Control + Attributes that work with Link Bindings or with CoAP Observe + (RFC7641). Editor note The git repository for the draft is found at https://github.com/core- wg/dynlink Status of This Memo This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79. @@ -29,94 +30,96 @@ Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet- Drafts is at https://datatracker.ietf.org/drafts/current/. Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress." - This Internet-Draft will expire on January 14, 2021. + This Internet-Draft will expire on July 16, 2021. Copyright Notice - Copyright (c) 2020 IETF Trust and the persons identified as the + Copyright (c) 2021 IETF Trust and the persons identified as the document authors. All rights reserved. This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License. Table of Contents 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 3 - 3. Conditional Notification Attributes . . . . . . . . . . . . . 4 + 3. Conditional Notification and Control Attributes . . . . . . . 4 3.1. Attribute Definitions . . . . . . . . . . . . . . . . . . 4 3.1.1. Minimum Period (pmin) . . . . . . . . . . . . . . . . 5 - 3.1.2. Maximum Period (pmax) . . . . . . . . . . . . . . . . 5 - 3.1.3. Change Step (st) . . . . . . . . . . . . . . . . . . 5 + 3.1.2. Maximum Period (pmax) . . . . . . . . . . . . . . . . 6 + 3.1.3. Change Step (st) . . . . . . . . . . . . . . . . . . 6 3.1.4. Greater Than (gt) . . . . . . . . . . . . . . . . . . 6 - 3.1.5. Less Than (lt) . . . . . . . . . . . . . . . . . . . 6 - 3.1.6. Notification Band (band) . . . . . . . . . . . . . . 6 - 3.2. Server processing of Conditional Notification Attributes 8 - 4. Link Bindings . . . . . . . . . . . . . . . . . . . . . . . . 8 - 4.1. The "bind" attribute and Binding Methods . . . . . . . . 9 - 4.1.1. Polling . . . . . . . . . . . . . . . . . . . . . . . 10 - 4.1.2. Observe . . . . . . . . . . . . . . . . . . . . . . . 10 - 4.1.3. Push . . . . . . . . . . . . . . . . . . . . . . . . 11 - 4.1.4. Execute . . . . . . . . . . . . . . . . . . . . . . . 11 - 4.2. Link Relation . . . . . . . . . . . . . . . . . . . . . . 11 - 5. Binding Table . . . . . . . . . . . . . . . . . . . . . . . . 12 - 6. Implementation Considerations . . . . . . . . . . . . . . . . 13 - 7. Security Considerations . . . . . . . . . . . . . . . . . . . 14 - 8. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 14 - 8.1. Resource Type value 'core.bnd' . . . . . . . . . . . . . 14 - 8.2. Link Relation Type . . . . . . . . . . . . . . . . . . . 14 - 9. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 15 - 10. Contributors . . . . . . . . . . . . . . . . . . . . . . . . 15 - 11. Changelog . . . . . . . . . . . . . . . . . . . . . . . . . . 16 - 12. References . . . . . . . . . . . . . . . . . . . . . . . . . 18 - 12.1. Normative References . . . . . . . . . . . . . . . . . . 18 - 12.2. Informative References . . . . . . . . . . . . . . . . . 18 - Appendix A. Examples . . . . . . . . . . . . . . . . . . . . . . 19 - A.1. Minimum Period (pmin) example . . . . . . . . . . . . . . 19 - A.2. Maximum Period (pmax) example . . . . . . . . . . . . . . 20 - A.3. Greater Than (gt) example . . . . . . . . . . . . . . . . 21 - A.4. Greater Than (gt) and Period Max (pmax) example . . . . . 22 - Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 23 + 3.1.5. Less Than (lt) . . . . . . . . . . . . . . . . . . . 7 + 3.1.6. Notification Band (band) . . . . . . . . . . . . . . 7 + 3.1.7. Minimum Evaluation Period (epmin) . . . . . . . . . . 8 + 3.1.8. Maximum Evaluation Period (epmax) . . . . . . . . . . 8 + 3.2. Server processing of Conditional Notification Attributes 9 + 4. Link Bindings . . . . . . . . . . . . . . . . . . . . . . . . 9 + 4.1. The "bind" attribute and Binding Methods . . . . . . . . 10 + 4.1.1. Polling . . . . . . . . . . . . . . . . . . . . . . . 11 + 4.1.2. Observe . . . . . . . . . . . . . . . . . . . . . . . 11 + 4.1.3. Push . . . . . . . . . . . . . . . . . . . . . . . . 12 + 4.1.4. Execute . . . . . . . . . . . . . . . . . . . . . . . 12 + 4.2. Link Relation . . . . . . . . . . . . . . . . . . . . . . 12 + 5. Binding Table . . . . . . . . . . . . . . . . . . . . . . . . 13 + 6. Implementation Considerations . . . . . . . . . . . . . . . . 14 + 7. Security Considerations . . . . . . . . . . . . . . . . . . . 15 + 8. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 15 + 8.1. Resource Type value 'core.bnd' . . . . . . . . . . . . . 15 + 8.2. Link Relation Type . . . . . . . . . . . . . . . . . . . 15 + 9. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 16 + 10. Contributors . . . . . . . . . . . . . . . . . . . . . . . . 16 + 11. Changelog . . . . . . . . . . . . . . . . . . . . . . . . . . 17 + 12. References . . . . . . . . . . . . . . . . . . . . . . . . . 20 + 12.1. Normative References . . . . . . . . . . . . . . . . . . 20 + 12.2. Informative References . . . . . . . . . . . . . . . . . 20 + Appendix A. Examples . . . . . . . . . . . . . . . . . . . . . . 20 + A.1. Minimum Period (pmin) example . . . . . . . . . . . . . . 21 + A.2. Maximum Period (pmax) example . . . . . . . . . . . . . . 21 + A.3. Greater Than (gt) example . . . . . . . . . . . . . . . . 22 + A.4. Greater Than (gt) and Period Max (pmax) example . . . . . 23 + Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 24 1. Introduction IETF Standards for machine to machine communication in constrained environments describe a REST protocol [RFC7252] and a set of related information standards that may be used to represent machine data and machine metadata in REST interfaces. CoRE Link-format [RFC6690] is a standard for doing Web Linking [RFC8288] in constrained environments. This specification introduces the concept of a Link Binding, which defines a new link relation type to create a dynamic link between resources over which state updates are conveyed. Specifically, a Link Binding is a unidirectional link for binding the states of source and destination resources together such that updates to one are sent over the link to the other. CoRE Link Format representations are used to configure, inspect, and maintain Link Bindings. This specification additionally defines Conditional - Notification Attributes for use with Link Bindings and with CoRE - Observe [RFC7641]. + Notification and Control Attributes for use with Link Bindings and + with CoRE Observe [RFC7641]. 2. Terminology The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here. This specification requires readers to be familiar with all the terms @@ -132,69 +135,90 @@ the resource values between a source and a destination. The process of using a REST method to achieve this is defined as "State Synchronization". The endpoint triggering the state synchronization is the synchronization initiator. Notification Band: A resource value range that results in state sychronization. The value range may be bounded by a minimum and maximum value or may be unbounded having either a minimum or maximum value. -3. Conditional Notification Attributes +3. Conditional Notification and Control Attributes 3.1. Attribute Definitions - This specification defines Conditional Notification Attributes, which - provide for fine-grained control of notification and state - synchronization when using CoRE Observe [RFC7641] or Link Bindings - (see Section 4). Conditional Notification Attributes define the - conditions that trigger a notification. + This specification defines Conditional Notification and Control + Attributes, which provide for fine-grained control of notification + and state synchronization when using CoRE Observe [RFC7641] or Link + Bindings (see Section 4). Conditional Notification Attributes define + the conditions that trigger a notification. Conditional Control + Attributes define the cadence of the measurement of the conditions + that trigger a notification. When resource interfaces following this specification are made available over CoAP, the CoAP Observation mechanism [RFC7641] MAY also be used to observe any changes in a resource, and receive asynchronous notifications as a result. A resource marked as Observable in its link description SHOULD support these Conditional - Notification Attributes. + Notification and Control Attributes. - The set of parameters defined here allow a client to control how - often a client is interested in receiving notifications and how much - a resource value should change for the new representation to be - interesting. + The set of Notification Attributes defined here allow a client to + control how often a client is interested in receiving notifications + and how much a resource value should change for the new + representation to be interesting. The set of Control Attributes + defined here allow a client to control how often the server performs + a measurement of the conditions. One or more Notification Attributes MAY be included as query parameters in an Observe request. - These attributes are defined below: + Conditional Notification Attributes are defined below: - +--------------------+-----------+-----------------+ + +-------------------+-----------+-----------------+ | Attribute | Parameter | Value | - +--------------------+-----------+-----------------+ - | Minimum Period (s) | pmin | xs:decimal (>0) | - | | | | - | Maximum Period (s) | pmax | xs:decimal (>0) | - | | | | - | Change Step | st | xs:decimal (>0) | - | | | | + +-------------------+-----------+-----------------+ | Greater Than | gt | xs:decimal | | | | | | Less Than | lt | xs:decimal | | | | | + | Change Step | st | xs:decimal (>0) | + | | | | | Notification Band | band | xs:boolean | - +--------------------+-----------+-----------------+ + +-------------------+-----------+-----------------+ Table 1: Conditional Notification Attributes + One or more Control Attributes MAY be included as query parameters in + an Observe request. + + Conditional Control Attributes are defined below: + + +-------------------------------+-----------+-----------------+ + | Attribute | Parameter | Value | + +-------------------------------+-----------+-----------------+ + | Minimum Period (s) | pmin | xs:decimal (>0) | + | | | | + | Maximum Period (s) | pmax | xs:decimal (>0) | + | | | | + | Minimum Evaluation Period (s) | epmin | xs:decimal (>0) | + | | | | + | Maximum Evaluation Period (s) | epmax | xs:decimal (>0) | + +-------------------------------+-----------+-----------------+ + + Table 2: Conditional Control Attributes + Conditional Notification Attributes SHOULD be evaluated on all potential notifications from a resource, whether resulting from an internal server-driven sampling process or from external update - requests to the server. + requests to the server. Conditional Control Attributes are used to + configure the internal server-driven sampling process for performing + measurements of the conditions of a resource. Note: In this draft, we assume that there are finite quantization effects in the internal or external updates to the value of a resource; specifically, that a resource may be updated at any time with any valid value. We therefore avoid any continuous-time assumptions in the description of the Conditional Notification Attributes and instead use the phrase "sampled value" to refer to a member of a sequence of values that may be internally observed from the resource state over time. @@ -214,23 +238,23 @@ notifications may be greater than pmin even when the sampled value changes within the pmin interval. Pmin may or may not be used to drive the internal sampling process. 3.1.2. Maximum Period (pmax) When present, the maximum period indicates the maximum time, in seconds, between two consecutive notifications (whether or not the resource value has changed). In the absence of this parameter, the maximum period is up to the server. The maximum period MUST be - greater than zero and MUST be greater than the minimum period - parameter (if present) otherwise the receiver MUST return a CoAP - error code 4.00 "Bad Request" (or equivalent). + greater than zero and MUST be greater than, or equal to, the minimum + period parameter (if present) otherwise the receiver MUST return a + CoAP error code 4.00 "Bad Request" (or equivalent). 3.1.3. Change Step (st) When present, the change step indicates how much the value of a resource SHOULD change before triggering a notification, compared to the value of the previous notification. Upon reception of a query including the st attribute, the most recently sampled value of the resource is reported, and then set as the last reported value (last_rep_v). When a subsequent sample or update of the resource value differs from the last reported value by an amount, positive or @@ -319,30 +343,58 @@ including equal to gt or lt. If the band is specified in which the value of gt is greater than that of lt, out-of-band notification occurs. That is, notification occurs when the resource value not between the gt and lt values, excluding equal to gt and lt. The Notification Band parameter can only be supported on resources with a scalar numeric value. +3.1.7. Minimum Evaluation Period (epmin) + + When present, the minimum evaluation period indicates the minimum + time, in seconds, the client recommends to the server to wait between + two consecutive measurements of the conditions of a resource since + the client has no interest in the server doing more frequent + measurements. When the minimum evaluation period expires after the + previous measurement, the server MAY immediately perform a new + measurement. In the absence of this parameter, the minimum + evaluation period is not defined and thus not used by the server. + The server MAY use pmin, if defined, as a guidance on the desired + measurement cadence. The minimum evaluation period MUST be greater + than zero otherwise the receiver MUST return a CoAP error code 4.00 + "Bad Request" (or equivalent). + +3.1.8. Maximum Evaluation Period (epmax) + + When present, the maximum evaluation period indicates the maximum + time, in seconds, the server MAY wait between two consecutive + measurements of the conditions of a resource. When the maximum + evaluation period expires after the previous measurement, the server + MUST immediately perform a new measurement. In the absence of this + parameter, the maximum evaluation period is not defined and thus not + used by the server. The maximum evaluation period MUST be greater + than zero and MUST be greater than the minimum evaluation period + parameter (if present) otherwise the receiver MUST return a CoAP + error code 4.00 "Bad Request" (or equivalent). + 3.2. Server processing of Conditional Notification Attributes - Pmin, pmax, st, gt, lt and band may be present in the same query. - Howver, they are not defined at multiple prioritization levels. The - server sends a notification whenever any of the parameter conditions - are met, upon which it updates its last notification value and time - to prepare for the next notification. Only one notification occurs - when there are multiple conditions being met at the same time. The - reference code below illustrates the logic to determine when a - notification is to be sent. + Pmin, pmax, epmin, epmax, st, gt, lt and band may be present in the + same query. However, they are not defined at multiple prioritization + levels. The server sends a notification whenever any of the + parameter conditions are met, upon which it updates its last + notification value and time to prepare for the next notification. + Only one notification occurs when there are multiple conditions being + met at the same time. The reference code below illustrates the logic + to determine when a notification is to be sent. bool notifiable( Resource * r ) { #define BAND r->band #define SCALAR_TYPE ( num_type == r->type ) #define STRING_TYPE ( str_type == r->type ) #define BOOLEAN_TYPE ( bool_type == r->type ) #define PMIN_EX ( r->last_sample_time - r->last_rep_time >= r->pmin ) #define PMAX_EX ( r->last_sample_time - r->last_rep_time > r->pmax ) #define LT_EX ( r->v < r->lt ^ r->last_rep_v < r->lt ) @@ -412,38 +464,38 @@ This specification defines a new CoRE link attribute "bind". This is the identifier for a binding method which defines the rules to synchronize the destination resource. This attribute is mandatory. +----------------+-----------+-----------+ | Attribute | Parameter | Value | +----------------+-----------+-----------+ | Binding method | bind | xs:string | +----------------+-----------+-----------+ - Table 2: The bind attribute + Table 3: The bind attribute The following table gives a summary of the binding methods defined in this specification. +---------+------------+-------------+---------------+ | Name | Identifier | Location | Method | +---------+------------+-------------+---------------+ | Polling | poll | Destination | GET | | | | | | | Observe | obs | Destination | GET + Observe | | | | | | | Push | push | Source | PUT | | | | | | | Execute | exec | Source | POST | +---------+------------+-------------+---------------+ - Table 3: Binding Method Summary + Table 4: Binding Method Summary The description of a binding method defines the following aspects: Identifier: This is the value of the "bind" attribute used to identify the method. Location: This information indicates whether the binding entry is stored on the source or on the destination endpoint. REST Method: This is the REST method used in the Request/Response @@ -531,21 +583,21 @@ The Methods column defines the REST methods supported by the Binding Table, which are described in more detail below. +---------------+----------+----------+----------------+ | Resource | rt= | Methods | Content-Format | +---------------+----------+----------+----------------+ | Binding Table | core.bnd | GET, PUT | link-format | +---------------+----------+----------+----------------+ - Table 4: Binding Table Description + Table 5: Binding Table Description The REST methods GET and PUT are used to manipulate a Binding Table. A GET request simply returns the current state of a Binding Table. A request with a PUT method and a content format of application/link- format is used to clear the bindings to the table or replaces its entire contents. All links in the payload of a PUT rquest MUST have a relation type "boundto". The following example shows requests for discovering, retrieving and replacing bindings in a binding table. @@ -585,32 +637,38 @@ resolution of the resource value when setting sequential bands. For example: Given BandA (Abmn=10, Bbmx=20) and BandB (Bbmn=21, Bbmx=30). If the resource value returns an integer then notifications for values between and inclusive of 10 and 30 will be triggered. Whereas if the resolution is to one decimal point (0.1) then notifications for values 20.1 to 20.9 will not be triggered. The use of the notification band minimum and maximum allow for a synchronization whenever a change in the resource value occurs. Theoretically this could occur in-line with the server internal - sample period for the determining the resource value. Implementors - SHOULD consider the resolution needed before updating the resource, - e.g. updating the resource when a temperature sensor value changes by - 0.001 degree versus 1 degree. + sample period or the configuration of epmin and epmax values for + determining the resource value. Implementors SHOULD consider the + resolution needed before updating the resource, e.g. updating the + resource when a temperature sensor value changes by 0.001 degree + versus 1 degree. The initiation of a Link Binding can be delegated from a client to a link state machine implementation, which can be an embedded client or a configuration tool. Implementation considerations have to be given to how to monitor transactions made by the configuration tool with regards to Link Bindings, as well as any errors that may arise with establishing Link Bindings in addition to established Link Bindings. + When a server has multiple observations with different measurement + cadences as defined by the epmin and epmax values, the server MAY + evaluate all observations when performing the measurement of any one + observation. + 7. Security Considerations Consideration has to be given to what kinds of security credentials the state machine of a configuration tool or an embedded client needs to be configured with, and what kinds of access control lists client implementations should possess, so that transactions on creating Link Bindings and handling error conditions can be processed by the state machine. 8. IANA Considerations @@ -657,24 +714,25 @@ Acknowledgement is given to colleagues from the SENSEI project who were critical in the initial development of the well-known REST interface concept, to members of the IPSO Alliance where further requirements for interface types have been discussed, and to Szymon Sasin, Cedric Chauvenet, Daniel Gavelle and Carsten Bormann who have provided useful discussion and input to the concepts in this specification. Christian Amsuss supplied a comprehensive review of draft -06. Hannes Tschofenig and Mert Ocak highlighted syntactical corrections in the usage of pmax and pmin in a query. Discussions with Ari Keraenen led to the addition of an extra binding method - supporting POST operations. + supporting POST operations. Alan Soloway contributed text leading to + the inclusion of epmin and epmax. David Navarro proposed allowing + for pmax to be equal to pmin. 10. Contributors - Christian Groves Australia email: cngroves.std@gmail.com Zach Shelby ARM Vuokatti FINLAND phone: +358 40 7796297 email: zach.shelby@arm.com @@ -687,20 +745,26 @@ eMail: matthieu.vial@schneider-electric.com Jintao Zhu Huawei Xi'an, Shaanxi Province China email: jintao.zhu@huawei.com 11. Changelog + draft-ietf-core-dynlink-12 + + o Attributes epmin and epmax included + + o pmax now can be equal to pmin + draft-ietf-core-dynlink-11 o Updates to author list draft-ietf-core-dynlink-10 o Binding methods now support both POST and PUT operations for server push. draft-ietf-core-dynlink-09 @@ -733,20 +797,23 @@ draft-ietf-core-dynlink-06 o Document restructure and refactoring into three main sections o Clarifications on band usage o Implementation considerations introduced o Additional text on security considerations + + draft-ietf-core-dynlink-05 + o Addition of a band modifier for gt and lt, adapted from draft- groves-core-obsattr o Removed statement prescribing gt MUST be greater than lt draft-ietf-core-dynlink-03 o General: Reverted to using "gt" and "lt" from "gth" and "lth" for this draft owing to concerns raised that the attributes are already used in LwM2M with the original names "gt" and "lt".