SenML Base Time Offset AttributeAustraliacngroves.std@gmail.comHuaweiP.R.Chinatommy@huawei.com
art
CoRE Working GroupInternet-DraftSenML defines a base time attribute and time value
which is used to determine the time when a value is recorded. In
some applications a SenML pack will contain a series of records
related to a constant sample time interval, e.g. once every 60 seconds.
This means that the time attribute will be required for each record.
This document defines a new “time offset” base attribute that allows a
sender to include the time for the sample interval between records. If the “time offset” base attribute is used the sender will not send the time attribute for each record, minimising message and storage size.SenML currently defines the base time “bt” and time “t” attributes to indicate the time that each value in a SenML record is recorded. This means that for each record (value “v”) that a “t” attribute is required. The example from section 5.1.2/ is copied below to illustrate a SenML pack with multiple records.As can be seen in the example above there is a fixed offset between the data points of 10 seconds.This document proposes a base time offset “bto” attribute that is used to indicate the offset between datapoints when a fixed offset is used. This negates the need to include the “t” attribute for each data point. The example below takes the above example and applies the base time offset to it.It can be seen that it results in a record and overall pack size reduction. The receiver of the record would use the base time “bt” for the initial data point, e.g. “v”: 21.2 would have a timestamp of 1320067464. Each subsequent record would have a time stamp equal to the previous record plus the base time offset “bto”, e.g. “v”: 21.3 would have a timestamp of 1320067474, “v”: 21.4 would have a timestamp of 1320067484, and so on.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 .See for further definitions.This document adds an additional “base time offset” attribute.Base Time Offset: The base time offset represents a fixed time offset between each record in a SenML pack. The first record represents time zero (or the base time if provided) and the offset is then applied to each subsequent record. Either a positive or negative base time offset is allowed.This document modifies the behaviour of the time attribute.Time: If the base time offset attribute is used in a SenML pack then the time attribute shall not be used in the individual records.Editor’s note: One theoretical use case may be to include the time attribute if the entry’s time deviates from the regular offset. It is not seen that such a corner case warrants the extra complexity.To simplify implementation, the use of base time offset is limited to:Fixed time increasing or decreasing records from the time stamp associated with the first record in the SenML pack. This means that usages such as described by the 2nd example in 5.1.2/ where negative time offset from time zero being provided by the last record in a SenML pack are not possible.Editor’s note: It could be possible to facilitate this use case by allowing a t=0 to be set on the last record with the use of a negative base time offset value. However again it’s not seen that such a corner case warrants the extra complexity in having to store values and calculate offsets at the end of transmission/reception.It is not possible to for two records in the SenML pack to have the same time. For example the inclusion of a record for a voltage measurement followed by a current measurement would result in the records having times with a difference of the time offset.This document defines an additional SenML label (JSON object member name) as shown in below.NamelabelTypeBase Time OffsetbtoNumerAs per section 6/, for CBOR the string map key “bto” shall be used to indicate the use of the base time offset.This document defines an addition XML attribute as shown in below.NameXMLTypeBase Time OffsetbtodoubleThe RelaxNG schema for the XML is:As per clause 8/ extensions are indicated through the use of an EXI schemaID options. The EXI schemaID options MUST be set to the value of “b” indicating the scheme provided in this specification.The following is the XSD Schema to be used for strict schema guided EXI processing.No extra security issues are seen beyond those described in .This document proposes one new entry in the IANA SenML label reegistry.Label Name: Base Time OffsetLabel: btoCBOR: -XML Type: DoubleID: bReference: This specification.TBDdraft-groves-core-senml-bto-01General: Changed “SenML Package” to “SenML Pack”Key words for use in RFCs to Indicate Requirement LevelsIn many standards track documents several words are used to signify the requirements in the specification. These words are often capitalized. This document defines these words as they should be interpreted in IETF documents. This document specifies an Internet Best Current Practices for the Internet Community, and requests discussion and suggestions for improvements.Media Types for Sensor Measurement Lists (SenML)This specification defines media types for representing simple sensor measurements and device parameters in the Sensor Measurement Lists (SenML). Representations are defined in JavaScript Object Notation (JSON), Concise Binary Object Representation (CBOR), eXtensible Markup Language (XML), and Efficient XML Interchange (EXI), which share the common SenML data model. A simple sensor, such as a temperature sensor, could use this media type in protocols such as HTTP or CoAP to transport the measurements of the sensor or to be configured.