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