idnits 2.17.1 draft-groves-core-senml-bto-01.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 : ---------------------------------------------------------------------------- ** The abstract seems to contain references ([I-D.ietf-core-senml]), which it shouldn't. Please replace those with straight textual mentions of the documents in question. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (April 19, 2017) is 2564 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) == Outdated reference: A later version (-16) exists of draft-ietf-core-senml-05 Summary: 1 error (**), 0 flaws (~~), 2 warnings (==), 1 comment (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 CoRE Working Group C. Groves 3 Internet-Draft 4 Intended status: Standards Track W. Yang 5 Expires: October 21, 2017 Huawei 6 April 19, 2017 8 SenML Base Time Offset Attribute 9 draft-groves-core-senml-bto-01 11 Abstract 13 SenML [I-D.ietf-core-senml] defines a base time attribute and time 14 value which is used to determine the time when a value is recorded. 15 In some applications a SenML pack will contain a series of records 16 related to a constant sample time interval, e.g. once every 60 17 seconds. This means that the time attribute will be required for 18 each record. This document defines a new "time offset" base 19 attribute that allows a sender to include the time for the sample 20 interval between records. If the "time offset" base attribute is 21 used the sender will not send the time attribute for each record, 22 minimising message and storage size. 24 Status of This Memo 26 This Internet-Draft is submitted in full conformance with the 27 provisions of BCP 78 and BCP 79. 29 Internet-Drafts are working documents of the Internet Engineering 30 Task Force (IETF). Note that other groups may also distribute 31 working documents as Internet-Drafts. The list of current Internet- 32 Drafts is at http://datatracker.ietf.org/drafts/current/. 34 Internet-Drafts are draft documents valid for a maximum of six months 35 and may be updated, replaced, or obsoleted by other documents at any 36 time. It is inappropriate to use Internet-Drafts as reference 37 material or to cite them other than as "work in progress." 39 This Internet-Draft will expire on October 21, 2017. 41 Copyright Notice 43 Copyright (c) 2017 IETF Trust and the persons identified as the 44 document authors. All rights reserved. 46 This document is subject to BCP 78 and the IETF Trust's Legal 47 Provisions Relating to IETF Documents 48 (http://trustee.ietf.org/license-info) in effect on the date of 49 publication of this document. Please review these documents 50 carefully, as they describe your rights and restrictions with respect 51 to this document. Code Components extracted from this document must 52 include Simplified BSD License text as described in Section 4.e of 53 the Trust Legal Provisions and are provided without warranty as 54 described in the Simplified BSD License. 56 Table of Contents 58 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 59 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 4 60 3. SenML Structure and Semantics . . . . . . . . . . . . . . . . 4 61 3.1. Base Attributes . . . . . . . . . . . . . . . . . . . . . 4 62 3.2. Regular Attributes . . . . . . . . . . . . . . . . . . . 4 63 3.3. Considerations . . . . . . . . . . . . . . . . . . . . . 4 64 4. JSON Representation (application/senml+json) . . . . . . . . 5 65 5. CBOR Representation (application/senml+cbor) . . . . . . . . 5 66 6. XML representation (application/senml+xml) . . . . . . . . . 5 67 7. EXI Representation (application/senml-exi) . . . . . . . . . 6 68 8. Security Considerations . . . . . . . . . . . . . . . . . . . 7 69 9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 7 70 10. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 8 71 11. Changelog . . . . . . . . . . . . . . . . . . . . . . . . . . 8 72 12. Normative References . . . . . . . . . . . . . . . . . . . . 8 73 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 8 75 1. Introduction 77 SenML currently defines the base time "bt" and time "t" attributes to 78 indicate the time that each value in a SenML record is recorded. 79 This means that for each record (value "v") that a "t" attribute is 80 required. The example from section 5.1.2/[I-D.ietf-core-senml] is 81 copied below to illustrate a SenML pack with multiple records. 83 [ {"bn": "urn:dev:ow:10e2073a01080063", 84 "bt": 1320067464, 85 "bu": "%RH", 86 "v": 21.2, "t": 0 }, 87 { "v": 21.3, "t": 10 }, 88 { "v": 21.4, "t": 20 }, 89 { "v": 21.4, "t": 30 }, 90 { "v": 21.5, "t": 40 }, 91 { "v": 21.5, "t": 50 }, 92 { "v": 21.5, "t": 60 }, 93 { "v": 21.6, "t": 70 }, 94 { "v": 21.7, "t": 80 }, 95 { "v": 21.5, "t": 90 }, 96 ... 98 Figure 1: SenML pack with multiple records 100 As can be seen in the example above there is a fixed offset between 101 the data points of 10 seconds. 103 This document proposes a base time offset "bto" attribute that is 104 used to indicate the offset between datapoints when a fixed offset is 105 used. This negates the need to include the "t" attribute for each 106 data point. The example below takes the above example and applies 107 the base time offset to it. 109 [ {"bn": "urn:dev:ow:10e2073a01080063", 110 "bt": 1320067464, 111 "bto": 10, 112 "bu": "%RH", 113 "v": 21.2}, 114 { "v": 21.3}, 115 { "v": 21.4}, 116 { "v": 21.4}, 117 { "v": 21.5}, 118 { "v": 21.5}, 119 { "v": 21.5}, 120 { "v": 21.6}, 121 { "v": 21.7}, 122 { "v": 21.5}, 123 ... 125 Figure 2: SenML pack with multiple records using base time offset 127 It can be seen that it results in a record and overall pack size 128 reduction. The receiver of the record would use the base time "bt" 129 for the initial data point, e.g. "v": 21.2 would have a timestamp of 130 1320067464. Each subsequent record would have a time stamp equal to 131 the previous record plus the base time offset "bto", e.g. "v": 21.3 132 would have a timestamp of 1320067474, "v": 21.4 would have a 133 timestamp of 1320067484, and so on. 135 2. Terminology 137 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 138 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 139 "OPTIONAL" in this document are to be interpreted as described in 140 [RFC2119]. 142 See [I-D.ietf-core-senml] for further definitions. 144 3. SenML Structure and Semantics 146 3.1. Base Attributes 148 This document adds an additional "base time offset" attribute. 150 Base Time Offset: The base time offset represents a fixed time offset 151 between each record in a SenML pack. The first record represents 152 time zero (or the base time if provided) and the offset is then 153 applied to each subsequent record. Either a positive or negative 154 base time offset is allowed. 156 3.2. Regular Attributes 158 This document modifies the behaviour of the time attribute. 160 Time: If the base time offset attribute is used in a SenML pack then 161 the time attribute shall not be used in the individual records. 163 _Editor's note: One theoretical use case may be to include the time 164 attribute if the entry's time deviates from the regular offset. It 165 is not seen that such a corner case warrants the extra complexity._ 167 3.3. Considerations 169 To simplify implementation, the use of base time offset is limited 170 to: 172 o Fixed time increasing or decreasing records from the time stamp 173 associated with the first record in the SenML pack. This means 174 that usages such as described by the 2nd example in 175 5.1.2/[I-D.ietf-core-senml] where negative time offset from time 176 zero being provided by the last record in a SenML pack are not 177 possible. 179 _Editor's note: It could be possible to facilitate this use case by 180 allowing a t=0 to be set on the last record with the use of a 181 negative base time offset value. However again it's not seen that 182 such a corner case warrants the extra complexity in having to store 183 values and calculate offsets at the end of transmission/reception._ 185 o It is not possible to for two records in the SenML pack to have 186 the same time. For example the inclusion of a record for a 187 voltage measurement followed by a current measurement would result 188 in the records having times with a difference of the time offset. 190 4. JSON Representation (application/senml+json) 192 This document defines an additional SenML label (JSON object member 193 name) as shown in Table 1 below. 195 +------------------+-------+-------+ 196 | Name | label | Type | 197 +------------------+-------+-------+ 198 | Base Time Offset | bto | Numer | 199 +------------------+-------+-------+ 201 Table 1: JSON SenML Labels 203 5. CBOR Representation (application/senml+cbor) 205 As per section 6/[I-D.ietf-core-senml], for CBOR the string map key 206 "bto" shall be used to indicate the use of the base time offset. 208 6. XML representation (application/senml+xml) 210 This document defines an addition XML attribute as shown in Table 2 211 below. 213 +------------------+-----+--------+ 214 | Name | XML | Type | 215 +------------------+-----+--------+ 216 | Base Time Offset | bto | double | 217 +------------------+-----+--------+ 219 Table 2: XML SenML Labels 221 The RelaxNG schema for the XML is: 223 senml = element senml { 224 attribute bn { xsd:string }?, 225 attribute bt { xsd:double }?, 226 attribute bv { xsd:double }?, 227 attribute bs { xsd:double }?, 228 attribute bu { xsd:string }?, 229 attribute bver { xsd:int }?, 230 attribute bto { xsd:double }?, 232 attribute l { xsd:string }?, 234 attribute n { xsd:string }?, 235 attribute s { xsd:double }?, 236 attribute t { xsd:double }?, 237 attribute u { xsd:string }?, 238 attribute ut { xsd:double }?, 240 attribute v { xsd:double }?, 241 attribute vb { xsd:boolean }?, 242 attribute vs { xsd:string }?, 243 attribute vd { xsd:string }? 244 } 246 sensml = 247 element sensml { 248 senml+ 249 } 251 start = sensml 253 7. EXI Representation (application/senml-exi) 255 As per clause 8/[I-D.ietf-core-senml] extensions are indicated 256 through the use of an EXI schemaID options. The EXI schemaID options 257 MUST be set to the value of "b" indicating the scheme provided in 258 this specification. 260 The following is the XSD Schema to be used for strict schema guided 261 EXI processing. 263 264 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 297 8. Security Considerations 299 No extra security issues are seen beyond those described in 300 [I-D.ietf-core-senml]. 302 9. IANA Considerations 304 This document proposes one new entry in the IANA SenML label 305 reegistry. 307 Label Name: Base Time Offset 309 Label: bto 310 CBOR: - 312 XML Type: Double 314 ID: b 316 Reference: This specification. 318 10. Acknowledgements 320 TBD 322 11. Changelog 324 draft-groves-core-senml-bto-01 326 o General: Changed "SenML Package" to "SenML Pack" 328 12. Normative References 330 [I-D.ietf-core-senml] 331 Jennings, C., Shelby, Z., Arkko, J., Keranen, A., and C. 332 Bormann, "Media Types for Sensor Measurement Lists 333 (SenML)", draft-ietf-core-senml-05 (work in progress), 334 March 2017. 336 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 337 Requirement Levels", BCP 14, RFC 2119, 338 DOI 10.17487/RFC2119, March 1997, 339 . 341 Authors' Addresses 343 Christian Groves 344 Australia 346 Email: cngroves.std@gmail.com 348 Weiwei Yang 349 Huawei 350 P.R.China 352 Email: tommy@huawei.com