RSS 

Fundamentals of the Presentation Server Architecture

To get a sound understanding of how Presentation Server is implemented and managed, you need to know the fundamentals of how they operate - what are the components of the server itself, how does it handle sessions, what the various services do, and more. This video offers an overview of the various components in the architecture and how they interact. (Running time: 27:48 minutes)

Tags: technical video
Views: 4,029
Rating: 5

Transcript : Hello. This is Brian Madden. This Citrix technology video is about Citrix Presentation Server architecture. And what that means is that we are going to focus on the actual architecture of the Citrix Presentation Server itself. So we’ve done other videos where we’ve focused on how Citrix Presentation Server works on the network, and how it communicates with other servers in the backend, data collectors, and data stores, and licensing, and things like that. Well, within this video, we’re going to focus specifically on the Citrix Presentation Server. So we’re going to look at how Citrix Presentation Server interacts with Microsoft Terminal Services. We’re going to look at all the services that run. We’re going to look at how it interacts with the registry, how it listens for connections. And we’re going to focus on the actual server itself. I think this architecture of a Presentation Server itself is something that’s often overlooked by a lot of administrators. But I think it can really help with your administration and troubleshooting skills, if you understand how the server itself is really working. So, to that end, there’s actually quite a few components that make up a Citrix Presentation Server. We have several Windows services. We have several registry keys. We have different ports in operation. We have all sorts of things. And we’re going to take a look at all this kind of stuff in this video today. So I think the first thing that we should take a look at is how Presentation Server interacts with the actual Microsoft Terminal Server itself. So to do that, I want to look at this drawing here. And let’s forget about Presentation Server for the minute, and just look at the Microsoft Terminal Server. So right here, we kind of have drawn here this Terminal Server multi-user operating system core. And this is going to be what’s essentially our Terminal Server service and the actual Windows operating system itself. You know, starting with Windows NT, back when Terminal Server came out, and then moving forward into 2000 and 2003, the Terminal Server capabilities have been integrated tighter and tighter and tighter into the Windows operating system. And, in fact, in Windows 2003, you only have one kernel. It is a multi-user kernel. Every edition, every version of Windows 2003, is multi-user capable. So, at the deepest level, we have this multi-user OS core. Now, what sits on top of that and does most of the work from the standpoint of server-based computing, is this component here, called the Session Manager. And as this name implies, the Session Manager is responsible for managing the individual sessions. So, it keeps the sessions separate from each other and isolates their name spaces and memory and their security, and that kind of stuff. But what’s interesting, is the Session Manager is just managing sessions. The Session Manager doesn’t really care about RDP protocol, it doesn’t care about ICA protocol, it doesn’t care about Citrix. The Session Manager is just managing user sessions on that box. So you can think of it as a Session Manager is actually kind of filling up with a whole bunch of different sessions, and managing sessions, and keeping these sessions separate. So of course, the Session Manager is responsible for connecting session 0, session 1, 2, 3, and kind of, you know, giving the session IDs and everything to all of the specific sessions. By the way, a fun bit of trivia here. That session ID 0 is typically the console session. But technically it’s not always the console session. So if you’re running a script or something like that, you cannot assume that session 0 is the console session. It usually will be, but that’s not always the case. So, anyway, moving one step over from the Session Manager, and looking at this other area of this diagram, we see we’ve got the Microsoft RDP Protocol and the Citrix ICA Protocol. So what’s important to note here, is that when we have a pure terminal server, and our users are connecting via RDP, and of course they’re going to connect via port 3389, there’s an RDP Connection Listener which is listening for those connections. And we’ll take a look at that more in depth in a little bit. This Connection Listener is listening for connections coming in on port 3389. And when it sees a connection, it handles it via the RDP Protocol Handler and the RDP Protocol Driver and Protocol Interface, and kind of attaches that incoming RDP session to one of these sessions via the Session Manager. Now the thing is that’s interesting, is when you install Presentation Server on an existing Terminal Server, installing Presentation Server from Citrix does not break Terminal Services. It does not change the behavior of Terminal Services. It does not do anything differently. All it does is provide another conduit, another channel, if you will, for users to be able to connect. So that when users connect on an ICA client, Citrix has some components that are listening in port 1494 for incoming ICA connections. Well, if a port 1494 connection comes in, then your Citrix ICA Protocol Driver picks up that connection, and it translates it and does what it needs to do, and presents that also to the Session Manager. So, at the end of the day, the Session Manager right here is just managing sessions. The Session Manager does not really care whether the users are coming in via RDP or whether they’re coming in via ICA, or coming in via something else. I mean, as a matter of fact Sun has their own thin client protocol called the ALP Protocol. Maybe some day Sun would write a protocol driver interface, and that would give you an ALP interface into the Session Manager. The point with this is the Session Manager does not care about the actual protocol the user is using to connect. The Session Manager is only focused in here on the actual Windows sessions. Think of it as like farther down on the stack. Then how the users actually get there, as far as what protocol they’re using, and what ports and this kind of stuff, that all has to do with other stuff higher up in the stack with RDP, ICA, or something in the future. Now to look at this closer, I’m actually going to jump onto Presentation Server. And I want to fire up the connection configuration. So I’ll go here into Programs and to start Citrix and Connection Configuration Tool. These are the connection listeners that my server is listening for. So I’m listening for ICA connections over the TCP protocol. And I’m listening for RDP connections over the TCP protocol. And then I can go into the properties of these and set all sorts of things as far as how I want it to operate and what settings I want to enable and disable, and things like that over this connection. But what is happening here, is that these connections that are configured right here, are specifying all users, all properties, everything that’s coming in over that connection. I can also actually look at the Microsoft Terminal Server connection configuration tool. And if I look at connections here, you see I’ve got the same kind of thing. So I’ve got ICA and RDP. So, of course, if I’m using a pure Terminal Server, and I launch this Microsoft Terminal Server’s configuration tool, I’m only going to see an RDP-TCP connection. But what actually happens, though, is when I install Presentation Server, it’s going to add this ICA-TCP connection information in here. And, as I said, all this information is stored in the registry. Okay, so let’s take a look at these. And if I go to HKEY_LOCAL_MACHINE, SYSTEM, CurrentControlSet, Control, Terminal Server. And you see here I have this thing called WinStations. And under WinStations I have a hive for ICA-Tcp, and I have a hive for RDP-Tcp. And what you’ll see here is that these contain all of the settings of the actual connection itself. So really as I’m using these tools, and whether I use the Terminal Server connection configuration or whether I use the Citrix connection configuration, it doesn’t matter. When I make changes within these tools, it’s actually saving those changes into this location right here. Now what’s important, though, is that all users who are connecting to an environment are connecting over one of these connections. Every ICA user is going to connect over this connection. Every RDP user is going to connect over this connection. So if you change a setting, like you disable print driver map, or, pardon me, if you disable printing, or if you disable client drive mapping or something like that. If you disable a setting like that at this level, that is going to enforce that for all users regardless of active directory, regardless of policies, regardless of everything. Because the bottom line is, if you configure this connection so that it does not support printing, it doesn’t matter what your active directory policy says. It doesn’t matter what Citrix says. If it doesn’t support printing, it just flat out doesn’t support it. So what this means is, if we go back to our diagram here, and let me go ahead and clear out some of this ink. As I said, this connection is kind of listening at this level right here. So that connection we looked at called RDP-TCP, and then we’ve got the other one here that’s called ICA-TCP, these are where the WinStation driver is listening for incoming connections. So it listens for incoming connections, it receives the connections, it does an initial kind of handshake and that kind of stuff, and then it forwards them on to the Session Manager. And the Session Manager is brokering these connections back and forth via the specific connection within the Presentation Server or Terminal Server environment. But some of the key takeaways are this. And that is that, if you look at this diagram here, what’s important about this is that you notice here that the whole RDP Protocol component, as I mentioned, when you install Presentation Server, that RDP Protocol stuff stays intact. It doesn’t go anywhere. When you install Presentation Server, it gives another option to your users as far as how they can connect into sessions on that server. But it is not destroying or deleting anything Microsoft-oriented. The other thing I want to focus on here is this Presentation Server Middleware right here. When you install the Citrix Presentation Server product itself, it installs its own set of services and drivers and all sorts of things. And that’s what I kind of want to look at a little bit more in depth right now. So, with this diagram, we’re looking at very high level, and this Presentation Server Middleware right here was just a generic box. If we look at our next slide, look now we have the Presentation Server Middleware has been kind of expanded. We still see over here our Terminal Server service and our Session Manager and that kind of stuff. But notice now that Presentation Server Middleware is greatly expanded, and we’ve got a lot more detail in this slide. So this is something that I want to take a little bit more in-depth look at. So, the first thing I want to focus on is right here, this IMA Service. If the Terminal Server service is the lifeblood of a terminal server itself, and therefore the Session Manager for a Presentation Server, the IMA Service is the central nervous system for Presentation Server in your environment. The bottom line is that, when you install Citrix Presentation Server, it installs this windows service called the Citrix IMA Service, and that IMA Service is responsible for almost everything Citrix related. By the way, IMA stands for Independent Management Architecture. So let’s jump out of the presentation here and go back onto our server and take a look at that IMA Service. So I go back to my desktop here, and let’s take a look at some services here. Okay, so if I go here and take a look at the services that I have running here, you’ll see there’s quite a few services from Citrix. Now, Citrix does a pretty good job of naming most of their services with…so that they start with the word Citrix, but not quite all of them. So you’ll see a server is down here called Independent Management Architecture, and that is this Citrix IMA Service. Looking back at our diagram, as I said, this IMA Service is a regular Windows service. The IMA Service itself is a multi-threaded service. So it does lots and lots of things. So a lot of the things that Citrix does we focused on in other videos, like Citrix being, you know, copying print drivers, and acting as a data collector, and calculating load evaluators. These are all jobs that the IMA Service does. So as I said, the IMA Service is a multi-threaded service. You will notice that it does lots of different threads and lots of different jobs. The bottom line, though is, if you stop the IMA Service, then as far as Citrix Presentation Server farm is concerned, that server disappears. Now what’s interesting is, if you stop the service, your users don’t lose their connections. Like, if I go back to this previous slide, you see here that, remember that the users are connected in via the Session Manager account directly itself. So they’re connected through the protocol drivers to the Session Manager. If you stop the IMA Service, the user’s connections are not lost, it’s just that no new users will be able to connect. Because one of the things the IMA Service does is it talks to the IMA Service of other servers on the network. So, any time you have a Citrix Server farm and multiple Presentation Servers are talking to each other, it’s the IMA Service of one Presentation Server talking to the IMA Service of the other Presentation Server. By the way, that communication takes place on port 2512. So, when you have a Citrix Presentation Server farm, and you look at your network, you’re going to see lots of traffic going back and forth on port 2512. And that traffic is the IMA Services of the respective servers talking to each other, and exchanging load information and user information and all that kind of stuff that they need to exchange. I should also mention the IMA Service plays a big role when you’re using that Java Management Console. So if I right now went back into my server, when I am contacting, using this Citrix Management Console, and I’m doing things like looking at who’s connected to my servers and what sessions I have and all sorts of information like this, this is all being sorted out via that IMA Service. What happens is the Presentation Server console we have running, it’s going to communicate with the IMA Service also via port 2513. Now, in a lot of cases, you’re going to run this Presentation Server console on the same computer that you’re running Citrix on, so it’s going to communicate locally. But if you’re communicating across the wire, that’s port 2513. So, basically, 2512, 2513, these are IMA Service ports that are being used to communicate between different components of the backend Citrix architecture. There’s a couple other things I want to mention as far as looking at the architecture itself. Another thing is called the Citrix XML Service. And so, again, if we look back here at our services, and I’ll go back in there, go back to these Citrix Services. We have a service here called the Citrix XML Service. And so this is another service that Citrix installs. And what the Citrix XML Service is, is it’s essentially a translator. It translates IMA protocol information into XML information. And the reason for that is that, you know, the IMA protocol that’s used to communicate back and forth between the IMA Services and multiple servers, that’s sort of a binary encrypted protocol and something that’s Citrix proprietary and not really accessible. Well sometimes, though, you need to access information from the IMA service in a way that is more easily consumable. And that’s exact to where the Citrix XML Service comes in. So the Citrix XML Service does not really have any brains in it. All the brains and all the work is being done at this IMA Service. But what this Citrix XML Service is down here, this is a service that is used for translating IMA back and forth between IMA formatted data and XML formatted dated. So where is the Citrix XML Service used? It’s used in two primary locations. Number one, is if you’re using a Citrix web interface. Well, the Citrix web interface of course, is a web server that provides access to applications and users via the web. So what happens is your web interface needs to contact backend Citrix Presentation Servers. So a user logs in to a web interface, and then the web interface, number one, has to authenticate that user, and number two, has to provide a list of applications that that user is allowed to see. So the way it works is, the web interface server sends data via this XML format to your backend Presentation Server. The Presentation Server is actually having the XML Service receive that data, translate it into sort of raw IMA format data, and interact between XML and the local IMA Service. Then when this Presentation Server back here needs to provide information back to the web interface, it provides it via this XML Service that again translates the raw IMA data back here into XML formatted data that is something that the web service can easily consume. Another use of where we see that XML Service used is for our clients. So, if you have a Citrix program neighborhood client, and you type in the location of a server, and it asks for how you’re connecting to that server and you tell it, you know, you give it, perhaps, the IP address. Well, when you provide that server location information via an IP address, the program neighborhood client software communicates via XML protocol with the backend Presentation Server. So again, it’s this XML Service running on the Presentation Server that is receiving all of the information from the actual program neighborhood client. And the XML Service communicates back and forth with the IMA Service on that Presentation Server. Another service that I want to look at is the Citrix XTE Service. And the XTE Service is interesting, because the XTE Service is used for something that Citrix calls session reliability. And so session reliability is, this is a marketing term from Citrix. But what session reliability is, is it’s a set of technologies that allow your clients to stay connected to a Presentation Server, even if you have a momentary loss of the network. So the idea is if… Remember the way Citrix Presentation Server used to work? If you lost the network, like you were using a wireless connection and the connection dropped for a second, or you went on an elevator or whatever? If this happened, then the autoclient reconnect would happen. Which is okay, but it was kind of hard to use for the user, this autoclient reconnect. And the problem was that it would have to reauthenticate the user and go through all that, all steps and all that rigmarole and everything like that. Well, what’s cool is that session reliability has built this sort of connection and reliability component into the protocol itself. So what happens, of course, remember that most users that connect, traditional Citrix users are connecting via port 1494. And 1494 is the ICA protocol port. What happened is Citrix developed a new protocol. So, in order to facility the session reliability, Citrix developed a new protocol called the Citrix Gateway Protocol, or CGP. And this Citrix Gateway Protocol is a wrapper protocol that wraps around ICA. So basically, you have your existing ICA traffic, and that’s what this diagram is trying to show right here. You have your existing ICA traffic that ordinarily would be put between a server and the client. Well the CGP is a wrapper that wraps around that traffic. And because it’s a wrapper, because it’s its own protocol, it needed to run on its own port. So what happens is, the CGP port that Citrix uses is 2598. So another way of saying that, is that when you have session reliability enabled on a Citrix Presentation Server environment, your users are connecting via ICA. They’re connecting via port 2598, not port 1494. Now, session reliability was introduced in PS 3 and also with the ICA Client’s Version 8. So, I should mention, it’s enabled by default. So if you have users with the ICA Client Version 8, and they’re connecting to your Presentation Server environment, they’re going to connect on port 2598. They’re not going to connect on port 1494. Of course, if for some reason session reliability has been disabled, then the users are going to connect on port 1494. So the bottom line now is that, basically, Citrix ICA can use essentially two ports. It can use pure ICA on port 1494, or it can use ICA wrapped in CGP on port 2598. So the point with all this CGP stuff is that there’s a service running on your Presentation Server called the Citrix XTE Service. And again, if I jump back on that server, you’ll see, here it is, it’s the Citrix XTE Server. It’s right there. Well, that Citrix XTE Server service is the service that is responsible for receiving the 2598 traffic, peeling off the CGP layer, and then taking the inside traffic and putting it through the Citrix connection and then in through the Session Manager. So really, you could…a way that you could sort of visualize this is that the XTE Server…Service is listening on port 2598. The Citrix Protocol, Citrix connection, is listening on port 1494. At the end of the day, they’re all going to come in through that same connection. So it’s basically, are they getting there being routed through the XTE Service, or are they getting there via connecting directly through the Citrix ICA connection. We’ll talk more about the session reliability in future videos as we start to look at performance and things like that. But the bottom line, though, is that right now you’ve got two ports that can go out from Citrix from a user standpoint, not just one. From the port standpoint, I guess there’s just a couple more things that I want to mention. There is still a use for you to keep port 1604. This is a port that was used in the older days, before IMA was around. And this is the port that Citrix used to enumerate applications and share load information and things like that. So you will still see that some servers are listening on port 1604. It kind of depends on the settings you have in your farm and your data collector settings and things like that. But if you see any port 1604 traffic, UDP traffic, that’s kind of some legacy compatibility traffic that Citrix still has that’s listening for older clients that might be connecting and enumerating applications in that way Okay, so we’ve now seen how Presentation Server relates to Terminal Server. We’ve seen some of the basic services that Presentation Server uses. I want to jump back on my Presentation Server and look at some of these other services that are here. You see we have here, there’s the Citrix CPU Utilization Management. We also have the Citrix Virtual Memory Optimization. Well these are those functions that we get with the Enterprise version of Citrix, where it offers the fair share CPU sharing technology and the virtual memory optimization technology. Well, these are the things that have their own services for that. So that’s what these services are. We have the Print Manager Service. This Print Manager Service is the service that is responsible for handling printing in Presentation Server version 4. I’m not going to go into that because a friend of mine, Sean Bass, has recorded a Citrix technology video that details the printing in PS 4. So there’s no need to go into that now, but I just wanted to mention that’s what that service is. We also have the Citrix SMA Service. This is the service that’s responsible for, they call it Suite Monitoring and Alerting. And this is what watches for the alerts and metrics and puts the alerts into the access suite console for you. Again, we’ll have future videos that talk about the access suite console more in detail. And then, of course, we have the WMI Service. And this is just the WMI provider that Citrix has. Again, a feature of the Enterprise edition of Presentation Server and something that provides the interface between WMI and the IMA Service. So, again, you can think of WMI Service kind of like the XML Service, where WMI Service is providing a WMI-based interface, whereas XML Service is providing an XML-based interface. So, one more thing I kind of want to mention sort of architecturally. We talked about the architecture of the server itself and the different services that are running. I want to draw up here something real quick and talk about something called virtual channels and just make sure that everyone is familiar with what these are. If I draw a Citrix Presentation Server and then I draw an ICA client. Okay, so of course these two devices are talking to each other via the ICA protocol. And what’s interesting about the ICA protocol is that the ICA protocol itself is just…it’s like an empty highway. The ICA protocol does not actually transmit any data, per se. What happens is the ICA protocol provides a conduit through which different lanes of data and different communication channels can be opened. And Citrix calls these virtual channels. So what happens is the ICA protocol, if you were to somehow crack it open and look at it, you’ll see is composed of all these virtual channels. And Citrix has virtual channels for just about everything. So there’s a virtual channel that is called thin wire. The thin wire virtual channel is the virtual channel that’s used for the primary screen updates that go back and forth between the (inaudible) server. Now, there’s also a virtual channel for things like, well, let’s say, clip board synchronization. And we have audio. We have server to client audio redirection and client to server microphone redirection. We have a virtual channel for printing. We have a virtual channel for com port mapping. A virtual channel for parallel port mapping. We have a virtual channel for the ICA autoclient updates. We have the capability for third party vendors to be able to add their own virtual channels. So if you use a third party product, like a printing product, or a management product like that, they’re going to add their own virtual channels. So what’s interesting here to show is that these virtual channels you have within ICA, there’s many, many, many virtual channels. And the reason I want to mention those virtual channels is a couple fold. Number one is that the virtual channels are negotiated at the time of the connection, when the ICA client connects to the Presentation Server. So if one particular client cannot support sound, then the sound virtual channel is just not built for that particular session. But if other clients on that same server can support sound, then they will get that. So what happens is, if you have 50 different users on one server, you might have 50 different sets of virtual channels, depending on what the clients can support and what the policies support, and everything like that. The second important thing to mention about virtual channels is that the various virtual channels have priorities. And this priorities specify who gets precedence in a situation when you have contention for data across the wire. So as you can imagine, the thin wire virtual channel has the highest priority. There’s actually four different priority levels you can set. The thin wire virtual channel has the very highest priority because, if it comes down to getting traffic across the wire, it’s either thin wire, or let’s say it’s some printing data, you probably want your screen response to happen faster than the actual printout to be able to get down to the client. So these virtual channel priorities, you can tweak these in the registry. Now these are system-wide, but you can actually tweak the priorities of the virtual channels in the registry. So if you have a custom environment where you have some custom virtual channel for this, maybe a GPS receiver, and it’s got to be updated live or whatever, then you can change the virtual channel priorities to give your certain virtual channels priorities over others. As a matter of fact, Citrix has a cool little utility that I want to show you now. Let me go back to the server. And on the server I have downloaded, I’ve gone to Citrix’s web site, citrix.com/cdn, which is the Citrix Developer Network, and I’ve downloaded the SDK for MetaFrame Presentation Server. And there’s a sample application in this MetaFrame Presentation Server SDK called the SMCConsole. And this sample application is really cool because it actually shows you, you can select your ICA session from the list, and it actually shows you how much bandwidth is being used and all the different virtual channels. And then you can use this little utility to change the priority of virtual channels and to enable or disable certain virtual channels, and kind of see how much bandwidth each channel is taking. Now this utility, this is just a sample application that’s got a source code and everything, because it’s really meant for people who download the SDK who want to write their own virtual channel manipulation software. But this is a kind of cool utility. Even if you’re not a developer, it’s kind of cool to sort of play with this little thing, and view the different virtual channels, and see what happens if you change priority, and see what happens if you disable virtual channels, and which sessions are taking which virtual channels. From an architecture standpoint, the Microsoft RDP protocol also uses virtual channels. So conceptually, this ICA virtual channels are very similar to the Microsoft RDP virtual channels. But the key takeaways for these virtual channels are that A). The ICA protocol is comprised of many, many virtual channels; it’s not just one big thick bucket, B). Different sessions in the same server can have different virtual channels enabled or disabled based on the situation, and C). It is possible to limit the bandwidth of certain virtual channels. And one final note, I’ll show you real quick, is if we go back into our Presentation Server and take a look at, for example, our policies. And I go and look at a policy here, and let’s just right click and go to properties of the policy. Within the bandwidth tab, I have the ability to specify various session limits, audio session limits, and com ports, and drives, and things like that. All I’m doing when I specify these limits here, I’m just specifying the limit of that particular virtual channel. Of course this is only going to apply to wherever this policy is applied, be it a server or a user or what have you. And, by the way, if you’re not that familiar with policies, I did record another Citrix technology video that goes into the details of policies, so you can see that. But that’s what this is doing. When you are limiting these various technologies within a session, you’re just affecting the virtual channels. So with that, I think that about wraps it up, what I wanted to talk about in this video. Now I hope after watching this you have a better understanding of how Presentation Server sits side-by-side with Citrix, how connections work, how the registry is used, what the various services do, and how the ICA protocol virtual channels work. Again, my name is Brian Madden. And thank you so much for listening today.

anonymous - <P>This is a fantastic video. Thank you for explaining these basic concepts so clear. I hope I can see more videos like this one.</P> <P>JP</P>

anonymous - <P>David</P> <P>That was excellent video keep up the good work!!</P> <P>Ronak Nathwani</P> <P><A href="http://www.iscentral.co.uk">www.iscentral.co.uk</A></P> <P> </P>

anonymous - Great Video...with nice explanation of basics

anonymous - <P>nice video for those who have less interest in reading the PDF's :)</P>

sreerenj - <P>David,</P> <P>Brilliant ! Nice explanation..... Very good for a beginner..</P> <P>Sreerenj</P>

anonymous - <P>Terrific Video!  Precise and very informative especially for a beginner like me. Hope to see more videos like this in the future. </P> <P>DMalone59</P>

anonymous - <P>PEOPLE,</P> <P>open eyes to CITRIX.....totally awesome.....i m sure a lot experienced guys also not know all which is said here....</P>

abdelli.s - Great presentation<br>

anonymous - <P>Great job Brian!! Thank you for this!!</P>

anonymous - It is wonderful presentation. It gives me good understanding about Citrix Presentation Server.Thanks a lot.

Log In