<?xml version="1.0" encoding="US-ASCII"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
<?rfc toc="yes"?>
<?rfc tocompact="yes"?>
<?rfc tocdepth="3"?>
<?rfc tocindent="yes"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes"?>
<?rfc comments="yes"?>
<?rfc inline="yes"?>
<?rfc compact="yes"?>
<?rfc subcompact="no"?>
<rfc category="std" docName="draft-ietf-lisp-sec-26" ipr="trust200902">
  <front>
    <title abbrev="LISP-SEC">LISP-Security (LISP-SEC)</title>

    <author fullname="Fabio Maino" initials="F.M" surname="Maino">
      <organization>Cisco Systems</organization>

      <address>
        <postal>
          <street>170 Tasman Drive</street>

          <city>San Jose</city>

          <code>95134</code>

          <region>California</region>

          <country>USA</country>
        </postal>

        <email>fmaino@cisco.com</email>
      </address>
    </author>

    <author fullname="Vina Ermagan" initials="V.E" surname="Ermagan">
      <organization>Google</organization>

      <address>
        <postal>
          <street/>

          <city/>

          <code/>

          <region>California</region>

          <country>USA</country>
        </postal>

        <email>ermagan@gmail.com</email>
      </address>
    </author>

    <author fullname="Albert Cabellos" initials="A.C" surname="Cabellos">
      <organization>Universitat Politecnica de Catalunya</organization>

      <address>
        <postal>
          <street>c/ Jordi Girona s/n</street>

          <city>Barcelona</city>

          <code>08034</code>

          <region/>

          <country>Spain</country>
        </postal>

        <email>acabello@ac.upc.edu</email>
      </address>
    </author>

    <author fullname="Damien Saucez" initials="D.S" surname="Saucez">
      <organization>Inria</organization>

      <address>
        <postal>
          <street>2004 route des Lucioles - BP 93</street>

          <city>Sophia Antipolis</city>

          <code/>

          <region/>

          <country>France</country>
        </postal>

        <email>damien.saucez@inria.fr</email>
      </address>
    </author>

    <date />

    <area>Internet</area>

    <workgroup>Network Working Group</workgroup>

    <keyword>LISP; deployment</keyword>

    <abstract>
      <t>This memo specifies LISP-SEC, a set of security mechanisms that
      provides origin authentication, integrity and anti-replay protection to
      LISP's EID-to-RLOC mapping data conveyed via the mapping lookup process.
      LISP-SEC also enables verification of authorization on EID-prefix claims
      in Map-Reply messages.</t>
    </abstract>
  </front>

  <middle>
    <section anchor="intro" title="Introduction">
      <t>The Locator/ID Separation Protocol <xref
      target="I-D.ietf-lisp-rfc6830bis"/>,<xref
      target="I-D.ietf-lisp-rfc6833bis"/> is a network-layer-based protocol
      that enables separation of IP addresses into two new numbering spaces:
      Endpoint Identifiers (EIDs) and Routing Locators (RLOCs). EID-to-RLOC
      mappings are stored in a database, the LISP Mapping System, and made
      available via the Map-Request/Map-Reply lookup process. If these
      EID-to-RLOC mappings, carried through Map-Reply messages, are
      transmitted without integrity protection, an adversary can manipulate
      them and hijack the communication, impersonate the requested EID, or
      mount Denial of Service or Distributed Denial of Service attacks. Also,
      if the Map-Reply message is transported unauthenticated, an adversarial
      LISP entity can overclaim an EID-prefix and maliciously redirect traffic
      directed to a large number of hosts. The LISP-SEC threat model,
      described in <xref target="threat-model"/>, is built on top of the LISP
      threat model defined in <xref target="RFC7835"/>, that includes a
      detailed description of "overclaiming" attack.</t>

      <t>This memo specifies LISP-SEC, a set of security mechanisms that
      provides origin authentication, integrity and anti-replay protection to
      LISP's EID-to-RLOC mapping data conveyed via mapping lookup process.
      LISP-SEC also enables verification of authorization on EID-prefix claims
      in Map-Reply messages, ensuring that the sender of a Map-Reply that
      provides the location for a given EID-prefix is entitled to do so
      according to the EID prefix registered in the associated Map-Server.
      Map-Register/Map-Notify security, including the right for a LISP entity
      to register an EID-prefix or to claim presence at an RLOC, is out of the
      scope of LISP-SEC as those protocols are protected by the security
      mechanisms specified in <xref target="I-D.ietf-lisp-rfc6833bis"/>.
      However, LISP-SEC extends the Map-Register message to allow an ITR to
      downgrade to non LISP-SEC Map-Requests. Additional security
      considerations are described in Section 6.</t>
    </section>

  <section title="Requirements Notation">
    <t>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
    "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
    "OPTIONAL" in this document are to be interpreted as described in  BCP 14
    <xref target="RFC2119"/> <xref target="RFC8174"/> when, and only when, they
    appear in all capitals, as shown here.
    </t>
  </section> <!-- Requirements Notation -->

    <section anchor="terms" title="Definition of Terms">
      <t><list style="empty">
          <t>One-Time Key (OTK): An ephemeral randomly generated key that must
          be used for a single Map-Request/Map-Reply exchange.</t>

          <t>ITR One-Time Key (ITR-OTK): The One-Time Key generated at the
          Ingress Tunnel Router (ITR).</t>

          <t>MS One-Time Key (MS-OTK): The One-Time Key generated at the
          Map-Server.</t>

          <t>Authentication Data (AD): Metadata that is included either in a
          LISP Encapsulated Control Message (ECM) header, as defined in <xref
          target="I-D.ietf-lisp-rfc6833bis"/>, or in a Map-Reply message to
          support confidentiality, integrity protection, and verification of
          EID-prefix authorization.</t>

          <t>OTK Authentication Data (OTK-AD): The portion of ECM
          Authentication Data that contains a One-Time Key.</t>

          <t>EID Authentication Data (EID-AD): The portion of ECM and
          Map-Reply Authentication Data used for verification of EID-prefix
          authorization.</t>

          <t>Packet Authentication Data (PKT-AD): The portion of Map-Reply
          Authentication Data used to protect the integrity of the Map-Reply
          message.</t>

          <t/>
        </list>For definitions of other terms, notably Map-Request, Map-Reply,
      Ingress Tunnel Router (ITR), Egress Tunnel Router (ETR), Map-Server
      (MS), and Map-Resolver (MR) please consult the LISP specification <xref
      target="I-D.ietf-lisp-rfc6833bis"/>.</t>
    </section>

    <section anchor="threat-model" title="LISP-SEC Threat Model">
      <t>LISP-SEC addresses the control plane threats, described in section
      3.7 and 3.8 of <xref target="RFC7835"/>, that target EID-to-RLOC
      mappings, including manipulations of Map-Request and Map-Reply messages,
      and malicious ETR EID prefix overclaiming. LISP-SEC makes two main
      assumptions: (1) the LISP mapping system is expected to deliver a
      Map-Request message to their intended destination ETR as identified by
      the EID, and (2) no on-path attack can be mounted
      within the LISP Mapping System. How the Mapping System is protected from
      on-path attacks depends from the particular Mapping System used, and is
      out of the scope of this memo. Furthermore, while LISP-SEC enables
      detection of EID prefix overclaiming attacks, it assumes that
      Map-Servers can verify the EID prefix authorization at registration time.
      </t>

      <t>According to the threat model described in <xref target="RFC7835"/>
      LISP-SEC assumes that any kind of attack, including on-path attacks, can be
      mounted outside of the boundaries of the LISP mapping system. An on-path
      attacker, outside of the LISP mapping system can, for example, hijack
      Map-Request and Map-Reply messages, spoofing the identity of a LISP
      node. Another example of on-path attack, called overclaiming attack, can
      be mounted by a malicious Egress Tunnel Router (ETR), by overclaiming
      the EID-prefixes for which it is authoritative. In this way the ETR can
      maliciously redirect traffic directed to a large number of hosts.</t>
    </section>

    <section anchor="operations" title="Protocol Operations">
      <t>The goal of the security mechanisms defined in <xref
      target="I-D.ietf-lisp-rfc6833bis"/> is to prevent unauthorized insertion
      of mapping data by providing origin authentication and integrity
      protection for the Map-Register, and by using the nonce to detect
      unsolicited Map-Reply sent by off-path attackers.</t>

      <t>LISP-SEC builds on top of the security mechanisms defined in <xref
      target="I-D.ietf-lisp-rfc6833bis"/> to address the threats described in
      <xref target="threat-model"/> by leveraging the trust relationships
      existing among the LISP entities participating in the exchange of the
      Map-Request/Map-Reply messages. Those trust relationships are used to
      securely distribute, as described in <xref target="wrap"/>, a
      per-message One-Time Key (OTK) that provides origin authentication,
      integrity and anti-replay protection to mapping data conveyed via the
      mapping lookup process, and that effectively prevent overclaiming
      attacks. The processing of security parameters during the
      Map-Request/Map-Reply exchange is as follows:</t>

      <t><list style="symbols">
          <t>Per each Map-Request message a new ITR-OTK is generated and
          stored at the ITR, and securely transported to the Map-Server.</t>

          <t>The Map-Server uses the ITR-OTK to compute a Keyed-Hashing for
          Message Authentication (HMAC) <xref target="RFC2104"/> that protects
          the integrity of the mapping data known to the Map-Server to prevent
          overclaiming attacks. The Map-Server also derives a new OTK, the
          MS-OTK, that is passed to the ETR, by applying a Key Derivation
          Function (KDF) (e.g. <xref target="RFC5869"/>) to the ITR-OTK.</t>

          <t>The ETR uses the MS-OTK to compute an HMAC that protects the
          integrity of the Map-Reply sent to the ITR.</t>

          <t>Finally, the ITR uses the stored ITR-OTK to verify the integrity
          of the mapping data provided by both the Map-Server and the ETR, and
          to verify that no overclaiming attacks were mounted along the path
          between the Map-Server and the ITR.</t>
        </list></t>

      <t><xref target="encap"/> provides the detailed description of the
      LISP-SEC control messages and their processing, while the rest of this
      section describes the flow of LISP protocol operations at each entity
      involved in the Map-Request/Map-Reply exchange:</t>

      <t><list style="numbers">
          <t>The ITR, upon needing to transmit a Map-Request message,
          generates and stores an OTK (ITR-OTK). This ITR-OTK is included into
          the Encapsulated Control Message (ECM) that contains the Map-Request
          sent to the Map-Resolver. <!-- ITR-OTK confidentiality and integrity
          protection MUST be provided in the path between the ITR and the
          Map-Resolver. This can be achieved either by encrypting the ITR-OTK
          with the pre-shared secret known to the ITR and the Map-Resolver (as
          specified in <xref target="encryption"/>), or by enabling DTLS
          between the ITR and the Map-Resolver.--></t>

          <t>The Map-Resolver decapsulates the ECM message, decrypts the
          ITR-OTK, if needed, and forwards through the Mapping System the
          received Map-Request and the ITR-OTK, as part of a new ECM message.
          The LISP Mapping System delivers the ECM to the appropriate
          Map-Server, as identified by the EID destination address of the
          Map-Request. <!-- As mentioned in <xref target="threat-model"/>, how the
          Mapping System is protected from MITM attacks depends from the
          particular Mapping Systems used, and is out of the scope of this
          memo.--></t>

          <t>The Map-Server is configured with the location mappings and
          policy information for the ETR responsible for the EID destination
          address. Using this preconfigured information, the Map-Server, after
          the decapsulation of the ECM message, finds the longest match
          EID-prefix that covers the requested EID in the received
          Map-Request. The Map-Server adds this EID-prefix, together with an
          HMAC computed using the ITR-OTK, to a new Encapsulated Control
          Message that contains the received Map-Request.</t>

          <t>The Map-Server derives a new OTK, the MS-OTK, by applying a Key
          Derivation Function (KDF) to the ITR-OTK. This MS-OTK is included in
          the Encapsulated Control Message that the Map-Server uses to forward
          the Map-Request to the ETR. <!-- MS-OTK confidentiality and integrity
          protection MUST be provided in the path between the Map-Server and
          the ETR. This can be achieved either by encrypting the MS-OTK with
          the pre-shared secret known to the Map-Server and the ETR (as
          specified in <xref target="encryption"/>), or by enabling DTLS
          between the Map-Server and the ETR.--></t>

          <t>If the Map-Server is acting in proxy mode, as specified in <xref
          target="I-D.ietf-lisp-rfc6833bis"/>, the ETR is not involved in the
          generation of the Map-Reply and steps 6 and 7 are skipped. In this
          case the Map-Server generates the Map-Reply on behalf of the ETR as
          described in <xref target="proxy"/>.</t>

          <t>The ETR, upon receiving the ECM encapsulated Map-Request from the
          Map-Server, decrypts the MS-OTK, if needed, and originates a
          Map-Reply that contains the EID-to-RLOC mapping information as
          specified in <xref target="I-D.ietf-lisp-rfc6833bis"/>.</t>

          <t>The ETR computes an HMAC over the Map-Reply, keyed with MS-OTK to
          protect the integrity of the whole Map-Reply. The ETR also copies
          the EID-prefix authorization data that the Map-Server included in
          the ECM encapsulated Map-Request into the Map-Reply message. The ETR
          then sends the complete Map-Reply message to the requesting ITR.</t>

          <t>The ITR, upon receiving the Map-Reply, uses the locally stored
          ITR-OTK to verify the integrity of the EID-prefix authorization data
          included in the Map-Reply by the Map-Server. The ITR computes the
          MS-OTK by applying the same KDF (as specified in the ECM
          encapsulated Map-Reply) used by the Map-Server, and verifies the
          integrity of the Map-Reply. <!--If the integrity checks fail, the
          Map-Reply MUST be discarded. Also, if the EID-prefixes claimed by
          the ETR in the Map-Reply are not equal or more specific than the
          EID-prefix authorization data inserted by the Map-Server, the ITR
          MUST discard the Map-Reply.--></t>
        </list></t>
    </section>

    <section anchor="encap" title="LISP-SEC Control Messages Details">
      <t>LISP-SEC metadata associated with a Map-Request is transported within
      the Encapsulated Control Message that contains the Map-Request.</t>

      <t>LISP-SEC metadata associated with the Map-Reply is transported within
      the Map-Reply itself.</t>

      <t>These specifications use Keyed-Hashing for Message Authentication (HMAC) in various places (as described in the following). The HMAC function AUTH-HMAC-SHA-1-96 <xref target="RFC2104"/> MUST be supported in LISP-SEC implementations. <!-- The HMAC function AUTH-HMAC-SHA-256-128 <xref target="RFC6234"/> is RECOMMENDED to be implemented and used, unless AUTH-HMAC-SHA-1-96 is considered sufficient.--></t>

      <section anchor="ECM_extensions"
               title="Encapsulated Control Message LISP-SEC Extensions">
        <t>LISP-SEC uses the ECM defined in <xref
        target="I-D.ietf-lisp-rfc6833bis"/> with S bit set to 1 to indicate
        that the LISP header includes Authentication Data (AD). The format of
        the LISP-SEC ECM Authentication Data is defined in <xref
        target="fig-AD"/> . OTK-AD stands for One-Time Key Authentication Data
        and EID-AD stands for EID Authentication Data.</t>

        <figure align="center" anchor="fig-AD"
                title="LISP-SEC ECM Authentication Data">
          <artwork align="center"><![CDATA[
 0                   1                   2                   3
 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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|  ECM AD Type  |   Unassigned  |        Requested HMAC ID      |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\
|              OTK Length       |     Key ID    | OTK Wrap. ID  | |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
|                       One-Time-Key Preamble ...               | |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+OTK-AD
|                   ... One-Time-Key Preamble                   | |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
~                      One-Time Key (128 bits)                  ~/
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ <---+
|           EID-AD Length       |           KDF ID              |     |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+     |
| Record Count  |E| Unassigned  |         EID HMAC ID           |EID-AD
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\    |
|  Unassigned   | EID mask-len  |           EID-AFI             | |   |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Rec |
~                          EID-prefix ...                       ~ |   |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+/    |
~                            EID HMAC                           ~     |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ <---+
          ]]></artwork>
        </figure>

        <t><list style="empty">
            <t>ECM AD Type: 1 (LISP-SEC Authentication Data). See <xref
            target="IANA"/>.</t>

            <t>Unassigned: Set to 0 on transmission and ignored on
            receipt.</t>

            <t>Requested HMAC ID: The HMAC algorithm, that will be used to
            protect the mappings, requested by the ITR. See <xref
            target="itr"/> for details, and <xref target="HMAC"/> for HMAC IDs.
            <!--that MUST be supported.--></t>

            <t>OTK Length: The length (in bytes) of the OTK Authentication
            Data (OTK-AD), that contains the OTK Preamble and the OTK.</t>

            <t>Key ID: The identifier of the pre-shared secret shared by an
            ITR and the Map-Resolver, and by the Map-Server and an ETR.
            Per-message keys are derived from the pre-shared secret to
            encrypt, authenticate the origin and protect the integrity of the
            OTK. The Key ID allows to rotate between multiple pre-shared
            secrets in a non disruptive way.</t>

            <t>OTK Wrapping ID (OTK Wrap. ID): The identifier of the key derivation function
            and of the key wrapping algorithm used to encrypt the
            One-Time-Key. See <xref target="encryption"/> for more details,
            and <xref target="wrap"/> for Wrapping IDs. <!-- that MUST be
            supported.--> </t>

            <t>One-Time-Key Preamble: set to 0 if the OTK is not encrypted.
            When the OTK is encrypted, this field MAY carry additional
            metadata resulting from the key wrapping operation. When a 128-bit
            OTK is sent unencrypted by a Map-Resolver, the OTK Preamble is set
            to 0x0000000000000000 (64 bits). See <xref target="null"/> for
            details.</t>

            <t>One-Time-Key: the OTK wrapped as specified by OTK Wrapping ID.
            See <xref target="encryption"/> for details.</t>

            <t>EID-AD Length: length (in bytes) of the EID Authentication Data
            (EID-AD). The ITR MUST set the EID-AD Length to 4 bytes, as it only
            fills the KDF ID field, and all the remaining fields part of the
            EID-AD are not present. An EID-AD MAY contain multiple
            EID-records. Each EID-record is 4-byte long plus the length of the
            AFI-encoded EID-prefix.</t>

            <t>KDF ID: Identifier of the Key Derivation Function used to
            derive the MS-OTK. <!-- The ITR MAY use this field to indicate the
            recommended KDF algorithm, according to local policy. The
            Map-Server can overwrite the KDF ID if it does not support the KDF
            ID recommended by the ITR.--> Refer to <xref target="map-server"/> for more details. <!-- See Section 5.4 for more details, and
            <xref target="kdf"/> for KDF IDs that MUST be supported. --></t>

            <t>Record Count: As defined in Section 5.2 of <xref
            target="I-D.ietf-lisp-rfc6833bis"/>. <!-- The number of records in this Map-Request
            message. A record is comprised of the portion of the packet that
            is labeled 'Rec' above and occurs the number of times equal to
            Record Count.--></t>

            <t>E: ETR-Cant-Sign bit. This bit is set to 1 to signal to the ITR
            that at least one of the ETRs authoritative for the EID prefixes
            of this Map-Reply has not enabled LISP-SEC. Only a Map-Server can set this bit. See <xref
            target="map-server"/> for more details.</t>

            <t>Unassigned: Set to 0 on transmission and ignored on
            receipt.</t>

            <t>EID HMAC ID: Identifier of the HMAC algorithm used to protect
            the integrity of the EID-AD. This field is filled by the Map-Server
            that computed the EID-prefix HMAC. See <xref target="EID-AD"/> for more details. <!--, and <xref target="HMAC"/> for HMAC IDs that MUST be
            supported.--></t>

            <t>EID mask-len: As defined in Section 5.2 of <xref
            target="I-D.ietf-lisp-rfc6833bis"/>.</t>

            <t>EID-AFI: As defined in Section 5.2 of <xref
            target="I-D.ietf-lisp-rfc6833bis"/>.</t>

            <t>EID-prefix: As defined in Section 5.2 of <xref
            target="I-D.ietf-lisp-rfc6833bis"/>.</t>

            <t>EID HMAC: HMAC of the EID-AD computed and inserted by a
            Map-Server See <xref target="EID-AD"/> for more details. <!--Before computing the HMAC operation the EID HMAC field
            MUST be set to 0. The HMAC MUST cover the entire EID-AD. -->
            </t>
          </list></t>
      </section>

      <section anchor="MR_extensions" title="Map-Reply LISP-SEC Extensions">
        <t>LISP-SEC uses the Map-Reply defined in <xref
        target="I-D.ietf-lisp-rfc6833bis"/>, with Type set to 2, and S-bit set
        to 1 to indicate that the Map-Reply message includes Authentication
        Data (AD). The format of the LISP-SEC Map-Reply Authentication Data is
        defined in <xref target="map-reply-AD"/>. PKT-AD is the Packet
        Authentication Data that covers the Map-Reply payload.</t>

        <figure align="center" anchor="map-reply-AD"
                title="LISP-SEC Map-Reply Authentication Data">
          <artwork align="center"><![CDATA[ 0                   1                   2                   3
 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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|  MR AD Type   |                Unassigned                     |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ <---+
|           EID-AD Length       |           KDF ID              |     |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+     |
| Record Count  |   Unassigned  |         EID HMAC ID           |EID-AD
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\    |
|  Unassigned   | EID mask-len  |           EID-AFI             | |   |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Rec |
~                          EID-prefix ...                       ~ |   |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+/    |
~                            EID HMAC                           ~     |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ <---+
|         PKT-AD Length         |         PKT HMAC ID           |\
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
~                            PKT HMAC                           ~PKT-AD
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+/
]]></artwork>
        </figure>

        <t><list style="empty">
            <t>MR AD Type: 1 (LISP-SEC Authentication Data). See <xref
            target="IANA"/>.</t>

            <t>EID-AD Length: length (in bytes) of the EID-AD (see <xref target="ECM_extensions"/>). <!--An EID-AD MAY
            contain multiple EID-records. Each EID-record is 4-byte long plus
            the length of the AFI-encoded EID-prefix. --></t>

            <t>KDF ID: Identifier of the Key Derivation Function used to
            derive MS-OTK (see <xref target="ECM_extensions"/>).
            <!-- and <xref target="kdf"/> for KDF IDs that MUST be supported.-->
            </t>

            <t>Record Count: The number of records in this Map-Reply message (see <xref target="ECM_extensions"/>).
            <!-- A record is comprised of the portion of the packet that is labeled
            'Rec' above and occurs the number of times equal to Record
            Count.--></t>

            <t>Unassigned: Set to 0 on transmission and ignored on
            receipt.</t>

            <t>EID HMAC ID: Identifier of the HMAC algorithm used to protect
            the integrity of the EID-AD (see <xref target="ECM_extensions"/>). <!--See <xref target="map-server"/> for
            more details, and <xref target="HMAC"/> for HMAC IDs that MUST be
            supported.--></t>

            <t>EID mask-len: Mask length for EID-prefix (see <xref target="ECM_extensions"/>).</t>

            <t>EID-AFI: See <xref target="ECM_extensions"/>. <!-- Address family of EID-prefix (see <xref target="encap"/>) according to <xref
            target="RFC8060"/ -->.</t>

            <t>EID-prefix: See <xref target="ECM_extensions"/>. <!--This field contains an EID-prefix that the
            destination ETR is authoritative for, and is the longest match for
            the requested EID.--></t>

            <t>EID HMAC: See <xref target="ECM_extensions"/>. <!--HMAC of the EID-AD, as computed by the Map-Server.
            Before computing the HMAC operation the EID HMAC field MUST be set
            to 0. The HMAC covers the entire EID-AD.--></t>

            <t>PKT-AD Length: length (in bytes) of the Packet Authentication
            Data (PKT-AD).</t>

            <t>PKT HMAC ID: Identifier of the HMAC algorithm used to protect
            the integrity of the Map-Reply (see <xref target="encryption"/>).
            </t>

            <t>PKT HMAC: HMAC of the whole Map-Reply packet, so to protect its integrity; including the LISP-SEC Authentication Data (from the Map-Reply Type field to the PKT HMAC field), which allow message authetification.  <!--The scope of the authentication goes
            from the Map-Reply Type field to the PKT HMAC field included.
            Before computing the HMAC operation the PKT HMAC field MUST be set
            to 0. See <xref target="etr"/> for more details.--></t>
          </list></t>
      </section>

      <section title="Map-Register LISP-SEC Extentions">
        <!-- t>This memo is allocating one of the bits marked as Unassigned in the
        Map-Register message defined in <xref
        target="I-D.ietf-lisp-rfc6833bis"/>. More precisely, the second bit
        after the Type field in a Map-Register message is allocated as the S
        bit. -->
        <t>The S bit in the Map-Register message (see <xref target="I-D.ietf-lisp-rfc6833bis"/>) indicates to the Map-Server that the registering ETR is LISP-SEC enabled. An ETR that supports LISP-SEC MUST set the S bit in its Map-Register messages.</t>
      </section>

      <section anchor="itr" title="ITR Processing: Generating a Map-Request">
        <t>Upon creating a Map-Request, the ITR generates a random ITR-OTK
        that is stored locally, until the corresponding Map-Reply is
        received (see <xref target="itr-receive"/>), together with the nonce generated as specified in <xref
        target="I-D.ietf-lisp-rfc6833bis"/>.</t>

        <t>The ITR MAY use the KDF ID field to indicate the recommended KDF algorithm, according to local policy. The Map-Server can overwrite the KDF ID if it does not support the KDF ID recommended by the ITR (see <xref target="map-server"/>).</t>


        <t>ITR-OTK confidentiality and integrity protection MUST be provided
        in the path between the ITR and the Map-Resolver. This can be achieved
        either by encrypting the ITR-OTK with the pre-shared secret known to
        the ITR and the Map-Resolver (see <xref target="encryption"/>), or by
        enabling DTLS between the ITR and the Map-Resolver.</t>

        <t>The Map-Request (as defined in <xref target="I-D.ietf-lisp-rfc6833bis"/>) MUST be encapsulated as a LISP Control Message in an ECM, with the S-bit set to 1, to indicate the presence of Authentication Data. Such a message is also called "Protected Map-Request" in this memo.</t>

        <t>The ITR-OTK is wrapped with the algorithm specified by the OTK Wrapping
        ID field. See <xref target="encryption"/> for further details on OTK
        encryption. If the NULL-KEY-WRAP-128 algorithm is selected and DTLS is
        not enabled in the path between the ITR and the Map-Resolver, the
        Map-Request MUST be dropped and an appropriate log action SHOULD be
        taken.</t>

        <t>The Requested HMAC ID field contains the suggested HMAC algorithm
        to be used by the Map-Server and the ETR to protect the integrity of
        the ECM Authentication data and of the Map-Reply.  A HMAC ID Value of
        NONE (0), MAY be used to specify that the ITR has no preferred HMAC ID.
        </t>

        <t>The KDF ID field specifies the suggested key derivation function to
        be used by the Map-Server to derive the MS-OTK. A KDF Value of NONE
        (0) may be used to specify that the ITR has no preferred KDF ID.</t>

        <t>The EID-AD length is set to 4 bytes, since the Authentication Data
        does not contain EID-prefix Authentication Data, and the EID-AD
        contains only the KDF ID field.</t>

        <!--section anchor="pitr" title="Proxy-ITR Processing"
        <t>The processing performed by a Proxy-ITR (PITR) is equivalent to the
          processing of an ITR. However, -->
          <t>If the ITR is directly connected to a Mapping System, such as LISP+ALT <xref target="RFC6836"/>, it performs the functions of both the ITR and the Map-Resolver, forwarding the Protected Map-Request as described in <xref target="map-resolver"/>.</t>

          <t>The processing performed by Proxy ITRs (PITRs) is equivalent to the
            processing of an ITR, hence the procedure described above applies.
          </t>

        <!--/section-->
      </section>

      <section anchor="encryption" title="Encrypting and Decrypting an OTK ">
        <t>MS-OTK confidentiality and integrity protection MUST be provided in
        the path between the Map-Server and the ETR. This can be achieved
        either by enabling DTLS between the Map-Server and the ETR or by
        encrypting the MS-OTK with the pre-shared secret known to the
        Map-Server and the ETR <xref target="I-D.ietf-lisp-rfc6833bis"/>.</t>

        <t>Similarly, ITR-OTK confidentiality and integrity protection MUST be
        provided in the path between the ITR and the Map-Resolver. This can be
        achieved either by enabling DTLS between the Map-Server and the ITR,
        or by encrypting the ITR-OTK with the pre-shared secret known to the
        ITR and the Map-Resolver. The ITR/Map-Resolver pre-shared key is
        similar to the Map-Server/ETR pre-shared key.</t>

        <t>This section describes OTK processing in the ITR/Map-Resolver path,
        as well as in the Map-Server/ETR path.</t>

        <t>It's important to note that, to prevent ETR's overclaiming attacks,
        the ITR/Map-Resolver pre-shared secret MUST be different from the
        Map-Server/ETR pre-shared secret.</t>

        <t>The OTK is wrapped using the algorithm specified in the OTK
        Wrapping ID field. This field identifies both the:</t>

        <t><list style="symbols">
            <t>Key Encryption Algorithm used to encrypt the wrapped OTK.</t>

            <t>Key Derivation Function used to derive a per-message encryption
            key.</t>
          </list>
          Implementations of this specification MUST support OTK
          Wrapping ID AES-KEY-WRAP-128+HKDF-SHA256 that specifies the use of the
          HKDF-SHA256 Key Derivation Function specified in <xref
          target="RFC4868"/> to derive a per-message encryption key
          (per-msg-key), as well as the AES-KEY-WRAP-128 Key Wrap algorithm used
          to encrypt a 128-bit OTK, according to <xref target="RFC3394"/>.</t>

          <t>Implementations of this specification MUST support OTK
          Wrapping NULL-KEY-WRAP-128. NULL-KEY-WRAP-128 is used to carry an unencrypted 128-bit OTK, with a 64-bit preamble set to 0x0000000000000000 (64 bits).</t>

        <t>The key wrapping process for OTK Wrapping ID
        AES-KEY-WRAP-128+HKDF-SHA256 is described below:
        <list style="numbers">

            <t>The KDF and Key Wrap algorithms are identified by the value of the 'OTK Wrapping ID' field. The initial values are documented in <xref target="tableKWF"/>.</t>

          <!-- The KDF and the Key Wrap algorithms are identified by the 'OTK  Wrapping ID' field.</t>
            according to the table in <xref target="wrap"/>.</t>

            <t>The Key Wrap algorithm is identified by the field 'OTK Wrapping
            ID' according to the table in <xref target="wrap"/>.</t -->

            <t>If the NULL-KEY-WRAP-128 algorithm (see <xref target="wrap"/>) is selected and DTLS is not enabled, the Map-Request
            MUST be dropped and an appropriate log action SHOULD be taken.</t>

            <t>The pre-shared secret used to derive the per-msg-key is
            represented by PSK[Key ID], that is the pre-shared secret
            identified by the 'Key ID'.</t>

            <t>The per-message encryption key is computed as: <list
                style="symbols">
                <t>per-msg-key = KDF( nonce + s + PSK[Key ID] )</t>

                <t>where the nonce is the value in the Nonce field of the
                Map-Request, and</t>

                <t>'s' is the string "OTK-Key-Wrap"</t>
              </list></t>

            <t>According to <xref target="RFC3394"/> the per-msg-key is used
            to wrap the OTK with AES-KEY-WRAP-128. The AES Key Wrap
            Initialization Value MUST be set to 0xA6A6A6A6A6A6A6A6 (64 bits).
            The output of the AES Key Wrap operation is 192-bit long. The most
            significant 64-bit are copied in the One-Time Key Preamble field,
            while the 128 less significant bits are copied in the One-Time Key
            field of the LISP-SEC Authentication Data.</t>
          </list></t>

        <t>When decrypting an encrypted OTK the receiver MUST verify that the
        Initialization Value resulting from the AES Key Wrap decryption
        operation is equal to 0xA6A6A6A6A6A6A6A6. If this verification fails
        the receiver MUST discard the entire message.</t>

        <section anchor="null" title="Unencrypted OTK">
          <!--t>MS-OTK confidentiality and integrity protection MUST be provided
          in the path between the Map-Server and the ETR. Similarly, ITR-OTK
          confidentiality and integrity protection MUST be provided in the
          path between the ITR and the Map-Resolver.</t-->

          <t>However, when DTLS is enabled the OTK MAY be sent unencrypted as
          transport layer security is providing confidentiality and integrity
          protection.</t>

          <t>When a 128-bit OTK is sent unencrypted the OTK Wrapping ID is set
          to NULL_KEY_WRAP_128, and the OTK Preamble is set to
          0x0000000000000000 (64 bits).</t>
        </section>
      </section>

      <section anchor="map-resolver" title="Map-Resolver Processing">
        <t>Upon receiving a Protected Map-Request, the Map-Resolver decapsulates the ECM message. The ITR-OTK, if encrypted,
        is decrypted as specified in <xref target="encryption"/>.</t>

        <t>Protecting the confidentiality of the ITR-OTK and, in general, the
        security of how the Map-Request is handed by the Map-Resolver to the
        Map-Server, is specific to the particular Mapping System used, and
        outside of the scope of this memo.</t>

        <t>In Mapping Systems where the Map-Server is compliant with <xref
        target="I-D.ietf-lisp-rfc6833bis"/>, the Map-Resolver originates a new
        ECM header with the S-bit set, that contains the unencrypted ITR-OTK,
        as specified in <xref target="encryption"/>, and the other data
        derived from the ECM Authentication Data of the received encapsulated
        Map-Request.</t>

        <t>The Map-Resolver then forwards to the Map-Server the received
        Map-Request, encapsulated in the new ECM header that includes the
        newly computed Authentication Data fields.</t>
      </section>

      <section anchor="map-server" title="Map-Server Processing">
        <t>Upon receiving a Protected Map-Request, the Map-Server processes it according to the setting of the S-bit and the P-bit in the Map-Register received from the ETRs authoritative for that prefix, as described below.</t>

        <t>While processing the Map-Request, the Map-Server can overwrite the KDF ID field if it does not support the KDF ID recommended by the ITR.
        Processing of the Map-Request MUST proceed in the order described
        in the table below, applying the processing corresponding to the first
        rule that matches the conditions indicated in the first column:</t>

        <texttable anchor="tableMRP" title="Map-Request Processing.">
          <ttcol width="30%">Matching Condition</ttcol>
          <ttcol align="left">Processing</ttcol>
          <c>1. At least one of the ETRs authoritative for the EID prefix
          included in the Map-Request registered with the P-bit set to 1
          </c>
          <c>The Map-Server MUST generate a LISP-SEC protected Map-Reply as
          specified in <xref target="proxy"/>. The ETR-Cant-Sign E-bit in the
          EID Authentication Data (EID-AD) MUST be set to 0.
          </c>
          <c/>
          <c/>
          <c>2. At least one of the ETRs authoritative for the EID prefix
          included in the Map-Request registered with the S-bit set to 1</c>
          <c>The Map-Server MUST generate a LISP-SEC protected Encapsulated
          Map-Request (as specified in <xref target="EID-AD"/>), to be sent to
          one of the authoritative ETRs that registered with the S-bit set to
          1 (and the P-bit set to 0). If there is at least one ETR that
          registered with the S-bit set to 0, the ETR-Cant-Sign E-bit of the
          EID-AD MUST be set to 1 to signal the ITR that a non LISP-SEC
          Map-Request might reach additional ETRs that have LISP-SEC
          disabled.</c>
          <c/>
          <c/>
          <c>3. All the ETRs authoritative for the EID prefix included in the
          Map-Request registered with the S-bit set to 0</c>
          <c>The Map-Server MUST send a Negative Map-Reply protected with
          LISP-SEC, as described in <xref target="proxy"/>. The ETR-Cant-Sign
          E-bit MUST be set to 1 to signal the ITR that a non LISP-SEC
          Map-Request might reach additional ETRs that have LISP-SEC
          disabled.</c>
        </texttable>

        <t>In this way the ITR that sent a LISP-SEC protected Map-Request
        always receives a LISP-SEC protected Map-Reply. However, the
        ETR-Cant-Sign E-bit set to 1 specifies that a non LISP-SEC Map-Request
        might reach additional ETRs that have LISP-SEC disabled. This
        mechanism allows the ITR to downgrade to non LISP-SEC
        requests, which does not protect against threats described in <xref target="threat-model"/>.</t>

        <section anchor="EID-AD"
                 title="Generating a LISP-SEC Protected Encapsulated Map-Request">
          <t>The Map-Server decapsulates the ECM and generates a new ECM
          Authentication Data. The Authentication Data includes the OTK-AD and
          the EID-AD, that contains EID-prefix authorization information, that
          are eventually received by the requesting ITR.</t>

          <t>The Map-Server updates the OTK-AD by deriving a new OTK (MS-OTK)
          from the ITR-OTK received with the Map-Request. MS-OTK is derived
          applying the key derivation function specified in the KDF ID field.
          If the algorithm specified in the KDF ID field is not supported, the
          Map-Server uses a different algorithm to derive the key and updates
          the KDF ID field accordingly.</t>

          <!-- t>MS-OTK confidentiality and integrity protection MUST be provided
          in the path between the Map-Server and the ETR. This can be achieved
          either by enabling DTLS between the Map-Server and the ETR, or by
          encrypting the MS-OTK with the pre-shared secret known to the
          Map-Server and the ETR.</t -->

          <t>The Map-Request MUST be encapsulated in an ECM, with the S-bit
          set to 1, to indicate the presence of Authentication Data.</t>

          <t>MS-OTK is wrapped with the algorithm specified by the OTK
          Wrapping ID field. See <xref target="encryption"/> for further
          details on OTK encryption. If the NULL-KEY-WRAP-128 algorithm is
          selected and DTLS is not enabled in the path between the Map-Server
          and the ETR, the Map-Request MUST be dropped and an appropriate log
          action SHOULD be taken.</t>

          <t>The Map-Server includes in the EID-AD the longest match
          registered EID-prefix for the destination EID, and an HMAC of this
          EID-prefix. The HMAC is keyed with the ITR-OTK contained in the
          received ECM Authentication Data, and the HMAC algorithm is chosen
          according to the Requested HMAC ID field. If the Map-Server does not
          support this algorithm, the Map-Server uses a different algorithm
          and specifies it in the EID HMAC ID field. The scope of the HMAC
          operation MUST cover the entire EID-AD, from the EID-AD Length field to the EID HMAC field, which MUST be set to 0 before the
          computation.</t>

          <t>The Map-Server then forwards the updated ECM encapsulated
          Map-Request, that contains the OTK-AD, the EID-AD, and the received
          Map-Request to an authoritative ETR as specified in <xref
          target="I-D.ietf-lisp-rfc6833bis"/>.</t>

        </section>

        <section anchor="proxy" title="Generating a Proxy Map-Reply">
          <t>LISP-SEC proxy Map-Reply are generated according to <xref
          target="I-D.ietf-lisp-rfc6833bis"/>, with the Map-Reply S-bit set
          to 1. The Map-Reply includes the Authentication Data that contains
          the EID-AD, computed as specified in <xref target="EID-AD"/>, as
          well as the PKT-AD computed as specified in <xref
          target="etr"/>.</t>
        </section>
      </section>

      <section anchor="etr" title="ETR Processing">
        <t>Upon receiving an ECM encapsulated Map-Request with the S-bit set,
        the ETR decapsulates the ECM message. The OTK field, if encrypted, is
        decrypted as specified in <xref target="encryption"/> to obtain the
        unencrypted MS-OTK.</t>

        <t>The ETR then generates a Map-Reply as specified in <xref
        target="I-D.ietf-lisp-rfc6833bis"/> and includes the Authentication
        Data that contains the EID-AD, as received in the encapsulated
        Map-Request, as well as the PKT-AD.</t>

        <t>The EID-AD is copied from the Authentication Data of the received
        encapsulated Map-Request.</t>

        <t>The PKT-AD contains the HMAC of the whole Map-Reply packet, keyed
        with the MS-OTK and computed using the HMAC algorithm specified in the
        Requested HMAC ID field of the received encapsulated Map-Request.
        If the ETR does not support the Requested HMAC ID, it uses a different algorithm and updates the PKT HMAC ID field accordingly.
        The HMAC operation MUST cover the entire Map-Reply, where the PKT HMAC field MUST be set to 0 before the computation.
        </t>

        <t>Finally the ETR sends the Map-Reply to the requesting ITR as
        specified in <xref target="I-D.ietf-lisp-rfc6833bis"/>.</t>
      </section>

      <section anchor="itr-receive"
               title="ITR Processing: Receiving a Map-Reply">
        <t>In response to an encapsulated Map-Request that has the S-bit set,
        an ITR MUST receive a Map-Reply with the S-bit set, that includes an
        EID-AD and a PKT-AD. If the Map-Reply does not include both ADs, the
        ITR MUST discard it. In response to a Protected Map-Request, an ITR expects a Map-Reply with the S-bit set to 1 including an EID-AD and a PKT-AD.  The ITR MUST discard the Map-Reply otherwise.
        </t>

        <t>Upon receiving a Map-Reply, the ITR must verify the integrity of
        both the EID-AD and the PKT-AD, and MUST discard the Map-Reply if one
        of the integrity checks fails. After processing the Map-Reply, the ITR
        MUST discard the &lt;nonce,ITR-OTK&gt; pair associated to the
        Map-Reply</t>

        <t>The integrity of the EID-AD is verified using the ITR-OTK (stored
        locally for the duration of this exchange) to re-compute the HMAC of
        the EID-AD using the algorithm specified in the EID HMAC ID field. If
        the EID HMAC ID field does not match the Requested HMAC ID the ITR
        MUST discard the Map-Reply and send, at the first opportunity it
        needs to, a new Map-Request with a different Requested HMAC ID field,
        according to ITR's local policy. The scope of the HMAC operation covers the entire EID-AD, from the EID-AD Length field to the EID HMAC field.</t>

        <t>ITR MUST set the EID HMAC ID field to 0 before computing the
        HMAC.</t>

        <t>To verify the integrity of the PKT-AD, first the MS-OTK is derived
        from the locally stored ITR-OTK using the algorithm specified in the
        KDF ID field.
        This is because the PKT-AD is generated by the ETR using
        the MS-OTK. If the KDF ID in the Map-Reply does not match the KDF ID
        requested in the Map-Request, the ITR MUST discard the Map-Reply and
        send, at the first opportunity it needs to, a new Map-Request with a
        different KDF ID, according to ITR's local policy. The key derivation function HKDF-SHA1-128 <xref target="RFC5869"/> MUST be supported.  Without consistent configuration of involved entities, extra delays may be experienced.
        However, since HKDF-SHA1-128 is mandatory to implement, the process will eventually converge.</t>

        <t>The derived MS-OTK is then used to re-compute the HMAC of the
        PKT-AD using the Algorithm specified in the PKT HMAC ID field. If the
        PKT HMAC ID field does not match the Requested HMAC ID the ITR MUST
        discard the Map-Reply and send, at the first opportunity it needs to,
        a new Map-Request with a different Requested HMAC ID according to
        ITR's local policy or until all HMAC IDs supported by the ITR have
        been attempted. When the PKT HMAC ID field does not match the Requested HMAC ID it is not possible to validate the Map-Reply.</t>

        <t>Each individual Map-Reply EID-record is considered valid only if:
        (1) both EID-AD and PKT-AD are valid, and (2) the intersection of the
        EID-prefix in the Map-Reply EID-record with one of the EID-prefixes
        contained in the EID-AD is not empty. After identifying the Map-Reply
        record as valid, the ITR sets the EID-prefix in the Map-Reply record
        to the value of the intersection set computed before, and adds the
        Map-Reply EID-record to its EID-to-RLOC cache, as described in <xref
        target="I-D.ietf-lisp-rfc6833bis"/>. An example of Map-Reply record
        validation is provided in <xref target="validation"/>.</t>

        <t><xref target="I-D.ietf-lisp-rfc6833bis"/> allows ETRs to send
        Solicited-Map-Requests (SMR) directly to the ITR. The corresponding SMR-invoked Map-Request will be sent through the mapping system, hence, secured with the specifications of this memo if in use. If an ITR accepts Map-Replies piggybacked in Map-Requests and its content is not already present in its EID-to-RLOC cache, it MUST send a Map-Request over the mapping system in order to verify its content with a secured Map-Reply.</t>

        <t/>

        <section anchor="validation" title="Map-Reply Record Validation">
          <t>The payload of a Map-Reply may contain multiple EID-records. The
          whole Map-Reply is signed by the ETR, with the PKT HMAC, to provide
          integrity protection and origin authentication to the EID-prefix
          records claimed by the ETR. The Authentication Data field of a
          Map-Reply may contain multiple EID-records in the EID-AD. The EID-AD
          is signed by the Map-Server, with the EID HMAC, to provide integrity
          protection and origin authentication to the EID-prefix records
          inserted by the Map-Server.</t>

          <t>Upon receiving a Map-Reply with the S-bit set, the ITR first
          checks the validity of both the EID HMAC and of the PKT-AD HMAC. If
          either one of the HMACs is not valid, a log action MUST be taken and
          the Map-Reply MUST NOT be processed any further. If both HMACs are
          valid, the ITR proceeds with validating each individual EID-record
          claimed by the ETR by computing the intersection of each one of the
          EID-prefix contained in the payload of the Map-Reply with each one
          of the EID-prefixes contained in the EID-AD. An EID-record is valid
          only if at least one of the intersections is not the empty set, otherwise, a log action MUST be taken and the EID-record MUST be discarded.</t>

          <t>For instance, the Map-Reply payload contains 3 mapping record
          EID-prefixes:
          <list style="empty">
              <t>2001:db8:102::/48</t>

              <t>2001:db8:103::/48</t>

              <t>2001:db8:200::/40</t>
          </list>
          The EID-AD contains two EID-prefixes:
          <list style="empty">
              <t>2001:db8:103::/48</t>

              <t>2001:db8:203::/48</t>
          </list>
          The EID-record with EID-prefix 2001:db8:102::/48 is not
          eligible to be used by the ITR since it is not included in any of
          the EID-ADs signed by the Map-Server. A log action MUST be taken and the EID-record MUST be
 	   discarded.</t>

          <t>The EID-record with EID-prefix 2001:db8:103::/48 is eligible to
          be used by the ITR because it matches the second EID-prefix
          contained in the EID-AD.</t>

          <t>The EID-record with EID-prefix 2001:db8:200::/40 is not eligible
          to be used by the ITR since it is not included in any of the EID-ADs
          signed by the Map-Server. A log action MUST be taken and the EID-record MUST be
 	   discarded. In this last example the ETR is trying to over claim the EID-prefix 2001:db8:200::/40, but the Map-Server authorized only
          2001:db8:203::/48, hence the EID-record is discarded.</t>
        </section>
      </section>
    </section>

    <section anchor="security" title="Security Considerations">

      <t>This document extends the LISP Control-Plane defined in <xref
      target="I-D.ietf-lisp-rfc6833bis"/>, hence, its Security Considerations apply as well to this document.
      </t>

      <section anchor="mapping-system" title="Mapping System Security">
        <t>The LISP-SEC threat model described in <xref
        target="threat-model"/>, assumes that the LISP Mapping System is
        working properly and delivers Map-Request messages to a
        Map-Server that is authoritative for the requested EID.</t>

        <t>It is assumed that the Mapping System ensures the confidentiality
        of the OTK, and the integrity of the Map-Reply data. However, how the
        LISP Mapping System is secured is out of the scope of this
        document.</t>

        <t>Similarly, Map-Register security, including the right for a LISP
        entity to register an EID-prefix or to claim presence at an RLOC, is
        out of the scope of LISP-SEC.</t>
      </section>

      <section anchor="random" title="Random Number Generation">
        <t>The ITR-OTK MUST be generated by a properly seeded pseudo-random
        (or strong random) source. See <xref target="RFC4086"/> for advice on
        generating security-sensitive random data.</t>
      </section>

      <section anchor="colocation" title="Map-Server and ETR Colocation">
        <t>If the Map-Server and the ETR are colocated, LISP-SEC does not
        provide protection from overclaiming attacks mounted by the ETR.
        However, in this particular case, since the ETR is within the trust
        boundaries of the Map-Server, ETR's overclaiming attacks are not
        included in the threat model.</t>
      </section>

      <section anchor="deploying" title="Deploying LISP-SEC">
        <!-- t>This memo is written according to <xref target="RFC2119"/>.
        Specifically, the use of the key word SHOULD "or the adjective
        'RECOMMENDED', mean that there may exist valid reasons in particular
        circumstances to ignore a particular item, but the full implications
        must be understood and carefully weighed before choosing a different
        course".</t -->

        <t>Those deploying LISP-SEC according to this memo, should carefully
        weight how the LISP-SEC threat model applies to their particular use
        case or deployment. If they decide to ignore a particular
        recommendation, they should make sure the risk associated with the corresponding threats is well understood.</t>

        <t>As an example, in certain closed and controlled deployments, it is
        possible that the threat associated with an on-path attacker between the xTR and
        the Mapping System is very low, and after careful consideration it may
        be decided to allow a NULL key wrapping algorithm while carrying the
        OTKs between the xTR and the Mapping System.</t>

        <t>As an example at the other end of the spectrum, in certain other
        deployments, attackers may be very sophisticated, and force the
        deployers to enforce very strict policies in term of HMAC algorithms
        accepted by an ITR.</t>

        <t>Similar considerations apply to the entire LISP-SEC threat model,
        and should guide the deployers and implementors whenever they
        encounter the key word SHOULD across this memo.</t>
      </section>

      <section anchor="provisioning" title="Shared Keys Provisioning">
        <t>Provisioning of the keys shared between the ITR and the
        Map-Resolver as well as between the ETR and the Map-Server should be
        performed via an orchestration infrastructure and it is out of the
        scope of this memo. It is recommended that both shared keys are
        refreshed at periodical intervals to address key aging or attackers
        gaining unauthorized access to the shared keys. Shared keys should be
        unpredictable random values.</t>
      </section>

      <section anchor="reply" title="Replay Attacks">
        <t>An attacker can capture a valid Map-Request and/or Map-Reply and
        replay it, however once the ITR receives the original Map-Reply the
        &lt;nonce,ITR-OTK&gt; pair stored at the ITR will be discarded. If a
        replayed Map-Reply arrives at the ITR, there is no
        &lt;nonce,ITR-OTK&gt; that matches the incoming Map-Reply and will be
        discarded.</t>

        <t>In case of replayed Map-Request, the Map-Server, Map-Resolver and
        ETR will have to do a LISP-SEC computation. This is equivalent, in terms of resources, to a valid LISP-SEC computation and an attacker does not obtain any benefit, since the corresponding Map-Reply is discarded as previously explained.</t>
      </section>

      <section anchor="DTLS" title="Message Privacy">
        <t>DTLS <xref target="RFC9147"/> SHOULD be used to provide
        communication privacy and to prevent eavesdropping, tampering, or
        message forgery to the messages exchanged between the ITR,
        Map-Resolver, Map-Server, and ETR, unless the OTK is encrypted in another way, e.g. using a pre-shared secret.</t>
      </section>

      <section anchor="dos"
               title="Denial of Service and Distributed Denial of Service Attacks">
        <t>LISP-SEC mitigates the risks of Denial of Service and Distributed
        Denial of Service attacks by protecting the integrity and
        authenticating the origin of the Map-Request/Map-Reply messages, and
        by preventing malicious ETRs from overclaiming EID prefixes that could
        re-direct traffic directed to a potentially large number of hosts.</t>
      </section>
    </section>

    <section anchor="IANA" title="IANA Considerations">

      <t>IANA is requested to create the sub-registries listed in the following sections in the "Locator/ID Separation Protocol (LISP) Parameters" registry.
      </t>

      <section anchor="ECM-AD-Type" title="ECM AD Type Registry">
        <t>IANA is requested to create the "ECM Authentication Data Type"
        registry with values 0-255, for use in the ECM LISP-SEC Extensions
        <xref target="ECM_extensions"/>. Initial allocation of this registry is shown in <xref target="tableEADT"/>.
        </t>

        <texttable anchor="tableEADT" title="ECM Authentication Data Types.">
          <ttcol align="left">Name</ttcol>
          <ttcol align="center">Number</ttcol>
          <ttcol align="left">Defined in</ttcol>
            <c>Reserved</c><c>0</c><c>This memo</c>
            <c>LISP-SEC-ECM-EXT</c><c>1</c><c>This memo</c>
        </texttable>

        <!-- t><figure align="center" suppress-title="true" title="HMAC Functions">
            <artwork align="center"><![CDATA[
Name                     Value        Defined In
Reserved                 0             This memo
LISP-SEC-ECM-EXT         1             This memo
]]></artwork>
</figure></t -->

        <t>Values 2-255 are unassigned. They are to be assigned according to
        the "Specification Required" policy defined in <xref
        target="RFC8126"/>.</t>
      </section>

      <section anchor="MR-AD-Type" title="Map-Reply AD Type Registry">
        <t>IANA is requested to create the "Map-Reply Authentication Data
        Type" registry with values 0-255, for use in the Map-Reply LISP-SEC
        Extensions <xref target="MR_extensions"/>. Initial allocation of this  registry is shown in <xref target="tableADT"/>.
        </t>

        <texttable anchor="tableADT" title="Map-Reply Authentication Data
        Types.">
          <ttcol align="left">Name</ttcol>
          <ttcol align="center">Number</ttcol>
          <ttcol align="left">Defined in</ttcol>
            <c>Reserved</c><c>0</c><c>This memo</c>
            <c>LISP-SEC-MR-EXT</c><c>1</c><c>This memo</c>
        </texttable>

        <!-- t><figure align="center" suppress-title="true" title="HMAC Functions">
            <artwork align="center"><![CDATA[
Name                     Value        Defined In
Reserved                 0             This memo
LISP-SEC-MR-EXT          1             This memo

]]></artwork>
</figure></t-->

        <t>Values 2-255 are unassigned. They are to be assigned according to
        the "Specification Required" policy defined in <xref
        target="RFC8126"/>.</t>
      </section>

      <section anchor="HMAC" title="HMAC Functions">
        <t>IANA is requested to create the "LISP-SEC Authentication Data HMAC
        ID" registry with values 0-65535 for use as Requested HMAC ID, EID
        HMAC ID, and PKT HMAC ID in the LISP-SEC Authentication Data. Initial allocation of this registry is shown in <xref target="tableHMACF"/>.
        </t>

        <texttable anchor="tableHMACF" title="LISP-SEC Authentication Data HMAC
        Functions.">
          <ttcol align="left">Name</ttcol>
          <ttcol align="center">Number</ttcol>
          <ttcol align="left">Defined in</ttcol>
            <c>NONE</c><c>0</c><c>This memo</c>
            <c>AUTH-HMAC-SHA-1-96</c><c>1</c><c><xref target="RFC2104"/></c>
            <c>AUTH-HMAC-SHA-256-128</c><c>2</c><c><xref target="RFC6234"/></c>
        </texttable>

        <!-- t><figure align="center" suppress-title="true" title="HMAC Functions">
            <artwork align="center"><![CDATA[
Name                     Number        Defined In
NONE                     0             This memo
AUTH-HMAC-SHA-1-96       1             [RFC2104]
AUTH-HMAC-SHA-256-128    2             [RFC6234]

]]></artwork>
</figure></t -->

        <t>Values 3-65535 are unassigned. They are to be assigned according to
        the "Specification Required" policy defined in <xref
        target="RFC8126"/>.</t>

        <!--t>AUTH-HMAC-SHA-1-96 MUST be supported, AUTH-HMAC-SHA-256-128 SHOULD
        be supported.</t-->
      </section>

      <section anchor="wrap" title="Key Wrap Functions">
        <t>IANA is requested to create the "LISP-SEC Authentication Data Key
        Wrap ID" registry with values 0-65535 for use as OTK key wrap
        algorithms ID in the LISP-SEC Authentication Data. Initial allocation of this registry is shown in <xref target="tableKWF"/>.</t>

        <texttable anchor="tableKWF" title="LISP-SEC Authentication Data Key
          Wrap Functions.">
          <ttcol align="left">Name</ttcol>
          <ttcol align="center">Number</ttcol>
          <ttcol align="left">KEY WRAP</ttcol>
          <ttcol align="left">KDF</ttcol>
            <c>Reserved</c><c>0</c><c>None</c><c>None</c>
            <c>NULL-KEY-WRAP-128</c><c>1</c><c>This memo</c><c>None</c>
            <c>AES-KEY-WRAP-128+HKDF-SHA256</c><c>2</c><c><xref target="RFC3394"/></c><c><xref target="RFC4868"/></c>
        </texttable>

        <!-- figure align="center" suppress-title="true"
                title="Key Wrap Functions">
          <artwork align="center"><![CDATA[
Name                        Number     KEY WRAP       KDF
Reserved                       0       None           None
NULL-KEY-WRAP-128              1       This memo      None
AES-KEY-WRAP-128+HKDF-SHA256   2       [RFC3394]      [RFC4868]

]]></artwork>
</figure -->

        <t/>

        <t>Values 3-65535 are unassigned. They are to be assigned according to
        the "Specification Required" policy defined in <xref
        target="RFC8126"/>.</t>


      </section>

      <section anchor="kdf" title="Key Derivation Functions">
        <t>IANA is requested to create the "LISP-SEC Authentication Data Key
        Derivation Function ID" registry with values 0-65535 for use as KDF ID.
        Initial allocation of this registry is shown in <xref target="tableKDF"/>.</t>

        <texttable anchor="tableKDF" title="LISP-SEC Authentication Data Key
          Derivation Function ID.">
          <ttcol width="20%" align="left">Name</ttcol>
          <ttcol width="20%" align="center">Number</ttcol>
          <ttcol align="center">Defined in</ttcol>
            <c>NONE</c><c>0</c><c>This memo</c>
            <c>HKDF-SHA1-128 </c><c>1</c><c><xref target="RFC5869"/></c>
      	</texttable>
<!--
Name                     Number        Defined In
NONE                     0             This memo
HKDF-SHA1-128            1             [RFC5869]
-->
        <t>Values 2-65535 are unassigned. They are to be assigned according to
        the "Specification Required" policy defined in <xref
        target="RFC8126"/>. Expert review, from security area, should assess that the security of key derivation function, so that its use does not introduce security risks.</t>

        <!--t>The key derivation function HKDF-SHA1-128 MUST be supported.</t-->
      </section>
    </section>

    <section anchor="Acknowledgements" title="Acknowledgements">
      <t>The authors would like to acknowledge Pere Monclus, Dave Meyer, Dino
      Farinacci, Brian Weis, David McGrew, Darrel Lewis and Landon Curt Noll
      for their valuable suggestions provided during the preparation of this
      document.</t>
    </section>
  </middle>

  <back>
    <references title="Normative References">
      <?rfc include='http://xml.resource.org/public/rfc/bibxml3/reference.I-D.ietf-lisp-rfc6833bis.xml'?>

    <?rfc include='http://xml.resource.org/public/rfc/bibxml3/reference.I-D.ietf-lisp-rfc6830bis.xml'?>

      <?rfc include="reference.RFC.2119"?>

      <?rfc include="reference.RFC.8126"?>

      <?rfc include="reference.RFC.4868"?>

      <?rfc include="reference.RFC.9147"?>

      <?rfc include="reference.RFC.8174"?>

      <?rfc include="reference.RFC.7835"?>

      <?rfc include="reference.RFC.6234"?>

      <?rfc include="reference.RFC.5869"?>

      <?rfc include="reference.RFC.3394"?>

      <?rfc include="reference.RFC.2104"?>





    </references>

    <references title="Informational References">

      <?rfc include="reference.RFC.4086"?>

      <?rfc include="reference.RFC.6836"?>


      <!--?rfc include="reference.RFC.8060"?-->

      <!--reference anchor="AFN" target="http://www.iana.org/assignments/address-family-numbers/">
        <front>
          <title>Address Family Numbers</title>
          <author >
            <organization> IANA - Internet Assigned  Numbers Authority</organization>
          </author>
          <date year="2021"/>
        </front>
      </reference-->
    </references>

  </back>
</rfc>
