home *** CD-ROM | disk | FTP | other *** search
/ Unix System Administration Handbook 1997 October / usah_oct97.iso / rfc / 1200s / rfc1241.txt < prev    next >
Text File  |  1991-07-01  |  42KB  |  955 lines

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