RFC 862 - Echo Protocol

Often, when you are getting familiar with new programming language or small networking library it is hard to came up with something meaningful as an example. I would like to share with you a little piece of advice regarding that.

You can implement an echo server. Even more - there is an official RFC for an echo protocol - it has number 862.

Network Working Group                                          J. Postel
Request for Comments: 862                                            ISI
                                                                May 1983

                             Echo Protocol

This RFC specifies a standard for the ARPA Internet community.  Hosts on
the ARPA Internet that choose to implement an Echo Protocol are expected
to adopt and implement this standard.

A very useful debugging and measurement tool is an echo service.  An
echo service simply sends back to the originating source any data it

TCP Based Echo Service

   One echo service is defined as a connection based application on TCP.
   A server listens for TCP connections on TCP port 7.  Once a
   connection is established any data received is sent back.  This
   continues until the calling user terminates the connection.

UDP Based Echo Service

   Another echo service is defined as a datagram based application on
   UDP.  A server listens for UDP datagrams on UDP port 7.  When a
   datagram is received, the data from it is sent back in an answering

It is a tiny document, that formalizes also tiny specification for an echo server - for two most known transport layer protocols - TCP and UDP. Rules and requirements are clear and well defined, port numbers are well known.

BTW: it is a really nice kata assignment as well. And, just for the record - please, look at the author and date - RFC was created in 1983 by Jon Postel (yes, this one responsible for Postel’s Law).

Besides an echo protocol there is also well known RFC which describes an IP protocol implemented on top of breeding pigeons (look at the security considerations at page 3 :wink:). But this is much harder to implement as a small assignment or kata.

Please, share with me your example implementation of an echo server in the comments - choose any protocol or programming language that you like. :smile: