idnits 2.17.1 draft-huitema-quic-ts-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 seems to lack the recommended RFC 2119 boilerplate, even if it appears to use RFC 2119 keywords. (The document does seem to have the reference to RFC 2119 which the ID-Checklist requires). -- The document date (February 1, 2021) is 1178 days in the past. Is this intentional? Checking references for intended status: Experimental ---------------------------------------------------------------------------- No issues found here. Summary: 0 errors (**), 0 flaws (~~), 2 warnings (==), 1 comment (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group C. Huitema 3 Internet-Draft Private Octopus Inc. 4 Intended status: Experimental February 1, 2021 5 Expires: August 5, 2021 7 Quic Timestamps For Measuring One-Way Delays 8 draft-huitema-quic-ts-04 10 Abstract 12 The TIME_STAMP frame can be added to Quic packets when one way delay 13 measurements is useful. The timestamp is set to the number of 14 microseconds from the beginning of the connection to the time at 15 which the packet is sent. The draft defines the "enable_time_stamp" 16 transport parameter for negotiating the use of this extension frame, 17 and a new frame types for the time_stamped frame. 19 Status of This Memo 21 This Internet-Draft is submitted in full conformance with the 22 provisions of BCP 78 and BCP 79. 24 Internet-Drafts are working documents of the Internet Engineering 25 Task Force (IETF). Note that other groups may also distribute 26 working documents as Internet-Drafts. The list of current Internet- 27 Drafts is at https://datatracker.ietf.org/drafts/current/. 29 Internet-Drafts are draft documents valid for a maximum of six months 30 and may be updated, replaced, or obsoleted by other documents at any 31 time. It is inappropriate to use Internet-Drafts as reference 32 material or to cite them other than as "work in progress." 34 This Internet-Draft will expire on August 5, 2021. 36 Copyright Notice 38 Copyright (c) 2021 IETF Trust and the persons identified as the 39 document authors. All rights reserved. 41 This document is subject to BCP 78 and the IETF Trust's Legal 42 Provisions Relating to IETF Documents 43 (https://trustee.ietf.org/license-info) in effect on the date of 44 publication of this document. Please review these documents 45 carefully, as they describe your rights and restrictions with respect 46 to this document. Code Components extracted from this document must 47 include Simplified BSD License text as described in Section 4.e of 48 the Trust Legal Provisions and are provided without warranty as 49 described in the Simplified BSD License. 51 Table of Contents 53 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 54 1.1. Terms and Definitions . . . . . . . . . . . . . . . . . . 3 55 2. Specification . . . . . . . . . . . . . . . . . . . . . . . . 3 56 2.1. Negotiation . . . . . . . . . . . . . . . . . . . . . . . 3 57 2.2. Sending TIME_STAMP frames . . . . . . . . . . . . . . . . 4 58 2.3. TIME_STAMP frame format . . . . . . . . . . . . . . . . . 4 59 2.4. RTT Measurements . . . . . . . . . . . . . . . . . . . . 5 60 2.5. One-Way Delay Measurements . . . . . . . . . . . . . . . 5 61 3. Discussion . . . . . . . . . . . . . . . . . . . . . . . . . 6 62 3.1. Management of Time . . . . . . . . . . . . . . . . . . . 6 63 4. Security Considerations . . . . . . . . . . . . . . . . . . . 7 64 5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 8 65 6. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 8 66 7. References . . . . . . . . . . . . . . . . . . . . . . . . . 8 67 7.1. Normative References . . . . . . . . . . . . . . . . . . 8 68 7.2. Informative References . . . . . . . . . . . . . . . . . 9 69 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 9 71 1. Introduction 73 The QUIC Transport Protocol [I-D.ietf-quic-transport] provides a 74 secure, multiplexed connection for transmitting reliable streams of 75 application data. The algorithms for QUIC Loss Detection and 76 Congestion Control [I-D.ietf-quic-recovery] use measurement of Round 77 Trip Time (RTT) to determine when packets should be retransmitted. 78 RTT measurements are useful, but there are however many cases in 79 which more precise One-Way Delay (1WD) measurements enable more 80 efficient Loss Detection and Congestion Control. 82 An example would be the Low Extra Delay Background Transport (LEDBAT) 83 [RFC6817] which uses variations in transmission delay to detect 84 competition for transmission resource. Experience shows that while 85 LEDBAT may be implemented using RTT measurements, this is inefficient 86 because queues on the return path or delayed ACKs will cause 87 unnecessary slowdowns. Using 1WD solves these issues. Similar 88 argument can be made for most delay-based congestion control 89 algorithms algorithms. 91 We propose to enable one way delay measurements in QUIC by defining a 92 TIME_STAMP frame carrying the time at which a packet is sent. The 93 use of this extension frame is negotiated with a transport parameter, 94 "enable_time_stamp". When the extension is negotiated by both 95 parties, this frame can be used in conjunction with other such as ACK 96 to measure one way delays. 98 1.1. Terms and Definitions 100 The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 101 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 102 "OPTIONAL" in this document are to be interpreted as described in BCP 103 14 [RFC2119] [RFC8174] when, and only when, they appear in all 104 capitals, as shown here. 106 2. Specification 108 The enable_time_stamp transport parameter used for negotiating the 109 use of the extension frame is defined in Section 2.1. The time_stamp 110 frame format is defined in Section 2.3. 112 2.1. Negotiation 114 The use of the time_stamp frame extension is negotiated using a 115 transport parameter: 117 o enable_time_stamp (TBD) 119 The enable time stamp transport parameter is included if the endpoint 120 wants to receive or accepts to send time_stamp frames for this 121 connection. This parameter is encoded as a variable integer as 122 specified in section 16 of [I-D.ietf-quic-transport]. It can take 123 one of the following three values: 125 1. I would like to receive TIME_STAMP frames 127 2. I am able to generate TIME_STAMP frames 129 3. I am able to generate TIME_STAMP frames and I would like to 130 receive them 132 Peers receiving another value SHOULD terminate the connection with a 133 TRANSPORT PARAMETER error. 135 A peer that advertises its capability of sending TIME_STAMP frames 136 using option values 2 or 3 MUST NOT send these frames if the other 137 peer does not announce advertise its desire to receive them by 138 sending the enable_time_stamp TP with option 1 or 3. This condition 139 is described as "successful sending negotiation" in Section 2.2. 141 Peers that receive TIME_STAMP frames when they have not advertised 142 their desire to receive them MAY terminate the connection with a 143 PROTOCOL VIOLATION error. 145 As specified in Section 2.2, TIME_STAMP frames MUST NOT be sent in 146 0-RTT packets. Clients that use 0-RTT MUST NOT reuse a value of the 147 server's enable_time_stamp parameter that they remember from the 148 resumed session. 150 2.2. Sending TIME_STAMP frames 152 Following successful sending negotiation, a peer SHOULD add a 153 time_stamp frame to 1RTT packets carrying an ACK frame. This 154 specification does not impose a placement of TIME_STAMP frames in the 155 packet. They MAY be sent either before or after the ACK frame. 157 Implementations SHOULD NOT send more than one TIME_STAMP frame per 158 packet, but they MAY send more than one in rare circumstances. When 159 multiple TIME_STAMP frames are present in a packet, the receiver 160 retains the frame indicating the largest timestamp. 162 Implementations MUST NOT send the TIME_STAMP frame in Initial, 0-RTT 163 or Handshake packets, because there is a risk that the peer will 164 receive such packets before the negotiation completes. This 165 restriction may appear excessive because some Handshake packets are 166 typically sent after the negotiation completes, but restricting 167 TIME_STAMP frames to 1RTT packets is simpler and less error prone 168 than allowing the TIME_STAMP frame in just a fraction of Handshake 169 packets. 171 2.3. TIME_STAMP frame format 173 TIME_STAMP frames are identified by the frame type: 175 o TIME_STAMP (TBD) 177 TIME_STAMP frames carry a single parameter, the time stamp, encoded 178 as a variable length interger. They are formatted as shown in 179 Figure 1, which uses the notational conventions specified in 180 Section 1.3 of [I-D.ietf-quic-transport]. 182 TIME_STAMP Frame { 183 Type (i) = TBD, 184 Time Stamp (i) 185 } 187 Figure 1: TIME_STAMP Frame Format 189 The time stamp encodes the number of microseconds since the beginning 190 of the connection, as measured by the peer at the time at which the 191 packet is sent. It is encoded using the exponent selected by the 192 peer in the ack_delay_exponent. The exponent reduced time stamp is 193 encoded as a variable length integer. 195 The beginning of the connection is defined as follow: 197 o for the client, the time when the first Initial packet is sent; 199 o for the server, the time when the first Initial packet is 200 received. 202 TIME_STAMP frames are not ack-eliciting. Their loss does not require 203 retransmission. 205 2.4. RTT Measurements 207 RTT measurements are performed as specified in Section 4 of 208 [I-D.ietf-quic-recovery], without reference to the Timestamp 209 parameter of the Timestamped ACK frames. 211 2.5. One-Way Delay Measurements 213 An endpoint generates a One Way Delay Sample on receiving a packet 214 containing both a TIME_STAMP frame and an ACK frame that meets the 215 following two conditions: 217 o the largest acknowledged packet number is newly acknowledged, and 219 o at least one of the newly acknowledged packets was ack-eliciting. 221 The One Way Delay sample, latest_1wd, is generated as the time 222 elapsed since the largest acknowledged packet was sent, corrected for 223 the 'phase_shift' difference between connection time at the sending 224 peer and connection time at the receiving peer. 226 latest_1wd = time_stamp - send_time_of_largest_acked - phase_shift 228 By convention, the phase_shift is estimated upon reception of the 229 first RTT sample, noted as first_rtt. It is set to: 231 phase_shift = time_stamp - send_time_of_largest_acked - first_rtt. /2 233 In that formula, we assume that the connection times are measured in 234 microseconds since the beginning of the connection. 236 We understand that clocks may drift over time, and that simply 237 estimating a phase shift at the beginning of a connection may be too 238 simplistic for long duration connections. Implementations MAY adopt 239 different strategies to reestimate the phase shift at appropriate 240 intervals. Specifying these strategies is beyond the scope of this 241 document. 243 3. Discussion 245 This document replaces an earlier proposal to modify the format of 246 the ACK frame by including a time stamp inside the modified frame. 247 The revised proposal encodes the time stamp independently of the ACK 248 frame, which requires slightly more overhead to encode the type of 249 the TIME_STAMP frame. 251 Defining an independent frame allows for more flexibility. This 252 draft defines the combination of TIME_STAMP with ACK frames, but they 253 could be combined with other frames as well. For example, adding a 254 TIME_STAMP to packets carrying a Path Response could allow measuring 255 one way delays before deciding to migrate to a new path. 257 3.1. Management of Time 259 There are two known issues with deducing one way delays from RTT 260 measurements: clock drift and undefined phase difference. 262 The phase difference problem is easy to understand. We start from a 263 list of measurements associating the send time of packet number x 264 (s[x]), the receive time of the acknowledgement of packet (a[x]), and 265 the time stamp indicating when packet x was received by the peer 266 (p[x]). The peer's time stamp are expressed in the peer's clock. 268 Suppose that we model the peer's clock as local time plus phase 269 difference f, and that we model the rtt as the sum of two one way 270 delays, up (u[x]) and down (d[x]). We get: 272 u[x] = p[x] + f - s[x] 274 d[x] = a[x] - p[x] - f 276 Just looking at the equation shows that the value of f cannot be 277 determined from the a series of measurement (s[x], a[x], p[x]). You 278 can just add constraints that all u[x] and d[x] are positive numbers, 279 which gives a range of plausible values for f: max(s[x] - p[x]) < f < 280 min(a[x]-p[x]). In case you wonder, you get similar formulations in 281 a multipath scenario. The plausible range may narrow to the min rtt 282 of the shortest path, but no further. 284 The phase difference uncertainty is not a big issue in practice, 285 because control algorithms are much more interested in the variations 286 of the delays than by their absolute values. Suppose we want to 287 compare one way delays at measurement (x) and (y). We get: 289 u[x] = p[x] + f - s[x] 291 u[y] = p[y] + f - s[y] 293 u[x] - u[y] = p[x] - p[y] - s[x] + s[y] 295 The phase difference does not affect the measurement of variations in 296 the one way delay. 298 The clock drift is another matter. All the equations above assume 299 that the local clock and the remote clock have the same frequency. 300 This is an approximation. Clocks drift over time. Instead of just 301 considering a stable phase difference, one should consider the sum of 302 a phase difference and a time-varying drift component. Estimating 303 drift is a complex problem. This was studied in detail in the 304 development of the Network Time Protocol (NTP) [RFC5905]. In theory, 305 implementations of Quic could copy the algorithms of NTP to build a 306 model of the clocks used by the local node and the peer. That would 307 be very complex. 309 Fortunately, implementations of Quic no not need to implement 310 something as complex as NTP. Most time based algorithms are only 311 interested in variations of delays over a short horizon. Clock drift 312 happens at a slow pace, maybe 1 millisecond per minute. Time base 313 congestion control algorithms already have to cope with the potential 314 drift of the minimum RTT due to changing network conditions. They do 315 that by periodically restarting themeasurement of the minimum RTT 316 after some delay, typically less than a minute. A simple 317 implementation of one way delay measurements could follow the same 318 approach, for example resetting the phase difference every 30 seconds 319 or so. 321 4. Security Considerations 323 The Timestamp value in the TIME_STAMP frame is asserted by the sender 324 of the packet. Adversarial peers could chose values of the time 325 stamp designed to exercise side effects in congestion control 326 algorithms or other algorithms relying on the one-way delays. This 327 can be mitigated by running plausibility checks on the received 328 values. For example, each peer can maintain statistics not just on 329 the One Way Delays, but also on the differences between One Way 330 Delays and RTT, and detect outlier values. Peers can also compare 331 the differences between timestamps in packets carrying 332 acknowledgements and the differences between the sending times of 333 corresponding packets, and detect anomalies if the delays between 334 acknowledging packets appears shorter than the delays when sending 335 them. 337 5. IANA Considerations 339 This document registers a new value in the QUIC Transport Parameter 340 Registry: 342 Value: TBD (using value 0x7158 in early deployments) 344 Parameter Name: enable_time_stamp 346 Specification: Indicates that the connection should use TimeStamped 347 ACK frames 349 This document also registers a new value in the QUIC Frame Type 350 registry: 352 Value: TBD (using value 757 in early deployments) 354 Frame Name: TIME_STAMP 356 Specification: Time stamp set at the time packet was sent 358 6. Acknowledgements 360 Thanks to Dmitri Tikhonov, Tal Misrahi and Watson Ladd for their 361 reviews and suggestions. 363 7. References 365 7.1. Normative References 367 [I-D.ietf-quic-recovery] 368 Iyengar, J. and I. Swett, "QUIC Loss Detection and 369 Congestion Control", draft-ietf-quic-recovery-34 (work in 370 progress), January 2021. 372 [I-D.ietf-quic-transport] 373 Iyengar, J. and M. Thomson, "QUIC: A UDP-Based Multiplexed 374 and Secure Transport", draft-ietf-quic-transport-34 (work 375 in progress), January 2021. 377 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 378 Requirement Levels", BCP 14, RFC 2119, 379 DOI 10.17487/RFC2119, March 1997, 380 . 382 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 383 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 384 May 2017, . 386 7.2. Informative References 388 [RFC5905] Mills, D., Martin, J., Ed., Burbank, J., and W. Kasch, 389 "Network Time Protocol Version 4: Protocol and Algorithms 390 Specification", RFC 5905, DOI 10.17487/RFC5905, June 2010, 391 . 393 [RFC6817] Shalunov, S., Hazel, G., Iyengar, J., and M. Kuehlewind, 394 "Low Extra Delay Background Transport (LEDBAT)", RFC 6817, 395 DOI 10.17487/RFC6817, December 2012, 396 . 398 Author's Address 400 Christian Huitema 401 Private Octopus Inc. 402 427 Golfcourse Rd 403 Friday Harbor WA 98250 404 USA 406 Email: huitema@huitema.net