idnits 2.17.1 draft-ietf-ipsec-auth-header-06.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- ** Looks like you're using RFC 2026 boilerplate. This must be updated to follow RFC 3978/3979, as updated by RFC 4748. 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 89 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 (May 1998) is 9478 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: 'RFC791' is mentioned on line 805, but not defined == Missing Reference: 'RFC2113' is mentioned on line 798, but not defined == Missing Reference: 'RFC1770' is mentioned on line 799, but not defined ** Obsolete undefined reference: RFC 1770 (Obsoleted by RFC 6814) == Missing Reference: 'RFC1393' is mentioned on line 806, but not defined ** Obsolete undefined reference: RFC 1393 (Obsoleted by RFC 6814) == Missing Reference: 'ZSu' is mentioned on line 813, but not defined == Missing Reference: 'Finn' is mentioned on line 814, but not defined == Missing Reference: 'Estrin' is mentioned on line 815, but not defined == Missing Reference: 'VerSteeg' is mentioned on line 816, but not defined == Missing Reference: 'Lee' is mentioned on line 817, but not defined == Missing Reference: 'RFC1883' is mentioned on line 858, but not defined ** Obsolete undefined reference: RFC 1883 (Obsoleted by RFC 2460) ** Obsolete normative reference: RFC 1826 (ref. 'ATK95') (Obsoleted by RFC 2402) ** Obsolete normative reference: RFC 1883 (ref. 'DH95') (Obsoleted by RFC 2460) -- Possible downref: Non-RFC (?) normative reference: ref. 'HC98' -- Possible downref: Non-RFC (?) normative reference: ref. 'KA97a' -- Possible downref: Non-RFC (?) normative reference: ref. 'KA97b' -- Possible downref: Non-RFC (?) normative reference: ref. 'MG97a' -- Possible downref: Non-RFC (?) normative reference: ref. 'MG97b' -- Possible downref: Non-RFC (?) normative reference: ref. 'STD-2' Summary: 15 errors (**), 0 flaws (~~), 13 warnings (==), 8 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-06.txt May 1998 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 Copyright (C) The Internet Society (May 1998). All Rights Reserved. 29 Table of Contents 31 1. Introduction......................................................3 32 2. Authentication Header Format......................................4 33 2.1 Next Header...................................................4 34 2.2 Payload Length................................................4 35 2.3 Reserved......................................................5 36 2.4 Security Parameters Index (SPI)...............................5 37 2.5 Sequence Number...............................................5 38 2.6 Authentication Data ..........................................6 39 3. Authentication Header Processing..................................6 40 3.1 Authentication Header Location...............................6 41 3.2 Authentication Algorithms....................................8 42 3.3 Outbound Packet Processing...................................8 43 3.3.1 Security Association Lookup.............................9 44 3.3.2 Sequence Number Generation..............................9 45 3.3.3 Integrity Check Value Calculation.......................9 46 3.3.3.1 Handling Mutable Fields...........................10 47 3.3.3.1.1 ICV Computation for IPv4.....................10 48 3.3.3.1.1.1 Base Header Fields.......................10 49 3.3.3.1.1.2 Options..................................11 50 3.3.3.1.2 ICV Computation for IPv6.....................11 51 3.3.3.1.2.1 Base Header Fields.......................11 52 3.3.3.1.2.2 Extension Headers Containing Options.....12 53 3.3.3.1.2.3 Extension Headers Not Containing Options.12 54 3.3.3.2 Padding...........................................12 55 3.3.3.2.1 Authentication Data Padding..................12 56 3.3.3.2.2 Implicit Packet Padding......................13 57 3.3.4 Fragmentation..........................................13 58 3.4 Inbound Packet Processing...................................13 59 3.4.1 Reassembly.............................................13 60 3.4.2 Security Association Lookup............................14 61 3.4.3 Sequence Number Verification...........................14 62 3.4.4 Integrity Check Value Verification.....................15 63 4. Auditing.........................................................16 64 5. Conformance Requirements.........................................16 65 6. Security Considerations..........................................17 66 7. Differences from RFC 1826........................................17 67 Acknowledgements....................................................17 68 Appendix A -- Mutability of IP Options/Extension Headers............19 69 A1. IPv4 Options.................................................19 70 A2. IPv6 Extension Headers.......................................20 71 References..........................................................22 72 Disclaimer..........................................................22 73 Author Information..................................................23 75 1. Introduction 77 The IP Authentication Header (AH) is used to provide connectionless 78 integrity and data origin authentication for IP datagrams (hereafter 79 referred to as just "authentication"), and to provide protection 80 against replays. This latter, optional service may be selected, by 81 the receiver, when a Security Association is established. (Although 82 the default calls for the sender to increment the Sequence Number 83 used for anti-replay, the service is effective only if the receiver 84 checks the Sequence Number.) AH provides authentication for as much 85 of the IP header as possible, as well as for upper level protocol 86 data. However, some IP header fields may change in transit and the 87 value of these fields, when the packet arrives at the receiver, may 88 not be predictable by the sender. The values of such fields cannot 89 be protected by AH. Thus the protection provided to the IP header by 90 AH is somewhat piecemeal. 92 AH may be applied alone, in combination with the IP Encapsulating 93 Security Payload (ESP) [KA97b], or in a nested fashion through the 94 use of tunnel mode (see "Security Architecture for the Internet 95 Protocol" [KA97a], hereafter referred to as the Security Architecture 96 document). Security services can be provided between a pair of 97 communicating hosts, between a pair of communicating security 98 gateways, or between a security gateway and a host. ESP may be used 99 to provide the same security services, and it also provides a 100 confidentiality (encryption) service. The primary difference between 101 the authentication provided by ESP and AH is the extent of the 102 coverage. Specifically, ESP does not protect any IP header fields 103 unless those fields are encapsulated by ESP (tunnel mode). For more 104 details on how to use AH and ESP in various network environments, see 105 the Security Architecture document [KA97a]. 107 It is assumed that the reader is familiar with the terms and concepts 108 described in the Security Architecture document. In particular, the 109 reader should be familiar with the definitions of security services 110 offered by AH and ESP, the concept of Security Associations, the ways 111 in which AH can be used in conjunction with ESP, and the different 112 key management options available for AH and ESP. (With regard to the 113 last topic, the current key management options required for both AH 114 and ESP are manual keying and automated keying via IKE [HC98].) 116 The keywords MUST, MUST NOT, REQUIRED, SHALL, SHALL NOT, SHOULD, 117 SHOULD NOT, RECOMMENDED, MAY, and OPTIONAL, when they appear in this 118 document, are to be interpreted as described in RFC 2119 [Bra97]. 120 2. Authentication Header Format 122 The protocol header (IPv4, IPv6, or Extension) immediately preceding the 123 AH header will contain the value 51 in its Protocol (IPv4) or Next 124 Header (IPv6, Extension) field [STD-2]. 126 0 1 2 3 127 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 128 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 129 | Next Header | Payload Len | RESERVED | 130 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 131 | Security Parameters Index (SPI) | 132 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 133 | Sequence Number Field | 134 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 135 | | 136 + Authentication Data (variable) | 137 | | 138 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 140 The following subsections define the fields that comprise the AH 141 format. All the fields described here are mandatory, i.e., they are 142 always present in the AH format and are included in the Integrity 143 Check Value (ICV) computation (see Sections 2.6 and 3.3.3). 145 2.1 Next Header 147 The Next Header is an 8-bit field that identifies the type of the 148 next payload after the Authentication Header. The value of this 149 field is chosen from the set of IP Protocol Numbers defined in the 150 most recent "Assigned Numbers" [STD-2] RFC from the Internet Assigned 151 Numbers Authority (IANA). 153 2.2 Payload Length 155 This 8-bit field specifies the length of AH in 32-bit words (4-byte 156 units), minus "2". (All IPv6 extension headers, as per RFC 1883, 157 encode the "Hdr Ext Len" field by first subtracting 1 (64-bit word) 158 from the header length (measured in 64-bit words). AH is an IPv6 159 extension header. However, since its length is measured in 32-bit 160 words, the "Payload Length" is calculated by subtracting 2 (32 bit 161 words).) In the "standard" case of a 96-bit authentication value 162 plus the 3 32-bit word fixed portion, this length field will be "4". 163 A "null" authentication algorithm may be used only for debugging 164 purposes. Its use would result in a "1" value for this field for 165 IPv4 or a "2" for IPv6, as there would be no corresponding 166 Authentication Data field (see Section 3.3.3.2.1 on "Authentication 167 Data Padding"). 169 2.3 Reserved 171 This 16-bit field is reserved for future use. It MUST be set to 172 "zero." (Note that the value is included in the Authentication Data 173 calculation, but is otherwise ignored by the recipient.) 175 2.4 Security Parameters Index (SPI) 177 The SPI is an arbitrary 32-bit value that, in combination with the 178 destination IP address and security protocol (AH), uniquely 179 identifies the Security Association for this datagram. The set of 180 SPI values in the range 1 through 255 are reserved by the Internet 181 Assigned Numbers Authority (IANA) for future use; a reserved SPI 182 value will not normally be assigned by IANA unless the use of the 183 assigned SPI value is specified in an RFC. It is ordinarily selected 184 by the destination system upon establishment of an SA (see the 185 Security Architecture document for more details). 187 The SPI value of zero (0) is reserved for local, implementation- 188 specific use and MUST NOT be sent on the wire. For example, a key 189 management implementation MAY use the zero SPI value to mean "No 190 Security Association Exists" during the period when the IPsec 191 implementation has requested that its key management entity establish 192 a new SA, but the SA has not yet been established. 194 2.5 Sequence Number 196 This unsigned 32-bit field contains a monotonically increasing 197 counter value (sequence number). It is mandatory and is always 198 present even if the receiver does not elect to enable the anti-replay 199 service for a specific SA. Processing of the Sequence Number field 200 is at the discretion of the receiver, i.e., the sender MUST always 201 transmit this field, but the receiver need not act upon it (see the 202 discussion of Sequence Number Verification in the "Inbound Packet 203 Processing" section below). 205 The sender's counter and the receiver's counter are initialized to 0 206 when an SA is established. (The first packet sent using a given SA 207 will have a Sequence Number of 1; see Section 3.3.2 for more details 208 on how the Sequence Number is generated.) If anti-replay is enabled 209 (the default), the transmitted Sequence Number must never be allowed 210 to cycle. Thus, the sender's counter and the receiver's counter MUST 211 be reset (by establishing a new SA and thus a new key) prior to the 212 transmission of the 2^32nd packet on an SA. 214 2.6 Authentication Data 216 This is a variable-length field that contains the Integrity Check 217 Value (ICV) for this packet. The field must be an integral multiple 218 of 32 bits in length. The details of the ICV computation are 219 described in Section 3.3.2 below. This field may include explicit 220 padding. This padding is included to ensure that the length of the 221 AH header is an integral multiple of 32 bits (IPv4) or 64 bits 222 (IPv6). All implementations MUST support such padding. Details of 223 how to compute the required padding length are provided below. The 224 authentication algorithm specification MUST specify the length of the 225 ICV and the comparison rules and processing steps for validation. 227 3. Authentication Header Processing 229 3.1 Authentication Header Location 231 Like ESP, AH may be employed in two ways: transport mode or tunnel 232 mode. The former mode is applicable only to host implementations and 233 provides protection for upper layer protocols, in addition to 234 selected IP header fields. (In this mode, note that for "bump-in- 235 the-stack" or "bump-in-the-wire" implementations, as defined in the 236 Security Architecture document, inbound and outbound IP fragments may 237 require an IPsec implementation to perform extra IP 238 reassembly/fragmentation in order to both conform to this 239 specification and provide transparent IPsec support. Special care is 240 required to perform such operations within these implementations when 241 multiple interfaces are in use.) 243 In transport mode, AH is inserted after the IP header and before an 244 upper layer protocol, e.g., TCP, UDP, ICMP, etc. or before any other 245 IPsec headers that have already been inserted. In the context of 246 IPv4, this calls for placing AH after the IP header (and any options 247 that it contains), but before the upper layer protocol. (Note that 248 the term "transport" mode should not be misconstrued as restricting 249 its use to TCP and UDP. For example, an ICMP message MAY be sent 250 using either "transport" mode or "tunnel" mode.) The following 251 diagram illustrates AH transport mode positioning for a typical IPv4 252 packet, on a "before and after" basis. 254 BEFORE APPLYING AH 255 ---------------------------- 256 IPv4 |orig IP hdr | | | 257 |(any options)| TCP | Data | 258 ---------------------------- 260 AFTER APPLYING AH 261 --------------------------------- 262 IPv4 |orig IP hdr | | | | 263 |(any options)| AH | TCP | Data | 264 --------------------------------- 265 |<------- authenticated ------->| 266 except for mutable fields 268 In the IPv6 context, AH is viewed as an end-to-end payload, and thus 269 should appear after hop-by-hop, routing, and fragmentation extension 270 headers. The destination options extension header(s) could appear 271 either before or after the AH header depending on the semantics 272 desired. The following diagram illustrates AH transport mode 273 positioning for a typical IPv6 packet. 275 BEFORE APPLYING AH 276 --------------------------------------- 277 IPv6 | | ext hdrs | | | 278 | orig IP hdr |if present| TCP | Data | 279 --------------------------------------- 281 AFTER APPLYING AH 282 ------------------------------------------------------------ 283 IPv6 | |hop-by-hop, dest*, | | dest | | | 284 |orig IP hdr |routing, fragment. | AH | opt* | TCP | Data | 285 ------------------------------------------------------------ 286 |<---- authenticated except for mutable fields ----------->| 288 * = if present, could be before AH, after AH, or both 290 ESP and AH headers can be combined in a variety of modes. The IPsec 291 Architecture document describes the combinations of security 292 associations that must be supported. 294 Tunnel mode AH may be employed in either hosts or security gateways 295 (or in so-called "bump-in-the-stack" or "bump-in-the-wire" 296 implementations, as defined in the Security Architecture document). 297 When AH is implemented in a security gateway (to protect transit 298 traffic), tunnel mode must be used. In tunnel mode, the "inner" IP 299 header carries the ultimate source and destination addresses, while 300 an "outer" IP header may contain distinct IP addresses, e.g., 301 addresses of security gateways. In tunnel mode, AH protects the 302 entire inner IP packet, including the entire inner IP header. The 303 position of AH in tunnel mode, relative to the outer IP header, is 304 the same as for AH in transport mode. The following diagram 305 illustrates AH tunnel mode positioning for typical IPv4 and IPv6 306 packets. 308 ------------------------------------------------ 309 IPv4 | new IP hdr* | | orig IP hdr* | | | 310 |(any options)| AH | (any options) |TCP | Data | 311 ------------------------------------------------ 312 |<- authenticated except for mutable fields -->| 313 | in the new IP hdr | 315 -------------------------------------------------------------- 316 IPv6 | | ext hdrs*| | | ext hdrs*| | | 317 |new IP hdr*|if present| AH |orig IP hdr*|if present|TCP|Data| 318 -------------------------------------------------------------- 319 |<-- authenticated except for mutable fields in new IP hdr ->| 321 * = construction of outer IP hdr/extensions and modification 322 of inner IP hdr/extensions is discussed below. 324 3.2 Authentication Algorithms 326 The authentication algorithm employed for the ICV computation is 327 specified by the SA. For point-to-point communication, suitable 328 authentication algorithms include keyed Message Authentication Codes 329 (MACs) based on symmetric encryption algorithms (e.g., DES) or on 330 one-way hash functions (e.g., MD5 or SHA-1). For multicast 331 communication, one-way hash algorithms combined with asymmetric 332 signature algorithms are appropriate, though performance and space 333 considerations currently preclude use of such algorithms. The 334 mandatory-to-implement authentication algorithms are described in 335 Section 5 "Conformance Requirements". Other algorithms MAY be 336 supported. 338 3.3 Outbound Packet Processing 340 In transport mode, the sender inserts the AH header after the IP 341 header and before an upper layer protocol header, as described above. 342 In tunnel mode, the outer and inner IP header/extensions can be 343 inter-related in a variety of ways. The construction of the outer IP 344 header/extensions during the encapsulation process is described in 345 the Security Architecture document. 347 If there is more than one IPsec header/extension required, the order 348 of the application of the security headers MUST be defined by 349 security policy. For simplicity of processing, each IPsec header 350 SHOULD ignore the existence (i.e., not zero the contents or try to 351 predict the contents) of IPsec headers to be applied later. (While a 352 native IP or bump-in-the-stack implementation could predict the 353 contents of later IPsec headers that it applies itself, it won't be 354 possible for it to predict any IPsec headers added by a bump-in-the- 355 wire implementation between the host and the network.) 357 3.3.1 Security Association Lookup 359 AH is applied to an outbound packet only after an IPsec 360 implementation determines that the packet is associated with an SA 361 that calls for AH processing. The process of determining what, if 362 any, IPsec processing is applied to outbound traffic is described in 363 the Security Architecture document. 365 3.3.2 Sequence Number Generation 367 The sender's counter is initialized to 0 when an SA is established. 368 The sender increments the Sequence Number for this SA and inserts the 369 new value into the Sequence Number Field. Thus the first packet sent 370 using a given SA will have a Sequence Number of 1. 372 If anti-replay is enabled (the default), the sender checks to ensure 373 that the counter has not cycled before inserting the new value in the 374 Sequence Number field. In other words, the sender MUST not send a 375 packet on an SA if doing so would cause the Sequence Number to cycle. 376 An attempt to transmit a packet that would result in Sequence Number 377 overflow is an auditable event. (Note that this approach to Sequence 378 Number management does not require use of modular arithmetic.) 380 Note that because the sender assumes anti-replay is enabled as a 381 default, unless otherwise notified by the receiver (see 3.4.3), if 382 the counter has cycled, the sender will set up a new SA and key 383 (unless the SA was configured with manual key management). 385 If anti-replay has been disabled, the sender does not need to monitor 386 or reset the counter, e.g., in the case of manual key management. 388 3.3.3 Integrity Check Value Calculation 390 The AH ICV is computed over: 391 o IP header fields that are either immutable in transit or that 392 are predictable in value upon arrival at the endpoint for the 393 AH SA 394 o the AH header (Next Header, Payload Len, Reserved, SPI, 395 Sequence Number, and the Authentication Data (which is set to 396 zero for this computation), and explicit padding bytes (if 397 any)) 399 o the upper level protocol data, which is assumed to be 400 immutable in transit 402 3.3.3.1 Handling Mutable Fields 404 If a field may be modified during transit, the value of the field is 405 set to zero for purposes of the ICV computation. If a field is 406 mutable, but its value at the (IPsec) receiver is predictable, then 407 that value is inserted into the field for purposes of the ICV 408 calculation. The Authentication Data field is also set to zero in 409 preparation for this computation. Note that by replacing each 410 field's value with zero, rather than omitting the field, alignment is 411 preserved for the ICV calculation. Also, the zero-fill approach 412 ensures that the length of the fields that are so handled cannot be 413 changed during transit, even though their contents are not explicitly 414 covered by the ICV. 416 As a new extension header or IPv4 option is created, it will be 417 defined in its own RFC and SHOULD include (in the Security 418 Considerations section) directions for how it should be handled when 419 calculating the AH ICV. If the IP (v4 or v6) implementation 420 encounters an extension header that it does not recognize, it will 421 discard the packet and send an ICMP message. IPsec will never see 422 the packet. If the IPsec implementation encounters an IPv4 option 423 that it does not recognize, it should zero the whole option, using 424 the second byte of the option as the length. IPv6 options (in 425 Destination extension headers or Hop by Hop extension header) contain 426 a flag indicating mutability, which determines appropriate processing 427 for such options. 429 3.3.3.1.1 ICV Computation for IPv4 431 3.3.3.1.1.1 Base Header Fields 433 The IPv4 base header fields are classified as follows: 435 Immutable 436 Version 437 Internet Header Length 438 Total Length 439 Identification 440 Protocol (This should be the value for AH.) 441 Source Address 442 Destination Address (without loose or strict source routing) 444 Mutable but predictable 445 Destination Address (with loose or strict source routing) 447 Mutable (zeroed prior to ICV calculation) 448 Type of Service (TOS) 449 Flags 450 Fragment Offset 451 Time to Live (TTL) 452 Header Checksum 454 TOS -- This field is excluded because some routers are known to 455 change the value of this field, even though the IP specification 456 does not consider TOS to be a mutable header field. 458 Flags -- This field is excluded since an intermediate router might 459 set the DF bit, even if the source did not select it. 461 Fragment Offset -- Since AH is applied only to non-fragmented IP 462 packets, the Offset Field must always be zero, and thus it is 463 excluded (even though it is predictable). 465 TTL -- This is changed en-route as a normal course of processing by 466 routers, and thus its value at the receiver is not predictable 467 by the sender. 469 Header Checksum -- This will change if any of these other fields 470 changes, and thus its value upon reception cannot be predicted 471 by the sender. 473 3.3.3.1.1.2 Options 475 For IPv4 (unlike IPv6), there is no mechanism for tagging options as 476 mutable in transit. Hence the IPv4 options are explicitly listed in 477 Appendix A and classified as immutable, mutable but predictable, or 478 mutable. For IPv4, the entire option is viewed as a unit; so even 479 though the type and length fields within most options are immutable 480 in transit, if an option is classified as mutable, the entire option 481 is zeroed for ICV computation purposes. 483 3.3.3.1.2 ICV Computation for IPv6 485 3.3.3.1.2.1 Base Header Fields 487 The IPv6 base header fields are classified as follows: 489 Immutable 490 Version 491 Payload Length 492 Next Header (This should be the value for AH.) 493 Source Address 494 Destination Address (without Routing Extension Header) 496 Mutable but predictable 497 Destination Address (with Routing Extension Header) 499 Mutable (zeroed prior to ICV calculation) 500 Class 501 Flow Label 502 Hop Limit 504 3.3.3.1.2.2 Extension Headers Containing Options 506 IPv6 options in the Hop-by-Hop and Destination Extension Headers 507 contain a bit that indicates whether the option might change 508 (unpredictably) during transit. For any option for which contents 509 may change en-route, the entire "Option Data" field must be treated 510 as zero-valued octets when computing or verifying the ICV. The 511 Option Type and Opt Data Len are included in the ICV calculation. 512 All options for which the bit indicates immutability are included in 513 the ICV calculation. See the IPv6 specification [DH95] for more 514 information. 516 3.3.3.1.2.3 Extension Headers Not Containing Options 518 The IPv6 extension headers that do not contain options are explicitly 519 listed in Appendix A and classified as immutable, mutable but 520 predictable, or mutable. 522 3.3.3.2 Padding 524 3.3.3.2.1 Authentication Data Padding 526 As mentioned in section 2.6, the Authentication Data field explicitly 527 includes padding to ensure that the AH header is a multiple of 32 528 bits (IPv4) or 64 bits (IPv6). If padding is required, its length is 529 determined by two factors: 531 - the length of the ICV 532 - the IP protocol version (v4 or v6) 534 For example, if the output of the selected algorithm is 96-bits, no 535 padding is required for either IPv4 or for IPv6. However, if a 536 different length ICV is generated, due to use of a different 537 algorithm, then padding may be required depending on the length and 538 IP protocol version. The content of the padding field is arbitrarily 539 selected by the sender. (The padding is arbitrary, but need not be 540 random to achieve security.) These padding bytes are included in the 541 Authentication Data calculation, counted as part of the Payload 542 Length, and transmitted at the end of the Authentication Data field 543 to enable the receiver to perform the ICV calculation. 545 3.3.3.2.2 Implicit Packet Padding 547 For some authentication algorithms, the byte string over which the 548 ICV computation is performed must be a multiple of a blocksize 549 specified by the algorithm. If the IP packet length (including AH) 550 does not match the blocksize requirements for the algorithm, implicit 551 padding MUST be appended to the end of the packet, prior to ICV 552 computation. The padding octets MUST have a value of zero. The 553 blocksize (and hence the length of the padding) is specified by the 554 algorithm specification. This padding is not transmitted with the 555 packet. Note that MD5 and SHA-1 are viewed as having a 1-byte 556 blocksize because of their internal padding conventions. 558 3.3.4 Fragmentation 560 If required, IP fragmentation occurs after AH processing within an 561 IPsec implementation. Thus, transport mode AH is applied only to 562 whole IP datagrams (not to IP fragments). An IP packet to which AH 563 has been applied may itself be fragmented by routers en route, and 564 such fragments must be reassembled prior to AH processing at a 565 receiver. In tunnel mode, AH is applied to an IP packet, the payload 566 of which may be a fragmented IP packet. For example, a security 567 gateway or a "bump-in-the-stack" or "bump-in-the-wire" IPsec 568 implementation (see the Security Architecture document for details) 569 may apply tunnel mode AH to such fragments. 571 3.4 Inbound Packet Processing 573 If there is more than one IPsec header/extension present, the 574 processing for each one ignores (does not zero, does not use) any 575 IPsec headers applied subsequent to the header being processed. 577 3.4.1 Reassembly 579 If required, reassembly is performed prior to AH processing. If a 580 packet offered to AH for processing appears to be an IP fragment, 581 i.e., the OFFSET field is non-zero or the MORE FRAGMENTS flag is set, 582 the receiver MUST discard the packet; this is an auditable event. The 583 audit log entry for this event SHOULD include the SPI value, 584 date/time, Source Address, Destination Address, and (in IPv6) the 585 Flow ID. 587 NOTE: For packet reassembly, the current IPv4 spec does NOT require 588 either the zero'ing of the OFFSET field or the clearing of the MORE 589 FRAGMENTS flag. In order for a reassembled packet to be processed by 590 IPsec (as opposed to discarded as an apparent fragment), the IP code 591 must do these two things after it reassembles a packet. 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 SA 615 (irrespective of whether the destination address is unicast, 616 broadcast, or multicast). Thus the anti-replay service SHOULD NOT be 617 used in a multi-sender environment that employs a single SA.) 619 If the receiver does not enable anti-replay for an SA, no inbound 620 checks are performed on the Sequence Number. However, from the 621 perspective of the sender, the default is to assume that anti-replay 622 is enabled at the receiver. To avoid having the sender do 623 unnecessary sequence number monitoring and SA setup (see section 624 3.3.2), if an SA establishment protocol such as IKE is employed, the 625 receiver SHOULD notify the sender, during SA establishment, if the 626 receiver will not provide anti-replay protection. 628 If the receiver has enabled the anti-replay service for this SA, the 629 receiver packet counter for the SA MUST be initialized to zero when 630 the SA is established. For each received packet, the receiver MUST 631 verify that the packet contains a Sequence Number that does not 632 duplicate the Sequence Number of any other packets received during 633 the life of this SA. This SHOULD be the first AH check applied to a 634 packet after it has been matched to an SA, to speed rejection of 635 duplicate packets. 637 Duplicates are rejected through the use of a sliding receive window. 639 (How the window is implemented is a local matter, but the following 640 text describes the functionality that the implementation must 641 exhibit.) A MINIMUM window size of 32 MUST be supported; but a 642 window size of 64 is preferred and SHOULD be employed as the default. 643 Another window size (larger than the MINIMUM) MAY be chosen by the 644 receiver. (The receiver does NOT notify the sender of the window 645 size.) 647 The "right" edge of the window represents the highest, validated 648 Sequence Number value received on this SA. Packets that contain 649 Sequence Numbers lower than the "left" edge of the window are 650 rejected. Packets falling within the window are checked against a 651 list of received packets within the window. An efficient means for 652 performing this check, based on the use of a bit mask, is described 653 in the Security Architecture document. 655 If the received packet falls within the window and is new, or if the 656 packet is to the right of the window, then the receiver proceeds to 657 ICV verification. If the ICV validation fails, the receiver MUST 658 discard the received IP datagram as invalid; this is an auditable 659 event. The audit log entry for this event SHOULD include the SPI 660 value, date/time, Source Address, Destination Address, the Sequence 661 Number, and (in IPv6) the Flow ID. The receive window is updated 662 only if the ICV verification succeeds. 664 DISCUSSION: 666 Note that if the packet is either inside the window and new, or is 667 outside the window on the "right" side, the receiver MUST 668 authenticate the packet before updating the Sequence Number window 669 data. 671 3.4.4 Integrity Check Value Verification 673 The receiver computes the ICV over the appropriate fields of the 674 packet, using the specified authentication algorithm, and verifies 675 that it is the same as the ICV included in the Authentication Data 676 field of the packet. Details of the computation are provided below. 678 If the computed and received ICV's match, then the datagram is valid, 679 and it is accepted. If the test fails, then the receiver MUST 680 discard the received IP datagram as invalid; this is an auditable 681 event. The audit log entry SHOULD include the SPI value, date/time 682 received, Source Address, Destination Address, and (in IPv6) the Flow 683 ID. 685 DISCUSSION: 687 Begin by saving the ICV value and replacing it (but not any 688 Authentication Data padding) with zero. Zero all other fields 689 that may have been modified during transit. (See section 3.3.3.1 690 for a discussion of which fields are zeroed before performing the 691 ICV calculation.) Check the overall length of the packet, and if 692 it requires implicit padding based on the requirements of the 693 authentication algorithm, append zero-filled bytes to the end of 694 the packet as required. Perform the ICV computation and compare 695 the result with the saved value, using the comparison rules 696 defined by the algorithm specification. (For example, if a 697 digital signature and one-way hash are used for the ICV 698 computation, the matching process is more complex.) 700 4. Auditing 702 Not all systems that implement AH will implement auditing. However, 703 if AH is incorporated into a system that supports auditing, then the 704 AH implementation MUST also support auditing and MUST allow a system 705 administrator to enable or disable auditing for AH. For the most 706 part, the granularity of auditing is a local matter. However, 707 several auditable events are identified in this specification and for 708 each of these events a minimum set of information that SHOULD be 709 included in an audit log is defined. Additional information also MAY 710 be included in the audit log for each of these events, and additional 711 events, not explicitly called out in this specification, also MAY 712 result in audit log entries. There is no requirement for the 713 receiver to transmit any message to the purported sender in response 714 to the detection of an auditable event, because of the potential to 715 induce denial of service via such action. 717 5. Conformance Requirements 719 Implementations that claim conformance or compliance with this 720 specification MUST fully implement the AH syntax and processing 721 described here and MUST comply with all requirements of the Security 722 Architecture document. If the key used to compute an ICV is manually 723 distributed, correct provision of the anti-replay service would 724 require correct maintenance of the counter state at the sender, until 725 the key is replaced, and there likely would be no automated recovery 726 provision if counter overflow were imminent. Thus a compliant 727 implementation SHOULD NOT provide this service in conjunction with 728 SAs that are manually keyed. A compliant AH implementation MUST 729 support the following mandatory-to-implement algorithms: 731 - HMAC with MD5 [MG97a] 732 - HMAC with SHA-1 [MG97b] 734 6. Security Considerations 736 Security is central to the design of this protocol, and these 737 security considerations permeate the specification. Additional 738 security-relevant aspects of using the IPsec protocol are discussed 739 in the Security Architecture document. 741 7. Differences from RFC 1826 743 This specification of AH differs from RFC 1826 [ATK95] in several 744 important respects, but the fundamental features of AH remain intact. 745 One goal of the revision of RFC 1826 was to provide a complete 746 framework for AH, with ancillary RFCs required only for algorithm 747 specification. For example, the anti-replay service is now an 748 integral, mandatory part of AH, not a feature of a transform defined 749 in another RFC. Carriage of a sequence number to support this 750 service is now required at all times. The default algorithms 751 required for interoperability have been changed to HMAC with MD5 or 752 SHA-1 (vs. keyed MD5), for security reasons. The list of IPv4 header 753 fields excluded from the ICV computation has been expanded to include 754 the OFFSET and FLAGS fields. 756 Another motivation for revision was to provide additional detail and 757 clarification of subtle points. This specification provides 758 rationale for exclusion of selected IPv4 header fields from AH 759 coverage and provides examples on positioning of AH in both the IPv4 760 and v6 contexts. Auditing requirements have been clarified in this 761 version of the specification. Tunnel mode AH was mentioned only in 762 passing in RFC 1826, but now is a mandatory feature of AH. 763 Discussion of interactions with key management and with security 764 labels have been moved to the Security Architecture document. 766 Acknowledgements 768 For over 3 years, this document has evolved through multiple versions 769 and iterations. During this time, many people have contributed 770 significant ideas and energy to the process and the documents 771 themselves. The authors would like to thank Karen Seo for providing 772 extensive help in the review, editing, background research, and 773 coordination for this version of the specification. The authors 774 would also like to thank the members of the IPsec and IPng working 775 groups, with special mention of the efforts of (in alphabetic order): 776 Steve Bellovin, Steve Deering, Francis Dupont, Phil Karn, Frank 777 Kastenholz, Perry Metzger, David Mihelcic, Hilarie Orman, Norman 778 Shulman, William Simpson, and Nina Yuan. 780 Appendix A -- Mutability of IP Options/Extension Headers 782 A1. IPv4 Options 784 This table shows how the IPv4 options are classified with regard to 785 "mutability". Where two references are provided, the second one 786 supercedes the first. This table is based in part on information 787 provided in RFC1700, "ASSIGNED NUMBERS", (October 1994). 789 Opt. 790 Copy Class # Name Reference 791 ---- ----- --- ------------------------- --------- 792 IMMUTABLE -- included in ICV calculation 793 0 0 0 End of Options List [RFC791] 794 0 0 1 No Operation [RFC791] 795 1 0 2 Security [RFC1108(historic but in use)] 796 1 0 5 Extended Security [RFC1108(historic but in use)] 797 1 0 6 Commercial Security [expired I-D, now US MIL STD] 798 1 0 20 Router Alert [RFC2113] 799 1 0 21 Sender Directed Multi- [RFC1770] 800 Destination Delivery 801 MUTABLE -- zeroed 802 1 0 3 Loose Source Route [RFC791] 803 0 2 4 Time Stamp [RFC791] 804 0 0 7 Record Route [RFC791] 805 1 0 9 Strict Source Route [RFC791] 806 0 2 18 Traceroute [RFC1393] 808 EXPERIMENTAL, SUPERCEDED -- zeroed 809 1 0 8 Stream ID [RFC791, RFC1122 (Host Req)] 810 0 0 11 MTU Probe [RFC1063, RFC1191 (PMTU)] 811 0 0 12 MTU Reply [RFC1063, RFC1191 (PMTU)] 812 1 0 17 Extended Internet Protocol [RFC1385, RFC1883 (IPv6)] 813 0 0 10 Experimental Measurement [ZSu] 814 1 2 13 Experimental Flow Control [Finn] 815 1 0 14 Experimental Access Ctl [Estrin] 816 0 0 15 ??? [VerSteeg] 817 1 0 16 IMI Traffic Descriptor [Lee] 818 1 0 19 Address Extension [Ullmann IPv7] 820 NOTE: Use of the Router Alert option is potentially incompatible with 821 use of IPsec. Although the option is immutable, its use implies that 822 each router along a packet's path will "process" the packet and 823 consequently might change the packet. This would happen on a hop by 824 hop basis as the packet goes from router to router. Prior to being 825 processed by the application to which the option contents are 826 directed, e.g., RSVP/IGMP, the packet should encounter AH processing. 828 However, AH processing would require that each router along the path 829 is a member of a multicast-SA defined by the SPI. This might pose 830 problems for packets that are not strictly source routed, and it 831 requires multicast support techniques not currently available. 833 NOTE: Addition or removal of any security labels (BSO, ESO, CIPSO) by 834 systems along a packet's path conflicts with the classification of 835 these IP Options as immutable and is incompatible with the use of 836 IPsec. 838 NOTE: End of Options List options SHOULD be repeated as necessary to 839 ensure that the IP header ends on a 4 byte boundary in order to 840 ensure that there are no unspecified bytes which could be used for a 841 covert channel. 843 A2. IPv6 Extension Headers 845 This table shows how the IPv6 Extension Headers are classified with 846 regard to "mutability". 848 Option/Extension Name Reference 849 ----------------------------------- --------- 850 MUTABLE BUT PREDICTABLE -- included in ICV calculation 851 Routing (Type 0) [RFC1883] 853 BIT INDICATES IF OPTION IS MUTABLE (CHANGES UNPREDICTABLY DURING TRANSIT) 854 Hop by Hop options [RFC1883] 855 Destination options [RFC1883] 857 NOT APPLICABLE 858 Fragmentation [RFC1883] 860 Options -- IPv6 options in the Hop-by-Hop and Destination Extension 861 Headers contain a bit that indicates whether the option might 862 change (unpredictably) during transit. For any option for which 863 contents may change en-route, the entire "Option Data" field 864 must be treated as zero-valued octets when computing or 865 verifying the ICV. The Option Type and Opt Data Len are 866 included in the ICV calculation. All options for which the bit 867 indicates immutability are included in the ICV calculation. See 868 the IPv6 specification [DH95] for more information. 870 Routing (Type 0) -- The IPv6 Routing Header "Type 0" will rearrange 871 the address fields within the packet during transit from source 872 to destination. However, the contents of the packet as it will 873 appear at the receiver are known to the sender and to all 874 intermediate hops. Hence, the IPv6 Routing Header "Type 0" is 875 included in the Authentication Data calculation as mutable but 876 predictable. The sender must order the field so that it 877 appears as it will at the receiver, prior to performing the ICV 878 computation. 880 Fragmentation -- Fragmentation occurs after outbound IPsec processing 881 (section 3.3) and reassembly occurs before inbound IPsec 882 processing (section 3.4). So the Fragmentation Extension 883 Header, if it exists, is not seen by IPsec. 885 Note that on the receive side, the IP implementation could leave 886 a Fragmentation Extension Header in place when it does 887 re-assembly. If this happens, then when AH receives the packet, 888 before doing ICV processing, AH MUST "remove" (or skip over) 889 this header and change the previous header's "Next Header" field 890 to be the "Next Header" field in the Fragmentation Extension 891 Header. 893 Note that on the send side, the IP implementation could give the 894 IPsec code a packet with a Fragmentation Extension Header with 895 Offset of 0 (first fragment) and a More Fragments Flag of 0 896 (last fragment). If this happens, then before doing ICV 897 processing, AH MUST first "remove" (or skip over) this header 898 and change the previous header's "Next Header" field to be the 899 "Next Header" field in the Fragmentation Extension Header. 901 References 903 [ATK95] R. Atkinson, "The IP Authentication Header," RFC 1826, 904 August 1995. 906 [Bra97] S. Bradner, "Key words for use in RFCs to Indicate 907 Requirement Level," RFC-2119, March 1997. 909 [DH95] Steve Deering & Bob Hinden, "Internet Protocol version 6 910 (IPv6) Specification", RFC-1883, December 1995. 912 [HC98] D. Harkins & D. Carrel, "The Internet Key Exchange (IKE)", 913 Internet Draft, February 1998. 915 [KA97a] Steve Kent, Randall Atkinson, "Security Architecture for 916 the Internet Protocol", Internet Draft, May 1998. 918 [KA97b] Steve Kent, Randall Atkinson, "IP Encapsulating Security 919 Payload (ESP)", Internet Draft, May 1998. 921 [MG97a] C. Madson & R. Glenn, "The Use of HMAC-MD5-96 within ESP 922 and AH", Internet Draft, February 1998. 924 [MG97b] C. Madson & R. Glenn, "The Use of HMAC-SHA-1-96 within ESP 925 and AH", Internet Draft, February 1998. 927 [STD-2] J. Reynolds & J. Postel, "Assigned Numbers", STD-2, 20 928 October 1994. 930 Disclaimer 932 The views and specification here are those of the authors and are not 933 necessarily those of their employers. The authors and their 934 employers specifically disclaim responsibility for any problems 935 arising from correct or incorrect implementation or use of this 936 specification. 938 Author Information 940 Stephen Kent 941 BBN Corporation 942 70 Fawcett Street 943 Cambridge, MA 02140 944 USA 945 E-mail: kent@bbn.com 946 Telephone: +1 (617) 873-3988 948 Randall Atkinson 949 @Home Network 950 425 Broadway, 951 Redwood City, CA 94063 952 USA 953 E-mail: rja@corp.home.net 954 Telephone: +1 (415) 569-5000 956 Copyright (C) The Internet Society (May 1998). All Rights Reserved. 958 This document and translations of it may be copied and furnished to 959 others, and derivative works that comment on or otherwise explain it 960 or assist in its implementation may be prepared, copied, published 961 and distributed, in whole or in part, without restriction of any 962 kind, provided that the above copyright notice and this paragraph are 963 included on all such copies and derivative works. However, this 964 document itself may not be modified in any way, such as by removing 965 the copyright notice or references to the Internet Society or other 966 Internet organizations, except as needed for the purpose of 967 developing Internet standards in which case the procedures for 968 copyrights defined in the Internet Standards process must be 969 followed, or as required to translate it into languages other than 970 English. 972 The limited permissions granted above are perpetual and will not be 973 revoked by the Internet Society or its successors or assigns. 975 This document and the information contained herein is provided on an 976 "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING 977 TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING 978 BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION 979 HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF 980 MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.