home *** CD-ROM | disk | FTP | other *** search
/ ftp.pasteur.org/FAQ/ / ftp-pasteur-org-FAQ.zip / FAQ / internet / tcp-ip / tcp-ip-faq / part2 < prev   
Encoding:
Internet Message Format  |  1999-09-07  |  21.9 KB

  1. Path: senator-bedfellow.mit.edu!bloom-beacon.mit.edu!howland.erols.net!newsfeed.mathworks.com!cam-news-hub1.bbnplanet.com!denver-news-feed1.bbnplanet.com!news.gtei.net!namche.sun.com!news2me.EBay.Sun.COM!engnews3.Eng.Sun.COM!not-for-mail
  2. From: tcp-ip-faq@eng.sun.com (TCP/IP FAQ Maintainer)
  3. Newsgroups: comp.protocols.tcp-ip,comp.answers,news.answers
  4. Subject: TCP/IP FAQ; Frequently Asked Questions (1999-09) Part 2 of 2
  5. Supersedes: <tcp-ip-faq-2.1999-08@eng.sun.com>
  6. Followup-To: comp.protocols.tcp-ip
  7. Date: 7 Sep 1999 03:38:45 GMT
  8. Organization: Sun Microsystems Inc., Mountain View, CA
  9. Lines: 476
  10. Approved: news-answers-request@MIT.EDU
  11. Expires: Sat, 09 Oct 99 03:11:44 GMT
  12. Message-ID: <tcp-ip-faq-2.1999-09@eng.sun.com>
  13. References: <tcp-ip-faq-1.1999-09@eng.sun.com>
  14. NNTP-Posting-Host: rory.eng.sun.com
  15. Summary: Part 2 of a 2-part informational posting that contains
  16.      responses to common questions on basic TCP/IP network
  17.      protocols and applications.
  18. X-Disclaimer: Approval for postings in *.answers is based on form, not content.
  19. X-Newsreader: trn 4.0-test72 (19 April 1999)
  20. Xref: senator-bedfellow.mit.edu comp.protocols.tcp-ip:78108 comp.answers:37580 news.answers:166033
  21.  
  22. Archive-name:      internet/tcp-ip/tcp-ip-faq/part2
  23. Version:           5.15
  24. Last-modified:     1999-09-06 20:11:43
  25. Posting-Frequency: monthly (first Friday)
  26. Maintainer:        tcp-ip-faq@eng.sun.com (Mike Oliver)
  27. URL:               http://www.itprc.com/tcpipfaq/default.htm
  28.  
  29. TCP/IP Frequently Asked Questions
  30.  
  31. Part 2: Applications and Application Programming
  32.  
  33. This is Part 2 of the Frequently Asked Questions (FAQ) list for the
  34. comp.protocols.tcp-ip Usenet newsgroup. The FAQ provides answers to a
  35. selection of common questions on the various protocols (IP, TCP, UDP,
  36. ICMP and others) that make up the TCP/IP protocol suite. It is posted
  37. to the news.answers, comp.answers and comp.protocols.tcp-ip newsgroups
  38. on or about the first Friday of every month.
  39.  
  40. The FAQ is posted in two parts. Part 1 contains answers to general
  41. questions and questions that concern the fundamental components of the
  42. suite. Part 2 contains answers to questions concerning common
  43. applications that depend on the TCP/IP suite for their network
  44. connectivity.
  45.  
  46. Comments on this document can be emailed to the FAQ maintainer at
  47. <tcp-ip-faq@eng.sun.com>.
  48.  
  49.   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
  50.  
  51. Table of Contents
  52.  
  53. FAQ Part 2 -- Applications and Application Programming
  54.  
  55. What Are The Common TCP/IP Application Protocols?
  56.  
  57.   1. DHCP
  58.   2. DNS
  59.   3. FTP
  60.   4. HTTP
  61.   5. IMAP
  62.   6. NFS
  63.   7. NNTP
  64.   8. NTP
  65.   9. POP
  66.  10. Rlogin
  67.  11. Rsh
  68.  12. SMTP
  69.  13. SNMP
  70.  14. Ssh
  71.  15. Telnet
  72.  16. X Window System
  73.  
  74. TCP/IP Programming
  75.  
  76.   1. What are sockets?
  77.   2. How can I detect that the other end of a TCP connection has
  78.      crashed?
  79.   3. Can TCP keepalive timeouts be configured?
  80.   4. Are there object-oriented network programming tools?
  81.  
  82.   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
  83.  
  84. What Are The Common TCP/IP Application Protocols?
  85.  
  86.   1. DHCP
  87.  
  88.      Dynamic Host Configuration Protocol (DHCP) allows IP addresses to
  89.      be allocated to hosts on an as-needed basis. The conventional
  90.      scheme of allocating a permanent fixed IP address to every host is
  91.      wasteful of addresses in situations where only a relatively small
  92.      number of hosts are active at any given time. DHCP lets a host
  93.      'borrow' an IP address from a pool of IP addresses; when the
  94.      address is no longer needed it is recycled and made available for
  95.      use by some other host. DHCP also allows a host to retrieve a
  96.      variety of configuration information at the same time as it
  97.      acquires an IP address.
  98.  
  99.      DCHP depends on UDP to carry packets between the client and server
  100.      tasks.
  101.  
  102.      DHCP is defined by RFC's 2131 and 2132. A widely-used
  103.      implementation of DHCP can be downloaded from
  104.      <http://www.isc.org/dhcp.html>.
  105.  
  106.   2. DNS
  107.  
  108.      The Domain Name System (DNS) provides dynamic on-demand
  109.      translation between human-readable names (like www.pizzahut.com)
  110.      and the numeric addresses actually used by IP (like
  111.      192.112.170.243). The basics of DNS operation are defined in RFC's
  112.      1034, 1101, 1876, 1982 and 2065.
  113.  
  114.      DNS uses both UDP and TCP. It used UDP to carry simple queries and
  115.      responses but depends on TCP to guarantee the correct and orderly
  116.      delivery of large amounts of bulk data (eg transfers of entire
  117.      zone configurations) across the network.
  118.  
  119.      DNS standards are discussed in the comp.protocols.dns.std
  120.      newsgroup. A very widely-used implementation of DNS called BIND
  121.      (Berkeley Internet Name Domain) is discussed in the
  122.      comp.protocols.dns.bind newsgroup, and the BIND software itself
  123.      can be downloaded from <http://www.isc.org/bind.html>. The
  124.      operation and politics of DNS are discussed in the
  125.      comp.protocols.tcp-ip.domains newsgroup.
  126.  
  127.   3. FTP
  128.  
  129.      File Transfer Protocol (FTP) provides a mechanism for moving data
  130.      files between systems. In addition to the fundamental PUT and GET
  131.      operations, FTP provides a small number of file management and
  132.      user authentication facilities. The protocol is defined in RFC
  133.      959.
  134.  
  135.      FTP depends on TCP to guarantee the correct and orderly delivery
  136.      of data across the network.
  137.  
  138.   4. HTTP
  139.  
  140.      Hyper Text Transfer Protocol (HTTP) is the protocol used to move
  141.      Web pages across an internet. Version 1.0 of HTTP is defined by
  142.      RFC 1945.  Version 1.1 makes more efficient use of TCP and is
  143.      defined by RFC 2068.
  144.  
  145.      HTTP depends on TCP to guarantee the correct and orderly delivery
  146.      of data across the network.
  147.  
  148.   5. IMAP
  149.  
  150.      Interactive Mail Access Protocol (IMAP) allows clients to
  151.      manipulate email messages and mailboxes that reside on some server
  152.      machine. The current version of IMAP is Version 4, usually
  153.      referred to as IMAP4.  IMAP4 is described by RFC 2060. IMAP
  154.      provides no way of sending email; client programs that use IMAP to
  155.      read mail usually use SMTP to send messages. IMAP is more powerful
  156.      and more complex than the other widely-used mail-reading protocol
  157.      POP.
  158.  
  159.      IMAP depends on TCP to guarantee the correct and orderly delivery
  160.      of data across the network.
  161.  
  162.      IMAP is discussed in the comp.mail.imap newsgroup.
  163.  
  164.   6. NFS
  165.  
  166.      Network File System (NFS) allows files stored on one machine (the
  167.      "server") to be accessed by other machines (the "clients") as
  168.      though the files were actually present on the client systems. NFS
  169.      is defined in terms of a Remote Procedure Call (RPC) abstraction
  170.      which in turn formats its packets according to a
  171.      processor-independent eXternal Data Representation (XDR).
  172.  
  173.      Version 2 of NFS is defined in RFC 1094 and Version 3 is defined
  174.      in RFC 1813. The RPC mechanism most often used with NFS, ONC/RPC,
  175.      is defined by RFC 1831. The XDR conventions used by ONC/RPC are
  176.      defined by RFC 1832. The ONC/RPC binding mechanism (a minimal
  177.      directory service which allows RPC clients to rendezvous with RPC
  178.      servers) is defined by RFC 1833.
  179.  
  180.      NFS can run over any kind of transport, but is most often used
  181.      over UDP. UDP does not guarantee packet delivery or ordering, so
  182.      when NFS runs over UDP the RPC implementation must provide its own
  183.      guarantees of correctness. When NFS runs over TCP, the RPC layer
  184.      can depend on TCP to provide this kind of correctness.
  185.  
  186.      NFS is discussed in the comp.protocols.nfs newsgroup.
  187.  
  188.   7. NNTP
  189.  
  190.      Network News Transfer Protocol (NNTP) is used to propagate netnews
  191.      postings (including Usenet postings) between systems. It is
  192.      defined in RFC 977. (The format of netnews messages is defined in
  193.      RFC 1036.)
  194.  
  195.      NNTP depends on TCP to guarantee the correct and orderly delivery
  196.      of data across the network.
  197.  
  198.      NNTP is discussed in the news.software.nntp newsgroup. A very
  199.      widely-used implementation of NNTP called INN (InterNet News) can
  200.      be downloaded from <http://www.isc.org/inn.html>.
  201.  
  202.   8. NTP
  203.  
  204.      Network Time Protocol (NTP) is used to synchronise time-of-day
  205.      clocks between various computer systems. The current version of
  206.      NTP is Version 3, defined in RFC 1305. Earlier versions (2 and 1
  207.      respectively) of the protocol are defined in RFC's 1119 and 1059.
  208.      David Mills maintains a publically-available implementation of NTP
  209.      server and clients along with a comprehensive collection of NTP
  210.      documentation on the web at <http://www.eecis.udel.edu/%7Entp/>.
  211.  
  212.      NTP depends on UDP to carry packets between server and client
  213.      tasks.
  214.  
  215.      NTP is discussed in the comp.protocols.time.ntp newsgroup.
  216.  
  217.   9. POP
  218.  
  219.      Post Office Protocol (POP) allows clients to read and remove email
  220.      from a mailbox that resides on some server machine. The current
  221.      version of POP is Version 3, usually referred to as POP3. It is
  222.      described by RFC 1939. POP provides no way of sending email;
  223.      client programs that use POP to read mail usually use SMTP to send
  224.      messages. POP is simpler and less powerful than the other
  225.      widely-used mail-reading protocol IMAP.
  226.  
  227.      POP depends on TCP to guarantee the correct and orderly delivery
  228.      of data across the network.
  229.  
  230.      POP doesn't have its own dedicated newsgroup. It is sometimes
  231.      discussed in client-specific newsgroups in the comp.mail.*
  232.      hierarchy.
  233.  
  234.  10. Rlogin
  235.  
  236.      Remote Login (rlogin) provides a network terminal or "remote
  237.      login" capability. Rlogin is similar to Telnet but it adds a
  238.      couple of features that make it a little more convenient than
  239.      Telnet.
  240.  
  241.      Rlogin is one of the so-called Berkeley r-commands, (where the "r"
  242.      stands for "remote") a family of commands created at UC Berkeley
  243.      during the development of BSD Unix to provide access to remote
  244.      systems in ways that are more convenient than the original TCP/IP
  245.      commands.
  246.  
  247.      The most obvious convenience is that rlogin, like other
  248.      r-commands, examines a .rhosts (pronounced "dot ar hosts") file on
  249.      the server side to authenticate logins based on the client host
  250.      address. The .rhosts file can be constructed to allow remote
  251.      access without requiring you to enter a password. If used
  252.      improperly this feature can be a security threat, but if used
  253.      correctly it can actually enhance security by not requiring a
  254.      password to be sent over the network where it might be read by a
  255.      packet sniffer.
  256.  
  257.      The r-commands depend on TCP to guarantee the correct and orderly
  258.      delivery of data across the network.
  259.  
  260.  11. Rsh
  261.  
  262.      Remote Shell (rsh) is an r-command that provides for remote
  263.      execution of arbitrary commands. It allows you to run a command on
  264.      a server without having to actually log in on the server. More
  265.      importantly it allows you to feed data to the remote command and
  266.      retrieve the command's output without having to stage the data
  267.      through temporary files on the server.
  268.  
  269.      Like other Berkeley r-commands, rsh uses the .rhosts file on the
  270.      server side to authenticate access based on the client's host
  271.      address.
  272.  
  273.      On some non-BSD systems the Remote Shell command is named remsh
  274.      because by the time the command was delivered on those systems the
  275.      usual rsh name had been used for a "restricted shell" application,
  276.      a command line interpreter intended to boost security by
  277.      preventing its users from performing certain activities.
  278.  
  279.      On Unix systems most of the work of rsh is handled by the rcmd(3)
  280.      library function, so if you're writing a program that needs
  281.      rsh-like functionality then you might be able to use that
  282.      function. However, since the rsh protocol requires the client to
  283.      use a privileged port you'll only be able to use rcmd(3) if your
  284.      program executes with superuser privileges. That's why the rsh
  285.      executable is setuid-root on Unix machines.
  286.  
  287.      If your program will not run as root then you might be able to use
  288.      the rexec(3) function instead. rexec(3) does not use the
  289.      server-side .rhosts file. Instead it requires the client to supply
  290.      an account password which is then transmitted unencrypted over the
  291.      network.
  292.  
  293.  12. SMTP
  294.  
  295.      Simple Mail Transfer Protocol (SMTP) is used to deliver email from
  296.      one system to another. The basic SMTP is defined in RFC 821 and
  297.      the format of Internet mail messages is described in RFC 822.
  298.  
  299.      SMTP depends on TCP to guarantee the correct and orderly delivery
  300.      of data across the network.
  301.  
  302.      A very widely-used implementation of SMTP called sendmail can be
  303.      downloaded from <http://www.sendmail.org/>. Other open-source SMTP
  304.      implementations include qmail (available at
  305.      <http://www.qmail.org/>) postfix (available at
  306.      <http://www.postfix.org/>), smail (available at
  307.      <ftp://ftp.planix.com/pub/Smail/>), exim (available at
  308.      <http://www.exim.org/>) and smtpd (available at
  309.      <http://www.obtuse.com/smtpd.html>).
  310.  
  311.  13. SNMP
  312.  
  313.      Simple Network Management Protocol (SNMP) provides a means of
  314.      monitoring and managing systems over a network. SNMP defines a
  315.      method of sending queries (the GET and GET-NEXT primitives) and
  316.      commands (the SET primitive) from a management station client to
  317.      an agent server running on the target system, and collecting
  318.      responses and unsolicited event notifications (the TRAP
  319.      primitive).
  320.  
  321.      Version 1 of SNMP is defined by RFC's 1098 and 1157. SNMP Version
  322.      2 is defined by RFC's 1441, 1445, 1446, 1447 and 1901 through
  323.      1909. The various things that can be monitored and managed by
  324.      SNMP, collectively called the Management Information Base (MIB)
  325.      are defined in dozens of additional RFC's.
  326.  
  327.      SNMP sends traffic through UDP because of its relative simplicity
  328.      and low overhead.
  329.  
  330.      SNMP is discussed in the comp.protocols.snmp newsgroup.
  331.  
  332.  14. Ssh
  333.  
  334.      Secure Shell (ssh) provides remote login and execution features
  335.      similar to those of the rsh and rlogin r-commands, but ssh
  336.      encrypts the data that is exchanged over the network. Encryption
  337.      can protect sensitive information, and it is not uncommon for
  338.      security-conscious administrators to disable plain rsh and telnet
  339.      services in favour of ssh.
  340.  
  341.      The SSH protocol used by the ssh command has also been used to
  342.      build a secure file transfer application which can be used as an
  343.      alternative to FTP for sensitive data.
  344.  
  345.      Complete information on ssh and its SSH protocol can be found at
  346.      <http://www.ssh.fi/>.
  347.  
  348.  15. Telnet
  349.  
  350.      Telnet provides a network terminal or "remote login" capability.
  351.      The Telnet server accepts data from the telnet client and forwards
  352.      them to the operating system in such a way that the received
  353.      characters are treated as though they had been typed at a terminal
  354.      keyboard. Responses generated by the server operating system are
  355.      passed back to the Telnet client for display.
  356.  
  357.      The Telnet protocol provides the ability to negotiate many kinds
  358.      of terminal-related behaviour (local vs. remote echoing, line mode
  359.      vs.  character mode and others) between the client and server. The
  360.      basic Telnet protocol is defined in RFC's 818 and 854 and the
  361.      option negotiation mechanism is described in RFC 855.
  362.  
  363.      Specific Telnet options, implementation issues and protocol quirks
  364.      are discussed in several dozen RFC's dating back to 1971. (That's
  365.      RFC's 97, 137, 139, 206, 215, 216, 318, 328, 340, 393, 435, 466,
  366.      495, 513, 559, 560, 562, 563, 581, 587, 595, 596, 652, 653, 654,
  367.      655, 656, 657, 658, 698, 726, 727, 728, 732, 735, 736, 748, 749,
  368.      779, 856, 857, 858, 859, 860, 861, 885, 927, 933, 946, 1041, 1043,
  369.      1053, 1073, 1079, 1091, 1096, 1097, 1143, 1184, 1205, 1372, 1408,
  370.      1411, 1412, 1416, 1571, 1572 and 2066, and that's not counting
  371.      obsolete ones. A couple of these are not entirely serious.) As you
  372.      might infer from this pedigree, Telnet is a widely-deployed and
  373.      well-used protocol.
  374.  
  375.      Telnet depends on TCP to guarantee the correct and orderly
  376.      delivery of data between the client and server.
  377.  
  378.  16. X Window System
  379.  
  380.      The X Window System (X11R6 is the most recent incarnation) allows
  381.      client programs running on one machine to control the graphic
  382.      display, keyboard and mouse of some other machine or of a
  383.      dedicated X display terminal.
  384.  
  385.      X depends on TCP to guarantee the correct and orderly delivery of
  386.      data across the network.
  387.  
  388.      The X Window System is discussed in the comp.windows.x newsgroup.
  389.  
  390.   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
  391.  
  392. TCP/IP Programming
  393.  
  394.   1. What are sockets?
  395.  
  396.      A socket is an abstraction that represents an endpoint of
  397.      communication. Most applications that consciously use TCP and UDP
  398.      do so by creating a socket of the appropriate type and then
  399.      performing a series of operations on that socket. The operations
  400.      that can be performed on a socket include control operations (such
  401.      as associating a port number with the socket, initiating or
  402.      accepting a connection on the socket, or destroying the socket)
  403.      data transfer operations (such as writing data through the socket
  404.      to some other application, or reading data from some other
  405.      application through the socket) and status operations (such as
  406.      finding the IP address associated with the socket).
  407.  
  408.      The complete set of operations that can be performed on a socket
  409.      constitutes the Sockets API (Application Programming Interface).
  410.      If you are interested in writing programs that use TCP/IP then
  411.      you'll probably need to use and understand the sockets API. Your
  412.      system manuals may have a description of the API (try `man socket'
  413.      if you're using a Unix system) and many books devote chapters to
  414.      it. A FAQ list for sockets programming is available on the Web
  415.      from its Canadian home at <http://www.ibrado.com/sock-faq/>, from
  416.      a UK mirror at <http://kipper.york.ac.uk/%7Evic/sock-faq/> or by
  417.      anonymous FTP from
  418.      <ftp://rtfm.mit.edu/pub/usenet/news.answers/unix-faq/socket>.
  419.  
  420.      The TLI (Transport Layer Interface) API provides an alternative
  421.      programming interface to TCP/IP on some systems, notably those
  422.      based on AT&T's System V Unix. The Open Group, a Unix standards
  423.      body, defines a variation of TLI called XTI (X/Open Transport
  424.      Interface). Note that both sockets and TLI (and XTI) are
  425.      general-purpose facilities and are defined to be completely
  426.      independent of TCP/IP. TCP/IP is just one of the protocol families
  427.      that can be accessed through these API's.
  428.  
  429.   2. How can I detect that the other end of a TCP connection has
  430.      crashed?  Can I use "keepalives" for this?
  431.  
  432.      Detecting crashed systems over TCP/IP is difficult. TCP doesn't
  433.      require any transmission over a connection if the application
  434.      isn't sending anything, and many of the media over which TCP/IP is
  435.      used (e.g.  Ethernet) don't provide a reliable way to determine
  436.      whether a particular host is up. If a server doesn't hear from a
  437.      client, it could be because it has nothing to say, some network
  438.      between the server and client may be down, the server or client's
  439.      network interface may be disconnected, or the client may have
  440.      crashed. Network failures are often temporary (a thin Ethernet
  441.      will appear down while someone is adding a link to the daisy
  442.      chain, and it often takes a few minutes for new routes to
  443.      stabilize when a router goes down) and TCP connections shouldn't
  444.      be dropped as a result.
  445.  
  446.      Keepalives are a feature of the sockets API that requests that an
  447.      empty packet be sent periodically over an idle connection; this
  448.      should evoke an acknowledgement from the remote system if it is
  449.      still up, a reset if it has rebooted, and a timeout if it is down.
  450.      These are not normally sent until the connection has been idle for
  451.      a few hours. The purpose isn't to detect a crash immediately, but
  452.      to keep unnecessary resources from being allocated forever.
  453.  
  454.      If more rapid detection of remote failures is required, this
  455.      should be implemented in the application protocol. There is no
  456.      standard mechanism for this, but an example is requiring clients
  457.      to send a "no-op" message every minute or two. An example protocol
  458.      that uses this is X Display Manager Control Protocol (XDMCP), part
  459.      of the X Window System, Version 11; the XDM server managing a
  460.      session periodically sends a Sync command to the display server,
  461.      which should evoke an application-level response, and resets the
  462.      session if it doesn't get a response (this is actually an example
  463.      of a poor implementation, as a timeout can occur if another client
  464.      "grabs" the server for too long).
  465.  
  466.   3. Can the TCP keepalive timeouts be configured?
  467.  
  468.      This varies by operating system. There is a program that works on
  469.      many Unices (though not Linux or Solaris), called netconfig, that
  470.      allows one to do this and documents many of the variables. It is
  471.      available by anonymous FTP from
  472.      <ftp://cs.ucsd.edu:/pub/csl/Netconfig/netconfig2.2.tar.Z>.
  473.  
  474.      In addition, Richard Stevens' TCP/IP Illustrated, Volume 1
  475.      includes a good discussion of setting the most useful variables on
  476.      many platforms.
  477.  
  478.   4. Are there object-oriented network programming tools?
  479.  
  480.      Yes. One such system is the ADAPTIVE Communication Environment
  481.      (ACE).  The README file for ACE is available on the Web at
  482.      <http://www.cs.wustl.edu/%7Eschmidt/ACE.html>. All software and
  483.      documentation is available via both anonymous ftp and the Web.
  484.  
  485.      ACE is available for anonymous ftp from
  486.      <ftp://ics.uci.edu/gnu/C++_wrappers.tar.Z>. That's a compressed
  487.      tar archive approximately 500KB in size. This release contains
  488.      contains the source code, documentation, and example test drivers
  489.      for C++ wrapper libraries.
  490.  
  491.   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
  492.  
  493. This compilation contains the opinions of the FAQ maintainer and the
  494. various FAQ contributors. Any resemblance to the opinions of the FAQ
  495. maintainer's employer is entirely coincidental.
  496.  
  497. Copyright (C) Mike Oliver 1997-1999. All Rights Reserved.
  498.