In Windows 10/11 and Windows Server 2022/2019/2016, when connecting to a Remote Desktop (RDS) server, UDP port 3389 is used in addition to the default RDP port TCP/3389. When your RDP client connects to the server, multiple sessions are established. The TCP (HTTP) control session is used to transmit the keyboard and mouse commands, and several UDP sessions are used to send the Remote Desktop images.
Check your MSTSC client is using UDP transport mode by clicking the Connection Info icon in the top RDP connection bar. The UDP protocol is used in our case.
The quality of the connection to the remote computer is excellent and UDP is enabled.
According to Microsoft, the use of the UDP protocol can significantly improve the responsiveness of the Remote Desktop session by reducing the number of retransmissions and the ability to work over unstable, high-latency connections.
RDP Connection Freezes When Using UDP Protocol
In some cases, using the UDP protocol for an RDP connection can cause problems: periodic image freezing, random disconnection of an RDP session, users seeing a black screen instead of the Remote Desktop, etc. Reconnecting to the RDP session usually helps in these cases. Sometimes this problem occurs frequently and affects the user’s normal functioning.
The problem with RDP sessions freezing occurs:
- If you are using RDP sessions within VPN tunnels (commonly encountered when using an OpenVPN Server). The cause of this is a fragmentation of UDP packets. This is caused by fragmentation of UDP packets as they are sent through the VPN tunnel (caused by different MTU settings);
- After updating Windows 11/10 to 22H2/22H2 build;
- When using the Remote Desktop Gateway on Windows Server 2022 and port 3391 for UDP traffic.
How to Disable the UDP Protocol over RDP
To resolve the issue of RDP sessions freezing when using VPN tunnels, you can try disabling the use of the UDP transport protocol.
You can disable UDP over RDP via Group Policy.
- Open the local GPO editor console (
gpedit.msc
); - Expand Computer Configuration -> Administrative Templates -> Windows Components -> Remote Desktop Services -> Remote Desktop Session Host -> Connections;
- Enable the policy Select RDP transport protocols and set Select Transport Type = Use only TCP;
- Restart the RDS/RDP server for the settings to take effect;
- Reconnect to the RDP server and click the Connection Information icon. The following message should appear here:
The quality of the connection to the remote computer is good.
This means that only TCP is used for the RDP connection.
This method allows you to disable the use of the UDP transport protocol on the RDP/RDS server side. Suppose you want to disable UDP for Remote Desktop on the client side. In that case, you need to enable the Turn off UDP on Client option under Computer Configuration -> Administrative Templates -> Windows Components -> Remote Desktop Services -> Remote Desktop Connection Client.
After making changes, update the local policy settings using the gpupdate /force
command and restart the mstsc.exe client.
You can also enable this option in the registry (the GPO policy mentioned above corresponds to the fClientDisableUDP registry parameter):
reg add "HKLM\software\policies\microsoft\windows nt\Terminal Services\Client" /v fClientDisableUDP /d 1 /t REG_DWORD
gpmc.msc
).
1 comment
If the problem of a black screen in an RDP session occurs, open the Event Viewer and check Application and Service Logs –> Microsoft –> Windows –> RemoteDesktopService-RdpCoreTS. See if there are any errors like ‘Failed GetConnectionProperty’ in CUMRDPConnection::QueryProperty at 2884 err=[0x80004001]‘, ‘Connection doesn’t support logon error redirector’ in CUMRDPConnection::GetLogonErrorRedirector at 4199 err=[0x80004001].
If you see them, disable the URCP (Universal Rate Control Protocol) used to transfer some data between your RDP client and a server over UDP (MS-RDPEUDP2):
reg add “HKLM\SOFTWARE\Microsoft\Terminal Server Client” /v “UseURCP” /t REG_DWORD /d 0 /f