Important: The information in this document is obsolete and should not be used for new development.
Deciding Which Protocol to Use
Each of the networking protocols available with Open Transport implements a different set of services. This section provides a brief discussion of the uses of each of the protocols included with the Open Transport system software on the Macintosh computer. If you have Open Transport software modules provided by vendors other than Apple Computer, Inc., you should refer to the documentation that came with that software to determine its use.There are instances in which the protocol to be used is dictated by the application; for example, HTTP requires TCP. In some cases, you might be in a position to choose the protocol yourself. If so, before you open an endpoint, you should make your choice based on the following issues:
This section discusses each of these choices in turn.
- general purpose or special purpose
- choice of protocol family, AppleTalk or TCP/IP
- connection-oriented or connectionless
- transaction-based or transactionless
- high- or low-level protocol
General Purpose or Special Purpose
Your choice of protocol is very simple if there is only one protocol that performs the function you are interested in. For example, if you want to send a print job directly to an AppleTalk printer, you probably need to use the Printer Access Protocol (PAP). On the other hand, if you want to transfer data of a general nature, there are many protocols that can do the job. The following sections describe the factors you can take into consideration in order to choose among those protocols.Choice of Protocol Family
There are two sets of protocols, or protocol families, included with the Open Transport system software: AppleTalk and TCP/IP. In addition, other developers can provide protocols and protocol families compatible with Open Transport. You must decide which protocol family to use for a specific purpose. For information on the use of other protocols, see the documentation that came with the software.AppleTalk is a networking technology developed by Apple Computer, Inc. Every Mac OS computer that has ever been made includes AppleTalk hardware and system software. If your application needs to communicate with other Mac OS computers, AppleTalk is a natural choice. Note that the other computers need not be running Open Transport; the nodes must be running the same protocol, but need not be using the same implementation of the protocol.
TCP/IP, on the other hand, is the standard protocol family used by the Worldwide Internet and by many networks owned by businesses and other organizations. It offers faster performance compared to AppleTalk and makes cross-platform applications easier to develop. If you wish to communicate with the Worldwide Internet without going through a gateway, or if you want to connect to a network that uses TCP/IP protocols, choose one of the Open Transport TCP/IP protocols.
High-Level or Low-Level Protocol
Figure 1-1 shows the protocols provided by Apple Computer, Inc. with Open Transport and where they fit in the OSI model. All the high-level protocols (except UDP) shown in Figure 1-1 provide error checking and error recovery services, including checking for correct packet sequence and retransmission of lost or damaged packets.If you use a high-level protocol that provides for reliable delivery of data and error recovery, you need not implement these services yourself. On the other hand, these protocols generate somewhat more network traffic than the lower-level protocols, including handshake and control signals, signals to maintain sessions, and retransmitted packets.
The network-layer protocols IP and DDP provide best-effort delivery between nodes on a network. They are connectionless protocols and do not correct for corruption of data, packet loss, or incorrect packet sequencing. They generate the least possible amount of network traffic for the data they transmit. These protocols are appropriate for applications that do not require highly accurate data transmission and for applications that provide their own error recovery. If you want to implement your own protocol stack based on AppleTalk or TCP/IP protocols, these are the protocols to use.
The high-level protocol UDP is unusual in that it comines attributes of both high and low level protocols--that is, it does not provide error recovery services but it checks for data corruption.
Connection-Oriented or Connectionless
Connection-oriented protocols ensure reliable delivery of data and do not require you to repeat the recipient's address or repeat the connection process for the duration of the session. Once you have established a connection, the protocol maintains the connection, informing you if it has closed for any reason. Because of the reliability of connection-oriented protocols, they are a good choice whenever you have a lot of data to exchange over a limited period of time. However, in order to maintain the connection, these protocols sometimes send control signals, which result in increased network traffic.Open Transport AppleTalk offers two connection-oriented protocols: ADSP and PAP. ADSP is a full-duplex transactionless protocol, well suited to the transfer of large amounts of data. PAP is a transactionless session-layer protocol and a client of ATP. It is intended primarily for communication with AppleTalk printer products.
Open Transport TCP/IP provides one connection-oriented protocol, TCP, which is a transactionless protocol. TCP, like ADSP, provides highly reliable data delivery suitable for the transfer of large amounts of data.
Transaction-Based or Transactionless
A transaction-based protocol is suited to many client-server interactions where the client requests services and there are a limited number of ways in which the server can respond. File servers and printers are examples of servers that can use these protocols. However, you should keep in mind that transaction-based protocols limit transport independence: currently, only Apple Talk uses these protocols. In addition, given that transaction-based protocols incur some overhead to set up, you might consider choosing one of the connection-oriented protocols instead; these also involve the overhead of establishing the connection but offer more possibility for transport-independence.Open Transport AppleTalk includes the ATP transaction-based protocols. An ATP transaction request must fit in a single packet; however, the response can contain up to eight packets. ATP transactions are an efficient means of transporting small amounts of data across the network. ATP provides a semi-reliable loss-free transport service.
You should use ATP
A workstation application that requires a state-dependent service should use ADSP instead of ATP. State dependence means that the response to a request is dependent on a previous request. For example, before a workstation application connected to a file server can read a file, it must have first issued a request to open the file. When a dialog is state dependent, all requests must be delivered in order and duplicate packets must not be sent; ADSP provides for this.
- if you want to send a small amount of data
- if your application requires delivery of all packets
- if your application can tolerate a minor degree of performance degradation
- if you do not want to incur the overhead involved in maintaining a session
An ATP transaction-based request, such as a workstation application requesting a server to return the time of day, is independent of other requests and not state dependent.
The Open Transport system software does not include any transaction-based protocols for the TCP/IP protocol family.
Summary
The following is a summary of the preceding sections:
- If your application requires a specific protocol, use that one.
- If your intended connectees are local Mac OS computers, use the AppleTalk protocol family.
- If your intended connectees are not Mac OS computers, or Mac OS computers on a remote network, use the TCP/IP protocol family.
- To take advantage of Open Transport's transport independence and provide both AppleTalk and TCP/IP, let the user choose.
- If you need reliability, use a connection-oriented protocol.
- If you need low overhead or you are writing a real-time application, use a connectionless protocol.
- Avoid transaction-based protocols.
Subtopics
- General Purpose or Special Purpose
- Choice of Protocol Family
- High-Level or Low-Level Protocol
- Connection-Oriented or Connectionless
- Transaction-Based or Transactionless
- Summary