Cloud VPS from $1.98/mo · pay with Bitcoin, Ethereum, Monero, USDT or Solana · paid in crypto
Remote access

How the Remote Desktop Protocol works, step by step

How the Remote Desktop Protocol works: the ten phases of an RDP connection, TLS and NLA, graphics codecs, virtual channels, UDP and disconnects.

CloudSat teamNovember 18, 20267 min read
Abstract illustration of two glowing panels joined by a braided bundle of colored light strands, one strand thicker and brighter than the rest
On this pageThe connection at a glance

Double-click a saved connection and a remote desktop appears a moment later. In between, client and server pick encryption, check your password, agree on features, open side channels and build a Windows session. That order explains why the certificate warning comes first, why a broken clipboard has nothing to do with graphics, and why a dropped Wi-Fi link does not close your programs.

The connection at a glance

Microsoft publishes RDP as open specifications. The core document, MS-RDPBCGR, splits the start of every connection into ten phases:

Phase What happens Where you notice it
1. Connection initiation Both sides pick a security protocol Certificate prompts, connection errors
2. Basic settings exchange Screen size, color depth, keyboard, client version, channel list Resolution, keyboard layout
3. Channel connection The client joins each static virtual channel Which redirections exist
4. RDP security commencement Keys for legacy RDP encryption only Nowhere, on a modern server
5. Secure settings exchange User name, domain, auto-reconnect cookie Whose session it is
6. Connect-time auto-detection Optional link measurement Picture quality on slow links
7. Licensing RDS license check Errors on multi-user servers
8. Multitransport bootstrapping Optional UDP connection Smoother video on lossy links
9. Capabilities exchange Each side lists what it supports The graphics mode you get
10. Connection finalization Final synchronize, control and font messages The first frame

Picking the security layer

The client opens TCP port 3389 and sends a connection request listing the security protocols it supports. Modern systems settle on TLS, or with Network Level Authentication (NLA) on, TLS plus CredSSP. The original RDP encryption, with RC4 keys exchanged in phase 4, survives only for old clients.

With CredSSP, the TLS handshake comes first and the server presents its certificate: the one the warning dialog asks about, self-signed unless someone installed another. Inside that channel, Kerberos or NTLM checks your user name and password. Only then does the client pass your credentials to the server, so Windows signs you in without a second login screen.

That order is what NLA means: anyone who fails to authenticate gets no session, no logon screen and no server memory. It is also why failed RDP sign-ins appear as network logons in the Security log, which securing RDP against brute-force attacks puts to use. Remote Credential Guard and Restricted Admin mode change the last step so reusable credentials never reach the server.

Settings, channels and licensing

Phases 2 and 3 borrow an old conferencing framework, T.124 GCC over T.125 MCS, to carry the client's settings and the static virtual channels it wants, each joined separately. Because every feature has its own channel, the server can refuse one, as Group Policy does for clipboard or drive redirection, without touching the rest.

Phase 5 sends the user name and an auto-reconnect cookie. Phase 6 measures the link so the server can choose how hard to compress. In phase 7, a server with the Remote Desktop Session Host role checks or issues an RDS client access license; a server without that role sends a single message saying the client is fine.

The UDP side road

Next, the server can invite the client to open a second connection over UDP, by default on port 3389 too. RDP's UDP transport has its own reliability and congestion control and is secured with TLS or DTLS. When it works, dynamic channels, graphics included, move to it and cope better with packet loss; when UDP is blocked, everything stays on TCP.

Capabilities and the first frame

In phase 9 the server's Demand Active message lists what it supports, from drawing orders and codecs to pointers and input types, and the client answers with Confirm Active. Phase 10 trades synchronize, control and font messages. The client may send input as soon as it confirms capabilities, and the server starts sending graphics once it receives the font list: your first frame.

How the picture travels

Early RDP sent drawing orders: render this text with cached glyphs, copy that rectangle, fill this region. That suited plain windows and struggled with anything that moved. Current Windows versions send most of the screen through the graphics pipeline extension, MS-RDPEGFX, which updates surfaces with a choice of codecs:

Codec Typical content
RemoteFX Progressive Images that arrive coarse and sharpen in passes
ClearCodec and Planar Text, interface elements, lossless regions
AVC420 (H.264, 4:2:0) Video and fast-changing areas
AVC444 (H.264, 4:4:4) The whole screen with full color detail, so colored text stays sharp

The mix depends on what both sides support and on server policy. On Windows Server 2016 and later, Prioritize H.264/AVC 444 graphics mode for Remote Desktop Connections requests the full-color mode and Configure H.264/AVC hardware encoding for Remote Desktop Connections lets a GPU encode, both under Remote Desktop Session Host > Remote Session Environment in Group Policy.

Input, and the keys that stay home

Keyboard and mouse travel the other way as small fast-path messages, with touch and pen in their own extension. Ctrl+Alt+Del never leaves your computer, because your own Windows handles it first, so sessions use Ctrl+Alt+End instead (Ctrl+Alt+Del and Task Manager over RDP). Windows key shortcuts go to the session only in full screen, unless you change the client's keyboard setting.

Virtual channels carry everything else

Everything except picture and input travels in a virtual channel. Static channels are agreed during setup; dynamic channels open and close inside one static channel, drdynvc, when a feature needs them.

Channel Type Carries
cliprdr Static Clipboard text, images and files
rdpdr Static Redirected drives, printers, smart cards and serial ports
rdpsnd Static or dynamic Sound played in the session
drdynvc Static The container for every dynamic channel
AUDIO_INPUT Dynamic Microphone
URBDRC Dynamic Low-level USB device redirection
Microsoft::Windows::RDS::Graphics Dynamic The graphics pipeline described above
Microsoft::Windows::RDS::DisplayControl Dynamic Resizing the session to match the window

Each channel has a client end and a server end. The clipboard's server end is rdpclip.exe inside your session, so a broken clipboard is a channel problem, not a picture problem (fixing copy and paste in Remote Desktop). Channels also move data between machines, which is why locked-down servers turn off the ones they do not need.

Disconnect is not sign out

Closing the client window disconnects: the session keeps running with its programs open, and quser lists it as Disc. Connecting again with the same account returns you to it, and after a short network drop the client reconnects by itself with the cookie from phase 5. Signing out ends the session and frees its memory. Disconnected sessions stay until someone signs them out or a limit under Remote Desktop Session Host > Session Time Limits closes them.

How many sessions a machine accepts

Windows edition Remote sessions at once
Windows 10 and 11 Home None; they can only connect out
Windows 10 and 11 Pro, Enterprise and Education One, which takes over the local desktop
Windows Server Two administrative sessions, without RDS licenses
Windows Server with the RD Session Host role As many as hardware and RDS licenses allow

A CloudSat RDP server is a Windows Server virtual machine, so it starts with those two administrative sessions and full Administrator access.

Who else speaks RDP

The specifications are public, so RDP is not limited to Microsoft software. FreeRDP, an open-source implementation under the Apache 2.0 license, sits under many clients, Remmina among them. xrdp is an RDP server for Linux desktops, and GNOME Remote Desktop serves GNOME sessions with FreeRDP's libraries. Microsoft's newer Azure Virtual Desktop documentation has started calling the protocol Direct Stream (DS), while the specifications and the .rdp file format keep the RDP name.

FAQ

Is RDP traffic encrypted?

Yes. Modern connections run inside TLS from the first phase, and the UDP transport uses TLS or DTLS. The weak point is trust: users who click through certificate warnings cannot tell the real server from an impostor.

Does RDP need UDP?

No. Sessions work over TCP alone. UDP is an optional second transport that smooths video and typing on lossy or distant links.

Can a Linux machine act as an RDP server?

Yes, with xrdp or GNOME Remote Desktop. Installing a desktop on a Linux server covers the setup.

Run it on CloudSat. Cloud VPS on AMD EPYC and NVMe from $1.98/mo in 13 regions, delivered in under 5 minutes and paid in crypto. See plans or deploy a server.