Optimize your Citrix Virtual Apps and Desktops services Traffic flow

The default traffic flow isn’t optimized when designing a new Citrix Virtual Apps and Desktops services (CVAD) environment. There are a couple of options that would result in a better traffic flow. The more you optimize the traffic flow, the better the User Experience, and I think that’s what everybody wants because happy users make happy admins. Some options are only for on-premises deployments, while others are for both on-premises and public cloud deployments. This article shows some options that don’t need any massive changes and are easy to implement.

The Default

The default traffic flow isn’t optimized, and it depends on a couple of different components that could all result in latency. When one of these components fails, it results in a disconnected session or even downtime. To better understand how the current traffic flows, look at the diagram below.

Default CVAD traffic Flow
Default CVAD traffic Flow

As you can see, all traffic goes through your Cloud Connectors, causing a high dependency on your Cloud Connectors. That’s why you would like to have them redundant and give them the appropriate resources.

Now that you understand the default traffic flow, it’s time to look at the options to optimize your traffic flow and realize a better user experience.

Rendezvous Protocol Traffic flow

The first option to optimize your traffic flow is the Rendezvous protocol. With this option enabled, your users don’t depend on the Cloud Connectors when they have a session. This option is available for public Cloud, Private Cloud, and on-premises. Whit every new Citrix Virtual Apps and Desktop Services deployment, this option is enabled by default, but current deployments could benefit from enabling this option.

What’s the benefit of this for you and your end-users:

  1. The user doesn’t notice any delay if the Cloud Connectors are overloaded or fail.
  2. As the cloud connectors no longer proxies the VDA-Gateway traffic makes them more scalable.

Have a look at the below diagram where the Rendezvous protocol is enabled

CVAD Rendezvous Traffic flow
CVAD Rendezvous Traffic flow

Requirements and validation

As mentioned before, Whit every new Citrix Virtual Apps and Desktop Services deployment, this option is enabled by default. An updated and detailed list of the requirements is available here. Below are some of the requirements you should take a look at:

  • Access to the environment using Citrix Workspace and Citrix Gateway service.
  • Control Plane: Citrix Virtual Apps and Desktops Service (Citrix Cloud).
  • VDA: Version 1912 or later.
    • 2012 is the minimum required for EDT Rendezvous.
    • 2012 is the minimum required for non-transparent proxy support (no PAC file support).
    • 2103 is the minimum required for proxy configuration with a PAC file.
  • The VDAs must have access to https://*.nssvc.net
  • The VDAs must be able to connect to the addresses mentioned above on TCP 443 and UDP 443 for TCP Rendezvous and EDT Rendezvous, respectively.
  • Cloud Connectors must obtain the VDAs’ FQDNs when brokering a session. Accomplish this in one of these two ways:
    • Enable DNS resolution for the site.
    • DNS Reverse Lookup Zone with PTR records for the VDAs.

If you meet all these requirements, you can validate if the rendezvous protocol is enabled. The first thing you should look at is to see if the policy is enabled. This option is enabled by default but could have been disabled by another admin or a previous deployment. Below you can see the policy enabled.

When the policy is configured correctly, you can validate if the rendezvous protocol is working by following these steps:

  1. Launch PowerShell or a command prompt within the HDX session.
  2. Run ctxsession.exe –v.
  3. The transport protocols in use indicate the type of connection:
    1. TCP Rendezvous: TCP > SSL > CGP > ICA
    1. EDT Rendezvous: UDP > DTLS > CGP > ICA
    1. Proxy through Cloud Connector: TCP > CGP > ICA

Direct Workload Connection Traffic flow

When you have configured the Rendezvous protocol and notice it, your users undoubtedly notice this next option. The downside of this next option is that it requires that your workload is on-premises or your branch offices have a direct connection to your data center.

The default traffic flow and rendezvous protocol traffic flow directs all traffic through the Gateway Service, even when you sit next to your VDA. We don’t want to take a detour while you can use a direct route. A direct route gives us fewer dependencies and the best user experience, and that’s when Direct Workload Connection comes in place.

Whit Direct Workload Connection, your internal users connect to the VDA directly, without the traffic going through the Gateway Service. Although there are numerous Points of Presence (PoPs) for the Gateway Services to reduce latency, this is never the most optimized connection for internal users that connect to an internal VDA routed through an external Gateway. That is causing latency, and latency causes unhappy users.

How does Direct Workload Connection work?

When a user connects to the Citrix Cloud, the traffic comes from a public IP address. This address is used to determine if the user is an Internal or External user. But before Citrix Workspace knows which Public IP Address is associated with your on-premises VDA and internal users, you need to create these locations in your workspace management plane.

But why shouldn’t you use the internal Ip address, you would think? The answer is relatively simple. When using the endpoint/internal IP address, we quickly would run into issues. How many users, public places, and customers you visit have the following internal-only IP Address scheme (10.0.0.0, 192.168.0.0, 172.16.0.0)? Suppose you connect to Citrix Workspace with an endpoint with an IP address the same as you defined as internal. In that case, Citrix Workspace thinks you are internal and tries to bypass the Gateway Service, resulting in a failed connection.

Below you can see the diagram of how Direct Workload Connection is working. As you can see, the internal user has the same Public IP (I think everyone knows this one) as the VDA, which means the internal user connects directly to the VDA. The External user has a different Public IP address (non-existing) as the VDA, so this traffic goes through the Gateway Service.

To add the public IP addresses of your on-premises environment and branch offices that have a direct connection to your data center. Sign in to Citrix Cloud and go to the “Network Locations”, there you can see all previously added locations and add a new Network location.

Validate Direct Workload

There are two options to see if Direct Workload is configured correctly and is working

Option 1: Using the Citrix Director
Go to a user’s session and then go to the Details of that session, there you see the Session Details. When the Connected via IP address equals its Endpoint IP address, Directworkload is working. See below two examples:

Option 2: ICA file logging

Navigate to the following registry key by using the registry editor:

32-bit Systems: HKEY_LOCAL_MACHINE\SOFTWARE\Citrix\ICA Client\Engine\Configuration\Advanced\Modules\Logging

64-bit Systems: HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Citrix\ICA Client\Engine\Configuration\Advanced\Modules\Logging

Set the following two string key values:

  1. LogFile=” path to the log file”
  2. LogICAFile=true

Then start a new Citrix Session and open the log file, there you see that it shows the VDA’s IP INTERNAL address. See the image below:

Conclusion

There are a few options to optimize the traffic flow as described before. The Rendezvous Protocol can you use on-premises as in the public cloud, where Direct Workload Connection is only an option when you can connect to your VDA’s directly. Both options help you get a better user experience. Your external users will benefit from the rendezvous protocol, where your internal users will benefit from the Direct Workload Connection. All that matters is that happy users make happy admins.

Citrix WEM optimizing multi-session OS machines

Update 16-12-2021:
As of Citrix WEM version 2112 that’s just been released this function is also available for on-premises deployments. Read more about this version here.

You could use Citrix Workspace Environment Management (WEM) for a lot of things within your Citrix Virtual Apps and Desktops (CVAD) environment(s). It’s also suitable to use for your workstations, but I don’t see that very often. I only use it for CVAD environments, which includes our own and our customer’s environments. WEM can be used On-Premises with the Current Release or used as a service using Citrix Cloud.

As more and more of our customers are looking to simplify management, including all back-end (Citrix Delivery Controllers, Storefront, WEM Infrastructure) servers, we started to migrate to Citrix Cloud. This gives the customers the possibility to use still On-Premises workloads (Virtual Apps and Desktop VM’s) but makes management of the previously mentioned back-end servers easier as Citrix manages this. Below you could see a diagram of all “Managed by Citrix” and “Managed by Customer” components.

Citrix managed or Customer managed

Multi-Session Optimization

Back in October 2020, Citrix released a new feature called “Multi-Session Optimization,” which I recently discovered when going through the WEM Administration console. Sadly this option is only available within WEM Services and not yet available with the On-Premises release. I think this is a matter of time because Citrix Cloud is always a step ahead of the On-Premises version. Citrix Docs WEM

How it works

Multi-Session Optimization can be used with a supported Multi-Session. When a user disconnects his session, the WEM agents lowers the CPU and the I/O priorities of processes or applications associated with the session. This means that the applications a user leaves active are then managed by WEM and will use fewer resources. When you have large environments with multiple disconnected sessions, users can use the resources typically used by the disconnected sessions, and then you could have more users share a VM. We have multiple environments where users don’t understand how to sign out from their session and click disconnect. This is because they were used to click the start button and then click sign out. Starting with the release of Windows 10 (same layout for Windows 2016/2019), they need to click start and then click on their user’s icon and then select “Sign Out.” We created additional Sign Out buttons for our customers that we pinned to the start menu but, the clients keep disconnecting.

To enable Multi-Session Optimization you open the Citrix WEM Administration Console from your Cloud management page and go to the System Optimization in the user interface. There you see the option Multi-Session Optimization. Now check “Enable Multi-Session Optimization” and click Apply (see image below). To make sure the Agents receive the new setting you could perform a Cache Refresh. After you enabled Multi-Session Optimization you need to monitor this in your environment and if needed you could exclude some Groups or Processes.

Enable Multi-Session Optimization

Multi-Session Optimization in action

For this article, I only used one session to test this newly discovered option, but it shows how it could save many resources if there are multiple users disconnected from the Multi-Session OS. In the first screenshot, you see an active user with all applications open and you can see that this user is using 1.4GB of memory. This is not that many, but it’s just an example.

Active Session

In the screenshot below, you can see that the user is disconnected, and as you would normally see, the memory usage keeps the same or is even higher in this example.

Disconnected Session

After one minute of waiting, the WEM agents kicks in and changes the priority of the resources associated with the disconnected session. You see that the CPU usage goes from 6.4% to 0.1%, and the memory usage goes from 1.5 GB to 262 MB. This could have a large impact if you have multiple disconnected sessions on one VM.

WEM Kicks in

I’m now going to test this in this environment and keep you updated if I have some additional recommendations that would help you keep your users have the best user experience. The need for resources management is getting even more important as users are using more and more resources, and looking at VMs in the Cloud where you pay for CPU and Memory usage this could save you money. Eventually, users need to sign out because that’s the most effective way of saving resources.