idnits 2.17.1 draft-huitema-quic-ts-03.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 document seems to lack an Introduction section. 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 (August 10, 2020) is 1347 days in the past. Is this intentional? Checking references for intended status: Experimental ---------------------------------------------------------------------------- == Outdated reference: A later version (-34) exists of draft-ietf-quic-recovery-29 == Outdated reference: A later version (-34) exists of draft-ietf-quic-transport-29 Summary: 1 error (**), 0 flaws (~~), 4 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 August 10, 2020 5 Expires: February 11, 2021 7 Quic Timestamps For Measuring One-Way Delays 8 draft-huitema-quic-ts-03 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 February 11, 2021. 36 Copyright Notice 38 Copyright (c) 2020 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. Measuring One-Way Delays . . . . . . . . . . . . . . . . . . 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. Measuring One-Way Delays 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, it is somewhat 86 inefficient because it will cause unnecessary slowdowns in case of 87 queues or delayed ACKs on the return path. Using 1WD solves these 88 issues. Similar argument can be made for most delay-based 89 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 2.2. Sending TIME_STAMP frames 147 Following successful sending negotiation, a peer SHOULD add a 148 time_stamp frame to 1RTT packets carrying an ACK frame. This 149 specification does not impose a placement of TIME_STAMP frames in the 150 packet. They MAY be sent either before or after the ACK frame. 152 Implementations SHOULD NOT send more than one TIME_STAMP frame per 153 packet, but they MAY send more than one in rare circumstances. When 154 multiple TIME_STAMP frames are present in a packet, the receiver 155 retains the frame indicating the largest timestamp. 157 Implementations MUST NOT send the TIME_STAMP frame in Initial, 0-RTT 158 or Handshake packets, because there is a risk that the peer will 159 receive such packets before the negotiation completes. This 160 restriction may appear excessive because some Handshake packets are 161 typically sent after the negotiation completes, but restricting 162 TIME_STAMP frames to 1RTT packets is simpler and less error prone 163 than allowing the TIME_STAMP frame in just a fraction of Handshake 164 packets. 166 2.3. TIME_STAMP frame format 168 TIME_STAMP frames are identified by the frame type: 170 o TIME_STAMP (TBD) 172 TIME_STAMP frames carry a single parameter, the time stamp. 174 0 1 2 3 175 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 176 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 177 | Time Stamp (i) ... 178 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 180 Figure 1: TIME_STAMP Frame Format with Time Stamp 182 The time stamp encodes the number of microseconds since the beginning 183 of the connection, as measured by the peer at the time at which the 184 packet is sent. It is encoded using the exponent selected by the 185 peer in the ack_delay_exponent. The exponent reduced time stamp is 186 encoded as a variable length integer. 188 The beginning of the connection is defined as follow: 190 o for the client, the time when the first Initial packet is sent; 192 o for the server, the time when the first Initial packet is 193 received. 195 TIME_STAMP frames are not ack-eliciting. Their loss does not require 196 retransmission. 198 2.4. RTT Measurements 200 RTT measurements are performed as specified in Section 4 of 201 [I-D.ietf-quic-recovery], without reference to the Timestamp 202 parameter of the Timestamped ACK frames. 204 2.5. One-Way Delay Measurements 206 An endpoint generates a One Way Delay Sample on receiving a packet 207 containing both a TIME_STAMP frame and an ACK frame that meets the 208 following two conditions: 210 o the largest acknowledged packet number is newly acknowledged, and 212 o at least one of the newly acknowledged packets was ack-eliciting. 214 The One Way Delay sample, latest_1wd, is generated as the time 215 elapsed since the largest acknowledged packet was sent, corrected for 216 the difference between local time at the sending peer and connection 217 time at the receiving peer, phase_shift. 219 latest_1wd = time_stamp - send_time_of_largest_acked - phase_shift 221 By convention, the phase_shift is estimated upon reception of the 222 first RTT sample, first_rtt. It is set to: 224 phase_shift = time_stamp - send_time_of_largest_acked - latest_rtt/2 226 In that formula, we assume that the local time are measured in 227 microseconds since the beginning of the connection. 229 We understand that clocks may drift over time, and that simply 230 estimating a phase shift at the beginning of a connection may be too 231 simplistic for long duration connections. Implementations MAY adopt 232 different strategies to reestimate the phase shift at appropriate 233 intervals. Specifying these strategies is beyond the scope of this 234 document. 236 3. Discussion 238 This document replaces an earlier proposal to modify the format of 239 the ACK frame by including a time stamp inside the modified frame. 240 The revised proposal encodes the time stamp independently of the ACK 241 frame, which requires slightly more overhead to encode the type of 242 the TIME_STAMP frame. 244 Defining an independent frame allows for more flexibility. This 245 draft defines the combination of TIME_STAMP with ACK frames, but they 246 could be combined with other frames as well. For example, adding a 247 TIME_STAMP to packets carrying a Path Response could allow measuring 248 one way delays before deciding to migrate to a new path. 250 3.1. Management of Time 252 There are two known issues with deducing one way delays from RTT 253 measurements: clock drift and undefined phase difference. 255 The phase difference problem is easy to understand. We start from a 256 list of measurements associating the send time of packet number x 257 (s[x]), the receive time of the acknowledgement of packet (a[x]), and 258 the time stamp indicating when packet x was received by the peer 259 (p[x]). The peer's time stamp are expressed in the peer's clock. 261 Suppose that we model the peer's clock as local time plus phase 262 difference f, and that we model the rtt as the sum of two one way 263 delays, up (u[x]) and down (d[x]). We get: 265 u[x] = p[x] + f - s[x] 267 d[x] = a[x] - p[x] - f 269 Just looking at the equation shows that the value of f cannot be 270 determined from the a series of measurement (s[x], a[x], p[x]). You 271 can just add constraints that all u[x] and d[x] are positive numbers, 272 which gives a range of plausible values for f: max(s[x] - p[x]) < f < 273 min(a[x]-p[x]). In case you wonder, you get similar formulations in 274 a multipath scenario. The plausible range may narrow to the min rtt 275 of the shortest path, but no further. 277 The phase difference uncertainty is not a big issue in practice, 278 because control algorithms are much more interested in the variations 279 of the delays than by their absolute values. Suppose we want to 280 compare one way delays at measurement (x) and (y). We get: 282 u[x] = p[x] + f - s[x] 284 u[y] = p[y] + f - s[y] 286 u[x] - u[y] = p[x] - p[y] - s[x] + s[y] 288 The phase difference does not affect the measurement of variations in 289 the one way delay. 291 The clock drift is another matter. All the equations above assume 292 that the local clock and the remote clock have the same frequency. 293 This is an approximation. Clocks drift over time. Instead of just 294 considering a stable phase difference, one should consider the sum of 295 a phase difference and a time-varying drift component. Estimating 296 drift is a complex problem. This was studied in detail in the 297 development of the Network Time Protocol (NTP) [RFC5905]. In theory, 298 implementations of Quic could copy the algorithms of NTP to build a 299 model of the clocks used by the local node and the peer. That would 300 be very complex. 302 Fortunately, implementations of Quic no not need to implement 303 something as complex as NTP. Most time based algorithms are only 304 interested in variations of delays over a short horizon. Clock drift 305 happens at a slow pace, maybe 1 millisecond per minute. Time base 306 congestion control algorithms already have to cope with the potential 307 drift of the minimum RTT due to changing network conditions. They do 308 that by periodically restarting themeasurement of the minimum RTT 309 after some delay, typically less than a minute. A simple 310 implementation of one way delay measurements could follow the same 311 approach, for example resetting the phase difference every 30 seconds 312 or so. 314 4. Security Considerations 316 The Timestamp value in the TIME_STAMP frame is asserted by the sender 317 of the packet. Adversarial peers could chose values of the time 318 stamp designed to exercise side effects in congestion control 319 algorithms or other algorithms relying on the one-way delays. This 320 can be mitigated by running plausibility checks on the received 321 values. For example, each peer can maintain statistics not just on 322 the One Way Delays, but also on the differences between One Way 323 Delays and RTT, and detect outlier values. Peers can also compare 324 the differences between timestamps in packets carrying 325 acknowledgements and the differences between the sending times of 326 corresponding packets, and detect anomalies if the delays between 327 acknowledging packets appears shorter than the delays when sending 328 them. 330 5. IANA Considerations 332 This document registers a new value in the QUIC Transport Parameter 333 Registry: 335 Value: TBD (using value 0x7158 in early deployments) 337 Parameter Name: enable_time_stamp 339 Specification: Indicates that the connection should use TimeStamped 340 ACK frames 342 This document also registers a new value in the QUIC Frame Type 343 registry: 345 Value: TBD (using value 757 in early deployments) 347 Frame Name: TIME_STAMP 349 Specification: Time stamp set at the time packet was sent 351 6. Acknowledgements 353 Thanks to Dmitri Tikhonov, Tal Misrahi and Watson Ladd for their 354 reviews and suggestions. 356 7. References 358 7.1. Normative References 360 [I-D.ietf-quic-recovery] 361 Iyengar, J. and I. Swett, "QUIC Loss Detection and 362 Congestion Control", draft-ietf-quic-recovery-29 (work in 363 progress), June 2020. 365 [I-D.ietf-quic-transport] 366 Iyengar, J. and M. Thomson, "QUIC: A UDP-Based Multiplexed 367 and Secure Transport", draft-ietf-quic-transport-29 (work 368 in progress), June 2020. 370 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 371 Requirement Levels", BCP 14, RFC 2119, 372 DOI 10.17487/RFC2119, March 1997, 373 . 375 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 376 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 377 May 2017, . 379 7.2. Informative References 381 [RFC5905] Mills, D., Martin, J., Ed., Burbank, J., and W. Kasch, 382 "Network Time Protocol Version 4: Protocol and Algorithms 383 Specification", RFC 5905, DOI 10.17487/RFC5905, June 2010, 384 . 386 [RFC6817] Shalunov, S., Hazel, G., Iyengar, J., and M. Kuehlewind, 387 "Low Extra Delay Background Transport (LEDBAT)", RFC 6817, 388 DOI 10.17487/RFC6817, December 2012, 389 . 391 Author's Address 393 Christian Huitema 394 Private Octopus Inc. 395 427 Golfcourse Rd 396 Friday Harbor WA 98250 397 U.S.A 399 Email: huitema@huitema.net