<?xml version="1.0"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
<?rfc toc="yes"?>

<!--
     ASCII to XML transformation by Invisible Worlds, Inc.
     http://invisible.net/
     Last transformation: 03-Feb-1999, 02:07:54

     Cannonical version of this document is at:
     http://info.internet.isi.edu/in-notes/rfc/files/rfc2004.txt

     Implementors should verify all content with
     cannonical version.  Failure to do so may result in
     protocol failures.
-->

<rfc number="2004"
     category="std">
<front>
<title abbrev="Minimal Encapsulation for IP">Minimal Encapsulation within IP</title>
<author initials="C." surname="Perkins" fullname="Charles Perkins">
<organization>Room H3-D34</organization>
<address>
<postal>
<street>T. J. Watson Research Center</street>
<street>IBM Corporation</street>
<street>30 Saw Mill River Rd.</street>
<street>Hawthorne</street>
<street>NY  10532</street>
</postal>
<facsimile>+1-914-784-6205</facsimile>
<email>perk@watson.ibm.com</email>
</address>
</author>
<date month="October" year="1996"/>
<area>Internet</area>
<keyword>encapsulate</keyword>
<keyword>mobile ip</keyword>
<keyword>routing</keyword>
<keyword>wireless</keyword>
<abstract>
<t>
   This document specifies a method by which an IP datagram may be
   encapsulated (carried as payload) within an IP datagram, with less
   overhead than &quot;conventional&quot; IP encapsulation that adds a second IP
   header to each encapsulated datagram.  Encapsulation is suggested as
   a means to alter the normal IP routing for datagrams, by delivering
   them to an intermediate destination that would otherwise not be
   selected by the (network part of the) IP Destination Address field in
   the original IP header.  Encapsulation may be serve a variety of
   purposes, such as delivery of a datagram to a mobile node using
   Mobile IP.
</t>
</abstract>
</front>
<middle>
<!-- RFC original section: (1.) -->
<section title="Introduction">
<t>
   This document specifies a method by which an IP datagram may be
   encapsulated (carried as payload) within an IP datagram, with less
   overhead than &quot;conventional&quot; IP encapsulation <xref target="_XREF_4"/> that adds a second
   IP header to each encapsulated datagram.  Encapsulation is suggested
   as a means to alter the normal IP routing for datagrams, by
   delivering them to an intermediate destination that would otherwise
   not be selected by the (network part of the) IP Destination Address
   field in the original IP header.  The process of encapsulation and
   decapsulation of a datagram is frequently referred to as &quot;tunneling&quot;
   the datagram, and the encapsulator and decapsulator are then
   considered to be the the &quot;endpoints&quot; of the tunnel; the encapsulator
   node is refered to as the &quot;entry point&quot; of the tunnel, and the
   decapsulator node is refered to as the &quot;exit point&quot; of the tunnel.
</t>
</section>
<!-- RFC original section: (2.) -->
<section title="Motivation">
<t>
   The Mobile IP working group has specified the use of encapsulation as
   a way to deliver packets from a mobile node&apos;s &quot;home network&quot; to an
   agent that can deliver datagrams locally by conventional means to the
   mobile node at its current location away from home <xref target="_XREF_5"/>.  The use of
   encapsulation may also be indicated whenever the source (or an
   intermediate router) of an IP datagram must influence the route by
   which a datagram is to be delivered to its ultimate destination.
   Other possible applications of encapsulation include multicasting,
   preferential billing, choice of routes with selected security
   attributes, and general policy routing.
</t>
<t>
   See <xref target="_XREF_4"/> for a discussion concerning the advantages of encapsulation
   versus use of the IP loose source routing option.  Using IP headers
   to encapsulate IP datagrams requires the unnecessary duplication of
   several fields within the inner IP header; it is possible to save
   some additional space by specifying a new encapsulation mechanism
   that eliminates the duplication.  The scheme outlined here comes from
   the Mobile IP Working Group (in earlier Internet Drafts), and is
   similar to that which had been defined in <xref target="_XREF_2"/>.
</t>
</section>
<!-- RFC original section: (3.) -->
<section title="Minimal Encapsulation">
<t>
   A minimal forwarding header is defined for datagrams which are not
   fragmented prior to encapsulation.  Use of this encapsulating method
   is optional.  Minimal encapsulation MUST NOT be used when an original
   datagram is already fragmented, since there is no room in the minimal
   forwarding header to store fragmentation information.  To encapsulate
   an IP datagram using minimal encapsulation, the minimal forwarding
   header is inserted into the datagram, as follows:
</t>
<figure><artwork>
     +---------------------------+       +---------------------------+
     |                           |       |                           |
     |         IP Header         |       |     Modified IP Header    |
     |                           |       |                           |
     +---------------------------+ ====&gt; +---------------------------+
     |                           |       | Minimal Forwarding Header |
     |                           |       +---------------------------+
     |         IP Payload        |       |                           |
     |                           |       |                           |
     |                           |       |         IP Payload        |
     +---------------------------+       |                           |
                                         |                           |
                                         +---------------------------+
</artwork></figure>
<t>
   The IP header of the original datagram is modified, and the minimal
   forwarding header is inserted into the datagram after the IP header,
   followed by the unmodified IP payload of the original datagram (e.g.,
   transport header and transport data).  No additional IP header is
   added to the datagram.
</t>
<t>
   In encapsulating the datagram, the original IP header <xref target="_XREF_6"/> is modified
   as follows:
<list>
<t>
    -  The Protocol field in the IP header is replaced by protocol
       number 55 for the minimal encapsulation protocol.
</t>
<t>
    -  The Destination Address field in the IP header is replaced by the
       IP address of the exit point of the tunnel.
</t>
<t>
    -  If the encapsulator is not the original source of the datagram,
       the Source Address field in the IP header is replaced by the IP
       address of the encapsulator.
</t>
<t>
    -  The Total Length field in the IP header is incremented by the
       size of the minimal forwarding header added to the datagram.
       This incremental size is either 12 or 8 octets, depending on
       whether or not the Original Source Address Present (S) bit is set
       in the forwarding header.
</t>
<t>
    -  The Header Checksum field in the IP header is recomputed <xref target="_XREF_6"/> or
       updated to account for the changes in the IP header described
       here for encapsulation.
</t></list>
</t>
<t>
    Note that unlike IP-in-IP encapsulation <xref target="_XREF_4"/>, the Time to Live
    (TTL) field in the IP header is not modified during encapsulation;
    if the encapsulator is forwarding the datagram, it will decrement
    the TTL as a result of doing normal IP forwarding.  Also, since
    the original TTL remains in the IP header after encapsulation,
    hops taken by the datagram within the tunnel are visible, for
    example, to &quot;traceroute&quot;.
</t>
<t>
   The format of the minimal forwarding header is as follows:
</t>
<figure><artwork>
    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
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |   Protocol    |S|  reserved   |        Header Checksum        |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                 Original Destination Address                  |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   :            (if present) Original Source Address               :
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
</artwork></figure>
<t><list><t>
      Protocol
<list>
<t>
         Copied from the Protocol field in the original IP header.
</t></list>
</t>
<t>
      Original Source Address Present (S)
<list>
<t>
            0  The Original Source Address field is not present.  The
               length of the minimal tunneling header in this case is
               8 octets.
</t>
<t>
            1  The Original Source Address field is present.  The
               length of the minimal tunneling header in this case is
               12 octets.
</t></list>
</t>
<t>
      reserved
<list>
<t>
         Sent as zero; ignored on reception.
</t></list>
</t>
<t>
      Header Checksum
<list>
<t>
         The 16-bit one&apos;s complement of the one&apos;s complement sum of all
         16-bit words in the minimal forwarding header.  For purposes of
         computing the checksum, the value of the checksum field is 0.
         The IP header and IP payload (after the minimal forwarding
         header) are not included in this checksum computation.
</t></list>
</t>
<t>
      Original Destination Address
<list>
<t>
         Copied from the Destination Address field in the original IP
         header.
</t></list>
</t>
<t>
      Original Source Address
<list>
<t>
         Copied from the Source Address field in the original IP header.
         This field is present only if the Original Source Address
         Present (S) bit is set.
</t></list>
</t></list>
</t>
<t>
   When decapsulating a datagram, the fields in the minimal forwarding
   header are restored to the IP header, and the forwarding header is
   removed from the datagram.  In addition, the Total Length field in
   the IP header is decremented by the size of the minimal forwarding
   header removed from the datagram, and the Header Checksum field in
   the IP header is recomputed <xref target="_XREF_6"/> or updated to account for the changes
   to the IP header described here for decapsulation.
</t>
<t>
   The encapsulator may use existing IP mechanisms appropriate for
   delivery of the encapsulated payload to the tunnel exit point.  In
   particular, use of IP options are allowed, and use of fragmentation
   is allowed unless the &quot;Don&apos;t Fragment&quot; bit is set in the IP header.
   This restriction on fragmentation is required so that nodes employing
   Path MTU Discovery <xref target="_XREF_3"/> can obtain the information they seek.
</t>
</section>
<!-- RFC original section: (4.) -->
<section title="Routing Failures">
<t>
   The use of any encapsulation method for routing purposes brings with
   it increased susceptibility to routing loops.  To cut down the
   danger, a router should follow the same procedures outlined in <xref target="_XREF_4"/>.
</t>
</section>
<!-- RFC original section: (5.) -->
<section title="ICMP Messages from within the Tunnel">
<t>
   ICMP messages are to be handled as specified in <xref target="_XREF_4"/>, including the
   maintenance of tunnel &quot;soft state&quot;.
</t>
</section>
<!-- RFC original section: (6.) -->
<section title="Security Considerations">
<t>
   Security considerations are not addressed in this document, but are
   generally similar to those outlined in <xref target="_XREF_4"/>.
</t>
</section>
<!-- RFC original section: (7.) -->
<section title="Acknowledgements">
<t>
   The original text for much of Section 3 was taken from the Mobile IP
   draft <xref target="_XREF_1"/>.  Thanks to David Johnson for improving consistency and
   making many other improvements to the draft.
</t>
</section>
</middle>
<back>
<!-- BEGIN INCLUDE REFERENCES ** DO NOT REMOVE -->
<references>
<reference anchor="_XREF_1">
<front>
<title>IPv4 Mobility Support,  Work in Progress</title>
<author initials="C." surname="Perkins" fullname="C. Perkins">
<organization/>
</author>
<date month="May" year="1995"/>
</front>
</reference>
<reference anchor="_XREF_2">
<front>
<title abbrev="David B. Johnson. Scalable and Robust Internetwork">David B. Johnson.  Scalable and Robust Internetwork Routing for Mobile Hosts.  In Proceedings of the 14th International Conference on Distributed Computing Systems, pages 2--11</title>
<author>
<organization/>
</author>
<date month="June" year="1994"/>
</front>
</reference>
<reference anchor="_XREF_3">
<front>
<title>Path MTU Discovery</title>
<author initials="J." surname="Mogul" fullname="J. Mogul">
<organization/>
</author>
<author initials="S." surname="Deering" fullname="S. Deering">
<organization/>
</author>
<date month="November" year="1990"/>
</front>
<seriesInfo>RFC 1191</seriesInfo>
</reference>
<reference anchor="_XREF_4">
<front>
<title>IP Encapsulation within IP</title>
<author initials="C." surname="Perkins" fullname="C. Perkins">
<organization/>
</author>
<date month="October" year="1996"/>
</front>
<seriesInfo>RFC 2003</seriesInfo>
</reference>
<reference anchor="_XREF_5">
<front>
<title>IP Mobility Support</title>
<author initials="C." surname="Perkins" fullname="C. Perkins">
<organization/>
</author>
<date month="October" year="1996"/>
</front>
<seriesInfo>RFC 2002</seriesInfo>
</reference>
<reference anchor="_XREF_6">
<front>
<title>Internet Protocol</title>
<author initials="J." surname="Postel" fullname="J. Postel">
<organization/>
</author>
<date month="September" year="1981"/>
</front>
<seriesInfo>STD 5</seriesInfo>
<seriesInfo>RFC 791</seriesInfo>
</reference>
</references>
<!-- END INCLUDE REFERENCES ** DO NOT REMOVE -->
</back>
</rfc>
