1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501
|
<pre>Internet Engineering Task Force (IETF) R. Seggelmann
Request for Comments: 6520 M. Tuexen
Category: Standards Track Muenster Univ. of Appl. Sciences
ISSN: 2070-1721 M. Williams
GWhiz Arts & Sciences
February 2012
<span class="h1">Transport Layer Security (TLS) and</span>
<span class="h1">Datagram Transport Layer Security (DTLS) Heartbeat Extension</span>
Abstract
This document describes the Heartbeat Extension for the Transport
Layer Security (TLS) and Datagram Transport Layer Security (DTLS)
protocols.
The Heartbeat Extension provides a new protocol for TLS/DTLS allowing
the usage of keep-alive functionality without performing a
renegotiation and a basis for path MTU (PMTU) discovery for DTLS.
Status of This Memo
This is an Internet Standards Track document.
This document is a product of the Internet Engineering Task Force
(IETF). It represents the consensus of the IETF community. It has
received public review and has been approved for publication by the
Internet Engineering Steering Group (IESG). Further information on
Internet Standards is available in <a href="./rfc5741#section-2">Section 2 of RFC 5741</a>.
Information about the current status of this document, any errata,
and how to provide feedback on it may be obtained at
<a href="http://www.rfc-editor.org/info/rfc6520">http://www.rfc-editor.org/info/rfc6520</a>.
<span class="grey">Seggelmann, et al. Standards Track [Page 1]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-2" ></span>
<span class="grey"><a href="./rfc6520">RFC 6520</a> TLS/DTLS Heartbeat Extension February 2012</span>
Copyright Notice
Copyright (c) 2012 IETF Trust and the persons identified as the
document authors. All rights reserved.
This document is subject to <a href="https://www.rfc-editor.org/bcp/bcp78">BCP 78</a> and the IETF Trust's Legal
Provisions Relating to IETF Documents
(<a href="http://trustee.ietf.org/license-info">http://trustee.ietf.org/license-info</a>) in effect on the date of
publication of this document. Please review these documents
carefully, as they describe your rights and restrictions with respect
to this document. Code Components extracted from this document must
include Simplified BSD License text as described in Section 4.e of
the Trust Legal Provisions and are provided without warranty as
described in the Simplified BSD License.
Table of Contents
<a href="#section-1">1</a>. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . <a href="#page-2">2</a>
<a href="#section-2">2</a>. Heartbeat Hello Extension . . . . . . . . . . . . . . . . . . . <a href="#page-3">3</a>
<a href="#section-3">3</a>. Heartbeat Protocol . . . . . . . . . . . . . . . . . . . . . . <a href="#page-4">4</a>
<a href="#section-4">4</a>. Heartbeat Request and Response Messages . . . . . . . . . . . . <a href="#page-5">5</a>
<a href="#section-5">5</a>. Use Cases . . . . . . . . . . . . . . . . . . . . . . . . . . . <a href="#page-6">6</a>
<a href="#section-6">6</a>. IANA Considerations . . . . . . . . . . . . . . . . . . . . . . <a href="#page-7">7</a>
<a href="#section-7">7</a>. Security Considerations . . . . . . . . . . . . . . . . . . . . <a href="#page-7">7</a>
<a href="#section-8">8</a>. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . <a href="#page-7">7</a>
<a href="#section-9">9</a>. References . . . . . . . . . . . . . . . . . . . . . . . . . . <a href="#page-7">7</a>
<span class="h2"><a class="selflink" id="section-1" href="#section-1">1</a>. Introduction</span>
<span class="h3"><a class="selflink" id="section-1.1" href="#section-1.1">1.1</a>. Overview</span>
This document describes the Heartbeat Extension for the Transport
Layer Security (TLS) and Datagram Transport Layer Security (DTLS)
protocols, as defined in [<a href="./rfc5246" title=""The Transport Layer Security (TLS) Protocol Version 1.2"">RFC5246</a>] and [<a href="./rfc6347" title=""Datagram Transport Layer Security Version 1.2"">RFC6347</a>] and their
adaptations to specific transport protocols described in [<a href="./rfc3436" title=""Transport Layer Security over Stream Control Transmission Protocol"">RFC3436</a>],
[<a href="./rfc5238" title=""Datagram Transport Layer Security (DTLS) over the Datagram Congestion Control Protocol (DCCP)"">RFC5238</a>], and [<a href="./rfc6083" title=""Datagram Transport Layer Security (DTLS) for Stream Control Transmission Protocol (SCTP)"">RFC6083</a>].
DTLS is designed to secure traffic running on top of unreliable
transport protocols. Usually, such protocols have no session
management. The only mechanism available at the DTLS layer to figure
out if a peer is still alive is a costly renegotiation, particularly
when the application uses unidirectional traffic. Furthermore, DTLS
needs to perform path MTU (PMTU) discovery but has no specific
message type to realize it without affecting the transfer of user
messages.
<span class="grey">Seggelmann, et al. Standards Track [Page 2]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-3" ></span>
<span class="grey"><a href="./rfc6520">RFC 6520</a> TLS/DTLS Heartbeat Extension February 2012</span>
TLS is based on reliable protocols, but there is not necessarily a
feature available to keep the connection alive without continuous
data transfer.
The Heartbeat Extension as described in this document overcomes these
limitations. The user can use the new HeartbeatRequest message,
which has to be answered by the peer with a HeartbeartResponse
immediately. To perform PMTU discovery, HeartbeatRequest messages
containing padding can be used as probe packets, as described in
[<a href="./rfc4821" title=""Packetization Layer Path MTU Discovery"">RFC4821</a>].
<span class="h3"><a class="selflink" id="section-1.2" href="#section-1.2">1.2</a>. Conventions</span>
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
document are to be interpreted as described in [<a href="./rfc2119" title=""Key words for use in RFCs to Indicate Requirement Levels"">RFC2119</a>].
<span class="h2"><a class="selflink" id="section-2" href="#section-2">2</a>. Heartbeat Hello Extension</span>
The support of Heartbeats is indicated with Hello Extensions. A peer
cannot only indicate that its implementation supports Heartbeats, it
can also choose whether it is willing to receive HeartbeatRequest
messages and respond with HeartbeatResponse messages or only willing
to send HeartbeatRequest messages. The former is indicated by using
peer_allowed_to_send as the HeartbeatMode; the latter is indicated by
using peer_not_allowed_to_send as the Heartbeat mode. This decision
can be changed with every renegotiation. HeartbeatRequest messages
MUST NOT be sent to a peer indicating peer_not_allowed_to_send. If
an endpoint that has indicated peer_not_allowed_to_send receives a
HeartbeatRequest message, the endpoint SHOULD drop the message
silently and MAY send an unexpected_message Alert message.
The format of the Heartbeat Hello Extension is defined by:
enum {
peer_allowed_to_send(1),
peer_not_allowed_to_send(2),
(255)
} HeartbeatMode;
struct {
HeartbeatMode mode;
} HeartbeatExtension;
Upon reception of an unknown mode, an error Alert message using
illegal_parameter as its AlertDescription MUST be sent in response.
<span class="grey">Seggelmann, et al. Standards Track [Page 3]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-4" ></span>
<span class="grey"><a href="./rfc6520">RFC 6520</a> TLS/DTLS Heartbeat Extension February 2012</span>
<span class="h2"><a class="selflink" id="section-3" href="#section-3">3</a>. Heartbeat Protocol</span>
The Heartbeat protocol is a new protocol running on top of the Record
Layer. The protocol itself consists of two message types:
HeartbeatRequest and HeartbeatResponse.
enum {
heartbeat_request(1),
heartbeat_response(2),
(255)
} HeartbeatMessageType;
A HeartbeatRequest message can arrive almost at any time during the
lifetime of a connection. Whenever a HeartbeatRequest message is
received, it SHOULD be answered with a corresponding
HeartbeatResponse message.
However, a HeartbeatRequest message SHOULD NOT be sent during
handshakes. If a handshake is initiated while a HeartbeatRequest is
still in flight, the sending peer MUST stop the DTLS retransmission
timer for it. The receiving peer SHOULD discard the message
silently, if it arrives during the handshake. In case of DTLS,
HeartbeatRequest messages from older epochs SHOULD be discarded.
There MUST NOT be more than one HeartbeatRequest message in flight at
a time. A HeartbeatRequest message is considered to be in flight
until the corresponding HeartbeatResponse message is received, or
until the retransmit timer expires.
When using an unreliable transport protocol like the Datagram
Congestion Control Protocol (DCCP) or UDP, HeartbeatRequest messages
MUST be retransmitted using the simple timeout and retransmission
scheme DTLS uses for flights as described in <a href="./rfc6347#section-4.2.4">Section 4.2.4 of
[RFC6347]</a>. In particular, after a number of retransmissions without
receiving a corresponding HeartbeatResponse message having the
expected payload, the DTLS connection SHOULD be terminated. The
threshold used for this SHOULD be the same as for DTLS handshake
messages. Please note that after the timer supervising a
HeartbeatRequest messages expires, this message is no longer
considered in flight. Therefore, the HeartbeatRequest message is
eligible for retransmission. The retransmission scheme, in
combination with the restriction that only one HeartbeatRequest is
allowed to be in flight, ensures that congestion control is handled
appropriately in case of the transport protocol not providing one,
like in the case of DTLS over UDP.
<span class="grey">Seggelmann, et al. Standards Track [Page 4]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-5" ></span>
<span class="grey"><a href="./rfc6520">RFC 6520</a> TLS/DTLS Heartbeat Extension February 2012</span>
When using a reliable transport protocol like the Stream Control
Transmission Protocol (SCTP) or TCP, HeartbeatRequest messages only
need to be sent once. The transport layer will handle
retransmissions. If no corresponding HeartbeatResponse message has
been received after some amount of time, the DTLS/TLS connection MAY
be terminated by the application that initiated the sending of the
HeartbeatRequest message.
<span class="h2"><a class="selflink" id="section-4" href="#section-4">4</a>. Heartbeat Request and Response Messages</span>
The Heartbeat protocol messages consist of their type and an
arbitrary payload and padding.
struct {
HeartbeatMessageType type;
uint16 payload_length;
opaque payload[HeartbeatMessage.payload_length];
opaque padding[padding_length];
} HeartbeatMessage;
The total length of a HeartbeatMessage MUST NOT exceed 2^14 or
max_fragment_length when negotiated as defined in [<a href="./rfc6066" title=""Transport Layer Security (TLS) Extensions: Extension Definitions"">RFC6066</a>].
type: The message type, either heartbeat_request or
heartbeat_response.
payload_length: The length of the payload.
payload: The payload consists of arbitrary content.
padding: The padding is random content that MUST be ignored by the
receiver. The length of a HeartbeatMessage is TLSPlaintext.length
for TLS and DTLSPlaintext.length for DTLS. Furthermore, the
length of the type field is 1 byte, and the length of the
payload_length is 2. Therefore, the padding_length is
TLSPlaintext.length - payload_length - 3 for TLS and
DTLSPlaintext.length - payload_length - 3 for DTLS. The
padding_length MUST be at least 16.
The sender of a HeartbeatMessage MUST use a random padding of at
least 16 bytes. The padding of a received HeartbeatMessage message
MUST be ignored.
If the payload_length of a received HeartbeatMessage is too large,
the received HeartbeatMessage MUST be discarded silently.
<span class="grey">Seggelmann, et al. Standards Track [Page 5]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-6" ></span>
<span class="grey"><a href="./rfc6520">RFC 6520</a> TLS/DTLS Heartbeat Extension February 2012</span>
When a HeartbeatRequest message is received and sending a
HeartbeatResponse is not prohibited as described elsewhere in this
document, the receiver MUST send a corresponding HeartbeatResponse
message carrying an exact copy of the payload of the received
HeartbeatRequest.
If a received HeartbeatResponse message does not contain the expected
payload, the message MUST be discarded silently. If it does contain
the expected payload, the retransmission timer MUST be stopped.
<span class="h2"><a class="selflink" id="section-5" href="#section-5">5</a>. Use Cases</span>
Each endpoint sends HeartbeatRequest messages at a rate and with the
padding required for the particular use case. The endpoint should
not expect its peer to send HeartbeatRequests. The directions are
independent.
<span class="h3"><a class="selflink" id="section-5.1" href="#section-5.1">5.1</a>. Path MTU Discovery</span>
DTLS performs path MTU discovery as described in <a href="./rfc6347#section-4.1.1.1">Section 4.1.1.1 of
[RFC6347]</a>. A detailed description of how to perform path MTU
discovery is given in [<a href="./rfc4821" title=""Packetization Layer Path MTU Discovery"">RFC4821</a>]. The necessary probe packets are the
HeartbeatRequest messages.
This method of using HeartbeatRequest messages for DTLS is similar to
the one for the Stream Control Transmission Protocol (SCTP) using the
padding chunk (PAD-chunk) defined in [<a href="./rfc4820" title=""Padding Chunk and Parameter for the Stream Control Transmission Protocol (SCTP)"">RFC4820</a>].
<span class="h3"><a class="selflink" id="section-5.2" href="#section-5.2">5.2</a>. Liveliness Check</span>
Sending HeartbeatRequest messages allows the sender to make sure that
it can reach the peer and the peer is alive. Even in the case of
TLS/TCP, this allows a check at a much higher rate than the TCP keep-
alive feature would allow.
Besides making sure that the peer is still reachable, sending
HeartbeatRequest messages refreshes the NAT state of all involved
NATs.
HeartbeatRequest messages SHOULD only be sent after an idle period
that is at least multiple round-trip times long. This idle period
SHOULD be configurable up to a period of multiple minutes and down to
a period of one second. A default value for the idle period SHOULD
be configurable, but it SHOULD also be tunable on a per-peer basis.
<span class="grey">Seggelmann, et al. Standards Track [Page 6]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-7" ></span>
<span class="grey"><a href="./rfc6520">RFC 6520</a> TLS/DTLS Heartbeat Extension February 2012</span>
<span class="h2"><a class="selflink" id="section-6" href="#section-6">6</a>. IANA Considerations</span>
IANA has assigned the heartbeat content type (24) from the "TLS
ContentType Registry" as specified in [<a href="./rfc5246" title=""The Transport Layer Security (TLS) Protocol Version 1.2"">RFC5246</a>]. The reference is to
<a href="./rfc6520">RFC 6520</a>.
IANA has created and now maintains a new registry for Heartbeat
Message Types. The message types are numbers in the range from 0 to
255 (decimal). IANA has assigned the heartbeat_request (1) and the
heartbeat_response (2) message types. The values 0 and 255 should be
reserved. This registry uses the Expert Review policy as described
in [<a href="./rfc5226" title="">RFC5226</a>]. The reference is to <a href="./rfc6520">RFC 6520</a>.
IANA has assigned the heartbeat extension type (15) from the TLS
"ExtensionType Values" registry as specified in [<a href="./rfc5246" title=""The Transport Layer Security (TLS) Protocol Version 1.2"">RFC5246</a>]. The
reference is to <a href="./rfc6520">RFC 6520</a>.
IANA has created and now maintains a new registry for Heartbeat
Modes. The modes are numbers in the range from 0 to 255 (decimal).
IANA has assigned the peer_allowed_to_send (1) and the
peer_not_allowed_to_send (2) modes. The values 0 and 255 should be
reserved. This registry uses the Expert Review policy as described
in [<a href="./rfc5226" title="">RFC5226</a>]. The reference is to <a href="./rfc6520">RFC 6520</a>.
<span class="h2"><a class="selflink" id="section-7" href="#section-7">7</a>. Security Considerations</span>
The security considerations of [<a href="./rfc5246" title=""The Transport Layer Security (TLS) Protocol Version 1.2"">RFC5246</a>] and [<a href="./rfc6347" title=""Datagram Transport Layer Security Version 1.2"">RFC6347</a>] apply to this
document. This document does not introduce any new security
considerations.
<span class="h2"><a class="selflink" id="section-8" href="#section-8">8</a>. Acknowledgments</span>
The authors wish to thank Pasi Eronen, Adrian Farrel, Stephen
Farrell, Adam Langley, Nikos Mavrogiannopoulos, Tom Petch, Eric
Rescorla, Peter Saint-Andre, and Juho Vaehae-Herttua for their
invaluable comments.
<span class="h2"><a class="selflink" id="section-9" href="#section-9">9</a>. References</span>
<span class="h3"><a class="selflink" id="section-9.1" href="#section-9.1">9.1</a>. Normative References</span>
[<a id="ref-RFC2119">RFC2119</a>] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", <a href="https://www.rfc-editor.org/bcp/bcp14">BCP 14</a>, <a href="./rfc2119">RFC 2119</a>, March 1997.
[<a id="ref-RFC5226">RFC5226</a>] Narten, T. and H. Alvestrand, "Guidelines for Writing an
IANA Considerations Section in RFCs", <a href="https://www.rfc-editor.org/bcp/bcp26">BCP 26</a>, <a href="./rfc5226">RFC 5226</a>,
May 2008.
<span class="grey">Seggelmann, et al. Standards Track [Page 7]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-8" ></span>
<span class="grey"><a href="./rfc6520">RFC 6520</a> TLS/DTLS Heartbeat Extension February 2012</span>
[<a id="ref-RFC5246">RFC5246</a>] Dierks, T. and E. Rescorla, "The Transport Layer Security
(TLS) Protocol Version 1.2", <a href="./rfc5246">RFC 5246</a>, August 2008.
[<a id="ref-RFC6066">RFC6066</a>] Eastlake, D., "Transport Layer Security (TLS) Extensions:
Extension Definitions", <a href="./rfc6066">RFC 6066</a>, January 2011.
[<a id="ref-RFC6347">RFC6347</a>] Rescorla, E. and N. Modadugu, "Datagram Transport Layer
Security Version 1.2", <a href="./rfc6347">RFC 6347</a>, January 2012.
<span class="h3"><a class="selflink" id="section-9.2" href="#section-9.2">9.2</a>. Informative References</span>
[<a id="ref-RFC3436">RFC3436</a>] Jungmaier, A., Rescorla, E., and M. Tuexen, "Transport
Layer Security over Stream Control Transmission Protocol",
<a href="./rfc3436">RFC 3436</a>, December 2002.
[<a id="ref-RFC4820">RFC4820</a>] Tuexen, M., Stewart, R., and P. Lei, "Padding Chunk and
Parameter for the Stream Control Transmission Protocol
(SCTP)", <a href="./rfc4820">RFC 4820</a>, March 2007.
[<a id="ref-RFC4821">RFC4821</a>] Mathis, M. and J. Heffner, "Packetization Layer Path MTU
Discovery", <a href="./rfc4821">RFC 4821</a>, March 2007.
[<a id="ref-RFC5238">RFC5238</a>] Phelan, T., "Datagram Transport Layer Security (DTLS) over
the Datagram Congestion Control Protocol (DCCP)",
<a href="./rfc5238">RFC 5238</a>, May 2008.
[<a id="ref-RFC6083">RFC6083</a>] Tuexen, M., Seggelmann, R., and E. Rescorla, "Datagram
Transport Layer Security (DTLS) for Stream Control
Transmission Protocol (SCTP)", <a href="./rfc6083">RFC 6083</a>, January 2011.
<span class="grey">Seggelmann, et al. Standards Track [Page 8]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-9" ></span>
<span class="grey"><a href="./rfc6520">RFC 6520</a> TLS/DTLS Heartbeat Extension February 2012</span>
Authors' Addresses
Robin Seggelmann
Muenster University of Applied Sciences
Stegerwaldstr. 39
48565 Steinfurt
DE
EMail: seggelmann@fh-muenster.de
Michael Tuexen
Muenster University of Applied Sciences
Stegerwaldstr. 39
48565 Steinfurt
DE
EMail: tuexen@fh-muenster.de
Michael Glenn Williams
GWhiz Arts & Sciences
2885 Denise Court
Newbury Park, CA, 91320
USA
EMail: michael.glenn.williams@gmail.com
Seggelmann, et al. Standards Track [Page 9]
</pre>
|