Pages

8/14/2003

Citrix::ICA Keepalive


CTX708444

Symptom

After a ICA_TCP session is abnormally terminated, subsequent viewing of the ICA-TCP session in either Citrix Server Administration, mfadmin.exe, Terminal server Administration, tsadmin.exe, or CMC, Citrix Management Console shows the connection in an ACTIVE not a DISCONNECTED state.

TCP/IP uses the initial packet round-trip time 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, TCP tunes itself to the "normal" delay of a connection. Because the default number of retries is five, the round-trip time can double four times (or in other words become 16X slower than its initial value) before the session is dropped. By increasing this number to 10, you are allowing the round-trip time to double nine times instead of four, thereby allowing the connection quality to erode up to 512X its original value before being dropped. For example, a connection that begins with a roundtrip time of 20 milliseconds would have to erode to a round-trip time of 10,240 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.

The TCP/IP retransmission is controlled by the Windows Terminal Server TcpMaxDataRetransmissions registry value. See Microsoft Knowledgebase Articles Q120642 , Q158474 and Q170359 for more information.

MetaFrame 1.8 (SP1 or higher) for Windows Terminal Server, MetaFrame 1.8 (SP2 or higher) for Windows 2000, and MetaFrame XP Application Server for Windows

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.

The Service Packs add a new “ICA KeepAlive” feature so the MetaFrame server can recognize broken ICA sessions 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:

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:
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 have 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 Windows NT 4.0, Terminal Server Edition 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).

No comments: