Newsgroups: comp.protocols.tcp-ip From: gnn@netcom.com (George Neville-Neil) Subject: TCP-IP FAQ for June 1994 Date: Sat, 4 Jun 1994 17:22:10 GMT Hi Folks, OK here is the latest FAQ, complete with corrections and some additions. Remember, this is also available for anonymous ftp from ftp.netcom.com:~ftp/pub/gnn/tcp-ip.faq Enjoy, George Internet Protocol Frequently Asked Questions Maintained by: George V. Neville-Neil (gnn@netcom.com) Contributions from: Ran Atkinson Stephane Bortzmeyer Phill Conrad Jon Kay Barry Margolin Jim Muchow W. Richard Stevens Version 1.2 Last Update: June 4, 1994 ************************************************************************ The following is a list of Frequently Asked Questions, and their answers, for people interested in the Internet Protocols, including TCP, UDP, ICMP and others. Please send all additions, corrections, complaints and kudos to the above address. This FAQ will be posted on or about the first of every month. ************************************************************************ Table of Contents: Glossary 1) Are there any good books on IP? 2) Where can I find example source code for TCP/UDP/IP? 3) Are there any public domain programs to check the performance of an IP link? 4) Where do I find RFCs? 5) How can I detect that the other end of a TCP connection has crashed? Can I use "keepalives" for this? 6) Can the keepalive timeouts be configured? 7) Can I set up a gateway to the Internet that translates IP addresses, so that I don't have to change all our internal addresses to an official network? Glossary: I felt this should be first given the plethora of acronyms used in the rest of this FAQ. IP: Internet Protocol. The lowest layer protocol defined in TCP/IP. This is the base layer on which all other protocols mentioned herein are built. IP is often referred to as TCP/IP as well. UDP: User Datagram Protocol. This is a connectionless protocol built on top of IP. It does not provide any guarantees on the ordering or delivery of messages. This protocol is layered on top of IP. TCP: Transmission Control Protocol. TCP is a connection oriented protocol that guarantees that messages are delivered in the order in which they were sent and that all messages are delivered. If a TCP connection cannot deliver a message it closes the connection and informs the entity that created it. This protocol is layered on top of IP. ICMP: Internet Control Message Protocol. ICMP is used for diagnostics in the network. The Unix program, ping, uses ICMP messages to detect the status of other hosts in the net. ICMP messages can either be queries (in the case of ping) or error reports, such as when a network is unreachable. RFC: Request For Comment. RFCs are documents that define the protocols used in the IP Internet. Some are only suggestions, some are even jokes, and others are published standards. Several sites in the Internet store RFCs and make them available for anonymous ftp. SLIP: Serial Line IP. An implementation of IP for use over a serial link (modem). CSLIP is an optimized (compressed) version of SLIP that gives better throughput. Bandwidth: The amount of data that can be pushed through a link in unit time. Usually measured in bits or bytes per second. Latency: The amount of time that a message spends in a network going from point A to point B. Jitter: The effect seen when latency is not a constant. That is, if messages experience a different latencies between two points in a network. RPC: Remote Procedure Call. RPC is a method of making network access to resource transparent to the application programmer by supplying a "stub" routine that is called in the same way as a regular procedure call. The stub actually performs the call across the network to another computer. Marshalling: The process of taking arbitrary data (characters, integers, structures) and packing them up for transmission across a network. MBONE: A virtual network that is a Multicast backBONE. It is still a research prototype, but it extends through most of the core of the Internet (including North America, Europe, and Australia). It uses IP Multicasting which is defined in RFC-1112. An MBONE FAQ is available via anonymous ftp from: ftp.isi.edu" There are frequent broadcasts of multimedia programs (audio and low bandwidth video) over the MBONE. 1) Are there any good books on IP? A) Yes. Please see the following: Internetworking with TCP/IP Volume I (Principles, Protocols, and Architecture) Douglas E. Comer Prentice Hall 1991 This volume covers all of the protocols, including IP, UDP, TCP, and the gateway protocols. It also includes discussions of higher level protocols such as FTP, TELNET, and NFS. Internetworking with TCP/IP Volume II (Design, Implementation, and Internals) Douglas E. Comer / David L. Stevens Prentice Hall 1991 Discusses the implementation of the protocols and gives numerous code examples. Internetworking with TCP/IP Volume III (BSD Socket Version) (Client - Server Programming and Applications) Douglas E. Comer / David L. Stevens Prentice Hall 1993 This book discusses programming applications that use the internet protocols. It includes examples of telnet, ftp clients and servers. Discusses RPC and XDR at length. TCP/IP Illustrated, Volume 1: The Protocols, W. Richard Stevens (c) Addison-Wesley, 1994 An excellent introduction to the entire TCP/IP protocol suite, covering all the major protocols, plus several important applications. Unix Network Programming W. Richard Stevens Prentice Hall 1990 An excellent introduction to network programming under Unix. The Design and Implementation of the 4.3 BSD Operating System Samuel J. Leffler, Marshall Kirk McKusick, Michael J. Karels, John S. Quarterman Addison-Wesley 1989 Though this book is a reference for the entire operating system, the eleventh and twelfth chapters completely explain how the networking protocols are implemented in the kernel. 2) Where can I find example source code for TCP/UDP/IP? A) Code from the Internetworking with TCP/IP Volume III is available for anonymous ftp from: arthur.cs.purdue.edu:/pub/dls Code used in the Net-2 version of Berkeley Unix is available for anonymous ftp from: ftp.uu.net:systems/unix/bsd-sources/sys/netinet and gatekeeper.dec.com:/pub/BSD/net2/sys/netinet Code from Richard Steven's book is available on: ftp.uu.net:/published/books/stevens.* 3) Are there any public domain programs to check the performance of an IP link? A) TTCP: Available for anonymous ftp from.... Host gatekeeper.dec.com Location: /.0/BSD/NetBSD/NetBSD-current/othersrc DIRECTORY dr-xr-xr-x 512 Apr 8 09:57 ttcp Location: /.0/BSD/NetBSD/NetBSD-current/othersrc/ttcp FILE -r--r--r-- 3885 Nov 7 03:35 ttcp.1 FILE -r--r--r-- 19225 Nov 7 03:35 ttcp.c Host world.std.com Location: /src/wuarchive/graphics/graphics/mirrors/sgi.com/sgi/src/ttcp FILE -r--r--r-- 3885 Oct 4 1991 ttcp.1 FILE -r--r--r-- 19170 May 17 1993 ttcp.c FILE -r--r--r-- 13033 Sep 5 1989 ttcp.c-brl On ftp.sgi.com are netperf (from Rick Jones at HP) and nettest (from Dave Borman at Cray). ttcp is also availabel at ftp.sgi.com. There is suite of Bandwidth Measuring programs from gnn@netcom.com. Available for anonymous ftp from ftp.netcom.com in ~ftp/gnn/bwmeas-0.3.tar.Z These are several programs that meausre bandwidth and jitter over several kinds of IPC links, including TCP and UDP. 4) Where do I find RFCs? A) RFCs are available for anonymous ftp from the following servers. You should pick the one geographically closest to you. North America ftp.internic.net (canonical set) FTP.NISC.SRI.COM and nic.cerf.net Austrailia and Pacific Rim munnari.oz.au Denmark ftp.denet.dk Germany walhalla.informatik.uni-dortmund.de Finland funet.fi Netherlands mcsun.eu.net Norway ugle.unit.no Sweden sunic.sunet.se and chalmers.se Using Web, WAIS, and gopher: Web: http://web.nexor.co.uk/rfc-index/rfc-index-search-form.html WAIS access by keyword: wais://wais.cnam.fr/RFC Excellent presentation with a full-text search too: http://www.cis.ohio-state.edu/hypertext/information/rfc.html With Gopher: gopher://r2d2.jvnc.net/11/Internet%20Resources/RFC gopher://muspin.gsfc.nasa.gov:4320/1g2go4%20ds.internic.net%2070%201%201/.ds/ .internetdocs 5) How can I detect that the other end of a TCP connection has crashed? Can I use "keepalives" for this? A) Detecting crashed systems over TCP/IP is difficult. TCP doesn't require any transmission over a connection if the application isn't sending anything, and many of the media over which TCP/IP is used (e.g. ethernet) don't provide a reliable way to determine whether a particular host is up. If a server doesn't hear from a client, it could be because it has nothing to say, some network between the server and client may be down, the server or client's network interface may be disconnected, or the client may have crashed. Network failures are often temporary (a thin ethernet will appear down while someone is adding a link to the daisy chain, and it often takes a few minutes for new routes to stabilize when a router goes down), and TCP connections shouldn't be dropped as a result. Keepalives are a feature of the sockets API that requests that an empty packet be sent periodically over an idle connection; this should evoke an acknowledgement from the remote system if it is still up, a reset if it has rebooted, and a timeout if it is down. These are not normally sent until the connection has been idle for a few hours. The purpose isn't to detect a crash immediately, but to keep unnecessary resources from being allocated forever. If more rapid detection of remote failures is required, this should be implemented in the application protocol. There is no standard mechanism for this, but an example is requiring clients to send a "no-op" message every minute or two. An example protocol that uses this is X Display Manager Control Protocol (XDMCP), part of the X Window System, Version 11; the XDM server managing a session periodically sends a Sync command to the display server, which should evoke an application-level response, and resets the session if it doesn't get a response (this is actually an example of a poor implementation, as a timeout can occur if another client "grabs" the server for too long). 6) Can the keepalive timeouts be configured? A) I know they can on many systems, but I don't know the details. 7) Can I set up a gateway to the Internet that translates IP addresses, so that I don't have to change all our internal addresses to an official network? A) There's no general solution to this. Many protocols include IP addresses in the application-level data (FTP's "PORT" command is the most notable), so it isn't simply a matter of translating addresses in the IP header. Also, if the network number(s) you're using match those assigned to another organization, your gateway won't be able to communicate with that organization (RFC 1597 proposes network numbers that are reserved for private use, to avoid such conflicts, but if you're already using a different network number this won't help you). However, if you're willing to live with limited access to the Internet from internal hosts, the "proxy" servers developed for firewalls can be used as a substitute for an address-translating gateway. See the firewall FAQ. -- gnn@netcom.com Gentlemen, I will not have you fighting in the War Room. --- The President in Dr. Strangelove