idnits 2.17.1 draft-ietf-ipsec-auth-header-03.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-23) 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. Miscellaneous warnings: ---------------------------------------------------------------------------- == The document seems to lack the recommended RFC 2119 boilerplate, even if it appears to use RFC 2119 keywords. (The document does seem to have the reference to RFC 2119 which the ID-Checklist requires). == 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 is enabled (the default), the sender checks to ensure that the counter has not cycled before inserting the new value in the Sequence Number field. In other words, the sender 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 (November 1997) is 9656 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: 'IP1' is mentioned on line 298, but not defined == Missing Reference: 'AH' is mentioned on line 298, but not defined == Missing Reference: 'IP2' is mentioned on line 297, but not defined == Missing Reference: 'ESP' is mentioned on line 298, but not defined == Missing Reference: 'RFC791' is mentioned on line 803, but not defined == Missing Reference: 'RFC2113' is mentioned on line 796, but not defined == Missing Reference: 'RFC1770' is mentioned on line 797, but not defined ** Obsolete undefined reference: RFC 1770 (Obsoleted by RFC 6814) == Missing Reference: 'RFC1393' is mentioned on line 804, but not defined ** Obsolete undefined reference: RFC 1393 (Obsoleted by RFC 6814) == Missing Reference: 'ZSu' is mentioned on line 811, but not defined == Missing Reference: 'Finn' is mentioned on line 812, but not defined == Missing Reference: 'Estrin' is mentioned on line 813, but not defined == Missing Reference: 'VerSteeg' is mentioned on line 814, but not defined == Missing Reference: 'Lee' is mentioned on line 815, but not defined == Missing Reference: 'RFC1883' is mentioned on line 851, but not defined ** Obsolete undefined reference: RFC 1883 (Obsoleted by RFC 2460) == Unused Reference: 'BCCH94' is defined on line 899, but no explicit reference was found in the text == Unused Reference: 'Bel89' is defined on line 903, but no explicit reference was found in the text == Unused Reference: 'CER95' is defined on line 910, but no explicit reference was found in the text == Unused Reference: 'GM93' is defined on line 918, but no explicit reference was found in the text == Unused Reference: 'KA97c' is defined on line 928, but no explicit reference was found in the text == Unused Reference: 'Ken91' is defined on line 931, but no explicit reference was found in the text == Unused Reference: 'Riv92' is defined on line 940, but no explicit reference was found in the text == Unused Reference: 'SHA' is defined on line 943, but no explicit reference was found in the text == Unused Reference: 'STD-1' is defined on line 945, 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: 19 errors (**), 0 flaws (~~), 26 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-03.txt November 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.....................16 61 4. Auditing.........................................................16 62 5. Conformance Requirements.........................................17 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. (Although 80 the default calls for the sender to increment the Sequence Number 81 used for anti-replay, the service is effective only if the receiver 82 checks the Sequence Number.) AH provides authentication for as much 83 of the IP header as possible, as well as for upper level protocol 84 data. However, some IP header fields may change in transit and the 85 value of these fields, when the packet arrives at the receiver, may 86 not be predictable by the sender. The values of such fields cannot 87 be protected by AH. Thus the protection provided to the IP header by 88 AH is somewhat piecemeal. 90 AH may be applied alone, in combination with the IP Encapsulating 91 Security Payload (ESP) [KA97b], or in a nested fashion through the 92 use of tunnel mode (see ''Security Architecture for the Internet 93 Protocol'' [KA97a], hereafter referred to as the Security Architecture 94 document). Security services can be provided between a pair of 95 communicating hosts, between a pair of communicating security 96 gateways, or between a security gateway and a host. ESP may be used 97 to provide the same security services, and it also provides a 98 confidentiality (encryption) service. The primary difference between 99 the authentication provided by ESP and AH is the extent of the 100 coverage. Specifically, ESP does not protect any IP header fields 101 unless those fields are encapsulated by ESP (tunnel mode). For more 102 details on how to use AH and ESP in various network environments, see 103 the Security Architecture document [KA97a]. 105 It is assumed that the reader is familiar with the terms and concepts 106 described in the Security Architecture document. In particular, the 107 reader should be familiar with the definitions of security services 108 offered by AH and ESP, the concept of Security Associations, the ways 109 in which AH can be used in conjunction with ESP, and the different 110 key management options available for AH and ESP. (With regard to the 111 last topic, the current key management options required for both AH 112 and ESP are manual keying and automated keying via ISAKMP/Oakley.) 114 The keywords MUST, MUST NOT, REQUIRED, SHALL, SHALL NOT, SHOULD, 115 SHOULD NOT, RECOMMENDED, MAY, and OPTIONAL, when they appear in this 116 document, are to be interpreted as described in RFC 2119 [Bra97]. 118 2. Authentication Header Format 120 The protocol header (IPv4, IPv6, or Extension) immediately preceding the 121 AH header will contain the value 51 in its Protocol (IPv4) or Next 122 Header (IPv6, Extension) field [STD-2]. 124 0 1 2 3 125 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 126 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 127 | Next Header | Payload Len | RESERVED | 128 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 129 | Security Parameters Index (SPI) | 130 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 131 | Sequence Number Field | 132 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 133 | | 134 + Authentication Data (variable) | 135 | | 136 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 138 The following subsections define the fields that comprise the AH 139 format. All the fields described here are mandatory, i.e., they are 140 always present in the AH format and are included in the ICV 141 computation. 143 2.1 Next Header 145 The Next Header is an 8-bit field that identifies the type of the 146 next payload after the Authentication Header. The value of this 147 field is chosen from the set of IP Protocol Numbers defined in the 148 most recent "Assigned Numbers" [STD-2] RFC from the Internet Assigned 149 Numbers Authority (IANA). 151 2.2 Payload Length 153 This 8-bit field specifies the length of AH in 32-bit words (4-byte 154 units), minus "2". (All IPv6 extension headers, as per RFC 1883, 155 encode the "Hdr Ext Len" field by first subtracting 1 (64-bit word) 156 from the header length (measured in 64-bit words). AH is an IPv6 157 extension header. However, since its length is measured in 32-bit 158 words, the "Payload Length" is calculated by subtracting 2 (32 bit 159 words).) In the "standard" case of a 96-bit authentication value 160 plus the 3 32-bit word fixed portion, this length field will be "4". 161 A "null" authentication algorithm may be used only for debugging 162 purposes. Its use would result in a "1" value for this field for 163 IPv4 or a "2" for IPv6, as there would be no corresponding 164 Authentication Data field (see Section 3.3.3.2.1 on "Authentication 165 Data Padding"). 167 2.3 Reserved 169 This 16-bit field is reserved for future use. It MUST be set to 170 "zero." (Note that the value is included in the Authentication Data 171 calculation, but is otherwise ignored by the recipient.) 173 2.4 Security Parameters Index (SPI) 175 The SPI is an arbitrary 32-bit value that, in combination with the 176 destination IP address and security protocol (AH), uniquely 177 identifies the Security Association for this datagram. The set of 178 SPI values in the range 1 through 255 are reserved by the Internet 179 Assigned Numbers Authority (IANA) for future use; a reserved SPI 180 value will not normally be assigned by IANA unless the use of the 181 assigned SPI value is specified in an RFC. It is ordinarily selected 182 by the destination system upon establishment of an SA (see the 183 Security Architecture document for more details). 185 The SPI value of zero (0) is reserved for local, implementation- 186 specific use and MUST NOT be sent on the wire. For example, a key 187 management implementation MAY use the zero SPI value to mean "No 188 Security Association Exists" during the period when the IPsec 189 implementation has requested that its key management entity establish 190 a new SA, but the SA has not yet been established. 192 2.5 Sequence Number 194 This unsigned 32-bit field contains a monotonically increasing 195 counter value (sequence number). It is mandatory and is always 196 present even if the receiver does not elect to enable the anti-replay 197 service for a specific SA. Processing of the Sequence Number field 198 is at the discretion of the receiver, i.e., the sender MUST always 199 transmit this field, but the receiver need not act upon it (see the 200 discussion of Sequence Number Verification in the "Inbound Packet 201 Processing" section below). 203 The sender's counter and the receiver's counter are initialized to 0 204 when an SA is established. (The first packet sent using a given SA 205 will have a Sequence Number of 1; see Section 3.3.2 for more details 206 on how the Sequence Number is generated.) If anti-replay is enabled 207 (the default), the transmitted Sequence Number must never be allowed 208 to cycle. Thus, the sender's counter and the receiver's counter MUST 209 be reset (by establishing a new SA and thus a new key) prior to the 210 transmission of the 2^32nd packet on an SA. 212 2.6 Authentication Data 214 This is a variable-length field that contains the Integrity Check 215 Value (ICV) for this packet. The field must be an integral multiple 216 of 32 bits in length. The details of the ICV computation are 217 described in Section 3.3.3 below. This field may include explicit 218 padding. This padding is included to ensure that the length of the 219 AH header is an integral multiple of 32 bits (IPv4) or 64 bits 220 (IPv6). All implementations MUST support such padding. Details of 221 how to compute the required padding length are provided below. The 222 authentication algorithm specification MUST specify the length of the 223 ICV and the comparison rules and processing steps for validation. 225 3. Authentication Header Processing 227 3.1 Authentication Header Location 229 Like ESP, AH may be employed in two ways: transport mode or tunnel 230 mode. The former mode is applicable only to host implementations and 231 provides protection for upper layer protocols, in addition to 232 selected IP header fields. (In this mode, note that for "bump-in- 233 the-stack" or "bump-in-the-wire" implementations, as defined in the 234 Security Architecture document, inbound and outbound IP fragments may 235 require an IPsec implementation to perform extra IP 236 reassembly/fragmentation in order to both conform to this 237 specification and provide transparent IPsec support. Special care is 238 required to perform such operations within these implementations when 239 multiple interfaces are in use.) 241 In transport mode, AH is inserted after the IP header and before an 242 upper layer protocol, e.g., TCP, UDP, ICMP, etc. or before any other 243 IPsec headers that have already been inserted. In the context of 244 IPv4, this calls for placing AH after the IP header (and any options 245 that it contains), but before the upper layer protocol. (Note that 246 the term "transport" mode should not be misconstrued as restricting 247 its use to TCP and UDP. For example, an ICMP message MAY be sent 248 using either "transport" mode or "tunnel" mode.) The following 249 diagram illustrates AH transport mode positioning for a typical IPv4 250 packet, on a "before and after" basis. 252 BEFORE APPLYING AH 253 ---------------------------- 254 IPv4 |orig IP hdr | | | 255 |(any options)| TCP | Data | 256 ---------------------------- 258 AFTER APPLYING AH 259 --------------------------------- 260 IPv4 |orig IP hdr | | | | 261 |(any options)| AH | TCP | Data | 262 --------------------------------- 263 |<------- authenticated ------->| 264 except for mutable fields 266 In the IPv6 context, AH is viewed as an end-to-end payload, and thus 267 should appear after hop-by-hop, routing, and fragmentation extension 268 headers. The destination options extension header(s) could appear 269 either before or after the AH header depending on the semantics 270 desired. The following diagram illustrates AH transport mode 271 positioning for a typical IPv6 packet. 273 BEFORE APPLYING AH 274 --------------------------------------- 275 IPv6 | | ext hdrs | | | 276 | orig IP hdr |if present| TCP | Data | 277 --------------------------------------- 279 AFTER APPLYING AH 280 ------------------------------------------------------------ 281 IPv6 | |hop-by-hop, dest*, | | dest | | | 282 |orig IP hdr |routing, fragment. | AH | opt* | TCP | Data | 283 ------------------------------------------------------------ 284 |<---- authenticated except for mutable fields ----------->| 286 * = if present, could be before AH, after AH, or both 288 If more than one IPsec header/extension is required, then starting 289 with packet [IP1][upper], the following 5 cases plus any combination 290 of one of the Tunnel cases followed by one of the Transport cases 291 (i.e., 4 then 1, 4 then 2, 4 then 3, 5 then 1, 5 then 2, 5 then 3.) 292 MUST be supported. 294 Transport Tunnel 295 ----------------- --------------------- 296 1. [IP1][AH][upper] 4. [IP2][AH][IP1][upper] 297 2. [IP1][ESP][upper] 5. [IP2][ESP][IP1][upper] 298 3. [IP1][AH][ESP][upper] 300 Support for additional combinations of AH and ESP is optional. Use 301 of other, optional combinations may adversely affect 302 interoperability. 304 Tunnel mode AH may be employed in either hosts or security gateways 305 (or in so-called "bump-in-the-stack" or "bump-in-the-wire" 306 implementations, as defined in the Security Architecture document). 307 When AH is implemented in a security gateway (to protect transit 308 traffic), tunnel mode must be used. In tunnel mode, the "inner" IP 309 header carries the ultimate source and destination addresses, while 310 an "outer" IP header may contain distinct IP addresses, e.g., 311 addresses of security gateways. In tunnel mode, AH protects the 312 entire inner IP packet, including the entire inner IP header. The 313 position of AH in tunnel mode, relative to the outer IP header, is 314 the same as for AH in transport mode. The following diagram 315 illustrates AH tunnel mode positioning for typical IPv4 and IPv6 316 packets. 318 ------------------------------------------------ 319 IPv4 | new IP hdr* | | orig IP hdr* | | | 320 |(any options)| AH | (any options) |TCP | Data | 321 ------------------------------------------------ 322 |<- authenticated except for mutable fields -->| 323 | in the new IP hdr | 325 -------------------------------------------------------------- 326 IPv6 | | ext hdrs*| | | ext hdrs*| | | 327 |new IP hdr*|if present| AH |orig IP hdr*|if present|TCP|Data| 328 -------------------------------------------------------------- 329 |<-- authenticated except for mutable fields in new IP hdr ->| 331 * = construction of outer IP hdr/extensions and modification 332 of inner IP hdr/extensions is discussed below. 334 3.2 Authentication Algorithms 336 The authentication algorithm employed for the ICV computation is 337 specified by the SA. For point-to-point communication, suitable 338 authentication algorithms include keyed Message Authentication Codes 339 (MACs) based on symmetric encryption algorithms (e.g., DES) or on 340 one-way hash functions (e.g., MD5 or SHA-1). For multicast 341 communication, one-way hash algorithms combined with asymmetric 342 signature algorithms are appropriate, though performance and space 343 considerations currently preclude use of such algorithms. The 344 mandatory-to-implement authentication algorithms are described in 345 Section 5 "Conformance Requirements". Other algorithms MAY be 346 supported. 348 3.3 Outbound Packet Processing 350 In transport mode, the sender inserts the AH header after the IP 351 header and before an upper layer protocol header, as described above. 352 In tunnel mode, the outer and inner IP header/extensions can be 353 inter-related in a variety of ways. The construction of the outer IP 354 header/extensions during the encapsulation process is described in 355 the Security Architecture document. 357 If there is more than one IPsec header/extension required, the order 358 of the application of the security headers MUST be defined by 359 security policy. For simplicity of processing, each IPsec header 360 SHOULD ignore the existence (i.e., not zero the contents or try to 361 predict the contents) of IPsec headers to be applied later. (While a 362 native IP or bump-in-the-stack implementation could predict the 363 contents of later IPsec headers that it applies itself, it won't be 364 possible for it to predict any IPsec headers added by a bump-in-the- 365 wire implementation between the host and the network.) 367 3.3.1 Security Association Lookup 369 AH is applied to an outbound packet only after an IPsec 370 implementation determines that the packet is associated with an SA 371 that calls for AH processing. The process of determining what, if 372 any, IPsec processing is applied to outbound traffic is described in 373 the Security Architecture document. 375 3.3.2 Sequence Number Generation 377 The sender's counter is initialized to 0 when an SA is established. 378 The sender increments the Sequence Number for this SA and inserts the 379 new value into the Sequence Number Field. Thus the first packet sent 380 using a given SA will have a Sequence Number of 1. 382 If anti-replay is enabled (the default), the sender checks to ensure 383 that the counter has not cycled before inserting the new value in the 384 Sequence Number field. In other words, the sender MUST not send a 385 packet on an SA if doing so would cause the Sequence Number to cycle. 386 An attempt to transmit a packet that would result in Sequence Number 387 overflow is an auditable event. (Note that this approach to Sequence 388 Number management does not require use of modular arithmetic.) 390 If anti-replay has been disabled, the sender does not need to monitor 391 or reset the counter, e.g., in the case of manual key management. 393 3.3.3 Integrity Check Value Calculation 395 The AH ICV is computed over: 396 o IP header fields that are either immutable in transit or that 397 are predictable in value upon arrival at the endpoint for the 398 AH SA 399 o the AH header (Next Header, Payload Len, Reserved, SPI, 400 Sequence Number, and the Authentication Data (which is set to 401 zero for this computation)) 402 o the upper level protocol data, which is assumed to be 403 immutable in transit 405 3.3.3.1 Handling Mutable Fields 407 If a field may be modified during transit, the value of the field is 408 set to zero for purposes of the ICV computation. If a field is 409 mutable, but its value at the (IPsec) receiver is predictable, then 410 that value is inserted into the field for purposes of the ICV 411 calculation. The Authentication Data field is also set to zero in 412 preparation for this computation. Note that by replacing each 413 field's value with zero, rather than omitting the field, alignment is 414 preserved for the ICV calculation. Also, the zero-fill approach 415 ensures that the length of the fields that are so handled cannot be 416 changed during transit, even though their contents are not explicitly 417 covered by the ICV. 419 As a new extension header or IPv4 option is created, it will be 420 defined in its own RFC and SHOULD include (in the Security 421 Considerations section) directions for how it should be handled when 422 calculating the AH ICV. If the IPsec implementation encounters an 423 extension header that it does not recognize, it MUST zero the whole 424 header except for the Next Header and Hdr Ext Len fields. The length 425 of the extension header MUST be computed by 8 * Hdr Ext Len value + 426 8. If the IPsec implementation encounters an IPv4 option that it 427 does not recognize, it should zero the whole option, using the second 428 byte of the option as the length. (IPv6 options contain a flag 429 indicating mutability, which determines appropriate processing for 430 such options.) 432 3.3.3.1.1 ICV Computation for IPv4 434 3.3.3.1.1.1 Base Header Fields 436 The IPv4 base header fields are classified as follows: 438 Immutable 439 Version 440 Internet Header Length 441 Total Length 442 Identification 443 Protocol (This should be the value for AH.) 444 Source Address 445 Destination Address (without loose or strict source routing) 447 Mutable but predictable 448 Destination Address (with loose or strict source routing) 450 Mutable (zeroed prior to ICV calculation) 451 Type of Service (TOS) 452 Flags 453 Fragment Offset 454 Time to Live (TTL) 455 Header Checksum 457 TOS -- This field is excluded because some routers are known to 458 change the value of this field, even though the IP specification 459 does not consider TOS to be a mutable header field. 461 Flags -- This field is excluded since an intermediate router might 462 set the DF bit, even if the source did not select it. 464 Fragment Offset -- Since AH is applied only to non-fragmented IP 465 packets, the Offset Field must always be zero, and thus it is 466 excluded (even though it is predictable). 468 TTL -- This is changed en-route as a normal course of processing by 469 routers, and thus its value at the receiver is not predictable 470 by the sender. 472 Header Checksum -- This will change if any of these other fields 473 changes, and thus its value upon reception cannot be predicted 474 by the sender. 476 3.3.3.1.1.2 Options 478 For IPv4 (unlike IPv6), there is no mechanism for tagging options as 479 mutable in transit. Hence the IPv4 options are explicitly listed in 480 Appendix A and classified as immutable, mutable but predictable, or 481 mutable. For IPv4, the entire option is viewed as a unit; so even 482 though the type and length fields within most options are immutable 483 in transit, if an option is classified as mutable, the entire option 484 is zeroed for ICV computation purposes. 486 3.3.3.1.2 ICV Computation for IPv6 488 3.3.3.1.2.1 Base Header Fields 490 The IPv6 base header fields are classified as follows: 492 Immutable 493 Version 494 Payload Length 495 Next Header (This should be the value for AH.) 496 Source Address 497 Destination Address (without Routing Extension Header) 499 Mutable but predictable 500 Destination Address (with Routing Extension Header) 502 Mutable (zeroed prior to ICV calculation) 503 Class 504 Flow Label 505 Hop Limit 507 3.3.3.1.2.2 Extension Headers -- Options 509 The IPv6 extension headers (that are options) are explicitly listed 510 in Appendix A and classified as immutable, mutable but predictable, 511 or mutable. 513 IPv6 options in the Hop-by-Hop and Destination Extension Headers 514 contain a bit that indicates whether the option might change 515 (unpredictably) during transit. For any option for which contents 516 may change en-route, the entire "Option Data" field must be treated 517 as zero-valued octets when computing or verifying the ICV. The 518 Option Type and Opt Data Len are included in the ICV calculation. 519 All options for which the bit indicates immutability are included in 520 the ICV calculation. See the IPv6 specification [DH95] for more 521 information. 523 3.3.3.1.2.3 Extension Headers -- non-Options 525 The IPv6 extension headers (that are not options) are explicitly 526 listed in Appendix A and classified as immutable, mutable but 527 predictable, or mutable. 529 3.3.3.2 Padding 531 3.3.3.2.1 Authentication Data Padding 533 As mentioned in section 2.6, the Authentication Data field explicitly 534 includes padding to ensure that the AH header is a multiple of 32 535 bits (IPv4) or 64 bits (IPv6). If padding is required, its length is 536 determined by two factors: 538 - the length of the ICV 539 - the IP protocol version (v4 or v6) 541 For example, if the output of the selected algorithm is 96-bits, no 542 padding is required for either IPv4 or for IPv6. However, if a 543 different length ICV is generated, due to use of a different 544 algorithm, then padding may be required depending on the length and 545 IP protocol version. The content of the padding field is arbitrarily 546 selected by the sender. (The padding is arbitrary, but need not be 547 random to achieve security.) These padding bytes are included in the 548 Authentication Data calculation, counted as part of the Payload 549 Length, and transmitted at the end of the Authentication Data field 550 to enable the receiver to perform the ICV calculation. 552 3.3.3.2.2 Implicit Packet Padding 554 For some authentication algorithms, the byte string over which the 555 ICV computation is performed must be a multiple of a blocksize 556 specified by the algorithm. If the IP packet length (including AH) 557 does not match the blocksize requirements for the algorithm, implicit 558 padding MUST be appended to the end of the packet, prior to ICV 559 computation. The padding octets MUST have a value of zero. The 560 blocksize (and hence the length of the padding) is specified by the 561 algorithm specification. This padding is not transmitted with the 562 packet. 564 3.3.4 Fragmentation 566 If required, IP fragmentation occurs after AH processing within an 567 IPsec implementation. Thus, transport mode AH is applied only to 568 whole IP datagrams (not to IP fragments). An IP packet to which AH 569 has been applied may itself be fragmented by routers en route, and 570 such fragments must be reassembled prior to AH processing at a 571 receiver. In tunnel mode, AH is applied to an IP packet, the payload 572 of which may be a fragmented IP packet. For example, a security 573 gateway or a "bump-in-the-stack" or "bump-in-the-wire" IPsec 574 implementation (see the Security Architecture document for details) 575 may apply tunnel mode AH to such fragments. 577 3.4 Inbound Packet Processing 579 If there is more than one IPsec header/extension present, the 580 processing for each one ignores (does not zero, does not use) any 581 IPsec headers applied subsequent to the header being processed. 583 3.4.1 Reassembly 585 If required, reassembly is performed prior to AH processing. If a 586 packet offered to AH for processing appears to be an IP fragment, 587 i.e., the OFFSET field is non-zero or the MORE FRAGMENTS flag is set, 588 the receiver MUST discard the packet; this is an auditable event. The 589 audit log entry for this event SHOULD include the SPI value, 590 date/time, Source Address, Destination Address, and (in IPv6) the 591 Flow ID. 593 3.4.2 Security Association Lookup 595 Upon receipt of a packet containing an IP Authentication Header, the 596 receiver determines the appropriate (unidirectional) SA, based on the 597 destination IP address, security protocol (AH), and the SPI. (This 598 process is described in more detail in the Security Architecture 599 document.) The SA indicates whether the Sequence Number field will 600 be checked, specifies the algorithm(s) employed for ICV computation, 601 and indicates the key(s) required to validate the ICV. 603 If no valid Security Association exists for this session (e.g., the 604 receiver has no key), the receiver MUST discard the packet; this is 605 an auditable event. The audit log entry for this event SHOULD 606 include the SPI value, date/time, Source Address, Destination 607 Address, and (in IPv6) the Flow ID. 609 3.4.3 Sequence Number Verification 611 All AH implementations MUST support the anti-replay service, though 612 its use may be enabled or disabled by the receiver on a per-SA basis. 613 (Note that there are no provisions for managing transmitted Sequence 614 Number values among multiple senders directing traffic to a single, 615 multicast SA. Thus the anti-replay service SHOULD NOT be used in a 616 multi-sender multicast environment that employs a single, multicast 617 SA.) 619 If the receiver does not enable anti-replay for an SA, no inbound 620 checks are performed on the Sequence Number. The default for the 621 sender is that the Sequence Number will be checked at the sender. 622 Hence, if an SA establishment protocol such as ISAKMP/Oakley is 623 employed, the receiver SHOULD notify the sender, during SA 624 establishment, if the receiver will not provide anti-replay 625 protection. 627 If the receiver has enabled the anti-replay service for this SA, the 628 receiver packet counter for the SA MUST be initialized to zero when 629 the SA is established. For each received packet, the receiver MUST 630 verify that the packet contains a Sequence Number that does not 631 duplicate the Sequence Number of any other packets received during 632 the life of this SA. This SHOULD be the first AH check applied to a 633 packet after it has been matched to an SA, to speed rejection of 634 duplicate packets. 636 Duplicates are rejected through the use of a sliding receive window. 637 (How the window is implemented is a local matter, but the following 638 text describes the functionality that the implementation must 639 exhibit.) A MINIMUM window size of 32 MUST be supported; but a 640 window size of 64 is preferred and SHOULD be employed as the default. 641 Another window size (larger than the MINIMUM) MAY be chosen by the 642 receiver. (The receiver does NOT notify the sender of the window 643 size.) 645 The "right" edge of the window represents the highest, validated 646 Sequence Number value received on this SA. Packets that contain 647 Sequence Numbers lower than the "left" edge of the window are 648 rejected. Packets falling within the window are checked against a 649 list of received packets within the window. An efficient means for 650 performing this check, based on the use of a bit mask, is described 651 in the Security Architecture document. 653 If the received packet falls within the window and is new, or if the 654 packet is to the right of the window, then the receiver proceeds to 655 ICV verification. If the ICV validation fails, the receiver MUST 656 discard the received IP datagram as invalid; this is an auditable 657 event. The audit log entry for this event SHOULD include the SPI 658 value, date/time, Source Address, Destination Address, the Sequence 659 Number, and (in IPv6) the Flow ID. The receive window is updated 660 only if the ICV verification succeeds. 662 DISCUSSION: 664 Note that if the packet is either inside the window and new, or is 665 outside the window on the "right" side, the receiver MUST 666 authenticate the packet before updating the Sequence Number window 667 data. 669 3.4.4 Integrity Check Value Verification 671 The receiver computes the ICV over the appropriate fields of the 672 packet, using the specified authentication algorithm, and verifies 673 that it is the same as the ICV included in the Authentication Data 674 field of the packet. Details of the computation are provided below. 676 If the computed and received ICV's match, then the datagram is valid, 677 and it is accepted. If the test fails, then the receiver MUST 678 discard the received IP datagram as invalid; this is an auditable 679 event. The audit log entry SHOULD include the SPI value, date/time 680 received, Source Address, Destination Address, and (in IPv6) the Flow 681 ID. 683 DISCUSSION: 685 Begin by saving the ICV value and replacing it (but not any 686 Authentication Data padding) with zero. Zero all other fields 687 that may have been modified during transit. (See section 3.3.3.1 688 for a discussion of which fields are zeroed before performing the 689 ICV calculation.) Check the overall length of the packet, and if 690 it requires implicit padding based on the requirements of the 691 authentication algorithm, append zero-filled bytes to the end of 692 the packet as required. Perform the ICV computation and compare 693 the result with the saved value, using the comparison rules 694 defined by the algorithm specification. (For example, if a 695 digital signature and one-way hash are used for the ICV 696 computation, the matching process is more complex.) 698 4. Auditing 700 Not all systems that implement AH will implement auditing. However, 701 if AH is incorporated into a system that supports auditing, then the 702 AH implementation MUST also support auditing and MUST allow a system 703 administrator to enable or disable auditing for AH. For the most 704 part, the granularity of auditing is a local matter. However, 705 several auditable events are identified in this specification and for 706 each of these events a minimum set of information that SHOULD be 707 included in an audit log is defined. Additional information also MAY 708 be included in the audit log for each of these events, and additional 709 events, not explicitly called out in this specification, also MAY 710 result in audit log entries. There is no requirement for the 711 receiver to transmit any message to the purported sender in response 712 to the detection of an auditable event, because of the potential to 713 induce denial of service via such action. 715 5. Conformance Requirements 717 Implementations that claim conformance or compliance with this 718 specification MUST fully implement the AH syntax and processing 719 described here and MUST comply with all requirements of the Security 720 Architecture document. If the key used to compute an ICV is manually 721 distributed, correct provision of the anti-replay service would 722 require correct maintenance of the counter state at the sender, until 723 the key is replaced, and there likely would be no automated recovery 724 provision if counter overflow were imminent. Thus a compliant 725 implementation SHOULD NOT provide this service in conjunction with 726 SAs that are manually keyed. A compliant AH implementation MUST 727 support the following mandatory-to-implement algorithms: 729 - HMAC with MD5 [MG97a] 730 - HMAC with SHA-1 [MG97b] 732 6. Security Considerations 734 Security is central to the design of this protocol, and these 735 security considerations permeate the specification. Additional 736 security-relevant aspects of using the IPsec protocol are discussed 737 in the Security Architecture document. 739 7. Differences from RFC 1826 741 This specification of AH differs from RFC 1826 [ATK95] in several 742 important respects, but the fundamental features of AH remain intact. 743 One goal of the revision of RFC 1826 was to provide a complete 744 framework for AH, with ancillary RFCs required only for algorithm 745 specification. For example, the anti-replay service is now an 746 integral, mandatory part of AH, not a feature of a transform defined 747 in another RFC. Carriage of a sequence number to support this 748 service is now required at all times. The default algorithms 749 required for interoperability have been changed to HMAC with MD5 or 750 SHA-1 (vs. keyed MD5), for security reasons. The list of IPv4 header 751 fields excluded from the ICV computation has been expanded to include 752 the OFFSET and FLAGS fields. 754 Another motivation for revision was to provide additional detail and 755 clarification of subtle points. This specification provides 756 rationale for exclusion of selected IPv4 header fields from AH 757 coverage and provides examples on positioning of AH in both the IPv4 758 and v6 contexts. Auditing requirements have been clarified in this 759 version of the specification. Tunnel mode AH was mentioned only in 760 passing in RFC 1826, but now is a mandatory feature of AH. 761 Discussion of interactions with key management and with security 762 labels have been moved to the Security Architecture document. 764 Acknowledgements 766 For over 2 years, this document has evolved through multiple versions 767 and iterations. During this time, many people have contributed 768 significant ideas and energy to the process and the documents 769 themselves. The authors would like to thank Karen Seo for providing 770 extensive help in the review, editing, background research, and 771 coordination for this version of the specification. The authors 772 would also like to thank the members of the IPsec and IPng working 773 groups, with special mention of the efforts of (in alphabetic order): 774 Steve Bellovin, Steve Deering, Francis Dupont, Phil Karn, Frank 775 Kastenholz, Perry Metzger, David Mihelcic, Hilarie Orman, Norman 776 Shulman, William Simpson, and Nina Yuan. 778 Appendix A -- Mutability of IP Options/Extension Headers 780 A1. IPv4 Options 782 This table shows how the IPv4 options are classified with regard to 783 "mutability". Where two references are provided, the second one 784 supercedes the first. This table is based in part on information 785 provided in RFC1700, "ASSIGNED NUMBERS", (October 1994). 787 Opt. 788 Copy Class # Name Reference 789 ---- ----- --- ------------------------- --------- 790 IMMUTABLE -- included in ICV calculation 791 0 0 0 End of Options List [RFC791] 792 0 0 1 No Operation [RFC791] 793 1 0 2 Security [RFC1108(historic but in use)] 794 1 0 5 Extended Security [RFC1108(historic but in use)] 795 1 0 6 Commercial Security [expired I-D, now US MIL STD] 796 1 0 20 Router Alert [RFC2113] 797 1 0 21 Sender Directed Multi- [RFC1770] 798 Destination Delivery 799 MUTABLE -- zeroed 800 1 0 3 Loose Source Route [RFC791] 801 0 2 4 Time Stamp [RFC791] 802 0 0 7 Record Route [RFC791] 803 1 0 9 Strict Source Route [RFC791] 804 0 2 18 Traceroute [RFC1393] 806 EXPERIMENTAL, SUPERCEDED -- zeroed 807 1 0 8 Stream ID [RFC791, RFC1122 (Host Req)] 808 0 0 11 MTU Probe [RFC1063, RFC1191 (PMTU)] 809 0 0 12 MTU Reply [RFC1063, RFC1191 (PMTU)] 810 1 0 17 Extended Internet Protocol [RFC1385, RFC1883 (IPv6)] 811 0 0 10 Experimental Measurement [ZSu] 812 1 2 13 Experimental Flow Control [Finn] 813 1 0 14 Experimental Access Ctl [Estrin] 814 0 0 15 ??? [VerSteeg] 815 1 0 16 IMI Traffic Descriptor [Lee] 816 1 0 19 Address Extension [Ullmann IPv7] 818 NOTE: Use of the Router Alert option is potentially incompatible with 819 use of IPsec. Although the option is immutable, its use implies that 820 each router along a packet's path will "process" the packet and 821 consequently might change the packet. This would happen on a hop by 822 hop basis as the packet goes from router to router. Prior to being 823 processed by the application to which the option contents are 824 directed, e.g., RSVP/IGMP, the packet should encounter AH processing. 826 However, AH processing would require that each router along the path 827 is a member of a multicast-SA defined by the SPI. This might pose 828 problems for packets that are not strictly source routed, and it 829 requires multicast support techniques not currently available. 831 NOTE: Addition or removal of any security labels (BSO, ESO, CIPSO) by 832 systems along a packet's path conflicts with the classification of 833 these IP Options as immutable and is incompatible with the use of 834 IPsec. 836 A2. IPv6 Extension Headers 838 This table shows how the IPv6 Extension Headers are classified with 839 regard to "mutability". 841 Option/Extension Name Reference 842 ----------------------------------- --------- 843 MUTABLE BUT PREDICTABLE -- included in ICV calculation 844 Routing (Type 0) [RFC1883] 846 BIT INDICATES IF OPTION IS MUTABLE (CHANGES UNPREDICTABLY DURING TRANSIT) 847 Hop by Hop options [RFC1883] 848 Destination options [RFC1883] 850 NOT APPLICABLE 851 Fragmentation [RFC1883] 853 Options -- IPv6 options in the Hop-by-Hop and Destination Extension 854 Headers contain a bit that indicates whether the option might 855 change (unpredictably) during transit. For any option for which 856 contents may change en-route, the entire "Option Data" field 857 must be treated as zero-valued octets when computing or 858 verifying the ICV. The Option Type and Opt Data Len are 859 included in the ICV calculation. All options for which the bit 860 indicates immutability are included in the ICV calculation. See 861 the IPv6 specification [DH95] for more information. 863 Routing (Type 0) -- The IPv6 Routing Header "Type 0" will rearrange 864 the address fields within the packet during transit from source 865 to destination. However, the contents of the packet as it will 866 appear at the receiver are known to the sender and to all 867 intermediate hops. Hence, the IPv6 Routing Header "Type 0" is 868 included in the Authentication Data calculation as mutable but 869 predictable. The sender must order the field so that it 870 appears as it will at the receiver, prior to performing the ICV 871 computation. 873 Fragmentation -- Fragmentation occurs after outbound IPsec processing 874 (section 3.3) and reassembly occurs before inbound IPsec 875 processing (section 3.4). So the Fragmentation Extension 876 Header, if it exists, is not seen by IPsec. 878 Note that on the receive side, the IP implementation could leave 879 a Fragmentation Extension Header in place when it does 880 re-assembly. If this happens, then when AH receives the packet, 881 before doing ICV processing, AH MUST "remove" (or skip over) 882 this header and change the previous header's "Next Header" field 883 to be the "Next Header" field in the Fragmentation Extension 884 Header. 886 Note that on the send side, the IP implementation could give the 887 IPsec code a packet with a Fragmentation Extension Header with 888 Offset of 0 (first fragment) and a More Fragments Flag of 0 889 (last fragment). If this happens, then before doing ICV 890 processing, AH MUST first "remove" (or skip over) this header 891 and change the previous header's "Next Header" field to be the 892 "Next Header" field in the Fragmentation Extension Header. 894 References 896 [ATK95] R. Atkinson, "The IP Authentication Header," RFC 1826, 897 August 1995. 899 [BCCH94] R. Braden, D. Clark, S. Crocker, & C.Huitema, "Report of 900 IAB Workshop on Security in the Internet Architecture", 901 RFC-1636, 9 June 1994, pp. 21-34. 903 [Bel89] Steven M. Bellovin, "Security Problems in the TCP/IP 904 Protocol Suite", ACM Computer Communications Review, Vol. 905 19, No. 2, March 1989. 907 [Bra97] S. Bradner, "Key words for use in RFCs to Indicate 908 Requirement Level," RFC-2119, March 1997. 910 [CER95] Computer Emergency Response Team (CERT), "IP Spoofing 911 Attacks and Hijacked Terminal Connections", CA-95:01, 912 January 1995. Available via anonymous ftp from 913 info.cert.org in /pub/cert_advisories. 915 [DH95] Steve Deering & Bob Hinden, "Internet Protocol version 6 916 (IPv6) Specification", RFC-1883, December 1995. 918 [GM93] James Galvin & Keith McCloghrie, Security Protocols for 919 version 2 of the Simple Network Management Protocol 920 (SNMPv2), RFC-1446, April 1993. 922 [KA97a] Steve Kent, Randall Atkinson, "Security Architecture for 923 the Internet Protocol", Internet Draft, November 1997. 925 [KA97b] Steve Kent, Randall Atkinson, "IP Encapsulating Security 926 Payload (ESP)", Internet Draft, November 1997. 928 [KA97c] Steve Kent, Randall Atkinson, "IP Authentication Header", 929 Internet Draft, November 1997. 931 [Ken91] Steve Kent, "US DoD Security Options for the Internet 932 Protocol", RFC-1108, November 1991. 934 [MG97a] C. Madson & R. Glenn, "The Use of HMAC-MD5-96 within ESP 935 and AH", Internet Draft, 7/2/97. 937 [MG97b] C. Madson & R. Glenn, "The Use of HMAC-SHA-1-96 within ESP 938 and AH", Internet Draft, 7/2/97. 940 [Riv92] Ronald Rivest, "The MD5 Message Digest Algorithm," RFC- 941 1321, April 1992. 943 [SHA] NIST, FIPS PUB 180-1: Secure Hash Standard, April 1995 945 [STD-1] J. Postel, "Internet Official Protocol Standards", STD-1, 946 March 1996. 948 [STD-2] J. Reynolds & J. Postel, "Assigned Numbers", STD-2, 20 949 October 1994. 951 Disclaimer 953 The views and specification here are those of the authors and are not 954 necessarily those of their employers. The authors and their 955 employers specifically disclaim responsibility for any problems 956 arising from correct or incorrect implementation or use of this 957 specification. 959 Author Information 961 Stephen Kent 962 BBN Corporation 963 70 Fawcett Street 964 Cambridge, MA 02140 965 USA 966 E-mail: kent@bbn.com 967 Telephone: +1 (617) 873-3988 969 Randall Atkinson 970 @Home Network 971 425 Broadway, 972 Redwood City, CA 94063 973 USA 974 E-mail: rja@inet.org