Client Server Architecture

The X Window System was developed at MIT in 1984. It is a network based windowing system.X is divided in to clients and servers that communicate using a network connection. This allows an X server on one machine to display the output of clients from other machines simultaneously.

X can be run over any type of network, including TCP/IP, OSI, and DECnet.

As a contrast, Microsoft Windows is not a client server architecture, and all windows applications must be executed on the same machine as Windows.
X Client/Server Architecture Image

Client Architecture

X clients (or applications) are usually written to a standard API. This API hides all of the network interface code and a lot of other "housekeeping"
functions that are required to implement the X Protocol and communicate with an X server.

Typically, a user will have multiple clients running on the display at one time.

X clients make requests to the X server (using the X prototcol) whenever they want something done on the display. The request is acted upon by the X Server.

MS Windows applications on the other hand make an API call that usually results in a call directly to the display device driver.
 

Server Architecture

The X Server is responsible for managing some type of display hardware, the keyboard, and a pointing device (usually a mouse). The X Server also manages the network connections to the clients. The X server processes requests from all of its clients and performs the desired actions.

Protocol Architecture

The X protocol is still at version 11.0. The Release number of X Windows (currently 5) does not imply a change in the protocol. Because there is only one version of the X11 protocol, all clients and X Server can interoperate.

The X protocol has 4 message types: Requests, Replys, Events, and Errors. These messages are exchanged between X clients and X servers.

Clients always send Requests to the server. The X server send a Reply to Requests that need some information returned to them (such as getting a bitmap from a window).

The X server sends Events to the clients when something has happen that the client should know about (such as input from the keyboard or mouse).

Errors are sent from the X server to the client when something goes wrong (such as the client specified a bad window identifier in a Request).

Hooks are included in the core X protocol for adding extensions. This allows new features to be added to X (on an optional basis), without making any incompatible changes to the X protocol.