Client/server communication with the TCP/IP model
Presentation of the protagonists
The client:
In client/server communication, the "client" is the program that needs a service.
The server:
In client/server communication, the "server" is the program that is able to respond to a service request.
Interaction:
To communicate each protagonist uses a communication port that complements the network address of the machine on which the program is running. The pair (address, port) identifies one end of the communication mode while a communication is identified by all of its two ends.
Two different communication modes are offered. There is on the one hand the communication by "datagram" and on the other hand the communication in connected mode.
Notes:
- The same program can be both a client for one communication and a server for another communication. This is the case of "proxy", "relay servers". This is also the case, during a file transfer by the FTP protocol when the "active" mode is used, for each of the protagonists.
- The fact that the human being directly uses one of the programs is not a criterion that defines whether this program is the client or the server in the communication. Indeed, we can find two antagonistic examples:
- A WEB browser is used, by a human being, to view WEB pages retrieved from a WEB server. To transfer the pages, we use the HTTP protocol in which the browser is the client, the general service rendered being "to obtain a WB file".
- An X11 server is used, by a human being, to view the windows of graphical applications. To display the windows, the programs use the X11 protocol in which they are clients, the general service rendered being "Drawing the windows of the application in view of presenting it to the human being".
Datagram communication
The datagram can be compared by analogy to a letter sent by post or to an SMS.
Communication in connected mode
The connected mode can be compared by analogy to a telephone communication. Once the called party has picked up, a two-way channel carries the voice of the two interlocutors.