 Hello and welcome to the next lecture in the course on Introduction to Computer and Network Performance Analysis using queuing systems. I am Professor Varshaapte and I am a faculty member in the Department of Computer Science and Engineering IIT Bombay. So we will continue from the previous lecture where we were sort of defining closed Jackson queuing networks. We had also learnt Sevchik Mitrani theorem, Sevchik Mitrani arrival theorem. Please go back and revise that if you do not remember because we will be using that in this lecture and using this we can derive a very beautiful method called mean value analysis for finding all the metrics of the closed Jackson queuing networks. So let us get started. Just to remind these are the parameters. Again this is just for your reference I will not go over everything. I will just remind everybody of V i which is the relative visit count. Again please go back and refer to the previous lecture to recall what a relative visit count is and we have the service demand as usual. For both open and queuing networks it is defined in the same way and rest of the parameters are as before. Now let us go over a little slowly on the metrics that the mean value analysis is going to derive. So remember that in closed queuing networks each of the metrics are defined for a low level M. This is of course similar to all of these metrics in open queuing networks. In open everything is a function of lambda the arrival rate. So we do not write the metrics with the lambda parameter in the parenthesis like we are writing here. There is a reason for that but all the open queuing network and open queuing system metrics are functions of all the parameters including lambda. And here also it is the same thing of course it is a function of all these parameters but we particularly express the metrics in the terms of this load parameter M and you will see why. So N i M is the average number of customers at node i at load level M. Lambda i M is the throughput at node i everything here is at load level M meaning the number of remember load level is something we say for this number of clients or request this is also called load level because of course when M increases load increases. So it is like a level of the load so that is why we call it often the load level. So response time at each node the system throughput the throughput along the branch that represents completion of a request this is important because in closed queuing networks there is not an obvious exit there is not an exit out of the system. So we have to pick a branch in this case it is this branch which we say is represents the system throughput in this case we say that this is the branch that represents system throughput and based on that it is basically just this throughput across this branch will be the lambda sis. Then we have system response time which is the response time through the whole network and then we have cycle time in the case of which is this is basically equal to system response time if no client node. And in case of think time also basically this is 0 if no client node basically this parameter is not relevant if of explicit client node is not being modeled. So another thing I would like to point out is that the lambda sis and the R sis and therefore of course the R cycle. These are metrics that are actually dependent on which branch or which arc in this queuing network graph that you selected as your system throughput arc. So this is you lambda sis if for some bizarre reason you should never do that there is no reason to do that. But if you say that this represents completion if this is completion if this arc represents completion then your lambda sis will change. So usually we do not do such non-intuitive things the branch that represents completion in a closed queuing network is dependent on the model itself what is the model that you were original model that you are modeling based on that system the branch that represents the completion will be kind of obvious and that is what represents this lambda sis that is what the lambda sis and R sis is dependent on. All the other ones the N i the especially the number of average number of customers at node i and also utilization is not written here because it is not a part of mean value analysis but utilization is a parameter. So this is also independent of the branch chosen for request completion. So let us get started with mean value analysis. So what is it? It is a method to find all the metrics without having to derive probability distribution. Of course when I say all the metrics we only find averages or means that is the whole point we are doing mean value analysis. But the point is that we can work only with the means that makes the entire algorithm a little bit intuitive and more importantly it makes it efficient and we never have to derive for example we never have to derive this. So the probability that the number of customers at node i when the load level is M this is never required. In fact N i M you know we do not go through this at all and N i just denotes averages. It does not denote the random variable it just denotes the average. So we do not go through the random variable and probability distribution and so on we can directly work in means. So this is important because the other there is a method which uses distributions and this is very computationally costly. Sceptic Mitrani theorem is extremely critical in deriving mean value analysis and this is the heart remember the heart of the Sceptic Mitrani theorem is that this will also apply for average. The average number of customers at a node i seen by an arrival when the load level in the queuing network is M is the same as the unconditional average at that same node when the load level is 1 less. So it is kind of should be very intuitive at this point of time that this relationship is suggesting a basically a recursive method to find to get your matrix. When something at load level M can be expressed as some other metric at load level M minus 1 one hopes that this can continue and maybe we can get something at we can find what ni 0 is. So ni 0 of course is just going to be 0 for all i we will know this and maybe we will be able to based on this be able to go back step by step from maybe from ni 0 I can get ni 1 can get then ni 1 I can get ni 2 and if I go this way I should be able to get this metric at any load level and from this metric hopefully I can get all the other metrics. So let us start. So let us first start clearly the base case is actually quite easy the ni 0 when there is nothing in the network the average number of customers at each node is also going to be 0. So this is just the base case. So let us now assume that we know ni M minus 1 for all i that means I know the average number of requests at stations i station all stations i when total number of requests in the queuing network is M minus 1. Where can I go from here? Let us remember Sevchik Mitrani theorem and this gives us a major hint to be able to write ri at M. What is this? This is the average response time at node i when load level is M. So to reason through this it is a standard old reasoning we can do. So suppose there were 3 customers here in the queue sorry. So I am showing 4 here in the queue and 1 in the server. So there are 5 customers in the system here and now a request arrives. Suppose M is equal to 10 the request arrives. The point is I am giving an example of 4 plus 1 but if we have to do the calculation we have to figure out what is the average here? What is this request going to see? What will the arriving request see? If we know what it sees here then we know that each of this request takes tau 1 amount of time average time is tau 1. We know that the service time here is exponential. So that implies that remaining time is also equal to tau 1 here. So if we know that the average that I expected here is 4 in the queue and 1 in the system then I can simply say that the response time of the arriving request is going to be 5 multiplied by tau 1 for those that are already in the system plus its own tau 1 plus its own request. So because it will come and queue at the end here it will come and queue here and that will be the 6th request. So this is very intuitive. So RIM we can simply write as first thing we will say that it is going to be whatever it sees at arrival what it sees at this load level plus itself multiplied by tau i. These are all the customers in the system given that the remaining service time has the same mean as the overall service time I have to just take all the customers in the system and multiply it by tau i to get its waiting time and then add its own service time. So what is this going to be n i a m tau i plus tau i this is going to be the waiting time and this is going to be the service. Now here is where Sevchik Mitrani theorem magically helps us. We can simply replace this n i n a i m by n i m minus 1 plus 1 multiplied by tau i. So I had said that we have to assume we know this. So if we know this I have RIM for every single station. There is one special case here that at the client node actually none of this matters R CM is going to remain H for all m because there is no queuing here it is just think time. It is just think time once the request enters the user s mind the user is going to think the same amount of time and there is no queuing at the user because we do not expect that the user is going to issue multiple requests before waiting for the response. So all those things are not there we have only one request that the user has issued, user will wait for the response and once the response comes user will think. So there is no queuing this always remains H. But for the other nodes where there is queuing and remember you also have the FCFS assumption first come first serve. So this is basically the formula for response time when the discipline is FCFS. So this is awesome from n i minus 1 I went to some metric at RIM. I still have to go remember that to finish the recursion I will have to go from here to n i m I need to get to n i m only then the recursion is complete. So this is simply repeating that for your reference later whatever we derived RIM is equal to 1 plus n i m minus 1 multiplied by tau i and RCM is going to be just be think time for all load levels. Now we have RIM for all i and m sorry for all i and we need to find the other metrics. So from RIM remember that I have my VI's which are relative visit counts. I can find my R cycle time at load level m as a simple summation of summation i equal to 1 to n if there are n stations in the network it will be i equal to 1 to n VI RIM. So remember I have RC I have R1 I have R2 I have everything here let us say this is i equal to 1 this is sorry this is i equal to we can also go from 0 to 2 in this case. So this will be i equal to 0 this is 1 and 2 but if we are numbering the stations as 1 to n then we will go like this. Essentially this has to be the summation over all the stations all stations including client node. So now I have the R cycle time of the whole network. Now remember that just like in the closed queuing system with single server we had defined a very interesting little slur region we will define a same kind of little slur region here. Remember that this is our system throughput arc. So we will define the little slur region like this. So this the request is exiting and entering instantaneously the flow through this is lambda sis and the time from this entering to doing all of this cycle here and then exiting here is R sis R cycle. And if this is the little slur region we know that inside the region there is a fixed number of M requests that is never going to change because it is a closed queuing network. So I can apply little slur and I can say M is equal to R cycle M multiplied by lambda sis M. So from here now the metric that I get is lambda sis M is equal to M by R cycle M. So we got system throughput. Now let us see what we can get. This is again just reinforcing that you get you apply little slur to that region. Again I will just draw the region here again. This is the region through which you apply little slur and you get lambda sis M is equal to M divided by R cycle M. So we started from N i M minus 1 we got R i M at all the nodes we got R cycle M and of course we get R sis M also. If the system time is going to be different from the cycle time you just have to leave out the think time and R sis M is going to be just the summation of the visit counts and the per visit response times for all the nodes except the think node. So you can always once you have R cycle time you can find R sis M as R cycle M minus H. If H is 0 then the 2 are going to be the same otherwise you will actually get the system response time and this is just summarizing what we just talked about. Now what do we have? Again recall we started from N i minus M minus 1 we got R i M we got R i M we got from R i M we got R cycle M we got R sis M and we got lambda sis M the whole throughput this one. Now what is the next thing that we can get? Remember that the node throughput this was something we had done in open queuing network also this still applies the node throughput lambda i M is going to be nothing but the number of visits to that node multiplied by the system throughput. So suppose that the way this circulation multiple visits to server 1 and server 2 happens for this network is such that there are 3 visits to this web server and 2 visits to the let us say this is a database server. So if the system throughput right now is 100 requests per second suppose that 100 requests per second it is sort of intuitive that to finish this 100 requests per second here we are going to have to do 300 requests per second here because each visit each request creates 3 visits here each request creates 3 visits here and 2 visits here. So this is going to be 200 requests per second and this is going to be 300 requests per second. So it is just because the overall output here is 100 you need to be able to do 300 requests here that is what you must be doing because each of these requests visited 3 times here and 2 times here. So this is very straightforward vi multiplied by lambda sis M for all i equal to 1 2 n. Once you have the node throughput now it is very interesting. Now you can now what you have here is you have this lambda 1 and you have the lambda 2. And now again Little's law can just see here how beautifully so many laws are coming to our rescue right. We started with Sceptic Mitrani theorem to actually apply the recursion and then Little's law we are applying either to the whole region or now we can apply Little's law to just the nodes. If we apply Little's law to the nodes Little's law to each node i what do you get throughput through the system is lambda 2. So n i M is going to be equal to I have lambda M and remember previously itself I got R i M and lo and behold we have n i M we started with n i minus 1 and we did all of the steps and we have n i M that means the recursion is complete right. So step by step we use all the tricks that we know to use there is nothing new other than Sceptic Mitrani there is no other law that we use we actually just keep using Little's law and just some common sense and that is how we start from n i minus 1 and get n i M. So this is again just repeating what I said earlier the node throughput is visit count multiplied by system throughput then we apply Little's law at the node level and then the recursion is complete except again we simply just have to state the base case properly n i 0 is going to be 0 for all i and then we start from this and then go to basically we will get R i with just one customer we will get with the n i 0 it will be equal to n i 0 plus 1 tau i and as expected n i 0 is 0 so you should get tau i right. So with one customer in the system all the response times are simply going to be equal to the service times and that is what the recursion tells you also okay. So at a glance this is just repeating that n i equal to 0 n i 0 equal to 0 is the base case then we have to know assume that n i M minus 1 is known we get the node response times using this part is the one that uses Sevchik Mitrani theorem okay to be just be able to substitute n i minus n i M minus 1 and that is the beauty here and that is what we are getting from Sevchik Mitrani theorem of course R i M is equal to H for anything that is a client node we get cycle time by just common sense that you know we have to multiply by the visits and that is you get the cycle time that way. Here this is little slaw to the whole region this is again common sense if system throughput is lambda says you just have to multiply it by v i is to get the node throughput and this part is little slaw single node. So again recursion is complete and we started with n i M minus 1 and derived n i M and we have a base case okay. So this actually completes the theory of closed queuing networks that we are going to look at and the next lecture will be some examples of this mean value analysis and we will actually also make some closing remarks for the course in the next lecture because it will be the last lecture of this course. So thank you and