idnits 2.17.1 draft-ietf-ipsec-auth-header-01.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- ** Cannot find the required boilerplate sections (Copyright, IPR, etc.) in this document. Expected boilerplate is as follows today (2024-04-27) according to https://trustee.ietf.org/license-info : IETF Trust Legal Provisions of 28-dec-2009, Section 6.a: This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79. IETF Trust Legal Provisions of 28-dec-2009, Section 6.b(i), paragraph 2: Copyright (c) 2024 IETF Trust and the persons identified as the document authors. All rights reserved. IETF Trust Legal Provisions of 28-dec-2009, Section 6.b(i), paragraph 3: This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- ** Missing expiration date. The document expiration date should appear on the first and last page. ** The document seems to lack a 1id_guidelines paragraph about Internet-Drafts being working documents. ** The document seems to lack a 1id_guidelines paragraph about 6 months document validity. ** The document seems to lack a 1id_guidelines paragraph about the list of current Internet-Drafts. ** The document seems to lack a 1id_guidelines paragraph about the list of Shadow Directories. == No 'Intended status' indicated for this document; assuming Proposed Standard Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- ** The document seems to lack an Abstract section. ** The document seems to lack an IANA Considerations section. (See Section 2.2 of https://www.ietf.org/id-info/checklist for how to handle the case when there are no actions for IANA.) ** The document seems to lack separate sections for Informative/Normative References. All references will be assumed normative when checking for downward references. ** There are 90 instances of too long lines in the document, the longest one being 7 characters in excess of 72. ** The document seems to lack a both a reference to RFC 2119 and the recommended RFC 2119 boilerplate, even if it appears to use RFC 2119 keywords. RFC 2119 keyword, line 161: '...ved for future use. It MUST be set to...' RFC 2119 keyword, line 188: '...ounter and the receiver's counter MUST...' RFC 2119 keyword, line 198: '...i.e., the sender MUST always transmit ...' RFC 2119 keyword, line 210: '... implementations MUST support such pad...' RFC 2119 keyword, line 235: '...UDP. For example, an ICMP message MAY...' (38 more instances...) Miscellaneous warnings: ---------------------------------------------------------------------------- == Using lowercase 'not' together with uppercase 'MUST', 'SHALL', 'SHOULD', or 'RECOMMENDED' is not an accepted usage according to RFC 2119. Please use uppercase 'NOT' together with RFC 2119 keywords (if that is what you mean). Found 'MUST not' in this paragraph: The sender's counter is initialized to 0 when an SA is established. The transmitter increments the Sequence Number for this SA, checks to ensure that the counter has not cycled, and inserts the new value into the Sequence Number Field. Thus the first packet sent using a given SA will have a Sequence Number of 1. A transmitter MUST not send a packet on an SA if doing so would cause the sequence number to cycle. An attempt to transmit a packet that would result in sequence number overflow is an auditable event. (Note that this approach to Sequence Number management does not require use of modular arithmetic.) -- 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.) -- Couldn't find a document date in the document -- date freshness check skipped. 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: 'RFC791' is mentioned on line 751, but not defined == Missing Reference: 'RFC2113' is mentioned on line 744, but not defined == Missing Reference: 'RFC1770' is mentioned on line 745, but not defined ** Obsolete undefined reference: RFC 1770 (Obsoleted by RFC 6814) == Missing Reference: 'RFC1393' is mentioned on line 752, but not defined ** Obsolete undefined reference: RFC 1393 (Obsoleted by RFC 6814) == Missing Reference: 'ZSu' is mentioned on line 759, but not defined == Missing Reference: 'Finn' is mentioned on line 760, but not defined == Missing Reference: 'Estrin' is mentioned on line 761, but not defined == Missing Reference: 'VerSteeg' is mentioned on line 762, but not defined == Missing Reference: 'Lee' is mentioned on line 763, but not defined == Missing Reference: 'RFC1883' is mentioned on line 797, but not defined ** Obsolete undefined reference: RFC 1883 (Obsoleted by RFC 2460) == Unused Reference: 'BCCH94' is defined on line 845, but no explicit reference was found in the text == Unused Reference: 'Bel89' is defined on line 849, but no explicit reference was found in the text == Unused Reference: 'CER95' is defined on line 853, but no explicit reference was found in the text == Unused Reference: 'GM93' is defined on line 861, but no explicit reference was found in the text == Unused Reference: 'KA97c' is defined on line 871, but no explicit reference was found in the text == Unused Reference: 'Ken91' is defined on line 878, but no explicit reference was found in the text == Unused Reference: 'STD-1' is defined on line 889, but no explicit reference was found in the text ** Obsolete normative reference: RFC 1826 (ref. 'ATK95') (Obsoleted by RFC 2402) ** Downref: Normative reference to an Informational RFC: RFC 1636 (ref. 'BCCH94') -- Possible downref: Non-RFC (?) normative reference: ref. 'Bel89' -- Possible downref: Non-RFC (?) normative reference: ref. 'CER95' ** Obsolete normative reference: RFC 1883 (ref. 'DH95') (Obsoleted by RFC 2460) ** Downref: Normative reference to an Historic RFC: RFC 1446 (ref. 'GM93') -- Possible downref: Non-RFC (?) normative reference: ref. 'KA97a' -- Possible downref: Non-RFC (?) normative reference: ref. 'KA97b' -- Possible downref: Non-RFC (?) normative reference: ref. 'KA97c' ** Downref: Normative reference to an Informational RFC: RFC 2104 (ref. 'KBC97') ** Downref: Normative reference to an Historic RFC: RFC 1108 (ref. 'Ken91') ** Downref: Normative reference to an Informational RFC: RFC 1321 (ref. 'Riv92') -- Possible downref: Non-RFC (?) normative reference: ref. 'SHA' -- Possible downref: Non-RFC (?) normative reference: ref. 'STD-1' -- Possible downref: Non-RFC (?) normative reference: ref. 'STD-2' Summary: 21 errors (**), 0 flaws (~~), 19 warnings (==), 10 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 1 Network Working Group Stephen Kent, BBN Corp 2 Internet Draft Randall Atkinson, @Home Network 3 draft-ietf-ipsec-auth-header-01.txt July 21 1997 5 IP Authentication Header 7 Status of This Memo 9 This document is an Internet Draft. Internet Drafts are working 10 documents of the Internet Engineering Task Force (IETF), its Areas, 11 and its Working Groups. Note that other groups may also distribute 12 working documents as Internet Drafts. 14 Internet Drafts are draft documents valid for a maximum of 6 months. 15 Internet Drafts may be updated, replaced, or obsoleted by other 16 documents at any time. It is not appropriate to use Internet Drafts 17 as reference material or to cite them other than as a "working draft" 18 or "work in progress". Please check the I-D abstract listing 19 contained in each Internet Draft directory to learn the current 20 status of this or any other Internet Draft. 22 This particular Internet Draft is a product of the IETF's IPsec 23 Working Group. It is intended that a future version of this draft 24 will be submitted for consideration as a standards-track document. 25 Distribution of this document is unlimited. 27 Table of Contents 29 1. Introduction......................................................3 30 2. Authentication Header Format......................................4 31 2.1 Next Header...................................................4 32 2.2 Payload Length................................................4 33 2.3 Reserved......................................................5 34 2.4 Security Parameters Index (SPI)...............................5 35 2.5 Sequence Number...............................................5 36 2.6 Authentication Data ..........................................5 37 3. Authentication Header Processing..................................6 38 3.1 Authentication Header Location...............................6 39 3.2 Outbound Packet Processing...................................8 40 3.2.1 Security Association Lookup.............................8 41 3.2.2 Sequence Number Generation..............................8 42 3.2.3 Integrity Check Value Calculation.......................9 43 3.2.3.1 Handling Mutable Fields............................9 44 3.2.3.1.1 ICV Computation for IPv4......................9 45 3.2.3.1.1.1 Base Header Fields........................9 46 3.2.3.1.1.2 Options..................................10 47 3.2.3.1.2 ICV Computation for IPv6.....................10 48 3.2.3.1.2.1 Base Header Fields.......................10 49 3.2.3.1.2.2 Extension Headers -- Options.............11 50 3.2.3.1.2.3 Extension Headers -- non-Options.........11 51 3.2.3.2 Padding...........................................11 52 3.2.3.2.1 Authentication Data Padding..................11 53 3.2.3.2.2 Implicit Packet Padding......................12 54 3.2.3.3 Authentication Algorithms.........................12 55 3.2.4 Fragmentation..........................................12 56 3.3 Inbound Packet Processing...................................13 57 3.3.1 Reassembly.............................................13 58 3.3.2 Security Association Lookup............................13 59 3.3.3 Sequence Number Verification...........................13 60 3.3.4 Integrity Check Value Verification.....................14 61 4. Auditing.........................................................15 62 5. Conformance Requirements.........................................15 63 6. Security Considerations..........................................16 64 7. Differences from RFC 1826........................................16 65 Acknowledgements....................................................17 66 Appendix A -- Mutability of IP Options/Extension Headers............18 67 1. IPv4 Options..................................................18 68 2. IPv6 Extension Headers........................................19 69 References..........................................................21 70 Disclaimer..........................................................22 71 Author Information..................................................22 73 1. Introduction 75 The IP Authentication Header (AH) is used to provide connectionless 76 integrity and data origin authentication for IP datagrams (hereafter 77 referred to as just "authentication"), and to provide protection 78 against replays. This latter, optional service may be selected, by 79 the receiver, when a Security Association is established. AH 80 provides authentication for as much of the IP header as possible, as 81 well as for upper level protocol data. However, some IP header 82 fields may change in transit and the value of these fields, when the 83 packet arrives at the receiver, may not be predictable by the 84 transmitter. The values of such fields cannot be protected by AH. 85 Thus the protection provided to the IP header by AH is somewhat 86 piecemeal. 88 AH may be applied alone, in combination with the IP Encapsulating 89 Security Payload (ESP) [KA97b], or in a nested fashion through the 90 use of tunnel mode (see "Security Architecture for the Internet 91 Protocol" [KA97a], hereafter referred to as the Security Architecture 92 document). Security services can be provided between a pair of 93 communicating hosts, between a pair of communicating security 94 gateways, or between a security gateway and a host. ESP may be used 95 to provide the same security services, and it also provides a 96 confidentiality (encryption) service. The primary difference between 97 the authentication provided by ESP and AH is the extent of the 98 coverage. Specifically, ESP does not protect any IP header fields 99 unless those fields are encapsulated by ESP (tunnel mode). For more 100 details on how to use AH and ESP in various network environments, see 101 the Security Architecture document [KA97a]. 103 It is assumed that the reader is familiar with the terms and concepts 104 described in the Security Architecture document. In particular, the 105 reader should be familiar with the definitions of security services 106 offered by AH and ESP, the concept of Security Associations, the ways 107 in which AH can be used in conjunction with ESP, and the different 108 key management options available for AH and ESP. (With regard to the 109 last topic, the current key management options required for both AH 110 and ESP are manual keying and automated keying via Oakley/ISAKMP.) 112 2. Authentication Header Format 114 The protocol header (IPv4, IPv6, or Extension) immediately preceding the 115 AH header will contain the value 51 in its Protocol (IPv4) or Next 116 Header (IPv6, Extension) field [STD-2]. 118 0 1 2 3 119 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 120 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 121 | Next Header | Payload Len | RESERVED | 122 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 123 | Security Parameters Index (SPI) | 124 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 125 | Sequence Number Field | 126 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 127 | | 128 + Authentication Data (variable) | 129 | | 130 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 132 The following subsections define the fields that comprise the AH 133 format. All the fields described here are mandatory, i.e., they are 134 always present in the AH format and are included in the ICV 135 computation. 137 2.1 Next Header 139 The Next Header is an 8-bit field that identifies the type of the 140 next payload after the Authentication Header. The value of this 141 field is chosen from the set of IP Protocol Numbers defined in the 142 most recent "Assigned Numbers" [STD-2] RFC from the Internet Assigned 143 Numbers Authority (IANA). 145 2.2 Payload Length 147 This 8-bit field specifies the length of AH, in 32-bit words (4-byte 148 units), minus "2," i.e., the fixed portion (as defined in the 149 original AH spec) of AH is not counted. (Since the Sequence Number 150 field is always present, the fixed portion of AH is now three 32-bit 151 words. However, the "minus 2" length adjustment has been retained 152 for backwards compatibility.) In the "standard" case of a 96-bit 153 authentication value plus the 3 32-bit word fixed portion, this 154 length field will be "4". A "null" authentication algorithm may be 155 used only for debugging purposes. Its use would result in a "1" 156 value for this field, as there would be no corresponding 157 Authentication Data field. 159 2.3 Reserved 161 This 16-bit field is reserved for future use. It MUST be set to 162 "zero." (Note that the value is included in the Authentication Data 163 calculation, but is otherwise ignored by the recipient.) 165 2.4 Security Parameters Index (SPI) 167 The SPI is an arbitrary 32-bit value that uniquely identifies the 168 Security Association for this datagram, relative to the destination 169 IP address contained in the IP header with which this security header 170 is associated, and relative to the security protocol employed. The 171 set of SPI values in the range 1 through 255 are reserved by the 172 Internet Assigned Numbers Authority (IANA) for future use; a reserved 173 SPI value will not normally be assigned by IANA unless the use of the 174 assigned SPI value is specified in an RFC. It is ordinarily selected 175 by the destination system upon establishment of an SA (see the 176 Security Architecture document for more details). (A zero value may 177 be used for local debugging purposes, but no AH packets should be 178 transmitted with a zero SPI value.) 180 2.5 Sequence Number 182 This unsigned 32-bit field contains a monotonically increasing 183 counter value (sequence number). The sender's counter and the 184 receiver's counter are initialized to 0 when an SA is established. 185 (The first packet sent using a given SA will have a Sequence Number 186 of 1; see Section 3.2.2 for more details on how the Sequence Number 187 is generated.) The transmitted Sequence Number must never be allowed 188 to cycle. Thus the sender's counter and the receiver's counter MUST 189 be reset (by establishing a new SA and thus a new key) prior to the 190 transmission of 2^32nd packet on an SA. 192 This field is always present, even if the receiver does not elect to 193 enable the anti-replay service for a specific SA, in order to ensure 194 8-byte alignment for the IPv6 environment, when the default integrity 195 algorithms are employed. 197 Processing of the Sequence Number field is at the discretion of the 198 receiver, i.e., the sender MUST always transmit this field, but the 199 receiver need not act upon it (see the discussion of Sequence Number 200 Verification in the "Inbound Processing" section below). 202 2.6 Authentication Data 204 This is a variable-length field that contains the Integrity Check 205 Value (ICV) for this packet. The field must be an integral multiple 206 of 32 bits in length. The details of the ICV computation are 207 described in Section 3.2.3 below. This field may include explicit 208 padding. This padding is included to ensure that the length of the 209 AH header is an integral multiple of 32 bits (IPv4) or 64 bits 210 (IPv6). All implementations MUST support such padding. Details of 211 how to compute the required padding length are provided below. 213 3. Authentication Header Processing 215 3.1 Authentication Header Location 217 Like ESP, AH may be employed in two ways: transport mode or tunnel 218 mode. The former mode is applicable only to host implementations and 219 provides protection for upper layer protocols, in addition to 220 selected IP header fields. (In this mode, note that for "bump-in- 221 the-stack" or "bump-in-the-wire" implementations, as defined in the 222 Security Architecture document, inbound and outbound IP fragments may 223 require an IPsec implementation to perform extra IP 224 reassembly/fragmentation in order to both conform to this 225 specification and provide transparent IPsec support. Special care is 226 required to perform such operations within these implementations when 227 multiple interfaces are in use.) 229 In transport mode, AH is inserted after the IP header and before an 230 upper layer protocol, e.g., TCP, UDP, ICMP, etc. or before any other 231 IPsec headers that have already been inserted, e.g., ESP. In the 232 context of IPv4, this calls for placing AH after the IP header (and 233 any options that it contains), but before the upper layer protocol. 234 (Note that the term "transport" mode should not be misconstrued as 235 restricting its use to TCP and UDP. For example, an ICMP message MAY 236 be sent using either "transport" mode or "tunnel" mode.) The 237 following diagram illustrates AH transport mode positioning for a 238 typical IPv4 packet, on a "before and after" basis. 240 BEFORE APPLYING AH 241 ---------------------------- 242 IPv4 |orig IP hdr | | | 243 |(any options)| TCP | Data | 244 ---------------------------- 246 AFTER APPLYING AH 247 --------------------------------- 248 IPv4 |orig IP hdr | | | | 249 |(any options)| AH | TCP | Data | 250 --------------------------------- 251 |<------- authenticated ------->| 252 except for mutable fields 254 In the IPv6 context, AH is viewed as an end-to-end payload, and thus 255 should appear after hop-by-hop, routing, and fragmentation extension 256 headers. The destination options extension header(s) could appear 257 either before or after the AH header depending on the semantics 258 desired. The following diagram illustrates AH transport mode 259 positioning for a typical IPv6 packet. 261 BEFORE APPLYING AH 262 --------------------------------------- 263 IPv6 | | ext hdrs | | | 264 | orig IP hdr |if present| TCP | Data | 265 --------------------------------------- 267 AFTER APPLYING AH 268 ------------------------------------------------------------ 269 IPv6 | |hxh,rtg,frag| dest | | dest | | | 270 |orig IP hdr |if present**| opt* | AH | opt* | TCP | Data | 271 ------------------------------------------------------------ 272 |<---- authenticated except for mutable fields ----------->| 274 * = if present, could be before AH, after AH, or both 275 ** = hop by hop, routing, fragmentation headers 277 Tunnel mode AH may be employed in either hosts or security gateways 278 (or in so-called "bump-in-the-stack" or "bump-in-the-wire" 279 implementations, as defined in the Security Architecture document). 280 When AH is implemented in a security gateway (to protect subscriber 281 transit traffic), tunnel mode must be used. In tunnel mode, the 282 "inner" IP header carries the ultimate source and destination 283 addresses, while an "outer" IP header may contain distinct IP 284 addresses, e.g., addresses of security gateways. In tunnel mode, AH 285 protects the entire inner IP packet, including the entire inner IP 286 header. The position of AH in tunnel mode, relative to the outer IP 287 header, is the same as for AH in transport mode. The following 288 diagram illustrates AH tunnel mode positioning for typical IPv4 and 289 IPv6 packets. 291 ------------------------------------------------ 292 IPv4 | new IP hdr* | | orig IP hdr* | | | 293 |(any options)| AH | (any options) |TCP | Data | 294 ------------------------------------------------ 295 |<-- authenticated except for mutable fields ->| 297 -------------------------------------------------------------- 298 IPv6 | | ext hdrs*| | | ext hdrs*| | | 299 |new IP hdr*|if present| AH |orig IP hdr*|if present|TCP|Data| 300 -------------------------------------------------------------- 301 |<-------- authenticated except for mutable fields --------->| 303 * = construction of outer IP hdr/extensions and modification 304 of inner IP hdr/extensions is discussed below. 306 3.2 Outbound Packet Processing 308 In transport mode, the transmitter inserts the AH header after the IP 309 header and before an upper layer protocol header, as described above. 310 In tunnel mode, the outer and inner IP header/extensions can be 311 inter-related in a variety of ways. The construction of the outer IP 312 header/extensions during the encapsulation process is described in 313 the Security Architecture document. 315 3.2.1 Security Association Lookup 317 AH is applied to an outbound packet only after an IPsec 318 implementation determines that the packet is associated with an SA 319 that calls for AH processing. The process of determining what, if 320 any, IPsec processing is applied to outbound traffic is described in 321 the Security Architecture document. 323 3.2.2 Sequence Number Generation 325 The sender's counter is initialized to 0 when an SA is established. 326 The transmitter increments the Sequence Number for this SA, checks to 327 ensure that the counter has not cycled, and inserts the new value 328 into the Sequence Number Field. Thus the first packet sent using a 329 given SA will have a Sequence Number of 1. A transmitter MUST not 330 send a packet on an SA if doing so would cause the sequence number to 331 cycle. An attempt to transmit a packet that would result in sequence 332 number overflow is an auditable event. (Note that this approach to 333 Sequence Number management does not require use of modular 334 arithmetic.) 336 3.2.3 Integrity Check Value Calculation 338 3.2.3.1 Handling Mutable Fields 340 The AH ICV is computed over IP header fields that are either 341 immutable in transit or that are predictable in value upon arrival at 342 the endpoint for the AH SA. The ICV also encompasses the upper level 343 protocol data, which is assumed to be immutable in transit. If a 344 field may be modified during transit, the value of the field is set 345 to zero for purposes of the ICV computation. If a field is mutable, 346 but its value at the (IPsec) receiver is predictable, then that value 347 is inserted into the field for purposes of the ICV calculation. The 348 Authentication Data field also is set to zero in preparation for this 349 computation. Note that by replacing each field's value with zero, 350 rather than omitting the field, alignment is preserved for the ICV 351 calculation. Also, the zero-fill approach ensures that the length of 352 the fields that are so handled cannot be changed during transit, even 353 though their contents are not explicitly covered by the ICV. 355 As a new extension header or IPv4 option is created, it will be 356 defined in its own RFC and SHOULD include (in the Security 357 Considerations section) directions for how it should be handled when 358 calculating the AH ICV. If the IPSEC implementation encounters an 359 extension header that it does not recognize, it MUST zero the whole 360 header except for the Next Header and Hdr Ext Len fields. The length 361 of the extension header MUST be computed by 8 * Hdr Ext Len value + 362 8. If the IPSEC implementation encounters an IPv4 option that it 363 does not recognize, it should zero the whole option, using the second 364 byte of the option as the length. (IPv6 options contain a flag 365 indicating mutability, which determines appropriate processing for 366 such options.) 368 3.2.3.1.1 ICV Computation for IPv4 370 3.2.3.1.1.1 Base Header Fields 372 The IPv4 base header fields are classified as follows: 374 Immutable 375 Version 376 Internet Header Length 377 Total Length 378 Identification 379 Protocol 380 Source Address 381 Destination Address (without loose or strict source routing) 383 Mutable but predictable 384 Destination Address (with loose or strict source routing) 386 Mutable (zeroed prior to ICV calculation) 387 Type of Service (TOS) 388 Flags 389 Fragment Offset 390 Time to Live (TTL) 391 Header Checksum 393 TOS -- This field is excluded because some routers are known to 394 change the value of this field, even though the IP specification 395 does not consider TOS to be a mutable header field. 397 Flags -- This field is excluded since an intermediate router might 398 set the DF bit, even if the source did not select it. 400 Fragment Offset -- Since AH is applied only to non-fragmented IP 401 packets, the Offset Field must always be zero, and thus it is 402 excluded (even though it is predictable). 404 TTL -- This is changed en-route as a normal course of processing by 405 routers, and thus its value at the receiver is not predictable 406 by the sender. 408 Header Checksum -- This will change if any of these other fields 409 changes, and thus its value upon reception cannot be predicted 410 by the sender. 412 3.2.3.1.1.2 Options 414 For IPv4 (unlike IPv6), there is no mechanism for tagging options as 415 mutable in transit. Hence the IPv4 options are explicitly listed in 416 Appendix A and classified as immutable, mutable but predictable, or 417 mutable. For IPv4, the entire option is viewed as a unit; so even 418 though the type and length fields within most options are immutable 419 in transit, if an option is classified as mutable, the entire option 420 is zeroed for ICV computation purposes. 422 3.2.3.1.2 ICV Computation for IPv6 424 3.2.3.1.2.1 Base Header Fields 426 The IPv6 base header fields are classified as follows: 428 Immutable 429 Version 430 Payload Length 431 Next Header 432 Source Address 433 Destination Address (without Routing Extension Header) 435 Mutable but predictable 436 Destination Address (with Routing Extension Header) 438 Mutable (zeroed prior to ICV calculation) 439 Priority 440 Flow Label 441 Hop Limit 443 3.2.3.1.2.2 Extension Headers -- Options 445 The IPv6 extension headers (that are options) are explicitly listed 446 in Appendix A and classified as immutable, mutable but predictable, 447 or mutable. 449 IPv6 options in the Hop-by-Hop and Destination Extension Headers 450 contain a bit that indicates whether the option might change 451 (unpredictably) during transit. For any option for which contents 452 may change en-route, the entire "Option Data" field must be treated 453 as zero-valued octets when computing or verifying the ICV. The 454 Option Type and Opt Data Len are included in the ICV calculation. 455 All options for which the bit indicates immutability are included in 456 the ICV calculation. See the IPv6 specification [DH95] for more 457 information. 459 3.2.3.1.2.3 Extension Headers -- non-Options 461 The IPv6 extension headers (that are not options) are explicitly 462 listed in Appendix A and classified as immutable, mutable but 463 predictable, or mutable. 465 3.2.3.2 Padding 467 3.2.3.2.1 Authentication Data Padding 469 As mentioned in section 2.6, the Authentication Data field explicitly 470 includes padding to ensure that the AH header is a multiple of 32 471 bits (IPv4) or 64 bits (IPv6). If padding is required, its length is 472 determined by two factors: 474 - the length of the ICV 475 - the IP protocol version (v4 or v6) 477 For example, if a default, 96-bit truncated (see Section 3.2.3.3) 478 HMAC algorithm is selected no padding is required for either IPv4 nor 479 for IPv6. However, if a different length ICV is generated, due to 480 use of a different algorithm, then padding may be required for the 481 IPv6 environment. The content of the padding field is arbitrarily 482 selected by the sender. (The padding is arbitrary, but need not be 483 random to achieve security.) These padding bytes are included in the 484 Authentication Data calculation, counted as part of the Payload 485 Length, and transmitted at the end of the Authentication Data field 486 to enable the receiver to perform the ICV calculation. 488 3.2.3.2.2 Implicit Packet Padding 490 For some authentication algorithms, the byte string over which the 491 ICV computation is performed must be a multiple of a blocksize 492 specified by the algorithm. If the IP packet length (including AH) 493 does not match the blocksize requirements for the algorithm, implicit 494 padding MUST be appended to the end of the packet, prior to ICV 495 computation. The padding octets MUST have a value of zero. The 496 blocksize (and hence the length of the padding) is specified by the 497 algorithm specification. This padding is not transmitted with the 498 packet. 500 3.2.3.3 Authentication Algorithms 502 The authentication algorithm employed for the ICV computation is 503 specified by the SA. For point-to-point communication, suitable 504 authentication algorithms include keyed Message Authentication Codes 505 (MACs) based on symmetric encryption algorithms (e.g., DES) or on 506 one-way hash functions (e.g., MD5 or SHA-1). For multicast 507 communication, one-way hash algorithms combined with asymmetric 508 signature algorithms are appropriate, though performance and space 509 considerations currently preclude use of such algorithms. As of this 510 writing, the mandatory-to-implement authentication algorithms are 511 based on the former class, i.e., HMAC [KBC97] with SHA-1 [SHA] or 512 HMAC with MD5 [Riv92]. The output of the HMAC computation is 513 truncated to the leftmost 96 bits. Other algorithms, possibly with 514 different ICV lengths, MAY be supported. 516 3.2.4 Fragmentation 518 If required, IP fragmentation occurs after AH processing within an 519 IPsec implementation. Thus, transport mode AH is applied only to 520 whole IP datagrams (not to IP fragments). An IP packet to which AH 521 has been applied may itself be fragmented by routers en route, and 522 such fragments must be reassembled prior to AH processing at a 523 receiver. In tunnel mode, AH is applied to an IP packet, the payload 524 of which may be a fragmented IP packet. For example, a security 525 gateway or a "bump-in-the-stack" or "bump-in-the-wire" IPsec 526 implementation (see the Security Architecture document for details) 527 may apply tunnel mode AH to such fragments. 529 3.3 Inbound Packet Processing 531 3.3.1 Reassembly 533 If required, reassembly is performed prior to AH processing. If a 534 packet offered to AH for processing appears to be an IP fragment, 535 i.e., the OFFSET field is non-zero or the MORE FRAGMENTS flag is set, 536 the receiver MUST discard the packet; this is an auditable event. The 537 audit log entry for this event SHOULD include the SPI value, 538 date/time, Source Address, Destination Address, and (in IPv6) the 539 Flow ID. 541 3.3.2 Security Association Lookup 543 Upon receipt of a packet containing an IP Authentication Header, the 544 receiver determines the appropriate (unidirectional) SA, based on the 545 destination IP address and the SPI. (This process is described in 546 more detail in the Security Architecture document.) The SA dictates 547 whether the Sequence Number field will be checked, specifies the 548 algorithm(s) employed for ICV computation, and indicates the key(s) 549 required to validate the ICV. 551 If no valid Security Association exists for this session (e.g., the 552 receiver has no key), the receiver MUST discard the packet; this is 553 an auditable event. The audit log entry for this event SHOULD 554 include the SPI value, date/time, Source Address, Destination 555 Address, and (in IPv6) the Flow ID. 557 3.3.3 Sequence Number Verification 559 All AH implementations MUST support the anti-replay service, though 560 its use may be enabled or disabled on a per-SA basis. (Note that 561 there are no provisions for managing transmitted Sequence Number 562 values among multiple senders directing traffic to a single, 563 multicast SA. Thus the anti-replay service SHOULD NOT be used in a 564 multi-sender multicast environment that employs a single, multicast 565 SA.) If an SA establishment protocol such as Oakley/ISAKMP is 566 employed, then the receiver SHOULD notify the transmitter, during SA 567 establishment, if the receiver will provide anti-replay protection 568 and SHOULD inform the transmitter of the window size. 570 If the receiver has enabled the anti-replay service for this SA, the 571 receiver packet counter for the SA MUST be initialized to zero when 572 the SA is established. For each received packet, the receiver MUST 573 verify that the packet contains a Sequence Number that does not 574 duplicate the Sequence Number of any other packets received during 575 the life of this SA. This SHOULD be the first AH check applied to a 576 packet after it has been matched to an SA, to speed rejection of 577 duplicate packets. 579 Duplicates are rejected through the use of a sliding receive window. 580 (How the window is implemented is a local matter, but the following 581 text describes the functionality that the implementation must 582 exhibit.) A MINIMUM window size of 32 MUST be supported; but a 583 window size of 64 is preferred and SHOULD be employed as the default. 584 A window size of 64 or larger MAY be chosen by the receiver. If a 585 larger window size is chosen, it MUST be a multiple of 32. If any 586 window size other than the default of 64 is employed by the receiver, 587 it MUST be reported to the transmitter during SA negotiation. 589 The "right" edge of the window represents the highest, validated 590 Sequence Number value received on this SA. Packets that contain 591 Sequence Numbers lower than the "left" edge of the window are 592 rejected. Packets falling within the window are checked against a 593 list of received packets within the window. An efficient means for 594 performing this check, based on the use of a bit mask, is described 595 in the Security Architecture document. 597 If the received packet falls within the window and is new, or if the 598 packet is to the right of the window, then the receiver proceeds to 599 ICV verification. If the ICV validation fails, the receiver MUST 600 discard the received IP datagram as invalid; this is an auditable 601 event. The audit log entry for this event SHOULD include the SPI 602 value, date/time, Source Address, Destination Address, the Sequence 603 Number, and (in IPv6) the Flow ID. The receive window is updated 604 only if the ICV verification succeeds. 606 DISCUSSION: 608 Note that if the packet is either inside the window and new, or is 609 outside the window on the "right" side, the receiver MUST 610 authenticate the packet before updating the Sequence Number window 611 data. 613 3.3.4 Integrity Check Value Verification 615 The receiver computes the ICV over the appropriate fields of the 616 packet, using the specified authentication algorithm, and verifies 617 that it is the same as the ICV included in the Authentication Data 618 field of the packet. Details of the computation are provided below. 620 If the computed and received ICV's match, then the datagram is valid, 621 and it is accepted. If the test fails, then the receiver MUST 622 discard the received IP datagram as invalid; this is an auditable 623 event. The audit log entry SHOULD include the SPI value, date/time, 624 Source Address, Destination Address, and (in IPv6) the Flow ID. 626 DISCUSSION: 628 Begin by saving the ICV value and replacing it (but not any 629 Authentication Data padding) with zero. Zero all other fields 630 that may have been modified during transit. (See section 3.2.3.1 631 for a discussion of which fields are zeroed before performing the 632 ICV calculation.) Check the overall length of the packet, and if 633 it requires implicit padding based on the requirements of the 634 authentication algorithm, append zero-filled bytes to the end of 635 the packet as required. Now perform the ICV computation and 636 compare the result with the saved value. (For the mandatory-to- 637 implement authentication algorithms, HMAC [KBC97] with SHA-1 [SHA] 638 or HMAC with MD5 [Riv92], the output of the HMAC computation is 639 truncated to the leftmost 96 bits. Other algorithms may have 640 different ICV lengths.) (If a digital signature and one-way hash 641 are used for the ICV computation, the matching process is more 642 complex and will be described in the algorithm specification.) 644 4. Auditing 646 Not all systems that implement AH will implement auditing. However, 647 if AH is incorporated into a system that supports auditing, then the 648 AH implementation MUST also support auditing and MUST allow a system 649 administrator to enable or disable auditing for AH. For the most 650 part, the granularity of auditing is a local matter. However, 651 several auditable events are identified in this specification and for 652 each of these events a minimum set of information that SHOULD be 653 included in an audit log is defined. Additional information also MAY 654 be included in the audit log for each of these events, and additional 655 events, not explicitly called out in this specification, also MAY 656 result in audit log entries. There is no requirement for the 657 receiver to transmit any message to the purported transmitter in 658 response to the detection of an auditable event, because of the 659 potential to induce denial of service via such action. 661 5. Conformance Requirements 663 Implementations that claim conformance or compliance with this 664 specification MUST fully implement the AH syntax and processing 665 described here and MUST comply with all requirements of the Security 666 Architecture document. If the key used to compute an ICV is manually 667 distributed, correct provision of the anti-replay service would 668 require correct maintenance of the counter state at the transmitter, 669 until the key is replaced, and there likely would be no automated 670 recovery provision if counter overflow were imminent. Thus a 671 compliant implementation SHOULD NOT provide this service in 672 conjunction with SAs that are manually keyed. A compliant AH 673 implementation MUST support the following mandatory-to-implement 674 algorithms (specified in [KBC97]): 676 - HMAC with MD5 677 - HMAC with SHA-1 679 6. Security Considerations 681 Security is central to the design of this protocol, and these 682 security considerations permeate the specification. Additional 683 security-relevant aspects of using the IPsec protocol are discussed 684 in the Security Architecture document. 686 7. Differences from RFC 1826 688 This specification of AH differs from RFC 1826 [ATK95] in several 689 important respects, but the fundamental features of AH remain intact. 690 One goal of the revision of RFC 1826 was to provide a complete 691 framework for AH, with ancillary RFCs required only for algorithm 692 specification. For example, the anti-replay service is now an 693 integral, mandatory part of AH, not a feature of a transform defined 694 in another RFC. Carriage of a sequence number to support this 695 service is now required at all times, to meet IPv6 alignment 696 requirements (even when anti-replay is not enabled for an SA). The 697 default algorithms required for interoperability have been changed to 698 HMAC with MD5 or SHA-1 (vs. keyed MD5), for security reasons. The 699 list of IPv4 header fields excluded from the ICV computation has been 700 expanded to include the OFFSET and FLAGS fields. 702 Another motivation for revision was to provide additional detail and 703 clarification of subtle points. This specification provides 704 rationale for exclusion of selected IPv4 header fields from AH 705 coverage and provides examples on positioning of AH in both the IPv4 706 and v6 contexts. Auditing requirements have been clarified in this 707 version of the specification. Tunnel mode AH was mentioned only in 708 passing in RFC 1826, but now is a mandatory feature of AH. 709 Discussion of interactions with key management and with security 710 labels have been moved to the Security Architecture document. 712 Acknowledgements 714 For over 2 years, this document has evolved through multiple versions 715 and iterations. During this time, many people have contributed 716 significant ideas and energy to the process and the documents 717 themselves. The authors would like to thank Karen Seo for providing 718 extensive help in the review, editing, background research, and 719 coordination for this version of the specification. The authors 720 would also like to thank the members of the IPsec and IPng working 721 groups, with special mention of the efforts of (in alphabetic order): 722 Steve Bellovin, Steve Deering, Francis Dupont, Phil Karn, Frank 723 Kastenholz, Perry Metzger, David Mihelcic, Hilarie Orman, William 724 Simpson, and Nina Yuan. 726 Appendix A -- Mutability of IP Options/Extension Headers 728 1. IPv4 Options 730 This table shows how the IPv4 options are classified with regard to 731 "mutability". Where two references are provided, the second one 732 supercedes the first. This table is based in part on information 733 provided in RFC1700, "ASSIGNED NUMBERS", (October 1994). 735 Opt. 736 Copy Class # Name Reference 737 ---- ----- --- ------------------------- --------- 738 IMMUTABLE -- included in ICV calculation 739 0 0 0 End of Options List [RFC791] 740 0 0 1 No Operation [RFC791] 741 1 0 2 Security [RFC1108(historic but in use)] 742 1 0 5 Extended Security [RFC1108(historic but in use)] 743 1 0 6 Commercial Security [expired I-D, now US MIL STD] 744 1 0 20 Router Alert [RFC2113] 745 1 0 21 Sender Directed Multi- [RFC1770] 746 Destination Delivery 747 MUTABLE -- zeroed 748 1 0 3 Loose Source Route [RFC791] 749 0 2 4 Time Stamp [RFC791] 750 0 0 7 Record Route [RFC791] 751 1 0 9 Strict Source Route [RFC791] 752 0 2 18 Traceroute [RFC1393] 754 EXPERIMENTAL, SUPERCEDED -- zeroed 755 1 0 8 Stream ID [RFC791, RFC1122 (Host Req)] 756 0 0 11 MTU Probe [RFC1063, RFC1191 (PMTU)] 757 0 0 12 MTU Reply [RFC1063, RFC1191 (PMTU)] 758 1 0 17 Extended Internet Protocol [RFC1385, RFC1883 (IPv6)] 759 0 0 10 Experimental Measurement [ZSu] 760 1 2 13 Experimental Flow Control [Finn] 761 1 0 14 Experimental Access Ctl [Estrin] 762 0 0 15 ??? [VerSteeg] 763 1 0 16 IMI Traffic Descriptor [Lee] 764 1 0 19 Address Extension [Ullmann IPv7] 766 NOTE: Use of the Router Alert option is potentially incompatible with 767 use of IPSEC. Although the option is immutable, its use implies that 768 each router along a packet's path will "process" the packet and 769 consequently might change the packet. This would happen on a hop by 770 hop basis as the packet goes from router to router. Prior to being 771 processed by the application to which the option contents are 772 directed, e.g., RSVP/IGMP, the packet should encounter AH processing. 773 However, AH processing would require that each router along the path 774 is a member of a multicast-SA defined by the SPI. This might pose 775 problems for packets that are not strictly source routed, and it 776 requires multicast support techniques not currently available. 778 NOTE: Addition or removal of any security labels (BSO, ESO, CIPSO) by 779 systems along a packet's path conflicts with the classification of these 780 IP Options as immutable and is incompatible with the use of IPSEC. 782 2. IPv6 Extension Headers 784 This table shows how the IPv6 Extension Headers are classified with 785 regard to "mutability". 787 Option/Extension Name Reference 788 ----------------------------------- --------- 789 MUTABLE BUT PREDICTABLE -- included in ICV calculation 790 Routing (Type 0) [RFC1883] 792 BIT INDICATES IF OPTION IS MUTABLE (CHANGES UNPREDICTABLY DURING TRANSIT) 793 Hop by Hop options [RFC1883] 794 Destination options [RFC1883] 796 NOT APPLICABLE 797 Fragmentation [RFC1883] 799 Options -- IPv6 options in the Hop-by-Hop and Destination Extension 800 Headers contain a bit that indicates whether the option might 801 change (unpredictably) during transit. For any option for which 802 contents may change en-route, the entire "Option Data" field 803 must be treated as zero-valued octets when computing or 804 verifying the ICV. The Option Type and Opt Data Len are 805 included in the ICV calculation. All options for which the bit 806 indicates immutability are included in the ICV calculation. See 807 the IPv6 specification [DH95] for more information. 809 Routing (Type 0) -- The IPv6 Routing Header "Type 0" will rearrange 810 the address fields within the packet during transit from source 811 to destination. However, the contents of the packet as it will 812 appear at the receiver are known to the sender and to all 813 intermediate hops. Hence, the IPv6 Routing Header "Type 0" is 814 included in the Authentication Data calculation as mutable but 815 predictable. The transmitter must order the field so that it 816 appears as it will at the receiver, prior to performing the ICV 817 computation. 819 Fragmentation -- Fragmentation occurs after outbound IPSEC processing 820 (section 3.2.4) and reassembly occurs before inbound IPSEC 821 processing (section 3.3.1). So the Fragmentation Extension 822 Header, if it exists, is not seen by IPSEC. 824 Note that on the receive side, the IP implementation could leave 825 a Fragmentation Extension Header in place when it does 826 re-assembly. If this happens, then when AH receives the packet, 827 before doing ICV processing, AH MUST "remove" (or skip over) 828 this header and change the previous header's "Next Header" field 829 to be the "Next Header" field in the Fragmentation Extension 830 Header. 832 Note that on the send side, the IP implementation could give the 833 IPSEC code a packet with a Fragmentation Extension Header with 834 Offset of 0 (first fragment) and a More Fragments Flag of 0 835 (last fragment). If this happens, then before doing ICV 836 processing, AH MUST first "remove" (or skip over) this header 837 and change the previous header's "Next Header" field to be the 838 "Next Header" field in the Fragmentation Extension Header. 840 References 842 [ATK95] R. Atkinson, "The IP Authentication Header," RFC 1826, 843 August 1995. 845 [BCCH94] R. Braden, D. Clark, S. Crocker, & C.Huitema, "Report of 846 IAB Workshop on Security in the Internet Architecture", 847 RFC-1636, 9 June 1994, pp. 21-34. 849 [Bel89] Steven M. Bellovin, "Security Problems in the TCP/IP 850 Protocol Suite", ACM Computer Communications Review, Vol. 851 19, No. 2, March 1989. 853 [CER95] Computer Emergency Response Team (CERT), "IP Spoofing 854 Attacks and Hijacked Terminal Connections", CA-95:01, 855 January 1995. Available via anonymous ftp from 856 info.cert.org in /pub/cert_advisories. 858 [DH95] Steve Deering & Bob Hinden, "Internet Protocol version 6 859 (IPv6) Specification", RFC-1883, December 1995. 861 [GM93] James Galvin & Keith McCloghrie, Security Protocols for 862 version 2 of the Simple Network Management Protocol 863 (SNMPv2), RFC-1446, April 1993. 865 [KA97a] Steve Kent, Randall Atkinson, "Security Architecture for 866 the Internet Protocol", Internet Draft, ?? 1997. 868 [KA97b] Steve Kent, Randall Atkinson, "IP Encapsulating Security 869 Payload (ESP)", Internet Draft, ?? 1997. 871 [KA97c] Steve Kent, Randall Atkinson, "IP Authentication Header", 872 Internet Draft, ?? 1997. 874 [KBC97] Hugo Krawczyk, Mihir Bellare, and Ran Canetti, "HMAC: 875 Keyed-Hashing for Message Authentication", RFC-2104, 876 February 1997. 878 [Ken91] Steve Kent, "US DoD Security Options for the Internet 879 Protocol", RFC-1108, November 1991. 881 [KA97a] Steve Kent, Randall Atkinson, "Security Architecture for 882 the Internet Protocol", Internet Draft, ?? 1997. 884 [Riv92] Ronald Rivest, "The MD5 Message Digest Algorithm," RFC- 885 1321, April 1992. 887 [SHA] NIST, FIPS PUB 180-1: Secure Hash Standard, April 1995 889 [STD-1] J. Postel, "Internet Official Protocol Standards", STD-1, 890 March 1996. 892 [STD-2] J. Reynolds & J. Postel, "Assigned Numbers", STD-2, 20 893 October 1994. 895 Disclaimer 897 The views and specification here are those of the authors and are not 898 necessarily those of their employers. The authors and their 899 employers specifically disclaim responsibility for any problems 900 arising from correct or incorrect implementation or use of this 901 specification. 903 Author Information 905 Stephen Kent 906 BBN Corporation 907 70 Fawcett Street 908 Cambridge, MA 02140 909 USA 910 E-mail: kent@bbn.com 911 Telephone: +1 (617) 873-3988 913 Randall Atkinson 914 @Home Network 915 385 Ravendale Drive 916 Mountain View, CA 94043 917 USA 918 E-mail: rja@inet.org