Configuring TCP KeepAlive Values to Improve WAN and ICA to Place ICA Session in a Disconnected State

Configuring TCP KeepAlive Values to Improve WAN and ICA to Place ICA Session in a Disconnected State

book

Article ID: CTX692976

calendar_today

Updated On:

Description

After an ICA_TCP session is abnormally terminated, subsequent viewing of the ICA-TCP session in either Citrix Server Administration, mfadmin.exe, Terminal server Administration, or the Management Console, shows the connection in an ACTIVE state not a DISCONNECTED state. 
This article contains information on improving WAN Links and about ICA KeepAlives to Place ICA Session in a Disconnected State.

Configuring TCP KeepAlive Values to Improve WAN Links and ICA KeepAlives to Place ICA Session in a Disconnected State

TCP/IP uses the initial packet retransmission timeout value at the moment when the session is initiated to determine what is "normal" for that connection. Because of this, it is better to have a consistently slow WAN connection and worse to have a connection that starts out fast and then becomes slow. Such an erosion of connection speed is common when connecting through an Internet Service Provider (ISP), particularly when the connection is opened in the morning and maintained into the work day.

Using an algorithm (RFC1122), TCP tunes itself to the "normal" delay of a connection. Because the default number of retries is five, the retransmission timeout can double four times (or in other words become 16 times slower than its initial value) before the session is dropped. By increasing this number to 10, you are allowing the retransmission timeout to double nine times instead of four, thereby allowing the connection quality to erode up to 512 times its original value before being dropped. For example, a connection with retransmission timeout value of 100 milliseconds would have to erode to a round-trip time of 512,000 milliseconds before being dropped by the server.

In environments where the TCP/IP network has high latency, modifying the operation of the Windows TCP/IP stack can improve TCP-based ICA sessions. However, if the connection is not reliable and disconnects often, increasing the TCP/IP retransmission may result in negative effect as the connection will take longer to disconnect therefore slower to change its state from ACTIVE to DISCONNECT.

The TCP/IP retransmission is controlled by the Server TcpMaxDataRetransmissions registry value. See Citrix eDocs Coordinating Keep-Alive Values Between the Secure Gateway and XenApp.

In some networks, ICA Clients might time out when connected to a session and then receive a new session upon reconnect, instead of being reconnected to the dropped session. This new session is received on reconnect because the former host server is not aware that the previous session was dropped due to high network latency.

“ICA KeepAlive” can recognize broken ICA sessions (This value does not help keeping the session active) and take appropriate action. When the ICA KeepAlive expires, the server disconnects or resets the broken session based on the setting “On broken or timed-out connection...,” which is configurable for the user or ICA connection. Two registry values control the ICA KeepAlive feature. Both values can be manually added to the registry key:
Caution! Refer to the Disclaimer at the end of this article before using Registry Editor.
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Citrix 

IcaEnableKeepAlive REG_DWORD: 0 or 1

When this value is 0, ICA KeepAlives are disabled. When this value is set to 1, ICA KeepAlives are enabled. The IcaEnableKeepAlive is set to 1 by the Service Pack installation.

ICAKeepAliveInterval REG_DWORD: <number in seconds>

REGEDIT location for Policies key:
HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Citrix\ICAPolicies
"SendICAKeepAlives"=dword:00000001
"ICAKeepAliveTimeout"=dword:0000000f


This parameter determines the interval separating keep alive retransmissions until a response is received. Once a response is received, the delay until the next keep alive transmission is again controlled by the value of KeepAliveTime. The connection is ended after the number of retransmissions specified by TcpMaxDataRetransmissions has gone unanswered. If the IcaEnableKeepAlive value is 1, this value controls the frequency at which ICA KeepAlives are sent to the client. This IcaKeepAlive Interval is set to 60 seconds by this hotfix installation. Sixty seconds is also the default interval if this value is not defined but IcaEnableKeepAlive is set to 1.
Default: 60 seconds

The time that elapses between an ICA broken client connection and the MetaFrame server disconnect (or reset) event may be longer than the IcaKeepAliveInterval. For instance, suppose the IcaKeepAliveInterval is set to 15 seconds. A client’s ICA WAN connection is dropped at 12:00:00. The server may not put the session into a disconnected (or reset) state until sometime after 12:00:15, although the session will usually disconnect (or reset) within approximately IcaKeepAliveInterval +2 minutes. This is because the TCP/IP stack retransmits the ICA keep alive packet a number of times at increasing intervals before timing out. When the TCP/IP stack finishes its retransmissions, the session is disconnected (or reset).

Additional Resources

Citrix eDocs – Setting Connection Keep-Alive Values and the Secure Gateway

Environment

Caution! Using Registry Editor incorrectly can cause serious problems that might require you to reinstall your operating system. Citrix cannot guarantee that problems resulting from the incorrect use of Registry Editor can be solved. Use Registry Editor at your own risk. Be sure to back up the registry before you edit it.

Issue/Introduction

This article contains information on improving WAN Links and about ICA KeepAlives to Place ICA Session in a Disconnected State.