|
TCP/IP Communication ProtocolsThe following excerpt from Apple Computer's Networking and Communications Handbook summarizes the primary Internet protocols in the TCP/IP protocol suite that are used in Apple networking. Warthman Associates wrote the text, based on interviews with and preliminary drafts by the Apple networking team. The document is written for an audience of network engineers and administrators.
TCP/IP ProtocolsTCP/IP is a family of protocols that allow computers to share resources across an internetwork. Since TCP (Transmission Control Protocol) and IP (Internet Protocol) are the best known of the protocols, the whole family of protocols is referred to as TCP/IP. However, there are a number of other protocols in the family, as described below. Internet Protocol (IP)The Internet Protocol (IP) is the fundamental protocol of the family. IP handles the routing of datagrams based on destination address. It allows for the interconnection of multiple networks by routing datagrams across network boundaries when necessary. Datagrams can be routed through Ethernet segments, serial lines, phone lines, or satellite links. IP is often referred to as a "connectionless" delivery system because it routes each datagram separately. When it receives a sequence of datagrams from a higher-level protocol, IP routes each datagram in the sequence individually. That is, each datagram in the sequence may, or may not, travel over the same path to the same destination. The IP service makes a best-effort attempt to deliver all datagrams, but if some datagrams get lost due to network hardware problems or resources that are overloaded, higher-level protocols, not IP, will retransmit the datagrams. "Connectionless" can also describe the logical view of an IP internet. Hosts and gateways on the Internet all operate autonomously, routing and delivering datagrams without any coordination with the original sender. Though nodes on the Internet are connected physically in various ways, users see the Internet as a single virtual network where the physical connections are irrelevant. IP also defines the format of a datagram. The general format is a datagram header, followed by a data area. The header includes such fields as version of the IP protocol, length of the header, total length of the datagram, and the source and destination IP addresses. Three fields in the datagram header control fragmentation and reassembly of datagrams. IP can be used with many different physical network implementations, each of which can specify a different maximum size for physical data frames. On some physical networks, IP datagrams must be fragmented to fit into one physical data frame. IP handles fragmenting and reassembly of datagrams, using data in the fragmentation fields of the header. The Time-To-Live (TTL) field in the IP header controls how long a datagram is allowed to remain in the Internet system. The sender of a datagram sets this field. Each gateway along the path from source to destination checks the time remaining and discards the datagram when the TTL value reaches zero. This feature prevents datagrams from traveling around the Internet forever, should the routing tables be temporarily corrupted. The data portion of an IP datagram is used by IP to forward information passed to it from higher-level protocols, such as the TCP header and data. One field in the IP header specifies which protocol is used in the data portion of the IP datagram. Internet Control Message Protocol (ICMP)The Internet Control Message Protocol (ICMP) is used for error messages intended for the IP network software, rather than any particular user program. For example, a gateway might send an ICMP datagram to inform another gateway that a subnetwork or a node on a subnetwork is unavailable. Because the IP Internet is a connectionless system, gateways and hosts route datagrams without coordinating with the original sender. This works fine except when a problem delivering a datagram occurs. Problems occur when nodes or whole networks become disconnected, the time-to-live counter expires, or gateways become too congested to process more traffic. ICMP is used to send messages about these and other error conditions. ICMP is also used for testing the reachability and status of destinations. A host or gateway sends an ICMP echo request message to test whether a destination is alive. Machines that receive echo requests must reply with the exact same data that was sent to them. ICMP is a required protocol for any Internet that uses IP. IP routing will not be successful unless ICMP is used for reporting unexpected circumstances. ICMP messages travel across the Internet in the data portion of IP datagrams. The IP software on the destination machine processes the ICMP messages; they are not sent to higher-level protocols. Transmission Control Protocol (TCP)The Transmission Control Protocol (TCP) ensures reliable stream-oriented communications between cooperating processes. Because TCP calls on IP's services, these processes can exist on machines on different networks. In keeping with the layered approach to networking, most systems that support TCP/IP provide a software interface to the TCP functions, allowing application programs to set up sessions with cooperating processes, listen for requests for sessions, send and receive data, and close sessions. The Application Program Interface (API) to TCP varies from machine to machine. Once a session has been established, the upper-level application channels continuous streams of data through TCP for delivery to its peer process. TCP puts this data along with any necessary control and addressing data into units called "segments," and then passes the segments to a lower-level protocol, which is usually IP. IP puts the segments into datagrams and sends them across the internetwork. TCP, on the other end, checks for errors, acknowledges error-free segments, and reassembles the segments for delivery to upper-level applications. TCP maintains data transmission reliability by using a positive acknowledgment with re-transmission (PAR) mechanism. A sending TCP re-transmits a segment at timed intervals until a positive acknowledgment is received. TCP uses a checksum to detect segments that may have been damaged in transit. Damaged segments are discarded without being acknowledged. TCP and IP have separate checksums. TCP's checksum verifies a segment; IP's checksum verifies its header. To maximize reliability and efficiency, TCP uses a concept known as a sliding window. With a simple PAR mechanism, there is a delay in sending a new packet until an acknowledgment for the previous packet has been received. To avoid this delay, sliding-window protocols allow the sender to transmit multiple packets before waiting for an acknowledgment. As each acknowledgment for each packet sent is received, the window moves forward and a new packet can be sent. The maximum number of packets that can be sent before an acknowledgment has been received is called the "window size." To further enhance reliability, TCP has a flow-control mechanism that allows the receiving end to specify how much data it can receive at the present time. When the receiving end sends an acknowledgment, it also advertises how much data it is prepared to accept on the next transmission. The sending node's window size may vary based on how much data the receiving end can accept. User Datagram Protocol (UDP)With the User Datagram Protocol (UDP), user processes can send and receive data across the network without the error-checking or session-management facilities of TCP. This avoids the overhead involved with establishing and maintaining an active and error-free TCP session. UDP is often used for transporting unknown protocols. For example, when UDP is used to transport AppleTalk protocol data on an Ethernet-based internetwork, the AppleTalk data can get passed through the standard Ethernet nodes that don't understand AppleTalk, and eventually reach a node that does understand it. Another important feature of both UDP and TCP is that they have the ability to distinguish among multiple destinations within a given host computer. The existence of a port number allows UDP and TCP users to distinguish among various applications on one machine, such as file transfer, remote job entry, and echo. In addition to the data sent by a user process, each UDP or TCP message includes an identifier, called a "port number" for the destination and source processes. By convention, some port numbers are reserved for well-known processes such as FTP, Telnet, name server, and authentication service. Routing Information Protocol (RIP)The Routing Information Protocol (RIP) is used by gateways for exchanging network routing information. It is mainly intended for local area networks, such as networks on a university campus. It was not intended for use on large, long-haul internets, although some large internets use it today. The most widely used version of RIP is the Routed software that is released with the 4.2BSD UNIX system. RIP is used by gateways to periodically broadcast their current routing database to neighboring gateways. Routing databases comprise a list of network addresses, and, for each network, the address of the next gateway to which to send datagrams for that network. When RIP messages are received, routing databases are updated if the RIP message gives newer information about the shortest path to a network. The concepts behind RIP are similar to the AppleTalk Routing Table Maintenance Protocol. TelnetTelnet is an applications-level protocol that makes a terminal on one computer appear to be directly attached to a remote computer on the internetwork. It can also make a personal computer act as a terminal to remote hosts. It is usually implemented as server software on a host that accepts requests from remote hosts, and local user software that interacts with the user at the local terminal. File Transfer Protocol (FTP)The File Transfer Protocol (FTP) supports the transfer of files between nodes on the internetwork. Like Telnet, FTP is usually implemented as a pair of server and user processes, where the server process handles requests from remote users to store and retrieve files, and the user process interacts with a user at a terminal. FTP options include choices between ASCII and EBCDIC, text and binary, and various transfer modes. Simple Mail Transfer Protocol (SMTP)As its name implies, the Simple Mail Transfer Protocol (SMTP) is a mechanism for transferring electronic mail among users on the internetwork. The protocol specifies the commands necessary to send mail, and is used with a standard that specifies the following general structure of a mail message: a group of header lines, a blank line, and the body of the message. Messages are sent as net ASCII, meaning the ASCII character set is used, with a carriage return/linefeed to delimit lines. SMTP is a simple mechanism that lets a user add mail to another user's mail file. There are some problems with this in a microcomputer environment, because the SMTP mail software expects to be able to open a connection to the addressee's computer. A microcomputer might be busy doing something else, or could be turned off. For this reason, mail is normally handled by a larger system, and microcomputer mail software becomes a simple program that retrieves mail from a mail server and presents it to the user. The Post Office Protocol (POP) is used for communicating between the microcomputer mail program and the server program.
|