home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1997 December / Internet_Info_CD-ROM_Walnut_Creek_December_1997.iso / drafts / draft_ietf_i / draft-ietf-ipsec-new-auth-00.txt < prev    next >
Text File  |  1997-03-28  |  34KB  |  898 lines

  1.  
  2.  
  3.  
  4.  
  5. Network Working Group                             Stephen Kent, BBN Corp
  6. Internet Draft                           Randall Atkinson, @Home Network
  7. draft-ietf-ipsec-new-auth-00.txt                           26 March 1997
  8.  
  9.  
  10.  
  11.  
  12.  
  13.                         IP Authentication Header
  14.  
  15.  
  16.  
  17.  
  18. Status of This Memo
  19.  
  20.    This document is an Internet Draft. Internet Drafts are working
  21.    documents of the Internet Engineering Task Force (IETF), its Areas,
  22.    and its Working Groups. Note that other groups may also distribute
  23.    working documents as Internet Drafts.
  24.  
  25.    Internet Drafts are draft documents valid for a maximum of 6 months.
  26.    Internet Drafts may be updated, replaced, or obsoleted by other
  27.    documents at any time. It is not appropriate to use Internet Drafts
  28.    as reference material or to cite them other than as a "working draft"
  29.    or "work in progress". Please check the I-D abstract listing
  30.    contained in each Internet Draft directory to learn the current
  31.    status of this or any other Internet Draft.
  32.  
  33.    This particular Internet Draft is a product of the IETF's IPng and
  34.    IPsec Working Groups. It is intended that a future version of this
  35.    draft will be submitted for consideration as a standards-track
  36.    document.  Distribution of this document is unlimited.
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60. Kent, Atkinson                                                  [Page 1]
  61.  
  62.  
  63.  
  64. Internet Draft          IP Authentication Header           26 March 1997
  65.  
  66.  
  67. Table of Contents
  68.  
  69.    1. Introduction......................................................3
  70.    2. Authentication Header Format......................................4
  71.       2.1 Next Header...................................................4
  72.       2.2 Payload Length................................................4
  73.       2.3 Reserved......................................................4
  74.       2.4 Security Parameters Index (SPI)...............................5
  75.       2.5 Sequence Number...............................................5
  76.       2.6 Authentication Data ..........................................5
  77.    3. Authentication Header Processing..................................5
  78.       3.1  Authentication Header Location...............................5
  79.       3.2  Outbound Packet Processing...................................8
  80.          3.2.1  Security Association Lookup.............................8
  81.          3.2.2  Sequence Number Field...................................8
  82.          3.2.3  Integrity Check Value Calculation.......................8
  83.             3.2.3.1  Handling Mutable Fields............................8
  84.                3.2.3.1.1  ICV Computation for IPv4......................9
  85.                3.2.3.1.2  ICV Computation for IPv6......................9
  86.             3.2.3.2  Padding...........................................10
  87.                3.2.3.2.1  Authentication Data Padding..................10
  88.                3.2.3.2.2  Implicit Packet Padding......................10
  89.             3.2.3.3  Authentication Algorithms.........................10
  90.          3.2.4  Fragmentation..........................................11
  91.       3.3  Inbound Packet Processing...................................11
  92.          3.3.1  Reassembly.............................................11
  93.          3.3.2  Security Association Lookup............................11
  94.          3.3.3  Sequence Number Verification...........................11
  95.          3.3.4  Integrity Check Value Verification.....................12
  96.    4. Conformance Requirements.........................................13
  97.    5. Security Considerations..........................................13
  98.    Acknowledgements....................................................13
  99.    References..........................................................14
  100.    Disclaimer..........................................................15
  101.    Author Information..................................................15
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117. Kent, Atkinson                                                  [Page 2]
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124. Internet Draft          IP Authentication Header           26 March 1997
  125.  
  126.  
  127. 1. Introduction
  128.  
  129.    The IP Authentication Header (AH) is used to provide connectionless
  130.    integrity and data origin authentication for IP datagrams (hereafter
  131.    referred to as just "authentication"), and to provide protection
  132.    against replays.  This latter, optional service may be selected when
  133.    a Security Association is established.  AH provides authentication
  134.    for as much of the IP header as possible, as well as for upper level
  135.    protocol data.  However, some IP header fields may change in transit
  136.    and the value of these fields, when the packet arrives at the
  137.    receiver, may not be predictable by the transmitter.  The values of
  138.    such fields cannot be protected by AH.  Thus the protection provided
  139.    to the IP header by AH is somewhat piecemeal.
  140.  
  141.    AH may be applied alone, in combination with the IP Encapsulating
  142.    Security Payload (ESP) [KA97b], or in a nested fashion through the
  143.    use of tunnel mode (see below).  Security services can be provided
  144.    between a pair of communicating hosts, between a pair of
  145.    communicating security gateways, or between a security gateway and a
  146.    host.  ESP may be used to provide the same security services, and it
  147.    also provides an optional confidentiality (encryption) service.  The
  148.    primary difference between ESP and AH, when used for authentication,
  149.    is the extent of the coverage.  Specifically, ESP does not protect
  150.    any IP header fields unless those fields are encapsulated by ESP.
  151.    For more details on how to use AH and ESP in various network
  152.    environments, see "Security Architecture for the Internet Protocol"
  153.    [KA97a].
  154.  
  155.    It is assumed that the reader is familiar with the terms and concepts
  156.    described in the document "Security Architecture for the Internet
  157.    Protocol" [KA97a].  In particular, the reader should be familiar with
  158.    the definitions of security services offered by AH (and by ESP), the
  159.    concept of Security Associations, the different key management
  160.    options available for AH (and ESP), and the ways in which AH can be
  161.    used in conjunction with ESP.
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177. Kent, Atkinson                                                  [Page 3]
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184. Internet Draft          IP Authentication Header           26 March 1997
  185.  
  186.  
  187. 2.  Authentication Header Format
  188.  
  189.    +---------------+---------------+---------------+---------------+
  190.    | Next Header(8)| Payload Len(8)|        RESERVED (16)          |
  191.    +---------------+---------------+---------------+---------------+
  192.    |                 Security Parameters Index (32)                |
  193.    +---------------+---------------+---------------+---------------+
  194.    |                   Sequence Number Field (32)                  |
  195.    +---------------+---------------+---------------+---------------+
  196.    |                                                               |
  197.    +     Authentication Data (variable number of 32-bit words)     |
  198.    |                                                               |
  199.    +---------------+---------------+---------------+---------------+
  200.     1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8
  201.  
  202.  
  203.    The following subsections define the fields that comprise the AH
  204.    format.  "Optional" means that the field is omitted if the option is
  205.    not selected, i.e., it is present in neither the packet as
  206.    transmitted nor as formatted for computation of the Integrity Check
  207.    Value (ICV).  Whether or not an option is selected is defined as part
  208.    of the Security Association.  In contrast, "mandatory" fields are
  209.    always present in the AH format.
  210.  
  211. 2.1 Next Header
  212.  
  213.    The Next Header is an 8-bit field that identifies the type of the
  214.    next payload after the Authentication Header.  The value of this
  215.    field is chosen from the set of IP Protocol Numbers defined in the
  216.    most recent "Assigned Numbers" [STD-2] RFC from the Internet Assigned
  217.    Numbers Authority (IANA). The Next Header field is mandatory.
  218.  
  219. 2.2 Payload Length
  220.  
  221.    This 8-bit field specifies the length of AH, in 32-bit words (4-byte
  222.    units), minus "2," i.e., the fixed portion of AH is not counted.  The
  223.    minimum value is 0, which is used only in the degenerate case of a
  224.    "null" authentication algorithm. The Payload Length field is
  225.    mandatory.
  226.  
  227.    *** Do we want to retain a null authentication algorithm as part of the
  228.    *** spec at this point? What purpose does it serve?
  229.  
  230. 2.3 Reserved
  231.  
  232.    This 16-bit field is reserved for future use.  It MUST be set to
  233.    "zero." (Note that the value is included in the Authentication Data
  234.    calculation, but is otherwise ignored by the recipient.)  The
  235.  
  236.  
  237. Kent, Atkinson                                                  [Page 4]
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244. Internet Draft          IP Authentication Header           26 March 1997
  245.  
  246.  
  247.    Reserved field is mandatory.
  248.  
  249. 2.4 Security Parameters Index (SPI)
  250.  
  251.    The SPI is an arbitrary 32-bit value identifying the Security
  252.    Association for this datagram (relative to the destination IP address
  253.    contained in the IP header with which this security header is
  254.    associated).  The set of SPI values in the range 1 through 255 are
  255.    reserved by the Internet Assigned Numbers Authority (IANA) for future
  256.    use; a reserved SPI value will not normally be assigned by IANA
  257.    unless the use of the assigned SPI value is specified in an RFC.  A
  258.    value of zero indicates that no Security Association exists.  The SPI
  259.    field is mandatory.  It is ordinarily selected by the destination
  260.    system upon establishment of an SA (see "Security Architecture for
  261.    the Internet Protocol" [KA97a] for more details).
  262.  
  263.    *** Under what circumstances will a zero SPI be employed?  Is this
  264.    *** still relevant or is it vestigial?
  265.  
  266. 2.5 Sequence Number
  267.  
  268.    This unsigned 32-bit field contains a monotonically increasing
  269.    counter value (sequence number).  The counter is initialized to 1
  270.    when an SA is established.  The sequence number must never be allowed
  271.    to cycle; thus, it MUST be reset (by establishing a new SA and thus a
  272.    new key) prior to the transmission of 2^32-1 packets on an SA.  The
  273.    Sequence Number field is optional.  It is included only if the anti-
  274.    replay service (a form of loose sequence integrity) is selected as a
  275.    security service for the SA.
  276.  
  277. 2.6 Authentication Data
  278.  
  279.    This is a variable-length field that contains the Integrity Check
  280.    Value (ICV) for this packet.  The field must be an integral multiple
  281.    of 32 bits in length.  The details of the ICV computation are
  282.    described in Section 3.2.3 below.  This field may include explicit
  283.    padding.  This padding is included to ensure that the length of the
  284.    AH header is an integral multiple of 32 bits (IPv4) or 64 bits
  285.    (IPv6).  All implementations MUST support such padding.  Details of
  286.    how to compute the required padding length are provided in Section
  287.    3.2.3.2.1 below.  The Authentication Data field is mandatory.
  288.  
  289. 3. Authentication Header Processing
  290.  
  291. 3.1 Authentication Header Location
  292.  
  293.    Like ESP, AH may be employed in two ways: transport mode or tunnel
  294.    mode.  The former mode is applicable only to host implementations and
  295.  
  296.  
  297. Kent, Atkinson                                                  [Page 5]
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304. Internet Draft          IP Authentication Header           26 March 1997
  305.  
  306.  
  307.    provides protection for upper layer protocols, in addition to
  308.    selected IP header fields.  In this mode, AH is inserted after the IP
  309.    header and before an upper layer protocol, e.g., TCP, UDP, ICMP, etc.
  310.    In the context of IPv4, this calls for placing AH after the IP header
  311.    (and any options that it contains), but before the upper layer
  312.    protocol.  (Note that the term "transport" mode should not be
  313.    misconstrued as restricting its use to TCP and UDP. For example, an
  314.    ICMP message MAY be sent using either "transport" mode or "tunnel"
  315.    mode.)  The following diagram illustrates AH transport mode
  316.    positioning for a typical IPv4 packet, on a "before and after" basis.
  317.  
  318.                   BEFORE APPLYING AH
  319.             ----------------------------
  320.       IPv4  |orig IP hdr  |     |      |
  321.             |(any options)| TCP | Data |
  322.             ----------------------------
  323.  
  324.  
  325.                   AFTER APPLYING AH
  326.             ---------------------------------
  327.       IPv4  |orig IP hdr  |    |     |      |
  328.             |(any options)| AH | TCP | Data |
  329.             ---------------------------------
  330.             |<------ authenticated  ------->|
  331.                  except for mutable fields
  332.  
  333.    In the IPv6 context, AH is viewed as an end-to-end payload, and thus
  334.    should appear after hop-by-hop, routing, and fragmentation extension
  335.    headers.  The destination options extension header(s) could appear
  336.    either before or after the AH header depending on the semantics
  337.    desired.  The following diagram illustrates AH transport mode
  338.    positioning for a typical IPv6 packet.
  339.  
  340.  
  341.  
  342.  
  343.  
  344.  
  345.  
  346.  
  347.  
  348.  
  349.  
  350.  
  351.  
  352.  
  353.  
  354.  
  355.  
  356.  
  357. Kent, Atkinson                                                  [Page 6]
  358.  
  359.  
  360.  
  361.  
  362.  
  363.  
  364. Internet Draft          IP Authentication Header           26 March 1997
  365.  
  366.  
  367.                        BEFORE APPLYING AH
  368.             ---------------------------------------
  369.       IPv6  |             | ext hdrs |     |      |
  370.             | orig IP hdr |if present| TCP | Data |
  371.             ---------------------------------------
  372.  
  373.                                AFTER APPLYING AH
  374.             ------------------------------------------------------------
  375.       IPv6  |             |hxh,rtg,frag| dest |    | dest |     |      |
  376.             |orig IP hdr  |if present**| opt* | AH | opt* | TCP | Data |
  377.             ------------------------------------------------------------
  378.             |<-------------------- authenticated --------------------->|
  379.                              except for mutable fields
  380.  
  381.                 * = if present, could be before AH, after AH, or both
  382.                ** = hop by hop, routing, fragmentation headers
  383.  
  384.    Tunnel mode AH may be employed in either hosts or security gateways.
  385.    When AH is implemented in a security gateway (to protect subscriber
  386.    transit traffic), tunnel mode must be used.  In tunnel mode, the
  387.    "inner" IP header carries the ultimate source and destination
  388.    addresses, while an "outer" IP header may contain distinct IP
  389.    addresses, e.g., addresses of security gateways.  In tunnel mode, AH
  390.    protects the entire inner IP packet, including the entire inner IP
  391.    header. The position of AH in tunnel mode, relative to the outer IP
  392.    header, is the same as for AH in transport mode.    The following
  393.    diagram illustrates AH tunnel mode positioning for typical IPv4 and
  394.    IPv6 packets.
  395.  
  396.             ------------------------------------------------
  397.       IPv4  | new IP hdr* |    | orig IP hdr*  |    |      |
  398.             |(any options)| AH | (any options) |TCP | Data |
  399.             ------------------------------------------------
  400.             |<---------------- authenticated ------------->|
  401.                         except for mutable fields
  402.  
  403.             --------------------------------------------------------------
  404.       IPv6  |           | ext hdrs*|    |            | ext hdrs*|   |    |
  405.             |new IP hdr*|if present| AH |orig IP hdr*|if present|TCP|Data|
  406.             --------------------------------------------------------------
  407.             |<---------------------- authenticated --------------------->|
  408.                               except for mutable fields
  409.  
  410.                   * = construction of outer IP hdr/extensions and
  411.                       modification of inner IP hdr/extensions is
  412.                       discussed below.
  413.  
  414.  
  415.  
  416.  
  417. Kent, Atkinson                                                  [Page 7]
  418.  
  419.  
  420.  
  421.  
  422.  
  423.  
  424. Internet Draft          IP Authentication Header           26 March 1997
  425.  
  426.  
  427. 3.2  Outbound Packet Processing
  428.  
  429.    In transport mode, the transmitter inserts the AH header after the IP
  430.    header and before an upper layer protocol header, as described above.
  431.    In tunnel mode, the outer and inner IP header/extensions can be
  432.    inter-related in a variety of ways.  The construction of the outer IP
  433.    header/extensions during the encapsulation process is described in
  434.    the document, "Security Architecture for the Internet Protocol".
  435.  
  436. 3.2.1  Security Association Lookup
  437.  
  438.    AH is applied to an outbound packet only after an IPsec
  439.    implementation determines that the packet is associated with an SA
  440.    that calls for AH processing.  The process of determining what, if
  441.    any, IPsec processing is applied to outbound traffic is described in
  442.    the document, "Security Architecture for the Internet Protocol".
  443.  
  444. 3.2.2  Sequence Number Field
  445.  
  446.    If the anti-replay service has been selected for this SA, the
  447.    transmitter increments the sequence number for this SA, checks to
  448.    ensure that the counter has not cycled, and inserts the new value
  449.    into the Sequence Number Field.  A transmitter MUST not send a packet
  450.    on an SA if doing so would cause the sequence number to cycle.
  451.  
  452. 3.2.3  Integrity Check Value Calculation
  453.  
  454. 3.2.3.1  Handling Mutable Fields
  455.  
  456.    The AH ICV is computed over IP header fields that are either
  457.    immutable in transit or that are predictable in value upon arrival at
  458.    the endpoint for the AH SA.  The ICV also encompasses the upper level
  459.    protocol data, which is assumed to be immutable in transit.  If a
  460.    field is modified during transit, the value of the field is set to
  461.    zero for purposes of the ICV computation.  If a field is mutable, but
  462.    its value at the (IPsec) receiver is predictable, then that value is
  463.    inserted into the field for purposes of the ICV calculation.  The
  464.    Authentication Data field also is set to zero in preparation for this
  465.    computation.  (Note that by replacing each field's value with zero,
  466.    rather than omitting the field, alignment is preserved for the ICV
  467.    calculation.)
  468.  
  469.    DISCUSSION:
  470.  
  471.       For IPv4 (unlike IPv6), there is no mechanism for tagging options
  472.       as mutable in transit.  Hence the IPv4 options are explicitly
  473.       listed here and classified as either mutable or immutable.  For
  474.       IPv4, the entire option is viewed as a unit; so even though the
  475.  
  476.  
  477. Kent, Atkinson                                                  [Page 8]
  478.  
  479.  
  480.  
  481.  
  482.  
  483.  
  484. Internet Draft          IP Authentication Header           26 March 1997
  485.  
  486.  
  487.       type and length fields within most options are immutable in
  488.       transit, if an option is classified as mutable, the entire option
  489.       is zeroed for ICV computation purposes.  The mutable IPv4 header
  490.       fields also are enumerated below.  The ICV calculation is
  491.       restricted to the immutable options and (base) header fields.
  492.  
  493.  
  494. 3.2.3.1.1  ICV Computation for IPv4
  495.  
  496.    The IPv4 base header fields "Time to Live", "Header Checksum",
  497.    "Offset", "Flags", and "Type of Service" are zeroed prior to the
  498.    computation of the ICV.  (The TOS field is included here because some
  499.    routers are known to change the value of this field, even though the
  500.    IP specification does not consider TOS to be a mutable header field.)
  501.  
  502.    *** What about OFFSET and FLAGS.  Since reassembly takes place before
  503.    *** AH processing why are these fields omitted from the ICV
  504.    *** computation?
  505.  
  506.    The following IPv4 options are mutable: record route, timestamp,
  507.    loose source routing, and strict source routing.  These options are
  508.    treated as zero-filled for purposes of the ICV computation.  The IP
  509.    Security Options, BSO and ESO (RFC-1038, RFC-1108) and the CIPSO
  510.    (option number 134) option are included in the ICV calculation and
  511.    are not zeroed.
  512.  
  513. 3.2.3.1.2  ICV Computation for IPv6
  514.  
  515.    In IPv6, the "Hop Limit" field in the IPv6 base header is zeroed
  516.    prior to performing the ICV calculation.  IPv6 options contain a bit
  517.    that indicates whether the option might change during transit.  For
  518.    any option for which contents may change en-route, the entire "Option
  519.    Data" field must be treated as zero-valued octets when computing or
  520.    verifying the ICV.  The Option Type and Opt Data Len are included in
  521.    the ICV calculation.  All other options are also included in the ICV
  522.    calculation.  See the IPv6 specification [DH95] for more information.
  523.  
  524.    Note that the IPv6 Routing Header "Type 0" will rearrange the address
  525.    fields within the packet during transit from source to destination.
  526.    However, the contents of the packet as it will appear at the receiver
  527.    are known to the sender and to all intermediate hops.  Hence, the
  528.    IPv6 Routing Header "Type 0" is included in the Authentication Data
  529.    calculation as an immutable option.  The transmitter must order the
  530.    field so that it appears as it will at the receiver, prior to
  531.    performing the ICV computation.
  532.  
  533.    *** Do we want to make any recommendation for what an AH implementation
  534.    *** should do if it encounters an unfamiliar IPv6 extension header,
  535.  
  536.  
  537. Kent, Atkinson                                                  [Page 9]
  538.  
  539.  
  540.  
  541.  
  542.  
  543.  
  544. Internet Draft          IP Authentication Header           26 March 1997
  545.  
  546.  
  547.    *** e.g., Routing Header "Type 1" (aka Nimrod)?
  548.  
  549. 3.2.3.2  Padding
  550.  
  551. 3.2.3.2.1  Authentication Data Padding
  552.  
  553.    As mentioned in section 2.6, the Authentication Data field explicitly
  554.    includes padding to ensure that the AH header is a multiple of 32
  555.    bits (IPv4) or 64 bits (IPv6).  If padding is required, its length is
  556.    determined by three factors:
  557.              - the presence or absence of the Sequence Number field
  558.              - the length of the ICV
  559.              - the IP protocol context (v4 or v6)
  560.  
  561.    For example, if the Sequence Number field is present and a default,
  562.    96-bit truncated HMAC algorithm is selected, no padding is required
  563.    for either IPv4 nor IPv6.  In contrast, if the anti-replay service is
  564.    not selected, and a default 96-bit truncated HMAC algorithm is
  565.    selected, no padding is required for IPv4, but 4 bytes of padding are
  566.    required for IPv6.  The content of the padding field is arbitrarily
  567.    selected by the sender.  (The padding is arbitrary, but need not be
  568.    random to achieve security.)  These bytes are included in the
  569.    Authentication Data calculation, counted as part of the Payload
  570.    Length, and transmitted at the end of the Authentication Data field
  571.    to enable the receiver to perform the ICV calculation.
  572.  
  573. 3.2.3.2.2 Implicit Packet Padding
  574.  
  575.    For some authentication algorithms, the byte string over which the
  576.    ICV computation is performed must be a multiple of a blocksize
  577.    specified by the algorithm.  If the IP packet length (including AH)
  578.    does not match the blocksize requirements for the algorithm, implicit
  579.    padding MUST be appended to the end of the packet, prior to ICV
  580.    computation.  The padding octets MUST have a value of zero.  The
  581.    blocksize (and hence the length of the padding) is specified by the
  582.    algorithm specification.  This padding is not transmitted with the
  583.    packet.
  584.  
  585. 3.2.3.3  Authentication Algorithms
  586.  
  587.    The authentication algorithm employed for the ICV computation is
  588.    specified by the SA.  For point-to-point communication, suitable
  589.    authentication algorithms include keyed Message Authentication Codes
  590.    (MACs) based on symmetric encryption algorithms (e.g., DES) or on
  591.    one-way hash functions (e.g., MD5 or SHA-1).  For multicast
  592.    communication, one-way hash algorithms combined with asymmetric
  593.    signature algorithms are suitable.  As of this writing, the
  594.    mandatory-to-implement authentication algorithms are based on the
  595.  
  596.  
  597. Kent, Atkinson                                                 [Page 10]
  598.  
  599.  
  600.  
  601.  
  602.  
  603.  
  604. Internet Draft          IP Authentication Header           26 March 1997
  605.  
  606.  
  607.    former class, i.e.,  HMAC [KBC97] with SHA-1 [SHA] or HMAC with MD5
  608.    [Riv92].  The output of the HMAC computation is truncated to (the
  609.    leftmost) 96 bits.  Other algorithms, possibly with different ICV
  610.    lengths, MAY be supported.
  611.  
  612. 3.2.4  Fragmentation
  613.  
  614.    If required, IP fragmentation occurs after AH processing within an
  615.    IPsec implementation.  However, an IP packet to which AH has been
  616.    applied may itself be fragmented by routers en route, including
  617.    security gateways that may apply AH or ESP (tunnel mode) to the
  618.    already-protected packet or fragments.
  619.  
  620. 3.3  Inbound Packet Processing
  621.  
  622. 3.3.1  Reassembly
  623.  
  624.    If required, reassembly is performed prior to AH processing.
  625.  
  626. 3.3.2  Security Association Lookup
  627.  
  628.    Upon receipt of a packet containing an IP Authentication Header, the
  629.    receiver determines the appropriate (unidirectional) SA, based on the
  630.    destination IP address and the SPI.  (This process is described in
  631.    more detail in the document, "Security Architecture for the Internet
  632.    Protocol".)  The SA will indicate whether the Sequence Number field
  633.    should be present, will specify the algorithm(s) employed for ICV
  634.    computation, and will indicate the key(s) required to validate the
  635.    ICV.
  636.  
  637.    If no valid Security Association exists for this session (e.g., the
  638.    receiver has no key), the receiver MUST discard the packet and the
  639.    failure MUST be recorded in an audit log.  The log entry SHOULD
  640.    include the SPI value, date/time, Source Address, Destination
  641.    Address, and (in IPv6) the Flow ID.  The log entry MAY also include
  642.    other identifying data.  There is no requirement for the receiver to
  643.    transmit any message to the purported transmitter in response to
  644.    receipt of such packets (because of the potential to induce denial of
  645.    service via such actions).
  646.  
  647. 3.3.3  Sequence Number Verification
  648.  
  649.    If the anti-replay service has been selected for this SA, the
  650.    receiver MUST verify that the packet contains a Sequence Number that
  651.    does not duplicate the Sequence Number of any other packets received
  652.    during the life of this SA.  This SHOULD be the first AH check
  653.    applied to a packet after it has been matched to an SA, to speed
  654.    rejection of duplicate packets.
  655.  
  656.  
  657. Kent, Atkinson                                                 [Page 11]
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664. Internet Draft          IP Authentication Header           26 March 1997
  665.  
  666.  
  667.    Duplicates are rejected through the use of a sliding receive window.
  668.    (How the window is implemented is a local matter, but the following
  669.    text describes the functionality that the implementation must
  670.    exhibit.)  The default window size is 32 and all AH implementations
  671.    MUST support this window size.  A larger window size MAY be
  672.    established during SA negotiation.  If a larger window size is
  673.    negotiated it MUST be a multiple of 32.
  674.  
  675.    The "right" edge of the window represents the highest, validated
  676.    Sequence Number value received on this SA.  Packets that contain
  677.    Sequence Number values lower than the "left" edge of the window are
  678.    rejected.  Packets falling within the window are checked against a
  679.    list of received packets within the window.  An efficient means for
  680.    performing this check, based on the use of a bit mask, is described
  681.    in [KA97a].
  682.  
  683.    If the received packet falls within the window, then the receiver
  684.    proceeds to ICV verification.  If the ICV validation fails, the
  685.    receiver MUST discard the received IP datagram as invalid and MUST
  686.    record the authentication failure in an audit log.  If such a failure
  687.    occurs, the log entry MUST include the SPI value, date/time received,
  688.    Sending Address, Destination Address, and (in IPv6) Flow ID.  The log
  689.    data MAY also include other information about the failed packet.  The
  690.    window is updated only if the ICV verification succeeds.
  691.  
  692.    DISCUSSION:
  693.  
  694.       Note that if the packet is either inside the window and new, or
  695.       outside the window on the "right" side, the receiver MUST
  696.       authenticate the Sequence Number field before updating the bit
  697.       mask (either turning on a bit or updating the "right" side of the
  698.       window).
  699.  
  700. 3.3.4  Integrity Check Value Verification
  701.  
  702.    The receiver computes the ICV over the appropriate fields of the
  703.    packet, using the specified authentication algorithm, and verifies
  704.    that it is the same as the ICV included in the Authentication Data
  705.    field of the packet.  Details of the computation are provided below.
  706.  
  707.    If the computed and received ICV's match, then the datagram is valid,
  708.    and it is accepted.  If the test fails, then the receiver MUST
  709.    discard the received IP datagram as invalid and MUST record the
  710.    authentication failure in an audit log. The log data MUST include the
  711.    SPI value, date/time received, Source Address, Destination Address,
  712.    and (in IPv6) the Flow ID.  The log data also MAY include other
  713.    information about the failed packet.
  714.  
  715.  
  716.  
  717. Kent, Atkinson                                                 [Page 12]
  718.  
  719.  
  720.  
  721.  
  722.  
  723.  
  724. Internet Draft          IP Authentication Header           26 March 1997
  725.  
  726.  
  727.    DISCUSSION:
  728.  
  729.       Begin by saving the ICV value and replacing it (but not any
  730.       Authentication Data padding) with zero.  Zero all other fields
  731.       that may have been modified during transit.  (See section 3.2.3.1
  732.       for a discussion of which fields are zeroed before performing the
  733.       ICV calculation.)  Check the overall length of the packet, and if
  734.       it requires implicit padding based on the requirements of the
  735.       authentication algorithm, append zero-filled bytes to the end of
  736.       the packet as required.  Now perform the ICV computation and
  737.       compare the result with the received value.  (If a digital
  738.       signature and one-way hash are used for the ICV computation, the
  739.       matching process is more complex and will be described in the
  740.       algorithm specification.)
  741.  
  742.  
  743. 4. Conformance Requirements
  744.  
  745.    Implementations that claim conformance or compliance with this
  746.    specification MUST fully implement the AH syntax and processing
  747.    described here and MUST comply with all requirements of the "Security
  748.    Architecture for the Internet Protocol."  Note that support for
  749.    manual key distribution is required, but its use is inconsistent with
  750.    the anti-replay service, and thus a compliant implementation must not
  751.    negotiate this service in conjunction with SAs that are manually
  752.    keyed.  A compliant AH implementation MUST support the following
  753.    mandatory-to-implement algorithms (specified in [KBC97]):
  754.  
  755.     - HMAC with MD5
  756.     - HMAC with SHA-1
  757.  
  758. 5. Security Considerations
  759.  
  760.    Security is central to the design of this protocol, and this security
  761.    considerations permeate the specification.  Additional security-
  762.    relevant aspects of using IPsec protocol are discussed in the
  763.    document, "Security Architecture for the Internet Protocol".
  764.  
  765.  
  766. Acknowledgements
  767.  
  768.    For over 2 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 the members of the IPsec
  772.    and IPng working groups, with special mention of the efforts of (in
  773.    alphabetic order): Steve Bellovin, Steve Deering, Francis Dupont,
  774.    Phil Karn, Frank Kastenholz, Perry Metzger, David Mihelcic, Hilarie
  775.  
  776.  
  777. Kent, Atkinson                                                 [Page 13]
  778.  
  779.  
  780.  
  781.  
  782.  
  783.  
  784. Internet Draft          IP Authentication Header           26 March 1997
  785.  
  786.  
  787.    Orman, and William Simpson.  In addition, Charlie Lynn, Karen Seo,
  788.    and Nina Yuan provided extensive help in the review and editing of
  789.    this version of the specification.
  790.  
  791.  
  792. References
  793.  
  794.    [BCCH94] R. Braden, D. Clark, S. Crocker, & C.Huitema, "Report of IAB
  795.              Workshop on Security in the Internet Architecture", RFC-
  796.              1636, 9 June 1994, pp. 21-34.
  797.  
  798.    [Bel89]   Steven M. Bellovin, "Security Problems in the TCP/IP
  799.              Protocol Suite", ACM Computer Communications Review, Vol.
  800.              19, No. 2, March 1989.
  801.  
  802.    [CER95]   Computer Emergency Response Team (CERT), "IP Spoofing
  803.              Attacks and Hijacked Terminal Connections", CA-95:01,
  804.              January 1995. Available via anonymous ftp from
  805.              info.cert.org in /pub/cert_advisories.
  806.  
  807.    [DH95]    Steve Deering & Bob Hinden, "Internet Protocol version 6
  808.              (IPv6) Specification", RFC-1883, December 1995.
  809.  
  810.    [GM93]    James Galvin & Keith McCloghrie, Security Protocols for
  811.              version 2 of the Simple Network Management Protocol
  812.              (SNMPv2), RFC-1446, April 1993.
  813.  
  814.    [KBC97]   Hugo Krawczyk, Mihir Bellare, and Ran Canetti, "HMAC:
  815.              Keyed-Hashing for Message Authentication", RFC-2104,
  816.              February 1997.
  817.  
  818.    [Ken91]   Steve Kent, "US DoD Security Options for the Internet
  819.              Protocol", RFC-1108, November 1991.
  820.  
  821.    [KA96a]   Steve Kent, Randall Atkinson, "Security Architecture for
  822.              the Internet Protocol", Internet Draft, ?? 1997.
  823.  
  824.    [KA96b]   Steve Kent, Randall Atkinson, "IP Encapsulating Security
  825.              Payload (ESP)", Internet Draft, March 1997.
  826.  
  827.    [KA96c]   Steve Kent, Randall Atkinson, "IP Authentication Header",
  828.              Internet Draft, March 1997.
  829.  
  830.    [Riv92]   Ronald Rivest, MD5 Digest Algorithm, RFC-1321, April 1992.
  831.  
  832.    [SHA]     NIST, FIPS PUB 180-1: Secure Hash Standard, April 1995
  833.  
  834.    [STD-1]   J. Postel, "Internet Official Protocol Standards", STD-1,
  835.  
  836.  
  837. Kent, Atkinson                                                 [Page 14]
  838.  
  839.  
  840.  
  841.  
  842.  
  843.  
  844. Internet Draft          IP Authentication Header           26 March 1997
  845.  
  846.  
  847.              March 1996.
  848.  
  849.    [STD-2]   J. Reynolds & J. Postel, "Assigned Numbers", STD-2, 20
  850.              October 1994.
  851.  
  852.  
  853. Disclaimer
  854.  
  855.    The views and specification here are those of the authors and are not
  856.    necessarily those of their employers.  The authors and their
  857.    employers specifically disclaim responsibility for any problems
  858.    arising from correct or incorrect implementation or use of this
  859.    specification.
  860.  
  861.  
  862.  
  863. Author Information
  864.  
  865.    Stephen Kent
  866.    BBN Corporation
  867.    70 Fawcett Street
  868.    Cambridge, MA  02140
  869.    USA
  870.    Telephone: +1 (617) 873-3988
  871.  
  872.    Randall Atkinson <rja@inet.org>
  873.    @Home Network
  874.    385 Ravendale Drive
  875.    Mountain View, CA 94043
  876.    USA
  877.  
  878.  
  879.  
  880.  
  881.  
  882.  
  883.  
  884.  
  885.  
  886.  
  887.  
  888.  
  889.  
  890.  
  891.  
  892.  
  893.  
  894.  
  895.  
  896.  
  897. Kent, Atkinson                                                 [Page 15]
  898.