<?xml version="1.0" encoding="US-ASCII"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
<rfc category="exp"
     docName="draft-ietf-lisp-map-server-reliable-transport-04"
     ipr="trust200902">
  <?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>

  <?rfc toc="yes" ?>

  <?rfc symrefs="yes" ?>

  <?rfc sortrefs="yes"?>

  <?rfc iprnotified="no" ?>

  <?rfc strict="yes" ?>

  <front>
    <title>LISP Map Server Reliable Transport</title>

    <author fullname="Balaji Pitta" initials="B." surname="Pitta">
      <organization>Cisco Systems</organization>

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

          <city>San Jose</city>

          <region>CA</region>

          <code>95134</code>

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

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

    <author fullname="Marc Portoles" initials="M." surname="Portoles">
      <organization>Cisco Systems</organization>

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

          <city>San Jose</city>

          <region>CA</region>

          <code>95134</code>

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

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

    <author fullname="Darrel Lewis" initials="D." surname="Lewis">
      <organization>ICANN</organization>

      <address>
        <postal>
          <street></street>

          <city>Los Angeles</city>

          <region>CA</region>

          <code>90292</code>

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

        <email>darrel.lewis@icann.org</email>
      </address>
    </author>

    <author fullname="Isidor Kouvelas" initials="I." surname="Kouvelas">
      <organization>Arista Networks Inc.</organization>

      <address>
        <postal>
          <street>5453 Great America Parkway</street>

          <city>Santa Clara</city>

          <region>CA</region>

          <code>95054</code>

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

        <email>isidor@kouvelas.net</email>
      </address>
    </author>

    <author fullname="Chris Cassar" initials="C." surname="Cassar">
      <organization>Rivian Automotive</organization>

      <address>
        <postal>
          <street/>
          <city/>
          <region/>
          <code/>
          <country>United Kingdom</country>
        </postal>

        <email>christiancassar@acm.org</email>
      </address>
    </author>
    <date year="2024"/>

    <abstract>
      <t>The communication between LISP ETRs and Map-Servers is based on
      unreliable UDP message exchange coupled with periodic message
      transmission in order to maintain soft state. The drawback of periodic
      messaging is the constant load imposed on both the ETR and the
      Map-Server. New use cases for LISP have increased the amount of state
      that needs to be communicated with requirements that are not satisfied
      by the current mechanism. This document introduces the use of a reliable
      transport for ETR to Map-Server communication in order to eliminate the
      periodic messaging overhead, while providing reliability, flow-control
      and endpoint liveness detection.</t>
    </abstract>
  </front>

  <middle>
    <section title="Introduction">
      <t>The communication channel between LISP ETRs and Map-Servers is based
      on unreliable UDP message exchange <xref target="RFC9301"/>.
      Where required, reliability is
      pursued through periodic retransmissions that maintain soft state on the
      peer. Map-Register messages are retransmitted every minute by an ETR and
      the Map-Server times out its state if the state is not refreshed for
      three successive periods. When registering multiple EID-Prefixes, the
      ETR includes multiple mapping records in the Map-Register message.
      Packet size limitations provide an upper bound to the number of mapping
      records that can be placed in each Map-Register message. When the ETR
      has more EID-Prefixes to register than can be packed in a single
      Map-Register message, the mapping records for the EID-Prefixes are split
      across multiple Map-Register messages.</t>

      <t>The drawback of the periodic registration is the constant load that
      it introduces on both the ETR and the Map-Server. The ETR uses resources
      to periodically build and transmit the Map-Register messages, and to
      process the resulting Map-Notify messages issued by the Map-Server. The
      Map-Server uses resources to process the received Map-Register messages,
      update the corresponding registration state, and build and transmit the
      matching Map-Notify messages. When the number of EID-Prefixes to be
      registered by an ETR is small, the resulting load imposed by periodic
      registrations may not be significant. The ETR will only transmit a
      single Map-Register message each period that contains a small number of
      mapping records.</t>

      <t>In some LISP deployments, a large set of EID-Prefixes must be
      registered by each ETR (e.g. mobility, database redistribution). Use
      cases with a large set of EID-Prefixes behind an ETR will result in a
      much higher load. An example is LISP mobility deployments where
      EID-Prefixes are limited to host entries. ETRs may have thousands of
      hosts to register resulting in hundreds of Map-Register and Map-Notify
      messages per registration period.</t>

      <t>A transport is required for the ETR to Map-Server communication that
      provides reliability, flow-control and endpoint liveness notifications.
      This document describes the use of TCP as a LISP reliable
      transport. The initial application for the LISP reliable transport
      session is the support of scalable EID prefix registration. The reliable
      session mechanism is defined to be extensible so that it can support
      additional LISP communication requirements as they arise using a single
      reliable transport session between an ETR and a Map-Server. The use of
      the reliable transport session for EID prefix registration is an
      alternative and does not replace the existing UDP based mechanism.</t>
    </section>

    <section title="Requirements Notation">
      <t>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
      "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
      document are to be interpreted as described in <xref
      target="RFC2119"/>.</t>
    </section>

    <section title="Message Format">
      <t>A single LISP reliable transport session may carry information for
      multiple LISP applications. One such application is the registration of
      EID to RLOC mappings that operates over a session between an ETR and a
      Map-Server. Communication over a session is based on the exchange of
      messages. This document defines a base set of messages to support
      session establishment and management. It also defines the messages for
      the EID to RLOC mapping registration application.</t>

      <t>To support protocol extensibility when new applications, or
      extensions to existing applications are introduced, the messages are
      based on a TLV format. <figure align="center">
          <preamble/>

          <artwork><![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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|             Type              |             Length            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                           Message ID                          |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                          Message Data                       ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                       Message End Marker                      |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork>

          <postamble>Reliable transport message format</postamble>
        </figure> <list style="symbols">
          <t>Type: 16 bit type field identifying the message type.</t>

          <t>Length: 16 bit field that provides the total size of the message
          in octets including the length, type and end marker fields. The
          length allows the receiver to locate the next message in the TCP
          stream. The minimum value of the length field is 8.</t>

          <t>ID: A 32-bit value that identifies the message. May be used by
          the receiver to identify the message in replies or notification
          messages.</t>

          <t>Data: Type specific message contents.</t>

          <t>End Marker: A 32-bit message end marker that must be set to
          0x9FACADE9. The End Marker is used by the receiver to validate that
          it has correctly parsed or skipped a message and provides a method
          to detect formatting errors. Note that message data may also contain
          this marker, and that the marker itself is not sufficient for
          parsing the message.</t>
        </list></t>

      <t>The base message format does not indicate how the peer should deal
      with the message in cases where the message type is not
      supported/understood. This is best dealt with by the application. For
      example, in case an error notification is returned, or an expected
      acknowledgement message is not received, the application might choose
      various courses of action; from simply logging that the feature is not
      supported, all the way to tearing the relationship with the peer down
      for the feature, or for all LISP features.</t>
    </section>

    <section title="Session Establishment">
      <t>To ensure backwards compatibility, the Map-Server and ETR MUST
      communicate via unreliable UDP messages until a reliable session between
      the two can be successfully established.</t>

      <t> The ETR indicates its intent to use a reliable transport setting the
      Reliable Transport bit in the UDP Map-Register message. As an
      acknowledgement, when the MS is ready to accept the establishment of a
      reliable transport session it also sets the Reliable Transport bit in
      the Map-Notify message. The Reliable Transport bit is specified below
      in <xref target="messages"/>. </t>

      <t>The Map-Server authenticates the ETR with the authentication data
      contained in the first UDP Map-Register message it receives from the
      ETR. Once the ETR is authenticated, the Map-Server performs a passive
      open by listening on TCP port 4342, and does not qualify the remote
      port. As a security measure, the Map-Server does not create any connection
      unless a UDP authentication, with the r bit set, completes first.
      After that, the Map-Server accepts connections only
      from those ETRs that have been authenticated via UDP Map-Register
      messages. Note that the use of TCP here is for documentation purposes,
      <xref target="protocols"/> lists the alternatives that can be used to
      sustain the reliable transport session.</t>

      <t>The ETR assumes the active role of the TCP session establishment by
      connecting to the Map-Server once it has received a UDP Map-Notify
      message with the Reliable Transport bit set. ETR MUST assume the client
      role and it is always the one attempting the connection.</t>

      <t>When a TCP session goes down, UDP authentication must take place
      before a new TCP session is established. The Map-Server will not accept
      a connection from the ETR until a UDP Map-Register with the Reliable
      Transport bit set has been received. Similarly, the ETR will not
      attempt to establish a session with the Map-Server until an UDP
      map-notify message has been received with the
      Reliable Transport bit set.</t>

      <t>A single reliable transport session is established between the
        Map-Server and the ETR to cover all communication needs.
        For example, an ETR that has EID prefix registrations for multiple
        EID instances and EID address families will only establish a single
        session with the Map-Server.</t>

      <section anchor="messages" title="Signaling to Trigger Session
        Establishment">
        <t>Following the procedures described in this document, the Map-Register
        and Map-Notify headers are extended with a new flag, the Reliable
        Transport bit, that is used to advertise intent to establish a
        reliable transport session (ETR), as well as the capability to accept
        reliable transport sessions (MS).</t>

        <t> The Map-Register header, as defined in
        <xref target="RFC9301"/> is extended with an
        additional field, the Reliable Transport bit.</t>

        <artwork><![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
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
       |Type=3 |P|S|I|        Reserved     |r|E|T|a|R|M| Record Count  |
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
        ]]></artwork>

        <list style="hanging">
            <t hangText="r:">This is the Reliable Transport bit in the
              Map-Register header. It should be set to 1 when the ETR that
              sends a registration intends to establish a reliable
              transport session with the MS that the registration is
              being sent to.</t>
        </list>
        <t> The Map-Notify header, as defined in
        <xref target="RFC9301"/>, is extended with an
        additional field, the Reliable Transport bit.</t>

        <artwork><![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
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
       |Type=4|             Reserved                 |r| Record Count  |
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
        ]]></artwork>
        <list style="hanging">
            <t hangText="r:">This is the Reliable Transport bit in the
              Map-Notify header. It should be set to 1 when the MS has
              validated an initial UDP registration and acknowledges the
              possibility to use a reliable transport session with the ETR.</t>
        </list>
      </section>
      <section anchor="protocols" title="Transport Protocol and Port
        Usage">
        <t>This document defines TCP as transport protocol that can be used to
          sustain a reliable transport between ETRs and the MS:
          <t> TCP [RFC0793]: This is the reference protocol used as a base for
            documentation of this specification. The port 4342 is used for this
            purpose (see <xref target="port_numbers"/>).
          TCP sessions are long-lived and maintained unless one of the endpoints
          closes or resets the session, or the communication times out and
          needs to be restarted.</t></t>

	<t>Note that new protocols could be added in the future. In such a case
	in order to establish the reliable transport sessions there is a 
	serialization delay associated to coordinating ETR and MS in choosing 
	one of the available protocols to support the connection. When an ETR 
	is capable of using more than one of the protocols, it MAY attempt 
	connections in order of preference. Additionally, the ETR 
	SHOULD only use one protocol as a support for the reliable transport.
	</t>
      </section>

    </section>

    <section title="Error Notifications">
      <t>The error notification message is used to communicate base reliable
      transport session communication errors. LISP applications making use of
      the reliable transport session and having to communicate application
      specific errors must define their own messages to do so. An error
      notification is issued when the receiver of a message does not recognize
      the message type or cannot parse the message contents. The notification
      includes the offending message type and ID and as much of the offending
      message data as the notification sender wishes to. <figure
          align="center">
          <preamble/>

          <artwork><![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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|           Type = 16           |            Length             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                           Message ID                          |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Error Code    |                   Reserved                    |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|    Offending Message Type     |    Offending Message Length   |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                     Offending Message ID                      |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                    Offending Message Data                   ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                       Message End Marker                      |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork>

          <postamble>Error Notification message format</postamble>
        </figure> <list style="symbols">
          <t>Error Code: An 8 bit field identifying the type of error that
          occurred. Defined errors are: <list style="symbols">
              <t>Unrecognized message type.</t>

              <t>Message format error.</t>
            </list></t>

          <t>Reserved: Set to zero by the sender and ignored by the
          receiver.</t>

          <t>Offending Message Type: 16 bit type field identifying the message
          type of the offending message that triggered this error
          notification. This is copied from the Type field of the offending
          message.</t>

          <t>Offending Message Length: 16 bit field that provides the total
          size of the offending message in octets. This is copied from the
          Length field of the offending message.</t>

          <t>Offending Message ID: A 32-bit field that is set to the Message
          ID field of the offending message.</t>

          <t>Offending Message Data: The Data from the offending message that
          triggered this error notification. The sender of the notification
          may include as much of the original data as is deemed necessary. The
          length of the Offending Message Data field is not provided by the
          Offending Message Length field and is determined by subtracting the
          size of the other fields in the message from the Length field. It is
          valid to not include any of the offending message data when sending
          an error notification.</t>

          <t>End Marker: A 32-bit message end marker that must be set to
          0x9FACADE9. The End Marker is used by the receiver to validate that
          it has correctly parsed or skipped a message and provides a method
          to detect formatting errors. Note that message data may also contain
          this marker, and that the marker itself is not sufficient for
          parsing the message.</t>
        </list></t>

      <t>An error notification cannot be the offending message in another
      error notification and MUST NOT trigger such a message.</t>
    </section>

    <section title="EID Prefix Registration">
      <t>EID prefix registration uses the reliable transport session between
      an ETR and a Map-Server to communicate the ETR local EID database EID to
      RLOC mappings to the Map-Server. In contrast to the UDP based periodic
      registration, mapping information over the reliable transport session is
      only sent when there is new information available for the Map-Server.
      The Map-Server does not maintain a timer to expire registrations
      communicated over the reliable transport session. Instead an explicit
      de-registration (a registration carrying a zero TTL) is needed to delete
      the state maintained by the Map-Server.</t>

      <t>The key used to identify registration mapping records in the ETR to
      Map-Server communication is the EID prefix. The prefix may be specified
      using an LCAF encoding that includes an EID instance ID.</t>

      <t>When the reliable transport session goes down, registration mappings
      learned by the Map-Server are treated as periodic UDP registrations and
      a timer is used to expire them after 3 minutes. During this period UDP
      based registrations or the re-establishment of the reliable transport
      session and subsequent communication of a new mapping can update the EID
      prefix mapping state.</t>

      <section title="Reliable Mapping Registration Messages">
        <t>This section defines the LISP reliable transport session messages
        used to communicate local EID database registrations between the ETR
        and the Map-Server.</t>

        <section title="Registration Message">
          <t>The reliable transport registration message is used to
          communicate EID to RLOC mapping registrations from the ETR to the
          Map-Server. To increase code reuse, the "Message Data" field uses
          the same format as the UDP Map-Registers but without the IP and UDP
          headers. A reliable registration message MUST contain a single
          mapping-record. The Map-Server MUST discard any reliable
          registration message that contains more than one mapping record.</t>

          <t>The reliable transport session is authenticated by means of the
          session establishment procedure. Thus, although the Map-Register
          MUST carry the authentication data, it is up to the Map-Server to
          determine if each individual reliable registration message should be
          authenticated. <figure align="center">
              <preamble/>

              <artwork><![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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|           Type = 17           |            Length             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                           Message ID                          |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                      Map-Register message                   ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
...                    Map-Register message                     |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                       Message End Marker                      |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork>

              <postamble>Registration message format</postamble>
            </figure></t>
        </section>

        <section title="Registration Acknowledgement Message">
          <t>The Acknowledgement message is sent from the Map-Server to the
          ETR to confirm successful registration of an EID prefix previously
          communicated by a reliable transport session Registration message.
          The Registration Acknowledgement message does not carry a mapping
          record (the Map-Servers view of the mapping). This is accomplished
          by the LISP reliable transport Map Notification message. <figure
              align="center">
              <preamble/>

              <artwork><![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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|           Type = 18           |            Length             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                           Message ID                          |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Prefix-Length |       EID-Prefix-AFI          | EID-Prefix  ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                       Message End Marker                      |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork>

              <postamble>Registration Acknowledgement message
              format</postamble>
            </figure> <list style="symbols">
              <t>Prefix-Length: Mask length for the EID prefix.</t>

              <t>EID-Prefix AFI: Address family identifier for the EID prefix
              in the following field.</t>

              <t>EID-Prefix: The EID prefix from the received
              Registration.</t>
            </list></t>
        </section>

        <section title="Registration Rejection Message">
          <t>The Registration Rejection Message is sent by the Map-Server to
          the ETR to indicate that the registration of a specific EID prefix
          is being rejected or withdrawn. A rejection refers to a
          recently-sent registration that is being immediately rejected. A
          withdrawal refers to a previously accepted registration that is no
          longer acceptable, perhaps due to a configuration change in the
          Map-Server. The ETR must keep track of rejected EID prefixes and be
          prepared to re-register their mappings when requested through a
          registration refresh message. <figure align="center">
              <preamble/>

              <artwork><![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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|           Type = 19           |            Length             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                           Message ID                          |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|     Reason    |           Reserved            | Prefix-Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|        EID-Prefix-AFI         |          EID-Prefix         ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                       Message End Marker                      |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork>

              <postamble>Registration Rejection message format</postamble>
            </figure> <list style="symbols">
              <t>Reason: Code identifying the reason for which the Map-Server
              rejected or withdrew the registration. <list style="symbols">
                  <t>1 - Not a valid site EID prefix.</t>

                  <t>2 - Authentication failure.</t>

                  <t>3 - Locator set not allowed.</t>

                  <t>4 - Used to cover reason that's not defined.</t>
                </list></t>

              <t>Reserved: This field is reserved for future use. Set to zero
              by the sender and ignored by the receiver.</t>

              <t>Prefix-Length: Mask length for the EID prefix.</t>

              <t>EID-Prefix-AFI: Address family identifier for the EID prefix
              in the following field.</t>

              <t>EID-Prefix: The EID prefix being rejected or withdrawn.</t>
            </list></t>
        </section>

        <section title="Registration Refresh Message">
          <t>Sent by the Map-Server to the ETR to request the
          (re-)transmission of EID prefix database mapping Registration
          messages. <figure align="center">
              <preamble/>

              <artwork><![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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|           Type = 20           |            Length             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                           Message ID                          |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|      Scope    |R|          Reserved           | Prefix-Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|        EID-Prefix-AFI         |          EID-Prefix         ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                       Message End Marker                      |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork>

              <postamble>Registration Refresh message format</postamble>
            </figure> <list style="symbols">
              <t>Scope: Determines the set of registrations being refreshed.
              <list style="symbols">
                  <t>0 - All prefixes under all address families under all EID
                  instances are being refreshed. When using this scope the
                  Prefix-Length, EID-Prefix-AFI, and EID-Prefix fields MUST be
                  omitted. That is, the Message End Marker follows immediately
                  after the Reserved field. The total length of the message
                  MUST be 15 bytes.</t>

                  <t>1 - All prefixes under all address families under a
                  single EID instance are being refreshed. The Prefix-Length
                  MUST be set to zero, EID-Prefix-AFI MUST be set to LCAF
                  type, the EID-Prefix encodes the LCAF Instance ID, the LCAF
                  address AFI MUST be set to UNSPECIFIED. The total length of
                  the message MUST be 30 bytes.</t>

                  <t>2 - All prefixes under a single address family under a
                  single EID instance are being refreshed. The Prefix-Length
                  MUST be set to zero, the EID-Prefix-AFI MUST be set to LCAF
                  type and the EID-Prefix MUST encode the Instance ID. The
                  LCAF address AFI MUST specify the address family to refresh,
                  the actual address SHOULD be set to zero.</t>

                  <t>3 - All prefixes covered by a specific EID prefix in a
                  single EID instance is being refreshed. The Prefix-Length,
                  EID-Prefix-AFI and EID prefix MUST be encoded
                  accordingly.</t>

                  <t>4 - A specific EID prefix in a single EID instance is
                  being refreshed. The Prefix-Length, EID-Prefix-AFI and EID
                  prefix MUST be encoded accordingly.</t>
                </list> The Map-Server has the flexibility to control the
              granularity of the refresh by issuing refresh with different
              scopes. It can send a single refresh with a coarse scope or send
              individual refreshes with narrower scope. The ETR MUST be able
              to process all scopes to ensure the Map-Server registration
              states are synchronized with the ETR.</t>

              <t>R: Request from the ETR to only refresh registrations that
              have been previously rejected by the Map-Server. If the R bit is
              set then the scope cannot have a value of 3 and the EID-Prefix
              and Prefix-Length fields must be omitted.</t>

              <t>Reserved: This field is reserved for future use. Set to zero
              by the sender and ignored by the receiver.</t>

              <t>Prefix-Length: Mask length for the EID prefix. Refer to scope
              for more details.</t>

              <t>EID-Prefix-AFI: Address family identifier for the EID prefix
              in the following field. Refer to scope for more details.</t>

              <t>EID-Prefix: The EID prefix being refreshed. Refer to scope
              for more details.</t>
            </list></t>
        </section>

        <section title="Mapping Notification Message">
          <t>Mapping Notification messages communicate the Map-Server view of
          the mapping for an EID prefix and no longer serve as a registration
          acknowledgement. Mapping Notifications do not need message level
          authentication as they are received over a reliable transport
          session to a known Map-Server. Note that reliable transport Mapping
          Notification messages do not reuse the UDP Map-Notify message
          format. <figure align="center">
              <preamble/>

              <artwork><![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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|           Type = 21           |            Length             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                           Message ID                          |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|			xTR-ID 128 bits                       ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|			xTR-ID 128 bits                       ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|			xTR-ID 128 bits                       ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|			xTR-ID 128 bits                         |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|			site-ID 64 bits                       ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|			site-ID 64 bits                         |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                         Mapping Record                      ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
...                       Mapping Record                        |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                       Message End Marker                      |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork>

              <postamble>Mapping Notification message format</postamble>
            </figure> <list style="symbols">
              <t>xTR-ID: xTR-ID taken from the last valid registration the
              Map-Server received for the EID-prefix conveyed in the mapping
              record.</t>

              <t>site-ID: site-ID taken from the last valid registration the
              Map-Server received for the EID-prefix conveyed in the mapping
              record.</t>

              <t>Mapping Record: Mapping record of the EID-prefix the
              Map-Server is conveying to the ETR.</t>
            </list></t>
        </section>
      </section>

      <section title="ETR Behavior">
        <t>The ETR operates the following per EID prefix, per MS state machine
        that defines the reliable transport EID prefix registration
        behavior.</t>

        <t>There are five states: <list style="symbols">
            <t>No state: The local EID database prefix does not exist.</t>

            <t>Periodic: The local EID database prefix is being periodically
            registered through UDP Map-Register messages as specified in
            [].</t>

            <t>Stable: From the ETR's perspective, no registrations are due to
            be sent to the peer. The session to the peer is up, and the peer
            has either acknowledged the registration, or is expected to
            request a refresh in the future.</t>

            <t>AckWait: A Registration message for the prefix has been
            transmitted to the Map-Server and the ETR is waiting for either a
            Registration Acknowledge or Registration Rejected reply from the
            Map-Server.</t>

            <t>Reject: The reliable transport registration for the local EID
            database prefix was rejected by the Map-Server. From the ETR's
            perspective, no registration is due to the peer AND the peer is
            known to have rejected the registration.</t>
          </list></t>

        <t>The following events drive the state transitions: <list
            style="symbols">
            <t>DB creation: The local EID database entry for the EID prefix is
            created.</t>

            <t>DB deletion: The local EID database entry for the EID prefix is
            deleted.</t>

            <t>DB change: The mapping contents or authentication information
            for the local EID database entry changes.</t>

            <t>Session up: The reliable transport session to the Map-Server is
            established.</t>

            <t>Session down: The reliable transport session the Map-Server
            goes down.</t>

            <t>Recv Refresh: A Registration refresh message is received from
            the Map-Server.</t>

            <t>Recv ACK: A Registration Acknowledge message is received from
            the Map-Server.</t>

            <t>Recv Rejected: A Registration Rejected message is received from
            the Map-Server.</t>

            <t>Periodic timer: The timer that drives generation of periodic
            UDP Map-Register messages fires.</t>
          </list></t>

        <t>The state machine is: <figure align="center">
            <preamble/>

            <artwork><![CDATA[
+--------------------+--------------------------------------+
|                    |              Prev State              |
|  Event             +-------------------+------------------+
|                    |   No state        |    Periodic      |
+--------------------+-------------------+------------------+
|  DB creation       |   -> Periodic     |    N/A           |
|  [session down]    |   A1              |                  |
+--------------------+-------------------+------------------+
|  DB creation       |   -> AckWait      |    N/A           |
|  [session up]      |   A2              |                  |
+--------------------+-------------------+------------------+
|  DB deletion       |   N/A             |    -> No state   |
|                    |                   |    A3            |
+--------------------+-------------------+------------------+
|  DB change         |   N/A             |    -             |
|                    |                   |    A1            |
+--------------------+-------------------+------------------+
|  Session up        |   -               |    -> Stable     |
|                    |                   |    A4            |
+--------------------+-------------------+------------------+
|  Session down      |   -               |    N/A           |
|                    |                   |                  |
+--------------------+-------------------+------------------+
|  Recv Refresh      |   -               |    N/A           |
|                    |                   |                  |
+--------------------+-------------------+------------------+
|  Recv Refresh      |   -               |    N/A           |
|  [rejected]        |                   |                  |
+--------------------+-------------------+------------------+
|  Recv ACK          |   -               |    N/A           |
|                    |                   |                  |
+--------------------+-------------------+------------------+
|  Recv Rejection    |   -               |    N/A           |
|                    |                   |                  |
+--------------------+-------------------+------------------+
|  Timer             |   N/A             |    -             |
|                    |                   |    A5            |
+--------------------+-------------------+------------------+
]]></artwork>

            <postamble>xTR per EID prefix per MS state machine</postamble>
          </figure> <figure align="center">
            <preamble/>

            <artwork><![CDATA[
+-----------------+-----------------------------------------------+
|                 |                   Prev State                  |
| Event           +---------------+---------------+---------------+
|                 |    Stable     |   AckWait     |   Rejected    |
+-----------------+---------------+---------------+---------------+
| DB creation     | N/A           | N/A           | N/A           |
|                 |               |               |               |
+-----------------+---------------+---------------+---------------+
| DB deletion     | -> No state   | -> No state   | -> No state   |
|                 | A6            | A6            |               |
+-----------------+---------------+---------------+---------------+
| DB change       | -> AckWait    | -             | -> AckWait    |
|                 | A2            | A2            | A2            |
+-----------------+---------------+---------------+---------------+
| Session up      | N/A           | N/A           | N/A           |
|                 |               |               |               |
+-----------------+---------------+---------------+---------------+
| Session down    | -> Periodic   | -> Periodic   | -> Periodic   |
|                 | A7            | A7            | A7            |
+-----------------+---------------+---------------+---------------+
| Recv Refresh    | -> AckWait    | -             | -> AckWait    |
|                 | A2            | A2            | A2            |
+-----------------+---------------+---------------+---------------+
| Recv Refresh    | -             | -             | -> AckWait    |
| [rejected]      |               | A2            | A2            |
+-----------------+---------------+---------------+---------------+
| Recv ACK        | -             | -> Stable     | -> AckWait    |
|                 |               |               | A2            |
+-----------------+---------------+---------------+---------------+
| Recv Rejection  | -> Rejected   | -> Rejected   | -             |
|                 |               |               |               |
+-----------------+---------------+---------------+---------------+
| Timer           | N/A           | N/A           | N/A           |
|                 |               |               |               |
+-----------------+---------------+---------------+---------------+
]]></artwork>

            <postamble>xTR per EID prefix per MS state machine</postamble>
          </figure></t>

        <t>Action descriptions: <list style="symbols">
            <t>A1: Start periodic registration timer with zero delay.</t>

            <t>A2: Send Registration over reliable transport session.</t>

            <t>A3: Send UDP registration with zero TTL.</t>

            <t>A4: Stop periodic registration timer.</t>

            <t>A7: Send UDP registration and start periodic registration timer
            with registration period.</t>

            <t>A6: Send Registration with TTL zero over reliable transport
            session.</t>

            <t>A7: Start periodic registration timer with registration
            period.</t>
          </list> All timer start actions must be jittered.</t>

        <t>When the reliable transport session is established the ETR moves
        the state machine into the Stable state without first registering the
        EID prefix over the reliable transport session. The Map-Server will
        send a refresh message with a scope of 0 that will trigger the
        registration message to be sent. Because other applications may be
        using the reliable session, the refresh message signals the ETR that
        the Map-Server supports reliable map registration messages. This model
        will also allow future optimizations where the Map-Server may retain
        registration state from a previous instantiation of the reliable
        transport session with the ETR and only request the refresh of EID
        prefix state beyond some negotiated session progress marker.</t>

        <t>Aa Map-Server authentication key change is treated as a DB change
        event and will result in triggering a new Registration message to be
        transmitted.</t>
      </section>

      <section title="Map-Server Behavior">
        <t>Received registrations create/update or delete mapping state.</t>

        <t>A refresh with global scope is sent when a session between the ETR
        and Map-Server is first established so the Map-Server can obtain the
        complete database contents from the ETR. This refresh is also serving
        as a capability signaling from the Map-Server to the ETR that it can
        support reliable registration.</t>

        <t>Refresh for rejected registrations sent (R bit set) when a new EID
        prefix is configured on the Map-Server.</t>

        <t>Refresh is sent whenever authentication key is changed or EID
        prefix is deconfigured. Upon reception of the registration Map-Server
        can decide whether to acknowledge the registration or issue
        rejection.</t>

        <t>Mapping Notification message sent whenever the mapping for a
        registered or more specific prefix for which notifications are
        requested changes. ETR acknowledgement or rejection messaging for
        Mapping Notification is not required because the ETR decides how to
        process the message based on the registered mapping information. If
        the mapping information changes the resulting registration will
        trigger a new Mapping Notification message from the Map-Server.</t>
      </section>
    </section>

    <section title="Security Considerations">
      <t>The LISP reliable transport session SHOULD be authenticated. On
      controlled RLOC networks that can guarantee that the source RLOC address
      of data packets cannot be spoofed, the authentication check can be a
      source address validation on the reliable transport packets. When the
      RLOC network does not provide such guarantees, reliable transport
      authentication SHOULD be used. Implementations SHOULD support the TCP
      Authentication Option (TCP-AO) [RFC5925].</t>
    </section>

    <section title="IANA Considerations">
      <section title="LISP Reliable Transport Message Types">
        <t>Assignment of new LISP reliable transport message types is done
        according to the "IETF Review" model defined in <xref
        target="RFC5266"/>.</t>

        <t>The initial content of the registry should be as follows. <figure
            align="center">
            <preamble/>

            <artwork><![CDATA[
Type         Name                                      Reference
-----------  ----------------------------------------  --------------
0-15         Reserved                                  This document
16           Error Notification                        This document
17           Registration Message                      This document
18           Registration Acknowledgement Message      This document
19           Registration Rejected Message             This document
20           Registration Refresh Message              This document
21           Mapping Notification Message              This document
22-64999     Unassigned
65000-65535  Reserved for Experimental Use
]]></artwork>
          </figure></t>
      </section>

      <section title="Transport Protocol Port Numbers" anchor="port_numbers">
        <t> Following the guidelines of [RFC8126], the authors request IANA is
          to assign a TCP port (4342 is suggested) to sustain reliable transport
          over TCP.</t>

        <table align="center" pn="table-1">
          <thead>
            <tr>
              <th align="left" colspan="1" rowspan="1">Service Name</th>
              <th align="left" colspan="1" rowspan="1">Port Number</th>
              <th align="left" colspan="1" rowspan="1">Transport Protocol</th>
              <th align="left" colspan="1" rowspan="1">Description</th>
              <th align="left" colspan="1" rowspan="1">Reference</th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <td align="left" colspan="1" rowspan="1">lisp-tcp</td>
              <td align="left" colspan="1" rowspan="1">4342 (suggested) </td>
              <td align="left" colspan="1" rowspan="1">tcp</td>
              <td align="left" colspan="1" rowspan="1">LISP TCP Reliable 
	      Control Plane</td>
              <td align="left" colspan="1" rowspan="1">TBD</td>
            </tr>
          </tbody>
        </table>

      </section>
    </section>

    <section title="Contributors">
    <author fullname="Jesus Arango" initials="J." surname="Arango">
      <organization>Microsoft</organization>

      <address>
        <postal>
          <street/>
          <region/>
          <code/>
          <country>USA</country>
        </postal>

        <email>jearango@microsoft.com</email>
      </address>
    </author>
    <author fullname="Johnson Leong" initials="J." surname="Leong">
      <organization>Uber Technologies</organization>

      <address>
        <postal>
          <street>Market St.</street>

          <city>San Francisco</city>

          <region>CA</region>

          <code>94103</code>

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

        <email></email>
      </address>
    </author>
    </section>

    <section title="Acknowledgments">
      <t>The authors would like to thank Noel Chiappa, Dino Farinacci, Jesper
      Skriver, Andre Pelletier, Les Ginsberg and Alberto Rodriguez-Natal
      for their contributions to this document.</t>
    </section>
  </middle>

  <back>
    <references title="Normative References">
      <?rfc include="http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml"?>

      <?rfc include="http://xml.resource.org/public/rfc/bibxml/reference.RFC.5266.xml"?>

      <?rfc include="http://xml.resource.org/public/rfc/bibxml/reference.RFC.9301.xml"?>
    </references>
  </back>
</rfc>
