Skip to content

Remote Desktop Session to AWS Intermittently Freezes with UDP

Release Date: 09/15/2022

Our Netcellent servers are hosted with Amazon Web Services (AWS), and this is a great decision because we are able to get rid of our server room which costs in electricity alone about $1,000 a month. In addition, we have a much more reliable environment to host our servers that can be easily backed up. The server resources can be expanded easily based on our needs. It was a great decision to move our servers to the cloud.

All of our servers are running as a terminal server and we access them through RDP (Remote Desktop Protocol). This has been working out well until about one year ago, when we noticed that from time to time the RDP session would freeze. The screen stops updating. However, what I type and my mouse clicks are still being sent. No error message is shown whatsoever -- the screen simply freezes. To make it work again, I have to disconnect and re-connect the session. Everything that I typed and/or clicked while it was frozen is there.

This problem affects some of our staff members, but not everyone experiences this issue. At first, we tolerated this problem until it became increasingly bad. So we researched and found the following article:

The nature of the issue is that with certain Windows 10 or 11 updates, the Remote Desktop Client seems to have problems handling the screen refresh function correctly in heavy network traffic conditions. RDP protocol is different from TCP in that TCP will guarantee the delivery of the network packet while RDP does not. On the other hand, RDP protocol is faster because there's no need to wait for acknowledgement from the other end. Therefore, RDP is the typical protocol to use for video streaming.

The work-around method is to disable RDP protocol for the Remote Desktop on the client side.  The following is an excerpt from the above article. But I modified it somewhat because the registry path in the article does not exactly match my local machine. So I changed it.  After applying the following solution, I verified that from the RDP session the AWS server does not freeze anymore.

I also ran into this issue since July 2019 on a Windows 1903 acting as the client machine. The following workaround on the client works for me, so the RDP no longer freezes.

Bring up regedit and navigate to the following location: 
    \\HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services\Client
Add a REG_DWORD entry: fClientDisableUDP and set the value to “1”.  See below sample screen:
This is to disable UDP protocol with RDP connection. UDP protocol is faster than TCP. But UDP may drop packets under heavy traffic. It is a work-around method to Windows RDP client issue.

After making this change in registry, close and reopen all your RDP sessions on your client computer to restart the Remote Desktop Client (mstsc.exe, aka Microsoft Terminal Services Client) application.

I'm waiting for a final fix to this issue.

In the article, there are further discussions on this subject:

Speculated Causation

  • Seems to occur primarily when using the UDP protocol under load.
  • My guess is that the RDP protocol has lost some of its resilience to packets getting lost or out-of-order.

RDP seems to behave a lot better with TCP than UDP. Switching to TCP-only does seem a bit more laggy, but the lag is more ordered (which is strangely nicer than the erratic lag) and I've yet to encounter an indefinite hang.



EMK

Feedback and Knowledge Base