draft-ietf-core-too-many-reqs-05.txt   draft-ietf-core-too-many-reqs-06.txt 
Network Working Group A. Keranen Network Working Group A. Keranen
Internet-Draft Ericsson Internet-Draft Ericsson
Intended status: Standards Track October 22, 2018 Intended status: Standards Track November 7, 2018
Expires: April 25, 2019 Expires: May 11, 2019
Too Many Requests Response Code for the Constrained Application Protocol Too Many Requests Response Code for the Constrained Application Protocol
draft-ietf-core-too-many-reqs-05 draft-ietf-core-too-many-reqs-06
Abstract Abstract
A Constrained Application Protocol (CoAP) server can experience A Constrained Application Protocol (CoAP) server can experience
temporary overload because one or more clients are sending requests temporary overload because one or more clients are sending requests
to the server at a higher rate than the server is capable or willing to the server at a higher rate than the server is capable or willing
to handle. This document defines a new CoAP Response Code for a to handle. This document defines a new CoAP Response Code for a
server to indicate that a client should reduce the rate of requests. server to indicate that a client should reduce the rate of requests.
Status of This Memo Status of This Memo
skipping to change at page 1, line 34 skipping to change at page 1, line 34
Internet-Drafts are working documents of the Internet Engineering Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF). Note that other groups may also distribute Task Force (IETF). Note that other groups may also distribute
working documents as Internet-Drafts. The list of current Internet- working documents as Internet-Drafts. The list of current Internet-
Drafts is at https://datatracker.ietf.org/drafts/current/. Drafts is at https://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress." material or to cite them other than as "work in progress."
This Internet-Draft will expire on April 25, 2019. This Internet-Draft will expire on May 11, 2019.
Copyright Notice Copyright Notice
Copyright (c) 2018 IETF Trust and the persons identified as the Copyright (c) 2018 IETF Trust and the persons identified as the
document authors. All rights reserved. document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents Provisions Relating to IETF Documents
(https://trustee.ietf.org/license-info) in effect on the date of (https://trustee.ietf.org/license-info) in effect on the date of
publication of this document. Please review these documents publication of this document. Please review these documents
skipping to change at page 2, line 13 skipping to change at page 2, line 13
described in the Simplified BSD License. described in the Simplified BSD License.
Table of Contents Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2
2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 3 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 3
3. CoAP Server Behavior . . . . . . . . . . . . . . . . . . . . 3 3. CoAP Server Behavior . . . . . . . . . . . . . . . . . . . . 3
4. CoAP Client Behavior . . . . . . . . . . . . . . . . . . . . 3 4. CoAP Client Behavior . . . . . . . . . . . . . . . . . . . . 3
5. Security Considerations . . . . . . . . . . . . . . . . . . . 4 5. Security Considerations . . . . . . . . . . . . . . . . . . . 4
6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 4 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 4
7. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 4 7. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 5
8. References . . . . . . . . . . . . . . . . . . . . . . . . . 4 8. References . . . . . . . . . . . . . . . . . . . . . . . . . 5
8.1. Normative References . . . . . . . . . . . . . . . . . . 4 8.1. Normative References . . . . . . . . . . . . . . . . . . 5
8.2. Informative References . . . . . . . . . . . . . . . . . 5 8.2. Informative References . . . . . . . . . . . . . . . . . 5
Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 5 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 6
1. Introduction 1. Introduction
The Constrained Application Protocol (CoAP) [RFC7252] Response Codes The Constrained Application Protocol (CoAP) [RFC7252] Response Codes
are used by a CoAP server to indicate the result of the attempt to are used by a CoAP server to indicate the result of the attempt to
understand and satisfy a request sent by a client. understand and satisfy a request sent by a client.
CoAP Response Codes are similar to the HTTP [RFC7230] Status Codes CoAP Response Codes are similar to the HTTP [RFC7230] Status Codes
and many codes are shared with similar semantics by both CoAP and and many codes are shared with similar semantics by both CoAP and
HTTP. HTTP has the code "429" registered for "Too Many Requests" HTTP. HTTP has the code "429" registered for "Too Many Requests"
[RFC6585]. This document registers a CoAP Response Code "4.29" for [RFC6585]. This document registers a CoAP Response Code "4.29" for
similar purpose and also defines use of the Max-Age option (see similar purpose and uses the Max-Age option (see Section 5.10.5 of
Section 5.10.5 of [RFC7252]) to indicate a back-off period after [RFC7252]) to indicate a back-off period after which a client can try
which a client can try the request again. the request again.
While a server may not be able to respond to one kind of request, it While a server may not be able to respond to one kind of request, it
may be able to respond to a request of different kind, even from the may be able to respond to a request of different kind, even from the
same client. Therefore the back-off period applies only to similar same client. Therefore the back-off period applies only to similar
requests. For the purpose of this response code, a request is requests. For the purpose of this response code, a request is
similar if it has the same method and Request-URI. Also if a client similar if it has the same method and Request-URI. Also if a client
is sending a sequence of requests that are part of the same series is sending a sequence of requests that are part of the same series
(e.g., a set of measurements to be processed by the server) they can (e.g., a set of measurements to be processed by the server) they can
be considered similar even if request URIs may be different. Because be considered similar even if request URIs may be different. Because
request similarity is context-dependent, it is up to the application request similarity is context-dependent, it is up to the application
logic to decide how the similarity of the requests should be logic to decide how the similarity of the requests should be
evaluated. evaluated.
The 4.29 code is similar to the 5.03 "Service Unavailable" [RFC7252] The 4.29 code is similar to the 5.03 "Service Unavailable" [RFC7252]
code in a way that the 5.03 code can also be used by a server to code in a way that the 5.03 code can also be used by a server to
signal an overload situation. However the 4.29 code indicates that signal an overload situation. The 5.03 code also uses the Max-Age
the too frequent requests from the requesting client are the reason option to indicate the time after which a client can retry. However
for the overload. the 4.29 code indicates that the too-frequent requests from the
requesting client are the reason for the overload.
2. Terminology 2. Terminology
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
"OPTIONAL" in this document are to be interpreted as described in BCP "OPTIONAL" in this document are to be interpreted as described in BCP
14 [RFC2119] [RFC8174] when, and only when, they appear in all 14 [RFC2119] [RFC8174] when, and only when, they appear in all
capitals, as shown here. capitals, as shown here.
Readers should also be familiar with the terms and concepts discussed Readers should also be familiar with the terms and concepts discussed
skipping to change at page 3, line 29 skipping to change at page 3, line 29
request messages more often than the server is capable or willing to request messages more often than the server is capable or willing to
handle, the server SHOULD respond to the request(s) with the Response handle, the server SHOULD respond to the request(s) with the Response
Code 4.29, "Too Many Requests". The Max-Age option is used to Code 4.29, "Too Many Requests". The Max-Age option is used to
indicate the number of seconds after which the server assumes it is indicate the number of seconds after which the server assumes it is
OK for the client to retry the request. OK for the client to retry the request.
An action result payload (see Section 5.5.1 of [RFC7252]) can be sent An action result payload (see Section 5.5.1 of [RFC7252]) can be sent
by the server to give more guidance to the client, e.g., about the by the server to give more guidance to the client, e.g., about the
details of the overload situation. details of the overload situation.
The 4.29 Response Code is only returned to the client(s) sending
requests too frequently; if other clients are sending requests that
cannot be served due to server overload, the 5.03 Response Code is
more appropriate.
If a client repeats a request that was answered with 4.29 before Max- If a client repeats a request that was answered with 4.29 before Max-
Age time has passed, it is possible the client did not recognize the Age time has passed, it is possible that the client sent multiple
error code and the server MAY respond with a more generic error code requests before receiving the first answer or that the client did not
(e.g., 5.03). Server MAY also limit how often it answers to a recognize the Response Code. To slow down clients that do not
client, e.g., to once every estimated RTT (if such estimate is recognize the 4.29 code, the server MAY respond with a more generic
available). However, both of these methods add per-client state to error code (e.g., 5.03). The server SHOULD rate-limit 4.29 replies
the server which may be counterproductive to reducing load. taking into account its usual load shedding policies. However, any
such method that adds per-client state to the server may be
counterproductive to reducing load.
4. CoAP Client Behavior 4. CoAP Client Behavior
If a client receives the 4.29 Response Code from a CoAP server to a If a client receives the 4.29 Response Code from a CoAP server to a
request, it SHOULD NOT send a similar request to the server before request, it SHOULD NOT send a similar request to the server before
the time indicated in the Max-Age option has passed. the time indicated in the Max-Age option has passed. If the 4.29
response does not contain a Max-Age option, the default value (60
seconds, as defined in Section 5.10.5 of [RFC7252]) is assumed.
Note that a client may receive a 4.29 Response Code already on a Note that a client may receive a 4.29 Response Code already on a
first request to a server. This can happen, for example, if there is first request to a server. This can happen, for example, if there is
a proxy on the path and the server replies based on the load from a proxy on the path and the server replies based on the load from
multiple clients aggregated by the proxy, or if a client has multiple clients aggregated by the proxy, or if a client has
restarted recently and does not remember its recent requests. restarted recently and does not remember its recent requests.
A client MUST NOT rely on a server being able to send the 4.29 A client should not rely on a server being able to send the 4.29
Response Code in an overload situation because an overloaded server Response Code in an overload situation because an overloaded server
may not be able to reply at all to some requests. may not be able to reply at all to some requests.
5. Security Considerations 5. Security Considerations
Security considerations of [RFC7252] apply also to this Response
Code.
Replying to CoAP requests with a Response Code consumes resources Replying to CoAP requests with a Response Code consumes resources
from a server. For a server under attack it may be more appropriate from a server. For a server under attack it may be more appropriate
to simply drop requests without responding at all. However, dropping to simply drop requests without responding at all. However, dropping
requests is likely to cause also well-behaving clients to simply requests is likely to cause also well-behaving clients to simply
retry the requests. retry the requests.
As with any other CoAP reply, a client should trust this Response As with any other CoAP reply, a client should trust this Response
Code only to extent it trusts the underlying security mechanisms Code only to extent it trusts the underlying security mechanisms
(e.g., DTLS [RFC6347]) for authentication and freshness. If a CoAP (e.g., DTLS [RFC6347]) for authentication and freshness. If a CoAP
reply with the Too Many Requests Response Code is not authenticated reply with the Too Many Requests Response Code is not authenticated
skipping to change at page 4, line 36 skipping to change at page 4, line 49
IANA is requested to register the following Response Code in the IANA is requested to register the following Response Code in the
"CoRE Parameters Registry", "CoAP Response Codes" sub-registry: "CoRE Parameters Registry", "CoAP Response Codes" sub-registry:
o Response Code: 4.29 o Response Code: 4.29
o Description: Too Many Requests o Description: Too Many Requests
o Reference: [[This document]] o Reference: [[This document]]
IANA is requested to add this document as an additional reference for
the Max-Age option in the "CoAP Option Numbers" sub-registry.
7. Acknowledgements 7. Acknowledgements
This Response Code definition was originally part of the "Publish- This Response Code definition was originally part of the "Publish-
Subscribe Broker for CoAP" document [I-D.ietf-core-coap-pubsub]. Subscribe Broker for CoAP" document [I-D.ietf-core-coap-pubsub].
Author would like to thank Abhijan Bhattacharyya, Carsten Bormann, Author would like to thank Abhijan Bhattacharyya, Carsten Bormann,
Daniel Migault, Gyorgy Rethy, Jana Iyengar, Jim Schaad, Klaus Hartke, Daniel Migault, Gyorgy Rethy, Jana Iyengar, Jim Schaad, Klaus Hartke,
Mohit Sethi, and Sandor Katona for their contributions and reviews. Mohit Sethi, and Sandor Katona for their contributions and reviews.
8. References 8. References
 End of changes. 13 change blocks. 
22 lines changed or deleted 38 lines changed or added

This html diff was produced by rfcdiff 1.47. The latest version is available from http://tools.ietf.org/tools/rfcdiff/