Appendix F. Sockets; Servers and Clients

Table of Contents

F.1. telnet
F.2. nc
F.3. socat
F.4. tcpclient
F.5. xinetd
F.6. tcpserver
F.7. redir

There is little point to the huge study of routing and network configuration if we can't move data from one host to another. This appendix will cover many of the command line tools (and a few daemons) which can be used to initiate TCP connections, receive TCP connections and send and receive UDP datagrams. Many of these tools are included with stock installations.

telnet and nc are the most common tools used for quickly creating a TCP connection. The less common utility tcpclient provides a scriptable method for initiating TCP sessions, equally as well as nc. Finally, the tool socat includes support for a large number of other types of sockets and files in addition to TCP and UDP.

Some services expect to run under another utility which will handle the socket operations. We'll tour the following utilities: xinetd, tcpserver and the very specifically designed port redirection utility redir.

It's important to remember that tools like socat and nc are suited equally well to initiate or receive TCP connections, but may not have the flexibility of administrative control afforded by tools such as xinetd and tcpserver where this was inherent to the design of the software.