| rfc9329.original | rfc9329.txt | |||
|---|---|---|---|---|
| Network Working Group T. Pauly | Internet Engineering Task Force (IETF) T. Pauly | |||
| Internet-Draft Apple Inc. | Request for Comments: 9329 Apple Inc. | |||
| Obsoletes: 8229 (if approved) V. Smyslov | Obsoletes: 8229 V. Smyslov | |||
| Intended status: Standards Track ELVIS-PLUS | Category: Standards Track ELVIS-PLUS | |||
| Expires: 23 February 2023 22 August 2022 | ISSN: 2070-1721 November 2022 | |||
| TCP Encapsulation of IKE and IPsec Packets | TCP Encapsulation of Internet Key Exchange Protocol (IKE) and IPsec | |||
| draft-ietf-ipsecme-rfc8229bis-09 | Packets | |||
| Abstract | Abstract | |||
| This document describes a method to transport Internet Key Exchange | This document describes a method to transport Internet Key Exchange | |||
| Protocol (IKE) and IPsec packets over a TCP connection for traversing | Protocol (IKE) and IPsec packets over a TCP connection for traversing | |||
| network middleboxes that may block IKE negotiation over UDP. This | network middleboxes that may block IKE negotiation over UDP. This | |||
| method, referred to as "TCP encapsulation", involves sending both IKE | method, referred to as "TCP encapsulation", involves sending both IKE | |||
| packets for Security Association establishment and Encapsulating | packets for Security Association (SA) establishment and Encapsulating | |||
| Security Payload (ESP) packets over a TCP connection. This method is | Security Payload (ESP) packets over a TCP connection. This method is | |||
| intended to be used as a fallback option when IKE cannot be | intended to be used as a fallback option when IKE cannot be | |||
| negotiated over UDP. | negotiated over UDP. | |||
| TCP encapsulation for IKE and IPsec was defined in RFC 8229. This | TCP encapsulation for IKE and IPsec was defined in RFC 8229. This | |||
| document updates the specification for TCP encapsulation by including | document clarifies the specification for TCP encapsulation by | |||
| additional clarifications obtained during implementation and | including additional clarifications obtained during implementation | |||
| deployment of this method. This documents obsoletes RFC 8229. | and deployment of this method. This documents obsoletes RFC 8229. | |||
| Status of This Memo | Status of This Memo | |||
| This Internet-Draft is submitted in full conformance with the | This is an Internet Standards Track document. | |||
| provisions of BCP 78 and BCP 79. | ||||
| Internet-Drafts are working documents of the Internet Engineering | ||||
| Task Force (IETF). Note that other groups may also distribute | ||||
| working documents as Internet-Drafts. The list of current Internet- | ||||
| Drafts is at https://datatracker.ietf.org/drafts/current/. | ||||
| Internet-Drafts are draft documents valid for a maximum of six months | This document is a product of the Internet Engineering Task Force | |||
| and may be updated, replaced, or obsoleted by other documents at any | (IETF). It represents the consensus of the IETF community. It has | |||
| time. It is inappropriate to use Internet-Drafts as reference | received public review and has been approved for publication by the | |||
| material or to cite them other than as "work in progress." | Internet Engineering Steering Group (IESG). Further information on | |||
| Internet Standards is available in Section 2 of RFC 7841. | ||||
| This Internet-Draft will expire on 23 February 2023. | Information about the current status of this document, any errata, | |||
| and how to provide feedback on it may be obtained at | ||||
| https://www.rfc-editor.org/info/rfc9329. | ||||
| Copyright Notice | Copyright Notice | |||
| Copyright (c) 2022 IETF Trust and the persons identified as the | Copyright (c) 2022 IETF Trust and the persons identified as the | |||
| document authors. All rights reserved. | document authors. All rights reserved. | |||
| This document is subject to BCP 78 and the IETF Trust's Legal | This document is subject to BCP 78 and the IETF Trust's Legal | |||
| Provisions Relating to IETF Documents (https://trustee.ietf.org/ | Provisions Relating to IETF Documents | |||
| license-info) in effect on the date of publication of this document. | (https://trustee.ietf.org/license-info) in effect on the date of | |||
| Please review these documents carefully, as they describe your rights | publication of this document. Please review these documents | |||
| and restrictions with respect to this document. Code Components | carefully, as they describe your rights and restrictions with respect | |||
| extracted from this document must include Revised BSD License text as | to this document. Code Components extracted from this document must | |||
| described in Section 4.e of the Trust Legal Provisions and are | include Revised BSD License text as described in Section 4.e of the | |||
| provided without warranty as described in the Revised BSD License. | Trust Legal Provisions and are provided without warranty as described | |||
| in the Revised BSD License. | ||||
| Table of Contents | Table of Contents | |||
| 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 | 1. Introduction | |||
| 1.1. Prior Work and Motivation . . . . . . . . . . . . . . . . 4 | 1.1. Prior Work and Motivation | |||
| 1.2. Terminology and Notation . . . . . . . . . . . . . . . . 5 | 1.2. Terminology and Notation | |||
| 2. Configuration . . . . . . . . . . . . . . . . . . . . . . . . 6 | 2. Configuration | |||
| 3. TCP-Encapsulated Data Formats . . . . . . . . . . . . . . . . 6 | 3. TCP-Encapsulated Data Formats | |||
| 3.1. TCP-Encapsulated IKE Message Format . . . . . . . . . . . 7 | 3.1. TCP-Encapsulated IKE Message Format | |||
| 3.2. TCP-Encapsulated ESP Packet Format . . . . . . . . . . . 8 | 3.2. TCP-Encapsulated ESP Packet Format | |||
| 4. TCP-Encapsulated Stream Prefix . . . . . . . . . . . . . . . 8 | 4. TCP-Encapsulated Stream Prefix | |||
| 5. Applicability . . . . . . . . . . . . . . . . . . . . . . . . 9 | 5. Applicability | |||
| 5.1. Recommended Fallback from UDP . . . . . . . . . . . . . . 10 | 5.1. Recommended Fallback from UDP | |||
| 6. Using TCP Encapsulation . . . . . . . . . . . . . . . . . . . 10 | 6. Using TCP Encapsulation | |||
| 6.1. Connection Establishment and Teardown . . . . . . . . . . 10 | 6.1. Connection Establishment and Teardown | |||
| 6.2. Retransmissions . . . . . . . . . . . . . . . . . . . . . 12 | 6.2. Retransmissions | |||
| 6.3. Cookies and Puzzles . . . . . . . . . . . . . . . . . . . 13 | 6.3. Cookies and Puzzles | |||
| 6.3.1. Statelessness versus Delay of SA Establishment . . . 14 | 6.3.1. Statelessness versus Delay of SA Establishment | |||
| 6.4. Error Handling in IKE_SA_INIT . . . . . . . . . . . . . . 14 | 6.4. Error Handling in IKE_SA_INIT | |||
| 6.5. NAT Detection Payloads . . . . . . . . . . . . . . . . . 15 | 6.5. NAT-Detection Payloads | |||
| 6.6. NAT-keepalive Packets . . . . . . . . . . . . . . . . . . 15 | 6.6. NAT-Keepalive Packets | |||
| 6.7. Dead Peer Detection and Transport Keepalives . . . . . . 16 | 6.7. Dead Peer Detection and Transport Keepalives | |||
| 6.8. Implications of TCP Encapsulation on IPsec SA | 6.8. Implications of TCP Encapsulation on IPsec SA Processing | |||
| Processing . . . . . . . . . . . . . . . . . . . . . . . 16 | 7. Interaction with IKEv2 Extensions | |||
| 7. Interaction with IKEv2 Extensions . . . . . . . . . . . . . . 16 | 7.1. MOBIKE Protocol | |||
| 7.1. MOBIKE Protocol . . . . . . . . . . . . . . . . . . . . . 17 | 7.2. IKE Redirect | |||
| 7.2. IKE Redirect . . . . . . . . . . . . . . . . . . . . . . 18 | 7.3. IKEv2 Session Resumption | |||
| 7.3. IKEv2 Session Resumption . . . . . . . . . . . . . . . . 18 | 7.4. IKEv2 Protocol Support for High Availability | |||
| 7.4. IKEv2 Protocol Support for High Availability . . . . . . 19 | 7.5. IKEv2 Fragmentation | |||
| 7.5. IKEv2 Fragmentation . . . . . . . . . . . . . . . . . . . 19 | 8. Middlebox Considerations | |||
| 8. Middlebox Considerations . . . . . . . . . . . . . . . . . . 20 | 9. Performance Considerations | |||
| 9. Performance Considerations . . . . . . . . . . . . . . . . . 20 | 9.1. TCP-in-TCP | |||
| 9.1. TCP-in-TCP . . . . . . . . . . . . . . . . . . . . . . . 20 | 9.2. Added Reliability for Unreliable Protocols | |||
| 9.2. Added Reliability for Unreliable Protocols . . . . . . . 21 | 9.3. Quality-of-Service Markings | |||
| 9.3. Quality-of-Service Markings . . . . . . . . . . . . . . . 22 | 9.4. Maximum Segment Size | |||
| 9.4. Maximum Segment Size . . . . . . . . . . . . . . . . . . 22 | 9.5. Tunneling ECN in TCP | |||
| 9.5. Tunneling ECN in TCP . . . . . . . . . . . . . . . . . . 22 | 10. Security Considerations | |||
| 10. Security Considerations . . . . . . . . . . . . . . . . . . . 22 | 11. IANA Considerations | |||
| 11. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 25 | 12. References | |||
| 12. References . . . . . . . . . . . . . . . . . . . . . . . . . 25 | 12.1. Normative References | |||
| 12.1. Normative References . . . . . . . . . . . . . . . . . . 25 | 12.2. Informative References | |||
| 12.2. Informative References . . . . . . . . . . . . . . . . . 26 | Appendix A. Using TCP Encapsulation with TLS | |||
| Appendix A. Using TCP Encapsulation with TLS . . . . . . . . . . 28 | Appendix B. Example Exchanges of TCP Encapsulation with TLS 1.3 | |||
| Appendix B. Example Exchanges of TCP Encapsulation with TLS | B.1. Establishing an IKE Session | |||
| 1.3 . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 | B.2. Deleting an IKE Session | |||
| B.1. Establishing an IKE Session . . . . . . . . . . . . . . . 29 | B.3. Re-establishing an IKE Session | |||
| B.2. Deleting an IKE Session . . . . . . . . . . . . . . . . . 30 | B.4. Using MOBIKE between UDP and TCP Encapsulation | |||
| B.3. Re-establishing an IKE Session . . . . . . . . . . . . . 31 | Acknowledgments | |||
| B.4. Using MOBIKE between UDP and TCP Encapsulation . . . . . 32 | Authors' Addresses | |||
| Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . 34 | ||||
| Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 35 | ||||
| 1. Introduction | 1. Introduction | |||
| The Internet Key Exchange Protocol version 2 (IKEv2) [RFC7296] is a | The Internet Key Exchange Protocol version 2 (IKEv2) [RFC7296] is a | |||
| protocol for establishing IPsec Security Associations (SAs), using | protocol for establishing IPsec Security Associations (SAs) using IKE | |||
| IKE messages over UDP for control traffic, and using Encapsulating | messages over UDP for control traffic and using Encapsulating | |||
| Security Payload (ESP) [RFC4303] messages for encrypted data traffic. | Security Payload (ESP) messages [RFC4303] for encrypted data traffic. | |||
| Many network middleboxes that filter traffic on public hotspots block | Many network middleboxes that filter traffic on public hotspots block | |||
| all UDP traffic, including IKE and IPsec, but allow TCP connections | all UDP traffic, including IKE and IPsec, but allow TCP connections | |||
| through because they appear to be web traffic. Devices on these | through because they appear to be web traffic. Devices on these | |||
| networks that need to use IPsec (to access private enterprise | networks that need to use IPsec (to access private enterprise | |||
| networks, to route Voice over IP calls to carrier networks, because | networks, to route Voice over IP calls to carrier networks because of | |||
| of security policies, etc.) are unable to establish IPsec SAs. This | security policies, etc.) are unable to establish IPsec SAs. This | |||
| document defines a method for encapsulating IKE control messages as | document defines a method for encapsulating IKE control messages as | |||
| well as ESP data messages within a TCP connection. Note that AH is | well as ESP data messages within a TCP connection. Note that | |||
| not supported by this specification. | Authentication Header (AH) is not supported by this specification. | |||
| Using TCP as a transport for IPsec packets adds a third option to the | Using TCP as a transport for IPsec packets adds the third option | |||
| list of traditional IPsec transports: | (below) to the list of traditional IPsec transports: | |||
| 1. Direct. Currently, IKE negotiations begin over UDP port 500. If | 1. Direct. Usually, IKE negotiations begin over UDP port 500. If | |||
| no Network Address Translation (NAT) device is detected between | no Network Address Translation (NAT) device is detected between | |||
| the Initiator and the Responder, then subsequent IKE packets are | the Initiator and the Responder, then subsequent IKE packets are | |||
| sent over UDP port 500, and IPsec data packets are sent using | sent over UDP port 500 and IPsec data packets are sent using ESP. | |||
| ESP. | ||||
| 2. UDP Encapsulation [RFC3948]. If a NAT is detected between the | 2. UDP Encapsulation. Described in [RFC3948]. If a NAT is detected | |||
| Initiator and the Responder, then subsequent IKE packets are sent | between the Initiator and the Responder, then subsequent IKE | |||
| over UDP port 4500 with four bytes of zero at the start of the | packets are sent over UDP port 4500 with 4 bytes of zero at the | |||
| UDP payload, and ESP packets are sent out over UDP port 4500. | start of the UDP payload, and ESP packets are sent out over UDP | |||
| Some implementations default to using UDP encapsulation even when | port 4500. Some implementations default to using UDP | |||
| no NAT is detected on the path, as some middleboxes do not | encapsulation even when no NAT is detected on the path, as some | |||
| support IP protocols other than TCP and UDP. | middleboxes do not support IP protocols other than TCP and UDP. | |||
| 3. TCP Encapsulation. If the other two methods are not available or | 3. TCP Encapsulation. Described in this document. If the other two | |||
| appropriate, IKE negotiation packets as well as ESP packets can | methods are not available or appropriate, IKE negotiation packets | |||
| be sent over a single TCP connection to the peer. | as well as ESP packets can be sent over a single TCP connection | |||
| to the peer. | ||||
| Direct use of ESP or UDP encapsulation should be preferred by IKE | Direct use of ESP or UDP encapsulation should be preferred by IKE | |||
| implementations due to performance concerns when using TCP | implementations due to performance concerns when using TCP | |||
| encapsulation (Section 9). Most implementations should use TCP | encapsulation (Section 9). Most implementations should use TCP | |||
| encapsulation only on networks where negotiation over UDP has been | encapsulation only on networks where negotiation over UDP has been | |||
| attempted without receiving responses from the peer or if a network | attempted without receiving responses from the peer or if a network | |||
| is known to not support UDP. | is known to not support UDP. | |||
| 1.1. Prior Work and Motivation | 1.1. Prior Work and Motivation | |||
| skipping to change at page 4, line 26 ¶ | skipping to change at line 163 ¶ | |||
| middleboxes. The specific goals of this document are as follows: | middleboxes. The specific goals of this document are as follows: | |||
| * To promote interoperability by defining a standard method of | * To promote interoperability by defining a standard method of | |||
| framing IKE and ESP messages within TCP streams. | framing IKE and ESP messages within TCP streams. | |||
| * To be compatible with the current IKEv2 standard without requiring | * To be compatible with the current IKEv2 standard without requiring | |||
| modifications or extensions. | modifications or extensions. | |||
| * To use IKE over UDP by default to avoid the overhead of other | * To use IKE over UDP by default to avoid the overhead of other | |||
| alternatives that always rely on TCP or Transport Layer Security | alternatives that always rely on TCP or Transport Layer Security | |||
| (TLS) [RFC5246][RFC8446]. | (TLS) [RFC5246] [RFC8446]. | |||
| Some previous alternatives include: | Some previous alternatives include: | |||
| Cellular Network Access | Cellular Network Access: | |||
| Interworking Wireless LAN (IWLAN) uses IKEv2 to create secure | Interworking Wireless LAN (IWLAN) uses IKEv2 to create secure | |||
| connections to cellular carrier networks for making voice calls | connections to cellular carrier networks for making voice calls | |||
| and accessing other network services over Wi-Fi networks. 3GPP has | and accessing other network services over Wi-Fi networks. 3GPP has | |||
| recommended that IKEv2 and ESP packets be sent within a TLS | recommended that IKEv2 and ESP packets be sent within a TLS | |||
| connection to be able to establish connections on restrictive | connection to be able to establish connections on restrictive | |||
| networks. | networks. | |||
| ISAKMP over TCP | ISAKMP over TCP: | |||
| Various non-standard extensions to the Internet Security | Various non-standard extensions to the Internet Security | |||
| Association and Key Management Protocol (ISAKMP) have been | Association and Key Management Protocol (ISAKMP) have been | |||
| deployed that send IPsec traffic over TCP or TCP-like packets. | deployed that send IPsec traffic over TCP or TCP-like packets. | |||
| Secure Sockets Layer (SSL) VPNs | Secure Sockets Layer (SSL) VPNs: | |||
| Many proprietary VPN solutions use a combination of TLS and IPsec | Many proprietary VPN solutions use a combination of TLS and IPsec | |||
| in order to provide reliability. These often run on TCP port 443. | in order to provide reliability. These often run on TCP port 443. | |||
| IKEv2 over TCP | IKEv2 over TCP: | |||
| IKEv2 over TCP as described in [I-D.ietf-ipsecme-ike-tcp] is used | IKEv2 over TCP as described in [IPSECME-IKE-TCP] is used to avoid | |||
| to avoid UDP fragmentation. | UDP fragmentation. | |||
| TCP encapsulation for IKE and IPsec was defined in [RFC8229]. This | TCP encapsulation for IKE and IPsec was defined in [RFC8229]. This | |||
| document updates the specification for TCP encapsulation by including | document updates the specification for TCP encapsulation by including | |||
| additional clarifications obtained during implementation and | additional clarifications obtained during implementation and | |||
| deployment of this method. | deployment of this method. | |||
| In particular: | In particular: | |||
| * The interpretation of the Length field preceding every message is | * The interpretation of the Length field preceding every message is | |||
| clarified (Section 3) | clarified (Section 3). | |||
| * The use of the NAT_DETECTION_*_IP notifications is clarified | * The use of the NAT_DETECTION_*_IP notifications is clarified | |||
| (Sections 5.1, 6.5, and 7.1) | (Sections 5.1, 6.5, and 7.1). | |||
| * Retransmission behavior is clarified (Section 6.2) | * Retransmission behavior is clarified (Section 6.2). | |||
| * The use of cookies and puzzles is described in more detail | * The use of cookies and puzzles is described in more detail | |||
| (Section 6.3) | (Section 6.3). | |||
| * Error handling is clarified (Section 6.4) | * Error handling is clarified (Section 6.4). | |||
| * Implications of TCP encapsulation on IPsec SA processing are | * Implications of TCP encapsulation on IPsec SA processing are | |||
| expanded (Section 6.8) | expanded (Section 6.8). | |||
| * Section 7 describing interactions with other IKEv2 extensions is | * Section 7 describing interactions with other IKEv2 extensions is | |||
| added | added. | |||
| * The interaction of TCP encapsulation with MOBIKE is clarified | * The interaction of TCP encapsulation with IKEv2 Mobility and | |||
| (Section 7.1) | Multihoming (MOBIKE) is clarified (Section 7.1). | |||
| * The recommendation for TLS encapsulation (Appendix A) now includes | * The recommendation for TLS encapsulation (Appendix A) now includes | |||
| TLS 1.3 | TLS 1.3. | |||
| * Examples of TLS encapsulation are provided using TLS 1.3 | * Examples of TLS encapsulation are provided using TLS 1.3 | |||
| (Appendix B) | (Appendix B). | |||
| * More security considerations are added. | * More security considerations are added. | |||
| 1.2. Terminology and Notation | 1.2. Terminology and Notation | |||
| This document distinguishes between the IKE peer that initiates TCP | This document distinguishes between the IKE peer that initiates TCP | |||
| connections to be used for TCP encapsulation and the roles of | connections to be used for TCP encapsulation and the roles of | |||
| Initiator and Responder for particular IKE messages. During the | Initiator and Responder for particular IKE messages. During the | |||
| course of IKE exchanges, the role of IKE Initiator and Responder may | course of IKE exchanges, the role of IKE Initiator and Responder may | |||
| swap for a given SA (as with IKE SA rekeys), while the Initiator of | swap for a given SA (as with IKE SA rekeys), while the Initiator of | |||
| the TCP connection is still responsible for tearing down the TCP | the TCP connection is still responsible for tearing down the TCP | |||
| connection and re-establishing it if necessary. For this reason, | connection and re-establishing it if necessary. For this reason, | |||
| this document will use the term "TCP Originator" to indicate the IKE | this document will use the term "TCP Originator" to indicate the IKE | |||
| peer that initiates TCP connections. The peer that receives TCP | peer that initiates TCP connections. The peer that receives TCP | |||
| connections will be referred to as the "TCP Responder". If an IKE SA | connections will be referred to as the "TCP Responder". If an IKE SA | |||
| is rekeyed one or more times, the TCP Originator MUST remain the peer | is rekeyed one or more times, the TCP Originator MUST remain the peer | |||
| that originally initiated the first IKE SA. | that originally initiated the first IKE SA. | |||
| The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", | The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", | |||
| "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and | "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and | |||
| "OPTIONAL" in this document are to be interpreted as described in BCP | "OPTIONAL" in this document are to be interpreted as described in | |||
| 14 [RFC2119] [RFC8174] when, and only when, they appear in all | BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all | |||
| capitals, as shown here. | capitals, as shown here. | |||
| 2. Configuration | 2. Configuration | |||
| One of the main reasons to use TCP encapsulation is that UDP traffic | One of the main reasons to use TCP encapsulation is that UDP traffic | |||
| may be entirely blocked on a network. Because of this, support for | may be entirely blocked on a network. Because of this, support for | |||
| TCP encapsulation is not specifically negotiated in the IKE exchange. | TCP encapsulation is not specifically negotiated in the IKE exchange. | |||
| Instead, support for TCP encapsulation must be pre-configured on both | Instead, support for TCP encapsulation must be preconfigured on both | |||
| the TCP Originator and the TCP Responder. | the TCP Originator and the TCP Responder. | |||
| Compliant implementations MUST support TCP encapsulation on TCP port | Compliant implementations MUST support TCP encapsulation on TCP port | |||
| 4500, which is reserved for IPsec NAT traversal. | 4500, which is reserved for IPsec NAT traversal. | |||
| Beyond a flag indicating support for TCP encapsulation, the | Beyond a flag indicating support for TCP encapsulation, the | |||
| configuration for each peer can include the following optional | configuration for each peer can include the following optional | |||
| parameters: | parameters: | |||
| * Alternate TCP ports on which the specific TCP Responder listens | * Alternate TCP ports on which the specific TCP Responder listens | |||
| skipping to change at page 6, line 45 ¶ | skipping to change at line 277 ¶ | |||
| for a detailed discussion. | for a detailed discussion. | |||
| Since TCP encapsulation of IKE and IPsec packets adds overhead and | Since TCP encapsulation of IKE and IPsec packets adds overhead and | |||
| has potential performance trade-offs compared to direct or UDP- | has potential performance trade-offs compared to direct or UDP- | |||
| encapsulated SAs (as described in Section 9), implementations SHOULD | encapsulated SAs (as described in Section 9), implementations SHOULD | |||
| prefer ESP direct or UDP-encapsulated SAs over TCP-encapsulated SAs | prefer ESP direct or UDP-encapsulated SAs over TCP-encapsulated SAs | |||
| when possible. | when possible. | |||
| 3. TCP-Encapsulated Data Formats | 3. TCP-Encapsulated Data Formats | |||
| Like UDP encapsulation, TCP encapsulation uses the first four bytes | Like UDP encapsulation, TCP encapsulation uses the first 4 bytes of a | |||
| of a message to differentiate IKE and ESP messages. TCP | message to differentiate IKE and ESP messages. TCP encapsulation | |||
| encapsulation also adds a 16-bit Length field that precedes every | also adds a 16-bit Length field that precedes every message to define | |||
| message to define the boundaries of messages within a stream. The | the boundaries of messages within a stream. The value in this field | |||
| value in this field is equal to the length of the original message | is equal to the length of the original message plus the length of the | |||
| plus the length of the field itself, in octets. If the first 32 bits | field itself, in octets. If the first 32 bits of the message are | |||
| of the message are zeros (a non-ESP marker), then the contents | zeros (a non-ESP marker), then the contents comprise an IKE message. | |||
| comprise an IKE message. Otherwise, the contents comprise an ESP | Otherwise, the contents comprise an ESP message. AH messages are not | |||
| message. Authentication Header (AH) messages are not supported for | supported for TCP encapsulation. | |||
| TCP encapsulation. | ||||
| Although a TCP stream may be able to send very long messages, | Although a TCP stream may be able to send very long messages, | |||
| implementations SHOULD limit message lengths to match the lengths | implementations SHOULD limit message lengths to match the lengths | |||
| used for UDP encapsulation of ESP messages. The maximum message | used for UDP encapsulation of ESP messages. The maximum message | |||
| length is used as the effective MTU for connections that are being | length is used as the effective MTU for connections that are being | |||
| encrypted using ESP, so the maximum message length will influence | encrypted using ESP, so the maximum message length will influence | |||
| characteristics of these connections, such as the TCP Maximum Segment | characteristics of these connections, such as the TCP Maximum Segment | |||
| Size (MSS). | Size (MSS). | |||
| Due to the fact that the Length field is 16-bit and includes both the | Due to the fact that the Length field is 16 bits and includes both | |||
| message length and the length of the field itself, it is impossible | the message length and the length of the field itself, it is | |||
| to encapsulate messages greater than 65533 octets in length. In most | impossible to encapsulate messages greater than 65533 octets in | |||
| cases, this is not a problem. Note also that a similar limitation | length. In most cases, this is not a problem. Note that a similar | |||
| exists for encapsulation ESP in UDP [RFC3948]. | limitation exists for encapsulation ESP in UDP [RFC3948]. | |||
| The minimum size of an encapsulated message is 1 octet (for NAT- | The minimum size of an encapsulated message is 1 octet (for NAT- | |||
| keepalive packets, see Section 6.6). Empty messages (where the | keepalive packets, see Section 6.6). Empty messages (where the | |||
| Length field equals to 2) MUST be silently ignored by receiver. | Length field equals 2) MUST be silently ignored by receiver. | |||
| Note that this method of encapsulation will also work for placing IKE | Note that this method of encapsulation will also work for placing IKE | |||
| and ESP messages within any protocol that presents a stream | and ESP messages within any protocol that presents a stream | |||
| abstraction, beyond TCP. | abstraction, beyond TCP. | |||
| 3.1. TCP-Encapsulated IKE Message Format | 3.1. TCP-Encapsulated IKE Message Format | |||
| 1 2 3 | 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 | 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 | |||
| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |||
| | Length | | | Length | | |||
| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |||
| | Non-ESP Marker | | | Non-ESP Marker | | |||
| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |||
| | | | | | | |||
| ~ IKE message [RFC7296] ~ | ~ IKE Message (RFC 7296) ~ | |||
| | | | | | | |||
| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |||
| Figure 1: IKE message format for TCP encapsulation | Figure 1: IKE Message Format for TCP Encapsulation | |||
| The IKE message is preceded by a 16-bit Length field in network byte | The IKE message is preceded by a 16-bit Length field in network byte | |||
| order that specifies the length of the IKE message (including the | order that specifies the length of the IKE message (including the | |||
| non-ESP marker) within the TCP stream. As with IKE over UDP port | non-ESP marker) within the TCP stream. As with IKE over UDP port | |||
| 4500, a zeroed 32-bit non-ESP marker is inserted before the start of | 4500, a zeroed 32-bit non-ESP marker is inserted before the start of | |||
| the IKE header in order to differentiate the traffic from ESP traffic | the IKE header in order to differentiate the traffic from ESP traffic | |||
| between the same addresses and ports. | between the same addresses and ports. | |||
| * Length (2 octets, unsigned integer) - Length of the IKE message, | Length (2 octets, unsigned integer): Length of the IKE message, | |||
| including the Length field and non-ESP marker. The value in the | including the Length field and non-ESP marker. The value in the | |||
| Length field MUST NOT be 0 or 1. The receiver MUST treat these | Length field MUST NOT be 0 or 1. The receiver MUST treat these | |||
| values as fatal errors and MUST close the TCP connection. | values as fatal errors and MUST close the TCP connection. | |||
| * Non-ESP Marker (4 octets) - Four zero-valued bytes. | Non-ESP Marker (4 octets): Four zero-valued bytes. | |||
| 3.2. TCP-Encapsulated ESP Packet Format | 3.2. TCP-Encapsulated ESP Packet Format | |||
| 1 2 3 | 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 | 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 | |||
| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |||
| | Length | | | Length | | |||
| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |||
| | | | | | | |||
| ~ ESP packet [RFC4303] ~ | ~ ESP Packet (RFC 4303) ~ | |||
| | | | | | | |||
| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |||
| Figure 2: ESP packet format for TCP encapsulation | Figure 2: ESP Packet Format for TCP Encapsulation | |||
| The ESP packet is preceded by a 16-bit Length field in network byte | The ESP packet is preceded by a 16-bit Length field in network byte | |||
| order that specifies the length of the ESP packet within the TCP | order that specifies the length of the ESP packet within the TCP | |||
| stream. | stream. | |||
| The Security Parameter Index (SPI) field [RFC7296] in the ESP header | The Security Parameter Index (SPI) field [RFC7296] in the ESP header | |||
| MUST NOT be a zero value. | MUST NOT be a zero value. | |||
| * Length (2 octets, unsigned integer) - Length of the ESP packet, | Length (2 octets, unsigned integer): Length of the ESP packet, | |||
| including the Length field. The value in the Length field MUST | including the Length field. The value in the Length field MUST | |||
| NOT be 0 or 1. The receiver MUST treat these values as fatal | NOT be 0 or 1. The receiver MUST treat these values as fatal | |||
| errors and MUST close TCP connection. | errors and MUST close TCP connection. | |||
| 4. TCP-Encapsulated Stream Prefix | 4. TCP-Encapsulated Stream Prefix | |||
| Each stream of bytes used for IKE and IPsec encapsulation MUST begin | Each stream of bytes used for IKE and IPsec encapsulation MUST begin | |||
| with a fixed sequence of six bytes as a magic value, containing the | with a fixed sequence of 6 bytes as a magic value, containing the | |||
| characters "IKETCP" as ASCII values. | characters "IKETCP" as ASCII values. | |||
| 0 1 2 3 4 5 | 0 1 2 3 4 5 | |||
| +------+------+------+------+------+------+ | +------+------+------+------+------+------+ | |||
| | 0x49 | 0x4b | 0x45 | 0x54 | 0x43 | 0x50 | | | 0x49 | 0x4b | 0x45 | 0x54 | 0x43 | 0x50 | | |||
| +------+------+------+------+------+------+ | +------+------+------+------+------+------+ | |||
| Figure 3: TCP-Encapsulated Stream Prefix | Figure 3: TCP-Encapsulated Stream Prefix | |||
| This value is intended to identify and validate that the TCP | This value is intended to identify and validate that the TCP | |||
| skipping to change at page 9, line 47 ¶ | skipping to change at line 420 ¶ | |||
| accept and is allowed to use TCP encapsulation, it MUST listen on the | accept and is allowed to use TCP encapsulation, it MUST listen on the | |||
| configured port(s) in case any peers will initiate new IKE sessions. | configured port(s) in case any peers will initiate new IKE sessions. | |||
| Initiators MAY use TCP encapsulation for any IKE session to a peer | Initiators MAY use TCP encapsulation for any IKE session to a peer | |||
| that is configured to support TCP encapsulation, although it is | that is configured to support TCP encapsulation, although it is | |||
| recommended that Initiators only use TCP encapsulation when traffic | recommended that Initiators only use TCP encapsulation when traffic | |||
| over UDP is blocked. | over UDP is blocked. | |||
| Since the support of TCP encapsulation is a configured property, not | Since the support of TCP encapsulation is a configured property, not | |||
| a negotiated one, it is recommended that if there are multiple IKE | a negotiated one, it is recommended that if there are multiple IKE | |||
| endpoints representing a single peer (such as multiple machines with | endpoints representing a single peer (such as multiple machines with | |||
| different IP addresses when connecting by Fully Qualified Domain | different IP addresses when connecting by Fully Qualified Domain Name | |||
| Name, or endpoints used with IKE redirection), all of the endpoints | (FQDN), or endpoints used with IKE redirection), all of the endpoints | |||
| equally support TCP encapsulation. | equally support TCP encapsulation. | |||
| If TCP encapsulation is being used for a specific IKE SA, all IKE | If TCP encapsulation is being used for a specific IKE SA, all IKE | |||
| messages for that IKE SA and ESP packets for its Child SAs MUST be | messages for that IKE SA and ESP packets for its Child SAs MUST be | |||
| sent over a TCP connection until the SA is deleted or IKEv2 Mobility | sent over a TCP connection until the SA is deleted or IKEv2 Mobility | |||
| and Multihoming (MOBIKE) is used to change the SA endpoints and/or | and Multihoming (MOBIKE) is used to change the SA endpoints and/or | |||
| the encapsulation protocol. See Section 7.1 for more details on | the encapsulation protocol. See Section 7.1 for more details on | |||
| using MOBIKE to transition between encapsulation modes. | using MOBIKE to transition between encapsulation modes. | |||
| 5.1. Recommended Fallback from UDP | 5.1. Recommended Fallback from UDP | |||
| skipping to change at page 11, line 7 ¶ | skipping to change at line 475 ¶ | |||
| MUST wait for the entire stream prefix to be received on the stream | MUST wait for the entire stream prefix to be received on the stream | |||
| before trying to parse out any IKE or ESP messages. The stream | before trying to parse out any IKE or ESP messages. The stream | |||
| prefix is sent only once, and only by the TCP Originator. | prefix is sent only once, and only by the TCP Originator. | |||
| In order to close an IKE session, either the Initiator or Responder | In order to close an IKE session, either the Initiator or Responder | |||
| SHOULD gracefully tear down IKE SAs with DELETE payloads. Once the | SHOULD gracefully tear down IKE SAs with DELETE payloads. Once the | |||
| SA has been deleted, the TCP Originator SHOULD close the TCP | SA has been deleted, the TCP Originator SHOULD close the TCP | |||
| connection if it does not intend to use the connection for another | connection if it does not intend to use the connection for another | |||
| IKE session to the TCP Responder. If the TCP connection is no longer | IKE session to the TCP Responder. If the TCP connection is no longer | |||
| associated with any active IKE SA, the TCP Responder MAY close the | associated with any active IKE SA, the TCP Responder MAY close the | |||
| connection to clean up IKE resources if TCP Originator didn't close | connection to clean up IKE resources if the TCP Originator didn't | |||
| it within some reasonable period of time (e.g., a few seconds). | close it within some reasonable period of time (e.g., a few seconds). | |||
| An unexpected FIN or a TCP Reset on the TCP connection may indicate a | An unexpected FIN or a TCP Reset on the TCP connection may indicate a | |||
| loss of connectivity, an attack, or some other error. If a DELETE | loss of connectivity, an attack, or some other error. If a DELETE | |||
| payload has not been sent, both sides SHOULD maintain the state for | payload has not been sent, both sides SHOULD maintain the state for | |||
| their SAs for the standard lifetime or timeout period. The TCP | their SAs for the standard lifetime or timeout period. The TCP | |||
| Originator is responsible for re-establishing the TCP connection if | Originator is responsible for re-establishing the TCP connection if | |||
| it is torn down for any unexpected reason. Since new TCP connections | it is torn down for any unexpected reason. Since new TCP connections | |||
| may use different IP addresses and/or ports due to NAT mappings or | may use different IP addresses and/or ports due to NAT mappings or | |||
| local address or port allocations changing, the TCP Responder MUST | local address or port allocations changing, the TCP Responder MUST | |||
| allow packets for existing SAs to be received from new source IP | allow packets for existing SAs to be received from new source IP | |||
| addresses and ports. Note that the IPv6 Flow-ID header MUST remain | addresses and ports. Note that the IPv6 Flow-ID header MUST remain | |||
| constant when new TCP connection is created to avoid ECMP load | constant when a new TCP connection is created to avoid ECMP load | |||
| balancing. | balancing. | |||
| A peer MUST discard a partially received message due to a broken | A peer MUST discard a partially received message due to a broken | |||
| connection. | connection. | |||
| Whenever the TCP Originator opens a new TCP connection to be used for | Whenever the TCP Originator opens a new TCP connection to be used for | |||
| an existing IKE SA, it MUST send the stream prefix first, before any | an existing IKE SA, it MUST send the stream prefix first, before any | |||
| IKE or ESP messages. This follows the same behavior as the initial | IKE or ESP messages. This follows the same behavior as the initial | |||
| TCP connection. | TCP connection. | |||
| Multiple IKE SAs MUST NOT share a single TCP connection, unless one | Multiple IKE SAs MUST NOT share a single TCP connection, unless one | |||
| is a rekey of an existing IKE SA, in which case there will | is a rekey of an existing IKE SA, in which case there will | |||
| temporarily be two IKE SAs on the same TCP connection. | temporarily be two IKE SAs on the same TCP connection. | |||
| If a TCP connection is being used to continue an existing IKE/ESP | If a TCP connection is being used to continue an existing IKE/ESP | |||
| session, the TCP Responder can recognize the session using either the | session, the TCP Responder can recognize the session using either the | |||
| IKE SPI from an encapsulated IKE message or the ESP SPI from an | IKE SPI from an encapsulated IKE message or the ESP SPI from an | |||
| encapsulated ESP packet. If the session had been fully established | encapsulated ESP packet. If the session had been fully established | |||
| previously, it is suggested that the TCP Originator send an | previously, it is suggested that the TCP Originator send an | |||
| UPDATE_SA_ADDRESSES message if MOBIKE is supported, or an empty | UPDATE_SA_ADDRESSES message if MOBIKE is supported and an empty | |||
| informational message otherwise. | informational message if it is not. | |||
| The TCP Responder MUST NOT accept any messages for the existing IKE | The TCP Responder MUST NOT accept any messages for the existing IKE | |||
| session on a new incoming connection, unless that connection begins | session on a new incoming connection, unless that connection begins | |||
| with the stream prefix. If either the TCP Originator or TCP | with the stream prefix. If either the TCP Originator or TCP | |||
| Responder detects corruption on a connection that was started with a | Responder detects corruption on a connection that was started with a | |||
| valid stream prefix, it SHOULD close the TCP connection. The | valid stream prefix, it SHOULD close the TCP connection. The | |||
| connection can be determined to be corrupted if there are too many | connection can be corrupted if there are too many subsequent messages | |||
| subsequent messages that cannot be parsed as valid IKE messages or | that cannot be parsed as valid IKE messages or ESP messages with | |||
| ESP messages with known SPIs, or if the authentication check for an | known SPIs, or if the authentication check for an IKE message or ESP | |||
| IKE message or ESP message with a known SPI fails. Implementations | message with a known SPI fails. Implementations SHOULD NOT tear down | |||
| SHOULD NOT tear down a connection if only a few consecutive ESP | a connection if only a few consecutive ESP packets have unknown SPIs | |||
| packets have unknown SPIs, since the SPI databases may be momentarily | since the SPI databases may be momentarily out of sync. If there is | |||
| out of sync. If there is instead a syntax issue within an IKE | instead a syntax issue within an IKE message, an implementation MUST | |||
| message, an implementation MUST send the INVALID_SYNTAX notify | send the INVALID_SYNTAX notify payload and tear down the IKE SA as | |||
| payload and tear down the IKE SA as usual, rather than tearing down | usual, rather than tearing down the TCP connection directly. | |||
| the TCP connection directly. | ||||
| A TCP Originator SHOULD only open one TCP connection per IKE SA, over | A TCP Originator SHOULD only open one TCP connection per IKE SA, over | |||
| which it sends all of the corresponding IKE and ESP messages. This | which it sends all of the corresponding IKE and ESP messages. This | |||
| helps ensure that any firewall or NAT mappings allocated for the TCP | helps ensure that any firewall or NAT mappings allocated for the TCP | |||
| connection apply to all of the traffic associated with the IKE SA | connection apply to all of the traffic associated with the IKE SA | |||
| equally. | equally. | |||
| Similarly, a TCP Responder SHOULD at any given time send packets for | As with TCP Originators, a TCP Responder SHOULD send packets for an | |||
| an IKE SA and its Child SAs over only one TCP connection. It SHOULD | IKE SA and its Child SAs over only one TCP connection at any given | |||
| choose the TCP connection on which it last received a valid and | time. It SHOULD choose the TCP connection on which it last received | |||
| decryptable IKE or ESP message. In order to be considered valid for | a valid and decryptable IKE or ESP message. In order to be | |||
| choosing a TCP connection, an IKE message must be successfully | considered valid for choosing a TCP connection, an IKE message must | |||
| decrypted and authenticated, not be a retransmission of a previously | be successfully decrypted and authenticated, not be a retransmission | |||
| received message, and be within the expected window for IKE message | of a previously received message, and be within the expected window | |||
| IDs. Similarly, an ESP message must pass authentication checks and | for IKE message IDs. Similarly, an ESP message must be successfully | |||
| be decrypted, and must not be a replay of a previous message. | decrypted and authenticated, and must not be a replay of a previous | |||
| message. | ||||
| Since a connection may be broken and a new connection re-established | Since a connection may be broken and a new connection re-established | |||
| by the TCP Originator without the TCP Responder being aware, a TCP | by the TCP Originator without the TCP Responder being aware, a TCP | |||
| Responder SHOULD accept receiving IKE and ESP messages on both old | Responder SHOULD accept receiving IKE and ESP messages on both old | |||
| and new connections until the old connection is closed by the TCP | and new connections until the old connection is closed by the TCP | |||
| Originator. A TCP Responder MAY close a TCP connection that it | Originator. A TCP Responder MAY close a TCP connection that it | |||
| perceives as idle and extraneous (one previously used for IKE and ESP | perceives as idle and extraneous (one previously used for IKE and ESP | |||
| messages that has been replaced by a new connection). | messages that has been replaced by a new connection). | |||
| 6.2. Retransmissions | 6.2. Retransmissions | |||
| Section 2.1 of [RFC7296] describes how IKEv2 deals with the | Section 2.1 of [RFC7296] describes how IKEv2 deals with the | |||
| unreliability of the UDP protocol. In brief, the exchange Initiator | unreliability of the UDP protocol. In brief, the exchange Initiator | |||
| is responsible for retransmissions and must retransmit requests | is responsible for retransmissions and must retransmit request | |||
| message until response message is received. If no reply is received | messages until a response message is received. If no reply is | |||
| after several retransmissions, the SA is deleted. The Responder | received after several retransmissions, the SA is deleted. The | |||
| never initiates retransmission, but must send a response message | Responder never initiates retransmission, but it must send a response | |||
| again in case it receives a retransmitted request. | message again in case it receives a retransmitted request. | |||
| When IKEv2 uses a reliable transport protocol, like TCP, the | When IKEv2 uses a reliable transport protocol, like TCP, the | |||
| retransmission rules are as follows: | retransmission rules are as follows: | |||
| * The exchange Initiator SHOULD NOT retransmit request message (*); | * The exchange Initiator SHOULD NOT retransmit request message (*); | |||
| if no response is received within some reasonable period of time, | if no response is received within some reasonable period of time, | |||
| the IKE SA is deleted. | the IKE SA is deleted. | |||
| * If a new TCP connection for the IKE SA is established while the | * If a new TCP connection for the IKE SA is established while the | |||
| exchange Initiator is waiting for a response, the Initiator MUST | exchange Initiator is waiting for a response, the Initiator MUST | |||
| retransmit its request over this connection and continue to wait | retransmit its request over this connection and continue to wait | |||
| for a response. | for a response. | |||
| * The exchange Responder does not change its behavior, but acts as | * The exchange Responder does not change its behavior, but acts as | |||
| described in Section 2.1 of [RFC7296]. | described in Section 2.1 of [RFC7296]. | |||
| (*) This is an optimization, implementations may continue to use the | (*) This is an optimization; implementations may continue to use the | |||
| retransmission logic from Section 2.1 of [RFC7296] for simplicity. | retransmission logic from Section 2.1 of [RFC7296] for simplicity. | |||
| 6.3. Cookies and Puzzles | 6.3. Cookies and Puzzles | |||
| IKEv2 provides a DoS attack protection mechanism through Cookies, | IKEv2 provides a DoS attack protection mechanism through Cookies, | |||
| which is described in Section 2.6 of [RFC7296]. [RFC8019] extends | which is described in Section 2.6 of [RFC7296]. [RFC8019] extends | |||
| this mechanism for protection against DDoS attacks by means of Client | this mechanism for protection against DDoS attacks by means of Client | |||
| Puzzles. Both mechanisms allow the Responder to avoid keeping state | Puzzles. Both mechanisms allow the Responder to avoid keeping state | |||
| until the Initiator proves its IP address is legitimate (and after | until the Initiator proves its IP address is legitimate (and after | |||
| solving a puzzle if required). | solving a puzzle if required). | |||
| The connection-oriented nature of TCP transport brings additional | The connection-oriented nature of TCP transport brings additional | |||
| considerations for using these mechanisms. In general, Cookies | considerations for using these mechanisms. In general, Cookies | |||
| provide less value in case of TCP encapsulation, since by the time a | provide less value in the case of TCP encapsulation; by the time a | |||
| Responder receives the IKE_SA_INIT request, the TCP session has | Responder receives the IKE_SA_INIT request, the TCP session has | |||
| already been established and the Initiator's IP address has been | already been established and the Initiator's IP address has been | |||
| verified. Moreover, a TCP/IP stack creates state once a TCP SYN | verified. Moreover, a TCP/IP stack creates state once a TCP SYN | |||
| packet is received (unless SYN Cookies described in [RFC4987] are | packet is received (unless SYN Cookies described in [RFC4987] are | |||
| employed), which contradicts the statelessness of IKEv2 Cookies. In | employed), which contradicts the statelessness of IKEv2 Cookies. In | |||
| particular, with TCP, an attacker is able to mount a SYN flooding DoS | particular, with TCP, an attacker is able to mount a SYN flooding DoS | |||
| attack which an IKEv2 Responder cannot prevent using stateless IKEv2 | attack that an IKEv2 Responder cannot prevent using stateless IKEv2 | |||
| Cookies. Thus, when using TCP encapsulation, it makes little sense | Cookies. Thus, when using TCP encapsulation, it makes little sense | |||
| to send Cookie requests without Puzzles unless the Responder is | to send Cookie requests without Puzzles unless the Responder is | |||
| concerned with a possibility of TCP Sequence Number attacks (see | concerned with a possibility of TCP sequence number attacks (see | |||
| [RFC6528] for details). Puzzles, on the other hand, still remain | [RFC6528] and [RFC9293] for details). Puzzles, on the other hand, | |||
| useful (and their use requires using Cookies). | still remain useful (and their use requires using Cookies). | |||
| The following considerations are applicable for using Cookie and | The following considerations are applicable for using Cookie and | |||
| Puzzle mechanisms in case of TCP encapsulation: | Puzzle mechanisms in the case of TCP encapsulation: | |||
| * the exchange Responder SHOULD NOT send an IKEv2 Cookie request | * The exchange Responder SHOULD NOT send an IKEv2 Cookie request | |||
| without an accompanied Puzzle; implementations might choose to | without an accompanied Puzzle; implementations might choose to | |||
| have exceptions to this for cases like mitigating TCP Sequence | have exceptions to this for cases like mitigating TCP sequence | |||
| Number attacks. | number attacks. | |||
| * if the Responder chooses to send a Cookie request (possibly along | * If the Responder chooses to send a Cookie request (possibly along | |||
| with Puzzle request), then the TCP connection that the IKE_SA_INIT | with Puzzle request), then the TCP connection that the IKE_SA_INIT | |||
| request message was received over SHOULD be closed after the | request message was received over SHOULD be closed after the | |||
| Responder sends its reply and no repeated requests are received | Responder sends its reply and no repeated requests are received | |||
| within some short period of time to keep the Responder stateless | within some short period of time to keep the Responder stateless | |||
| (see Section 6.3.1). Note that the Responder MUST NOT include the | (see Section 6.3.1). Note that the Responder MUST NOT include the | |||
| Initiator's TCP port into the Cookie calculation (*), since the | Initiator's TCP port into the Cookie calculation (*) since the | |||
| Cookie can be returned over a new TCP connection with a different | Cookie can be returned over a new TCP connection with a different | |||
| port. | port. | |||
| * the exchange Initiator acts as described in Section 2.6 of | * The exchange Initiator acts as described in Section 2.6 of | |||
| [RFC7296] and Section 7 of [RFC8019], i.e. using TCP encapsulation | [RFC7296] and Section 7 of [RFC8019], i.e., using TCP | |||
| doesn't change the Initiator's behavior. | encapsulation doesn't change the Initiator's behavior. | |||
| (*) Examples of Cookie calculation methods are given in Section 2.6 | (*) Examples of Cookie calculation methods are given in Section 2.6 | |||
| of [RFC7296] and in Section 7.1.1.3 of [RFC8019] and they don't | of [RFC7296] and in Section 7.1.1.3 of [RFC8019], and they don't | |||
| include transport protocol ports. However these examples are given | include transport protocol ports. However, these examples are given | |||
| for illustrative purposes, since Cookie generation algorithm is a | for illustrative purposes since the Cookie generation algorithm is a | |||
| local matter and some implementations might include port numbers, | local matter and some implementations might include port numbers that | |||
| that won't work with TCP encapsulation. Note also that these | won't work with TCP encapsulation. Note also that these examples | |||
| examples include the Initiator's IP address in Cookie calculation. | include the Initiator's IP address in Cookie calculation. In | |||
| In general this address may change between two initial requests (with | general, this address may change between two initial requests (with | |||
| and without Cookies). This may happen due to NATs, since NATs have | and without Cookies). This may happen due to NATs, which have more | |||
| more freedom to change source IP addresses for new TCP connections | freedom to change source IP addresses for new TCP connections than | |||
| than for UDP. In such cases cookie verification might fail. | for UDP. In such cases, cookie verification might fail. | |||
| 6.3.1. Statelessness versus Delay of SA Establishment | 6.3.1. Statelessness versus Delay of SA Establishment | |||
| There is a trade-off in choosing the period of time after which the | There is a trade-off in choosing the period of time after which the | |||
| TCP connection is closed. If it is too short, then the proper | TCP connection is closed. If it is too short, then the proper | |||
| Initiator which repeats its request would need to re-establish the | Initiator that repeats its request would need to re-establish the TCP | |||
| TCP connection introducing additional delay. On the other hand, if | connection, introducing additional delay. On the other hand, if it | |||
| it is too long, then the Responder's resources would be wasted in | is too long, then the Responder's resources would be wasted in case | |||
| case the Initiator never comes back. This document doesn't specify | the Initiator never comes back. This document doesn't mandate the | |||
| the duration of time, because it doesn't affect interoperability, but | duration of time because it doesn't affect interoperability, but it | |||
| it is believed that 5-10 seconds is a good compromise. Note also, | is believed that 5-10 seconds is a good compromise. Also, note that | |||
| that if the Responder requests the Initiator to solve a puzzle, then | if the Responder requests that the Initiator solve a puzzle, then the | |||
| the Responder can estimate how long it would take the Initiator to | Responder can estimate how long it would take the Initiator to find a | |||
| find a solution and adjust the time interval accordingly. | solution and adjust the time interval accordingly. | |||
| 6.4. Error Handling in IKE_SA_INIT | 6.4. Error Handling in IKE_SA_INIT | |||
| Section 2.21.1 of [RFC7296] describes how error notifications are | Section 2.21.1 of [RFC7296] describes how error notifications are | |||
| handled in the IKE_SA_INIT exchange. In particular, it is advised | handled in the IKE_SA_INIT exchange. In particular, it is advised | |||
| that the Initiator should not act immediately after receiving an | that the Initiator should not act immediately after receiving an | |||
| error notification and should instead wait some time for valid | error notification; instead, it should wait some time for a valid | |||
| response, since the IKE_SA_INIT messages are completely | response since the IKE_SA_INIT messages are completely | |||
| unauthenticated. This advice does not apply equally in case of TCP | unauthenticated. This advice does not apply equally in the case of | |||
| encapsulation. If the Initiator receives a response message over | TCP encapsulation. If the Initiator receives a response message over | |||
| TCP, then either this message is genuine and was sent by the peer, or | TCP, then either this message is genuine and was sent by the peer or | |||
| the TCP session was hijacked and the message is forged. In this | the TCP session was hijacked and the message is forged. In the | |||
| latter case, no genuine messages from the Responder will be received. | latter case, no genuine messages from the Responder will be received. | |||
| Thus, in case of TCP encapsulation, an Initiator SHOULD NOT wait for | Thus, in the case of TCP encapsulation, an Initiator SHOULD NOT wait | |||
| additional messages in case it receives an error notification from | for additional messages in case it receives an error notification | |||
| the Responder in the IKE_SA_INIT exchange. | from the Responder in the IKE_SA_INIT exchange. | |||
| If in the IKE_SA_INIT exchange the Responder returns an error | In the IKE_SA_INIT exchange, if the Responder returns an error | |||
| notification that implies a recovery action from the Initiator (such | notification that implies a recovery action from the Initiator (such | |||
| as INVALID_KE_PAYLOAD or INVALID_MAJOR_VERSION, see Section 2.21.1 of | as INVALID_KE_PAYLOAD or INVALID_MAJOR_VERSION, see Section 2.21.1 of | |||
| [RFC7296]) then the Responder SHOULD NOT close the TCP connection | [RFC7296]), then the Responder SHOULD NOT close the TCP connection | |||
| immediately, in anticipation that the Initiator will repeat the | immediately in anticipation of the fact that the Initiator will | |||
| request with corrected parameters. See also Section 6.3. | repeat the request with corrected parameters. See also Section 6.3. | |||
| 6.5. NAT Detection Payloads | 6.5. NAT-Detection Payloads | |||
| When negotiating over UDP, IKE_SA_INIT packets include | When negotiating over UDP, IKE_SA_INIT packets include | |||
| NAT_DETECTION_SOURCE_IP and NAT_DETECTION_DESTINATION_IP payloads to | NAT_DETECTION_SOURCE_IP and NAT_DETECTION_DESTINATION_IP payloads to | |||
| determine if UDP encapsulation of IPsec packets should be used. | determine if UDP encapsulation of IPsec packets should be used. | |||
| These payloads contain SHA-1 digests of the SPIs, IP addresses, and | These payloads contain SHA-1 digests of the SPIs, IP addresses, and | |||
| ports as defined in [RFC7296]. IKE_SA_INIT packets sent on a TCP | ports as defined in [RFC7296]. IKE_SA_INIT packets sent on a TCP | |||
| connection SHOULD include these payloads with the same content as | connection SHOULD include these payloads with the same content as | |||
| when sending over UDP and SHOULD use the applicable TCP ports when | when sending over UDP and SHOULD use the applicable TCP ports when | |||
| creating and checking the SHA-1 digests. | creating and checking the SHA-1 digests. | |||
| If a NAT is detected due to the SHA-1 digests not matching the | If a NAT is detected due to the SHA-1 digests not matching the | |||
| expected values, no change should be made for encapsulation of | expected values, no change should be made for encapsulation of | |||
| subsequent IKE or ESP packets, since TCP encapsulation inherently | subsequent IKE or ESP packets since TCP encapsulation inherently | |||
| supports NAT traversal. However, for the transport mode IPsec SAs, | supports NAT traversal. However, for the transport mode IPsec SAs, | |||
| implementations need to handle TCP and UDP packet checksum fixup | implementations need to handle TCP and UDP packet checksum fixup | |||
| during decapsulation, as defined for UDP encapsulation in [RFC3948]. | during decapsulation, as defined for UDP encapsulation in [RFC3948]. | |||
| Implementations MAY use the information that a NAT is present to | Implementations MAY use the information that a NAT is present to | |||
| influence keepalive timer values. | influence keepalive timer values. | |||
| 6.6. NAT-keepalive Packets | 6.6. NAT-Keepalive Packets | |||
| Encapsulating IKE and IPsec inside of a TCP connection can impact the | Encapsulating IKE and IPsec inside of a TCP connection can impact the | |||
| strategy that implementations use to maintain middlebox port | strategy that implementations use to maintain middlebox port | |||
| mappings. | mappings. | |||
| In general, TCP port mappings are maintained by NATs longer than UDP | In general, TCP port mappings are maintained by NATs longer than UDP | |||
| port mappings, so IPsec ESP NAT-keepalive packets [RFC3948] SHOULD | port mappings, so IPsec ESP NAT-keepalive packets [RFC3948] SHOULD | |||
| NOT be sent when using TCP encapsulation. Any implementation using | NOT be sent when using TCP encapsulation. Any implementation using | |||
| TCP encapsulation MUST silently drop incoming NAT-keepalive packets | TCP encapsulation MUST silently drop incoming NAT-keepalive packets | |||
| and not treat them as errors. NAT-keepalive packets over a TCP- | and not treat them as errors. NAT-keepalive packets over a TCP- | |||
| encapsulated IPsec connection will be sent as a one-octet-long | encapsulated IPsec connection will be sent as a 1-octet-long payload | |||
| payload with the value 0xFF, preceded by the two byte Length | with the value 0xFF, preceded by the 2-octet Length specifying a | |||
| specifying a length of 3 (since it includes the length of the Length | length of 3 (since it includes the length of the Length field). | |||
| field). | ||||
| 6.7. Dead Peer Detection and Transport Keepalives | 6.7. Dead Peer Detection and Transport Keepalives | |||
| Peer liveness should be checked using IKE informational packets | Peer liveness should be checked using IKE informational packets | |||
| [RFC7296]. | [RFC7296]. | |||
| Note that, depending on the configuration of TCP and TLS on the | Note that, depending on the configuration of TCP and TLS on the | |||
| connection, TCP keep-alives [RFC1122] and TLS keep-alives [RFC6520] | connection, TCP keep-alives [RFC1122] and TLS keep-alives [RFC6520] | |||
| MAY be used. These MUST NOT be used as indications of IKE peer | MAY be used. These MUST NOT be used as indications of IKE peer | |||
| liveness, for which purpose the standard IKEv2 mechanism of | liveness, for which purpose the standard IKEv2 mechanism of | |||
| exchanging (usually empty) INFORMATIONAL messages is used (see | exchanging (usually empty) INFORMATIONAL messages is used (see | |||
| Section 1.4 of [RFC7296]). | Section 1.4 of [RFC7296]). | |||
| 6.8. Implications of TCP Encapsulation on IPsec SA Processing | 6.8. Implications of TCP Encapsulation on IPsec SA Processing | |||
| Using TCP encapsulation affects some aspects of IPsec SA processing. | Using TCP encapsulation affects some aspects of IPsec SA processing. | |||
| 1. Section 8.1 of [RFC4301] requires all tunnel mode IPsec SAs to be | 1. Section 8.1 of [RFC4301] requires all tunnel mode IPsec SAs to be | |||
| able to copy the Don't Fragment (DF) bit from inner IPv4 header | able to copy the Don't Fragment (DF) bit from inner IPv4 header | |||
| to the outer (tunnel) one. With TCP encapsulation this is | to the outer (tunnel) one. With TCP encapsulation, this is | |||
| generally not possible, because the TCP/IP stack manages the DF | generally not possible because the TCP/IP stack manages the DF | |||
| bit in the outer IPv4 header, and usually the stack ensures that | bit in the outer IPv4 header, and usually the stack ensures that | |||
| the DF bit is set for TCP packets to avoid IP fragmentation. | the DF bit is set for TCP packets to avoid IP fragmentation. | |||
| Note, that this behavior is compliant with generic tunneling | Note, that this behavior is compliant with generic tunneling | |||
| considerations, since the outer TCP header acts as a link-layer | considerations since the outer TCP header acts as a link-layer | |||
| protocol and its fragmentation and reassembly have no correlation | protocol and its fragmentation and reassembly have no correlation | |||
| with the inner payload. | with the inner payload. | |||
| 2. The other feature that is less applicable with TCP encapsulation | 2. The other feature that is less applicable with TCP encapsulation | |||
| is an ability to split traffic of different QoS classes into | is an ability to split traffic of different QoS classes into | |||
| different IPsec SAs, created by a single IKE SA. In this case | different IPsec SAs, created by a single IKE SA. In this case, | |||
| the Differentiated Services Code Point (DSCP) field is usually | the Differentiated Services Code Point (DSCP) field is usually | |||
| copied from the inner IP header to the outer (tunnel) one, | copied from the inner IP header to the outer (tunnel) one, | |||
| ensuring that IPsec traffic of each SA receives the corresponding | ensuring that IPsec traffic of each SA receives the corresponding | |||
| level of service. With TCP encapsulation all IPsec SAs created | level of service. With TCP encapsulation, all IPsec SAs created | |||
| by a single IKE SA will share a single TCP connection and thus | by a single IKE SA will share a single TCP connection; thus, they | |||
| will receive the same level of service (see Section 9.3). If | will receive the same level of service (see Section 9.3). If | |||
| this functionality is needed, implementations should create | this functionality is needed, implementations should create | |||
| several IKE SAs each over separate TCP connection and assign a | several IKE SAs each over separate TCP connections and assign a | |||
| corresponding DSCP value to each of them. | corresponding DSCP value to each of them. | |||
| TCP encapsulation of IPsec packets may have implications on | TCP encapsulation of IPsec packets may have implications on | |||
| performance of the encapsulated traffic. Performance considerations | performance of the encapsulated traffic. Performance considerations | |||
| are discussed in Section 9. | are discussed in Section 9. | |||
| 7. Interaction with IKEv2 Extensions | 7. Interaction with IKEv2 Extensions | |||
| 7.1. MOBIKE Protocol | 7.1. MOBIKE Protocol | |||
| The MOBIKE protocol, which allows SAs to migrate between IP | The MOBIKE protocol, which allows SAs to migrate between IP | |||
| addresses, is defined in [RFC4555], and [RFC4621] further clarifies | addresses, is defined in [RFC4555]; [RFC4621] further clarifies the | |||
| the details of the protocol. When an IKE session that has negotiated | details of the protocol. When an IKE session that has negotiated | |||
| MOBIKE is transitioning between networks, the Initiator of the | MOBIKE is transitioning between networks, the Initiator of the | |||
| transition may switch between using TCP encapsulation, UDP | transition may switch between using TCP encapsulation, UDP | |||
| encapsulation, or no encapsulation. Implementations that implement | encapsulation, or no encapsulation. Implementations that implement | |||
| both MOBIKE and TCP encapsulation within the same connection | both MOBIKE and TCP encapsulation within the same connection | |||
| configuration MUST support dynamically enabling and disabling TCP | configuration MUST support dynamically enabling and disabling TCP | |||
| encapsulation as interfaces change. | encapsulation as interfaces change. | |||
| When a MOBIKE-enabled Initiator changes networks, the INFORMATIONAL | When a MOBIKE-enabled Initiator changes networks, the INFORMATIONAL | |||
| exchange with the UPDATE_SA_ADDRESSES notification SHOULD be | exchange with the UPDATE_SA_ADDRESSES notification SHOULD be | |||
| initiated first over UDP before attempting over TCP. If there is a | initiated first over UDP before attempting over TCP. If there is a | |||
| skipping to change at page 18, line 11 ¶ | skipping to change at line 810 ¶ | |||
| new INFORMATIONAL exchange with the UPDATE_SA_ADDRESSES notify is | new INFORMATIONAL exchange with the UPDATE_SA_ADDRESSES notify is | |||
| initiated in case the address (or transport) is changed while waiting | initiated in case the address (or transport) is changed while waiting | |||
| for a response. | for a response. | |||
| Section 3.5 of [RFC4555] also states that once an IKE SA is switched | Section 3.5 of [RFC4555] also states that once an IKE SA is switched | |||
| to a new IP address, all outstanding requests in this SA are | to a new IP address, all outstanding requests in this SA are | |||
| immediately retransmitted using this address. See also Section 6.2. | immediately retransmitted using this address. See also Section 6.2. | |||
| The MOBIKE protocol defines the NO_NATS_ALLOWED notification that can | The MOBIKE protocol defines the NO_NATS_ALLOWED notification that can | |||
| be used to detect the presence of NAT between peer and to refuse to | be used to detect the presence of NAT between peer and to refuse to | |||
| communicate in this situation. In case of TCP the NO_NATS_ALLOWED | communicate in this situation. In the case of TCP, the | |||
| notification SHOULD be ignored because TCP generally has no problems | NO_NATS_ALLOWED notification SHOULD be ignored because TCP generally | |||
| with NAT boxes. | has no problems with NAT boxes. | |||
| Section 3.7 of [RFC4555] describes an additional optional step in the | Section 3.7 of [RFC4555] describes an additional optional step in the | |||
| process of changing IP addresses called Return Routability Check. It | process of changing IP addresses called "Return Routability Check". | |||
| is performed by Responders in order to be sure that the new | It is performed by Responders in order to be sure that the new | |||
| initiator's address is in fact routable. In case of TCP | Initiator's address is, in fact, routable. In the case of TCP | |||
| encapsulation this check has little value, since TCP handshake proves | encapsulation, this check has little value since a TCP handshake | |||
| routability of the TCP Originator's address. So, in case of TCP | proves the routability of the TCP Originator's address; thus, the | |||
| encapsulation the Return Routability Check SHOULD NOT be performed. | Return Routability Check SHOULD NOT be performed. | |||
| 7.2. IKE Redirect | 7.2. IKE Redirect | |||
| A redirect mechanism for IKEv2 is defined in [RFC5685]. This | A redirect mechanism for IKEv2 is defined in [RFC5685]. This | |||
| mechanism allows security gateways to redirect clients to another | mechanism allows security gateways to redirect clients to another | |||
| gateway either during IKE SA establishment or after session setup. | gateway either during IKE SA establishment or after session setup. | |||
| If a client is connecting to a security gateway using TCP and then is | If a client is connecting to a security gateway using TCP and then is | |||
| redirected to another security gateway, the client needs to reset its | redirected to another security gateway, the client needs to reset its | |||
| transport selection. In other words, the client MUST again try first | transport selection. In other words, with the next security gateway, | |||
| UDP and then fall back to TCP while establishing a new IKE SA, | the client MUST first try UDP and then fall back to TCP while | |||
| regardless of the transport of the SA the redirect notification was | establishing a new IKE SA, regardless of the transport of the SA the | |||
| received over (unless the client's configuration instructs it to | redirect notification was received over (unless the client's | |||
| instantly use TCP for the gateway it is redirected to). | configuration instructs it to instantly use TCP for the gateway it is | |||
| redirected to). | ||||
| 7.3. IKEv2 Session Resumption | 7.3. IKEv2 Session Resumption | |||
| Session resumption for IKEv2 is defined in [RFC5723]. Once an IKE SA | Session resumption for IKEv2 is defined in [RFC5723]. Once an IKE SA | |||
| is established, the server creates a resumption ticket where | is established, the server creates a resumption ticket where | |||
| information about this SA is stored, and transfers this ticket to the | information about this SA is stored and transfers this ticket to the | |||
| client. The ticket may be later used to resume the IKE SA after it | client. The ticket may be later used to resume the IKE SA after it | |||
| is deleted. In the event of resumption the client presents the | is deleted. In the event of resumption, the client presents the | |||
| ticket in a new exchange, called IKE_SESSION_RESUME. Some parameters | ticket in a new exchange, called IKE_SESSION_RESUME. Some parameters | |||
| in the new SA are retrieved from the ticket and others are re- | in the new SA are retrieved from the ticket and others are | |||
| negotiated (more details are given in Section 5 of [RFC5723]). | renegotiated (more details are given in Section 5 of [RFC5723]). | |||
| Since network conditions may change while the client is inactive, the | Since network conditions may change while the client is inactive, the | |||
| fact that TCP encapsulation was used in an old SA SHOULD NOT affect | fact that TCP encapsulation was used in an old SA SHOULD NOT affect | |||
| which transport is used during session resumption. In other words, | which transport is used during session resumption. In other words, | |||
| the transport should be selected as if the IKE SA is being created | the transport should be selected as if the IKE SA is being created | |||
| from scratch. | from scratch. | |||
| 7.4. IKEv2 Protocol Support for High Availability | 7.4. IKEv2 Protocol Support for High Availability | |||
| [RFC6311] defines a support for High Availability in IKEv2. In case | [RFC6311] defines a support for High Availability in IKEv2. In case | |||
| skipping to change at page 19, line 22 ¶ | skipping to change at line 870 ¶ | |||
| time of failover. | time of failover. | |||
| Synchronizing states when using TCP encapsulation is much harder than | Synchronizing states when using TCP encapsulation is much harder than | |||
| when using UDP; doing so requires access to TCP/IP stack internals, | when using UDP; doing so requires access to TCP/IP stack internals, | |||
| which is not always available from an IKE/IPsec implementation. If a | which is not always available from an IKE/IPsec implementation. If a | |||
| cluster implementation doesn't synchronize TCP states between nodes, | cluster implementation doesn't synchronize TCP states between nodes, | |||
| then after failover event the new active node will not have any TCP | then after failover event the new active node will not have any TCP | |||
| connection with the client, so the node cannot initiate the | connection with the client, so the node cannot initiate the | |||
| INFORMATIONAL exchange as required by [RFC6311]. Since the cluster | INFORMATIONAL exchange as required by [RFC6311]. Since the cluster | |||
| usually acts as TCP Responder, the new active node cannot re- | usually acts as TCP Responder, the new active node cannot re- | |||
| establish TCP connection, since only the TCP Originator can do it. | establish TCP connection because only the TCP Originator can do it. | |||
| For the client, the cluster failover event may remain undetected for | For the client, the cluster failover event may remain undetected for | |||
| long time if it has no IKE or ESP traffic to send. Once the client | long time if it has no IKE or ESP traffic to send. Once the client | |||
| sends an ESP or IKEv2 packet, the cluster node will reply with TCP | sends an ESP or IKEv2 packet, the cluster node will reply with TCP | |||
| RST and the client (as TCP Originator) will reestablish the TCP | RST and the client (as TCP Originator) will reestablish the TCP | |||
| connection so that the node will be able to initiate the | connection so that the node will be able to initiate the | |||
| INFORMATIONAL exchange informing the client about the cluster | INFORMATIONAL exchange informing the client about the cluster | |||
| failover. | failover. | |||
| This document makes the following recommendation: if support for High | This document makes the following recommendation: if support for High | |||
| Availability in IKEv2 is negotiated and TCP transport is used, a | Availability in IKEv2 is negotiated and TCP transport is used, a | |||
| client that is a TCP Originator SHOULD periodically send IKEv2 | client that is a TCP Originator SHOULD periodically send IKEv2 | |||
| messages (e.g. by initiating liveness check exchange) whenever there | messages (e.g., by initiating liveness check exchange) whenever there | |||
| is no IKEv2 or ESP traffic. This differs from the recommendations | is no IKEv2 or ESP traffic. This differs from the recommendations | |||
| given in Section 2.4 of [RFC7296] in the following: the liveness | given in Section 2.4 of [RFC7296] in the following: the liveness | |||
| check should be periodically performed even if the client has nothing | check should be periodically performed even if the client has nothing | |||
| to send over ESP. The frequency of sending such messages should be | to send over ESP. The frequency of sending such messages should be | |||
| high enough to allow quick detection and restoring of broken TCP | high enough to allow quick detection and restoration of broken TCP | |||
| connections. | connections. | |||
| 7.5. IKEv2 Fragmentation | 7.5. IKEv2 Fragmentation | |||
| IKE message fragmentation [RFC7383] is not required when using TCP | IKE message fragmentation [RFC7383] is not required when using TCP | |||
| encapsulation, since a TCP stream already handles the fragmentation | encapsulation since a TCP stream already handles the fragmentation of | |||
| of its contents across packets. Since fragmentation is redundant in | its contents across packets. Since fragmentation is redundant in | |||
| this case, implementations might choose to not negotiate IKE | this case, implementations might choose to not negotiate IKE | |||
| fragmentation. Even if fragmentation is negotiated, an | fragmentation. Even if fragmentation is negotiated, an | |||
| implementation SHOULD NOT send fragments when going over a TCP | implementation SHOULD NOT send fragments when going over a TCP | |||
| connection, although it MUST support receiving fragments. | connection, although it MUST support receiving fragments. | |||
| If an implementation supports both MOBIKE and IKE fragmentation, it | If an implementation supports both MOBIKE and IKE fragmentation, it | |||
| SHOULD negotiate IKE fragmentation over a TCP-encapsulated session in | SHOULD negotiate IKE fragmentation over a TCP-encapsulated session in | |||
| case the session switches to UDP encapsulation on another network. | case the session switches to UDP encapsulation on another network. | |||
| 8. Middlebox Considerations | 8. Middlebox Considerations | |||
| skipping to change at page 20, line 28 ¶ | skipping to change at line 923 ¶ | |||
| encapsulated traffic as opposed to UDP-encapsulated traffic, some may | encapsulated traffic as opposed to UDP-encapsulated traffic, some may | |||
| still block or interfere with TCP-encapsulated IKE and IPsec traffic. | still block or interfere with TCP-encapsulated IKE and IPsec traffic. | |||
| A network device that monitors the transport layer will track the | A network device that monitors the transport layer will track the | |||
| state of TCP sessions, such as TCP sequence numbers. If the IKE | state of TCP sessions, such as TCP sequence numbers. If the IKE | |||
| implementation has its own minimal implementation of TCP, it SHOULD | implementation has its own minimal implementation of TCP, it SHOULD | |||
| still use common TCP behaviors to avoid being dropped by middleboxes. | still use common TCP behaviors to avoid being dropped by middleboxes. | |||
| Operators that intentionally block IPsec because of security | Operators that intentionally block IPsec because of security | |||
| implications might want to also block TCP port 4500 or use other | implications might want to also block TCP port 4500 or use other | |||
| methods to reject TCP encapsulated IPsec traffic (e.g. filter out TCP | methods to reject TCP encapsulated IPsec traffic (e.g., filter out | |||
| connections that begin with the "IKETCP" stream prefix). | TCP connections that begin with the "IKETCP" stream prefix). | |||
| 9. Performance Considerations | 9. Performance Considerations | |||
| Several aspects of TCP encapsulation for IKE and IPsec packets may | Several aspects of TCP encapsulation for IKE and IPsec packets may | |||
| negatively impact the performance of connections within a tunnel-mode | negatively impact the performance of connections within a tunnel-mode | |||
| IPsec SA. Implementations should be aware of these performance | IPsec SA. Implementations should be aware of these performance | |||
| impacts and take these into consideration when determining when to | impacts and take these into consideration when determining when to | |||
| use TCP encapsulation. Implementations MUST favor using direct ESP | use TCP encapsulation. Implementations MUST favor using direct ESP | |||
| or UDP encapsulation over TCP encapsulation whenever possible. | or UDP encapsulation over TCP encapsulation whenever possible. | |||
| 9.1. TCP-in-TCP | 9.1. TCP-in-TCP | |||
| If the outer connection between IKE peers is over TCP, inner TCP | If the outer connection between IKE peers is over TCP, inner TCP | |||
| connections may suffer negative effects from using TCP within TCP. | connections may suffer negative effects from using TCP within TCP. | |||
| Running TCP within TCP is discouraged, since the TCP algorithms | Running TCP within TCP is discouraged since the TCP algorithms | |||
| generally assume that they are running over an unreliable datagram | generally assume that they are running over an unreliable datagram | |||
| layer. | layer. | |||
| If the outer (tunnel) TCP connection experiences packet loss, this | If the outer (tunnel) TCP connection experiences packet loss, this | |||
| loss will be hidden from any inner TCP connections, since the outer | loss will be hidden from any inner TCP connections since the outer | |||
| connection will retransmit to account for the losses. Since the | connection will retransmit to account for the losses. Since the | |||
| outer TCP connection will deliver the inner messages in order, any | outer TCP connection will deliver the inner messages in order, any | |||
| messages after a lost packet may have to wait until the loss is | messages after a lost packet may have to wait until the loss is | |||
| recovered. This means that loss on the outer connection will be | recovered. This means that loss on the outer connection will be | |||
| interpreted only as delay by inner connections. The burstiness of | interpreted only as delay by inner connections. The burstiness of | |||
| inner traffic can increase, since a large number of inner packets may | inner traffic can increase since a large number of inner packets may | |||
| be delivered across the tunnel at once. The inner TCP connection may | be delivered across the tunnel at once. The inner TCP connection may | |||
| interpret a long period of delay as a transmission problem, | interpret a long period of delay as a transmission problem, | |||
| triggering a retransmission timeout, which will cause spurious | triggering a retransmission timeout, which will cause spurious | |||
| retransmissions. The sending rate of the inner connection may be | retransmissions. The sending rate of the inner connection may be | |||
| unnecessarily reduced if the retransmissions are not detected as | unnecessarily reduced if the retransmissions are not detected as | |||
| spurious in time. | spurious in time. | |||
| The inner TCP connection's round-trip-time estimation will be | The inner TCP connection's round-trip-time estimation will be | |||
| affected by the burstiness of the outer TCP connection if there are | affected by the burstiness of the outer TCP connection if there are | |||
| long delays when packets are retransmitted by the outer TCP | long delays when packets are retransmitted by the outer TCP | |||
| connection. This will make the congestion control loop of the inner | connection. This will make the congestion control loop of the inner | |||
| TCP traffic less reactive, potentially permanently leading to a lower | TCP traffic less reactive, potentially permanently leading to a lower | |||
| sending rate than the outer TCP would allow for. | sending rate than the outer TCP would allow for. | |||
| TCP-in-TCP can also lead to "TCP meltdown", where stacked instances | TCP-in-TCP can also lead to "TCP meltdown", where stacked instances | |||
| of TCP can result in significant impacts to performance | of TCP can result in significant impacts to performance | |||
| [TCP-MELTDOWN]. This can occur when losses in the lower TCP (closer | [TCP-MELTDOWN]. This can occur when losses in the lower TCP (closer | |||
| to the link) increase delays seen by the higher TCP (closer to the | to the link) increase delays seen by the higher TCP (closer to the | |||
| application) that create timeouts, which in turn cause | application) that create timeouts, which, in turn, cause | |||
| retransmissions that can then cause losses in the lower TCP by | retransmissions that can then cause losses in the lower TCP by | |||
| overrunning its buffer. The very mechanism intended to avoid loss | overrunning its buffer. The very mechanism intended to avoid loss | |||
| (retransmission) interacts between the two layers to increase loss. | (retransmission) interacts between the two layers to increase loss. | |||
| To limit this effect, the timeouts of the two TCP layers need to be | To limit this effect, the timeouts of the two TCP layers need to be | |||
| carefully managed, e.g., such that the higher layer has a much longer | carefully managed, e.g., such that the higher layer has a much longer | |||
| timeout than the lower layer. | timeout than the lower layer. | |||
| Note that any negative effects will be shared among all flows going | Note that any negative effects will be shared among all flows going | |||
| through the outer TCP connection. This is of particular concern for | through the outer TCP connection. This is of particular concern for | |||
| any latency-sensitive or real-time applications using the tunnel. If | any latency-sensitive or real-time applications using the tunnel. If | |||
| skipping to change at page 22, line 10 ¶ | skipping to change at line 998 ¶ | |||
| Some application-level protocols that prefer packet loss to delay | Some application-level protocols that prefer packet loss to delay | |||
| (such as Voice over IP or other real-time protocols) may be | (such as Voice over IP or other real-time protocols) may be | |||
| negatively impacted if their packets are retransmitted by the TCP | negatively impacted if their packets are retransmitted by the TCP | |||
| connection due to packet loss. | connection due to packet loss. | |||
| 9.3. Quality-of-Service Markings | 9.3. Quality-of-Service Markings | |||
| Quality-of-Service (QoS) markings, such as the Differentiated | Quality-of-Service (QoS) markings, such as the Differentiated | |||
| Services Code Point (DSCP) and Traffic Class, should be used with | Services Code Point (DSCP) and Traffic Class, should be used with | |||
| care on TCP connections used for encapsulation. Individual packets | care on TCP connections used for encapsulation. Individual packets | |||
| SHOULD NOT use different markings than the rest of the connection, | SHOULD NOT use different markings than the rest of the connection | |||
| since packets with different priorities may be routed differently and | since packets with different priorities may be routed differently and | |||
| cause unnecessary delays in the connection. | cause unnecessary delays in the connection. | |||
| 9.4. Maximum Segment Size | 9.4. Maximum Segment Size | |||
| A TCP connection used for IKE encapsulation SHOULD negotiate its MSS | A TCP connection used for IKE encapsulation SHOULD negotiate its MSS | |||
| in order to avoid unnecessary fragmentation of packets. | in order to avoid unnecessary fragmentation of packets. | |||
| 9.5. Tunneling ECN in TCP | 9.5. Tunneling ECN in TCP | |||
| Since there is not a one-to-one relationship between outer IP packets | Since there is not a one-to-one relationship between outer IP packets | |||
| and inner ESP/IP messages when using TCP encapsulation, the markings | and inner ESP/IP messages when using TCP encapsulation, the markings | |||
| for Explicit Congestion Notification (ECN) [RFC3168] cannot be simply | for Explicit Congestion Notification (ECN) [RFC3168] cannot easily be | |||
| mapped. However, any ECN Congestion Experienced (CE) marking on | mapped. However, any ECN Congestion Experienced (CE) marking on | |||
| inner headers should be preserved through the tunnel. | inner headers should be preserved through the tunnel. | |||
| Implementations SHOULD follow the ECN compatibility mode for tunnel | Implementations SHOULD follow the ECN compatibility mode for tunnel | |||
| ingress as described in [RFC6040]. In compatibility mode, the outer | ingress as described in [RFC6040]. In compatibility mode, the outer | |||
| tunnel TCP connection marks its packet headers as not ECN-capable. | tunnel TCP connection marks its packet headers as not ECN-capable. | |||
| If upon egress, the arriving outer header is marked with CE, the | Upon egress, if the arriving outer header is marked with CE, the | |||
| implementation will drop the inner packet, since there is not a | implementation will drop the inner packet since there is not a | |||
| distinct inner packet header onto which to translate the ECN | distinct inner packet header onto which to translate the ECN | |||
| markings. | markings. | |||
| 10. Security Considerations | 10. Security Considerations | |||
| IKE Responders that support TCP encapsulation may become vulnerable | IKE Responders that support TCP encapsulation may become vulnerable | |||
| to new Denial-of-Service (DoS) attacks that are specific to TCP, such | to new Denial-of-Service (DoS) attacks that are specific to TCP, such | |||
| as SYN-flooding attacks. TCP Responders should be aware of this | as SYN-flooding attacks. TCP Responders should be aware of this | |||
| additional attack surface. | additional attack surface. | |||
| TCP connections are also susceptible to RST and other spoofing | TCP connections are also susceptible to RST and other spoofing | |||
| attacks [RFC4953]. This specification makes IPsec tolerant of sudden | attacks [RFC4953]. This specification makes IPsec tolerant of sudden | |||
| TCP connection drops, but if an attacker is able to tear down TCP | TCP connection drops, but if an attacker is able to tear down TCP | |||
| connections, IPsec connection's performance can suffer, effectively | connections, IPsec connection's performance can suffer, effectively | |||
| making this a DoS attack. | making this a DoS attack. | |||
| TCP data injection attacks have no effect on application data since | TCP data injection attacks have no effect on application data since | |||
| IPsec provides data integrity. However, they can have some effect, | IPsec provides data integrity. However, they can have some effect, | |||
| mostly by creating DoS attacks: | mostly by creating DoS attacks: | |||
| * if an attacker alters the content of the Length field that | * If an attacker alters the content of the Length field that | |||
| separates packets, then the receiver will incorrectly identify the | separates packets, then the Receiver will incorrectly identify the | |||
| boundaries of the following packets and will drop all of them or | boundaries of the following packets and will drop all of them or | |||
| even tear down the TCP connection if the content of the Length | even tear down the TCP connection if the content of the Length | |||
| field happens to be 0 or 1 (see Section 3) | field happens to be 0 or 1 (see Section 3). | |||
| * if the content of an IKE message is altered, then it will be | * If the content of an IKE message is altered, then it will be | |||
| dropped by the receiver; if the dropped message is the IKE request | dropped by the receiver; if the dropped message is the IKE request | |||
| message, then the initiator will tear down the IKE SA after some | message, then the Initiator will tear down the IKE SA after some | |||
| timeout, since in most cases the request message will not be | timeout since, in most cases, the request message will not be | |||
| retransmitted (as advised in Section 6.2) and thus the response | retransmitted (as advised in Section 6.2); thus, the response will | |||
| will never be received | never be received. | |||
| * if an attacker alters the non-ESP marker then IKE packets will be | * If an attacker alters the non-ESP marker, then IKE packets will be | |||
| dispatched to ESP and sometimes visa versa, those packets will be | dispatched to ESP (and sometimes visa versa) and those packets | |||
| dropped | will be dropped. | |||
| * if an attacker modifies TCP-Encapsulated stream prefix or | * If an attacker modifies TCP-Encapsulated stream prefix or | |||
| unencrypted IKE messages before IKE SA is established, then in | unencrypted IKE messages before IKE SA is established, then in | |||
| most cases this will result in failure to establish IKE SA, often | most cases this will result in failure to establish IKE SA, often | |||
| with false "authentication failed" diagnostics | with false "authentication failed" diagnostics. | |||
| [RFC5961] discusses how TCP injection attacks can be mitigated. | [RFC5961] discusses how TCP injection attacks can be mitigated. | |||
| Note that data injection attacks are also possible on IP level (e.g. | Note that data injection attacks are also possible on IP level (e.g., | |||
| when IP fragmentation is used), resulting in DoS attacks even if TCP | when IP fragmentation is used), resulting in DoS attacks even if TCP | |||
| encapsulation is not used. On the other hand, TCP injection attacks | encapsulation is not used. On the other hand, TCP injection attacks | |||
| are easier to mount than the IP fragmentation injection attacks, | are easier to mount than the IP fragmentation injection attacks | |||
| because TCP keeps a long receive window open that's a sitting target | because TCP keeps a long receive window open that's a sitting target | |||
| for such attacks. | for such attacks. | |||
| If an attacker successfully mounts an injection attack on a TCP | If an attacker successfully mounts an injection attack on a TCP | |||
| connection used for encapsulating IPsec traffic and modifies a Length | connection used for encapsulating IPsec traffic and modifies a Length | |||
| field, the receiver might not be able to correctly identify the | field, the receiver might not be able to correctly identify the | |||
| boundaries of the following packets in the stream since it will try | boundaries of the following packets in the stream since it will try | |||
| to parse arbitrary data as an ESP or IKE header. After such a | to parse arbitrary data as an ESP or IKE header. After such a | |||
| parsing failure, all following packets will be dropped. | parsing failure, all following packets will be dropped. | |||
| Communication will eventually recover, but this might take several | Communication will eventually recover, but this might take several | |||
| minutes and can result in IKE SA deletion and re-creation. | minutes and can result in IKE SA deletion and re-creation. | |||
| To speed up the recovery from such attacks, implementations are | To speed up the recovery from such attacks, implementations are | |||
| advised to follow recommendations in Section 6.1 and close the TCP | advised to follow recommendations in Section 6.1 and close the TCP | |||
| connection if incoming packets contain SPIs that don't match any | connection if incoming packets contain SPIs that don't match any | |||
| known SAs. Once the TCP connection is closed it will be re-created | known SAs. Once the TCP connection is closed, it will be re-created | |||
| by the TCP Originator as described in Section 6.1. | by the TCP Originator as described in Section 6.1. | |||
| To avoid performance degradation caused by closing and re-creating | To avoid performance degradation caused by closing and re-creating | |||
| TCP connection, implementations MAY alternatively try to re-sync | TCP connections, implementations MAY alternatively try to resync | |||
| after they receive unknown SPIs by searching the TCP stream for a | after they receive unknown SPIs by searching the TCP stream for a | |||
| 64-bit binary vector consisting of a known SPI in the first 32 bits | 64-bit binary vector consisting of a known SPI in the first 32 bits | |||
| and a valid Sequence Number for this SPI in the second 32 bits, and | and a valid Sequence Number for this SPI in the second 32 bits. | |||
| then validate the ICV of this packet candidate by taking the | Then, they can validate the Integrity Check Value (ICV) of this | |||
| preceding 16 bits as the Length field. They can also search for 4 | packet candidate by taking the preceding 16 bits as the Length field. | |||
| bytes of zero (non-ESP marker) followed by 128 bits of IKE SPIs of | They can also search for 4 bytes of zero (non-ESP marker) followed by | |||
| IKE SA associated with this TCP connection and then validate ICV of | 128 bits of IKE SPIs of the IKE SA(s) associated with this TCP | |||
| this IKE message candidate by taking the 16 bits preceding the non- | connection and then validate the ICV of this IKE message candidate by | |||
| ESP marker as the Length field. Implementations SHOULD limit the | taking the 16 bits preceding the non-ESP marker as the Length field. | |||
| attempts to resync, since if the injection attack is ongoing then | Implementations SHOULD limit the attempts to resync, because if the | |||
| there is a high probability that the resync process will not succeed, | injection attack is ongoing, then there is a high probability that | |||
| or quickly come under attack again. | the resync process will not succeed or will quickly come under attack | |||
| again. | ||||
| An attacker capable of blocking UDP traffic can force peers to use | An attacker capable of blocking UDP traffic can force peers to use | |||
| TCP encapsulation, thus degrading the performance and making the | TCP encapsulation, thus, degrading the performance and making the | |||
| connection more vulnerable to DoS attacks. Note that an attacker | connection more vulnerable to DoS attacks. Note that an attacker | |||
| able to modify packets on the wire or to block them can prevent peers | that is able to modify packets on the wire or to block them can | |||
| to communicate regardless of the transport being used. | prevent peers from communicating regardless of the transport being | |||
| used. | ||||
| TCP Responders should be careful to ensure that the stream prefix | TCP Responders should be careful to ensure that the stream prefix | |||
| "IKETCP" uniquely identifies incoming streams as streams that use the | "IKETCP" uniquely identifies incoming streams as streams that use the | |||
| TCP encapsulation protocol. | TCP encapsulation protocol. | |||
| Attackers may be able to disrupt the TCP connection by sending | Attackers may be able to disrupt the TCP connection by sending | |||
| spurious TCP Reset packets. Therefore, implementations SHOULD make | spurious TCP Reset packets. Therefore, implementations SHOULD make | |||
| sure that IKE session state persists even if the underlying TCP | sure that IKE session state persists even if the underlying TCP | |||
| connection is torn down. | connection is torn down. | |||
| If MOBIKE is being used, all of the security considerations outlined | If MOBIKE is being used, all of the security considerations outlined | |||
| for MOBIKE apply [RFC4555]. | for MOBIKE apply [RFC4555]. | |||
| Similarly to MOBIKE, TCP encapsulation requires a TCP Responder to | Similar to MOBIKE, TCP encapsulation requires a TCP Responder to | |||
| handle changes to source address and port due to network or | handle changes to source address and port due to network or | |||
| connection disruption. The successful delivery of valid new IKE or | connection disruption. The successful delivery of valid new IKE or | |||
| ESP messages over a new TCP connection is used by the TCP Responder | ESP messages over a new TCP connection is used by the TCP Responder | |||
| to determine where to send subsequent responses. If an attacker is | to determine where to send subsequent responses. If an attacker is | |||
| able to send packets on a new TCP connection that pass the validation | able to send packets on a new TCP connection that pass the validation | |||
| checks of the TCP Responder, it can influence which path future | checks of the TCP Responder, it can influence which path future | |||
| packets will take. For this reason, the validation of messages on | packets will take. For this reason, the validation of messages on | |||
| the TCP Responder must include decryption, authentication, and replay | the TCP Responder must include decryption, authentication, and replay | |||
| checks. | checks. | |||
| 11. IANA Considerations | 11. IANA Considerations | |||
| TCP port 4500 is already allocated to IPsec for NAT traversal. This | TCP port 4500 is already allocated to IPsec for NAT traversal in the | |||
| "Service Name and Transport Protocol Port Number Registry". This | ||||
| port SHOULD be used for TCP-encapsulated IKE and ESP as described in | port SHOULD be used for TCP-encapsulated IKE and ESP as described in | |||
| this document. | this document. | |||
| This document updates the reference for TCP port 4500 from RFC 8229 | This document updates the reference for TCP port 4500 from RFC 8229 | |||
| to itself: | to itself: | |||
| Keyword Decimal Description Reference | Service Name: ipsec-nat-t | |||
| ----------- -------- ------------------- --------- | Port Number / Transport Protocol: 4500/tcp | |||
| ipsec-nat-t 4500/tcp IPsec NAT-Traversal [RFCXXXX] | Description: IPsec NAT-Traversal | |||
| Reference: RFC 9329 | ||||
| 12. References | 12. References | |||
| 12.1. Normative References | 12.1. Normative References | |||
| [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate | [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate | |||
| Requirement Levels", BCP 14, RFC 2119, | Requirement Levels", BCP 14, RFC 2119, | |||
| DOI 10.17487/RFC2119, March 1997, | DOI 10.17487/RFC2119, March 1997, | |||
| <https://www.rfc-editor.org/info/rfc2119>. | <https://www.rfc-editor.org/info/rfc2119>. | |||
| skipping to change at page 26, line 17 ¶ | skipping to change at line 1191 ¶ | |||
| Distributed Denial-of-Service Attacks", RFC 8019, | Distributed Denial-of-Service Attacks", RFC 8019, | |||
| DOI 10.17487/RFC8019, November 2016, | DOI 10.17487/RFC8019, November 2016, | |||
| <https://www.rfc-editor.org/info/rfc8019>. | <https://www.rfc-editor.org/info/rfc8019>. | |||
| [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC | [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC | |||
| 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, | 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, | |||
| May 2017, <https://www.rfc-editor.org/info/rfc8174>. | May 2017, <https://www.rfc-editor.org/info/rfc8174>. | |||
| 12.2. Informative References | 12.2. Informative References | |||
| [I-D.ietf-ipsecme-ike-tcp] | [IPSECME-IKE-TCP] | |||
| Nir, Y., "A TCP transport for the Internet Key Exchange", | Nir, Y., "A TCP transport for the Internet Key Exchange", | |||
| Work in Progress, Internet-Draft, draft-ietf-ipsecme-ike- | Work in Progress, Internet-Draft, draft-ietf-ipsecme-ike- | |||
| tcp-01, 3 December 2012, <https://www.ietf.org/archive/id/ | tcp-01, 3 December 2012, | |||
| draft-ietf-ipsecme-ike-tcp-01.txt>. | <https://datatracker.ietf.org/doc/html/draft-ietf-ipsecme- | |||
| ike-tcp-01>. | ||||
| [I-D.ietf-uta-rfc7525bis] | [RFC9325] Sheffer, Y., Saint-Andre, P., and T. Fossati, | |||
| Sheffer, Y., Saint-Andre, P., and T. Fossati, | ||||
| "Recommendations for Secure Use of Transport Layer | "Recommendations for Secure Use of Transport Layer | |||
| Security (TLS) and Datagram Transport Layer Security | Security (TLS) and Datagram Transport Layer Security | |||
| (DTLS)", Work in Progress, Internet-Draft, draft-ietf-uta- | (DTLS)", RFC 9325, DOI 10.17487/RFC9325, November 2022, | |||
| rfc7525bis-11, 16 August 2022, | <https://www.rfc-editor.org/info/rfc9325>. | |||
| <https://datatracker.ietf.org/api/v1/doc/document/draft- | ||||
| ietf-uta-rfc7525bis/>. | ||||
| [RFC1122] Braden, R., Ed., "Requirements for Internet Hosts - | [RFC1122] Braden, R., Ed., "Requirements for Internet Hosts - | |||
| Communication Layers", STD 3, RFC 1122, | Communication Layers", STD 3, RFC 1122, | |||
| DOI 10.17487/RFC1122, October 1989, | DOI 10.17487/RFC1122, October 1989, | |||
| <https://www.rfc-editor.org/info/rfc1122>. | <https://www.rfc-editor.org/info/rfc1122>. | |||
| [RFC2817] Khare, R. and S. Lawrence, "Upgrading to TLS Within | [RFC2817] Khare, R. and S. Lawrence, "Upgrading to TLS Within | |||
| HTTP/1.1", RFC 2817, DOI 10.17487/RFC2817, May 2000, | HTTP/1.1", RFC 2817, DOI 10.17487/RFC2817, May 2000, | |||
| <https://www.rfc-editor.org/info/rfc2817>. | <https://www.rfc-editor.org/info/rfc2817>. | |||
| skipping to change at page 28, line 5 ¶ | skipping to change at line 1270 ¶ | |||
| [RFC6520] Seggelmann, R., Tuexen, M., and M. Williams, "Transport | [RFC6520] Seggelmann, R., Tuexen, M., and M. Williams, "Transport | |||
| Layer Security (TLS) and Datagram Transport Layer Security | Layer Security (TLS) and Datagram Transport Layer Security | |||
| (DTLS) Heartbeat Extension", RFC 6520, | (DTLS) Heartbeat Extension", RFC 6520, | |||
| DOI 10.17487/RFC6520, February 2012, | DOI 10.17487/RFC6520, February 2012, | |||
| <https://www.rfc-editor.org/info/rfc6520>. | <https://www.rfc-editor.org/info/rfc6520>. | |||
| [RFC6528] Gont, F. and S. Bellovin, "Defending against Sequence | [RFC6528] Gont, F. and S. Bellovin, "Defending against Sequence | |||
| Number Attacks", RFC 6528, DOI 10.17487/RFC6528, February | Number Attacks", RFC 6528, DOI 10.17487/RFC6528, February | |||
| 2012, <https://www.rfc-editor.org/info/rfc6528>. | 2012, <https://www.rfc-editor.org/info/rfc6528>. | |||
| [RFC9293] Eddy, W., Ed., "Transmission Control Protocol (TCP)", | ||||
| STD 7, RFC 9293, DOI 10.17487/RFC9293, August 2022, | ||||
| <https://www.rfc-editor.org/info/rfc9293>. | ||||
| [RFC7383] Smyslov, V., "Internet Key Exchange Protocol Version 2 | [RFC7383] Smyslov, V., "Internet Key Exchange Protocol Version 2 | |||
| (IKEv2) Message Fragmentation", RFC 7383, | (IKEv2) Message Fragmentation", RFC 7383, | |||
| DOI 10.17487/RFC7383, November 2014, | DOI 10.17487/RFC7383, November 2014, | |||
| <https://www.rfc-editor.org/info/rfc7383>. | <https://www.rfc-editor.org/info/rfc7383>. | |||
| [RFC8229] Pauly, T., Touati, S., and R. Mantha, "TCP Encapsulation | [RFC8229] Pauly, T., Touati, S., and R. Mantha, "TCP Encapsulation | |||
| of IKE and IPsec Packets", RFC 8229, DOI 10.17487/RFC8229, | of IKE and IPsec Packets", RFC 8229, DOI 10.17487/RFC8229, | |||
| August 2017, <https://www.rfc-editor.org/info/rfc8229>. | August 2017, <https://www.rfc-editor.org/info/rfc8229>. | |||
| [RFC8446] Rescorla, E., "The Transport Layer Security (TLS) Protocol | [RFC8446] Rescorla, E., "The Transport Layer Security (TLS) Protocol | |||
| Version 1.3", RFC 8446, DOI 10.17487/RFC8446, August 2018, | Version 1.3", RFC 8446, DOI 10.17487/RFC8446, August 2018, | |||
| <https://www.rfc-editor.org/info/rfc8446>. | <https://www.rfc-editor.org/info/rfc8446>. | |||
| [TCP-MELTDOWN] | [TCP-MELTDOWN] | |||
| Honda, O., Ohsaki, H., Imase, M., Ishizuka, M., and J. | Honda, O., Ohsaki, H., Imase, M., Ishizuka, M., and J. | |||
| Murayama, "Understanding TCP over TCP: effects of TCP | Murayama, "Understanding TCP over TCP: effects of TCP | |||
| tunneling on end-to-end throughput and latency", 2005, | tunneling on end-to-end throughput and latency", October | |||
| <https://doi.org/10.1117/12.630496>. | 2005, <https://doi.org/10.1117/12.630496>. | |||
| Appendix A. Using TCP Encapsulation with TLS | Appendix A. Using TCP Encapsulation with TLS | |||
| This section provides recommendations on how to use TLS in addition | This section provides recommendations on how to use TLS in addition | |||
| to TCP encapsulation. | to TCP encapsulation. | |||
| When using TCP encapsulation, implementations may choose to use TLS | When using TCP encapsulation, implementations may choose to use TLS | |||
| 1.2 [RFC5246] or TLS 1.3 [RFC8446] on the TCP connection to be able | 1.2 [RFC5246] or TLS 1.3 [RFC8446] on the TCP connection to be able | |||
| to traverse middleboxes, which may otherwise block the traffic. | to traverse middleboxes, which may otherwise block the traffic. | |||
| If a web proxy is applied to the ports used for the TCP connection | If a web proxy is applied to the ports used for the TCP connection | |||
| and TLS is being used, the TCP Originator can send an HTTP CONNECT | and TLS is being used, the TCP Originator can send an HTTP CONNECT | |||
| message to establish an SA through the proxy [RFC2817]. | message to establish an SA through the proxy [RFC2817]. | |||
| The use of TLS should be configurable on the peers, and may be used | The use of TLS should be configurable on the peers and may be used as | |||
| as the default when using TCP encapsulation or may be used as a | the default when using TCP encapsulation or may be used as a fallback | |||
| fallback when basic TCP encapsulation fails. The TCP Responder may | when basic TCP encapsulation fails. The TCP Responder may expect to | |||
| expect to read encapsulated IKE and ESP packets directly from the TCP | read encapsulated IKE and ESP packets directly from the TCP | |||
| connection, or it may expect to read them from a stream of TLS data | connection, or it may expect to read them from a stream of TLS data | |||
| packets. The TCP Originator should be pre-configured to use TLS or | packets. The TCP Originator should be preconfigured regarding | |||
| not when communicating with a given port on the TCP Responder. | whether or not to use TLS when communicating with a given port on the | |||
| TCP Responder. | ||||
| When new TCP connections are re-established due to a broken | When new TCP connections are re-established due to a broken | |||
| connection, TLS must be renegotiated. TLS session resumption is | connection, TLS must be renegotiated. TLS session resumption is | |||
| recommended to improve efficiency in this case. | recommended to improve efficiency in this case. | |||
| The security of the IKE session is entirely derived from the IKE | The security of the IKE session is entirely derived from the IKE | |||
| negotiation and key establishment and not from the TLS session (which | negotiation and key establishment and not from the TLS session | |||
| in this context is only used for encapsulation purposes); therefore, | (which, in this context, is only used for encapsulation purposes); | |||
| when TLS is used on the TCP connection, both the TCP Originator and | therefore, when TLS is used on the TCP connection, both the TCP | |||
| the TCP Responder SHOULD allow the NULL cipher to be selected for | Originator and the TCP Responder SHOULD allow the NULL cipher to be | |||
| performance reasons. Note, that TLS 1.3 only supports AEAD | selected for performance reasons. Note that TLS 1.3 only supports | |||
| algorithms and at the time of writing this document there was no | AEAD algorithms and at the time of writing this document there was no | |||
| recommended cipher suite for TLS 1.3 with the NULL cipher. It is | recommended cipher suite for TLS 1.3 with the NULL cipher. It is | |||
| RECOMMENDED to follow [I-D.ietf-uta-rfc7525bis] when selecting | RECOMMENDED to follow [RFC9325] when selecting parameters for TLS. | |||
| parameters for TLS. | ||||
| Implementations should be aware that the use of TLS introduces | Implementations should be aware that the use of TLS introduces | |||
| another layer of overhead requiring more bytes to transmit a given | another layer of overhead requiring more bytes to transmit a given | |||
| IKE and IPsec packet. For this reason, direct ESP, UDP | IKE and IPsec packet. For this reason, direct ESP, UDP | |||
| encapsulation, or TCP encapsulation without TLS should be preferred | encapsulation, or TCP encapsulation without TLS should be preferred | |||
| in situations in which TLS is not required in order to traverse | in situations in which TLS is not required in order to traverse | |||
| middleboxes. | middleboxes. | |||
| Appendix B. Example Exchanges of TCP Encapsulation with TLS 1.3 | Appendix B. Example Exchanges of TCP Encapsulation with TLS 1.3 | |||
| This appendix contains examples of data flows in cases where TCP | ||||
| encapsulation of IKE and IPsec packets is used with TLS 1.3. The | ||||
| examples below are provided for illustrative purpose only; readers | ||||
| should refer to the main body of the document for details. | ||||
| B.1. Establishing an IKE Session | B.1. Establishing an IKE Session | |||
| Client Server | Client Server | |||
| ---------- ---------- | ---------- ---------- | |||
| 1) -------------------- TCP Connection ------------------- | 1) -------------------- TCP Connection ------------------- | |||
| (IP_I:Port_I -> IP_R:Port_R) | (IP_I:Port_I -> IP_R:Port_R) | |||
| TcpSyn -------> | TcpSyn -------> | |||
| <------- TcpSyn,Ack | <------- TcpSyn,Ack | |||
| TcpAck -------> | TcpAck -------> | |||
| 2) --------------------- TLS Session --------------------- | 2) --------------------- TLS Session --------------------- | |||
| skipping to change at page 30, line 28 ¶ | skipping to change at line 1399 ¶ | |||
| final IKE_AUTH | final IKE_AUTH | |||
| HDR, SK {AUTH} | HDR, SK {AUTH} | |||
| <------- Length + Non-ESP Marker | <------- Length + Non-ESP Marker | |||
| final IKE_AUTH | final IKE_AUTH | |||
| HDR, SK {AUTH, CP(CFG_REPLY), | HDR, SK {AUTH, CP(CFG_REPLY), | |||
| SA, TSi, TSr, ...} | SA, TSi, TSr, ...} | |||
| -------------- IKE and IPsec SAs Established ------------ | -------------- IKE and IPsec SAs Established ------------ | |||
| Length + ESP Frame -------> | Length + ESP Frame -------> | |||
| 1. The client establishes a TCP connection with the server on port | 1. The client establishes a TCP connection with the server on port | |||
| 4500 or on an alternate pre-configured port that the server is | 4500 or on an alternate preconfigured port that the server is | |||
| listening on. | listening on. | |||
| 2. If configured to use TLS, the client initiates a TLS handshake. | 2. If configured to use TLS, the client initiates a TLS handshake. | |||
| During the TLS handshake, the server SHOULD NOT request the | During the TLS handshake, the server SHOULD NOT request the | |||
| client's certificate, since authentication is handled as part of | client's certificate since authentication is handled as part of | |||
| IKE negotiation. | IKE negotiation. | |||
| 3. The client sends the stream prefix for TCP-encapsulated IKE | 3. The client sends the stream prefix for TCP-encapsulated IKE | |||
| (Section 4) traffic to signal the beginning of IKE negotiation. | (Section 4) traffic to signal the beginning of IKE negotiation. | |||
| 4. The client and server establish an IKE connection. This example | 4. The client and server establish an IKE connection. This example | |||
| shows EAP-based authentication, although any authentication type | shows EAP-based authentication, although any authentication type | |||
| may be used. | may be used. | |||
| B.2. Deleting an IKE Session | B.2. Deleting an IKE Session | |||
| skipping to change at page 34, line 42 ¶ | skipping to change at line 1585 ¶ | |||
| 7. Once the client receives a response on the TCP-encapsulated | 7. Once the client receives a response on the TCP-encapsulated | |||
| connection, it immediately starts a new INFORMATIONAL exchange | connection, it immediately starts a new INFORMATIONAL exchange | |||
| with an UPDATE_SA_ADDRESSES notify payload and recalculated | with an UPDATE_SA_ADDRESSES notify payload and recalculated | |||
| NAT_DETECTION_*_IP notify payloads in order to get correct | NAT_DETECTION_*_IP notify payloads in order to get correct | |||
| information about the presence of NATs. | information about the presence of NATs. | |||
| 8. The IKE and ESP packet flow can resume. | 8. The IKE and ESP packet flow can resume. | |||
| Acknowledgments | Acknowledgments | |||
| Thanks to the original authors of RFC 8229, Tommy Pauly, Samy Touati, | Thanks to the authors of RFC 8229 (Tommy Pauly, Samy Touati, and Ravi | |||
| and Ravi Mantha. Since this document updates and obsoletes RFC 8229, | Mantha). Since this document clarifies and obsoletes RFC 8229, most | |||
| most of its text was borrowed from the original document. | of its text was borrowed from the original document. | |||
| The following people provided valuable feedback and advices while | The following people provided valuable feedback and advice while | |||
| preparing RFC8229: Stuart Cheshire, Delziel Fernandes, Yoav Nir, | preparing RFC 8229: Stuart Cheshire, Delziel Fernandes, Yoav Nir, | |||
| Christoph Paasch, Yaron Sheffer, David Schinazi, Graham Bartlett, | Christoph Paasch, Yaron Sheffer, David Schinazi, Graham Bartlett, | |||
| Byju Pularikkal, March Wu, Kingwel Xie, Valery Smyslov, Jun Hu, and | Byju Pularikkal, March Wu, Kingwel Xie, Valery Smyslov, Jun Hu, and | |||
| Tero Kivinen. Special thanks to Eric Kinnear for his implementation | Tero Kivinen. Special thanks to Eric Kinnear for his implementation | |||
| work. | work. | |||
| The authors would like to thank Tero Kivinen, Paul Wouters, Joseph | The authors would like to thank Tero Kivinen, Paul Wouters, Joseph | |||
| Touch, and Christian Huitema for their valuable comments while | Touch, and Christian Huitema for their valuable comments while | |||
| preparing this document. | preparing this document. | |||
| Authors' Addresses | Authors' Addresses | |||
| Tommy Pauly | Tommy Pauly | |||
| Apple Inc. | Apple Inc. | |||
| 1 Infinite Loop | 1 Infinite Loop | |||
| Cupertino, California 95014, | Cupertino, California 95014 | |||
| United States of America | United States of America | |||
| Email: tpauly@apple.com | Email: tpauly@apple.com | |||
| Valery Smyslov | Valery Smyslov | |||
| ELVIS-PLUS | ELVIS-PLUS | |||
| PO Box 81 | PO Box 81 | |||
| Moscow (Zelenograd) | Moscow (Zelenograd) | |||
| 124460 | 124460 | |||
| Russian Federation | Russian Federation | |||
| Phone: +7 495 276 0211 | Phone: +7 495 276 0211 | |||
| End of changes. 130 change blocks. | ||||
| 340 lines changed or deleted | 347 lines changed or added | |||
This html diff was produced by rfcdiff 1.48. | ||||