idnits 2.17.1 draft-ietf-core-too-many-reqs-05.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, 2018) is 2013 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 (-14) exists of draft-ietf-core-coap-pubsub-05 -- Obsolete informational reference (is this intentional?): RFC 6347 (Obsoleted by RFC 9147) -- Obsolete informational reference (is this intentional?): RFC 7230 (Obsoleted by RFC 9110, RFC 9112) Summary: 0 errors (**), 0 flaws (~~), 2 warnings (==), 3 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group A. Keranen 3 Internet-Draft Ericsson 4 Intended status: Standards Track October 22, 2018 5 Expires: April 25, 2019 7 Too Many Requests Response Code for the Constrained Application Protocol 8 draft-ietf-core-too-many-reqs-05 10 Abstract 12 A Constrained Application Protocol (CoAP) server can experience 13 temporary overload because one or more clients are sending requests 14 to the server at a higher rate than the server is capable or willing 15 to handle. This document defines a new CoAP Response Code for a 16 server to indicate that a client should reduce the rate of requests. 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 25, 2019. 35 Copyright Notice 37 Copyright (c) 2018 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 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 3 54 3. CoAP Server Behavior . . . . . . . . . . . . . . . . . . . . 3 55 4. CoAP Client Behavior . . . . . . . . . . . . . . . . . . . . 3 56 5. Security Considerations . . . . . . . . . . . . . . . . . . . 4 57 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 4 58 7. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 4 59 8. References . . . . . . . . . . . . . . . . . . . . . . . . . 4 60 8.1. Normative References . . . . . . . . . . . . . . . . . . 4 61 8.2. Informative References . . . . . . . . . . . . . . . . . 5 62 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 5 64 1. Introduction 66 The Constrained Application Protocol (CoAP) [RFC7252] Response Codes 67 are used by a CoAP server to indicate the result of the attempt to 68 understand and satisfy a request sent by a client. 70 CoAP Response Codes are similar to the HTTP [RFC7230] Status Codes 71 and many codes are shared with similar semantics by both CoAP and 72 HTTP. HTTP has the code "429" registered for "Too Many Requests" 73 [RFC6585]. This document registers a CoAP Response Code "4.29" for 74 similar purpose and also defines use of the Max-Age option (see 75 Section 5.10.5 of [RFC7252]) to indicate a back-off period after 76 which a client can try the request again. 78 While a server may not be able to respond to one kind of request, it 79 may be able to respond to a request of different kind, even from the 80 same client. Therefore the back-off period applies only to similar 81 requests. For the purpose of this response code, a request is 82 similar if it has the same method and Request-URI. Also if a client 83 is sending a sequence of requests that are part of the same series 84 (e.g., a set of measurements to be processed by the server) they can 85 be considered similar even if request URIs may be different. Because 86 request similarity is context-dependent, it is up to the application 87 logic to decide how the similarity of the requests should be 88 evaluated. 90 The 4.29 code is similar to the 5.03 "Service Unavailable" [RFC7252] 91 code in a way that the 5.03 code can also be used by a server to 92 signal an overload situation. However the 4.29 code indicates that 93 the too frequent requests from the requesting client are the reason 94 for the overload. 96 2. Terminology 98 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 99 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 100 "OPTIONAL" in this document are to be interpreted as described in BCP 101 14 [RFC2119] [RFC8174] when, and only when, they appear in all 102 capitals, as shown here. 104 Readers should also be familiar with the terms and concepts discussed 105 in [RFC7252]. 107 3. CoAP Server Behavior 109 If a CoAP server is unable to serve a client that is sending CoAP 110 request messages more often than the server is capable or willing to 111 handle, the server SHOULD respond to the request(s) with the Response 112 Code 4.29, "Too Many Requests". The Max-Age option is used to 113 indicate the number of seconds after which the server assumes it is 114 OK for the client to retry the request. 116 An action result payload (see Section 5.5.1 of [RFC7252]) can be sent 117 by the server to give more guidance to the client, e.g., about the 118 details of the overload situation. 120 If a client repeats a request that was answered with 4.29 before Max- 121 Age time has passed, it is possible the client did not recognize the 122 error code and the server MAY respond with a more generic error code 123 (e.g., 5.03). Server MAY also limit how often it answers to a 124 client, e.g., to once every estimated RTT (if such estimate is 125 available). However, both of these methods add per-client state to 126 the server which may be counterproductive to reducing load. 128 4. CoAP Client Behavior 130 If a client receives the 4.29 Response Code from a CoAP server to a 131 request, it SHOULD NOT send a similar request to the server before 132 the time indicated in the Max-Age option has passed. 134 Note that a client may receive a 4.29 Response Code already on a 135 first request to a server. This can happen, for example, if there is 136 a proxy on the path and the server replies based on the load from 137 multiple clients aggregated by the proxy, or if a client has 138 restarted recently and does not remember its recent requests. 140 A client MUST NOT rely on a server being able to send the 4.29 141 Response Code in an overload situation because an overloaded server 142 may not be able to reply at all to some requests. 144 5. Security Considerations 146 Replying to CoAP requests with a Response Code consumes resources 147 from a server. For a server under attack it may be more appropriate 148 to simply drop requests without responding at all. However, dropping 149 requests is likely to cause also well-behaving clients to simply 150 retry the requests. 152 As with any other CoAP reply, a client should trust this Response 153 Code only to extent it trusts the underlying security mechanisms 154 (e.g., DTLS [RFC6347]) for authentication and freshness. If a CoAP 155 reply with the Too Many Requests Response Code is not authenticated 156 and integrity protected, an attacker can attempt to spoof a reply and 157 make the client wait for an extended period of time before trying 158 again. 160 If the Response Code is sent without encryption, it may leak 161 information about the server overload situation and client traffic 162 patterns. 164 6. IANA Considerations 166 IANA is requested to register the following Response Code in the 167 "CoRE Parameters Registry", "CoAP Response Codes" sub-registry: 169 o Response Code: 4.29 171 o Description: Too Many Requests 173 o Reference: [[This document]] 175 7. Acknowledgements 177 This Response Code definition was originally part of the "Publish- 178 Subscribe Broker for CoAP" document [I-D.ietf-core-coap-pubsub]. 179 Author would like to thank Abhijan Bhattacharyya, Carsten Bormann, 180 Daniel Migault, Gyorgy Rethy, Jana Iyengar, Jim Schaad, Klaus Hartke, 181 Mohit Sethi, and Sandor Katona for their contributions and reviews. 183 8. References 185 8.1. Normative References 187 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 188 Requirement Levels", BCP 14, RFC 2119, 189 DOI 10.17487/RFC2119, March 1997, 190 . 192 [RFC7252] Shelby, Z., Hartke, K., and C. Bormann, "The Constrained 193 Application Protocol (CoAP)", RFC 7252, 194 DOI 10.17487/RFC7252, June 2014, 195 . 197 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 198 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 199 May 2017, . 201 8.2. Informative References 203 [I-D.ietf-core-coap-pubsub] 204 Koster, M., Keranen, A., and J. Jimenez, "Publish- 205 Subscribe Broker for the Constrained Application Protocol 206 (CoAP)", draft-ietf-core-coap-pubsub-05 (work in 207 progress), July 2018. 209 [RFC6347] Rescorla, E. and N. Modadugu, "Datagram Transport Layer 210 Security Version 1.2", RFC 6347, DOI 10.17487/RFC6347, 211 January 2012, . 213 [RFC6585] Nottingham, M. and R. Fielding, "Additional HTTP Status 214 Codes", RFC 6585, DOI 10.17487/RFC6585, April 2012, 215 . 217 [RFC7230] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer 218 Protocol (HTTP/1.1): Message Syntax and Routing", 219 RFC 7230, DOI 10.17487/RFC7230, June 2014, 220 . 222 Author's Address 224 Ari Keranen 225 Ericsson 227 Email: ari.keranen@ericsson.com