home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1997 December / Internet_Info_CD-ROM_Walnut_Creek_December_1997.iso / rfc / rfc2075 < prev    next >
Text File  |  1997-01-08  |  13KB  |  284 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7. Network Working Group                                       C. Partridge
  8. Request for Comments: 2075                                           BBN
  9. Category: Experimental                                      January 1997
  10.  
  11.  
  12.                           IP Echo Host Service
  13.  
  14. Status of this Memo
  15.  
  16.    This memo defines an Experimental Protocol for the Internet
  17.    community.  This memo does not specify an Internet standard of any
  18.    kind.  Discussion and suggestions for improvement are requested.
  19.    Distribution of this memo is unlimited.
  20.  
  21. Abstract
  22.  
  23.    This memo describes how to implement an IP echo host.  IP echo hosts
  24.    send back IP datagrams after exchanging the source and destination IP
  25.    addresses.  The effect is that datagrams sent to the echo host are
  26.    sent back to the source, as if they originated at the echo host.
  27.  
  28. Introduction
  29.  
  30.    An IP echo host returns IP datagrams to their original source host,
  31.    with the IP source and destination addresses reversed, so that the
  32.    returning datagram appears to be coming from the echo host to the
  33.    original source.  IP echo hosts are tremendously useful for debugging
  34.    applications and protocols.  They allow researchers to create looped
  35.    back conversations across the Internet, exposing their traffic to all
  36.    the vagaries of Internet behavior (congestion, cross traffic,
  37.    variable round-trip times and the like) without having to distribute
  38.    prototype software to a large number of test machines.
  39.  
  40.    IP echo hosts were heavily used on the Internet in the late 1970s and
  41.    early 1980s to debug various Internet transport and application
  42.    protocols.  But, for reasons unclear, at the current date there are
  43.    no echo hosts on the Internet and few people are even aware of the
  44.    concept.  The goal of this memo is to document the concept in the
  45.    hopes it will be revived.
  46.  
  47. Implementation Details
  48.  
  49.    While the basic idea of a echo host is simple, there are a few
  50.    implementation details that require attention.  This section
  51.    describes those implementation details.  The presentation works from
  52.    the simplest to most difficult issues.
  53.  
  54.  
  55.  
  56.  
  57.  
  58. Partridge                     Experimental                      [Page 1]
  59.  
  60. RFC 2075                  IP Echo Host Service              January 1997
  61.  
  62.  
  63.    The most straightforward situation is when an echo host receives an
  64.    IP datagram with no options and whose protocol field has a value
  65.    other than 1 (ICMP).  In this case, the echo host modifies the header
  66.    by exchanging the source and destination addresses, decrements the
  67.    TTL by one and updates the IP header checksum.  The host then
  68.    transmits the updated IP datagram back to the original source of the
  69.    datagram.
  70.  
  71.       NOTE: If the TTL is zero or less after decrementing, the datagram
  72.       MUST not be echoed.  In general, an echo host is required to do
  73.       all the various sanity checks that a router or host would do to an
  74.       IP datagram before accepting the datagram for echoing (see STD 3,
  75.       RFC 1122, and RFC 1812).
  76.  
  77.       The TTL MUST be decremented for security reasons noted below.
  78.       Observe, however, that the effect is that hosts using an echo path
  79.       through an echo host SHOULD set their TTL to twice the normal
  80.       value to be sure of achieving connectivity over the echo path.
  81.  
  82.    If an arriving IP datagram has options, the echo host's
  83.    responsibilities are more complex.  In general, the IP source and
  84.    destination are always exchanged and TTL and checksum updated, but in
  85.    certain situations, other special actions may have to take place.
  86.  
  87.    If the datagram contains an incomplete source route option (i.e. the
  88.    echo host is not the final destination), the datagram MUST be
  89.    discarded.  If the datagram contains a complete source route option,
  90.    the source route option MUST be reversed, and the datagram (with
  91.    source and destination IP addresses exchanged and updated TTL) MUST
  92.    be sent back along the reverse source route.
  93.  
  94.    More generally, the goal with any option is to update the option such
  95.    that when the echoed packet is received at the original source, the
  96.    option fields will contain data which makes sense for a datagram
  97.    originating at the echo host.
  98.  
  99.    There is one option for which it is unclear what the correct action.
  100.    The timestamp option is sometimes used for round-trip time
  101.    estimation.  If the option is reset at the echo host, then a history
  102.    of roughly half of the trip delay will be lost.  But if the option is
  103.    not reset, then the timestamp option will appear inconsistent with
  104.    the source and destination addresses of the datagram.  To try to
  105.    balance these two issues, the following rules are suggested:
  106.  
  107.       1. If the first entry in the timestamp option contains the IP
  108.       address of the source host, the entry SHOULD be rewritten to
  109.       contain the IP address of the echo host, and the timestamp option
  110.       pointer SHOULD be truncated so that this timestamp is the only one
  111.  
  112.  
  113.  
  114. Partridge                     Experimental                      [Page 2]
  115.  
  116. RFC 2075                  IP Echo Host Service              January 1997
  117.  
  118.  
  119.       in the list.  (This rewrite makes the option appear consistent
  120.       with the new source and destination IP addresses, and retains the
  121.       source timestamp, while losing information about the path to the
  122.       echo host).
  123.  
  124.       2. If the first entry in the timestamp option does not contain the
  125.       IP address of the source host, the entry SHOULD be echoed back
  126.       unchanged. The echo host SHOULD NOT appear in the timestamp
  127.       option.  (This approach retains the entire history of the path,
  128.       though observe that on a symmetric route, it means every router
  129.       may appear twice in the path).
  130.  
  131.    Finally, if the IP datagram contains an ICMP packet (i.e. the IP
  132.    protocol field value is 1), the datagram SHOULD be discarded.  The
  133.    reason for this rule is that the most likely reason for receiving an
  134.    ICMP datagram is that an echoed datagram has encountered a problem at
  135.    some router in the path and the router has sent back an ICMP
  136.    datagram.  Echoing the ICMP datagram back to the router may confuse
  137.    the router and thus SHOULD be avoided.  (This rule simply follows the
  138.    Internet maxim of being conservative in what we send).
  139.  
  140.    However, in some cases the ICMP datagram will have useful information
  141.    for the source host which it would be desirable to echo.  A
  142.    sophisticated echo host MAY choose to echo ICMP datagrams according
  143.    to the following rules:
  144.  
  145.       1. Any ICMP datagram in which the destination address in the
  146.       encapsulated IP header (the header within the ICMP datagram)
  147.       matches the source address of the ICMP datagram MAY be safely
  148.       echoed.
  149.  
  150.       2. ICMP Source Quench and ICMP Destination Unreachable with a code
  151.       of 4 (fragmentation needed and DF set) MAY be sent to the
  152.       *destination* of the encapsulated IP datagram if the source IP
  153.       address of the encapsulated IP datagram is that of the echo host.
  154.       When the ICMP message is sent on, it SHOULD be rewritten as an
  155.       ICMP message from the echo host to the source.
  156.  
  157.       3. All other ICMP messages MUST be discarded.
  158.  
  159.    These rules were chosen to try to ensure that end-to-end ICMP
  160.    messages are passed through, as are messages from routers which are
  161.    fairly safe and useful (or necessary) to the end system, but that
  162.    potentially dangerous messages such as Redirects are suppressed.
  163.    (The ICMP Destination Unreachable with code 4 is required for MTU
  164.    discovery under RFC-1191).
  165.  
  166.  
  167.  
  168.  
  169.  
  170. Partridge                     Experimental                      [Page 3]
  171.  
  172. RFC 2075                  IP Echo Host Service              January 1997
  173.  
  174.  
  175. Security Considerations
  176.  
  177.    Echo hosts pose a number of security concerns related to address
  178.    spoofing.
  179.  
  180.    First, echo hosts provide obvious ways to extend attacks that make
  181.    use of address spoofing.  A malevolent host can write an third
  182.    party's IP address as the source address of a datagram sent to an
  183.    echo host and thus cause the echo host to send a datagram to the
  184.    third party.  In general, this trick does not create a new security
  185.    hole (the malevolent host could just as well have sent the datagram
  186.    with a forged source address straight to the third party host).  But
  187.    there are some new twists to the problem.
  188.  
  189.    One exception is if the echo host is a host inside a firewall that
  190.    accepts datagrams from hosts outside the firewall.  In that case, a
  191.    malevolent host outside the firewall may be able to use the echo host
  192.    to make its packets appear to originate from inside the firewall
  193.    (from the echo host).  In general, a good firewall will catch these
  194.    cases (the source address of the datagrams sent to the echo host will
  195.    be for a host inside the firewall and testing for interior source
  196.    addresses on datagrams arriving at an exterior interface is a
  197.    standard firewall filter) but since the primary purpose of echo hosts
  198.    is for wide scale Internet testing, there seems no reason to invite
  199.    danger.  So we recommend that echo hosts SHOULD NOT be placed inside
  200.    firewalls.
  201.  
  202.    Second, address spoofing can be used to cause flooding of the
  203.    network.  In this case, a malevolent host sends a datagram to an echo
  204.    host with the source address of another echo host.  This trick will
  205.    cause datagrams to circulate between the two echo hosts.  The
  206.    requirement that the echo host decrement the TTL by one ensures that
  207.    each datagram will eventually die, but a sufficiently malevolent host
  208.    sending a large number of datagrams with high TTLs to an echo host
  209.    can cause considerable disruption.  There are a number of possible
  210.    ways to repair this problem (such as requiring sources to
  211.    authenticate themselves before sending datagrams to be echoed).  A
  212.    simple protection is simply to limit the number of packets echoed
  213.    back to any one source per second.  For instance, one might limit a
  214.    source to a packet rate equal to 10% of the interface bandwidth (for
  215.    a 10 Mb/s Ethernet this would be about 75 maximum sized packets per
  216.    second).
  217.  
  218.    One variation of this attack is to generate e-mail addressed to the
  219.    echo host (e.g., user@echo.xxx.com).  This e-mail will loop over the
  220.    network a number of times until the SMTP server determines the
  221.    message has too many Received-From: lines.
  222.  
  223.  
  224.  
  225.  
  226. Partridge                     Experimental                      [Page 4]
  227.  
  228. RFC 2075                  IP Echo Host Service              January 1997
  229.  
  230.  
  231.    A third variation of the flooding trick is to place a multicast or
  232.    broadcast address as the source of the IP datagram sent to an echo
  233.    server.  Since this results in an illegal arriving IP datagram, the
  234.    echo server MUST discard the datagram.  (This warning serves as a
  235.    reminder that echo servers MUST do the standard checks for an illegal
  236.    datagram before echoing).
  237.  
  238. Implementation Note
  239.  
  240.    Echo hosts are often implemented as virtual interfaces on an existing
  241.    host or router.  One can think of the echo host's IP address as a
  242.    second IP address for the host, with the semantics that all datagrams
  243.    sent to that address get echoed.  Observe that when an echo host is
  244.    supported as a module within a larger host implementation, an easy
  245.    implementation mistake to make is to accidentally put the non-echo
  246.    address of a host into an echoed packet.  For a variety of reasons
  247.    (including security and correct operation of echo paths) implementors
  248.    MUST ensure this NEVER happens.
  249.  
  250. Acknowledgements
  251.  
  252.    This memo was stimulated by a conversation with Jon Crowcroft in
  253.    which we both lamented the demise of some beloved IP echo hosts
  254.    (e.g., goonhilly-echo.arpa).  It has been considerably improved by
  255.    comments from various members of the End2End-Interest mailing list,
  256.    including Bob Braden, Mark Handley, Christian Huitema, Dave Mills,
  257.    Tim Salo, Vern Schryver, Lansing Sloan, and Rich Stevens.
  258.  
  259.    The author is emphatically not the inventor of echo hosts.  Enquiries
  260.    to the usual suspects suggest that echo hosts were created by persons
  261.    unknown (probably at BBN) very early in the development of IP.  I'd
  262.    like to thank those persons who created echo hosts and apologize for
  263.    any errors in describing their invention.
  264.  
  265. Author's Address
  266.  
  267.    Craig Partridge
  268.    BBN Corporation
  269.    10 Moulton St
  270.    Cambridge MA 02138
  271.  
  272.    EMail: craig@bbn.com
  273.  
  274.  
  275.  
  276.  
  277.  
  278.  
  279.  
  280.  
  281.  
  282. Partridge                     Experimental                      [Page 5]
  283.  
  284.