idnits 2.17.1 draft-ietf-ipsecme-ike-tcp-00.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (August 28, 2012) is 4260 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) ** Obsolete normative reference: RFC 5996 (Obsoleted by RFC 7296) == Outdated reference: A later version (-10) exists of draft-ietf-behave-lsn-requirements-09 -- Obsolete informational reference (is this intentional?): RFC 793 (Obsoleted by RFC 9293) Summary: 1 error (**), 0 flaws (~~), 2 warnings (==), 2 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group Y. Nir 3 Internet-Draft Check Point 4 Intended status: Standards Track August 28, 2012 5 Expires: March 1, 2013 7 A TCP transport for the Internet Key Exchange 8 draft-ietf-ipsecme-ike-tcp-00 10 Abstract 12 This document describes using TCP for IKE messages. This facilitates 13 the transport of large messages over paths where fragments are either 14 dropped, or where packet loss makes the use of large UDP packets 15 unreliable. 17 Status of this Memo 19 This Internet-Draft is submitted in full conformance with the 20 provisions of BCP 78 and BCP 79. 22 Internet-Drafts are working documents of the Internet Engineering 23 Task Force (IETF). Note that other groups may also distribute 24 working documents as Internet-Drafts. The list of current Internet- 25 Drafts is at http://datatracker.ietf.org/drafts/current/. 27 Internet-Drafts are draft documents valid for a maximum of six months 28 and may be updated, replaced, or obsoleted by other documents at any 29 time. It is inappropriate to use Internet-Drafts as reference 30 material or to cite them other than as "work in progress." 32 This Internet-Draft will expire on March 1, 2013. 34 Copyright Notice 36 Copyright (c) 2012 IETF Trust and the persons identified as the 37 document authors. All rights reserved. 39 This document is subject to BCP 78 and the IETF Trust's Legal 40 Provisions Relating to IETF Documents 41 (http://trustee.ietf.org/license-info) in effect on the date of 42 publication of this document. Please review these documents 43 carefully, as they describe your rights and restrictions with respect 44 to this document. Code Components extracted from this document must 45 include Simplified BSD License text as described in Section 4.e of 46 the Trust Legal Provisions and are provided without warranty as 47 described in the Simplified BSD License. 49 1. Introduction 51 The Internet Key Exchange version 2 (IKEv2), specified in [RFC5996] 52 uses UDP to transport the exchange messages. Some of those messages 53 may be fairly large. Specifically, the messages of the IKE_AUTH 54 exchange can become quite large, as they may contain a chain of 55 certificates, an "Auth" payload (that may contain a public key 56 signature), CRLs, and some configuration information that is carried 57 in the CFG payload. 59 When such UDP packets exceed the path MTU, they get fragmented. This 60 increases the probability of packets being dropped. The 61 retransmission mechanisms in IKE (as described in section 2.1 of RFC 62 5996) takes care of that as long as packet loss is at a reasonable 63 level. More recently we have seen a number of service providers 64 dropping fragmented packets. Firewalls and NAT devices need to keep 65 state for each packet where some (but not all) of the fragments have 66 passed through. This creates a burden in terms of memory, especially 67 for high capacity devices such as Carrier-Grade NAT (CGN) or high 68 capacity firewalls. 70 The BEHAVE working group has an Internet Draft describing required 71 behavior of CGNs ([I-D.ietf-behave-lsn-requirements]). It requires 72 CGNs to comply with [RFC4787], which in section 11 requires NAT 73 devices to support fragments. However, some people deploying IKE 74 have found that some ISPs have begun to drop fragments in preparation 75 for deploying CGNs. While we all hope for a future where all devices 76 comply with the emerging standards, or even a future where CGNs are 77 not required, we have to make IKE work today. 79 The solution described in this document is to transport the IKE 80 messages over a TCP ([RFC0793]) connection rather than over UDP. IKE 81 packets describe their own length, so they are well-suited for 82 transport over a stream-based connection such as TCP. The Initiator 83 opens a TCP connection to the Responder's port 500, sends the 84 requests and receives the responses, and then closes the connection. 85 TCP can handle arbitrary-length messages, works well with any sized 86 data, and is well supported by all ISP infrastructure. 88 1.1. Non-Goals of this Specification 90 Firewall traversal is not a goal of this specification. If a 91 firewall has a policy to block IKE and/or IPsec, hiding the IKE 92 exchange in TCP is not expected to help. Some implementations hide 93 both IKE and IPsec in a TCP connection, usually pretending to be 94 HTTPS by using port 443. This has a significant impact on bandwidth 95 and gateway capacity, and even this is defeated by better firewalls. 96 SSL VPNs tunnel IP packets over TLS, but the latest firewalls are 97 also TLS proxies, and are able to defeat this as well. 99 This document is not part of that arms race. It is only meant to 100 allow IKE to work When faced with broken infrastructure that drops 101 large IP packets. 103 1.2. Conventions Used in This Document 105 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 106 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 107 document are to be interpreted as described in [RFC2119]. 109 2. The Protocol 111 2.1. Initiator 113 An Initiator MAY try IKE using TCP for any request. It opens a TCP 114 connection from an arbitrary port to port 500 of the Responder. When 115 the three-way handshake completes, the Initiator MUST send the 116 request. If the Initiator knows that this request is the last 117 request needed at this time, it MAY half-close the TCP connection, or 118 it MAY wait until the last response has been received. When all 119 responses have been received, the Initiator MUST close the 120 connection. If the peer has closed the connection before all 121 requests have been transmitted or responded to, the Initiator SHOULD 122 either open a new TCP connection or transmit them over UDP again. 124 An initiator MUST accept responses sent over IKE within the same 125 connection, but MUST also accept responses over other transports, if 126 the request had been sent over them as well. 128 2.2. Responder 130 A Responder MAY accept TCP connections to port 500, and if it does, 131 it MUST accept IKE requests over this connection. Responses to 132 requests received over this connection MUST also go over this 133 connection. If the connection has closed before the Responder has 134 had a chance to respond, it MUST NOT respond over UDP, but MUST 135 instead wait for a retransmission over UDP or over another TCP 136 connection. 138 The responder MUST accept different requests on different transports. 139 Specifically, the Responder MUST NOT rely on subsequent requests 140 coming over the same transport. For example, it is entirely 141 acceptable to have the IKE_INITIAL exchange come over UDP port 500, 142 while the IKE_AUTH request comes over TCP, and some following 143 requests might come over UDP port 4500 (because NAT has been 144 detected). 146 A responder that is configured to support IKE over TCP and receives 147 an IKEv2 Initial request over any other transport MUST send an 148 IKE_TCP_SUPPORTED notification (Section 2.5) in the Initial response. 149 the responder MAY send this notification even if the Initial request 150 was received over TCP. 152 If the responder has some requests of its own to send, it MUST NOT 153 use a connection that has been opened by a peer. Instead, it MUST 154 either use UDP or else open a new TCP connection to the original 155 Initiator's TCP port 500. 157 The normal flow of things is that the Initiator opens a connection 158 and closes its side first. The responder closes after sending the 159 last response where the initiator has already half-closed the 160 connection. If, however, a significant amount of time has passed, 161 and neither new requests arrive nor the connection is closed by the 162 initiator, the Responder MAY close or even reset the connection. 164 This specification makes no recommendation as to how long such a 165 timeout should be, but a few seconds should be enough. 167 2.3. Transmitter 169 The transmitter, whether an initiator transmitting a request or a 170 responder transmitting a response MUST NOT retransmit over the same 171 connection. TCP takes care of that. It SHOULD send the IKE header 172 and the IKE payloads with a single command or in rapid succession, 173 because the receiver might block on reading from the socket. 175 2.4. Receiver 177 The IKE header is copied from RFC 5996 below for reference: 179 1 2 3 180 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 181 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 182 | IKE SA Initiator's SPI | 183 | | 184 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 185 | IKE SA Responder's SPI | 186 | | 187 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 188 | Next Payload | MjVer | MnVer | Exchange Type | Flags | 189 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 190 | Message ID | 191 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 192 | Length | 193 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 195 Figure 1: IKE Header Format 197 The receiver MUST first read in the 28 bytes that make up the IKE 198 header. The Responder then subtracts 28 from the length field, and 199 reads the resulting number of bytes. The combined message, comprised 200 on 28 header bytes and whatever number of payload bytes is processed 201 the same way as regular UDP messages. That includes retransmission 202 detection, with one slight difference: if a retransmitted request is 203 detected, the response is retransmitted as well, but using the 204 current TCP connection rather than whatever other transport had been 205 used for the original transmission of the request. 207 2.5. IKE_TCP_SUPPORTED Notification 209 This notification is sent by a responder over non-TCP transports to 210 inform the initiator that this specification is supported and 211 configured. 213 The Notify payload is formatted as follows: 215 1 2 3 216 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 217 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 218 ! Next Payload !C! RESERVED ! Payload Length ! 219 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 220 ! Protocol ID ! SPI Size !IKE_TCP_SUPPORTED Message Type ! 221 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 223 o Protocol ID (1 octet) MUST be 0. 224 o SPI Size (1 octet) MUST be zero, in conformance with section 3.10 225 of RFC 5996. 227 o IKE_TCP_SUPPORTED Notify Message Type (2 octets) - MUST be xxxxx, 228 the value assigned for IKE_TCP_SUPPORTED. TBA by IANA. 230 3. Operational Considerations 232 Most IKE messages are relatively short. All but the IKE_AUTH 233 exchange in IKEv2 are comprised of short messages that fit in a 234 single packet on most networks. The Informational exchange could be 235 an exception, as it may contain arbitrary-length CFG payloads, but in 236 practice this is not done. It is only the IKE_AUTH exchange that has 237 long messages. UDP has advantages in lower latency and lower 238 resource consumption, so it makes sense to use UDP whenever TCP is 239 not required. 241 The requirements in Section 2.2 were written so that different 242 requests may be sent over different transports. The initiator can 243 choose the transport on a per-request basis. So one obvious policy 244 would be to do everything over UDP except the specific requests that 245 tend to become too big. This way the first messages use UDP, and the 246 Initiator can set up the TCP connection at the same time, eliminating 247 the latency penalty of using TCP. This may not always be the most 248 efficient policy, though. It means that the first messages sent over 249 TCP are relatively large ones, and TCP slow start may cause an extra 250 roundtrip, because the message has exceeded the transmission window. 251 An initiator using this policy MUST NOT go to TCP if the responder 252 has not indicated support by sending the IKE_TCP_SUPPORTED 253 notification (Section 2.5) in the Initial response. 255 An alternative method, that is probably easier for the Initiator to 256 implement, is to do an entire "mission" using the same transport. So 257 if TCP is needed for long messages and an IKE SA has not yet been 258 created, the Initiator will open a TCP connection, and perform all 259 2-4 requests needed to set up a child SA over the same connection. 261 Yet another policy would be to begin by using UDP, and at the same 262 time set up the TCP connection. If at any point the TCP handshake 263 completes, the next requests go over that connection. This method 264 can be used to auto-discover support of TCP on the responder. This 265 is easier for the user than configuring which peers support TCP, but 266 has the potential of wasting resources, as TCP connections may finish 267 the three-way handshake just when IKE over UDP has finished. The 268 requirements from the responder ensure that all these policies will 269 work. 271 3.1. Liveness Check 273 The TCP connections described in this document are short-lived. We 274 do not expect them to stay for the lifetime of the SA, but to get 275 torn down by either side within seconds of the SA being set up. 276 Because of this, they are not well-suited for the transport of short 277 requests such as those for liveness check. 279 Although liveness checks MAY be sent over TCP, this is not 280 recommended. 282 4. Security Considerations 284 Most of the security considerations for IKE over TCP are the same as 285 those for UDP as in RFC 5996. 287 For the Responder, listening to TCP port 500 involves all the risks 288 of maintaining any TCP server. Precautions against DoS attacks, such 289 as SYN cookies are RECOMMENDED. see [RFC4987] for details. 291 5. IANA Considerations 293 IANA is requested to assign a notify message type from the status 294 types range (16418-40959) of the "IKEv2 Notify Message Types" 295 registry with name "IKE_TCP_SUPPORTED" 297 No IANA action is required for the TCP port, as TCP port 500 is 298 already allocated to "ISAKMP". 300 6. References 302 6.1. Normative References 304 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 305 Requirement Levels", BCP 14, RFC 2119, March 1997. 307 [RFC5996] Kaufman, C., Hoffman, P., Nir, Y., and P. Eronen, 308 "Internet Key Exchange Protocol Version 2 (IKEv2)", 309 RFC 5996, September 2010. 311 6.2. Informative References 313 [I-D.ietf-behave-lsn-requirements] 314 Perreault, S., Yamagata, I., Miyakawa, S., Nakagawa, A., 315 and H. Ashida, "Common requirements for Carrier Grade NATs 316 (CGNs)", draft-ietf-behave-lsn-requirements-09 (work in 317 progress), August 2012. 319 [RFC0793] Postel, J., "Transmission Control Protocol", STD 7, 320 RFC 793, September 1981. 322 [RFC4787] Audet, F. and C. Jennings, "Network Address Translation 323 (NAT) Behavioral Requirements for Unicast UDP", BCP 127, 324 RFC 4787, January 2007. 326 [RFC4987] Eddy, W., "TCP SYN Flooding Attacks and Common 327 Mitigations", RFC 4987, August 2007. 329 Author's Address 331 Yoav Nir 332 Check Point Software Technologies Ltd. 333 5 Hasolelim st. 334 Tel Aviv 67897 335 Israel 337 Email: ynir@checkpoint.com