The X protocol is a standardized protocol for exchanging data between an X server and an X client over a network. The X protocol supports the graphical application on an X client through the graphical user interface provided by the X server. This functional separation - the X client for the graphical application, the X server for the graphical display - makes the client and server interchangeable; it also allows remote applications on the network to be graphically supported by the X server.
The X protocol recognizes four different data packet formats: Request, Reply, Event, and Error. According to the procedure, the X client sends a request to the X server in the form of a request (REQ). Such a request from an X client to the X server can be for an operation to be performed by the server, for a window to be set up by the server, for a font instruction, for a graphics command to create a graphic, for text or graphics output, or for a query about server properties.information to the client. Regardless of the response, the X client can send its next request.
If the X client receives an event data packet, the X server informs the client about special events caused by the user, such as a mouse movement. And an Error data packet also informs the client about events at the X server. However, the X client handles error messages differently from event messages. The X protocol uses an extended ASCII character set to transfer information, with several versions supporting only line and raster graphics, and another version supporting the core graphical system. The network-independent X protocol represents the lowest level in X Window.