idnits 2.17.1 draft-ietf-ipsec-udp-encaps-02.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- ** Looks like you're using RFC 2026 boilerplate. This must be updated to follow RFC 3978/3979, as updated by RFC 4748. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- == The page length should not exceed 58 lines per page, but there was 1 longer page, the longest (page 1) being 445 lines Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- ** The document seems to lack an IANA Considerations section. (See Section 2.2 of https://www.ietf.org/id-info/checklist for how to handle the case when there are no actions for IANA.) ** The document seems to lack separate sections for Informative/Normative References. All references will be assumed normative when checking for downward references. ** The abstract seems to contain references ([Kiv02], [Dixon00]), which it shouldn't. Please replace those with straight textual mentions of the documents in question. == There are 5 instances of lines with private range IPv4 addresses in the document. If these are generic example addresses, they should be changed to use any of the ranges defined in RFC 6890 (or successor): 192.0.2.x, 198.51.100.x or 203.0.113.x. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the RFC 3978 Section 5.4 Copyright Line does not match the current year == The document seems to lack the recommended RFC 2119 boilerplate, even if it appears to use RFC 2119 keywords. (The document does seem to have the reference to RFC 2119 which the ID-Checklist requires). -- The document seems to lack a disclaimer for pre-RFC5378 work, but may have content which was first submitted before 10 November 2008. If you have contacted all the original authors and they are all willing to grant the BCP78 rights to the IETF Trust, then this is fine, and you can ignore this comment. If not, you may need to add the pre-RFC5378 disclaimer. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- The document date (April 2002) is 8046 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) == Unused Reference: 'RFC 1122' is defined on line 373, but no explicit reference was found in the text == Unused Reference: 'RFC-2119' is defined on line 376, but no explicit reference was found in the text ** Obsolete normative reference: RFC 2406 (Obsoleted by RFC 4303, RFC 4305) ** Obsolete normative reference: RFC 2409 (Obsoleted by RFC 4306) -- Possible downref: Normative reference to a draft: ref. 'Dixon00' == Outdated reference: A later version (-08) exists of draft-ietf-ipsec-nat-t-ike-02 Summary: 6 errors (**), 0 flaws (~~), 7 warnings (==), 3 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 1 IP Security Protocol Working Group (IPSEC) A. Huttunen 2 INTERNET-DRAFT F-Secure Corporation 3 Category: Standards track W. Dixon, B. Swander 4 Expires: October 2002 Microsoft 5 T. Kivinen, M. Stenberg 6 SSH Communications Security Corp 7 V. Volpe 8 Cisco Systems 9 L. DiBurro 10 Nortel Networks 11 April 2002 13 UDP Encapsulation of IPsec Packets 14 draft-ietf-ipsec-udp-encaps-02.txt 16 Status of this Memo 18 This document is an Internet-Draft and is in full conformance with 19 all provisions of Section 10 of RFC2026. 21 Internet-Drafts are working documents of the Internet Engineering 22 Task Force (IETF), its areas, and its working groups. Note that 23 other groups may also distribute working documents as 24 Internet-Drafts. 26 Internet-Drafts are draft documents valid for a maximum of six 27 months and may be updated, replaced, or obsoleted by other documents 28 at any time. It is inappropriate to use Internet-Drafts as reference 29 material or to cite them other than as "work in progress." 31 The list of current Internet-Drafts can be accessed at 32 http://www.ietf.org/ietf/1id-abstracts.txt. 34 The list of Internet-Draft Shadow Directories can be accessed at 35 http://www.ietf.org/shadow.html. 37 This Internet-Draft will expire on October, 2002. 39 Copyright Notice 41 Copyright (C) The Internet Society (2002). All Rights Reserved. 43 Abstract 45 This draft defines methods to encapsulate and decapsulate ESP 46 packets inside UDP packets for the purpose of traversing NATs. 48 ESP encapsulation as defined in this document is capable of being 49 used in both IPv4 and IPv6 scenarios. 51 The encapsulation is used whenever negotiated using IKE, as 52 defined in [Kiv02]. The design choices are documented in [Dixon00]. 54 Change Log 55 Version -01 56 - removed everything related to the AH-protocol 57 - added instructions on how to use the encapsulation with 58 some other key management protocol than IKE 59 Version -02 60 - changed to using 4-byte non-ESP marker, removed all references 61 to using this with other key management protocols 62 - TCP checksum handling for transport mode related discussion 63 modified 64 - copied tunnel mode security considerations from the 65 earlier draft-huttunen-ipsec-esp-in-udp-00.txt draft, 66 added transport mode considerations 68 1. Introduction 70 This draft defines methods to encapsulate and decapsulate ESP 71 packets inside UDP packets for the purpose of traversing NATs. 72 The UDP port numbers are the same as used by IKE traffic, as 73 defined in [Kiv02]. 75 It is up to the need of the clients whether transport mode 76 or tunnel mode is to be supported. L2TP/IPsec clients MUST support 77 transport mode since [RFC 3193] defines that L2TP/IPsec MUST use 78 transport mode], and IPsec tunnel mode clients MUST support tunnel 79 mode. 81 An IKE implementation supporting this draft MUST NOT use the 82 ESP SPI field zero for ESP packets. (XXX To be changed to 83 an IANA allocated SPI value later.) This ensures that 84 IKE packets and ESP packets can be distinguished from each other. 86 UDP encapsulation of ESP packets as defined in this document is 87 written in terms of IPv4 headers. There is no technical reason 88 why an IPv6 header could not be used as the outer header and/or 89 as the inner header. 91 2. Packet Formats 93 2.1 UDP-encapsulated ESP Header Format 95 0 1 2 3 96 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 97 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 98 | Source Port | Destination Port | 99 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 100 | Length | Checksum | 101 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 102 | ESP header [RFC 2406] | 103 ~ ~ 104 | | 105 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 107 The UDP header is a standard [RFC 768] header, where 108 - Source Port and Destination Port are the same as used by 109 floated IKE traffic. 110 - Checksum is zero. 112 The SPI field in the ESP header must not be zero. (XXX To be 113 changed to an IANA allocated SPI value later.) 115 2.2 Floated IKE Header Format 117 0 1 2 3 118 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 119 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 120 | Source Port | Destination Port | 121 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 122 | Length | Checksum | 123 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 124 | Non-ESP Marker | 125 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 126 | IKE header [RFC 2409] | 127 ~ ~ 128 | | 129 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 131 The UDP header is a standard [RFC 768] header, and is used 132 as defined in [Kiv02]. 134 Non-ESP Marker is 4 bytes of zero aligning with the SPI field 135 of an ESP packet. (XXX To be changed to an IANA allocated SPI 136 value later.) 138 2.3 NAT-keepalive Packet Format 140 0 1 2 3 141 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 142 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 143 | Source Port | Destination Port | 144 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 145 | Length | Checksum | 146 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 147 | 0xFF | 148 +-+-+-+-+-+-+-+-+ 150 The UDP header is a standard [RFC 768] header, where 151 - Source Port and Destination Port are the same as used by floated 152 IKE traffic. 153 - Checksum is zero. 155 The sender SHOULD use a one octet long payload with the value 0xFF. 156 The receiver SHOULD ignore a received NAT-keepalive packet. 158 3. Encapsulation and Decapsulation Procedures 160 3.1 Auxiliary Procedures 162 3.1.1 Tunnel Mode Decapsulation NAT Procedure 164 When a tunnel mode has been used to transmit packets, the inner 165 IP header can contain addresses that are not suitable for the 166 current network. This procedure defines how these addresses are 167 to be converted to suitable addresses for the current network. 169 Depending on local policy, one of the following MUST be done: 170 a) If a valid source IP address space has been defined in the policy 171 for the encapsulated packets from the peer, check that the source 172 IP address of the inner packet is valid according to the policy. 173 b) If an address has been assigned for the remote peer, check 174 that the source IP address used in the inner packet is the 175 same as the IP address assigned. 176 c) NAT is performed for the packet, making it suitable for transport 177 in the local network. 179 3.1.2 Transport Mode Decapsulation NAT Procedure 181 When a transport mode has been used to transmit packets, contained 182 TCP or UDP headers will contain incorrect checksums due to the change 183 of parts of the IP header during transit. This procedure defines how 184 to fix these checksums. 186 Depending on local policy, one of the following MUST be done: 187 a) If the protocol header after the ESP header is a TCP/UDP 188 header and the peer's real source IP address has been received 189 according to [Kiv02], incrementally recompute the TCP/UDP checksum: 190 - subtract the IP source address in the received packet 191 from the checksum 192 - add the real IP source address received via IKE to the checksum 193 b) If the protocol header after the ESP header is a TCP/UDP 194 header, recompute the checksum field in the TCP/UDP header. 195 c) If the protocol header after the ESP header is an UDP 196 header, zero the checksum field in the UDP header. If the protocol 197 header after the ESP header is a TCP header, and there is an 198 option to flag to the stack that TCP checksum does not need to 199 be computed, then that flag MAY be used. This SHOULD only be done 200 for transport mode, and if the packet is integrity protected. Tunnel 201 mode TCP checksums MUST be verified. 202 [This is not a violation to the spirit of section 4.2.2.7 in RFC 1122 203 because a checksum is being generated by the sender, and verified 204 by the receiver. That checksum is the integrity over the packet 205 performed by IPsec.] 207 In addition an implementation MAY fix any contained protocols that 208 have been broken by NAT. 210 3.2 Transport Mode ESP Encapsulation 212 BEFORE APPLYING ESP/UDP 213 ---------------------------- 214 IPv4 |orig IP hdr | | | 215 |(any options)| TCP | Data | 216 ---------------------------- 218 AFTER APPLYING ESP/UDP 219 ------------------------------------------------------- 220 IPv4 |orig IP hdr | UDP | ESP | | | ESP | ESP| 221 |(any options)| Hdr | Hdr | TCP | Data | Trailer |Auth| 222 ------------------------------------------------------- 223 |<----- encrypted ---->| 224 |<------ authenticated ----->| 226 1) Ordinary ESP encapsulation procedure is used. 227 2) A properly formatted UDP header is inserted where shown. 228 3) The Total Length, Protocol and Header Checksum fields in the 229 IP header are edited to match the resulting IP packet. 231 3.3 Transport Mode ESP Decapsulation 233 1) The UDP header is removed from the packet. 234 2) The Total Length, Protocol and Header Checksum fields in the 235 new IP header are edited to match the resulting IP packet. 236 3) Ordinary ESP decapsulation procedure is used. 237 4) Transport mode decapsulation NAT procedure is used. 239 3.4 Tunnel Mode ESP Encapsulation 241 BEFORE APPLYING ESP/UDP 242 ---------------------------- 243 IPv4 |orig IP hdr | | | 244 |(any options)| TCP | Data | 245 ---------------------------- 247 AFTER APPLYING ESP/UDP 248 -------------------------------------------------------------- 249 IPv4 |new h.| UDP | ESP |orig IP hdr | | | ESP | ESP| 250 |(opts)| Hdr | Hdr |(any options)| TCP | Data | Trailer |Auth| 251 -------------------------------------------------------------- 252 |<------------ encrypted ----------->| 253 |<------------- authenticated ------------>| 255 1) Ordinary ESP encapsulation procedure is used. 256 2) A properly formatted UDP header is inserted where shown. 257 3) The Total Length, Protocol and Header Checksum fields in the 258 new IP header are edited to match the resulting IP packet. 260 3.5 Tunnel Mode ESP Decapsulation 262 1) The UDP header is removed from the packet. 263 2) The Total Length, Protocol and Header Checksum fields in the 264 new IP header are edited to match the resulting IP packet. 265 3) Ordinary ESP decapsulation procedure is used. 266 4) Tunnel mode decapsulation NAT procedure is used. 268 4. NAT Keepalive Procedure 270 The sole purpose of sending NAT-keepalive packets is to keep 271 NAT mappings alive for the duration of a connection between 272 the peers. Reception of NAT-keepalive packets MUST NOT be 273 used to detect liveness of a connection. 275 A peer MAY send a NAT-keepalive packet if there exists one 276 or more phase I or phase II SAs between the peers, or such 277 an SA has existed at most N minutes earlier. N is a locally 278 configurable parameter with a default value of 5 minutes. 280 A peer SHOULD send a NAT-keepalive packet if a need to send such 281 packets is detected according to [Kiv02] and if no other packet to 282 the peer has been sent in M seconds. M is a locally configurable 283 parameter with a default value of 20 seconds. 285 5. Security Considerations 287 5.1 DoS 289 On some systems ESPUDP may have DoS attack consequences, 290 especially if ordinary operating system UDP-functionality is 291 being used. It may be recommended not to open an ordinary UDP-port 292 for this. 294 5.2 Tunnel Mode Conflict 296 Implementors are warned that it is possible for remote peers to 297 negotiate entries that overlap in a GW, an issue affecting tunnel 298 mode. 300 +----+ \ / 301 | |-------------|----\ 302 +----+ / \ \ 303 Ari's NAT 1 \ 304 Laptop \ 305 10.1.2.3 \ 306 +----+ \ / \ +----+ +----+ 307 | |-------------|----------+------| |----------| | 308 +----+ / \ +----+ +----+ 309 Bob's NAT 2 GW Suzy's 310 Laptop Server 311 10.1.2.3 313 Because GW will now see two possible SAs that lead to 10.1.2.3, it 314 can become confused where to send packets coming from Suzy's server. 315 Implementators MUST devise ways of preventing such a thing from 316 occurring; either by disallowing conflicting connections or by 317 other means. 319 5.3 Transport Mode Conflict 321 Another similar issue may occur in transport mode, with 2 clients 322 behind the same NAT talking to the same server. 324 +----+ 325 | | 326 +----+ \ 327 Ari's \ 328 Laptop \ 329 10.1.2.3 \ 330 +----+ \ / +----+ 331 | |-----+-----------------| | 332 +----+ / \ +----+ 333 Bob's NAT Server 334 Laptop 335 10.1.2.4 337 Now, transport SAs on the server will look like: 338 To Ari: S to NAT, , UDP encap <4500, Y> 339 To Bob: S to NAT, , UDP encap <4500, Z> 341 is the protocol and port information. 342 The UDP encap ports are the ports used in UDP encapsulated 343 ESP format of section 2.1. 345 If the overlaps , then 346 simple filter lookups may not be sufficient to determine 347 which SA needs to be used to send traffic. Implementations 348 MUST handle this situation, either by disallowing 349 conflicting connections, or by other means. 351 6. Intellectual Property Rights 353 The IETF has been notified of intellectual property rights claimed in 354 regard to some or all of the specification contained in this document. 355 For more information consult the online list of claimed rights. 357 SSH Communications Security Corp has notified the working group of one 358 or more patents or patent applications that may be relevant to this 359 internet-draft. SSH Communications Security Corp has already given a 360 licence for those patents to the IETF. For more information consult the 361 online list of claimed rights. 363 7. Acknowledgments 365 Thanks to Joern Sierwald, Tamir Zegman, Larry DiBurro, Tatu Ylonen 366 and Santeri Paavolainen who contributed to the previous drafts 367 about NAT traversal. 369 8. References 371 [RFC 768] Postel, J., "User Datagram Protocol", August 1980 373 [RFC 1122] R. Braden (Editor), "Requirements for Internet Hosts 374 -- Communication Layers", October 1989 376 [RFC-2119] Bradner, S., "Key words for use in RFCs to indicate 377 Requirement Levels", March 1997 379 [RFC 2406] Kent, S., "IP Encapsulating Security Payload (ESP)", 380 November 1998 382 [RFC 2409] D. Harkins, D. Carrel, "The Internet Key Exchange 383 (IKE)", November 1998 385 [RFC 3193] Patel, B. et. al, "Securing L2TP using IPsec", 386 November 2001 388 [Dixon00] Dixon, W. et. al., 389 draft-ietf-ipsec-udp-encaps-justification-00.txt, 390 "IPSec over NAT Justification for UDP Encapsulation", June 2001 392 [Kiv02] Kivinen, T. et. al., draft-ietf-ipsec-nat-t-ike-02.txt, 393 "Negotiation of NAT-Traversal in the IKE", April 2002 395 9. Authors' Addresses 397 Ari Huttunen 398 F-Secure Corporation 399 Tammasaarenkatu 7 400 FIN-00181 HELSINKI 401 Finland 402 E-mail: Ari.Huttunen@F-Secure.com 404 William Dixon 405 Microsoft 406 One Microsoft Way 407 Redmond WA 98052 408 E-mail: wdixon@microsoft.com 410 Brian Swander 411 Microsoft 412 One Microsoft Way 413 Redmond WA 98052 414 E-mail: briansw@microsoft.com 416 Tero Kivinen 417 SSH Communications Security Corp 418 Fredrikinkatu 42 419 FIN-00100 HELSINKI 420 Finland 421 E-mail: kivinen@ssh.fi 423 Markus Stenberg 424 SSH Communications Security Corp 425 Fredrikinkatu 42 426 FIN-00100 HELSINKI 427 Finland 428 E-mail: mstenber@ssh.com 430 Victor Volpe 431 Cisco Systems 432 124 Grove Street 433 Suite 205 434 Franklin, MA 02038 435 E-mail: vvolpe@cisco.com 437 Larry DiBurro 438 Nortel Networks 439 80 Central Street 440 Boxborough, MA 01719 441 ldiburro@nortelnetworks.com