idnits 2.17.1 draft-ietf-ipsec-auth-header-02.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-24) 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 178: '...specific use and MUST NOT be sent on t...' RFC 2119 keyword, line 179: '...t implementation MAY use the zero SPI ...' RFC 2119 keyword, line 190: '...receiver, i.e., the sender MUST always...' RFC 2119 keyword, line 200: '...ter and the receiver's counter MUST be...' (43 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: If anti-replay has been enabled, the transmitter checks to ensure that the counter has not cycled before inserting the new value in the Sequence Number field. In other words, the 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.) -- The document date (2 October 1997) is 9701 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: 'IP' is mentioned on line 284, but not defined == Missing Reference: 'AH' is mentioned on line 284, but not defined == Missing Reference: 'ESP' is mentioned on line 284, but not defined == Missing Reference: 'RFC791' is mentioned on line 793, but not defined == Missing Reference: 'RFC2113' is mentioned on line 786, but not defined == Missing Reference: 'RFC1770' is mentioned on line 787, but not defined ** Obsolete undefined reference: RFC 1770 (Obsoleted by RFC 6814) == Missing Reference: 'RFC1393' is mentioned on line 794, but not defined ** Obsolete undefined reference: RFC 1393 (Obsoleted by RFC 6814) == Missing Reference: 'ZSu' is mentioned on line 801, but not defined == Missing Reference: 'Finn' is mentioned on line 802, but not defined == Missing Reference: 'Estrin' is mentioned on line 803, but not defined == Missing Reference: 'VerSteeg' is mentioned on line 804, but not defined == Missing Reference: 'Lee' is mentioned on line 805, but not defined == Missing Reference: 'RFC1883' is mentioned on line 841, but not defined ** Obsolete undefined reference: RFC 1883 (Obsoleted by RFC 2460) == Unused Reference: 'BCCH94' is defined on line 889, but no explicit reference was found in the text == Unused Reference: 'Bel89' is defined on line 893, but no explicit reference was found in the text == Unused Reference: 'CER95' is defined on line 897, but no explicit reference was found in the text == Unused Reference: 'GM93' is defined on line 905, but no explicit reference was found in the text == Unused Reference: 'KA97c' is defined on line 915, but no explicit reference was found in the text == Unused Reference: 'Ken91' is defined on line 918, but no explicit reference was found in the text == Unused Reference: 'Riv92' is defined on line 927, but no explicit reference was found in the text == Unused Reference: 'SHA' is defined on line 930, but no explicit reference was found in the text == Unused Reference: 'STD-1' is defined on line 932, 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 Historic RFC: RFC 1108 (ref. 'Ken91') -- Possible downref: Non-RFC (?) normative reference: ref. 'MG97a' -- Possible downref: Non-RFC (?) normative reference: ref. 'MG97b' ** 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: 20 errors (**), 0 flaws (~~), 24 warnings (==), 12 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-02.txt 2 October 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 ..........................................6 37 3. Authentication Header Processing..................................6 38 3.1 Authentication Header Location...............................6 39 3.2 Authentication Algorithms....................................8 40 3.3 Outbound Packet Processing...................................9 41 3.3.1 Security Association Lookup.............................9 42 3.3.2 Sequence Number Generation..............................9 43 3.3.3 Integrity Check Value Calculation......................10 44 3.3.3.1 Handling Mutable Fields...........................10 45 3.3.3.1.1 ICV Computation for IPv4.....................10 46 3.3.3.1.1.1 Base Header Fields.......................10 47 3.3.3.1.1.2 Options..................................11 48 3.3.3.1.2 ICV Computation for IPv6.....................12 49 3.3.3.1.2.1 Base Header Fields.......................12 50 3.3.3.1.2.2 Extension Headers -- Options.............12 51 3.3.3.1.2.3 Extension Headers -- non-Options.........12 52 3.3.3.2 Padding...........................................12 53 3.3.3.2.1 Authentication Data Padding..................12 54 3.3.3.2.2 Implicit Packet Padding......................13 55 3.3.4 Fragmentation..........................................13 56 3.4 Inbound Packet Processing...................................14 57 3.4.1 Reassembly.............................................14 58 3.4.2 Security Association Lookup............................14 59 3.4.3 Sequence Number Verification...........................14 60 3.4.4 Integrity Check Value Verification.....................15 61 4. Auditing.........................................................16 62 5. Conformance Requirements.........................................16 63 6. Security Considerations..........................................17 64 7. Differences from RFC 1826........................................17 65 Acknowledgements....................................................18 66 Appendix A -- Mutability of IP Options/Extension Headers............19 67 A1. IPv4 Options.................................................19 68 A2. IPv6 Extension Headers.......................................20 69 References..........................................................22 70 Disclaimer..........................................................23 71 Author Information..................................................23 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". (All IPv6 extension headers, as per RFC 1883, 149 encode the "Hdr Ext Len" field by first subtracting 1 (64-bit word) 150 from the header length (measured in 64-bit words). AH is an IPv6 151 extension header. However, since its length is measured in 32-bit 152 words, the "Payload Length" is calculated by subtracting 2 (32 bit 153 words).) In the "standard" case of a 96-bit authentication value 154 plus the 3 32-bit word fixed portion, this length field will be "4". 155 A "null" authentication algorithm may be used only for debugging 156 purposes. Its use would result in a "1" value for this field, as 157 there would be no corresponding 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, in combination with the 168 destination IP address and security protocol, uniquely identifies the 169 Security Association for this datagram. The set of SPI values in the 170 range 1 through 255 are reserved by the Internet Assigned Numbers 171 Authority (IANA) for future use; a reserved SPI value will not 172 normally be assigned by IANA unless the use of the assigned SPI value 173 is specified in an RFC. It is ordinarily selected by the destination 174 system upon establishment of an SA (see the Security Architecture 175 document for more details). 177 The SPI value of zero (0) is reserved for local, implementation- 178 specific use and MUST NOT be sent on the wire. For example, a key 179 management implementation MAY use the zero SPI value to mean "No 180 Security Association Exists" during the period when the IPsec 181 implementation has requested that its key management entity establish 182 a new SA, but the SA has not yet been established. 184 2.5 Sequence Number 186 This unsigned 32-bit field contains a monotonically increasing 187 counter value (sequence number). It is mandatory and is always 188 present even if the receiver does not elect to enable the anti-replay 189 service for a specific SA. Processing of the Sequence Number field 190 is at the discretion of the receiver, i.e., the sender MUST always 191 transmit this field, but the receiver need not act upon it (see the 192 discussion of Sequence Number Verification in the "Inbound Packet 193 Processing" section below). 195 The sender's counter and the receiver's counter are initialized to 0 196 when an SA is established. (The first packet sent using a given SA 197 will have a Sequence Number of 1; see Section 3.3.2 for more details 198 on how the Sequence Number is generated.) If anti-replay has been 199 enabled, the transmitted Sequence Number must never be allowed to 200 cycle. Thus, the sender's counter and the receiver's counter MUST be 201 reset (by establishing a new SA and thus a new key) prior to the 202 transmission of the 2^32nd packet on an SA. 204 2.6 Authentication Data 206 This is a variable-length field that contains the Integrity Check 207 Value (ICV) for this packet. The field must be an integral multiple 208 of 32 bits in length. The details of the ICV computation are 209 described in Section 3.3.3 below. This field may include explicit 210 padding. This padding is included to ensure that the length of the 211 AH header is an integral multiple of 32 bits (IPv4) or 64 bits 212 (IPv6). All implementations MUST support such padding. Details of 213 how to compute the required padding length are provided below. 215 3. Authentication Header Processing 217 3.1 Authentication Header Location 219 Like ESP, AH may be employed in two ways: transport mode or tunnel 220 mode. The former mode is applicable only to host implementations and 221 provides protection for upper layer protocols, in addition to 222 selected IP header fields. (In this mode, note that for "bump-in- 223 the-stack" or "bump-in-the-wire" implementations, as defined in the 224 Security Architecture document, inbound and outbound IP fragments may 225 require an IPsec implementation to perform extra IP 226 reassembly/fragmentation in order to both conform to this 227 specification and provide transparent IPsec support. Special care is 228 required to perform such operations within these implementations when 229 multiple interfaces are in use.) 231 In transport mode, AH is inserted after the IP header and before an 232 upper layer protocol, e.g., TCP, UDP, ICMP, etc. or before any other 233 IPsec headers that have already been inserted. In the context of 234 IPv4, this calls for placing AH after the IP header (and any options 235 that it contains), but before the upper layer protocol. (Note that 236 the term "transport" mode should not be misconstrued as restricting 237 its use to TCP and UDP. For example, an ICMP message MAY be sent 238 using either "transport" mode or "tunnel" mode.) The following 239 diagram illustrates AH transport mode positioning for a typical IPv4 240 packet, on a "before and after" basis. 242 BEFORE APPLYING AH 243 ---------------------------- 244 IPv4 |orig IP hdr | | | 245 |(any options)| TCP | Data | 246 ---------------------------- 248 AFTER APPLYING AH 249 --------------------------------- 250 IPv4 |orig IP hdr | | | | 251 |(any options)| AH | TCP | Data | 252 --------------------------------- 253 |<------- authenticated ------->| 254 except for mutable fields 256 In the IPv6 context, AH is viewed as an end-to-end payload, and thus 257 should appear after hop-by-hop, routing, and fragmentation extension 258 headers. The destination options extension header(s) could appear 259 either before or after the AH header depending on the semantics 260 desired. The following diagram illustrates AH transport mode 261 positioning for a typical IPv6 packet. 263 BEFORE APPLYING AH 264 --------------------------------------- 265 IPv6 | | ext hdrs | | | 266 | orig IP hdr |if present| TCP | Data | 267 --------------------------------------- 269 AFTER APPLYING AH 270 ------------------------------------------------------------ 271 IPv6 | |hop-by-hop, dest*, | | dest | | | 272 |orig IP hdr |routing, fragment. | AH | opt* | TCP | Data | 273 ------------------------------------------------------------ 274 |<---- authenticated except for mutable fields ----------->| 276 * = if present, could be before AH, after AH, or both 278 If more than one IPsec header/extension is required: 279 o the order of application of the security headers MUST be 280 defined by security policy 281 o The following 3 cases MUST be supported: 282 1. [IP][AH][upper] 283 2. [IP][ESP][upper] 284 3. [IP][AH][ESP][upper] 285 o arbitrary nesting is allowed -- Senders MAY generate 286 arbitrary nestings of IPsec headers and Receivers SHOULD 287 accept arbitrary nestings of IPsec headers. 289 Tunnel mode AH may be employed in either hosts or security gateways 290 (or in so-called "bump-in-the-stack" or "bump-in-the-wire" 291 implementations, as defined in the Security Architecture document). 292 When AH is implemented in a security gateway (to protect transit 293 traffic), tunnel mode must be used. In tunnel mode, the "inner" IP 294 header carries the ultimate source and destination addresses, while 295 an "outer" IP header may contain distinct IP addresses, e.g., 296 addresses of security gateways. In tunnel mode, AH protects the 297 entire inner IP packet, including the entire inner IP header. The 298 position of AH in tunnel mode, relative to the outer IP header, is 299 the same as for AH in transport mode. The following diagram 300 illustrates AH tunnel mode positioning for typical IPv4 and IPv6 301 packets. 303 ------------------------------------------------ 304 IPv4 | new IP hdr* | | orig IP hdr* | | | 305 |(any options)| AH | (any options) |TCP | Data | 306 ------------------------------------------------ 307 |<-- authenticated except for mutable fields ->| 309 -------------------------------------------------------------- 310 IPv6 | | ext hdrs*| | | ext hdrs*| | | 311 |new IP hdr*|if present| AH |orig IP hdr*|if present|TCP|Data| 312 -------------------------------------------------------------- 313 |<-------- authenticated except for mutable fields --------->| 315 * = construction of outer IP hdr/extensions and modification 316 of inner IP hdr/extensions is discussed below. 318 3.2 Authentication Algorithms 320 The authentication algorithm employed for the ICV computation is 321 specified by the SA. For point-to-point communication, suitable 322 authentication algorithms include keyed Message Authentication Codes 323 (MACs) based on symmetric encryption algorithms (e.g., DES) or on 324 one-way hash functions (e.g., MD5 or SHA-1). For multicast 325 communication, one-way hash algorithms combined with asymmetric 326 signature algorithms are appropriate, though performance and space 327 considerations currently preclude use of such algorithms. The 328 mandatory-to-implement authentication algorithms are described in 329 Section 5 "Conformance Requirements". Other algorithms MAY be 330 supported. Note: Where an algorithm yields more than 96 bits, the 331 output of the computation is truncated to the leftmost 96 bits. 333 3.3 Outbound Packet Processing 335 In transport mode, the transmitter inserts the AH header after the IP 336 header and before an upper layer protocol header, as described above. 337 In tunnel mode, the outer and inner IP header/extensions can be 338 inter-related in a variety of ways. The construction of the outer IP 339 header/extensions during the encapsulation process is described in 340 the Security Architecture document. 342 If there is more than one IPsec header/extension required, the order 343 of the application of the security headers MUST be defined by 344 security policy. For simplicity of processing, each IPsec header 345 SHOULD ignore the existence (i.e., not zero the contents or try to 346 predict the contents) of IPsec headers to be applied later. (While a 347 native IP or bump-in-the-stack implementation could predict the 348 contents of later IPsec headers that it applies itself, it won't be 349 possible for it to predict any IPsec headers added by a bump-in-the- 350 wire implementation between the host and the network.) 352 3.3.1 Security Association Lookup 354 AH is applied to an outbound packet only after an IPsec 355 implementation determines that the packet is associated with an SA 356 that calls for AH processing. The process of determining what, if 357 any, IPsec processing is applied to outbound traffic is described in 358 the Security Architecture document. 360 3.3.2 Sequence Number Generation 362 The sender's counter is initialized to 0 when an SA is established. 363 The transmitter increments the Sequence Number for this SA and 364 inserts the new value into the Sequence Number Field. Thus the first 365 packet sent using a given SA will have a Sequence Number of 1. 367 If anti-replay has been enabled, the transmitter checks to ensure 368 that the counter has not cycled before inserting the new value in the 369 Sequence Number field. In other words, the transmitter MUST not send 370 a packet on an SA if doing so would cause the Sequence Number to 371 cycle. An attempt to transmit a packet that would result in Sequence 372 Number overflow is an auditable event. (Note that this approach to 373 Sequence Number management does not require use of modular 374 arithmetic.) 376 If anti-replay has not been enabled, the sender does not need to 377 monitor or reset the counter, e.g., in the case of manual key 378 management. NOTE: If the receiver does NOT notify the sender that 379 anti-replay is enabled, then the sender may overflow the counter and 380 may send packets that the receiver will reject. 382 3.3.3 Integrity Check Value Calculation 384 The AH ICV is computed over: 385 o IP header fields that are either immutable in transit or that 386 are predictable in value upon arrival at the endpoint for the 387 AH SA 388 o the AH header (Next Header, Payload Len, Reserved, SPI, 389 Sequence Number, and the Authentication Data (which is set to 390 zero for this computation)) 391 o the upper level protocol data, which is assumed to be 392 immutable in transit 394 3.3.3.1 Handling Mutable Fields 396 If a field may be modified during transit, the value of the field is 397 set to zero for purposes of the ICV computation. If a field is 398 mutable, but its value at the (IPsec) receiver is predictable, then 399 that value is inserted into the field for purposes of the ICV 400 calculation. The Authentication Data field is also set to zero in 401 preparation for this computation. Note that by replacing each 402 field's value with zero, rather than omitting the field, alignment is 403 preserved for the ICV calculation. Also, the zero-fill approach 404 ensures that the length of the fields that are so handled cannot be 405 changed during transit, even though their contents are not explicitly 406 covered by the ICV. 408 As a new extension header or IPv4 option is created, it will be 409 defined in its own RFC and SHOULD include (in the Security 410 Considerations section) directions for how it should be handled when 411 calculating the AH ICV. If the IPSEC implementation encounters an 412 extension header that it does not recognize, it MUST zero the whole 413 header except for the Next Header and Hdr Ext Len fields. The length 414 of the extension header MUST be computed by 8 * Hdr Ext Len value + 415 8. If the IPSEC implementation encounters an IPv4 option that it 416 does not recognize, it should zero the whole option, using the second 417 byte of the option as the length. (IPv6 options contain a flag 418 indicating mutability, which determines appropriate processing for 419 such options.) 421 3.3.3.1.1 ICV Computation for IPv4 423 3.3.3.1.1.1 Base Header Fields 425 The IPv4 base header fields are classified as follows: 427 Immutable 428 Version 429 Internet Header Length 430 Total Length 431 Identification 432 Protocol 433 Source Address 434 Destination Address (without loose or strict source routing) 436 Mutable but predictable 437 Destination Address (with loose or strict source routing) 439 Mutable (zeroed prior to ICV calculation) 440 Type of Service (TOS) 441 Flags 442 Fragment Offset 443 Time to Live (TTL) 444 Header Checksum 446 TOS -- This field is excluded because some routers are known to 447 change the value of this field, even though the IP specification 448 does not consider TOS to be a mutable header field. 450 Flags -- This field is excluded since an intermediate router might 451 set the DF bit, even if the source did not select it. 453 Fragment Offset -- Since AH is applied only to non-fragmented IP 454 packets, the Offset Field must always be zero, and thus it is 455 excluded (even though it is predictable). 457 TTL -- This is changed en-route as a normal course of processing by 458 routers, and thus its value at the receiver is not predictable 459 by the sender. 461 Header Checksum -- This will change if any of these other fields 462 changes, and thus its value upon reception cannot be predicted 463 by the sender. 465 3.3.3.1.1.2 Options 467 For IPv4 (unlike IPv6), there is no mechanism for tagging options as 468 mutable in transit. Hence the IPv4 options are explicitly listed in 469 Appendix A and classified as immutable, mutable but predictable, or 470 mutable. For IPv4, the entire option is viewed as a unit; so even 471 though the type and length fields within most options are immutable 472 in transit, if an option is classified as mutable, the entire option 473 is zeroed for ICV computation purposes. 475 3.3.3.1.2 ICV Computation for IPv6 477 3.3.3.1.2.1 Base Header Fields 479 The IPv6 base header fields are classified as follows: 481 Immutable 482 Version 483 Payload Length 484 Next Header 485 Source Address 486 Destination Address (without Routing Extension Header) 488 Mutable but predictable 489 Destination Address (with Routing Extension Header) 491 Mutable (zeroed prior to ICV calculation) 492 Priority 493 Flow Label 494 Hop Limit 496 3.3.3.1.2.2 Extension Headers -- Options 498 The IPv6 extension headers (that are options) are explicitly listed 499 in Appendix A and classified as immutable, mutable but predictable, 500 or mutable. 502 IPv6 options in the Hop-by-Hop and Destination Extension Headers 503 contain a bit that indicates whether the option might change 504 (unpredictably) during transit. For any option for which contents 505 may change en-route, the entire "Option Data" field must be treated 506 as zero-valued octets when computing or verifying the ICV. The 507 Option Type and Opt Data Len are included in the ICV calculation. 508 All options for which the bit indicates immutability are included in 509 the ICV calculation. See the IPv6 specification [DH95] for more 510 information. 512 3.3.3.1.2.3 Extension Headers -- non-Options 514 The IPv6 extension headers (that are not options) are explicitly 515 listed in Appendix A and classified as immutable, mutable but 516 predictable, or mutable. 518 3.3.3.2 Padding 520 3.3.3.2.1 Authentication Data Padding 522 As mentioned in section 2.6, the Authentication Data field explicitly 523 includes padding to ensure that the AH header is a multiple of 32 524 bits (IPv4) or 64 bits (IPv6). If padding is required, its length is 525 determined by two factors: 527 - the length of the ICV 528 - the IP protocol version (v4 or v6) 530 For example, if the output of the selected algorithm is 96-bits, no 531 padding is required for either IPv4 or for IPv6. However, if a 532 different length ICV is generated, due to use of a different 533 algorithm, then padding may be required for the IPv6 environment. 534 The content of the padding field is arbitrarily selected by the 535 sender. (The padding is arbitrary, but need not be random to achieve 536 security.) These padding bytes are included in the Authentication 537 Data calculation, counted as part of the Payload Length, and 538 transmitted at the end of the Authentication Data field to enable the 539 receiver to perform the ICV calculation. 541 3.3.3.2.2 Implicit Packet Padding 543 For some authentication algorithms, the byte string over which the 544 ICV computation is performed must be a multiple of a blocksize 545 specified by the algorithm. If the IP packet length (including AH) 546 does not match the blocksize requirements for the algorithm, implicit 547 padding MUST be appended to the end of the packet, prior to ICV 548 computation. The padding octets MUST have a value of zero. The 549 blocksize (and hence the length of the padding) is specified by the 550 algorithm specification. This padding is not transmitted with the 551 packet. 553 3.3.4 Fragmentation 555 If required, IP fragmentation occurs after AH processing within an 556 IPsec implementation. Thus, transport mode AH is applied only to 557 whole IP datagrams (not to IP fragments). An IP packet to which AH 558 has been applied may itself be fragmented by routers en route, and 559 such fragments must be reassembled prior to AH processing at a 560 receiver. In tunnel mode, AH is applied to an IP packet, the payload 561 of which may be a fragmented IP packet. For example, a security 562 gateway or a "bump-in-the-stack" or "bump-in-the-wire" IPsec 563 implementation (see the Security Architecture document for details) 564 may apply tunnel mode AH to such fragments. 566 3.4 Inbound Packet Processing 568 If there is more than one IPsec header/extension present, the 569 processing for each one ignores (does not zero, does not use) any 570 IPsec headers applied subsequent to the header being processed. 572 3.4.1 Reassembly 574 If required, reassembly is performed prior to AH processing. If a 575 packet offered to AH for processing appears to be an IP fragment, 576 i.e., the OFFSET field is non-zero or the MORE FRAGMENTS flag is set, 577 the receiver MUST discard the packet; this is an auditable event. The 578 audit log entry for this event SHOULD include the SPI value, 579 date/time, Source Address, Destination Address, and (in IPv6) the 580 Flow ID. 582 3.4.2 Security Association Lookup 584 Upon receipt of a packet containing an IP Authentication Header, the 585 receiver determines the appropriate (unidirectional) SA, based on the 586 destination IP address, security protocol (AH),and the SPI. (This 587 process is described in more detail in the Security Architecture 588 document.) The SA indicates whether the Sequence Number field will 589 be checked, specifies the algorithm(s) employed for ICV computation, 590 and indicates the key(s) required to validate the ICV. 592 If no valid Security Association exists for this session (e.g., the 593 receiver has no key), the receiver MUST discard the packet; this is 594 an auditable event. The audit log entry for this event SHOULD 595 include the SPI value, date/time, Source Address, Destination 596 Address, and (in IPv6) the Flow ID. 598 3.4.3 Sequence Number Verification 600 All AH implementations MUST support the anti-replay service, though 601 its use may be enabled or disabled on a per-SA basis. (Note that 602 there are no provisions for managing transmitted Sequence Number 603 values among multiple senders directing traffic to a single, 604 multicast SA. Thus the anti-replay service SHOULD NOT be used in a 605 multi-sender multicast environment that employs a single, multicast 606 SA.) 608 If the receiver does not enable anti-replay for an SA, no checks are 609 performed on the inbound Sequence Number. If an SA establishment 610 protocol such as Oakley/ISAKMP is employed, then the receiver SHOULD 611 notify the transmitter, during SA establishment, if the receiver will 612 provide anti-replay protection. 614 If the receiver has enabled the anti-replay service for this SA, the 615 receiver packet counter for the SA MUST be initialized to zero when 616 the SA is established. For each received packet, the receiver MUST 617 verify that the packet contains a Sequence Number that does not 618 duplicate the Sequence Number of any other packets received during 619 the life of this SA. This SHOULD be the first AH check applied to a 620 packet after it has been matched to an SA, to speed rejection of 621 duplicate packets. 623 Duplicates are rejected through the use of a sliding receive window. 624 (How the window is implemented is a local matter, but the following 625 text describes the functionality that the implementation must 626 exhibit.) A MINIMUM window size of 32 MUST be supported; but a 627 window size of 64 is preferred and SHOULD be employed as the default. 628 Another window size (larger than the MINIMUM) MAY be chosen by the 629 receiver. (The receiver does NOT notify the sender of the window 630 size.) 632 The "right" edge of the window represents the highest, validated 633 Sequence Number value received on this SA. Packets that contain 634 Sequence Numbers lower than the "left" edge of the window are 635 rejected. Packets falling within the window are checked against a 636 list of received packets within the window. An efficient means for 637 performing this check, based on the use of a bit mask, is described 638 in the Security Architecture document. 640 If the received packet falls within the window and is new, or if the 641 packet is to the right of the window, then the receiver proceeds to 642 ICV verification. If the ICV validation fails, the receiver MUST 643 discard the received IP datagram as invalid; this is an auditable 644 event. The audit log entry for this event SHOULD include the SPI 645 value, date/time, Source Address, Destination Address, the Sequence 646 Number, and (in IPv6) the Flow ID. The receive window is updated 647 only if the ICV verification succeeds. 649 DISCUSSION: 651 Note that if the packet is either inside the window and new, or is 652 outside the window on the "right" side, the receiver MUST 653 authenticate the packet before updating the Sequence Number window 654 data. 656 3.4.4 Integrity Check Value Verification 658 The receiver computes the ICV over the appropriate fields of the 659 packet, using the specified authentication algorithm, and verifies 660 that it is the same as the ICV included in the Authentication Data 661 field of the packet. Details of the computation are provided below. 663 If the computed and received ICV's match, then the datagram is valid, 664 and it is accepted. If the test fails, then the receiver MUST 665 discard the received IP datagram as invalid; this is an auditable 666 event. The audit log entry SHOULD include the SPI value, date/time 667 received, Source Address, Destination Address, and (in IPv6) the Flow 668 ID. 670 DISCUSSION: 672 Begin by saving the ICV value and replacing it (but not any 673 Authentication Data padding) with zero. Zero all other fields 674 that may have been modified during transit. (See section 3.3.3.1 675 for a discussion of which fields are zeroed before performing the 676 ICV calculation.) Check the overall length of the packet, and if 677 it requires implicit padding based on the requirements of the 678 authentication algorithm, append zero-filled bytes to the end of 679 the packet as required. Now perform the ICV computation and 680 compare the result with the saved value. Note that if the output 681 of the authentication algorithm is greater than 96 bits, the 682 output should be truncated to the leftmost 96 bits. (If a digital 683 signature and one-way hash are used for the ICV computation, the 684 matching process is more complex and will be described in the 685 algorithm specification.) 687 4. Auditing 689 Not all systems that implement AH will implement auditing. However, 690 if AH is incorporated into a system that supports auditing, then the 691 AH implementation MUST also support auditing and MUST allow a system 692 administrator to enable or disable auditing for AH. For the most 693 part, the granularity of auditing is a local matter. However, 694 several auditable events are identified in this specification and for 695 each of these events a minimum set of information that SHOULD be 696 included in an audit log is defined. Additional information also MAY 697 be included in the audit log for each of these events, and additional 698 events, not explicitly called out in this specification, also MAY 699 result in audit log entries. There is no requirement for the 700 receiver to transmit any message to the purported transmitter in 701 response to the detection of an auditable event, because of the 702 potential to induce denial of service via such action. 704 5. Conformance Requirements 706 Implementations that claim conformance or compliance with this 707 specification MUST fully implement the AH syntax and processing 708 described here and MUST comply with all requirements of the Security 709 Architecture document. If the key used to compute an ICV is manually 710 distributed, correct provision of the anti-replay service would 711 require correct maintenance of the counter state at the transmitter, 712 until the key is replaced, and there likely would be no automated 713 recovery provision if counter overflow were imminent. Thus a 714 compliant implementation SHOULD NOT provide this service in 715 conjunction with SAs that are manually keyed. A compliant AH 716 implementation MUST support the following mandatory-to-implement 717 algorithms: 719 - HMAC with MD5 [MG97a] 720 - HMAC with SHA-1 [MG97b] 722 6. Security Considerations 724 Security is central to the design of this protocol, and these 725 security considerations permeate the specification. Additional 726 security-relevant aspects of using the IPsec protocol are discussed 727 in the Security Architecture document. 729 7. Differences from RFC 1826 731 This specification of AH differs from RFC 1826 [ATK95] in several 732 important respects, but the fundamental features of AH remain intact. 733 One goal of the revision of RFC 1826 was to provide a complete 734 framework for AH, with ancillary RFCs required only for algorithm 735 specification. For example, the anti-replay service is now an 736 integral, mandatory part of AH, not a feature of a transform defined 737 in another RFC. Carriage of a sequence number to support this 738 service is now required at all times. The default algorithms 739 required for interoperability have been changed to HMAC with MD5 or 740 SHA-1 (vs. keyed MD5), for security reasons. The list of IPv4 header 741 fields excluded from the ICV computation has been expanded to include 742 the OFFSET and FLAGS fields. 744 Another motivation for revision was to provide additional detail and 745 clarification of subtle points. This specification provides 746 rationale for exclusion of selected IPv4 header fields from AH 747 coverage and provides examples on positioning of AH in both the IPv4 748 and v6 contexts. Auditing requirements have been clarified in this 749 version of the specification. Tunnel mode AH was mentioned only in 750 passing in RFC 1826, but now is a mandatory feature of AH. 751 Discussion of interactions with key management and with security 752 labels have been moved to the Security Architecture document. 754 Acknowledgements 756 For over 2 years, this document has evolved through multiple versions 757 and iterations. During this time, many people have contributed 758 significant ideas and energy to the process and the documents 759 themselves. The authors would like to thank Karen Seo for providing 760 extensive help in the review, editing, background research, and 761 coordination for this version of the specification. The authors 762 would also like to thank the members of the IPsec and IPng working 763 groups, with special mention of the efforts of (in alphabetic order): 764 Steve Bellovin, Steve Deering, Francis Dupont, Phil Karn, Frank 765 Kastenholz, Perry Metzger, David Mihelcic, Hilarie Orman, Norman 766 Shulman, William Simpson, and Nina Yuan. 768 Appendix A -- Mutability of IP Options/Extension Headers 770 A1. IPv4 Options 772 This table shows how the IPv4 options are classified with regard to 773 "mutability". Where two references are provided, the second one 774 supercedes the first. This table is based in part on information 775 provided in RFC1700, "ASSIGNED NUMBERS", (October 1994). 777 Opt. 778 Copy Class # Name Reference 779 ---- ----- --- ------------------------- --------- 780 IMMUTABLE -- included in ICV calculation 781 0 0 0 End of Options List [RFC791] 782 0 0 1 No Operation [RFC791] 783 1 0 2 Security [RFC1108(historic but in use)] 784 1 0 5 Extended Security [RFC1108(historic but in use)] 785 1 0 6 Commercial Security [expired I-D, now US MIL STD] 786 1 0 20 Router Alert [RFC2113] 787 1 0 21 Sender Directed Multi- [RFC1770] 788 Destination Delivery 789 MUTABLE -- zeroed 790 1 0 3 Loose Source Route [RFC791] 791 0 2 4 Time Stamp [RFC791] 792 0 0 7 Record Route [RFC791] 793 1 0 9 Strict Source Route [RFC791] 794 0 2 18 Traceroute [RFC1393] 796 EXPERIMENTAL, SUPERCEDED -- zeroed 797 1 0 8 Stream ID [RFC791, RFC1122 (Host Req)] 798 0 0 11 MTU Probe [RFC1063, RFC1191 (PMTU)] 799 0 0 12 MTU Reply [RFC1063, RFC1191 (PMTU)] 800 1 0 17 Extended Internet Protocol [RFC1385, RFC1883 (IPv6)] 801 0 0 10 Experimental Measurement [ZSu] 802 1 2 13 Experimental Flow Control [Finn] 803 1 0 14 Experimental Access Ctl [Estrin] 804 0 0 15 ??? [VerSteeg] 805 1 0 16 IMI Traffic Descriptor [Lee] 806 1 0 19 Address Extension [Ullmann IPv7] 808 NOTE: Use of the Router Alert option is potentially incompatible with 809 use of IPSEC. Although the option is immutable, its use implies that 810 each router along a packet's path will "process" the packet and 811 consequently might change the packet. This would happen on a hop by 812 hop basis as the packet goes from router to router. Prior to being 813 processed by the application to which the option contents are 814 directed, e.g., RSVP/IGMP, the packet should encounter AH processing. 816 However, AH processing would require that each router along the path 817 is a member of a multicast-SA defined by the SPI. This might pose 818 problems for packets that are not strictly source routed, and it 819 requires multicast support techniques not currently available. 821 NOTE: Addition or removal of any security labels (BSO, ESO, CIPSO) by 822 systems along a packet's path conflicts with the classification of 823 these IP Options as immutable and is incompatible with the use of 824 IPSEC. 826 A2. IPv6 Extension Headers 828 This table shows how the IPv6 Extension Headers are classified with 829 regard to "mutability". 831 Option/Extension Name Reference 832 ----------------------------------- --------- 833 MUTABLE BUT PREDICTABLE -- included in ICV calculation 834 Routing (Type 0) [RFC1883] 836 BIT INDICATES IF OPTION IS MUTABLE (CHANGES UNPREDICTABLY DURING TRANSIT) 837 Hop by Hop options [RFC1883] 838 Destination options [RFC1883] 840 NOT APPLICABLE 841 Fragmentation [RFC1883] 843 Options -- IPv6 options in the Hop-by-Hop and Destination Extension 844 Headers contain a bit that indicates whether the option might 845 change (unpredictably) during transit. For any option for which 846 contents may change en-route, the entire "Option Data" field 847 must be treated as zero-valued octets when computing or 848 verifying the ICV. The Option Type and Opt Data Len are 849 included in the ICV calculation. All options for which the bit 850 indicates immutability are included in the ICV calculation. See 851 the IPv6 specification [DH95] for more information. 853 Routing (Type 0) -- The IPv6 Routing Header "Type 0" will rearrange 854 the address fields within the packet during transit from source 855 to destination. However, the contents of the packet as it will 856 appear at the receiver are known to the sender and to all 857 intermediate hops. Hence, the IPv6 Routing Header "Type 0" is 858 included in the Authentication Data calculation as mutable but 859 predictable. The transmitter must order the field so that it 860 appears as it will at the receiver, prior to performing the ICV 861 computation. 863 Fragmentation -- Fragmentation occurs after outbound IPSEC processing 864 (section 3.3) and reassembly occurs before inbound IPSEC 865 processing (section 3.4). So the Fragmentation Extension 866 Header, if it exists, is not seen by IPSEC. 868 Note that on the receive side, the IP implementation could leave 869 a Fragmentation Extension Header in place when it does 870 re-assembly. If this happens, then when AH receives the packet, 871 before doing ICV processing, AH MUST "remove" (or skip over) 872 this header and change the previous header's "Next Header" field 873 to be the "Next Header" field in the Fragmentation Extension 874 Header. 876 Note that on the send side, the IP implementation could give the 877 IPSEC code a packet with a Fragmentation Extension Header with 878 Offset of 0 (first fragment) and a More Fragments Flag of 0 879 (last fragment). If this happens, then before doing ICV 880 processing, AH MUST first "remove" (or skip over) this header 881 and change the previous header's "Next Header" field to be the 882 "Next Header" field in the Fragmentation Extension Header. 884 References 886 [ATK95] R. Atkinson, "The IP Authentication Header," RFC 1826, 887 August 1995. 889 [BCCH94] R. Braden, D. Clark, S. Crocker, & C.Huitema, "Report of 890 IAB Workshop on Security in the Internet Architecture", 891 RFC-1636, 9 June 1994, pp. 21-34. 893 [Bel89] Steven M. Bellovin, "Security Problems in the TCP/IP 894 Protocol Suite", ACM Computer Communications Review, Vol. 895 19, No. 2, March 1989. 897 [CER95] Computer Emergency Response Team (CERT), "IP Spoofing 898 Attacks and Hijacked Terminal Connections", CA-95:01, 899 January 1995. Available via anonymous ftp from 900 info.cert.org in /pub/cert_advisories. 902 [DH95] Steve Deering & Bob Hinden, "Internet Protocol version 6 903 (IPv6) Specification", RFC-1883, December 1995. 905 [GM93] James Galvin & Keith McCloghrie, Security Protocols for 906 version 2 of the Simple Network Management Protocol 907 (SNMPv2), RFC-1446, April 1993. 909 [KA97a] Steve Kent, Randall Atkinson, "Security Architecture for 910 the Internet Protocol", Internet Draft, ?? 1997. 912 [KA97b] Steve Kent, Randall Atkinson, "IP Encapsulating Security 913 Payload (ESP)", Internet Draft, ?? 1997. 915 [KA97c] Steve Kent, Randall Atkinson, "IP Authentication Header", 916 Internet Draft, ?? 1997. 918 [Ken91] Steve Kent, "US DoD Security Options for the Internet 919 Protocol", RFC-1108, November 1991. 921 [MG97a] C. Madson & R. Glenn, "The Use of HMAC-MD5-96 within ESP 922 and AH", Internet Draft, 7/2/97. 924 [MG97b] C. Madson & R. Glenn, "The Use of HMAC-SHA-1-96 within ESP 925 and AH", Internet Draft, 7/2/97. 927 [Riv92] Ronald Rivest, "The MD5 Message Digest Algorithm," RFC- 928 1321, April 1992. 930 [SHA] NIST, FIPS PUB 180-1: Secure Hash Standard, April 1995 932 [STD-1] J. Postel, "Internet Official Protocol Standards", STD-1, 933 March 1996. 935 [STD-2] J. Reynolds & J. Postel, "Assigned Numbers", STD-2, 20 936 October 1994. 938 Disclaimer 940 The views and specification here are those of the authors and are not 941 necessarily those of their employers. The authors and their 942 employers specifically disclaim responsibility for any problems 943 arising from correct or incorrect implementation or use of this 944 specification. 946 Author Information 948 Stephen Kent 949 BBN Corporation 950 70 Fawcett Street 951 Cambridge, MA 02140 952 USA 953 E-mail: kent@bbn.com 954 Telephone: +1 (617) 873-3988 956 Randall Atkinson 957 @Home Network 958 425 Broadway, 959 Redwood City, CA 94063 960 USA 961 E-mail: rja@inet.org