RFC 2075
IP Echo Host Service
IP Echo Host Service ๐
okay bestie, let's start with the paperwork ๐ (the title block, so you know who's involved):
- RFC number: 2075 โจ
- Title: IP Echo Host Service
- Network Working Group: this one was written for the Network Working Group ๐ธ
- Author: Craig Partridge, BBN ๐ง
- Category: Experimental ๐งช
- Date: January 1997 ๐
- Obsoletes / Updates: the title block doesn't list anything this one obsoletes or updates ๐คท
Status of this Memo ๐ฃ
So this memo defines an Experimental Protocol for the Internet community ๐งช. It is not an Internet standard of any kind ๐ . Discussion and suggestions for improvement are totally requested ๐ฌ. Distribution of this memo is unlimited ๐.
Abstract ๐ฆ
This memo explains how to build an IP echo host. IP echo hosts send back IP datagrams after swapping the source and destination IP addresses ๐. The effect is that datagrams you send to the echo host get sent back to you, like they came from the echo host itself ๐ช.
Introduction ๐
An IP echo host sends IP datagrams back to their original source host, with the IP source and destination addresses reversed. That way the returning datagram looks like it's coming from the echo host to the original source ๐ฎ. Echo hosts are tremendously useful for debugging applications and protocols ๐. Researchers can make looped-back conversations across the Internet, which exposes their traffic to all the chaos of Internet behavior (congestion, cross traffic, variable round-trip times and more) ๐ช๏ธ. And they don't have to ship prototype software to a bunch of test machines ๐ .
IP echo hosts were used a LOT on the Internet in the late 1970s and early 1980s to debug various transport and application protocols ๐ผ. But for reasons nobody can really explain, there are currently no echo hosts on the Internet, and few people even know the concept exists ๐ญ. The goal of this memo is to write the concept down so it can get revived ๐ซถ.
Implementation Details ๐ ๏ธ
The basic idea of an echo host is simple, but there are a few implementation details that need attention ๐ง . This section goes from the simplest issues to the hardest ones ๐ช.
The most straightforward case is when an echo host receives an IP datagram with no options, and the protocol field has a value other than 1 (ICMP) ๐. Here, the echo host swaps the source and destination addresses, decrements the TTL by one, and updates the IP header checksum โ๏ธ. Then it transmits the updated datagram back to the original source ๐ค.
NOTE: If the TTL is zero or less after decrementing, the datagram MUST not be echoed. In general, an echo host is required to do all the various sanity checks that a router or host would do to an IP datagram before accepting the datagram for echoing (see STD 3, RFC 1122, and RFC 1812) ๐ง. The TTL MUST be decremented for security reasons noted below. Observe, however, that hosts using an echo path through an echo host SHOULD set their TTL to twice the normal value, so they're sure to get connectivity over the echo path ๐ฃ๏ธ.
If an arriving IP datagram has options, the echo host's jobs get more complicated ๐. In general, the IP source and destination are always swapped, and the TTL and checksum get updated. But in certain situations, other special actions may have to happen ๐ญ.
If the datagram has an incomplete source route option (meaning the echo host is not the final destination), the datagram MUST be discarded ๐๏ธ. If the datagram has a complete source route option, the source route option MUST be reversed, and the datagram (with source and destination IP addresses swapped and updated TTL) MUST be sent back along the reverse source route ๐.
More generally, the goal with any option is to update it so that when the echoed packet gets back to the original source, the option fields contain data that makes sense for a datagram that originated at the echo host ๐งฉ.
There's one option where the right action is unclear ๐ค. The timestamp option is sometimes used for round-trip time estimation โฑ๏ธ. If the echo host resets the option, a history of roughly half the trip delay gets lost ๐. But if it doesn't reset the option, the timestamp option will look inconsistent with the source and destination addresses of the datagram ๐ฌ. To balance these two issues, the following rules are suggested:
- If the first entry in the timestamp option contains the IP address of the source host, the entry SHOULD be rewritten to contain the IP address of the echo host, and the timestamp option pointer SHOULD be truncated so that this timestamp is the only one in the list. (This rewrite makes the option look consistent with the new source and destination IP addresses, keeps the source timestamp, and loses information about the path to the echo host โ๏ธ.)
- If the first entry in the timestamp option does not contain the IP address of the source host, the entry SHOULD be echoed back unchanged. The echo host SHOULD NOT appear in the timestamp option. (This approach keeps the entire history of the path, though on a symmetric route, every router may show up twice ๐ฏ.)
Finally, if the IP datagram contains an ICMP packet (meaning the IP protocol field value is 1), the datagram SHOULD be discarded ๐ซ. The reason: the most likely reason to receive an ICMP datagram is that an echoed datagram ran into a problem at some router on the path, and that router sent back an ICMP datagram ๐ง. Echoing the ICMP datagram back to the router may confuse the router, so this SHOULD be avoided ๐. (This rule just follows the Internet maxim of being conservative in what we send ๐งธ.)
Sometimes, though, the ICMP datagram has useful info for the source host that would be nice to echo โจ. A sophisticated echo host MAY choose to echo ICMP datagrams according to these rules:
- Any ICMP datagram where the destination address in the encapsulated IP header (the header inside the ICMP datagram) matches the source address of the ICMP datagram MAY be safely echoed ๐ก๏ธ.
- ICMP Source Quench and ICMP Destination Unreachable with a code of 4 (fragmentation needed and DF set) MAY be sent to the destination of the encapsulated IP datagram, if the source IP address of the encapsulated IP datagram is that of the echo host. When the ICMP message is sent on, it SHOULD be rewritten as an ICMP message from the echo host to the source ๐ช.
- All other ICMP messages MUST be discarded ๐งน.
These rules try to make sure end-to-end ICMP messages get through, along with messages from routers that are fairly safe and useful (or necessary) for the end system ๐ฌ. But potentially dangerous messages, like Redirects, get suppressed ๐ท. (The ICMP Destination Unreachable with code 4 is required for MTU discovery under RFC-1191 ๐.)
Security Considerations ๐
Okay, this section is serious, so read it carefully ๐จ.
Echo hosts pose a number of security concerns related to address spoofing ๐ญ.
First, echo hosts give obvious ways to extend attacks that use address spoofing ๐. A malevolent host can write a third party's IP address as the source address of a datagram sent to an echo host, and cause the echo host to send a datagram to that third party ๐จ. In general this trick doesn't create a brand-new security hole (the malevolent host could've just sent the datagram with a forged source address straight to the third party) ๐คท. But there are some new twists to the problem ๐.
One exception: the echo host is a host inside a firewall that accepts datagrams from hosts outside the firewall ๐งฑ. In that case, a malevolent host outside the firewall might use the echo host to make its packets look like they come from inside the firewall (from the echo host) ๐. In general, a good firewall catches these cases, because the source address of datagrams sent to the echo host will be for a host inside the firewall, and testing for interior source addresses on datagrams arriving at an exterior interface is a standard firewall filter ๐. But since the main purpose of echo hosts is wide-scale Internet testing, there's no reason to invite danger ๐ โโ๏ธ. So we recommend that echo hosts SHOULD NOT be placed inside firewalls ๐.
Second, address spoofing can be used to flood the network ๐. Here, a malevolent host sends a datagram to an echo host with the source address of another echo host. This trick makes datagrams circulate between the two echo hosts ๐. The requirement that the echo host decrement the TTL by one makes sure each datagram eventually dies, but a sufficiently malevolent host sending lots of datagrams with high TTLs to an echo host can cause serious disruption ๐ฑ. There are a number of possible fixes (like requiring sources to authenticate themselves before sending datagrams to be echoed) ๐. A simple protection is to limit the number of packets echoed back to any one source per second ๐ฆ. For instance, you might limit a source to a packet rate equal to 10% of the interface bandwidth (for a 10 Mb/s Ethernet, that's about 75 maximum sized packets per second) ๐งฎ.
One variation of this attack is to generate e-mail addressed to the echo host (e.g., user@echo.xxx.com) ๐ง. This e-mail loops around the network a bunch of times until the SMTP server decides the message has too many Received-From: lines ๐.
A third variation of the flooding trick is to put a multicast or broadcast address as the source of the IP datagram sent to an echo server ๐ก. Since this creates an illegal arriving IP datagram, the echo server MUST discard the datagram ๐ฎ. (This warning is a reminder that echo servers MUST do the standard checks for an illegal datagram before echoing ๐.)
Implementation Note ๐ง
Echo hosts are often built as virtual interfaces on an existing host or router ๐ฅ๏ธ. You can think of the echo host's IP address as a second IP address for the host, where all datagrams sent to that address get echoed ๐ช. Here's a sneaky mistake to watch out for: when an echo host is a module inside a larger host implementation, it's easy to accidentally put the non-echo address of the host into an echoed packet ๐ต. For a variety of reasons (including security and correct operation of echo paths), implementors MUST ensure this NEVER happens ๐จ๐ .
Acknowledgements ๐ซถ
This memo was sparked by a conversation with Jon Crowcroft, where they both lamented the demise of some beloved IP echo hosts (e.g., goonhilly-echo.arpa) ๐ข. It got a lot better thanks to comments from various members of the End2End-Interest mailing list, including Bob Braden, Mark Handley, Christian Huitema, Dave Mills, Tim Salo, Vern Schryver, Lansing Sloan, and Rich Stevens ๐.
The author is emphatically not the inventor of echo hosts ๐ . Enquiries to the usual suspects suggest echo hosts were created by persons unknown (probably at BBN) very early in the development of IP ๐ต๏ธ. The author would like to thank those persons who created echo hosts and apologize for any errors in describing their invention ๐๐.
Author's Address ๐ฌ
Craig Partridge BBN Corporation 10 Moulton St Cambridge MA 02138
EMail: craig@bbn.com ๐
๐ฆ where this page comes from
- ietf: rfc2075 1997-01
- ๐ girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms