Describe how server processes start and stop under the control of inetd.
Clients, Servers, and Ports
There are many types of network services, but each service operates in a similar way. For example, let's consider the telnet service.
This service allows a user logged in on one UNIX machine (say, machine A) to contact machine B, log on to that machine, and work on the remote machine.
Telnet model
For the connections, TELNET uses the TCP protocol. The TELNET service is offered in the host machine's TCP port 23.
The user at the terminal interacts with the local telnet client. The TELNET client acts as a terminal accepting any keystrokes from the keyboard, interpreting them and displaying the output on the screen. The client on the computer makes the TCP connection to the host machine's port 23 where the TELNET server answers. The TELNET server interacts with applications in the host machine and assists in the terminal emulation.
Figure 4.2 Telnet Protocol Model
TELNET Connection
As the connection is setup, both ends of the TELNET connection are assumed to be originated and terminated at the (NVT) network virtual terminal. The NVT is a network wide terminal which is host independent so that both the server and the client in the connection may not need to keep any information about each others terminal's characteristics. Both sides see each other as a NVT terminal. As there are several types of terminals, which may be able to provide additional services from those provided by the NVT, the TELNET protocol contains a
negotiation method for the user and the server to negotiate changes to the terminal provided in the NVT. Typically the client and the server stays in the NVT just as long as it takes to negotiate some terminal type to be emulated.
The following series of images below describe how the telnet service works:
1) User logs on to a UNIX machine A
2) User contacts remote machine B using telnet service. User can now work on the remote machine B.
3) Telnet is organized as a client-server transaction. User on machine A types to a telnet client process running on machine A.
The client process passes data across the network to the server process running on machine B.
4) The server process on machine B acts on the commands it receives, and passes the replies back to the client process on machine A.
In the most typical situation, each connection between two machines has an associated pair of client and serverprocesses, with different client and server processes for each
Client: (1) a process running on a host computer which requests services; (2) a computer running a client process.
Server: (1) a process running on a host computer which supplies services in response to client requests. (2) a computer which runs server processes.
process: A UNIX process is a running program.
transaction. Now let's explore in more detail how these client/server transactions are set up under UNIX.