|
Lesson 3 - Protocols, Programs, and Processes
An example of a very basic protocol is illustrated on the Simple Protocol Diagram. Suppose two programs connected by a communications channel need to exchange messages that vary in length up to a maximum of 999 bytes. The protocol rules would specify that the first three characters of each message are numeric characters that give the length of the message in decimal (not counting the first three characters). For the message "HELLO WORLD," which contains 11 characters (including the space), the sending program would transmit the characters "011HELLO WORLD." The receiving program would accept the first three characters, and then, knowing the length of the message, would expect eleven more characters.
Simple ProtocolIf the receiving program got a message that had something other than a numeric in the first three characters, it would consider that a violation of the protocol. If the sending program stopped sending before all of the characters were received, that would also be considered an error. ProgramsThe term "program" tends to mean a complete set of routines that provide a high-level function of some sort. In the literature of data communications, and at some points in this course, the term "process" will be used instead of "program"--usually when we are discussing a subset of functions (still possibly quite complex) that fit into a larger program or system. This is especially true when we are talking about a program when it is executing in an operating system (OS). An executing, ready-to-run, or waiting program is called a process, and is sometimes referred to as a task. Types of Cooperative ProcessesProcesses that communicate with one another must be cooperating in some sense to accomplish a useful function. But they can cooperate in different ways. Three important styles of cooperation have been categorized, namely: peer-to-peer, client/server, and master/slave. The legacy "master/slave," or mainframe control model, where large databases are accessed by many users, has pretty much morphed into a client/server paradigm. In many instances, the mainframes were simply re-labeled "Superservers." Peer-to-Peer ProcessesTwo programs or processes that use the same protocol to communicate and perform approximately the same function for their respective nodes are referred to as peer processes. With peer processes, in general, neither process controls the other, and the same protocol is used for data flowing in either direction. Communication between them is spoken of as "peer-to-peer." This concept is illustrated on the Peer Processes Diagram.
Peer ProcessesThe Peer Communications Diagram illustrates this concept even further, in that workstations are communicating between each other directly. Each has the ability to send requests or to respond to requests. They are considered peers because each contains the same ability to initiate communication.
Peer CommunicationsClient/Server ProcessesAnother way that processes can cooperate is for one process to take the role of client and the other, that of server. The client process makes requests, by means of the shared protocol, for the server process to perform some task. This method of cooperation is typically used to allow the sharing of resources across a network, as illustrated on the Client/Server Processes Diagram. The client process wishes to take advantage of a resource that exists on the server node. Examples of resources that are commonly shared through client/server arrangements are files, databases, and printers. Typically, the client process is found on a lower-capability, end-user node, such as a workstation or personal computer (PC), while the server process runs on nodes with larger capacity or greater power, such as a network file server. Examples of programs that employ client/server architectures are the Network File System (NFS) and several of the relational database management products, such as Oracle.
Client/Server ProcessesBoth client and server processes are dedicated to their respective tasks; the roles do not normally reverse, but can. The processes share a common protocol, and the protocol defines conventions for communications typically originating from the client to the server. With peer-to-peer communications, the protocol rules are more or less the same, and so are the peer tasks. ServicesIf the program at the end of the communication link is an interactive program, then it is providing some service to the user, for example, accepting and displaying messages that are transmitted by the other program. The user may have no knowledge of the protocol the programs are using to exchange data. Services are quite distinct from protocols; many different protocols could be used to provide a given service, and programs that use a single protocol to communicate could provide many different services. Finally, a communications program can provide its services to another program instead of to a user. [ Previous Section ] [ Unit Contents ] [ Next Lesson ]
|