| 1 |
<pre>Internet Engineering Task Force (IETF) V. Smyslov |
| 2 |
Request for Comments: 7383 ELVIS-PLUS |
| 3 |
Category: Standards Track November 2014 |
| 4 |
ISSN: 2070-1721 |
| 5 |
|
| 6 |
|
| 7 |
<span class="h1">Internet Key Exchange Protocol Version 2 (IKEv2) Message Fragmentation</span> |
| 8 |
|
| 9 |
Abstract |
| 10 |
|
| 11 |
This document describes a way to avoid IP fragmentation of large |
| 12 |
Internet Key Exchange Protocol version 2 (IKEv2) messages. This |
| 13 |
allows IKEv2 messages to traverse network devices that do not allow |
| 14 |
IP fragments to pass through. |
| 15 |
|
| 16 |
Status of This Memo |
| 17 |
|
| 18 |
This is an Internet Standards Track document. |
| 19 |
|
| 20 |
This document is a product of the Internet Engineering Task Force |
| 21 |
(IETF). It represents the consensus of the IETF community. It has |
| 22 |
received public review and has been approved for publication by the |
| 23 |
Internet Engineering Steering Group (IESG). Further information on |
| 24 |
Internet Standards is available in <a href="./rfc5741#section-2">Section 2 of RFC 5741</a>. |
| 25 |
|
| 26 |
Information about the current status of this document, any errata, |
| 27 |
and how to provide feedback on it may be obtained at |
| 28 |
<a href="http://www.rfc-editor.org/info/rfc7383">http://www.rfc-editor.org/info/rfc7383</a>. |
| 29 |
|
| 30 |
Copyright Notice |
| 31 |
|
| 32 |
Copyright (c) 2014 IETF Trust and the persons identified as the |
| 33 |
document authors. All rights reserved. |
| 34 |
|
| 35 |
This document is subject to <a href="https://www.rfc-editor.org/bcp/bcp78">BCP 78</a> and the IETF Trust's Legal |
| 36 |
Provisions Relating to IETF Documents |
| 37 |
(<a href="http://trustee.ietf.org/license-info">http://trustee.ietf.org/license-info</a>) in effect on the date of |
| 38 |
publication of this document. Please review these documents |
| 39 |
carefully, as they describe your rights and restrictions with respect |
| 40 |
to this document. Code Components extracted from this document must |
| 41 |
include Simplified BSD License text as described in Section 4.e of |
| 42 |
the Trust Legal Provisions and are provided without warranty as |
| 43 |
described in the Simplified BSD License. |
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
<span class="grey">Smyslov Standards Track [Page 1]</span></pre> |
| 53 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-2" ></span> |
| 54 |
<span class="grey"><a href="./rfc7383">RFC 7383</a> IKEv2 Fragmentation November 2014</span> |
| 55 |
|
| 56 |
|
| 57 |
Table of Contents |
| 58 |
|
| 59 |
<a href="#section-1">1</a>. Introduction ....................................................<a href="#page-2">2</a> |
| 60 |
<a href="#section-1.1">1.1</a>. Problem Description ........................................<a href="#page-2">2</a> |
| 61 |
<a href="#section-1.2">1.2</a>. Proposed Solution ..........................................<a href="#page-3">3</a> |
| 62 |
<a href="#section-1.3">1.3</a>. Conventions Used in This Document ..........................<a href="#page-4">4</a> |
| 63 |
<a href="#section-2">2</a>. Protocol Details ................................................<a href="#page-4">4</a> |
| 64 |
<a href="#section-2.1">2.1</a>. Overview ...................................................<a href="#page-4">4</a> |
| 65 |
<a href="#section-2.2">2.2</a>. Limitations ................................................<a href="#page-4">4</a> |
| 66 |
<a href="#section-2.3">2.3</a>. Negotiation ................................................<a href="#page-5">5</a> |
| 67 |
<a href="#section-2.4">2.4</a>. Using IKE Fragmentation ....................................<a href="#page-5">5</a> |
| 68 |
<a href="#section-2.5">2.5</a>. Fragmenting Message ........................................<a href="#page-6">6</a> |
| 69 |
<a href="#section-2.5.1">2.5.1</a>. Selecting Fragment Size .............................<a href="#page-8">8</a> |
| 70 |
<a href="#section-2.5.2">2.5.2</a>. PMTU Discovery ......................................<a href="#page-9">9</a> |
| 71 |
2.5.3. Fragmenting Messages Containing Unprotected |
| 72 |
Payloads ...........................................<a href="#page-11">11</a> |
| 73 |
<a href="#section-2.6">2.6</a>. Receiving IKE Fragment Message ............................<a href="#page-11">11</a> |
| 74 |
<a href="#section-2.6.1">2.6.1</a>. Replay Detection and Retransmissions ...............<a href="#page-13">13</a> |
| 75 |
<a href="#section-3">3</a>. Interaction with Other IKE Extensions ..........................<a href="#page-14">14</a> |
| 76 |
<a href="#section-4">4</a>. Transport Considerations .......................................<a href="#page-14">14</a> |
| 77 |
<a href="#section-5">5</a>. Security Considerations ........................................<a href="#page-15">15</a> |
| 78 |
<a href="#section-6">6</a>. IANA Considerations ............................................<a href="#page-16">16</a> |
| 79 |
<a href="#section-7">7</a>. References .....................................................<a href="#page-16">16</a> |
| 80 |
<a href="#section-7.1">7.1</a>. Normative References ......................................<a href="#page-16">16</a> |
| 81 |
<a href="#section-7.2">7.2</a>. Informative References ....................................<a href="#page-16">16</a> |
| 82 |
<a href="#appendix-A">Appendix A</a>. Design Rationale ......................................<a href="#page-19">19</a> |
| 83 |
<a href="#appendix-B">Appendix B</a>. Correlation between IP Datagram Size and Encrypted |
| 84 |
Payload Content Size ..................................<a href="#page-19">19</a> |
| 85 |
Acknowledgements ..................................................<a href="#page-20">20</a> |
| 86 |
Author's Address ..................................................<a href="#page-20">20</a> |
| 87 |
|
| 88 |
<span class="h2"><a class="selflink" id="section-1" href="#section-1">1</a>. Introduction</span> |
| 89 |
|
| 90 |
<span class="h3"><a class="selflink" id="section-1.1" href="#section-1.1">1.1</a>. Problem Description</span> |
| 91 |
|
| 92 |
The Internet Key Exchange Protocol version 2 (IKEv2), specified in |
| 93 |
[<a href="./rfc7296" title=""Internet Key Exchange Protocol Version 2 (IKEv2)"">RFC7296</a>], uses UDP as a transport for its messages. Most IKEv2 |
| 94 |
messages are relatively small, usually below several hundred bytes. |
| 95 |
A notable exception is the IKE_AUTH exchange, which requires fairly |
| 96 |
large messages, up to several KB, especially when certificates are |
| 97 |
transferred. When the IKE message size exceeds the path MTU, it gets |
| 98 |
fragmented at the IP level. The problem is that some network |
| 99 |
devices, specifically some NAT boxes, do not allow IP fragments to |
| 100 |
pass through. This apparently blocks IKE communication and, |
| 101 |
therefore, prevents peers from establishing an IPsec Security |
| 102 |
Association (SA). <a href="./rfc7296#section-2">Section 2 of [RFC7296]</a> discusses the impact of IP |
| 103 |
fragmentation on IKEv2 and acknowledges this problem. |
| 104 |
|
| 105 |
|
| 106 |
|
| 107 |
|
| 108 |
<span class="grey">Smyslov Standards Track [Page 2]</span></pre> |
| 109 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-3" ></span> |
| 110 |
<span class="grey"><a href="./rfc7383">RFC 7383</a> IKEv2 Fragmentation November 2014</span> |
| 111 |
|
| 112 |
|
| 113 |
Widespread deployment of Carrier-Grade NATs (CGNs) introduces new |
| 114 |
challenges. [<a href="./rfc6888" title=""Common Requirements for Carrier-Grade NATs (CGNs)"">RFC6888</a>] describes requirements for CGNs. It states |
| 115 |
that CGNs must comply with <a href="./rfc4787#section-11">Section 11 of [RFC4787]</a>, which requires |
| 116 |
NATs to support receiving IP fragments (REQ-14). In real life, |
| 117 |
fulfillment of this requirement creates an additional burden in terms |
| 118 |
of memory, especially for high-capacity devices used in CGNs. It was |
| 119 |
found by people deploying IKE that more and more ISPs use equipment |
| 120 |
that drops IP fragments, thereby violating this requirement. |
| 121 |
|
| 122 |
Security researchers have found, and continue to find, attack vectors |
| 123 |
that rely on IP fragmentation. For these reasons, and also as |
| 124 |
articulated in [<a href="#ref-FRAGDROP" title=""Why Operators Filter Fragments and What It Implies"">FRAGDROP</a>], many network operators filter all IPv6 |
| 125 |
fragments. Also, the default behavior of many currently deployed |
| 126 |
firewalls is to discard IPv6 fragments. |
| 127 |
|
| 128 |
In one recent study [<a href="#ref-BLACKHOLES">BLACKHOLES</a>], two researchers utilized a |
| 129 |
measurement network to measure fragment filtering. They sent |
| 130 |
packets, fragmented to the minimum MTU of 1280, to 502 IPv6-enabled |
| 131 |
and reachable probes. They found that during any given trial period, |
| 132 |
ten percent of the probes did not receive fragmented packets. |
| 133 |
|
| 134 |
Thus, this problem is valid for both IPv4 and IPv6 and may be caused |
| 135 |
by either deficiency of network devices or operational choice. |
| 136 |
|
| 137 |
<span class="h3"><a class="selflink" id="section-1.2" href="#section-1.2">1.2</a>. Proposed Solution</span> |
| 138 |
|
| 139 |
The solution to the problem described in this document is to perform |
| 140 |
fragmentation of large messages by IKEv2 itself and replace them with |
| 141 |
a series of smaller messages. In this case, the resulting IP |
| 142 |
datagrams will be small enough so that no fragmentation at the IP |
| 143 |
level will take place. |
| 144 |
|
| 145 |
The primary goal of this solution is to allow IKEv2 to operate in |
| 146 |
environments that might block IP fragments. This goal does not |
| 147 |
assume that IP fragmentation should be avoided completely, but only |
| 148 |
in those cases when it interferes with IKE operations. However, this |
| 149 |
solution could be used to avoid IP fragmentation in all situations |
| 150 |
where fragmentation within IKE is applicable, as recommended in |
| 151 |
<a href="./rfc5405#section-3.2">Section 3.2 of [RFC5405]</a>. Avoiding IP fragmentation would be |
| 152 |
beneficial for IKEv2 in general. The Security Considerations section |
| 153 |
of [<a href="./rfc7296" title=""Internet Key Exchange Protocol Version 2 (IKEv2)"">RFC7296</a>] mentions exhaustion of the IP reassembly buffers as one |
| 154 |
of the possible attacks on the protocol. In [<a href="#ref-DOSUDPPROT">DOSUDPPROT</a>], several |
| 155 |
aspects of attacks on IKE using IP fragmentation are discussed, and |
| 156 |
one of the defenses it proposes is to perform fragmentation within |
| 157 |
IKE, similar to the solution described in this document. |
| 158 |
|
| 159 |
|
| 160 |
|
| 161 |
|
| 162 |
|
| 163 |
|
| 164 |
<span class="grey">Smyslov Standards Track [Page 3]</span></pre> |
| 165 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-4" ></span> |
| 166 |
<span class="grey"><a href="./rfc7383">RFC 7383</a> IKEv2 Fragmentation November 2014</span> |
| 167 |
|
| 168 |
|
| 169 |
<span class="h3"><a class="selflink" id="section-1.3" href="#section-1.3">1.3</a>. Conventions Used in This Document</span> |
| 170 |
|
| 171 |
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", |
| 172 |
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this |
| 173 |
document are to be interpreted as described in [<a href="./rfc2119" title=""Key words for use in RFCs to Indicate Requirement Levels"">RFC2119</a>]. |
| 174 |
|
| 175 |
<span class="h2"><a class="selflink" id="section-2" href="#section-2">2</a>. Protocol Details</span> |
| 176 |
|
| 177 |
<span class="h3"><a class="selflink" id="section-2.1" href="#section-2.1">2.1</a>. Overview</span> |
| 178 |
|
| 179 |
The idea of the protocol described in this document is to split large |
| 180 |
IKEv2 messages into a set of smaller ones, called IKE Fragment |
| 181 |
messages. Fragmentation takes place before the original message is |
| 182 |
encrypted and authenticated, so that each IKE Fragment message |
| 183 |
receives individual protection. On the receiving side, IKE Fragment |
| 184 |
messages are collected, verified, decrypted, and merged together to |
| 185 |
get the original message before encryption. See <a href="#appendix-A">Appendix A</a> for |
| 186 |
details on design rationale. |
| 187 |
|
| 188 |
<span class="h3"><a class="selflink" id="section-2.2" href="#section-2.2">2.2</a>. Limitations</span> |
| 189 |
|
| 190 |
Since IKE Fragment messages are cryptographically protected, SK_a and |
| 191 |
SK_e must already be calculated. In general, it means that the |
| 192 |
original message can be fragmented if and only if it contains an |
| 193 |
Encrypted payload. |
| 194 |
|
| 195 |
This implies that messages of the IKE_SA_INIT exchange cannot be |
| 196 |
fragmented. In most cases, this is not a problem because IKE_SA_INIT |
| 197 |
messages are usually small enough to avoid IP fragmentation. But in |
| 198 |
some cases (advertising a badly structured long list of algorithms, |
| 199 |
using large Modular Exponentiation (MODP) groups, etc.), these |
| 200 |
messages may become fairly large and get fragmented at the IP level. |
| 201 |
In this case, the solution described in this document will not help. |
| 202 |
|
| 203 |
Among existing IKEv2 extensions, messages of an IKE_SESSION_RESUME |
| 204 |
exchange, as defined in [<a href="./rfc5723" title=""Internet Key Exchange Protocol Version 2 (IKEv2) Session Resumption"">RFC5723</a>], cannot be fragmented either. See |
| 205 |
<a href="#section-3">Section 3</a> for details. |
| 206 |
|
| 207 |
Another limitation is that the minimum size of an IP datagram bearing |
| 208 |
an IKE Fragment message is about 100 bytes, depending on the |
| 209 |
algorithms employed. According to [<a href="./rfc0791" title=""Internet Protocol"">RFC0791</a>], the minimum IPv4 |
| 210 |
datagram size that is guaranteed not to be further fragmented is |
| 211 |
68 bytes. So, even the smallest IKE Fragment messages could be |
| 212 |
fragmented at the IP level in some circumstances. But such extremely |
| 213 |
small Path MTU (PMTU) sizes are very rare in real life. |
| 214 |
|
| 215 |
|
| 216 |
|
| 217 |
|
| 218 |
|
| 219 |
|
| 220 |
<span class="grey">Smyslov Standards Track [Page 4]</span></pre> |
| 221 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-5" ></span> |
| 222 |
<span class="grey"><a href="./rfc7383">RFC 7383</a> IKEv2 Fragmentation November 2014</span> |
| 223 |
|
| 224 |
|
| 225 |
<span class="h3"><a class="selflink" id="section-2.3" href="#section-2.3">2.3</a>. Negotiation</span> |
| 226 |
|
| 227 |
The initiator indicates its support for IKE fragmentation and |
| 228 |
willingness to use it by including a Notification payload of type |
| 229 |
IKEV2_FRAGMENTATION_SUPPORTED in the IKE_SA_INIT request message. If |
| 230 |
the responder also supports this extension and is willing to use it, |
| 231 |
it includes this notification in the response message. |
| 232 |
|
| 233 |
Initiator Responder |
| 234 |
----------- ----------- |
| 235 |
HDR, SAi1, KEi, Ni, |
| 236 |
[N(IKEV2_FRAGMENTATION_SUPPORTED)] --> |
| 237 |
|
| 238 |
<-- HDR, SAr1, KEr, Nr, [CERTREQ], |
| 239 |
[N(IKEV2_FRAGMENTATION_SUPPORTED)] |
| 240 |
|
| 241 |
The Notify payload is formatted as follows: |
| 242 |
|
| 243 |
1 2 3 |
| 244 |
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 |
| 245 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 246 |
| Next Payload |C| RESERVED | Payload Length | |
| 247 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 248 |
|Protocol ID(=0)| SPI Size (=0) | Notify Message Type | |
| 249 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 250 |
|
| 251 |
o Protocol ID (1 octet) - MUST be 0. |
| 252 |
|
| 253 |
o SPI Size (1 octet) - MUST be 0, meaning no Security Parameter |
| 254 |
Index (SPI) is present. |
| 255 |
|
| 256 |
o Notify Message Type (2 octets) - MUST be 16430, the value assigned |
| 257 |
for the IKEV2_FRAGMENTATION_SUPPORTED notification. |
| 258 |
|
| 259 |
This notification contains no data. |
| 260 |
|
| 261 |
<span class="h3"><a class="selflink" id="section-2.4" href="#section-2.4">2.4</a>. Using IKE Fragmentation</span> |
| 262 |
|
| 263 |
IKE fragmentation MUST NOT be used unless both peers have indicated |
| 264 |
their support for it. After that, it is up to the initiator of each |
| 265 |
exchange to decide whether or not to use it. The responder usually |
| 266 |
replies in the same form as the request message, but other |
| 267 |
considerations might override this. |
| 268 |
|
| 269 |
The initiator can employ various policies regarding the use of IKE |
| 270 |
fragmentation. It might first try to send an unfragmented message |
| 271 |
and resend it as fragmented only if no complete response is received |
| 272 |
even after several retransmissions. Alternatively, it might choose |
| 273 |
|
| 274 |
|
| 275 |
|
| 276 |
<span class="grey">Smyslov Standards Track [Page 5]</span></pre> |
| 277 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-6" ></span> |
| 278 |
<span class="grey"><a href="./rfc7383">RFC 7383</a> IKEv2 Fragmentation November 2014</span> |
| 279 |
|
| 280 |
|
| 281 |
to always send fragmented messages (however, see <a href="#section-3">Section 3</a>), or it |
| 282 |
might fragment only large messages and messages that are expected to |
| 283 |
result in large responses. |
| 284 |
|
| 285 |
The following general guidelines apply: |
| 286 |
|
| 287 |
o If either peer has information that a part of the transaction is |
| 288 |
likely to be fragmented at the IP layer, causing interference with |
| 289 |
the IKE exchange, that peer SHOULD use IKE fragmentation. This |
| 290 |
information might be passed from a lower layer, provided by |
| 291 |
configuration, or derived through heuristics. Examples of |
| 292 |
heuristics are the lack of a complete response after several |
| 293 |
retransmissions for the initiator, and receiving repeated |
| 294 |
retransmissions of the request for the responder. |
| 295 |
|
| 296 |
o If either peer knows that IKE fragmentation has been used in a |
| 297 |
previous exchange in the context of the current IKE SA, that peer |
| 298 |
SHOULD continue to use IKE fragmentation for the messages that are |
| 299 |
larger than the current fragmentation threshold (see |
| 300 |
<a href="#section-2.5.1">Section 2.5.1</a>). |
| 301 |
|
| 302 |
o IKE fragmentation SHOULD NOT be used in cases where IP-layer |
| 303 |
fragmentation of both the request and response messages is |
| 304 |
unlikely. For example, there is no point in fragmenting liveness |
| 305 |
check messages. |
| 306 |
|
| 307 |
o If none of the above apply, the responder SHOULD respond in the |
| 308 |
same form (fragmented or not) as the request message to which it |
| 309 |
is responding. Note that the other guidelines might override this |
| 310 |
because of information or heuristics available to the responder. |
| 311 |
|
| 312 |
In most cases, IKE fragmentation will be used in the IKE_AUTH |
| 313 |
exchange, especially if certificates are employed. |
| 314 |
|
| 315 |
<span class="h3"><a class="selflink" id="section-2.5" href="#section-2.5">2.5</a>. Fragmenting Message</span> |
| 316 |
|
| 317 |
Only messages that contain an Encrypted payload are subject to IKE |
| 318 |
fragmentation. For the purpose of construction of IKE Fragment |
| 319 |
messages, the original (unencrypted) content of the Encrypted payload |
| 320 |
is split into chunks. The content is treated as a binary blob and is |
| 321 |
split regardless of the boundaries of inner payloads. Each of the |
| 322 |
resulting chunks is treated as an original content of the Encrypted |
| 323 |
Fragment payload and is then encrypted and authenticated. Thus, the |
| 324 |
Encrypted Fragment payload contains a chunk of the original content |
| 325 |
of the Encrypted payload in encrypted form. The cryptographic |
| 326 |
processing of the Encrypted Fragment payload is identical to that |
| 327 |
|
| 328 |
|
| 329 |
|
| 330 |
|
| 331 |
|
| 332 |
<span class="grey">Smyslov Standards Track [Page 6]</span></pre> |
| 333 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-7" ></span> |
| 334 |
<span class="grey"><a href="./rfc7383">RFC 7383</a> IKEv2 Fragmentation November 2014</span> |
| 335 |
|
| 336 |
|
| 337 |
described in <a href="./rfc7296#section-3.14">Section 3.14 of [RFC7296]</a>, as well as documents updating |
| 338 |
such processing for particular algorithms or modes, such as |
| 339 |
[<a href="./rfc5282" title=""Using Authenticated Encryption Algorithms with the Encrypted Payload of the Internet Key Exchange version 2 (IKEv2) Protocol"">RFC5282</a>]. |
| 340 |
|
| 341 |
As is the case for the Encrypted payload, the Encrypted Fragment |
| 342 |
payload, if present in a message, MUST be the last payload in the |
| 343 |
message. |
| 344 |
|
| 345 |
The Encrypted Fragment payload is denoted SKF{...}, and its payload |
| 346 |
type is 53. This payload is also called the "Encrypted and |
| 347 |
Authenticated Fragment" payload. |
| 348 |
|
| 349 |
1 2 3 |
| 350 |
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 |
| 351 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 352 |
| Next Payload |C| RESERVED | Payload Length | |
| 353 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 354 |
| Fragment Number | Total Fragments | |
| 355 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 356 |
| Initialization Vector | |
| 357 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 358 |
~ Encrypted content ~ |
| 359 |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 360 |
| | Padding (0-255 octets) | |
| 361 |
+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+ |
| 362 |
| | Pad Length | |
| 363 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 364 |
~ Integrity Checksum Data ~ |
| 365 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 366 |
|
| 367 |
Encrypted Fragment Payload |
| 368 |
|
| 369 |
o Next Payload (1 octet) - in the very first fragment (with Fragment |
| 370 |
Number equal to 1), this field MUST be set to the payload type of |
| 371 |
the first inner payload (the same as for the Encrypted payload). |
| 372 |
In the rest of the Fragment messages (with Fragment Number greater |
| 373 |
than 1), this field MUST be set to zero. |
| 374 |
|
| 375 |
o Fragment Number (2 octets, unsigned integer) - current Fragment |
| 376 |
message number, starting from 1. This field MUST be less than or |
| 377 |
equal to the next field (Total Fragments). This field MUST NOT be |
| 378 |
zero. |
| 379 |
|
| 380 |
o Total Fragments (2 octets, unsigned integer) - number of Fragment |
| 381 |
messages into which the original message was divided. This field |
| 382 |
MUST NOT be zero. With PMTU discovery, this field plays an |
| 383 |
additional role. See <a href="#section-2.5.2">Section 2.5.2</a> for details. |
| 384 |
|
| 385 |
|
| 386 |
|
| 387 |
|
| 388 |
<span class="grey">Smyslov Standards Track [Page 7]</span></pre> |
| 389 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-8" ></span> |
| 390 |
<span class="grey"><a href="./rfc7383">RFC 7383</a> IKEv2 Fragmentation November 2014</span> |
| 391 |
|
| 392 |
|
| 393 |
The other fields are identical to those specified in <a href="./rfc7296#section-3.14">Section 3.14 of |
| 394 |
[RFC7296]</a>. |
| 395 |
|
| 396 |
When prepending the IKE header to the IKE Fragment messages, it MUST |
| 397 |
be taken intact from the original message, except for the Length and |
| 398 |
Next Payload fields. The Length field is adjusted to reflect the |
| 399 |
length of the IKE Fragment message being constructed, and the Next |
| 400 |
Payload field is set to the payload type of the first payload in that |
| 401 |
message (in most cases, it will be the Encrypted Fragment payload). |
| 402 |
After prepending the IKE header and all payloads that possibly |
| 403 |
precede the Encrypted payload in the original message (if any; see |
| 404 |
<a href="#section-2.5.3">Section 2.5.3</a>), the resulting messages are sent to the peer. |
| 405 |
|
| 406 |
Below is an example of fragmenting a message. |
| 407 |
|
| 408 |
HDR(MID=n), SK(NextPld=PLD1) {PLD1 ... PLDN} |
| 409 |
|
| 410 |
Original Message |
| 411 |
|
| 412 |
|
| 413 |
HDR(MID=n), SKF(NextPld=PLD1, Frag#=1, TotalFrags=m) {...}, |
| 414 |
HDR(MID=n), SKF(NextPld=0, Frag#=2, TotalFrags=m) {...}, |
| 415 |
... |
| 416 |
HDR(MID=n), SKF(NextPld=0, Frag#=m, TotalFrags=m) {...} |
| 417 |
|
| 418 |
IKE Fragment Messages |
| 419 |
|
| 420 |
<span class="h4"><a class="selflink" id="section-2.5.1" href="#section-2.5.1">2.5.1</a>. Selecting Fragment Size</span> |
| 421 |
|
| 422 |
When splitting the content of an Encrypted payload into chunks, the |
| 423 |
sender SHOULD choose their size so that the resulting IP datagrams |
| 424 |
will be smaller than some fragmentation threshold. Implementations |
| 425 |
may calculate the fragmentation threshold using various sources of |
| 426 |
information. |
| 427 |
|
| 428 |
If the sender has information about the PMTU size, it SHOULD use it. |
| 429 |
The responder in the exchange may use the maximum size of the |
| 430 |
received IKE Fragment message IP datagrams as a threshold when |
| 431 |
constructing a fragmented response. Successful completion of |
| 432 |
previous exchanges (including those exchanges that cannot employ IKE |
| 433 |
fragmentation, e.g., IKE_SA_INIT) may be an indication that the |
| 434 |
fragmentation threshold can be set to the size of the largest message |
| 435 |
of those messages already sent. |
| 436 |
|
| 437 |
Otherwise, for messages to be sent over IPv6, it is RECOMMENDED that |
| 438 |
a value of 1280 bytes as a maximum IP datagram size be used |
| 439 |
([<a href="./rfc2460" title=""Internet Protocol, Version 6 (IPv6) Specification"">RFC2460</a>]). For messages to be sent over IPv4, it is RECOMMENDED |
| 440 |
that a value of 576 bytes as a maximum IP datagram size be used. The |
| 441 |
|
| 442 |
|
| 443 |
|
| 444 |
<span class="grey">Smyslov Standards Track [Page 8]</span></pre> |
| 445 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-9" ></span> |
| 446 |
<span class="grey"><a href="./rfc7383">RFC 7383</a> IKEv2 Fragmentation November 2014</span> |
| 447 |
|
| 448 |
|
| 449 |
presence of tunnels on the path may reduce these values. |
| 450 |
Implementations may use other values if they are appropriate in the |
| 451 |
current environment. |
| 452 |
|
| 453 |
According to [<a href="./rfc0791" title=""Internet Protocol"">RFC0791</a>], the minimum IPv4 datagram size that is |
| 454 |
guaranteed not to be further fragmented is 68 bytes, but it is |
| 455 |
generally impossible to use such a small value for the solution |
| 456 |
described in this document. Using 576 bytes is a compromise -- the |
| 457 |
value is large enough for the presented solution and small enough to |
| 458 |
avoid IP fragmentation in most situations. Several other UDP-based |
| 459 |
protocols (Syslog, DNS, etc.) use 576 bytes as a safe low limit for |
| 460 |
IP datagram size. |
| 461 |
|
| 462 |
See <a href="#appendix-B">Appendix B</a> for correlation between IP datagram size and Encrypted |
| 463 |
payload content size. |
| 464 |
|
| 465 |
<span class="h4"><a class="selflink" id="section-2.5.2" href="#section-2.5.2">2.5.2</a>. PMTU Discovery</span> |
| 466 |
|
| 467 |
The amount of traffic that the IKE endpoint produces during the |
| 468 |
lifetime of an IKE SA is fairly modest -- it is usually below 100 KB |
| 469 |
within a period of several hours. Most of this traffic consists of |
| 470 |
relatively short messages -- usually below several hundred bytes. In |
| 471 |
most cases, the only time when IKE endpoints exchange messages of |
| 472 |
several KB in size is IKE SA establishment, and often each endpoint |
| 473 |
sends exactly one such message. |
| 474 |
|
| 475 |
For the reasons articulated above, implementing PMTU discovery in IKE |
| 476 |
is OPTIONAL. It is believed that using the values recommended in |
| 477 |
<a href="#section-2.5.1">Section 2.5.1</a> as a fragmentation threshold will be sufficient in most |
| 478 |
cases. Using these values could lead to suboptimal fragmentation, |
| 479 |
but it is acceptable given the amount of traffic IKE produces. |
| 480 |
Implementations may support PMTU discovery if there are good reasons |
| 481 |
to do it (for example, if they are intended to be used in |
| 482 |
environments where the MTU size might be less than the values listed |
| 483 |
in <a href="#section-2.5.1">Section 2.5.1</a>). |
| 484 |
|
| 485 |
PMTU discovery in IKE follows recommendations given in <a href="./rfc4821#section-10.4">Section 10.4 |
| 486 |
of [RFC4821]</a> with some modifications, induced by the distinctive |
| 487 |
features of IKE listed above. The difference is that the PMTU search |
| 488 |
is performed downward, while in [<a href="./rfc4821" title=""Packetization Layer Path MTU Discovery"">RFC4821</a>] it is performed upward. |
| 489 |
The reason for this change is that IKE usually sends large messages |
| 490 |
only when the IKE SA is being established, and in many cases there is |
| 491 |
only one such message. If the probing were performed upward, this |
| 492 |
message would be fragmented using the smallest allowable threshold, |
| 493 |
and usually all other messages are small enough to avoid IP |
| 494 |
fragmentation, so continued probing would be of little value. |
| 495 |
|
| 496 |
|
| 497 |
|
| 498 |
|
| 499 |
|
| 500 |
<span class="grey">Smyslov Standards Track [Page 9]</span></pre> |
| 501 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-10" ></span> |
| 502 |
<span class="grey"><a href="./rfc7383">RFC 7383</a> IKEv2 Fragmentation November 2014</span> |
| 503 |
|
| 504 |
|
| 505 |
It is the initiator of the exchange who performs PMTU discovery. |
| 506 |
This is done by probing several values of fragmentation threshold. |
| 507 |
Implementations MUST be prepared to probe in every exchange that |
| 508 |
utilizes IKE fragmentation to deal with possible changes in path MTU |
| 509 |
over time. While doing probes, it MUST start from larger values and |
| 510 |
refragment the original message, using the next smaller value of the |
| 511 |
threshold if it did not receive a response in a reasonable time after |
| 512 |
several retransmissions. The exact number of retransmissions and |
| 513 |
length of timeouts are not covered in this specification because they |
| 514 |
do not affect interoperability. However, the timeout interval is |
| 515 |
supposed to be relatively short, so that unsuccessful probes would |
| 516 |
not delay IKE operations too much. Performing a few retries within |
| 517 |
several seconds for each probe seems appropriate, but different |
| 518 |
environments may require different rules. When starting a new probe, |
| 519 |
the node MUST reset its retransmission timers so that if it employs |
| 520 |
exponential back-off the timers will start over. After reaching the |
| 521 |
smallest allowed value for the fragmentation threshold, an |
| 522 |
implementation MUST continue retransmitting until the exchange either |
| 523 |
completes or times out using some timeout interval as discussed in |
| 524 |
<a href="./rfc7296#section-2.4">Section 2.4 of [RFC7296]</a>. |
| 525 |
|
| 526 |
PMTU discovery in IKE is supposed to be coarse-grained, i.e., it is |
| 527 |
expected that a node will try only a few fragmentation thresholds in |
| 528 |
order to minimize delays caused by unsuccessful probes. If path MTU |
| 529 |
information is not yet available, the endpoint may use the link MTU |
| 530 |
size when it starts probing. In subsequent exchanges, the node |
| 531 |
should start with the current value of the fragmentation threshold. |
| 532 |
|
| 533 |
If an implementation is capable of receiving ICMP error messages, it |
| 534 |
can additionally utilize classic PMTU discovery methods, as described |
| 535 |
in [<a href="./rfc1191" title=""Path MTU discovery"">RFC1191</a>] and [<a href="./rfc1981" title=""Path MTU Discovery for IP version 6"">RFC1981</a>]. In particular, if the initiator receives |
| 536 |
a Packet Too Big error in response to the probe, and it contains a |
| 537 |
smaller value than the current fragmentation threshold, then the |
| 538 |
initiator SHOULD stop retransmitting the probe and SHOULD select a |
| 539 |
new value for the fragmentation threshold that is less than or equal |
| 540 |
to the value from the ICMP message and meets the requirements listed |
| 541 |
below. |
| 542 |
|
| 543 |
In the case of PMTU discovery, the Total Fragments field is used to |
| 544 |
distinguish between different sets of fragments, i.e., the sets that |
| 545 |
were created by fragmenting the original message using different |
| 546 |
fragmentation thresholds. Since the sender starts from larger |
| 547 |
fragments and then makes them smaller, the value in the Total |
| 548 |
Fragments field increases with each new probe. When selecting the |
| 549 |
next smaller value for the fragmentation threshold, the sender MUST |
| 550 |
ensure that the value in the Total Fragments field is really |
| 551 |
increased. This requirement should not be a problem for the sender, |
| 552 |
because PMTU discovery in IKE is supposed to be coarse-grained, so |
| 553 |
|
| 554 |
|
| 555 |
|
| 556 |
<span class="grey">Smyslov Standards Track [Page 10]</span></pre> |
| 557 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-11" ></span> |
| 558 |
<span class="grey"><a href="./rfc7383">RFC 7383</a> IKEv2 Fragmentation November 2014</span> |
| 559 |
|
| 560 |
|
| 561 |
the difference between previous and next fragmentation thresholds |
| 562 |
should be significant anyway. The need to distinguish between the |
| 563 |
sets is vital for the receiver, since receiving a valid fragment from |
| 564 |
a newer set means that it has to start the reassembly process over |
| 565 |
and not mix fragments from different sets. |
| 566 |
|
| 567 |
<span class="h4"><a class="selflink" id="section-2.5.3" href="#section-2.5.3">2.5.3</a>. Fragmenting Messages Containing Unprotected Payloads</span> |
| 568 |
|
| 569 |
Currently, there are no IKEv2 exchanges that define messages, |
| 570 |
containing both unprotected payloads and payloads, that are protected |
| 571 |
by the Encrypted payload. However, IKEv2 does not prohibit such |
| 572 |
construction. If some future IKEv2 extension defines such a message |
| 573 |
and it needs to be fragmented, all unprotected payloads MUST be |
| 574 |
placed in the first fragment (with the Fragment Number field equal to |
| 575 |
1), along with the Encrypted Fragment payload, which MUST be present |
| 576 |
in every IKE Fragment message and be the last payload in it. |
| 577 |
|
| 578 |
Below is an example of a fragmenting message that contains both |
| 579 |
protected and unprotected payloads. |
| 580 |
|
| 581 |
HDR(MID=n), PLD0, SK(NextPld=PLD1) {PLD1 ... PLDN} |
| 582 |
|
| 583 |
Original Message |
| 584 |
|
| 585 |
|
| 586 |
HDR(MID=n), PLD0, SKF(NextPld=PLD1, Frag#=1, TotalFrags=m) {...}, |
| 587 |
HDR(MID=n), SKF(NextPld=0, Frag#=2, TotalFrags=m) {...}, |
| 588 |
... |
| 589 |
HDR(MID=n), SKF(NextPld=0, Frag#=m, TotalFrags=m) {...} |
| 590 |
|
| 591 |
IKE Fragment Messages |
| 592 |
|
| 593 |
Note that the size of each IP datagram bearing IKE Fragment messages |
| 594 |
should not exceed the fragmentation threshold, including the first |
| 595 |
one, that contains unprotected payloads. This will reduce the size |
| 596 |
of the Encrypted Fragment payload content in the first IKE Fragment |
| 597 |
message to accommodate all unprotected payloads. In an extreme case, |
| 598 |
the Encrypted Fragment payload will contain no data, but it still |
| 599 |
must be present in the message, because only its presence allows the |
| 600 |
receiver to determine that the sender has used IKE fragmentation. |
| 601 |
|
| 602 |
<span class="h3"><a class="selflink" id="section-2.6" href="#section-2.6">2.6</a>. Receiving IKE Fragment Message</span> |
| 603 |
|
| 604 |
The receiver identifies the IKE Fragment message by the presence of |
| 605 |
an Encrypted Fragment payload in it. In most cases, it will be the |
| 606 |
first and only payload in the message; however, this may not be true |
| 607 |
for some hypothetical IKE exchanges (see <a href="#section-2.5.3">Section 2.5.3</a>). |
| 608 |
|
| 609 |
|
| 610 |
|
| 611 |
|
| 612 |
<span class="grey">Smyslov Standards Track [Page 11]</span></pre> |
| 613 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-12" ></span> |
| 614 |
<span class="grey"><a href="./rfc7383">RFC 7383</a> IKEv2 Fragmentation November 2014</span> |
| 615 |
|
| 616 |
|
| 617 |
Upon receiving the IKE Fragment message, the following actions are |
| 618 |
performed: |
| 619 |
|
| 620 |
o Check message validity - in particular, check whether the values |
| 621 |
in the Fragment Number and the Total Fragments fields in the |
| 622 |
Encrypted Fragment payload are valid. The following tests need to |
| 623 |
be performed. |
| 624 |
|
| 625 |
* check that the Fragment Number and the Total Fragments fields |
| 626 |
contain non-zero values |
| 627 |
|
| 628 |
* check that the value in the Fragment Number field is less than |
| 629 |
or equal to the value in the Total Fragments field |
| 630 |
|
| 631 |
* if reassembling has already started, check that the value in |
| 632 |
the Total Fragments field is equal to or greater than the Total |
| 633 |
Fragments field in the fragments that have already been stored |
| 634 |
in the reassembling queue |
| 635 |
|
| 636 |
If any of these tests fail, the message MUST be silently |
| 637 |
discarded. |
| 638 |
|
| 639 |
o Check that this IKE Fragment message is new for the receiver and |
| 640 |
not a replay. If an IKE Fragment message with the same Message |
| 641 |
ID, Fragment Number, and Total Fragments fields is already present |
| 642 |
in the reassembling queue, this message is considered a replay and |
| 643 |
MUST be silently discarded. |
| 644 |
|
| 645 |
o Verify IKE Fragment message authenticity by checking the Integrity |
| 646 |
Check Value (ICV) in the Encrypted Fragment payload. If the ICV |
| 647 |
check fails, the message MUST be silently discarded. |
| 648 |
|
| 649 |
o If reassembling is not finished yet and the Total Fragments field |
| 650 |
in the received fragment is greater than the Total Fragments field |
| 651 |
in those fragments that are in the reassembling queue, the |
| 652 |
receiver MUST discard all received fragments and start the |
| 653 |
reassembly process over with just the received IKE Fragment |
| 654 |
message. |
| 655 |
|
| 656 |
o Store the message in the reassembling queue waiting for the rest |
| 657 |
of the fragments to arrive. |
| 658 |
|
| 659 |
When all IKE Fragment messages (as indicated in the Total Fragments |
| 660 |
field) are received, the decrypted content of all Encrypted Fragment |
| 661 |
payloads is merged together to form the content of the original |
| 662 |
Encrypted payload and, therefore, along with the IKE header and |
| 663 |
|
| 664 |
|
| 665 |
|
| 666 |
|
| 667 |
|
| 668 |
<span class="grey">Smyslov Standards Track [Page 12]</span></pre> |
| 669 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-13" ></span> |
| 670 |
<span class="grey"><a href="./rfc7383">RFC 7383</a> IKEv2 Fragmentation November 2014</span> |
| 671 |
|
| 672 |
|
| 673 |
unprotected payloads (if any), the original message. Then, it is |
| 674 |
processed as if it was received, verified, and decrypted as a regular |
| 675 |
IKE message. |
| 676 |
|
| 677 |
If the receiver does not get all IKE fragments needed to reassemble |
| 678 |
the original message within a timeout interval, it MUST discard all |
| 679 |
IKE Fragment messages received so far for the exchange. The next |
| 680 |
actions depend on the role of the receiver in the exchange. |
| 681 |
|
| 682 |
o The initiator acts as described in <a href="./rfc7296#section-2.1">Section 2.1 of [RFC7296]</a>. It |
| 683 |
either retransmits the fragmented request message or deems the IKE |
| 684 |
SA to have failed and deletes it. The number of retransmits and |
| 685 |
length of timeouts for the initiator are not covered in this |
| 686 |
specification, since they are assumed to be the same as in a |
| 687 |
regular IKEv2 exchange and are discussed in <a href="./rfc7296#section-2.4">Section 2.4 of |
| 688 |
[RFC7296]</a>. |
| 689 |
|
| 690 |
o The responder in this case acts as if no request message was |
| 691 |
received. It would delete any memory of the incomplete request |
| 692 |
message and not treat it as an IKE SA failure. It is RECOMMENDED |
| 693 |
that the reassembling timeout for the responder be equal to the |
| 694 |
time interval that the implementation waits before completely |
| 695 |
giving up when acting as the initiator of an exchange. |
| 696 |
<a href="./rfc7296#section-2.4">Section 2.4 of [RFC7296]</a> gives recommendations for selecting this |
| 697 |
interval. Implementations can use a shorter timeout to conserve |
| 698 |
memory. |
| 699 |
|
| 700 |
<span class="h4"><a class="selflink" id="section-2.6.1" href="#section-2.6.1">2.6.1</a>. Replay Detection and Retransmissions</span> |
| 701 |
|
| 702 |
According to <a href="./rfc7296#section-2.2">Section 2.2 of [RFC7296]</a>, the Message ID is used, in |
| 703 |
particular, to identify retransmissions of IKE messages. Each |
| 704 |
request or response message, sent by either side, must have a unique |
| 705 |
Message ID, or be considered a retransmission otherwise. This logic |
| 706 |
has already been updated by [<a href="./rfc6311" title=""Protocol Support for High Availability of IKEv2/ IPsec"">RFC6311</a>], which deliberately allows any |
| 707 |
number of messages with zero Message ID. This document also updates |
| 708 |
this logic for those situations where IKE fragmentation is in use. |
| 709 |
|
| 710 |
If an incoming message contains an Encrypted Fragment payload, the |
| 711 |
values of the Fragment Number and Total Fragments fields MUST be used |
| 712 |
along with the Message ID to detect retransmissions and replays. |
| 713 |
|
| 714 |
If the responder receives a retransmitted fragment of a request when |
| 715 |
it has already processed that request and has sent back a response, |
| 716 |
that event MUST only trigger a retransmission of the response message |
| 717 |
(fragmented or not) if the Fragment Number field in the received |
| 718 |
fragment is set to 1; otherwise, it MUST be ignored. |
| 719 |
|
| 720 |
|
| 721 |
|
| 722 |
|
| 723 |
|
| 724 |
<span class="grey">Smyslov Standards Track [Page 13]</span></pre> |
| 725 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-14" ></span> |
| 726 |
<span class="grey"><a href="./rfc7383">RFC 7383</a> IKEv2 Fragmentation November 2014</span> |
| 727 |
|
| 728 |
|
| 729 |
<span class="h2"><a class="selflink" id="section-3" href="#section-3">3</a>. Interaction with Other IKE Extensions</span> |
| 730 |
|
| 731 |
IKE fragmentation is compatible with most IKE extensions, such as IKE |
| 732 |
Session Resumption ([<a href="./rfc5723" title=""Internet Key Exchange Protocol Version 2 (IKEv2) Session Resumption"">RFC5723</a>]), the Quick Crash Detection Method |
| 733 |
([<a href="./rfc6290" title=""A Quick Crash Detection Method for the Internet Key Exchange Protocol (IKE)"">RFC6290</a>]), and so on. It neither affects their operation nor is |
| 734 |
affected by them. It is believed that IKE fragmentation will also be |
| 735 |
compatible with future IKE extensions, if they follow general |
| 736 |
principles of formatting, sending, and receiving IKE messages, as |
| 737 |
described in [<a href="./rfc7296" title=""Internet Key Exchange Protocol Version 2 (IKEv2)"">RFC7296</a>]. |
| 738 |
|
| 739 |
When IKE fragmentation is used with IKE Session Resumption |
| 740 |
([<a href="./rfc5723" title=""Internet Key Exchange Protocol Version 2 (IKEv2) Session Resumption"">RFC5723</a>]), messages of an IKE_SESSION_RESUME exchange cannot be |
| 741 |
fragmented, since they do not contain an Encrypted payload. These |
| 742 |
messages may be large due to the ticket size. To avoid IP |
| 743 |
fragmentation in this situation, it is recommended that smaller |
| 744 |
tickets be used, e.g., by utilizing a "ticket by reference" approach |
| 745 |
instead of "ticket by value". |
| 746 |
|
| 747 |
Protocol Support for High Availability of IKEv2/IPsec, described in |
| 748 |
[<a href="./rfc6311" title=""Protocol Support for High Availability of IKEv2/ IPsec"">RFC6311</a>], requires special care when deciding whether to fragment an |
| 749 |
IKE message or not. Since it deliberately allows any number of |
| 750 |
synchronization exchanges to have the same Message ID, namely zero, |
| 751 |
standard IKEv2 replay detection logic, based on checking the Message |
| 752 |
ID, is not applicable for such messages, and the receiver has to |
| 753 |
check message content to detect replays. When implementing IKE |
| 754 |
fragmentation along with [<a href="./rfc6311" title=""Protocol Support for High Availability of IKEv2/ IPsec"">RFC6311</a>], IKE Message ID Synchronization |
| 755 |
messages MUST NOT be sent fragmented, to simplify the receiver's task |
| 756 |
of detecting replays. Fortunately, these messages are small, and |
| 757 |
there is no point in fragmenting them anyway. |
| 758 |
|
| 759 |
<span class="h2"><a class="selflink" id="section-4" href="#section-4">4</a>. Transport Considerations</span> |
| 760 |
|
| 761 |
With IKE fragmentation, if any single IKE Fragment message gets lost, |
| 762 |
the receiver becomes unable to reassemble the original message. So, |
| 763 |
in general, using IKE fragmentation implies a higher probability that |
| 764 |
the message will not be delivered to the peer. Although in most |
| 765 |
network environments the difference will be insignificant, on some |
| 766 |
lossy networks it may become noticeable. When using IKE |
| 767 |
fragmentation, implementations MAY use longer timeouts and do more |
| 768 |
retransmits than usual before considering the peer dead. |
| 769 |
|
| 770 |
Note that Fragment messages are not individually acknowledged. The |
| 771 |
response Fragment messages are all sent back together only when all |
| 772 |
fragments of the request are received, and the original request |
| 773 |
message is reassembled and successfully processed. |
| 774 |
|
| 775 |
|
| 776 |
|
| 777 |
|
| 778 |
|
| 779 |
|
| 780 |
<span class="grey">Smyslov Standards Track [Page 14]</span></pre> |
| 781 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-15" ></span> |
| 782 |
<span class="grey"><a href="./rfc7383">RFC 7383</a> IKEv2 Fragmentation November 2014</span> |
| 783 |
|
| 784 |
|
| 785 |
<span class="h2"><a class="selflink" id="section-5" href="#section-5">5</a>. Security Considerations</span> |
| 786 |
|
| 787 |
Most of the security considerations for IKE fragmentation are the |
| 788 |
same as those for the base IKEv2 protocol described in [<a href="./rfc7296" title=""Internet Key Exchange Protocol Version 2 (IKEv2)"">RFC7296</a>]. |
| 789 |
This extension introduces the Encrypted Fragment payload to protect |
| 790 |
the content of an IKE Message Fragment. This allows the receiver to |
| 791 |
individually check the authenticity of fragments, thus protecting |
| 792 |
peers from a DoS attack. |
| 793 |
|
| 794 |
The Security Considerations section of [<a href="./rfc7296" title=""Internet Key Exchange Protocol Version 2 (IKEv2)"">RFC7296</a>] mentions a possible |
| 795 |
attack on IKE where an attacker could prevent an exchange from |
| 796 |
completing by exhausting the IP reassembly buffers. The mechanism |
| 797 |
described in this document allows IKE to avoid IP fragmentation and |
| 798 |
therefore increases its robustness to DoS attacks. |
| 799 |
|
| 800 |
The following attack is possible with IKE fragmentation. An attacker |
| 801 |
can initiate an IKE_SA_INIT exchange, complete it, compute SK_a and |
| 802 |
SK_e, and then send a large but still incomplete set of IKE_AUTH |
| 803 |
fragments. These fragments will pass the ICV check and will be |
| 804 |
stored in reassembly buffers, but since the set is incomplete, the |
| 805 |
reassembling will never succeed and eventually will time out. If the |
| 806 |
set is large, this attack could potentially exhaust the receiver's |
| 807 |
memory resources. |
| 808 |
|
| 809 |
To mitigate the impact of this attack, it is RECOMMENDED that the |
| 810 |
receiver limit the number of fragments it stores in the reassembling |
| 811 |
queue so that the sum of the sizes of Encrypted Fragment payload |
| 812 |
contents (after decryption) for fragments that are already placed |
| 813 |
into the reassembling queue is less than some value that is |
| 814 |
reasonable for the implementation. If the peer sends so many |
| 815 |
fragments that the above condition is not met, the receiver can |
| 816 |
consider this situation to be either an attack or a broken sender |
| 817 |
implementation. In either case, the receiver SHOULD drop the |
| 818 |
connection and discard all the received fragments. |
| 819 |
|
| 820 |
This value can be predefined, can be a configurable option, or can be |
| 821 |
calculated dynamically, depending on the receiver's memory load. |
| 822 |
Some care should be taken when selecting this value because if it is |
| 823 |
too small it might prevent a legitimate peer from establishing an IKE |
| 824 |
SA if the size of messages it sends exceeds this value. It is NOT |
| 825 |
RECOMMENDED for this value to exceed 64 KB because any IKE message |
| 826 |
before fragmentation would likely be shorter than that. |
| 827 |
|
| 828 |
If IKE fragments arrive in order, it is possible, but not advised, |
| 829 |
for the receiver to parse the beginning of the message that is being |
| 830 |
reassembled and extract the already-available payloads before the |
| 831 |
reassembly is complete. It can be dangerous to take any action based |
| 832 |
on the content of these payloads, because the fragments that have not |
| 833 |
|
| 834 |
|
| 835 |
|
| 836 |
<span class="grey">Smyslov Standards Track [Page 15]</span></pre> |
| 837 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-16" ></span> |
| 838 |
<span class="grey"><a href="./rfc7383">RFC 7383</a> IKEv2 Fragmentation November 2014</span> |
| 839 |
|
| 840 |
|
| 841 |
yet been received might contain payloads that could change the |
| 842 |
meaning of them (or could even make the whole message invalid), and |
| 843 |
this can potentially be exploited by an attacker. It is important to |
| 844 |
address this threat by ensuring that all the fragments are received |
| 845 |
prior to parsing the reassembled message, as described in |
| 846 |
<a href="#section-2.6">Section 2.6</a>. |
| 847 |
|
| 848 |
<span class="h2"><a class="selflink" id="section-6" href="#section-6">6</a>. IANA Considerations</span> |
| 849 |
|
| 850 |
This document defines a new payload in the "IKEv2 Payload Types" |
| 851 |
registry: |
| 852 |
|
| 853 |
53 Encrypted and Authenticated Fragment SKF |
| 854 |
|
| 855 |
This document also defines a new Notify Message Type in the "IKEv2 |
| 856 |
Notify Message Types - Status Types" registry: |
| 857 |
|
| 858 |
16430 IKEV2_FRAGMENTATION_SUPPORTED |
| 859 |
|
| 860 |
<span class="h2"><a class="selflink" id="section-7" href="#section-7">7</a>. References</span> |
| 861 |
|
| 862 |
<span class="h3"><a class="selflink" id="section-7.1" href="#section-7.1">7.1</a>. Normative References</span> |
| 863 |
|
| 864 |
[<a id="ref-RFC2119">RFC2119</a>] Bradner, S., "Key words for use in RFCs to Indicate |
| 865 |
Requirement Levels", <a href="https://www.rfc-editor.org/bcp/bcp14">BCP 14</a>, <a href="./rfc2119">RFC 2119</a>, March 1997, |
| 866 |
<<a href="http://www.rfc-editor.org/info/rfc2119">http://www.rfc-editor.org/info/rfc2119</a>>. |
| 867 |
|
| 868 |
[<a id="ref-RFC7296">RFC7296</a>] Kaufman, C., Hoffman, P., Nir, Y., Eronen, P., and T. |
| 869 |
Kivinen, "Internet Key Exchange Protocol Version 2 |
| 870 |
(IKEv2)", STD 79, <a href="./rfc7296">RFC 7296</a>, October 2014, |
| 871 |
<<a href="http://www.rfc-editor.org/info/rfc7296">http://www.rfc-editor.org/info/rfc7296</a>>. |
| 872 |
|
| 873 |
[<a id="ref-RFC6311">RFC6311</a>] Singh, R., Kalyani, G., Nir, Y., Sheffer, Y., and D. |
| 874 |
Zhang, "Protocol Support for High Availability of IKEv2/ |
| 875 |
IPsec", <a href="./rfc6311">RFC 6311</a>, July 2011, |
| 876 |
<<a href="http://www.rfc-editor.org/info/rfc6311">http://www.rfc-editor.org/info/rfc6311</a>>. |
| 877 |
|
| 878 |
<span class="h3"><a class="selflink" id="section-7.2" href="#section-7.2">7.2</a>. Informative References</span> |
| 879 |
|
| 880 |
[<a id="ref-RFC0791">RFC0791</a>] Postel, J., "Internet Protocol", STD 5, <a href="./rfc791">RFC 791</a>, |
| 881 |
September 1981, <<a href="http://www.rfc-editor.org/info/rfc791">http://www.rfc-editor.org/info/rfc791</a>>. |
| 882 |
|
| 883 |
[<a id="ref-RFC1191">RFC1191</a>] Mogul, J. and S. Deering, "Path MTU discovery", <a href="./rfc1191">RFC 1191</a>, |
| 884 |
November 1990, <<a href="http://www.rfc-editor.org/info/rfc1191">http://www.rfc-editor.org/info/rfc1191</a>>. |
| 885 |
|
| 886 |
[<a id="ref-RFC1981">RFC1981</a>] McCann, J., Deering, S., and J. Mogul, "Path MTU Discovery |
| 887 |
for IP version 6", <a href="./rfc1981">RFC 1981</a>, August 1996, |
| 888 |
<<a href="http://www.rfc-editor.org/info/rfc1981">http://www.rfc-editor.org/info/rfc1981</a>>. |
| 889 |
|
| 890 |
|
| 891 |
|
| 892 |
<span class="grey">Smyslov Standards Track [Page 16]</span></pre> |
| 893 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-17" ></span> |
| 894 |
<span class="grey"><a href="./rfc7383">RFC 7383</a> IKEv2 Fragmentation November 2014</span> |
| 895 |
|
| 896 |
|
| 897 |
[<a id="ref-RFC2460">RFC2460</a>] Deering, S. and R. Hinden, "Internet Protocol, Version 6 |
| 898 |
(IPv6) Specification", <a href="./rfc2460">RFC 2460</a>, December 1998, |
| 899 |
<<a href="http://www.rfc-editor.org/info/rfc2460">http://www.rfc-editor.org/info/rfc2460</a>>. |
| 900 |
|
| 901 |
[<a id="ref-RFC4787">RFC4787</a>] Audet, F. and C. Jennings, "Network Address Translation |
| 902 |
(NAT) Behavioral Requirements for Unicast UDP", <a href="https://www.rfc-editor.org/bcp/bcp127">BCP 127</a>, |
| 903 |
<a href="./rfc4787">RFC 4787</a>, January 2007, |
| 904 |
<<a href="http://www.rfc-editor.org/info/rfc4787">http://www.rfc-editor.org/info/rfc4787</a>>. |
| 905 |
|
| 906 |
[<a id="ref-RFC4821">RFC4821</a>] Mathis, M. and J. Heffner, "Packetization Layer Path MTU |
| 907 |
Discovery", <a href="./rfc4821">RFC 4821</a>, March 2007, |
| 908 |
<<a href="http://www.rfc-editor.org/info/rfc4821">http://www.rfc-editor.org/info/rfc4821</a>>. |
| 909 |
|
| 910 |
[<a id="ref-RFC5282">RFC5282</a>] Black, D. and D. McGrew, "Using Authenticated Encryption |
| 911 |
Algorithms with the Encrypted Payload of the Internet Key |
| 912 |
Exchange version 2 (IKEv2) Protocol", <a href="./rfc5282">RFC 5282</a>, |
| 913 |
August 2008, <<a href="http://www.rfc-editor.org/info/rfc5282">http://www.rfc-editor.org/info/rfc5282</a>>. |
| 914 |
|
| 915 |
[<a id="ref-RFC5405">RFC5405</a>] Eggert, L. and G. Fairhurst, "Unicast UDP Usage Guidelines |
| 916 |
for Application Designers", <a href="https://www.rfc-editor.org/bcp/bcp145">BCP 145</a>, <a href="./rfc5405">RFC 5405</a>, |
| 917 |
November 2008, <<a href="http://www.rfc-editor.org/info/rfc5405">http://www.rfc-editor.org/info/rfc5405</a>>. |
| 918 |
|
| 919 |
[<a id="ref-RFC5723">RFC5723</a>] Sheffer, Y. and H. Tschofenig, "Internet Key Exchange |
| 920 |
Protocol Version 2 (IKEv2) Session Resumption", <a href="./rfc5723">RFC 5723</a>, |
| 921 |
January 2010, <<a href="http://www.rfc-editor.org/info/rfc5723">http://www.rfc-editor.org/info/rfc5723</a>>. |
| 922 |
|
| 923 |
[<a id="ref-RFC6290">RFC6290</a>] Nir, Y., Wierbowski, D., Detienne, F., and P. Sethi, "A |
| 924 |
Quick Crash Detection Method for the Internet Key Exchange |
| 925 |
Protocol (IKE)", <a href="./rfc6290">RFC 6290</a>, June 2011, |
| 926 |
<<a href="http://www.rfc-editor.org/info/rfc6290">http://www.rfc-editor.org/info/rfc6290</a>>. |
| 927 |
|
| 928 |
[<a id="ref-RFC6888">RFC6888</a>] Perreault, S., Yamagata, I., Miyakawa, S., Nakagawa, A., |
| 929 |
and H. Ashida, "Common Requirements for Carrier-Grade NATs |
| 930 |
(CGNs)", <a href="https://www.rfc-editor.org/bcp/bcp127">BCP 127</a>, <a href="./rfc6888">RFC 6888</a>, April 2013, |
| 931 |
<<a href="http://www.rfc-editor.org/info/rfc6888">http://www.rfc-editor.org/info/rfc6888</a>>. |
| 932 |
|
| 933 |
[<a id="ref-FRAGDROP">FRAGDROP</a>] Jaeggli, J., Colitti, L., Kumari, W., Vyncke, E., Kaeo, |
| 934 |
M., and T. Taylor, "Why Operators Filter Fragments and |
| 935 |
What It Implies", Work in Progress, <a href="./draft-taylor-v6ops-fragdrop-02">draft-taylor-v6ops-</a> |
| 936 |
<a href="./draft-taylor-v6ops-fragdrop-02">fragdrop-02</a>, December 2013. |
| 937 |
|
| 938 |
|
| 939 |
|
| 940 |
|
| 941 |
|
| 942 |
|
| 943 |
|
| 944 |
|
| 945 |
|
| 946 |
|
| 947 |
|
| 948 |
<span class="grey">Smyslov Standards Track [Page 17]</span></pre> |
| 949 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-18" ></span> |
| 950 |
<span class="grey"><a href="./rfc7383">RFC 7383</a> IKEv2 Fragmentation November 2014</span> |
| 951 |
|
| 952 |
|
| 953 |
[<a id="ref-BLACKHOLES">BLACKHOLES</a>] |
| 954 |
De Boer, M. and J. Bosma, "Discovering Path MTU black |
| 955 |
holes on the Internet using RIPE Atlas", July 2012, |
| 956 |
<<a href="http://www.nlnetlabs.nl/downloads/publications/pmtu-black-holes-msc-thesis.pdf">http://www.nlnetlabs.nl/downloads/publications/</a> |
| 957 |
<a href="http://www.nlnetlabs.nl/downloads/publications/pmtu-black-holes-msc-thesis.pdf">pmtu-black-holes-msc-thesis.pdf</a>>. |
| 958 |
|
| 959 |
[<a id="ref-DOSUDPPROT">DOSUDPPROT</a>] |
| 960 |
Kaufman, C., Perlman, R., and B. Sommerfeld, "DoS |
| 961 |
protection for UDP-based protocols", ACM Conference on |
| 962 |
Computer and Communications Security, October 2003. |
| 963 |
|
| 964 |
|
| 965 |
|
| 966 |
|
| 967 |
|
| 968 |
|
| 969 |
|
| 970 |
|
| 971 |
|
| 972 |
|
| 973 |
|
| 974 |
|
| 975 |
|
| 976 |
|
| 977 |
|
| 978 |
|
| 979 |
|
| 980 |
|
| 981 |
|
| 982 |
|
| 983 |
|
| 984 |
|
| 985 |
|
| 986 |
|
| 987 |
|
| 988 |
|
| 989 |
|
| 990 |
|
| 991 |
|
| 992 |
|
| 993 |
|
| 994 |
|
| 995 |
|
| 996 |
|
| 997 |
|
| 998 |
|
| 999 |
|
| 1000 |
|
| 1001 |
|
| 1002 |
|
| 1003 |
|
| 1004 |
<span class="grey">Smyslov Standards Track [Page 18]</span></pre> |
| 1005 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-19" ></span> |
| 1006 |
<span class="grey"><a href="./rfc7383">RFC 7383</a> IKEv2 Fragmentation November 2014</span> |
| 1007 |
|
| 1008 |
|
| 1009 |
<span class="h2"><a class="selflink" id="appendix-A" href="#appendix-A">Appendix A</a>. Design Rationale</span> |
| 1010 |
|
| 1011 |
The simplest approach to IKE fragmentation would have been to |
| 1012 |
fragment a message that is fully formed and ready to be sent. |
| 1013 |
However, if a message got fragmented after being encrypted and |
| 1014 |
authenticated, this could make a simple DoS attack possible. The |
| 1015 |
attacker could infrequently emit forged but valid-looking fragments |
| 1016 |
into the network, and some of these fragments would be fetched by the |
| 1017 |
receiver into the reassembling queue. The receiver would not be able |
| 1018 |
to distinguish forged fragments from valid ones and would only be |
| 1019 |
able to determine that some of the received fragments were forged |
| 1020 |
after the whole message was reassembled and its authenticity check |
| 1021 |
failed. |
| 1022 |
|
| 1023 |
To prevent this kind of attack and also reduce vulnerability to some |
| 1024 |
other kinds of DoS attacks, it was decided to perform fragmentation |
| 1025 |
before applying cryptographic protection to the message. In this |
| 1026 |
case, each Fragment message becomes individually encrypted and |
| 1027 |
authenticated; this allows the receiver to determine forged fragments |
| 1028 |
and not store them in the reassembling queue. |
| 1029 |
|
| 1030 |
<span class="h2"><a class="selflink" id="appendix-B" href="#appendix-B">Appendix B</a>. Correlation between IP Datagram Size and Encrypted Payload</span> |
| 1031 |
Content Size |
| 1032 |
|
| 1033 |
In the case of IPv4, the content size of the Encrypted Payload is |
| 1034 |
less than the IP datagram size by the sum of the following values: |
| 1035 |
|
| 1036 |
o IPv4 header size (typically 20 bytes, up to 60 if IP options are |
| 1037 |
present) |
| 1038 |
|
| 1039 |
o UDP header size (8 bytes) |
| 1040 |
|
| 1041 |
o non-ESP (Encapsulating Security Payload) marker size (4 bytes if |
| 1042 |
present) |
| 1043 |
|
| 1044 |
o IKE header size (28 bytes) |
| 1045 |
|
| 1046 |
o Encrypted payload header size (4 bytes) |
| 1047 |
|
| 1048 |
o initialization vector (IV) size (variable) |
| 1049 |
|
| 1050 |
o padding and its size (at least 1 byte) |
| 1051 |
|
| 1052 |
o ICV size (variable) |
| 1053 |
|
| 1054 |
The sum may be estimated as 61..105 bytes + IV + ICV + padding. |
| 1055 |
|
| 1056 |
|
| 1057 |
|
| 1058 |
|
| 1059 |
|
| 1060 |
<span class="grey">Smyslov Standards Track [Page 19]</span></pre> |
| 1061 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-20" ></span> |
| 1062 |
<span class="grey"><a href="./rfc7383">RFC 7383</a> IKEv2 Fragmentation November 2014</span> |
| 1063 |
|
| 1064 |
|
| 1065 |
In the case of IPv6, the content size of the Encrypted Payload is |
| 1066 |
less than the IP datagram size by the sum of the following values: |
| 1067 |
|
| 1068 |
o IPv6 header size (40 bytes) |
| 1069 |
|
| 1070 |
o IPv6 extension headers (optional; size varies) |
| 1071 |
|
| 1072 |
o UDP header size (8 bytes) |
| 1073 |
|
| 1074 |
o non-ESP marker size (4 bytes if present) |
| 1075 |
|
| 1076 |
o IKE header size (28 bytes) |
| 1077 |
|
| 1078 |
o Encrypted payload header size (4 bytes) |
| 1079 |
|
| 1080 |
o IV size (variable) |
| 1081 |
|
| 1082 |
o padding and its size (at least 1 byte) |
| 1083 |
|
| 1084 |
o ICV size (variable) |
| 1085 |
|
| 1086 |
If no extension header is present, the sum may be estimated as |
| 1087 |
81..85 bytes + IV + ICV + padding. If extension headers are present, |
| 1088 |
the payload content size is further reduced by the sum of the size of |
| 1089 |
the extension headers. The length of each extension header can be |
| 1090 |
calculated as 8 * (Hdr Ext Len) bytes, except for the fragment |
| 1091 |
header, which is always 8 bytes in length. |
| 1092 |
|
| 1093 |
Acknowledgements |
| 1094 |
|
| 1095 |
The author would like to thank Tero Kivinen, Yoav Nir, Paul Wouters, |
| 1096 |
Yaron Sheffer, Joe Touch, Derek Atkins, Ole Troan, and others for |
| 1097 |
their reviews and valuable comments. Thanks to Ron Bonica for |
| 1098 |
contributing text to the Introduction section. Thanks to Paul |
| 1099 |
Hoffman and Barry Leiba for improving text clarity. |
| 1100 |
|
| 1101 |
Author's Address |
| 1102 |
|
| 1103 |
Valery Smyslov |
| 1104 |
ELVIS-PLUS |
| 1105 |
PO Box 81 |
| 1106 |
Moscow (Zelenograd) 124460 |
| 1107 |
Russian Federation |
| 1108 |
|
| 1109 |
Phone: +7 495 276 0211 |
| 1110 |
EMail: [email protected] |
| 1111 |
|
| 1112 |
|
| 1113 |
|
| 1114 |
|
| 1115 |
|
| 1116 |
Smyslov Standards Track [Page 20] |
| 1117 |
</pre> |