Basic Networking Concepts
Basic Networking Concepts
Although this book is intended for readers who already have some
knowledge of networking fundamentals, many people use slightly
different definitions for the same networking terms. Therefore, this section
provides definitions of networking and communications terms as used in
this book.
If the nodes are not all connected to a single physical cable, special
hardware and software devices must connect the cables in order to forward
messages to their destination addresses. A bridge is a device that connects
networking cables without examining the addresses of messages or
making decisions as to the best route for a message to take. By contrast, a
router contains addressing and routing information that lets it determine
from a message's address the most efficient route for the message. A
message can be passed from router to router several times before being
delivered must use a common set of rules defining the format of the data
and the manner in which it is to be transmitted. A protocol is a formalized
set of procedural rules for the exchange of information and for the
interactions among the network's interconnected nodes. A network
software developer implements these rules in software modules that carry
out the functions specified by the protocol.
Whereas a router can connect networks only if they use the same protocol
and address format, a gateway converts addresses and protocols to
connect dissimilar networks.
Note
Although it is sometimes important to distinguish between a protocol and
the software that implements the protocol, in most cases you can infer
which is meant from the context. Accordingly, this book usually uses the
term protocol rather than the more precise term protocol implementation
to refer to the Open Transport implementation of a protocol.
Types of Protocols
Networking protocols can be characterized as connectionless or
connection-oriented, and as transactionless or transaction-based.
Table 1-1 shows where some Open Transport protocols fit in the protocol-
type matrix. A protocol of one type can be a client of a different type. For
example, the connection-oriented transactionless AppleTalk Printer
Access Protocol (PAP) is a client of the connectionless transaction-based
AppleTalk Transaction Protocol (ATP), which is in turn a client of the
connectionless transactionless Datagram Delivery Protocol (DDP).
The Open Transport protocol matrix and some Open Transport protocols
Connectionless Connection-oriented
PPP Serial connection
DDP ADSP
Transactionless
IP TCP
UDP PAP
Transaction-based ATP ASP[1]
Addressing
In order to establish a network connection or to send a message using a
connectionless protocol, you must have the address of the destination.
Each protocol uses a specific type of address, which might be the same as
that used by a lower-level protocol in the protocol stack or might be
unique to that protocol. DDP and IP, for example, use addresses sufficient
for node-to-node delivery of datagrams, through routers if necessary. The
protocols and applications that are clients of DDP are assigned socket
numbers. A socket is a piece of software that serves as an addressable
entity on a node. DDP is responsible for delivering a datagram to the
correct socket.
It is important to note that often more than one protocol is defined and
implemented to handle the requirements of a layer in different ways. In
addition, some protocols include functions that span more than one layer
specified by a model. For example, in favor of efficiency, a network
protocol developer may elect to define a single protocol that spans two or
more layers of a reference model.
Figure 1-1 shows the layers of the OSI model and how the AppleTalk and
TCP/IP protocols provided with the Open Transport system software fit
into this model.
Subtopics
Types of Protocols
Addressing
Protocol Stacks and the OSI Model
The set of functions you use and the sequence of functions you call
depends on the operation you want to perform and whether the
protocol you want to use is connectionless or connection-oriented,
transactionless or transaction-based.
Software Modules
You can write your own STREAMS modules to work with Open
Transport. The Open Transport TCP/IP software modules are based
on the UNIX STREAMS standard. This book does not cover
STREAMS or writing a STREAMS modules. For more information
about STREAMS, see UNIX System V Release 4: Programmer's Guide:
STREAMS and the Open Transport Module Devloper's SDK.
endpoint providers
mapper providers
service providers
Transport Independence
In contrast to earlier Mac OS application programming interfaces
(APIs) for AppleTalk and TCP/IP, in which each protocol had a
separate and unique set of routines, Open Transport provides a single
set of functions that you can use with any protocol or protocol family.
The type of endpoint you open (connectionless or connection-oriented,
and transactionless or transaction-based) determines which functions
you call to send and receive data, independent of the specific protocol
or protocol family you use.
For example, if you open a connectionless, transactionless endpoint,
you use the OTSndUData function to send data. You use this function
whether you are using DDP, IP, or UDP. If you open a connection-
oriented, transactionless endpoint, on the other hand, you first
establish a connection using the OTConnect and OTRcvConnect
functions, and then use the OTSnd function to send data. You use these
same functions whether you are using TCP, ADSP, or any other Open
Transport connection-oriented, transactionless protocol.
Although transport independence means that you can use the same
API regardless of the protocol or communcations hardware you want
to use, it does not free you from all knowledge of the transport type.
When you open an endpoint, you must specify the highest-level
protocol in the endpoint provider, and you must call the functions
appropriate to the type of that protocol. For example, although your
application can use the same set of functions to send data through
either an ADSP or a TCP connection (that is, functions for a
connection-based transactionless protocol), you must specify which of
these protocols you want to use use when you open the endpoint.
Because the type of endpoint you open depends only on the highest-
level protocol in the endpoint provider, protocol layering does not
affect the transport independence of Open Transport. That is, you use
the same functions to open and maintain a connection and to send
messages whether you are using ADSP over DDP through Ethernet,
or TCP over IP through token ring.
Subtopics
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.
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.
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.
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.
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:
Chapter Contents