idnits 2.17.1 draft-huitema-quic-ts-02.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 (February 29, 2020) is 1518 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-26 == Outdated reference: A later version (-34) exists of draft-ietf-quic-transport-27 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 February 29, 2020 5 Expires: September 1, 2020 7 Quic Timestamps For Measuring One-Way Delays 8 draft-huitema-quic-ts-02 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 September 1, 2020. 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 . . . . . . . . . . . . . . . . 3 58 2.3. TIME_STAMP frame format . . . . . . . . . . . . . . . . . 4 59 2.4. RTT Measurements . . . . . . . . . . . . . . . . . . . . 4 60 2.5. One-Way Delay Measurements . . . . . . . . . . . . . . . 4 61 3. Discussion . . . . . . . . . . . . . . . . . . . . . . . . . 5 62 3.1. Management of Time . . . . . . . . . . . . . . . . . . . 5 63 4. Security Considerations . . . . . . . . . . . . . . . . . . . 7 64 5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 7 65 6. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 8 66 7. References . . . . . . . . . . . . . . . . . . . . . . . . . 8 67 7.1. Normative References . . . . . . . . . . . . . . . . . . 8 68 7.2. Informative References . . . . . . . . . . . . . . . . . 8 69 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 8 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 accepts and sends time_stamp frames for this connection. This 121 parameter has a zero-length value. Negotiation is successful if both 122 peers support include this parameter in their transport parameter 123 message. Peers that receive a time_stamp frame in the absence of 124 successful negotiation MAY terminate the connection with a PROTOCOL 125 VIOLATION error. 127 2.2. Sending TIME_STAMP frames 129 If negotiation is successful the peers SHOULD add a time_stamp frame 130 to 1RTT packets carrying an ACK frame. This specification does not 131 impose a placement of TIME_STAMP frames in the packet. They MAY be 132 sent either before or after the ACK frame. 134 Implementations SHOULD NOT send more than one TIME_STAMP frame per 135 packet, but they MAY send more than one in rare circumstances. When 136 multiple TIME_STAMP frames are present in a packet, the receiver 137 retains the frame indicating the largest timestamp. 139 Implementations MUST NOT send the TIME_STAMP frame in Initial, 0-RTT 140 or Handshake packets, because there is a risk that the peer will 141 receive such packets before the negotiation completes. This 142 restriction may appear excessive because some Handshake packets are 143 typically sent after the negotiation completes, but restricting 144 TIME_STAMP frames to 1RTT packets is simpler and less error prone 145 than allowing the TIME_STAMP frame in just a fraction of Handshake 146 packets. 148 2.3. TIME_STAMP frame format 150 TIME_STAMP frames are identified by the frame type: 152 o TIME_STAMP (TBD) 154 TIME_STAMP frames carry a single parameter, the time stamp. 156 0 1 2 3 157 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 158 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 159 | Time Stamp (i) ... 160 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 162 Figure 1: TIME_STAMP Frame Format with Time Stamp 164 The time stamp encodes the number of microseconds since the beginning 165 of the connection, as measured by the peer at the time at which the 166 packet is sent. It is encoded using the exponent selected by the 167 peer in the ack_delay_exponent. The exponent reduced time stamp is 168 encoded as a variable length integer. 170 The beginning of the connection is defined as follow: 172 o for the client, the time when the first Initial packet is sent; 174 o for the server, the time when the first Initial packet is 175 received. 177 TIME_STAMP frames are not ack-eliciting. Their loss does not require 178 retransmission. 180 2.4. RTT Measurements 182 RTT measurements are performed as specified in Section 4 of 183 [I-D.ietf-quic-recovery], without reference to the Timestamp 184 parameter of the Timestamped ACK frames. 186 2.5. One-Way Delay Measurements 188 An endpoint generates a One Way Delay Sample on receiving a packet 189 containing both a TIME_STAMP frame and an ACK frame that meets the 190 following two conditions: 192 o the largest acknowledged packet number is newly acknowledged, and 194 o at least one of the newly acknowledged packets was ack-eliciting. 196 The One Way Delay sample, latest_1wd, is generated as the time 197 elapsed since the largest acknowledged packet was sent, corrected for 198 the difference between local time at the sending peer and connection 199 time at the receiving peer, phase_shift. 201 latest_1wd = time_stamp - send_time_of_largest_acked - phase_shift 203 By convention, the phase_shift is estimated upon reception of the 204 first RTT sample, first_rtt. It is set to: 206 phase_shift = time_stamp - send_time_of_largest_acked - latest_rtt/2 208 In that formula, we assume that the local time are measured in 209 microseconds since the beginning of the connection. 211 We understand that clocks may drift over time, and that simply 212 estimating a phase shift at the beginning of a connection may be too 213 simplistic for long duration connections. Implementations MAY adopt 214 different strategies to reestimate the phase shift at appropriate 215 intervals. Specifying these strategies is beyond the scope of this 216 document. 218 3. Discussion 220 This document replaces an earlier proposal to modify the format of 221 the ACK frame by including a time stamp inside the modified frame. 222 The revised proposal encodes the time stamp independently of the ACK 223 frame, which requires slightly more overhead to encode the type of 224 the TIME_STAMP frame. 226 Defining an independent frame allows for more flexibility. This 227 draft defines the combination of TIME_STAMP with ACK frames, but they 228 could be combined with other frames as well. For example, adding a 229 TIME_STAMP to packets carrying a Path Response could allow measuring 230 one way delays before deciding to migrate to a new path. 232 3.1. Management of Time 234 There are two known issues with deducing one way delays from RTT 235 measurements: clock drift and undefined phase difference. 237 The phase difference problem is easy to understand. We start from a 238 list of measurements associating the send time of packet number x 239 (s[x]), the receive time of the acknowledgement of packet (a[x]), and 240 the time stamp indicating when packet x was received by the peer 241 (p[x]). The peer's time stamp are expressed in the peer's clock. 243 Suppose that we model the peer's clock as local time plus phase 244 difference f, and that we model the rtt as the sum of two one way 245 delays, up (u[x]) and down (d[x]). We get: 247 u[x] = p[x] + f - s[x] 249 d[x] = a[x] - p[x] - f 251 Just looking at the equation shows that the value of f cannot be 252 determined from the a series of measurement (s[x], a[x], p[x]). You 253 can just add constraints that all u[x] and d[x] are positive numbers, 254 which gives a range of plausible values for f: max(s[x] - p[x]) < f < 255 min(a[x]-p[x]). In case you wonder, you get similar formulations in 256 a multipath scenario. The plausible range may narrow to the min rtt 257 of the shortest path, but no further. 259 The phase difference uncertainty is not a big issue in practice, 260 because control algorithms are much more interested in the variations 261 of the delays than by their absolute values. Suppose we want to 262 compare one way delays at measurement (x) and (y). We get: 264 u[x] = p[x] + f - s[x] 266 u[y] = p[y] + f - s[y] 268 u[x] - u[y] = p[x] - p[y] - s[x] + s[y] 270 The phase difference does not affect the measurement of variations in 271 the one way delay. 273 The clock drift is another matter. All the equations above assume 274 that the local clock and the remote clock have the same frequency. 275 This is an approximation. Clocks drift over time. Instead of just 276 considering a stable phase difference, one should consider the sum of 277 a phase difference and a time-varying drift component. Estimating 278 drift is a complex problem. This was studied in detail in the 279 development of the Network Time Protocol (NTP) [RFC5905]. In theory, 280 implementations of Quic could copy the algorithms of NTP to build a 281 model of the clocks used by the local node and the peer. That would 282 be very complex. 284 Fortunately, implementations of Quic no not need to implement 285 something as complex as NTP. Most time based algorithms are only 286 interested in variations of delays over a short horizon. Clock drift 287 happens at a slow pace, maybe 1 millisecond per minute. Time base 288 congestion control algorithms already have to cope with the potential 289 drift of the minimum RTT due to changing network conditions. They do 290 that by periodically restarting themeasurement of the minimum RTT 291 after some delay, typically less than a minute. A simple 292 implementation of one way delay measurements could follow the same 293 approach, for example resetting the phase difference every 30 seconds 294 or so. 296 4. Security Considerations 298 The Timestamp value in the TIME_STAMP frame is asserted by the sender 299 of the packet. Adversarial peers could chose values of the time 300 stamp designed to exercise side effects in congestion control 301 algorithms or other algorithms relying on the one-way delays. This 302 can be mitigated by running plausibility checks on the received 303 values. For example, each peer can maintain statistics not just on 304 the One Way Delays, but also on the differences between One Way 305 Delays and RTT, and detect outlier values. Peers can also compare 306 the differences between timestamps in packets carrying 307 acknowledgements and the differences between the sending times of 308 corresponding packets, and detect anomalies if the delays between 309 acknowledging packets appears shorter than the delays when sending 310 them. 312 5. IANA Considerations 314 This document registers a new value in the QUIC Transport Parameter 315 Registry: 317 Value: TBD (using value 0x7157 in early deployments) 319 Parameter Name: enable_time_stamp 321 Specification: Indicates that the connection should use TimeStamped 322 ACK frames 324 This document also registers a new value in the QUIC Frame Type 325 registry: 327 Value: TBD (using value 757 in early deployments) 329 Frame Name: TIME_STAMP 331 Specification: Time stamp set at the time packet was sent 333 6. Acknowledgements 335 Thanks to Dmitri Tikhonov, Tal Misrahi and Watson Ladd for their 336 reviews and suggestions. 338 7. References 340 7.1. Normative References 342 [I-D.ietf-quic-recovery] 343 Iyengar, J. and I. Swett, "QUIC Loss Detection and 344 Congestion Control", draft-ietf-quic-recovery-26 (work in 345 progress), February 2020. 347 [I-D.ietf-quic-transport] 348 Iyengar, J. and M. Thomson, "QUIC: A UDP-Based Multiplexed 349 and Secure Transport", draft-ietf-quic-transport-27 (work 350 in progress), February 2020. 352 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 353 Requirement Levels", BCP 14, RFC 2119, 354 DOI 10.17487/RFC2119, March 1997, 355 . 357 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 358 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 359 May 2017, . 361 7.2. Informative References 363 [RFC5905] Mills, D., Martin, J., Ed., Burbank, J., and W. Kasch, 364 "Network Time Protocol Version 4: Protocol and Algorithms 365 Specification", RFC 5905, DOI 10.17487/RFC5905, June 2010, 366 . 368 [RFC6817] Shalunov, S., Hazel, G., Iyengar, J., and M. Kuehlewind, 369 "Low Extra Delay Background Transport (LEDBAT)", RFC 6817, 370 DOI 10.17487/RFC6817, December 2012, 371 . 373 Author's Address 374 Christian Huitema 375 Private Octopus Inc. 376 427 Golfcourse Rd 377 Friday Harbor WA 98250 378 U.S.A 380 Email: huitema@huitema.net