Consider now a situation in which a user is required to authenticate itself to the database server before a transaction is executed. Authentication protocols may use some form of cryptography, which is compute-intensive . Thus, the service demand of a database transaction at the CPU varies significantly depending on whether the transaction is in the authentication phase or in the database access phase. Figure 2.12 illustrates the various phases of a transaction. When the service demands in each phase vary widely, one can use a modeling technique called class switching. Section 2.4 introduced the notion of multiple classes in a QN model; different classes can be used to model customers with very different service demands. In this case, a customer of the QN belongs to a single class. In class switching, a customer may switch from one class to another when moving between queues.
Figure 2.12. States of a database transaction.
In the multiple class case, service demands are associated with a class and a queue. In addition, however, class switching probabilities, pi,r;j,s, are used to indicated the probability that a class r customer switches to class s when moving from queue i to queue j. Class switching is used in  to analyze the performance of Kerberos-based authentication protocols.