idnits 2.17.1 draft-pauly-ipsecme-tcp-encaps-04.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 (April 25, 2016) is 2924 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) == Missing Reference: 'Section 4' is mentioned on line 295, but not defined == Missing Reference: 'Figure 2' is mentioned on line 407, but not defined == Missing Reference: 'ChangeCipherSpec' is mentioned on line 766, but not defined == Missing Reference: 'CERTREQ' is mentioned on line 625, but not defined == Missing Reference: 'CERT' is mentioned on line 629, but not defined == Missing Reference: 'CP' is mentioned on line 664, but not defined -- Obsolete informational reference (is this intentional?): RFC 5246 (Obsoleted by RFC 8446) Summary: 0 errors (**), 0 flaws (~~), 7 warnings (==), 2 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network T. Pauly 3 Internet-Draft Apple Inc. 4 Intended status: Standards Track S. Touati 5 Expires: October 27, 2016 Ericsson 6 R. Mantha 7 Cisco Systems 8 April 25, 2016 10 TCP Encapsulation of IKEv2 and IPSec Packets 11 draft-pauly-ipsecme-tcp-encaps-04 13 Abstract 15 This document describes a method to transport IKEv2 and IPSec packets 16 over a TCP connection for traversing network middleboxes that may 17 block IKEv2 negotiation over UDP. This method, referred to as TCP 18 encapsulation, involves sending all packets for tunnel establishment 19 as well as tunneled packets over a TCP connection. This method is 20 intended to be used as a fallback option when IKE cannot be 21 negotiated over UDP. 23 Status of This Memo 25 This Internet-Draft is submitted in full conformance with the 26 provisions of BCP 78 and BCP 79. 28 Internet-Drafts are working documents of the Internet Engineering 29 Task Force (IETF). Note that other groups may also distribute 30 working documents as Internet-Drafts. The list of current Internet- 31 Drafts is at http://datatracker.ietf.org/drafts/current/. 33 Internet-Drafts are draft documents valid for a maximum of six months 34 and may be updated, replaced, or obsoleted by other documents at any 35 time. It is inappropriate to use Internet-Drafts as reference 36 material or to cite them other than as "work in progress." 38 This Internet-Draft will expire on October 27, 2016. 40 Copyright Notice 42 Copyright (c) 2016 IETF Trust and the persons identified as the 43 document authors. All rights reserved. 45 This document is subject to BCP 78 and the IETF Trust's Legal 46 Provisions Relating to IETF Documents 47 (http://trustee.ietf.org/license-info) in effect on the date of 48 publication of this document. Please review these documents 49 carefully, as they describe your rights and restrictions with respect 50 to this document. Code Components extracted from this document must 51 include Simplified BSD License text as described in Section 4.e of 52 the Trust Legal Provisions and are provided without warranty as 53 described in the Simplified BSD License. 55 Table of Contents 57 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 58 1.1. Prior Work and Motivation . . . . . . . . . . . . . . . . 3 59 1.2. Requirements Language . . . . . . . . . . . . . . . . . . 4 60 2. Configuration . . . . . . . . . . . . . . . . . . . . . . . . 4 61 3. TCP-Encapsulated Header Formats . . . . . . . . . . . . . . . 5 62 3.1. TCP-Encapsulated IKEv2 Header Format . . . . . . . . . . 5 63 3.2. TCP-Encapsulated ESP Header Format . . . . . . . . . . . 6 64 4. TCP-Encapsulated Stream Prefix . . . . . . . . . . . . . . . 6 65 5. Applicability . . . . . . . . . . . . . . . . . . . . . . . . 6 66 6. Connection Establishment and Teardown . . . . . . . . . . . . 7 67 7. Interaction with NAT Detection Payloads . . . . . . . . . . . 8 68 8. Using MOBIKE with TCP encapsulation . . . . . . . . . . . . . 8 69 9. Using IKEv2 Message Fragmentation with TCP encapsulation . . 9 70 10. Considerations for Keep-alives and DPD . . . . . . . . . . . 9 71 11. Middlebox Considerations . . . . . . . . . . . . . . . . . . 9 72 12. Performance Considerations . . . . . . . . . . . . . . . . . 10 73 12.1. TCP-in-TCP . . . . . . . . . . . . . . . . . . . . . . . 10 74 12.2. Added Reliability for Unreliable Protocols . . . . . . . 10 75 12.3. Quality of Service Markings . . . . . . . . . . . . . . 10 76 12.4. Maximum Segment Size . . . . . . . . . . . . . . . . . . 10 77 13. Security Considerations . . . . . . . . . . . . . . . . . . . 11 78 14. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 11 79 15. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 11 80 16. References . . . . . . . . . . . . . . . . . . . . . . . . . 11 81 16.1. Normative References . . . . . . . . . . . . . . . . . . 11 82 16.2. Informative References . . . . . . . . . . . . . . . . . 11 83 Appendix A. Using TCP encapsulation with TLS . . . . . . . . . . 12 84 Appendix B. Example exchanges of TCP Encapsulation with TLS . . 13 85 B.1. Establishing an IKEv2 session . . . . . . . . . . . . . . 13 86 B.2. Deleting an IKEv2 session . . . . . . . . . . . . . . . . 15 87 B.3. Re-establishing an IKEv2 session . . . . . . . . . . . . 16 88 B.4. Using MOBIKE between UDP and TCP Encapsulation . . . . . 16 89 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 18 91 1. Introduction 93 IKEv2 [RFC7296] is a protocol for establishing IPSec tunnels, using 94 IKE messages over UDP for control traffic, and using Encapsulating 95 Security Payload (ESP) messages for its data traffic. Many network 96 middleboxes that filter traffic on public hotspots block all UDP 97 traffic, including IKEv2 and IPSec, but allow TCP connections through 98 since they appear to be web traffic. Devices on these networks that 99 need to use IPSec (to access private enterprise networks, to route 100 voice-over-IP calls to carrier networks, or because of security 101 policies) are unable to establish IPSec tunnels. This document 102 defines a method for encapsulating both the IKEv2 control messages as 103 well as the IPSec data messages within a TCP connection. 105 Using TCP as a transport for IPSec packets adds a third option to the 106 list of traditional IPSec transports: 108 1. Direct. Currently, IKEv2 negotiations begin over UDP port 500. 109 If no NAT is detected between the initiator and the receiver, 110 then subsequent IKEv2 packets are sent over UDP port 500 and 111 IPSec data packets are sent using ESP [RFC4303]. 113 2. UDP Encapsulation [RFC3948]. If a NAT is detected between the 114 initiator and the receiver, then subsequent IKEv2 packets are 115 sent over UDP port 4500 with four bytes of zero at the start of 116 the UDP payload and ESP packets are sent out over UDP port 117 4500. Some peers default to using UDP encapsulation even when 118 no NAT are detected on the path as some middleboxes do not 119 support IP protocols other than TCP and UDP. 121 3. TCP Encapsulation. If both of the other two methods are not 122 available or appropriate, both IKEv2 negotiation packets as 123 well as ESP packets can be sent over a single TCP connection to 124 the peer. 126 Direct use of ESP or UDP Encapsulation should be preferred by IKEv2 127 implementations due to performance concerns when using TCP 128 Encapsulation Section 12. Most implementations should use TCP 129 Encapsulation only on networks where negotiation over UDP has been 130 attempted without receiving responses from the peer, or if a network 131 is known to not support UDP. 133 1.1. Prior Work and Motivation 135 Encapsulating IKEv2 connections within TCP streams is a common 136 approach to solve the problem of UDP packets being blocked by network 137 middleboxes. The goal of this document is to promote 138 interoperability by providing a standard method of framing IKEv2 and 139 ESP message within streams, and to provide guidelines for how to 140 configure and use TCP encapsulation. 142 Some previous solutions include: 144 Cellular Network Access Interworking Wireless LAN (IWLAN) uses IKEv2 145 to create secure connections to cellular carrier networks for 146 making voice calls and accessing other network services over 147 Wi-Fi networks. 3GPP has recommended that IKEv2 and ESP packets 148 be sent within a TLS connection to be able to establish 149 connections on restrictive networks. 151 ISAKMP over TCP Various non-standard extensions to ISAKMP have been 152 deployed that send IPSec traffic over TCP or TCP-like packets. 154 SSL VPNs Many proprietary VPN solutions use a combination of TLS and 155 IPSec in order to provide reliability. 157 IKEv2 over TCP IKEv2 over TCP as described in 158 [I-D.nir-ipsecme-ike-tcp] is used to avoid UDP fragmentation. 160 1.2. Requirements Language 162 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 163 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 164 document are to be interpreted as described in RFC 2119 [RFC2119]. 166 2. Configuration 168 One of the main reasons to use TCP encapsulation is that UDP traffic 169 may be entirely blocked on a network. Because of this, support for 170 TCP encapsulation is not specifically negotiated in the IKEv2 171 exchange. Instead, support for TCP encapsulation must be pre- 172 configured on both the initiator and the responder. 174 The configuration defined on each peer should include the following 175 parameters: 177 o One or more TCP ports on which the responder will listen for 178 incoming connections. Note that the initiator may initiate TCP 179 connections to the responder from any local port. 181 o Optionally, an extra framing protocol to use on top of TCP to 182 further encapsulate the stream of IKEv2 and IPSec packets. See 183 Appendix A for a detailed discussion. 185 This document leaves the selection of TCP ports up to 186 implementations. It's suggested to use TCP port 4500, which is 187 allocated for IPSec NAT Traversal. 189 Since TCP encapsulation of IKEv2 and IPSec packets adds overhead and 190 has potential performance trade-offs compared to direct or UDP- 191 encapsulated tunnels (as described in Performance Considerations, 192 Section 12), when possible, implementations SHOULD prefer IKEv2 193 direct or UDP encapsulated tunnels over TCP encapsulated tunnels. 195 3. TCP-Encapsulated Header Formats 197 In order to encapsulate IKEv2 and ESP messages within a TCP stream, a 198 16-bit length field precedes every message. If the first 32-bits of 199 the message are zeros (a Non-ESP Marker), then the contents comprise 200 an IKEv2 message. Otherwise, the contents comprise an ESP message. 201 Authentication Header (AH) messages are not supported for TCP 202 encapsulation. 204 Although a TCP stream may be able to send very long messages, 205 implementations SHOULD limit message lengths to typical UDP datagram 206 ESP payload lengths. The maximum message length is used as the 207 effective MTU for connections that are being encrypted using ESP, so 208 the maximum message length will influence characteristics of inner 209 connections, such as the TCP Maximum Segment Size (MSS). 211 3.1. TCP-Encapsulated IKEv2 Header Format 213 1 2 3 214 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 215 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 216 | Length | 217 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 218 | Non-ESP Marker | 219 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 220 | | 221 ~ IKEv2 header [RFC7296] ~ 222 | | 223 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 225 Figure 1 227 The IKE header is preceded by a 16-bit length field in network byte 228 order that specifies the length of the IKE packet within the TCP 229 stream. As with IKEv2 over UDP port 4500, a zeroed 32-bit Non-ESP 230 Marker is inserted before the start of the IKEv2 header in order to 231 differentiate the traffic from ESP traffic between the same addresses 232 and ports. 234 o Length (2 octets, unsigned integer) - Length of the IKE packet 235 including the Length Field and Non-ESP Marker. 237 3.2. TCP-Encapsulated ESP Header Format 239 1 2 3 240 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 241 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 242 | Length | 243 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 244 | | 245 ~ ESP header [RFC4303] ~ 246 | | 247 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 249 Figure 2 251 The ESP header is preceded by a 16-bit length field in network byte 252 order that specifies the length of the ESP packet within the TCP 253 stream. 255 o Length (2 octets, unsigned integer) - Length of the ESP packet 256 including the Length Field. 258 4. TCP-Encapsulated Stream Prefix 260 Each TCP stream used for IKEv2 and IPSec encapsulation MUST begin 261 with a fixed sequence of five bytes as a magic value, containing the 262 characters "IKEv2" as ASCII values. This allows peers to 263 differentiate this protocol from other protocols that may be run over 264 TCP streams, since the value does not overlap with the valid start of 265 any other known stream protocol. This value is only sent once, by 266 the Initiator only, at the beginning of any TCP stream. 268 0 1 2 3 4 269 +------+------+------+------+------+ 270 | 0x69 | 0x6b | 0x65 | 0x76 | 0x32 | 271 +------+------+------+------+------+ 273 Figure 3 275 5. Applicability 277 TCP encapsulation is applicable only when it has been configured to 278 be used with specific IKEv2 peers. If a responder is configured to 279 use TCP encapsulation, it MUST listen on the configured port(s) in 280 case any peers will initiate new IKEv2 sessions. Initiators MAY use 281 TCP encapsulation for any IKEv2 session to a peer that is configured 282 to support TCP encapsulation, although it is recommended that 283 initiators should only use TCP encapsulation when traffic over UDP is 284 blocked. 286 Any specific IKE SA, along with its Child SAs, is either TCP 287 encapsulated or not. A mix of TCP and UDP encapsulation for a single 288 SA is not allowed. 290 6. Connection Establishment and Teardown 292 When the IKEv2 initiator uses TCP encapsulation for its negotiation, 293 it will initiate a TCP connection to the responder using the 294 configured TCP port. The first bytes sent on the stream MUST be the 295 stream prefix value [Section 4]. After this prefix, encapsulated 296 IKEv2 messages will negotiate the IKE SA and initial Child SA 297 [RFC7296]. After this point, both encapsulated IKE Figure 1 and ESP 298 Figure 2 messages will be sent over the TCP connection. 300 In order to close an IKE session, either the initiator or responder 301 SHOULD gracefully tear down IKE SAs with DELETE payloads. Once all 302 SAs have been deleted, the initiator of the original connection MUST 303 close the TCP connection. 305 An unexpected FIN or a RST on the TCP connection may indicate either 306 a loss of connectivity, an attack, or some other error. If a DELETE 307 payload has not been sent, both sides SHOULD maintain the state for 308 their SAs for the standard lifetime or time-out period. The original 309 initiator (that is, the endpoint that initiated the TCP connection 310 and sent the first IKE_SA_INIT message) is responsible for re- 311 establishing the TCP connection if it is torn down for any unexpected 312 reason. Since new TCP connections may use different ports due to NAT 313 mappings or local port allocations changing, the responder MUST allow 314 packets for existing SAs to be received from new source ports. 316 A peer MUST discard a partially received message due to a broken 317 connection. 319 The streams of data sent over any TCP connection used for this 320 protocol MUST begin with the stream prefix value followed by a 321 complete message, which is either an encapsulated IKE or ESP message. 322 If the connection is being used to resume a previous IKE session, the 323 responder can recognize the session using either the IKE SPI from an 324 encapsulated IKE message or the ESP SPI from an encapsulated ESP 325 message. If the session had been fully established previously, it is 326 suggested that the initiator send an UPDATE_SA_ADDRESSES message if 327 MOBIKE is supported, or an INFORMATIONAL message (a keepalive) 328 otherwise. If either initiator or responder receives a stream that 329 cannot be parsed correctly, it MUST close the TCP connection. 331 Multiple TCP connections between the initiator and the responder are 332 allowed, but their use must take into account the initiator 333 capabilities and the deployment model such as to connect to multiple 334 gateways handling different ESP SAs when deployed in a high 335 availability model. It is also possible to negotiate multiple IKE 336 SAs over the same TCP connection. 338 The processing of the TCP packets is the same whether its within a 339 single or multiple TCP connections. 341 7. Interaction with NAT Detection Payloads 343 When negotiating over UDP port 500, IKE_SA_INIT packets include 344 NAT_DETECTION_SOURCE_IP and NAT_DETECTION_DESTINATION_IP payloads to 345 determine if UDP encapsulation of IPSec packets should be used. 346 These payloads contain SHA-1 digests of the SPIs, IP addresses, and 347 ports. IKE_SA_INIT packets sent on a TCP connection SHOULD include 348 these payloads, and SHOULD use the applicable TCP ports when creating 349 and checking the SHA-1 digests. 351 If a NAT is detected due to the SHA-1 digests not matching the 352 expected values, no change should be made for encapsulation of 353 subsequent IKEv2 or ESP packets, since TCP encapsulation inherently 354 supports NAT traversal. Implementations MAY use the information that 355 a NAT is present to influence keep-alive timer values. 357 8. Using MOBIKE with TCP encapsulation 359 When an IKEv2 session is transitioned between networks using MOBIKE 360 [RFC4555], the initiator of the transition may switch between using 361 TCP encapsulation, UDP encapsulation, or no encapsulation. 362 Implementations that implement both MOBIKE and TCP encapsulation MUST 363 support dynamically enabling and disabling TCP encapsulation as 364 interfaces change. 366 The encapsulation method of ESP packets MUST always match the 367 encapsulation method of the IKEv2 negotiation, which may be different 368 when an IKEv2 endpoint changes networks. When a MOBIKE-enabled 369 initiator changes networks, the UPDATE_SA_ADDRESSES notification 370 SHOULD be sent out first over UDP before attempting over TCP. If 371 there is a response to the UPDATE_SA_ADDRESSES notification sent over 372 UDP, then the ESP packets should be sent directly over IP or over UDP 373 port 4500 (depending on if a NAT was detected), regardless of if a 374 connection on a previous network was using TCP encapsulation. 375 Similarly, if the responder only responds to the UPDATE_SA_ADDRESSES 376 notification over TCP, then the ESP packets should be sent over the 377 TCP connection, regardless of if a connection on a previous network 378 did not use TCP encapsulation. 380 9. Using IKEv2 Message Fragmentation with TCP encapsulation 382 IKEv2 Message Fragmentation [RFC7383] is not required when using TCP 383 encapsulation, since a TCP stream already handles the fragmentation 384 of its contents across packets. Since fragmentation is redundant in 385 this case, implementations might choose to not negotiate IKEv2 386 fragmentation. Even if fragmentation is negotiated, an 387 implementation MAY choose to not fragment when going over a TCP 388 connection. 390 If an implementation supports both MOBIKE and IKEv2 fragmentation, it 391 SHOULD negotiate IKEv2 fragmentation over a TCP encapsulated session 392 in case the session switches to UDP encapsulation on another network. 394 10. Considerations for Keep-alives and DPD 396 Encapsulating IKE and IPSec inside of a TCP connection can impact the 397 strategy that implementations use to detect peer liveness and to 398 maintain middlebox port mappings. Peer liveness should be checked 399 using IKEv2 Informational packets [RFC7296]. 401 In general, TCP port mappings are maintained by NATs longers than UDP 402 port mappings, so IPSec ESP NAT keep-alives [RFC3948] SHOULD NOT be 403 sent when using TCP encapsulation. Any implementation using TCP 404 encapsulation MUST silently drop incoming NAT keep-alive packets, and 405 not treat them as errors. NAT keep-alive packets over a TCP 406 encapsulated IPSec connection will be sent with a length value of 1 407 byte, whose value is 0xFF [Figure 2]. 409 Note that depending on the configuration of TCP and TLS on the 410 connection, TCP keep-alives [RFC1122] and TLS keep-alives [RFC6520] 411 may be used. These MUST NOT be used as indications of IKEv2 peer 412 liveness. 414 11. Middlebox Considerations 416 Many security networking devices such as Firewalls or Intrusion 417 Prevention Systems, network optimization/acceleration devices and 418 Network Address Translation (NAT) devices keep the state of sessions 419 that traverse through them. 421 These devices commonly track the transport layer and/or the 422 application layer data to drop traffic that is anomalous or malicious 423 in nature. 425 A network device that monitors up to the application layer will 426 commonly expect to see HTTP traffic within a TCP socket running over 427 port 80, if non-HTTP traffic is seen (such as TCP encapsulated 428 IKEv2), this could be dropped by the security device. 430 A network device that monitors the transport layer will track the 431 state of TCP sessions, such as TCP sequence numbers. TCP 432 encapsulation of IKEv2 should therefore use standard TCP behaviors to 433 avoid being dropped by middleboxes. 435 12. Performance Considerations 437 Several aspects of TCP encapsulation for IKEv2 and IPSec packets may 438 negatively impact the performance of connections within the tunnel. 439 Implementations should be aware of these and take these into 440 consideration when determining when to use TCP encapsulation. 442 12.1. TCP-in-TCP 444 If the outer connection between IKEv2 peers is over TCP, inner TCP 445 connections may suffer effects from using TCP within TCP. In 446 particular, the inner TCP's round-trip-time estimation will be 447 affected by the burstiness of the outer TCP. This will make loss- 448 recovery of the inner TCP traffic less reactive and more prone to 449 spurious retransmission timeouts. 451 12.2. Added Reliability for Unreliable Protocols 453 Since ESP is an unreliable protocol, transmitting ESP packets over a 454 TCP connection will change the fundamental behavior of the packets. 455 Some application-level protocols that prefer packet loss to delay 456 (such as Voice over IP or other real-time protocols) may be 457 negatively impacted if their packets are retransmitted by the TCP 458 connection due to packet loss. 460 12.3. Quality of Service Markings 462 Quality of Service (QoS) markings, such as DSCP and Traffic Class, 463 should be used with care on TCP connections used for encapsulation. 464 Individual packets SHOULD NOT use different markings than the rest of 465 the connection, since packets with different priorities may be routed 466 differently and cause unnecessary delays in the connection. 468 12.4. Maximum Segment Size 470 A TCP connection used for IKEv2 encapsulation SHOULD negotiate its 471 maximum segment size (MSS) in order to avoid unnecessary 472 fragmentation of packets. 474 13. Security Considerations 476 IKEv2 responders that support TCP encapsulation may become vulnerable 477 to new Denial-of-Service (DoS) attacks that are specific to TCP, such 478 as SYN-flooding attacks. Responders should be aware of this 479 additional attack-surface. 481 Attackers may be able to disrupt the TCP connection by sending 482 spurious RST packets. Due to this, implementations SHOULD make sure 483 that IKE session state persists even if the underlying TCP connection 484 is torn down. 486 14. IANA Considerations 488 This memo includes no request to IANA. 490 TCP port 4500 is already allocated to IPSec. This port MAY be used 491 for the protocol described in this document, but implementations MAY 492 prefer to use other ports based on local policy. 494 15. Acknowledgments 496 The authors would like to acknowledge the input and advice of Stuart 497 Cheshire, Delziel Fernandes, Yoav Nir, Christoph Paasch, Yaron 498 Sheffer, David Schinazi, Graham Bartlett, Byju Pularikkal, March Wu 499 and Kingwel Xie. Special thanks to Eric Kinnear for his 500 implementation work. 502 16. References 504 16.1. Normative References 506 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 507 Requirement Levels", BCP 14, RFC 2119, 508 DOI 10.17487/RFC2119, March 1997, 509 . 511 [RFC7296] Kaufman, C., Hoffman, P., Nir, Y., Eronen, P., and T. 512 Kivinen, "Internet Key Exchange Protocol Version 2 513 (IKEv2)", STD 79, RFC 7296, DOI 10.17487/RFC7296, October 514 2014, . 516 16.2. Informative References 518 [I-D.nir-ipsecme-ike-tcp] 519 Nir, Y., "A TCP transport for the Internet Key Exchange", 520 draft-nir-ipsecme-ike-tcp-01 (work in progress), July 521 2012. 523 [RFC1122] Braden, R., Ed., "Requirements for Internet Hosts - 524 Communication Layers", STD 3, RFC 1122, 525 DOI 10.17487/RFC1122, October 1989, 526 . 528 [RFC2817] Khare, R. and S. Lawrence, "Upgrading to TLS Within 529 HTTP/1.1", RFC 2817, DOI 10.17487/RFC2817, May 2000, 530 . 532 [RFC3948] Huttunen, A., Swander, B., Volpe, V., DiBurro, L., and M. 533 Stenberg, "UDP Encapsulation of IPsec ESP Packets", 534 RFC 3948, DOI 10.17487/RFC3948, January 2005, 535 . 537 [RFC4303] Kent, S., "IP Encapsulating Security Payload (ESP)", 538 RFC 4303, DOI 10.17487/RFC4303, December 2005, 539 . 541 [RFC4555] Eronen, P., "IKEv2 Mobility and Multihoming Protocol 542 (MOBIKE)", RFC 4555, DOI 10.17487/RFC4555, June 2006, 543 . 545 [RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security 546 (TLS) Protocol Version 1.2", RFC 5246, 547 DOI 10.17487/RFC5246, August 2008, 548 . 550 [RFC6520] Seggelmann, R., Tuexen, M., and M. Williams, "Transport 551 Layer Security (TLS) and Datagram Transport Layer Security 552 (DTLS) Heartbeat Extension", RFC 6520, 553 DOI 10.17487/RFC6520, February 2012, 554 . 556 [RFC7383] Smyslov, V., "Internet Key Exchange Protocol Version 2 557 (IKEv2) Message Fragmentation", RFC 7383, 558 DOI 10.17487/RFC7383, November 2014, 559 . 561 Appendix A. Using TCP encapsulation with TLS 563 This section provides recommendations on the support of TLS with the 564 TCP encapsulation. 566 When using TCP encapsulation, implementations may choose to use TLS 567 [RFC5246], to be able to traverse middle-boxes, which may block non 568 HTTP traffic. 570 If a web proxy is applied to the ports for the TCP connection, and 571 TLS is being used, the initiator can send an HTTP CONNECT message to 572 establish a tunnel through the proxy [RFC2817]. 574 The use of TLS should be configurable on the peers. The responder 575 may expect to read encapsulated IKEv2 and ESP packets directly from 576 the TCP connection, or it may expect to read them from a stream of 577 TLS data packets. The initiator should be pre-configured to use TLS 578 or not when communicating with a given port on the responder. 580 When new TCP connections are re-established due to a broken 581 connection, TLS must be re-negotiated. TLS Session Resumption is 582 recommended to improve efficiency in this case. 584 The security of the IKEv2 session is entirely derived from the IKVEv2 585 negotiation and key establishment, therefore When TLS is used on the 586 TCP connection, both the initiator and responder MUST allow for the 587 NULL cipher to be selected. 589 Implementations must be aware that the use of TLS introduces another 590 layer of overhead requiring more bytes to transmit a given IKEv2 and 591 IPSec packet. 593 Appendix B. Example exchanges of TCP Encapsulation with TLS 595 B.1. Establishing an IKEv2 session 596 Client Server 597 ---------- ---------- 598 -------------------- TCP Connection ------------------- 599 1) (IP_I:Port_I -> IP_R:TCP443 or TCP4500) 600 TcpSyn ----------> 601 <---------- TcpSyn,Ack 602 TcpAck ----------> 604 --------------------- TLS Session --------------------- 605 2) ClientHello ----------> 606 ServerHello 607 Certificate* 608 ServerKeyExchange* 609 <---------- ServerHelloDone 610 ClientKeyExchange 611 CertificateVerify* 612 [ChangeCipherSpec] 613 Finished ----------> 614 [ChangeCipherSpec] 615 <---------- Finished 617 ---------------------- IKEv2 Session -------------------- 618 3) IKE_SA_INIT ----------> 619 HDR, SAi1, KEi, Ni, 620 [N(NAT_DETECTION_*_IP)] 621 <---------- IKE_SA_INIT 622 HDR, SAr1, KEr, Nr, 623 [N(NAT_DETECTION_*_IP)] 624 first IKE_AUTH ----------> 625 HDR, SK {IDi, [CERTREQ] 626 CP(CFG_REQUEST), IDr, 627 SAi2, TSi, TSr, ...} 628 <---------- first IKE_AUTH 629 HDR, SK {IDr, [CERT], AUTH, 630 EAP, SAr2, TSi, TSr} 631 EAP ----------> 632 repeat 1..N times 633 <---------- EAP 634 final IKE_AUTH ----------> 635 HDR, SK {AUTH} 636 <---------- final IKE_AUTH 637 HDR, SK {AUTH, CP(CFG_REPLY), 638 SA, TSi, TSr, ...} 639 -------------- IKEv2 Tunnel Established ------------- 641 Figure 4 643 1. Client establishes a TCP connection with the server on port 443 644 or 4500. 646 2. Client initiates TLS handshake. During TLS handshake, the 647 server SHOULD NOT request the client's' certificate, since 648 authentication is handled as part of IKEv2 negotiation. 650 3. Client and server establish an IKEv2 connection. This example 651 shows EAP-based authentication, although any authentication 652 type may be used. 654 B.2. Deleting an IKEv2 session 656 Client Server 657 ---------- ---------- 658 ---------------------- IKEv2 Session -------------------- 659 1) INFORMATIONAL ----------> 660 HDR, SK {[N,] [D,] 661 [CP,] ...} 662 <---------- INFORMATIONAL 663 HDR, SK {[N,] [D,] 664 [CP], ...} 666 --------------------- TLS Session --------------------- 667 2) close_notify ----------> 668 <---------- close_notify 669 -------------------- TCP Connection ------------------- 670 3) TcpFin ----------> 671 <---------- Ack 672 <---------- TcpFin 673 Ack ----------> 674 --------------------- Tunnel Deleted ------------------- 676 Figure 5 678 1. Client and server exchange INFORMATIONAL messages to notify IKE 679 SA deletion. 681 2. Client and server negotiate TLS session deletion using TLS 682 CLOSE_NOTIFY. 684 3. The TCP connection is torn down. 686 Unless the TCP connection and/or TLS session are being used for 687 multiple IKE SAs, the deletion of the IKE SA should lead to the 688 disposal of the underlying TLS and TCP state. 690 B.3. Re-establishing an IKEv2 session 692 Client Server 693 ---------- ---------- 694 -------------------- TCP Connection ------------------- 695 1) (IP_I:Port_I -> IP_R:TCP443 or TCP4500) 696 TcpSyn ----------> 697 <---------- TcpSyn,Ack 698 TcpAck ----------> 699 --------------------- TLS Session --------------------- 700 2) ClientHello ----------> 701 <---------- ServerHello 702 [ChangeCipherSpec] 703 Finished 704 [ChangeCipherSpec] ----------> 705 Finished 706 3) <--------------------> IKEv2/ESP flow <-----------------> 708 Figure 6 710 1. If a previous TCP connection was broken (for example, due to a 711 RST), the client is responsible for re-initiating the TCP 712 connection. The initiator's address and port (IP_I and Port_I) 713 may be different from the previous connection's address and 714 port. 716 2. In ClientHello TLS message, the client SHOULD send the Session 717 ID it received in the previous TLS handshake if available. It 718 is up to the server to perform either an abbreviated handshake 719 or full handshake based on the session ID match. 721 3. After TCP and TLS are complete, the IKEv2 and ESP packet flow 722 can resume. If MOBIKE is being used, the initiator SHOULD send 723 UPDATE_SA_ADDRESSES. 725 B.4. Using MOBIKE between UDP and TCP Encapsulation 727 Client Server 728 ---------- ---------- 729 (IP_I1:UDP500 -> IP_R:UDP500) 730 1) ----------------- IKE_SA_INIT Exchange ----------------- 731 (IP_I1:UDP4500 -> IP_R:UDP4500) 732 Intial IKE_AUTH -----------> 733 HDR, SK { IDi, CERT, AUTH, 734 CP(CFG_REQUEST), 735 SAi2, TSi, TSr, 736 N(MOBIKE_SUPPORTED) } 737 <----------- Initial IKE_AUTH 738 HDR, SK { IDr, CERT, AUTH, 739 EAP, SAr2, TSi, TSr, 740 N(MOBIKE_SUPPORTED) } 741 <--------------- IKEv2 tunnel establishment ------------> 743 2) ------------ MOBIKE Attempt on new network -------------- 744 (IP_I2:UDP4500 -> IP_R:UDP4500) 745 INFORMATIONAL -----------> 746 HDR, SK { N(UPDATE_SA_ADDRESSES), 747 N(NAT_DETECTION_SOURCE_IP), 748 N(NAT_DETECTION_DESTINATION_IP) } 750 3) -------------------- TCP Connection ------------------- 751 (IP_I2:PORT_I -> IP_R:TCP443 or TCP4500) 752 TcpSyn -----------> 753 <----------- TcpSyn,Ack 754 TcpAck -----------> 756 4) --------------------- TLS Session --------------------- 757 ClientHello -----------> 758 ServerHello 759 Certificate* 760 ServerKeyExchange* 761 <----------- ServerHelloDone 762 ClientKeyExchange 763 CertificateVerify* 764 [ChangeCipherSpec] 765 Finished -----------> 766 [ChangeCipherSpec] 767 <----------- Finished 768 5) ---------------------- IKEv2 Session -------------------- 769 INFORMATIONAL -----------> 770 HDR, SK { N(UPDATE_SA_ADDRESSES), 771 N(NAT_DETECTION_SOURCE_IP), 772 N(NAT_DETECTION_DESTINATION_IP) } 774 <----------- INFORMATIONAL 775 HDR, SK { N(NAT_DETECTION_SOURCE_IP), 776 N(NAT_DETECTION_DESTINATION_IP) } 777 6) <---------------- IKEv2/ESP data flow ------------------> 779 Figure 7 781 1. During the IKE_SA_INIT exchange, the client and server exchange 782 MOBIKE_SUPPORTED notify payloads to indicate support for 783 MOBIKE. 785 2. The client changes its point of attachment to the network, and 786 receives a new IP address. The client attempts to re-establish 787 the IKEv2 session using the UPDATE_SA_ADDRESSES notify payload, 788 but the server does not respond because the network blocks UDP 789 traffic. 791 3. The client beings up a TCP connection to the server in order to 792 use TCP encapsulation. 794 4. The client initiates and TLS handshake with the server. 796 5. The client sends the UPDATE_SA_ADDRESSES notify payload on the 797 TCP encapsulated connection. 799 6. The IKEv2 and ESP packet flow can resume. 801 Authors' Addresses 803 Tommy Pauly 804 Apple Inc. 805 1 Infinite Loop 806 Cupertino, California 95014 807 US 809 Email: tpauly@apple.com 811 Samy Touati 812 Ericsson 813 300 Holger Way 814 San Jose, California 95134 815 US 817 Email: samy.touati@ericsson.com 819 Ravi Mantha 820 Cisco Systems 821 SEZ, Embassy Tech Village 822 Panathur, Bangalore 560 037 823 India 825 Email: ramantha@cisco.com