idnits 2.17.1 draft-pauly-quic-datagram-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 date (October 22, 2019) is 1648 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-recovery-23 == Outdated reference: A later version (-34) exists of draft-ietf-quic-transport-23 == Outdated reference: A later version (-05) exists of draft-schinazi-quic-h3-datagram-01 -- Obsolete informational reference (is this intentional?): RFC 6347 (Obsoleted by RFC 9147) 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: April 24, 2020 D. Schinazi 6 Google LLC 7 October 22, 2019 9 An Unreliable Datagram Extension to QUIC 10 draft-pauly-quic-datagram-04 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 Status of This Memo 20 This Internet-Draft is submitted in full conformance with the 21 provisions of BCP 78 and BCP 79. 23 Internet-Drafts are working documents of the Internet Engineering 24 Task Force (IETF). Note that other groups may also distribute 25 working documents as Internet-Drafts. The list of current Internet- 26 Drafts is at https://datatracker.ietf.org/drafts/current/. 28 Internet-Drafts are draft documents valid for a maximum of six months 29 and may be updated, replaced, or obsoleted by other documents at any 30 time. It is inappropriate to use Internet-Drafts as reference 31 material or to cite them other than as "work in progress." 33 This Internet-Draft will expire on April 24, 2020. 35 Copyright Notice 37 Copyright (c) 2019 IETF Trust and the persons identified as the 38 document authors. All rights reserved. 40 This document is subject to BCP 78 and the IETF Trust's Legal 41 Provisions Relating to IETF Documents 42 (https://trustee.ietf.org/license-info) in effect on the date of 43 publication of this document. Please review these documents 44 carefully, as they describe your rights and restrictions with respect 45 to this document. Code Components extracted from this document must 46 include Simplified BSD License text as described in Section 4.e of 47 the Trust Legal Provisions and are provided without warranty as 48 described in the Simplified BSD License. 50 Table of Contents 52 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 53 1.1. Specification of Requirements . . . . . . . . . . . . . . 2 54 2. Motivation . . . . . . . . . . . . . . . . . . . . . . . . . 3 55 3. Transport Parameter . . . . . . . . . . . . . . . . . . . . . 3 56 4. Datagram Frame Type . . . . . . . . . . . . . . . . . . . . . 4 57 5. Behavior and Usage . . . . . . . . . . . . . . . . . . . . . 4 58 5.1. Acknowledgement Handling . . . . . . . . . . . . . . . . 5 59 5.2. Flow Control . . . . . . . . . . . . . . . . . . . . . . 5 60 5.3. Congestion Control . . . . . . . . . . . . . . . . . . . 5 61 6. Security Considerations . . . . . . . . . . . . . . . . . . . 6 62 7. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 6 63 8. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 6 64 9. References . . . . . . . . . . . . . . . . . . . . . . . . . 6 65 9.1. Normative References . . . . . . . . . . . . . . . . . . 6 66 9.2. Informative References . . . . . . . . . . . . . . . . . 7 67 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 7 69 1. Introduction 71 The QUIC Transport Protocol [I-D.ietf-quic-transport] provides a 72 secure, multiplexed connection for transmitting reliable streams of 73 application data. Reliability within QUIC is performed on a per- 74 stream basis, so some frame types are not eligible for 75 retransmission. 77 Some applications, particularly those that need to transmit real-time 78 data, prefer to transmit data unreliably. These applications can 79 build directly upon UDP [RFC0768] as a transport, and can add 80 security with DTLS [RFC6347]. Extending QUIC to support transmitting 81 unreliable application data would provide another option for secure 82 datagrams, with the added benefit of sharing a cryptographic and 83 authentication context used for reliable streams. 85 This document defines four new DATAGRAM QUIC frame types, which carry 86 application data without requiring retransmissions. 88 1.1. Specification of Requirements 90 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 91 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 92 "OPTIONAL" in this document are to be interpreted as described in BCP 93 14 [RFC2119] [RFC8174] when, and only when, they appear in all 94 capitals, as shown here. 96 2. Motivation 98 Transmitting unreliable data over QUIC provides benefits over 99 existing solutions: 101 o Applications that open both a reliable TLS stream and an 102 unreliable DTLS flow to the same peer can benefit by sharing a 103 single handshake and authentication context between a reliable 104 QUIC stream and flow of unreliable QUIC datagrams. This can 105 reduce the latency required for handshakes. 107 o QUIC uses a more nuanced loss recovery mechanism than the DTLS 108 handshake, which has a basic packet loss retransmission timer. 109 This may allow loss recovery to occur more quickly for QUIC data. 111 o QUIC datagrams, while unreliable, can support acknowledgements, 112 allowing applications to be aware of whether a datagram was 113 successfully received. 115 These reductions in connection latency, and application insight into 116 the delivery of datagrams, can be useful for optimizing audio/video 117 streaming applications, gaming applications, and other real-time 118 network applications. 120 Unreliable QUIC datagrams can also be used to implement an IP packet 121 tunnel over QUIC, such as for a Virtual Private Network (VPN). 122 Internet-layer tunneling protocols generally require a reliable and 123 authenticated handshake, followed by unreliable secure transmission 124 of IP packets. This can, for example, require a TLS connection for 125 the control data, and DTLS for tunneling IP packets. A single QUIC 126 connection could support both parts with the use of unreliable 127 datagrams. 129 3. Transport Parameter 131 Support for receiving the DATAGRAM frame types is advertised by means 132 of a QUIC Transport Parameter (name=max_datagram_frame_size, 133 value=0x0020). The max_datagram_frame_size transport parameter is an 134 integer value (represented as a variable-length integer) that 135 represents the maximum size of a DATAGRAM frame (including the frame 136 type, length, and payload) the endpoint is willing to receive, in 137 bytes. An endpoint that includes this parameter supports the 138 DATAGRAM frame types and is willing to receive such frames on this 139 connection. Endpoints MUST NOT send DATAGRAM frames until they have 140 sent and received the max_datagram_frame_size transport parameter. 141 Endpoints MUST NOT send DATAGRAM frames of size strictly larger than 142 the value of max_datagram_frame_size the endpoint has received from 143 its peer. An endpoint that receives a DATAGRAM frame when it has not 144 sent the max_datagram_frame_size transport parameter MUST terminate 145 the connection with error PROTOCOL_VIOLATION. An endpoint that 146 receives a DATAGRAM frame that is strictly larger than the value it 147 sent in its max_datagram_frame_size transport parameter MUST 148 terminate the connection with error PROTOCOL_VIOLATION. 150 4. Datagram Frame Type 152 DATAGRAM frames are used to transmit application data in an 153 unreliable manner. The DATAGRAM frame type takes the form 0b0011000X 154 (or the values 0x30 and 0x31). The least significant bit of the 155 DATAGRAM frame type is the LEN bit (0x01). It indicates that there 156 is a Length field present. If this bit is set to 0, the Length field 157 is absent and the Datagram Data field extends to the end of the 158 packet. If this bit is set to 1, the Length field is present. 160 The DATAGRAM frame is structured as follows: 162 0 1 2 3 163 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 164 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 165 | [Length (i)] ... 166 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 167 | Datagram Data (*) ... 168 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 170 Figure 1: DATAGRAM Frame Format 172 DATAGRAM frames contain the following fields: 174 Length: A variable-length integer specifying the length of the 175 datagram in bytes. This field is present only when the LEN bit is 176 set. If the LEN bit is not set, the datagram data extends to the 177 end of the QUIC packet. 179 Datagram Data: The bytes of the datagram to be delivered. 181 5. Behavior and Usage 183 When an application sends an unreliable datagram over a QUIC 184 connection, QUIC will generate a new DATAGRAM frame and send it in 185 the first available packet. This frame SHOULD be sent as soon as 186 possible, and MAY be coalesced with other frames. 188 When a QUIC endpoint receives a valid DATAGRAM frame, it SHOULD 189 deliver the data to the application immediately, as long as it is 190 able to process the frame and can store the contents in memory. 192 DATAGRAM frames MUST be protected with either 0-RTT or 1-RTT keys. 194 Application protocols using datagrams might need to differentiate 195 categories or flows of datagrams being transmitted over a single QUIC 196 connection. Each application protocol is expected to define its own 197 mechanism for adding flow identifiers or similar mechanisms to the 198 datagram payloads being sent over the QUIC connection. For example, 199 the use of datagrams with HTTP/3 is defined in 200 [I-D.schinazi-quic-h3-datagram]. 202 5.1. Acknowledgement Handling 204 Although DATAGRAM frames are not retransmitted upon loss detection, 205 they are ack-eliciting ([I-D.ietf-quic-recovery]). Receivers SHOULD 206 support delaying ACK frames (within the limits specified by 207 max_ack_delay) in reponse to receiving packets that only contain 208 DATAGRAM frames, since the timing of these acknowledgements is not 209 used for loss recovery. 211 If a sender detects that a packet containing a specific DATAGRAM 212 frame has been lost, the implementation MAY notify the application 213 that the datagram was lost. Similarly, if a packet containing a 214 DATAGRAM frame is acknowledged, the implementation MAY notify the 215 application that the datagram was successfully transmitted and 216 received. 218 5.2. Flow Control 220 DATAGRAM frames do not provide any explicit flow control signaling, 221 and do not contribute to any per-flow or connection-wide data limit. 223 The risk associated with not providing flow control for DATAGRAM 224 frames is that a receiver may not be able to commit the necessary 225 resources to process the frames. For example, it may not be able to 226 store the frame contents in memory. However, since DATAGRAM frames 227 are inherently unreliable, they MAY be dropped by the receiver if the 228 receiver cannot process them. 230 5.3. Congestion Control 232 DATAGRAM frames are subject to a QUIC connection's congestion 233 control. Specifically, if a DATAGRAM frame is enqueued to be sent by 234 the application, but sending a packet with this frame is not allowed 235 by the congestion control window as specified in 236 [I-D.ietf-quic-recovery], the packet cannot be sent. The sender 237 implementation MUST either drop the frame without sending it (at 238 which point it MAY notify the application) or else delay sending the 239 frame until the window opens. 241 Implementations can optionally support allowing the application to 242 specify a sending expiration time, beyond which a congestion- 243 controlled DATAGRAM frame ought to be dropped without transmission. 245 6. Security Considerations 247 The DATAGRAM frame shares the same security properties as the rest of 248 the data transmitted within a QUIC connection. All application data 249 transmitted with the DATAGRAM frame, like the STREAM frame, MUST be 250 protected either by 0-RTT or 1-RTT keys. 252 7. IANA Considerations 254 This document registers a new value in the QUIC Transport Parameter 255 Registry: 257 Value: 0x0020 (if this document is approved) 259 Parameter Name: max_datagram_frame_size 261 Specification: Indicates that the connection should enable support 262 for unreliable DATAGRAM frames. An endpoint that advertises this 263 transport parameter can receive datagrams frames from the other 264 endpoint, up to and including the length in bytes provided in the 265 transport parameter. 267 This document also registers a new value in the QUIC Frame Type 268 registry: 270 Value: 0x30 and 0x31 (if this document is approved) 272 Frame Name: DATAGRAM 274 Specification: Unreliable application data 276 8. Acknowledgments 278 Thanks to Ian Swett, who inspired this proposal. 280 9. References 282 9.1. Normative References 284 [I-D.ietf-quic-recovery] 285 Iyengar, J. and I. Swett, "QUIC Loss Detection and 286 Congestion Control", draft-ietf-quic-recovery-23 (work in 287 progress), September 2019. 289 [I-D.ietf-quic-transport] 290 Iyengar, J. and M. Thomson, "QUIC: A UDP-Based Multiplexed 291 and Secure Transport", draft-ietf-quic-transport-23 (work 292 in progress), September 2019. 294 9.2. Informative References 296 [I-D.schinazi-quic-h3-datagram] 297 Schinazi, D., "Using QUIC Datagrams with HTTP/3", draft- 298 schinazi-quic-h3-datagram-01 (work in progress), October 299 2019. 301 [RFC0768] Postel, J., "User Datagram Protocol", STD 6, RFC 768, 302 DOI 10.17487/RFC0768, August 1980, 303 . 305 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 306 Requirement Levels", BCP 14, RFC 2119, 307 DOI 10.17487/RFC2119, March 1997, 308 . 310 [RFC6347] Rescorla, E. and N. Modadugu, "Datagram Transport Layer 311 Security Version 1.2", RFC 6347, DOI 10.17487/RFC6347, 312 January 2012, . 314 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 315 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 316 May 2017, . 318 Authors' Addresses 320 Tommy Pauly 321 Apple Inc. 322 One Apple Park Way 323 Cupertino, California 95014 324 United States of America 326 Email: tpauly@apple.com 328 Eric Kinnear 329 Apple Inc. 330 One Apple Park Way 331 Cupertino, California 95014 332 United States of America 334 Email: ekinnear@apple.com 335 David Schinazi 336 Google LLC 337 1600 Amphitheatre Parkway 338 Mountain View, California 94043 339 United States of America 341 Email: dschinazi.ietf@gmail.com