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