Network Working GroupInternet Engineering Task Force (IETF) V. SmyslovInternet-DraftRequest for Comments: 7383 ELVIS-PLUSIntended status:Category: Standards TrackJune 10, 2014 Expires: December 12,November 2014IKEv2ISSN: 2070-1721 Internet Key Exchange Protocol Version 2 (IKEv2) Message Fragmentationdraft-ietf-ipsecme-ikev2-fragmentation-10Abstract This document describesthea way to avoid IP fragmentation of largeIKEv2Internet Key Exchange Protocol version 2 (IKEv2) messages. This allows IKEv2 messages to traverse network devices that do not allow IP fragments to pass through. Status ofthisThis Memo ThisInternet-Draftissubmitted in full conformance with the provisions of BCP 78 and BCP 79. Internet-Drafts are working documentsan Internet Standards Track document. This document is a product of the Internet Engineering Task Force (IETF).Note that other groups may also distribute working documents as Internet-Drafts. The listIt represents the consensus ofcurrent Internet- Drafts is at http://datatracker.ietf.org/drafts/current/. Internet-Drafts are draft documents validthe IETF community. It has received public review and has been approved fora maximumpublication by the Internet Engineering Steering Group (IESG). Further information on Internet Standards is available in Section 2 of RFC 5741. Information about the current status ofsix monthsthis document, any errata, and how to provide feedback on it may beupdated, replaced, or obsoleted by other documentsobtained atany time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress." This Internet-Draft will expire on December 12, 2014.http://www.rfc-editor.org/info/rfc7383. Copyright Notice Copyright (c) 2014 IETF Trust and the persons identified as the document authors. All rights reserved. This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) 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 1. Introduction. . . . . . . . . . . . . . . . . . . . . . . . . 3....................................................2 1.1. Problemdescription . . . . . . . . . . . . . . . . . . . 3Description ........................................2 1.2. Proposedsolution . . . . . . . . . . . . . . . . . . . . 3Solution ..........................................3 1.3. Conventions Used in This Document. . . . . . . . . . . . 4..........................4 2. Protocoldetails . . . . . . . . . . . . . . . . . . . . . . . 5Details ................................................4 2.1. Overview. . . . . . . . . . . . . . . . . . . . . . . . . 5...................................................4 2.2. Limitations. . . . . . . . . . . . . . . . . . . . . . . 5................................................4 2.3. Negotiation. . . . . . . . . . . . . . . . . . . . . . . 5................................................5 2.4. Using IKE Fragmentation. . . . . . . . . . . . . . . . . 6....................................5 2.5. Fragmenting Message. . . . . . . . . . . . . . . . . . . 7........................................6 2.5.1. Selecting Fragment Size. . . . . . . . . . . . . . . 9.............................8 2.5.2. PMTU Discovery. . . . . . . . . . . . . . . . . . . . 10......................................9 2.5.3. Fragmenting Messagescontaining unprotectedContaining Unprotected Payloads. . . . . . . . . . . . . . . . . . . . . . . 11...........................................11 2.6. Receiving IKE Fragment Message. . . . . . . . . . . . . . 12............................11 2.6.1. Replay Detection and Retransmissions. . . . . . . . . 14...............13 3. Interaction withotherOther IKEextensions . . . . . . . . . . . . 15Extensions ..........................14 4. Transport Considerations. . . . . . . . . . . . . . . . . . . 16.......................................14 5. Security Considerations. . . . . . . . . . . . . . . . . . . 17........................................15 6. IANA Considerations. . . . . . . . . . . . . . . . . . . . . 19............................................16 7.Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 20 8.References. . . . . . . . . . . . . . . . . . . . . . . . . . 21 8.1......................................................16 7.1. Normative References. . . . . . . . . . . . . . . . . . . 21 8.2.......................................16 7.2. Informative References. . . . . . . . . . . . . . . . . . 21....................................16 Appendix A. Designrationale . . . . . . . . . . . . . . . . . . 23Rationale ......................................19 Appendix B. Correlation between IP DatagramsizeSize and Encrypted Payloadcontent size . . . . . . . . . . . 24Content Size ..................................19 Acknowledgements ..................................................20 Author's Address. . . . . . . . . . . . . . . . . . . . . . . . . 26..................................................20 1. Introduction 1.1. ProblemdescriptionDescription The Internet Key Exchange Protocol version 2 (IKEv2), specified in[IKEv2],[RFC7296], uses UDP as a transport for its messages. Most IKEv2 messages are relatively small, usually below several hundred bytes.NoticeableA notable exception is the IKE_AUTHExchange,exchange, which requires fairly large messages, up to severalkBytes,KB, especially when certificates are transferred. When the IKE message size exceeds the path MTU, it gets fragmentedbyat the IP level. The problem is that some network devices, specifically some NAT boxes, do not allow IP fragments to pass through. This apparently blocks IKE communication and, therefore, prevents peers from establishing an IPsecSA.Security Association (SA). Section 2 of[IKEv2][RFC7296] discusses the impact of IP fragmentation on IKEv2 and acknowledges this problem. Widespread deployment of Carrier-Grade NATs(CGN)(CGNs) introduces new challenges. [RFC6888] describes requirements for CGNs. Itstates,states that CGNs must comply with Section 11 of [RFC4787], which requiresNATNATs to support receiving IP fragments (REQ-14). In reallifelife, fulfillment of this requirement creates an additional burden in terms of memory, especially for high-capacitydevices,devices used in CGNs. It was found by people deployingIKE,IKE that more and more ISPs use equipment thatdropdrops IP fragments, thereby violating this requirement. Security researchers havefoundfound, and continue tofindfind, attack vectors that rely on IP fragmentation. For these reasons, and also as articulated in [FRAGDROP], many network operators filter all IPv6 fragments. Also, the default behavior of many currently deployed firewalls is to discard IPv6 fragments. In one recent study [BLACKHOLES], two researchers utilized a measurement network to measure fragment filtering. They sent packets, fragmented to the minimum MTU of 1280, to 502IPv6 enabledIPv6-enabled and reachable probes. They found that during any given trial period, ten percent of the probes did not receive fragmented packets.ThusThus, this problem is valid for both IPv4 and IPv6 and may be causedeitherby either deficiency of network devices orbyoperational choice. 1.2. ProposedsolutionSolution The solution to the problem described in this document is to perform fragmentation of large messages by IKEv2itself, replacingitself and replace thembywith a series of smaller messages. In thiscasecase, the resulting IPDatagramsdatagrams will be small enough so that no fragmentationonat the IP level will take place. The primary goal of this solution is to allow IKEv2 to operate inenvironments,environments that might block IP fragments. This goal does not assume that IP fragmentation should be avoided completely, but only in those cases when it interferes with IKE operations.HoweverHowever, this solution could be used to avoid IP fragmentation in all situations where fragmentation within IKE is applicable, asit isrecommended in Section 3.2 of [RFC5405]. Avoiding IP fragmentation would be beneficial for IKEv2 in general. The Security ConsiderationsSectionsection of[IKEv2][RFC7296] mentionsexhaustingexhaustion of the IP reassembly buffers as one of the possible attacks on the protocol. Inthe paper [DOSUDPPROT][DOSUDPPROT], several aspects of attacks on IKE using IP fragmentation are discussed, and one of the defenses it proposes is to perform fragmentation withinIKE similarlyIKE, similar to the solution described in this document. 1.3. Conventions Used in This Document 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 [RFC2119]. 2. ProtocoldetailsDetails 2.1. Overview The idea of the protocol described in this document is to split large IKEv2messagemessages into a set of smaller ones, called IKE FragmentMessages.messages. Fragmentation takes place before the original message is encrypted and authenticated, so that each IKE FragmentMessagemessage receives individual protection. On the receivingsideside, IKE FragmentMessagesmessages are collected, verified,decrypteddecrypted, and merged together to get the original message before encryption. See Appendix A for details on design rationale. 2.2. Limitations Since IKE FragmentMessagesmessages are cryptographically protected, SK_a and SK_e must already be calculated. In general, it means that the original message can be fragmented if and only if it contains an EncryptedPayload.payload. This implies that messages of the IKE_SA_INITExchangeexchange cannot be fragmented. In mostcasescases, this is not a problem because IKE_SA_INIT messages are usually small enough to avoid IP fragmentation. But in some cases (advertising a badly structured long list of algorithms, using largeMODP Groups, etc.)Modular Exponentiation (MODP) groups, etc.), these messages may become fairly large and get fragmentedbyat the IP level. In thiscasecase, thedescribedsolution described in this document will not help. Among existing IKEv2 extensions, messages of an IKE_SESSION_RESUMEExchange,exchange, as defined in [RFC5723], cannot be fragmented either. See Section 3 for details. Another limitation is that theminimalminimum size of an IPDatagramdatagram bearing an IKE FragmentMessagemessage is about 100bytesbytes, depending on the algorithms employed. According to[RFC0791][RFC0791], the minimum IPv4Datagramdatagram size that is guaranteed not to be further fragmented is 68 bytes. So, even the smallest IKE FragmentMessagesmessages could be fragmentedbyat the IP level in some circumstances. But such extremely smallPMTUPath MTU (PMTU) sizes are very rare in real life. 2.3. Negotiation TheInitiatorinitiator indicates its support fortheIKEFragmentationfragmentation and willingness to use it by including a NotificationPayloadpayload of type IKEV2_FRAGMENTATION_SUPPORTED in the IKE_SA_INIT request message. IfResponderthe responder also supports this extension and is willing to use it, it includes this notification in the response message. Initiator Responder ----------- ----------- HDR, SAi1, KEi, Ni, [N(IKEV2_FRAGMENTATION_SUPPORTED)] --> <-- HDR, SAr1, KEr, Nr, [CERTREQ], [N(IKEV2_FRAGMENTATION_SUPPORTED)] The Notify payload is formatted as follows: 1 2 3 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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Next Payload |C| RESERVED | Payload Length | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |Protocol ID(=0)| SPI Size (=0) | Notify Message Type | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ o Protocol ID (1 octet) - MUST be 0. o SPI Size (1 octet) - MUST be 0, meaning noSPISecurity Parameter Index (SPI) is present. o Notify Message Type (2 octets) - MUST bexxxxx,16430, the value assigned for the IKEV2_FRAGMENTATION_SUPPORTED notification. ThisNotificationnotification contains no data. 2.4. Using IKE FragmentationTheIKEFragmentationfragmentation MUST NOT be used unless both peers have indicated their support for it. Afterthatthat, it is up to theInitiatorinitiator of each exchange to decide whether or not to use it. TheResponderresponder usually replies in the same form as the request message, but other considerations might override this. TheInitiatorinitiator can employ various policies regarding the use of IKEFragmentation.fragmentation. It might first try to send an unfragmented message and resend it as fragmented only if no complete response is received even after several retransmissions. Alternatively, it might choosealwaysto always send fragmented messages(but(however, see Section 3), or it might fragment only large messages and messages that are expected to result in large responses. The following general guidelines apply: o If either peer has information that a part of the transaction is likely to be fragmented at the IP layer, causing interference with the IKE exchange, that peer SHOULD use IKEFragmentation.fragmentation. This information might be passed from a lower layer, provided by configuration, or derived through heuristics. Examples of heuristics are the lack of a complete response after several retransmissions for theInitiator,initiator, and receiving repeated retransmissions of the request for theResponder.responder. o If either peer knows that IKEFragmentationfragmentation has been used in a previous exchange in the context of the current IKE SA, that peer SHOULD continuetheto useofIKEFragmentationfragmentation for the messages that are larger than the current fragmentation threshold (see Section 2.5.1). o IKEFragmentationfragmentation SHOULD NOT be used in cases where IP-layer fragmentation of both the request and response messages is unlikely. For example, there is no point in fragmentingLiveness Checkliveness check messages. o If none of the above apply, theResponderresponder SHOULD respond in the same form (fragmented or not) as the request message to which it isresponding to.responding. Note that the other guidelines might override this because of information or heuristics available to theResponder.responder. In mostcasescases, IKEFragmentationfragmentation will be used in the IKE_AUTHExchange,exchange, especially if certificates are employed. 2.5. Fragmenting Message Only messages that contain an EncryptedPayloadpayload are subjectforto IKEFragmentation.fragmentation. For the purpose of construction of IKE FragmentMessages constructionmessages, the original (unencrypted) content of the EncryptedPayloadpayload is split into chunks. The content is treated as a binary blob and is split regardless of the boundaries of innerPayloads boundaries.payloads. Each of the resulting chunks is treated as an original content of the Encrypted FragmentPayloadpayload and is then encrypted and authenticated. Thus, the Encrypted FragmentPayloadpayload contains a chunk of the original content of the EncryptedPayloadpayload in encrypted form. The cryptographic processing of the Encrypted FragmentPayloadpayload is identical to that described in Section 3.14 of[IKEv2],[RFC7296], as well as documents updatingitsuch processing for particular algorithms or modes, such as [RFC5282].TheAs is the case for the EncryptedFragment Payload, similarly topayload, the EncryptedPayload,Fragment payload, if present in a message, MUST be the last payload in the message. The Encrypted FragmentPayloadpayload is denotedSKF{...}SKF{...}, and its payload type isXXX (TBA by IANA).53. This payload is also called the "Encrypted and Authenticated Fragment" payload. 1 2 3 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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Next Payload |C| RESERVED | Payload Length | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Fragment Number | Total Fragments | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Initialization Vector | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ~ Encrypted content ~ + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | Padding (0-255 octets) | +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+ | | Pad Length | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ~ Integrity Checksum Data ~ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Encrypted Fragment Payload o Next Payload (1 octet) - in the very first fragment (with Fragment Number equal to1)1), this field MUST be set toPayload Typethe payload type of the first innerPayload (similarly topayload (the same as for the EncryptedPayload).payload). In the restfragmentsof the Fragment messages (with Fragment Number greater than 1), this field MUST be set to zero. o Fragment Number (2octets)octets, unsigned integer) - currentfragment numberFragment message number, starting from 1. This field MUST be less than or equal to the nextfield, Total Fragments.field (Total Fragments). This field MUST NOT be zero. o Total Fragments (2octets)octets, unsigned integer) - number offragmentsFragment messages into which the original message wasdivided into.divided. This field MUST NOT be zero. With PMTUdiscoverydiscovery, this field plays an additional role. See Section 2.5.2 for details. The other fields are identical to those specified in Section 3.14 of[IKEv2].[RFC7296]. When prepending the IKEHeaderheader to the IKE FragmentMessagesmessages, it MUST be taken intact from the original message, except for the Length andtheNext Payload fields. The Length field is adjusted to reflect the length of theconstructedIKE Fragment message being constructed, and the Next Payload field is set to the payload type of the firstPayloadpayload inconstructedthat message (in mostcasescases, it will be the Encrypted FragmentPayload).payload). After prepending the IKEHeaderheader and allPayloadspayloads that possibly precede the EncryptedPayloadpayload in the original message (ifany,any; see Section 2.5.3), the resulting messages are sent to the peer. Below is an example of fragmenting a message. HDR(MID=n), SK(NextPld=PLD1) {PLD1 ... PLDN} Original Message HDR(MID=n), SKF(NextPld=PLD1, Frag#=1, TotalFrags=m) {...}, HDR(MID=n), SKF(NextPld=0, Frag#=2, TotalFrags=m) {...}, ... HDR(MID=n), SKF(NextPld=0, Frag#=m, TotalFrags=m) {...} IKE Fragment Messages 2.5.1. Selecting Fragment Size When splitting the content of an EncryptedPayloadpayload intochunkschunks, the sender SHOULD choose their sizeso,so that the resulting IPDatagramsdatagrams will be smaller than some fragmentation threshold. Implementations may calculate the fragmentation threshold using various sources of information. If theSendersender has information about the PMTUsizesize, it SHOULD use it. TheResponderresponder in the exchange may use the maximum size of the received IKE FragmentMessagemessage IPDatagramsdatagrams as a threshold when constructing a fragmented response. Successful completion of previous exchanges (including thoseexchanges,exchanges that cannot employ IKEFragmentation, e.g.fragmentation, e.g., IKE_SA_INIT) may be anindication,indication that the fragmentation threshold can be set to the size of the largest message of those messages alreadysent messages. Otherwisesent. Otherwise, for messages to be sent overIPv6IPv6, it is RECOMMENDEDto usethat a value of 1280 bytes as a maximum IPDatagramdatagram size be used ([RFC2460]). For messages to be sent overIPv4IPv4, it is RECOMMENDEDto usethat a value of 576 bytes as a maximum IPDatagram size. Presencedatagram size be used. The presence of tunnels on the path may reduce these values. Implementations may use other values if they are appropriate in the current environment. According to[RFC0791][RFC0791], the minimum IPv4Datagramdatagram size that is guaranteed not to be further fragmented is 68 bytes, but it is generally impossible to use such a small value forsolution,the solution described in this document. Using 576 bytes is a compromise--- the value is large enough for the presented solution and small enough to avoid IP fragmentation in most situations. Several other UDP-basedprotocol assume the valueprotocols (Syslog, DNS, etc.) use 576 bytes as a safe low limit for IPDatagrams size (Syslog, DNS, etc.).datagram size. See Appendix B for correlation between IPDatagramdatagram size and EncryptedPayloadpayload content size. 2.5.2. PMTU Discovery The amount of traffic that the IKE endpoint produces during the lifetime of an IKE SA is fairly modest- usually-- it is usually belowone hundred kBytes100 KB within a period of several hours. Most of this traffic consists of relatively short messages--- usually below several hundred bytes. In mostcasescases, the only time when IKE endpoints exchange messages of severalkBytesKB in size is IKE SAestablishmentestablishment, and often each endpoint sends exactly one such message. For the reasons articulatedaboveabove, implementing PMTU discovery in IKE is OPTIONAL. It is believed that using the values recommended in Section 2.5.1 as a fragmentation threshold will be sufficient in most cases. Using these values could lead to suboptimal fragmentation, but it is acceptable given the amount of traffic IKE produces. Implementations may support PMTU discovery if there are good reasons to do it (forexampleexample, ifit isthey are intended to be used in environments where the MTU sizeis possible tomight be lessthatthan the values listed in Section 2.5.1). PMTU discovery in IKE follows recommendations given in Section 10.4 of [RFC4821] withthe difference,some modifications, induced by thespecialtiesdistinctive features of IKE listed above. The difference is that the PMTU search is performed downward, while in [RFC4821] it is performed upward. The reason for this change is that IKE usually sends large messages only when the IKE SA is beingestablishedestablished, and in many cases there is only one such message. If the probing were performedupwardupward, this message would be fragmented using the smallest allowable threshold, and usually all other messages are small enough to avoid IP fragmentation, sotherecontinued probing would be of littlevalue to continue probing.value. It is theInitiatorinitiator of theexchange,exchange who performs PMTU discovery.ItThis is done by probing several values of fragmentation threshold. Implementations MUST be prepared to probe in every exchange that utilizes IKEFragmentationfragmentation to deal with possible changesofin path MTU over time. While doing probes, it MUST start from larger values and refragment the originalmessagemessage, using the next smaller value of the threshold if it did not receive a response in a reasonable time after several retransmissions. The exact number of retransmissions and length of timeouts are not covered in this specification because they do not affect interoperability. However, the timeout interval is supposed to be relatively short, so that unsuccessful probes would not delay IKE operations too much. Performing a few retries within several seconds for each probe seems appropriate, but different environments may require different rules. When starting a newprobeprobe, the node MUST reset its retransmission timersso,so that if it employs exponentialback- off,back-off the timers will start over. After reaching the smallest allowed value for the fragmentationthresholdthreshold, an implementation MUST continue retransmitting untileitherthe exchange either completes or times out using some timeout intervalfromas discussed in Section 2.4 of[IKEv2].[RFC7296]. PMTU discovery in IKE is supposed to be coarse-grained,i.e.i.e., it isexpected,expected that a node will try only a few fragmentationthresholds,thresholds in order to minimize delays caused by unsuccessful probes. Ifno information aboutpath MTU information isknown yet,not yet available, the endpoint maystart probing fromuse the link MTUsize.size when it starts probing. In subsequent exchanges, thefollowing exchangesnode should startfromwith the current value of the fragmentation threshold. If an implementation is capableto receiveof receiving ICMP errormessagesmessages, it can additionally utilize classic PMTU discovery methods, as described in [RFC1191] and [RFC1981]. In particular, if theInitiatorinitiator receives a Packet Too Big error in response to the probe, and it contains a smallervalue,value than the current fragmentation threshold, then theInitiatorinitiator SHOULD stop retransmitting the probe and SHOULD select a new value for the fragmentation threshold that is less than or equal to the value from the ICMP message and meets the requirements listed below. In the case of PMTUdiscoverydiscovery, the Total Fragments field is used to distinguish between different sets of fragments,i.e.i.e., the sets that were created by fragmenting the original message using different fragmentation thresholds. Since the sender starts from larger fragments and thenmakemakes them smaller, the value in the Total Fragments field increases with each new probe. When selecting the next smaller value for the fragmentation threshold, the sender MUST ensure that the value in the Total Fragments field is really increased. This requirement should not be a problem for the sender, because PMTU discovery in IKE is supposed to be coarse-grained, so the difference between previous and next fragmentation thresholds should be significant anyway. Thenecessityneed to distinguish between the sets is vital forreceiverthe receiver, since receiving a valid fragment from a newer set means that ithavehas to startreassemblingthe reassembly process over and nottomix fragments from different sets. 2.5.3. Fragmenting Messagescontaining unprotectedContaining Unprotected PayloadsCurrentlyCurrently, there are no IKEv2 exchanges that define messages, containing both unprotected payloads and payloads, that are protected by the EncryptedPayload. Howeverpayload. However, IKEv2 does not prohibit such construction. If some future IKEv2 extension defines such a message and it needs to be fragmented, all unprotected payloads MUST be placed in the first fragment (with the Fragment Number field equal to 1), along with the Encrypted FragmentPayload,payload, which MUST be present in every IKE FragmentMessagemessage and be the last payload in it. Below is an example of a fragmentingmessage, containingmessage that contains both protected and unprotectedPayloads.payloads. HDR(MID=n), PLD0, SK(NextPld=PLD1) {PLD1 ... PLDN} Original Message HDR(MID=n), PLD0, SKF(NextPld=PLD1, Frag#=1, TotalFrags=m) {...}, HDR(MID=n), SKF(NextPld=0, Frag#=2, TotalFrags=m) {...}, ... HDR(MID=n), SKF(NextPld=0, Frag#=m, TotalFrags=m) {...} IKE Fragment Messages Note that the size of each IPDatagramdatagram bearing IKE FragmentMessagesmessages should not exceed the fragmentation threshold, including the first one, that contains unprotectedPayloads.payloads. This will reduce the size of the Encrypted FragmentPayloadpayload content in the first IKE FragmentMessagemessage to accommodate all unprotectedPayloads.payloads. In an extremecasecase, the Encrypted FragmentPayloadpayload will contain no data, but it still must be present in the message, because only its presence allows the receiver to determine that the senderhavehas used IKEFragmentation.fragmentation. 2.6. Receiving IKE Fragment Message TheReceiverreceiver identifies the IKE FragmentMessagemessage by the presence of an Encrypted FragmentPayloadpayload in it. In mostcasescases, it will be the first andtheonly payload in themessage, howevermessage; however, this may not be true for some hypothetical IKE exchanges (see Section2.5.3)2.5.3). Upon receiving the IKE FragmentMessagemessage, the following actions are performed: o Check message validity - in particular, check whether the values in the Fragment Number and the Total Fragments fields in the Encrypted FragmentPayloadpayload are valid. The following tests need to be performed. * check that the Fragment Number and the Total Fragments fields contain non-zero values * check that the value in the Fragment Number field is less than or equal to the value in the Total Fragments field * if reassembling has already started, check that the value in the Total Fragments field is equal to or greater than the Total Fragments field in the fragments that have already been stored in the reassembling queue If any ofthisthese testsfailsfail, the message MUST be silently discarded. oCheck,Check that this IKE FragmentMessagemessage is new for the receiver and not a replay. If an IKE Fragment message with the same Message ID,sameFragmentNumberNumber, andsameTotal Fragments fields is already present in the reassembling queue, this message is considered a replay and MUST be silently discarded. o Verify IKE FragmentMessagemessage authenticity by checkingICVthe Integrity Check Value (ICV) in the Encrypted FragmentPayload.payload. If the ICV checkfailsfails, the message MUST be silently discarded. o If reassembling is not finished yet and the Total Fragments field in the received fragment is greater thanthisthe Total Fragments field in thosefragments,fragments that are in the reassembling queue, the receiver MUST discard all received fragments and startreassemblingthe reassembly process over with just the received IKE FragmentMessage.message. o Store the message in the reassembling queue waiting for the rest of the fragments to arrive. When all IKE FragmentMessagesmessages (as indicated in the Total Fragments field) are received, the decrypted content of all Encrypted FragmentPayloadspayloads is merged together to form the content of the original EncryptedPayload,payload and, therefore, along with the IKEHeaderheader and unprotectedPayloadspayloads (if any), the original message.ThenThen, it is processed as if it was received,verifiedverified, and decrypted as a regular IKE message. If the receiver does not get all IKE fragments needed to reassemble the originalMessagemessage within a timeout interval, it MUST discard all IKE FragmentMessagesmessages received so far for the exchange. The next actions depend on the role of the receiver in the exchange. o TheInitiatorinitiator acts as described in Section 2.1 of[IKEv2].[RFC7296]. It either retransmits the fragmented requestMessagemessage or deems the IKE SA to have failed and deletes it. The number of retransmits and length of timeouts for theInitiatorinitiator are not covered in thisspecificationspecification, since they are assumed to be the same as in a regular IKEv2 exchange and are discussed in Section 2.4 of[IKEv2].[RFC7296]. o TheResponderresponder in this case acts as if no request message was received. It would delete any memory of the incomplete requestmessage,message and not treat it as an IKE SA failure.TheIt is RECOMMENDED that the reassembling timeout for theResponder is RECOMMENDED toresponder be equal to the time interval that the implementation waits before completely giving up when acting asInitiatorthe initiator of an exchange. Section 2.4 of[IKEv2][RFC7296] gives recommendations for selecting this interval. Implementations can use a shorter timeout to conserve memory. 2.6.1. Replay Detection and Retransmissions According to[IKEv2] implementations must reject message withSection 2.2 of [RFC7296], thesameMessage IDas it has seen before (taking into consideration Response bit).is used, in particular, to identify retransmissions of IKE messages. Each request or response message, sent by either side, must have a unique Message ID, or be considered a retransmission otherwise. This logic has already been updated by [RFC6311], which deliberately allows any number of messages with zero Message ID. This document also updates this logic forthe situations, whenthose situations where IKEFragmentationfragmentation is in use. If an incoming message contains an Encrypted FragmentPayload,payload, the values of the Fragment Number and Total Fragments fields MUST be used along with the Message ID to detect retransmissions and replays. IfResponderthe responder receives a retransmitted fragment of a request when it has already processed that request and has sent back a response, that event MUST only trigger a retransmission of the response message (fragmented or not) if the Fragment Number field in the received fragment is set to1 and1; otherwise, it MUST beignored otherwise.ignored. 3. Interaction withotherOther IKEextensionsExtensions IKEFragmentationfragmentation is compatible with mostofIKE extensions, such as IKE Session Resumption ([RFC5723]), the Quick Crash Detection Method([RFC6290])([RFC6290]), and so on. It neitheraffectaffects theiroperation,operation nor is affected by them. It is believed that IKEFragmentationfragmentation will also be compatible with future IKE extensions, if they follow general principles of formatting,sendingsending, and receiving IKE messages, as described in[IKEv2].[RFC7296]. When IKEFragmentationfragmentation is used with IKE Session Resumption ([RFC5723]), messages of an IKE_SESSION_RESUMEExchangeexchange cannot befragmentedfragmented, since they do not contain an EncryptedPayload.payload. These messages may be large due to the ticket size. To avoid IPFragmentationfragmentation in thissituationsituation, it is recommendedto usethat smallertickets, e.g.tickets be used, e.g., by utilizing a "ticket by reference" approach instead of "ticket by value".One exception that requires a special care isProtocol Support for High Availability ofIKEv2/IPsec ([RFC6311]).IKEv2/IPsec, described in [RFC6311], requires special care when deciding whether to fragment an IKE message or not. Since it deliberately allows any number of synchronization exchanges to have the same Message ID, namely zero, standard IKEv2 replay detection logic, based on checking the MessageIDID, is not applicable for such messages, and the receiver has to check message content to detect replays. When implementing IKEFragmentationfragmentation along with [RFC6311], IKE Message ID Synchronization messages MUST NOT be sentfragmentedfragmented, to simplify the receiver's task of detecting replays. Fortunately, these messages aresmallsmall, and there is no point in fragmenting them anyway. 4. Transport Considerations With IKEFragmentationfragmentation, if any single IKE FragmentMessage getmessage gets lost, the receiver becomes unable to reassemble the originalMessage.message. So, in general, using IKEFragmentationfragmentation implies a higher probabilityforthat theMessagemessage will nottobe delivered to the peer. Although in most network environments the difference will be insignificant, on some lossy networks it may become noticeable. When using IKEFragmentationfragmentation, implementations MAY use longer timeouts and do more retransmits than usual before considering the peer dead. Note that FragmentMessagesmessages are not individually acknowledged. The response FragmentMessagesmessages are all sent backalltogether only when all fragments of the request are received, and the original requestMessagemessage is reassembled and successfully processed. 5. Security Considerations Most of the security considerations for IKEFragmentationfragmentation are the same as those for the base IKEv2 protocol described in[IKEv2].[RFC7296]. This extension introduces the Encrypted FragmentPayloadpayload to protect the content of an IKE Message Fragment. This allows the receiver to individually check the authenticity of fragments, thus protecting peers from a DoS attack. The Security ConsiderationsSectionsection of[IKEv2][RFC7296] mentions a possible attack on IKE where an attacker could prevent an exchange from completing by exhaustingofthe IP reassembly buffers. Themechanism,mechanism described in thisdocument,document allows IKE to avoid IP fragmentation and therefore increases its robustness to DoS attacks. The following attack is possible with IKEFragmentation.fragmentation. An attacker can initiate an IKE_SA_INITExchange,exchange, complete it, compute SK_a andSK_eSK_e, and then send alarge,large but stillincomplete,incomplete set of IKE_AUTH fragments. These fragments will pass the ICV check and will be stored in reassembly buffers, but since the set is incomplete, the reassembling will never succeed and eventually will time out. If the set is large, this attack could potentially exhaust the receiver's memory resources. To mitigate the impact of this attack, it is RECOMMENDED that the receiverlimitslimit the number of fragments it stores in the reassembling queue so that the sum of the sizes of Encrypted FragmentPayloadpayload contents (after decryption) for fragments that are already placed into the reassembling queue is less than some value that is reasonable for the implementation. If the peer sends so many fragments that the above condition is not met, the receiver can consider this situation to be either an attack orasa broken sender implementation. In either case, the receiver SHOULD drop the connection and discard all the received fragments. This value can be predefined, can be a configurable option, or can be calculateddynamicallydynamically, depending on the receiver's memory load. Some care should be taken when selecting this valuebecause,because if it is toosmall,small it might prevent a legitimate peerto establishfrom establishing an IKE SA if the size of messages it sends exceeds this value. It is NOT RECOMMENDED for this value to exceed 64KbytesKB because any IKE message before fragmentation would likely be shorter than that. If IKE fragments arrive in order, it is possible, but not advised, for the receiver to parse the beginning of the message that is being reassembled and extract thealready availablealready-available payloads before the reassembly is complete. It can be dangerous to take any action based on the content of these payloads, because the fragments that have not yet been receivedfragmentsmight contain payloads that could change the meaning of them (or could even make the whole messageinvalid)invalid), and this can potentially be exploited by an attacker. It is important to address this threat by ensuring that all the fragments are received prior toparseparsing the reassembled message, asitdescribed in Section 2.6. 6. IANA Considerations This document defines a newPayloadpayload in the "IKEv2 Payload Types" registry:<TBA>53 Encrypted and Authenticated Fragment SKF This document also defines a new Notify MessageTypesType in the"Notify"IKEv2 Notify Message Types - Status Types" registry:<TBA>16430 IKEV2_FRAGMENTATION_SUPPORTED 7.Acknowledgements The author would like to thank Tero Kivinen, Yoav Nir, Paul Wouters, Yaron Sheffer, Joe Touch, Derek Atkins, Ole Troan and others for their reviews and valuable comments. Thanks to Ron Bonica for contributing text to the Introduction Section. Thanks to Paul Hoffman and Barry Leiba for improving text clarity. 8.References8.1.7.1. Normative References [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March1997. [IKEv2]1997, <http://www.rfc-editor.org/info/rfc2119>. [RFC7296] Kaufman, C., Hoffman, P., Nir, Y., Eronen, P., and T. Kivinen, "Internet Key Exchange Protocol Version 2 (IKEv2)",draft-kivinen-ipsecme-ikev2-rfc5996bis-03 (work in progress), April 2014.STD 79, RFC 7296, October 2014, <http://www.rfc-editor.org/info/rfc7296>. [RFC6311] Singh, R., Kalyani, G., Nir, Y., Sheffer, Y., and D. Zhang, "Protocol Support for High Availability of IKEv2/ IPsec", RFC 6311, July2011. 8.2.2011, <http://www.rfc-editor.org/info/rfc6311>. 7.2. Informative References [RFC0791] Postel, J., "Internet Protocol", STD 5, RFC 791, September1981.1981, <http://www.rfc-editor.org/info/rfc791>. [RFC1191] Mogul, J. and S. Deering, "Path MTU discovery", RFC 1191, November1990.1990, <http://www.rfc-editor.org/info/rfc1191>. [RFC1981] McCann, J., Deering, S., and J. Mogul, "Path MTU Discovery for IP version 6", RFC 1981, August1996.1996, <http://www.rfc-editor.org/info/rfc1981>. [RFC2460] Deering, S. and R. Hinden, "Internet Protocol, Version 6 (IPv6) Specification", RFC 2460, December1998.1998, <http://www.rfc-editor.org/info/rfc2460>. [RFC4787] Audet, F. and C. Jennings, "Network Address Translation (NAT) Behavioral Requirements for Unicast UDP", BCP 127, RFC 4787, January2007.2007, <http://www.rfc-editor.org/info/rfc4787>. [RFC4821] Mathis, M. and J. Heffner, "Packetization Layer Path MTU Discovery", RFC 4821, March2007.2007, <http://www.rfc-editor.org/info/rfc4821>. [RFC5282] Black, D. and D. McGrew, "Using Authenticated Encryption Algorithms with the Encrypted Payload of the Internet Key Exchange version 2 (IKEv2) Protocol", RFC 5282, August2008.2008, <http://www.rfc-editor.org/info/rfc5282>. [RFC5405] Eggert, L. and G. Fairhurst, "Unicast UDP Usage Guidelines for Application Designers", BCP 145, RFC 5405, November2008.2008, <http://www.rfc-editor.org/info/rfc5405>. [RFC5723] Sheffer, Y. and H. Tschofenig, "Internet Key Exchange Protocol Version 2 (IKEv2) Session Resumption", RFC 5723, January2010.2010, <http://www.rfc-editor.org/info/rfc5723>. [RFC6290] Nir, Y., Wierbowski, D., Detienne, F., and P. Sethi, "A Quick Crash Detection Method for the Internet Key Exchange Protocol (IKE)", RFC 6290, June2011.2011, <http://www.rfc-editor.org/info/rfc6290>. [RFC6888] Perreault, S., Yamagata, I., Miyakawa, S., Nakagawa, A., and H. Ashida, "Common Requirements for Carrier-Grade NATs (CGNs)", BCP 127, RFC 6888, April2013.2013, <http://www.rfc-editor.org/info/rfc6888>. [FRAGDROP] Jaeggli, J., Colitti, L., Kumari, W., Vyncke, E., Kaeo, M., and T. Taylor, "Why Operators Filter Fragments and What It Implies",draft-taylor-v6ops-fragdrop-02 (workWork inprogress),Progress, draft-taylor-v6ops- fragdrop-02, December 2013. [BLACKHOLES] De Boer, M. and J. Bosma, "Discovering Path MTU black holes on the Internet using RIPE Atlas", July 2012,<http: //www.nlnetlabs.nl/downloads/publications/<http://www.nlnetlabs.nl/downloads/publications/ pmtu-black-holes-msc-thesis.pdf>. [DOSUDPPROT] Kaufman, C., Perlman, R., and B. Sommerfeld, "DoS protection for UDP-based protocols", ACM Conference on Computer and Communications Security, October 2003. Appendix A. DesignrationaleRationale The simplest approach totheIKE fragmentation would have been to fragment a message that is fully formed and ready to be sent.ButHowever, if a message got fragmented after being encrypted and authenticated, this couldopen a possibility formake a simpleDenial of Service attack.DoS attack possible. The attacker could infrequently emit forged butvalid lookingvalid-looking fragments into the network, and some of these fragments would be fetched by the receiver into the reassembling queue.Receiver couldThe receiver would not be able to distinguish forged fragments from valid ones andcouldwould only be able to determine that some of the received fragments were forgedwhenafter the whole messagegotwas reassembled andcheck forits authenticity check failed. To prevent this kind of attack and alsotoreduce vulnerability to some other kinds of DoSattacksattacks, it was decided tomakeperform fragmentation before applying cryptographic protection to the message. In thiscasecase, each FragmentMessagemessage becomes individually encrypted andauthenticated, thatauthenticated; this allows the receiver to determine forged fragments and nottostore them in the reassembling queue. Appendix B. Correlation between IP DatagramsizeSize and Encrypted Payload Content Size In the case of IPv4, the content sizeFor IPv4of the Encrypted Payloadcontent sizeis less than the IPDatagramdatagram size by the sum of the following values: o IPv4 header size (typically 20 bytes, up to 60 if IP options are present) o UDP header size (8 bytes) o non-ESP (Encapsulating Security Payload) marker size (4 bytes if present) o IKEHeaderheader size (28 bytes) o EncryptedPayloadpayload header size (4 bytes) oIVinitialization vector (IV) size(varying)(variable) o padding and its size (at least 1 byte) o ICV size(varying)(variable) The sum may be estimated as 61..105 bytes + IV + ICV + padding.For IPv6 Encrypted PayloadIn the case of IPv6, the content size of the Encrypted Payload is less than the IPDatagramdatagram size by the sum of the following values: o IPv6 header size (40 bytes) o IPv6 extension headers(optional,(optional; size varies) o UDP header size (8 bytes) o non-ESP marker size (4 bytes if present) o IKEHeaderheader size (28 bytes) o EncryptedPayloadpayload header size (4 bytes) o IV size(varying)(variable) o padding and its size (at least 1 byte) o ICV size(varying)(variable) If no extension header is present, the sum may be estimated as 81..85 bytes + IV + ICV + padding. If extension headers are present, the payload content size is further reduced by the sum of the size of the extension headers. The length of each extension header can be calculated as 8 * (Hdr Ext Len)bytesbytes, except for the fragmentheaderheader, which is always 8 bytes in length. Acknowledgements The author would like to thank Tero Kivinen, Yoav Nir, Paul Wouters, Yaron Sheffer, Joe Touch, Derek Atkins, Ole Troan, and others for their reviews and valuable comments. Thanks to Ron Bonica for contributing text to the Introduction section. Thanks to Paul Hoffman and Barry Leiba for improving text clarity. Author's Address Valery Smyslov ELVIS-PLUS PO Box 81 Moscow (Zelenograd) 124460 Russian Federation Phone: +7 495 276 0211Email:EMail: svan@elvis.ru