Sei sulla pagina 1di 39

© 2009 Immidio. All rights reserved.

This presentation is for informational purposes only. Immidio makes no warranties, express or implied, in this summary.
Legacy versus Innovation

What people think the TS What the TS product team


product team did over the really did, except being
last couple of years renamed to “Presentation
and Hosted Desktop
Virtualization“ group
Win 2008 TS

Win 2003 TS
A B C D
Win 2000 TS
LSM TS
Windows
NT TS OS Platform
Remote Desktop Architecture

System-wide User Session

System Services Winlogon,


User
and User Shell
Mode
Session Management and Applications

Network User-specific
Kernel
Protocol Kernel Components
Mode
Stack and Drivers
WS2003 Architecture

System-wide Admin User Sessions 1 - n

Terminal Services Console Remote Session


Sessions Mgmt. Shell & User Shell
Remote Connection Mgmt. Apps and Applications

Authen- Event
tication Handler User-specific
Kernel Components
Drivers
Kernel and Network Kernel
Components and Drivers Drivers
WS2008 Architecture

System-wide Local User Sessions 2 - n

RDS LSM Remote Session


Remote
Console
Session Shell & User Shell
Connection
Mgmt. Apps and Applications
Mgmt.

Authen- Event
tication Handler User-specific
Kernel Components
Drivers
Kernel and Network Kernel
Components and Drivers Drivers
Windows Server 2003 Session 0 Isolation

Service A App A App D

Service B App B App E

Service C App C App F

Session 0 Session 1
Windows Server 2008

Service A Interactive App A App D


Services
Detection
Service B App B App E

Service C App C App F


UI0Detect
Session 0 Session 1 Session 2
Remote Desktop Architecture

Terminal Server Service Winlogon


LogonUI Per-
Explorer/RDPShell Session
LSM Apps
RDP Protocol Ext. UserInit
Rdpwsx.dll TsTheme
User Mode Smss Csrss.exe TsAppCompat

Kernel Mode TS Device Driver


Termdd.sys Kbdclass.sys
Win32k.sys
Rdpwd.sys Mouclass.sys
CredSSP TsSecSrv Display Driver
Tdtcp.sys Rdpdd.sys
TDI Interface
TCP/IP
NDIS Interface System Session
Network Card Drv. Space Space
User Connection Sequence

• Why do you want to know about details?


– User session initialization sequence details may help
you when troubleshooting terminal servers
• Initialization sequence in a nutshell
1. Connection initiation and user authentication
2. Load balancing
3. Settings exchange and device mapping (VCs)
4. Licensing
5. User session initialization
6. Applying user profiles and group policies
Dynamic Virtual Channels
TS Client Terminal Server

TS Service uWDF Host Per


RDP Client Session
Rdpwsx Smss/Lsm TS User
Mode Driver Apps

Device
Driver Network Terminal Server uWDF Reflector
USB Bus Layer Device Driver
Driver
USB Bus Driver
WinStation Driver
USB Host Transport
Controller Layer Transport Layer (TCP/IP)

Dynamic Virtual Channel


Profiles – Timing is Important

• Step 6 drill-down – profiles and GPO


1. Load profile
2. Apply Group Policy Objects (GPO)
3. Run GPO logon script (Group Policy configuration)
4. Map TS home drive (AD User configuration)
5. Run AD logon script (AD User configuration)
6. Application initialization, launch script (UsrLogon)
7. Application / Desktop is started
• TS home drive not available in GPO logon script
– Consider using AD logon script
Remote Desktop Window Station

Four desktops form an interactive Window


Station, internally referred to as “WinSta0”

Winlogon Application Screen saver Disconnected


desktop desktop desktop desktop
TS Seamless Windows

Terminal
Server

Rdpshell.exe
Like Citrix Wfshell.exe
Rdpinit.exe
RDP shell login application
RemoteApp
Program

Workstation Local
Includes local devices, file type mappings,
Applications
notification area, and clipboard
RemoteApp Session Processes

• Processes running in user context


– Rdpshell.exe: RemoteApp shell
– Rdpinit.exe: RDP shell logon process
• RemoteApp challenge
– Sessions that may not be terminated properly after
the user closes last RemoteApp program
– System processes not preventing user logoff are
configured in the registry under HKLM \System
\CurrentControlSet \Control \Terminal Server
\SysProcs
Microsoft Shim – TsAppCmp.dll

Session 1 Session 2

TsAppCmp.dll TsAppCmp.dll

Terminal
Registry Files and Folders
Server
Remote Desktop Connection

TS Client Terminal Server

TS Client Wtsapi32.dll TS API Application


Application
TS Service Winlogon Per-
Session
Rdpwsx Sessions Csrss Apps
Mstscax.dll

TS Device Driver Win32k.sys


Termdd.sys Kernel

Network Rdpwd.sys Rdpdd.sys


Protocol Display
Stack Tdtcp.sys Driver

RDP
RDP Tuning – Client Side

• In RDP 6.x, disable “Enable Font Smoothing”


(=Cleartype) in the Experience tab of Remote
Desktop Connection
– 2 to 10 times faster, but result looks ugly
• Configuration of persistent cache in the registry:
– HKEY_CURRENT_USER\SOFTWARE\Microsoft\
Terminal Server Client\BitmapPersistCacheSize
• Configuration of memory cache size in the RDP
file:
– “bitmapcachesize:i:1500“ sets the memory cache size
to 1500 Kbytes
RDP Tuning – Server side

• Bulk Compression (configure via Group Policy)


– RDP5.x – Windows Server 2003 (128 KB)
– RDP6.0 – Windows Server 2008 = default
(328 KB, 5-30% improvement)
– RDP6.1 – Windows Server 2008
(2.6 MB, 10-60% improvement)
• Bandwidth allocation (Registry – TermDD)
– FlowControlDisable – Default value = 0
– FlowControlDisplayBandwidth – Default value = 70
– FlowControlChannelBandwidth – Default value = 30

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TermDD
Compression Algorithms

• Planar compression (applied to bitmaps)


– Four planars: RGB + Alpha
• Bulk compression: RDP5.x - RDP6.0 - RDP6.1
– Applied after all other compression
– Drawing commands and resources: i.e. bitmaps, VC
traffic

Tests RDP5.x RDP6.0 RDP6.1


Memory 128K 328K 2.6MB
CPU 0.5% 1.5% 1.0%
Bandwidth Reduction 0 (baseline) 15% 35%
Set RDP Compression Algorithm
System Components
Session 0
CSRSS 0 Services
SMSS 0 Win32k
LSASS
WinInit LSM

Kernel Memory
boots Manager

TsAppCompat
Win-
SMSS 1 CSRSS 1 UserInit Citrix Shell
Logon
Win32k GP - user part

Citrix
RPC
Ticketing Session 1
Citrix System Architecture
System-wide User Sessions 1 - n

TS Service Winlogon Per-


User
Session
Mode Wsxica Rdpwsx Smss Csrss Apps

Mouse,
Device Driver Keyboard Win32k.sys - Kernel
Kernel
Mode Wdica.sys Citrix Vdtw30.dll
Tdtcp.sys Display Driver
Video
XenApp Architecture

Terminal Server Service Winlogon


Ctxstartup.exe Per-
Wfshell.exe Session
LSM Apps
ICA Protocol Ext. UserInit
Wsxica.dll TsTheme
User Mode Smss Csrss.exe TsAppCompat

Kernel Mode TS Device Driver


Termdd.sys Kbdclass.sys Cdm.sys
Win32k.sys Redirector
Wdica.sys Mouclass.sys
PDs Video Driver
Tdtcp.sys Vdtw30.sys
TDI Interface Display Driver
Icacdd.sys
TCP/IP
NDIS Interface System Session
Network Card Drv. Space Space
Citrix Services & Drivers (1)

• EncSvc.exe (Citrix Encryption Service)


• SemsService.exe Citrix EUEM (End User Experienceing Monitoring)
• Citrix ICA - LEGACY
• Citrix Licensing (Performance – mflicperf.dll)
• CtxSFOSvc.exe (Citrix Virtual Memory Optimization)
• HCAService.exe (CitrixHealthMon – Health Monitoring and
Recovery)
• CitrixICA (Performance – icaperf.dll)
• CtxWMISvc.exe (Citrix WMI Service)
• XTE.exe (Citrix XTE Server – Session Reliability)
Citrix Services & Drivers (2)

• CdfSvc.exe (Diagnostic Facility COM Server)


• Cdm.sys (Client Drive Mapping Redirector File System Driver)
• Cpsvc.exe (Citrix Print Manager Service)
• Ctxaltstr.sys (SFO Alternate Stream Driver)
• Ctxcpusched.exe (CPU utilization mgmt/resource mgmt)
• Ctxhttp (Ctxxmlss.exe, XML Service)
• Ctxpidmn.sys (Sandbox Main Driver)
• Ctxrmpn.sys (RM Process Notification Driver)
• CtxSbx.sys (Sandbox Filter Driver)
• Ctxsmcdrv.sys (SMC Support Driver – Session Monitoring and
Control)
Citrix Services & Drivers (3)

• Icacdd.sys (ICA TW Miniport)


• Icareduc.sys (ICA Reduction Driver)
• ImaAdvanceServer.exe (Citrix Server Manager, interface to OS)
• ImaService (Imasrv.exe, management service)
• Mfcom.exe (COM access to Citrix farm)
• Pdcomp.sys (Compression Protocol Driver)
• Pdcrypt1.sys (Encryption Protocol Driver)
• Pdcrypt2.sys (Encryption 128 bit Protocol Driver)
• Pdrframe.sys (Frame Protocol Drv for Reliable Transport)
• RadeSvc..exe (Citrix Streaming Server)
• Twexport.sys (Thinwire Support Driver)
• Wdica.sys (ICA WinStation Driver)
Drivers loaded by System Process

• Cdfdrv.sys: Trace Kernel Mode Driver


• Cdm.sys: Client Drive Mapping Redirector File System Driver
• CtxAltStr.sys: SFO Alternate Stream Driver
• Ctxpidmn.sys: Process Notification Driver
• Ctxrmon.sys: RM Process Notification Driver
• Ctxsbx.sys: Application Isolation Environment Driver
• Ctxsmcdrv.sys: SMC Support Driver
• Icacdd.sys: ICA TW Miniport
• Icareduc.sys: ICA Reduction Driver
• Wdica.sys: ICA Winstation Driver
Processes in all Sessions

Session 0 Session 1
• ImaAdvanceServer.exe • Radeobj.exe (App Streaming)
• Mfcom.exe • Pnamain.exe (PNA)
• Radesvc.exe • Ssonsrv.exe (Pass-through
• Cdfsvc.exe (Diagnostic Facility Authentication)
COM Server) • Wfshell.exe
• Cdmsvc.exe (Client Mapping) • Java
• Encsvc.exe (Encryption)
• Hcaservice.exe (HCA) Session n
• Cpsvc.exe (Client Printer) • Wfshell.exe
• Ctxxmlss.exe (XML)
• Imasrv.exe (IMA)
• XTE.exe
XenApp “Middleware”
ICA ICA Protocol
Local Host on TCP port 1494
Cache Port Citrix
1494 Connection
MS Jet
ICA Client

IMA Protocol
IMA on TCP port 2513
Service
Terminal
Server XenApp
Service ICA Browser on
RPC
Consoles
UDP port 1604
IMA
Protocol
on TCP Citrix XML via TCP/IP on
XML To anyone requesting
Port 2512 TCP port 80
Service published application
information

Citrix
XTE ICA Protocol port 1494
Service
ODBC Citrix Gateway Protocol port 2598
ICA Client 8+
Other with Session
Data IMA
XenApp Reliability
Store Data Store
Server
ICA Virtual Channels

ThinWire (video, keyboard, mouse, etc


Seamless Windows
Printing Data
Clipboard Mapping
Drive Mapping
ICA XenApp
Client Audio Server

ICA Protocol Stream

Notes:
• ICA specific – RDP VCs are different
• Limit of 32 virtual channels per session
ICA Stack

Client Server

COM Port

COM Port
Graphics

Graphics
Custom

Custom
Printer

Printer
Virtual

Disk

Disk
Channels

WD: ICA Protocol & WD: ICA Protocol &


Channel MUX Channel MUX

Protocol Drivers Protocol Drivers

Transport Drivers Transport Drivers


The ICA Stack

Virtual Drivers

Winstation
Driver

Protocol Driver

Pluggable Drv.

Transport Driver
MetaFrame XP

Virtual Drivers

Winstation
Driver

Reducer
Protocol Driver

PD
Transport Driver
Feature Release 1

Virtual Drivers
Virtual
Driver
Priorities

Session
Winstation Monitoring and
Driver Control API

Reducer MKII
Protocol Driver

PD
QoS priority bits
Transport Driver
Feature Release 2

Virtual Drivers

Virtual S S S S
Driver I I I I
L L L L
Priority O O O O
Silos
Winstation
Driver

„High Throughput‟ Reducer MKII


Driver
Protocol Driver(s)

Transport Driver
Presentation Server 3.0

Virtual Drivers

S S S S
Per Channel I I I I
Compression L L L L
O O O O

Winstation
Driver
Reducer MKIII
Protocol Driver(s)

Transport Driver
XenApp 4.5 / 5.0

Virtual Drivers

Video/MM Drivers Buffer

S S S S
Per Channel I I I I Client Performance
Compression L L L L
Information
O O O O

Winstation
Driver
Reducer MKIII
Protocol Driver(s)

Transport Driver
© 2009 Immidio. All rights reserved.
This presentation is for informational purposes only. Immidio makes no warranties, express or implied, in this summary.

Potrebbero piacerti anche