Tech-invite3GPPspaceIETFspace
96959493929190898887868584838281807978777675747372717069686766656463626160595857565554535251504948474645444342414039383736353433323130292827262524232221201918171615141312111009080706050403020100
in Index   Prev   Next

RFC 6830

The Locator/ID Separation Protocol (LISP)

Pages: 75
Obsoleted by:  93009301
Updated by:  8113
Part 2 of 4 – Pages 15 to 42
First   Prev   Next

Top   ToC   RFC6830 - Page 15   prevText

5. LISP Encapsulation Details

Since additional tunnel headers are prepended, the packet becomes larger and can exceed the MTU of any link traversed from the ITR to the ETR. It is RECOMMENDED in IPv4 that packets do not get fragmented as they are encapsulated by the ITR. Instead, the packet is dropped and an ICMP Too Big message is returned to the source. This specification RECOMMENDS that implementations provide support for one of the proposed fragmentation and reassembly schemes. Two existing schemes are detailed in Section 5.4. Since IPv4 or IPv6 addresses can be either EIDs or RLOCs, the LISP architecture supports IPv4 EIDs with IPv6 RLOCs (where the inner header is in IPv4 packet format and the outer header is in IPv6 packet format) or IPv6 EIDs with IPv4 RLOCs (where the inner header is in IPv6 packet format and the outer header is in IPv4 packet format). The next sub-sections illustrate packet formats for the homogeneous case (IPv4-in-IPv4 and IPv6-in-IPv6), but all 4 combinations MUST be supported.
Top   ToC   RFC6830 - Page 16

5.1. LISP IPv4-in-IPv4 Header Format

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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ / |Version| IHL |Type of Service| Total Length | / +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | Identification |Flags| Fragment Offset | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ OH | Time to Live | Protocol = 17 | Header Checksum | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | Source Routing Locator | \ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ \ | Destination Routing Locator | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ / | Source Port = xxxx | Dest Port = 4341 | UDP +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ \ | UDP Length | UDP Checksum | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ L |N|L|E|V|I|flags| Nonce/Map-Version | I \ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ S / | Instance ID/Locator-Status-Bits | P +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ / |Version| IHL |Type of Service| Total Length | / +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | Identification |Flags| Fragment Offset | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ IH | Time to Live | Protocol | Header Checksum | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | Source EID | \ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ \ | Destination EID | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ IHL = IP-Header-Length
Top   ToC   RFC6830 - Page 17

5.2. LISP IPv6-in-IPv6 Header Format

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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ / |Version| Traffic Class | Flow Label | / +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | Payload Length | Next Header=17| Hop Limit | v +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | O + + u | | t + Source Routing Locator + e | | r + + | | H +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ d | | r + + | | ^ + Destination Routing Locator + | | | \ + + \ | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ / | Source Port = xxxx | Dest Port = 4341 | UDP +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ \ | UDP Length | UDP Checksum | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ L |N|L|E|V|I|flags| Nonce/Map-Version | I \ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ S / | Instance ID/Locator-Status-Bits | P +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ / |Version| Traffic Class | Flow Label | / +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ / | Payload Length | Next Header | Hop Limit | v +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Top   ToC   RFC6830 - Page 18
       |                                                               |
   I   +                                                               +
   n   |                                                               |
   n   +                          Source EID                           +
   e   |                                                               |
   r   +                                                               +
       |                                                               |
   H   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   d   |                                                               |
   r   +                                                               +
       |                                                               |
   ^   +                        Destination EID                        +
   \   |                                                               |
    \  +                                                               +
     \ |                                                               |
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

5.3. Tunnel Header Field Descriptions

Inner Header (IH): The inner header is the header on the datagram received from the originating host. The source and destination IP addresses are EIDs [RFC0791] [RFC2460]. Outer Header: (OH) The outer header is a new header prepended by an ITR. The address fields contain RLOCs obtained from the ingress router's EID-to-RLOC Cache. The IP protocol number is "UDP (17)" from [RFC0768]. The setting of the Don't Fragment (DF) bit 'Flags' field is according to rules listed in Sections 5.4.1 and 5.4.2. UDP Header: The UDP header contains an ITR selected source port when encapsulating a packet. See Section 6.5 for details on the hash algorithm used to select a source port based on the 5-tuple of the inner header. The destination port MUST be set to the well-known IANA-assigned port value 4341. UDP Checksum: The 'UDP Checksum' field SHOULD be transmitted as zero by an ITR for either IPv4 [RFC0768] or IPv6 encapsulation [UDP-TUNNELS] [UDP-ZERO]. When a packet with a zero UDP checksum is received by an ETR, the ETR MUST accept the packet for decapsulation. When an ITR transmits a non-zero value for the UDP checksum, it MUST send a correctly computed value in this field. When an ETR receives a packet with a non-zero UDP checksum, it MAY choose to verify the checksum value. If it chooses to perform such verification, and the verification fails, the packet MUST be silently dropped. If the ETR chooses not to perform the verification, or performs the verification successfully, the packet MUST be accepted for decapsulation. The handling of UDP
Top   ToC   RFC6830 - Page 19
      checksums for all tunneling protocols, including LISP, is under
      active discussion within the IETF.  When that discussion
      concludes, any necessary changes will be made to align LISP with
      the outcome of the broader discussion.

   UDP Length:  The 'UDP Length' field is set for an IPv4-encapsulated
      packet to be the sum of the inner-header IPv4 Total Length plus
      the UDP and LISP header lengths.  For an IPv6-encapsulated packet,
      the 'UDP Length' field is the sum of the inner-header IPv6 Payload
      Length, the size of the IPv6 header (40 octets), and the size of
      the UDP and LISP headers.

   N: The N-bit is the nonce-present bit.  When this bit is set to 1,
      the low-order 24 bits of the first 32 bits of the LISP header
      contain a Nonce.  See Section 6.3.1 for details.  Both N- and
      V-bits MUST NOT be set in the same packet.  If they are, a
      decapsulating ETR MUST treat the 'Nonce/Map-Version' field as
      having a Nonce value present.

   L: The L-bit is the 'Locator-Status-Bits' field enabled bit.  When
      this bit is set to 1, the Locator-Status-Bits in the second
      32 bits of the LISP header are in use.

     x 1 x x 0 x x x
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |N|L|E|V|I|flags|            Nonce/Map-Version                  |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                      Locator-Status-Bits                      |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

   E: The E-bit is the echo-nonce-request bit.  This bit MUST be ignored
      and has no meaning when the N-bit is set to 0.  When the N-bit is
      set to 1 and this bit is set to 1, an ITR is requesting that the
      nonce value in the 'Nonce' field be echoed back in LISP-
      encapsulated packets when the ITR is also an ETR.  See
      Section 6.3.1 for details.

   V: The V-bit is the Map-Version present bit.  When this bit is set to
      1, the N-bit MUST be 0.  Refer to Section 6.6.3 for more details.
      This bit indicates that the LISP header is encoded in this
      case as:

     0 x 0 1 x x x x
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |N|L|E|V|I|flags|  Source Map-Version   |   Dest Map-Version    |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                 Instance ID/Locator-Status-Bits               |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Top   ToC   RFC6830 - Page 20
   I: The I-bit is the Instance ID bit.  See Section 5.5 for more
      details.  When this bit is set to 1, the 'Locator-Status-Bits'
      field is reduced to 8 bits and the high-order 24 bits are used as
      an Instance ID.  If the L-bit is set to 0, then the low-order
      8 bits are transmitted as zero and ignored on receipt.  The format
      of the LISP header would look like this:

     x x x x 1 x x x
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |N|L|E|V|I|flags|            Nonce/Map-Version                  |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                 Instance ID                   |     LSBs      |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

   flags:  The 'flags' field is a 3-bit field reserved for future flag
      use.  It MUST be set to 0 on transmit and MUST be ignored on
      receipt.

   LISP Nonce:  The LISP 'Nonce' field is a 24-bit value that is
      randomly generated by an ITR when the N-bit is set to 1.  Nonce
      generation algorithms are an implementation matter but are
      required to generate different nonces when sending to different
      destinations.  However, the same nonce can be used for a period of
      time to the same destination.  The nonce is also used when the
      E-bit is set to request the nonce value to be echoed by the other
      side when packets are returned.  When the E-bit is clear but the
      N-bit is set, a remote ITR is either echoing a previously
      requested echo-nonce or providing a random nonce.  See
      Section 6.3.1 for more details.

   LISP Locator-Status-Bits (LSBs):  When the L-bit is also set, the
      'Locator-Status-Bits' field in the LISP header is set by an ITR to
      indicate to an ETR the up/down status of the Locators in the
      source site.  Each RLOC in a Map-Reply is assigned an ordinal
      value from 0 to n-1 (when there are n RLOCs in a mapping entry).
      The Locator-Status-Bits are numbered from 0 to n-1 from the least
      significant bit of the field.  The field is 32 bits when the I-bit
      is set to 0 and is 8 bits when the I-bit is set to 1.  When a
      Locator-Status-Bit is set to 1, the ITR is indicating to the ETR
      that the RLOC associated with the bit ordinal has up status.  See
      Section 6.3 for details on how an ITR can determine the status of
      the ETRs at the same site.  When a site has multiple EID-Prefixes
      that result in multiple mappings (where each could have a
      different Locator-Set), the Locator-Status-Bits setting in an
      encapsulated packet MUST reflect the mapping for the EID-Prefix
      that the inner-header source EID address matches.  If the LSB for
      an anycast Locator is set to 1, then there is at least one RLOC
      with that address, and the ETR is considered 'up'.
Top   ToC   RFC6830 - Page 21
   When doing ITR/PITR encapsulation:

   o  The outer-header 'Time to Live' field (or 'Hop Limit' field, in
      the case of IPv6) SHOULD be copied from the inner-header 'Time to
      Live' field.

   o  The outer-header 'Type of Service' field (or the 'Traffic Class'
      field, in the case of IPv6) SHOULD be copied from the inner-header
      'Type of Service' field (with one exception; see below).

   When doing ETR/PETR decapsulation:

   o  The inner-header 'Time to Live' field (or 'Hop Limit' field, in
      the case of IPv6) SHOULD be copied from the outer-header 'Time to
      Live' field, when the Time to Live value of the outer header is
      less than the Time to Live value of the inner header.  Failing to
      perform this check can cause the Time to Live of the inner header
      to increment across encapsulation/decapsulation cycles.  This
      check is also performed when doing initial encapsulation, when a
      packet comes to an ITR or PITR destined for a LISP site.

   o  The inner-header 'Type of Service' field (or the 'Traffic Class'
      field, in the case of IPv6) SHOULD be copied from the outer-header
      'Type of Service' field (with one exception; see below).

   Note that if an ETR/PETR is also an ITR/PITR and chooses to
   re-encapsulate after decapsulating, the net effect of this is that
   the new outer header will carry the same Time to Live as the old
   outer header minus 1.

   Copying the Time to Live (TTL) serves two purposes: first, it
   preserves the distance the host intended the packet to travel;
   second, and more importantly, it provides for suppression of looping
   packets in the event there is a loop of concatenated tunnels due to
   misconfiguration.  See Section 9.3 for TTL exception handling for
   traceroute packets.

   The Explicit Congestion Notification ('ECN') field occupies bits 6
   and 7 of both the IPv4 'Type of Service' field and the IPv6 'Traffic
   Class' field [RFC3168].  The 'ECN' field requires special treatment
   in order to avoid discarding indications of congestion [RFC3168].
   ITR encapsulation MUST copy the 2-bit 'ECN' field from the inner
   header to the outer header.  Re-encapsulation MUST copy the 2-bit
   'ECN' field from the stripped outer header to the new outer header.
   If the 'ECN' field contains a congestion indication codepoint (the
   value is '11', the Congestion Experienced (CE) codepoint), then ETR
   decapsulation MUST copy the 2-bit 'ECN' field from the stripped outer
   header to the surviving inner header that is used to forward the
Top   ToC   RFC6830 - Page 22
   packet beyond the ETR.  These requirements preserve CE indications
   when a packet that uses ECN traverses a LISP tunnel and becomes
   marked with a CE indication due to congestion between the tunnel
   endpoints.

5.4. Dealing with Large Encapsulated Packets

This section proposes two mechanisms to deal with packets that exceed the path MTU between the ITR and ETR. It is left to the implementor to decide if the stateless or stateful mechanism should be implemented. Both or neither can be used, since it is a local decision in the ITR regarding how to deal with MTU issues, and sites can interoperate with differing mechanisms. Both stateless and stateful mechanisms also apply to Re-encapsulating and Recursive Tunneling, so any actions below referring to an ITR also apply to a TE-ITR.

5.4.1. A Stateless Solution to MTU Handling

An ITR stateless solution to handle MTU issues is described as follows: 1. Define H to be the size, in octets, of the outer header an ITR prepends to a packet. This includes the UDP and LISP header lengths. 2. Define L to be the size, in octets, of the maximum-sized packet an ITR can send to an ETR without the need for the ITR or any intermediate routers to fragment the packet. 3. Define an architectural constant S for the maximum size of a packet, in octets, an ITR must receive so the effective MTU can be met. That is, S = L - H. When an ITR receives a packet from a site-facing interface and adds H octets worth of encapsulation to yield a packet size greater than L octets, it resolves the MTU issue by first splitting the original packet into 2 equal-sized fragments. A LISP header is then prepended to each fragment. The size of the encapsulated fragments is then (S/2 + H), which is less than the ITR's estimate of the path MTU between the ITR and its correspondent ETR. When an ETR receives encapsulated fragments, it treats them as two individually encapsulated packets. It strips the LISP headers and then forwards each fragment to the destination host of the destination site. The two fragments are reassembled at the
Top   ToC   RFC6830 - Page 23
   destination host into the single IP datagram that was originated by
   the source host.  Note that reassembly can happen at the ETR if the
   encapsulated packet was fragmented at or after the ITR.

   This behavior is performed by the ITR when the source host originates
   a packet with the 'DF' field of the IP header set to 0.  When the
   'DF' field of the IP header is set to 1, or the packet is an IPv6
   packet originated by the source host, the ITR will drop the packet
   when the size is greater than L and send an ICMP Too Big message to
   the source with a value of S, where S is (L - H).

   When the outer-header encapsulation uses an IPv4 header, an
   implementation SHOULD set the DF bit to 1 so ETR fragment reassembly
   can be avoided.  An implementation MAY set the DF bit in such headers
   to 0 if it has good reason to believe there are unresolvable path MTU
   issues between the sending ITR and the receiving ETR.

   This specification RECOMMENDS that L be defined as 1500.

5.4.2. A Stateful Solution to MTU Handling

An ITR stateful solution to handle MTU issues is described as follows and was first introduced in [OPENLISP]: 1. The ITR will keep state of the effective MTU for each Locator per Map-Cache entry. The effective MTU is what the core network can deliver along the path between the ITR and ETR. 2. When an IPv6-encapsulated packet, or an IPv4-encapsulated packet with the DF bit set to 1, exceeds what the core network can deliver, one of the intermediate routers on the path will send an ICMP Too Big message to the ITR. The ITR will parse the ICMP message to determine which Locator is affected by the effective MTU change and then record the new effective MTU value in the Map-Cache entry. 3. When a packet is received by the ITR from a source inside of the site and the size of the packet is greater than the effective MTU stored with the Map-Cache entry associated with the destination EID the packet is for, the ITR will send an ICMP Too Big message back to the source. The packet size advertised by the ITR in the ICMP Too Big message is the effective MTU minus the LISP encapsulation length. Even though this mechanism is stateful, it has advantages over the stateless IP fragmentation mechanism, by not involving the destination host with reassembly of ITR fragmented packets.
Top   ToC   RFC6830 - Page 24

5.5. Using Virtualization and Segmentation with LISP

When multiple organizations inside of a LISP site are using private addresses [RFC1918] as EID-Prefixes, their address spaces MUST remain segregated due to possible address duplication. An Instance ID in the address encoding can aid in making the entire AFI-based address unique. See IANA Considerations (Section 14.2) for details on possible address encodings. An Instance ID can be carried in a LISP-encapsulated packet. An ITR that prepends a LISP header will copy a 24-bit value used by the LISP router to uniquely identify the address space. The value is copied to the 'Instance ID' field of the LISP header, and the I-bit is set to 1. When an ETR decapsulates a packet, the Instance ID from the LISP header is used as a table identifier to locate the forwarding table to use for the inner destination EID lookup. For example, an 802.1Q VLAN tag or VPN identifier could be used as a 24-bit Instance ID.
Top   ToC   RFC6830 - Page 25

6. EID-to-RLOC Mapping

6.1. LISP IPv4 and IPv6 Control-Plane Packet Formats

The following UDP packet formats are used by the LISP control plane. 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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |Version| IHL |Type of Service| Total Length | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Identification |Flags| Fragment Offset | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Time to Live | Protocol = 17 | Header Checksum | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Source Routing Locator | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Destination Routing Locator | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ / | Source Port | Dest Port | UDP +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ \ | UDP Length | UDP Checksum | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | | LISP Message | | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Top   ToC   RFC6830 - Page 26
        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
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
       |Version| Traffic Class |           Flow Label                  |
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
       |         Payload Length        | Next Header=17|   Hop Limit   |
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
       |                                                               |
       +                                                               +
       |                                                               |
       +                     Source Routing Locator                    +
       |                                                               |
       +                                                               +
       |                                                               |
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
       |                                                               |
       +                                                               +
       |                                                               |
       +                  Destination Routing Locator                  +
       |                                                               |
       +                                                               +
       |                                                               |
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     / |           Source Port         |         Dest Port             |
   UDP +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     \ |           UDP Length          |        UDP Checksum           |
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
       |                                                               |
       |                         LISP Message                          |
       |                                                               |
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

   The LISP UDP-based messages are the Map-Request and Map-Reply
   messages.  When a UDP Map-Request is sent, the UDP source port is
   chosen by the sender and the destination UDP port number is set to
   4342.  When a UDP Map-Reply is sent, the source UDP port number is
   set to 4342 and the destination UDP port number is copied from the
   source port of either the Map-Request or the invoking data packet.
   Implementations MUST be prepared to accept packets when either the
   source port or destination UDP port is set to 4342 due to NATs
   changing port number values.

   The 'UDP Length' field will reflect the length of the UDP header and
   the LISP Message payload.
Top   ToC   RFC6830 - Page 27
   The UDP checksum is computed and set to non-zero for Map-Request,
   Map-Reply, Map-Register, and Encapsulated Control Message (ECM)
   control messages.  It MUST be checked on receipt, and if the checksum
   fails, the packet MUST be dropped.

   The format of control messages includes the UDP header so the
   checksum and length fields can be used to protect and delimit message
   boundaries.

6.1.1. LISP Packet Type Allocations

This section will be the authoritative source for allocating LISP Type values and for defining LISP control message formats. Current allocations are: Reserved: 0 b'0000' LISP Map-Request: 1 b'0001' LISP Map-Reply: 2 b'0010' LISP Map-Register: 3 b'0011' LISP Map-Notify: 4 b'0100' LISP Encapsulated Control Message: 8 b'1000'

6.1.2. Map-Request Message Format

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=1 |A|M|P|S|p|s| Reserved | IRC | Record Count | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Nonce . . . | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | . . . Nonce | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Source-EID-AFI | Source EID Address ... | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ITR-RLOC-AFI 1 | ITR-RLOC Address 1 ... | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ... | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ITR-RLOC-AFI n | ITR-RLOC Address n ... | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ / | Reserved | EID mask-len | EID-Prefix-AFI | Rec +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ \ | EID-Prefix ... | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Map-Reply Record ... | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Top   ToC   RFC6830 - Page 28
   Packet field descriptions:

   Type:   1 (Map-Request)

   A: This is an authoritative bit, which is set to 0 for UDP-based
      Map-Requests sent by an ITR.  It is set to 1 when an ITR wants the
      destination site to return the Map-Reply rather than the mapping
      database system.

   M: This is the map-data-present bit.  When set, it indicates that a
      Map-Reply Record segment is included in the Map-Request.

   P: This is the probe-bit, which indicates that a Map-Request SHOULD
      be treated as a Locator reachability probe.  The receiver SHOULD
      respond with a Map-Reply with the probe-bit set, indicating that
      the Map-Reply is a Locator reachability probe reply, with the
      nonce copied from the Map-Request.  See Section 6.3.2 for more
      details.

   S: This is the Solicit-Map-Request (SMR) bit.  See Section 6.6.2 for
      details.

   p: This is the PITR bit.  This bit is set to 1 when a PITR sends a
      Map-Request.

   s: This is the SMR-invoked bit.  This bit is set to 1 when an xTR is
      sending a Map-Request in response to a received SMR-based
      Map-Request.

   Reserved:  This field MUST be set to 0 on transmit and MUST be
      ignored on receipt.

   IRC:  This 5-bit field is the ITR-RLOC Count, which encodes the
      additional number of ('ITR-RLOC-AFI', 'ITR-RLOC Address') fields
      present in this message.  At least one (ITR-RLOC-AFI,
      ITR-RLOC-Address) pair MUST be encoded.  Multiple 'ITR-RLOC
      Address' fields are used, so a Map-Replier can select which
      destination address to use for a Map-Reply.  The IRC value ranges
      from 0 to 31.  For a value of 0, there is 1 ITR-RLOC address
      encoded; for a value of 1, there are 2 ITR-RLOC addresses encoded,
      and so on up to 31, which encodes a total of 32 ITR-RLOC
      addresses.

   Record Count:  This is 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.  For this version of the protocol, a receiver MUST
      accept and process Map-Requests that contain one or more records,
Top   ToC   RFC6830 - Page 29
      but a sender MUST only send Map-Requests containing one record.
      Support for requesting multiple EIDs in a single Map-Request
      message will be specified in a future version of the protocol.

   Nonce:  This is an 8-octet random value created by the sender of the
      Map-Request.  This nonce will be returned in the Map-Reply.  The
      security of the LISP mapping protocol critically depends on the
      strength of the nonce in the Map-Request message.  The nonce
      SHOULD be generated by a properly seeded pseudo-random (or strong
      random) source.  See [RFC4086] for advice on generating security-
      sensitive random data.

   Source-EID-AFI:  This is the address family of the 'Source EID
      Address' field.

   Source EID Address:  This is the EID of the source host that
      originated the packet that caused the Map-Request.  When
      Map-Requests are used for refreshing a Map-Cache entry or for
      RLOC-Probing, an AFI value 0 is used and this field is of zero
      length.

   ITR-RLOC-AFI:  This is the address family of the 'ITR-RLOC Address'
      field that follows this field.

   ITR-RLOC Address:  This is used to give the ETR the option of
      selecting the destination address from any address family for the
      Map-Reply message.  This address MUST be a routable RLOC address
      of the sender of the Map-Request message.

   EID mask-len:  This is the mask length for the EID-Prefix.

   EID-Prefix-AFI:  This is the address family of the EID-Prefix
      according to [AFI].

   EID-Prefix:  This prefix is 4 octets for an IPv4 address family and
      16 octets for an IPv6 address family.  When a Map-Request is sent
      by an ITR because a data packet is received for a destination
      where there is no mapping entry, the EID-Prefix is set to the
      destination IP address of the data packet, and the 'EID mask-len'
      is set to 32 or 128 for IPv4 or IPv6, respectively.  When an xTR
      wants to query a site about the status of a mapping it already has
      cached, the EID-Prefix used in the Map-Request has the same mask
      length as the EID-Prefix returned from the site when it sent a
      Map-Reply message.
Top   ToC   RFC6830 - Page 30
   Map-Reply Record:  When the M-bit is set, this field is the size of a
      single "Record" in the Map-Reply format.  This Map-Reply record
      contains the EID-to-RLOC mapping entry associated with the Source
      EID.  This allows the ETR that will receive this Map-Request to
      cache the data if it chooses to do so.

6.1.3. EID-to-RLOC UDP Map-Request Message

A Map-Request is sent from an ITR when it needs a mapping for an EID, wants to test an RLOC for reachability, or wants to refresh a mapping before TTL expiration. For the initial case, the destination IP address used for the Map-Request is the data packet's destination address (i.e., the destination EID) that had a mapping cache lookup failure. For the latter two cases, the destination IP address used for the Map-Request is one of the RLOC addresses from the Locator-Set of the Map-Cache entry. The source address is either an IPv4 or IPv6 RLOC address, depending on whether the Map-Request is using an IPv4 or IPv6 header, respectively. In all cases, the UDP source port number for the Map-Request message is a 16-bit value selected by the ITR/PITR, and the UDP destination port number is set to the well- known destination port number 4342. A successful Map-Reply, which is one that has a nonce that matches an outstanding Map-Request nonce, will update the cached set of RLOCs associated with the EID-Prefix range. One or more Map-Request ('ITR-RLOC-AFI', 'ITR-RLOC-Address') fields MUST be filled in by the ITR. The number of fields (minus 1) encoded MUST be placed in the 'IRC' field. The ITR MAY include all locally configured Locators in this list or just provide one locator address from each address family it supports. If the ITR erroneously provides no ITR-RLOC addresses, the Map-Replier MUST drop the Map-Request. Map-Requests can also be LISP encapsulated using UDP destination port 4342 with a LISP Type value set to "Encapsulated Control Message", when sent from an ITR to a Map-Resolver. Likewise, Map-Requests are LISP encapsulated the same way from a Map-Server to an ETR. Details on Encapsulated Map-Requests and Map-Resolvers can be found in [RFC6833]. Map-Requests MUST be rate-limited. It is RECOMMENDED that a Map-Request for the same EID-Prefix be sent no more than once per second. An ITR that is configured with mapping database information (i.e., it is also an ETR) MAY optionally include those mappings in a Map-Request. When an ETR configured to accept and verify such "piggybacked" mapping data receives such a Map-Request and it does
Top   ToC   RFC6830 - Page 31
   not have this mapping in the map-cache, it MAY originate a "verifying
   Map-Request", addressed to the map-requesting ITR and the ETR MAY add
   a Map-Cache entry.  If the ETR has a Map-Cache entry that matches the
   "piggybacked" EID and the RLOC is in the Locator-Set for the entry,
   then it may send the "verifying Map-Request" directly to the
   originating Map-Request source.  If the RLOC is not in the
   Locator-Set, then the ETR MUST send the "verifying Map-Request" to
   the "piggybacked" EID.  Doing this forces the "verifying Map-Request"
   to go through the mapping database system to reach the authoritative
   source of information about that EID, guarding against RLOC-spoofing
   in the "piggybacked" mapping data.

6.1.4. Map-Reply Message Format

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=2 |P|E|S| Reserved | Record Count | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Nonce . . . | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | . . . Nonce | +-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | Record TTL | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ R | Locator Count | EID mask-len | ACT |A| Reserved | e +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ c | Rsvd | Map-Version Number | EID-Prefix-AFI | o +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ r | EID-Prefix | d +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | /| Priority | Weight | M Priority | M Weight | | L +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | o | Unused Flags |L|p|R| Loc-AFI | | c +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | \| Locator | +-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Top   ToC   RFC6830 - Page 32
   Packet field descriptions:

   Type:   2 (Map-Reply)

   P: This is the probe-bit, which indicates that the Map-Reply is in
      response to a Locator reachability probe Map-Request.  The 'Nonce'
      field MUST contain a copy of the nonce value from the original
      Map-Request.  See Section 6.3.2 for more details.

   E: This bit indicates that the ETR that sends this Map-Reply message
      is advertising that the site is enabled for the Echo-Nonce Locator
      reachability algorithm.  See Section 6.3.1 for more details.

   S: This is the Security bit.  When set to 1, the following
      authentication information will be appended to the end of the
      Map-Reply.  The detailed format of the Authentication Data Content
      is for further study.

     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
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |    AD Type    |       Authentication Data Content . . .       |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

   Reserved:  This field MUST be set to 0 on transmit and MUST be
      ignored on receipt.

   Record Count:  This is the number of records in this reply message.
      A record is comprised of that portion of the packet labeled
      'Record' above and occurs the number of times equal to Record
      Count.

   Nonce:  This is a 24-bit value set in a Data-Probe packet, or a
      64-bit value from the Map-Request is echoed in this 'Nonce' field
      of the Map-Reply.  When a 24-bit value is supplied, it resides in
      the low-order 64 bits of the 'Nonce' field.

   Record TTL:  This is the time in minutes the recipient of the
      Map-Reply will store the mapping.  If the TTL is 0, the entry
      SHOULD be removed from the cache immediately.  If the value is
      0xffffffff, the recipient can decide locally how long to store the
      mapping.

   Locator Count:  This is the number of Locator entries.  A Locator
      entry comprises what is labeled above as 'Loc'.  The Locator count
      can be 0, indicating that there are no Locators for the
      EID-Prefix.
Top   ToC   RFC6830 - Page 33
   EID mask-len:  This is the mask length for the EID-Prefix.

   ACT:  This 3-bit field describes Negative Map-Reply actions.  In any
      other message type, these bits are set to 0 and ignored on
      receipt.  These bits are used only when the 'Locator Count' field
      is set to 0.  The action bits are encoded only in Map-Reply
      messages.  The actions defined are used by an ITR or PITR when a
      destination EID matches a negative Map-Cache entry.  Unassigned
      values should cause a Map-Cache entry to be created, and when
      packets match this negative cache entry, they will be dropped.
      The current assigned values are:

      (0) No-Action:  The map-cache is kept alive, and no packet
                      encapsulation occurs.

      (1) Natively-Forward:  The packet is not encapsulated or dropped
                             but natively forwarded.

      (2) Send-Map-Request:  The packet invokes sending a Map-Request.

      (3) Drop:  A packet that matches this map-cache entry is dropped.
                 An ICMP Destination Unreachable message SHOULD be sent.

   A: The Authoritative bit, when sent, is always set to 1 by an ETR.
      When a Map-Server is proxy Map-Replying [RFC6833] for a LISP site,
      the Authoritative bit is set to 0.  This indicates to requesting
      ITRs that the Map-Reply was not originated by a LISP node managed
      at the site that owns the EID-Prefix.

   Map-Version Number:  When this 12-bit value is non-zero, the
      Map-Reply sender is informing the ITR what the version number is
      for the EID record contained in the Map-Reply.  The ETR can
      allocate this number internally but MUST coordinate this value
      with other ETRs for the site.  When this value is 0, there is no
      versioning information conveyed.  The Map-Version Number can be
      included in Map-Request and Map-Register messages.  See
      Section 6.6.3 for more details.

   EID-Prefix-AFI:  Address family of the EID-Prefix according to [AFI].

   EID-Prefix:  This prefix is 4 octets for an IPv4 address family and
      16 octets for an IPv6 address family.

   Priority:  Each RLOC is assigned a unicast Priority.  Lower values
      are more preferable.  When multiple RLOCs have the same Priority,
      they MAY be used in a load-split fashion.  A value of 255 means
      the RLOC MUST NOT be used for unicast forwarding.
Top   ToC   RFC6830 - Page 34
   Weight:  When priorities are the same for multiple RLOCs, the Weight
      indicates how to balance unicast traffic between them.  Weight is
      encoded as a relative weight of total unicast packets that match
      the mapping entry.  For example, if there are 4 Locators in a
      Locator-Set, where the Weights assigned are 30, 20, 20, and 10,
      the first Locator will get 37.5% of the traffic, the 2nd and 3rd
      Locators will get 25% of the traffic, and the 4th Locator will get
      12.5% of the traffic.  If all Weights for a Locator-Set are equal,
      the receiver of the Map-Reply will decide how to load-split the
      traffic.  See Section 6.5 for a suggested hash algorithm to
      distribute the load across Locators with the same Priority and
      equal Weight values.

   M Priority:  Each RLOC is assigned a multicast Priority used by an
      ETR in a receiver multicast site to select an ITR in a source
      multicast site for building multicast distribution trees.  A value
      of 255 means the RLOC MUST NOT be used for joining a multicast
      distribution tree.  For more details, see [RFC6831].

   M Weight:  When priorities are the same for multiple RLOCs, the
      Weight indicates how to balance building multicast distribution
      trees across multiple ITRs.  The Weight is encoded as a relative
      weight (similar to the unicast Weights) of the total number of
      trees built to the source site identified by the EID-Prefix.  If
      all Weights for a Locator-Set are equal, the receiver of the
      Map-Reply will decide how to distribute multicast state across
      ITRs.  For more details, see [RFC6831].

   Unused Flags:  These are set to 0 when sending and ignored on
      receipt.

   L: When this bit is set, the Locator is flagged as a local Locator to
      the ETR that is sending the Map-Reply.  When a Map-Server is doing
      proxy Map-Replying [RFC6833] for a LISP site, the L-bit is set to
      0 for all Locators in this Locator-Set.

   p: When this bit is set, an ETR informs the RLOC-Probing ITR that the
      locator address for which this bit is set is the one being
      RLOC-probed and MAY be different from the source address of the
      Map-Reply.  An ITR that RLOC-probes a particular Locator MUST use
      this Locator for retrieving the data structure used to store the
      fact that the Locator is reachable.  The p-bit is set for a single
      Locator in the same Locator-Set.  If an implementation sets more
      than one p-bit erroneously, the receiver of the Map-Reply MUST
      select the first Locator.  The p-bit MUST NOT be set for
      Locator-Set records sent in Map-Request and Map-Register messages.
Top   ToC   RFC6830 - Page 35
   R: This is set when the sender of a Map-Reply has a route to the
      Locator in the Locator data record.  This receiver may find this
      useful to know if the Locator is up but not necessarily reachable
      from the receiver's point of view.  See also Section 6.4 for
      another way the R-bit may be used.

   Locator:  This is an IPv4 or IPv6 address (as encoded by the
      'Loc-AFI' field) assigned to an ETR.  Note that the destination
      RLOC address MAY be an anycast address.  A source RLOC can be an
      anycast address as well.  The source or destination RLOC MUST NOT
      be the broadcast address (255.255.255.255 or any subnet broadcast
      address known to the router) and MUST NOT be a link-local
      multicast address.  The source RLOC MUST NOT be a multicast
      address.  The destination RLOC SHOULD be a multicast address if it
      is being mapped from a multicast destination EID.

6.1.5. EID-to-RLOC UDP Map-Reply Message

A Map-Reply returns an EID-Prefix with a prefix length that is less than or equal to the EID being requested. The EID being requested is either from the destination field of an IP header of a Data-Probe or the EID record of a Map-Request. The RLOCs in the Map-Reply are globally routable IP addresses of all ETRs for the LISP site. Each RLOC conveys status reachability but does not convey path reachability from a requester's perspective. Separate testing of path reachability is required. See Section 6.3 for details. Note that a Map-Reply may contain different EID-Prefix granularity (prefix + length) than the Map-Request that triggers it. This might occur if a Map-Request were for a prefix that had been returned by an earlier Map-Reply. In such a case, the requester updates its cache with the new prefix information and granularity. For example, a requester with two cached EID-Prefixes that are covered by a Map-Reply containing one less-specific prefix replaces the entry with the less-specific EID-Prefix. Note that the reverse, replacement of one less-specific prefix with multiple more-specific prefixes, can also occur, not by removing the less-specific prefix but rather by adding the more-specific prefixes that, during a lookup, will override the less-specific prefix.
Top   ToC   RFC6830 - Page 36
   When an ETR is configured with overlapping EID-Prefixes, a
   Map-Request with an EID that best matches any EID-Prefix MUST be
   returned in a single Map-Reply message.  For instance, if an ETR had
   database mapping entries for EID-Prefixes:

     10.0.0.0/8
     10.1.0.0/16
     10.1.1.0/24
     10.1.2.0/24

   A Map-Request for EID 10.1.1.1 would cause a Map-Reply with a record
   count of 1 to be returned with a mapping record EID-Prefix of
   10.1.1.0/24.

   A Map-Request for EID 10.1.5.5 would cause a Map-Reply with a record
   count of 3 to be returned with mapping records for EID-Prefixes
   10.1.0.0/16, 10.1.1.0/24, and 10.1.2.0/24.

   Note that not all overlapping EID-Prefixes need to be returned but
   only the more-specific entries (note that in the second example above
   10.0.0.0/8 was not returned for requesting EID 10.1.5.5) for the
   matching EID-Prefix of the requesting EID.  When more than one
   EID-Prefix is returned, all SHOULD use the same Time to Live value so
   they can all time out at the same time.  When a more-specific
   EID-Prefix is received later, its Time to Live value in the Map-Reply
   record can be stored even when other less-specific entries exist.
   When a less-specific EID-Prefix is received later, its map-cache
   expiration time SHOULD be set to the minimum expiration time of any
   more-specific EID-Prefix in the map-cache.  This is done so the
   integrity of the EID-Prefix set is wholly maintained and so no more-
   specific entries are removed from the map-cache while keeping less-
   specific entries.

   Map-Replies SHOULD be sent for an EID-Prefix no more often than once
   per second to the same requesting router.  For scalability, it is
   expected that aggregation of EID addresses into EID-Prefixes will
   allow one Map-Reply to satisfy a mapping for the EID addresses in the
   prefix range, thereby reducing the number of Map-Request messages.

   Map-Reply records can have an empty Locator-Set.  A Negative
   Map-Reply is a Map-Reply with an empty Locator-Set.  Negative
   Map-Replies convey special actions by the sender to the ITR or PITR
   that have solicited the Map-Reply.  There are two primary
   applications for Negative Map-Replies.  The first is for a
   Map-Resolver to instruct an ITR or PITR when a destination is for a
   LISP site versus a non-LISP site, and the other is to source quench
   Map-Requests that are sent for non-allocated EIDs.
Top   ToC   RFC6830 - Page 37
   For each Map-Reply record, the list of Locators in a Locator-Set MUST
   appear in the same order for each ETR that originates a Map-Reply
   message.  The Locator-Set MUST be sorted in order of ascending IP
   address where an IPv4 locator address is considered numerically 'less
   than' an IPv6 locator address.

   When sending a Map-Reply message, the destination address is copied
   from one of the 'ITR-RLOC' fields from the Map-Request.  The ETR can
   choose a locator address from one of the address families it
   supports.  For Data-Probes, the destination address of the Map-Reply
   is copied from the source address of the Data-Probe message that is
   invoking the reply.  The source address of the Map-Reply is one of
   the local IP addresses chosen to allow Unicast Reverse Path
   Forwarding (uRPF) checks to succeed in the upstream service provider.
   The destination port of a Map-Reply message is copied from the source
   port of the Map-Request or Data-Probe, and the source port of the
   Map-Reply message is set to the well-known UDP port 4342.

6.1.5.1. Traffic Redirection with Coarse EID-Prefixes
When an ETR is misconfigured or compromised, it could return coarse EID-Prefixes in Map-Reply messages it sends. The EID-Prefix could cover EID-Prefixes that are allocated to other sites, redirecting their traffic to the Locators of the compromised site. To solve this problem, there are two basic solutions that could be used. The first is to have Map-Servers proxy Map-Reply on behalf of ETRs so their registered EID-Prefixes are the ones returned in Map-Replies. Since the interaction between an ETR and Map-Server is secured with shared keys, it is easier for an ETR to detect misbehavior. The second solution is to have ITRs and PITRs cache EID-Prefixes with mask lengths that are greater than or equal to a configured prefix length. This limits the damage to a specific width of any EID-Prefix advertised but needs to be coordinated with the allocation of site prefixes. These solutions can be used independently or at the same time. At the time of this writing, other approaches are being considered and researched.

6.1.6. Map-Register Message Format

The usage details of the Map-Register message can be found in specification [RFC6833]. This section solely defines the message format. The message is sent in UDP with a destination UDP port of 4342 and a randomly selected UDP source port number.
Top   ToC   RFC6830 - Page 38
   The Map-Register message format is:

        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|            Reserved               |M| Record Count  |
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
       |                         Nonce . . .                           |
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
       |                         . . . Nonce                           |
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
       |            Key ID             |  Authentication Data Length   |
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
       ~                     Authentication Data                       ~
   +-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |   |                          Record TTL                           |
   |   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   R   | Locator Count | EID mask-len  | ACT |A|      Reserved         |
   e   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   c   | Rsvd  |  Map-Version Number   |        EID-Prefix-AFI         |
   o   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   r   |                          EID-Prefix                           |
   d   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |  /|    Priority   |    Weight     |  M Priority   |   M Weight    |
   | L +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   | o |        Unused Flags     |L|p|R|           Loc-AFI             |
   | c +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |  \|                             Locator                           |
   +-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

   Packet field descriptions:

   Type:   3 (Map-Register)

   P: This is the proxy Map-Reply bit.  When set to 1, an ETR sends a
      Map-Register message requesting the Map-Server to proxy a
      Map-Reply.  The Map-Server will send non-authoritative Map-Replies
      on behalf of the ETR.  Details on this usage can be found in
      [RFC6833].

   Reserved:  This field MUST be set to 0 on transmit and MUST be
      ignored on receipt.

   M: This is the want-map-notify bit.  When set to 1, an ETR is
      requesting a Map-Notify message to be returned in response to
      sending a Map-Register message.  The Map-Notify message sent by a
      Map-Server is used to acknowledge receipt of a Map-Register
      message.
Top   ToC   RFC6830 - Page 39
   Record Count:  This is the number of records in this Map-Register
      message.  A record is comprised of that portion of the packet
      labeled 'Record' above and occurs the number of times equal to
      Record Count.

   Nonce:  This 8-octet 'Nonce' field is set to 0 in Map-Register
      messages.  Since the Map-Register message is authenticated, the
      'Nonce' field is not currently used for any security function but
      may be in the future as part of an anti-replay solution.

   Key ID:  This is a configured ID to find the configured Message
      Authentication Code (MAC) algorithm and key value used for the
      authentication function.  See Section 14.4 for codepoint
      assignments.

   Authentication Data Length:  This is the length in octets of the
      'Authentication Data' field that follows this field.  The length
      of the 'Authentication Data' field is dependent on the MAC
      algorithm used.  The length field allows a device that doesn't
      know the MAC algorithm to correctly parse the packet.

   Authentication Data:  This is the message digest used from the output
      of the MAC algorithm.  The entire Map-Register payload is
      authenticated with this field preset to 0.  After the MAC is
      computed, it is placed in this field.  Implementations of this
      specification MUST include support for HMAC-SHA-1-96 [RFC2404],
      and support for HMAC-SHA-256-128 [RFC4868] is RECOMMENDED.

   The definition of the rest of the Map-Register can be found in
   Section 6.1.4.

6.1.7. Map-Notify Message Format

The usage details of the Map-Notify message can be found in specification [RFC6833]. This section solely defines the message format. The message is sent inside a UDP packet with source and destination UDP ports equal to 4342.
Top   ToC   RFC6830 - Page 40
   The Map-Notify message format is:

        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                 | Record Count  |
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
       |                         Nonce . . .                           |
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
       |                         . . . Nonce                           |
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
       |            Key ID             |  Authentication Data Length   |
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
       ~                     Authentication Data                       ~
   +-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |   |                          Record TTL                           |
   |   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   R   | Locator Count | EID mask-len  | ACT |A|      Reserved         |
   e   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   c   | Rsvd  |  Map-Version Number   |         EID-Prefix-AFI        |
   o   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   r   |                          EID-Prefix                           |
   d   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |  /|    Priority   |    Weight     |  M Priority   |   M Weight    |
   | L +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   | o |        Unused Flags     |L|p|R|           Loc-AFI             |
   | c +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |  \|                             Locator                           |
   +-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

   Packet field descriptions:

   Type:   4 (Map-Notify)

   The Map-Notify message has the same contents as a Map-Register
   message.  See the Map-Register section for field descriptions.
Top   ToC   RFC6830 - Page 41

6.1.8. Encapsulated Control Message Format

An Encapsulated Control Message (ECM) is used to encapsulate control packets sent between xTRs and the mapping database system described in [RFC6833]. 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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ / | IPv4 or IPv6 Header | OH | (uses RLOC addresses) | \ | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ / | Source Port = xxxx | Dest Port = 4342 | UDP +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ \ | UDP Length | UDP Checksum | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ LH |Type=8 |S| Reserved | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ / | IPv4 or IPv6 Header | IH | (uses RLOC or EID addresses) | \ | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ / | Source Port = xxxx | Dest Port = yyyy | UDP +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ \ | UDP Length | UDP Checksum | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ LCM | LISP Control Message | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Packet header descriptions: OH: The outer IPv4 or IPv6 header, which uses RLOC addresses in the source and destination header address fields. UDP: The outer UDP header with destination port 4342. The source port is randomly allocated. The checksum field MUST be non-zero. LH: Type 8 is defined to be a "LISP Encapsulated Control Message", and what follows is either an IPv4 or IPv6 header as encoded by the first 4 bits after the 'Reserved' field. S: This is the Security bit. When set to 1, the field following the 'Reserved' field will have the following format. The detailed format of the Authentication Data Content is for further study.
Top   ToC   RFC6830 - Page 42
     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
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |    AD Type    |       Authentication Data Content . . .       |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

   IH:   The inner IPv4 or IPv6 header, which can use either RLOC or EID
         addresses in the header address fields.  When a Map-Request is
         encapsulated in this packet format, the destination address in
         this header is an EID.

   UDP:  The inner UDP header, where the port assignments depend on the
         control packet being encapsulated.  When the control packet is
         a Map-Request or Map-Register, the source port is selected by
         the ITR/PITR and the destination port is 4342.  When the
         control packet is a Map-Reply, the source port is 4342 and the
         destination port is assigned from the source port of the
         invoking Map-Request.  Port number 4341 MUST NOT be assigned to
         either port.  The checksum field MUST be non-zero.

   LCM:  The format is one of the control message formats described in
         this section.  At this time, only Map-Request messages are
         allowed to be encapsulated.  In the future, PIM Join/Prune
         messages [RFC6831] might be allowed.  Encapsulating other types
         of LISP control messages is for further study.  When
         Map-Requests are sent for RLOC-Probing purposes (i.e., the
         probe-bit is set), they MUST NOT be sent inside Encapsulated
         Control Messages.



(page 42 continued on part 3)

Next Section