home *** CD-ROM | disk | FTP | other *** search
/ A Beginner's Guide to the Internet / INTERNET.ISO / text / rfc / rfc1241.txt < prev    next >
Encoding:
Text File  |  1996-03-03  |  41.5 KB  |  959 lines

  1.  
  2. C:\TM\RFC>cmpr -dv 
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9. Network Working Group                                       R. Woodburn
  10. Request for Comments: 1241                                         SAIC
  11.                                                                D. Mills
  12.                                                  University of Delaware
  13.                                                               July 1991
  14.  
  15.  
  16.             A Scheme for an Internet Encapsulation Protocol:
  17.                                Version 1
  18.  
  19. 1. Status of this Memo
  20.  
  21.    This memo defines an Experimental Protocol for the Internet
  22.    community.  Discussion and suggestions for improvement are requested.
  23.    Please refer to the current edition of the "IAB Official Protocol
  24.    Standards" for the standardization state and status of this protocol.
  25.    Distribution of this memo is unlimited.
  26.  
  27. 2. Glossary
  28.  
  29.    Clear Datagram -
  30.      The unmodified IP datagram in the User Space before
  31.      Encapsulation.
  32.  
  33.    Clear Header -
  34.      The header portion of the Clear Datagram before
  35.      Encapsulation.  This header includes the IP header and
  36.      possibly part or all of the next layer protocol header,
  37.      i.e., the TCP header.
  38.  
  39.    Decapsulation -
  40.      The stripping of the Encapsulation Header and forwarding
  41.      of the Clear Datagram by the Decapsulator.
  42.  
  43.    Decapsulator -
  44.      The entity responsible for receiving an Encapsulated
  45.      Datagram, decapsulating it, and delivering it to the
  46.      destination User Space.  Delivery may be direct, or via
  47.      Encapsulation.  A Decapsulator may be a host or a gateway.
  48.  
  49.    Encapsulated Datagram -
  50.      The datagram consisting of a Clear Datagram prepended with
  51.      an Encapsulation Header.
  52.  
  53.    Encapsulation -
  54.      The process of mapping a Clear Datagram to the
  55.      Encapsulation Space, prepending an Encapsulation Header to
  56.      the Clear Datagram and routing the Encapsulated Datagram
  57.  
  58.  
  59.  
  60. Woodburn & Mills                                                [Page 1]
  61.  
  62. RFC 1241                 Internet Encapsulation                July 1991
  63.  
  64.  
  65.      to a Decapsulator.
  66.  
  67.    Encapsulation Header -
  68.      The header for the Encapsulation Protocol prepended to the
  69.      Clear Datagram during Encapsulation.  This header consists
  70.      of an IP header followed by an Encapsulation Protocol
  71.      Header.
  72.  
  73.    Encapsulation Protocol Header -
  74.      The Encapsulation Protocol specific portion of the
  75.      Encapsulation Header.
  76.  
  77.    Encapsulation Space -
  78.      The address and routing space within which the
  79.      Encapsulators and Decapsulators reside.  Routing within
  80.      this space is accomplished via Flows.  Encapsulation
  81.      Spaces do not overlap, that is, the address of any
  82.      Encapsulator or Decapsulator is unique for all
  83.      Encapsulation Spaces.
  84.  
  85.    Encapsulator -
  86.      The entity responsible for mapping a given User Space
  87.      datagram to the Encapsulation Space, encapsulating the
  88.      datagram, and forwarding the Encapsulated Datagram to a
  89.      Decapsulator.  An Encapsulator may be a host or a gateway.
  90.  
  91.    Flow -
  92.      Also called a "tunnel."  A flow is the end-to-end path in
  93.      the Encapsulation Space over which Encapsulated Datagrams
  94.      travel.  There may be several Encapsulator/Decapsulator
  95.      pairs along a given flow.  Note that a Flow does not
  96.      denote what User Space gateways are traversed along the
  97.      path.
  98.  
  99.    Flow ID -
  100.      A 32-bit identifier which uniquely distinguishes a flow in
  101.      a given Encapsulator or Decapsulator.  Flow IDs are
  102.      specific to a single Encapsulator/Decapsulator Entity and
  103.      are not global quantities.
  104.  
  105.    Mapping Function -
  106.      This is the function of mapping a Clear Header to a
  107.      particular Flow.  All encapsulators along a given Flow are
  108.      required to map a given Clear Header to the same Flow.
  109.  
  110.    User Address -
  111.      The address or identifier uniquely identifying an entity
  112.      within a User Space.
  113.  
  114.  
  115.  
  116. Woodburn & Mills                                                [Page 2]
  117.  
  118. RFC 1241                 Internet Encapsulation                July 1991
  119.  
  120.  
  121.    Source Route -
  122.      A complete end-to-end route which is computed at the
  123.      source and enumerates transit gateways.
  124.  
  125.    User Space -
  126.      The address and routing space within which the users
  127.      reside.  Routing within this space provides reachability
  128.      between all address pairs within the space.  User Spaces
  129.      do not overlap, that is, a given User Address is unique in
  130.      all User Spaces.
  131.  
  132. 3. Background
  133.  
  134.    For several years researchers in the Internet community have needed a
  135.    means of "tunneling" between networks.  A tunnel is essentially a
  136.    Source Route that circumvents conventional routing mechanisms.
  137.    Tunnels provide the means to bypass routing failures, avoid broken
  138.    gateways and routing domains, or establish deterministic paths for
  139.    experimentation.
  140.  
  141.    There are several means of accomplishing tunneling.  In the past,
  142.    tunneling has been accomplished through source routing options in the
  143.    IP header which allow gateways along a given path to be enumerated.
  144.    The disadvantage of source routing in the IP header is that it
  145.    requires the source to know something about the networks traversed to
  146.    reach the destination.  The source must then modify outgoing packets
  147.    to reflect the source route.  Current routing implementations
  148.    generally don't support source routes in their routing tables as a
  149.    means of reaching an IP address, nor do current routing protocols.
  150.  
  151.    Another means of tunneling would be to develop a new IP option.  This
  152.    option field would be part of a separate IP header that could be
  153.    prepended to an IP datagram.  The IP option would indicate
  154.    information about the original datagram.  This tunneling option has
  155.    the disadvantage of significantly modifying existing IP
  156.    implementations to handle a new IP option.  It also would be less
  157.    flexible in permitting the tunneling of other protocols, such as ISO
  158.    protocols, through an IP environment.  An even less palatable
  159.    alternative would be to replace IP with a new networking protocol or
  160.    a new version of IP with tunneling built in as part of its
  161.    functionality.
  162.  
  163.    A final alternative is to create a new IP encapsulation protocol
  164.    which uses the current IP header format.  By using encapsulation, a
  165.    destination can be reached transparently without the source having to
  166.    know topology specifics.  Virtual networks can be created by tying
  167.    otherwise unconnected machines together with flows through an
  168.    encapsulation space.
  169.  
  170.  
  171.  
  172. Woodburn & Mills                                                [Page 3]
  173.  
  174. RFC 1241                 Internet Encapsulation                July 1991
  175.  
  176.  
  177.                                                ++++++  Clear Datagram
  178.                                                ******  Encapsulated
  179.        Datagram
  180.                                                     #
  181.        Encapsulator/Decapsulator
  182.                                                     &  User Space Host
  183.  
  184.  
  185.            User Space A                        User Space C
  186.  
  187.           --------------                    -----------
  188.          /              \                  /           \
  189.         /                \                /             \
  190.        |                  |              |               |
  191.        |     &            |              |               |
  192.        |     +   +++++    |              |      *****    |
  193.        |     +++++   +    |              |      *   *    |
  194.        |             +    |              |  *****   *    |
  195.         \            +   /  -----------  \ *       *    /  ----------
  196.          \           ++> # *         **> # *        ***> # ++++      \
  197.           --------------  / *        *  \  ------------  /   +        \
  198.                          |  *        *   |              |    +         |
  199.                          |  *        *   |              |    +         |
  200.                          |  *****    *   |              |    +++++++   |
  201.                          |      *****    |              |          V   |
  202.                          |               |              |          &   |
  203.                           \             /                \             /
  204.                            \           /                  \           /
  205.                             -----------                    ----------
  206.                            Encapsulation                      User
  207.                               Space B                        Space D
  208.  
  209.  
  210.                   Fig. 1.  Encapsulation Architectural Model
  211.  
  212.    Up until now, there has been no standard for an encapsulation
  213.    protocol.  This RFC provides a means of performing encapsulation in
  214.    the Internet environment.
  215.  
  216. 4. Architecture and Approach
  217.  
  218.    The architecture for encapsulation is based on two entities -- an
  219.    Encapsulator and a Decapsulator.  These entities and the associated
  220.    spaces are shown in Fig. 1.
  221.  
  222.    Encapsulators and Decapsulators have addresses in the User Spaces to
  223.    which they belong, as well as addresses in the Encapsulation Spaces
  224.    to which they belong. An encapsulator will receive a Clear Datagram
  225.  
  226.  
  227.  
  228. Woodburn & Mills                                                [Page 4]
  229.  
  230. RFC 1241                 Internet Encapsulation                July 1991
  231.  
  232.  
  233.    from its User Space, and after determining that encapsulation should
  234.    be used, perform a mapping function which translates the User Space
  235.    information in the Clear Header to an Encapsulation Header.  This
  236.    Encapsulation Header is then prepended to the Clear Datagram to form
  237.    the Encapsulated Datagram, as in Fig 2.  It is desirable that the
  238.    encapsulation process be transparent to entities in the User Space.
  239.    Only the Encapsulator need know that encapsulation is occurring.
  240.  
  241.          +---------------+-----------------+--------+----------------+
  242.          | Encapsulating |  Encapsulation  | Clear  |  Remainder of  |
  243.          |   IP Header   | Protocol Header | Header | Clear Datagram |
  244.          +---------------+-----------------+--------+----------------+
  245.  
  246.          |                                 |                         |
  247.          |        Encapsulation Header     |      Clear Datagram     |
  248.          |                                 |                         |
  249.  
  250.  
  251.                  Fig. 2.  Example of an Encapsulated Datagram
  252.  
  253.    The Encapsulator forwards the datagram to a Decapsulator whose
  254.    identity is determined at the time of encapsulation.  The
  255.    Decapsulator receives the Encapsulated Datagram and removes the
  256.    Encapsulation Header and treats the Clear Datagram as if it were
  257.    received locally.  The requirement for the address of the
  258.    Decapsulator is that it be reachable from the Encapsulator's
  259.    Encapsulation Space address.
  260.  
  261. 5. Generation of the Encapsulation Header
  262.  
  263.    The contents of the Encapsulation Header are generated by performing
  264.    a mapping function from the Clear Header to the contents of the
  265.    Encapsulation Header.  This mapping function could take many forms,
  266.    but the end result should be the same.  The following paragraphs
  267.    describe one method of performing the mapping.  The process is
  268.    illustrated in Fig. 3.
  269.  
  270.    In the first part of the mapping function, the Clear Header is
  271.    matched with stored headers and masks to determine a Flow ID.  This
  272.    is essentially a "mask-and-match" table look up, where the lookup
  273.    table holds three entries, a Clear Header, a header mask, and a
  274.    corresponding Flow ID.  The mask can be used for allowing a range of
  275.    source and destination addresses to map to a given flow.  Other
  276.    fields, such as the IP TOS bits or even the TCP source or destination
  277.    port addresses could also be used to discriminate between Flows.
  278.    This flexibility allows many possibilities for using the mapping
  279.    function.  Not only can a given network be associated with a
  280.    particular flow, but even a particular TCP protocol or connection
  281.  
  282.  
  283.  
  284. Woodburn & Mills                                                [Page 5]
  285.  
  286. RFC 1241                 Internet Encapsulation                July 1991
  287.  
  288.  
  289.    could be distinguished from another.
  290.  
  291.    How the lookup table is built and maintained is not part of this
  292.    protocol.  It is assumed that it is managed by some higher layer
  293.    entity.  It would be sufficient to configure the tables from ascii
  294.    text files if necessary.
  295.  
  296.                                                 +--------+
  297.                                                 |        |
  298.                                              +->| Encap. |--+
  299.                                              |  | Info.  |  |
  300.                    +-------+                 |  | Table  |  |
  301.                    | Mask  |   +---------+   |  |        |  |
  302.        Clear --+-->|  &    |-->| Flow ID |---+  |        |  |
  303.        Header  |   | Match |   +---------+      +--------+  |
  304.                |   +-------+                                |
  305.                |                                            +-->  Encap
  306.                +----------------------------------------------->  Header
  307.  
  308.  
  309.                 Fig. 3.  Generation of the Encapsulation Header
  310.  
  311.    The Flow IDs are managed at a higher layer as well.  An example of
  312.    how Flow IDs can be managed is found in the Setup protocol of the
  313.    Inter-Domain Policy Sensitive Routing Protocol (IDPR). [4] The upper
  314.    layer protocol would be responsible for maintaining information not
  315.    carried in the encapsulation protocol related to the flow.  This
  316.    could include the information necessary to construct the
  317.    Encapsulation Header (described below) as well as information such as
  318.    the type of data being encapsulated (currently only IP is defined),
  319.    and the type of authentication used if any.  Note that IDPR Setup
  320.    requires the use of a longer Flow ID which is unique for the entire
  321.    universe of Encapsulators and is the same at every Encapsulator.
  322.  
  323.    The Flow ID that results from the mapping of a Clear Header is a 32
  324.    bit quantity and identifies the Flow as it is seen by the
  325.    Encapsulator.  If a Clear Datagram must be encapsulated and
  326.    decapsulated several times in order reach the destination, the Flow
  327.    ID may be different at each Encapsulator, but need not be.  The Flow
  328.    ID acts as an index into a table of Encapsulation Header information
  329.    that is used to build the Encapsulation Header.  Note that the
  330.    decision to make the Flow ID local to the Encapsulator is due to the
  331.    difficulty in choosing and maintaining globally unique identifiers.
  332.  
  333.    The intermediate step of using a Flow ID entirely optional.  The
  334.    important requirement is that all Encapsulators along a Flow map the
  335.    same Clear Header to the same Flow (which could be identified by
  336.    different identifiers along the way).  However, by allowing for a
  337.  
  338.  
  339.  
  340. Woodburn & Mills                                                [Page 6]
  341.  
  342. RFC 1241                 Internet Encapsulation                July 1991
  343.  
  344.  
  345.    Flow ID in the protocol, a more efficient implementation of the
  346.    mapping function becomes possible.  This is discussed in more detail
  347.    when we consider the Decapsulator.
  348.  
  349.    The following information is required to construct the Encapsulation
  350.    Header:
  351.  
  352.    Flow ID -
  353.      This is the key for this table of information and
  354.      represents the Flow ID relative to the current
  355.      Encapsulator.
  356.  
  357.    Decapsulator Address -
  358.      The IP address of the Decapsulator in the Encapsulation
  359.      Space must be known to build the IP portion of the
  360.      Encapsulation Header.
  361.  
  362.    Decapsulator's Flow ID -
  363.      The Flow ID, if any, for the Flow as seen by the
  364.      Decapsulator must be known.
  365.  
  366.    Previous Encapsulator's Address -
  367.      If this is not the first Encapsulator along the Flow, the
  368.      previous Encapsulator's address must be known for error
  369.      reporting.
  370.  
  371.    Previous Encapsulator's Flow ID -
  372.      In addition to the previous Encapsulator's address, the
  373.      Flow ID of the Flow relative to the previous Encapsulator
  374.      must be known.
  375.  
  376.    The Encapsulation Header consists of an IP Header as well as an
  377.    Encapsulation Protocol Header.  The two pieces of information
  378.    required for the Encapsulation Protocol Header which must be
  379.    determined at the time of encapsulation are the protocol which is
  380.    being encapsulated and the Flow ID to send to the Decapsulator.  The
  381.    generation of the IP header is more complicated.
  382.  
  383.    There are  two possible ways each field in the Clear Header could
  384.    related to the new IP header.
  385.  
  386.    Copy -
  387.      Copy the existing field from the Clear Header to the IP
  388.      header in the Encapsulation Header.
  389.  
  390.    Ignore -
  391.      The field may or may not have existed in the Clear Header,
  392.      but does not apply to the new IP header.
  393.  
  394.  
  395.  
  396. Woodburn & Mills                                                [Page 7]
  397.  
  398. RFC 1241                 Internet Encapsulation                July 1991
  399.  
  400.  
  401.    The IP header has a fixed portion and a variable portion, the options
  402.    list.  A summary of all possible IP fields and the relation to the
  403.    Clear Header follows in Table 1. [2]
  404.  
  405.    Note that most of the fields in the Clear Header are simply ignored.
  406.    Fields such as the Header Length in the Clear Header have no effect
  407.    on the Header Length of the new IP header.  The fields which are more
  408.    interesting and require some thought are now discussed.
  409.  
  410.    The Quality of Service bits should be copied from the Clear Header to
  411.    the new IP header.  This is in keeping with the transparency
  412.    principle that if the User Space was providing a given service, then
  413.    the Encapsulation Space must provide the same service.
  414.  
  415.    The More Fragments bit and Fragment Offset should not be copied,
  416.    since the datagram being built is a complete datagram, regardless of
  417.    the status of the encapsulated datagram.  If the completed datagram
  418.    is too large for the interface, it will be fragmented for
  419.    transmission to the decapsulator by the normal IP fragmentation
  420.    mechanism.
  421.  
  422.    The Don't Fragment bit should not be copied into the Encapsulation
  423.    Header.  The transparency principle would again be violated.  It
  424.    should be up to the Encapsulator to decide whether fragmentation
  425.    should be allowed across the Encapsulation Space.  If it is decided
  426.    that the DF bit should be used, then ICMP message would be returned
  427.    if the Encapsulated Datagram required fragmentation across the
  428.    Encapsulation Space The mechanism for returning an ICMP message to
  429.    the source in the User space will have to be modified, however, and
  430.    this is discussed in the Appendix B.
  431.  
  432.    Regarding the Time To Live (TTL) field, the easiest thing to do is to
  433.    ignore the TTL from the Clear Header.  If this field were copied from
  434.    the Clear Header to the new IP header, the packet life might be
  435.    prematurely exceeded during transit in the Encapsulation Space.  This
  436.    breaks the transparency rule of encapsulation as seen from the User
  437.    Space.  The TTL of the Clear Header is decremented before
  438.    encapsulation by the IP forwarding function, so there is no chance of
  439.    a packet looping forever if the links of a Flow form a loop.
  440.  
  441.  
  442.  
  443.  
  444.  
  445.  
  446.  
  447.  
  448.  
  449.  
  450.  
  451.  
  452. Woodburn & Mills                                                [Page 8]
  453.  
  454. RFC 1241                 Internet Encapsulation                July 1991
  455.  
  456.  
  457.                           +---------------------+---------+
  458.                           |        Field        | Mapping |
  459.                           +---------------------+---------+
  460.                           | Version             | Ignore  |
  461.                           | Header Length       | Ignore  |
  462.                           | Precedence          | Copy    |
  463.                           | QoS bits            | Copy    |
  464.                           | Total Length        | Ignore  |
  465.                           | Identification      | Ignore  |
  466.                           | Don't Fragment Bit  | Ignore  |
  467.                           | More Fragments Bit  | Ignore  |
  468.                           | Fragment Offset     | Ignore  |
  469.                           | Time to Live        | Ignore  |
  470.                           | Protocol            | Ignore  |
  471.                           | Header Checksum     | Ignore  |
  472.                           | Source Address      | Ignore  |
  473.                           | Destination Address | Ignore  |
  474.                           | End of Option List  | Ignore  |
  475.                           | NOP Option          | Ignore  |
  476.                           | Security Option     | Copy    |
  477.                           | LSR Option          | Ignore  |
  478.                           | SSR Option          | Ignore  |
  479.                           | RR Option           | Ignore  |
  480.                           | Stream ID Option    | Ignore  |
  481.                           | Timestamp Option    | Ignore  |
  482.                           +---------------------+---------+
  483.  
  484.                        Table 1.  Summary of IP Header Mappings
  485.  
  486.    The protocol field for the new IP header should be filled with the
  487.    protocol number of the encapsulation protocol.
  488.  
  489.    The source address in the new IP header becomes the IP address of the
  490.    Encapsulator in the Encapsulation Domain.  The destination address
  491.    becomes the IP address of the Decapsulator as found in the
  492.    encapsulation table.
  493.  
  494.    IP Options are generally not copied because most don't make sense in
  495.    the context of the Encapsulation Space, as the transparency principle
  496.    would indicate.  The security option is probably the one option that
  497.    should get copied for the same reason QOS and precedence fields are
  498.    copied, the Encapsulation Space must provide the expected service.
  499.    Timestamp, Loose Source Route, Strict Source Route, and Record Route
  500.    are not copied during encapsulation.
  501.  
  502. 6. Decapsulation
  503.  
  504.    In the ideal situation, a Decapsulator receives an Encapsulated
  505.  
  506.  
  507.  
  508. Woodburn & Mills                                                [Page 9]
  509.  
  510. RFC 1241                 Internet Encapsulation                July 1991
  511.  
  512.  
  513.    Datagram, strips off the Encapsulation Header and sends the Clear
  514.    Datagram back into IP so that it is forwarded from that point.
  515.    However, if the Clear Datagram has not reached the destination User
  516.    Space, it must again be encapsulated to move it close to the
  517.    destination User Space.  In this latter case the Decapsulator would
  518.    become an Encapsulator and would perform the same calculation to
  519.    generate the Encapsulation Header as did the previous Encapsulator.
  520.    In order to make this process more efficient, the use of Flow IDs
  521.    have been incorporated into the protocol.
  522.  
  523.    When Flow IDs are used, the Flow ID received in the Encapsulation
  524.    Header corresponds to a stored Flow ID in the Decapsulator.  At this
  525.    point the Decapsulator has the option of bypassing the mask and match
  526.    operation on the Clear Header.  The received Flow ID can be used to
  527.    point directly into the local Encapsulator tables for the
  528.    construction of the next Encapsulation Header.  If the Flow ID is
  529.    unknown, an error message is sent back to the previous Encapsulator
  530.    to that effect and a signal is sent to upper layer entity managing
  531.    the encapsulation tables.
  532.  
  533.    Because the normal IP forwarding mechanism is being bypassed when
  534.    Flow IDs are used, certain mechanisms normally handled by IP must be
  535.    taken care of by the Decapsulator before encapsulation.  The
  536.    Decapsulator must decrement the TTL before the next encapsulation
  537.    occurs.  If a Time Exceeded error occurs, then an ICMP message is
  538.    sent to the source indicated in the Clear Header.
  539.  
  540. 7. Error Messages
  541.  
  542.    There are two kinds of error message built into the encapsulation
  543.    protocol.  The first is used to report unknown flow identifiers seen
  544.    by a Decapsulator and the second is for the forwarding of ICMP
  545.    messages.
  546.  
  547.    When a Decapsulator is using the received Flow ID in an Encapsulation
  548.    Header to forward a datagram to the next Decapsulator in a Flow, it
  549.    is possible that the Flow ID may not be known.  For this case the
  550.    Decapsulator will notify the previous Encapsulator that the Flow was
  551.    not known so that the problem may be reported to the layer
  552.    responsible for the programming of the Flow tables.  This is
  553.    accomplished through an encapsulation error message.
  554.  
  555.    If an Encapsulator receives an ICMP messages regarding a given flow,
  556.    this message should be forwarded backwards along the flow to the
  557.    source Encapsulator.  This is accomplished by the second kind of
  558.    error message.  The ICMP message will contain the Flow ID of the
  559.    message which caused the error.  This Flow ID must be translated to
  560.    the Flow ID relative to the Encapsulator to which the error message
  561.  
  562.  
  563.  
  564. Woodburn & Mills                                               [Page 10]
  565.  
  566. RFC 1241                 Internet Encapsulation                July 1991
  567.  
  568.  
  569.    is sent.
  570.  
  571.    If an error occurs while sending any error message, no further error
  572.    message are generated.
  573.  
  574. 8. References
  575.  
  576.    [1]  J. Postel,  Internet  Control  Message  Protocol,  RFC  792,
  577.         September 1981.
  578.  
  579.    [2]  J. Postel, Internet Protocol, RFC 791, September 1981.
  580.  
  581.    [3]  J. Postel, Transmission Control Protocol, RFC 793, September
  582.         1981.
  583.  
  584.    [4]  ORWG, Inter-Domain Policy Routing Protocol Specification and
  585.         Usage, Draft, August 1990
  586.  
  587. A. Packet Formats
  588.  
  589.    This section describes the packet formats for the encapsulation
  590.    protocol.
  591.  
  592.         0               8              16              24            31
  593.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  594.        | Vers  |  HL   |  MT   |  RC   |            Checksum           |
  595.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  596.        |                            Flow ID                            |
  597.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  598.  
  599.                   Fig. A.1.  Encapsulation Protocol Header Example
  600.  
  601.        Vers      4 bits    The  version   number  of  the  encapsulation
  602.                            protocol.     The  version  of  the  protocol
  603.                            described by this document is 1.
  604.  
  605.        HL        4 bits    The  header   length  of   the  Encapsulation
  606.                            Protocol Header in octets.
  607.  
  608.        MT        4 bits    The  message   type  of   the   Encapsulation
  609.                            Protocol message.    A  data  message  has  a
  610.                            message type  of 1.   An  error message has a
  611.                            message type of 2.
  612.  
  613.        RC        4 bits    The reason code.  This field is unused in the
  614.                            Data Message  and must have a value of 0.  In
  615.                            the Error Message it contains the reason code
  616.                            for the  Error Message.   Defined reason code
  617.  
  618.  
  619.  
  620. Woodburn & Mills                                               [Page 11]
  621.  
  622. RFC 1241                 Internet Encapsulation                July 1991
  623.  
  624.  
  625.                            values are:
  626.  
  627.                                 1 Unknown Flow ID
  628.                                 2 ICMP returned
  629.  
  630.        Checksum  16 bits   A   one's   complement   checksum   for   the
  631.                            Encapsulation Protocol Header.  This field is
  632.                            set to 0 upon calculation of the checksum and
  633.                            is  filled   with  the  checksum  calculation
  634.                            result before the data message is sent.
  635.  
  636.        Flow ID   32 bits   The Flow  ID as  seen by  the Decapsulator or
  637.                            Encapsulator to  which this  message is being
  638.                            sent.   In the  case of  an Unknown  Flow  ID
  639.                            error, the Flow ID causing the error is used.
  640.  
  641. For Data Messages, the Encapsulation Protocol Header is followed by the
  642. Clear Datagram.  For Error Messages, the header is followed by the ICMP
  643. message being forwarded along a flow.
  644.  
  645. B. Encapsulation and Existing IP Mechanisms
  646.  
  647.    This section discusses in detail the effect of this encapsulation
  648.    protocol upon the existing mechanisms available with IP and some the
  649.    possible effects of IP mechanisms upon this protocol.  Specifically
  650.    these are Fragmentation and ICMP messages.
  651.  
  652. B.1 Fragmentation and Maximum Transmission Unit
  653.  
  654.    An immediate concern of using an encapsulation mechanism is that of
  655.    restrictions based upon MTU size.  The source of a Clear Datagram is
  656.    going to generate packets consistent with MTU of the interface over
  657.    which datagram is transmitted.  If these packets reach an
  658.    Encapsulator and are encapsulated, they may be fragmented if they are
  659.    larger than the MTU of the Encapsulator, even though the physical
  660.    interfaces of the source and Encapsulator may have the same MTU.
  661.    Because the Encapsulated Datagram is sent to the Decapsulator using
  662.    IP, there is no problem in allowing IP to perform fragmentation and
  663.    reassembly.  However, fragmentation is known to be inefficient and is
  664.    generally avoided.  Because a new header is being prepended to the
  665.    Clear Datagram by the encapsulation process, the likelihood of
  666.    fragmentation occurring is increased.  If the Encapsulator decides to
  667.    disallow fragmentation through the Encapsulation Space, it must send
  668.    an ICMP message back to the source.  This means that the MTU of the
  669.    interface in the encapsulation space is effectively smaller than that
  670.    of the physical MTU of the interface.
  671.  
  672.    Fragmentation by intermediate User Space Gateways introduces another
  673.  
  674.  
  675.  
  676. Woodburn & Mills                                               [Page 12]
  677.  
  678. RFC 1241                 Internet Encapsulation                July 1991
  679.  
  680.  
  681.    problem.  Fragmentation occurs at the IP level.  If a TCP protocol is
  682.    in use and fragmentation occurs, the TCP header is contained in the
  683.    first fragment, but not the following fragments.  [3] If these
  684.    fragments are forwarded by an Encapsulator, discrimination of the
  685.    Clear Header for a given flow will only be able to occur on the IP
  686.    header portion of the Clear Header.  If discrimination is attempted
  687.    on the TCP portion of the header, then only the first fragment will
  688.    be matched, while remaining fragments will not.
  689.  
  690. B.2 ICMP Messages
  691.  
  692.    The most controversial aspect of encapsulation is the handling of
  693.    ICMP messages. [1] Because the Encapsulation Header contains the
  694.    source address of the Encapsulator in the Encapsulation Space, ICMP
  695.    messages which occur within the Encapsulation Space will be sent back
  696.    to the Encapsulator.  Once the Encapsulator receives the ICMP
  697.    message, the question is what should the next action be.  Since the
  698.    original source of the Clear Datagram knows nothing about the
  699.    Encapsulation Space, it does not make sense to forward an ICMP
  700.    message on to it and ICMP message are not supposed to beget ICMP
  701.    messages.  Yet not sending the original source something may break
  702.    some important mechanisms.
  703.  
  704.    In addition to deciding what to forward to the source of the Clear
  705.    Datagram, there is the problem of possibly not having enough
  706.    information to send anything at all back to the source.  An ICMP
  707.    message returns the header of the offending message and the first
  708.    eight octets of the data after the header.  For the case of the
  709.    encapsulation protocol, this translates to the IP portion of the
  710.    Encapsulation Header, the first eight octets of the Encapsulation
  711.    Protocol Header, and nothing else.  The contents of the Clear
  712.    Datagram are completely lost.  Therefore, for the Encapsulator to
  713.    send an ICMP message back to the source it has to reconstruct the
  714.    Clear Header.  However, it is essentially impossible to reproduce the
  715.    exact header.
  716.  
  717.    For the purpose of this specification, the Flow ID has been assumed
  718.    to be a unique one way mapping from a Clear Header.  There is no
  719.    guarantee that the Flow ID could be used to map back to the Clear
  720.    Header, since several headers potentially map to the same flow.  With
  721.    there being no effective way to regenerate the original datagram,
  722.    some compromises must be examined.
  723.  
  724.    For each of the possible ICMP messages, the alternatives and impact
  725.    will be assessed.  There are three categories of ICMP message
  726.    involved.  The first is those ICMP messages which are not applicable
  727.    in the context of Encapsulation.  These are: Echo/Echo Reply and
  728.    Timestamp/Timestamp Reply.
  729.  
  730.  
  731.  
  732. Woodburn & Mills                                               [Page 13]
  733.  
  734. RFC 1241                 Internet Encapsulation                July 1991
  735.  
  736.  
  737.    The second category are those ICMP messages which concern mechanisms
  738.    local to the encapsulation domain.  These are messages which would
  739.    not make sense to the original source if it did receive them.  In
  740.    these cases the encapsulator will have to decide what to do, but no
  741.    ICMP message need be sent back to the original source.  The datagram
  742.    will simply be lost, IP is not meant to be a reliable protocol.
  743.    Subsequent messages received for encapsulation may cause the
  744.    encapsulator to generate ICMP Destination Unreachable messages back
  745.    to the original source if the encapsulator can no longer send
  746.    messages to the destination decapsulator.  This requires that ICMP
  747.    messages inside the encapsulation domain affect the mapping from the
  748.    Flow ID.  ICMP messages in the second category are: Parameter
  749.    Problem, Redirect, Destination Unreachable, Time Exceeded.
  750.  
  751.    Finally there is one ICMP message which has direct bearing on the
  752.    operation of the original source of datagrams destined for
  753.    encapsulation, the ICMP Source Quench message.  The only possible
  754.    mechanism available to the Encapsulator to handle this message is for
  755.    the source quench message set a flag for the offending Flow ID such
  756.    that subsequent messages that map the Flow cause the generation of a
  757.    source quench back to the original source before the datagram is
  758.    encapsulated.
  759.  
  760.    This last mechanism may be a solution for the more general problem.
  761.    The rule of thumb could be that when an ICMP message is received for
  762.    a given flow, then flag the Flow so that then next message
  763.    encapsulated will cause the next message encapsulated on that flow to
  764.    force an ICMP message to the source.  After the ICMP message is sent
  765.    to the source, the mechanism could be reset.  This would effectively
  766.    cause every other packet to receive an ICMP message if there were a
  767.    persistent problem.  This mechanism is probably only safe for
  768.    Unreachable messages and Source Quench.
  769.  
  770. C. Reception of Clear Datagrams
  771.  
  772.    In order to use the encapsulation protocol a modification is required
  773.    to IP forwarding.  There must be some way for the IP module in a
  774.    system to pass Clear Datagrams to the encapsulation protocol.  A
  775.    suggested means of doing this is to make an addition to a system's
  776.    routing table structures.  A flag could be added to a route that
  777.    tells the forwarding function to use encapsulation.  Note that the
  778.    default route could also be set to use encapsulation.
  779.  
  780.    With this mechanism in place, a system's IP forwarding mechanism
  781.    would examine its routing tables to try and match the IP destination
  782.    to a specific route.  If a route was found, it would be then checked
  783.    to see if encapsulation should be used.  If not the packet would be
  784.    handled normally.  If encapsulation was turned on for the route, then
  785.  
  786.  
  787.  
  788. Woodburn & Mills                                               [Page 14]
  789.  
  790. RFC 1241                 Internet Encapsulation                July 1991
  791.  
  792.  
  793.    the datagram would be sent to encapsulation for forwarding.
  794.  
  795.    In addition  to snagging packets as they are forwarded, something
  796.    must be  done at  the last  Decapsulator on  a given flow so that
  797.    packets that  are decapsulated  are properly  dumped into  the IP
  798.    module for  delivery.   Because the packets are encapsulated just
  799.    before forwarding,  it should be a simple matter for decapsulated
  800.    datagrams to be injected into the output portion of IP.  However, the
  801.    source  address in  the Clear  Header must  not change.   The address
  802.    must  remain the address of the source in the source User Space and
  803.    not be overwritten with that of the Decapsulator.
  804.  
  805. D. Construction of Virtual Networks with Encapsulation
  806.  
  807.    Because of the modification to the routing table to permit
  808.    encapsulation, it becomes possible to specify a virtual interface
  809.    whose sole purpose is encapsulation.  Using this mechanism, it would
  810.    become possible to link topologically distant entities with Flows.
  811.    This would allow the construction of a Virtual Network which would
  812.    overlay the actual routing topology.  An example of such a virtual
  813.    network is shown in Fig. 4.
  814.  
  815.  
  816.  
  817.  
  818.  
  819.  
  820.  
  821.  
  822.  
  823.  
  824.  
  825.  
  826.  
  827.  
  828.  
  829.  
  830.  
  831.  
  832.  
  833.  
  834.  
  835.  
  836.  
  837.  
  838.  
  839.  
  840.  
  841.  
  842.  
  843.  
  844. Woodburn & Mills                                               [Page 15]
  845.  
  846. RFC 1241                 Internet Encapsulation                July 1991
  847.  
  848.  
  849.                                       ++++++  Virtual Network A
  850.                                       ******  Virtual Network B
  851.                                            #  Encapsulator/Decapsulator
  852.                                       ------  Common Routing Space
  853.  
  854.            ------------                     ------------
  855.           /            \                   /            \
  856.          /      +++ #   \                 /              \
  857.         |  # +++    +    |               |    # ***** #   |
  858.         |  +        +    |               |    *       *   |
  859.         |  +       +     |               |     *     *    |
  860.         |   +      +     |               |      *   *     |
  861.         |   # ++++ # +   |               |       * *      |
  862.          \            + /  -------------  \       # **   /  ---------
  863.           \           + # ++            \ # ******   *** # **        \
  864.            ------------  /  +++          *  ------------  /  ***      \
  865.                         |      #        * |              |      # *** #|
  866.                         |      +      **  |              |      *     *|
  867.                         |      +     #    |              |     *    ** |
  868.                         |      + ++++ *   |              |    *    *   |
  869.                         |       #+     *  |              |   *    *    |
  870.            ------------  \  ++++        */  ------------  \ *    #     /
  871.           /            \ # +             # **           * # *****     /
  872.          /              +  -------------  /  # ****** # *\   --------
  873.         |   # +++++++   +|               |   *        *   |
  874.         |   +        + + |               |   *         *  |
  875.         |    +         # |               |   *          * |
  876.         |    +       ++  |               |   *          # |
  877.         |    # ++++++    |               |   * *********  |
  878.          \              /                 \   #          /
  879.           \            /                   \            /
  880.            ------------                     ------------
  881.  
  882.  
  883.                        Fig. 4.  Virtual Networks Example
  884.  
  885.    Each Encapsulator shown has an virtual interface on one of the
  886.    virtual networks.  The lines represent individual links in the flows
  887.    that connect each member of the virtual network.  Note that new links
  888.    could be added between any points as long as the two entities are
  889.    visible to each other in a common Encapsulation Space.  The routing
  890.    within the virtual network would be handled by the encapsulation
  891.    mechanism.  The programming of the routing tables could be a variant
  892.    of any of the currently existing routing protocols, an encapsulated
  893.    OSPF for example.
  894.  
  895.    With this in mind, it would be possible to have special encapsulation
  896.    gateways with virtual interfaces on two virtual networks to form an
  897.  
  898.  
  899.  
  900. Woodburn & Mills                                               [Page 16]
  901.  
  902. RFC 1241                 Internet Encapsulation                July 1991
  903.  
  904.  
  905.    entire virtual internet.  This is the role of the Encapsulators
  906.    joining Virtual Network A and Virtual Network B.
  907.  
  908. E. Encapsulation and OSI
  909.  
  910.    It is intended that the encapsulation mechanism described in the memo
  911.    be extensible to other environments outside of the Internet.  It
  912.    should be possible to encapsulate many different protocols within IP
  913.    and IP within many other protocols.
  914.  
  915.    The key concepts defined in this memo are the mapping of a header to
  916.    a Flow ID and the mapping of fields in the original header to the
  917.    encapsulating header.  Special mappings between protocols would have
  918.    to be defined, i.e. for the QoS bits, and some sort of translation of
  919.    meanings carefully crafted, but it would be possible, none the less.
  920.  
  921. F. Security Considerations
  922.  
  923.    No means of authentication or integrity checking is specifically
  924.    defined for this protocol apart from the checksum for the header
  925.    information.  However for authentication or integrity checking to be
  926.    used with this protocol, it is suggested that the authentication
  927.    information be appended to the Encapsulated Datagram.  Information
  928.    regarding the type of authentication or integrity check in use would
  929.    have to be included in the flow management protocol which is used to
  930.    distribute the flow information.
  931.  
  932. G. Authors' Addresses
  933.  
  934.    Robert A. Woodburn
  935.    SAIC
  936.    8619 Westwood Center Drive
  937.    Vienna, VA  22182
  938.  
  939.    Phone:  (703) 734-9000 or (703) 448-0210
  940.    EMail:  woody@cseic.saic.com
  941.  
  942.  
  943.    David L. Mills
  944.    Electrical Engineering Department
  945.    University of Delaware
  946.    Newark, DE  19716
  947.  
  948.    Phone:  (302) 451-8247
  949.    EMail:  mills@udel.edu
  950.  
  951.  
  952.  
  953.  
  954.  
  955.  
  956. Woodburn & Mills                                               [Page 17]
  957.  
  958. C:\TM\RFC>
  959.