Java Reference
In-Depth Information
Application
Application
Socket
Socket
UDP
TCP
TCP
UDP
IP
IP
Channel
Channel
IP
(e.g., Ethernet)
Host
Router
Host
Figure 1.1: A TCP/IP network.
small number of communication channels; most hosts need only one. Programs that exchange
information over the network, however, do not interact directly with routers and generally
remain blissfully unaware of their existence.
By information we mean sequences of bytes that are constructed and interpreted by pro-
grams. In the context of computer networks, these byte sequences are generally called packets .
A packet contains control information that the network uses to do its job and sometimes also
includes user data. An example is information identifying the packet's destination. Routers
use such control information to figure out how to forward each packet.
A protocol is an agreement about the packets exchanged by communicating programs
and what they mean. A protocol tells how packets are structured—for example, where the
destination information is located in the packet and how big it is—as well as how the infor-
mation is to be interpreted. A protocol is usually designed to solve a specific problem using
given capabilities. For example, the HyperText Transfer Protocol (HTTP) solves the problem of
transferring hypertext objects between servers, where they are stored, and Web browsers that
make them available to human users.
Implementing a useful network requires that a large number of different problems be
solved. To keep things manageable and modular, different protocols are designed to solve
different sets of problems. TCP/IP is one such collection of solutions, sometimes called a
protocol suite . It happens to be the suite of protocols used in the Internet, but it can be used in
stand-alone private networks as well. Henceforth when we talk about the “network,” we mean
any network that uses the TCP/IP protocol suite. The main protocols in the TCP/IP suite are
the Internet Protocol (IP), the Transmission Control Protocol (TCP), and the User Datagram
Protocol (UDP).
It turns out to be useful to organize protocols into layers ; TCP/IP and virtually all
other protocol suites are organized this way. Figure 1.1 shows the relationships among the
protocols, applications, and the sockets API in the hosts and routers, as well as the flow
of data from one application (using TCP) to another. The boxes labeled TCP, UDP, and IP
represent implementations of those protocols. Such implementations typically reside in the
Search WWH ::




Custom Search