idnits 2.17.1 draft-ietf-hip-esp-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 19. -- Found old boilerplate from RFC 3978, Section 5.5 on line 1262. -- Found old boilerplate from RFC 3979, Section 5, paragraph 1 on line 1239. -- Found old boilerplate from RFC 3979, Section 5, paragraph 2 on line 1246. -- Found old boilerplate from RFC 3979, Section 5, paragraph 3 on line 1252. ** 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 : ---------------------------------------------------------------------------- No issues found here. 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 15, 2006) is 6525 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) == Outdated reference: A later version (-10) exists of draft-ietf-hip-base-05 ** Downref: Normative reference to an Experimental draft: draft-ietf-hip-base (ref. '5') ** Downref: Normative reference to an Informational draft: draft-ietf-hip-arch (ref. '7') -- Possible downref: Non-RFC (?) normative reference: ref. '8' -- Obsolete informational reference (is this intentional?): RFC 2409 (ref. '10') (Obsoleted by RFC 4306) == Outdated reference: A later version (-09) exists of draft-nikander-esp-beet-mode-05 == Outdated reference: A later version (-05) exists of draft-ietf-hip-mm-03 Summary: 5 errors (**), 0 flaws (~~), 5 warnings (==), 9 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group P. Jokela 3 Internet-Draft Ericsson Research NomadicLab 4 Expires: December 17, 2006 R. Moskowitz 5 ICSAlabs, a Division of TruSecure 6 Corporation 7 P. Nikander 8 Ericsson Research NomadicLab 9 June 15, 2006 11 Using ESP transport format with HIP 12 draft-ietf-hip-esp-03 14 Status of this Memo 16 By submitting this Internet-Draft, each author represents that any 17 applicable patent or other IPR claims of which he or she is aware 18 have been or will be disclosed, and any of which he or she becomes 19 aware will be disclosed, in accordance with Section 6 of BCP 79. 21 Internet-Drafts are working documents of the Internet Engineering 22 Task Force (IETF), its areas, and its working groups. Note that 23 other groups may also distribute working documents as Internet- 24 Drafts. 26 Internet-Drafts are draft documents valid for a maximum of six months 27 and may be updated, replaced, or obsoleted by other documents at any 28 time. It is inappropriate to use Internet-Drafts as reference 29 material or to cite them other than as "work in progress." 31 The list of current Internet-Drafts can be accessed at 32 http://www.ietf.org/ietf/1id-abstracts.txt. 34 The list of Internet-Draft Shadow Directories can be accessed at 35 http://www.ietf.org/shadow.html. 37 This Internet-Draft will expire on December 17, 2006. 39 Copyright Notice 41 Copyright (C) The Internet Society (2006). 43 Abstract 45 This memo specifies an Encapsulated Security Payload (ESP) based 46 mechanism for transmission of user data packets, to be used with the 47 Host Identity Protocol (HIP). 49 Table of Contents 51 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 4 52 2. Conventions used in this document . . . . . . . . . . . . . . 5 53 3. Using ESP with HIP . . . . . . . . . . . . . . . . . . . . . . 6 54 3.1. ESP Packet Format . . . . . . . . . . . . . . . . . . . . 6 55 3.2. Conceptual ESP Packet Processing . . . . . . . . . . . . . 6 56 3.2.1. Semantics of the Security Parameter Index (SPI) . . . 7 57 3.3. Security Association Establishment and Maintenance . . . . 7 58 3.3.1. ESP Security Associations . . . . . . . . . . . . . . 8 59 3.3.2. Rekeying . . . . . . . . . . . . . . . . . . . . . . . 8 60 3.3.3. Security Association Management . . . . . . . . . . . 9 61 3.3.4. Security Parameter Index (SPI) . . . . . . . . . . . . 9 62 3.3.5. Supported Transforms . . . . . . . . . . . . . . . . . 9 63 3.3.6. Sequence Number . . . . . . . . . . . . . . . . . . . 10 64 3.3.7. Lifetimes and Timers . . . . . . . . . . . . . . . . . 10 65 4. The Protocol . . . . . . . . . . . . . . . . . . . . . . . . . 11 66 4.1. ESP in HIP . . . . . . . . . . . . . . . . . . . . . . . . 11 67 4.1.1. Setting up an ESP Security Association . . . . . . . . 11 68 4.1.2. Updating an Existing ESP SA . . . . . . . . . . . . . 12 69 5. Parameter and Packet Formats . . . . . . . . . . . . . . . . . 13 70 5.1. New Parameters . . . . . . . . . . . . . . . . . . . . . . 13 71 5.1.1. ESP_INFO . . . . . . . . . . . . . . . . . . . . . . . 13 72 5.1.2. ESP_TRANSFORM . . . . . . . . . . . . . . . . . . . . 14 73 5.1.3. NOTIFY Parameter . . . . . . . . . . . . . . . . . . . 15 74 5.2. HIP ESP Security Association Setup . . . . . . . . . . . . 16 75 5.2.1. Setup During Base Exchange . . . . . . . . . . . . . . 16 76 5.3. HIP ESP Rekeying . . . . . . . . . . . . . . . . . . . . . 17 77 5.3.1. Initializing Rekeying . . . . . . . . . . . . . . . . 18 78 5.3.2. Responding to the Rekeying Initialization . . . . . . 18 79 5.4. ICMP Messages . . . . . . . . . . . . . . . . . . . . . . 19 80 5.4.1. Unknown SPI . . . . . . . . . . . . . . . . . . . . . 19 81 6. Packet Processing . . . . . . . . . . . . . . . . . . . . . . 20 82 6.1. Processing Outgoing Application Data . . . . . . . . . . . 20 83 6.2. Processing Incoming Application Data . . . . . . . . . . . 20 84 6.3. HMAC and SIGNATURE Calculation and Verification . . . . . 21 85 6.4. Processing Incoming ESP SA Initialization (R1) . . . . . . 21 86 6.5. Processing Incoming Initialization Reply (I2) . . . . . . 22 87 6.6. Processing Incoming ESP SA Setup Finalization (R2) . . . . 22 88 6.7. Dropping HIP Associations . . . . . . . . . . . . . . . . 22 89 6.8. Initiating ESP SA Rekeying . . . . . . . . . . . . . . . . 22 90 6.9. Processing Incoming UPDATE Packets . . . . . . . . . . . . 24 91 6.9.1. Processing UPDATE Packet: No Outstanding Rekeying 92 Request . . . . . . . . . . . . . . . . . . . . . . . 24 93 6.10. Finalizing Rekeying . . . . . . . . . . . . . . . . . . . 25 94 6.11. Processing NOTIFY Packets . . . . . . . . . . . . . . . . 26 95 7. Keying Material . . . . . . . . . . . . . . . . . . . . . . . 27 96 8. Security Considerations . . . . . . . . . . . . . . . . . . . 28 97 9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 29 98 10. References . . . . . . . . . . . . . . . . . . . . . . . . . . 30 99 10.1. Normative references . . . . . . . . . . . . . . . . . . . 30 100 10.2. Informative references . . . . . . . . . . . . . . . . . . 30 101 Appendix A. A Note on Implementation Options . . . . . . . . . . 31 102 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 32 103 Intellectual Property and Copyright Statements . . . . . . . . . . 33 105 1. Introduction 107 In the Host Identity Protocol Architecture [7], hosts are identified 108 with public keys. The Host Identity Protocol [5] base exchange 109 allows any two HIP-supporting hosts to authenticate each other and to 110 create a HIP association between themselves. During the base 111 exchange, the hosts generate a piece of shared keying material using 112 an authenticated Diffie-Hellman exchange. 114 The HIP base exchange specification [5] does not describe any 115 transport formats, or methods for user data, to be used during the 116 actual communication; it only defines that it is mandatory to 117 implement the Encapsulated Security Payload (ESP) [4] based transport 118 format and method. This document specifies how ESP is used with HIP 119 to carry actual user data. 121 To be more specific, this document specifies a set of HIP protocol 122 extensions and their handling. Using these extensions, a pair of ESP 123 Security Associations (SAs) is created between the hosts during the 124 base exchange. The resulting ESP Security Associations use keys 125 drawn from the keying material (KEYMAT) generated during the base 126 exchange. After the HIP association and required ESP SAs have been 127 established between the hosts, the user data communication is 128 protected using ESP. In addition, this document specifies methods to 129 update an existing ESP Security Association. 131 It should be noted that representations of host identity are not 132 carried explicitly in the headers of user data packets. Instead, the 133 ESP Security Parameter Index (SPI) is used to indicate the right host 134 context. The SPIs are selected during the HIP ESP setup exchange. 135 For user data packets, ESP SPIs (in possible combination with IP 136 addresses) are used indirectly to identify the host context, thereby 137 avoiding any additional explicit protocol headers. 139 2. Conventions used in this document 141 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 142 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 143 document are to be interpreted as described in RFC2119 [1]. 145 3. Using ESP with HIP 147 The HIP base exchange is used to set up a HIP association between two 148 hosts. The base exchange provides two-way host authentication and 149 key material generation, but it does not provide any means for 150 protecting data communication between the hosts. In this document we 151 specify the use of ESP for protecting user data traffic after the HIP 152 base exchange. Note that this use of ESP is intended only for host- 153 to-host traffic; security gateways are not supported. 155 To support ESP use, the HIP base exchange messages require some minor 156 additions to the parameters transported. In the R1 packet, the 157 responder adds the possible ESP transforms in a new ESP_TRANSFORM 158 parameter before sending it to the Initiator. The Initiator gets the 159 proposed transforms, selects one of those proposed transforms, and 160 adds it to the I2 packet in an ESP_TRANSFORM parameter. In this I2 161 packet, the Initiator also sends the SPI value that it wants to be 162 used for ESP traffic flowing from the Responder to the Initiator. 163 This information is carried using the new ESP_INFO parameter. When 164 finalizing the ESP SA setup, the Responder sends its SPI value to the 165 Initiator in the R2 packet, again using ESP_INFO. 167 3.1. ESP Packet Format 169 The ESP specification [4] defines the ESP packet format for IPsec. 170 The HIP ESP packet looks exactly the same as the IPsec ESP transport 171 format packet. The semantics, however, are a bit different and are 172 described in more detail in the next subsection. 174 3.2. Conceptual ESP Packet Processing 176 ESP packet processing can be implemented in different ways in HIP. 177 It is possible to implement it in a way that a standards compliant, 178 unmodified IPsec implementation [4] can be used. 180 When a standards compliant IPsec implementation that uses IP 181 addresses in the SPD and SAD is used, the packet processing may take 182 the following steps. For outgoing packets, assuming that the upper 183 layer pseudoheader has been built using IP addresses, the 184 implementation recalculates upper layer checksums using HITs and, 185 after that, changes the packet source and destination addresses back 186 to corresponding IP addresses. The packet is sent to the IPsec ESP 187 for transport mode handling and from there the encrypted packet is 188 sent to the network. When an ESP packet is received, the packet is 189 first put to the IPsec ESP transport mode handling, and after 190 decryption, the source and destination IP addresses are replaced with 191 HITs and finally, upper layer checksums are verified before passing 192 the packet to the upper layer. 194 An alternative way to implement the packet processing is the BEET 195 (Bound End-to-End Tunnel) [11] mode. In BEET mode, the ESP packet is 196 formatted as a transport mode packet, but the semantics of the 197 connection are the same as for tunnel mode. The "outer" addresses of 198 the packet are the IP addresses and the "inner" addresses are the 199 HITs. For outgoing traffic, after the packet has been encrypted, the 200 packet's IP header is changed to a new one, containing IP addresses 201 instead of HITs and the packet is sent to the network. When ESP 202 packet is received, the SPI value, together with the integrity 203 protection, allow the packet to be securely associated with the right 204 HIT pair. The packet header is replaces with a new header, 205 containing HITs and the packet is decrypted. 207 3.2.1. Semantics of the Security Parameter Index (SPI) 209 SPIs are used in ESP to find the right Security Association for 210 received packets. The ESP SPIs have added significance when used 211 with HIP; they are a compressed representation of a pair of HITs. 212 Thus, SPIs MAY be used by intermediary systems in providing services 213 like address mapping. Note that since the SPI has significance at 214 the receiver, only the < DST, SPI >, where DST is a destination IP 215 address, uniquely identifies the receiver HIT at any given point of 216 time. The same SPI value may be used by several hosts. A single < 217 DST, SPI > value may denote different hosts and contexts at different 218 points of time, depending on the host that is currently reachable at 219 the DST. 221 Each host selects for itself the SPI it wants to see in packets 222 received from its peer. This allows it to select different SPIs for 223 different peers. The SPI selection SHOULD be random; the rules of 224 Section 2.1 of the ESP specification [4] must be followed. A 225 different SPI SHOULD be used for each HIP exchange with a particular 226 host; this is to avoid a replay attack. Additionally, when a host 227 rekeys, the SPI MUST be changed. Furthermore, if a host changes over 228 to use a different IP address, it MAY change the SPI. 230 One method for SPI creation that meets the above criteria would be to 231 concatenate the HIT with a 32-bit random or sequential number, hash 232 this (using SHA1), and then use the high order 32 bits as the SPI. 234 The selected SPI is communicated to the peer in the third (I2) and 235 fourth (R2) packets of the base HIP exchange. Changes in SPI are 236 signaled with ESP_INFO parameters. 238 3.3. Security Association Establishment and Maintenance 239 3.3.1. ESP Security Associations 241 In HIP, ESP Security Associations are setup between the HIP nodes 242 during the base exchange [5]. Existing ESP SAs can be updated later 243 using UPDATE messages. The reason for updating the ESP SA later can 244 be e.g. need for rekeying the SA because of sequence number rollover. 246 Upon setting up a HIP association, each association is linked to two 247 ESP SAs, one for incoming packets and one for outgoing packets. The 248 Initiator's incoming SA corresponds with the Responder's outgoing 249 one, and vice versa. The Initiator defines the SPI for its incoming 250 association, as defined in Section 3.2.1. This SA is herein called 251 SA-RI, and the corresponding SPI is called SPI-RI. Respectively, the 252 Responder's incoming SA corresponds with the Initiator's outgoing SA 253 and is called SA-IR, with the SPI being called SPI-IR. 255 The Initiator creates SA-RI as a part of R1 processing, before 256 sending out the I2, as explained in Section 6.4. The keys are 257 derived from KEYMAT, as defined in Section 7. The Responder creates 258 SA-RI as a part of I2 processing, see Section 6.5. 260 The Responder creates SA-IR as a part of I2 processing, before 261 sending out R2; see Section 6.5. The Initiator creates SA-IR when 262 processing R2; see Section 6.6. 264 The initial session keys are drawn from the generated keying 265 material, KEYMAT, after the HIP keys have been drawn as specified in 266 [5]. 268 When the HIP association is removed, the related ESP SAs MUST also be 269 removed. 271 3.3.2. Rekeying 273 After the initial HIP base exchange and SA establishment, both hosts 274 are in the ESTABLISHED state. There are no longer Initiator and 275 Responder roles and the association is symmetric. In this 276 subsection, the party that initiates the rekey procedure is denoted 277 with I' and the peer with R'. 279 An existing HIP-created ESP SA may need updating during the lifetime 280 of the HIP association. This document specifies the rekeying of an 281 existing HIP-created ESP SA, using the UPDATE message. The ESP_INFO 282 parameter introduced above is used for this purpose. 284 I' initiates the ESP SA updating process when needed (see 285 Section 6.8). It creates an UPDATE packet with required information 286 and sends it to the peer node. The old SAs are still in use, local 287 policy permitting. 289 R', after receiving and processing the UPDATE (see Section 6.9), 290 generates new SAs: SA-I'R' and SA-R'I'. It does not take the new 291 outgoing SA into use, but still uses the old one, so there 292 temporarily exists two SA pairs towards the same peer host. The SPI 293 for the new outgoing SA, SPI-R'I', is specified in the received 294 ESP_INFO parameter in the UPDATE packet. For the new incoming SA, R' 295 generates the new SPI value, SPI-I'R', and includes it in the 296 response UPDATE packet. 298 When I' receives a response UPDATE from R', it generates new SAs, as 299 described in Section 6.9: SA-I'R' and SA-R'I'. It starts using the 300 new outgoing SA immediately. 302 R' starts using the new outgoing SA when it receives traffic on the 303 new incoming SA or when it receives the UPDATE ACK confirming 304 completion of rekeying. After this, R' can remove the old SAs. 305 Similarly, when the I' receives traffic from the new incoming SA, it 306 can safely remove the old SAs. 308 3.3.3. Security Association Management 310 An SA pair is indexed by the 2 SPIs and 2 HITs (both local and remote 311 HITs since a system can have more than one HIT). An inactivity timer 312 is RECOMMENDED for all SAs. If the state dictates the deletion of an 313 SA, a timer is set to allow for any late arriving packets. 315 3.3.4. Security Parameter Index (SPI) 317 The SPIs in ESP provide a simple compression of the HIP data from all 318 packets after the HIP exchange. This does require a per HIT-pair 319 Security Association (and SPI), and a decrease of policy granularity 320 over other Key Management Protocols like IKE. 322 When a host updates the ESP SA, it provides a new inbound SPI to and 323 gets a new outbound SPI from its partner. 325 3.3.5. Supported Transforms 327 All HIP implementations MUST support AES [3] and HMAC-SHA-1-96 [2]. 328 If the Initiator does not support any of the transforms offered by 329 the Responder, it should abandon the negotiation and inform the peer 330 with a NOTIFY message about a non-supported transform. 332 In addition to AES, all implementations MUST implement the ESP NULL 333 encryption algorithm. When the ESP NULL encryption is used, it MUST 334 be used together with SHA1 or MD5 authentication as specified in 335 Section 5.1.2 337 3.3.6. Sequence Number 339 The Sequence Number field is MANDATORY when ESP is used with HIP. 340 Anti-replay protection MUST be used in an ESP SA established with 341 HIP. When ESP is used with HIP, a 64-bit sequence number MUST be 342 used. This means that each host MUST rekey before its sequence 343 number reaches 2^64. 345 When using a 64-bit sequence number, the higher 32 bits are NOT 346 included in the ESP header, but are simply kept local to both peers. 347 See [9]. 349 3.3.7. Lifetimes and Timers 351 HIP does not negotiate any lifetimes. All ESP lifetimes are local 352 policy. The only lifetimes a HIP implementation MUST support are 353 sequence number rollover (for replay protection), and SHOULD support 354 timing out inactive ESP SAs. An SA times out if no packets are 355 received using that SA. The default timeout value is 15 minutes. 356 Implementations MAY support lifetimes for the various ESP transforms. 357 Each implementation SHOULD implement per-HIT configuration of the 358 inactivity timeout, allowing statically configured HIP associations 359 to stay alive for days, even when inactive. 361 4. The Protocol 363 In this section, the protocol for setting up an ESP association to be 364 used with HIP association is described. 366 4.1. ESP in HIP 368 4.1.1. Setting up an ESP Security Association 370 Setting up an ESP Security Association between hosts using HIP 371 consists of three messages passed between the hosts. The parameters 372 are included in R1, I2, and R2 messages during base exchange. 374 Initiator Responder 376 I1 377 ----------------------------------> 379 R1: ESP_TRANSFORM 380 <---------------------------------- 382 I2: ESP_TRANSFORM, ESP_INFO 383 ----------------------------------> 385 R2: ESP_INFO 386 <---------------------------------- 388 Setting up an ESP Security Association between HIP hosts requires 389 three messages to exchange the information that is required during an 390 ESP communication. 392 The R1 message contains the ESP_TRANSFORM parameter, in which the 393 sending host defines the possible ESP transforms it is willing to use 394 for the ESP SA. 396 The I2 message contains the response to an ESP_TRANSFORM received in 397 the R1 message. The sender must select one of the proposed ESP 398 transforms from the ESP_TRANSFORM parameter in the R1 message and 399 include the selected one in the ESP_TRANSFORM parameter in the I2 400 packet. In addition to the transform, the host includes the ESP_INFO 401 parameter, containing the SPI value to be used by the peer host. 403 In the R2 message, the ESP SA setup is finalized. The packet 404 contains the SPI information required by the Initiator for the ESP 405 SA. 407 4.1.2. Updating an Existing ESP SA 409 The update process is accomplished using two messages. The HIP 410 UPDATE message is used to update the parameters of an existing ESP 411 SA. The UPDATE mechanism and message is defined in [5] and the 412 additional parameters for updating an existing ESP SA are described 413 here. 415 The following picture shows a typical exchange when an existing ESP 416 SA is updated. Messages include SEQ and ACK parameters required by 417 the UPDATE mechanism. 419 H1 H2 420 UPDATE: SEQ, ESP_INFO [, DIFFIE_HELLMAN] 421 -----------------------------------------------------> 423 UPDATE: SEQ, ACK, ESP_INFO [, DIFFIE_HELLMAN] 424 <----------------------------------------------------- 426 UPDATE: ACK 427 -----------------------------------------------------> 429 The host willing to update the ESP SA creates and sends an UPDATE 430 message. The message contains the ESP_INFO parameter, containing the 431 old SPI value that was used, the new SPI value to be used, and the 432 index value for the keying material, giving the point from where the 433 next keys will be drawn. If new keying material must be generated, 434 the UPDATE message will also contain the DIFFIE_HELLMAN parameter, 435 defined in [5]. 437 The host receiving the UPDATE message requesting update of an 438 existing ESP SA, MUST reply with an UPDATE message. In the reply 439 message, the host sends the ESP_INFO parameter containing the 440 corresponding values: old SPI, new SPI, and the keying material 441 index. If the incoming UPDATE contained a DIFFIE_HELLMAN parameter, 442 the reply packet MUST also contain a DIFFIE_HELLMAN parameter. 444 5. Parameter and Packet Formats 446 In this section, new and modified HIP parameters are presented, as 447 well as modified HIP packets. 449 5.1. New Parameters 451 Two new HIP parameters are defined for setting up ESP transport 452 format associations in HIP communication and for rekeying existing 453 ones. Also, the NOTIFY parameter, described in [5], has two new 454 error parameters. 456 Parameter Type Length Data 458 ESP_INFO 65 12 Remote's old SPI, 459 new SPI and other info 460 ESP_TRANSFORM 4095 variable ESP Encryption and 461 Authentication Transform(s) 463 5.1.1. ESP_INFO 465 During the establishment and update of an ESP SA, the SPI value of 466 both hosts must be transmitted between the hosts. Additional 467 information that is required when the hosts are drawing keys from the 468 generated keying material is the index value into the KEYMAT from 469 where the keys are drawn. The ESP_INFO parameter is used to transmit 470 this information between the hosts. 472 During the initial ESP SA setup, the hosts send the SPI value that 473 they want the peer to use when sending ESP data to them. The value 474 is set in the New SPI field of the ESP_INFO parameter. In the 475 initial setup, an old value for the SPI does not exist, thus the Old 476 SPI value field is set to zero. The Old SPI field value may also be 477 zero when additional SAs are set up between HIP hosts, e.g. in case 478 of multihomed HIP hosts [12]. However, such use is beyond the scope 479 of this specification. 481 The Keymat index value points to the place in the KEYMAT from where 482 the keying material for the ESP SAs is drawn. The Keymat index value 483 is zero only when the ESP_INFO is sent during a rekeying process and 484 new keying material is generated. 486 During the life of an SA established by HIP, one of the hosts may 487 need to reset the Sequence Number to one and rekey. The reason for 488 rekeying might be an approaching sequence number wrap in ESP, or a 489 local policy on use of a key. Rekeying ends the current SAs and 490 starts new ones on both peers. 492 During the rekeying process, the ESP_INFO parameter is used to 493 transmit the changed SPI values and the keying material index. 495 0 1 2 3 496 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 497 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 498 | Type | Length | 499 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 500 | Reserved | Keymat Index | 501 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 502 | Old SPI | 503 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 504 | New SPI | 505 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 507 Type 65 508 Length 12 509 Keymat Index Index, in bytes, where to continue to draw ESP keys 510 from KEYMAT. If the packet includes a new 511 Diffie-Hellman key and the ESP_INFO is sent in an 512 UPDATE packet, the field MUST be zero. If the 513 ESP_INFO is included in base exchange messages, the 514 Keymat Index must have the index value of the point 515 from where the ESP SA keys are drawn. Note that the 516 length of this field limits the amount of 517 keying material that can be drawn from KEYMAT. If 518 that amount is exceeded, the packet MUST contain 519 a new Diffie-Hellman key. 520 Old SPI Old SPI for data sent to address(es) associated 521 with this SA. If this is an initial SA setup, the 522 Old SPI value is zero. 523 New SPI New SPI for data sent to address(es) associated 524 with this SA. 526 5.1.2. ESP_TRANSFORM 528 The ESP_TRANSFORM parameter is used during ESP SA establishment. The 529 first party sends a selection of transform families in the 530 ESP_TRANSFORM parameter and the peer must select one of the proposed 531 values and include it in the response ESP_TRANSFORM parameter. 533 0 1 2 3 534 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 535 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 536 | Type | Length | 537 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 538 | Reserved | Suite-ID #1 | 539 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 540 | Suite-ID #2 | Suite-ID #3 | 541 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 542 | Suite-ID #n | Padding | 543 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 545 Type 4095 546 Length length in octets, excluding Type, Length, and 547 padding 548 Reserved zero when sent, ignored when received 549 Suite-ID defines the ESP Suite to be used 551 The following Suite-IDs are defined ([6],[8]): 553 Suite-ID Value 555 RESERVED 0 556 ESP-AES-CBC with HMAC-SHA1 1 557 ESP-3DES-CBC with HMAC-SHA1 2 558 ESP-3DES-CBC with HMAC-MD5 3 559 ESP-BLOWFISH-CBC with HMAC-SHA1 4 560 ESP-NULL with HMAC-SHA1 5 561 ESP-NULL with HMAC-MD5 6 563 The sender of an ESP transform parameter MUST make sure that there 564 are no more than six (6) Suite-IDs in one ESP transform parameter. 565 Conversely, a recipient MUST be prepared to handle received transport 566 parameters that contain more than six Suite-IDs. The limited number 567 of Suite-IDs sets the maximum size of ESP_TRANSFORM parameter. As 568 the default configuration, the ESP_TRANSFORM parameter MUST contain 569 at least one of the mandatory Suite-IDs. There MAY be a 570 configuration option that allows the administrator to override this 571 default. 573 Mandatory implementations: ESP-AES-CBC with HMAC-SHA1 and ESP-NULL 574 with HMAC-SHA1. 576 5.1.3. NOTIFY Parameter 578 The HIP base specification defines a set of NOTIFY error types. The 579 following error types are required for describing errors in ESP 580 Transform crypto suites during negotiation. 582 NOTIFY PARAMETER - ERROR TYPES Value 583 ------------------------------ ----- 585 NO_ESP_PROPOSAL_CHOSEN 18 587 None of the proposed ESP Transform crypto suites was 588 acceptable. 590 INVALID_ESP_TRANSFORM_CHOSEN 19 592 The ESP Transform crypto suite does not correspond to 593 one offered by the responder. 595 5.2. HIP ESP Security Association Setup 597 The ESP Security Association is set up during the base exchange. The 598 following subsections define the ESP SA setup procedure both using 599 base exchange messages (R1, I2, R2) and using UPDATE messages. 601 5.2.1. Setup During Base Exchange 603 5.2.1.1. Modifications in R1 605 The ESP_TRANSFORM contains the ESP modes supported by the sender, in 606 the order of preference. All implementations MUST support AES [3] 607 with HMAC-SHA-1-96 [2]. 609 The following figure shows the resulting R1 packet layout. 611 The HIP parameters for the R1 packet: 613 IP ( HIP ( [ R1_COUNTER, ] 614 PUZZLE, 615 DIFFIE_HELLMAN, 616 HIP_TRANSFORM, 617 ESP_TRANSFORM, 618 HOST_ID, 619 [ ECHO_REQUEST, ] 620 HIP_SIGNATURE_2 ) 621 [, ECHO_REQUEST ]) 623 5.2.1.2. Modifications in I2 625 The ESP_INFO contains the sender's SPI for this association as well 626 as the keymat index from where the ESP SA keys will be drawn. The 627 Old SPI value is set to zero. 629 The ESP_TRANSFORM contains the ESP mode selected by the sender of R1. 630 All implementations MUST support AES [3] with HMAC-SHA-1-96 [2]. 632 The following figure shows the resulting I2 packet layout. 634 The HIP parameters for the I2 packet: 636 IP ( HIP ( ESP_INFO, 637 [R1_COUNTER,] 638 SOLUTION, 639 DIFFIE_HELLMAN, 640 HIP_TRANSFORM, 641 ESP_TRANSFORM, 642 ENCRYPTED { HOST_ID }, 643 [ ECHO_RESPONSE ,] 644 HMAC, 645 HIP_SIGNATURE 646 [, ECHO_RESPONSE] ) ) 648 5.2.1.3. Modifications in R2 650 The R2 contains an ESP_INFO parameter, which has the SPI value of the 651 sender of the R2 for this association. The ESP_INFO also has the 652 keymat index value specifying where the ESP SA keys are drawn. 654 The following figure shows the resulting R2 packet layout. 656 The HIP parameters for the R2 packet: 658 IP ( HIP ( ESP_INFO, HMAC_2, HIP_SIGNATURE ) ) 660 5.3. HIP ESP Rekeying 662 In this section, the procedure for rekeying an existing ESP SA is 663 presented. 665 Conceptually, the process can be represented by the following message 666 sequence using the host names I' and R' defined in Section 3.3.2. 667 For simplicity, HMAC and HIP_SIGNATURE are not depicted, and 668 DIFFIE_HELLMAN keys are optional. The UPDATE with ACK_I need not be 669 piggybacked with the UPDATE with SEQ_R; it may be acked separately 670 (in which case the sequence would include four packets). 672 I' R' 674 UPDATE(ESP_INFO, SEQ_I, [DIFFIE_HELLMAN]) 675 -----------------------------------> 676 UPDATE(ESP_INFO, SEQ_R, ACK_I, [DIFFIE_HELLMAN]) 677 <----------------------------------- 678 UPDATE(ACK_R) 679 -----------------------------------> 681 Below, the first two packets in this figure are explained. 683 5.3.1. Initializing Rekeying 685 When HIP is used with ESP, the UPDATE packet is used to initiate 686 rekeying. The UPDATE packet MUST carry an ESP_INFO and MAY carry a 687 DIFFIE_HELLMAN parameter. 689 Intermediate systems that use the SPI will have to inspect HIP 690 packets for those that carry rekeying information. The packet is 691 signed for the benefit of the intermediate systems. Since 692 intermediate systems may need the new SPI values, the contents cannot 693 be encrypted. 695 The following figure shows the contents of a rekeying initialization 696 UPDATE packet. 698 The HIP parameters for the UPDATE packet initiating rekeying: 700 IP ( HIP ( ESP_INFO, 701 SEQ, 702 [DIFFIE_HELLMAN, ] 703 HMAC, 704 HIP_SIGNATURE ) ) 706 5.3.2. Responding to the Rekeying Initialization 708 The UPDATE ACK is used to acknowledge the received UPDATE rekeying 709 initialization. The acknowledgement UPDATE packet MUST carry an 710 ESP_INFO and MAY carry a DIFFIE_HELLMAN parameter. 712 Intermediate systems that use the SPI will have to inspect HIP 713 packets for packets carrying rekeying information. The packet is 714 signed for the benefit of the intermediate systems. Since 715 intermediate systems may need the new SPI values, the contents cannot 716 be encrypted. 718 The following figure shows the contents of a rekeying acknowledgement 719 UPDATE packet. 721 The HIP parameters for the UPDATE packet: 723 IP ( HIP ( ESP_INFO, 724 SEQ, 725 ACK, 726 [ DIFFIE_HELLMAN, ] 727 HMAC, 728 HIP_SIGNATURE ) ) 730 5.4. ICMP Messages 732 The ICMP message handling is mainly described in the HIP base 733 specification [5]. In this section, we describe the actions related 734 to ESP security associations. 736 5.4.1. Unknown SPI 738 If a HIP implementation receives an ESP packet that has an 739 unrecognized SPI number, it MAY respond (subject to rate limiting the 740 responses) with an ICMP packet with type "Parameter Problem", with 741 the Pointer pointing to the the beginning of SPI field in the ESP 742 header. 744 6. Packet Processing 746 Packet processing is mainly defined in the HIP base specification 747 [5]. This section describes the changes and new requirements for 748 packet handling when the ESP transport format is used. Note that all 749 HIP packets (currently protocol 99) MUST bypass ESP processing. 751 6.1. Processing Outgoing Application Data 753 Outgoing application data handling is specified in the HIP base 754 specification [5]. When ESP transport format is used, and there is 755 an active HIP session for the given < source, destination > HIT pair, 756 the outgoing datagram is protected using the ESP security 757 association. In a typical implementation, this will result in a 758 BEET-mode ESP packet being sent. BEET-mode [11] was introduced above 759 in Section 3.2. 761 1. Detect the proper ESP SA using the HITs in the packet header or 762 other information associated with the packet 764 2. Process the packet normally, as if the SA was a transport mode 765 SA. 767 3. Ensure that the outgoing ESP protected packet has proper IP 768 header format depending on the used IP address family, and proper 769 IP addresses in its IP header, e.g., by replacing HITs left by 770 the ESP processing. Note that this placement of proper IP 771 addresses MAY also be performed at some other point in the stack, 772 e.g., before ESP processing. 774 6.2. Processing Incoming Application Data 776 Incoming HIP user data packets arrive as ESP protected packets. In 777 the usual case the receiving host has a corresponding ESP security 778 association, identified by the SPI and destination IP address in the 779 packet. However, if the host has crashed or otherwise lost its HIP 780 state, it may not have such an SA. 782 The basic incoming data handling is specified in the HIP base 783 specification. Additional steps are required when ESP is used for 784 protecting the data traffic. The following steps define the 785 conceptual processing rules for incoming ESP protected datagrams 786 targeted to an ESP security association created with HIP. 788 1. Detect the proper ESP SA using the SPI. If the resulting SA is a 789 non-HIP ESP SA, process the packet according to standard IPsec 790 rules. If there are no SAs identified with the SPI, the host MAY 791 send an ICMP packet as defined in Section 5.4. How to handle 792 lost state is an implementation issue. 794 2. If the SPI matches with an active HIP-based ESP SA, the IP 795 addresses in the datagram are replaced with the HITs associated 796 with the SPI. Note that this IP-address-to-HIT conversion step 797 MAY also be performed at some other point in the stack, e.g., 798 after ESP processing. Note also that if the incoming packet has 799 IPv4 addresses, the packet must be converted to IPv6 format 800 before replacing the addresses with HITs (such that the transport 801 checksum will pass if there are no errors). 803 3. The transformed packet is next processed normally by ESP, as if 804 the packet were a transport mode packet. The packet may be 805 dropped by ESP, as usual. In a typical implementation, the 806 result of successful ESP decryption and verification is a 807 datagram with the associated HITs as source and destination. 809 4. The datagram is delivered to the upper layer. Demultiplexing the 810 datagram to the right upper layer socket is performed as usual, 811 except that the HITs are used in place of IP addresses during the 812 demultiplexing. 814 6.3. HMAC and SIGNATURE Calculation and Verification 816 The new HIP parameters described in this document, ESP_INFO and 817 ESP_TRANSFORM, must be protected using HMAC and signature 818 calculations. In a typical implementation, they are included in R1, 819 I2, R2, and UPDATE packet HMAC and SIGNATURE calculations as 820 described in [5]. 822 6.4. Processing Incoming ESP SA Initialization (R1) 824 The ESP SA setup is initialized in the R1 message. The receiving 825 host (Initiator) select one of the ESP transforms from the presented 826 values. If no suitable value is found, the negotiation is 827 terminated. The selected values are subsequently used when 828 generating and using encryption keys, and when sending the reply 829 packet. If the proposed alternatives are not acceptable to the 830 system, it may abandon the ESP SA establishment negotiation, or it 831 may resend the I1 message within the retry bounds. 833 After selecting the ESP transform, and performing other R1 834 processing, the system prepares and creates an incoming ESP security 835 association. It may also prepare a security association for outgoing 836 traffic, but since it does not have the correct SPI value yet, it 837 cannot activate it. 839 6.5. Processing Incoming Initialization Reply (I2) 841 The following steps are required to process the incoming ESP SA 842 initialization replies in I2. The steps below assume that the I2 has 843 been accepted for processing (e.g., has not been dropped due to HIT 844 comparisons as described in [5]). 846 o The ESP_TRANSFORM parameter is verified and it MUST contain a 847 single value in the parameter and it MUST match one of the values 848 offered in the initialization packet. 850 o The ESP_INFO New SPI field is parsed to obtain the SPI that will 851 be used for the Security Association outbound from the Responder 852 and inbound to the Initiator. For this initial ESP SA 853 establishment, the Old SPI value MUST be zero. The Keymat Index 854 field MUST contain the index value to the KEYMAT from where the 855 ESP SA keys are drawn. 857 o The system prepares and creates both incoming and outgoing ESP 858 security associations. 860 o Upon successful processing of the initialization reply message, 861 the possible old Security Associations (as left over from an 862 earlier incarnation of the HIP association) are dropped and the 863 new ones are installed, and a finalizing packet, R2, is sent. 864 Possible ongoing rekeying attempts are dropped. 866 6.6. Processing Incoming ESP SA Setup Finalization (R2) 868 Before the ESP SA can be finalized, the ESP_INFO New SPI field is 869 parsed to obtain the SPI that will be used for the ESP Security 870 Association inbound to the sender of the finalization message R2. 871 The system uses this SPI to create or activate the outgoing ESP 872 security association used for sending packets to the peer. 874 6.7. Dropping HIP Associations 876 When the system drops a HIP association, as described in the HIP base 877 specification, the associated ESP SAs MUST also be dropped. 879 6.8. Initiating ESP SA Rekeying 881 During ESP SA rekeying, the hosts draw new keys from the existing 882 keying material, or a new keying material is generated from where the 883 new keys are drawn. 885 A system may initiate the SA rekeying procedure at any time. It MUST 886 initiate a rekey if its incoming ESP sequence counter is about to 887 overflow. The system MUST NOT replace its keying material until the 888 rekeying packet exchange successfully completes. 890 Optionally, a system may include a new Diffie-Hellman key for use in 891 new KEYMAT generation. New KEYMAT generation occurs prior to drawing 892 the new keys. 894 The rekeying procedure uses the UPDATE mechanism defined in [5]. 895 Because each peer must update its half of the security association 896 pair (including new SPI creation), the rekeying process requires that 897 each side both send and receive an UPDATE. A system will then rekey 898 the ESP SA when it has sent parameters to the peer and has received 899 both an ACK of the relevant UPDATE message and corresponding peer's 900 parameters. It may be that the ACK and the required HIP parameters 901 arrive in different UPDATE messages. This is always true if a system 902 does not initiate ESP SA update but responds to an update request 903 from the peer, but may also occur if two systems initiate update 904 nearly simultaneously. In such a case, if the system has an 905 outstanding update request, it saves the one parameter and waits for 906 the other before completing rekeying. 908 The following steps define the processing rules for initiating an ESP 909 SA update: 911 1. The system decides whether to continue to use the existing KEYMAT 912 or to generate new KEYMAT. In the latter case, the system MUST 913 generate a new Diffie-Hellman public key. 915 2. The system creates an UPDATE packet, which contains the ESP_INFO 916 parameter. In addition, the host may include the optional 917 DIFFIE_HELLMAN parameter. If the UDPATE contains the 918 DIFFIE_HELLMAN parameter, the Keymat Index in the ESP_INFO 919 parameter MUST be zero, and the Diffie-Hellman group ID must be 920 unchanged from that used in the initial handshake. If the UPDATE 921 does not contain DIFFIE_HELLMAN, the ESP_INFO Keymat Index MUST 922 be greater or equal to the index of the next byte to be drawn 923 from the current KEYMAT. 925 3. The system sends the UPDATE packet. For reliability, the 926 underlying UPDATE retransmission mechanism MUST be used. 928 4. The system MUST NOT delete its existing SAs, but continue using 929 them if its policy still allows. The rekeying procedure SHOULD 930 be initiated early enough to make sure that the SA replay 931 counters do not overflow. 933 5. In case a protocol error occurs and the peer system acknowledges 934 the UPDATE but does not itself send an ESP_INFO, the system may 935 not finalize the outstanding ESP SA update request. To guard 936 against this, a system MAY re-initiate the ESP SA update 937 procedure after some time waiting for the peer to respond, or it 938 MAY decide to abort the ESP SA after waiting for an 939 implementation-dependent time. The system MUST NOT keep an 940 oustanding ESP SA update request for an indefinite time. 942 To simplify the state machine, a host MUST NOT generate new UPDATEs 943 while it has an outstanding ESP SA update request, unless it is 944 restarting the update process. 946 6.9. Processing Incoming UPDATE Packets 948 When a system receives an UPDATE packet, it must be processed if the 949 following conditions hold (in addition to the generic conditions 950 specified for UPDATE processing in Section 6.12 of [5]): 952 1. A corresponding HIP association must exist. This is usually 953 ensured by the underlying UPDATE mechanism. 955 2. The state of the HIP association is ESTABLISHED or R2-SENT. 957 If the above conditions hold, the following steps define the 958 conceptual processing rules for handling the received UPDATE packet: 960 1. If the received UPDATE contains a DIFFIE_HELLMAN parameter, the 961 received Keymat Index MUST be zero and the Group ID must match 962 the Group ID in use on the association. If this test fails, the 963 packet SHOULD be dropped and the system SHOULD log an error 964 message. 966 2. If there is no outstanding rekeying request, the packet 967 processing continues as specified in Section 6.9.1. 969 3. If there is an outstanding rekeying request, the UPDATE MUST be 970 acknowledged, the received ESP_INFO (and possibly DIFFIE_HELLMAN) 971 parameters must be saved, and the packet processing continues as 972 specified in Section 6.10. 974 6.9.1. Processing UPDATE Packet: No Outstanding Rekeying Request 976 The following steps define the conceptual processing rules for 977 handling a received UPDATE packet with ESP_INFO parameter: 979 1. The system consults its policy to see if it needs to generate a 980 new Diffie-Hellman key, and generates a new key (with same Group 981 ID) if needed. The system records any newly generated or 982 received Diffie-Hellman keys, for use in KEYMAT generation upon 983 finalizing the ESP SA update. 985 2. If the system generated a new Diffie-Hellman key in the previous 986 step, or if it received a DIFFIE_HELLMAN parameter, it sets 987 ESP_INFO Keymat Index to zero. Otherwise, the ESP_INFO Keymat 988 Index MUST be greater or equal to the index of the next byte to 989 be drawn from the current KEYMAT. In this case, it is 990 RECOMMENDED that the host use the Keymat Index requested by the 991 peer in the received ESP_INFO. 993 3. The system creates an UPDATE packet, which contains an ESP_INFO 994 parameter, and the optional DIFFIE_HELLMAN parameter. This 995 UPDATE would also typically acknowledge the peer's UPDATE with an 996 ACK parameter, although a separate UPDATE ACK may be sent. 998 4. The system sends the UPDATE packet and stores any received 999 ESP_INFO, and DIFFIE_HELLMAN parameters. At this point, it only 1000 needs to receive an acknowledgement for the newly sent UPDATE to 1001 finish ESP SA update. In the usual case, the acknowledgement is 1002 handled by the underlying UPDATE mechanism. 1004 6.10. Finalizing Rekeying 1006 A system finalizes rekeying when it has both received the 1007 corresponding UPDATE acknowledgement packet from the peer and it has 1008 successfully received the peer's UPDATE. The following steps are 1009 taken: 1011 1. If the received UPDATE messages contains a new Diffie-Hellman 1012 key, the system has a new Diffie-Hellman key due to initiating 1013 ESP SA update, or both, the system generates new KEYMAT. If 1014 there is only one new Diffie-Hellman key, the old existing key is 1015 used as the other key. 1017 2. If the system generated new KEYMAT in the previous step, it sets 1018 Keymat Index to zero, independent of whether the received UPDATE 1019 included a Diffie-Hellman key or not. If the system did not 1020 generate new KEYMAT, it uses the greater Keymat Index of the two 1021 (sent and received) ESP_INFO parameters. 1023 3. The system draws keys for new incoming and outgoing ESP SAs, 1024 starting from the Keymat Index, and prepares new incoming and 1025 outgoing ESP SAs. The SPI for the outgoing SA is the new SPI 1026 value received in an ESP_INFO parameter. The SPI for the 1027 incoming SA was generated when the ESP_INFO was sent to the peer. 1028 The order of the keys retrieved from the KEYMAT during rekeying 1029 process is similar to that described in Section 7. Note, that 1030 only IPsec ESP keys are retrieved during rekeying process, not 1031 the HIP keys. 1033 4. The system starts to send to the new outgoing SA and prepares to 1034 start receiving data on the new incoming SA. Once the system 1035 receives data on the new incoming SA it may safely delete the old 1036 SAs. 1038 6.11. Processing NOTIFY Packets 1040 The processing of NOTIFY packets is described in the HIP base 1041 specification. 1043 7. Keying Material 1045 The keying material is generated as described in the HIP base 1046 specification. During the base exchange, the initial keys are drawn 1047 from the generated material. After the HIP association keys have 1048 been drawn, the ESP keys are drawn in the following order: 1050 SA-gl ESP encryption key for HOST_g's outgoing traffic 1052 SA-gl ESP authentication key for HOST_g's outgoing traffic 1054 SA-lg ESP encryption key for HOST_l's outgoing traffic 1056 SA-lg ESP authentication key for HOST_l's outgoing traffic 1058 HOST_g denotes the host with the greater HIT value, and HOST_l the 1059 host with the lower HIT value. When HIT values are compared, they 1060 are interpreted as positive (unsigned) 128-bit integers in network 1061 byte order. 1063 The four HIP keys are only drawn from KEYMAT during a HIP I1->R2 1064 exchange. Subsequent rekeys using UPDATE will only draw the four ESP 1065 keys from KEYMAT. Section 6.9 describes the rules for reusing or 1066 regenerating KEYMAT based on the rekeying. 1068 The number of bits drawn for a given algorithm is the "natural" size 1069 of the keys. For the mandatory algorithms, the following sizes 1070 apply: 1072 AES 128 bits 1074 SHA-1 160 bits 1076 NULL 0 bits 1078 8. Security Considerations 1080 In this document the usage of ESP [4] between HIP hosts to protect 1081 data traffic is introduced. The Security Considerations for ESP are 1082 discussed in the ESP specification. 1084 There are different ways to establish an ESP Security Association 1085 between two nodes. This can be done, e.g. using IKE [10]. This 1086 document specifies how Host Identity Protocol is used to establish 1087 ESP Security Associations. 1089 The following issues are new, or changed from the standard ESP usage: 1091 o Initial keying material generation 1093 o Updating the keying material 1095 The initial keying material is generated using the Host Identity 1096 Protocol [5] using Diffie-Hellman procedure. This document extends 1097 the usage of UDPATE packet, defined in the base specification, to 1098 modify existing ESP SAs. The hosts may rekey, i.e. force the 1099 generation of new keying material using Diffie-Hellman procedure. 1100 The initial setup of ESP SA between the hosts is done during the base 1101 ecxhange and the message exchange is protected with using methods 1102 provided by base exchange. Changing of connection parameters means 1103 basically that the old ESP SA is removed and a new one is generated 1104 once the UPDATE message exchange has been completed. The message 1105 exchange is protected using the HIP association keys. Both HMAC and 1106 signing of packets is used. 1108 9. IANA Considerations 1110 This document defines additional parameters for the Host Identity 1111 Protocol [5]. These parameters are defined in Section 5.1.1 and 1112 Section 5.1.2 with the following numbers: 1114 o ESP_INFO is 65. 1116 o ESP_TRANSFORM is 4095. 1118 10. References 1120 10.1. Normative references 1122 [1] Bradner, S., "Key words for use in RFCs to Indicate Requirement 1123 Levels", BCP 14, RFC 2119, March 1997. 1125 [2] Madson, C. and R. Glenn, "The Use of HMAC-SHA-1-96 within ESP 1126 and AH", RFC 2404, November 1998. 1128 [3] Frankel, S., Glenn, R., and S. Kelly, "The AES-CBC Cipher 1129 Algorithm and Its Use with IPsec", RFC 3602, September 2003. 1131 [4] Kent, S., "IP Encapsulating Security Payload (ESP)", 1132 draft-ietf-ipsec-esp-v3-10 (work in progress), March 2005. 1134 [5] Moskowitz, R., "Host Identity Protocol", draft-ietf-hip-base-05 1135 (work in progress), March 2006. 1137 [6] Schiller, J., "Cryptographic Algorithms for use in the Internet 1138 Key Exchange Version 2", draft-ietf-ipsec-ikev2-algorithms-05 1139 (work in progress), April 2004. 1141 [7] Moskowitz, R. and P. Nikander, "Host Identity Protocol 1142 Architecture", draft-ietf-hip-arch-03 (work in progress), 1143 August 2005. 1145 [8] Schneier, B., "Applied Cryptography Second Edition: protocols 1146 algorithms and source in code in C", 1996. 1148 10.2. Informative references 1150 [9] Kent, S. and K. Seo, "Security Architecture for the Internet 1151 Protocol", draft-ietf-ipsec-rfc2401bis-06 (work in progress), 1152 April 2005. 1154 [10] Harkins, D. and D. Carrel, "The Internet Key Exchange (IKE)", 1155 RFC 2409, November 1998. 1157 [11] Melen, J. and P. Nikander, "A Bound End-to-End Tunnel (BEET) 1158 mode for ESP", draft-nikander-esp-beet-mode-05 (work in 1159 progress), February 2006. 1161 [12] Nikander, P., "End-Host Mobility and Multihoming with the Host 1162 Identity Protocol", draft-ietf-hip-mm-03 (work in progress), 1163 March 2006. 1165 Appendix A. A Note on Implementation Options 1167 It is possible to implement this specification in multiple different 1168 ways. As noted above, one possible way of implementing is to rewrite 1169 IP headers below IPsec. In such an implementation, IPsec is used as 1170 if it was processing IPv6 transport mode packets, with the IPv6 1171 header containing HITs instead of IP addresses in the source and 1172 destionation address fields. In outgoing packets, after IPsec 1173 processing, the HITs are replaced with actual IP addresses, based on 1174 the HITs and the SPI. In incoming packets, before IPsec processing, 1175 the IP addresses are replaced with HITs, based on the SPI in the 1176 incoming packet. In such an implementation, all IPsec policies are 1177 based on HITs and the upper layers only see packets with HITs in the 1178 place of IP addresses. Consequently, support of HIP does not 1179 conflict with other use of IPsec as long as the SPI spaces are kept 1180 separate. 1182 Another way for implementing is to use the proposed BEET mode (A 1183 Bound End-to-End mode for ESP) [11]. The BEET mode provides some 1184 features from both IPsec tunnel and transport modes. The HIP uses 1185 HITs as the "inner" addresses and IP addresses as "outer" addresses 1186 like IP addresses are used in the tunnel mode. Instead of tunneling 1187 packets between hosts, a conversion between inner and outer addresses 1188 is made at end-hosts and the inner address is never sent in the wire 1189 after the initial HIP negotiation. BEET provides IPsec transport 1190 mode syntax (no inner headers) with limited tunnel mode semantics 1191 (fixed logical inner addresses - the HITs - and changeable outer IP 1192 addresses). 1194 Compared to the option of implementing the required address rewrites 1195 outside of IPsec, BEET has one implementation level benefit. The 1196 BEET-way of implementing the address rewriting keeps all the 1197 configuration information in one place, at the SADB. On the other 1198 hand, when address rewriting is implemented separately, the 1199 implementation must make sure that the information in the SADB and 1200 the separate address rewriting DB are kept in synchrony. As a 1201 result, the BEET mode based way of implementing is RECOMMENDED over 1202 the separate implementation. 1204 Authors' Addresses 1206 Petri Jokela 1207 Ericsson Research NomadicLab 1208 JORVAS FIN-02420 1209 FINLAND 1211 Phone: +358 9 299 1 1212 Email: petri.jokela@nomadiclab.com 1214 Robert Moskowitz 1215 ICSAlabs, a Division of TruSecure Corporation 1216 1000 Bent Creek Blvd, Suite 200 1217 Mechanicsburg, PA 1218 USA 1220 Email: rgm@icsalabs.com 1222 Pekka Nikander 1223 Ericsson Research NomadicLab 1224 JORVAS FIN-02420 1225 FINLAND 1227 Phone: +358 9 299 1 1228 Email: pekka.nikander@nomadiclab.com 1230 Intellectual Property Statement 1232 The IETF takes no position regarding the validity or scope of any 1233 Intellectual Property Rights or other rights that might be claimed to 1234 pertain to the implementation or use of the technology described in 1235 this document or the extent to which any license under such rights 1236 might or might not be available; nor does it represent that it has 1237 made any independent effort to identify any such rights. Information 1238 on the procedures with respect to rights in RFC documents can be 1239 found in BCP 78 and BCP 79. 1241 Copies of IPR disclosures made to the IETF Secretariat and any 1242 assurances of licenses to be made available, or the result of an 1243 attempt made to obtain a general license or permission for the use of 1244 such proprietary rights by implementers or users of this 1245 specification can be obtained from the IETF on-line IPR repository at 1246 http://www.ietf.org/ipr. 1248 The IETF invites any interested party to bring to its attention any 1249 copyrights, patents or patent applications, or other proprietary 1250 rights that may cover technology that may be required to implement 1251 this standard. Please address the information to the IETF at 1252 ietf-ipr@ietf.org. 1254 Disclaimer of Validity 1256 This document and the information contained herein are provided on an 1257 "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS 1258 OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY AND THE INTERNET 1259 ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, 1260 INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE 1261 INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED 1262 WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. 1264 Copyright Statement 1266 Copyright (C) The Internet Society (2006). This document is subject 1267 to the rights, licenses and restrictions contained in BCP 78, and 1268 except as set forth therein, the authors retain all their rights. 1270 Acknowledgment 1272 Funding for the RFC Editor function is currently provided by the 1273 Internet Society.