Debian Codegraph @

rfc2406.html

raw
1 <pre>Network Working Group S. Kent
2 Request for Comments: 2406 BBN Corp
3 Obsoletes: <a href="./rfc1827">1827</a> R. Atkinson
4 Category: Standards Track @Home Network
5 November 1998
6
7
8 <span class="h1">IP Encapsulating Security Payload (ESP)</span>
9
10 Status of this Memo
11
12 This document specifies an Internet standards track protocol for the
13 Internet community, and requests discussion and suggestions for
14 improvements. Please refer to the current edition of the "Internet
15 Official Protocol Standards" (STD 1) for the standardization state
16 and status of this protocol. Distribution of this memo is unlimited.
17
18 Copyright Notice
19
20 Copyright (C) The Internet Society (1998). All Rights Reserved.
21
22 Table of Contents
23
24 <a href="#section-1">1</a>. Introduction..................................................<a href="#page-2">2</a>
25 <a href="#section-2">2</a>. Encapsulating Security Payload Packet Format..................<a href="#page-3">3</a>
26 <a href="#section-2.1">2.1</a> Security Parameters Index................................<a href="#page-4">4</a>
27 <a href="#section-2.2">2.2</a> Sequence Number .........................................<a href="#page-4">4</a>
28 <a href="#section-2.3">2.3</a> Payload Data.............................................<a href="#page-5">5</a>
29 <a href="#section-2.4">2.4</a> Padding (for Encryption).................................<a href="#page-5">5</a>
30 <a href="#section-2.5">2.5</a> Pad Length...............................................<a href="#page-7">7</a>
31 <a href="#section-2.6">2.6</a> Next Header..............................................<a href="#page-7">7</a>
32 <a href="#section-2.7">2.7</a> Authentication Data......................................<a href="#page-7">7</a>
33 <a href="#section-3">3</a>. Encapsulating Security Protocol Processing....................<a href="#page-7">7</a>
34 <a href="#section-3.1">3.1</a> ESP Header Location......................................<a href="#page-7">7</a>
35 <a href="#section-3.2">3.2</a> Algorithms..............................................<a href="#page-10">10</a>
36 <a href="#section-3.2.1">3.2.1</a> Encryption Algorithms..............................<a href="#page-10">10</a>
37 <a href="#section-3.2.2">3.2.2</a> Authentication Algorithms..........................<a href="#page-10">10</a>
38 <a href="#section-3.3">3.3</a> Outbound Packet Processing..............................<a href="#page-10">10</a>
39 <a href="#section-3.3.1">3.3.1</a> Security Association Lookup........................<a href="#page-11">11</a>
40 <a href="#section-3.3.2">3.3.2</a> Packet Encryption..................................<a href="#page-11">11</a>
41 <a href="#section-3.3.3">3.3.3</a> Sequence Number Generation.........................<a href="#page-12">12</a>
42 <a href="#section-3.3.4">3.3.4</a> Integrity Check Value Calculation..................<a href="#page-12">12</a>
43 <a href="#section-3.3.5">3.3.5</a> Fragmentation......................................<a href="#page-13">13</a>
44 <a href="#section-3.4">3.4</a> Inbound Packet Processing...............................<a href="#page-13">13</a>
45 <a href="#section-3.4.1">3.4.1</a> Reassembly.........................................<a href="#page-13">13</a>
46 <a href="#section-3.4.2">3.4.2</a> Security Association Lookup........................<a href="#page-13">13</a>
47 <a href="#section-3.4.3">3.4.3</a> Sequence Number Verification.......................<a href="#page-14">14</a>
48 <a href="#section-3.4.4">3.4.4</a> Integrity Check Value Verification.................<a href="#page-15">15</a>
49
50
51
52 <span class="grey">Kent &amp; Atkinson Standards Track [Page 1]</span></pre>
53 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-2" ></span>
54 <span class="grey"><a href="./rfc2406">RFC 2406</a> IP Encapsulating Security Payload November 1998</span>
55
56
57 <a href="#section-3.4.5">3.4.5</a> Packet Decryption..................................<a href="#page-16">16</a>
58 <a href="#section-4">4</a>. Auditing.....................................................<a href="#page-17">17</a>
59 <a href="#section-5">5</a>. Conformance Requirements.....................................<a href="#page-18">18</a>
60 <a href="#section-6">6</a>. Security Considerations......................................<a href="#page-18">18</a>
61 <a href="#section-7">7</a>. Differences from <a href="./rfc1827">RFC 1827</a>....................................<a href="#page-18">18</a>
62 Acknowledgements................................................<a href="#page-19">19</a>
63 References......................................................<a href="#page-19">19</a>
64 Disclaimer......................................................<a href="#page-20">20</a>
65 Author Information..............................................<a href="#page-21">21</a>
66 Full Copyright Statement........................................<a href="#page-22">22</a>
67
68 <span class="h2"><a class="selflink" id="section-1" href="#section-1">1</a>. Introduction</span>
69
70 The Encapsulating Security Payload (ESP) header is designed to
71 provide a mix of security services in IPv4 and IPv6. ESP may be
72 applied alone, in combination with the IP Authentication Header (AH)
73 [<a href="#ref-KA97b" title="&quot;IP Authentication Header&quot;">KA97b</a>], or in a nested fashion, e.g., through the use of tunnel mode
74 (see "Security Architecture for the Internet Protocol" [<a href="#ref-KA97a" title="&quot;Security Architecture for the Internet Protocol&quot;">KA97a</a>],
75 hereafter referred to as the Security Architecture document).
76 Security services can be provided between a pair of communicating
77 hosts, between a pair of communicating security gateways, or between
78 a security gateway and a host. For more details on how to use ESP
79 and AH in various network environments, see the Security Architecture
80 document [<a href="#ref-KA97a" title="&quot;Security Architecture for the Internet Protocol&quot;">KA97a</a>].
81
82 The ESP header is inserted after the IP header and before the upper
83 layer protocol header (transport mode) or before an encapsulated IP
84 header (tunnel mode). These modes are described in more detail
85 below.
86
87 ESP is used to provide confidentiality, data origin authentication,
88 connectionless integrity, an anti-replay service (a form of partial
89 sequence integrity), and limited traffic flow confidentiality. The
90 set of services provided depends on options selected at the time of
91 Security Association establishment and on the placement of the
92 implementation. Confidentiality may be selected independent of all
93 other services. However, use of confidentiality without
94 integrity/authentication (either in ESP or separately in AH) may
95 subject traffic to certain forms of active attacks that could
96 undermine the confidentiality service (see [<a href="#ref-Bel96" title="&quot;Problem Areas for the IP Security Protocols&quot;">Bel96</a>]). Data origin
97 authentication and connectionless integrity are joint services
98 (hereafter referred to jointly as "authentication) and are offered as
99 an option in conjunction with (optional) confidentiality. The anti-
100 replay service may be selected only if data origin authentication is
101 selected, and its election is solely at the discretion of the
102 receiver. (Although the default calls for the sender to increment
103 the Sequence Number used for anti-replay, the service is effective
104 only if the receiver checks the Sequence Number.) Traffic flow
105
106
107
108 <span class="grey">Kent &amp; Atkinson Standards Track [Page 2]</span></pre>
109 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-3" ></span>
110 <span class="grey"><a href="./rfc2406">RFC 2406</a> IP Encapsulating Security Payload November 1998</span>
111
112
113 confidentiality requires selection of tunnel mode, and is most
114 effective if implemented at a security gateway, where traffic
115 aggregation may be able to mask true source-destination patterns.
116 Note that although both confidentiality and authentication are
117 optional, at least one of them MUST be selected.
118
119 It is assumed that the reader is familiar with the terms and concepts
120 described in the Security Architecture document. In particular, the
121 reader should be familiar with the definitions of security services
122 offered by ESP and AH, the concept of Security Associations, the ways
123 in which ESP can be used in conjunction with the Authentication
124 Header (AH), and the different key management options available for
125 ESP and AH. (With regard to the last topic, the current key
126 management options required for both AH and ESP are manual keying and
127 automated keying via IKE [<a href="#ref-HC98" title="&quot;The Internet Key Exchange (IKE)&quot;">HC98</a>].)
128
129 The keywords MUST, MUST NOT, REQUIRED, SHALL, SHALL NOT, SHOULD,
130 SHOULD NOT, RECOMMENDED, MAY, and OPTIONAL, when they appear in this
131 document, are to be interpreted as described in <a href="./rfc2119">RFC 2119</a> [<a href="#ref-Bra97" title="&quot;Key words for use in RFCs to Indicate Requirement Level&quot;">Bra97</a>].
132
133 <span class="h2"><a class="selflink" id="section-2" href="#section-2">2</a>. Encapsulating Security Payload Packet Format</span>
134
135 The protocol header (IPv4, IPv6, or Extension) immediately preceding
136 the ESP header will contain the value 50 in its Protocol (IPv4) or
137 Next Header (IPv6, Extension) field [<a href="#ref-STD-2" title="&quot;Assigned Numbers&quot;">STD-2</a>].
138
139 0 1 2 3
140 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
141 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ----
142 | Security Parameters Index (SPI) | ^Auth.
143 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |Cov-
144 | Sequence Number | |erage
145 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ----
146 | Payload Data* (variable) | | ^
147 ~ ~ | |
148 | | |Conf.
149 + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |Cov-
150 | | Padding (0-255 bytes) | |erage*
151 +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |
152 | | Pad Length | Next Header | v v
153 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ------
154 | Authentication Data (variable) |
155 ~ ~
156 | |
157 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
158
159 * If included in the Payload field, cryptographic
160 synchronization data, e.g., an Initialization Vector (IV, see
161
162
163
164 <span class="grey">Kent &amp; Atkinson Standards Track [Page 3]</span></pre>
165 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-4" ></span>
166 <span class="grey"><a href="./rfc2406">RFC 2406</a> IP Encapsulating Security Payload November 1998</span>
167
168
169 <a href="#section-2.3">Section 2.3</a>), usually is not encrypted per se, although it
170 often is referred to as being part of the ciphertext.
171
172 The following subsections define the fields in the header format.
173 "Optional" means that the field is omitted if the option is not
174 selected, i.e., it is present in neither the packet as transmitted
175 nor as formatted for computation of an Integrity Check Value (ICV,
176 see <a href="#section-2.7">Section 2.7</a>). Whether or not an option is selected is defined as
177 part of Security Association (SA) establishment. Thus the format of
178 ESP packets for a given SA is fixed, for the duration of the SA. In
179 contrast, "mandatory" fields are always present in the ESP packet
180 format, for all SAs.
181
182 <span class="h3"><a class="selflink" id="section-2.1" href="#section-2.1">2.1</a> Security Parameters Index</span>
183
184 The SPI is an arbitrary 32-bit value that, in combination with the
185 destination IP address and security protocol (ESP), uniquely
186 identifies the Security Association for this datagram. The set of
187 SPI values in the range 1 through 255 are reserved by the Internet
188 Assigned Numbers Authority (IANA) for future use; a reserved SPI
189 value will not normally be assigned by IANA unless the use of the
190 assigned SPI value is specified in an RFC. It is ordinarily selected
191 by the destination system upon establishment of an SA (see the
192 Security Architecture document for more details). The SPI field is
193 mandatory.
194
195 The SPI value of zero (0) is reserved for local, implementation-
196 specific use and MUST NOT be sent on the wire. For example, a key
197 management implementation MAY use the zero SPI value to mean "No
198 Security Association Exists" during the period when the IPsec
199 implementation has requested that its key management entity establish
200 a new SA, but the SA has not yet been established.
201
202 <span class="h3"><a class="selflink" id="section-2.2" href="#section-2.2">2.2</a> Sequence Number</span>
203
204 This unsigned 32-bit field contains a monotonically increasing
205 counter value (sequence number). It is mandatory and is always
206 present even if the receiver does not elect to enable the anti-replay
207 service for a specific SA. Processing of the Sequence Number field
208 is at the discretion of the receiver, i.e., the sender MUST always
209 transmit this field, but the receiver need not act upon it (see the
210 discussion of Sequence Number Verification in the "Inbound Packet
211 Processing" section below).
212
213 The sender's counter and the receiver's counter are initialized to 0
214 when an SA is established. (The first packet sent using a given SA
215 will have a Sequence Number of 1; see <a href="#section-3.3.3">Section 3.3.3</a> for more details
216 on how the Sequence Number is generated.) If anti-replay is enabled
217
218
219
220 <span class="grey">Kent &amp; Atkinson Standards Track [Page 4]</span></pre>
221 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-5" ></span>
222 <span class="grey"><a href="./rfc2406">RFC 2406</a> IP Encapsulating Security Payload November 1998</span>
223
224
225 (the default), the transmitted Sequence Number must never be allowed
226 to cycle. Thus, the sender's counter and the receiver's counter MUST
227 be reset (by establishing a new SA and thus a new key) prior to the
228 transmission of the 2^32nd packet on an SA.
229
230 <span class="h3"><a class="selflink" id="section-2.3" href="#section-2.3">2.3</a> Payload Data</span>
231
232 Payload Data is a variable-length field containing data described by
233 the Next Header field. The Payload Data field is mandatory and is an
234 integral number of bytes in length. If the algorithm used to encrypt
235 the payload requires cryptographic synchronization data, e.g., an
236 Initialization Vector (IV), then this data MAY be carried explicitly
237 in the Payload field. Any encryption algorithm that requires such
238 explicit, per-packet synchronization data MUST indicate the length,
239 any structure for such data, and the location of this data as part of
240 an RFC specifying how the algorithm is used with ESP. If such
241 synchronization data is implicit, the algorithm for deriving the data
242 MUST be part of the RFC.
243
244 Note that with regard to ensuring the alignment of the (real)
245 ciphertext in the presence of an IV:
246
247 o For some IV-based modes of operation, the receiver treats
248 the IV as the start of the ciphertext, feeding it into the
249 algorithm directly. In these modes, alignment of the start
250 of the (real) ciphertext is not an issue at the receiver.
251 o In some cases, the receiver reads the IV in separately from
252 the ciphertext. In these cases, the algorithm
253 specification MUST address how alignment of the (real)
254 ciphertext is to be achieved.
255
256 <span class="h3"><a class="selflink" id="section-2.4" href="#section-2.4">2.4</a> Padding (for Encryption)</span>
257
258 Several factors require or motivate use of the Padding field.
259
260 o If an encryption algorithm is employed that requires the
261 plaintext to be a multiple of some number of bytes, e.g.,
262 the block size of a block cipher, the Padding field is used
263 to fill the plaintext (consisting of the Payload Data, Pad
264 Length and Next Header fields, as well as the Padding) to
265 the size required by the algorithm.
266
267 o Padding also may be required, irrespective of encryption
268 algorithm requirements, to ensure that the resulting
269 ciphertext terminates on a 4-byte boundary. Specifically,
270
271
272
273
274
275
276 <span class="grey">Kent &amp; Atkinson Standards Track [Page 5]</span></pre>
277 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-6" ></span>
278 <span class="grey"><a href="./rfc2406">RFC 2406</a> IP Encapsulating Security Payload November 1998</span>
279
280
281 the Pad Length and Next Header fields must be right aligned
282 within a 4-byte word, as illustrated in the ESP packet
283 format figure above, to ensure that the Authentication Data
284 field (if present) is aligned on a 4-byte boundary.
285
286 o Padding beyond that required for the algorithm or alignment
287 reasons cited above, may be used to conceal the actual
288 length of the payload, in support of (partial) traffic flow
289 confidentiality. However, inclusion of such additional
290 padding has adverse bandwidth implications and thus its use
291 should be undertaken with care.
292
293 The sender MAY add 0-255 bytes of padding. Inclusion of the Padding
294 field in an ESP packet is optional, but all implementations MUST
295 support generation and consumption of padding.
296
297 a. For the purpose of ensuring that the bits to be encrypted
298 are a multiple of the algorithm's blocksize (first bullet
299 above), the padding computation applies to the Payload
300 Data exclusive of the IV, the Pad Length, and Next Header
301 fields.
302
303 b. For the purposes of ensuring that the Authentication Data
304 is aligned on a 4-byte boundary (second bullet above), the
305 padding computation applies to the Payload Data inclusive
306 of the IV, the Pad Length, and Next Header fields.
307
308 If Padding bytes are needed but the encryption algorithm does not
309 specify the padding contents, then the following default processing
310 MUST be used. The Padding bytes are initialized with a series of
311 (unsigned, 1-byte) integer values. The first padding byte appended
312 to the plaintext is numbered 1, with subsequent padding bytes making
313 up a monotonically increasing sequence: 1, 2, 3, ... When this
314 padding scheme is employed, the receiver SHOULD inspect the Padding
315 field. (This scheme was selected because of its relative simplicity,
316 ease of implementation in hardware, and because it offers limited
317 protection against certain forms of "cut and paste" attacks in the
318 absence of other integrity measures, if the receiver checks the
319 padding values upon decryption.)
320
321 Any encryption algorithm that requires Padding other than the default
322 described above, MUST define the Padding contents (e.g., zeros or
323 random data) and any required receiver processing of these Padding
324 bytes in an RFC specifying how the algorithm is used with ESP. In
325 such circumstances, the content of the Padding field will be
326 determined by the encryption algorithm and mode selected and defined
327 in the corresponding algorithm RFC. The relevant algorithm RFC MAY
328 specify that a receiver MUST inspect the Padding field or that a
329
330
331
332 <span class="grey">Kent &amp; Atkinson Standards Track [Page 6]</span></pre>
333 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-7" ></span>
334 <span class="grey"><a href="./rfc2406">RFC 2406</a> IP Encapsulating Security Payload November 1998</span>
335
336
337 receiver MUST inform senders of how the receiver will handle the
338 Padding field.
339
340 <span class="h3"><a class="selflink" id="section-2.5" href="#section-2.5">2.5</a> Pad Length</span>
341
342 The Pad Length field indicates the number of pad bytes immediately
343 preceding it. The range of valid values is 0-255, where a value of
344 zero indicates that no Padding bytes are present. The Pad Length
345 field is mandatory.
346
347 <span class="h3"><a class="selflink" id="section-2.6" href="#section-2.6">2.6</a> Next Header</span>
348
349 The Next Header is an 8-bit field that identifies the type of data
350 contained in the Payload Data field, e.g., an extension header in
351 IPv6 or an upper layer protocol identifier. The value of this field
352 is chosen from the set of IP Protocol Numbers defined in the most
353 recent "Assigned Numbers" [<a href="#ref-STD-2" title="&quot;Assigned Numbers&quot;">STD-2</a>] RFC from the Internet Assigned
354 Numbers Authority (IANA). The Next Header field is mandatory.
355
356 <span class="h3"><a class="selflink" id="section-2.7" href="#section-2.7">2.7</a> Authentication Data</span>
357
358 The Authentication Data is a variable-length field containing an
359 Integrity Check Value (ICV) computed over the ESP packet minus the
360 Authentication Data. The length of the field is specified by the
361 authentication function selected. The Authentication Data field is
362 optional, and is included only if the authentication service has been
363 selected for the SA in question. The authentication algorithm
364 specification MUST specify the length of the ICV and the comparison
365 rules and processing steps for validation.
366
367 <span class="h2"><a class="selflink" id="section-3" href="#section-3">3</a>. Encapsulating Security Protocol Processing</span>
368
369 <span class="h3"><a class="selflink" id="section-3.1" href="#section-3.1">3.1</a> ESP Header Location</span>
370
371 Like AH, ESP may be employed in two ways: transport mode or tunnel
372 mode. The former mode is applicable only to host implementations and
373 provides protection for upper layer protocols, but not the IP header.
374 (In this mode, note that for "bump-in-the-stack" or "bump-in-the-
375 wire" implementations, as defined in the Security Architecture
376 document, inbound and outbound IP fragments may require an IPsec
377 implementation to perform extra IP reassembly/fragmentation in order
378 to both conform to this specification and provide transparent IPsec
379 support. Special care is required to perform such operations within
380 these implementations when multiple interfaces are in use.)
381
382 In transport mode, ESP is inserted after the IP header and before an
383 upper layer protocol, e.g., TCP, UDP, ICMP, etc. or before any other
384 IPsec headers that have already been inserted. In the context of
385
386
387
388 <span class="grey">Kent &amp; Atkinson Standards Track [Page 7]</span></pre>
389 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-8" ></span>
390 <span class="grey"><a href="./rfc2406">RFC 2406</a> IP Encapsulating Security Payload November 1998</span>
391
392
393 IPv4, this translates to placing ESP after the IP header (and any
394 options that it contains), but before the upper layer protocol.
395 (Note that the term "transport" mode should not be misconstrued as
396 restricting its use to TCP and UDP. For example, an ICMP message MAY
397 be sent using either "transport" mode or "tunnel" mode.) The
398 following diagram illustrates ESP transport mode positioning for a
399 typical IPv4 packet, on a "before and after" basis. (The "ESP
400 trailer" encompasses any Padding, plus the Pad Length, and Next
401 Header fields.)
402
403 BEFORE APPLYING ESP
404 ----------------------------
405 IPv4 |orig IP hdr | | |
406 |(any options)| TCP | Data |
407 ----------------------------
408
409 AFTER APPLYING ESP
410 -------------------------------------------------
411 IPv4 |orig IP hdr | ESP | | | ESP | ESP|
412 |(any options)| Hdr | TCP | Data | Trailer |Auth|
413 -------------------------------------------------
414 |&lt;----- encrypted ----&gt;|
415 |&lt;------ authenticated -----&gt;|
416
417
418 In the IPv6 context, ESP is viewed as an end-to-end payload, and thus
419 should appear after hop-by-hop, routing, and fragmentation extension
420 headers. The destination options extension header(s) could appear
421 either before or after the ESP header depending on the semantics
422 desired. However, since ESP protects only fields after the ESP
423 header, it generally may be desirable to place the destination
424 options header(s) after the ESP header. The following diagram
425 illustrates ESP transport mode positioning for a typical IPv6 packet.
426
427 BEFORE APPLYING ESP
428 ---------------------------------------
429 IPv6 | | ext hdrs | | |
430 | orig IP hdr |if present| TCP | Data |
431 ---------------------------------------
432
433
434
435
436
437
438
439
440
441
442
443
444 <span class="grey">Kent &amp; Atkinson Standards Track [Page 8]</span></pre>
445 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-9" ></span>
446 <span class="grey"><a href="./rfc2406">RFC 2406</a> IP Encapsulating Security Payload November 1998</span>
447
448
449 AFTER APPLYING ESP
450 ---------------------------------------------------------
451 IPv6 | orig |hop-by-hop,dest*,| |dest| | | ESP | ESP|
452 |IP hdr|routing,fragment.|ESP|opt*|TCP|Data|Trailer|Auth|
453 ---------------------------------------------------------
454 |&lt;---- encrypted ----&gt;|
455 |&lt;---- authenticated ----&gt;|
456
457 * = if present, could be before ESP, after ESP, or both
458
459 ESP and AH headers can be combined in a variety of modes. The IPsec
460 Architecture document describes the combinations of security
461 associations that must be supported.
462
463 Tunnel mode ESP may be employed in either hosts or security gateways.
464 When ESP is implemented in a security gateway (to protect subscriber
465 transit traffic), tunnel mode must be used. In tunnel mode, the
466 "inner" IP header carries the ultimate source and destination
467 addresses, while an "outer" IP header may contain distinct IP
468 addresses, e.g., addresses of security gateways. In tunnel mode, ESP
469 protects the entire inner IP packet, including the entire inner IP
470 header. The position of ESP in tunnel mode, relative to the outer IP
471 header, is the same as for ESP in transport mode. The following
472 diagram illustrates ESP tunnel mode positioning for typical IPv4 and
473 IPv6 packets.
474
475 -----------------------------------------------------------
476 IPv4 | new IP hdr* | | orig IP hdr* | | | ESP | ESP|
477 |(any options)| ESP | (any options) |TCP|Data|Trailer|Auth|
478 -----------------------------------------------------------
479 |&lt;--------- encrypted ----------&gt;|
480 |&lt;----------- authenticated ----------&gt;|
481
482 ------------------------------------------------------------
483 IPv6 | new* |new ext | | orig*|orig ext | | | ESP | ESP|
484 |IP hdr| hdrs* |ESP|IP hdr| hdrs * |TCP|Data|Trailer|Auth|
485 ------------------------------------------------------------
486 |&lt;--------- encrypted -----------&gt;|
487 |&lt;---------- authenticated ----------&gt;|
488
489 * = if present, construction of outer IP hdr/extensions
490 and modification of inner IP hdr/extensions is
491 discussed below.
492
493
494
495
496
497
498
499
500 <span class="grey">Kent &amp; Atkinson Standards Track [Page 9]</span></pre>
501 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-10" ></span>
502 <span class="grey"><a href="./rfc2406">RFC 2406</a> IP Encapsulating Security Payload November 1998</span>
503
504
505 <span class="h3"><a class="selflink" id="section-3.2" href="#section-3.2">3.2</a> Algorithms</span>
506
507 The mandatory-to-implement algorithms are described in <a href="#section-5">Section 5</a>,
508 "Conformance Requirements". Other algorithms MAY be supported. Note
509 that although both confidentiality and authentication are optional,
510 at least one of these services MUST be selected hence both algorithms
511 MUST NOT be simultaneously NULL.
512
513 <span class="h4"><a class="selflink" id="section-3.2.1" href="#section-3.2.1">3.2.1</a> Encryption Algorithms</span>
514
515 The encryption algorithm employed is specified by the SA. ESP is
516 designed for use with symmetric encryption algorithms. Because IP
517 packets may arrive out of order, each packet must carry any data
518 required to allow the receiver to establish cryptographic
519 synchronization for decryption. This data may be carried explicitly
520 in the payload field, e.g., as an IV (as described above), or the
521 data may be derived from the packet header. Since ESP makes
522 provision for padding of the plaintext, encryption algorithms
523 employed with ESP may exhibit either block or stream mode
524 characteristics. Note that since encryption (confidentiality) is
525 optional, this algorithm may be "NULL".
526
527 <span class="h4"><a class="selflink" id="section-3.2.2" href="#section-3.2.2">3.2.2</a> Authentication Algorithms</span>
528
529 The authentication algorithm employed for the ICV computation is
530 specified by the SA. For point-to-point communication, suitable
531 authentication algorithms include keyed Message Authentication Codes
532 (MACs) based on symmetric encryption algorithms (e.g., DES) or on
533 one-way hash functions (e.g., MD5 or SHA-1). For multicast
534 communication, one-way hash algorithms combined with asymmetric
535 signature algorithms are appropriate, though performance and space
536 considerations currently preclude use of such algorithms. Note that
537 since authentication is optional, this algorithm may be "NULL".
538
539 <span class="h3"><a class="selflink" id="section-3.3" href="#section-3.3">3.3</a> Outbound Packet Processing</span>
540
541 In transport mode, the sender encapsulates the upper layer protocol
542 information in the ESP header/trailer, and retains the specified IP
543 header (and any IP extension headers in the IPv6 context). In tunnel
544 mode, the outer and inner IP header/extensions can be inter-related
545 in a variety of ways. The construction of the outer IP
546 header/extensions during the encapsulation process is described in
547 the Security Architecture document. If there is more than one IPsec
548 header/extension required by security policy, the order of the
549 application of the security headers MUST be defined by security
550 policy.
551
552
553
554
555
556 <span class="grey">Kent &amp; Atkinson Standards Track [Page 10]</span></pre>
557 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-11" ></span>
558 <span class="grey"><a href="./rfc2406">RFC 2406</a> IP Encapsulating Security Payload November 1998</span>
559
560
561 <span class="h4"><a class="selflink" id="section-3.3.1" href="#section-3.3.1">3.3.1</a> Security Association Lookup</span>
562
563 ESP is applied to an outbound packet only after an IPsec
564 implementation determines that the packet is associated with an SA
565 that calls for ESP processing. The process of determining what, if
566 any, IPsec processing is applied to outbound traffic is described in
567 the Security Architecture document.
568
569 <span class="h4"><a class="selflink" id="section-3.3.2" href="#section-3.3.2">3.3.2</a> Packet Encryption</span>
570
571 In this section, we speak in terms of encryption always being applied
572 because of the formatting implications. This is done with the
573 understanding that "no confidentiality" is offered by using the NULL
574 encryption algorithm. Accordingly, the sender:
575
576 1. encapsulates (into the ESP Payload field):
577 - for transport mode -- just the original upper layer
578 protocol information.
579 - for tunnel mode -- the entire original IP datagram.
580 2. adds any necessary padding.
581 3. encrypts the result (Payload Data, Padding, Pad Length, and
582 Next Header) using the key, encryption algorithm, algorithm
583 mode indicated by the SA and cryptographic synchronization
584 data (if any).
585 - If explicit cryptographic synchronization data, e.g.,
586 an IV, is indicated, it is input to the encryption
587 algorithm per the algorithm specification and placed
588 in the Payload field.
589 - If implicit cryptographic synchronication data, e.g.,
590 an IV, is indicated, it is constructed and input to
591 the encryption algorithm as per the algorithm
592 specification.
593
594 The exact steps for constructing the outer IP header depend on the
595 mode (transport or tunnel) and are described in the Security
596 Architecture document.
597
598 If authentication is selected, encryption is performed first, before
599 the authentication, and the encryption does not encompass the
600 Authentication Data field. This order of processing facilitates
601 rapid detection and rejection of replayed or bogus packets by the
602 receiver, prior to decrypting the packet, hence potentially reducing
603 the impact of denial of service attacks. It also allows for the
604 possibility of parallel processing of packets at the receiver, i.e.,
605 decryption can take place in parallel with authentication. Note that
606 since the Authentication Data is not protected by encryption, a keyed
607 authentication algorithm must be employed to compute the ICV.
608
609
610
611
612 <span class="grey">Kent &amp; Atkinson Standards Track [Page 11]</span></pre>
613 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-12" ></span>
614 <span class="grey"><a href="./rfc2406">RFC 2406</a> IP Encapsulating Security Payload November 1998</span>
615
616
617 <span class="h4"><a class="selflink" id="section-3.3.3" href="#section-3.3.3">3.3.3</a> Sequence Number Generation</span>
618
619 The sender's counter is initialized to 0 when an SA is established.
620 The sender increments the Sequence Number for this SA and inserts the
621 new value into the Sequence Number field. Thus the first packet sent
622 using a given SA will have a Sequence Number of 1.
623
624 If anti-replay is enabled (the default), the sender checks to ensure
625 that the counter has not cycled before inserting the new value in the
626 Sequence Number field. In other words, the sender MUST NOT send a
627 packet on an SA if doing so would cause the Sequence Number to cycle.
628 An attempt to transmit a packet that would result in Sequence Number
629 overflow is an auditable event. (Note that this approach to Sequence
630 Number management does not require use of modular arithmetic.)
631
632 The sender assumes anti-replay is enabled as a default, unless
633 otherwise notified by the receiver (see 3.4.3). Thus, if the counter
634 has cycled, the sender will set up a new SA and key (unless the SA
635 was configured with manual key management).
636
637 If anti-replay is disabled, the sender does not need to monitor or
638 reset the counter, e.g., in the case of manual key management (see
639 <a href="#section-5">Section 5</a>). However, the sender still increments the counter and
640 when it reaches the maximum value, the counter rolls over back to
641 zero.
642
643 <span class="h4"><a class="selflink" id="section-3.3.4" href="#section-3.3.4">3.3.4</a> Integrity Check Value Calculation</span>
644
645 If authentication is selected for the SA, the sender computes the ICV
646 over the ESP packet minus the Authentication Data. Thus the SPI,
647 Sequence Number, Payload Data, Padding (if present), Pad Length, and
648 Next Header are all encompassed by the ICV computation. Note that
649 the last 4 fields will be in ciphertext form, since encryption is
650 performed prior to authentication.
651
652 For some authentication algorithms, the byte string over which the
653 ICV computation is performed must be a multiple of a blocksize
654 specified by the algorithm. If the length of this byte string does
655 not match the blocksize requirements for the algorithm, implicit
656 padding MUST be appended to the end of the ESP packet, (after the
657 Next Header field) prior to ICV computation. The padding octets MUST
658 have a value of zero. The blocksize (and hence the length of the
659 padding) is specified by the algorithm specification. This padding
660 is not transmitted with the packet. Note that MD5 and SHA-1 are
661 viewed as having a 1-byte blocksize because of their internal padding
662 conventions.
663
664
665
666
667
668 <span class="grey">Kent &amp; Atkinson Standards Track [Page 12]</span></pre>
669 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-13" ></span>
670 <span class="grey"><a href="./rfc2406">RFC 2406</a> IP Encapsulating Security Payload November 1998</span>
671
672
673 <span class="h4"><a class="selflink" id="section-3.3.5" href="#section-3.3.5">3.3.5</a> Fragmentation</span>
674
675 If necessary, fragmentation is performed after ESP processing within
676 an IPsec implementation. Thus, transport mode ESP is applied only to
677 whole IP datagrams (not to IP fragments). An IP packet to which ESP
678 has been applied may itself be fragmented by routers en route, and
679 such fragments must be reassembled prior to ESP processing at a
680 receiver. In tunnel mode, ESP is applied to an IP packet, the
681 payload of which may be a fragmented IP packet. For example, a
682 security gateway or a "bump-in-the-stack" or "bump-in-the-wire" IPsec
683 implementation (as defined in the Security Architecture document) may
684 apply tunnel mode ESP to such fragments.
685
686 NOTE: For transport mode -- As mentioned at the beginning of <a href="#section-3.1">Section</a>
687 <a href="#section-3.1">3.1</a>, bump-in-the-stack and bump-in-the-wire implementations may have
688 to first reassemble a packet fragmented by the local IP layer, then
689 apply IPsec, and then fragment the resulting packet.
690
691 NOTE: For IPv6 -- For bump-in-the-stack and bump-in-the-wire
692 implementations, it will be necessary to walk through all the
693 extension headers to determine if there is a fragmentation header and
694 hence that the packet needs reassembling prior to IPsec processing.
695
696 <span class="h3"><a class="selflink" id="section-3.4" href="#section-3.4">3.4</a> Inbound Packet Processing</span>
697
698 <span class="h4"><a class="selflink" id="section-3.4.1" href="#section-3.4.1">3.4.1</a> Reassembly</span>
699
700 If required, reassembly is performed prior to ESP processing. If a
701 packet offered to ESP for processing appears to be an IP fragment,
702 i.e., the OFFSET field is non-zero or the MORE FRAGMENTS flag is set,
703 the receiver MUST discard the packet; this is an auditable event. The
704 audit log entry for this event SHOULD include the SPI value,
705 date/time received, Source Address, Destination Address, Sequence
706 Number, and (in IPv6) the Flow ID.
707
708 NOTE: For packet reassembly, the current IPv4 spec does NOT require
709 either the zero'ing of the OFFSET field or the clearing of the MORE
710 FRAGMENTS flag. In order for a reassembled packet to be processed by
711 IPsec (as opposed to discarded as an apparent fragment), the IP code
712 must do these two things after it reassembles a packet.
713
714 <span class="h4"><a class="selflink" id="section-3.4.2" href="#section-3.4.2">3.4.2</a> Security Association Lookup</span>
715
716 Upon receipt of a (reassembled) packet containing an ESP Header, the
717 receiver determines the appropriate (unidirectional) SA, based on the
718 destination IP address, security protocol (ESP), and the SPI. (This
719 process is described in more detail in the Security Architecture
720 document.) The SA indicates whether the Sequence Number field will
721
722
723
724 <span class="grey">Kent &amp; Atkinson Standards Track [Page 13]</span></pre>
725 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-14" ></span>
726 <span class="grey"><a href="./rfc2406">RFC 2406</a> IP Encapsulating Security Payload November 1998</span>
727
728
729 be checked, whether the Authentication Data field should be present,
730 and it will specify the algorithms and keys to be employed for
731 decryption and ICV computations (if applicable).
732
733 If no valid Security Association exists for this session (for
734 example, the receiver has no key), the receiver MUST discard the
735 packet; this is an auditable event. The audit log entry for this
736 event SHOULD include the SPI value, date/time received, Source
737 Address, Destination Address, Sequence Number, and (in IPv6) the
738 cleartext Flow ID.
739
740 <span class="h4"><a class="selflink" id="section-3.4.3" href="#section-3.4.3">3.4.3</a> Sequence Number Verification</span>
741
742 All ESP implementations MUST support the anti-replay service, though
743 its use may be enabled or disabled by the receiver on a per-SA basis.
744 This service MUST NOT be enabled unless the authentication service
745 also is enabled for the SA, since otherwise the Sequence Number field
746 has not been integrity protected. (Note that there are no provisions
747 for managing transmitted Sequence Number values among multiple
748 senders directing traffic to a single SA (irrespective of whether the
749 destination address is unicast, broadcast, or multicast). Thus the
750 anti-replay service SHOULD NOT be used in a multi-sender environment
751 that employs a single SA.)
752
753 If the receiver does not enable anti-replay for an SA, no inbound
754 checks are performed on the Sequence Number. However, from the
755 perspective of the sender, the default is to assume that anti-replay
756 is enabled at the receiver. To avoid having the sender do
757 unnecessary sequence number monitoring and SA setup (see <a href="#section-3.3.3">section</a>
758 <a href="#section-3.3.3">3.3.3</a>), if an SA establishment protocol such as IKE is employed, the
759 receiver SHOULD notify the sender, during SA establishment, if the
760 receiver will not provide anti-replay protection.
761
762 If the receiver has enabled the anti-replay service for this SA, the
763 receive packet counter for the SA MUST be initialized to zero when
764 the SA is established. For each received packet, the receiver MUST
765 verify that the packet contains a Sequence Number that does not
766 duplicate the Sequence Number of any other packets received during
767 the life of this SA. This SHOULD be the first ESP check applied to a
768 packet after it has been matched to an SA, to speed rejection of
769 duplicate packets.
770
771 Duplicates are rejected through the use of a sliding receive window.
772 (How the window is implemented is a local matter, but the following
773 text describes the functionality that the implementation must
774 exhibit.) A MINIMUM window size of 32 MUST be supported; but a
775 window size of 64 is preferred and SHOULD be employed as the default.
776
777
778
779
780 <span class="grey">Kent &amp; Atkinson Standards Track [Page 14]</span></pre>
781 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-15" ></span>
782 <span class="grey"><a href="./rfc2406">RFC 2406</a> IP Encapsulating Security Payload November 1998</span>
783
784
785 Another window size (larger than the MINIMUM) MAY be chosen by the
786 receiver. (The receiver does NOT notify the sender of the window
787 size.)
788
789 The "right" edge of the window represents the highest, validated
790 Sequence Number value received on this SA. Packets that contain
791 Sequence Numbers lower than the "left" edge of the window are
792 rejected. Packets falling within the window are checked against a
793 list of received packets within the window. An efficient means for
794 performing this check, based on the use of a bit mask, is described
795 in the Security Architecture document.
796
797 If the received packet falls within the window and is new, or if the
798 packet is to the right of the window, then the receiver proceeds to
799 ICV verification. If the ICV validation fails, the receiver MUST
800 discard the received IP datagram as invalid; this is an auditable
801 event. The audit log entry for this event SHOULD include the SPI
802 value, date/time received, Source Address, Destination Address, the
803 Sequence Number, and (in IPv6) the Flow ID. The receive window is
804 updated only if the ICV verification succeeds.
805
806 DISCUSSION:
807
808 Note that if the packet is either inside the window and new, or is
809 outside the window on the "right" side, the receiver MUST
810 authenticate the packet before updating the Sequence Number window
811 data.
812
813 <span class="h4"><a class="selflink" id="section-3.4.4" href="#section-3.4.4">3.4.4</a> Integrity Check Value Verification</span>
814
815 If authentication has been selected, the receiver computes the ICV
816 over the ESP packet minus the Authentication Data using the specified
817 authentication algorithm and verifies that it is the same as the ICV
818 included in the Authentication Data field of the packet. Details of
819 the computation are provided below.
820
821 If the computed and received ICV's match, then the datagram is valid,
822 and it is accepted. If the test fails, then the receiver MUST
823 discard the received IP datagram as invalid; this is an auditable
824 event. The log data SHOULD include the SPI value, date/time
825 received, Source Address, Destination Address, the Sequence Number,
826 and (in IPv6) the cleartext Flow ID.
827
828 DISCUSSION:
829
830 Begin by removing and saving the ICV value (Authentication Data
831 field). Next check the overall length of the ESP packet minus the
832 Authentication Data. If implicit padding is required, based on
833
834
835
836 <span class="grey">Kent &amp; Atkinson Standards Track [Page 15]</span></pre>
837 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-16" ></span>
838 <span class="grey"><a href="./rfc2406">RFC 2406</a> IP Encapsulating Security Payload November 1998</span>
839
840
841 the blocksize of the authentication algorithm, append zero-filled
842 bytes to the end of the ESP packet directly after the Next Header
843 field. Perform the ICV computation and compare the result with
844 the saved value, using the comparison rules defined by the
845 algorithm specification. (For example, if a digital signature and
846 one-way hash are used for the ICV computation, the matching
847 process is more complex.)
848
849 <span class="h4"><a class="selflink" id="section-3.4.5" href="#section-3.4.5">3.4.5</a> Packet Decryption</span>
850
851 As in <a href="#section-3.3.2">section 3.3.2</a>, "Packet Encryption", we speak here in terms of
852 encryption always being applied because of the formatting
853 implications. This is done with the understanding that "no
854 confidentiality" is offered by using the NULL encryption algorithm.
855 Accordingly, the receiver:
856
857 1. decrypts the ESP Payload Data, Padding, Pad Length, and Next
858 Header using the key, encryption algorithm, algorithm mode,
859 and cryptographic synchronization data (if any), indicated by
860 the SA.
861 - If explicit cryptographic synchronization data, e.g.,
862 an IV, is indicated, it is taken from the Payload
863 field and input to the decryption algorithm as per the
864 algorithm specification.
865 - If implicit cryptographic synchronization data, e.g.,
866 an IV, is indicated, a local version of the IV is
867 constructed and input to the decryption algorithm as
868 per the algorithm specification.
869 2. processes any padding as specified in the encryption
870 algorithm specification. If the default padding scheme (see
871 <a href="#section-2.4">Section 2.4</a>) has been employed, the receiver SHOULD inspect
872 the Padding field before removing the padding prior to
873 passing the decrypted data to the next layer.
874 3. reconstructs the original IP datagram from:
875 - for transport mode -- original IP header plus the
876 original upper layer protocol information in the ESP
877 Payload field
878 - for tunnel mode -- tunnel IP header + the entire IP
879 datagram in the ESP Payload field.
880
881 The exact steps for reconstructing the original datagram depend on
882 the mode (transport or tunnel) and are described in the Security
883 Architecture document. At a minimum, in an IPv6 context, the
884 receiver SHOULD ensure that the decrypted data is 8-byte aligned, to
885 facilitate processing by the protocol identified in the Next Header
886 field.
887
888
889
890
891
892 <span class="grey">Kent &amp; Atkinson Standards Track [Page 16]</span></pre>
893 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-17" ></span>
894 <span class="grey"><a href="./rfc2406">RFC 2406</a> IP Encapsulating Security Payload November 1998</span>
895
896
897 If authentication has been selected, verification and decryption MAY
898 be performed serially or in parallel. If performed serially, then
899 ICV verification SHOULD be performed first. If performed in
900 parallel, verification MUST be completed before the decrypted packet
901 is passed on for further processing. This order of processing
902 facilitates rapid detection and rejection of replayed or bogus
903 packets by the receiver, prior to decrypting the packet, hence
904 potentially reducing the impact of denial of service attacks. Note:
905
906 If the receiver performs decryption in parallel with authentication,
907 care must be taken to avoid possible race conditions with regard to
908 packet access and reconstruction of the decrypted packet.
909
910 Note that there are several ways in which the decryption can "fail":
911
912 a. The selected SA may not be correct -- The SA may be
913 mis-selected due to tampering with the SPI, destination
914 address, or IPsec protocol type fields. Such errors, if they
915 map the packet to another extant SA, will be
916 indistinguishable from a corrupted packet, (case c).
917 Tampering with the SPI can be detected by use of
918 authentication. However, an SA mismatch might still occur
919 due to tampering with the IP Destination Address or the IPsec
920 protocol type field.
921
922 b. The pad length or pad values could be erroneous -- Bad pad
923 lengths or pad values can be detected irrespective of the use
924 of authentication.
925
926 c. The encrypted ESP packet could be corrupted -- This can be
927 detected if authentication is selected for the SA.,
928
929 In case (a) or (c), the erroneous result of the decryption operation
930 (an invalid IP datagram or transport-layer frame) will not
931 necessarily be detected by IPsec, and is the responsibility of later
932 protocol processing.
933
934 <span class="h2"><a class="selflink" id="section-4" href="#section-4">4</a>. Auditing</span>
935
936 Not all systems that implement ESP will implement auditing. However,
937 if ESP is incorporated into a system that supports auditing, then the
938 ESP implementation MUST also support auditing and MUST allow a system
939 administrator to enable or disable auditing for ESP. For the most
940 part, the granularity of auditing is a local matter. However,
941 several auditable events are identified in this specification and for
942 each of these events a minimum set of information that SHOULD be
943 included in an audit log is defined. Additional information also MAY
944 be included in the audit log for each of these events, and additional
945
946
947
948 <span class="grey">Kent &amp; Atkinson Standards Track [Page 17]</span></pre>
949 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-18" ></span>
950 <span class="grey"><a href="./rfc2406">RFC 2406</a> IP Encapsulating Security Payload November 1998</span>
951
952
953 events, not explicitly called out in this specification, also MAY
954 result in audit log entries. There is no requirement for the
955 receiver to transmit any message to the purported sender in response
956 to the detection of an auditable event, because of the potential to
957 induce denial of service via such action.
958
959 <span class="h2"><a class="selflink" id="section-5" href="#section-5">5</a>. Conformance Requirements</span>
960
961 Implementations that claim conformance or compliance with this
962 specification MUST implement the ESP syntax and processing described
963 here and MUST comply with all requirements of the Security
964 Architecture document. If the key used to compute an ICV is manually
965 distributed, correct provision of the anti-replay service would
966 require correct maintenance of the counter state at the sender, until
967 the key is replaced, and there likely would be no automated recovery
968 provision if counter overflow were imminent. Thus a compliant
969 implementation SHOULD NOT provide this service in conjunction with
970 SAs that are manually keyed. A compliant ESP implementation MUST
971 support the following mandatory-to-implement algorithms:
972
973 - DES in CBC mode [<a href="#ref-MD97" title="&quot;The ESP DES-CBC Cipher Algorithm With Explicit IV&quot;">MD97</a>]
974 - HMAC with MD5 [<a href="#ref-MG97a" title="&quot;The Use of HMAC-MD5-96 within ESP and AH&quot;">MG97a</a>]
975 - HMAC with SHA-1 [<a href="#ref-MG97b" title="&quot;The Use of HMAC-SHA-1-96 within ESP and AH&quot;">MG97b</a>]
976 - NULL Authentication algorithm
977 - NULL Encryption algorithm
978
979 Since ESP encryption and authentication are optional, support for the
980 2 "NULL" algorithms is required to maintain consistency with the way
981 these services are negotiated. NOTE that while authentication and
982 encryption can each be "NULL", they MUST NOT both be "NULL".
983
984 <span class="h2"><a class="selflink" id="section-6" href="#section-6">6</a>. Security Considerations</span>
985
986 Security is central to the design of this protocol, and thus security
987 considerations permeate the specification. Additional security-
988 relevant aspects of using the IPsec protocol are discussed in the
989 Security Architecture document.
990
991 <span class="h2"><a class="selflink" id="section-7" href="#section-7">7</a>. Differences from <a href="./rfc1827">RFC 1827</a></span>
992
993 This document differs from <a href="./rfc1827">RFC 1827</a> [<a href="#ref-ATK95" title="&quot;IP Encapsulating Security Payload (ESP)&quot;">ATK95</a>] in several significant
994 ways. The major difference is that, this document attempts to
995 specify a complete framework and context for ESP, whereas <a href="./rfc1827">RFC 1827</a>
996 provided a "shell" that was completed through the definition of
997 transforms. The combinatorial growth of transforms motivated the
998 reformulation of the ESP specification as a more complete document,
999 with options for security services that may be offered in the context
1000 of ESP. Thus, fields previously defined in transform documents are
1001
1002
1003
1004 <span class="grey">Kent &amp; Atkinson Standards Track [Page 18]</span></pre>
1005 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-19" ></span>
1006 <span class="grey"><a href="./rfc2406">RFC 2406</a> IP Encapsulating Security Payload November 1998</span>
1007
1008
1009 now part of this base ESP specification. For example, the fields
1010 necessary to support authentication (and anti-replay) are now defined
1011 here, even though the provision of this service is an option. The
1012 fields used to support padding for encryption, and for next protocol
1013 identification, are now defined here as well. Packet processing
1014 consistent with the definition of these fields also is included in
1015 the document.
1016
1017 Acknowledgements
1018
1019 Many of the concepts embodied in this specification were derived from
1020 or influenced by the US Government's SP3 security protocol, ISO/IEC's
1021 NLSP, or from the proposed swIPe security protocol. [SDNS89, ISO92,
1022 IB93].
1023
1024 For over 3 years, this document has evolved through multiple versions
1025 and iterations. During this time, many people have contributed
1026 significant ideas and energy to the process and the documents
1027 themselves. The authors would like to thank Karen Seo for providing
1028 extensive help in the review, editing, background research, and
1029 coordination for this version of the specification. The authors
1030 would also like to thank the members of the IPsec and IPng working
1031 groups, with special mention of the efforts of (in alphabetic order):
1032 Steve Bellovin, Steve Deering, Phil Karn, Perry Metzger, David
1033 Mihelcic, Hilarie Orman, Norman Shulman, William Simpson and Nina
1034 Yuan.
1035
1036 References
1037
1038 [<a id="ref-ATK95">ATK95</a>] Atkinson, R., "IP Encapsulating Security Payload (ESP)",
1039 <a href="./rfc1827">RFC 1827</a>, August 1995.
1040
1041 [<a id="ref-Bel96">Bel96</a>] Steven M. Bellovin, "Problem Areas for the IP Security
1042 Protocols", Proceedings of the Sixth Usenix Unix Security
1043 Symposium, July, 1996.
1044
1045 [<a id="ref-Bra97">Bra97</a>] Bradner, S., "Key words for use in RFCs to Indicate
1046 Requirement Level", <a href="https://www.rfc-editor.org/bcp/bcp14">BCP 14</a>, <a href="./rfc2119">RFC 2119</a>, March 1997.
1047
1048 [<a id="ref-HC98">HC98</a>] Harkins, D., and D. Carrel, "The Internet Key Exchange
1049 (IKE)", <a href="./rfc2409">RFC 2409</a>, November 1998.
1050
1051 [<a id="ref-IB93">IB93</a>] John Ioannidis &amp; Matt Blaze, "Architecture and
1052 Implementation of Network-layer Security Under Unix",
1053 Proceedings of the USENIX Security Symposium, Santa Clara,
1054 CA, October 1993.
1055
1056
1057
1058
1059
1060 <span class="grey">Kent &amp; Atkinson Standards Track [Page 19]</span></pre>
1061 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-20" ></span>
1062 <span class="grey"><a href="./rfc2406">RFC 2406</a> IP Encapsulating Security Payload November 1998</span>
1063
1064
1065 [<a id="ref-ISO92">ISO92</a>] ISO/IEC JTC1/SC6, Network Layer Security Protocol, ISO-IEC
1066 DIS 11577, International Standards Organisation, Geneva,
1067 Switzerland, 29 November 1992.
1068
1069 [<a id="ref-KA97a">KA97a</a>] Kent, S., and R. Atkinson, "Security Architecture for the
1070 Internet Protocol", <a href="./rfc2401">RFC 2401</a>, November 1998.
1071
1072 [<a id="ref-KA97b">KA97b</a>] Kent, S., and R. Atkinson, "IP Authentication Header", <a href="./rfc2402">RFC</a>
1073 <a href="./rfc2402">2402</a>, November 1998.
1074
1075 [<a id="ref-MD97">MD97</a>] Madson, C., and N. Doraswamy, "The ESP DES-CBC Cipher
1076 Algorithm With Explicit IV", <a href="./rfc2405">RFC 2405</a>, November 1998.
1077
1078 [<a id="ref-MG97a">MG97a</a>] Madson, C., and R. Glenn, "The Use of HMAC-MD5-96 within
1079 ESP and AH", <a href="./rfc2403">RFC 2403</a>, November 1998.
1080
1081 [<a id="ref-MG97b">MG97b</a>] Madson, C., and R. Glenn, "The Use of HMAC-SHA-1-96 within
1082 ESP and AH", <a href="./rfc2404">RFC 2404</a>, November 1998.
1083
1084 [<a id="ref-STD-2">STD-2</a>] Reynolds, J., and J. Postel, "Assigned Numbers", STD 2, <a href="./rfc1700">RFC</a>
1085 <a href="./rfc1700">1700</a>, October 1994. See also:
1086 <a href="http://www.iana.org/numbers.html">http://www.iana.org/numbers.html</a>
1087
1088 [<a id="ref-SDNS89">SDNS89</a>] SDNS Secure Data Network System, Security Protocol 3, SP3,
1089 Document SDN.301, Revision 1.5, 15 May 1989, as published
1090 in NIST Publication NIST-IR-90-4250, February 1990.
1091
1092 Disclaimer
1093
1094 The views and specification here are those of the authors and are not
1095 necessarily those of their employers. The authors and their
1096 employers specifically disclaim responsibility for any problems
1097 arising from correct or incorrect implementation or use of this
1098 specification.
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116 <span class="grey">Kent &amp; Atkinson Standards Track [Page 20]</span></pre>
1117 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-21" ></span>
1118 <span class="grey"><a href="./rfc2406">RFC 2406</a> IP Encapsulating Security Payload November 1998</span>
1119
1120
1121 Author Information
1122
1123 Stephen Kent
1124 BBN Corporation
1125 70 Fawcett Street
1126 Cambridge, MA 02140
1127 USA
1128
1129 Phone: +1 (617) 873-3988
1130 EMail: [email protected]
1131
1132
1133 Randall Atkinson
1134 @Home Network
1135 425 Broadway,
1136 Redwood City, CA 94063
1137 USA
1138
1139 Phone: +1 (415) 569-5000
1140 EMail: [email protected]
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172 <span class="grey">Kent &amp; Atkinson Standards Track [Page 21]</span></pre>
1173 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-22" ></span>
1174 <span class="grey"><a href="./rfc2406">RFC 2406</a> IP Encapsulating Security Payload November 1998</span>
1175
1176
1177 Full Copyright Statement
1178
1179 Copyright (C) The Internet Society (1998). All Rights Reserved.
1180
1181 This document and translations of it may be copied and furnished to
1182 others, and derivative works that comment on or otherwise explain it
1183 or assist in its implementation may be prepared, copied, published
1184 and distributed, in whole or in part, without restriction of any
1185 kind, provided that the above copyright notice and this paragraph are
1186 included on all such copies and derivative works. However, this
1187 document itself may not be modified in any way, such as by removing
1188 the copyright notice or references to the Internet Society or other
1189 Internet organizations, except as needed for the purpose of
1190 developing Internet standards in which case the procedures for
1191 copyrights defined in the Internet Standards process must be
1192 followed, or as required to translate it into languages other than
1193 English.
1194
1195 The limited permissions granted above are perpetual and will not be
1196 revoked by the Internet Society or its successors or assigns.
1197
1198 This document and the information contained herein is provided on an
1199 "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
1200 TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
1201 BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
1202 HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
1203 MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228 Kent &amp; Atkinson Standards Track [Page 22]
1229 </pre>