draft-ietf-core-hop-limit-06.txt   draft-ietf-core-hop-limit-07.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: March 30, 2020 McAfee Expires: April 19, 2020 McAfee
J. Shallow J. Shallow
September 27, 2019 October 17, 2019
Constrained Application Protocol (CoAP) Hop-Limit Option Constrained Application Protocol (CoAP) Hop-Limit Option
draft-ietf-core-hop-limit-06 draft-ietf-core-hop-limit-07
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 35 skipping to change at page 1, line 35
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 March 30, 2020. This Internet-Draft will expire on April 19, 2020.
Copyright Notice Copyright Notice
Copyright (c) 2019 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
skipping to change at page 2, line 21 skipping to change at page 2, line 21
2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 3 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 3
3. Hop-Limit Option . . . . . . . . . . . . . . . . . . . . . . 3 3. Hop-Limit Option . . . . . . . . . . . . . . . . . . . . . . 3
4. Debugging & Troubleshooting . . . . . . . . . . . . . . . . . 5 4. Debugging & Troubleshooting . . . . . . . . . . . . . . . . . 5
5. HTTP-Mapping Considerations . . . . . . . . . . . . . . . . . 5 5. HTTP-Mapping Considerations . . . . . . . . . . . . . . . . . 5
6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 6 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 6
6.1. CoAP Response Code . . . . . . . . . . . . . . . . . . . 6 6.1. CoAP Response Code . . . . . . . . . . . . . . . . . . . 6
6.2. CoAP Option Number . . . . . . . . . . . . . . . . . . . 6 6.2. CoAP Option Number . . . . . . . . . . . . . . . . . . . 6
7. Security Considerations . . . . . . . . . . . . . . . . . . . 7 7. Security Considerations . . . . . . . . . . . . . . . . . . . 7
8. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 7 8. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 7
9. References . . . . . . . . . . . . . . . . . . . . . . . . . 7 9. References . . . . . . . . . . . . . . . . . . . . . . . . . 7
9.1. Normative References . . . . . . . . . . . . . . . . . . 7 9.1. Normative References . . . . . . . . . . . . . . . . . . 8
9.2. Informative References . . . . . . . . . . . . . . . . . 8 9.2. Informative References . . . . . . . . . . . . . . . . . 8
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 8 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 8
1. Introduction 1. Introduction
More and more applications are using the Constrained Application More and more applications are using the Constrained Application
Protocol (CoAP) [RFC7252] as a communication protocol between Protocol (CoAP) [RFC7252] as a communication protocol between
involved application agents. For example, application agents. For example, [I-D.ietf-dots-signal-channel]
[I-D.ietf-dots-signal-channel] specifies how CoAP is used as a specifies how CoAP is used as a signaling protocol between domains
signaling protocol between domains under distributed denial-of- under distributed denial-of-service (DDoS) attacks and DDoS
service (DDoS) attacks and DDoS mitigation providers. In such mitigation providers. In such contexts, a CoAP client can
contexts, a CoAP client can communicate directly with a server or communicate directly with a server or indirectly via proxies.
indirectly via proxies.
When multiple proxies are involved, infinite forwarding loops may be When multiple proxies are involved, infinite forwarding loops may be
experienced (e.g., routing misconfiguration, policy conflicts). To experienced (e.g., routing misconfiguration, policy conflicts). To
prevent such loops, this document defines a new CoAP option, called prevent such loops, this document defines a new CoAP option, called
Hop-Limit (Section 3). Also, the document defines a new CoAP Hop-Limit (Section 3). Also, the document defines a new CoAP
Response Code (Section 6.1) to report loops together with relevant Response Code (Section 6.1) to report loops together with relevant
diagnostic information to ease troubleshooting (Section 4). diagnostic information to ease troubleshooting (Section 4).
1.1. Intended Usage 1.1. Intended Usage
The Hop-Limit option has originally been designed for a specific use The Hop-Limit option was originally designed for a specific use case
case [I-D.ietf-dots-signal-channel]. However, its intended usage is [I-D.ietf-dots-signal-channel]. However, its intended usage is
general: CoAP proxies that do not have specific knowledge that proxy general:
forwarding loops are avoided in some other way, are expected to
implement this option and have it enabled by default. New CoAP proxies MUST implement this option and have it enabled by
default.
Note that this means that a server that receives requests both via Note that this means that a server that receives requests both via
proxies and directly from clients may see otherwise identical proxies and directly from clients may see otherwise identical
requests with and without the Hop-Limit option included; servers with requests with and without the Hop-Limit option included; servers with
internal caching will therefore also want to implement this option. internal caching will therefore also want to implement this option,
since understanding the Hop-Limit option will improve caching
efficiency.
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 be familiar with the terms and concepts defined in Readers should be familiar with the terms and concepts defined in
[RFC7252]. [RFC7252].
3. Hop-Limit Option 3. Hop-Limit Option
The properties of the Hop-Limit option are shown in Table 1. In this The properties of the Hop-Limit option are shown in Table 1. The
table, the C, U, N, and R columns indicate the properties Critical, formatting of this table follows the one used in Table 4 of [RFC7252]
Unsafe, NoCacheKey, and Repeatable defined in Section 5.4 of (Section 5.10). The C, U, N, and R columns indicate the properties
[RFC7252]. Critical, Unsafe, NoCacheKey, and Repeatable defined in Section 5.4
of [RFC7252]. None of these properties is marked for the Hop-Limit
option.
+--------+---+---+---+---+-----------+--------+--------+---------+ +--------+---+---+---+---+-----------+--------+--------+---------+
| Number | C | U | N | R | Name | Format | Length | Default | | Number | C | U | N | R | Name | Format | Length | Default |
+--------+---+---+---+---+-----------+--------+--------+---------+ +--------+---+---+---+---+-----------+--------+--------+---------+
| TBA2 | | | | | Hop-Limit | uint | 1 | 16 | | TBA2 | | | | | Hop-Limit | uint | 1 | 16 |
+--------+---+---+---+---+-----------+--------+--------+---------+ +--------+---+---+---+---+-----------+--------+--------+---------+
Table 1: CoAP Hop-Limit Option Properties Table 1: CoAP Hop-Limit Option Properties
The Hop-Limit option (Section 6.2) is an elective option used to The Hop-Limit option (Section 6.2) is an elective option used to
detect and prevent infinite loops when proxies are involved. The detect and prevent infinite loops of CoAP requests when proxies are
option is not repeatable. Therefore, any message carrying multiple involved. The option is not repeatable. Therefore, any request
Hop-Limit options MUST be handled following the procedure specified carrying multiple Hop-Limit options MUST be handled following the
in Section 5.4.5 of [RFC7252]. procedure specified in Section 5.4.5 of [RFC7252].
The value of the Hop-Limit option is encoded as an unsigned integer The value of the Hop-Limit option is encoded as an unsigned integer
(see Section 3.2 of [RFC7252]). This value MUST be between 1 and 255 (see Section 3.2 of [RFC7252]). This value MUST be between 1 and 255
inclusive. CoAP messages received with a Hop-Limit option set to '0' inclusive. CoAP requests received with a Hop-Limit option set to '0'
or greater than '255' MUST be rejected by a CoAP server/proxy using or greater than '255' MUST be rejected by a CoAP server/proxy using
4.00 (Bad Request). 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 that
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 that
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. Note that recommendations in Section 5.7.1 of [RFC7252] for caching. Note that
loops which involve only such proxies will not be detected. loops that involve only such proxies will not be detected.
Nevertheless, the presence of such proxies will not prevent infinite Nevertheless, the presence of such proxies will not prevent infinite
loop detection if at least one CoAP proxy which support the Hop-Limit loop detection if at least one CoAP proxy that supports the Hop-Limit
option is involved in the loop. option is involved in the loop.
A CoAP proxy which understands the Hop-Limit option MAY be A CoAP proxy that understands the Hop-Limit option SHOULD be
instructed, using a configuration parameter, to insert a Hop-Limit instructed, using a configuration parameter, to insert a Hop-Limit
option when relaying a request which do not include the Hop-Limit option when relaying a request that does not include the Hop-Limit
option. 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 so that in the majority of
guarantee that a CoAP request would not be dropped in networks when cases it is sufficiently large to guarantee that a CoAP request would
there were no loops, but not so large as to consume CoAP proxy not be dropped in networks when there were no loops, but not so large
resources when a loop does occur. Lower values should be used with as to consume CoAP proxy resources when a loop does occur. The value
caution and only in networks where topologies are known by the CoAP is still configurable to accommodate unusual topologies. Lower
client (or proxy) inserting the Hop-Limit option. values should be used with caution and only in networks where
topologies are known by the CoAP 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 requests (i.e., ignore the value of Hop-Limit received in a
message). This modification should be done with caution in case request). 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 rendering ineffective the efficacy of loop
detection through the Hop-Limit option.
Otherwise, a CoAP proxy which understands the Hop-Limit option MUST Otherwise, a CoAP proxy that 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 that understands the Hop-Limit option MUST NOT use a
stored TBA1 (Hop Limit Reached) error response unless the value of stored TBA1 (Hop Limit Reached) error response unless the value of
the Hop-Limit option in the presented request is less than or equal the Hop-Limit option in the presented request is smaller than or
to the value of the Hop-Limit option in the request used to obtain equal to the value of the Hop-Limit option in the request used to
the stored response. Otherwise, the CoAP proxy follows the behavior obtain the stored response. Otherwise, the CoAP proxy follows the
in Section 5.6 of [RFC7252]. behavior in Section 5.6 of [RFC7252].
Note: If a request with a given value of Hop-Limit failed to reach 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 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 will be observed if a smaller value of the Hop-Limit option is
instead. used instead.
CoAP messages MUST NOT be forwarded if the Hop-Limit option is set to CoAP requests 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. Requests 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 response sent back to the CoAP peer. It is RECOMMENDED that error response sent back to the CoAP peer. It is RECOMMENDED that
CoAP implementations support means to alert administrators about loop CoAP implementations support means to alert administrators about loop
errors so that appropriate actions are undertaken. errors so that appropriate actions are undertaken.
4. Debugging & Troubleshooting 4. Debugging & Troubleshooting
To ease debugging and troubleshooting, the CoAP proxy which detects a To ease debugging and troubleshooting, the CoAP proxy that detects a
loop includes its information in the diagnostic payload under the loop includes an identifier for itself in the diagnostic payload
conditions detailed in Section 5.5.2 of [RFC7252]. That information under the conditions detailed in Section 5.5.2 of [RFC7252]. That
MUST NOT include any space character. The information inserted by a identifier MUST NOT include any space character (ASCII value 32).
CoAP proxy can be, for example, a proxy name (e.g., p11.example.net), The identifier inserted by a CoAP proxy can be, for example, a proxy
proxy alias (e.g., myproxyalias), or IP address (e.g., 2001:db8::1). name (e.g., p11.example.net), proxy alias (e.g., myproxyalias), or IP
address (e.g., 2001:db8::1).
Each intermediate proxy involved in relaying a TBA1 (Hop Limit Each intermediate proxy involved in relaying a TBA1 (Hop Limit
Reached) error message prepends its own information in the diagnostic Reached) error message prepends its own identifier in the diagnostic
payload with a space character used as separator. Only one payload with a space character used as separator. Only one
information per proxy should appear in the diagnostic payload. Doing identifier per proxy should appear in the diagnostic payload. This
so allows to limit the size of the TBA1 (Hop Limit Reached) error approach allows to limit the size of the TBA1 (Hop Limit Reached)
message, and to ease correlation with hops count. Note that an error message, ease correlation with hops count, and detect whether a
intermediate proxy prepends its information only if there is enough proxy was involved in the forwarding of the TBA1 (Hop Limit Reached)
space as determined by the Path MTU (Section 4.6 of [RFC7252]). If error message. Note that an intermediate proxy prepends its
not, an intermediate proxy forwards the TBA1 (Hop Limit Reached) identifier only if there is enough space as determined by the Path
error message to the next hop without updating the diagnostic MTU (Section 4.6 of [RFC7252]). If not, an intermediate proxy
payload. forwards the TBA1 (Hop Limit Reached) error message to the next hop
without updating the diagnostic payload.
An intermediate proxy MUST NOT forward a TBA1 (Hop Limit Reached)
error message if it detects that its identifier is included in the
diagnostic payload. Such messages SHOULD be logged and appropriate
alerts sent to the administrators.
5. HTTP-Mapping Considerations 5. HTTP-Mapping Considerations
This section focuses on the HTTP mappings specific to the CoAP This section focuses on the HTTP mappings specific to the CoAP
extension specified in this document. As a reminder, the basic extension specified in this document. As a reminder, the basic
normative requirements on HTTP/CoAP mappings are defined in normative requirements on HTTP/CoAP mappings are defined in
Section 10 of [RFC7252]. The implementation guidelines for HTTP/CoAP Section 10 of [RFC7252]. The implementation guidelines for HTTP/CoAP
mappings are elaborated in [RFC8075]. mappings are elaborated in [RFC8075].
By default, the HTTP-to-CoAP Proxy inserts a Hop-Limit option By default, the HTTP-to-CoAP Proxy inserts a Hop-Limit option
following the guidelines in Section 3. The HTTP-to-CoAP Proxy MAY be following the guidelines in Section 3. The HTTP-to-CoAP Proxy may be
instructed by policy to insert a Hop-Limit option only if a Via instructed by policy to insert a Hop-Limit option only if a Via
(Section 5.7.1 of [RFC7230]) or CDN-Loop header field [RFC8586] is (Section 5.7.1 of [RFC7230]) or CDN-Loop header field [RFC8586] is
present in the HTTP request. present in the HTTP request.
The HTTP-to-CoAP Proxy uses 508 (Loop Detected) as the HTTP response The HTTP-to-CoAP Proxy uses 508 (Loop Detected) as the HTTP response
status code to map TBA1 (Hop Limit Reached). Furthermore, it maps status code to map TBA1 (Hop Limit Reached). Furthermore, it maps
the diagnostic payload of TBA1 (Hop Limit Reached) as per Section 6.6 the diagnostic payload of TBA1 (Hop Limit Reached) as per Section 6.6
of [RFC8075]. of [RFC8075].
By default, the CoAP-to-HTTP Proxy inserts a Via header field in the By default, the CoAP-to-HTTP Proxy inserts a Via header field in the
HTTP request if the CoAP request includes a Hop-Limit option. The HTTP request if the CoAP request includes a Hop-Limit option. The
CoAP-to-HTTP Proxy MAY be instructed by policy to insert a CDN-Loop CoAP-to-HTTP Proxy may be instructed by policy to insert a CDN-Loop
header field instead of the Via header field. header field instead of the Via header field.
The CoAP-to-HTTP Proxy maps the 508 (Loop Detected) HTTP response The CoAP-to-HTTP Proxy maps the 508 (Loop Detected) HTTP response
status code to TBA1 (Hop Limit Reached). Moreover, the CoAP-to-HTTP status code to TBA1 (Hop Limit Reached). Moreover, the CoAP-to-HTTP
Proxy inserts its information following the guidelines in Section 4. Proxy inserts its information following the guidelines in Section 4.
When both HTTP-to-CoAP and CoAP-to-HTTP proxies are involved, the When both HTTP-to-CoAP and CoAP-to-HTTP proxies are involved, the
loop detection may get broken if the proxy-forwarded traffic loop detection may get broken if the proxy-forwarded traffic
repeatedly crosses the HTTP-to-CoAP and CoAP-to-HTTP proxies. repeatedly crosses the HTTP-to-CoAP and CoAP-to-HTTP proxies.
Nevertheless, if the loop is within the CoAP or HTTP legs, the loop Nevertheless, if the loop is within the CoAP or HTTP legs, the loop
skipping to change at page 7, line 10 skipping to change at page 7, line 21
Table 3: CoAP Option Number Table 3: CoAP Option Number
This document suggests 16 as a value to be assigned for the new This document suggests 16 as a value to be assigned for the new
option number. option number.
7. Security Considerations 7. 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].
A CoAP endpoint can probe the topology of a network into which it is
making requests by tweaking the value of the Hop-Limit option. Such
probing is likely to fail if proxies at the boundaries of that
network rewrite the value of Hop-Limit carried in received requests
(see Section 3).
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 that is located
located at the boundary of an administrative domain MAY be instructed at the boundary of an administrative domain MAY be instructed to
to strip the diagnostic payload or part of it before forwarding on strip the diagnostic payload or part of it before forwarding on the
the TBA1 (Hop Limit Reached) response. TBA1 (Hop Limit Reached) response.
8. Acknowledgements 8. 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, Jim Thanks to Klaus Hartke, Carsten Bormann, Peter van der Stok, Jim
Schaad, Jaime Jimenez, Roni Even, and Scott Bradner for the reviews. Schaad, Jaime Jimenez, Roni Even, Scott Bradner, Thomas Fossati,
Radia Perlman, Eric Vyncke, Suresh Krishnan, Roman Danyliw, Barry
Leiba, Christer Holmberg, Benjamin Kaduk, and Adam Roach for their
review and comments.
Carsten Bormann provided the "Intended Usage" text. Carsten Bormann provided the "Intended Usage" text.
9. References 9. References
9.1. Normative References 9.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>.
[RFC7230] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer [RFC7230] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer
Protocol (HTTP/1.1): Message Syntax and Routing", Protocol (HTTP/1.1): Message Syntax and Routing",
RFC 7230, DOI 10.17487/RFC7230, June 2014, RFC 7230, DOI 10.17487/RFC7230, June 2014,
 End of changes. 34 change blocks. 
74 lines changed or deleted 96 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/