idnits 2.17.1 draft-jokela-hip-rfc5202-bis-03.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (July 15, 2012) is 4293 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) == Missing Reference: 'RFC2451' is mentioned on line 672, but not defined == Missing Reference: 'RFC2410' is mentioned on line 677, but not defined == Missing Reference: 'RFC4868' is mentioned on line 679, but not defined == Missing Reference: 'RFC4309' is mentioned on line 681, but not defined == Missing Reference: 'RFC4106' is mentioned on line 683, but not defined == Unused Reference: 'RFC0791' is defined on line 1300, but no explicit reference was found in the text -- Obsolete informational reference (is this intentional?): RFC 2401 (Obsoleted by RFC 4301) -- Obsolete informational reference (is this intentional?): RFC 4306 (Obsoleted by RFC 5996) -- Obsolete informational reference (is this intentional?): RFC 5206 (Obsoleted by RFC 8046) Summary: 0 errors (**), 0 flaws (~~), 7 warnings (==), 4 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 Intended status: Standards Track R. Moskowitz 5 Expires: January 16, 2013 ICSAlabs, An Independent 6 Division of Verizon Business 7 Systems 8 J. Melen 9 Ericsson Research NomadicLab 10 July 15, 2012 12 Using the Encapsulating Security Payload (ESP) Transport Format with the 13 Host Identity Protocol (HIP) 14 draft-jokela-hip-rfc5202-bis-03 16 Abstract 18 This memo specifies an Encapsulated Security Payload (ESP) based 19 mechanism for transmission of user data packets, to be used with the 20 Host Identity Protocol (HIP). 22 Status of This Memo 24 This Internet-Draft is submitted in full conformance with the 25 provisions of BCP 78 and BCP 79. 27 Internet-Drafts are working documents of the Internet Engineering 28 Task Force (IETF). Note that other groups may also distribute 29 working documents as Internet-Drafts. The list of current Internet- 30 Drafts is at http://datatracker.ietf.org/drafts/current/. 32 Internet-Drafts are draft documents valid for a maximum of six months 33 and may be updated, replaced, or obsoleted by other documents at any 34 time. It is inappropriate to use Internet-Drafts as reference 35 material or to cite them other than as "work in progress." 37 This Internet-Draft will expire on January 16, 2013. 39 Copyright Notice 41 Copyright (c) 2012 IETF Trust and the persons identified as the 42 document authors. All rights reserved. 44 This document is subject to BCP 78 and the IETF Trust's Legal 45 Provisions Relating to IETF Documents 46 (http://trustee.ietf.org/license-info) in effect on the date of 47 publication of this document. Please review these documents 48 carefully, as they describe your rights and restrictions with respect 49 to this document. Code Components extracted from this document must 50 include Simplified BSD License text as described in Section 4.e of 51 the Trust Legal Provisions and are provided without warranty as 52 described in the Simplified BSD License. 54 Table of Contents 56 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 4 57 2. Conventions Used in This Document . . . . . . . . . . . . . . 4 58 3. Using ESP with HIP . . . . . . . . . . . . . . . . . . . . . . 4 59 3.1. ESP Packet Format . . . . . . . . . . . . . . . . . . . . 5 60 3.2. Conceptual ESP Packet Processing . . . . . . . . . . . . . 5 61 3.2.1. Semantics of the Security Parameter Index (SPI) . . . 6 62 3.3. Security Association Establishment and Maintenance . . . . 6 63 3.3.1. ESP Security Associations . . . . . . . . . . . . . . 6 64 3.3.2. Rekeying . . . . . . . . . . . . . . . . . . . . . . . 7 65 3.3.3. Security Association Management . . . . . . . . . . . 8 66 3.3.4. Security Parameter Index (SPI) . . . . . . . . . . . . 8 67 3.3.5. Supported Transforms . . . . . . . . . . . . . . . . . 8 68 3.3.6. Sequence Number . . . . . . . . . . . . . . . . . . . 9 69 3.3.7. Lifetimes and Timers . . . . . . . . . . . . . . . . . 9 70 3.4. IPsec and HIP ESP Implementation Considerations . . . . . 9 71 3.4.1. Data Packet Processing Considerations . . . . . . . . 10 72 3.4.2. HIP Signaling Packet Considerations . . . . . . . . . 10 73 4. The Protocol . . . . . . . . . . . . . . . . . . . . . . . . . 11 74 4.1. ESP in HIP . . . . . . . . . . . . . . . . . . . . . . . . 11 75 4.1.1. Setting Up an ESP Security Association . . . . . . . . 11 76 4.1.2. Updating an Existing ESP SA . . . . . . . . . . . . . 12 77 5. Parameter and Packet Formats . . . . . . . . . . . . . . . . . 12 78 5.1. New Parameters . . . . . . . . . . . . . . . . . . . . . . 12 79 5.1.1. ESP_INFO . . . . . . . . . . . . . . . . . . . . . . . 13 80 5.1.2. ESP_TRANSFORM . . . . . . . . . . . . . . . . . . . . 15 81 5.1.3. NOTIFY Parameter . . . . . . . . . . . . . . . . . . . 16 82 5.2. HIP ESP Security Association Setup . . . . . . . . . . . . 16 83 5.2.1. Setup During Base Exchange . . . . . . . . . . . . . . 16 84 5.3. HIP ESP Rekeying . . . . . . . . . . . . . . . . . . . . . 18 85 5.3.1. Initializing Rekeying . . . . . . . . . . . . . . . . 18 86 5.3.2. Responding to the Rekeying Initialization . . . . . . 19 87 5.4. ICMP Messages . . . . . . . . . . . . . . . . . . . . . . 19 88 5.4.1. Unknown SPI . . . . . . . . . . . . . . . . . . . . . 19 89 6. Packet Processing . . . . . . . . . . . . . . . . . . . . . . 19 90 6.1. Processing Outgoing Application Data . . . . . . . . . . . 20 91 6.2. Processing Incoming Application Data . . . . . . . . . . . 20 92 6.3. HMAC and SIGNATURE Calculation and Verification . . . . . 21 93 6.4. Processing Incoming ESP SA Initialization (R1) . . . . . . 21 94 6.5. Processing Incoming Initialization Reply (I2) . . . . . . 21 95 6.6. Processing Incoming ESP SA Setup Finalization (R2) . . . . 22 96 6.7. Dropping HIP Associations . . . . . . . . . . . . . . . . 22 97 6.8. Initiating ESP SA Rekeying . . . . . . . . . . . . . . . . 22 98 6.9. Processing Incoming UPDATE Packets . . . . . . . . . . . . 24 99 6.9.1. Processing UPDATE Packet: No Outstanding Rekeying 100 Request . . . . . . . . . . . . . . . . . . . . . . . 24 101 6.10. Finalizing Rekeying . . . . . . . . . . . . . . . . . . . 25 102 6.11. Processing NOTIFY Packets . . . . . . . . . . . . . . . . 26 103 7. Keying Material . . . . . . . . . . . . . . . . . . . . . . . 26 104 8. Security Considerations . . . . . . . . . . . . . . . . . . . 26 105 9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 27 106 10. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 27 107 11. References . . . . . . . . . . . . . . . . . . . . . . . . . . 28 108 11.1. Normative references . . . . . . . . . . . . . . . . . . . 28 109 11.2. Informative references . . . . . . . . . . . . . . . . . . 28 110 Appendix A. A Note on Implementation Options . . . . . . . . . . 29 111 Appendix B. Bound End-to-End Tunnel mode for ESP . . . . . . . . 29 112 B.1. Protocol definition . . . . . . . . . . . . . . . . . . . 30 113 B.1.1. Changes to Security Association data structures . . . 30 114 B.1.2. Packet format . . . . . . . . . . . . . . . . . . . . 31 115 B.1.3. Cryptographic processing . . . . . . . . . . . . . . . 32 116 B.1.4. IP header processing . . . . . . . . . . . . . . . . . 33 117 B.1.5. Handling of outgoing packets . . . . . . . . . . . . . 33 118 B.1.6. Handling of incoming packets . . . . . . . . . . . . . 34 119 B.1.7. IPv4 options handling . . . . . . . . . . . . . . . . 35 121 1. Introduction 123 In the Host Identity Protocol Architecture 124 [I-D.moskowitz-hip-rfc4423-bis], hosts are identified with public 125 keys. The Host Identity Protocol [I-D.moskowitz-hip-rfc5201-bis] 126 base exchange allows any two HIP-supporting hosts to authenticate 127 each other and to create a HIP association between themselves. 128 During the base exchange, the hosts generate a piece of shared keying 129 material using an authenticated Diffie-Hellman exchange. 131 The HIP base exchange specification [I-D.moskowitz-hip-rfc5201-bis] 132 does not describe any transport formats or methods for user data to 133 be used during the actual communication; it only defines that it is 134 mandatory to implement the Encapsulated Security Payload (ESP) 135 [RFC4303] based transport format and method. This document specifies 136 how ESP is used with HIP to carry actual user data. 138 To be more specific, this document specifies a set of HIP protocol 139 extensions and their handling. Using these extensions, a pair of ESP 140 Security Associations (SAs) is created between the hosts during the 141 base exchange. The resulting ESP Security Associations use keys 142 drawn from the keying material (KEYMAT) generated during the base 143 exchange. After the HIP association and required ESP SAs have been 144 established between the hosts, the user data communication is 145 protected using ESP. In addition, this document specifies methods to 146 update an existing ESP Security Association. 148 It should be noted that representations of Host Identity are not 149 carried explicitly in the headers of user data packets. Instead, the 150 ESP Security Parameter Index (SPI) is used to indicate the right host 151 context. The SPIs are selected during the HIP ESP setup exchange. 152 For user data packets, ESP SPIs (in possible combination with IP 153 addresses) are used indirectly to identify the host context, thereby 154 avoiding any additional explicit protocol headers. 156 2. Conventions Used in This Document 158 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 159 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 160 document are to be interpreted as described in RFC 2119 [RFC2119]. 162 3. Using ESP with HIP 164 The HIP base exchange is used to set up a HIP association between two 165 hosts. The base exchange provides two-way host authentication and 166 key material generation, but it does not provide any means for 167 protecting data communication between the hosts. In this document, 168 we specify the use of ESP for protecting user data traffic after the 169 HIP base exchange. Note that this use of ESP is intended only for 170 host-to-host traffic; security gateways are not supported. 172 To support ESP use, the HIP base exchange messages require some minor 173 additions to the parameters transported. In the R1 packet, the 174 Responder adds the possible ESP transforms in a npew ESP_TRANSFORM 175 parameter before sending it to the Initiator. The Initiator gets the 176 proposed transforms, selects one of those proposed transforms, and 177 adds it to the I2 packet in an ESP_TRANSFORM parameter. In this I2 178 packet, the Initiator also sends the SPI value that it wants to be 179 used for ESP traffic flowing from the Responder to the Initiator. 180 This information is carried using the new ESP_INFO parameter. When 181 finalizing the ESP SA setup, the Responder sends its SPI value to the 182 Initiator in the R2 packet, again using ESP_INFO. 184 3.1. ESP Packet Format 186 The ESP specification [RFC4303] defines the ESP packet format for 187 IPsec. The HIP ESP packet looks exactly the same as the IPsec ESP 188 transport format packet. The semantics, however, are a bit different 189 and are described in more detail in the next subsection. 191 3.2. Conceptual ESP Packet Processing 193 ESP packet processing can be implemented in different ways in HIP. 194 It is possible to implement it in a way that a standards compliant, 195 unmodified IPsec implementation [RFC4303] can be used. 197 When a standards compliant IPsec implementation that uses IP 198 addresses in the SPD and Security Association Database (SAD) is used, 199 the packet processing may take the following steps. For outgoing 200 packets, assuming that the upper-layer pseudoheader has been built 201 using IP addresses, the implementation recalculates upper-layer 202 checksums using Host Identity Tags (HITs) and, after that, changes 203 the packet source and destination addresses back to corresponding IP 204 addresses. The packet is sent to the IPsec ESP for transport mode 205 handling and from there the encrypted packet is sent to the network. 206 When an ESP packet is received, the packet is first put to the IPsec 207 ESP transport mode handling, and after decryption, the source and 208 destination IP addresses are replaced with HITs and finally, upper- 209 layer checksums are verified before passing the packet to the upper 210 layer. 212 An alternative way to implement packet processing is the BEET (Bound 213 End-to-End Tunnel) mode (see Appendix B). In BEET mode, the ESP 214 packet is formatted as a transport mode packet, but the semantics of 215 the connection are the same as for tunnel mode. The "outer" 216 addresses of the packet are the IP addresses and the "inner" 217 addresses are the HITs. For outgoing traffic, after the packet has 218 been encrypted, the packet's IP header is changed to a new one that 219 contains IP addresses instead of HITs, and the packet is sent to the 220 network. When the ESP packet is received, the SPI value, together 221 with the integrity protection, allow the packet to be securely 222 associated with the right HIT pair. The packet header is replaced 223 with a new header containing HITs, and the packet is decrypted. BEET 224 mode is completely internal for host and doesn't require that the 225 corresponding host implements it, instead the corresponding host can 226 have ESP transport mode and do HIT IP conversions outside ESP. 228 3.2.1. Semantics of the Security Parameter Index (SPI) 230 SPIs are used in ESP to find the right Security Association for 231 received packets. The ESP SPIs have added significance when used 232 with HIP; they are a compressed representation of a pair of HITs. 233 Thus, SPIs MAY be used by intermediary systems in providing services 234 like address mapping. Note that since the SPI has significance at 235 the receiver, only the < DST, SPI >, where DST is a destination IP 236 address, uniquely identifies the receiver HIT at any given point of 237 time. The same SPI value may be used by several hosts. A single < 238 DST, SPI > value may denote different hosts and contexts at different 239 points of time, depending on the host that is currently reachable at 240 the DST. 242 Each host selects for itself the SPI it wants to see in packets 243 received from its peer. This allows it to select different SPIs for 244 different peers. The SPI selection SHOULD be random; the rules of 245 Section 2.1 of the ESP specification [RFC4303] must be followed. A 246 different SPI SHOULD be used for each HIP exchange with a particular 247 host; this is to avoid a replay attack. Additionally, when a host 248 rekeys, the SPI MUST be changed. Furthermore, if a host changes over 249 to use a different IP address, it MAY change the SPI. 251 One method for SPI creation that meets the above criteria would be to 252 concatenate the HIT with a 32-bit random or sequential number, hash 253 this (using SHA1), and then use the high-order 32 bits as the SPI. 255 The selected SPI is communicated to the peer in the third (I2) and 256 fourth (R2) packets of the base HIP exchange. Changes in SPI are 257 signaled with ESP_INFO parameters. 259 3.3. Security Association Establishment and Maintenance 261 3.3.1. ESP Security Associations 263 In HIP, ESP Security Associations are setup between the HIP nodes 264 during the base exchange [I-D.moskowitz-hip-rfc5201-bis]. Existing 265 ESP SAs can be updated later using UPDATE messages. The reason for 266 updating the ESP SA later can be, for example, a need for rekeying 267 the SA because of sequence number rollover. 269 Upon setting up a HIP association, each association is linked to two 270 ESP SAs, one for incoming packets and one for outgoing packets. The 271 Initiator's incoming SA corresponds with the Responder's outgoing 272 one, and vice versa. The Initiator defines the SPI for its incoming 273 association, as defined in Section 3.2.1. This SA is herein called 274 SA-RI, and the corresponding SPI is called SPI-RI. Respectively, the 275 Responder's incoming SA corresponds with the Initiator's outgoing SA 276 and is called SA-IR, with the SPI being called SPI-IR. 278 The Initiator creates SA-RI as a part of R1 processing, before 279 sending out the I2, as explained in Section 6.4. The keys are 280 derived from KEYMAT, as defined in Section 7. The Responder creates 281 SA-RI as a part of I2 processing; see Section 6.5. 283 The Responder creates SA-IR as a part of I2 processing, before 284 sending out R2; see Section 6.5. The Initiator creates SA-IR when 285 processing R2; see Section 6.6. 287 The initial session keys are drawn from the generated keying 288 material, KEYMAT, after the HIP keys have been drawn as specified in 289 [I-D.moskowitz-hip-rfc5201-bis]. 291 When the HIP association is removed, the related ESP SAs MUST also be 292 removed. 294 3.3.2. Rekeying 296 After the initial HIP base exchange and SA establishment, both hosts 297 are in the ESTABLISHED state. There are no longer Initiator and 298 Responder roles and the association is symmetric. In this 299 subsection, the party that initiates the rekey procedure is denoted 300 with I' and the peer with R'. 302 An existing HIP-created ESP SA may need updating during the lifetime 303 of the HIP association. This document specifies the rekeying of an 304 existing HIP-created ESP SA, using the UPDATE message. The ESP_INFO 305 parameter introduced above is used for this purpose. 307 I' initiates the ESP SA updating process when needed (see 308 Section 6.8). It creates an UPDATE packet with required information 309 and sends it to the peer node. The old SAs are still in use, local 310 policy permitting. 312 R', after receiving and processing the UPDATE (see Section 6.9), 313 generates new SAs: SA-I'R' and SA-R'I'. It does not take the new 314 outgoing SA into use, but still uses the old one, so there 315 temporarily exists two SA pairs towards the same peer host. The SPI 316 for the new outgoing SA, SPI-R'I', is specified in the received 317 ESP_INFO parameter in the UPDATE packet. For the new incoming SA, R' 318 generates the new SPI value, SPI-I'R', and includes it in the 319 response UPDATE packet. 321 When I' receives a response UPDATE from R', it generates new SAs, as 322 described in Section 6.9: SA-I'R' and SA-R'I'. It starts using the 323 new outgoing SA immediately. 325 R' starts using the new outgoing SA when it receives traffic on the 326 new incoming SA or when it receives the UPDATE ACK confirming 327 completion of rekeying. After this, R' can remove the old SAs. 328 Similarly, when the I' receives traffic from the new incoming SA, it 329 can safely remove the old SAs. 331 3.3.3. Security Association Management 333 An SA pair is indexed by the 2 SPIs and 2 HITs (both local and remote 334 HITs since a system can have more than one HIT). An inactivity timer 335 is RECOMMENDED for all SAs. If the state dictates the deletion of an 336 SA, a timer is set to allow for any late arriving packets. 338 3.3.4. Security Parameter Index (SPI) 340 The SPIs in ESP provide a simple compression of the HIP data from all 341 packets after the HIP exchange. This does require a per HIT-pair 342 Security Association (and SPI), and a decrease of policy granularity 343 over other Key Management Protocols like IKE. 345 When a host updates the ESP SA, it provides a new inbound SPI to and 346 gets a new outbound SPI from its partner. 348 3.3.5. Supported Transforms 350 All HIP implementations MUST support AES-128-CBC [RFC3602] and HMAC- 351 SHA1 [RFC2404]. If the Initiator does not support any of the 352 transforms offered by the Responder, it should abandon the 353 negotiation and inform the peer with a NOTIFY message about a non- 354 supported transform. 356 In addition to AES-128-CBC, all implementations MUST implement the 357 ESP NULL encryption algorithm. When the ESP NULL encryption is used, 358 it MUST be used together with SHA1 authentication as specified in 359 Section 5.1.2 361 3.3.6. Sequence Number 363 The Sequence Number field is MANDATORY when ESP is used with HIP. 364 Anti-replay protection MUST be used in an ESP SA established with 365 HIP. When ESP is used with HIP, a 64-bit sequence number MUST be 366 used. This means that each host MUST rekey before its sequence 367 number reaches 2^64. 369 When using a 64-bit sequence number, the higher 32 bits are NOT 370 included in the ESP header, but are simply kept local to both peers. 371 See [RFC4301]. 373 3.3.7. Lifetimes and Timers 375 HIP does not negotiate any lifetimes. All ESP lifetimes are local 376 policy. The only lifetimes a HIP implementation MUST support are 377 sequence number rollover (for replay protection), and SHOULD support 378 timing out inactive ESP SAs. An SA times out if no packets are 379 received using that SA. The default timeout value is 15 minutes. 380 Implementations MAY support lifetimes for the various ESP transforms. 381 Each implementation SHOULD implement per-HIT configuration of the 382 inactivity timeout, allowing statically configured HIP associations 383 to stay alive for days, even when inactive. 385 3.4. IPsec and HIP ESP Implementation Considerations 387 When HIP is run on a node where a standards compliant IPsec is used, 388 some issues have to be considered. 390 The HIP implementation must be able to co-exist with other IPsec 391 keying protocols. When the HIP implementation selects the SPI value, 392 it may lead to a collision if not implemented properly. To avoid the 393 possibility for a collision, the HIP implementation MUST ensure that 394 the SPI values used for HIP SAs are not used for IPsec or other SAs, 395 and vice versa. 397 In the sending host, the HIP SA processing takes place always before 398 the IPsec processing. Vice versa, at the receiving host, the IPsec 399 processing is done first for incoming packets and the decrypted 400 packet is further given to the HIP processing. 402 Incoming packets using an SA that is not negotiated by HIP MUST NOT 403 be processed as described in Section 3.2, paragraph 2. The SPI will 404 identify the correct SA for packet decryption and MUST be used to 405 identify that the packet has an upper-layer checksum that is 406 calculated as specified in [I-D.moskowitz-hip-rfc5201-bis]. 408 3.4.1. Data Packet Processing Considerations 410 For outbound traffic, the SPD or (coordinated) SPDs if there are two 411 (one for HIP and one for IPsec) MUST ensure that packets intended for 412 HIP processing are given a HIP-enabled SA and that packets intended 413 for IPsec processing are given an IPsec-enabled SA. The SP then MUST 414 be bound to the matching SA and non-HIP packets will not be processed 415 by this SA. Data originating from a socket that is not using HIP 416 MUST NOT have checksum recalculated (as described in Section 3.2, 417 paragraph 2) and data MUST NOT be passed to the SP or SA created by 418 the HIP. 420 It is possible that in case of overlapping policies, the outgoing 421 packet would be handled both by the IPsec and HIP. In this case, it 422 is possible that the HIP association is end-to-end, while the IPsec 423 SA is for encryption between the HIP host and a Security Gateway. In 424 case of a Security Gateway ESP association, the ESP uses always 425 tunnel mode. 427 In case of IPsec tunnel mode, it is hard to see during the HIP SA 428 processing if the IPsec ESP SA has the same final destination. Thus, 429 traffic MUST be encrypted both with the HIP ESP SA and with the IPsec 430 SA when the IPsec ESP SA is used in tunnel mode. 432 In case of IPsec transport mode, the connection end-points are the 433 same. However, for HIP data packets it is not possible to avoid HIP 434 SA processing, while mapping the HIP data packet's IP addresses to 435 the corresponding HITs requires SPI values from the ESP header. In 436 case of transport mode IPsec SA, the IPsec encryption MAY be skipped 437 to avoid double encryption, if the local policy allows. 439 3.4.2. HIP Signaling Packet Considerations 441 In general, HIP signaling packets should follow the same processing 442 as HIP data packets. 444 In case of IPsec tunnel mode, the HIP signaling packets are always 445 encrypted using IPsec ESP SA. Note, that this hides the HIP 446 signaling packets from the eventual HIP middle boxes on the path 447 between the originating host and the Security Gateway. 449 In case of IPsec transport mode, the HIP signaling packets MAY skip 450 the IPsec ESP SA encryption if the local policy allows. This allows 451 the eventual HIP middle boxes to handle the passing HIP signaling 452 packets. 454 4. The Protocol 456 In this section, the protocol for setting up an ESP association to be 457 used with HIP association is described. 459 4.1. ESP in HIP 461 4.1.1. Setting Up an ESP Security Association 463 Setting up an ESP Security Association between hosts using HIP 464 consists of three messages passed between the hosts. The parameters 465 are included in R1, I2, and R2 messages during base exchange. 467 Initiator Responder 469 I1 470 ----------------------------------> 472 R1: ESP_TRANSFORM 473 <---------------------------------- 475 I2: ESP_TRANSFORM, ESP_INFO 476 ----------------------------------> 478 R2: ESP_INFO 479 <---------------------------------- 481 Setting up an ESP Security Association between HIP hosts requires 482 three messages to exchange the information that is required during an 483 ESP communication. 485 The R1 message contains the ESP_TRANSFORM parameter, in which the 486 sending host defines the possible ESP transforms it is willing to use 487 for the ESP SA. 489 The I2 message contains the response to an ESP_TRANSFORM received in 490 the R1 message. The sender must select one of the proposed ESP 491 transforms from the ESP_TRANSFORM parameter in the R1 message and 492 include the selected one in the ESP_TRANSFORM parameter in the I2 493 packet. In addition to the transform, the host includes the ESP_INFO 494 parameter containing the SPI value to be used by the peer host. 496 In the R2 message, the ESP SA setup is finalized. The packet 497 contains the SPI information required by the Initiator for the ESP 498 SA. 500 4.1.2. Updating an Existing ESP SA 502 The update process is accomplished using two messages. The HIP 503 UPDATE message is used to update the parameters of an existing ESP 504 SA. The UPDATE mechanism and message is defined in 505 [I-D.moskowitz-hip-rfc5201-bis], and the additional parameters for 506 updating an existing ESP SA are described here. 508 The following picture shows a typical exchange when an existing ESP 509 SA is updated. Messages include SEQ and ACK parameters required by 510 the UPDATE mechanism. 512 H1 H2 513 UPDATE: SEQ, ESP_INFO [, DIFFIE_HELLMAN] 514 -----------------------------------------------------> 516 UPDATE: SEQ, ACK, ESP_INFO [, DIFFIE_HELLMAN] 517 <----------------------------------------------------- 519 UPDATE: ACK 520 -----------------------------------------------------> 522 The host willing to update the ESP SA creates and sends an UPDATE 523 message. The message contains the ESP_INFO parameter containing the 524 old SPI value that was used, the new SPI value to be used, and the 525 index value for the keying material, giving the point from where the 526 next keys will be drawn. If new keying material must be generated, 527 the UPDATE message will also contain the DIFFIE_HELLMAN parameter 528 defined in [I-D.moskowitz-hip-rfc5201-bis]. 530 The host receiving the UPDATE message requesting update of an 531 existing ESP SA MUST reply with an UPDATE message. In the reply 532 message, the host sends the ESP_INFO parameter containing the 533 corresponding values: old SPI, new SPI, and the keying material 534 index. If the incoming UPDATE contained a DIFFIE_HELLMAN parameter, 535 the reply packet MUST also contain a DIFFIE_HELLMAN parameter. 537 5. Parameter and Packet Formats 539 In this section, new and modified HIP parameters are presented, as 540 well as modified HIP packets. 542 5.1. New Parameters 544 Two new HIP parameters are defined for setting up ESP transport 545 format associations in HIP communication and for rekeying existing 546 ones. Also, the NOTIFY parameter, described in 548 [I-D.moskowitz-hip-rfc5201-bis], has two new error parameters. 550 Parameter Type Length Data 552 ESP_INFO 65 12 Remote's old SPI, 553 new SPI, and other info 554 ESP_TRANSFORM 4095 variable ESP Encryption and 555 Authentication Transform(s) 557 5.1.1. ESP_INFO 559 During the establishment and update of an ESP SA, the SPI value of 560 both hosts must be transmitted between the hosts. During the 561 establishment and update of an ESP SA, the SPI value of both hosts 562 must be transmitted between the hosts. In addition, hosts need the 563 index value to the KEYMAT when they are drawing keys from the 564 generated keying material. The ESP_INFO parameter is used to 565 transmit the SPI values and the KEYMAT index information between the 566 hosts. 568 During the initial ESP SA setup, the hosts send the SPI value that 569 they want the peer to use when sending ESP data to them. The value 570 is set in the NEW SPI field of the ESP_INFO parameter. In the 571 initial setup, an old value for the SPI does not exist, thus the OLD 572 SPI value field is set to zero. The OLD SPI field value may also be 573 zero when additional SAs are set up between HIP hosts, e.g., in case 574 of multihomed HIP hosts [RFC5206]. However, such use is beyond the 575 scope of this specification. 577 RFC 4301 [RFC4301] describes how to establish multiple SAs to 578 properly support QoS. If different classes of traffic (distinguished 579 by Differentiated Services Code Point (DSCP) bits [RFC3474], 580 [RFC3260]) are sent on the same SA, and if the receiver is employing 581 the optional anti-replay feature available in ESP, this could result 582 in inappropriate discarding of lower priority packets due to the 583 windowing mechanism used by this feature. Therefore, a sender SHOULD 584 put traffic of different classes but with the same selector values on 585 different SAs to support Quality of Service (QoS) appropriately. To 586 permit this, the implementation MUST permit establishment and 587 maintenance of multiple SAs between a given sender and receiver with 588 the same selectors. Distribution of traffic among these parallel SAs 589 to support QoS is locally determined by the sender and is not 590 negotiated by HIP. The receiver MUST process the packets from the 591 different SAs without prejudice. It is possible that the DSCP value 592 changes en route, but this should not cause problems with respect to 593 IPsec processing since the value is not employed for SA selection and 594 MUST NOT be checked as part of SA/packet validation. 596 The KEYMAT index value points to the place in the KEYMAT from where 597 the keying material for the ESP SAs is drawn. The KEYMAT index value 598 is zero only when the ESP_INFO is sent during a rekeying process and 599 new keying material is generated. 601 During the life of an SA established by HIP, one of the hosts may 602 need to reset the Sequence Number to one and rekey. The reason for 603 rekeying might be an approaching sequence number wrap in ESP, or a 604 local policy on use of a key. Rekeying ends the current SAs and 605 starts new ones on both peers. 607 During the rekeying process, the ESP_INFO parameter is used to 608 transmit the changed SPI values and the keying material index. 610 0 1 2 3 611 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 612 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 613 | Type | Length | 614 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 615 | Reserved | KEYMAT Index | 616 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 617 | OLD SPI | 618 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 619 | NEW SPI | 620 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 622 Type 65 623 Length 12 624 KEYMAT Index Index, in bytes, where to continue to draw ESP keys 625 from KEYMAT. If the packet includes a new 626 Diffie-Hellman key and the ESP_INFO is sent in an 627 UPDATE packet, the field MUST be zero. If the 628 ESP_INFO is included in base exchange messages, the 629 KEYMAT Index must have the index value of the point 630 from where the ESP SA keys are drawn. Note that 631 the length of this field limits the amount of 632 keying material that can be drawn from KEYMAT. If 633 that amount is exceeded, the packet MUST contain 634 a new Diffie-Hellman key. 635 OLD SPI old SPI for data sent to address(es) associated 636 with this SA. If this is an initial SA setup, the 637 OLD SPI value is zero. 638 NEW SPI new SPI for data sent to address(es) associated 639 with this SA. 641 5.1.2. ESP_TRANSFORM 643 The ESP_TRANSFORM parameter is used during ESP SA establishment. The 644 first party sends a selection of transform families in the 645 ESP_TRANSFORM parameter, and the peer must select one of the proposed 646 values and include it in the response ESP_TRANSFORM parameter. 648 0 1 2 3 649 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 650 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 651 | Type | Length | 652 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 653 | Reserved | Suite ID #1 | 654 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 655 | Suite ID #2 | Suite ID #3 | 656 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 657 | Suite ID #n | Padding | 658 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 660 Type 4095 661 Length length in octets, excluding Type, Length, and 662 padding 663 Reserved zero when sent, ignored when received 664 Suite ID defines the ESP Suite to be used 666 The following Suite IDs can be used: 668 Suite ID Value 670 RESERVED 0 671 AES-128-CBC with HMAC-SHA1 1 [RFC3602], [RFC2404] 672 3DES-CBC with HMAC-SHA1 2 [RFC2451], [RFC2404] 673 DEPRECATED 3 674 DEPRECATED 4 675 NULL-ENCRYPT with HMAC-SHA1 5 [RFC2410], [RFC2404] 676 DEPRECATED 6 677 NULL-ENCRYPT with HMAC-SHA2 7 [RFC2410], [RFC4868] 678 AES-128-CBC with HMAC-SHA2 8 [RFC3602], [RFC4868] 679 AES-256-CBC with HMAC-SHA2 9 [RFC3602], [RFC4868] 680 AES-CCM-8 10 [RFC4309] 681 AES-CCM-16 11 [RFC4309] 682 AES-GCM with a 8 octet ICV 12 [RFC4106] 683 AES-GCM with a 16 octet ICV 13 [RFC4106] 685 The sender of an ESP transform parameter MUST make sure that there 686 are no more than six (6) Suite IDs in one ESP transform parameter. 687 Conversely, a recipient MUST be prepared to handle received transform 688 parameters that contain more than six Suite IDs. The limited number 689 of Suite IDs sets the maximum size of the ESP_TRANSFORM parameter. 690 As the default configuration, the ESP_TRANSFORM parameter MUST 691 contain at least one of the mandatory Suite IDs. There MAY be a 692 configuration option that allows the administrator to override this 693 default. 695 Mandatory implementations: AES-CBC with HMAC-SHA1 and NULL with HMAC- 696 SHA1. 698 Under some conditions, it is possible to use Traffic Flow 699 Confidentiality (TFC) [RFC4303] with ESP in BEET mode. However, the 700 definition of such operation is future work and must be done in a 701 separate specification. 703 5.1.3. NOTIFY Parameter 705 The HIP base specification defines a set of NOTIFY error types. The 706 following error types are required for describing errors in ESP 707 Transform crypto suites during negotiation. 709 NOTIFY PARAMETER - ERROR TYPES Value 710 ------------------------------ ----- 712 NO_ESP_PROPOSAL_CHOSEN 18 714 None of the proposed ESP Transform crypto suites was 715 acceptable. 717 INVALID_ESP_TRANSFORM_CHOSEN 19 719 The ESP Transform crypto suite does not correspond to 720 one offered by the Responder. 722 5.2. HIP ESP Security Association Setup 724 The ESP Security Association is set up during the base exchange. The 725 following subsections define the ESP SA setup procedure using both 726 base exchange messages (R1, I2, R2) and UPDATE messages. 728 5.2.1. Setup During Base Exchange 730 5.2.1.1. Modifications in R1 732 The ESP_TRANSFORM contains the ESP modes supported by the sender, in 733 the order of preference. All implementations MUST support AES-CBC 734 [RFC3602] with HMAC-SHA1 [RFC2404]. 736 The following figure shows the resulting R1 packet layout. 738 The HIP parameters for the R1 packet: 740 IP ( HIP ( [ R1_COUNTER, ] 741 PUZZLE, 742 DIFFIE_HELLMAN, 743 HIP_TRANSFORM, 744 ESP_TRANSFORM, 745 HOST_ID, 746 [ ECHO_REQUEST, ] 747 HIP_SIGNATURE_2 ) 748 [, ECHO_REQUEST ]) 750 5.2.1.2. Modifications in I2 752 The ESP_INFO contains the sender's SPI for this association as well 753 as the KEYMAT index from where the ESP SA keys will be drawn. The 754 old SPI value is set to zero. 756 The ESP_TRANSFORM contains the ESP mode selected by the sender of R1. 757 All implementations MUST support AES-CBC [RFC3602] with HMAC-SHA1 758 [RFC2404]. 760 The following figure shows the resulting I2 packet layout. 762 The HIP parameters for the I2 packet: 764 IP ( HIP ( ESP_INFO, 765 [R1_COUNTER,] 766 SOLUTION, 767 DIFFIE_HELLMAN, 768 HIP_TRANSFORM, 769 ESP_TRANSFORM, 770 ENCRYPTED { HOST_ID }, 771 [ ECHO_RESPONSE ,] 772 HMAC, 773 HIP_SIGNATURE 774 [, ECHO_RESPONSE] ) ) 776 5.2.1.3. Modifications in R2 778 The R2 contains an ESP_INFO parameter, which has the SPI value of the 779 sender of the R2 for this association. The ESP_INFO also has the 780 KEYMAT index value specifying where the ESP SA keys are drawn. 782 The following figure shows the resulting R2 packet layout. 784 The HIP parameters for the R2 packet: 786 IP ( HIP ( ESP_INFO, HMAC_2, HIP_SIGNATURE ) ) 788 5.3. HIP ESP Rekeying 790 In this section, the procedure for rekeying an existing ESP SA is 791 presented. 793 Conceptually, the process can be represented by the following message 794 sequence using the host names I' and R' defined in Section 3.3.2. 795 For simplicity, HMAC and HIP_SIGNATURE are not depicted, and 796 DIFFIE_HELLMAN keys are optional. The UPDATE with ACK_I need not be 797 piggybacked with the UPDATE with SEQ_R; it may be ACKed separately 798 (in which case the sequence would include four packets). 800 I' R' 802 UPDATE(ESP_INFO, SEQ_I, [DIFFIE_HELLMAN]) 803 -----------------------------------> 804 UPDATE(ESP_INFO, SEQ_R, ACK_I, [DIFFIE_HELLMAN]) 805 <----------------------------------- 806 UPDATE(ACK_R) 807 -----------------------------------> 809 Below, the first two packets in this figure are explained. 811 5.3.1. Initializing Rekeying 813 When HIP is used with ESP, the UPDATE packet is used to initiate 814 rekeying. The UPDATE packet MUST carry an ESP_INFO and MAY carry a 815 DIFFIE_HELLMAN parameter. 817 Intermediate systems that use the SPI will have to inspect HIP 818 packets for those that carry rekeying information. The packet is 819 signed for the benefit of the intermediate systems. Since 820 intermediate systems may need the new SPI values, the contents cannot 821 be encrypted. 823 The following figure shows the contents of a rekeying initialization 824 UPDATE packet. 826 The HIP parameters for the UPDATE packet initiating rekeying: 828 IP ( HIP ( ESP_INFO, 829 SEQ, 830 [DIFFIE_HELLMAN, ] 831 HMAC, 832 HIP_SIGNATURE ) ) 834 5.3.2. Responding to the Rekeying Initialization 836 The UPDATE ACK is used to acknowledge the received UPDATE rekeying 837 initialization. The acknowledgment UPDATE packet MUST carry an 838 ESP_INFO and MAY carry a DIFFIE_HELLMAN parameter. 840 Intermediate systems that use the SPI will have to inspect HIP 841 packets for packets carrying rekeying information. The packet is 842 signed for the benefit of the intermediate systems. Since 843 intermediate systems may need the new SPI values, the contents cannot 844 be encrypted. 846 The following figure shows the contents of a rekeying acknowledgment 847 UPDATE packet. 849 The HIP parameters for the UPDATE packet: 851 IP ( HIP ( ESP_INFO, 852 SEQ, 853 ACK, 854 [ DIFFIE_HELLMAN, ] 855 HMAC, 856 HIP_SIGNATURE ) ) 858 5.4. ICMP Messages 860 ICMP message handling is mainly described in the HIP base 861 specification [I-D.moskowitz-hip-rfc5201-bis]. In this section, we 862 describe the actions related to ESP security associations. 864 5.4.1. Unknown SPI 866 If a HIP implementation receives an ESP packet that has an 867 unrecognized SPI number, it MAY respond (subject to rate limiting the 868 responses) with an ICMP packet with type "Parameter Problem", with 869 the pointer pointing to the beginning of SPI field in the ESP header. 871 6. Packet Processing 873 Packet processing is mainly defined in the HIP base specification 874 [I-D.moskowitz-hip-rfc5201-bis]. This section describes the changes 875 and new requirements for packet handling when the ESP transport 876 format is used. Note that all HIP packets (currently protocol 253) 877 MUST bypass ESP processing. 879 6.1. Processing Outgoing Application Data 881 Outgoing application data handling is specified in the HIP base 882 specification [I-D.moskowitz-hip-rfc5201-bis]. When the ESP 883 transport format is used, and there is an active HIP session for the 884 given < source, destination > HIT pair, the outgoing datagram is 885 protected using the ESP security association. The following 886 additional steps define the conceptual processing rules for outgoing 887 ESP protected datagrams. 889 1. Detect the proper ESP SA using the HITs in the packet header or 890 other information associated with the packet 892 2. Process the packet normally, as if the SA was a transport mode 893 SA. 895 3. Ensure that the outgoing ESP protected packet has proper IP 896 header format depending on the used IP address family, and proper 897 IP addresses in its IP header, e.g., by replacing HITs left by 898 the ESP processing. Note that this placement of proper IP 899 addresses MAY also be performed at some other point in the stack, 900 e.g., before ESP processing. 902 6.2. Processing Incoming Application Data 904 Incoming HIP user data packets arrive as ESP protected packets. In 905 the usual case, the receiving host has a corresponding ESP security 906 association, identified by the SPI and destination IP address in the 907 packet. However, if the host has crashed or otherwise lost its HIP 908 state, it may not have such an SA. 910 The basic incoming data handling is specified in the HIP base 911 specification. Additional steps are required when ESP is used for 912 protecting the data traffic. The following steps define the 913 conceptual processing rules for incoming ESP protected datagrams 914 targeted to an ESP security association created with HIP. 916 1. Detect the proper ESP SA using the SPI. If the resulting SA is a 917 non-HIP ESP SA, process the packet according to standard IPsec 918 rules. If there are no SAs identified with the SPI, the host MAY 919 send an ICMP packet as defined in Section 5.4. How to handle 920 lost state is an implementation issue. 922 2. If the SPI matches with an active HIP-based ESP SA, the IP 923 addresses in the datagram are replaced with the HITs associated 924 with the SPI. Note that this IP-address-to-HIT conversion step 925 MAY also be performed at some other point in the stack, e.g., 926 after ESP processing. Note also that if the incoming packet has 927 IPv4 addresses, the packet must be converted to IPv6 format 928 before replacing the addresses with HITs (such that the transport 929 checksum will pass if there are no errors). 931 3. The transformed packet is next processed normally by ESP, as if 932 the packet were a transport mode packet. The packet may be 933 dropped by ESP, as usual. In a typical implementation, the 934 result of successful ESP decryption and verification is a 935 datagram with the associated HITs as source and destination. 937 4. The datagram is delivered to the upper layer. Demultiplexing the 938 datagram to the right upper layer socket is performed as usual, 939 except that the HITs are used in place of IP addresses during the 940 demultiplexing. 942 6.3. HMAC and SIGNATURE Calculation and Verification 944 The new HIP parameters described in this document, ESP_INFO and 945 ESP_TRANSFORM, must be protected using HMAC and signature 946 calculations. In a typical implementation, they are included in R1, 947 I2, R2, and UPDATE packet HMAC and SIGNATURE calculations as 948 described in [I-D.moskowitz-hip-rfc5201-bis]. 950 6.4. Processing Incoming ESP SA Initialization (R1) 952 The ESP SA setup is initialized in the R1 message. The receiving 953 host (Initiator) selects one of the ESP transforms from the presented 954 values. If no suitable value is found, the negotiation is 955 terminated. The selected values are subsequently used when 956 generating and using encryption keys, and when sending the reply 957 packet. If the proposed alternatives are not acceptable to the 958 system, it may abandon the ESP SA establishment negotiation, or it 959 may resend the I1 message within the retry bounds. 961 After selecting the ESP transform and performing other R1 processing, 962 the system prepares and creates an incoming ESP security association. 963 It may also prepare a security association for outgoing traffic, but 964 since it does not have the correct SPI value yet, it cannot activate 965 it. 967 6.5. Processing Incoming Initialization Reply (I2) 969 The following steps are required to process the incoming ESP SA 970 initialization replies in I2. The steps below assume that the I2 has 971 been accepted for processing (e.g., has not been dropped due to HIT 972 comparisons as described in [I-D.moskowitz-hip-rfc5201-bis]). 974 o The ESP_TRANSFORM parameter is verified and it MUST contain a 975 single value in the parameter, and it MUST match one of the values 976 offered in the initialization packet. 978 o The ESP_INFO NEW SPI field is parsed to obtain the SPI that will 979 be used for the Security Association outbound from the Responder 980 and inbound to the Initiator. For this initial ESP SA 981 establishment, the old SPI value MUST be zero. The KEYMAT Index 982 field MUST contain the index value to the KEYMAT from where the 983 ESP SA keys are drawn. 985 o The system prepares and creates both incoming and outgoing ESP 986 security associations. 988 o Upon successful processing of the initialization reply message, 989 the possible old Security Associations (as left over from an 990 earlier incarnation of the HIP association) are dropped and the 991 new ones are installed, and a finalizing packet, R2, is sent. 992 Possible ongoing rekeying attempts are dropped. 994 6.6. Processing Incoming ESP SA Setup Finalization (R2) 996 Before the ESP SA can be finalized, the ESP_INFO NEW SPI field is 997 parsed to obtain the SPI that will be used for the ESP Security 998 Association inbound to the sender of the finalization message R2. 999 The system uses this SPI to create or activate the outgoing ESP 1000 security association used for sending packets to the peer. 1002 6.7. Dropping HIP Associations 1004 When the system drops a HIP association, as described in the HIP base 1005 specification, the associated ESP SAs MUST also be dropped. 1007 6.8. Initiating ESP SA Rekeying 1009 During ESP SA rekeying, the hosts draw new keys from the existing 1010 keying material, or new keying material is generated from where the 1011 new keys are drawn. 1013 A system may initiate the SA rekeying procedure at any time. It MUST 1014 initiate a rekey if its incoming ESP sequence counter is about to 1015 overflow. The system MUST NOT replace its keying material until the 1016 rekeying packet exchange successfully completes. 1018 Optionally, a system may include a new Diffie-Hellman key for use in 1019 new KEYMAT generation. New KEYMAT generation occurs prior to drawing 1020 the new keys. 1022 The rekeying procedure uses the UPDATE mechanism defined in 1023 [I-D.moskowitz-hip-rfc5201-bis]. Because each peer must update its 1024 half of the security association pair (including new SPI creation), 1025 the rekeying process requires that each side both send and receive an 1026 UPDATE. A system will then rekey the ESP SA when it has sent 1027 parameters to the peer and has received both an ACK of the relevant 1028 UPDATE message and corresponding peer's parameters. It may be that 1029 the ACK and the required HIP parameters arrive in different UPDATE 1030 messages. This is always true if a system does not initiate ESP SA 1031 update but responds to an update request from the peer, and may also 1032 occur if two systems initiate update nearly simultaneously. In such 1033 a case, if the system has an outstanding update request, it saves the 1034 one parameter and waits for the other before completing rekeying. 1036 The following steps define the processing rules for initiating an ESP 1037 SA update: 1039 1. The system decides whether to continue to use the existing KEYMAT 1040 or to generate a new KEYMAT. In the latter case, the system MUST 1041 generate a new Diffie-Hellman public key. 1043 2. The system creates an UPDATE packet, which contains the ESP_INFO 1044 parameter. In addition, the host may include the optional 1045 DIFFIE_HELLMAN parameter. If the UPDATE contains the 1046 DIFFIE_HELLMAN parameter, the KEYMAT Index in the ESP_INFO 1047 parameter MUST be zero, and the Diffie-Hellman group ID must be 1048 unchanged from that used in the initial handshake. If the UPDATE 1049 does not contain DIFFIE_HELLMAN, the ESP_INFO KEYMAT Index MUST 1050 be greater than or equal to the index of the next byte to be 1051 drawn from the current KEYMAT. 1053 3. The system sends the UPDATE packet. For reliability, the 1054 underlying UPDATE retransmission mechanism MUST be used. 1056 4. The system MUST NOT delete its existing SAs, but continue using 1057 them if its policy still allows. The rekeying procedure SHOULD 1058 be initiated early enough to make sure that the SA replay 1059 counters do not overflow. 1061 5. In case a protocol error occurs and the peer system acknowledges 1062 the UPDATE but does not itself send an ESP_INFO, the system may 1063 not finalize the outstanding ESP SA update request. To guard 1064 against this, a system MAY re-initiate the ESP SA update 1065 procedure after some time waiting for the peer to respond, or it 1066 MAY decide to abort the ESP SA after waiting for an 1067 implementation-dependent time. The system MUST NOT keep an 1068 outstanding ESP SA update request for an indefinite time. 1070 To simplify the state machine, a host MUST NOT generate new UPDATEs 1071 while it has an outstanding ESP SA update request, unless it is 1072 restarting the update process. 1074 6.9. Processing Incoming UPDATE Packets 1076 When a system receives an UPDATE packet, it must be processed if the 1077 following conditions hold (in addition to the generic conditions 1078 specified for UPDATE processing in Section 6.12 of 1079 [I-D.moskowitz-hip-rfc5201-bis]): 1081 1. A corresponding HIP association must exist. This is usually 1082 ensured by the underlying UPDATE mechanism. 1084 2. The state of the HIP association is ESTABLISHED or R2-SENT. 1086 If the above conditions hold, the following steps define the 1087 conceptual processing rules for handling the received UPDATE packet: 1089 1. If the received UPDATE contains a DIFFIE_HELLMAN parameter, the 1090 received KEYMAT Index MUST be zero and the Group ID must match 1091 the Group ID in use on the association. If this test fails, the 1092 packet SHOULD be dropped and the system SHOULD log an error 1093 message. 1095 2. If there is no outstanding rekeying request, the packet 1096 processing continues as specified in Section 6.9.1. 1098 3. If there is an outstanding rekeying request, the UPDATE MUST be 1099 acknowledged, the received ESP_INFO (and possibly DIFFIE_HELLMAN) 1100 parameters must be saved, and the packet processing continues as 1101 specified in Section 6.10. 1103 6.9.1. Processing UPDATE Packet: No Outstanding Rekeying Request 1105 The following steps define the conceptual processing rules for 1106 handling a received UPDATE packet with the ESP_INFO parameter: 1108 1. The system consults its policy to see if it needs to generate a 1109 new Diffie-Hellman key, and generates a new key (with same Group 1110 ID) if needed. The system records any newly generated or 1111 received Diffie-Hellman keys for use in KEYMAT generation upon 1112 finalizing the ESP SA update. 1114 2. If the system generated a new Diffie-Hellman key in the previous 1115 step, or if it received a DIFFIE_HELLMAN parameter, it sets the 1116 ESP_INFO KEYMAT Index to zero. Otherwise, the ESP_INFO KEYMAT 1117 Index MUST be greater than or equal to the index of the next byte 1118 to be drawn from the current KEYMAT. In this case, it is 1119 RECOMMENDED that the host use the KEYMAT Index requested by the 1120 peer in the received ESP_INFO. 1122 3. The system creates an UPDATE packet, which contains an ESP_INFO 1123 parameter and the optional DIFFIE_HELLMAN parameter. This UPDATE 1124 would also typically acknowledge the peer's UPDATE with an ACK 1125 parameter, although a separate UPDATE ACK may be sent. 1127 4. The system sends the UPDATE packet and stores any received 1128 ESP_INFO and DIFFIE_HELLMAN parameters. At this point, it only 1129 needs to receive an acknowledgment for the newly sent UPDATE to 1130 finish ESP SA update. In the usual case, the acknowledgment is 1131 handled by the underlying UPDATE mechanism. 1133 6.10. Finalizing Rekeying 1135 A system finalizes rekeying when it has both received the 1136 corresponding UPDATE acknowledgment packet from the peer and it has 1137 successfully received the peer's UPDATE. The following steps are 1138 taken: 1140 1. If the received UPDATE messages contain a new Diffie-Hellman key, 1141 the system has a new Diffie-Hellman key due to initiating ESP SA 1142 update, or both, the system generates a new KEYMAT. If there is 1143 only one new Diffie-Hellman key, the old existing key is used as 1144 the other key. 1146 2. If the system generated a new KEYMAT in the previous step, it 1147 sets the KEYMAT Index to zero, independent of whether the 1148 received UPDATE included a Diffie-Hellman key or not. If the 1149 system did not generate a new KEYMAT, it uses the greater KEYMAT 1150 Index of the two (sent and received) ESP_INFO parameters. 1152 3. The system draws keys for new incoming and outgoing ESP SAs, 1153 starting from the KEYMAT Index, and prepares new incoming and 1154 outgoing ESP SAs. The SPI for the outgoing SA is the new SPI 1155 value received in an ESP_INFO parameter. The SPI for the 1156 incoming SA was generated when the ESP_INFO was sent to the peer. 1157 The order of the keys retrieved from the KEYMAT during the 1158 rekeying process is similar to that described in Section 7. 1159 Note, that only IPsec ESP keys are retrieved during the rekeying 1160 process, not the HIP keys. 1162 4. The system starts to send to the new outgoing SA and prepares to 1163 start receiving data on the new incoming SA. Once the system 1164 receives data on the new incoming SA, it may safely delete the 1165 old SAs. 1167 6.11. Processing NOTIFY Packets 1169 The processing of NOTIFY packets is described in the HIP base 1170 specification. 1172 7. Keying Material 1174 The keying material is generated as described in the HIP base 1175 specification. During the base exchange, the initial keys are drawn 1176 from the generated material. After the HIP association keys have 1177 been drawn, the ESP keys are drawn in the following order: 1179 SA-gl ESP encryption key for HOST_g's outgoing traffic 1181 SA-gl ESP authentication key for HOST_g's outgoing traffic 1183 SA-lg ESP encryption key for HOST_l's outgoing traffic 1185 SA-lg ESP authentication key for HOST_l's outgoing traffic 1187 HOST_g denotes the host with the greater HIT value, and HOST_l 1188 denotes the host with the lower HIT value. When HIT values are 1189 compared, they are interpreted as positive (unsigned) 128-bit 1190 integers in network byte order. 1192 The four HIP keys are only drawn from KEYMAT during a HIP I1->R2 1193 exchange. Subsequent rekeys using UPDATE will only draw the four ESP 1194 keys from KEYMAT. Section 6.9 describes the rules for reusing or 1195 regenerating KEYMAT based on the rekeying. 1197 The number of bits drawn for a given algorithm is the "natural" size 1198 of the keys, as specified in Section 6.5 of 1199 [I-D.moskowitz-hip-rfc5201-bis]. 1201 8. Security Considerations 1203 In this document, the usage of ESP [RFC4303] between HIP hosts to 1204 protect data traffic is introduced. The Security Considerations for 1205 ESP are discussed in the ESP specification. 1207 There are different ways to establish an ESP Security Association 1208 between two nodes. This can be done, e.g., using IKE [RFC4306]. 1209 This document specifies how the Host Identity Protocol is used to 1210 establish ESP Security Associations. 1212 The following issues are new or have changed from the standard ESP 1213 usage: 1215 o Initial keying material generation 1217 o Updating the keying material 1219 The initial keying material is generated using the Host Identity 1220 Protocol [I-D.moskowitz-hip-rfc5201-bis] using the Diffie-Hellman 1221 procedure. This document extends the usage of the UPDATE packet, 1222 defined in the base specification, to modify existing ESP SAs. The 1223 hosts may rekey, i.e., force the generation of new keying material 1224 using the Diffie-Hellman procedure. The initial setup of ESP SA 1225 between the hosts is done during the base exchange, and the message 1226 exchange is protected using methods provided by base exchange. 1227 Changes in connection parameters means basically that the old ESP SA 1228 is removed and a new one is generated once the UPDATE message 1229 exchange has been completed. The message exchange is protected using 1230 the HIP association keys. Both HMAC and signing of packets is used. 1232 9. IANA Considerations 1234 This document defines additional parameters and NOTIFY error types 1235 for the Host Identity Protocol [I-D.moskowitz-hip-rfc5201-bis]. 1237 The new parameters and their type numbers are defined in 1238 Section 5.1.1 and Section 5.1.2, and they have been added to the 1239 Parameter Type namespace specified in 1240 [I-D.moskowitz-hip-rfc5201-bis]. 1242 The new NOTIFY error types and their values are defined in 1243 Section 5.1.3, and they have been added to the Notify Message Type 1244 namespace specified in [I-D.moskowitz-hip-rfc5201-bis]. 1246 10. Acknowledgments 1248 This document was separated from the base "Host Identity Protocol" 1249 specification in the beginning of 2005. Since then, a number of 1250 people have contributed to the text by providing comments and 1251 modification proposals. The list of people include Tom Henderson, 1252 Jeff Ahrenholz, Jan Melen, Jukka Ylitalo, and Miika Komu. 1253 Especially, the authors want to thank Pekka Nikander for his 1254 invaluable contributions to the document since the first draft 1255 version. The authors want to thank also Charlie Kaufman for 1256 reviewing the document with his eye on the usage of crypto 1257 algorithms. 1259 Due to the history of this document, most of the ideas are inherited 1260 from the base "Host Identity Protocol" specification. Thus, the list 1261 of people in the Acknowledgments section of that specification is 1262 also valid for this document. Many people have given valuable 1263 feedback, and our apologies to anyone whose name is missing. 1265 11. References 1267 11.1. Normative references 1269 [I-D.moskowitz-hip-rfc5201-bis] Moskowitz, R., Jokela, P., 1270 Henderson, T., and T. Heer, "Host 1271 Identity Protocol", 1272 draft-moskowitz-hip-rfc5201-bis-02 1273 (work in progress), July 2010. 1275 [RFC2119] Bradner, S., "Key words for use in 1276 RFCs to Indicate Requirement 1277 Levels", BCP 14, RFC 2119, 1278 March 1997. 1280 [RFC2404] Madson, C. and R. Glenn, "The Use of 1281 HMAC-SHA-1-96 within ESP and AH", 1282 RFC 2404, November 1998. 1284 [RFC3602] Frankel, S., Glenn, R., and S. 1285 Kelly, "The AES-CBC Cipher Algorithm 1286 and Its Use with IPsec", RFC 3602, 1287 September 2003. 1289 [RFC4303] Kent, S., "IP Encapsulating Security 1290 Payload (ESP)", RFC 4303, 1291 December 2005. 1293 11.2. Informative references 1295 [I-D.moskowitz-hip-rfc4423-bis] Moskowitz, R., "Host Identity 1296 Protocol Architecture", 1297 draft-moskowitz-hip-rfc4423-bis-02 1298 (work in progress), June 2010. 1300 [RFC0791] Postel, J., "Internet Protocol", 1301 STD 5, RFC 791, September 1981. 1303 [RFC2401] Kent, S. and R. Atkinson, "Security 1304 Architecture for the Internet 1305 Protocol", RFC 2401, November 1998. 1307 [RFC3260] Grossman, D., "New Terminology and 1308 Clarifications for Diffserv", 1309 RFC 3260, April 2002. 1311 [RFC3474] Lin, Z. and D. Pendarakis, 1312 "Documentation of IANA assignments 1313 for Generalized MultiProtocol Label 1314 Switching (GMPLS) Resource 1315 Reservation Protocol - Traffic 1316 Engineering (RSVP-TE) Usage and 1317 Extensions for Automatically 1318 Switched Optical Network (ASON)", 1319 RFC 3474, March 2003. 1321 [RFC4301] Kent, S. and K. Seo, "Security 1322 Architecture for the Internet 1323 Protocol", RFC 4301, December 2005. 1325 [RFC4306] Kaufman, C., "Internet Key Exchange 1326 (IKEv2) Protocol", RFC 4306, 1327 December 2005. 1329 [RFC5206] Henderson, T., Ed., "End-Host 1330 Mobility and Multihoming with the 1331 Host Identity Protocol", RFC 5206, 1332 April 2008. 1334 Appendix A. A Note on Implementation Options 1336 It is possible to implement this specification in multiple different 1337 ways. As noted above, one possible way of implementing this is to 1338 rewrite IP headers below IPsec. In such an implementation, IPsec is 1339 used as if it was processing IPv6 transport mode packets, with the 1340 IPv6 header containing HITs instead of IP addresses in the source and 1341 destination address fields. In outgoing packets, after IPsec 1342 processing, the HITs are replaced with actual IP addresses, based on 1343 the HITs and the SPI. In incoming packets, before IPsec processing, 1344 the IP addresses are replaced with HITs, based on the SPI in the 1345 incoming packet. In such an implementation, all IPsec policies are 1346 based on HITs and the upper layers only see packets with HITs in the 1347 place of IP addresses. Consequently, support of HIP does not 1348 conflict with other uses of IPsec as long as the SPI spaces are kept 1349 separate. Appendix B describes another way to implement this 1350 specification. 1352 Appendix B. Bound End-to-End Tunnel mode for ESP 1354 This section introduces an alternative way of implementing the 1355 necessary functions for HIP ESP transport. Compared to the option of 1356 implementing the required address rewrites outside of IPsec, BEET has 1357 one implementation level benefit. In BEET-way of implementing, the 1358 address rewriting information is kept in one place, at the SAD. On 1359 the other hand, when address rewriting is implemented separately, the 1360 implementation MUST make sure that the information in the SAD and the 1361 separate address rewriting DB are kept in synchrony. As a result, 1362 the BEET-mode-based way of implementing this specification is 1363 RECOMMENDED over the separate implementation as it keeps the binds 1364 the identities, encryption and locators tightly together. It should 1365 be noted that implementing BEET mode doesn't require that 1366 corresponding hosts implement it as the behavior is only visible 1367 internally in a host. 1369 The BEET mode is a combination of IPsec tunnel and transport modes 1370 and provides some of the features from both. The HIP uses HITs as 1371 the "inner" addresses and IP addresses as "outer" addresses, like IP 1372 addresses are used in the tunnel mode. Instead of tunneling packets 1373 between hosts, a conversion between inner and outer addresses is made 1374 at end-hosts and the inner address is never sent on the wire after 1375 the initial HIP negotiation. BEET provides IPsec transport mode 1376 syntax (no inner headers) with limited tunnel mode semantics (fixed 1377 logical inner addresses - the HITs - and changeable outer IP 1378 addresses). 1380 B.1. Protocol definition 1382 In this section we define the exact protocol formats and operations. 1384 B.1.1. Changes to Security Association data structures 1386 A BEET mode Security Association contains the same data as a regular 1387 tunnel mode Security Association, with the exception that the inner 1388 selectors must be single addresses and cannot be subnets. The data 1389 includes the following: 1391 A pair of inner IP addresses. 1393 A pair of outer IP addresses. 1395 Cryptographic keys and other data as defined in RFC2401 [RFC2401] 1396 Section 4.4.3. 1398 A conforming implementation MAY store the data in a way similar to a 1399 regular tunnel mode Security Association. 1401 Note that in a conforming implementation the inner and outer 1402 addresses MAY belong to different address families. All 1403 implementations that support both IPv4 and IPv6 SHOULD support both 1404 IPv4-over-IPv6 and IPv6-over-IPv4 tunneling. 1406 B.1.2. Packet format 1408 The wire packet format is identical to the ESP transport mode wire 1409 format as defined in [RFC4303] Section 3.1.1. However, the resulting 1410 packet contains outer IP addresses instead of the inner IP addresses 1411 received from the upper layer. The construction of the outer headers 1412 is defined in RFC2401 [RFC2401] Section 5.1.2. The following diagram 1413 illustrates ESP BEET mode positioning for typical IPv4 and IPv6 1414 packets. 1416 IPv4 INNER ADDRESSES 1417 -------------------- 1419 BEFORE APPLYING ESP 1420 ------------------------------ 1421 | inner IP hdr | | | 1422 | | TCP | Data | 1423 ------------------------------ 1425 AFTER APPLYING ESP, OUTER v4 ADDRESSES 1426 ---------------------------------------------------- 1427 | outer IP hdr | | | | ESP | ESP | 1428 | (any options) | ESP | TCP | Data | Trailer | ICV | 1429 ---------------------------------------------------- 1430 |<---- encryption ---->| 1431 |<-------- integrity ------->| 1433 AFTER APPLYING ESP, OUTER v6 ADDRESSES 1434 ------------------------------------------------------ 1435 | outer | new ext | | | | ESP | ESP | 1436 | IP hdr | hdrs. | ESP | TCP | Data | Trailer| ICV | 1437 ------------------------------------------------------ 1438 |<--- encryption ---->| 1439 |<------- integrity ------->| 1441 IPv4 INNER ADDRESSES with options 1442 --------------------------------- 1444 BEFORE APPLYING ESP 1445 ------------------------------ 1446 | inner IP hdr | | | 1447 | + options | TCP | Data | 1448 ------------------------------ 1450 AFTER APPLYING ESP, OUTER v4 ADDRESSES 1451 ---------------------------------------------------------- 1452 | outer IP hdr | | | | | ESP | ESP | 1453 | (any options) | ESP | PH | TCP | Data | Trailer | ICV | 1454 ---------------------------------------------------------- 1455 |<------- encryption ------->| 1456 |<----------- integrity ---------->| 1458 AFTER APPLYING ESP, OUTER v6 ADDRESSES 1459 ------------------------------------------------------------ 1460 | outer | new ext | | | | | ESP | ESP | 1461 | IP hdr | hdrs. | ESP | PH | TCP | Data | Trailer| ICV | 1462 ------------------------------------------------------------ 1463 |<------ encryption ------->| 1464 |<---------- integrity ---------->| 1466 PH Pseudo Header for IPv4 options 1468 IPv6 INNER ADDRESSES 1469 -------------------- 1471 BEFORE APPLYING ESP 1472 ------------------------------------------ 1473 | | ext hdrs | | | 1474 | inner IP hdr | if present | TCP | Data | 1475 ------------------------------------------ 1477 AFTER APPLYING ESP, OUTER v6 ADDRESSES 1478 -------------------------------------------------------------- 1479 | outer | new ext | | dest | | | ESP | ESP | 1480 | IP hdr | hdrs. | ESP | opts.| TCP | Data | Trailer | ICV | 1481 -------------------------------------------------------------- 1482 |<---- encryption ---->| 1483 |<------- integrity ------>| 1485 AFTER APPLYING ESP, OUTER v4 ADDRESSES 1486 ---------------------------------------------------- 1487 | outer | | dest | | | ESP | ESP | 1488 | IP hdr | ESP | opts.| TCP | Data | Trailer | ICV | 1489 ---------------------------------------------------- 1490 |<------- encryption -------->| 1491 |<----------- integrity ----------->| 1493 B.1.3. Cryptographic processing 1495 The outgoing packets MUST be protected exactly as in ESP transport 1496 mode [RFC4303]. That is, the upper layer protocol packet is wrapped 1497 into an ESP header, encrypted, and authenticated exactly as if 1498 regular transport mode was used. The resulting ESP packet is subject 1499 to IP header processing as defined in Appendix B.1.4 and 1500 Appendix B.1.5. The incoming ESP protected messages are verified and 1501 decrypted exactly as if regular transport mode was used. The 1502 resulting clear text packet is subject to IP header processing as 1503 defined in Appendix B.1.4 and Appendix B.1.6. 1505 B.1.4. IP header processing 1507 The biggest difference between the BEET mode and the other two modes 1508 is in IP header processing. In the regular transport mode the IP 1509 header is kept intact. In the regular tunnel mode an outer IP header 1510 is created on output and discarded on input. In the BEET mode the IP 1511 header is replaced with another one on both input and output. 1513 On the BEET mode output side, the IP header processing MUST first 1514 ensure that the IP addresses in the original IP header contain the 1515 inner addresses as specified in the SA. This MAY be ensured by 1516 proper policy processing, and it is possible that no checks are 1517 needed at the SA processing time. Once the IP header has been 1518 verified to contain the right IP inner addresses, it is discarded. A 1519 new IP header is created, using the discarded inner header as a hint 1520 for other fields but the IP addresses. The IP addresses in the new 1521 header MUST be the outer tunnel addresses. 1523 On input side, the received IP header is simply discarded. Since the 1524 packet has been decrypted and verified, no further checks are 1525 necessary. A new IP header, corresponding to a tunnel mode inner 1526 header, is created, using the discarded outer header as a hint for 1527 other fields but the IP addresses. The IP addresses in the new 1528 header MUST be the inner addresses. 1530 As the outer header fields are used as hint for creating inner 1531 header, it must be noted that inner header differs as compared to 1532 tunnel-mode inner header. In BEET mode the inner header will have 1533 the TTL, DF-bit and other option values from the outer header. The 1534 TTL, DF-bit and other option values of the inner header MUST be 1535 processed by the stack. 1537 B.1.5. Handling of outgoing packets 1539 The outgoing BEET mode packets are processed as follows: 1541 1. The system MUST verify that the IP header contains the inner 1542 source and destination addresses, exactly as defined in the SA. 1543 This verification MAY be explicit, or it MAY be implicit, for 1544 example, as a result of prior policy processing. Note that in 1545 some implementations there may be no real IP header at this time 1546 but the source and destination addresses may be carried out-of- 1547 band. In case the source address is still unassigned, it SHOULD 1548 be ensured that the designated inner source address would be 1549 selected at a later stage. 1551 2. The IP payload (the contents of the packet beyond the IP header) 1552 is wrapped into an ESP header as defined in [RFC4303] Section 1553 3.3. 1555 3. A new IP header is constructed, replacing the original one. The 1556 new IP header MUST contain the outer source and destination 1557 addresses, as defined in the SA. Note that in some 1558 implementations there may be no real IP header at this time but 1559 the source and destination addresses may be carried out-of-band. 1560 In the case where the source address must be left unassigned, it 1561 SHOULD be made sure that the right source address is selected at 1562 a later stage. Other than the addresses, it is RECOMMENDED that 1563 the new IP header copies the fields from the original IP header. 1565 4. If there are any IPv4 options in the original packet, it is 1566 RECOMMENDED that they are discarded. If the inner header 1567 contains one or more options that need to be transported between 1568 the tunnel end-points, sender MUST encapsulate the options as 1569 defined in Appendix B.1.7 1571 Instead of literally discarding the IP header and constructing a new 1572 one, a conforming implementation MAY simply replace the addresses in 1573 an existing header. However, if the RECOMMENDED feature of allowing 1574 the inner and outer addresses from different address families is 1575 used, this simple strategy does not work. 1577 B.1.6. Handling of incoming packets 1579 The incoming BEET mode packets are processed as follows: 1581 1. The system MUST verify and decrypt the incoming packet 1582 successfully, as defined in [RFC4303] section 3.4. If the 1583 verification or decryption fails, the packet MUST be discarded. 1585 2. The original IP header is simply discarded, without any checks. 1586 Since the ESP verification succeeded, the packet can be safely 1587 assumed to have arrived from the right sender. 1589 3. A new IP header is constructed, replacing the original one. The 1590 new IP header MUST contain the inner source and destination 1591 addresses, as defined in the SA. If the sender has set the ESP 1592 next protocol field to 94 and included the pseudo header as 1593 described in Appendix B.1.7, the receiver MUST include the 1594 options after the constructed IP header. Note, that in some 1595 implementations the real IP header may have already been 1596 discarded and the source and destination addresses are carried 1597 out-of-band. In such case the out-of-band addresses MUST be the 1598 inner addresses. Other than the addresses, it is RECOMMENDED 1599 that the new IP header copies the fields from the original IP 1600 header. 1602 Instead of literally discarding the IP header and constructing a new 1603 one a conforming implementation MAY simply replace the addresses in 1604 an existing header. However, if the RECOMMENDED feature of allowing 1605 the inner and outer addresses from different address families is 1606 used, this simple strategy does not work. 1608 B.1.7. IPv4 options handling 1610 In BEET mode, if IPv4 options are transported inside the tunnel, the 1611 sender MUST include a pseudo-header after ESP header. The pseudo- 1612 header identifies that IPv4 options from the original packet are to 1613 be applied on the packet on input side. 1615 The sender MUST set the next protocol field on the ESP header as 94. 1616 The resulting pseudo header including the IPv4 options MUST be padded 1617 to 8 octet boundary. The padding length is expressed in octets, 1618 valid padding lengths are 0 or 4 octets as the original IPv4 options 1619 are already padded to 4 octet boundary. The padding MUST be filled 1620 with NOP options as defined in [RFC0791]Internet Protocol section 3.1 1621 Internet header format. The padding is added in front of the 1622 original options to ensure that the receiver is able to reconstruct 1623 the original IPv4 datagram. The Header Length field contains the 1624 length of the IPv4 options, and padding in 8 octets units. 1626 0 1 2 3 1627 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 1628 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1629 | Next Header | Header Len | Pad Len | Reserved | 1630 +---------------+---------------+-------------------------------+ 1631 | Padding (if needed) | 1632 +---------------------------------------------------------------+ 1633 | IPv4 options ... | 1634 | | 1635 +---------------------------------------------------------------+ 1637 Next Header Identifies the data following this header 1638 Length in octets 8-bit unsigned integer. Length of the 1639 pseudo header in 8-octet units, not 1640 including the first 8 octets. 1642 The receiver MUST remove this pseudo-header and padding as a part of 1643 BEET processing, in order reconstruct the original IPv4 datagram. 1644 The IPv4 options included into the pseudo-header MUST be added after 1645 the reconstructed IPv4 (inner) header on the receiving side. 1647 Authors' Addresses 1649 Petri Jokela 1650 Ericsson Research NomadicLab 1651 JORVAS FIN-02420 1652 FINLAND 1654 Phone: +358 9 299 1 1655 EMail: petri.jokela@nomadiclab.com 1657 Robert Moskowitz 1658 ICSAlabs, An Independent Division of Verizon Business Systems 1659 1000 Bent Creek Blvd, Suite 200 1660 Mechanicsburg, PA 1661 USA 1663 EMail: rgm@icsalabs.com 1665 Jan Melen 1666 Ericsson Research NomadicLab 1667 JORVAS FIN-02420 1668 FINLAND 1670 Phone: +358 9 299 1 1671 EMail: jan.melen@nomadiclab.com