idnits 2.17.1 draft-ietf-ipsecme-tcp-encaps-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 (June 24, 2016) is 2863 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 816, but not defined == Missing Reference: 'Figure 2' is mentioned on line 414, but not defined == Missing Reference: 'ChangeCipherSpec' is mentioned on line 782, but not defined == Missing Reference: 'CERTREQ' is mentioned on line 634, but not defined == Missing Reference: 'CERT' is mentioned on line 638, but not defined == Missing Reference: 'CP' is mentioned on line 676, 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: December 26, 2016 Ericsson 6 R. Mantha 7 Cisco Systems 8 June 24, 2016 10 TCP Encapsulation of IKE and IPSec Packets 11 draft-ietf-ipsecme-tcp-encaps-00 13 Abstract 15 This document describes a method to transport IKE and IPSec packets 16 over a TCP connection for traversing network middleboxes that may 17 block IKE 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 December 26, 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 IKE 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 IKE 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 . . . . . . . . . . . . . . . . . . 11 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 . . . . . . . . . . . . . . . . . 12 83 Appendix A. Using TCP encapsulation with TLS . . . . . . . . . . 13 84 Appendix B. Example exchanges of TCP Encapsulation with TLS . . 13 85 B.1. Establishing an IKE session . . . . . . . . . . . . . . . 13 86 B.2. Deleting an IKE session . . . . . . . . . . . . . . . . . 15 87 B.3. Re-establishing an IKE session . . . . . . . . . . . . . 16 88 B.4. Using MOBIKE between UDP and TCP Encapsulation . . . . . 17 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 IKE 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 IKE 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, IKE negotiations begin over UDP port 500. 109 If no NAT is detected between the initiator and the receiver, 110 then subsequent IKE 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 IKE 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 IKE negotiation packets as well 123 as ESP packets can be sent over a single TCP connection to the 124 peer. 126 Direct use of ESP or UDP Encapsulation should be preferred by IKE 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 IKE connections within TCP streams is a common approach 136 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 IKE 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 IKE exchange. 171 Instead, support for TCP encapsulation must be pre-configured on both 172 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 IKE 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 IKE 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 ESP direct 193 or UDP encapsulated tunnels over TCP encapsulated tunnels. 195 3. TCP-Encapsulated Header Formats 197 In order to encapsulate IKE 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 IKE 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 IKE 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 ~ IKE 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 IKE over UDP port 4500, a zeroed 32-bit Non-ESP 230 Marker is inserted before the start of the IKE 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 The SPI field in the ESP header MUST NOT be a zero value. 257 o Length (2 octets, unsigned integer) - Length of the ESP packet 258 including the Length Field. 260 4. TCP-Encapsulated Stream Prefix 262 Each TCP stream used for IKE and IPSec encapsulation MUST begin with 263 a fixed sequence of five bytes as a magic value, containing the 264 characters "IKETCP" as ASCII values. This allows peers to 265 differentiate this protocol from other protocols that may be run over 266 TCP streams, since the value does not overlap with the valid start of 267 any other known stream protocol. This value is only sent once, by 268 the Initiator only, at the beginning of any TCP stream. If other 269 framing protocols are used within TCP to further encapsulate or 270 encrypt the stream of IKE and ESP messages, the Stream Prefix must 271 still precede any IKE or ESP messages. 273 0 1 2 3 4 5 274 +------+------+------+------+------+------+ 275 | 0x49 | 0x4b | 0x45 | 0x54 | 0x43 | 0x50 | 276 +------+------+------+------+------+------+ 278 Figure 3 280 5. Applicability 282 TCP encapsulation is applicable only when it has been configured to 283 be used with specific IKE peers. If a responder is configured to use 284 TCP encapsulation, it MUST listen on the configured port(s) in case 285 any peers will initiate new IKE sessions. Initiators MAY use TCP 286 encapsulation for any IKE session to a peer that is configured to 287 support TCP encapsulation, although it is recommended that initiators 288 should only use TCP encapsulation when traffic over UDP is blocked. 290 If TCP encapsulation is being used for a specific IKE SA, all 291 messages for that IKE SA and its Child SAs MUST be sent over a TCP 292 connection until the SA is deleted or MOBIKE is used to change the SA 293 endpoints and/or encapsulation protocol. No packets should be sent 294 over UDP or direct ESP for the IKE SA or its Child SAs while using 295 TCP encapsulation. 297 6. Connection Establishment and Teardown 299 When the IKE initiator uses TCP encapsulation for its negotiation, it 300 will initiate a TCP connection to the responder using the configured 301 TCP port. The first bytes sent on the stream MUST be the stream 302 prefix value [Section 4]. After this prefix, encapsulated IKE 303 messages will negotiate the IKE SA and initial Child SA [RFC7296]. 304 After this point, both encapsulated IKE Figure 1 and ESP Figure 2 305 messages will be sent over the TCP connection. 307 In order to close an IKE session, either the initiator or responder 308 SHOULD gracefully tear down IKE SAs with DELETE payloads. Once all 309 SAs have been deleted, the initiator of the original connection MUST 310 close the TCP connection. 312 An unexpected FIN or a RST on the TCP connection may indicate either 313 a loss of connectivity, an attack, or some other error. If a DELETE 314 payload has not been sent, both sides SHOULD maintain the state for 315 their SAs for the standard lifetime or time-out period. The original 316 initiator (that is, the endpoint that initiated the TCP connection 317 and sent the first IKE_SA_INIT message) is responsible for re- 318 establishing the TCP connection if it is torn down for any unexpected 319 reason. Since new TCP connections may use different ports due to NAT 320 mappings or local port allocations changing, the responder MUST allow 321 packets for existing SAs to be received from new source ports. 323 A peer MUST discard a partially received message due to a broken 324 connection. 326 The streams of data sent over any TCP connection used for this 327 protocol MUST begin with the stream prefix value followed by a 328 complete message, which is either an encapsulated IKE or ESP message. 329 If the connection is being used to resume a previous IKE session, the 330 responder can recognize the session using either the IKE SPI from an 331 encapsulated IKE message or the ESP SPI from an encapsulated ESP 332 message. If the session had been fully established previously, it is 333 suggested that the initiator send an UPDATE_SA_ADDRESSES message if 334 MOBIKE is supported, or an INFORMATIONAL message (a keepalive) 335 otherwise. If either initiator or responder receives a stream that 336 cannot be parsed correctly, it MUST close the TCP connection. 338 Multiple TCP connections between the initiator and the responder are 339 allowed, but their use must take into account the initiator 340 capabilities and the deployment model such as to connect to multiple 341 gateways handling different ESP SAs when deployed in a high 342 availability model. It is also possible to negotiate multiple IKE 343 SAs over the same TCP connection. 345 The processing of the TCP packets is the same whether its within a 346 single or multiple TCP connections. 348 7. Interaction with NAT Detection Payloads 350 When negotiating over UDP port 500, IKE_SA_INIT packets include 351 NAT_DETECTION_SOURCE_IP and NAT_DETECTION_DESTINATION_IP payloads to 352 determine if UDP encapsulation of IPSec packets should be used. 353 These payloads contain SHA-1 digests of the SPIs, IP addresses, and 354 ports. IKE_SA_INIT packets sent on a TCP connection SHOULD include 355 these payloads, and SHOULD use the applicable TCP ports when creating 356 and checking the SHA-1 digests. 358 If a NAT is detected due to the SHA-1 digests not matching the 359 expected values, no change should be made for encapsulation of 360 subsequent IKE or ESP packets, since TCP encapsulation inherently 361 supports NAT traversal. Implementations MAY use the information that 362 a NAT is present to influence keep-alive timer values. 364 8. Using MOBIKE with TCP encapsulation 366 When an IKE session is transitioned between networks using MOBIKE 367 [RFC4555], the initiator of the transition may switch between using 368 TCP encapsulation, UDP encapsulation, or no encapsulation. 369 Implementations that implement both MOBIKE and TCP encapsulation MUST 370 support dynamically enabling and disabling TCP encapsulation as 371 interfaces change. 373 The encapsulation method of ESP packets MUST always match the 374 encapsulation method of the IKE negotiation, which may be different 375 when an IKE endpoint changes networks. When a MOBIKE-enabled 376 initiator changes networks, the UPDATE_SA_ADDRESSES notification 377 SHOULD be sent out first over UDP before attempting over TCP. If 378 there is a response to the UPDATE_SA_ADDRESSES notification sent over 379 UDP, then the ESP packets should be sent directly over IP or over UDP 380 port 4500 (depending on if a NAT was detected), regardless of if a 381 connection on a previous network was using TCP encapsulation. 382 Similarly, if the responder only responds to the UPDATE_SA_ADDRESSES 383 notification over TCP, then the ESP packets should be sent over the 384 TCP connection, regardless of if a connection on a previous network 385 did not use TCP encapsulation. 387 9. Using IKE Message Fragmentation with TCP encapsulation 389 IKE Message Fragmentation [RFC7383] is not required when using TCP 390 encapsulation, since a TCP stream already handles the fragmentation 391 of its contents across packets. Since fragmentation is redundant in 392 this case, implementations might choose to not negotiate IKE 393 fragmentation. Even if fragmentation is negotiated, an 394 implementation MAY choose to not fragment when going over a TCP 395 connection. 397 If an implementation supports both MOBIKE and IKE fragmentation, it 398 SHOULD negotiate IKE fragmentation over a TCP encapsulated session in 399 case the session switches to UDP encapsulation on another network. 401 10. Considerations for Keep-alives and DPD 403 Encapsulating IKE and IPSec inside of a TCP connection can impact the 404 strategy that implementations use to detect peer liveness and to 405 maintain middlebox port mappings. Peer liveness should be checked 406 using IKE Informational packets [RFC7296]. 408 In general, TCP port mappings are maintained by NATs longers than UDP 409 port mappings, so IPSec ESP NAT keep-alives [RFC3948] SHOULD NOT be 410 sent when using TCP encapsulation. Any implementation using TCP 411 encapsulation MUST silently drop incoming NAT keep-alive packets, and 412 not treat them as errors. NAT keep-alive packets over a TCP 413 encapsulated IPSec connection will be sent with a length value of 1 414 byte, whose value is 0xFF [Figure 2]. 416 Note that depending on the configuration of TCP and TLS on the 417 connection, TCP keep-alives [RFC1122] and TLS keep-alives [RFC6520] 418 may be used. These MUST NOT be used as indications of IKE peer 419 liveness. 421 11. Middlebox Considerations 423 Many security networking devices such as Firewalls or Intrusion 424 Prevention Systems, network optimization/acceleration devices and 425 Network Address Translation (NAT) devices keep the state of sessions 426 that traverse through them. 428 These devices commonly track the transport layer and/or the 429 application layer data to drop traffic that is anomalous or malicious 430 in nature. 432 A network device that monitors up to the application layer will 433 commonly expect to see HTTP traffic within a TCP socket running over 434 port 80, if non-HTTP traffic is seen (such as TCP encapsulated IKE), 435 this could be dropped by the security device. 437 A network device that monitors the transport layer will track the 438 state of TCP sessions, such as TCP sequence numbers. TCP 439 encapsulation of IKE should therefore use standard TCP behaviors to 440 avoid being dropped by middleboxes. 442 12. Performance Considerations 444 Several aspects of TCP encapsulation for IKE and IPSec packets may 445 negatively impact the performance of connections within the tunnel. 446 Implementations should be aware of these and take these into 447 consideration when determining when to use TCP encapsulation. 449 12.1. TCP-in-TCP 451 If the outer connection between IKE peers is over TCP, inner TCP 452 connections may suffer effects from using TCP within TCP. In 453 particular, the inner TCP's round-trip-time estimation will be 454 affected by the burstiness of the outer TCP. This will make loss- 455 recovery of the inner TCP traffic less reactive and more prone to 456 spurious retransmission timeouts. 458 12.2. Added Reliability for Unreliable Protocols 460 Since ESP is an unreliable protocol, transmitting ESP packets over a 461 TCP connection will change the fundamental behavior of the packets. 462 Some application-level protocols that prefer packet loss to delay 463 (such as Voice over IP or other real-time protocols) may be 464 negatively impacted if their packets are retransmitted by the TCP 465 connection due to packet loss. 467 12.3. Quality of Service Markings 469 Quality of Service (QoS) markings, such as DSCP and Traffic Class, 470 should be used with care on TCP connections used for encapsulation. 471 Individual packets SHOULD NOT use different markings than the rest of 472 the connection, since packets with different priorities may be routed 473 differently and cause unnecessary delays in the connection. 475 12.4. Maximum Segment Size 477 A TCP connection used for IKE encapsulation SHOULD negotiate its 478 maximum segment size (MSS) in order to avoid unnecessary 479 fragmentation of packets. 481 13. Security Considerations 483 IKE responders that support TCP encapsulation may become vulnerable 484 to new Denial-of-Service (DoS) attacks that are specific to TCP, such 485 as SYN-flooding attacks. Responders should be aware of this 486 additional attack-surface. 488 Attackers may be able to disrupt the TCP connection by sending 489 spurious RST packets. Due to this, implementations SHOULD make sure 490 that IKE session state persists even if the underlying TCP connection 491 is torn down. 493 14. IANA Considerations 495 This memo includes no request to IANA. 497 TCP port 4500 is already allocated to IPSec. This port MAY be used 498 for the protocol described in this document, but implementations MAY 499 prefer to use other ports based on local policy. 501 15. Acknowledgments 503 The authors would like to acknowledge the input and advice of Stuart 504 Cheshire, Delziel Fernandes, Yoav Nir, Christoph Paasch, Yaron 505 Sheffer, David Schinazi, Graham Bartlett, Byju Pularikkal, March Wu 506 and Kingwel Xie. Special thanks to Eric Kinnear for his 507 implementation work. 509 16. References 511 16.1. Normative References 513 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 514 Requirement Levels", BCP 14, RFC 2119, 515 DOI 10.17487/RFC2119, March 1997, 516 . 518 [RFC7296] Kaufman, C., Hoffman, P., Nir, Y., Eronen, P., and T. 519 Kivinen, "Internet Key Exchange Protocol Version 2 520 (IKEv2)", STD 79, RFC 7296, DOI 10.17487/RFC7296, October 521 2014, . 523 16.2. Informative References 525 [I-D.nir-ipsecme-ike-tcp] 526 Nir, Y., "A TCP transport for the Internet Key Exchange", 527 draft-nir-ipsecme-ike-tcp-01 (work in progress), July 528 2012. 530 [RFC1122] Braden, R., Ed., "Requirements for Internet Hosts - 531 Communication Layers", STD 3, RFC 1122, 532 DOI 10.17487/RFC1122, October 1989, 533 . 535 [RFC2817] Khare, R. and S. Lawrence, "Upgrading to TLS Within 536 HTTP/1.1", RFC 2817, DOI 10.17487/RFC2817, May 2000, 537 . 539 [RFC3948] Huttunen, A., Swander, B., Volpe, V., DiBurro, L., and M. 540 Stenberg, "UDP Encapsulation of IPsec ESP Packets", 541 RFC 3948, DOI 10.17487/RFC3948, January 2005, 542 . 544 [RFC4303] Kent, S., "IP Encapsulating Security Payload (ESP)", 545 RFC 4303, DOI 10.17487/RFC4303, December 2005, 546 . 548 [RFC4555] Eronen, P., "IKEv2 Mobility and Multihoming Protocol 549 (MOBIKE)", RFC 4555, DOI 10.17487/RFC4555, June 2006, 550 . 552 [RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security 553 (TLS) Protocol Version 1.2", RFC 5246, 554 DOI 10.17487/RFC5246, August 2008, 555 . 557 [RFC6520] Seggelmann, R., Tuexen, M., and M. Williams, "Transport 558 Layer Security (TLS) and Datagram Transport Layer Security 559 (DTLS) Heartbeat Extension", RFC 6520, 560 DOI 10.17487/RFC6520, February 2012, 561 . 563 [RFC7383] Smyslov, V., "Internet Key Exchange Protocol Version 2 564 (IKEv2) Message Fragmentation", RFC 7383, 565 DOI 10.17487/RFC7383, November 2014, 566 . 568 Appendix A. Using TCP encapsulation with TLS 570 This section provides recommendations on the support of TLS with the 571 TCP encapsulation. 573 When using TCP encapsulation, implementations may choose to use TLS 574 [RFC5246], to be able to traverse middle-boxes, which may block non 575 HTTP traffic. 577 If a web proxy is applied to the ports for the TCP connection, and 578 TLS is being used, the initiator can send an HTTP CONNECT message to 579 establish a tunnel through the proxy [RFC2817]. 581 The use of TLS should be configurable on the peers. The responder 582 may expect to read encapsulated IKE and ESP packets directly from the 583 TCP connection, or it may expect to read them from a stream of TLS 584 data packets. The initiator should be pre-configured to use TLS or 585 not when communicating with a given port on the responder. 587 When new TCP connections are re-established due to a broken 588 connection, TLS must be re-negotiated. TLS Session Resumption is 589 recommended to improve efficiency in this case. 591 The security of the IKE session is entirely derived from the IKVEv2 592 negotiation and key establishment, therefore When TLS is used on the 593 TCP connection, both the initiator and responder MUST allow for the 594 NULL cipher to be selected. 596 Implementations must be aware that the use of TLS introduces another 597 layer of overhead requiring more bytes to transmit a given IKE and 598 IPSec packet. 600 Appendix B. Example exchanges of TCP Encapsulation with TLS 602 B.1. Establishing an IKE session 603 Client Server 604 ---------- ---------- 605 1) -------------------- TCP Connection ------------------- 606 (IP_I:Port_I -> IP_R:TCP443 or TCP4500) 607 TcpSyn ----------> 608 <---------- TcpSyn,Ack 609 TcpAck ----------> 611 2) --------------------- TLS Session --------------------- 612 ClientHello ----------> 613 ServerHello 614 Certificate* 615 ServerKeyExchange* 616 <---------- ServerHelloDone 617 ClientKeyExchange 618 CertificateVerify* 619 [ChangeCipherSpec] 620 Finished ----------> 621 [ChangeCipherSpec] 622 <---------- Finished 624 3) ---------------------- Stream Prefix -------------------- 625 "IKETCP" ----------> 626 4) ----------------------- IKE Session --------------------- 627 IKE_SA_INIT ----------> 628 HDR, SAi1, KEi, Ni, 629 [N(NAT_DETECTION_*_IP)] 630 <---------- IKE_SA_INIT 631 HDR, SAr1, KEr, Nr, 632 [N(NAT_DETECTION_*_IP)] 633 first IKE_AUTH ----------> 634 HDR, SK {IDi, [CERTREQ] 635 CP(CFG_REQUEST), IDr, 636 SAi2, TSi, TSr, ...} 637 <---------- first IKE_AUTH 638 HDR, SK {IDr, [CERT], AUTH, 639 EAP, SAr2, TSi, TSr} 640 EAP ----------> 641 repeat 1..N times 642 <---------- EAP 643 final IKE_AUTH ----------> 644 HDR, SK {AUTH} 645 <---------- final IKE_AUTH 646 HDR, SK {AUTH, CP(CFG_REPLY), 647 SA, TSi, TSr, ...} 648 ----------------- IKE Tunnel Established ---------------- 650 Figure 4 652 1. Client establishes a TCP connection with the server on port 443 653 or 4500. 655 2. Client initiates TLS handshake. During TLS handshake, the 656 server SHOULD NOT request the client's' certificate, since 657 authentication is handled as part of IKE negotiation. 659 3. Client send the Stream Prefix for TCP encapsulated IKE 660 [Section 4] traffic to signal the beginning of IKE negotation. 662 4. Client and server establish an IKE connection. This example 663 shows EAP-based authentication, although any authentication 664 type may be used. 666 B.2. Deleting an IKE session 668 Client Server 669 ---------- ---------- 670 1) ----------------------- IKE Session --------------------- 671 INFORMATIONAL ----------> 672 HDR, SK {[N,] [D,] 673 [CP,] ...} 674 <---------- INFORMATIONAL 675 HDR, SK {[N,] [D,] 676 [CP], ...} 678 2) --------------------- TLS Session --------------------- 679 close_notify ----------> 680 <---------- close_notify 681 3) -------------------- TCP Connection ------------------- 682 TcpFin ----------> 683 <---------- Ack 684 <---------- TcpFin 685 Ack ----------> 686 --------------------- Tunnel Deleted ------------------- 688 Figure 5 690 1. Client and server exchange INFORMATIONAL messages to notify IKE 691 SA deletion. 693 2. Client and server negotiate TLS session deletion using TLS 694 CLOSE_NOTIFY. 696 3. The TCP connection is torn down. 698 Unless the TCP connection and/or TLS session are being used for 699 multiple IKE SAs, the deletion of the IKE SA should lead to the 700 disposal of the underlying TLS and TCP state. 702 B.3. Re-establishing an IKE session 704 Client Server 705 ---------- ---------- 706 1) -------------------- TCP Connection ------------------- 707 (IP_I:Port_I -> IP_R:TCP443 or TCP4500) 708 TcpSyn ----------> 709 <---------- TcpSyn,Ack 710 TcpAck ----------> 711 2) --------------------- TLS Session --------------------- 712 ClientHello ----------> 713 <---------- ServerHello 714 [ChangeCipherSpec] 715 Finished 716 [ChangeCipherSpec] ----------> 717 Finished 718 3) ---------------------- Stream Prefix -------------------- 719 "IKETCP" ----------> 720 4) <---------------------> IKE/ESP flow <------------------> 722 Figure 6 724 1. If a previous TCP connection was broken (for example, due to a 725 RST), the client is responsible for re-initiating the TCP 726 connection. The initiator's address and port (IP_I and Port_I) 727 may be different from the previous connection's address and 728 port. 730 2. In ClientHello TLS message, the client SHOULD send the Session 731 ID it received in the previous TLS handshake if available. It 732 is up to the server to perform either an abbreviated handshake 733 or full handshake based on the session ID match. 735 3. After TCP and TLS are complete, the client sends the Stream 736 Prefix for TCP encapsulated IKE traffic [Section 4]. 738 4. The IKE and ESP packet flow can resume. If MOBIKE is being 739 used, the initiator SHOULD send UPDATE_SA_ADDRESSES. 741 B.4. Using MOBIKE between UDP and TCP Encapsulation 743 Client Server 744 ---------- ---------- 745 (IP_I1:UDP500 -> IP_R:UDP500) 746 1) ----------------- IKE_SA_INIT Exchange ----------------- 747 (IP_I1:UDP4500 -> IP_R:UDP4500) 748 Intial IKE_AUTH -----------> 749 HDR, SK { IDi, CERT, AUTH, 750 CP(CFG_REQUEST), 751 SAi2, TSi, TSr, 752 N(MOBIKE_SUPPORTED) } 753 <----------- Initial IKE_AUTH 754 HDR, SK { IDr, CERT, AUTH, 755 EAP, SAr2, TSi, TSr, 756 N(MOBIKE_SUPPORTED) } 757 <---------------- IKE tunnel establishment -------------> 759 2) ------------ MOBIKE Attempt on new network -------------- 760 (IP_I2:UDP4500 -> IP_R:UDP4500) 761 INFORMATIONAL -----------> 762 HDR, SK { N(UPDATE_SA_ADDRESSES), 763 N(NAT_DETECTION_SOURCE_IP), 764 N(NAT_DETECTION_DESTINATION_IP) } 766 3) -------------------- TCP Connection ------------------- 767 (IP_I2:PORT_I -> IP_R:TCP443 or TCP4500) 768 TcpSyn -----------> 769 <----------- TcpSyn,Ack 770 TcpAck -----------> 772 4) --------------------- TLS Session --------------------- 773 ClientHello -----------> 774 ServerHello 775 Certificate* 776 ServerKeyExchange* 777 <----------- ServerHelloDone 778 ClientKeyExchange 779 CertificateVerify* 780 [ChangeCipherSpec] 781 Finished -----------> 782 [ChangeCipherSpec] 783 <----------- Finished 784 5) ---------------------- Stream Prefix -------------------- 785 "IKETCP" ----------> 787 6) ----------------------- IKE Session --------------------- 788 INFORMATIONAL -----------> 789 HDR, SK { N(UPDATE_SA_ADDRESSES), 790 N(NAT_DETECTION_SOURCE_IP), 791 N(NAT_DETECTION_DESTINATION_IP) } 793 <----------- INFORMATIONAL 794 HDR, SK { N(NAT_DETECTION_SOURCE_IP), 795 N(NAT_DETECTION_DESTINATION_IP) } 796 7) <----------------- IKE/ESP data flow -------------------> 798 Figure 7 800 1. During the IKE_SA_INIT exchange, the client and server exchange 801 MOBIKE_SUPPORTED notify payloads to indicate support for 802 MOBIKE. 804 2. The client changes its point of attachment to the network, and 805 receives a new IP address. The client attempts to re-establish 806 the IKE session using the UPDATE_SA_ADDRESSES notify payload, 807 but the server does not respond because the network blocks UDP 808 traffic. 810 3. The client beings up a TCP connection to the server in order to 811 use TCP encapsulation. 813 4. The client initiates and TLS handshake with the server. 815 5. The client sends the Stream Prefix for TCP encapsulated IKE 816 traffic [Section 4]. 818 6. The client sends the UPDATE_SA_ADDRESSES notify payload on the 819 TCP encapsulated connection. 821 7. The IKE and ESP packet flow can resume. 823 Authors' Addresses 825 Tommy Pauly 826 Apple Inc. 827 1 Infinite Loop 828 Cupertino, California 95014 829 US 831 Email: tpauly@apple.com 832 Samy Touati 833 Ericsson 834 300 Holger Way 835 San Jose, California 95134 836 US 838 Email: samy.touati@ericsson.com 840 Ravi Mantha 841 Cisco Systems 842 SEZ, Embassy Tech Village 843 Panathur, Bangalore 560 037 844 India 846 Email: ramantha@cisco.com