idnits 2.17.1 draft-ietf-quic-datagram-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 (26 February 2020) is 1522 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) == Outdated reference: A later version (-34) exists of draft-ietf-quic-transport-27 == Outdated reference: A later version (-34) exists of draft-ietf-quic-recovery-26 -- Obsolete informational reference (is this intentional?): RFC 6347 (Obsoleted by RFC 9147) == Outdated reference: A later version (-05) exists of draft-schinazi-quic-h3-datagram-02 Summary: 0 errors (**), 0 flaws (~~), 4 warnings (==), 2 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group T. Pauly 3 Internet-Draft E. Kinnear 4 Intended status: Standards Track Apple Inc. 5 Expires: 29 August 2020 D. Schinazi 6 Google LLC 7 26 February 2020 9 An Unreliable Datagram Extension to QUIC 10 draft-ietf-quic-datagram-00 12 Abstract 14 This document defines an extension to the QUIC transport protocol to 15 add support for sending and receiving unreliable datagrams over a 16 QUIC connection. 18 Discussion of this work is encouraged to happen on the QUIC IETF 19 mailing list quic@ietf.org (mailto:quic@ietf.org) or on the GitHub 20 repository which contains the draft: https://github.com/quicwg/ 21 datagram (https://github.com/quicwg/datagram). 23 Status of This Memo 25 This Internet-Draft is submitted in full conformance with the 26 provisions of BCP 78 and BCP 79. 28 Internet-Drafts are working documents of the Internet Engineering 29 Task Force (IETF). Note that other groups may also distribute 30 working documents as Internet-Drafts. The list of current Internet- 31 Drafts is at https://datatracker.ietf.org/drafts/current/. 33 Internet-Drafts are draft documents valid for a maximum of six months 34 and may be updated, replaced, or obsoleted by other documents at any 35 time. It is inappropriate to use Internet-Drafts as reference 36 material or to cite them other than as "work in progress." 38 This Internet-Draft will expire on 29 August 2020. 40 Copyright Notice 42 Copyright (c) 2020 IETF Trust and the persons identified as the 43 document authors. All rights reserved. 45 This document is subject to BCP 78 and the IETF Trust's Legal 46 Provisions Relating to IETF Documents (https://trustee.ietf.org/ 47 license-info) in effect on the date of publication of this document. 48 Please review these documents carefully, as they describe your rights 49 and restrictions with respect to this document. Code Components 50 extracted from this document must include Simplified BSD License text 51 as described in Section 4.e of the Trust Legal Provisions and are 52 provided without warranty as described in the Simplified BSD License. 54 Table of Contents 56 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 57 1.1. Specification of Requirements . . . . . . . . . . . . . . 3 58 2. Motivation . . . . . . . . . . . . . . . . . . . . . . . . . 3 59 3. Transport Parameter . . . . . . . . . . . . . . . . . . . . . 4 60 4. Datagram Frame Type . . . . . . . . . . . . . . . . . . . . . 5 61 5. Behavior and Usage . . . . . . . . . . . . . . . . . . . . . 5 62 5.1. Acknowledgement Handling . . . . . . . . . . . . . . . . 6 63 5.2. Flow Control . . . . . . . . . . . . . . . . . . . . . . 6 64 5.3. Congestion Control . . . . . . . . . . . . . . . . . . . 7 65 6. Security Considerations . . . . . . . . . . . . . . . . . . . 7 66 7. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 7 67 8. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 8 68 9. References . . . . . . . . . . . . . . . . . . . . . . . . . 8 69 9.1. Normative References . . . . . . . . . . . . . . . . . . 8 70 9.2. Informative References . . . . . . . . . . . . . . . . . 8 71 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 9 73 1. Introduction 75 The QUIC Transport Protocol [I-D.ietf-quic-transport] provides a 76 secure, multiplexed connection for transmitting reliable streams of 77 application data. Reliability within QUIC is performed on a per- 78 stream basis, so some frame types are not eligible for 79 retransmission. 81 Some applications, particularly those that need to transmit real-time 82 data, prefer to transmit data unreliably. These applications can 83 build directly upon UDP [RFC0768] as a transport, and can add 84 security with DTLS [RFC6347]. Extending QUIC to support transmitting 85 unreliable application data would provide another option for secure 86 datagrams, with the added benefit of sharing a cryptographic and 87 authentication context used for reliable streams. 89 This document defines two new DATAGRAM QUIC frame types, which carry 90 application data without requiring retransmissions. 92 Discussion of this work is encouraged to happen on the QUIC IETF 93 mailing list quic@ietf.org (mailto:quic@ietf.org) or on the GitHub 94 repository which contains the draft: https://github.com/quicwg/ 95 datagram (https://github.com/quicwg/datagram). 97 1.1. Specification of Requirements 99 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 100 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 101 "OPTIONAL" in this document are to be interpreted as described in BCP 102 14 [RFC2119] [RFC8174] when, and only when, they appear in all 103 capitals, as shown here. 105 2. Motivation 107 Transmitting unreliable data over QUIC provides benefits over 108 existing solutions: 110 * Applications that open both a reliable TLS stream and an 111 unreliable DTLS flow to the same peer can benefit by sharing a 112 single handshake and authentication context between a reliable 113 QUIC stream and flow of unreliable QUIC datagrams. This can 114 reduce the latency required for handshakes. 116 * QUIC uses a more nuanced loss recovery mechanism than the DTLS 117 handshake, which has a basic packet loss retransmission timer. 118 This may allow loss recovery to occur more quickly for QUIC data. 120 * QUIC datagrams, while unreliable, can support acknowledgements, 121 allowing applications to be aware of whether a datagram was 122 successfully received. 124 * QUIC datagrams are subject to QUIC congestion control, allowing 125 applications to avoid implementing their own. 127 These reductions in connection latency, and application insight into 128 the delivery of datagrams, can be useful for optimizing audio/video 129 streaming applications, gaming applications, and other real-time 130 network applications. 132 Unreliable QUIC datagrams can also be used to implement an IP packet 133 tunnel over QUIC, such as for a Virtual Private Network (VPN). 134 Internet-layer tunneling protocols generally require a reliable and 135 authenticated handshake, followed by unreliable secure transmission 136 of IP packets. This can, for example, require a TLS connection for 137 the control data, and DTLS for tunneling IP packets. A single QUIC 138 connection could support both parts with the use of unreliable 139 datagrams. 141 3. Transport Parameter 143 Support for receiving the DATAGRAM frame types is advertised by means 144 of a QUIC Transport Parameter (name=max_datagram_frame_size, 145 value=0x0020). The max_datagram_frame_size transport parameter is an 146 integer value (represented as a variable-length integer) that 147 represents the maximum size of a DATAGRAM frame (including the frame 148 type, length, and payload) the endpoint is willing to receive, in 149 bytes. An endpoint that includes this parameter supports the 150 DATAGRAM frame types and is willing to receive such frames on this 151 connection. Endpoints MUST NOT send DATAGRAM frames until they have 152 sent and received the max_datagram_frame_size transport parameter. 153 Endpoints MUST NOT send DATAGRAM frames of size strictly larger than 154 the value of max_datagram_frame_size the endpoint has received from 155 its peer. An endpoint that receives a DATAGRAM frame when it has not 156 sent the max_datagram_frame_size transport parameter MUST terminate 157 the connection with error PROTOCOL_VIOLATION. An endpoint that 158 receives a DATAGRAM frame that is strictly larger than the value it 159 sent in its max_datagram_frame_size transport parameter MUST 160 terminate the connection with error PROTOCOL_VIOLATION. Endpoints 161 that wish to use DATAGRAM frames need to ensure they send a 162 max_datagram_frame_size value sufficient to allow their peer to use 163 them. It is RECOMMENDED to send the value 65536 in the 164 max_datagram_frame_size transport parameter as that indicates to the 165 peer that this endpoint will accept any DATAGRAM frame that fits 166 inside a QUIC packet. 168 When clients use 0-RTT, they MAY store the value of the server's 169 max_datagram_frame_size transport parameter. Doing so allows the 170 client to send DATAGRAM frames in 0-RTT packets. When servers decide 171 to accept 0-RTT data, they MUST send a max_datagram_frame_size 172 transport parameter greater or equal to the value they sent to the 173 client in the connection where they sent them the NewSessionTicket 174 message. If a client stores the value of the max_datagram_frame_size 175 transport parameter with their 0-RTT state, they MUST validate that 176 the new value of the max_datagram_frame_size transport parameter sent 177 by the server in the handshake is greater or equal to the stored 178 value; if not, the client MUST terminate the connection with error 179 PROTOCOL_VIOLATION. 181 Application protocols that use datagrams MUST define how they react 182 to the max_datagram_frame_size transport parameter being missing. If 183 datagram support is integral to the application, the application 184 protocol can fail the handshake if the max_datagram_frame_size 185 transport parameter is not present. 187 4. Datagram Frame Type 189 DATAGRAM frames are used to transmit application data in an 190 unreliable manner. The DATAGRAM frame type takes the form 0b0011000X 191 (or the values 0x30 and 0x31). The least significant bit of the 192 DATAGRAM frame type is the LEN bit (0x01). It indicates that there 193 is a Length field present. If this bit is set to 0, the Length field 194 is absent and the Datagram Data field extends to the end of the 195 packet. If this bit is set to 1, the Length field is present. 197 The DATAGRAM frame is structured as follows: 199 0 1 2 3 200 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 201 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 202 | [Length (i)] ... 203 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 204 | Datagram Data (*) ... 205 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 207 Figure 1: DATAGRAM Frame Format 209 DATAGRAM frames contain the following fields: 211 Length: A variable-length integer specifying the length of the 212 datagram in bytes. This field is present only when the LEN bit is 213 set. If the LEN bit is not set, the datagram data extends to the 214 end of the QUIC packet. Note that empty (i.e., zero-length) 215 datagrams are allowed. 217 Datagram Data: The bytes of the datagram to be delivered. 219 5. Behavior and Usage 221 When an application sends an unreliable datagram over a QUIC 222 connection, QUIC will generate a new DATAGRAM frame and send it in 223 the first available packet. This frame SHOULD be sent as soon as 224 possible, and MAY be coalesced with other frames. 226 When a QUIC endpoint receives a valid DATAGRAM frame, it SHOULD 227 deliver the data to the application immediately, as long as it is 228 able to process the frame and can store the contents in memory. 230 DATAGRAM frames MUST be protected with either 0-RTT or 1-RTT keys. 232 Application protocols using datagrams are responsible for defining 233 the semantics of the Datagram Data field, and how it is parsed. If 234 the application protocol supports the coexistence of multiple 235 entities using datagrams inside a single QUIC connection, it may need 236 a mechanism to allow demultiplexing between them. For example, using 237 datagrams with HTTP/3 involves prepending a flow identifier to all 238 datagrams, see [I-D.schinazi-quic-h3-datagram]. 240 Note that while the max_datagram_frame_size transport parameter 241 places a limit on the maximum size of DATAGRAM frames, that limit can 242 be further reduced by the max_packet_size transport parameter, and by 243 the Maximum Transmission Unit (MTU) of the path between endpoints. 244 DATAGRAM frames cannot be fragmented, therefore application protocols 245 need to handle cases where the maximum datagram size is limited by 246 other factors. 248 5.1. Acknowledgement Handling 250 Although DATAGRAM frames are not retransmitted upon loss detection, 251 they are ack-eliciting ([I-D.ietf-quic-recovery]). Receivers SHOULD 252 support delaying ACK frames (within the limits specified by 253 max_ack_delay) in reponse to receiving packets that only contain 254 DATAGRAM frames, since the timing of these acknowledgements is not 255 used for loss recovery. 257 If a sender detects that a packet containing a specific DATAGRAM 258 frame might have been lost, the implementation MAY notify the 259 application that it believes the datagram was lost. Similarly, if a 260 packet containing a DATAGRAM frame is acknowledged, the 261 implementation MAY notify the application that the datagram was 262 successfully transmitted and received. Note that, due to reordering, 263 a DATAGRAM frame that was thought to be lost could at a later point 264 be received and acknowledged. 266 5.2. Flow Control 268 DATAGRAM frames do not provide any explicit flow control signaling, 269 and do not contribute to any per-flow or connection-wide data limit. 271 The risk associated with not providing flow control for DATAGRAM 272 frames is that a receiver may not be able to commit the necessary 273 resources to process the frames. For example, it may not be able to 274 store the frame contents in memory. However, since DATAGRAM frames 275 are inherently unreliable, they MAY be dropped by the receiver if the 276 receiver cannot process them. 278 5.3. Congestion Control 280 DATAGRAM frames employ the QUIC connection's congestion controller. 281 As a result, a connection may be unable to send a DATAGRAM frame 282 generated by the application until the congestion controller allows 283 it [I-D.ietf-quic-recovery]. The sender implementation MUST 284 either delay sending the frame until the controller allows it or drop 285 the frame without sending it (at which point it MAY notify the 286 application). 288 Implementations can optionally support allowing the application to 289 specify a sending expiration time, beyond which a congestion- 290 controlled DATAGRAM frame ought to be dropped without transmission. 292 6. Security Considerations 294 The DATAGRAM frame shares the same security properties as the rest of 295 the data transmitted within a QUIC connection. All application data 296 transmitted with the DATAGRAM frame, like the STREAM frame, MUST be 297 protected either by 0-RTT or 1-RTT keys. 299 7. IANA Considerations 301 This document registers a new value in the QUIC Transport Parameter 302 Registry: 304 Value: 0x0020 (if this document is approved) 306 Parameter Name: max_datagram_frame_size 308 Specification: Indicates that the connection should enable support 309 for unreliable DATAGRAM frames. An endpoint that advertises this 310 transport parameter can receive datagrams frames from the other 311 endpoint, up to and including the length in bytes provided in the 312 transport parameter. 314 This document also registers a new value in the QUIC Frame Type 315 registry: 317 Value: 0x30 and 0x31 (if this document is approved) 319 Frame Name: DATAGRAM 321 Specification: Unreliable application data 323 8. Acknowledgments 325 Thanks to Ian Swett, who inspired this proposal. 327 9. References 329 9.1. Normative References 331 [I-D.ietf-quic-transport] 332 Iyengar, J. and M. Thomson, "QUIC: A UDP-Based Multiplexed 333 and Secure Transport", Work in Progress, Internet-Draft, 334 draft-ietf-quic-transport-27, 21 February 2020, 335 . 338 [I-D.ietf-quic-recovery] 339 Iyengar, J. and I. Swett, "QUIC Loss Detection and 340 Congestion Control", Work in Progress, Internet-Draft, 341 draft-ietf-quic-recovery-26, 21 February 2020, 342 . 345 9.2. Informative References 347 [RFC0768] Postel, J., "User Datagram Protocol", STD 6, RFC 768, 348 DOI 10.17487/RFC0768, August 1980, 349 . 351 [RFC6347] Rescorla, E. and N. Modadugu, "Datagram Transport Layer 352 Security Version 1.2", RFC 6347, DOI 10.17487/RFC6347, 353 January 2012, . 355 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 356 Requirement Levels", BCP 14, RFC 2119, 357 DOI 10.17487/RFC2119, March 1997, 358 . 360 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 361 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 362 May 2017, . 364 [I-D.schinazi-quic-h3-datagram] 365 Schinazi, D., "Using QUIC Datagrams with HTTP/3", Work in 366 Progress, Internet-Draft, draft-schinazi-quic-h3-datagram- 367 02, 4 November 2019, . 370 Authors' Addresses 372 Tommy Pauly 373 Apple Inc. 374 One Apple Park Way 375 Cupertino, California 95014, 376 United States of America 378 Email: tpauly@apple.com 380 Eric Kinnear 381 Apple Inc. 382 One Apple Park Way 383 Cupertino, California 95014, 384 United States of America 386 Email: ekinnear@apple.com 388 David Schinazi 389 Google LLC 390 1600 Amphitheatre Parkway 391 Mountain View, California 94043, 392 United States of America 394 Email: dschinazi.ietf@gmail.com