The X Windows system, which is commonly abbreviated to just X – is a client/server application which allows multiple clients use the same display managed by a server. The server in this instance manages the display, mouse and keyboard. The client is actually any remote application which runs on a different host (or on the same one). In most configurations, the standard protocol used is TCP because it’s more commonly understood by both client and host. Twenty years ago though, there were many other protocols were used by X Windows – DECNET was a typical choice in large Unix and Ultrix environments.
Sometimes the X Windows System could be a dedicated piece of hardware although this is becoming less common. Most of the time the client and server are used on the same host, but allowing inbound connections from remote clients when required. In some specialised support environment you’ll even find the processes running on a workstation to support the X Windows access. In some sense where the application is installed is irrelevant, what is more important is that a reliable bi-directional protocol is available for communication. To support increased security, particularly in certain sensitive environments access may be restricted and controlled via an online IP changer.
X windows running with something like UDP is never going to work very well, but the ideal as mentioned above is probably something like TCP. The main communication matrix relies on 8 bit bytes transferred across the connection between the client and server. So on a Unix system when the client and server is installed on the same host, the system will default back to Unix domain protocols instead. This is because these domain protocols are more efficient when used on the same host and minimizes the IP processing involved in the communication stream.
It is when multiple connections are being used that communication can get more complex. This is not unusual as for example X Windows is often used to allow multiple connections to an application running on a Unix System. Sometimes these applications have specific requirements to allow full functionality for example special graphic commands which affect the screen. It is important to remember though that all X Windows does is allow access to the keyboard, display and mouse to these clients. Although it might seem similar it is not the same as a remote access protocol like Telnet which allows logging in to a remote host but no direct control of hardware.
The X Windows system normally is there to allow access to important applications so will usually be bootstrapped at start up. The server will create a TCP end point and will do a passive open on a port (default normally 6000 +n). Sometimes configuration files will be needed to support different applications especially if they have graphical requirements like the BBC iPlayer, these must be downloaded before the session is established. In this instance n is the number of the display so will be incremented to allow multiple concurrent connections. On a Unix server this will usually be a domain socket incremented by n with display numbers too.