In the jargon of operating systems, it is not actually programs but processes
that are communicating. A process can be thought of as a program that is running within an end system.
Processes on two different end systems communicate with each other by exchanging messages
across the computer network. A sending process creates and sends messages into the network; a receiving process receives
these messages and possibly responds by sending messages back.
Client and Server Processes
A network application consists of pairs of prcesses that send messages to each other over a network.
In a P2P file-sharing system, a file is transferred from a prcess in one peer to a process in another peer. For each
pair of communicating process, the two processes were labeled one as the client and the other as the server.
With the Web, a browser is a client process and a Web server is a server process. With P2P file sharing, the
peer that is downloading the file is labeled as the client, and the peer that is uploading the file is labeled as the server.
Sockets
Any message sent from one process to another must go thorugh the underlying network. A process sends
messages into, and receives messages from, the network through its socket.
When a prcess wants to send a message to another process on another host, it shoves the message out its
door (socket) and into the network. This sending process assumes that there is a transportation infrastructure on the
other side of its door that will transport the message across the network to the door of the destination process. Once
the message arrives at the destination host, the message passes, through the receiving process's door (socket), and the receiving
process than acts on the message.
A socket is the interface between the application layer and the transport layer within a host. It
is also referred to as the application programming interface (API) between the application and the network,
since the socket is the programming interface with which network applications are built in the Internet.
Addressing Processes
In order for a prcess on one host to send a message to a process on another host, the sending process must
identify the receiving process. Tho identify the receiving process, two pieces of information need to be specified:
(1) the name or address of the host and (2) an identifier that specifies the receiving process in the destination host.
In internet applications, the destination host is identified by it IP address Since the
IP address of any host connected to the public Internet must be globally unique, the assignment of IP addresses must
be carefully managed.
In addition to knowing the address of the host to which a message is destined, the sending host must also
identify the receiving process running in the host. This information is needed because in general a host could be runing many
network applllications. A destination port number serves this purpose. Popular applications have
been assigned specific port numbers.