draft-ietf-core-hop-limit-02.txt   draft-ietf-core-hop-limit-03.txt 
CORE M. Boucadair CORE M. Boucadair
Internet-Draft Orange Internet-Draft Orange
Intended status: Standards Track T. Reddy Intended status: Standards Track T. Reddy
Expires: June 15, 2019 McAfee Expires: August 30, 2019 McAfee
J. Shallow J. Shallow
NCC Group NCC Group
December 12, 2018 February 26, 2019
Constrained Application Protocol (CoAP) Hop Limit Option Constrained Application Protocol (CoAP) Hop Limit Option
draft-ietf-core-hop-limit-02 draft-ietf-core-hop-limit-03
Abstract Abstract
The presence of Constrained Application Protocol (CoAP) proxies may The presence of Constrained Application Protocol (CoAP) proxies may
lead to infinite forwarding loops, which is undesirable. To prevent lead to infinite forwarding loops, which is undesirable. To prevent
and detect such loops, this document specifies the Hop-Limit CoAP and detect such loops, this document specifies the Hop-Limit CoAP
option. option.
Status of This Memo Status of This Memo
skipping to change at page 1, line 36 skipping to change at page 1, line 36
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 June 15, 2019. This Internet-Draft will expire on August 30, 2019.
Copyright Notice Copyright Notice
Copyright (c) 2018 IETF Trust and the persons identified as the Copyright (c) 2019 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
carefully, as they describe your rights and restrictions with respect carefully, as they describe your rights and restrictions with respect
to this document. Code Components extracted from this document must to this document. Code Components extracted from this document must
include Simplified BSD License text as described in Section 4.e of include Simplified BSD License text as described in Section 4.e of
the Trust Legal Provisions and are provided without warranty as the Trust Legal Provisions and are provided without warranty as
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 . . . . . . . . . . . . . . . . . . . . . . . . . 2 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 2
3. Hop-Limit Option . . . . . . . . . . . . . . . . . . . . . . 3 3. Hop-Limit Option . . . . . . . . . . . . . . . . . . . . . . 3
4. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 4 4. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 4
4.1. CoAP Response Code . . . . . . . . . . . . . . . . . . . 4 4.1. CoAP Response Code . . . . . . . . . . . . . . . . . . . 4
4.2. CoAP Option Number . . . . . . . . . . . . . . . . . . . 4 4.2. CoAP Option Number . . . . . . . . . . . . . . . . . . . 5
5. Security Considerations . . . . . . . . . . . . . . . . . . . 5 5. Security Considerations . . . . . . . . . . . . . . . . . . . 5
6. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 5 6. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 5
7. References . . . . . . . . . . . . . . . . . . . . . . . . . 5 7. References . . . . . . . . . . . . . . . . . . . . . . . . . 5
7.1. Normative References . . . . . . . . . . . . . . . . . . 5 7.1. Normative References . . . . . . . . . . . . . . . . . . 5
7.2. Informative References . . . . . . . . . . . . . . . . . 6 7.2. Informative References . . . . . . . . . . . . . . . . . 6
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 6 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 6
1. Introduction 1. Introduction
More and more applications are using Constrained Application Protocol More and more applications are using Constrained Application Protocol
skipping to change at page 2, line 50 skipping to change at page 3, line 5
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 be familiar with the terms and concepts defined in Readers should be familiar with the terms and concepts defined in
[RFC7252]. [RFC7252].
Within this document, CoAP agent refers to both CoAP client and CoAP
proxy.
3. Hop-Limit Option 3. Hop-Limit Option
Hop-Limit option (see Section 4.2) is an elective option used to The Hop-Limit option (see Section 4.2) is an elective option used to
detect and prevent infinite loops when proxies are involved. Only detect and prevent infinite loops when proxies are involved. The
one single instance of the option is allowed in a message. option is not repeatable. Therefore, any message carrying multiple
Therefore, any message carrying multiple Hop-Limit option instances Hop-Limit options MUST be rejected using 4.00 (Bad Request) error
MUST be rejected using 4.00 (Bad Request) error message. message.
The value of the Hop-Limit option is encoded as an 8-bit unsigned The value of the Hop-Limit option is encoded as an 8-bit unsigned
integer (see Section 3.2 of [RFC7252]). This value MUST be between 1 integer (see Section 3.2 of [RFC7252]). This value MUST be between 1
and 255 inclusive. CoAP messages received with a Hop-Limit option and 255 inclusive. CoAP messages received with a Hop-Limit option
set to '0' or greater than '255' MUST be rejected by a CoAP agent set to '0' or greater than '255' MUST be rejected by a CoAP server/
using 4.00 (Bad Request). proxy using 4.00 (Bad Request).
The Hop-Limit option is safe to forward. That is, a CoAP proxy which The Hop-Limit option is safe to forward. That is, a CoAP proxy which
does not understand the Hop-Limit option should forward it on. The does not understand the Hop-Limit option should forward it on. The
option is also part of the cache key. As such, a CoAP proxy which option is also part of the cache key. As such, a CoAP proxy which
does not understand the Hop-Limit option must follow the does not understand the Hop-Limit option must follow the
recommendations in Section 5.7.1 of [RFC7252] for caching. recommendations in Section 5.7.1 of [RFC7252] for caching. Note that
loops which involve only such proxies won't be detected.
Nevertheless, the presence of such proxies won't prevent infinite
loop detection if at least one CoAP proxy which support the Hop-Limit
option is involved in the loop.
If a CoAP proxy receives a request which does not include a Hop-Limit A CoAP proxy which understands the Hop-Limit option MAY be
option, it SHOULD insert a Hop-Limit option when relaying the request instructed, using a configuration parameter, to insert a Hop-Limit
to a next hop (absent explicit policy/configuration otherwise). option when relaying a request which do not include the Hop-Limit
option.
The initial Hop-Limit value SHOULD be configurable. If no initial The initial Hop-Limit value SHOULD be configurable. If no initial
value is explicitly provided, the default initial Hop-Limit value of value is explicitly provided, the default initial Hop-Limit value of
16 MUST be used. This value is chosen to be sufficiently large to 16 MUST be used. This value is chosen to be sufficiently large to
guarantee that a CoAP request would not be dropped in networks when guarantee that a CoAP request would not be dropped in networks when
there were no loops, but not so large as to consume CoAP proxy there were no loops, but not so large as to consume CoAP proxy
resources when a loop does occur. Lower values should be used with resources when a loop does occur. Lower values should be used with
caution and only in networks where topologies are known by the CoAP caution and only in networks where topologies are known by the CoAP
agent inserting the Hop-Limit option. client (or proxy) inserting the Hop-Limit option.
Because forwarding errors may occur if inadequate Hop-Limit values Because forwarding errors may occur if inadequate Hop-Limit values
are used, proxies at the boundaries of an administrative domain MAY are used, proxies at the boundaries of an administrative domain MAY
be instructed to remove or rewrite the value of Hop-Limit carried in be instructed to remove or rewrite the value of Hop-Limit carried in
received messages (i.e., ignore the value of Hop-Limit received in a received messages (i.e., ignore the value of Hop-Limit received in a
message). This modification should be done with caution in case message). This modification should be done with caution in case
proxy-forwarded traffic repeatedly crosses the administrative domain proxy-forwarded traffic repeatedly crosses the administrative domain
boundary in a loop and so Hop-Limit detection gets broken. boundary in a loop and so Hop-Limit detection gets broken.
Otherwise, a CoAP proxy which understands the Hop-Limit option MUST Otherwise, a CoAP proxy which understands the Hop-Limit option MUST
decrement the value of the option by 1 prior to forwarding it. A decrement the value of the option by 1 prior to forwarding it. A
CoAP proxy which understands the Hop-Limit option MUST NOT use a CoAP proxy which understands the Hop-Limit option MUST NOT use a
stored response unless the value of the Hop-Limit option in the stored TBA1 (Hop Limit Reached) error response unless the value of
presented request is less than or equal to the value of the Hop-Limit the Hop-Limit option in the presented request is less than or equal
option in the request used to obtain the stored response. to the value of the Hop-Limit option in the request used to obtain
the stored response. Otherwise, the CoAP proxy follows the behavior
in Section 5.6 of [RFC7252].
Note: If a request with a given value of Hop-Limit failed to reach
a server because the hop limit is exhausted, then the same failure
will be observed if a less value of the Hop-Limit option is used
instead.
CoAP messages MUST NOT be forwarded if the Hop-Limit option is set to CoAP messages MUST NOT be forwarded if the Hop-Limit option is set to
'0' after decrement. Messages that cannot be forwarded because of '0' after decrement. Messages that cannot be forwarded because of
exhausted Hop-Limit SHOULD be logged with a TBA1 (Hop Limit Reached) exhausted Hop-Limit SHOULD be logged with a TBA1 (Hop Limit Reached)
error message sent back to the CoAP peer. It is RECOMMENDED that error response sent back to the CoAP peer. It is RECOMMENDED that
CoAP agents support means to alert administrators about loop errors CoAP implementations support means to alert administrators about loop
so that appropriate actions are undertaken. errors so that appropriate actions are undertaken.
To ease debugging and troubleshooting, the CoAP proxy which detects a To ease debugging and troubleshooting, the CoAP proxy which detects a
loop SHOULD include its information (e.g., proxy name, proxy alias, loop SHOULD include its information (e.g., proxy name, proxy alias,
IP address) in the diagnostic payload under the conditions detailed IP address) in the diagnostic payload under the conditions detailed
in Section 5.5.2 of [RFC7252]. in Section 5.5.2 of [RFC7252]. That information MUST NOT include any
space character.
Each intermediate proxy involved in relaying a TBA1 (Hop Limit Each intermediate proxy involved in relaying a TBA1 (Hop Limit
Reached) error message SHOULD prepend its own information in the Reached) error message SHOULD prepend its own information in the
diagnostic payload with a space character used as separator. Only diagnostic payload with a space character used as separator. Only
one information per proxy SHOULD appear in the diagnostic payload. one information per proxy SHOULD appear in the diagnostic payload.
Doing so allows to limit the size of the TBA1 (Hop Limit Reached) Doing so allows to limit the size of the TBA1 (Hop Limit Reached)
error message, and to ease correlation with hops count. error message, and to ease correlation with hops count.
4. IANA Considerations 4. IANA Considerations
4.1. CoAP Response Code 4.1. CoAP Response Code
IANA is requested to add the following entry to the "CoAP Response IANA is requested to add the following entry to the "CoAP Response
Codes" sub-registry available at https://www.iana.org/assignments/ Codes" sub-registry available at https://www.iana.org/assignments/
core-parameters/core-parameters.xhtml#response-codes: core-parameters/core-parameters.xhtml#response-codes:
+------+------------------+-----------+ +------+------------------+-----------+
| Code | Description | Reference | | Code | Description | Reference |
+------+------------------+-----------+ +------+------------------+-----------+
| TBA1 | Hop Limit Reached| [RFCXXXX] | | TBA1 | Hop Limit Reached| [RFCXXXX] |
+------+------------------+-----------+ +------+------------------+-----------+
Table 1: CoAP Response Codes Table 1: CoAP Response Codes
This document suggests 5.06 as a code to be assigned for the new This document suggests 5.06 as a code to be assigned for the new
response code. response code.
Editorial Note: Please update TBA1 statements within the document Editorial Note: Please update TBA1 statements within the document
with the assigned code. with the assigned code.
4.2. CoAP Option Number 4.2. CoAP Option Number
IANA is requested to add the following entry to the "CoAP Option IANA is requested to add the following entry to the "CoAP Option
Numbers" sub-registry available at https://www.iana.org/assignments/ Numbers" sub-registry available at https://www.iana.org/assignments/
core-parameters/core-parameters.xhtml#option-numbers: core-parameters/core-parameters.xhtml#option-numbers:
+--------+---+---+---+---+------------------+-----------+ +--------+---+---+---+---+------------------+-----------+
| Number | C | U | N | R | Name | Reference | | Number | C | U | N | R | Name | Reference |
+--------+---+---+---+---+------------------+-----------+ +--------+---+---+---+---+------------------+-----------+
| TBA2 | | | | | Hop-Limit | [RFCXXXX] | | TBA2 | | | | | Hop-Limit | [RFCXXXX] |
+--------+---+---+---+---+------------------+-----------+ +--------+---+---+---+---+------------------+-----------+
C=Critical, U=Unsafe, N=NoCacheKey, R=Repeatable C=Critical, U=Unsafe, N=NoCacheKey, R=Repeatable
Table 2: CoAP Option Number Table 2: CoAP Option Number
5. Security Considerations 5. Security Considerations
Security considerations related to CoAP proxying are discussed in Security considerations related to CoAP proxying are discussed in
Section 11.2 of [RFC7252]. Section 11.2 of [RFC7252].
The diagnostic payload of a TBA1 (Hop Limit Reached) error message The diagnostic payload of a TBA1 (Hop Limit Reached) error message
may leak sensitive information revealing the topology of an may leak sensitive information revealing the topology of an
administrative domain. To prevent that, a CoAP proxy which is administrative domain. To prevent that, a CoAP proxy which is
located at the boundary of an administrative domain MAY be instructed located at the boundary of an administrative domain MAY be instructed
to strip the diagnostic payload or part of it before forwarding on to strip the diagnostic payload or part of it before forwarding on
the TBA1 response. the TBA1 response.
6. Acknowledgements 6. Acknowledgements
This specification was part of [I-D.ietf-dots-signal-channel]. Many This specification was part of [I-D.ietf-dots-signal-channel]. Many
thanks to those who reviewed DOTS specifications. thanks to those who reviewed DOTS specifications.
Thanks to Klaus Hartke, Carsten Bormann, Peter van der Stok, and Jim Thanks to Klaus Hartke, Carsten Bormann, Peter van der Stok, and Jim
Schaad for the review. Schaad for the reviews.
7. References 7. References
7.1. Normative References 7.1. Normative References
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", BCP 14, RFC 2119, Requirement Levels", BCP 14, RFC 2119,
DOI 10.17487/RFC2119, March 1997, DOI 10.17487/RFC2119, March 1997,
<https://www.rfc-editor.org/info/rfc2119>. <https://www.rfc-editor.org/info/rfc2119>.
skipping to change at page 6, line 11 skipping to change at page 6, line 25
[RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC
2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174,
May 2017, <https://www.rfc-editor.org/info/rfc8174>. May 2017, <https://www.rfc-editor.org/info/rfc8174>.
7.2. Informative References 7.2. Informative References
[I-D.ietf-dots-signal-channel] [I-D.ietf-dots-signal-channel]
K, R., Boucadair, M., Patil, P., Mortensen, A., and N. K, R., Boucadair, M., Patil, P., Mortensen, A., and N.
Teague, "Distributed Denial-of-Service Open Threat Teague, "Distributed Denial-of-Service Open Threat
Signaling (DOTS) Signal Channel Specification", draft- Signaling (DOTS) Signal Channel Specification", draft-
ietf-dots-signal-channel-25 (work in progress), September ietf-dots-signal-channel-28 (work in progress), January
2018. 2019.
Authors' Addresses Authors' Addresses
Mohamed Boucadair Mohamed Boucadair
Orange Orange
Rennes 35000 Rennes 35000
France France
Email: mohamed.boucadair@orange.com Email: mohamed.boucadair@orange.com
 End of changes. 21 change blocks. 
44 lines changed or deleted 54 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/