idnits 2.17.1 draft-nikander-esp-beet-mode-01.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- ** It looks like you're using RFC 3978 boilerplate. You should update this to the boilerplate described in the IETF Trust License Policy document (see https://trustee.ietf.org/license-info), which is required now. -- Found old boilerplate from RFC 3667, Section 5.1 on line 15. -- Found old boilerplate from RFC 3978, Section 5.5 on line 1008. -- Found old boilerplate from RFC 3979, Section 5, paragraph 2 on line 992. -- Found old boilerplate from RFC 3979, Section 5, paragraph 3 on line 998. ** Found boilerplate matching RFC 3978, Section 5.4, paragraph 1 (on line 1014), which is fine, but *also* found old RFC 2026, Section 10.4C, paragraph 1 text on line 36. ** The document seems to lack an RFC 3978 Section 5.1 IPR Disclosure Acknowledgement -- however, there's a paragraph with a matching beginning. Boilerplate error? ** This document has an original RFC 3978 Section 5.4 Copyright Line, instead of the newer IETF Trust Copyright according to RFC 4748. ** This document has an original RFC 3978 Section 5.5 Disclaimer, instead of the newer disclaimer which includes the IETF Trust according to RFC 4748. ** The document seems to lack an RFC 3979 Section 5, para. 1 IPR Disclosure Acknowledgement -- however, there's a paragraph with a matching beginning. Boilerplate error? ** The document uses RFC 3667 boilerplate or RFC 3978-like boilerplate instead of verbatim RFC 3978 boilerplate. After 6 May 2005, submission of drafts without verbatim RFC 3978 boilerplate is not accepted. The following non-3978 patterns matched text found in the document. That text should be removed or replaced: By submitting this Internet-Draft, I certify that any applicable patent or other IPR claims of which I am aware have been disclosed, or will be disclosed, and any of which I become aware will be disclosed, in accordance with RFC 3668. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- == No 'Intended status' indicated for this document; assuming Proposed Standard Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- ** There are 7 instances of too long lines in the document, the longest one being 10 characters in excess of 72. == There are 5 instances of lines with non-RFC6890-compliant IPv4 addresses in the document. If these are example addresses, they should be changed. == There are 2 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 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 (June 18, 2004) is 7250 days in the past. Is this intentional? -- Found something which looks like a code comment -- if you have code sections in the document, please surround them with '' and '' lines. Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) ** Downref: Normative reference to an Informational RFC: RFC 2367 (ref. '2') ** Obsolete normative reference: RFC 2401 (ref. '3') (Obsoleted by RFC 4301) == Outdated reference: A later version (-10) exists of draft-ietf-ipsec-esp-v3-05 == Outdated reference: A later version (-06) exists of draft-moskowitz-hip-arch-03 == Outdated reference: A later version (-09) exists of draft-moskowitz-hip-06 == Outdated reference: A later version (-02) exists of draft-nikander-mobileip-v6-ro-sec-00 Summary: 10 errors (**), 0 flaws (~~), 8 warnings (==), 7 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group P. Nikander 3 Internet-Draft J. Melen 4 Expires: December 17, 2004 Ericsson Research Nomadic Lab 5 June 18, 2004 7 A Bound End-to-End Tunnel (BEET) mode for ESP 8 draft-nikander-esp-beet-mode-01 10 Status of this Memo 12 By submitting this Internet-Draft, I certify that any applicable 13 patent or other IPR claims of which I am aware have been disclosed, 14 and any of which I become aware will be disclosed, in accordance with 15 RFC 3668. 17 Internet-Drafts are working documents of the Internet Engineering 18 Task Force (IETF), its areas, and its working groups. Note that other 19 groups may also distribute working documents as Internet-Drafts. 21 Internet-Drafts are draft documents valid for a maximum of six months 22 and may be updated, replaced, or obsoleted by other documents at any 23 time. It is inappropriate to use Internet-Drafts as reference 24 material or to cite them other than as "work in progress." 26 The list of current Internet-Drafts can be accessed at http:// 27 www.ietf.org/ietf/1id-abstracts.txt. 29 The list of Internet-Draft Shadow Directories can be accessed at 30 http://www.ietf.org/shadow.html. 32 This Internet-Draft will expire on December 17, 2004. 34 Copyright Notice 36 Copyright (C) The Internet Society (2004). All Rights Reserved. 38 Abstract 40 This document specifies a new mode, called Bound End-to-End Tunnel 41 (BEET) mode, for IPsec ESP. The new mode augments the existing ESP 42 tunnel and transport modes. For end-to-end tunnels, the new mode 43 provides limited tunnel mode semantics without the regular tunnel 44 mode overhead. The mode is intended to support new uses of ESP, 45 including mobility and multi-address multi-homing. 47 Table of Contents 49 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3 50 2. Conventions used in this document . . . . . . . . . . . . . . 4 51 2.1 Terminology . . . . . . . . . . . . . . . . . . . . . . . 4 52 3. Background . . . . . . . . . . . . . . . . . . . . . . . . . . 5 53 3.1 Related work . . . . . . . . . . . . . . . . . . . . . . . 5 54 4. Use scenarios . . . . . . . . . . . . . . . . . . . . . . . . 6 55 4.1 NAT traversal . . . . . . . . . . . . . . . . . . . . . . 6 56 4.2 Mobile IP . . . . . . . . . . . . . . . . . . . . . . . . 7 57 4.2.1 Mobile IPv4 . . . . . . . . . . . . . . . . . . . . . 7 58 4.2.2 Mobile IPv4 route optimization . . . . . . . . . . . . 9 59 4.2.3 Mobile IPv6 . . . . . . . . . . . . . . . . . . . . . 9 60 4.3 End-node multi-address multi-homing . . . . . . . . . . . 10 61 4.4 Host Identity Protocol . . . . . . . . . . . . . . . . . . 10 62 5. Protocol definition . . . . . . . . . . . . . . . . . . . . . 12 63 5.1 Changes to Security Association data structures . . . . . 12 64 5.2 Packet format . . . . . . . . . . . . . . . . . . . . . . 12 65 5.3 Cryptographic processing . . . . . . . . . . . . . . . . . 13 66 5.4 IP header processing . . . . . . . . . . . . . . . . . . . 14 67 5.5 Handling of outgoing packets . . . . . . . . . . . . . . . 14 68 5.6 Handling of incoming packets . . . . . . . . . . . . . . . 15 69 6. Policy considerations . . . . . . . . . . . . . . . . . . . . 17 70 7. PF_KEY extensions . . . . . . . . . . . . . . . . . . . . . . 18 71 8. New requirements on Key Management protocols . . . . . . . . . 19 72 9. Implementing the functionality with other means . . . . . . . 20 73 10. Security Considerations . . . . . . . . . . . . . . . . . . 21 74 11. IANA Considerations . . . . . . . . . . . . . . . . . . . . 22 75 12. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . 23 76 13. References . . . . . . . . . . . . . . . . . . . . . . . . . 24 77 13.1 Normative references . . . . . . . . . . . . . . . . . . . . 24 78 13.2 Informative references . . . . . . . . . . . . . . . . . . . 24 79 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . 25 80 A. Implementation experiences . . . . . . . . . . . . . . . . . . 26 81 B. Garden beets . . . . . . . . . . . . . . . . . . . . . . . . . 27 82 Intellectual Property and Copyright Statements . . . . . . . . 28 84 1. Introduction 86 The current IPsec ESP specification [4] defines two modes of 87 operation: tunnel mode and transport mode. The tunnel mode is mainly 88 intended for non-end-to-end use where one or both of the ends of the 89 ESP Security Associations (SAs) are located in security gateways, 90 separate from the actual end-nodes. The transport mode is intended 91 for end-to-end use, where both ends of the security association are 92 terminated at the end-nodes themselves. 94 This document defines a new mode for ESP, called Bound End-to-End 95 Tunnel (BEET) mode. The purpose of the mode is to provide limited 96 tunnel mode semantics without the overhead associated with the 97 regular tunnel mode. As the name states, the BEET mode is intended 98 solely for end-to-end use. It provides tunnel mode semantics in the 99 sense that the IP addresses seen by the applications and the IP 100 addresses used on the wire are distinct from each other, providing 101 the illusion that the application level IP addresses are tunneled 102 over the network level IP addresses. However, the mode does not 103 support full tunnel semantics. More specifically, the IP addresses 104 as seen by the application are strictly bound, and only one pair of 105 bound addresses can be used on any given BEET mode Security 106 Association. This is in contrast to the regular tunnel mode, where 107 the inner IP addresses can be any addresses from a defined range. 109 A BEET mode Security Associations records two pairs of IP addresses, 110 called inner addresses and outer addresses. The inner addresses are 111 what the applications see. The outer addresses are what appear on 112 the wire. Since the inner addresses are fixed for the lifetime of 113 the Security Association, they need not to be sent in individual 114 packets. Instead, they are set up as the Security Associations are 115 created, they are verified when packets are sent, and they are 116 restored as packets are received. 118 This all gives the BEET mode the efficiency of transport mode with a 119 limited set of end-to-end tunnel semantics. The efficiency is 120 accomplished by removing the inner IP header from the packet that is 121 transported on the wire. Due to removal of inner IP header, tunneled 122 packet TTL is reduced by every router on the path. The semantics of 123 BEET mode is limited in the sense that only one fixed pair of inner 124 addresses are allowed. The outer addresses may change over the life 125 time of the SA, but the inner addresses cannot. If a new pair of 126 inner addresses is needed, a new pair of BEET mode Security 127 Associations must be established, or the regular tunnel mode must be 128 used. However, in the cases considered, a single pair of security 129 associations is usually sufficient between any single pair of nodes. 131 2. Conventions used in this document 133 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 134 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 135 document are to be interpreted as described in RFC2119 [1]. 137 This document contains both normative and informative sections. The 138 normative sections define the BEET mode. The informative sections 139 provide background information that aim to motivate the need for the 140 new mode. Whenever it may not be clear from the context whether a 141 given major section is normative or informative, it is defined in the 142 beginning of the section. 144 2.1 Terminology 146 In this section we define the terms specific to this document. This 147 section is normative. 149 Inner IP address 150 An IP address as seen by applications, stored in TCB or other 151 upper layer data structures, and processed by the IP stack prior 152 to ESP processing in the output side and after ESP processing in 153 the input side. 155 Outer IP address 156 An IP address seen in the wire and processed by the IP stack after 157 ESP processing in the output side and before ESP processing in the 158 input side. 160 Inner IP header 161 An IP header that contains inner IP addresses. In some cases an 162 inner IP header may be represented as an internal data structure 163 containing the data equivalent to an IP header. 165 Outer IP header 166 An IP header that contains outer IP addresses. In some cases an 167 outer IP header may be represented as an internal data structure 168 containing the data equivalent to an IP header. 170 3. Background 172 For a number of years people have been talking about using IPsec for 173 other purposes than VPN. In fact, the current specifications do 174 provide support for end-to-end protection of data. However, that 175 mode is rarely used, for a number of reasons [5], [6]. One of the 176 reasons, though, seems to be address agility. That is, due to NAT, 177 mobility, multi-address multi-homing, etc., the addresses that are 178 used actually on the wire do not necessarily match with the addresses 179 that the applications expect to see. In the NAT case the addresses 180 are changed on the fly, thereby invalidating any transport mode 181 checksums (unless, of course, a tunnel is used). Mobile nodes change 182 their addresses periodically, and the existing applications rarely 183 survive the address changes without some help, e.g., Mobile IP. 184 Multi-addressing based multi-homed nodes would prefer to keep their 185 connections active even when the primary (or currently used) IP 186 address becomes unusable in the face of an network outage. 188 Based on the reasons above, there is clearly a need for a mode of 189 communication where the addresses that the applications see are 190 distinct from the addresses that are actually used in the wire. The 191 current IPsec tunnel mode provides the required functionality, but at 192 the cost of additional overhead in terms of larger packets and more 193 complicated processing. 195 3.1 Related work 197 The basic idea captured by this draft has been floating around for a 198 long time. Steven Bellovin's HostNAT talk [7] at the Los Angeles 199 IETF is an early example. After that, basically the same idea has 200 surfaced several times. Perhaps the most concrete current proposal 201 is the Host Identity Protocol (HIP) [10], where BEET mode ESP 202 processing is an integral part of the overall protocol. 204 4. Use scenarios 206 In this section we describe a number of possible use scenarios. None 207 of these use scenarios are meant to be complete specifications on how 208 exactly to support the functionality. Separate specifications are 209 needed for that. Instead, the purpose of this section is to discuss 210 the overall benefits of the BEET mode, and to lay out a road map for 211 possible future documents. This section is informative. 213 4.1 NAT traversal 215 NAT traversal is currently a major problem in IPsec. It is not 216 sufficient to encapsulate the packets into UDP; additionally, tunnel 217 mode must be used. Tunnel mode is required since the outer IP 218 addresses at the ends of the protected connection differ. If 219 transport mode was used, the differing IP addresses would lead to 220 failing upper layer TCP/UDP checksums. 222 The BEET mode provides sufficient tunnel mode semantics without the 223 packet overhead of the tunnel mode. A pair of BEET mode SAs can be 224 effectively used to "un-NAT" packets that have been NATed during 225 their travel through the network. Figure 1 illustrates the process. 227 Packet contents on a client -> server packet 228 +--------+ 229 | Client | src = 131.160.175.2 dst = 129.15.6.1 clear text 230 +--------+ ^ 231 | 10.0.0.1 | 232 | | src = 10.0.0.1 dst = 129.15.6.1 ESP 233 | | 234 +-----+ | 235 | NAT | SAs 236 +-----+ | 237 | 131.160.175.2 | 238 | | src = 131.160.175.2 dst = 129.15.6.1 ESP 239 | 129.15.5.1 | 240 +--------+ v 241 | Server | src = 131.160.175.2 dst = 129.15.6.1 clear text 242 +--------+ 244 Figure 1 246 A drawback in this scheme is that the Client must either know its 247 public IP address, or it must rely on the Server to tell what address 248 to use. It must be noticed that if the NAT box is mapping several 249 internal IP addresses into a single public address, the public 250 address cannot be directly used. In that case the client and server 251 need to agree on a unique address, to be used to internally represent 252 the client. It must be pointed out that such an address is 253 semantically very similar to a Mobile IP home address. The details 254 of such address agreement are beyond the scope of this document. 256 4.2 Mobile IP 258 In Mobile IP, the BEET mode could be used instead of the currently 259 defined wire formats. If the hosts would be using end-to-end ESP 260 anyway, this has the benefit of saving the space that would otherwise 261 be taken by the standard Mobile IP wire formats. Furthermore, in 262 BEET the inner IP header does not actually appear in the wire format. 263 Effectively, this makes BEET as space efficient for mobile nodes as 264 the standard ESP transport mode is today between fixed hosts. 266 Instead of having a separate Binding Cache, the nodes could include 267 the address translation information into a pair of BEET mode security 268 associations. 270 4.2.1 Mobile IPv4 272 In the current Mobile IPv4, two different wire formats are used, 273 depending on whether there is a NAT device between the communicating 274 hosts or not. See Figure 2, below. 276 Mobile IPv4 wire format without NAT traversal 278 IP(CoA->HA) | IP(HoA->CN) | payload 280 Mobile IPv4 wire format with NAT traversal 282 IP(CoA->HA) | UDP(any->434) | MIP header | IP(HoA->CN) | payload 284 (where the MIP header is a minimal 4 octet header) 286 [Figure courtesy to Sami Vaarala.] 288 Figure 2 290 It is required that the inner address representing the mobile node, 291 as seen by the application, is always the home address. That is, 292 from the application point of view, the packets flow between the home 293 address and the correspondent node address. 295 If IPsec is used to protect the traffic between the Mobile Node and 296 the Correspondent node, ESP transport mode can be used. However, the 297 transport mode ESP packet is enclosed into an IP-over-IP wrapper at 298 the home agent, see Figure 3. 300 Current Mobile IPv4 wire format with end-to-end ESP transport mode: 302 CN -> HA: IP(CN->HoA) | ESP | payload | ESP trailer 303 HA -> MN: IP(HA->CoA) | IP(CN->HoA) | ESP | payload | ESP trailer 305 MN -> HA: IP(CoA->HA) | IP(HoA->CN) | ESP | payload | ESP trailer 306 HA -> CN: IP(HoA->CN) | ESP | payload | ESP trailer 308 Proposed Mobile IPv4 wire format with ESP BEET mode: 310 CN -> HA: IP(CN->HoA) | ESP | payload | ESP trailer 311 HA -> MN: IP(HA->CoA) | ESP | payload | ESP trailer 313 MN -> HA: IP(CoA->HA) | ESP | payload | ESP trailer 314 HA -> CN: IP(HoA->CN) | ESP | payload | ESP trailer 316 Figure 3 318 In this scenario, the correspondent node does not need to be aware 319 that the security association is in fact using the BEET mode. If the 320 home agent and the mobile node co-operate, and the mobile node 321 implements the BEET semantics, the change could be implemented 322 transparently to the correspondent node. 324 As multiple CNs may choose same SPI for receiving data from HA, the 325 HA must implement SPINAT [8] towards MN. Thus, the SPI used to 326 receive packets from MN at HA would uniquely identify the real 327 destination CN. This SPI must be negotiated per CN basis but as it is 328 assumed that there would be a end-to-end SA anyway the amount of 329 signaling doesn't need to be increased 331 It should be noticed that the space savings are even larger in the 332 NAT traversal situation, as is illustrated in Figure Figure 4, below. 334 Current Mobile IPv4 NAT-traversal wire format with end-to-end transport ESP: 336 CN -> HA: IP(CN->HoA) | ESP | payload | ESP trailer 337 HA -> MN: IP(HA->CoA) | UDP | MIP | IP(CN->HoA) | ESP | payload | ESP trailer 339 MN -> HA: IP(CoA->HA) | UDP | MIP | IP(HoA->CN) | ESP | payload | ESP trailer 340 HA -> CN: IP(HoA->CN) | ESP | payload | ESP trailer 342 Proposed Mobile IPv4 NAT-traversal wire format with BEET ESP: 344 CN -> HA: IP(CN->HoA) | ESP | payload | ESP trailer 345 HA -> MN: IP(HA->CoA) | UDP | ESP | payload | ESP trailer 346 MN -> HA: IP(CoA->HA) | UDP | ESP | payload | ESP trailer 347 HA -> CN: IP(HoA->CN) | ESP | payload | ESP trailer 349 Figure 4 351 4.2.2 Mobile IPv4 route optimization 353 BEET can be used for route optimization purposes as the outer IP 354 address can always be set to as the current CoA of the MN. Likewise 355 the MN can set the outer address as the address of the CN instead of 356 the HA's address, although this would require that both ends support 357 BEET mode. Binding updates would be sent to the CN as well instead of 358 just updating the location on HA. Revealing MN's real location to the 359 CN is not always desirable. 361 4.2.3 Mobile IPv6 363 Triangular routing in Mobile IPv6 is similar to that of Mobile IPv4. 364 However, the tunnel between the home agent and the mobile node is an 365 ESP tunnel instead of being a plain IP-over-IP tunnel. However, if 366 BEET mode was used between the correspondent node and the mobile 367 node, the ESP tunnel between the home agent and the mobile node would 368 not bring any additional protection to the payload data. Thus, in 369 that case BEET could replace the ESP tunnel, similar to the IPv4 370 case, illustrated in Figure 3 above. 372 Mobile IPv6 Route Optimization uses a Type 2 Routing Header (RH) and 373 Home Address Option (HAO) in the packet wire format. However, it can 374 be argued that the semantics of these options is equivalent to a 375 optimized point-to-point tunnel. That is, the Type 2 RH defines the 376 real destination address of a packet, thereby effectively creating a 377 partial tunnel where the inner and outer source addresses are 378 identical but the destination addresses differ. Similarly, the Home 379 Address Option defines the real source address of the packet, again 380 creating a partial tunnel. The only difference is that this time the 381 inner and outer destination addresses are identical but the source 382 addresses differ. 384 Thus, for Mobile IPv6, BEET mode would define a different wire format 385 for the payload packets. Instead of using Type 2 RH and HAO, the 386 packets could be encapsulated into a BEET mode ESP tunnel. In the 387 case that ESP is used anyway, this has the advantage that the 388 standard Mobile IPv6 extra headers are not needed, thereby saving 389 bytes in the headers. Compared to tunnel mode ESP, BEET mode has the 390 advantage that the inner IP header is not needed. 392 In Mobile IPv6, mobility management can be implemented just as 393 before, using the HoTI/CoTI, HoT/CoT and Binding Update (BU) 394 messages. The difference would lay in handling Binding Updates. If 395 BEET mode was used, processing Binding Updates would change the outer 396 IP addresses in the BEET mode Security Associations instead of 397 changing the Binding Cache. 399 4.3 End-node multi-address multi-homing 401 The BEET mode provides for limited end-node multi-address 402 multi-homing. It semantically provides a tunnel between the 403 end-hosts, with fixed inner IP addresses. This allows a multi-homed 404 host to use different outer IP addresses in different packets, 405 without any notice by the upper layer protocols. The upper layer 406 protocols see the inner IP address at all times. Thus, this limited 407 form of multi-homing has no affect on the applications, which 408 seemingly communicate over fixed IP addresses all the time. 410 Implementing this kind of limited multi-homing support would require 411 a small change to the current IPsec SPD and SA implementations. 412 Currently the incoming SA selection is based on the SPI and 413 destination address, with the implicit assumption that there is only 414 one possible destination address for each incoming SA. In a 415 multi-homed host it would be desirable to have multiple destination 416 addresses associated with the SA, thereby allowing the same SA to be 417 used independent on the actual destination address in the packets. 418 Removing the destination address from unicast SA lookup is already 419 being proposed in the current ESP draft [4]. 421 If it is considered undesirable to change the implementations to 422 support multiple alternative destination addresses, it would still be 423 possible to support limited multi-homing by creating several parallel 424 SAs, one for each destination address. Each of these SAs would have 425 identical inner addresses. Effectively, this would distribute the 426 tunnel over multiple SAs. 428 In this latter implementation, the outgoing SA processing becomes 429 more complex. Selecting the outgoing SA does not depend only on the 430 inner IP addresses but also on the outer destination address. 431 Selecting the outer destination address depends on the current 432 multi-homing situation. This creates a situation where the SA 433 processing must be deferred after selecting the actual outer address 434 to be used. This might be difficult in some implementations. 436 4.4 Host Identity Protocol 438 The Host Identity Protocol (HIP) as a piece of more recent 439 development. Its aim is to explore the possibilities created by 440 separating the end-host identifier and locator of IP addresses. 441 There are currently five implementations, and the specifications are 442 being finalized. [9][10] 444 In HIP, the TCP and UDP sockets are not bound to IP addresses but to 445 Host Identifiers (HI). The Host Identifiers create a new independent 446 name space. 448 The BEET mode could be used to support HIP by defining the inner 449 tunnel in terms of Host Identifiers and the outer tunnel in terms of 450 standard IP addresses. In that way all processing prior to outgoing 451 ESP and after incoming ESP uses Host Identifiers. The wire format 452 packets use standard IP addresses and ESP transport packet format. 454 5. Protocol definition 456 In this section we define the exact protocol formats and operations. 457 This section is normative. 459 5.1 Changes to Security Association data structures 461 A BEET mode Security Association contains the same data as a regular 462 tunnel mode Security Association, with the exception that the inner 463 selectors must be single addresses and cannot be subnets. The data 464 includes the following: 465 A pair of inner IP addresses. 466 A pair of outer IP addresses. 467 Cryptographic keys and other data as defined in RFC2401 [3] 468 Section 4.4.3. 469 A conforming implementation MAY store the data in a way different 470 than or similar to a regular tunnel mode Security Association. 472 Note that in a conforming implementation the inner and outer 473 addresses MAY belong to different address families. All 474 implementations that support both IPv4 and IPv6 SHOULD support both 475 IPv4-over-IPv6 and IPv6-over-IPv4 tunneling. 477 5.2 Packet format 479 The wire packet format is identical to the ESP transport mode wire 480 format as defined in [4] Section 3.1.1. However, the resulting 481 packet contains outer IP addresses instead of the inner IP addresses 482 received from the upper layer. The construction of the outer headers 483 is defined in RFC2401 [3] Section 5.1.2. The following diagram 484 illustrates ESP BEET mode positioning for typical IPv4 and IPv6 485 packets. 487 IPv4 INNER ADDRESSES 488 -------------------- 490 BEFORE APPLYING ESP 491 ------------------------------ 492 | inner IP hdr | | | 493 | (any options) | TCP | Data | 494 ------------------------------ 496 AFTER APPLYING ESP, OUTER v4 ADDRESSES 497 ---------------------------------------------------- 498 | outer IP hdr | | | | ESP | ESP | 499 | (any options) | ESP | TCP | Data | Trailer | ICV | 500 ---------------------------------------------------- 501 |<---- encryption ---->| 502 |<-------- integrity ------->| 504 AFTER APPLYING ESP, OUTER v6 ADDRESSES 505 ------------------------------------------------------ 506 | outer | new ext | | | | ESP | ESP | 507 | IP hdr | hdrs. | ESP | TCP | Data | Trailer| ICV | 508 ------------------------------------------------------ 509 |<--- encryption ---->| 510 |<------- integrity ------->| 512 IPv6 INNER ADDRESSES 513 -------------------- 515 BEFORE APPLYING ESP 516 ------------------------------------------ 517 | | ext hdrs | | | 518 | inner IP hdr | if present | TCP | Data | 519 ------------------------------------------ 521 AFTER APPLYING ESP, OUTER v6 ADDRESSES 522 -------------------------------------------------------------- 523 | outer | new ext | | dest | | | ESP | ESP | 524 | IP hdr | hdrs. | ESP | opts.| TCP | Data | Trailer | ICV | 525 -------------------------------------------------------------- 526 |<---- encryption ---->| 527 |<------- integrity ------>| 529 AFTER APPLYING ESP, OUTER v4 ADDRESSES 530 ---------------------------------------------------- 531 | outer | | dest | | | ESP | ESP | 532 | IP hdr | ESP | opts.| TCP | Data | Trailer | ICV | 533 ---------------------------------------------------- 534 |<------- encryption -------->| 535 |<----------- integrity ----------->| 537 5.3 Cryptographic processing 539 The outgoing packets MUST be protected exactly as in ESP transport 540 mode [4]. That is, the upper layer protocol packet is wrapped into 541 an ESP header, encrypted, and authenticated exactly as if regular 542 transport mode was used. The resulting ESP packet is subject to IP 543 header processing as defined in Section 5.4 and Section 5.5. The 544 incoming ESP protected messages are verified and decrypted exactly as 545 if regular transport mode was used. The resulting clear text packet 546 is subject to IP header processing as defined in Section 5.4 and 547 Section 5.6. 549 5.4 IP header processing 551 The biggest difference between the BEET mode and the other two modes 552 is in IP header processing. In the regular transport mode the IP 553 header is kept intact. In the regular tunnel mode an outer IP header 554 is created on output and discarded on input. In the BEET mode the IP 555 header is replaced with another one on both input and output. 557 On the BEET mode output side, the IP header processing MUST first 558 ensure that the IP addresses in the original IP header contain the 559 inner addresses as specified in the SA. This MAY be ensured by 560 proper policy processing, and it is possible that no checks are 561 needed at the SA processing time. Once the IP header has been 562 verified to contain the right IP inner addresses, it is discarded. A 563 new IP header is created, using the discarded inner header as a hint 564 for other fields but the IP addresses. The IP addresses in the new 565 header MUST be the outer tunnel addresses. 567 On input side, the received IP header is simply discarded. Since the 568 packet has been decrypted and verified, no further checks are 569 necessary. A new IP header, corresponding to a tunnel mode inner 570 header, is created, using the discarded outer header as a hint for 571 other fields but the IP addresses. The IP addresses in the new header 572 MUST be the inner addresses. 574 As the outer header fields are used as hint for creating inner 575 header, it must be noted that inner header differs as compared to 576 tunnel-mode inner header. In BEET mode the inner header will have the 577 TTL, DF-bit and other option values of the outer header which must be 578 considered as the inner header of BEET mode is being processed. 580 5.5 Handling of outgoing packets 582 The outgoing BEET mode packets are processed as follows: 583 1. The system MUST verify that the IP header contains the inner 584 source and destination addresses, exactly as defined in the SA. 585 This verification MAY be explicit, or it MAY be implicit, for 586 example, as a result of prior policy processing. Note that in 587 some implementations there may be no real IP header at this time 588 but the source and destination addresses may be carried 589 out-of-band. In the case where the source address is still 590 unassigned, it SHOULD be made sure that the designated inner 591 source address would have been selected at a later stage. 592 2. The IP payload (the contents of the packet beyond the IP header) 593 is wrapped into an ESP header as defined in [4] Section 3.3. 594 3. A new IP header is constructed, replacing the original one. The 595 new IP header MUST contain the outer source and destination 596 addresses, as defined in the SA. Note that in some 597 implementations there may be no real IP header at this time but 598 the source and destination addresses may be carried out-of-band. 599 In the case where the source address must be left unassigned, it 600 SHOULD be made sure that the right source address is selected at 601 a later stage. Other than the addresses, it is RECOMMENDED that 602 the new IP header copies the fields from the original IP header. 603 4. If there are any IPv4 header options in the original packet, it 604 is RECOMMENDED that they are discarded. If the inner header 605 contains an option that must be transported between the tunnel 606 end-points, sender MAY encapsulate the inner header in to ESP 607 packet and set the ESP next header as IPv4 (4). Thus, sender 608 encapsulates the whole IP datagram similarly as in tunnel-mode. 609 The inner header MUST contain the inner addresses as specified in 610 the SA. 612 Instead of literally discarding the IP header and constructing a new 613 one a conforming implementation MAY simply replace the addresses in 614 an existing header. However, if the RECOMMENDED feature of allowing 615 the inner and outer addresses from different address families is 616 used, this simple strategy does not work. 618 5.6 Handling of incoming packets 620 The incoming BEET mode packets are processed as follows: 621 1. The system MUST verify and decrypt the incoming packet 622 successfully, as defined in [4] section 3.4. If the verification 623 or decryption fails, the packet MUST be discarded. 624 2. The original IP header is simply discarded, without any checks. 625 Since the ESP verification succeeded, the packet can be safely 626 assumed to have arrived from the right sender. 627 3. If the sender has set the ESP next protocol field to IPv4 and 628 included the inner header as previously described, the receiver 629 MUST verify that the inner header contains correct inner 630 addresses. If verification fails, the packet MUST be discarded. 631 The receiver MUST processes the inner header and options as if 632 the packet would have been received in tunnel-mode and the inner 633 header would have contained the receivers address as destination. 634 4. A new IP header is constructed, replacing the original one. The 635 new IP header MUST contain the inner source and destination 636 addresses, as defined in the SA. Note that in some 637 implementations the real IP header may have already been 638 discarded and the source and destination addresses are carried 639 out-of-band. In such case the out-of-band addresses MUST be the 640 inner addresses. Other than the addresses, it is RECOMMENDED 641 that the new IP header copies the fields from the original IP 642 header. 644 Instead of literally discarding the IP header and constructing a new 645 one a conforming implementation MAY simply replace the addresses in 646 an existing header. However, if the RECOMMENDED feature of allowing 647 the inner and outer addresses from different address families is 648 used, this simple strategy does not work. 650 6. Policy considerations 652 In this section we describe how the BEET mode affects on IPsec policy 653 processing. This section is normative. 655 A BEET Security Association SHOULD NOT be used with NULL 656 authentication. 658 On the output side, the IPsec policy processing mechanism SHOULD take 659 care that only packets with IP addresses matching with the inner 660 addresses of a Security Association are passed to that Security 661 Association. If the policy mechanism do not provide full assurance 662 on this, the SA processing MUST check the addresses. Further policy 663 distinction may be specified based on IP version, upper layer 664 protocol, and ports. If such restrictions are defined, they MUST be 665 enforced. 667 On the output side, the policy rules SHOULD prevent any packets 668 containing the inner IP addresses pair from escaping to the wire in 669 clear text. 671 On the input side, there is no policy processing necessary on 672 encrypted packets. The SA is found based on the SPI and destination 673 address. A single SA MAY be associated with several destination 674 addresses. Since the outer IPsec addresses are discarded, and since 675 the packet authenticity and integrity is protected by ESP, there is 676 no need to check the outer addresses. Since the inner addresses are 677 fixed and restored from the SA, there is no need to check them. 678 There MAY be further policy rules specifying allowed upper layer 679 protocols and ports. If such restrictions are defined, they MUST be 680 enforced. 682 On the input side, there SHOULD be a policy rule that filters out 683 clear text packets that contain the inner addresses. 685 7. PF_KEY extensions 687 This section defines the necessary extensions to the PF_KEYv2 API [2] 688 to support the BEET mode. This section is informative. 690 A BEET mode Security Association is created by specifying the inner 691 IP addresses in the PF_KEYv2 Identity extensions, using two new 692 identity types. The identity types of the source and destination 693 identity extensions MUST be identical, i.e. either IPv4 or IPv6. 695 (#define SADB_X_IDENTTYPE_ADDR 4) 696 #define SADB_IDENTTYPE_BEET_IPV4_ADDRESS 5 697 #define SADB_IDENTTYPE_BEET_IPV6_ADDRESS 6 698 #define SADB_IDENTTYPE_MAX 6 700 When these new identity types are used, the contents of the identity 701 field in the PF_KEY messages MUST be a binary address, in network 702 byte order. 704 For SADB_IDENTTYPE_BEET_IPV4_ADDRESS the length of the identity MUST 705 be exactly four octets. For SADB_IDENTTYPE_BEET_IPV6_ADDRESS the 706 length must be exactly 16 octets. 708 Additionally, a new IPsec mode is defined in ipsec.h, and used in the 709 unspecified but commonly used the PF_KEY extension SADB_X_EXT_SA2 710 field sadb_x_sa2_mode. 712 #define IPSEC_MODE_BEET 3 714 If an SA is specified using SADB_X_EXT_SA2, if the sadb_x_sa2_mode is 715 IPSEC_MODE_BEET, and if the source and destination identities are 716 defined in terms of SADB_IDENTTYPE_BEET_IPV4_ADDRESS or 717 SADB_IDENTTY_BEET_IPV6_ADDRESS, then the BEET mode MUST be used. If 718 an SA is specified using SADB_X_EXT_SA2, if the sadb_x_sa2_mode is 719 IPSEC_MODE_BEET, and if the identities are defined in terms (other 720 than the new types defined above) that exactly match to single IPv4 721 or IPv6 addresses, then the BEET mode SHOULD be used. 723 8. New requirements on Key Management protocols 725 In this section we discuss the requirements that the new mode places 726 upon existing and new key management protocols. This section is 727 informative. 729 In order to provide support for the BEET mode, key agreement protocol 730 implementations must understand the existence of such a mode. In 731 some situations it is sufficient that the BEET mode is implemented at 732 the IPsec ESP level only at one end as long as the key management is 733 aware of its usage. For example, the NAT scenario described in 734 Section 4.1 does not require a BEET ESP implementation at the server 735 end. It is sufficient that the client implements the BEET mode; in 736 fact, if the client somehow knows it public IP address it may be able 737 to set up the BEET mode security associations without any explicit 738 concent on the server end. On the other hand, if the client does not 739 know its public IP address, it needs help from the server in order to 740 determine it. 742 More generally, one can get benefit from the BEET mode only to the 743 extend the key management protocol supports it. If the key 744 management protocol is fully aware of mobility and multi-homing 745 issues, and provides facilities for signaling changes in the current 746 connectivity situation, it is relatively easy to implement end-node 747 mobility and multi-address multi-homing with BEET. An example of 748 such usage is HIP [10]. Additionally, current IPsec NAT traversal 749 with IKEv1 includes a "SHOULD" statement for the stationary end to 750 update the remote IP address of the peer whenever a valid IPsec 751 packet arrives. Unfortunately, such practise MAY be vulnerable to 752 various flooding attacks, cf. [12]. 754 9. Implementing the functionality with other means 756 It is currently possible to implement the equivalent of BEET mode by 757 using transport mode ESP and explicit network address translation at 758 the end-hosts themselves. In this section we briefly compare these 759 two alternatives. The purpose of this section is to give background 760 information for security considerations. This section is 761 informative. 763 In an implementation using the BEET mode, the input side IP address 764 translation is integrated with the decryption and integrity 765 verification processing. The packet is passed and given the inner 766 addresses if and only if it is correctly decrypted and verified. A 767 typical IPsec SPD implementation would prohibit receiving unprotected 768 IP packets that use the inner addresses on the wire, as it is done in 769 the regular tunnel mode. At the same time, any other uses of the 770 outer addresses would be trivial; passing a packet to the SA requires 771 both that the packet has an ESP header and that the SPI matches. 773 In an implementation based on separate address translation and 774 transport mode ESP, the address translation and cryptographic 775 processing are completely separate. In practise, the host must 776 translate the outer IP address into the inner IP addresses before the 777 packet is passed to IPsec. (The other way around may not be secure, 778 since there would be no way for the address translation process to 779 know if the packet was correctly decrypted and verified or if it was 780 received via some other means.) Using the outer addresses for other 781 purposes may be hard, depending on the implementation of the address 782 translation mechanism. In particular, using the outer addresses on 783 other ESP SAs may be hard, since the typical address translation 784 mechanisms could be only configured with the protocol level (ESP vs. 785 not) and do not understand SPIs. 787 At the output side, a BEET mode implementation takes care of 788 translating the inner addresses to outer addresses, as a part of the 789 encryption process. The IPsec SPD contains necessary entries that 790 make sure that the inner addresses never leak. 792 In an implementation based on separate components, the output packets 793 would be passed with inner addresses from IPsec to the address 794 translation mechanism. The address translation mechanism will then 795 translate the inner addresses to outer addresses. While this does 796 not prevent usage of the outer addresses for other purposes, the 797 configuration is brittle and error prone. If there are mistakes at 798 the IPsec configuration, the address translation mechanism may 799 translate unprotected packets, leading to potential confusion. If 800 there are mistakes at the address translation side, the inner 801 addresses may leak to the network. 803 10. Security Considerations 805 In this section we discuss the security properties of the BEET mode, 806 discussing some limitations [11]. This section is normative. 808 There are no known new vulnerabilities that the introduction of the 809 BEET mode would create. 811 It is currently possible to implement the equivalent of BEET mode by 812 using transport mode ESP and explicit network address translation at 813 the end-hosts themselves. However, such an implementation is more 814 complex, less flexible, and potentially more vulnerable to security 815 problems that are caused by misconfigurations; see Section 9. 817 The main security benefit is an operational one. To implement the 818 same functionality without the BEET mode typically requires 819 configuring three different, unrelated components in the hosts. 821 The transport mode ESP SAs must be configured. 823 A host based NAT function must be configured to properly translate 824 between the inner and outer addresses. 826 A host firewall must be configured to properly filter out packets 827 so that inner addresses do not leak in or out. 829 While it may be possible to configure these components to achieve the 830 same functionality, such a configuration is error prone, increasing 831 the probability of security vulnerabilities. An integrated BEET mode 832 implementation is less prone to configuration mistakes. Furthermore, 833 it would be fairly hard to implement portable key management 834 protocols that would be able to configure all of the required 835 components at the same time. On the other hand, it would be easy to 836 provide a portable key management protocol implementation that would 837 be able to configure BEET mode SAs through the specified PF_KEY 838 extensions. 840 Since the BEET security associations have the semantics of a fixed, 841 point-to-point tunnel between two IP addresses, it is possible to 842 place one or both of the tunnel end points into other nodes but those 843 that actually "possess" the inner IP addresses, i.e., to implement a 844 BEET mode proxy. However, since such usage defeats the security 845 benefits of combined ESP and hostNAT processing, as discussed above, 846 the implementations SHOULD NOT support such usage. 848 11. IANA Considerations 850 The PF_KEYv2 interface should probably have an IANA registry. 852 12. Acknowledgments 854 During the 56th IETF meeting in San Francisco and afterwards, the 855 following people made comments on the ideas, helping the author to 856 write the draft: Jari Arkko, Steven Bellovin, Charlie Kaufman, Tero 857 Kivinen, Cheryl Madson, Andrew McGrecor, Robert Moskowitz, Michael 858 Richardson, Timothy Shepard, Jukka Ylitalo, Sami Vaarala. 860 The author ows special thanks to Derek Atkins and Steve Kent, who 861 strongly opposed the idea during the San Francisco IETF, and thereby 862 forced writing a high quality initial draft. 864 13. References 866 13.1 Normative references 868 [1] Bradner, S., "Key words for use in RFCs to Indicate Requirement 869 Levels", BCP 14, RFC 2119, March 1997. 871 [2] McDonald, D., Metz, C. and B. Phan, "PF_KEY Key Management API, 872 Version 2", RFC 2367, July 1998. 874 [3] Kent, S. and R. Atkinson, "Security Architecture for the 875 Internet Protocol", RFC 2401, November 1998. 877 [4] Kent, S., "IP Encapsulating Security Payload (ESP)", 878 draft-ietf-ipsec-esp-v3-05 (work in progress), April 2003. 880 13.2 Informative references 882 [5] Arkko, J. and P. Nikander, "Limitations in IPsec Policy", 883 Security Protocols 11th International Workshop, Cambridge, UK, 884 April 2-4, 2003, LNCS to be published, Springer, April 2003. 886 [6] Ionnadis, J., "Why we still don't have IPsec", Network and 887 Distributed Systems Security Symposium (NDSS'03), Internet 888 Society, February 2003. 890 [7] Bellovin, S., "EIDs, IPsec, and HostNAT", IETF 41th, March 891 1998. 893 [8] Ylitalo, J., Melen, J., Nikander, P. and V. Torvinen, 894 "Re-thinking Security in IP based Micro-Mobility", 7th 895 Information Security Conference (ISC'04) , Palo Alto, 896 September 27-29, 2004, to be published, Springer, September 897 2004. 899 [9] Moskowitz, R., "Host Identity Protocol Architecture", 900 draft-moskowitz-hip-arch-03 (work in progress), May 2003. 902 [10] Nikander, P. and R. Moskowitz, "Host Identity Protocol", 903 draft-moskowitz-hip-06 (work in progress), May 2003. 905 [11] Rescorla, E. and B. Korver, "Guidelines for Writing RFC Text on 906 Security Considerations", draft-iab-sec-cons-03 (work in 907 progress), February 2003. 909 [12] Nikander, P., "Mobile IP version 6 Route Optimization Security 910 Design Background", draft-nikander-mobileip-v6-ro-sec-00 (work 911 in progress), April 2003. 913 Authors' Addresses 915 Pekka Nikander 916 Ericsson Research Nomadic Lab 918 JORVAS FIN-02420 919 FINLAND 921 Phone: +358 9 299 1 922 EMail: pekka.nikander@nomadiclab.com 924 Jan Melen 925 Ericsson Research Nomadic Lab 927 JORVAS FIN-02420 928 FINLAND 930 Phone: +358 9 299 1 931 EMail: jan.melen@nomadiclab.com 933 Appendix A. Implementation experiences 935 We have implemented the BEET mode to the FreeBSD 5.2.1 KAME stack. 936 Our implementation uses the PF_KEYv2 identity extension, as described 937 in Section 7. 939 The current implementation is based on four hooks placed at the 940 strategical locations at the ESP and ip_output processing. We 941 support full IPv4/IPv6 conversions, allowing both IPv4-over-IPv6 and 942 IPv6-over-IPv4 tunneling. The number of lines changed in the KAME 943 policy processing is 36 lines; these changes were necessary to fully 944 support the identity extension, which was partly unimplemented in the 945 KAME stack. The hooks themselves take 83 lines, and the protocol 946 processing code is 450 lines long. About 90% of the protocol 947 processing code was copied and pasted from the IPsec tunnel mode and 948 transport mode routines, with minimal changes. About 70% of the code 949 is needed to implement v4-over-v6 and v6-over-v4 tunneling. The 950 number of actual functional lines for the simple v4-over-v4 and 951 v6-over-v6 cases is mere 62 lines. The implementation effort took 952 three days from two programmers, including writing simple test cases 953 and performing rudimentary testing on the implementation to see that 954 it works. 956 The current implementation is tailored for experimentation. A more 957 proper implementation would implement all of the processing as an 958 integral part of the IPsec processing. The current KAME code 959 supports only two modes. Once the necessary cleanups, such as 960 replacing "if" statements with "switch" statements, and additions for 961 supporting v4-over-v6 and v6-over-v4 tunneling is in place, we expect 962 the extra protocol processing code required by the BEET mode to take 963 less than 100 lines. 965 Appendix B. Garden beets 967 Commonly known as the garden beet, this firm, round root vegetable 968 has leafy green tops, which are also edible and highly nutritious. 969 The most common color for beets (called "beetroots" in the British 970 Isles) is a garnet red. However, they can range in color from deep 971 red to white, the most intriguing being the Chioggia (also called 972 "candy cane"), with its concentric rings of red and white. Beets are 973 available year-round and should be chosen by their firmness and 974 smooth skins. 976 Intellectual Property Statement 978 The IETF takes no position regarding the validity or scope of any 979 Intellectual Property Rights or other rights that might be claimed to 980 pertain to the implementation or use of the technology described in 981 this document or the extent to which any license under such rights 982 might or might not be available; nor does it represent that it has 983 made any independent effort to identify any such rights. Information 984 on the IETF's procedures with respect to rights in IETF Documents can 985 be found in BCP 78 and BCP 79. 987 Copies of IPR disclosures made to the IETF Secretariat and any 988 assurances of licenses to be made available, or the result of an 989 attempt made to obtain a general license or permission for the use of 990 such proprietary rights by implementers or users of this 991 specification can be obtained from the IETF on-line IPR repository at 992 http://www.ietf.org/ipr. 994 The IETF invites any interested party to bring to its attention any 995 copyrights, patents or patent applications, or other proprietary 996 rights that may cover technology that may be required to implement 997 this standard. Please address the information to the IETF at 998 ietf-ipr@ietf.org. 1000 Disclaimer of Validity 1002 This document and the information contained herein are provided on an 1003 "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS 1004 OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY AND THE INTERNET 1005 ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, 1006 INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE 1007 INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED 1008 WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. 1010 Copyright Statement 1012 Copyright (C) The Internet Society (2004). This document is subject 1013 to the rights, licenses and restrictions contained in BCP 78, and 1014 except as set forth therein, the authors retain all their rights. 1016 Acknowledgment 1018 Funding for the RFC Editor function is currently provided by the 1019 Internet Society.