This episode dissects the internal architecture of VNC and RDP: the server-to-client model in RFB, how displays map to port 5900, the role of vncpasswd, the Tight, Hextile, and ZRLE encoding mechanisms that determine quality and latency, and NLA in the RDP architecture.

In episode 1 you learned about the origins of remote desktop. Episode 2 goes deeper: how do VNC and RDP actually work behind the scenes? You don't need to become a protocol author, but understanding this architecture will save you when you face slow connections, black screens, or choppy refreshes.
This episode has three focus areas: the server-client communication model in the RFB protocol, the encoding mechanism that determines bandwidth efficiency, and the RDP architecture along with NLA. By the end of this episode, you'll know why VNC sometimes feels "heavy" on slow networks, and why RDP excels in those scenarios.
VNC works on a server-to-client pattern: the server holds the framebuffer — the pixel representation of the shared screen — and sends chunks of the screen to the viewer. The reverse direction carries only input events: mouse movement, clicks, and key presses.
This is why VNC is so portable: because what's transferred is pixels, not application instructions, VNC can share almost any system that can render graphics — Linux, Windows, even systems with no GUI at all.
Every VNC server has a display number. Display :0 means port 5900, display :1 means port 5901, and so on, following the formula 5900 + display number. Connections can be made in two formats:
host:display — for example server:1host:port — for example 192.168.1.20:5901When a server is first created, you must set a password with vncpasswd. This is the password the viewer will be asked for during the handshake:
vncpasswdThe vncpasswd command writes the password to the ~/.vnc/passwd file in encrypted form (DES). This file is used by the server to validate the client when a connection is opened. Security details — including the weaknesses of VNC passwords — will be covered in episode 12.
Because VNC sends pixels, how those pixels are encoded greatly determines speed. This mechanism is called encoding, and each client-server pair agrees on which encoding to use during the handshake. The four most important encodings:
Choosing an encoding is a trade-off between CPU, bandwidth, and quality:
vncviewer -encodings zrle server:1The -encodings zrle option on vncviewer tells the viewer to prioritize ZRLE. In episode 19 we'll explore this tuning further when we cover performance and bandwidth optimization.
Unlike VNC, RDP isn't just "sending pixels." RDP is a bidirectional protocol that separates data presentation, input, and peripheral channels into distinct layers. An RDP connection can carry not only the screen and input, but also clipboard, printer, sound, and drive mapping — all in a single session.
The default RDP port is 3389. RDP servers on Linux typically use xrdp, which we'll cover thoroughly in episode 15.
One of RDP's key security features is NLA (Network Level Authentication). With NLA, the client must authenticate — usually with user credentials — before the full desktop session is built. This prevents attacks where an attacker interacts with a fake login screen or wastes server resources.
xfreerdp /v:192.168.1.20 /u:arman /sec:nlaThe xfreerdp /v:... /sec:nla command forces NLA authentication to the RDP server. Compared to VNC, whose authentication is "password before the screen," RDP authenticates the full user with the Windows/Linux mechanism.
With an understanding of the architecture, you can compare them fairly:
| Aspect | VNC | RDP |
|---|---|---|
| Transfer | Pixel framebuffer | Layered protocol + channels |
| WAN efficiency | Depends on encoding | Aggressive built-in compression |
| Authentication | Static password | NLA credentials |
| Peripherals | Keyboard + mouse | Clipboard, printer, sound, drive |
| Extensibility | Open RFB spec | Proprietary |
The rule of thumb: on a LAN with a fast connection, VNC with Tight/Hextile encoding is nearly indistinguishable from RDP. On a WAN with limited bandwidth, RDP almost always wins because its compression was designed for it. But VNC remains the champion for cross-platform use and for cases where you only need to see the screen, not map drives or printers.
LAN -> VNC (hextile / tight)
WAN -> RDP (NLA + built-in compression)Episode 2 opened the black box of VNC and RDP: the server-to-client model in RFB with framebuffer delivery, the 5900 + display port formula, the role of vncpasswd, the Tight/Hextile/ZRLE encoding mechanisms that determine quality and latency, and the RDP architecture with NLA and peripheral channels.
Key takeaways:
host:display.In the next episode, episode 3, we start hands-on: installing a VNC server on Linux — choosing between x11vnc, TigerVNC, TightVNC, and GNOME Remote Desktop, complete with install commands for Debian/Ubuntu, RHEL/Rocky, and Arch. Make sure your server machine is ready, because starting this episode we're seriously getting our hands dirty with the terminal.