An "echo server" is a server that does nothing more than sending back whatever is sent to it. Hence the name : echo What can you use it for ? Whatever you feel like. Practical applications could be network and connectivity testing and troubleshooting. Assume you've build a rather complex network with VLANs and subnets, and really strick firewalls between those subnets, and you're beginning to wonder if a client on one segment of the network will still be able to connect to your web server, database server, ... on some other segment. A ping or a traceroute will establish if the server (IP address) can be reached but does not tell you if an application will be able to connect to the desired port on the server and whether a reply from the server will be able to reach the client again.
This "echo server" can be set up to listen on any desired (tcp) port to simulate whatever application you want to run (eg web server = port 80, Microsoft SQL Server = port 1433, etc). From the client machine, you can then telnet to this port. When a telnet connection has been established, everything you type will be echoed back to your screen, indicating that the telnet client and the echo server can talk to each other : you've established connectivity at the application level.
In a similar way, you can use this echo server to troubleshoot networks, test a firewall (eg "if I have a server listening on port 123, wil my firewall allow connections to it ?) and so on.
On the server machine, run the echo server wih a given port number, eg echosrv 1433 On the client machine, telnet to this port (telnet server_ip_address 1433) and type any text.
This is a very basic echo server (code from http://cs.baylor.edu/~donahoo/). All it does is open a socket and listen. When a client connects, the "handleTCPClient" function is called. Here, this function just sends back the received characters (echoBuffer). You can imagine that for other applications, this function will become rather more elaborate.
link to source: echod.c
All you have to do now is compile this source (eg with gcc) and run it !