ArticleslgStudy

science

X Window System protocols and architecture

X Window System protocols and architecture is a science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand X Window System protocols and architecture rather than just read about it. In short: In computing, the X Window System (commonly: X11, or X) is a network-transparent windowing system for bitmap displays. This article details the protocols and technical structure of X11.

X Window System protocols and architecture — main illustration
X Window System protocols and architecture — illustration

Key takeaways

  • X Window System protocols and architecture belongs to science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect X Window System protocols and architecture to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of X Window System protocols and architecture from memory before moving on to harder problems.

Reference excerpt

In computing, the X Window System (commonly: X11, or X) is a network-transparent windowing system for bitmap displays. This article details the protocols and technical structure of X11.

Client–server model and network transparency

X uses a client–server model. An X server program runs on a computer with a graphical display and communicates with various client programs. The X server acts as a go-between for the user and the client programs, accepting requests on TCP port 6000 plus the display number for graphical output (windows) from the client programs and displaying them to the user (display), and receiving user input (keyboard, mouse) and transmitting it to the client programs. In X, the server runs on the user's computer, while the clients may run on remote machines. This terminology reverses the common notion of client–server systems, where the client normally runs on the user's local computer and the server runs on the remote computer. The X terminology takes the perspective that the X program is at the centre of all activity, i.e. the X program accepts and responds to requests from applications, and from the user's mouse and keyboard input. Therefore, applications (on remote computers) are viewed as clients of the X server program. The communication protocol between server and client runs network-transparently: the client and server may run on the same machine or on different ones, possibly with different architectures and operating systems. A client and server can communicate securely over the Internet by tunneling the connection over an encrypted connection.

Design principles Bob Scheifler and Jim Gettys set out the early principles of X as follows (as listed in Scheifler/Gettys 1996):

Do not add new functionality unless an implementor cannot complete a real application without it. It is as important to decide what a system is not as to decide what it is. Do not serve all the world's needs; rather, make the system extensible so that additional needs can be met in an upwardly compatible fashion. The only thing worse than generalizing from one example is generalizing from no examples at all. If a problem is not completely understood, it is probably best to provide no solution at all. If you can get 90 percent of the desired effect for 10 percent of the work, use the simpler solution. (See also Worse is better.) Isolate complexity as much as possible. Provide mechanism rather than policy. In particular, place user interface policy in the clients' hands. The first principle was modified during the design of X11 to: Do not add new functionality unless you know of some real application that will require it. X has largely kept to these principles since. The X.Org Foundation develops the reference implementation with a view to extension and improvement of the implementation, whilst keeping it almost entirely compatible with the original 1987 protocol.

Core protocol

Communication between server and clients is done by exchanging packets over a network channel. The client establishes the connection, sending the first packet. The server answers by sending back a packet stating the acceptance or refusal of the connection, or with a request for a further authentication. If the connection is accepted, the acceptance packet contains data for the client to use in the subsequent interaction with the server. After connection is established, the client and the server exchange four different types of packets over the channel:

Request: the client requests information from the server or requests it to perform an action. Reply: the server responds to a request. Not all requests generate replies. Event: the server sends an event to the client, e.g., keyboard or mouse input, or a window being moved, resized or exposed. Error: the server sends an error packet if a request is invalid. Since requests are queued, error packets generated by a request may not be sent immediately. The X server provides a set of basic services. The client programs realize more complex functionalities by interacting with the server.

Windows

What other graphical user interfaces usually call a window is a top-level window in the X Window System. The term window is also used for windows that lie within another window, that is, the subwindows of a parent window. Graphical elements such as buttons, menus, icons, etc. are all realized using windows. A window can only be created as a subwindow of a parent window. This causes the windows to be arranged hierarchically in a tree. The X server automatically creates the root of the tree, called the root window. The top-level windows are exactly the direct subwindows of the root window. Visibly, the root window is as large as the screen, and lies behind all other windows.

Identifiers The X server stores all data about windows, fonts, etc. The client knows identifiers of these objects – integers it can use as names for them when interacting with the server. For example, if a client wishes a window to be created, it requests the server to create one and (in case of success) gets in return an identifier the server associated with the newly created window. The identifier can be later used by the client to request, for example, a string to be drawn in the window. Identifiers are unique to the server, not only to the client; for example, no two windows have the same identifier, even if created by two different clients. A client can access any object given its identifier, even if another client created the object.

… excerpt ends here. Continue reading the full article.

Illustrations

X Window System protocols and architecture: In this example, the X server takes input from a keyboard and mouse and displays to a screen. A web browser and a terminal emulator run on the user's workstation, and a terminal emulator runs on a remote server but under the control of the user's machine. Note that the remote application runs just as it would locally.
In this example, the X server takes input from a keyboard and mouse and displays to a screen. A web browser and a terminal emulator run on the user's workstation, and a terminal emulator runs on a remote server but under the control of the user's machine. Note that the remote application runs just as it would locally.
X Window System protocols and architecture: A possible placement of some windows: 1 is the root window, which covers the whole screen; 2 and 3 are top-level windows; 4 and 5 are subwindows of 2. The parts of window that are outside its parent are not visible.
A possible placement of some windows: 1 is the root window, which covers the whole screen; 2 and 3 are top-level windows; 4 and 5 are subwindows of 2. The parts of window that are outside its parent are not visible.

Worked examples

Example 1 — a first encounter with X Window System protocols and architecture

Start with the simplest possible case. Write down what X Window System protocols and architecture claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to X Window System protocols and architecture before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about X Window System protocols and architecture ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of X Window System protocols and architecture

In research
X Window System protocols and architecture appears in science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses X Window System protocols and architecture in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
X Window System protocols and architecture is common in secondary-school and first-year university syllabi. It links to neighbouring topics Application layer protocols, Remote desktop protocols, X Window System, so understanding it makes those chapters shorter.
In everyday life
Look for X Window System protocols and architecture outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “X Window System protocols and architecture” →

How to study X Window System protocols and architecture in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what X Window System protocols and architecture means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain X Window System protocols and architecture out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is X Window System protocols and architecture in simple terms?

In computing, the X Window System (commonly: X11, or X) is a network-transparent windowing system for bitmap displays. This article details the protocols and technical structure of X11.

Why does X Window System protocols and architecture matter?

Because it connects several science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study X Window System protocols and architecture?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on X Window System protocols and architecture.

Tags

  • Application layer protocols
  • Remote desktop protocols
  • X Window System
  • X Window extensions

Keep exploring