idnits 2.17.1 draft-deason-afs3-type-time-00.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 (March 7, 2011) is 4770 days in the past. Is this intentional? Checking references for intended status: Informational ---------------------------------------------------------------------------- No issues found here. Summary: 0 errors (**), 0 flaws (~~), 1 warning (==), 1 comment (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 N/A A. Deason 3 Internet-Draft Sine Nomine 4 Intended status: Informational March 7, 2011 5 Expires: September 8, 2011 7 Base Types for Time in AFS-3 8 draft-deason-afs3-type-time-00 10 Abstract 12 This document defines two types to be used in future AFS-3 Rx Remote 13 Procedure Calls (RPCs) to represent time. Current AFS-3 RPCs 14 represent time as 32-bit integers representing seconds. This is 15 insufficient in both granularity and range, so new types to represent 16 time are defined in this document to overcome these limitations. 18 Internet Draft Comments 20 Comments regarding this draft are solicited. Please include the 21 AFS-3 protocol standardization mailing list 22 (afs3-standardization@openafs.org) as a recipient of any comments. 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 September 8, 2011. 41 Copyright Notice 43 Copyright (c) 2011 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. 53 Table of Contents 55 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3 56 2. Data Types . . . . . . . . . . . . . . . . . . . . . . . . . . 3 57 2.1. AFSAbsTime . . . . . . . . . . . . . . . . . . . . . . . . 3 58 2.2. AFSRelTime . . . . . . . . . . . . . . . . . . . . . . . . 4 59 3. Security Considerations . . . . . . . . . . . . . . . . . . . . 5 60 4. IANA Considerations . . . . . . . . . . . . . . . . . . . . . . 5 61 5. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 5 62 6. Informative References . . . . . . . . . . . . . . . . . . . . 5 63 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . . 6 65 1. Introduction 67 All extant AFS-3 RPCs represent time as a 32-bit integer, as encoded 68 by XDR in [RFC4506], which represents a number of seconds. For RPCs 69 that specify an absolute time, this is the number of seconds that 70 have passed since since midnight or 0 hour January 1, 1970 71 Coordinated Universal Time (UTC), not counting leap seconds. These 72 time structures will be unusable after January 2038, and are already 73 insufficient to represent time with more granularity than one second. 75 This limited granularity creates inefficiencies in various parts of 76 the AFS-3 protocol when it must be determined in what order two 77 events have occurred (for example, whether or not a file was changed 78 since the last time a volume has been backed up). When those two 79 events have occurred during the same second, implementations must 80 take a conservative assumption about which event occurred first, 81 often resulting in unnecessary duplication or retransmission of data. 82 In addition, metadata can be lost when files are copied to AFS from 83 other filesystems that store file modification times with finer 84 granularity than one second. 86 This document defines a new type, AFSAbsTime, to be used in AFS-3 87 RPCs in the future. This type aims to solve these problems, as it 88 supports a much wider range of dates at a much finer granularity. 89 Another type, AFSRelTime, is defined to represent times relative to 90 some other event, which provides for greater granularity over the 91 existing representations via 32-bit integers. 93 Both of these new types also provide standard type identifiers to be 94 used when specifying relative or absolute time in AFS-3 RPC arguments 95 and structures. Currently, both of these are just specified as 96 "afs_int32" types in the XDR language definitions, which can make it 97 ambiguous whether or not a field is an absolute time, relative time, 98 or something else completely. Using the standard types AFSAbsTime 99 and AFSRelTime will make this unambiguous. 101 2. Data Types 103 This document defines two new data types: AFSAbsTime and AFSRelTime. 104 Both of these are encoded on the wire using the XDR standard 105 described in [RFC4506], and are described using the XDR language 106 specification therein. 108 2.1. AFSAbsTime 110 The new AFSAbsTime type is represented as an XDR-encoded structure 111 containing a 64-bit unsigned integer as the timestamp, and an 112 unsigned 32-bit integer representing the resolution. It is defined 113 as thus in XDR: 115 struct AFSAbsTime { 116 unsigned hyper timestamp; 117 unsigned int resolution; 118 }; 120 The AFSAbsTime structure represents the amount of time that has 121 passed since midnight or 0 hour January 1, 1601 Coordinated Universal 122 Time (UTC). The value of the timestamp field represents this amount 123 of time in increments of 100 nanoseconds (ns). This precision and 124 starting date is equivalent to the Microsoft Windows FILETIME 125 structure. 127 The value of the resolution field represents the resolution of the 128 time source from which the timestamp was obtained. The presence of 129 this field is important when calculating the order in which two 130 events occurred relative to each other. If a timestamp is obtained 131 from a time source that only has 1-second granularity, the event may 132 have occurred anywhere in that second, whereas if it was obtained 133 from a source with 100-ns granularity, it is known that it occurred 134 before an event that occurred 0.5 seconds later. 136 The value of the resolution field is the smallest amount of time 137 representable by that time source, in increments of 100 ns. If the 138 value of the timestamp field is X, and the value of the resolution is 139 Y, the AFSAbsTime structure describes an event that occurs at or 140 after time X, but before time X+Y. 142 For example, to represent the time 60 seconds after midnight on 143 January 1, 1601, the value of the timestamp field would be 600000000 144 (600 million). If the time source this was obtained from only has 145 1-second granularity, the resolution field would have the value 146 10000000 (10 million). In effect, the AFSAbsTime structure then 147 represents an event that happened at or after 60 seconds after 148 midnight on January 1, 1601, but happened before 61 seconds after 149 midnight on January 1, 1601. 151 This structure can represent any time from January 1, 1601 up to the 152 year 30282 with 100-ns granularity. 154 2.2. AFSRelTime 156 The new AFSRelTime type has nearly the same representation on the 157 wire as AFSAbsTime in Section 2.1: 159 struct AFSRelTime { 160 hyper timestamp; 161 unsigned int resolution; 162 }; 164 The AFSRelTime structure represents the amount of time that has 165 passed since some other event. The event to which this time is 166 relative is unspecified, and can be anything; it must be specified by 167 the RPC or structure that defines a field of the AFSRelTime type. 169 The value of the timestamp field represents this amount of time in 170 increments of 100 ns. Values greater than 0 represent dates that 171 occur after the relative event, and values less than 0 represent 172 dates that occur before the relative event. 174 The meaning and value of the resolution field is the same as that of 175 the resolution field in AFSAbsTime specified in Section 2.1. 177 For example, to represent the time 5 seconds before some other event, 178 the value of the timestamp field would be -50000000 (negative 50 179 million). If the time source has 1-second granularity, the 180 resolution field would have the value 10000000 (10 million). In 181 effect, the AFSRelTime structure then represents an event that 182 happens at or after 5 seconds before some other event X, but before 4 183 seconds before the event X. 185 3. Security Considerations 187 This memo raises no security issues. 189 4. IANA Considerations 191 This document makes no request of the IANA. 193 5. Acknowledgements 195 The author thanks Simon Wilkinson And Jeffrey Altman for some 196 background text and for bringing up the question of varying time 197 resolution, and Tom Keiser and David Boyes for input on the problem 198 of time resolution. 200 6. Informative References 202 [RFC4506] Eisler, M., "XDR: External Data Representation Standard", 203 STD 67, RFC 4506, May 2006. 205 Author's Address 207 Andrew Deason 208 Sine Nomine Associates 209 43596 Blacksmith Square 210 Ashburn, Virginia 20147-4606 211 USA 213 Phone: +1 703 723 6673 214 Email: adeason@sinenomine.net