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