idnits 2.17.1 draft-ietf-core-conditional-attributes-04.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (May 10, 2022) is 688 days in the past. Is this intentional? -- Found something which looks like a code comment -- if you have code sections in the document, please surround them with '' and '' lines. Checking references for intended status: Informational ---------------------------------------------------------------------------- No issues found here. Summary: 0 errors (**), 0 flaws (~~), 1 warning (==), 2 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 CoRE Working Group M. Koster 3 Internet-Draft Dogtiger Labs 4 Intended status: Informational A. Soloway 5 Expires: November 11, 2022 Qualcomm Technologies, Inc. 6 B. Silverajan, Ed. 7 Tampere University 8 May 10, 2022 10 Conditional Attributes for Constrained RESTful Environments 11 draft-ietf-core-conditional-attributes-04 13 Abstract 15 This specification defines Conditional Notification and Control 16 Attributes that work with CoAP Observe (RFC7641). 18 Editor note 20 The git repository for the draft is found at https://github.com/core- 21 wg/conditional-attributes/ 23 Status of This Memo 25 This Internet-Draft is submitted in full conformance with the 26 provisions of BCP 78 and BCP 79. 28 Internet-Drafts are working documents of the Internet Engineering 29 Task Force (IETF). Note that other groups may also distribute 30 working documents as Internet-Drafts. The list of current Internet- 31 Drafts is at https://datatracker.ietf.org/drafts/current/. 33 Internet-Drafts are draft documents valid for a maximum of six months 34 and may be updated, replaced, or obsoleted by other documents at any 35 time. It is inappropriate to use Internet-Drafts as reference 36 material or to cite them other than as "work in progress." 38 This Internet-Draft will expire on November 11, 2022. 40 Copyright Notice 42 Copyright (c) 2022 IETF Trust and the persons identified as the 43 document authors. All rights reserved. 45 This document is subject to BCP 78 and the IETF Trust's Legal 46 Provisions Relating to IETF Documents 47 (https://trustee.ietf.org/license-info) in effect on the date of 48 publication of this document. Please review these documents 49 carefully, as they describe your rights and restrictions with respect 50 to this document. Code Components extracted from this document must 51 include Simplified BSD License text as described in Section 4.e of 52 the Trust Legal Provisions and are provided without warranty as 53 described in the Simplified BSD License. 55 Table of Contents 57 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 58 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 3 59 3. Conditional Attributes . . . . . . . . . . . . . . . . . . . 3 60 3.1. Conditional Notification Attributes . . . . . . . . . . . 3 61 3.1.1. Greater Than (c.gt) . . . . . . . . . . . . . . . . . 4 62 3.1.2. Less Than (c.lt) . . . . . . . . . . . . . . . . . . 4 63 3.1.3. Change Step (c.st) . . . . . . . . . . . . . . . . . 5 64 3.1.4. Notification band (c.band) . . . . . . . . . . . . . 5 65 3.1.5. Edge (c.edge) . . . . . . . . . . . . . . . . . . . . 6 66 3.2. Conditional Control Attributes . . . . . . . . . . . . . 7 67 3.2.1. Minimum Period (c.pmin) . . . . . . . . . . . . . . . 7 68 3.2.2. Maximum Period (c.pmax) . . . . . . . . . . . . . . . 8 69 3.2.3. Minimum Evaluation Period (c.epmin) . . . . . . . . . 8 70 3.2.4. Maximum Evaluation Period (c.epmax) . . . . . . . . . 8 71 3.2.5. Confirmable Notification (c.con) . . . . . . . . . . 8 72 3.3. Server processing of Conditional Attributes . . . . . . . 9 73 4. Implementation Considerations . . . . . . . . . . . . . . . . 10 74 5. Security Considerations . . . . . . . . . . . . . . . . . . . 10 75 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 10 76 7. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 11 77 8. Contributors . . . . . . . . . . . . . . . . . . . . . . . . 11 78 9. Changelog . . . . . . . . . . . . . . . . . . . . . . . . . . 12 79 10. References . . . . . . . . . . . . . . . . . . . . . . . . . 13 80 10.1. Normative References . . . . . . . . . . . . . . . . . . 13 81 10.2. Informative References . . . . . . . . . . . . . . . . . 13 82 Appendix A. Examples . . . . . . . . . . . . . . . . . . . . . . 13 83 A.1. Minimum Period (c.pmin) example . . . . . . . . . . . . . 13 84 A.2. Maximum Period (c.pmax) example . . . . . . . . . . . . . 14 85 A.3. Greater Than (c.gt) example . . . . . . . . . . . . . . . 15 86 A.4. Greater Than (c.gt) and Period Max (c.pmax) example . . . 16 87 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 18 89 1. Introduction 91 IETF Standards for machine to machine communication in constrained 92 environments describe a REST protocol [RFC7252] and a set of related 93 information standards that may be used to represent machine data and 94 machine metadata in REST interfaces. 96 This specification defines Conditional Notification and Control 97 Attributes for use with CoRE Observe [RFC7641]. 99 2. Terminology 101 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 102 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 103 "OPTIONAL" in this document are to be interpreted as described in 104 BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all 105 capitals, as shown here. 107 This specification requires readers to be familiar with all the terms 108 and concepts that are discussed in [RFC7641]. This specification 109 makes use of the following additional terminology: 111 Notification Band: A resource value range that may be bounded by a 112 minimum and maximum value or may be unbounded having either a 113 minimum or maximum value. 115 3. Conditional Attributes 117 This specification defines conditional attributes for use with CoRE 118 Observe [RFC7641]. Conditional attributes provide fine-grained 119 control of notification and synchronization of resource states. When 120 observing a resource, a CoAP client conveys conditional attributes as 121 metadata using the query component of a CoAP URI. A conditional 122 attribute can be represented as a "name=value" query parameter or 123 simply a "name" without a value. Multiple conditional attributes in 124 a query component are separated with an ampersand "&". A resource 125 marked as Observable in its link description SHOULD support these 126 conditional attributes. 128 Note: In this draft, we assume that there are finite quantization 129 effects in the internal or external updates to the value representing 130 the state of a resource; specifically, that a resource state may be 131 updated at any time with any valid value. We therefore avoid any 132 continuous-time assumptions in the description of the conditional 133 attributes and instead use the phrase "sampled value" to refer to a 134 member of a sequence of values that may be internally observed from 135 the resource state over time. 137 3.1. Conditional Notification Attributes 139 Conditional Notification Attributes define the conditions that 140 trigger a notification. Conditional Notification Attributes SHOULD 141 be evaluated on all potential notifications from a resource, whether 142 resulting from an internal server-driven sampling process or from 143 external update requests to the server. 145 The set of Conditional Notification Attributes defined here allow a 146 client to control how often a client is interested in receiving 147 notifications and how much a value should change for the new 148 representation state to be interesting. One or more Conditional 149 Notification Attributes MAY be included in an Observe request. 151 Conditional Notification Attributes are defined below: 153 +-------------------+--------+-----------------+ 154 | Attribute | Name | Value | 155 +-------------------+--------+-----------------+ 156 | Greater Than | c.gt | xs:decimal | 157 | | | | 158 | Less Than | c.lt | xs:decimal | 159 | | | | 160 | Change Step | c.st | xs:decimal (>0) | 161 | | | | 162 | Notification Band | c.band | (none) | 163 | | | | 164 | Edge | c.edge | xs:boolean | 165 +-------------------+--------+-----------------+ 167 Table 1: Conditional Notification Attributes 169 3.1.1. Greater Than (c.gt) 171 When present, Greater Than indicates the upper limit value the 172 sampled value SHOULD cross before triggering a notification. A 173 notification is sent whenever the sampled value crosses the specified 174 upper limit value, relative to the last reported value, and the time 175 for "c.pmin" has elapsed since the last notification. The sampled 176 value is sent in the notification. If the value continues to rise, 177 no notifications are generated as a result of "c.gt". If the value 178 drops below the upper limit value then a notification is sent, 179 subject again to the "c.pmin" time. 181 The Greater Than parameter can only be supported on resources with a 182 scalar numeric value. 184 3.1.2. Less Than (c.lt) 186 When present, Less Than indicates the lower limit value the resource 187 value SHOULD cross before triggering a notification. A notification 188 is sent when the samples value crosses the specified lower limit 189 value, relative to the last reported value, and the time for "c.pmin" 190 has elapsed since the last notification. The sampled value is sent 191 in the notification. If the value continues to fall no notifications 192 are generated as a result of "c.lt". If the value rises above the 193 lower limit value then a new notification is sent, subject to the 194 "c.pmin" time. 196 The Less Than parameter can only be supported on resources with a 197 scalar numeric value. 199 3.1.3. Change Step (c.st) 201 When present, the change step indicates how much the value 202 representing a resource state SHOULD change before triggering a 203 notification, compared to the old state. Upon reception of a query 204 including the "c.st" attribute, the current resource state 205 representing the most recently sampled value is reported, and then 206 set as the last reported value (last_rep_v). When a subsequent 207 sampled value or update of the resource state differs from the last 208 reported state by an amount, positive or negative, greater than or 209 equal to st, and the time for "c.pmin" has elapsed since the last 210 notification, a notification is sent and the last reported value is 211 updated to the new resource state sent in the notification. The 212 change step MUST be greater than zero otherwise the receiver MUST 213 return a CoAP error code 4.00 "Bad Request" (or equivalent). 215 The Change Step parameter can only be supported on resource states 216 represented with a scalar numeric value. 218 Note: Due to sampling and other constraints, e.g. "c.pmin", the 219 change in resource states received in two sequential notifications 220 may differ by more than "c.st". 222 3.1.4. Notification band (c.band) 224 The notification band attribute allows a bounded or unbounded (based 225 on a minimum or maximum) value range that may trigger multiple 226 notifications. This enables use cases where different ranges results 227 in differing behaviour. For example, in monitoring the temperature 228 of machinery, whilst the temperature is in the normal operating 229 range, only periodic updates are needed. However as the temperature 230 moves to more abnormal ranges more frequent state updates may be sent 231 to clients. 233 Without a notification band, a transition across a less than (c.lt), 234 or greater than (c.gt) limit only generates one notification. This 235 means that it is not possible to describe a case where multiple 236 notifications are sent so long as the limit is exceeded. 238 The "c.band" attribute works as a modifier to the behaviour of "c.gt" 239 and "c.lt". Its use is determined only by its presence, and not its 240 value. Therefore, if "c.band" is present in a query, "c.gt", "c.lt" 241 or both, MUST be included. 243 When "c.band" is present with the "c.lt" attribute, it defines the 244 lower bound for the notification band (notification band minimum). 245 Notifications occur when the resource value is equal to or above the 246 notification band minimum. If "c.lt" is not present there is no 247 minimum value for the band. 249 When "c.band" is present with the "c.gt" attribute, it defines the 250 upper bound for the notification band (notification band maximum). 251 Notifications occur when the resource value is equal to or below the 252 notification band maximum. If "c.gt" is not present there is no 253 maximum value for the band. 255 If "c.band" is present with both the "c.gt" and "c.lt" attributes, 256 notification occurs when the resource value is greater than or equal 257 to "c.gt" or when the resource value is less than or equal to "c.lt". 259 If "c.band" is specified in which the value of "c.gt" is less than 260 that of "c.lt", in-band notification occurs. That is, notification 261 occurs whenever the resource value is between the "c.gt" and "c.lt" 262 values, including equal to "c.gt" or "c.lt". 264 If "c.band" is specified in which the value of "c.gt" is greater than 265 that of "c.lt", out-of-band notification occurs. That is, 266 notification occurs when the resource value not between the "c.gt" 267 and "c.lt" values, excluding equal to "c.gt" and "c.lt". 269 The Notification Band parameter can only be supported on resources 270 with a scalar numeric value. 272 3.1.5. Edge (c.edge) 274 When present, the "c.edge" attribute indicates interest for receiving 275 notifications of either the falling edge or the rising edge 276 transition of a boolean resource state. When the value of the 277 "c.edge" attribute is 0 (False), the server notifies the client each 278 time a resource state changes from True to False. When the value of 279 the "c.edge" attribute is 1 (True), the server notifies the client 280 each time a resource state changes from False to True. 282 The "c.edge" attribute can only be supported on resources with a 283 boolean value. 285 3.2. Conditional Control Attributes 287 Conditional Control Attributes define the time intervals between 288 consecutive notifications as well as the cadence of the measurement 289 of the conditions that trigger a notification. Conditional Control 290 Attributes can be used to configure the internal server-driven 291 sampling process for performing measurements of the conditions of a 292 resource. One or more Conditional Control Attributes MAY be included 293 in an Observe request. 295 Conditional Control Attributes are defined below: 297 +-------------------------------+---------+-----------------+ 298 | Attribute | Name | Value | 299 +-------------------------------+---------+-----------------+ 300 | Minimum Period (s) | c.pmin | xs:decimal (>0) | 301 | | | | 302 | Maximum Period (s) | c.pmax | xs:decimal (>0) | 303 | | | | 304 | Minimum Evaluation Period (s) | c.epmin | xs:decimal (>0) | 305 | | | | 306 | Maximum Evaluation Period (s) | c.epmax | xs:decimal (>0) | 307 | | | | 308 | Confirmable Notification | c.con | xs:boolean | 309 +-------------------------------+---------+-----------------+ 311 Table 2: Conditional Control Attributes 313 3.2.1. Minimum Period (c.pmin) 315 When present, the minimum period indicates the minimum time, in 316 seconds, between two consecutive notifications (whether or not the 317 resource state has changed). In the absence of this parameter, the 318 minimum period is up to the server. The minimum period MUST be 319 greater than zero otherwise the receiver MUST return a CoAP error 320 code 4.00 "Bad Request" (or equivalent). 322 A server MAY update the resource state with the last sampled value 323 that occured during the "c.pmin" interval, after the "c.pmin" 324 interval expires. 326 Note: Due to finite quantization effects, the time between 327 notifications may be greater than "c.pmin" even when the sampled 328 value changes within the "c.pmin" interval. "c.pmin" may or may not 329 be used to drive the internal sampling process. 331 3.2.2. Maximum Period (c.pmax) 333 When present, the maximum period indicates the maximum time, in 334 seconds, between two consecutive notifications (whether or not the 335 resource state has changed). In the absence of this parameter, the 336 maximum period is up to the server. The maximum period MUST be 337 greater than zero and MUST be greater than, or equal to, the minimum 338 period parameter (if present) otherwise the receiver MUST return a 339 CoAP error code 4.00 "Bad Request" (or equivalent). 341 3.2.3. Minimum Evaluation Period (c.epmin) 343 When present, the minimum evaluation period indicates the minimum 344 time, in seconds, the client recommends to the server to wait between 345 two consecutive measurements of the conditions of a resource since 346 the client has no interest in the server doing more frequent 347 measurements. When the minimum evaluation period expires after the 348 previous measurement, the server MAY immediately perform a new 349 measurement. In the absence of this parameter, the minimum 350 evaluation period is not defined and thus not used by the server. 351 The server MAY use "c.pmin", if defined, as a guidance on the desired 352 measurement cadence. The minimum evaluation period MUST be greater 353 than zero otherwise the receiver MUST return a CoAP error code 4.00 354 "Bad Request" (or equivalent). 356 3.2.4. Maximum Evaluation Period (c.epmax) 358 When present, the maximum evaluation period indicates the maximum 359 time, in seconds, the server MAY wait between two consecutive 360 measurements of the conditions of a resource. When the maximum 361 evaluation period expires after the previous measurement, the server 362 MUST immediately perform a new measurement. In the absence of this 363 parameter, the maximum evaluation period is not defined and thus not 364 used by the server. The maximum evaluation period MUST be greater 365 than zero and MUST be greater than the minimum evaluation period 366 parameter (if present) otherwise the receiver MUST return a CoAP 367 error code 4.00 "Bad Request" (or equivalent). 369 3.2.5. Confirmable Notification (c.con) 371 When present with a value of 1 (True) in a query, the "c.con" 372 attribute indicates a notification MUST be confirmable, i.e., the 373 server MUST send the notification in a confirmable CoAP message, to 374 request an acknowledgement from the client. When present with a 375 value of 0 (False) in a query, the "c.con" attribute indicates a 376 notification can be confirmable or non-confirmable, i.e., it can be 377 sent in a confirmable or a non-confirmable CoAP message. 379 3.3. Server processing of Conditional Attributes 381 Conditional Notification Attributes and Conditional Control 382 Attributes may be present in the same query. However, they are not 383 defined at multiple prioritization levels. The server sends a 384 notification whenever any of the parameter conditions are met, upon 385 which it updates its last notification value and time to prepare for 386 the next notification. Only one notification occurs when there are 387 multiple conditions being met at the same time. The reference code 388 below illustrates the logic to determine when a notification is to be 389 sent. 391 bool notifiable( Resource * r ) { 393 #define EDGE EXISTS(r->edge) 394 #define BAND EXISTS(r->band) 395 #define SCALAR_TYPE ( num_type == r->type ) 396 #define STRING_TYPE ( str_type == r->type ) 397 #define BOOLEAN_TYPE ( bool_type == r->type ) 398 #define PMIN_EX ( r->last_sample_time - r->last_rep_time >= r->pmin ) 399 #define PMAX_EX ( r->last_sample_time - r->last_rep_time > r->pmax ) 400 #define LT_EX ( r->v < r->lt ^ r->last_rep_v < r->lt ) 401 #define GT_EX ( r->v > r->gt ^ r->last_rep_v > r->gt ) 402 #define ST_EX ( abs( r->v - r->last_rep_v ) >= r->st ) 403 #define IN_BAND ( ( r->gt <= r->v && r->v <= r->lt ) || \ 404 ( r->lt <= r->gt && r->gt <= r->v ) || \ 405 ( r->v <= r->lt && r->lt <= r->gt ) ) 406 #define VB_CHANGE ( r->vb != r->last_rep_vb ) 407 #define VB_EDGE ( r->vb && r->edge || !r->vb && !r->edge ) 408 #define VS_CHANGE ( r->vs != r->last_rep_vs ) 410 return ( 411 PMIN_EX && 412 ( SCALAR_TYPE ? 413 ( ( !BAND && ( GT_EX || LT_EX || ST_EX || PMAX_EX ) ) || 414 ( BAND && IN_BAND && ( ST_EX || PMAX_EX) ) ) 415 : STRING_TYPE ? 416 ( VS_CHANGE || PMAX_EX ) 417 : BOOLEAN_TYPE ? 418 ( ( !EDGE && VB_CHANGE ) || 419 ( EDGE && VB_CHANGE && VB_EDGE ) || 420 PMAX_EX ) 421 : false ) 422 ); 423 } 425 4. Implementation Considerations 427 When "c.pmax" and "c.pmin" are equal, the expected behaviour is that 428 notifications will be sent every (c.pmin == c.pmax) seconds. 429 However, these notifications can only be fulfilled by the server on a 430 best effort basis. Because "c.pmin" and "c.pmax" are designed as 431 acceptable tolerance bounds for sending state updates, a query from 432 an interested client containing equal "c.pmin" and "c.pmax" values 433 must not be seen as a hard real-time scheduling contract between the 434 client and the server. 436 The use of the notification band minimum and maximum allow for a 437 synchronization whenever a change in the resource value occurs. 438 Theoretically this could occur in-line with the server internal 439 sample period or the configuration of "c.epmin" and "c.epmax" values 440 for determining the resource value. Implementors SHOULD consider the 441 resolution needed before updating the resource, e.g. updating the 442 resource when a temperature sensor value changes by 0.001 degree 443 versus 1 degree. 445 When a server has multiple observations with different measurement 446 cadences as defined by the "c.epmin" and "c.epmax" values, the server 447 MAY evaluate all observations when performing the measurement of any 448 one observation. 450 This specification defines conditional attributes that can be used 451 with CoRE Observe relationships between CoAP clients and CoAP 452 servers. However, it is recognised that the presence of 1 or more 453 proxies between a client and a server can interfere with clients 454 receiving resource updates, if a proxy does not supply resource 455 representations when the value remains unchanged (eg if "c.pmax" is 456 set, and the server sends multiple updates when the resource state 457 contains the same value). A server SHOULD use the Max-Age option to 458 mitigate this by setting Max-Age to be less than or equal to 459 "c.pmax". 461 5. Security Considerations 463 The security considerations in Section 11 of [RFC7252] apply. 464 Additionally, the security considerations in Section 7 of [RFC7641] 465 also apply. 467 6. IANA Considerations 469 This memo requests a new Conditional Attributes registry to ensure 470 attributes map uniquely to parameter names. 472 +---------------------------+-----------+---------------+-----------+ 473 | Attribute | Parameter | Value | Reference | 474 +---------------------------+-----------+---------------+-----------+ 475 | Minimum Period (s) | c.pmin | xs:decimal | This memo | 476 | | | (>0) | | 477 | | | | | 478 | Maximum Period (s) | c.pmax | xs:decimal | This memo | 479 | | | (>0) | | 480 | | | | | 481 | Minimum Evaluation Period | c.epmin | xs:decimal | This memo | 482 | (s) | | (>0) | | 483 | | | | | 484 | Maximum Evaluation Period | c.epmax | xs:decimal | This memo | 485 | (s) | | (>0) | | 486 | | | | | 487 | Confirmable Notification | c.con | xs:boolean | This memo | 488 | | | | | 489 | Greater Than | c.gt | xs:decimal | This memo | 490 | | | | | 491 | Less Than | c.lt | xs:decimal | This memo | 492 | | | | | 493 | Change Step | c.st | xs:decimal | This memo | 494 | | | (>0) | | 495 | | | | | 496 | Notification Band | c.band | (none) | This memo | 497 | | | | | 498 | Edge | c.edge | xs:boolean | This memo | 499 +---------------------------+-----------+---------------+-----------+ 501 7. Acknowledgements 503 Hannes Tschofenig and Mert Ocak highlighted syntactical corrections 504 in the usage of pmax and pmin in a query. David Navarro proposed 505 allowing for pmax to be equal to pmin. 507 8. Contributors 508 Christian Groves 509 Australia 510 email: cngroves.std@gmail.com 512 Zach Shelby 513 ARM 514 Vuokatti 515 FINLAND 516 phone: +358 40 7796297 517 email: zach.shelby@arm.com 519 Matthieu Vial 520 Schneider-Electric 521 Grenoble 522 France 523 phone: +33 (0)47657 6522 524 eMail: matthieu.vial@schneider-electric.com 526 Jintao Zhu 527 Huawei 528 Xi'an, Shaanxi Province 529 China 530 email: jintao.zhu@huawei.com 532 9. Changelog 534 draft-ietf-core-conditional-attributes-04 536 o Reference code updated to include behaviour for edge attribute. 538 draft-ietf-core-conditional-attributes-03 540 o Attribute names updated to create uniqueness for use as 541 conditional observe attributes. 543 draft-ietf-core-conditional-attributes-02 545 o Clarifications on usage and value of the band parameter 547 o Implementation considerations for proxies added 549 o Security considerations added 551 o IANA considerations added 553 draft-ietf-core-conditional-attributes-01 554 o Clarifications on True and False values for Edge and Con 555 Attributes 557 o Alan Soloway added as author 559 draft-ietf-core-conditional-attributes-00 561 o Conditional Atttributes section from draft-ietf-core-dynlink-13 562 separated into own WG draft 564 10. References 566 10.1. Normative References 568 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 569 Requirement Levels", BCP 14, RFC 2119, 570 DOI 10.17487/RFC2119, March 1997, 571 . 573 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 574 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 575 May 2017, . 577 10.2. Informative References 579 [RFC7252] Shelby, Z., Hartke, K., and C. Bormann, "The Constrained 580 Application Protocol (CoAP)", RFC 7252, 581 DOI 10.17487/RFC7252, June 2014, 582 . 584 [RFC7641] Hartke, K., "Observing Resources in the Constrained 585 Application Protocol (CoAP)", RFC 7641, 586 DOI 10.17487/RFC7641, September 2015, 587 . 589 Appendix A. Examples 591 This appendix provides some examples of the use of binding attribute 592 / observe attributes. 594 Note: For brevity the only the method or response code is shown in 595 the header field. 597 A.1. Minimum Period (c.pmin) example 598 Observed CLIENT SERVER Actual 599 t State | | State 600 ____________ | | ____________ 601 1 | | 602 2 unknown | | 18.5 Cel 603 3 +----->| Header: GET 604 4 | GET | Token: 0x4a 605 5 | | Uri-Path: temperature 606 6 | | Uri-Query: c.pmin="10" 607 7 | | Observe: 0 (register) 608 8 | | 609 9 ____________ |<-----+ Header: 2.05 610 10 | 2.05 | Token: 0x4a 611 11 18.5 Cel | | Observe: 9 612 12 | | Payload: "18.5 Cel" 613 13 | | ____________ 614 14 | | 615 15 | | 23 Cel 616 16 | | 617 17 | | 618 18 | | 619 19 | | ____________ 620 20 ____________ |<-----+ Header: 2.05 621 21 | 2.05 | 26 Cel Token: 0x4a 622 22 26 Cel | | Observe: 20 623 23 | | Payload: "26 Cel" 624 24 | | 625 25 | | 627 Figure 1: Client registers and receives one notification of the 628 current state and one of a new state state when c.pmin time expires. 630 A.2. Maximum Period (c.pmax) example 632 Observed CLIENT SERVER Actual 633 t State | | State 634 ____________ | | ____________ 635 1 | | 636 2 unknown | | 18.5 Cel 637 3 +----->| Header: GET 638 4 | GET | Token: 0x4a 639 5 | | Uri-Path: temperature 640 6 | | Uri-Query: c.pmax="20" 641 7 | | Observe: 0 (register) 642 8 | | 643 9 ____________ |<-----+ Header: 2.05 644 10 | 2.05 | Token: 0x4a 645 11 18.5 Cel | | Observe: 9 646 12 | | Payload: "18.5 Cel" 647 13 | | 648 14 | | 649 15 | | ____________ 650 16 ____________ |<-----+ Header: 2.05 651 17 | 2.05 | 23 Cel Token: 0x4a 652 18 23 Cel | | Observe: 16 653 19 | | Payload: "23 Cel" 654 20 | | 655 21 | | 656 22 | | 657 23 | | 658 24 | | 659 25 | | 660 26 | | 661 27 | | 662 28 | | 663 29 | | 664 30 | | 665 31 | | 666 32 | | 667 33 | | 668 34 | | 669 35 | | 670 36 | | ____________ 671 37 ____________ |<-----+ Header: 2.05 672 38 | 2.05 | 23 Cel Token: 0x4a 673 39 23 Cel | | Observe: 37 674 40 | | Payload: "23 Cel" 675 41 | | 676 42 | | 678 Figure 2: Client registers and receives one notification of the 679 current state, one of a new state and one of an unchanged state when 680 "c.pmax 682 A.3. Greater Than (c.gt) example 683 Observed CLIENT SERVER Actual 684 t State | | State 685 ____________ | | ____________ 686 1 | | 687 2 unknown | | 18.5 Cel 688 3 +----->| Header: GET 689 4 | GET | Token: 0x4a 690 5 | | Uri-Path: temperature 691 6 | | Uri-Query: c.gt=25 692 7 | | Observe: 0 (register) 693 8 | | 694 9 ____________ |<-----+ Header: 2.05 695 10 | 2.05 | Token: 0x4a 696 11 18.5 Cel | | Observe: 9 697 12 | | Payload: "18.5 Cel" 698 13 | | 699 14 | | 700 15 | | ____________ 701 16 ____________ |<-----+ Header: 2.05 702 17 | 2.05 | 26 Cel Token: 0x4a 703 18 26 Cel | | Observe: 16 704 29 | | Payload: "26 Cel" 705 20 | | 706 21 | | 708 Figure 3: Client registers and receives one notification of the 709 current state and one of a new state when it passes through the 710 greater than threshold of 25. 712 A.4. Greater Than (c.gt) and Period Max (c.pmax) example 713 Observed CLIENT SERVER Actual 714 t State | | State 715 ____________ | | ____________ 716 1 | | 717 2 unknown | | 18.5 Cel 718 3 +----->| Header: GET 719 4 | GET | Token: 0x4a 720 5 | | Uri-Path: temperature 721 6 | | Uri-Query: c.pmax=20;c.gt=25 722 7 | | Observe: 0 (register) 723 8 | | 724 9 ____________ |<-----+ Header: 2.05 725 10 | 2.05 | Token: 0x4a 726 11 18.5 Cel | | Observe: 9 727 12 | | Payload: "18.5 Cel" 728 13 | | 729 14 | | 730 15 | | 731 16 | | 732 17 | | 733 18 | | 734 19 | | 735 20 | | 736 21 | | 737 22 | | 738 23 | | 739 24 | | 740 25 | | 741 26 | | 742 27 | | 743 28 | | 744 29 | | ____________ 745 30 ____________ |<-----+ Header: 2.05 746 31 | 2.05 | 23 Cel Token: 0x4a 747 32 23 Cel | | Observe: 30 748 33 | | Payload: "23 Cel" 749 34 | | 750 35 | | 751 36 | | ____________ 752 37 ____________ |<-----+ Header: 2.05 753 38 | 2.05 | 26 Cel Token: 0x4a 754 39 26 Cel | | Observe: 37 755 40 | | Payload: "26 Cel" 756 41 | | 757 42 | | 759 Figure 4: Client registers and receives one notification of the 760 current state, one when "c.pmax 762 Authors' Addresses 764 Michael Koster 765 Dogtiger Labs 766 524 H Street 767 Antioch, CA 94509 768 USA 770 Email: michaeljohnkoster@gmail.com 772 Alan Soloway 773 Qualcomm Technologies, Inc. 774 5775 Morehouse Drive 775 San Diego 92121 776 USA 778 Email: asoloway@qti.qualcomm.com 780 Bilhanan Silverajan (editor) 781 Tampere University 782 Kalevantie 4 783 Tampere FI-33100 784 Finland 786 Email: bilhanan.silverajan@tuni.fi