idnits 2.17.1 draft-bormann-cbor-time-tag-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 : ---------------------------------------------------------------------------- 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 (June 14, 2017) is 2508 days in the past. Is this intentional? Checking references for intended status: Informational ---------------------------------------------------------------------------- == Missing Reference: 'RFCthis' is mentioned on line 244, but not defined == Unused Reference: 'IEEE1588-2008' is defined on line 279, but no explicit reference was found in the text == Unused Reference: 'RESOLUTION' is defined on line 286, but no explicit reference was found in the text == Outdated reference: A later version (-11) exists of draft-greevenbosch-appsawg-cbor-cddl-10 ** Obsolete normative reference: RFC 7049 (Obsoleted by RFC 8949) == Outdated reference: A later version (-06) exists of draft-touch-time-02 Summary: 1 error (**), 0 flaws (~~), 6 warnings (==), 1 comment (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group C. Bormann 3 Internet-Draft Universitaet Bremen TZI 4 Intended status: Informational B. Gamari 5 Expires: December 16, 2017 Well-Typed 6 H. Birkholz 7 Fraunhofer SIT 8 June 14, 2017 10 Concise Binary Object Representation (CBOR) Tags for Time, Duration, and 11 Period 12 draft-bormann-cbor-time-tag-01 14 Abstract 16 The Concise Binary Object Representation (CBOR, RFC 7049) is a data 17 format whose design goals include the possibility of extremely small 18 code size, fairly small message size, and extensibility without the 19 need for version negotiation. 21 In CBOR, one point of extensibility is the definition of CBOR tags. 22 RFC 7049 defines two tags for time: CBOR tag 0 (RFC3339 time) and tag 23 1 (Posix time [TIME_T], int or float). Since then, additional 24 requirements have become known. The present document defines a CBOR 25 tag for time that allows a more elaborate representation of time, and 26 anticipates the definition of related CBOR tags for duration and time 27 period. It is intended as the reference document for the IANA 28 registration of the CBOR tags defined. 30 Note to Readers 32 Version -00 of the present draft opened up the possibilities provided 33 by extended representations of time in CBOR. The present version -01 34 consolidates this draft to non-speculative content, the normative 35 parts of which are believed will stay unchanged during further 36 development of the draft. This version is provided to aid the 37 registration of the CBOR tag immediately needed. Further versions 38 will re-introduce some of the material from -00, but in a more 39 concrete form. 41 Status of This Memo 43 This Internet-Draft is submitted in full conformance with the 44 provisions of BCP 78 and BCP 79. 46 Internet-Drafts are working documents of the Internet Engineering 47 Task Force (IETF). Note that other groups may also distribute 48 working documents as Internet-Drafts. The list of current Internet- 49 Drafts is at http://datatracker.ietf.org/drafts/current/. 51 Internet-Drafts are draft documents valid for a maximum of six months 52 and may be updated, replaced, or obsoleted by other documents at any 53 time. It is inappropriate to use Internet-Drafts as reference 54 material or to cite them other than as "work in progress." 56 This Internet-Draft will expire on December 16, 2017. 58 Copyright Notice 60 Copyright (c) 2017 IETF Trust and the persons identified as the 61 document authors. All rights reserved. 63 This document is subject to BCP 78 and the IETF Trust's Legal 64 Provisions Relating to IETF Documents 65 (http://trustee.ietf.org/license-info) in effect on the date of 66 publication of this document. Please review these documents 67 carefully, as they describe your rights and restrictions with respect 68 to this document. Code Components extracted from this document must 69 include Simplified BSD License text as described in Section 4.e of 70 the Trust Legal Provisions and are provided without warranty as 71 described in the Simplified BSD License. 73 Table of Contents 75 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 76 1.1. Terminology . . . . . . . . . . . . . . . . . . . . . . . 3 77 1.2. Background . . . . . . . . . . . . . . . . . . . . . . . 3 78 2. Objectives . . . . . . . . . . . . . . . . . . . . . . . . . 3 79 3. Time Format . . . . . . . . . . . . . . . . . . . . . . . . . 4 80 3.1. Key 1 . . . . . . . . . . . . . . . . . . . . . . . . . . 5 81 3.2. Keys 4 and 5 . . . . . . . . . . . . . . . . . . . . . . 5 82 3.3. Keys -3, -6, -9, -12, -15, -18 . . . . . . . . . . . . . 5 83 4. CDDL typenames . . . . . . . . . . . . . . . . . . . . . . . 5 84 5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 6 85 6. Security Considerations . . . . . . . . . . . . . . . . . . . 6 86 7. References . . . . . . . . . . . . . . . . . . . . . . . . . 7 87 7.1. Normative References . . . . . . . . . . . . . . . . . . 7 88 7.2. Informative References . . . . . . . . . . . . . . . . . 8 89 Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . 8 90 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 8 92 1. Introduction 94 The Concise Binary Object Representation (CBOR, [RFC7049]) provides 95 for the interchange of structured data without a requirement for a 96 pre-agreed schema. RFC 7049 defines a basic set of data types, as 97 well as a tagging mechanism that enables extending the set of data 98 types supported via an IANA registry. 100 (TBD: Expand on text from abstract here.) 102 1.1. Terminology 104 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 105 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 106 document are to be interpreted as described in RFC 2119 [RFC2119]. 108 The term "byte" is used in its now customary sense as a synonym for 109 "octet". Where bit arithmetic is explained, this document uses the 110 notation familiar from the programming language C (including C++14's 111 0bnnn binary literals), except that the operator "**" stands for 112 exponentiation. 114 1.2. Background 116 Additional information about the complexities of time representation 117 can be found in [TIME]. This specification uses a number of terms 118 that should be familiar to connoisseurs of precise time; references 119 for these may need to be added. 121 2. Objectives 123 For the time tag, the present specification addresses the following 124 objectives that go beyond the original tags 0 and 1: 126 o Additional resolution for epoch-based time (as in tag 1). CBOR 127 tag 1 only provides for integer and up to binary64 floating point 128 representation of times, limiting resolution to approximately 129 microseconds at the time of writing (and progressively becoming 130 worse over time). 132 Not currently addressed, but possibly covered by the definition of 133 additional map keys for the map inside the tag: 135 o Indication of time scale. Tags 0 and 1 are for UTC; however, some 136 interchanges are better performed on TAI. Other time scales may 137 be registered once they become relevant (e.g., one of the proposed 138 successors to UTC that might no longer use leap seconds, or a 139 scale based on smeared leap seconds). 141 o Direct representation of natural platform time formats. Some 142 platforms use epoch-based time formats that require some 143 computation to convert them into the representations allowed by 144 tag 1; these computations can also lose precision and cause 145 ambiguities. (TBD: The present specification does not take a 146 position on whether tag 1 can be "fixed" to include, e.g., Decimal 147 or BigFloat representations. It does define how to use these with 148 the extended time format.) 150 o Additional indication of intents about the interpretation of the 151 time given, in particular for future times. Intents might include 152 information about time zones, daylight savings times, etc. 154 Additional tags might later be defined for duration and period. The 155 objectives for such duration and period tags are likely similar. 157 3. Time Format 159 An extended time is indicated by CBOR tag TBDET, which tags a map 160 data item (CBOR major type 5). The map may contain integer (major 161 types 0 and 1) or text string (major type 3) keys, with the value 162 type determined by each specific key. Implementations MUST ignore 163 key/value types they do not understand for negative integer and text 164 string values of the key. Not understanding key/value for unsigned 165 keys is an error. 167 The map must contain exactly one unsigned integer key, which 168 specifies the "base time", and may also contain one or more negative 169 integer or text-string keys, which may encode supplementary 170 information such as: 172 o a higher precision time offset to be added to the base time, 174 Future keys may add: 176 o a reference time scale and epoch different from the default UTC 177 and 1970-01-01 179 o information about clock source and precision, accuracy, and 180 resolution 182 o intent information such as timezone and daylight savings time, 183 and/or possibly positioning coordinates, to express information 184 that would indicate a local time. 186 While this document does not define supplementary text keys, a number 187 of unsigned and negative-integer keys are defined below. 189 3.1. Key 1 191 Key 1 indicates a value that is exactly like the data item that would 192 be tagged by CBOR tag 1 (Posix time [TIME_T] as int or float). 194 3.2. Keys 4 and 5 196 Keys 4 and 5 are like key 1, except that the data item is an array as 197 defined for CBOR tag 4 or 5, respectively. This can be used to 198 include a Decimal or Bigfloat epoch-based float [TIME_T] in an 199 extended time. 201 3.3. Keys -3, -6, -9, -12, -15, -18 203 The keys -3, -6, -9, -12, -15 and -18 indicate additional decimal 204 fractions by giving an unsigned integer (major type 0) and scaling 205 this with the scale factor 1e-3, 1e-6, 1e-9, 1e-12, 1e-15, and 1e-18, 206 respectively (see Table 1). More than one of these keys MUST NOT be 207 present in one extended time data item. These additional fractions 208 are added to a base time in seconds [SI-SECOND] indicated by a Key 1, 209 which then MUST also be present and MUST have an integer value. 211 +-----+--------------+-----------------+ 212 | Key | meaning | example usage | 213 +-----+--------------+-----------------+ 214 | -3 | milliseconds | Java time | 215 | -6 | microseconds | (old) UNIX time | 216 | -9 | nanoseconds | (new) UNIX time | 217 | -12 | picoseconds | Haskell time | 218 | -15 | femtoseconds | (future) | 219 | -18 | attoseconds | (future) | 220 +-----+--------------+-----------------+ 222 Table 1: Key for decimally scaled Fractions 224 4. CDDL typenames 226 For the use with the CBOR Data Definition Language, CDDL 227 [I-D.greevenbosch-appsawg-cbor-cddl], the type names defined in 228 Figure 1 are recommended: 230 etime = #6.TBDET({* (int/tstr) => any}) 232 Figure 1: Recommended type names for CDDL 234 5. IANA Considerations 236 IANA is requested to allocate the tags in Table 2 from the FCFS 237 space, with the present document as the specification reference. 239 +-------+-----------+-------------------------+ 240 | Tag | Data Item | Semantics | 241 +-------+-----------+-------------------------+ 242 | TBDET | map | [RFCthis] extended time | 243 | TBDED | map | [RFCthis] duration | 244 | TBDEP | map | [RFCthis] period | 245 +-------+-----------+-------------------------+ 247 Table 2: Values for Tags 249 Although duration and period are not yet defined in the present 250 version of this document, the tag values for duration and period are 251 requested at the same time as the value for extended time in order to 252 achieve allocation of all three values as a contiguous set. 254 RFC editor note: Please replace TBDET, TBDED, and TBDEP by the tag 255 number allocated by IANA throughout the document and delete this 256 note. 258 6. Security Considerations 260 The security considerations of RFC 7049 apply; the tags introduced 261 here are not expected to raise security considerations beyond those. 263 Time, of course, has significant security considerations; these 264 include the exploitation of ambiguities where time is security 265 relevant (e.g., for freshness or in a validity span) or the 266 disclosure of characteristics of the emitting system (e.g., time 267 zone, or clock resolution and wall clock offset). 269 7. References 271 7.1. Normative References 273 [I-D.greevenbosch-appsawg-cbor-cddl] 274 Birkholz, H., Vigano, C., and C. Bormann, "CBOR data 275 definition language (CDDL): a notational convention to 276 express CBOR data structures", draft-greevenbosch-appsawg- 277 cbor-cddl-10 (work in progress), March 2017. 279 [IEEE1588-2008] 280 IEEE, "1588-2008 - IEEE Standard for a Precision Clock 281 Synchronization Protocol for Networked Measurement and 282 Control Systems", July 2008, 283 . 286 [RESOLUTION] 287 The Open Group Base Specifications, "Vol. 1: Base 288 Definitions, Issue 7", Section 3.328 '(Time) Resolution', 289 IEEE Std 1003.1-2008, 2016 Edition, 2016, 290 . 293 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 294 Requirement Levels", BCP 14, RFC 2119, 295 DOI 10.17487/RFC2119, March 1997, 296 . 298 [RFC7049] Bormann, C. and P. Hoffman, "Concise Binary Object 299 Representation (CBOR)", RFC 7049, DOI 10.17487/RFC7049, 300 October 2013, . 302 [SI-SECOND] 303 International Organization for Standardization (ISO), 304 "Quantities and units -- Part 3: Space and time", 305 ISO 80000-3, March 2006. 307 [TIME_T] The Open Group Base Specifications, "Vol. 1: Base 308 Definitions, Issue 7", Section 4.15 'Seconds Since the 309 Epoch', IEEE Std 1003.1-2008, 2016 Edition, 2016, 310 . 313 7.2. Informative References 315 [TIME] Touch, J., "Resolving Multiple Time Scales in the 316 Internet", draft-touch-time-02 (work in progress), April 317 2017. 319 Acknowledgements 321 Authors' Addresses 323 Carsten Bormann 324 Universitaet Bremen TZI 325 Postfach 330440 326 Bremen D-28359 327 Germany 329 Phone: +49-421-218-63921 330 Email: cabo@tzi.org 332 Ben Gamari 333 Well-Typed 334 117 Middle Rd. 335 Portsmouth, NH 03801 336 United States 338 Email: ben@well-typed.com 340 Henk Birkholz 341 Fraunhofer Institute for Secure Information Technology 342 Rheinstrasse 75 343 Darmstadt 64295 344 Germany 346 Email: henk.birkholz@sit.fraunhofer.de